Bug 571989 part 1: Move the contents of gfx/src/psshared into widget/src/gtk2, which is the sole user.
authorZack Weinberg <zweinberg@mozilla.com>
Mon, 28 Jun 2010 10:36:17 -0700
changeset 46350 72b5eccbe07c8a83b17b1c5e97f3b7fb8fe115a2
parent 46349 4aadb903f941f20bbfffdf2b51126334de3ed9b8
child 46351 6a6fbf66e1e01b945cfa1b59d2a9e7717504b8b1
push idunknown
push userunknown
push dateunknown
bugs571989
milestone1.9.3a6pre
Bug 571989 part 1: Move the contents of gfx/src/psshared into widget/src/gtk2, which is the sole user.
config/autoconf.mk.in
configure.in
gfx/src/Makefile.in
gfx/src/psshared/Makefile.in
gfx/src/psshared/nsCUPSShim.cpp
gfx/src/psshared/nsCUPSShim.h
gfx/src/psshared/nsPSPrinters.cpp
gfx/src/psshared/nsPSPrinters.h
gfx/src/psshared/nsPaperPS.cpp
gfx/src/psshared/nsPaperPS.h
gfx/src/psshared/psSharedCore.h
js/src/configure.in
toolkit/library/libxul-config.mk
widget/src/beos/nsDeviceContextSpecB.cpp
widget/src/gtk2/Makefile.in
widget/src/gtk2/nsCUPSShim.cpp
widget/src/gtk2/nsCUPSShim.h
widget/src/gtk2/nsDeviceContextSpecG.cpp
widget/src/gtk2/nsPSPrinters.cpp
widget/src/gtk2/nsPSPrinters.h
widget/src/gtk2/nsPaperPS.cpp
widget/src/gtk2/nsPaperPS.h
--- a/config/autoconf.mk.in
+++ b/config/autoconf.mk.in
@@ -125,17 +125,16 @@ ENABLE_TESTS	= @ENABLE_TESTS@
 IBMBIDI = @IBMBIDI@
 MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
 ACCESSIBILITY = @ACCESSIBILITY@
 MOZ_VIEW_SOURCE = @MOZ_VIEW_SOURCE@
 MOZ_JSLOADER  = @MOZ_JSLOADER@
 MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
 MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
 XPCOM_USE_LEA = @XPCOM_USE_LEA@
-MOZ_ENABLE_POSTSCRIPT = @MOZ_ENABLE_POSTSCRIPT@
 MOZ_INSTALLER	= @MOZ_INSTALLER@
 MOZ_UPDATER	= @MOZ_UPDATER@
 MOZ_UPDATE_CHANNEL	= @MOZ_UPDATE_CHANNEL@
 MOZ_UPDATE_PACKAGING	= @MOZ_UPDATE_PACKAGING@
 MOZ_NO_ACTIVEX_SUPPORT = @MOZ_NO_ACTIVEX_SUPPORT@
 MOZ_ACTIVEX_SCRIPTING_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
 MOZ_DISABLE_PARENTAL_CONTROLS = @MOZ_DISABLE_PARENTAL_CONTROLS@
 XPC_IDISPATCH_SUPPORT = @XPC_IDISPATCH_SUPPORT@
--- a/configure.in
+++ b/configure.in
@@ -1227,18 +1227,16 @@ XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_D
 MOZ_FS_LAYOUT=unix
 
 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
 
 USE_DEPENDENT_LIBS=1
 
 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
 
-MOZ_ENABLE_POSTSCRIPT=1 
-
 if test -n "$CROSS_COMPILE"; then
     OS_TARGET="${target_os}"
     OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
     OS_RELEASE=
     case "${target_os}" in
         linux*)       OS_ARCH=Linux OS_TARGET=Linux ;;
         kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
         gnu*)         OS_ARCH=GNU ;;
@@ -2025,17 +2023,16 @@ case "$target" in
     MOZ_OPTIMIZE_FLAGS="-O3"
     _PEDANTIC=
     CFLAGS="$CFLAGS -fpascal-strings -fno-common"
     CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
     _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
-    MOZ_ENABLE_POSTSCRIPT=
     TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
     # The ExceptionHandling framework is needed for Objective-C exception
     # logging code in nsObjCExceptions.h. Currently we only use that in debug
     # builds.
     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
 
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
     dnl ===================================================================
@@ -2292,17 +2289,16 @@ ia64*-hpux*)
     AC_DEFINE(STDC_HEADERS)
     AC_DEFINE(NEW_H, <new>)
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
     AC_DEFINE(HAVE_LOCALTIME_R)
 
     TARGET_MD_ARCH=win32
     _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
     BIN_SUFFIX='.exe'
-    MOZ_ENABLE_POSTSCRIPT=
     MOZ_USER_DIR="Mozilla"
 
     MOZ_GFX_OPTIMIZE_MOBILE=1
 
     # Sanity check for WINCE_WINDOWS_MOBILE
     # XXX disabled until we can fix the mobile tinderbox
     ##if test "$WINCE_WINDOWS_MOBILE"; then
     ##   AC_CHECK_HEADER(tpcshell.h, [],
@@ -2415,17 +2411,16 @@ ia64*-hpux*)
     AC_DEFINE(XP_WIN32)
     AC_DEFINE(HW_THREADS)
     AC_DEFINE(STDC_HEADERS)
     AC_DEFINE(NEW_H, <new>)
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
     TARGET_MD_ARCH=win32
     _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
     BIN_SUFFIX='.exe'
-    MOZ_ENABLE_POSTSCRIPT=
     MOZ_USER_DIR="Mozilla"
 
     dnl Hardcode to win95 for now - cls
     TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
 
     dnl set NO_X11 defines here as the general check is skipped on win32
     no_x=yes
     AC_DEFINE(NO_X11)
@@ -2619,17 +2614,16 @@ ia64*-hpux*)
     WARNINGS_AS_ERRORS='-Werror'
     MOZ_DEBUG_FLAGS="-g -fno-inline"
     MOZ_OPTIMIZE_FLAGS="-O2"
     MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
     DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
     LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
     TARGET_MD_ARCH=os2
     _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
-    MOZ_ENABLE_POSTSCRIPT=
     RC=rc.exe
     RCFLAGS='-n'
     MOZ_USER_DIR="Mozilla"
 
     if test "$MOZTOOLS"; then
         MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
     else
         AC_MSG_ERROR([MOZTOOLS is not set])
@@ -8718,17 +8712,16 @@ AC_SUBST(JAVA_INCLUDE_PATH)
 AC_SUBST(JAVA)
 AC_SUBST(JAVAC)
 AC_SUBST(JAR)
 
 AC_SUBST(MOZ_PROFILELOCKING)
 
 AC_SUBST(HAVE_XIE)
 AC_SUBST(MOZ_XIE_LIBS)
-AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
 
 AC_SUBST(BUILD_STATIC_LIBS)
 AC_SUBST(MOZ_ENABLE_LIBXUL)
 AC_SUBST(ENABLE_TESTS)
 AC_SUBST(IBMBIDI)
 AC_SUBST(MOZ_UNIVERSALCHARDET)
 AC_SUBST(ACCESSIBILITY)
 AC_SUBST(MOZ_VIEW_SOURCE)
--- a/gfx/src/Makefile.in
+++ b/gfx/src/Makefile.in
@@ -44,20 +44,16 @@ include $(DEPTH)/config/autoconf.mk
 
 MODULE      = gfx
 LIBRARY_NAME    = gkgfx
 EXPORT_LIBRARY = 1
 GRE_MODULE	= 1
 LIBXUL_LIBRARY = 1
 
 
-ifdef MOZ_ENABLE_POSTSCRIPT
-DIRS        += psshared
-endif
-
 CPPSRCS = \
         nsColor.cpp \
         nsFont.cpp \
         nsRect.cpp \
         nsRegion.cpp \
         nsTransform2D.cpp \
         nsScriptableRegion.cpp \
         $(NULL)
deleted file mode 100644
--- a/gfx/src/psshared/Makefile.in
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# ***** 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
-# Ken Herron <kherron+mozilla@fmailbox.com>
-# 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 of 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 *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-MODULE		= gfx
-LIBRARY_NAME	= gfxpsshar
-EXPORT_LIBRARY	= 1
-GRE_MODULE	= 1
-LIBXUL_LIBRARY = 1
-
-EXPORTS		= nsCUPSShim.h \
-		  nsPaperPS.h \
-		  nsPSPrinters.h\
-		  psSharedCore.h \
-		  $(NULL)
-
-CPPSRCS		= nsCUPSShim.cpp \
-		  nsPaperPS.cpp \
-		  nsPSPrinters.cpp \
-		  $(NULL)
-
-EXTRA_DSO_LDOPTS = \
-		  $(MOZ_COMPONENT_LIBS) \
-		  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-DEFINES += -D_IMPL_NS_PSSHARED
deleted file mode 100644
--- a/gfx/src/psshared/psSharedCore.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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
- * IBM Corporation.
- * Portions created by the Initial Developer are Copyright (C) 2004
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *  Brian Ryner <bryner@brianryner.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either of 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 ***** */
-
-#ifndef psSharedCore_h__
-#define psSharedCore_h__
-
-#include "nscore.h"
-
-#ifdef MOZ_ENABLE_LIBXUL
-#define NS_PSSHARED
-#define NS_PSSHARED_(type) type
-#define NS_PSSHARED_STATIC_MEMBER_(type) type
-#else //!MOZ_ENABLE_LIBXUL
-#ifdef _IMPL_NS_PSSHARED
-#define NS_PSSHARED NS_EXPORT
-#define NS_PSSHARED_(type) NS_EXPORT_(type)
-#define NS_PSSHARED_STATIC_MEMBER_(type) NS_EXPORT_STATIC_MEMBER_(type)
-#else
-#define NS_PSSHARED NS_IMPORT
-#define NS_PSSHARED_(type) NS_IMPORT_(type)
-#define NS_PSSHARED_STATIC_MEMBER_(type) NS_IMPORT_STATIC_MEMBER_(type)
-#endif
-#endif //MOZ_ENABLE_LIBXUL
-
-#endif
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -986,18 +986,16 @@ MOZ_JS_LIBS='-L$(libdir) -lmozjs'
 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib'
 
 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
 
 USE_DEPENDENT_LIBS=1
 
 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
 
-MOZ_ENABLE_POSTSCRIPT=1 
-
 MOZ_THUMB2=
 
 if test -n "$CROSS_COMPILE"; then
     OS_TARGET="${target_os}"
     OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
     OS_RELEASE=
     case "${target_os}" in
         linux*)       OS_ARCH=Linux OS_TARGET=Linux ;;
@@ -1716,17 +1714,16 @@ case "$target" in
     MOZ_OPTIMIZE_FLAGS="-O3"
     _PEDANTIC=
     CFLAGS="$CFLAGS -fpascal-strings -fno-common"
     CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
     _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
-    MOZ_ENABLE_POSTSCRIPT=
     TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
     LDFLAGS="$LDFLAGS -framework Cocoa"
     # The ExceptionHandling framework is needed for Objective-C exception
     # logging code in nsObjCExceptions.h. Currently we only use that in debug
     # builds.
     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
 
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
@@ -1967,17 +1964,16 @@ ia64*-hpux*)
     AC_DEFINE(HW_THREADS)
     AC_DEFINE(STDC_HEADERS)
     AC_DEFINE(NEW_H, <new>)
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
 
     TARGET_MD_ARCH=win32
     _PLATFORM_DEFAULT_TOOLKIT='windows'
     BIN_SUFFIX='.exe'
-    MOZ_ENABLE_POSTSCRIPT=
     MOZ_USER_DIR="Mozilla"
 
     dnl Default to Windows Mobile components enabled
     WINCE_WINDOWS_MOBILE=1
 
     MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
     [  --disable-windows-mobile-components
                           Disable Windows Mobile specific components from
@@ -2116,17 +2112,16 @@ ia64*-hpux*)
     AC_DEFINE(XP_WIN32)
     AC_DEFINE(HW_THREADS)
     AC_DEFINE(STDC_HEADERS)
     AC_DEFINE(NEW_H, <new>)
     AC_DEFINE(WIN32_LEAN_AND_MEAN)
     TARGET_MD_ARCH=win32
     _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
     BIN_SUFFIX='.exe'
-    MOZ_ENABLE_POSTSCRIPT=
     MOZ_USER_DIR="Mozilla"
 
     dnl Hardcode to win95 for now - cls
     TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
 
     dnl set NO_X11 defines here as the general check is skipped on win32
     no_x=yes
     AC_DEFINE(NO_X11)
@@ -2305,17 +2300,16 @@ ia64*-hpux*)
     WARNINGS_AS_ERRORS='-Werror'
     MOZ_DEBUG_FLAGS="-g -fno-inline"
     MOZ_OPTIMIZE_FLAGS="-O2"
     MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
     DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
     LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
     TARGET_MD_ARCH=os2
     _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
-    MOZ_ENABLE_POSTSCRIPT=
     RC=rc.exe
     RCFLAGS='-n'
     MOZ_USER_DIR="Mozilla"
 
     if test "$MOZTOOLS"; then
         MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
     else
         AC_MSG_ERROR([MOZTOOLS is not set])
--- a/toolkit/library/libxul-config.mk
+++ b/toolkit/library/libxul-config.mk
@@ -284,21 +284,16 @@ endif
 endif
 
 ifdef MOZ_ENABLE_GTK2
 ifdef MOZ_X11
 STATIC_LIBS += gtkxtbin
 endif
 endif
 
-ifdef MOZ_ENABLE_POSTSCRIPT
-DEFINES += -DMOZ_ENABLE_POSTSCRIPT
-STATIC_LIBS += gfxpsshar
-endif
-
 ifneq (,$(filter icon,$(MOZ_IMG_DECODERS)))
 DEFINES += -DICON_DECODER
 COMPONENT_LIBS += imgicon
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
 COMPONENT_LIBS += widget_android
 endif
--- a/widget/src/beos/nsDeviceContextSpecB.cpp
+++ b/widget/src/beos/nsDeviceContextSpecB.cpp
@@ -190,17 +190,16 @@ NS_IMETHODIMP nsPrinterEnumeratorBeOS::D
 //----------------------------------------------------------------------
 nsresult GlobalPrinters::InitializeGlobalPrinters ()
 {
   if (PrintersAreAllocated())
     return NS_OK;
 
   mGlobalNumPrinters = 0;
 
-#ifdef USE_POSTSCRIPT
   mGlobalPrinterList = new nsTArray<nsString>();
   if (!mGlobalPrinterList) 
     return NS_ERROR_OUT_OF_MEMORY;
 
   /* add an entry for the default printer (see nsPostScriptObj.cpp) */
   mGlobalPrinterList->AppendElement(
     nsString(NS_ConvertASCIItoUTF16(NS_POSTSCRIPT_DRIVER_NAME "default")));
   mGlobalNumPrinters++;
@@ -236,18 +235,17 @@ nsresult GlobalPrinters::InitializeGloba
       mGlobalPrinterList->AppendElement(
         nsString(NS_ConvertASCIItoUTF16(NS_POSTSCRIPT_DRIVER_NAME)) + 
         nsString(NS_ConvertASCIItoUTF16(name)));
       mGlobalNumPrinters++;      
     }
 
     NS_Free(printerList);
   }
-#endif /* USE_POSTSCRIPT */
-      
+
   if (mGlobalNumPrinters == 0)
     return NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE; 
 
   return NS_OK;
 }
 
 //----------------------------------------------------------------------
 void GlobalPrinters::FreeGlobalPrinters()
--- a/widget/src/gtk2/Makefile.in
+++ b/widget/src/gtk2/Makefile.in
@@ -86,16 +86,19 @@ CPPSRCS         += nsIdleServiceGTK.cpp
 endif
 
 ifdef NS_PRINTING
 CPPSRCS		+= \
 		nsDeviceContextSpecG.cpp \
 		nsPrintOptionsGTK.cpp \
 		nsPrintDialogGTK.cpp \
 		nsPrintSettingsGTK.cpp \
+		nsCUPSShim.cpp \
+		nsPaperPS.cpp \
+		nsPSPrinters.cpp \
 		$(NULL)
 endif
 
 ifdef MOZ_X11
 CPPSRCS += 	nsClipboard.cpp \
 		nsDragService.cpp \
 		$(NULL)
 endif
@@ -148,20 +151,13 @@ CXXFLAGS        += $(MOZ_CAIRO_CFLAGS) $
 ifdef MOZ_PLATFORM_MAEMO
 ifdef MOZ_ENABLE_GCONF
 CXXFLAGS += $(MOZ_GCONF_CFLAGS)
 endif
 endif
 
 DEFINES		+= -DCAIRO_GFX
 
-ifdef MOZ_ENABLE_POSTSCRIPT
-DEFINES         += -DUSE_POSTSCRIPT
-EXTRA_DSO_LDOPTS += -lgfxpsshar
-endif
-
-
-DEFINES		+=
 INCLUDES	+= \
 		-I$(srcdir)/../xpwidgets \
 		-I$(srcdir)/../shared \
 		-I$(topsrcdir)/other-licenses/atk-1.0 \
 		$(NULL)
rename from gfx/src/psshared/nsCUPSShim.cpp
rename to widget/src/gtk2/nsCUPSShim.cpp
rename from gfx/src/psshared/nsCUPSShim.h
rename to widget/src/gtk2/nsCUPSShim.h
--- a/gfx/src/psshared/nsCUPSShim.h
+++ b/widget/src/gtk2/nsCUPSShim.h
@@ -35,18 +35,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsCUPSShim_h___
 #define nsCUPSShim_h___
 
 #include "prtypes.h"
-#include "psSharedCore.h"
-
 
 /* Various CUPS data types. We don't #include cups headers to avoid
  * requiring CUPS to be installed on the build host (and to avoid having
  * to test for CUPS in configure).
  */
 typedef struct                          /**** Printer Options ****/
 {
     char          *name;                  /* Name of option */
@@ -78,17 +76,17 @@ typedef int (PR_CALLBACK *CupsTempFdType
                                           int   length);
 typedef int (PR_CALLBACK *CupsAddOptionType)(const char    *name,
                                              const char    *value,
                                              int           num_options,
                                              cups_option_t **options);
 
 struct PRLibrary;
 
-class NS_PSSHARED nsCUPSShim {
+class nsCUPSShim {
     public:
         nsCUPSShim() : mCupsLib(nsnull) { }
         ~nsCUPSShim();
 
         /**
          * Initialize this object. Attempt to load the CUPS shared
          * library and find function pointers for the supported
          * functions (see below).
--- a/widget/src/gtk2/nsDeviceContextSpecG.cpp
+++ b/widget/src/gtk2/nsDeviceContextSpecG.cpp
@@ -57,20 +57,18 @@
 #include "nsIPrefBranch.h"
 #include "prenv.h" /* for PR_GetEnv */
 
 #include "nsPrintfCString.h"
 #include "nsReadableUtils.h"
 #include "nsStringEnumerator.h"
 #include "nsIServiceManager.h" 
 
-#ifdef USE_POSTSCRIPT
 #include "nsPSPrinters.h"
 #include "nsPaperPS.h"  /* Paper size list */
-#endif /* USE_POSTSCRIPT */
 
 #include "nsPrintSettingsGTK.h"
 
 #include "nsIFileStreams.h"
 #include "nsILocalFile.h"
 #include "nsTArray.h"
 
 #include <unistd.h>
@@ -564,22 +562,18 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::Ge
 
 NS_IMETHODIMP nsDeviceContextSpecGTK::GetPrintMethod(PrintMethod &aMethod)
 {
   return GetPrintMethod(mPrinter, aMethod);
 }
 /* static !! */
 nsresult nsDeviceContextSpecGTK::GetPrintMethod(const char *aPrinter, PrintMethod &aMethod)
 {
-#if defined(USE_POSTSCRIPT)
   aMethod = pmPostScript;
   return NS_OK;
-#else
-  return NS_ERROR_UNEXPECTED;
-#endif
 }
 
 static void
 print_callback(GtkPrintJob *aJob, gpointer aData, GError *aError) {
   g_object_unref(aJob);
   ((nsILocalFile*) aData)->Remove(PR_FALSE);
 }
 
@@ -773,26 +767,24 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::In
   printerName.Assign(NS_ConvertUTF16toUTF8(aPrinterName));
   DO_PR_DEBUG_LOG(("printerName='%s'\n", printerName.get()));
   
   PrintMethod type = pmInvalid;
   rv = nsDeviceContextSpecGTK::GetPrintMethod(printerName, type);
   if (NS_FAILED(rv))
     return rv;
 
-#ifdef USE_POSTSCRIPT
   /* "Demangle" postscript printer name */
   if (type == pmPostScript) {
     /* Strip the printing method name from the printer,
      * e.g. turn "PostScript/foobar" to "foobar" */
     PRInt32 slash = printerName.FindChar('/');
     if (kNotFound != slash)
       printerName.Cut(0, slash + 1);
   }
-#endif /* USE_POSTSCRIPT */
 
 #ifdef SET_PRINTER_FEATURES_VIA_PREFS
   /* Defaults to FALSE */
   pPrefs->SetBoolPref(nsPrintfCString(256, PRINTERFEATURES_PREF ".%s.has_special_printerfeatures", fullPrinterName.get()).get(), PR_FALSE);
 #endif /* SET_PRINTER_FEATURES_VIA_PREFS */
 
   
   /* Set filename */
@@ -808,17 +800,16 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::In
     else
       filename.AssignLiteral("mozilla.ps");
   }  
   DO_PR_DEBUG_LOG(("Setting default filename to '%s'\n", filename.get()));
   aPrintSettings->SetToFileName(NS_ConvertUTF8toUTF16(filename).get());
 
   aPrintSettings->SetIsInitializedFromPrinter(PR_TRUE);
 
-#ifdef USE_POSTSCRIPT
   if (type == pmPostScript) {
     DO_PR_DEBUG_LOG(("InitPrintSettingsFromPrinter() for PostScript printer\n"));
 
 #ifdef SET_PRINTER_FEATURES_VIA_PREFS
     nsPrinterFeatures printerFeatures(fullPrinterName);
 
     printerFeatures.SetSupportsPaperSizeChange(PR_TRUE);
     printerFeatures.SetSupportsOrientationChange(PR_TRUE);
@@ -945,17 +936,16 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::In
     }
     
 #ifdef SET_PRINTER_FEATURES_VIA_PREFS
     printerFeatures.SetCanChangeNumCopies(PR_TRUE);   
 #endif /* SET_PRINTER_FEATURES_VIA_PREFS */
 
     return NS_OK;    
   }
-#endif /* USE_POSTSCRIPT */
 
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP nsPrinterEnumeratorGTK::DisplayPropertiesDlg(const PRUnichar *aPrinter, nsIPrintSettings *aPrintSettings)
 {
   return NS_OK;
 }
@@ -971,32 +961,30 @@ nsresult GlobalPrinters::InitializeGloba
   if (!mGlobalPrinterList) 
     return NS_ERROR_OUT_OF_MEMORY;
 
   nsresult rv;
   nsCOMPtr<nsIPrefBranch> pPrefs = do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv))
     return rv;
       
-#ifdef USE_POSTSCRIPT
   nsPSPrinterList psMgr;
   if (NS_SUCCEEDED(psMgr.Init()) && psMgr.Enabled()) {
     /* Get the list of PostScript-module printers */
     // XXX: this function is the only user of GetPrinterList
     // So it may be interesting to convert the nsCStrings
     // in this function, we would save one loop here
     nsTArray<nsCString> printerList;
     psMgr.GetPrinterList(printerList);
     for (PRUint32 i = 0; i < printerList.Length(); i++)
     {
       mGlobalPrinterList->AppendElement(NS_ConvertUTF8toUTF16(printerList[i]));
     }
   }
-#endif /* USE_POSTSCRIPT */  
-      
+
   /* If there are no printers available after all checks, return an error */
   if (!mGlobalPrinterList->Length())
   {
     /* Make sure we do not cache an empty printer list */
     FreeGlobalPrinters();
 
     return NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE;
   }
rename from gfx/src/psshared/nsPSPrinters.cpp
rename to widget/src/gtk2/nsPSPrinters.cpp
rename from gfx/src/psshared/nsPSPrinters.h
rename to widget/src/gtk2/nsPSPrinters.h
--- a/gfx/src/psshared/nsPSPrinters.h
+++ b/widget/src/gtk2/nsPSPrinters.h
@@ -38,23 +38,22 @@
 
 #ifndef nsPSPrinters_h___
 #define nsPSPrinters_h___
 
 #include "nsString.h"
 #include "nsTArray.h"
 #include "prtypes.h"
 #include "nsCUPSShim.h"
-#include "psSharedCore.h"
 
 class nsIPrefService;
 class nsIPrefBranch;
 class nsCUPSShim;
 
-class NS_PSSHARED nsPSPrinterList {
+class nsPSPrinterList {
     public:
         /**
          * Initialize a printer manager object.
          * @return NS_ERROR_NOT_INITIALIZED if unable to access prefs
          *         NS_OK for successful initialization.
          */
         nsresult Init();
 
rename from gfx/src/psshared/nsPaperPS.cpp
rename to widget/src/gtk2/nsPaperPS.cpp
rename from gfx/src/psshared/nsPaperPS.h
rename to widget/src/gtk2/nsPaperPS.h
--- a/gfx/src/psshared/nsPaperPS.h
+++ b/widget/src/gtk2/nsPaperPS.h
@@ -37,26 +37,25 @@
  * ***** END LICENSE BLOCK ***** */
 
  
 #ifndef _PAPERPS_H_
 #define _PAPERPS_H_
 
 #include "prtypes.h"
 #include "nsDebug.h"
-#include "psSharedCore.h"
 
 struct nsPaperSizePS_ {
     const char *name;
     float width_mm;
     float height_mm;
     PRBool isMetric;        // Present to the user in metric, if possible
 };
 
-class NS_PSSHARED nsPaperSizePS {
+class nsPaperSizePS {
     public:
         /** ---------------------------------------------------
          * Constructor
          */
         nsPaperSizePS() { mCurrent = 0; }
 
         /** ---------------------------------------------------
          * @return PR_TRUE if the cursor points past the last item.
@@ -114,15 +113,14 @@ class NS_PSSHARED nsPaperSizePS {
          */
         PRBool IsMetric() {
             NS_PRECONDITION(!AtEnd(), "Invalid current item");
             return mList[mCurrent].isMetric;
         }
 
     private:
         unsigned int mCurrent;
-        // the class visibility should export these, but it doesn't
-        static NS_PSSHARED_STATIC_MEMBER_(const nsPaperSizePS_) mList[];
-        static NS_PSSHARED_STATIC_MEMBER_(const unsigned int) mCount;
+        static const nsPaperSizePS_ mList[];
+        static const unsigned int mCount;
 };
 
 #endif