Changes to turn gfxps into a true component. Thanks to alecf@netscape.com

for providing the base patch.
This commit is contained in:
ramiro%netscape.com 1999-06-25 09:38:26 +00:00
Родитель b3853e4a0b
Коммит 05ae9c3868
27 изменённых файлов: 46 добавлений и 39 удалений

Просмотреть файл

@ -26,7 +26,8 @@
#include "nsDeviceContextGTK.h"
#include "nsGfxCIID.h"
#include "../ps/nsDeviceContextPS.h"
#include "nsGfxPSCID.h"
#include "nsIDeviceContextPS.h"
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
@ -363,11 +364,29 @@ NS_IMETHODIMP nsDeviceContextGTK::GetDeviceSurfaceDimensions(PRInt32 &aWidth, PR
NS_IMETHODIMP nsDeviceContextGTK::GetDeviceContextFor(nsIDeviceContextSpec *aDevice,
nsIDeviceContext *&aContext)
{
static NS_DEFINE_CID(kCDeviceContextPS, NS_DEVICECONTEXTPS_CID);
// Create a Postscript device context
aContext = new nsDeviceContextPS();
((nsDeviceContextPS *)aContext)->SetSpec(aDevice);
NS_ADDREF(aDevice);
return((nsDeviceContextPS *) aContext)->Init((nsIDeviceContext*)aContext, (nsIDeviceContext*)this);
nsresult rv;
nsIDeviceContextPS *dcps;
rv = nsComponentManager::CreateInstance(kCDeviceContextPS,
nsnull,
nsIDeviceContextPS::GetIID(),
(void **)&dcps);
NS_ASSERTION(NS_SUCCEEDED(rv), "Couldn't create PS Device context");
dcps->SetSpec(aDevice);
dcps->InitDeviceContextPS((nsIDeviceContext*)aContext,
(nsIDeviceContext*)this);
rv = dcps->QueryInterface(nsIDeviceContext::GetIID(),
(void **)&aContext);
NS_RELEASE(dcps);
return rv;
}
NS_IMETHODIMP nsDeviceContextGTK::BeginDocument(void)

Просмотреть файл

@ -27,7 +27,7 @@ include $(topsrcdir)/config/config.mk
LIBRARY_NAME = gfxps
MODULE=raptor
IS_COMPONENT=1
DEFINES += -D_IMPL_NS_GFXONXP
CFLAGS += $(TK_CFLAGS)
@ -40,11 +40,15 @@ CPPSRCS = \
nsRenderingContextPS.cpp \
nsPostScriptObj.cpp \
nsAFMObject.cpp \
nsGfxFactoryPS.cpp \
$(NULL)
CSRCS = \
font_metrics.c \
EXPORTS = \
nsIDeviceContextPS.h \
nsGfxPSCID.h \
nsIDeviceContextSpecPS.h \
nsPostScriptObj.h

Просмотреть файл

@ -58,21 +58,24 @@ PRInt32 i, n;
}
void nsDeviceContextPS :: SetSpec(nsIDeviceContextSpec* aSpec)
NS_IMETHODIMP
nsDeviceContextPS :: SetSpec(nsIDeviceContextSpec* aSpec)
{
mSpec = aSpec;
NS_ADDREF(aSpec);
return NS_OK;
}
NS_IMPL_QUERY_INTERFACE(nsDeviceContextPS, kDeviceContextIID)
NS_IMPL_ADDREF(nsDeviceContextPS)
NS_IMPL_RELEASE(nsDeviceContextPS)
NS_IMPL_ISUPPORTS_INHERITED(nsDeviceContextPS,
DeviceContextImpl,
nsIDeviceContextPS)
/** ---------------------------------------------------
* See documentation in nsDeviceContextPS.h
* @update 12/21/98 dwc
*/
NS_IMETHODIMP nsDeviceContextPS :: Init(nsIDeviceContext *aCreatingDeviceContext,nsIDeviceContext *aPrinterContext)
NS_IMETHODIMP
nsDeviceContextPS::InitDeviceContextPS(nsIDeviceContext *aCreatingDeviceContext,nsIDeviceContext *aPrinterContext)
{
float origscale, newscale;
float t2d, a2d;

Просмотреть файл

@ -25,23 +25,25 @@
#include "nsIView.h"
#include "nsIRenderingContext.h"
#include "nsVoidArray.h"
#include "nsIDeviceContextPS.h"
class nsPostScriptObj;
class nsDeviceContextWin; // need to be a friend of the class using us.
class nsDeviceContextPS : public DeviceContextImpl
class nsDeviceContextPS : public DeviceContextImpl,
public nsIDeviceContextPS
{
public:
nsDeviceContextPS();
NS_DECL_ISUPPORTS
NS_DECL_ISUPPORTS_INHERITED
/**
* This method does nothing since a postscript devicecontext will never be created
* with a NativeWidget.
* @update 12/21/98 dwc
*/
NS_IMETHOD Init(nsIDeviceContext *aCreatingDeviceContext,nsIDeviceContext *aPrinterContext);
NS_IMETHOD InitDeviceContextPS(nsIDeviceContext *aCreatingDeviceContext,nsIDeviceContext *aPrinterContext);
NS_IMETHOD CreateRenderingContext(nsIRenderingContext *&aContext);
NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets);
@ -68,7 +70,9 @@ public:
NS_IMETHOD EndDocument(void);
NS_IMETHOD BeginPage(void);
NS_IMETHOD EndPage(void);
virtual void SetSpec(nsIDeviceContextSpec *aSpec);
NS_IMETHOD SetSpec(nsIDeviceContextSpec *aSpec);
protected:
virtual ~nsDeviceContextPS();

Просмотреть файл

@ -37,7 +37,6 @@ INCLUDES+=-I$(srcdir)/../src -I$(PUBLIC)/raptor -I$(PUBLIC)/xpcom
LIBS = \
-lraptorgfx \
-lgfx$(MOZ_TOOLKIT) \
-lgfxps \
-lnetlib \
-lhttpurl \
-lgophurl \

Просмотреть файл

@ -51,7 +51,6 @@ LIBS = \
-l$(MOZ_LIB_JS_PREFIX)js \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-limg \
-lmozutil \
-lxpcom \

Просмотреть файл

@ -51,7 +51,6 @@ LIBS = \
-lsecfree \
-lraptorgfx \
-lgfx$(MOZ_TOOLKIT) \
-lgfxps \
-limg \
-l$(MOZ_LIB_UTIL_PREFIX)util \
$(PNG_LIBS) \

Просмотреть файл

@ -58,7 +58,6 @@ LIBS = \
-ljsdom \
-lraptorgfx \
-lgfx$(MOZ_TOOLKIT) \
-lgfxps \
-lxpcom \
-lxp \
-lraptorhtmlpars \

Просмотреть файл

@ -59,7 +59,6 @@ LIBS = \
$(NSPR_LIBS) \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-limg \
-lmozutil \
$(TK_LIBS) \

Просмотреть файл

@ -48,7 +48,6 @@ GECKO_LIBS = \
$(TOOLKIT_WIDGET_LIB) \
-lraptorgfx \
$(TOOLKIT_GFX_LIB) \
-lgfxps \
-lraptorhtmlpars \
-lexpat \
-lxmltok \

Просмотреть файл

@ -63,7 +63,6 @@ LIBS = \
-lxp \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-lmozutil \
-lsecfree \
$(ZLIB_LIBS) \

Просмотреть файл

@ -60,7 +60,6 @@ LIBS = \
-limg \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-lmozutil \
-lmsgbaseutil \
$(JPEG_LIBS) \

Просмотреть файл

@ -59,7 +59,6 @@ LIBS = \
$(NSPR_LIBS) \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-limg \
-lmozutil \
$(TK_LIBS) \

Просмотреть файл

@ -46,7 +46,6 @@ GECKO_LIBS = \
$(TOOLKIT_WIDGET_LIB) \
-lraptorgfx \
$(TOOLKIT_GFX_LIB) \
-lgfxps \
-lraptorhtmlpars \
-lexpat \
-lxmltok \

Просмотреть файл

@ -61,7 +61,6 @@ LIBS = \
-limg \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-lmozutil \
$(DIST)/lib/libmsgnews_s.a \
-lmsgbaseutil \

Просмотреть файл

@ -63,7 +63,6 @@ LIBS = \
$(JPEG_LIBS) \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-lmozutil \
-lmsgbaseutil \
$(ZLIB_LIBS) \

Просмотреть файл

@ -35,7 +35,6 @@ REQUIRES = raptor netlib xpcom reg pref
LIBS = \
-lraptorgfx \
-lgfx$(MOZ_TOOLKIT) \
-lgfxps \
-lnetlib \
-labouturl \
-lfileurl \

Просмотреть файл

@ -51,7 +51,6 @@ LIBS = \
-l$(MOZ_LIB_JS_PREFIX)js \
-lgfx$(MOZ_TOOLKIT) \
-lraptorgfx \
-lgfxps \
-limg \
-lmozutil \
-lxpcom \

Просмотреть файл

@ -46,7 +46,6 @@ GECKO_LIBS = \
$(TOOLKIT_WIDGET_LIB) \
-lraptorgfx \
$(TOOLKIT_GFX_LIB) \
-lgfxps \
-lraptorhtmlpars \
-lexpat \
-lxmltok \

Просмотреть файл

@ -46,7 +46,6 @@ GECKO_LIBS = \
$(TOOLKIT_WIDGET_LIB) \
-lraptorgfx \
$(TOOLKIT_GFX_LIB) \
-lgfxps \
-lraptorhtmlpars \
-lexpat \
-lxmltok \

Просмотреть файл

@ -40,7 +40,6 @@ GECKO_LIBS = \
$(TOOLKIT_WIDGET_LIB) \
-lraptorgfx \
$(TOOLKIT_GFX_LIB) \
-lgfxps \
-lraptorhtmlpars \
-lexpat \
-lxmltok \

Просмотреть файл

@ -102,7 +102,7 @@ BASE_LIBS = -lpref $(ZLIB_LIBS) -lreg
TOOLKIT_WIDGET_LIB = -lwidgetgtk
TOOLKIT_GFX_LIB = -lgfxgtk
GECKO_LIBS = -lraptorwebwidget $(TOOLKIT_WIDGET_LIB) -lraptorgfx $(TOOLKIT_GFX_LIB) -lgfxps -lraptorhtmlpars -lexpat -lxmltok -ljsdom $(NULL)
GECKO_LIBS = -lraptorwebwidget $(TOOLKIT_WIDGET_LIB) -lraptorgfx $(TOOLKIT_GFX_LIB) -lraptorhtmlpars -lexpat -lxmltok -ljsdom $(NULL)
JPEG_LIBS = -ljpeg

Просмотреть файл

@ -119,7 +119,6 @@ GECKO_LIBS = \
$(TOOLKIT_WIDGET_LIB) \
-lraptorgfx \
$(TOOLKIT_GFX_LIB) \
-lgfxps \
-lraptorhtmlpars \
-lexpat \
-lxmltok \

Просмотреть файл

@ -51,7 +51,6 @@ LIBS := \
$(TOOLKIT_WIDGET_LIB) \
-lraptorgfx \
$(TOOLKIT_GFX_LIB) \
-lgfxps \
-lraptorhtmlpars \
-lraptorview \
-labouturl \

Просмотреть файл

@ -40,7 +40,6 @@ CPPSRCS = \
LIBS := \
-lraptorgfx \
-lgfxps \
-lnetlib \
-lremoturl \
-lnetcnvts \
@ -67,7 +66,6 @@ LIBS := \
-lgfx$(MOZ_TOOLKIT) \
$(TK_LIBS) \
-lraptorgfx \
-lgfxps \
-lxp \
-lraptorhtmlpars \
-lexpat \

Просмотреть файл

@ -79,7 +79,6 @@ NETLIB_LIBS = \
LIBS = \
-lraptorgfx \
-lgfx$(MOZ_TOOLKIT) \
-lgfxps \
-lnetlib \
-labouturl \
-lfileurl \

Просмотреть файл

@ -42,7 +42,6 @@ LIBS = \
$(TOOLKIT_WIDGET_LIB)\
-lraptorgfx \
$(TOOLKIT_GFX_LIB)\
-lgfxps \
-lreg \
-labouturl \
-lhttpurl \