Enabled building of gfxQtFonts and gfxQtPlatform for cairo-qt configuration
authorromaxa@romaxa.research.nokia.com
Sat, 19 Apr 2008 16:19:04 +0300
changeset 16758 6cfa2d695051115e8507d209ebebe8337178cf9b
parent 16757 dd2c686f5eb5ee5fc701bddae258719d45619671
child 16759 121613a0b6ffdd0b3ec069de3bc68aeff783f4ea
push id1298
push userpavlov@mozilla.com
push dateSun, 17 Aug 2008 05:03:09 +0000
treeherderautoland@4a506fa751d8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0a1pre
Enabled building of gfxQtFonts and gfxQtPlatform for cairo-qt configuration
gfx/src/thebes/Makefile.in
gfx/src/thebes/nsThebesDeviceContext.cpp
gfx/thebes/public/Makefile.in
gfx/thebes/src/Makefile.in
gfx/thebes/src/gfxPlatform.cpp
--- a/gfx/src/thebes/Makefile.in
+++ b/gfx/src/thebes/Makefile.in
@@ -72,16 +72,23 @@ CPPSRCS		= \
 		nsThebesRenderingContext.cpp \
 		nsThebesFontMetrics.cpp \
 		nsThebesFontEnumerator.cpp \
 		$(NULL)
 
 
 EXTRA_DSO_LIBS	= gkgfx thebes
 
+ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
+CPPSRCS += nsSystemFontsQt.cpp
+ifdef MOZ_ENABLE_GLITZ
+REQUIRES += glitzglx
+endif
+endif
+
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
 CPPSRCS		+= nsSystemFontsGTK2.cpp
 
 ifdef MOZ_ENABLE_GLITZ
 REQUIRES        += glitzglx
 endif
 
 endif
--- a/gfx/src/thebes/nsThebesDeviceContext.cpp
+++ b/gfx/src/thebes/nsThebesDeviceContext.cpp
@@ -81,16 +81,19 @@ static nsSystemFontsOS2 *gSystemFonts = 
 #elif defined(XP_BEOS)
 #include "nsSystemFontsBeOS.h"
 static nsSystemFontsBeOS *gSystemFonts = nsnull;
 #elif XP_MACOSX
 #include "nsSystemFontsMac.h"
 #include "gfxQuartzSurface.h"
 #include "gfxImageSurface.h"
 static nsSystemFontsMac *gSystemFonts = nsnull;
+#elif defined(MOZ_WIDGET_QT)
+#include "nsSystemFontsQt.h"
+static nsSystemFontsQt *gSystemFonts = nsnull;
 #else
 #error Need to declare gSystemFonts!
 #endif
 
 #ifdef MOZ_ENABLE_GTK2
 extern "C" {
 static int x11_error_handler (Display *dpy, XErrorEvent *err) {
     NS_ASSERTION(PR_FALSE, "X Error");
@@ -216,17 +219,19 @@ nsThebesDeviceContext::SetDPI()
                 DevCloseDC(dc);
         }
         if (dpi < 0) // something didn't work before, fall back to hardcoded DPI value
             dpi = 96;
 #elif defined(XP_MACOSX)
 
         // we probably want to actually get a real DPI here?
         dpi = 96;
-
+#elif defined(MOZ_WIDGET_QT)
+		// TODO: get real DPI here with Qt methods
+        dpi = 96;
 #else
 #error undefined platform dpi
 #endif
 
         if (prefDPI > 0 && !mPrintingSurface)
             dpi = prefDPI;
     }
 
@@ -379,16 +384,18 @@ nsThebesDeviceContext::GetSystemFont(nsS
 #elif XP_WIN
         gSystemFonts = new nsSystemFontsWin();
 #elif XP_OS2
         gSystemFonts = new nsSystemFontsOS2();
 #elif defined(XP_BEOS)
         gSystemFonts = new nsSystemFontsBeOS();
 #elif XP_MACOSX
         gSystemFonts = new nsSystemFontsMac();
+#elif defined(MOZ_WIDGET_QT)
+        gSystemFonts = new nsSystemFontsQt();
 #else
 #error Need to know how to create gSystemFonts, fix me!
 #endif
     }
 
     nsString fontName;
     gfxFontStyle fontStyle;
     nsresult rv = gSystemFonts->GetSystemFont(aID, &fontName, &fontStyle);
--- a/gfx/thebes/public/Makefile.in
+++ b/gfx/thebes/public/Makefile.in
@@ -56,16 +56,24 @@ EXPORTS +=      gfxXlibSurface.h gfxPlat
 EXPORTS +=	gfxPangoFonts.h
 EXPORTS +=	gfxPDFSurface.h gfxPSSurface.h
 
 ifdef MOZ_ENABLE_GLITZ
 REQUIRES += glitzglx
 endif
 endif
 
+ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
+EXPORTS += gfxXlibSurface.h gfxQtPlatform.h gfxXlibNativeRenderer.h
+EXPORTS += gfxQtFonts.h
+ifdef MOZ_ENABLE_GLITZ
+REQUIRES += glitzglx
+endif
+endif
+
 ifeq ($(MOZ_WIDGET_TOOLKIT),os2)
 EXPORTS	+=	gfxOS2Surface.h \
 		gfxOS2Platform.h \
 		gfxOS2Fonts.h \
 		$(NULL)
 EXPORTS +=	gfxPDFSurface.h
 endif
 
--- a/gfx/thebes/src/Makefile.in
+++ b/gfx/thebes/src/Makefile.in
@@ -84,16 +84,25 @@ CPPSRCS +=      gfxXlibSurface.cpp gfxPl
 CPPSRCS +=	gfxPangoFonts.cpp 
 CPPSRCS +=	gfxPDFSurface.cpp gfxPSSurface.cpp
 CPPSRCS +=	gfxFontconfigUtils.cpp
 CPPSRCS +=	nsUnicodeRange.cpp
 CSRCS = cairo-xlib-utils.c
 EXTRA_DSO_LDOPTS += $(MOZ_PANGO_LIBS) $(ZLIB_LIBS) $(MOZ_XFT_LIBS) $(XLDFLAGS) $(XLIBS)
 endif
 
+ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
+CPPSRCS +=  gfxXlibSurface.cpp gfxQtPlatform.cpp gfxXlibNativeRenderer.cpp
+CPPSRCS +=	gfxQtFonts.cpp 
+CPPSRCS +=	gfxFontconfigUtils.cpp
+CPPSRCS +=	nsUnicodeRange.cpp
+CSRCS = cairo-xlib-utils.c
+EXTRA_DSO_LDOPTS += $(ZLIB_LIBS) $(MOZ_XFT_LIBS) $(XLDFLAGS) $(XLIBS)
+endif
+
 ifeq ($(MOZ_WIDGET_TOOLKIT),beos)
 CPPSRCS	+= 	gfxBeOSSurface.cpp gfxBeOSPlatform.cpp
 CPPSRCS +=	gfxPangoFonts.cpp 
 #CPPSRCS +=	gfxPDFSurface.cpp
 CPPSRCS +=	gfxFontconfigUtils.cpp
 CPPSRCS +=	nsUnicodeRange.cpp
 EXTRA_DSO_LDOPTS += $(MOZ_PANGO_LIBS) $(CAIRO_FT_LIBS) -lfontconfig -lpangocairo-1.0
 endif
--- a/gfx/thebes/src/gfxPlatform.cpp
+++ b/gfx/thebes/src/gfxPlatform.cpp
@@ -39,16 +39,18 @@
 
 #if defined(XP_WIN)
 #include "gfxWindowsPlatform.h"
 #elif defined(XP_MACOSX)
 #include "gfxPlatformMac.h"
 #include "gfxQuartzFontCache.h"
 #elif defined(MOZ_WIDGET_GTK2)
 #include "gfxPlatformGtk.h"
+#elif defined(MOZ_WIDGET_QT)
+#include "gfxQtPlatform.h"
 #elif defined(XP_BEOS)
 #include "gfxBeOSPlatform.h"
 #elif defined(XP_OS2)
 #include "gfxOS2Platform.h"
 #endif
 
 #include "gfxContext.h"
 #include "gfxImageSurface.h"
@@ -124,16 +126,18 @@ gfxPlatform::Init()
 {
     NS_ASSERTION(!gPlatform, "Already started???");
 #if defined(XP_WIN)
     gPlatform = new gfxWindowsPlatform;
 #elif defined(XP_MACOSX)
     gPlatform = new gfxPlatformMac;
 #elif defined(MOZ_WIDGET_GTK2)
     gPlatform = new gfxPlatformGtk;
+#elif defined(MOZ_WIDGET_QT)
+    gPlatform = new gfxQtPlatform;
 #elif defined(XP_BEOS)
     gPlatform = new gfxBeOSPlatform;
 #elif defined(XP_OS2)
     gPlatform = new gfxOS2Platform;
 #endif
     if (!gPlatform)
         return NS_ERROR_OUT_OF_MEMORY;