Changed 'unix' to 'motif' to deal with toolkit confusion.

git-svn-id: svn://10.0.0.236/trunk@13862 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
ramiro%netscape.com
1998-11-02 12:24:05 +00:00
parent 2e7953e856
commit a079b82f96
13 changed files with 234 additions and 234 deletions

View File

@@ -45,8 +45,8 @@ EXTRA_DSO_LDOPTS+= -lXt -lX11 -lXext -lm
endif
CPPSRCS=nsDeviceContextUnix.cpp nsFontMetricsUnix.cpp nsGfxFactoryUnix.cpp \
nsRenderingContextUnix.cpp nsRegionUnix.cpp nsImageUnix.cpp
CPPSRCS=nsDeviceContextMotif.cpp nsFontMetricsMotif.cpp nsGfxFactoryMotif.cpp \
nsRenderingContextMotif.cpp nsRegionMotif.cpp nsImageMotif.cpp
include $(DEPTH)/config/rules.mk

View File

@@ -24,7 +24,7 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
LIBRARY_NAME = gfxunix
LIBRARY_NAME = gfxmotif
MODULE=raptor
@@ -44,8 +44,8 @@ EXTRA_DSO_LDOPTS+=\
EXTRA_DSO_LDOPTS+= $(XLDFLAGS) $(XLIBS)
CPPSRCS=nsDeviceContextUnix.cpp nsFontMetricsUnix.cpp nsGfxFactoryUnix.cpp \
nsRenderingContextUnix.cpp nsRegionUnix.cpp nsImageUnix.cpp
CPPSRCS=nsDeviceContextMotif.cpp nsFontMetricsMotif.cpp nsGfxFactoryMotif.cpp \
nsRenderingContextMotif.cpp nsRegionMotif.cpp nsImageMotif.cpp
include $(topsrcdir)/config/rules.mk

View File

@@ -16,8 +16,8 @@
* Reserved.
*/
#include "nsDeviceContextUnix.h"
#include "nsRenderingContextUnix.h"
#include "nsDeviceContextMotif.h"
#include "nsRenderingContextMotif.h"
#include "../nsGfxCIID.h"
#include "math.h"
@@ -56,7 +56,7 @@ nsReservedColor sReservedColors[] = {
{ 166, 202, 240 } };
nsDeviceContextUnix :: nsDeviceContextUnix()
nsDeviceContextMotif :: nsDeviceContextMotif()
{
mSurface = nsnull;
mTwipsToPixels = 1.0;
@@ -83,7 +83,7 @@ nsDeviceContextUnix :: nsDeviceContextUnix()
mDisplay = 0;
}
nsDeviceContextUnix :: ~nsDeviceContextUnix()
nsDeviceContextMotif :: ~nsDeviceContextMotif()
{
if (mSurface) {
delete mSurface;
@@ -97,11 +97,11 @@ nsDeviceContextUnix :: ~nsDeviceContextUnix()
delete mDeviceColors;
}
NS_IMPL_QUERY_INTERFACE(nsDeviceContextUnix, kDeviceContextIID)
NS_IMPL_ADDREF(nsDeviceContextUnix)
NS_IMPL_RELEASE(nsDeviceContextUnix)
NS_IMPL_QUERY_INTERFACE(nsDeviceContextMotif, kDeviceContextIID)
NS_IMPL_ADDREF(nsDeviceContextMotif)
NS_IMPL_RELEASE(nsDeviceContextMotif)
NS_IMETHODIMP nsDeviceContextUnix :: Init(nsNativeWidget aNativeWidget)
NS_IMETHODIMP nsDeviceContextMotif :: Init(nsNativeWidget aNativeWidget)
{
NS_ASSERTION(!(aNativeWidget == nsnull), "attempt to init devicecontext with null widget");
@@ -126,7 +126,7 @@ NS_IMETHODIMP nsDeviceContextUnix :: Init(nsNativeWidget aNativeWidget)
}
NS_IMETHODIMP nsDeviceContextUnix :: GetScrollBarDimensions(float &aWidth, float &aHeight) const
NS_IMETHODIMP nsDeviceContextMotif :: GetScrollBarDimensions(float &aWidth, float &aHeight) const
{
// XXX Should we push this to widget library
aWidth = 240.0;
@@ -134,13 +134,13 @@ NS_IMETHODIMP nsDeviceContextUnix :: GetScrollBarDimensions(float &aWidth, float
return NS_OK;
}
NS_IMETHODIMP nsDeviceContextUnix :: GetDrawingSurface(nsIRenderingContext &aContext, nsDrawingSurface &aSurface)
NS_IMETHODIMP nsDeviceContextMotif :: GetDrawingSurface(nsIRenderingContext &aContext, nsDrawingSurface &aSurface)
{
aContext.CreateDrawingSurface(nsnull, 0, aSurface);
return nsnull == aSurface ? NS_ERROR_OUT_OF_MEMORY : NS_OK;
}
Display *nsDeviceContextUnix::GetDisplay()
Display *nsDeviceContextMotif::GetDisplay()
{
if (mDisplay)
return(mDisplay);
@@ -159,7 +159,7 @@ Display *nsDeviceContextUnix::GetDisplay()
// aCanAlloc is PR_TRUE. If all else fails try and find the closest match to
// an existing color.
uint8 nsDeviceContextUnix :: AllocColor(uint8 aRed, uint8 aGreen, uint8 aBlue, PRBool aCanAlloc)
uint8 nsDeviceContextMotif :: AllocColor(uint8 aRed, uint8 aGreen, uint8 aBlue, PRBool aCanAlloc)
{
Display* display = GetDisplay();
@@ -224,7 +224,7 @@ uint8 nsDeviceContextUnix :: AllocColor(uint8 aRed, uint8 aGreen, uint8 aBlue, P
}
NS_IMETHODIMP nsDeviceContextUnix :: ConvertPixel(nscolor aColor, PRUint32 & aPixel)
NS_IMETHODIMP nsDeviceContextMotif :: ConvertPixel(nscolor aColor, PRUint32 & aPixel)
{
PRUint32 newcolor = 0;
@@ -255,7 +255,7 @@ NS_IMETHODIMP nsDeviceContextUnix :: ConvertPixel(nscolor aColor, PRUint32 & aPi
}
void nsDeviceContextUnix :: InstallColormap()
void nsDeviceContextMotif :: InstallColormap()
{
/*
@@ -286,7 +286,7 @@ void nsDeviceContextUnix :: InstallColormap()
}
void nsDeviceContextUnix :: InstallColormap(Display* aDisplay, Drawable aDrawable)
void nsDeviceContextMotif :: InstallColormap(Display* aDisplay, Drawable aDrawable)
{
XWindowAttributes wa;
@@ -386,14 +386,14 @@ void nsDeviceContextUnix :: InstallColormap(Display* aDisplay, Drawable aDrawabl
}
nsDrawingSurface nsDeviceContextUnix :: GetDrawingSurface()
nsDrawingSurface nsDeviceContextMotif :: GetDrawingSurface()
{
return mSurface;
}
NS_IMETHODIMP nsDeviceContextUnix :: CheckFontExistence(const nsString& aFontName)
NS_IMETHODIMP nsDeviceContextMotif :: CheckFontExistence(const nsString& aFontName)
{
char **fnames = nsnull;
PRInt32 namelen = aFontName.Length() + 1;
@@ -433,7 +433,7 @@ NS_IMETHODIMP nsDeviceContextUnix :: CheckFontExistence(const nsString& aFontNam
return rv;
}
void nsDeviceContextUnix::AllocColors()
void nsDeviceContextMotif::AllocColors()
{
uint8* index = new uint8[256];
@@ -485,7 +485,7 @@ void nsDeviceContextUnix::AllocColors()
}
NS_IMETHODIMP nsDeviceContextUnix::GetPaletteInfo(nsPaletteInfo& aPaletteInfo)
NS_IMETHODIMP nsDeviceContextMotif::GetPaletteInfo(nsPaletteInfo& aPaletteInfo)
{
aPaletteInfo.isPaletteDevice = mPaletteInfo.isPaletteDevice;
aPaletteInfo.sizePalette = mPaletteInfo.sizePalette;
@@ -495,7 +495,7 @@ NS_IMETHODIMP nsDeviceContextUnix::GetPaletteInfo(nsPaletteInfo& aPaletteInfo)
}
NS_IMETHODIMP nsDeviceContextUnix::GetILColorSpace(IL_ColorSpace*& aColorSpace)
NS_IMETHODIMP nsDeviceContextMotif::GetILColorSpace(IL_ColorSpace*& aColorSpace)
{
InstallColormap();

View File

@@ -16,8 +16,8 @@
* Reserved.
*/
#ifndef nsDeviceContextUnix_h___
#define nsDeviceContextUnix_h___
#ifndef nsDeviceContextMotif_h___
#define nsDeviceContextMotif_h___
#include "nsDeviceContext.h"
#include "nsUnitConversion.h"
@@ -35,7 +35,7 @@
#endif
/* nsDrawingSurface is actually the following struct */
struct nsDrawingSurfaceUnix {
struct nsDrawingSurfaceMotif {
Display *display ;
Drawable drawable ;
GC gc ;
@@ -48,10 +48,10 @@ struct nsDrawingSurfaceUnix {
};
class nsDeviceContextUnix : public DeviceContextImpl
class nsDeviceContextMotif : public DeviceContextImpl
{
public:
nsDeviceContextUnix();
nsDeviceContextMotif();
NS_DECL_ISUPPORTS
@@ -73,7 +73,7 @@ public:
protected:
~nsDeviceContextUnix();
~nsDeviceContextMotif();
void AllocColors();
uint8 AllocColor(uint8 aRed, uint8 aGreen,
uint8 aBlue, PRBool aCanAlloc);
@@ -81,7 +81,7 @@ protected:
Display *GetDisplay();
nsDrawingSurfaceUnix * mSurface ;
nsDrawingSurfaceMotif * mSurface ;
PRUint32 mDepth;
Visual * mVisual;
@@ -97,7 +97,7 @@ protected:
public:
void InstallColormap(void);
void InstallColormap(Display* aDisplay, Drawable aDrawable);
void SetDrawingSurface(nsDrawingSurfaceUnix * aSurface) { mSurface = aSurface; }
void SetDrawingSurface(nsDrawingSurfaceMotif * aSurface) { mSurface = aSurface; }
nsDrawingSurface GetDrawingSurface();
private:
@@ -113,4 +113,4 @@ private:
};
#endif /* nsDeviceContextUnix_h___ */
#endif /* nsDeviceContextMotif_h___ */

View File

@@ -17,8 +17,8 @@
*/
#include "xp_core.h" //this is a hack to get it to build. MMP
#include "nsFontMetricsUnix.h"
#include "nsDeviceContextUnix.h"
#include "nsFontMetricsMotif.h"
#include "nsDeviceContextMotif.h"
#include "nspr.h"
#include "nsCRT.h"
@@ -27,7 +27,7 @@ static NS_DEFINE_IID(kIFontMetricsIID, NS_IFONT_METRICS_IID);
//#define NOISY_FONTS
nsFontMetricsUnix :: nsFontMetricsUnix()
nsFontMetricsMotif :: nsFontMetricsMotif()
{
NS_INIT_REFCNT();
mFont = nsnull;
@@ -35,7 +35,7 @@ nsFontMetricsUnix :: nsFontMetricsUnix()
mFontInfo = nsnull;
}
nsFontMetricsUnix :: ~nsFontMetricsUnix()
nsFontMetricsMotif :: ~nsFontMetricsMotif()
{
if (nsnull != mFont) {
delete mFont;
@@ -49,9 +49,9 @@ nsFontMetricsUnix :: ~nsFontMetricsUnix()
}
}
NS_IMPL_ISUPPORTS(nsFontMetricsUnix, kIFontMetricsIID)
NS_IMPL_ISUPPORTS(nsFontMetricsMotif, kIFontMetricsIID)
NS_IMETHODIMP nsFontMetricsUnix :: Init(const nsFont& aFont, nsIDeviceContext* aCX)
NS_IMETHODIMP nsFontMetricsMotif :: Init(const nsFont& aFont, nsIDeviceContext* aCX)
{
NS_ASSERTION(!(nsnull == aCX), "attempt to init fontmetrics with null device context");
@@ -183,13 +183,13 @@ NS_IMETHODIMP nsFontMetricsUnix :: Init(const nsFont& aFont, nsIDeviceContext* a
}
NS_IMETHODIMP
nsFontMetricsUnix :: Destroy()
nsFontMetricsMotif :: Destroy()
{
// NS_IF_RELEASE(mDeviceContext);
return NS_OK;
}
char * nsFontMetricsUnix::PickAppropriateSize(char **names, XFontStruct *fonts, int cnt, nscoord desired)
char * nsFontMetricsMotif::PickAppropriateSize(char **names, XFontStruct *fonts, int cnt, nscoord desired)
{
int idx;
float app2dev;
@@ -237,7 +237,7 @@ char * nsFontMetricsUnix::PickAppropriateSize(char **names, XFontStruct *fonts,
}
}
void nsFontMetricsUnix::RealizeFont()
void nsFontMetricsMotif::RealizeFont()
{
nsNativeWidget widget;
mContext->GetNativeWidget(widget);
@@ -268,28 +268,28 @@ void nsFontMetricsUnix::RealizeFont()
}
NS_IMETHODIMP
nsFontMetricsUnix :: GetXHeight(nscoord& aResult)
nsFontMetricsMotif :: GetXHeight(nscoord& aResult)
{
aResult = mMaxAscent / 2; // XXX temporary code!
return NS_OK;
}
NS_IMETHODIMP
nsFontMetricsUnix :: GetSuperscriptOffset(nscoord& aResult)
nsFontMetricsMotif :: GetSuperscriptOffset(nscoord& aResult)
{
aResult = mMaxAscent / 2; // XXX temporary code!
return NS_OK;
}
NS_IMETHODIMP
nsFontMetricsUnix :: GetSubscriptOffset(nscoord& aResult)
nsFontMetricsMotif :: GetSubscriptOffset(nscoord& aResult)
{
aResult = mMaxAscent / 2; // XXX temporary code!
return NS_OK;
}
NS_IMETHODIMP
nsFontMetricsUnix :: GetStrikeout(nscoord& aOffset, nscoord& aSize)
nsFontMetricsMotif :: GetStrikeout(nscoord& aOffset, nscoord& aSize)
{
aOffset = 0; /* XXX */
aSize = 0; /* XXX */
@@ -297,50 +297,50 @@ nsFontMetricsUnix :: GetStrikeout(nscoord& aOffset, nscoord& aSize)
}
NS_IMETHODIMP
nsFontMetricsUnix :: GetUnderline(nscoord& aOffset, nscoord& aSize)
nsFontMetricsMotif :: GetUnderline(nscoord& aOffset, nscoord& aSize)
{
aOffset = 0; /* XXX */
aSize = 0; /* XXX */
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsUnix :: GetHeight(nscoord &aHeight)
NS_IMETHODIMP nsFontMetricsMotif :: GetHeight(nscoord &aHeight)
{
aHeight = mHeight;
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsUnix :: GetLeading(nscoord &aLeading)
NS_IMETHODIMP nsFontMetricsMotif :: GetLeading(nscoord &aLeading)
{
aLeading = mLeading;
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsUnix :: GetMaxAscent(nscoord &aAscent)
NS_IMETHODIMP nsFontMetricsMotif :: GetMaxAscent(nscoord &aAscent)
{
aAscent = mMaxAscent;
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsUnix :: GetMaxDescent(nscoord &aDescent)
NS_IMETHODIMP nsFontMetricsMotif :: GetMaxDescent(nscoord &aDescent)
{
aDescent = mMaxDescent;
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsUnix :: GetMaxAdvance(nscoord &aAdvance)
NS_IMETHODIMP nsFontMetricsMotif :: GetMaxAdvance(nscoord &aAdvance)
{
aAdvance = mMaxAdvance;
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsUnix :: GetFont(const nsFont*& aFont)
NS_IMETHODIMP nsFontMetricsMotif :: GetFont(const nsFont*& aFont)
{
aFont = mFont;
return NS_OK;
}
NS_IMETHODIMP nsFontMetricsUnix :: GetFontHandle(nsFontHandle &aHandle)
NS_IMETHODIMP nsFontMetricsMotif :: GetFontHandle(nsFontHandle &aHandle)
{
aHandle = (nsFontHandle)mFontHandle;
return NS_OK;

View File

@@ -16,8 +16,8 @@
* Reserved.
*/
#ifndef nsFontMetricsUnix_h__
#define nsFontMetricsUnix_h__
#ifndef nsFontMetricsMotif_h__
#define nsFontMetricsMotif_h__
#include "nsIFontMetrics.h"
#include "nsFont.h"
@@ -28,11 +28,11 @@
#include "X11/Xlib.h"
class nsFontMetricsUnix : public nsIFontMetrics
class nsFontMetricsMotif : public nsIFontMetrics
{
public:
nsFontMetricsUnix();
~nsFontMetricsUnix();
nsFontMetricsMotif();
~nsFontMetricsMotif();
void* operator new(size_t sz) {
void* rv = new char[sz];

View File

@@ -21,11 +21,11 @@
#include "nsIFactory.h"
#include "nsISupports.h"
#include "../nsGfxCIID.h"
#include "nsFontMetricsUnix.h"
#include "nsRenderingContextUnix.h"
#include "nsImageUnix.h"
#include "nsDeviceContextUnix.h"
#include "nsRegionUnix.h"
#include "nsFontMetricsMotif.h"
#include "nsRenderingContextMotif.h"
#include "nsImageMotif.h"
#include "nsDeviceContextMotif.h"
#include "nsRegionMotif.h"
static NS_DEFINE_IID(kCFontMetrics, NS_FONT_METRICS_CID);
static NS_DEFINE_IID(kCRenderingContext, NS_RENDERING_CONTEXT_CID);
@@ -36,7 +36,7 @@ static NS_DEFINE_IID(kCRegion, NS_REGION_CID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
class nsGfxFactoryUnix : public nsIFactory
class nsGfxFactoryMotif : public nsIFactory
{
public:
// nsISupports methods
@@ -52,26 +52,26 @@ class nsGfxFactoryUnix : public nsIFactory
NS_IMETHOD LockFactory(PRBool aLock);
nsGfxFactoryUnix(const nsCID &aClass);
~nsGfxFactoryUnix();
nsGfxFactoryMotif(const nsCID &aClass);
~nsGfxFactoryMotif();
private:
nsrefcnt mRefCnt;
nsCID mClassID;
};
nsGfxFactoryUnix::nsGfxFactoryUnix(const nsCID &aClass)
nsGfxFactoryMotif::nsGfxFactoryMotif(const nsCID &aClass)
{
mRefCnt = 0;
mClassID = aClass;
}
nsGfxFactoryUnix::~nsGfxFactoryUnix()
nsGfxFactoryMotif::~nsGfxFactoryMotif()
{
NS_ASSERTION(mRefCnt == 0, "non-zero refcnt at destruction");
}
nsresult nsGfxFactoryUnix::QueryInterface(const nsIID &aIID,
nsresult nsGfxFactoryMotif::QueryInterface(const nsIID &aIID,
void **aResult)
{
if (aResult == NULL) {
@@ -95,12 +95,12 @@ nsresult nsGfxFactoryUnix::QueryInterface(const nsIID &aIID,
return NS_OK;
}
nsrefcnt nsGfxFactoryUnix::AddRef()
nsrefcnt nsGfxFactoryMotif::AddRef()
{
return ++mRefCnt;
}
nsrefcnt nsGfxFactoryUnix::Release()
nsrefcnt nsGfxFactoryMotif::Release()
{
if (--mRefCnt == 0) {
delete this;
@@ -109,7 +109,7 @@ nsrefcnt nsGfxFactoryUnix::Release()
return mRefCnt;
}
nsresult nsGfxFactoryUnix::CreateInstance(nsISupports *aOuter,
nsresult nsGfxFactoryMotif::CreateInstance(nsISupports *aOuter,
const nsIID &aIID,
void **aResult)
{
@@ -122,19 +122,19 @@ nsresult nsGfxFactoryUnix::CreateInstance(nsISupports *aOuter,
nsISupports *inst = nsnull;
if (mClassID.Equals(kCFontMetrics)) {
inst = (nsISupports *)new nsFontMetricsUnix();
inst = (nsISupports *)new nsFontMetricsMotif();
}
else if (mClassID.Equals(kCDeviceContext)) {
inst = (nsISupports *)new nsDeviceContextUnix();
inst = (nsISupports *)new nsDeviceContextMotif();
}
else if (mClassID.Equals(kCRenderingContext)) {
inst = (nsISupports *)new nsRenderingContextUnix();
inst = (nsISupports *)new nsRenderingContextMotif();
}
else if (mClassID.Equals(kCImage)) {
inst = (nsISupports *)new nsImageUnix();
inst = (nsISupports *)new nsImageMotif();
}
else if (mClassID.Equals(kCRegion)) {
inst = (nsISupports *)new nsRegionUnix();
inst = (nsISupports *)new nsRegionMotif();
}
if (inst == NULL) {
@@ -154,7 +154,7 @@ nsresult nsGfxFactoryUnix::CreateInstance(nsISupports *aOuter,
return res;
}
nsresult nsGfxFactoryUnix::LockFactory(PRBool aLock)
nsresult nsGfxFactoryMotif::LockFactory(PRBool aLock)
{
// Not implemented in simplest case.
return NS_OK;
@@ -167,7 +167,7 @@ extern "C" NS_GFXNONXP nsresult NSGetFactory(const nsCID &aClass, nsIFactory **a
return NS_ERROR_NULL_POINTER;
}
*aFactory = new nsGfxFactoryUnix(aClass);
*aFactory = new nsGfxFactoryMotif(aClass);
if (nsnull == aFactory) {
return NS_ERROR_OUT_OF_MEMORY;

View File

@@ -17,9 +17,9 @@
*/
#include "xp_core.h" //this is a hack to get it to build. MMP
#include "nsImageUnix.h"
#include "nsRenderingContextUnix.h"
#include "nsDeviceContextUnix.h"
#include "nsImageMotif.h"
#include "nsRenderingContextMotif.h"
#include "nsDeviceContextMotif.h"
#include "nspr.h"
@@ -29,7 +29,7 @@ static NS_DEFINE_IID(kIImageIID, NS_IIMAGE_IID);
//------------------------------------------------------------
nsImageUnix :: nsImageUnix()
nsImageMotif :: nsImageMotif()
{
NS_INIT_REFCNT();
mImage = nsnull ;
@@ -47,7 +47,7 @@ nsImageUnix :: nsImageUnix()
//------------------------------------------------------------
nsImageUnix :: ~nsImageUnix()
nsImageMotif :: ~nsImageMotif()
{
if (nsnull != mImage) {
XDestroyImage(mImage);
@@ -73,11 +73,11 @@ nsImageUnix :: ~nsImageUnix()
}
NS_IMPL_ISUPPORTS(nsImageUnix, kIImageIID);
NS_IMPL_ISUPPORTS(nsImageMotif, kIImageIID);
//------------------------------------------------------------
nsresult nsImageUnix :: Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,nsMaskRequirements aMaskRequirements)
nsresult nsImageMotif :: Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,nsMaskRequirements aMaskRequirements)
{
if(nsnull != mImageBits)
delete[] (PRUint8*)mImageBits;
@@ -117,7 +117,7 @@ nsresult nsImageUnix :: Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,nsM
//------------------------------------------------------------
void nsImageUnix::ComputMetrics()
void nsImageMotif::ComputMetrics()
{
mRowBytes = CalcBytesSpan(mWidth);
@@ -128,7 +128,7 @@ void nsImageUnix::ComputMetrics()
//------------------------------------------------------------
// figure out how big our palette needs to be
void nsImageUnix :: ComputePaletteSize(PRIntn nBitCount)
void nsImageMotif :: ComputePaletteSize(PRIntn nBitCount)
{
switch (nBitCount)
{
@@ -153,7 +153,7 @@ void nsImageUnix :: ComputePaletteSize(PRIntn nBitCount)
//------------------------------------------------------------
PRInt32 nsImageUnix :: CalcBytesSpan(PRUint32 aWidth)
PRInt32 nsImageMotif :: CalcBytesSpan(PRUint32 aWidth)
{
PRInt32 spanbytes;
@@ -168,7 +168,7 @@ PRInt32 spanbytes;
//------------------------------------------------------------
// set up the pallete to the passed in color array, RGB only in this array
void nsImageUnix :: ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, nsRect *aUpdateRect)
void nsImageMotif :: ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, nsRect *aUpdateRect)
{
if (nsnull == mImage)
@@ -183,10 +183,10 @@ void nsImageUnix :: ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, nsR
//------------------------------------------------------------
// Draw the bitmap, this method has a source and destination coordinates
NS_IMETHODIMP nsImageUnix :: Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
NS_IMETHODIMP nsImageMotif :: Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight)
{
nsDrawingSurfaceUnix *unixdrawing =(nsDrawingSurfaceUnix*) aSurface;
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aSurface;
if ((PR_FALSE==mStaticImage) || (nsnull == mImage)) {
BuildImage(aSurface);
@@ -204,12 +204,12 @@ NS_IMETHODIMP nsImageUnix :: Draw(nsIRenderingContext &aContext, nsDrawingSurfac
//------------------------------------------------------------
// Draw the bitmap, this draw just has destination coordinates
NS_IMETHODIMP nsImageUnix :: Draw(nsIRenderingContext &aContext,
NS_IMETHODIMP nsImageMotif :: Draw(nsIRenderingContext &aContext,
nsDrawingSurface aSurface,
PRInt32 aX, PRInt32 aY,
PRInt32 aWidth, PRInt32 aHeight)
{
nsDrawingSurfaceUnix *unixdrawing =(nsDrawingSurfaceUnix*) aSurface;
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aSurface;
BuildImage(aSurface);
@@ -228,20 +228,20 @@ NS_IMETHODIMP nsImageUnix :: Draw(nsIRenderingContext &aContext,
//------------------------------------------------------------
void nsImageUnix::CompositeImage(nsIImage *aTheImage, nsPoint *aULLocation,nsBlendQuality aBlendQuality)
void nsImageMotif::CompositeImage(nsIImage *aTheImage, nsPoint *aULLocation,nsBlendQuality aBlendQuality)
{
}
//------------------------------------------------------------
// lets build an alpha mask from this image
PRBool nsImageUnix::SetAlphaMask(nsIImage *aTheMask)
PRBool nsImageMotif::SetAlphaMask(nsIImage *aTheMask)
{
PRInt32 num;
PRUint8 *srcbits;
if (aTheMask &&
(((nsImageUnix*)aTheMask)->mNumBytesPixel == 1)) {
(((nsImageMotif*)aTheMask)->mNumBytesPixel == 1)) {
mLocation.x = 0;
mLocation.y = 0;
mAlphaDepth = 8;
@@ -261,7 +261,7 @@ PRUint8 *srcbits;
}
void nsImageUnix::AllocConvertedBits(PRUint32 aSize)
void nsImageMotif::AllocConvertedBits(PRUint32 aSize)
{
if (nsnull == mConvertedBits)
mConvertedBits = (PRUint8*) new PRUint8[aSize];
@@ -269,9 +269,9 @@ void nsImageUnix::AllocConvertedBits(PRUint32 aSize)
//------------------------------------------------------------
void nsImageUnix::ConvertImage(nsDrawingSurface aDrawingSurface)
void nsImageMotif::ConvertImage(nsDrawingSurface aDrawingSurface)
{
nsDrawingSurfaceUnix *unixdrawing =(nsDrawingSurfaceUnix*) aDrawingSurface;
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aDrawingSurface;
PRUint8 *tempbuffer,*cursrc,*curdest;
PRInt32 x,y;
PRUint16 red,green,blue,*cur16;
@@ -359,7 +359,7 @@ PRUint16 red,green,blue,*cur16;
#endif
}
nsresult nsImageUnix::BuildImage(nsDrawingSurface aDrawingSurface)
nsresult nsImageMotif::BuildImage(nsDrawingSurface aDrawingSurface)
{
if (nsnull != mImage) {
// XDestroyImage(mImage);
@@ -374,7 +374,7 @@ nsresult nsImageUnix::BuildImage(nsDrawingSurface aDrawingSurface)
//------------------------------------------------------------
nsresult nsImageUnix::Optimize(nsIDeviceContext* aContext)
nsresult nsImageMotif::Optimize(nsIDeviceContext* aContext)
{
mStaticImage = PR_TRUE;
#if 0
@@ -385,12 +385,12 @@ nsresult nsImageUnix::Optimize(nsIDeviceContext* aContext)
//------------------------------------------------------------
void nsImageUnix::CreateImage(nsDrawingSurface aSurface)
void nsImageMotif::CreateImage(nsDrawingSurface aSurface)
{
PRUint32 wdepth;
Visual * visual ;
PRUint32 format ;
nsDrawingSurfaceUnix *unixdrawing =(nsDrawingSurfaceUnix*) aSurface;
nsDrawingSurfaceMotif *unixdrawing =(nsDrawingSurfaceMotif*) aSurface;
if(mImageBits) {
format = ZPixmap;

View File

@@ -16,19 +16,19 @@
* Reserved.
*/
#ifndef nsImageUnix_h___
#define nsImageUnix_h___
#ifndef nsImageMotif_h___
#define nsImageMotif_h___
#include "nsIImage.h"
#include "X11/Xlib.h"
#include "X11/Xutil.h"
class nsImageUnix : public nsIImage
class nsImageMotif : public nsIImage
{
public:
nsImageUnix();
~nsImageUnix();
nsImageMotif();
~nsImageMotif();
NS_DECL_ISUPPORTS

View File

@@ -16,11 +16,11 @@
* Reserved.
*/
#include "nsRegionUnix.h"
#include "nsRegionMotif.h"
static NS_DEFINE_IID(kRegionIID, NS_IREGION_IID);
nsRegionUnix :: nsRegionUnix()
nsRegionMotif :: nsRegionMotif()
{
NS_INIT_REFCNT();
@@ -28,18 +28,18 @@ nsRegionUnix :: nsRegionUnix()
mRegionType = eRegionType_empty;
}
nsRegionUnix :: ~nsRegionUnix()
nsRegionMotif :: ~nsRegionMotif()
{
if (mRegion)
::XDestroyRegion(mRegion);
mRegion = nsnull;
}
NS_IMPL_QUERY_INTERFACE(nsRegionUnix, kRegionIID)
NS_IMPL_ADDREF(nsRegionUnix)
NS_IMPL_RELEASE(nsRegionUnix)
NS_IMPL_QUERY_INTERFACE(nsRegionMotif, kRegionIID)
NS_IMPL_ADDREF(nsRegionMotif)
NS_IMPL_RELEASE(nsRegionMotif)
nsresult nsRegionUnix :: Init(void)
nsresult nsRegionMotif :: Init(void)
{
mRegion = ::XCreateRegion();
mRegionType = eRegionType_empty;
@@ -47,9 +47,9 @@ nsresult nsRegionUnix :: Init(void)
return NS_OK;
}
void nsRegionUnix :: SetTo(const nsIRegion &aRegion)
void nsRegionMotif :: SetTo(const nsIRegion &aRegion)
{
nsRegionUnix * pRegion = (nsRegionUnix *)&aRegion;
nsRegionMotif * pRegion = (nsRegionMotif *)&aRegion;
SetRegionEmpty();
@@ -58,7 +58,7 @@ void nsRegionUnix :: SetTo(const nsIRegion &aRegion)
SetRegionType();
}
void nsRegionUnix :: SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
void nsRegionMotif :: SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
{
SetRegionEmpty();
@@ -75,16 +75,16 @@ void nsRegionUnix :: SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeig
SetRegionType();
}
void nsRegionUnix :: Intersect(const nsIRegion &aRegion)
void nsRegionMotif :: Intersect(const nsIRegion &aRegion)
{
nsRegionUnix * pRegion = (nsRegionUnix *)&aRegion;
nsRegionMotif * pRegion = (nsRegionMotif *)&aRegion;
::XIntersectRegion(mRegion, pRegion->mRegion, mRegion);
SetRegionType();
}
void nsRegionUnix :: Intersect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
void nsRegionMotif :: Intersect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
{
Region tRegion = CreateRectRegion(aX, aY, aWidth, aHeight);
@@ -96,9 +96,9 @@ void nsRegionUnix :: Intersect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 a
}
void nsRegionUnix :: Union(const nsIRegion &aRegion)
void nsRegionMotif :: Union(const nsIRegion &aRegion)
{
nsRegionUnix * pRegion = (nsRegionUnix *)&aRegion;
nsRegionMotif * pRegion = (nsRegionMotif *)&aRegion;
::XUnionRegion(mRegion, pRegion->mRegion, mRegion);
@@ -106,7 +106,7 @@ void nsRegionUnix :: Union(const nsIRegion &aRegion)
}
void nsRegionUnix :: Union(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
void nsRegionMotif :: Union(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
{
Region tRegion = CreateRectRegion(aX, aY, aWidth, aHeight);
@@ -119,9 +119,9 @@ void nsRegionUnix :: Union(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeig
}
void nsRegionUnix :: Subtract(const nsIRegion &aRegion)
void nsRegionMotif :: Subtract(const nsIRegion &aRegion)
{
nsRegionUnix * pRegion = (nsRegionUnix *)&aRegion;
nsRegionMotif * pRegion = (nsRegionMotif *)&aRegion;
::XSubtractRegion(mRegion, pRegion->mRegion, mRegion);
@@ -129,7 +129,7 @@ void nsRegionUnix :: Subtract(const nsIRegion &aRegion)
}
void nsRegionUnix :: Subtract(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
void nsRegionMotif :: Subtract(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
{
Region tRegion = CreateRectRegion(aX, aY, aWidth, aHeight);
@@ -141,7 +141,7 @@ void nsRegionUnix :: Subtract(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aH
}
PRBool nsRegionUnix :: IsEmpty(void)
PRBool nsRegionMotif :: IsEmpty(void)
{
if (mRegionType == eRegionType_empty)
return PR_TRUE;
@@ -149,15 +149,15 @@ PRBool nsRegionUnix :: IsEmpty(void)
return PR_FALSE;
}
PRBool nsRegionUnix :: IsEqual(const nsIRegion &aRegion)
PRBool nsRegionMotif :: IsEqual(const nsIRegion &aRegion)
{
nsRegionUnix * pRegion = (nsRegionUnix *)&aRegion;
nsRegionMotif * pRegion = (nsRegionMotif *)&aRegion;
return(::XEqualRegion(mRegion, pRegion->mRegion));
}
void nsRegionUnix :: GetBoundingBox(PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, PRInt32 *aHeight)
void nsRegionMotif :: GetBoundingBox(PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, PRInt32 *aHeight)
{
XRectangle rect;
@@ -169,12 +169,12 @@ void nsRegionUnix :: GetBoundingBox(PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, P
*aHeight = rect.height;
}
void nsRegionUnix :: Offset(PRInt32 aXOffset, PRInt32 aYOffset)
void nsRegionMotif :: Offset(PRInt32 aXOffset, PRInt32 aYOffset)
{
::XOffsetRegion(mRegion, aXOffset, aYOffset);
}
PRBool nsRegionUnix :: ContainsRect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
PRBool nsRegionMotif :: ContainsRect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
{
PRInt32 containment;
@@ -187,18 +187,18 @@ PRBool nsRegionUnix :: ContainsRect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRIn
}
PRBool nsRegionUnix :: ForEachRect(nsRectInRegionFunc *func, void *closure)
PRBool nsRegionMotif :: ForEachRect(nsRectInRegionFunc *func, void *closure)
{
return PR_FALSE;
}
Region nsRegionUnix :: GetXRegion(void)
Region nsRegionMotif :: GetXRegion(void)
{
return (mRegion);
}
void nsRegionUnix :: SetRegionType()
void nsRegionMotif :: SetRegionType()
{
if (::XEmptyRegion(mRegion) == True)
mRegionType = eRegionType_empty;
@@ -206,13 +206,13 @@ void nsRegionUnix :: SetRegionType()
mRegionType = eRegionType_rect ;
}
void nsRegionUnix :: SetRegionEmpty()
void nsRegionMotif :: SetRegionEmpty()
{
::XDestroyRegion(mRegion);
mRegion = ::XCreateRegion();
}
Region nsRegionUnix :: CreateRectRegion(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
Region nsRegionMotif :: CreateRectRegion(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight)
{
Region r = ::XCreateRegion();

View File

@@ -16,8 +16,8 @@
* Reserved.
*/
#ifndef nsRegionUnix_h___
#define nsRegionUnix_h___
#ifndef nsRegionMotif_h___
#define nsRegionMotif_h___
#include "nsIRegion.h"
@@ -32,11 +32,11 @@ enum nsRegionType {
};
class nsRegionUnix : public nsIRegion
class nsRegionMotif : public nsIRegion
{
public:
nsRegionUnix();
~nsRegionUnix();
nsRegionMotif();
~nsRegionMotif();
NS_DECL_ISUPPORTS
@@ -70,4 +70,4 @@ private:
};
#endif // nsRegionUnix_h___
#endif // nsRegionMotif_h___

View File

@@ -18,13 +18,13 @@
#include "xp_core.h" //this is a hack to get it to build. MMP
#include "nsRenderingContextUnix.h"
#include "nsDeviceContextUnix.h"
#include "nsRenderingContextMotif.h"
#include "nsDeviceContextMotif.h"
#include <math.h>
#include "nspr.h"
#include "nsRegionUnix.h"
#include "nsRegionMotif.h"
#include "nsGfxCIID.h"
#include "X11/Xlib.h"
@@ -76,7 +76,7 @@ GraphicsState :: ~GraphicsState()
static NS_DEFINE_IID(kRenderingContextIID, NS_IRENDERING_CONTEXT_IID);
nsRenderingContextUnix :: nsRenderingContextUnix()
nsRenderingContextMotif :: nsRenderingContextMotif()
{
NS_INIT_REFCNT();
@@ -100,7 +100,7 @@ nsRenderingContextUnix :: nsRenderingContextUnix()
}
nsRenderingContextUnix :: ~nsRenderingContextUnix()
nsRenderingContextMotif :: ~nsRenderingContextMotif()
{
if (mRegion) {
::XDestroyRegion(mRegion);
@@ -141,12 +141,12 @@ nsRenderingContextUnix :: ~nsRenderingContextUnix()
}
NS_IMPL_QUERY_INTERFACE(nsRenderingContextUnix, kRenderingContextIID)
NS_IMPL_ADDREF(nsRenderingContextUnix)
NS_IMPL_RELEASE(nsRenderingContextUnix)
NS_IMPL_QUERY_INTERFACE(nsRenderingContextMotif, kRenderingContextIID)
NS_IMPL_ADDREF(nsRenderingContextMotif)
NS_IMPL_RELEASE(nsRenderingContextMotif)
NS_IMETHODIMP
nsRenderingContextUnix :: Init(nsIDeviceContext* aContext,
nsRenderingContextMotif :: Init(nsIDeviceContext* aContext,
nsIWidget *aWindow)
{
@@ -156,7 +156,7 @@ nsRenderingContextUnix :: Init(nsIDeviceContext* aContext,
mContext = aContext;
NS_IF_ADDREF(mContext);
mRenderingSurface = new nsDrawingSurfaceUnix();
mRenderingSurface = new nsDrawingSurfaceMotif();
#ifdef MITSHM
mRenderingSurface->shmImage = nsnull;
@@ -181,27 +181,27 @@ nsRenderingContextUnix :: Init(nsIDeviceContext* aContext,
}
NS_IMETHODIMP
nsRenderingContextUnix :: Init(nsIDeviceContext* aContext,
nsRenderingContextMotif :: Init(nsIDeviceContext* aContext,
nsDrawingSurface aSurface)
{
mContext = aContext;
NS_IF_ADDREF(mContext);
mRenderingSurface = (nsDrawingSurfaceUnix *) aSurface;
mRenderingSurface = (nsDrawingSurfaceMotif *) aSurface;
return (CommonInit());
}
NS_IMETHODIMP nsRenderingContextUnix :: CommonInit()
NS_IMETHODIMP nsRenderingContextMotif :: CommonInit()
{
#ifdef MITSHM
PRInt32 shmMajor, shmMinor ;
#endif
((nsDeviceContextUnix *)mContext)->SetDrawingSurface(mRenderingSurface);
((nsDeviceContextUnix *)mContext)->InstallColormap();
((nsDeviceContextMotif *)mContext)->SetDrawingSurface(mRenderingSurface);
((nsDeviceContextMotif *)mContext)->InstallColormap();
mContext->GetDevUnitsToAppUnits(mP2T);
float app2dev;
@@ -235,18 +235,18 @@ NS_IMETHODIMP nsRenderingContextUnix :: CommonInit()
}
NS_IMETHODIMP
nsRenderingContextUnix :: SelectOffScreenDrawingSurface(nsDrawingSurface aSurface)
nsRenderingContextMotif :: SelectOffScreenDrawingSurface(nsDrawingSurface aSurface)
{
if (nsnull == aSurface)
mRenderingSurface = mFrontBuffer;
else
mRenderingSurface = (nsDrawingSurfaceUnix *)aSurface;
mRenderingSurface = (nsDrawingSurfaceMotif *)aSurface;
return NS_OK;
}
NS_IMETHODIMP
nsRenderingContextUnix::GetHints(PRUint32& aResult)
nsRenderingContextMotif::GetHints(PRUint32& aResult)
{
PRUint32 result = 0;
@@ -262,19 +262,19 @@ nsRenderingContextUnix::GetHints(PRUint32& aResult)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: Reset(void)
NS_IMETHODIMP nsRenderingContextMotif :: Reset(void)
{
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetDeviceContext(nsIDeviceContext *&aContext)
NS_IMETHODIMP nsRenderingContextMotif :: GetDeviceContext(nsIDeviceContext *&aContext)
{
NS_IF_ADDREF(mContext);
aContext = mContext;
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: PushState(void)
NS_IMETHODIMP nsRenderingContextMotif :: PushState(void)
{
nsRect rect;
@@ -314,7 +314,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: PushState(void)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: PopState(PRBool &aClipEmpty)
NS_IMETHODIMP nsRenderingContextMotif :: PopState(PRBool &aClipEmpty)
{
PRBool bEmpty = PR_FALSE;
@@ -364,13 +364,13 @@ NS_IMETHODIMP nsRenderingContextUnix :: PopState(PRBool &aClipEmpty)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: IsVisibleRect(const nsRect& aRect, PRBool &aVisible)
NS_IMETHODIMP nsRenderingContextMotif :: IsVisibleRect(const nsRect& aRect, PRBool &aVisible)
{
aVisible = PR_TRUE;
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: SetClipRectInPixels(const nsRect& aRect, nsClipCombine aCombine, PRBool &aClipEmpty)
NS_IMETHODIMP nsRenderingContextMotif :: SetClipRectInPixels(const nsRect& aRect, nsClipCombine aCombine, PRBool &aClipEmpty)
{
PRBool bEmpty = PR_FALSE;
@@ -462,7 +462,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: SetClipRectInPixels(const nsRect& aRect,
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: SetClipRect(const nsRect& aRect, nsClipCombine aCombine, PRBool &aClipEmpty)
NS_IMETHODIMP nsRenderingContextMotif :: SetClipRect(const nsRect& aRect, nsClipCombine aCombine, PRBool &aClipEmpty)
{
nsRect trect = aRect;
@@ -471,7 +471,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: SetClipRect(const nsRect& aRect, nsClipC
return SetClipRectInPixels(trect, aCombine, aClipEmpty);
}
NS_IMETHODIMP nsRenderingContextUnix :: GetClipRect(nsRect &aRect, PRBool &aClipValid)
NS_IMETHODIMP nsRenderingContextMotif :: GetClipRect(nsRect &aRect, PRBool &aClipValid)
{
if (mRegion != nsnull) {
XRectangle xrect;
@@ -491,12 +491,12 @@ NS_IMETHODIMP nsRenderingContextUnix :: GetClipRect(nsRect &aRect, PRBool &aClip
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: SetClipRegion(const nsIRegion& aRegion, nsClipCombine aCombine, PRBool &aClipEmpty)
NS_IMETHODIMP nsRenderingContextMotif :: SetClipRegion(const nsIRegion& aRegion, nsClipCombine aCombine, PRBool &aClipEmpty)
{
nsRect rect;
XRectangle xrect;
nsRegionUnix *pRegion = (nsRegionUnix *)&aRegion;
nsRegionMotif *pRegion = (nsRegionMotif *)&aRegion;
Region xregion = pRegion->GetXRegion();
::XClipBox(xregion, &xrect);
@@ -516,7 +516,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: SetClipRegion(const nsIRegion& aRegion,
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetClipRegion(nsIRegion **aRegion)
NS_IMETHODIMP nsRenderingContextMotif :: GetClipRegion(nsIRegion **aRegion)
{
nsIRegion * pRegion ;
@@ -540,7 +540,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: GetClipRegion(nsIRegion **aRegion)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: SetColor(nscolor aColor)
NS_IMETHODIMP nsRenderingContextMotif :: SetColor(nscolor aColor)
{
if (nsnull == mContext)
return NS_ERROR_FAILURE;
@@ -561,13 +561,13 @@ NS_IMETHODIMP nsRenderingContextUnix :: SetColor(nscolor aColor)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetColor(nscolor &aColor) const
NS_IMETHODIMP nsRenderingContextMotif :: GetColor(nscolor &aColor) const
{
aColor = mCurrentColor;
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: SetLineStyle(nsLineStyle aLineStyle)
NS_IMETHODIMP nsRenderingContextMotif :: SetLineStyle(nsLineStyle aLineStyle)
{
if (aLineStyle != mCurrentLineStyle)
{
@@ -610,13 +610,13 @@ NS_IMETHODIMP nsRenderingContextUnix :: SetLineStyle(nsLineStyle aLineStyle)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetLineStyle(nsLineStyle &aLineStyle)
NS_IMETHODIMP nsRenderingContextMotif :: GetLineStyle(nsLineStyle &aLineStyle)
{
aLineStyle = mCurrentLineStyle;
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: SetFont(const nsFont& aFont)
NS_IMETHODIMP nsRenderingContextMotif :: SetFont(const nsFont& aFont)
{
NS_IF_RELEASE(mFontMetrics);
mContext->GetMetricsFor(aFont, mFontMetrics);
@@ -639,7 +639,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: SetFont(const nsFont& aFont)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: SetFont(nsIFontMetrics *aFontMetrics)
NS_IMETHODIMP nsRenderingContextMotif :: SetFont(nsIFontMetrics *aFontMetrics)
{
NS_IF_RELEASE(mFontMetrics);
mFontMetrics = aFontMetrics;
@@ -666,7 +666,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: SetFont(nsIFontMetrics *aFontMetrics)
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetFontMetrics(nsIFontMetrics *&aFontMetrics)
NS_IMETHODIMP nsRenderingContextMotif :: GetFontMetrics(nsIFontMetrics *&aFontMetrics)
{
NS_IF_ADDREF(mFontMetrics);
aFontMetrics = mFontMetrics;
@@ -675,26 +675,26 @@ NS_IMETHODIMP nsRenderingContextUnix :: GetFontMetrics(nsIFontMetrics *&aFontMet
}
// add the passed in translation to the current translation
NS_IMETHODIMP nsRenderingContextUnix :: Translate(nscoord aX, nscoord aY)
NS_IMETHODIMP nsRenderingContextMotif :: Translate(nscoord aX, nscoord aY)
{
mTMatrix->AddTranslation((float)aX,(float)aY);
return NS_OK;
}
// add the passed in scale to the current scale
NS_IMETHODIMP nsRenderingContextUnix :: Scale(float aSx, float aSy)
NS_IMETHODIMP nsRenderingContextMotif :: Scale(float aSx, float aSy)
{
mTMatrix->AddScale(aSx, aSy);
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetCurrentTransform(nsTransform2D *&aTransform)
NS_IMETHODIMP nsRenderingContextMotif :: GetCurrentTransform(nsTransform2D *&aTransform)
{
aTransform = mTMatrix;
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: CreateDrawingSurface(nsRect *aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface)
NS_IMETHODIMP nsRenderingContextMotif :: CreateDrawingSurface(nsRect *aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface)
{
if (nsnull == mRenderingSurface) {
aSurface = nsnull;
@@ -790,7 +790,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: CreateDrawingSurface(nsRect *aBounds, PR
w, h, depth);
nsDrawingSurfaceUnix * surface = new nsDrawingSurfaceUnix();
nsDrawingSurfaceMotif * surface = new nsDrawingSurfaceMotif();
surface->drawable = p ;
surface->display = mRenderingSurface->display;
@@ -812,9 +812,9 @@ NS_IMETHODIMP nsRenderingContextUnix :: CreateDrawingSurface(nsRect *aBounds, PR
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: DestroyDrawingSurface(nsDrawingSurface aDS)
NS_IMETHODIMP nsRenderingContextMotif :: DestroyDrawingSurface(nsDrawingSurface aDS)
{
nsDrawingSurfaceUnix * surface = (nsDrawingSurfaceUnix *) aDS;
nsDrawingSurfaceMotif * surface = (nsDrawingSurfaceMotif *) aDS;
#ifdef MITSHM
if (surface->shmImage != nsnull) {
@@ -839,7 +839,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: DestroyDrawingSurface(nsDrawingSurface a
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1)
NS_IMETHODIMP nsRenderingContextMotif :: DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -855,7 +855,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawLine(nscoord aX0, nscoord aY0, nscoo
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
NS_IMETHODIMP nsRenderingContextMotif :: DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -883,12 +883,12 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawPolyline(const nsPoint aPoints[], PR
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawRect(const nsRect& aRect)
NS_IMETHODIMP nsRenderingContextMotif :: DrawRect(const nsRect& aRect)
{
return DrawRect(aRect.x, aRect.y, aRect.width, aRect.height);
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
NS_IMETHODIMP nsRenderingContextMotif :: DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -911,12 +911,12 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawRect(nscoord aX, nscoord aY, nscoord
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: FillRect(const nsRect& aRect)
NS_IMETHODIMP nsRenderingContextMotif :: FillRect(const nsRect& aRect)
{
return FillRect(aRect.x, aRect.y, aRect.width, aRect.height);
}
NS_IMETHODIMP nsRenderingContextUnix :: FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
NS_IMETHODIMP nsRenderingContextMotif :: FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -937,7 +937,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: FillRect(nscoord aX, nscoord aY, nscoord
}
NS_IMETHODIMP nsRenderingContextUnix::DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints)
NS_IMETHODIMP nsRenderingContextMotif::DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -965,7 +965,7 @@ NS_IMETHODIMP nsRenderingContextUnix::DrawPolygon(const nsPoint aPoints[], PRInt
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix::FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints)
NS_IMETHODIMP nsRenderingContextMotif::FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -996,12 +996,12 @@ NS_IMETHODIMP nsRenderingContextUnix::FillPolygon(const nsPoint aPoints[], PRInt
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawEllipse(const nsRect& aRect)
NS_IMETHODIMP nsRenderingContextMotif :: DrawEllipse(const nsRect& aRect)
{
return DrawEllipse(aRect.x, aRect.y, aRect.width, aRect.height);
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
NS_IMETHODIMP nsRenderingContextMotif :: DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -1023,12 +1023,12 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawEllipse(nscoord aX, nscoord aY, nsco
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: FillEllipse(const nsRect& aRect)
NS_IMETHODIMP nsRenderingContextMotif :: FillEllipse(const nsRect& aRect)
{
return FillEllipse(aRect.x, aRect.y, aRect.width, aRect.height);
}
NS_IMETHODIMP nsRenderingContextUnix :: FillEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
NS_IMETHODIMP nsRenderingContextMotif :: FillEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
return NS_ERROR_FAILURE;
@@ -1050,13 +1050,13 @@ NS_IMETHODIMP nsRenderingContextUnix :: FillEllipse(nscoord aX, nscoord aY, nsco
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawArc(const nsRect& aRect,
NS_IMETHODIMP nsRenderingContextMotif :: DrawArc(const nsRect& aRect,
float aStartAngle, float aEndAngle)
{
return DrawArc(aRect.x,aRect.y,aRect.width,aRect.height,aStartAngle,aEndAngle);
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
NS_IMETHODIMP nsRenderingContextMotif :: DrawArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
float aStartAngle, float aEndAngle)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
@@ -1080,13 +1080,13 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawArc(nscoord aX, nscoord aY, nscoord
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: FillArc(const nsRect& aRect,
NS_IMETHODIMP nsRenderingContextMotif :: FillArc(const nsRect& aRect,
float aStartAngle, float aEndAngle)
{
return FillArc(aRect.x, aRect.y, aRect.width, aRect.height, aStartAngle, aEndAngle);
}
NS_IMETHODIMP nsRenderingContextUnix :: FillArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
NS_IMETHODIMP nsRenderingContextMotif :: FillArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
float aStartAngle, float aEndAngle)
{
if (nsnull == mTMatrix || nsnull == mRenderingSurface) {
@@ -1110,31 +1110,31 @@ NS_IMETHODIMP nsRenderingContextUnix :: FillArc(nscoord aX, nscoord aY, nscoord
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(char ch, nscoord &aWidth)
NS_IMETHODIMP nsRenderingContextMotif :: GetWidth(char ch, nscoord &aWidth)
{
char buf[1];
buf[0] = ch;
return GetWidth(buf, 1, aWidth);
}
NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(PRUnichar ch, nscoord &aWidth)
NS_IMETHODIMP nsRenderingContextMotif :: GetWidth(PRUnichar ch, nscoord &aWidth)
{
PRUnichar buf[1];
buf[0] = ch;
return GetWidth(buf, 1, aWidth);
}
NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(const nsString& aString, nscoord &aWidth)
NS_IMETHODIMP nsRenderingContextMotif :: GetWidth(const nsString& aString, nscoord &aWidth)
{
return GetWidth(aString.GetUnicode(), aString.Length(), aWidth);
}
NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(const char *aString, nscoord &aWidth)
NS_IMETHODIMP nsRenderingContextMotif :: GetWidth(const char *aString, nscoord &aWidth)
{
return GetWidth(aString, strlen(aString), aWidth);
}
NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(const char *aString,
NS_IMETHODIMP nsRenderingContextMotif :: GetWidth(const char *aString,
PRUint32 aLength, nscoord &aWidth)
{
PRInt32 rc;
@@ -1147,7 +1147,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(const char *aString,
return NS_OK;
}
NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(const PRUnichar *aString,
NS_IMETHODIMP nsRenderingContextMotif :: GetWidth(const PRUnichar *aString,
PRUint32 aLength,
nscoord &aWidth)
{
@@ -1188,7 +1188,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: GetWidth(const PRUnichar *aString,
}
NS_IMETHODIMP
nsRenderingContextUnix :: DrawString(const char *aString, PRUint32 aLength,
nsRenderingContextMotif :: DrawString(const char *aString, PRUint32 aLength,
nscoord aX, nscoord aY,
nscoord aWidth,
const nscoord* aSpacing)
@@ -1243,7 +1243,7 @@ nsRenderingContextUnix :: DrawString(const char *aString, PRUint32 aLength,
}
NS_IMETHODIMP
nsRenderingContextUnix :: DrawString(const PRUnichar *aString, PRUint32 aLength,
nsRenderingContextMotif :: DrawString(const PRUnichar *aString, PRUint32 aLength,
nscoord aX, nscoord aY, nscoord aWidth,
const nscoord* aSpacing)
{
@@ -1320,14 +1320,14 @@ nsRenderingContextUnix :: DrawString(const PRUnichar *aString, PRUint32 aLength,
}
NS_IMETHODIMP
nsRenderingContextUnix :: DrawString(const nsString& aString,
nsRenderingContextMotif :: DrawString(const nsString& aString,
nscoord aX, nscoord aY, nscoord aWidth,
const nscoord* aSpacing)
{
return DrawString(aString.GetUnicode(), aString.Length(), aX, aY, aWidth, aSpacing);
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY)
NS_IMETHODIMP nsRenderingContextMotif :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY)
{
nscoord width,height;
width = NSToCoordRound(mP2T * aImage->GetWidth());
@@ -1336,7 +1336,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, nscoord aX,
return DrawImage(aImage,aX,aY,width,height);
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
NS_IMETHODIMP nsRenderingContextMotif :: DrawImage(nsIImage *aImage, nscoord aX, nscoord aY,
nscoord aWidth, nscoord aHeight)
{
nsRect tr;
@@ -1349,7 +1349,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, nscoord aX,
return DrawImage(aImage,tr);
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)
NS_IMETHODIMP nsRenderingContextMotif :: DrawImage(nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect)
{
nsRect sr,dr;
@@ -1363,7 +1363,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, const nsRect
dr.x,dr.y,dr.width,dr.height);
}
NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, const nsRect& aRect)
NS_IMETHODIMP nsRenderingContextMotif :: DrawImage(nsIImage *aImage, const nsRect& aRect)
{
nsRect tr;
@@ -1374,7 +1374,7 @@ NS_IMETHODIMP nsRenderingContextUnix :: DrawImage(nsIImage *aImage, const nsRect
}
NS_IMETHODIMP
nsRenderingContextUnix :: CopyOffScreenBits(nsDrawingSurface aSrcSurf,
nsRenderingContextMotif :: CopyOffScreenBits(nsDrawingSurface aSrcSurf,
PRInt32 aSrcX, PRInt32 aSrcY,
const nsRect &aDestBounds,
PRUint32 aCopyFlags)
@@ -1382,7 +1382,7 @@ nsRenderingContextUnix :: CopyOffScreenBits(nsDrawingSurface aSrcSurf,
PRInt32 x = aSrcX;
PRInt32 y = aSrcY;
nsRect drect = aDestBounds;
nsDrawingSurfaceUnix *destsurf;
nsDrawingSurfaceMotif *destsurf;
if (aCopyFlags & NS_COPYBITS_TO_BACK_BUFFER)
{
@@ -1401,10 +1401,10 @@ nsRenderingContextUnix :: CopyOffScreenBits(nsDrawingSurface aSrcSurf,
//XXX flags are unused. that would seem to mean that there is
//inefficiency somewhere... MMP
::XCopyArea(((nsDrawingSurfaceUnix *)aSrcSurf)->display,
((nsDrawingSurfaceUnix *)aSrcSurf)->drawable,
::XCopyArea(((nsDrawingSurfaceMotif *)aSrcSurf)->display,
((nsDrawingSurfaceMotif *)aSrcSurf)->drawable,
destsurf->drawable,
((nsDrawingSurfaceUnix *)aSrcSurf)->gc,
((nsDrawingSurfaceMotif *)aSrcSurf)->gc,
x, y, drect.width, drect.height,
drect.x, drect.y);

View File

@@ -16,8 +16,8 @@
* Reserved.
*/
#ifndef nsRenderingContextUnix_h___
#define nsRenderingContextUnix_h___
#ifndef nsRenderingContextMotif_h___
#define nsRenderingContextMotif_h___
#include "nsIRenderingContext.h"
#include "nsUnitConversion.h"
@@ -30,11 +30,11 @@
#include "nsIViewManager.h"
#include "nsIWidget.h"
#include "nsRect.h"
#include "nsImageUnix.h"
#include "nsImageMotif.h"
#include "nsIDeviceContext.h"
#include "nsVoidArray.h"
#include "nsIRegion.h"
#include "nsDeviceContextUnix.h"
#include "nsDeviceContextMotif.h"
#include "X11/Xlib.h"
#include "X11/Xutil.h"
@@ -47,11 +47,11 @@
class GraphicsState;
class nsRenderingContextUnix : public nsIRenderingContext
class nsRenderingContextMotif : public nsIRenderingContext
{
public:
nsRenderingContextUnix();
~nsRenderingContextUnix();
nsRenderingContextMotif();
~nsRenderingContextMotif();
void* operator new(size_t sz) {
void* rv = new char[sz];
@@ -162,8 +162,8 @@ protected:
nsTransform2D *mTMatrix; // transform that all the graphics drawn here will obey
float mP2T;
nsDrawingSurfaceUnix *mRenderingSurface; // Can be a BackBuffer if Selected in
nsDrawingSurfaceUnix *mFrontBuffer;
nsDrawingSurfaceMotif *mRenderingSurface; // Can be a BackBuffer if Selected in
nsDrawingSurfaceMotif *mFrontBuffer;
nsIDeviceContext *mContext;
nsIFontMetrics *mFontMetrics;
Region mRegion;
@@ -183,4 +183,4 @@ private:
};
#endif /* nsRenderingContextUnix_h___ */
#endif /* nsRenderingContextMotif_h___ */