mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-30 10:12:59 +00:00
Bug 571989 part 1: Move the contents of gfx/src/psshared into widget/src/gtk2, which is the sole user.
--HG-- rename : gfx/src/psshared/nsCUPSShim.cpp => widget/src/gtk2/nsCUPSShim.cpp rename : gfx/src/psshared/nsCUPSShim.h => widget/src/gtk2/nsCUPSShim.h rename : gfx/src/psshared/nsPSPrinters.cpp => widget/src/gtk2/nsPSPrinters.cpp rename : gfx/src/psshared/nsPSPrinters.h => widget/src/gtk2/nsPSPrinters.h rename : gfx/src/psshared/nsPaperPS.cpp => widget/src/gtk2/nsPaperPS.cpp rename : gfx/src/psshared/nsPaperPS.h => widget/src/gtk2/nsPaperPS.h
This commit is contained in:
parent
a2baef3136
commit
aacc755259
@ -130,7 +130,6 @@ 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@
|
||||
|
@ -1232,8 +1232,6 @@ 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'`
|
||||
@ -2030,7 +2028,6 @@ case "$target" in
|
||||
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
|
||||
@ -2297,7 +2294,6 @@ ia64*-hpux*)
|
||||
TARGET_MD_ARCH=win32
|
||||
_PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
|
||||
BIN_SUFFIX='.exe'
|
||||
MOZ_ENABLE_POSTSCRIPT=
|
||||
MOZ_USER_DIR="Mozilla"
|
||||
|
||||
MOZ_GFX_OPTIMIZE_MOBILE=1
|
||||
@ -2420,7 +2416,6 @@ ia64*-hpux*)
|
||||
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
|
||||
@ -2624,7 +2619,6 @@ ia64*-hpux*)
|
||||
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"
|
||||
@ -8723,7 +8717,6 @@ 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)
|
||||
|
@ -49,10 +49,6 @@ GRE_MODULE = 1
|
||||
LIBXUL_LIBRARY = 1
|
||||
|
||||
|
||||
ifdef MOZ_ENABLE_POSTSCRIPT
|
||||
DIRS += psshared
|
||||
endif
|
||||
|
||||
CPPSRCS = \
|
||||
nsColor.cpp \
|
||||
nsFont.cpp \
|
||||
|
@ -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
|
@ -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
|
@ -991,8 +991,6 @@ USE_DEPENDENT_LIBS=1
|
||||
|
||||
_PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
|
||||
|
||||
MOZ_ENABLE_POSTSCRIPT=1
|
||||
|
||||
MOZ_THUMB2=
|
||||
|
||||
if test -n "$CROSS_COMPILE"; then
|
||||
@ -1721,7 +1719,6 @@ case "$target" in
|
||||
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
|
||||
@ -1972,7 +1969,6 @@ ia64*-hpux*)
|
||||
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
|
||||
@ -2121,7 +2117,6 @@ ia64*-hpux*)
|
||||
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
|
||||
@ -2310,7 +2305,6 @@ ia64*-hpux*)
|
||||
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"
|
||||
|
@ -289,11 +289,6 @@ 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
|
||||
|
@ -195,7 +195,6 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
|
||||
|
||||
mGlobalNumPrinters = 0;
|
||||
|
||||
#ifdef USE_POSTSCRIPT
|
||||
mGlobalPrinterList = new nsTArray<nsString>();
|
||||
if (!mGlobalPrinterList)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
@ -241,8 +240,7 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
|
||||
|
||||
NS_Free(printerList);
|
||||
}
|
||||
#endif /* USE_POSTSCRIPT */
|
||||
|
||||
|
||||
if (mGlobalNumPrinters == 0)
|
||||
return NS_ERROR_GFX_PRINTER_NO_PRINTER_AVAILABLE;
|
||||
|
||||
|
@ -91,6 +91,9 @@ CPPSRCS += \
|
||||
nsPrintOptionsGTK.cpp \
|
||||
nsPrintDialogGTK.cpp \
|
||||
nsPrintSettingsGTK.cpp \
|
||||
nsCUPSShim.cpp \
|
||||
nsPaperPS.cpp \
|
||||
nsPSPrinters.cpp \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
@ -153,13 +156,6 @@ endif
|
||||
|
||||
DEFINES += -DCAIRO_GFX
|
||||
|
||||
ifdef MOZ_ENABLE_POSTSCRIPT
|
||||
DEFINES += -DUSE_POSTSCRIPT
|
||||
EXTRA_DSO_LDOPTS += -lgfxpsshar
|
||||
endif
|
||||
|
||||
|
||||
DEFINES +=
|
||||
INCLUDES += \
|
||||
-I$(srcdir)/../xpwidgets \
|
||||
-I$(srcdir)/../shared \
|
||||
|
@ -40,8 +40,6 @@
|
||||
#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
|
||||
@ -83,7 +81,7 @@ typedef int (PR_CALLBACK *CupsAddOptionType)(const char *name,
|
||||
|
||||
struct PRLibrary;
|
||||
|
||||
class NS_PSSHARED nsCUPSShim {
|
||||
class nsCUPSShim {
|
||||
public:
|
||||
nsCUPSShim() : mCupsLib(nsnull) { }
|
||||
~nsCUPSShim();
|
@ -62,10 +62,8 @@
|
||||
#include "nsStringEnumerator.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
#ifdef USE_POSTSCRIPT
|
||||
#include "nsPSPrinters.h"
|
||||
#include "nsPaperPS.h" /* Paper size list */
|
||||
#endif /* USE_POSTSCRIPT */
|
||||
|
||||
#include "nsPrintSettingsGTK.h"
|
||||
|
||||
@ -569,12 +567,8 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::GetPrintMethod(PrintMethod &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
|
||||
@ -778,7 +772,6 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
#ifdef USE_POSTSCRIPT
|
||||
/* "Demangle" postscript printer name */
|
||||
if (type == pmPostScript) {
|
||||
/* Strip the printing method name from the printer,
|
||||
@ -787,7 +780,6 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich
|
||||
if (kNotFound != slash)
|
||||
printerName.Cut(0, slash + 1);
|
||||
}
|
||||
#endif /* USE_POSTSCRIPT */
|
||||
|
||||
#ifdef SET_PRINTER_FEATURES_VIA_PREFS
|
||||
/* Defaults to FALSE */
|
||||
@ -813,7 +805,6 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich
|
||||
|
||||
aPrintSettings->SetIsInitializedFromPrinter(PR_TRUE);
|
||||
|
||||
#ifdef USE_POSTSCRIPT
|
||||
if (type == pmPostScript) {
|
||||
DO_PR_DEBUG_LOG(("InitPrintSettingsFromPrinter() for PostScript printer\n"));
|
||||
|
||||
@ -950,7 +941,6 @@ NS_IMETHODIMP nsPrinterEnumeratorGTK::InitPrintSettingsFromPrinter(const PRUnich
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
#endif /* USE_POSTSCRIPT */
|
||||
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
@ -976,7 +966,6 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
|
||||
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 */
|
||||
@ -990,8 +979,7 @@ nsresult GlobalPrinters::InitializeGlobalPrinters ()
|
||||
mGlobalPrinterList->AppendElement(NS_ConvertUTF8toUTF16(printerList[i]));
|
||||
}
|
||||
}
|
||||
#endif /* USE_POSTSCRIPT */
|
||||
|
||||
|
||||
/* If there are no printers available after all checks, return an error */
|
||||
if (!mGlobalPrinterList->Length())
|
||||
{
|
||||
|
@ -43,13 +43,12 @@
|
||||
#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.
|
@ -42,7 +42,6 @@
|
||||
|
||||
#include "prtypes.h"
|
||||
#include "nsDebug.h"
|
||||
#include "psSharedCore.h"
|
||||
|
||||
struct nsPaperSizePS_ {
|
||||
const char *name;
|
||||
@ -51,7 +50,7 @@ struct nsPaperSizePS_ {
|
||||
PRBool isMetric; // Present to the user in metric, if possible
|
||||
};
|
||||
|
||||
class NS_PSSHARED nsPaperSizePS {
|
||||
class nsPaperSizePS {
|
||||
public:
|
||||
/** ---------------------------------------------------
|
||||
* Constructor
|
||||
@ -119,9 +118,8 @@ class NS_PSSHARED nsPaperSizePS {
|
||||
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user