rpms/firefox/FC-5 firefox-1.5-bullet-bill.patch, NONE, 1.1 firefox-1.5-download-dir.patch, NONE, 1.1 firefox-1.5-pango-printing.patch, NONE, 1.1 firefox-1.5-theme-change.patch, NONE, 1.1
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Tue Nov 7 20:26:20 UTC 2006
Author: caillon
Update of /cvs/dist/rpms/firefox/FC-5
In directory cvs.devel.redhat.com:/tmp/cvs-serv29918
Added Files:
firefox-1.5-bullet-bill.patch firefox-1.5-download-dir.patch
firefox-1.5-pango-printing.patch
firefox-1.5-theme-change.patch
Log Message:
* Tue Nov 7 2006 Christopher Aillon <caillon at redhat.com> - 1.5.0.8-1
- Update to 1.5.0.8
- Fix up a few items in the download manager
- Use the bullet character for password fields.
- Add pango printing patch from Behdad.
firefox-1.5-bullet-bill.patch:
nsTextEditRules.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
--- NEW FILE firefox-1.5-bullet-bill.patch ---
Index: mozilla/editor/libeditor/text/nsTextEditRules.cpp
===================================================================
RCS file: /cvsroot/mozilla/editor/libeditor/text/nsTextEditRules.cpp,v
retrieving revision 1.195
diff -d -u -p -r1.195 nsTextEditRules.cpp
--- mozilla/editor/libeditor/text/nsTextEditRules.cpp 16 Jun 2005 13:10:56 -0000 1.195
+++ mozilla/editor/libeditor/text/nsTextEditRules.cpp 4 Oct 2006 16:02:19 -0000
@@ -1390,13 +1390,13 @@ nsTextEditRules::EchoInsertionToPWBuff(P
// manage the password buffer
mPasswordText.Insert(*aOutString, aStart);
- // change the output to '*' only
+ // change the output to 'U+2022' only
PRInt32 length = aOutString->Length();
PRInt32 i;
aOutString->Truncate();
for (i=0; i<length; i++)
{
- aOutString->Append(PRUnichar('*'));
+ aOutString->Append(PRUnichar(0x2022));
}
return NS_OK;
firefox-1.5-download-dir.patch:
browser/components/preferences/downloads.js | 20 +++++++++++---------
toolkit/mozapps/downloads/content/downloads.js | 20 +++++++++++---------
2 files changed, 22 insertions(+), 18 deletions(-)
--- NEW FILE firefox-1.5-download-dir.patch ---
Index: browser/components/preferences/downloads.js
===================================================================
RCS file: /cvsroot/mozilla/browser/components/preferences/downloads.js,v
retrieving revision 1.7
diff -u -p -6 -r1.7 downloads.js
--- browser/components/preferences/downloads.js 13 Sep 2005 18:39:25 -0000 1.7
+++ browser/components/preferences/downloads.js 1 Feb 2006 15:58:23 -0000
@@ -91,25 +91,27 @@ var gDownloadsPane = {
var customDirPref = document.getElementById("browser.download.dir");
return customDirPref.value;
},
_getSpecialFolderKey: function (aFolderType)
{
+ if (aFolderType == "Desktop")
+ return "Desk";
+
+ if (aFolderType != "Downloads")
+ throw "ASSERTION FAILED: folder type should be 'Desktop' or 'Downloads'";
+
#ifdef XP_WIN
- return aFolderType == "Desktop" ? "DeskP" : "Pers";
-#endif
+ return "Pers";
+#else
#ifdef XP_MACOSX
- return aFolderType == "Desktop" ? "UsrDsk" : "UsrDocs";
-#endif
-#ifdef XP_OS2
- return aFolderType == "Desktop" ? "Desk" : "Home";
+ return "UsrDocs";
+#else
+ return "Home";
#endif
-#ifdef XP_BEOS
- return aFolderType == "Desktop" ? "Desk" : "Home";
#endif
- return "Home";
},
_getDownloadsFolder: function (aFolder)
{
var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
Index: toolkit/mozapps/downloads/content/downloads.js
===================================================================
RCS file: /cvsroot/mozilla/toolkit/mozapps/downloads/content/downloads.js,v
retrieving revision 1.53
diff -u -p -6 -r1.53 downloads.js
--- toolkit/mozapps/downloads/content/downloads.js 9 Jan 2006 20:36:45 -0000 1.53
+++ toolkit/mozapps/downloads/content/downloads.js 1 Feb 2006 15:59:07 -0000
@@ -775,25 +775,27 @@ function initAutoDownloadDisplay()
autodownloadInfo.hidden = false;
var autodownloadSpring = document.getElementById("autodownloadSpring");
autodownloadSpring.hidden = true;
function getSpecialFolderKey(aFolderType)
{
+ if (aFolderType == "Desktop")
+ return "Desk";
+
+ if (aFolderType != "Downloads")
+ throw "ASSERTION FAILED: folder type should be 'Desktop' or 'Downloads'";
+
#ifdef XP_WIN
- return aFolderType == "Desktop" ? "DeskP" : "Pers";
-#endif
+ return "Pers";
+#else
#ifdef XP_MACOSX
- return aFolderType == "Desktop" ? "UsrDsk" : "UsrDocs";
-#endif
-#ifdef XP_OS2
- return aFolderType == "Desktop" ? "Desk" : "Home";
+ return "UsrDocs";
+#else
+ return "Home";
#endif
-#ifdef XP_BEOS
- return aFolderType == "Desktop" ? "Desk" : "Home";
#endif
- return "Home";
}
function getDownloadsFolder(aFolder)
{
var fileLocator = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
firefox-1.5-pango-printing.patch:
config/system-headers | 2
gfx/src/freetype/nsFreeType.cpp | 18
gfx/src/freetype/nsFreeType.h | 7
gfx/src/ps/Makefile.in | 11
gfx/src/ps/mozilla-ps-decoder.cpp | 376 ++++++
gfx/src/ps/mozilla-ps-decoder.h | 72 +
gfx/src/ps/nsDeviceContextPS.cpp | 56
gfx/src/ps/nsFontMetricsPS.cpp | 303 ++++-
gfx/src/ps/nsFontMetricsPS.h | 68 +
gfx/src/ps/nsFontMetricsPSPango.cpp | 2107 ++++++++++++++++++++++++++++++++++++
gfx/src/ps/nsFontMetricsPSPango.h | 305 +++++
gfx/src/ps/nsPostScriptObj.cpp | 91 +
gfx/src/ps/nsPostScriptObj.h | 32
gfx/src/ps/nsRenderingContextPS.cpp | 206 ---
gfx/src/ps/nsRenderingContextPS.h | 11
gfx/src/ps/nsType1.cpp | 261 +++-
gfx/src/ps/nsType1.h | 3
17 files changed, 3611 insertions(+), 318 deletions(-)
--- NEW FILE firefox-1.5-pango-printing.patch ---
Patch for Firefox 1.5.0.7 to add support for printing via Pango.
This also implements printing MathML via Pango, and prints bitmap
fonts too.
Authors:
Behdad Esfahbod
Chris Blizzard
Akira TAGOH
Index: gfx/src/freetype/nsFreeType.cpp
===================================================================
RCS file: /cvsroot/mozilla/gfx/src/freetype/nsFreeType.cpp,v
retrieving revision 1.28
diff -u -p -d -r1.28 nsFreeType.cpp
--- gfx/src/freetype/nsFreeType.cpp 13 Jul 2005 18:21:10 -0000 1.28
+++ gfx/src/freetype/nsFreeType.cpp 23 Oct 2006 17:37:09 -0000
@@ -123,6 +123,8 @@ FtFuncList nsFreeType2::FtFuncs [] = {
// #endif
{"FT_Get_First_Char", NS_FT2_OFFSET(nsFT_Get_First_Char), PR_FALSE},
{"FT_Get_Next_Char", NS_FT2_OFFSET(nsFT_Get_Next_Char), PR_FALSE},
+ {"FT_Has_PS_Glyph_Names", NS_FT2_OFFSET(nsFT_Has_PS_Glyph_Names), PR_FALSE},
+ {"FT_Get_Glyph_Name", NS_FT2_OFFSET(nsFT_Get_Glyph_Name), PR_TRUE},
{nsnull, 0, 0}
};
@@ -388,6 +390,22 @@ nsFreeType2::GetNextChar(FT_Face face, F
}
NS_IMETHODIMP
+nsFreeType2::HasPSGlyphNames(FT_Face face, FT_Int *result)
+{
+ // call the FreeType2 function via the function pointer
+ *result = nsFT_Has_PS_Glyph_Names(face);
+ return NS_OK;
+}
+
+NS_IMETHODIMP
+nsFreeType2::GetGlyphName(FT_Face face, FT_UInt glyph_index, FT_Pointer buffer, FT_UInt buffer_max)
+{
+ // call the FreeType2 function via the function pointer
+ FT_Error error = nsFT_Get_Glyph_Name(face, glyph_index, buffer, buffer_max);
+ return error ? NS_ERROR_FAILURE : NS_OK;
+}
+
+NS_IMETHODIMP
nsFreeType2::SupportsExtFunc(PRBool *res)
{
*res = gHasExtFunc;
Index: gfx/src/freetype/nsFreeType.h
===================================================================
RCS file: /cvsroot/mozilla/gfx/src/freetype/nsFreeType.h,v
retrieving revision 1.18
diff -u -p -d -r1.18 nsFreeType.h
--- gfx/src/freetype/nsFreeType.h 1 May 2005 17:36:19 -0000 1.18
+++ gfx/src/freetype/nsFreeType.h 23 Oct 2006 17:37:09 -0000
@@ -52,6 +52,7 @@
#include FT_CACHE_H
#include FT_CACHE_IMAGE_H
#include FT_TRUETYPE_TABLES_H
+#include FT_TYPE1_TABLES_H
#include "nsIFreeType2.h"
typedef struct FT_FaceRec_* FT_Face;
@@ -138,6 +139,8 @@ typedef FT_Error (*FT_Glyph_To_Bitmap_t)
typedef FT_ULong (*FT_Get_First_Char_t)(FT_Face, FT_UInt*);
typedef FT_ULong (*FT_Get_Next_Char_t)(FT_Face, FT_ULong, FT_UInt*);
+typedef FT_Int (*FT_Has_PS_Glyph_Names_t)(FT_Face);
+typedef FT_Error (*FT_Get_Glyph_Name_t)(FT_Face, FT_UInt, FT_Pointer, FT_UInt);
class nsFreeTypeFace;
@@ -193,11 +196,13 @@ protected:
// #endif
FT_Get_First_Char_t nsFT_Get_First_Char;
FT_Get_Next_Char_t nsFT_Get_Next_Char;
+ FT_Has_PS_Glyph_Names_t nsFT_Has_PS_Glyph_Names;
+ FT_Get_Glyph_Name_t nsFT_Get_Glyph_Name;
// this array needs to be big enough to hold all the function pointers
// plus one extra for the null at the end
// #ifdef MOZ_SVG
- static FtFuncList FtFuncs[24];
+ static FtFuncList FtFuncs[28];
// #else
// static FtFuncList FtFuncs[20];
// #endif
Index: gfx/src/ps/Makefile.in
===================================================================
RCS file: /cvsroot/mozilla/gfx/src/ps/Makefile.in,v
retrieving revision 1.57
diff -u -p -d -r1.57 Makefile.in
--- gfx/src/ps/Makefile.in 4 Mar 2005 07:39:27 -0000 1.57
+++ gfx/src/ps/Makefile.in 23 Oct 2006 17:37:10 -0000
@@ -98,13 +98,22 @@ EXTRA_DSO_LDOPTS = \
$(MOZ_UNICHARUTIL_LIBS) \
$(NULL)
+ifdef MOZ_ENABLE_PANGO
+CPPSRCS += \
+ nsFontMetricsPSPango.cpp \
+ mozilla-ps-decoder.cpp
+EXTRA_DSO_LDOPTS += $(MOZ_PANGO_LIBS)
+CXXFLAGS += $(MOZ_PANGO_CFLAGS)
+CFLAGS += $(MOZ_PANGO_CFLAGS)
+endif
+
ifdef MOZ_ENABLE_XFT
EXTRA_DSO_LDOPTS += \
$(MOZ_XFT_LIBS) \
$(NULL)
endif
-ifneq (,$(MOZ_ENABLE_FREETYPE2)$(MOZ_ENABLE_XFT))
+ifneq (,$(MOZ_ENABLE_FREETYPE2)$(MOZ_ENABLE_XFT)$(MOZ_ENABLE_PANGO))
CPPSRCS += \
nsType1.cpp \
$(NULL)
Index: gfx/src/ps/mozilla-ps-decoder.cpp
===================================================================
RCS file: gfx/src/ps/mozilla-ps-decoder.cpp
diff -N gfx/src/ps/mozilla-ps-decoder.cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ gfx/src/ps/mozilla-ps-decoder.cpp 23 Oct 2006 17:37:10 -0000
@@ -0,0 +1,376 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is mozilla.org code.
+ *
+ * The Initial Developer of the Original Code is Christopher Blizzard
+ * <blizzard at mozilla.org>. Portions created by the Initial Developer
+ * are Copyright (C) 2004 the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+#define PANGO_ENABLE_BACKEND
+#define PANGO_ENABLE_ENGINE
+
+#include "mozilla-ps-decoder.h"
+#include <pango/pangofc-fontmap.h>
+#include <pango/pangofc-font.h>
+
+#include "nsString.h"
+#include "nsIPersistentProperties2.h"
+#include "nsNetUtil.h"
+#include "nsReadableUtils.h"
+#include "nsICharsetConverterManager.h"
+#include "nsICharRepresentable.h"
+#include "nsCompressedCharMap.h"
+
+#undef DEBUG_CUSTOM_ENCODER
+
+G_DEFINE_TYPE (MozillaPSDecoder, mozilla_ps_decoder, PANGO_TYPE_FC_DECODER)
+
+MozillaPSDecoder *mozilla_ps_decoder_new (void);
+
+static FcCharSet *mozilla_ps_decoder_get_charset (PangoFcDecoder *decoder,
+ PangoFcFont *fcfont);
+static PangoGlyph mozilla_ps_decoder_get_glyph (PangoFcDecoder *decoder,
+ PangoFcFont *fcfont,
+ guint32 wc);
+
+static PangoFcDecoder *mozilla_find_ps_decoder (FcPattern *pattern,
+ gpointer user_data);
+
+typedef struct _MozillaPSDecoderPrivate MozillaPSDecoderPrivate;
+
+#define MOZILLA_PS_DECODER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MOZILLA_TYPE_DECODER, MozillaPSDecoderPrivate))
+
+struct _MozillaPSDecoderPrivate {
+ char *family;
[...4197 lines suppressed...]
toCS(upm, aFace->bbox.xMax),
toCS(upm, aFace->bbox.yMax));
- nsString charIDstr(aCharIDs);
- PRUint32 len = aCharIDs.Length();
-
+ nsValueArray glyphs(PR_UINT16_MAX);
+ nsCStringArray glyphnames(PR_UINT16_MAX);
+ glyphs = *aGlyphs;
+
+ PRUint32 len = aLen;
+ PRUint32 i;
+
if (len < 10) {
// Add a small set of characters to the subset of the user
// defined font to produce to make sure the font ends up
@@ -584,25 +682,47 @@ outputType1SubFont(nsIFreeType2 *aFt2, F
// XXX : need to check if this is true of type 1 fonts as well.
// I suspect it's only the case of CID-keyed fonts (type 9) we used to
// generate.
- charIDstr.AppendLiteral("1234567890");
+ for (i = 1; i <= 10; i++) {
+ glyphs.AppendValue(i);
+ }
len += 10;
}
- const PRUnichar *charIDs = charIDstr.get();
-
- PRUint32 i;
+ FT_Int has_glyph_name;
+#if defined (MOZ_ENABLE_XFT) || defined (MOZ_ENABLE_PANGO)
+ has_glyph_name = FT_Has_PS_Glyph_Names(aFace);
+#else
+ has_glyph_name = aFt2->hasPSGlyphNames(aFace);
+#endif
// construct an Encoding vector : the 0th element
// is /.notdef
- fputs("/Encoding [\n/.notdef\n", aFile);
- for (i = 0; i < len; ++i) {
- fprintf(aFile, "/uni%04X", charIDs[i]);
- if (i % 8 == 7) fputc('\n', aFile);
+ fputs("/Encoding [\n/.notdef", aFile);
+ for (i = aOffset; i < aOffset + aLen; ++i) {
+ nsCString name;
+ char buffer[256];
+
+ if (glyphs.ValueAt(i) == 0) {
+ name = "/.notdef";
+ } else if (!has_glyph_name ||
+#if defined (MOZ_ENABLE_XFT) || defined (MOZ_ENABLE_PANGO)
+ FT_Get_Glyph_Name(aFace, glyphs.ValueAt(i), buffer, 255) != FT_Err_Ok
+#else
+ NS_FAILED(aFt2->getGlyphName(aFace, glyphs.ValueAt(i), buffer, 255))
+#endif
+ ) {
+ name = nsPrintfCString(256, "/idx%04X", glyphs.ValueAt(i));
+ } else {
+ name = nsPrintfCString(256, "/%s", buffer);
+ }
+ glyphnames.AppendCString(name);
+ fprintf(aFile, name.get());
+ if ((i-aOffset) % 8 == 6) fputc('\n', aFile);
}
- for (i = len; i < 255; ++i) {
+ for (i = PR_MAX (0, 255 - int(aLen)); i; --i) {
fputs("/.notdef", aFile);
- if (i % 8 == 7) fputc('\n', aFile);
+ if (i % 8 == 1) fputc('\n', aFile);
}
fputs("] def\n", aFile);
@@ -630,23 +750,21 @@ outputType1SubFont(nsIFreeType2 *aFt2, F
// get the maximum charstring length without actually filling up the buffer
PRInt32 charStringLen;
PRInt32 maxCharStringLen =
-#ifdef MOZ_ENABLE_XFT
+#if defined(MOZ_ENABLE_XFT) || defined(MOZ_ENABLE_PANGO)
FT2GlyphToType1CharString(aFace, 0, aWmode, aLenIV, nsnull);
#else
FT2GlyphToType1CharString(aFt2, aFace, 0, aWmode, aLenIV, nsnull);
#endif
- PRUint32 glyphID;
-
- for (i = 0; i < len; i++) {
-#ifdef MOZ_ENABLE_XFT
- glyphID = FT_Get_Char_Index(aFace, charIDs[i]);
+ for (i = aOffset; i < aOffset + aLen; i++) {
+#if defined(MOZ_ENABLE_XFT) || defined(MOZ_ENABLE_PANGO)
charStringLen =
- FT2GlyphToType1CharString(aFace, glyphID, aWmode, aLenIV, nsnull);
+ FT2GlyphToType1CharString(aFace, glyphs.ValueAt(i), aWmode, aLenIV,
+ nsnull);
#else
- aFt2->GetCharIndex(aFace, charIDs[i], &glyphID);
charStringLen =
- FT2GlyphToType1CharString(aFt2, aFace, glyphID, aWmode, aLenIV, nsnull);
+ FT2GlyphToType1CharString(aFt2, aFace, glyphs.ValueAt(i), aWmode, aLenIV,
+ nsnull);
#endif
if (charStringLen > maxCharStringLen)
@@ -666,7 +784,7 @@ outputType1SubFont(nsIFreeType2 *aFt2, F
len + 1).get());
// output the notdef glyph
-#ifdef MOZ_ENABLE_XFT
+#if defined(MOZ_ENABLE_XFT) || defined(MOZ_ENABLE_PANGO)
charStringLen = FT2GlyphToType1CharString(aFace, 0, aWmode, aLenIV,
charString.get());
#else
@@ -676,22 +794,20 @@ outputType1SubFont(nsIFreeType2 *aFt2, F
// enclose charString with "/.notdef RD ..... ND"
charStringOut(aFile, &pos, &key, NS_REINTERPRET_CAST(const char*, charString.get()),
- charStringLen, 0);
+ charStringLen, "/.notdef");
// output the charstrings for each glyph in this sub font
- for (i = 0; i < len; i++) {
-#ifdef MOZ_ENABLE_XFT
- glyphID = FT_Get_Char_Index(aFace, charIDs[i]);
- charStringLen = FT2GlyphToType1CharString(aFace, glyphID, aWmode,
+ for (i = aOffset; i < aOffset + aLen; i++) {
+#if defined(MOZ_ENABLE_XFT) || defined(MOZ_ENABLE_PANGO)
+ charStringLen = FT2GlyphToType1CharString(aFace, glyphs.ValueAt(i), aWmode,
aLenIV, charString.get());
#else
- aFt2->GetCharIndex(aFace, charIDs[i], &glyphID);
- charStringLen = FT2GlyphToType1CharString(aFt2, aFace, glyphID, aWmode,
- aLenIV, charString.get());
+ charStringLen = FT2GlyphToType1CharString(aFt2, aFace, glyphs.ValueAt(i),
+ aWmode, aLenIV, charString.get());
#endif
charStringOut(aFile, &pos, &key, NS_REINTERPRET_CAST(const char*, charString.get()),
- charStringLen, charIDs[i]);
+ charStringLen, glyphnames.CStringAt(i - aOffset)->get());
}
// wrap up the encrypted part of the font definition
@@ -753,15 +869,12 @@ void encryptAndHexOut(FILE *aFile, PRUin
/* static */
void charStringOut(FILE* aFile, PRUint32* aPos, PRUint16* aKey,
- const char *aStr, PRUint32 aLen, PRUnichar aId)
+ const char *aStr, PRUint32 aLen, const char *aGlyphName)
{
// use a local buffer instead of nsPrintfCString to avoid alloc.
char buf[30];
int oLen;
- if (aId == 0)
- oLen = PR_snprintf(buf, 30, "/.notdef %d RD ", aLen);
- else
- oLen = PR_snprintf(buf, 30, "/uni%04X %d RD ", aId, aLen);
+ oLen = PR_snprintf(buf, 30, "%s %d RD ", aGlyphName, aLen);
if (oLen >= 30) {
NS_WARNING("buffer size exceeded. charstring will be truncated");
Index: gfx/src/ps/nsType1.h
===================================================================
RCS file: /cvsroot/mozilla/gfx/src/ps/nsType1.h,v
retrieving revision 1.5
diff -u -p -d -r1.5 nsType1.h
--- gfx/src/ps/nsType1.h 4 Mar 2005 07:39:27 -0000 1.5
+++ gfx/src/ps/nsType1.h 23 Oct 2006 17:37:39 -0000
@@ -122,8 +122,9 @@ FT_Error FT2GlyphToType1CharString(nsIFr
class nsString;
class nsCString;
+class nsValueArray;
-PRBool FT2SubsetToType1FontSet(FT_Face aFace, const nsString& aSubset,
+PRBool FT2SubsetToType1FontSet(FT_Face aFace, nsValueArray *aGlyphSubset,
int aWmode, FILE *aFile);
nsresult FT2ToType1FontName(FT_Face aFace, int aWmode,
nsCString& aFontName);
Index: config/system-headers
===================================================================
--- config/system-headers 2006-10-26 12:21:39.000000000 -0400
+++ config/system-headers 2006-10-26 12:23:29.000000000 -0400
@@ -180,6 +180,7 @@
freetype/ftoutln.h
freetype/ttnameid.h
freetype/tttables.h
+freetype/t1tables.h
fribidi/fribidi.h
FSp_fopen.h
fstream.h
@@ -484,6 +485,7 @@
pango/pangofc-fontmap.h
pango/pango-fontmap.h
pango/pango.h
+pango/pangoft2.h
pango/pangoxft.h
pango/pangox.h
pango-types.h
firefox-1.5-theme-change.patch:
nsPresContext.cpp | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++----
nsPresContext.h | 13 ++++
2 files changed, 144 insertions(+), 10 deletions(-)
--- NEW FILE firefox-1.5-theme-change.patch ---
Index: layout/base/nsPresContext.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/base/nsPresContext.cpp,v
retrieving revision 3.288.12.2.4.1
diff -d -u -p -r3.288.12.2.4.1 nsPresContext.cpp
--- layout/base/nsPresContext.cpp 21 Apr 2006 23:30:50 -0000 3.288.12.2.4.1
+++ layout/base/nsPresContext.cpp 26 Sep 2006 19:26:40 -0000
@@ -73,6 +73,9 @@
#include "nsIDOMDocument.h"
#include "nsAutoPtr.h"
#include "nsEventStateManager.h"
+#include "nsIEventQueue.h"
+#include "nsIEventQueueService.h"
+
#ifdef IBMBIDI
#include "nsBidiPresUtils.h"
#endif // IBMBIDI
@@ -267,6 +270,7 @@ nsPresContext::~nsPresContext()
NS_IF_RELEASE(mDeviceContext);
NS_IF_RELEASE(mLookAndFeel);
NS_IF_RELEASE(mLangGroup);
+ NS_IF_RELEASE(mEventQueueService);
}
NS_IMPL_ISUPPORTS2(nsPresContext, nsPresContext, nsIObserver)
@@ -285,6 +289,17 @@ static const char* const kGenericFont[]
".fantasy."
};
+// Set to true when LookAndFeelChanged needs to be called. This is used
+// because the look and feel is a service, so there's no need to notify it from
+// more than one prescontext.
+static PRBool sLookAndFeelChanged;
+
+// Set to true when ThemeChanged needs to be called on mTheme. This is used
+// because mTheme is a service, so there's no need to notify it from more than
+// one prescontext.
+static PRBool sThemeChanged;
+
+
void
nsPresContext::GetFontPreferences()
{
@@ -709,6 +724,9 @@ nsPresContext::Init(nsIDeviceContext* aD
this);
#endif
+ rv = CallGetService(NS_EVENTQUEUESERVICE_CONTRACTID, &mEventQueueService);
+ NS_ENSURE_SUCCESS(rv, rv);
+
// Initialize our state from the user preferences
GetUserPreferences();
@@ -1180,33 +1198,126 @@ nsPresContext::GetTheme()
void
nsPresContext::ThemeChanged()
{
+ if (!mPendingThemeChanged) {
+ sLookAndFeelChanged = PR_TRUE;
+ sThemeChanged = PR_TRUE;
+
+ nsCOMPtr<nsIEventQueue> eventQ;
+ mEventQueueService->
+ GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
+ getter_AddRefs(eventQ));
+ if (!eventQ) {
+ return;
+ }
+
+ PLEvent* evt = new PLEvent();
+ if (!evt) {
+ return;
+ }
+
+ PL_InitEvent(evt, this, nsPresContext::ThemeChangedInternal,
+ nsPresContext::DestroyThemeChangeEvt);
+
+ // After this point, event destruction will release |this|
+ NS_ADDREF_THIS();
+
+ nsresult rv = eventQ->PostEvent(evt);
+ if (NS_FAILED(rv)) {
+ PL_DestroyEvent(evt);
+ } else {
+ mPendingThemeChanged = PR_TRUE;
+ }
+ }
+}
+
+void* PR_CALLBACK
+nsPresContext::ThemeChangedInternal(PLEvent *aEvent)
+{
+ nsPresContext* pc = NS_STATIC_CAST(nsPresContext*, aEvent->owner);
+
+ pc->mPendingThemeChanged = PR_FALSE;
+
// Tell the theme that it changed, so it can flush any handles to stale theme
// data.
- if (mTheme)
- mTheme->ThemeChanged();
+ if (pc->mTheme && sThemeChanged) {
+ pc->mTheme->ThemeChanged();
+ sThemeChanged = PR_FALSE;
+ }
// Clear all cached nsILookAndFeel colors.
- if (mLookAndFeel)
- mLookAndFeel->LookAndFeelChanged();
+ if (pc->mLookAndFeel && sLookAndFeelChanged) {
+ pc->mLookAndFeel->LookAndFeelChanged();
+ sLookAndFeelChanged = PR_FALSE;
+ }
// We have to clear style data because the assumption of style rule
// immutability has been violated since any style rule that uses
// system colors or fonts (and probably -moz-appearance as well) has
// changed.
- nsPresContext::ClearStyleDataAndReflow();
+ pc->ClearStyleDataAndReflow();
+
+ return nsnull;
+}
+
+
+void PR_CALLBACK
+nsPresContext::DestroyThemeChangeEvt(PLEvent* aEvent)
+{
+ nsPresContext* pc = NS_STATIC_CAST(nsPresContext*, aEvent->owner);
+ NS_RELEASE(pc);
+ delete aEvent;
}
void
nsPresContext::SysColorChanged()
{
- if (mLookAndFeel) {
+ if (!mPendingSysColorChanged) {
+ sLookAndFeelChanged = PR_TRUE;
+
+ nsCOMPtr<nsIEventQueue> eventQ;
+ mEventQueueService->
+ GetSpecialEventQueue(nsIEventQueueService::UI_THREAD_EVENT_QUEUE,
+ getter_AddRefs(eventQ));
+ if (!eventQ) {
+ return;
+ }
+
+ PLEvent* evt = new PLEvent();
+ if (!evt) {
+ return;
+ }
+
+ PL_InitEvent(evt, this, nsPresContext::SysColorChangedInternal,
+ nsPresContext::DestroySysColorChangeEvt);
+
+ // After this point, event destruction will release |this|
+ NS_ADDREF_THIS();
+
+ nsresult rv = eventQ->PostEvent(evt);
+ if (NS_FAILED(rv)) {
+ PL_DestroyEvent(evt);
+ } else {
+ mPendingSysColorChanged = PR_TRUE;
+ }
+ }
+}
+
+void* PR_CALLBACK
+nsPresContext::SysColorChangedInternal(PLEvent *aEvent)
+{
+ nsPresContext* pc = NS_STATIC_CAST(nsPresContext*, aEvent->owner);
+
+ pc->mPendingSysColorChanged = PR_FALSE;
+
+ if (pc->mLookAndFeel && sLookAndFeelChanged) {
// Don't use the cached values for the system colors
- mLookAndFeel->LookAndFeelChanged();
+ pc->mLookAndFeel->LookAndFeelChanged();
+ sLookAndFeelChanged = PR_FALSE;
}
-
+
// Reset default background and foreground colors for the document since
// they may be using system colors
- GetDocumentColorPreferences();
+ pc->GetDocumentColorPreferences();
// Clear out all of the style data since it may contain RGB values
// which originated from system colors.
@@ -1222,7 +1333,17 @@ nsPresContext::SysColorChanged()
// data without reflowing/updating views will lead to incorrect change hints
// later, because when generating change hints, any style structs which have
// been cleared and not reread are assumed to not be used at all.
- ClearStyleDataAndReflow();
+ pc->ClearStyleDataAndReflow();
+
+ return nsnull;
+}
+
+void PR_CALLBACK
+nsPresContext::DestroySysColorChangeEvt(PLEvent* aEvent)
+{
+ nsPresContext* pc = NS_STATIC_CAST(nsPresContext*, aEvent->owner);
+ NS_RELEASE(pc);
+ delete aEvent;
}
void
Index: layout/base/nsPresContext.h
===================================================================
RCS file: /cvsroot/mozilla/layout/base/nsPresContext.h,v
retrieving revision 3.150.4.2
diff -d -u -p -r3.150.4.2 nsPresContext.h
--- layout/base/nsPresContext.h 29 Aug 2005 16:15:39 -0000 3.150.4.2
+++ layout/base/nsPresContext.h 26 Sep 2006 19:26:40 -0000
@@ -56,6 +56,7 @@
#include "nsCRT.h"
#include "nsIPrintSettings.h"
#include "nsPropertyTable.h"
+#include "plevent.h"
#ifdef IBMBIDI
class nsBidiPresUtils;
#endif // IBMBIDI
@@ -76,6 +77,7 @@ class nsIAtom;
class nsIEventStateManager;
class nsIURI;
class nsILookAndFeel;
+class nsIEventQueueService;
class nsICSSPseudoComparator;
class nsIAtom;
struct nsStyleStruct;
@@ -627,6 +629,14 @@ public:
const nscoord* GetBorderWidthTable() { return mBorderWidthTable; }
protected:
+ static NS_HIDDEN_(void*) PR_CALLBACK ThemeChangedInternal(PLEvent* aEvent);
+ static NS_HIDDEN_(void*) PR_CALLBACK SysColorChangedInternal(PLEvent* aEvent);
+ static NS_HIDDEN_(void) PR_CALLBACK DestroyThemeChangeEvt(PLEvent* aEvent);
+ static NS_HIDDEN_(void) PR_CALLBACK DestroySysColorChangeEvt(PLEvent* aEvent);
+
+ friend void* PR_CALLBACK ThemeChangedInternal(PLEvent* aEvent);
+ friend void* PR_CALLBACK SysColorChangedInternal(PLEvent* aEvent);
+
NS_HIDDEN_(void) SetImgAnimations(nsIContent *aParent, PRUint16 aMode);
NS_HIDDEN_(void) GetDocumentColorPreferences();
@@ -654,6 +664,7 @@ protected:
// from gfx back to layout.
nsIEventStateManager* mEventManager; // [STRONG]
nsILookAndFeel* mLookAndFeel; // [STRONG]
+ nsIEventQueueService *mEventQueueService; // [STRONG]
nsIAtom* mMedium; // initialized by subclass ctors;
// weak pointer to static atom
@@ -724,6 +735,8 @@ protected:
unsigned mCanPaginatedScroll : 1;
unsigned mDoScaledTwips : 1;
unsigned mEnableJapaneseTransform : 1;
+ unsigned mPendingSysColorChanged : 1;
+ unsigned mPendingThemeChanged : 1;
#ifdef IBMBIDI
unsigned mIsVisual : 1;
unsigned mIsBidiSystem : 1;
More information about the fedora-cvs-commits
mailing list