mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 13:57:32 +00:00
# 37239
r= mkaply@us.ibm.com OS/2 bring up continues - OS/2 specific changes
This commit is contained in:
parent
4759075517
commit
b21a2a4d57
@ -75,6 +75,8 @@ OS_LIBS += $(NSPR_LIBS)
|
|||||||
# I guess eventually we ought to use an xml dialog...
|
# I guess eventually we ought to use an xml dialog...
|
||||||
# XXX Have to copy files because rc is too stupid for an objdir build
|
# XXX Have to copy files because rc is too stupid for an objdir build
|
||||||
|
|
||||||
|
MOZ_POST_DSO_LIB_COMMAND = rc $(RES_FILE)
|
||||||
|
|
||||||
$(SHARED_LIBRARY): $(OBJS) $(RES_FILE)
|
$(SHARED_LIBRARY): $(OBJS) $(RES_FILE)
|
||||||
|
|
||||||
$(RES_FILE): $(srcdir)/libprint.rc
|
$(RES_FILE): $(srcdir)/libprint.rc
|
||||||
|
@ -17,6 +17,14 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||||
|
*
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
*
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3.
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/10/2000 IBM Corp. Make it look more like Windows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ToDo: nowt (except get rid of unicode hack)
|
// ToDo: nowt (except get rid of unicode hack)
|
||||||
@ -25,8 +33,9 @@
|
|||||||
#include "libprint.h"
|
#include "libprint.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "nsISupports.h"
|
//#include "nscore.h"
|
||||||
#include "nsIFactory.h"
|
#include "nsIFactory.h"
|
||||||
|
#include "nsISupports.h"
|
||||||
#include "nsGfxCIID.h"
|
#include "nsGfxCIID.h"
|
||||||
#include "nsFontMetricsOS2.h"
|
#include "nsFontMetricsOS2.h"
|
||||||
#include "nsRenderingContextOS2.h"
|
#include "nsRenderingContextOS2.h"
|
||||||
@ -37,114 +46,236 @@
|
|||||||
#include "nsPaletteOS2.h"
|
#include "nsPaletteOS2.h"
|
||||||
#include "nsDeviceContextSpecOS2.h"
|
#include "nsDeviceContextSpecOS2.h"
|
||||||
#include "nsDeviceContextSpecFactoryO.h"
|
#include "nsDeviceContextSpecFactoryO.h"
|
||||||
|
//#include "nsScriptableRegion.h"
|
||||||
// nsGfxFactory.cpp - factory for creating os/2 graphics objects.
|
#include "nsIImageManager.h"
|
||||||
|
//#include "nsScreenManagerWin.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
|
||||||
static NS_DEFINE_IID(kCFontMetrics, NS_FONT_METRICS_CID);
|
static NS_DEFINE_IID(kCFontMetrics, NS_FONT_METRICS_CID);
|
||||||
|
static NS_DEFINE_IID(kCFontEnumerator, NS_FONT_ENUMERATOR_CID);
|
||||||
static NS_DEFINE_IID(kCRenderingContext, NS_RENDERING_CONTEXT_CID);
|
static NS_DEFINE_IID(kCRenderingContext, NS_RENDERING_CONTEXT_CID);
|
||||||
static NS_DEFINE_IID(kCImage, NS_IMAGE_CID);
|
static NS_DEFINE_IID(kCImage, NS_IMAGE_CID);
|
||||||
|
static NS_DEFINE_IID(kCBlender, NS_BLENDER_CID);
|
||||||
static NS_DEFINE_IID(kCDeviceContext, NS_DEVICE_CONTEXT_CID);
|
static NS_DEFINE_IID(kCDeviceContext, NS_DEVICE_CONTEXT_CID);
|
||||||
static NS_DEFINE_IID(kCRegion, NS_REGION_CID);
|
static NS_DEFINE_IID(kCRegion, NS_REGION_CID);
|
||||||
static NS_DEFINE_IID(kCBlender, NS_BLENDER_CID);
|
|
||||||
static NS_DEFINE_IID(kCDeviceContextSpec, NS_DEVICE_CONTEXT_SPEC_CID);
|
static NS_DEFINE_IID(kCDeviceContextSpec, NS_DEVICE_CONTEXT_SPEC_CID);
|
||||||
static NS_DEFINE_IID(kCDeviceContextSpecFactory, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID);
|
static NS_DEFINE_IID(kCDeviceContextSpecFactory, NS_DEVICE_CONTEXT_SPEC_FACTORY_CID);
|
||||||
|
static NS_DEFINE_IID(kCDrawingSurface, NS_DRAWING_SURFACE_CID);
|
||||||
|
static NS_DEFINE_IID(kImageManagerImpl, NS_IMAGEMANAGER_CID);
|
||||||
|
static NS_DEFINE_IID(kCScreenManager, NS_SCREENMANAGER_CID);
|
||||||
|
|
||||||
|
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
|
static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
||||||
|
static NS_DEFINE_IID(kCScriptableRegion, NS_SCRIPTABLE_REGION_CID);
|
||||||
|
|
||||||
|
|
||||||
class nsGfxFactoryOS2 : public nsIFactory
|
class nsGfxFactoryOS2 : public nsIFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NS_DECL_ISUPPORTS
|
||||||
|
NS_DECL_NSIFACTORY
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
nsGfxFactoryOS2(const nsCID &aClass);
|
||||||
|
~nsGfxFactoryOS2();
|
||||||
// nsIFactory methods
|
|
||||||
NS_IMETHOD CreateInstance( nsISupports *aOuter,
|
|
||||||
const nsIID &aIID,
|
|
||||||
void **aResult);
|
|
||||||
|
|
||||||
NS_IMETHOD LockFactory( PRBool aLock) { return NS_OK; }
|
|
||||||
|
|
||||||
nsGfxFactoryOS2( const nsCID &aClass);
|
|
||||||
virtual ~nsGfxFactoryOS2();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsCID mClassID;
|
nsCID mClassID;
|
||||||
};
|
};
|
||||||
|
|
||||||
nsGfxFactoryOS2::nsGfxFactoryOS2( const nsCID &aClass)
|
static int gUseAFunctions = 0;
|
||||||
|
|
||||||
|
nsGfxFactoryOS2::nsGfxFactoryOS2(const nsCID &aClass)
|
||||||
{
|
{
|
||||||
NS_INIT_REFCNT();
|
static int init = 0;
|
||||||
mClassID = aClass;
|
if (!init) {
|
||||||
|
init = 1;
|
||||||
|
/* OS2TODO
|
||||||
|
OSVERSIONINFO os;
|
||||||
|
os.dwOSVersionInfoSize = sizeof(os);
|
||||||
|
::GetVersionEx(&os);
|
||||||
|
if ((os.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) &&
|
||||||
|
(os.dwMajorVersion == 4) &&
|
||||||
|
(os.dwMinorVersion == 0) && // Windows 95 (not 98)
|
||||||
|
(::GetACP() == 932)) { // Shift-JIS (Japanese)
|
||||||
|
gUseAFunctions = 1;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_INIT_REFCNT();
|
||||||
|
mClassID = aClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsGfxFactoryOS2::~nsGfxFactoryOS2()
|
nsGfxFactoryOS2::~nsGfxFactoryOS2()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(nsGfxFactoryOS2,nsIFactory::GetIID())
|
nsresult nsGfxFactoryOS2::QueryInterface(const nsIID &aIID,
|
||||||
|
void **aResult)
|
||||||
|
{
|
||||||
|
if (aResult == NULL) {
|
||||||
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult nsGfxFactoryOS2::CreateInstance( nsISupports *aOuter,
|
// Always NULL result, in case of failure
|
||||||
|
*aResult = NULL;
|
||||||
|
|
||||||
|
if (aIID.Equals(kISupportsIID)) {
|
||||||
|
*aResult = (void *)(nsISupports*)this;
|
||||||
|
} else if (aIID.Equals(kIFactoryIID)) {
|
||||||
|
*aResult = (void *)(nsIFactory*)this;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*aResult == NULL) {
|
||||||
|
return NS_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
AddRef(); // Increase reference count for caller
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMPL_ADDREF(nsGfxFactoryOS2);
|
||||||
|
NS_IMPL_RELEASE(nsGfxFactoryOS2);
|
||||||
|
|
||||||
|
nsresult nsGfxFactoryOS2::CreateInstance(nsISupports *aOuter,
|
||||||
const nsIID &aIID,
|
const nsIID &aIID,
|
||||||
void **aResult)
|
void **aResult)
|
||||||
{
|
{
|
||||||
if( !aResult)
|
nsresult res;
|
||||||
return NS_ERROR_NULL_POINTER;
|
if (aResult == NULL) {
|
||||||
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
}
|
||||||
|
|
||||||
*aResult = 0;
|
*aResult = NULL;
|
||||||
|
|
||||||
nsISupports *inst = nsnull;
|
nsISupports *inst = nsnull;
|
||||||
|
PRBool already_addreffed = PR_FALSE;
|
||||||
|
|
||||||
if( mClassID.Equals( kCFontMetrics)) {
|
if (mClassID.Equals(kCFontMetrics)) {
|
||||||
inst = new nsFontMetricsOS2;
|
nsFontMetricsOS2* fm;
|
||||||
}
|
if (gUseAFunctions) {
|
||||||
else if( mClassID.Equals( kCDeviceContext)) {
|
// NS_NEWXPCOM(fm, nsFontMetricsOS2A);
|
||||||
inst = new nsDeviceContextOS2;
|
}
|
||||||
}
|
else {
|
||||||
else if( mClassID.Equals( kCRenderingContext)) {
|
NS_NEWXPCOM(fm, nsFontMetricsOS2);
|
||||||
inst = (nsISupports *)((nsIRenderingContext*)new nsRenderingContextOS2);
|
}
|
||||||
}
|
inst = (nsISupports *)fm;
|
||||||
else if( mClassID.Equals( kCImage)) {
|
}
|
||||||
inst = new nsImageOS2;
|
else if (mClassID.Equals(kCDeviceContext)) {
|
||||||
}
|
nsDeviceContextOS2* dc;
|
||||||
else if( mClassID.Equals( kCRegion)) {
|
NS_NEWXPCOM(dc, nsDeviceContextOS2);
|
||||||
inst = new nsRegionOS2;
|
inst = (nsISupports *)dc;
|
||||||
}
|
}
|
||||||
else if( mClassID.Equals( kCBlender)) {
|
else if (mClassID.Equals(kCRenderingContext)) {
|
||||||
inst = new nsBlender;
|
nsRenderingContextOS2* rc;
|
||||||
}
|
if (gUseAFunctions) {
|
||||||
else if( mClassID.Equals( kCDeviceContextSpec)) {
|
// NS_NEWXPCOM(rc, nsRenderingContextOS2A);
|
||||||
inst = new nsDeviceContextSpecOS2;
|
}
|
||||||
}
|
else {
|
||||||
else if( mClassID.Equals( kCDeviceContextSpecFactory)) {
|
NS_NEWXPCOM(rc, nsRenderingContextOS2);
|
||||||
inst = new nsDeviceContextSpecFactoryOS2;
|
}
|
||||||
}
|
inst = (nsISupports *)((nsIRenderingContext*)rc);
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kCImage)) {
|
||||||
|
nsImageOS2* image;
|
||||||
|
NS_NEWXPCOM(image, nsImageOS2);
|
||||||
|
inst = (nsISupports *)image;
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kCRegion)) {
|
||||||
|
nsRegionOS2* region;
|
||||||
|
NS_NEWXPCOM(region, nsRegionOS2);
|
||||||
|
inst = (nsISupports *)region;
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kCBlender)) {
|
||||||
|
nsBlender* blender;
|
||||||
|
NS_NEWXPCOM(blender, nsBlender);
|
||||||
|
inst = (nsISupports *)blender;
|
||||||
|
}
|
||||||
|
// OS2TODO
|
||||||
|
/*else if (mClassID.Equals(kCDrawingSurface)) {
|
||||||
|
nsDrawingSurfaceOS2* ds;
|
||||||
|
NS_NEWXPCOM(ds, nsDrawingSurfaceOS2);
|
||||||
|
inst = (nsISupports *)((nsIDrawingSurface *)ds);
|
||||||
|
}*/
|
||||||
|
else if (mClassID.Equals(kCDeviceContextSpec)) {
|
||||||
|
nsDeviceContextSpecOS2* dcs;
|
||||||
|
NS_NEWXPCOM(dcs, nsDeviceContextSpecOS2);
|
||||||
|
inst = (nsISupports *)dcs;
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kCDeviceContextSpecFactory)) {
|
||||||
|
nsDeviceContextSpecFactoryOS2* dcs;
|
||||||
|
NS_NEWXPCOM(dcs, nsDeviceContextSpecFactoryOS2);
|
||||||
|
inst = (nsISupports *)dcs;
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kCScriptableRegion)) {
|
||||||
|
nsCOMPtr<nsIRegion> rgn;
|
||||||
|
NS_NEWXPCOM(rgn, nsRegionOS2);
|
||||||
|
/*if (rgn != nsnull) {
|
||||||
|
nsIScriptableRegion* scriptableRgn = new nsScriptableRegion(rgn);
|
||||||
|
inst = (nsISupports *)scriptableRgn;
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kImageManagerImpl)) {
|
||||||
|
nsCOMPtr<nsIImageManager> iManager;
|
||||||
|
res = NS_NewImageManager(getter_AddRefs(iManager));
|
||||||
|
already_addreffed = PR_TRUE;
|
||||||
|
if (NS_SUCCEEDED(res))
|
||||||
|
{
|
||||||
|
res = iManager->QueryInterface(NS_GET_IID(nsISupports), (void**)&inst);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kCFontEnumerator)) {
|
||||||
|
/* OS2TODO
|
||||||
|
nsFontEnumeratorOS2* fe;
|
||||||
|
NS_NEWXPCOM(fe, nsFontEnumeratorOS2);
|
||||||
|
inst = (nsISupports *)fe;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
else if (mClassID.Equals(kCScreenManager)) {
|
||||||
|
/* OS2TODO
|
||||||
|
NS_NEWXPCOM(inst, nsScreenManagerOS2);
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
if( !inst)
|
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
if( inst == NULL) {
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (already_addreffed == PR_FALSE)
|
||||||
|
NS_ADDREF(inst); // Stabilize
|
||||||
|
|
||||||
|
res = inst->QueryInterface(aIID, aResult);
|
||||||
|
|
||||||
nsresult res = inst->QueryInterface(aIID, aResult);
|
NS_RELEASE(inst); // Destabilize and avoid leaks. Avoid calling delete <interface pointer>
|
||||||
|
|
||||||
if( NS_FAILED(res))
|
return res;
|
||||||
// We didn't get the right interface, so clean up
|
|
||||||
delete inst;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a factory-factory: create a factory for the desired type.
|
nsresult nsGfxFactoryOS2::LockFactory(PRBool aLock)
|
||||||
|
{
|
||||||
|
// Not implemented in simplest case.
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return the proper factory to the caller
|
||||||
extern "C" NS_GFXNONXP nsresult NSGetFactory(nsISupports* servMgr,
|
extern "C" NS_GFXNONXP nsresult NSGetFactory(nsISupports* servMgr,
|
||||||
const nsCID &aClass,
|
const nsCID &aClass,
|
||||||
const char *aClassName,
|
const char *aClassName,
|
||||||
const char *aProgID,
|
const char *aProgID,
|
||||||
nsIFactory **aFactory)
|
nsIFactory **aFactory)
|
||||||
{
|
{
|
||||||
if( !aFactory)
|
if (nsnull == aFactory) {
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
}
|
||||||
|
|
||||||
*aFactory = new nsGfxFactoryOS2( aClass);
|
*aFactory = new nsGfxFactoryOS2(aClass);
|
||||||
|
|
||||||
if( !*aFactory)
|
if (nsnull == aFactory) {
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
return (*aFactory)->QueryInterface( nsIFactory::GetIID(), (void**) aFactory);
|
return (*aFactory)->QueryInterface(kIFactoryIID, (void**)aFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Module-level data ---------------------------------------------------------
|
// Module-level data ---------------------------------------------------------
|
||||||
|
@ -17,6 +17,13 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||||
|
*
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/11/2000 IBM Corp. Make it look more like Windows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nsGfxDefs.h"
|
#include "nsGfxDefs.h"
|
||||||
@ -34,50 +41,52 @@ nsImageOS2::nsImageOS2()
|
|||||||
NS_INIT_REFCNT();
|
NS_INIT_REFCNT();
|
||||||
|
|
||||||
mInfo = 0;
|
mInfo = 0;
|
||||||
mStride = 0;
|
mRowBytes = 0;
|
||||||
mImageBits = 0;
|
mImageBits = 0;
|
||||||
mBitmap = 0;
|
mBitmap = 0;
|
||||||
|
|
||||||
mAStride = 0;
|
mARowBytes = 0;
|
||||||
mAImageBits = 0;
|
mAlphaBits = 0;
|
||||||
mABitmap = 0;
|
mABitmap = 0;
|
||||||
mAlphaDepth = 0;
|
mAlphaDepth = 0;
|
||||||
|
mAlphaLevel = 0;
|
||||||
|
|
||||||
mColorMap = 0;
|
mColorMap = 0;
|
||||||
|
|
||||||
mOptimized = PR_FALSE;
|
mIsOptimized = PR_FALSE;
|
||||||
|
mIsTopToBottom = PR_FALSE;
|
||||||
|
|
||||||
mDeviceDepth = 0;
|
mDeviceDepth = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsImageOS2::~nsImageOS2()
|
nsImageOS2::~nsImageOS2()
|
||||||
{
|
{
|
||||||
Cleanup();
|
CleanUp(PR_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsImageOS2::Init( PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,
|
nsresult nsImageOS2::Init( PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,
|
||||||
nsMaskRequirements aMaskRequirements)
|
nsMaskRequirements aMaskRequirements)
|
||||||
{
|
{
|
||||||
// Guard against memory leak in multiple init
|
// Guard against memory leak in multiple init
|
||||||
Cleanup();
|
CleanUp(PR_TRUE);
|
||||||
|
|
||||||
// (copying windows code - what about monochrome? Oh well.)
|
// (copying windows code - what about monochrome? Oh well.)
|
||||||
NS_ASSERTION( aDepth == 24 || aDepth == 8, "Bad image depth");
|
NS_ASSERTION( aDepth == 24 || aDepth == 8, "Bad image depth");
|
||||||
|
|
||||||
// Work out size of bitmap to allocate
|
// Work out size of bitmap to allocate
|
||||||
mStride = RASWIDTH(aWidth,aDepth);
|
mRowBytes = RASWIDTH(aWidth,aDepth);
|
||||||
|
|
||||||
// mStride = aWidth * aDepth;
|
// mRowBytes = aWidth * aDepth;
|
||||||
// if( aDepth < 8)
|
// if( aDepth < 8)
|
||||||
// mStride += 7;
|
// mRowBytes += 7;
|
||||||
// mStride /= 8;
|
// mRowBytes /= 8;
|
||||||
//
|
//
|
||||||
// // Make sure image width is 4byte aligned
|
// // Make sure image width is 4byte aligned
|
||||||
// mStride = (mStride + 3) & ~0x3;
|
// mRowBytes = (mRowBytes + 3) & ~0x3;
|
||||||
|
|
||||||
SetDecodedRect(0,0,0,0); //init
|
SetDecodedRect(0,0,0,0); //init
|
||||||
|
|
||||||
mImageBits = new PRUint8 [ aHeight * mStride ];
|
mImageBits = new PRUint8 [ aHeight * mRowBytes ];
|
||||||
|
|
||||||
// Set up bitmapinfo header
|
// Set up bitmapinfo header
|
||||||
int cols = -1;
|
int cols = -1;
|
||||||
@ -110,33 +119,37 @@ nsresult nsImageOS2::Init( PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,
|
|||||||
{
|
{
|
||||||
if( aMaskRequirements == nsMaskRequirements_kNeeds1Bit)
|
if( aMaskRequirements == nsMaskRequirements_kNeeds1Bit)
|
||||||
{
|
{
|
||||||
mAStride = (aWidth + 7) / 8;
|
mARowBytes = (aWidth + 7) / 8;
|
||||||
mAlphaDepth = 1;
|
mAlphaDepth = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NS_ASSERTION( nsMaskRequirements_kNeeds8Bit == aMaskRequirements,
|
NS_ASSERTION( nsMaskRequirements_kNeeds8Bit == aMaskRequirements,
|
||||||
"unexpected mask depth");
|
"unexpected mask depth");
|
||||||
mAStride = aWidth;
|
mARowBytes = aWidth;
|
||||||
mAlphaDepth = 8;
|
mAlphaDepth = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 32-bit align each row
|
// 32-bit align each row
|
||||||
mAStride = (mAStride + 3) & ~0x3;
|
mARowBytes = (mARowBytes + 3) & ~0x3;
|
||||||
|
|
||||||
mAImageBits = new PRUint8 [ aHeight * mAStride];
|
mAlphaBits = new PRUint8 [ aHeight * mARowBytes];
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsImageOS2::Cleanup()
|
void nsImageOS2::CleanUp(PRBool aCleanUpAll)
|
||||||
{
|
{
|
||||||
|
// OS2TODO to handle aCleanUpAll param
|
||||||
|
|
||||||
if( mImageBits) {
|
if( mImageBits) {
|
||||||
delete [] mImageBits; mImageBits = 0;
|
delete [] mImageBits;
|
||||||
|
mImageBits = 0;
|
||||||
}
|
}
|
||||||
if( mInfo) {
|
if( mInfo) {
|
||||||
free( mInfo); mInfo = 0;
|
free( mInfo);
|
||||||
|
mInfo = 0;
|
||||||
}
|
}
|
||||||
if( mColorMap) {
|
if( mColorMap) {
|
||||||
if( mColorMap->Index)
|
if( mColorMap->Index)
|
||||||
@ -144,8 +157,9 @@ void nsImageOS2::Cleanup()
|
|||||||
delete mColorMap;
|
delete mColorMap;
|
||||||
mColorMap = 0;
|
mColorMap = 0;
|
||||||
}
|
}
|
||||||
if( mAImageBits) {
|
if( mAlphaBits) {
|
||||||
delete [] mAImageBits; mAImageBits = 0;
|
delete [] mAlphaBits;
|
||||||
|
mAlphaBits = 0;
|
||||||
}
|
}
|
||||||
if( mBitmap) {
|
if( mBitmap) {
|
||||||
GpiDeleteBitmap( mBitmap);
|
GpiDeleteBitmap( mBitmap);
|
||||||
@ -219,7 +233,7 @@ nsresult nsImageOS2::Draw( nsIRenderingContext &aContext,
|
|||||||
// (b) is allegedly more efficient...
|
// (b) is allegedly more efficient...
|
||||||
//
|
//
|
||||||
#if 0
|
#if 0
|
||||||
if( mBitmap == 0 && mOptimized)
|
if( mBitmap == 0 && mIsOptimized)
|
||||||
{
|
{
|
||||||
// moz has asked us to optimize this image, but we haven't got
|
// moz has asked us to optimize this image, but we haven't got
|
||||||
// round to actually doing it yet. So do it now.
|
// round to actually doing it yet. So do it now.
|
||||||
@ -269,7 +283,7 @@ nsresult nsImageOS2::Draw( nsIRenderingContext &aContext,
|
|||||||
nsresult nsImageOS2::Optimize( nsIDeviceContext* aContext)
|
nsresult nsImageOS2::Optimize( nsIDeviceContext* aContext)
|
||||||
{
|
{
|
||||||
// Defer this until we have a PS...
|
// Defer this until we have a PS...
|
||||||
mOptimized = PR_TRUE;
|
mIsOptimized = PR_TRUE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,7 +320,7 @@ void nsImageOS2::CreateBitmaps( nsDrawingSurfaceOS2 *surf)
|
|||||||
if( mBitmap == GPI_ERROR)
|
if( mBitmap == GPI_ERROR)
|
||||||
PMERROR("GpiCreateBitmap");
|
PMERROR("GpiCreateBitmap");
|
||||||
|
|
||||||
if( mAImageBits)
|
if( mAlphaBits)
|
||||||
{
|
{
|
||||||
if( mAlphaDepth == 1)
|
if( mAlphaDepth == 1)
|
||||||
{
|
{
|
||||||
@ -314,7 +328,7 @@ void nsImageOS2::CreateBitmaps( nsDrawingSurfaceOS2 *surf)
|
|||||||
mABitmap = GpiCreateBitmap( surf->mPS,
|
mABitmap = GpiCreateBitmap( surf->mPS,
|
||||||
maskInfo,
|
maskInfo,
|
||||||
CBM_INIT,
|
CBM_INIT,
|
||||||
(PBYTE) mAImageBits,
|
(PBYTE) mAlphaBits,
|
||||||
maskInfo);
|
maskInfo);
|
||||||
if( mABitmap == GPI_ERROR)
|
if( mABitmap == GPI_ERROR)
|
||||||
PMERROR( "GpiCreateBitmap (mask)");
|
PMERROR( "GpiCreateBitmap (mask)");
|
||||||
@ -347,7 +361,7 @@ void nsImageOS2::DrawBitmap( HPS hps, LONG lCount, PPOINTL pPoints,
|
|||||||
pBmp2 = *pMaskInfo;
|
pBmp2 = *pMaskInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *pBits = bIsMask ? mAImageBits : mImageBits;
|
void *pBits = bIsMask ? mAlphaBits : mImageBits;
|
||||||
|
|
||||||
if( GPI_ERROR == GpiDrawBits( hps, pBits, pBmp2,
|
if( GPI_ERROR == GpiDrawBits( hps, pBits, pBmp2,
|
||||||
lCount, pPoints, lRop, BBO_OR))
|
lCount, pPoints, lRop, BBO_OR))
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/11/2000 IBM Corp. Make it look more like Windows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _nsImageOS2_h_
|
#ifndef _nsImageOS2_h_
|
||||||
@ -26,78 +32,176 @@
|
|||||||
|
|
||||||
struct nsDrawingSurfaceOS2;
|
struct nsDrawingSurfaceOS2;
|
||||||
|
|
||||||
class nsImageOS2 : public nsIImage
|
class nsImageOS2 : public nsIImage{
|
||||||
{
|
public:
|
||||||
public:
|
nsImageOS2();
|
||||||
nsImageOS2();
|
~nsImageOS2();
|
||||||
virtual ~nsImageOS2();
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
nsresult Init( PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth,
|
/**
|
||||||
nsMaskRequirements aMaskRequirements);
|
@see nsIImage.h
|
||||||
PRInt32 GetWidth() { return mInfo ? mInfo->cx : 0; }
|
*/
|
||||||
PRInt32 GetHeight() { return mInfo ? mInfo->cy : 0; }
|
virtual PRInt32 GetBytesPix() { return mInfo ? mInfo->cBitCount : 0; }
|
||||||
PRInt32 GetLineStride() { return mStride; }
|
virtual PRInt32 GetHeight() { return mInfo ? mInfo->cy : 0; }
|
||||||
PRUint8 *GetBits() { return mImageBits; }
|
virtual PRBool GetIsRowOrderTopToBottom() { return mIsTopToBottom; }
|
||||||
void *GetBitInfo() { return mInfo; }
|
virtual PRInt32 GetWidth() { return mInfo ? mInfo->cx : 0; }
|
||||||
nsColorMap *GetColorMap() { return mColorMap; }
|
virtual PRUint8* GetBits() { return mImageBits; }
|
||||||
PRInt32 GetBytesPix() { return mInfo ? mInfo->cBitCount : 0; }
|
virtual PRInt32 GetLineStride() { return mRowBytes; }
|
||||||
|
|
||||||
NS_IMETHOD SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PRInt32 y2);
|
|
||||||
virtual PRInt32 GetDecodedX1() { return mDecodedX1;}
|
|
||||||
virtual PRInt32 GetDecodedY1() { return mDecodedY1;}
|
|
||||||
virtual PRInt32 GetDecodedX2() { return mDecodedX2;}
|
|
||||||
virtual PRInt32 GetDecodedY2() { return mDecodedY2;}
|
|
||||||
|
|
||||||
PRBool GetIsRowOrderTopToBottom() { return PR_FALSE; }
|
NS_IMETHOD SetDecodedRect(PRInt32 x1, PRInt32 y1, PRInt32 x2, PRInt32 y2);
|
||||||
|
virtual PRInt32 GetDecodedX1() { return mDecodedX1;}
|
||||||
|
virtual PRInt32 GetDecodedY1() { return mDecodedY1;}
|
||||||
|
virtual PRInt32 GetDecodedX2() { return mDecodedX2;}
|
||||||
|
virtual PRInt32 GetDecodedY2() { return mDecodedY2;}
|
||||||
|
|
||||||
// These may require more sensible returns...
|
virtual PRBool GetHasAlphaMask() { return mAlphaBits != nsnull; }
|
||||||
PRInt32 GetAlphaWidth() { return mInfo ? mInfo->cx : 0; }
|
|
||||||
PRInt32 GetAlphaHeight() { return mInfo ? mInfo->cy : 0; }
|
|
||||||
PRInt32 GetAlphaLineStride() { return mAStride; }
|
|
||||||
PRBool GetHasAlphaMask() { return mAImageBits != nsnull; }
|
|
||||||
PRUint8 *GetAlphaBits() { return mAImageBits; }
|
|
||||||
|
|
||||||
void SetAlphaLevel(PRInt32 aAlphaLevel) {}
|
NS_IMETHOD Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||||
PRInt32 GetAlphaLevel() { return 0; }
|
NS_IMETHOD Draw(nsIRenderingContext &aContext, nsDrawingSurface aSurface, PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
|
||||||
|
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
|
||||||
|
virtual nsColorMap* GetColorMap() {return mColorMap;}
|
||||||
|
virtual void ImageUpdated(nsIDeviceContext *aContext, PRUint8 aFlags, nsRect *aUpdateRect);
|
||||||
|
virtual nsresult Init(PRInt32 aWidth, PRInt32 aHeight, PRInt32 aDepth, nsMaskRequirements aMaskRequirements);
|
||||||
|
virtual PRBool IsOptimized() { return mIsOptimized; }
|
||||||
|
virtual nsresult Optimize(nsIDeviceContext* aContext);
|
||||||
|
virtual PRUint8* GetAlphaBits() { return mAlphaBits; }
|
||||||
|
virtual PRInt32 GetAlphaWidth() { return mInfo ? mInfo->cx : 0; }
|
||||||
|
virtual PRInt32 GetAlphaHeight() { return mInfo ? mInfo->cy : 0; }
|
||||||
|
virtual PRInt32 GetAlphaLineStride(){ return mARowBytes; }
|
||||||
|
|
||||||
nsresult Optimize( nsIDeviceContext* aContext);
|
/**
|
||||||
PRBool IsOptimized() { return mOptimized; }
|
* Draw a tiled version of the bitmap
|
||||||
|
* @update - dwc 3/30/00
|
||||||
|
* @param aSurface the surface to blit to
|
||||||
|
* @param aX The destination horizontal location
|
||||||
|
* @param aY The destination vertical location
|
||||||
|
* @param aWidth The destination width of the pixelmap
|
||||||
|
* @param aHeight The destination height of the pixelmap
|
||||||
|
* @return if TRUE, no errors
|
||||||
|
*/
|
||||||
|
#if 0 // OS2TODO
|
||||||
|
PRBool DrawTile(nsIRenderingContext &aContext, nsDrawingSurface aSurface,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,nscoord aWidth,nscoord aHeight);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IMETHOD Draw( nsIRenderingContext &aContext, nsDrawingSurface aSurface,
|
/**
|
||||||
PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
* Return the header size of the Device Independent Bitmap(DIB).
|
||||||
NS_IMETHOD Draw( nsIRenderingContext &aContext, nsDrawingSurface aSurface,
|
* @return size of header in bytes
|
||||||
PRInt32 aSX, PRInt32 aSY, PRInt32 aSWidth, PRInt32 aSHeight,
|
*/
|
||||||
PRInt32 aDX, PRInt32 aDY, PRInt32 aDWidth, PRInt32 aDHeight);
|
#if 0 // OS2TODO
|
||||||
|
PRIntn GetSizeHeader(){return sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * mNumPaletteColors;}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ImageUpdated( nsIDeviceContext *aContext,
|
/**
|
||||||
PRUint8 aFlags, nsRect *aUpdateRect);
|
* Return the image size of the Device Independent Bitmap(DIB).
|
||||||
|
* @update dc - 10/29/98
|
||||||
|
* @return size of image in bytes
|
||||||
|
*/
|
||||||
|
#if 0 // OS2TODO
|
||||||
|
PRIntn GetSizeImage(){ return mSizeImage; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculate the number of bytes spaned for this image for a given width
|
||||||
|
* @param aWidth is the width to calculate the number of bytes for
|
||||||
|
* @return the number of bytes in this span
|
||||||
|
*/
|
||||||
|
#if 0 // OS2TODO
|
||||||
|
PRInt32 CalcBytesSpan(PRUint32 aWidth);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
virtual void SetAlphaLevel(PRInt32 aAlphaLevel) {mAlphaLevel=aAlphaLevel;}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the alpha level assigned.
|
||||||
|
* @update dc - 10/29/98
|
||||||
|
* @return The alpha level from 0 to 1
|
||||||
|
*/
|
||||||
|
virtual PRInt32 GetAlphaLevel() {return(mAlphaLevel);}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the DIB specific informations for this bitmap.
|
||||||
|
* @update dc - 10/29/98
|
||||||
|
* @return VOID
|
||||||
|
*/
|
||||||
|
void* GetBitInfo() { return mInfo; }
|
||||||
|
|
||||||
NS_IMETHOD LockImagePixels(PRBool aMaskPixels);
|
NS_IMETHOD LockImagePixels(PRBool aMaskPixels);
|
||||||
NS_IMETHOD UnlockImagePixels(PRBool aMaskPixels);
|
NS_IMETHOD UnlockImagePixels(PRBool aMaskPixels);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BITMAPINFO2 *mInfo;
|
/**
|
||||||
PRInt32 mStride;
|
* Clean up the memory used nsImageWin.
|
||||||
PRInt32 mAStride;
|
* @update dc - 10/29/98
|
||||||
PRUint8 *mImageBits;
|
* @param aCleanUpAll - if True, all the memory used will be released otherwise just clean up the DIB memory
|
||||||
PRUint8 *mAImageBits;
|
*/
|
||||||
nsColorMap *mColorMap;
|
void CleanUp(PRBool aCleanUpAll);
|
||||||
HBITMAP mBitmap;
|
|
||||||
HBITMAP mABitmap;
|
|
||||||
PRBool mOptimized;
|
|
||||||
PRInt32 mAlphaDepth;
|
|
||||||
PRUint32 mDeviceDepth;
|
|
||||||
|
|
||||||
PRInt32 mDecodedX1; //Keeps track of what part of image
|
#ifdef OS2TODO
|
||||||
PRInt32 mDecodedY1; // has been decoded.
|
/**
|
||||||
PRInt32 mDecodedX2;
|
* Create a Device Dependent bitmap from a drawing surface
|
||||||
PRInt32 mDecodedY2;
|
* @update dc - 10/29/98
|
||||||
|
* @param aSurface - The drawingsurface to create the DDB from.
|
||||||
|
*/
|
||||||
|
void CreateDDB(nsDrawingSurface aSurface);
|
||||||
|
|
||||||
void Cleanup();
|
|
||||||
void CreateBitmaps( nsDrawingSurfaceOS2 *surf);
|
/**
|
||||||
void DrawBitmap( HPS hps, LONG cPts, PPOINTL pPts, LONG lRop, PRBool bMsk);
|
* Create a Device Dependent bitmap from a drawing surface
|
||||||
|
* @update dc - 05/20/99
|
||||||
|
* @param aSurface - The drawingsurface to create the DIB from.
|
||||||
|
* @param aWidth - width of DIB
|
||||||
|
* @param aHeight - height of DIB
|
||||||
|
*/
|
||||||
|
nsresult ConvertDDBtoDIB(PRInt32 aWidth,PRInt32 aHeight);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print a DDB
|
||||||
|
* @update dc - 05/20/99
|
||||||
|
* @param aSurface - The drawingsurface to create the DIB from.
|
||||||
|
* @param aX - x location to place image
|
||||||
|
* @param aX - y location to place image
|
||||||
|
* @param aWidth - width of DIB
|
||||||
|
* @param aHeight - height of DIB
|
||||||
|
*/
|
||||||
|
nsresult PrintDDB(nsDrawingSurface aSurface,PRInt32 aX,PRInt32 aY,PRInt32 aWidth,PRInt32 aHeight);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get an index in the palette that matches as closly as possible the passed in RGB colors
|
||||||
|
* @update dc - 10/29/98
|
||||||
|
* @param aR - Red component of the color to match
|
||||||
|
* @param aG - Green component of the color to match
|
||||||
|
* @param aB - Blue component of the color to match
|
||||||
|
* @return - The closest palette match
|
||||||
|
*/
|
||||||
|
PRUint8 PaletteMatch(PRUint8 r, PRUint8 g, PRUint8 b);
|
||||||
|
#endif
|
||||||
|
BITMAPINFO2* mInfo;
|
||||||
|
PRBool mIsTopToBottom; // rows in image are top to bottom
|
||||||
|
HBITMAP mBitmap;
|
||||||
|
HBITMAP mABitmap;
|
||||||
|
PRUint32 mDeviceDepth;
|
||||||
|
PRInt32 mRowBytes; // number of bytes per row
|
||||||
|
PRUint8* mImageBits; // starting address of DIB bits
|
||||||
|
PRBool mIsOptimized; // Did we convert our DIB to a HBITMAP
|
||||||
|
nsColorMap* mColorMap; // Redundant with mColorTable, but necessary
|
||||||
|
|
||||||
|
PRInt32 mDecodedX1; //Keeps track of what part of image
|
||||||
|
PRInt32 mDecodedY1; // has been decoded.
|
||||||
|
PRInt32 mDecodedX2;
|
||||||
|
PRInt32 mDecodedY2;
|
||||||
|
|
||||||
|
// alpha layer members
|
||||||
|
PRUint8 *mAlphaBits; // alpha layer if we made one
|
||||||
|
PRInt8 mAlphaDepth; // alpha layer depth
|
||||||
|
PRInt16 mARowBytes; // number of bytes per row in the image for tha alpha
|
||||||
|
PRInt16 mAlphaLevel; // an alpha level every pixel uses
|
||||||
|
|
||||||
|
void CreateBitmaps( nsDrawingSurfaceOS2 *surf);
|
||||||
|
void DrawBitmap( HPS hps, LONG cPts, PPOINTL pPts, LONG lRop, PRBool bMsk);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/08/2000 IBM Corp. Fix for trying to us an already freed mGammaTable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// ToDo: nothing
|
// ToDo: nothing
|
||||||
@ -52,8 +58,12 @@ class nsPaletteOS2 : public nsIPaletteOS2
|
|||||||
return mContext == nsnull ? NS_ERROR_FAILURE : NS_OK;
|
return mContext == nsnull ? NS_ERROR_FAILURE : NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
long GetGPIColor( HPS hps, nscolor rgb)
|
long GetGPIColor( nsIDeviceContext *aContext, HPS hps, nscolor rgb)
|
||||||
{
|
{
|
||||||
|
if (mContext != aContext) {
|
||||||
|
mContext = aContext;
|
||||||
|
mContext->GetGammaTable( mGammaTable);
|
||||||
|
}
|
||||||
long gcolor = MK_RGB( mGammaTable[NS_GET_R(rgb)],
|
long gcolor = MK_RGB( mGammaTable[NS_GET_R(rgb)],
|
||||||
mGammaTable[NS_GET_G(rgb)],
|
mGammaTable[NS_GET_G(rgb)],
|
||||||
mGammaTable[NS_GET_B(rgb)]);
|
mGammaTable[NS_GET_B(rgb)]);
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/08/2000 IBM Corp. Fix for trying to us an already freed mGammaTable.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Manage picking of colours via various GPI methods.
|
// Manage picking of colours via various GPI methods.
|
||||||
@ -38,7 +44,7 @@ class nsIDeviceContext;
|
|||||||
class nsIPaletteOS2 : public nsISupports
|
class nsIPaletteOS2 : public nsISupports
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual long GetGPIColor( HPS hps, nscolor rgb) = 0;
|
virtual long GetGPIColor( nsIDeviceContext *aContext, HPS hps, nscolor rgb) = 0;
|
||||||
virtual nsresult Select( HPS hps, nsIDeviceContext *aContext) = 0;
|
virtual nsresult Select( HPS hps, nsIDeviceContext *aContext) = 0;
|
||||||
virtual nsresult Deselect( HPS hps) = 0;
|
virtual nsresult Deselect( HPS hps) = 0;
|
||||||
virtual nsresult GetNSPalette( nsPalette &aPalette) const = 0;
|
virtual nsresult GetNSPalette( nsPalette &aPalette) const = 0;
|
||||||
|
@ -17,6 +17,12 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
*
|
*
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/110/2000 IBM Corp. Make more like Windows
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Region object. From os2fe\regions.cpp.
|
// Region object. From os2fe\regions.cpp.
|
||||||
@ -31,50 +37,49 @@ typedef void (*nsRECTLInRegionFunc)(void *closure, RECTL &rectl);
|
|||||||
|
|
||||||
class nsRegionOS2 : public nsIRegion
|
class nsRegionOS2 : public nsIRegion
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsRegionOS2();
|
nsRegionOS2();
|
||||||
virtual ~nsRegionOS2();
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
|
||||||
|
|
||||||
NS_IMETHOD Init();
|
|
||||||
|
|
||||||
virtual void SetTo( const nsIRegion &aRegion);
|
|
||||||
virtual void SetTo( PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
|
||||||
virtual void Intersect( const nsIRegion &aRegion);
|
|
||||||
virtual void Intersect( PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
|
||||||
virtual void Union( const nsIRegion &aRegion);
|
|
||||||
virtual void Union( PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
|
||||||
virtual void Subtract( const nsIRegion &aRegion);
|
|
||||||
virtual void Subtract( PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
|
||||||
virtual PRBool IsEmpty();
|
|
||||||
virtual PRBool IsEqual( const nsIRegion &aRegion);
|
|
||||||
virtual void GetBoundingBox( PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, PRInt32 *aHeight);
|
|
||||||
virtual void Offset( PRInt32 aXOffset, PRInt32 aYOffset);
|
|
||||||
virtual PRBool ContainsRect( PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
|
||||||
|
|
||||||
NS_IMETHOD GetRects( nsRegionRectSet **aRects);
|
NS_DECL_ISUPPORTS
|
||||||
NS_IMETHOD FreeRects( nsRegionRectSet *aRects);
|
|
||||||
|
|
||||||
NS_IMETHOD GetNumRects(PRUint32 *aRects) const { *aRects = 0; return NS_OK; }
|
virtual nsresult Init();
|
||||||
|
|
||||||
// Don't use this -- it returns a region defined in CRS.
|
virtual void SetTo(const nsIRegion &aRegion);
|
||||||
NS_IMETHOD GetNativeRegion( void *&aRegion) const;
|
virtual void SetTo(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||||
NS_IMETHOD GetRegionComplexity( nsRegionComplexity &aComplexity) const;
|
virtual void Intersect(const nsIRegion &aRegion);
|
||||||
|
virtual void Intersect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||||
|
virtual void Union(const nsIRegion &aRegion);
|
||||||
|
virtual void Union(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||||
|
virtual void Subtract(const nsIRegion &aRegion);
|
||||||
|
virtual void Subtract(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||||
|
virtual PRBool IsEmpty(void);
|
||||||
|
virtual PRBool IsEqual(const nsIRegion &aRegion);
|
||||||
|
virtual void GetBoundingBox(PRInt32 *aX, PRInt32 *aY, PRInt32 *aWidth, PRInt32 *aHeight);
|
||||||
|
virtual void Offset(PRInt32 aXOffset, PRInt32 aYOffset);
|
||||||
|
virtual PRBool ContainsRect(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight);
|
||||||
|
NS_IMETHOD GetRects(nsRegionRectSet **aRects);
|
||||||
|
NS_IMETHOD FreeRects(nsRegionRectSet *aRects);
|
||||||
|
NS_IMETHOD GetNativeRegion(void *&aRegion) const; // Don't use this -- it returns a region defined in CRS.
|
||||||
|
NS_IMETHOD GetRegionComplexity(nsRegionComplexity &aComplexity) const;
|
||||||
|
|
||||||
|
NS_IMETHOD GetNumRects(PRUint32 *aRects) const { *aRects = 0; return NS_OK; }
|
||||||
|
|
||||||
// OS/2 specific
|
// OS/2 specific
|
||||||
// get region in widget's coord space for given device
|
// get region in widget's coord space for given device
|
||||||
HRGN GetHRGN( PRUint32 ulHeight, HPS hps);
|
HRGN GetHRGN( PRUint32 ulHeight, HPS hps);
|
||||||
|
|
||||||
// copy from another region defined in aWidget's space for a given device
|
// copy from another region defined in aWidget's space for a given device
|
||||||
nsresult Init( HRGN copy, PRUint32 ulHeight, HPS hps);
|
nsresult Init( HRGN copy, PRUint32 ulHeight, HPS hps);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void combine( long lOp, PRInt32 aX, PRInt32 aY, PRInt32 aW, PRInt32 aH);
|
~nsRegionOS2();
|
||||||
void combine( long lOp, const nsIRegion &aRegion);
|
|
||||||
|
|
||||||
HRGN mRegion;
|
HRGN mRegion;
|
||||||
long mRegionType;
|
long mRegionType;
|
||||||
|
|
||||||
|
void combine( long lOp, PRInt32 aX, PRInt32 aY, PRInt32 aW, PRInt32 aH);
|
||||||
|
void combine( long lOp, const nsIRegion &aRegion);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
*
|
*
|
||||||
* Date Modified by Description of modification
|
* Date Modified by Description of modification
|
||||||
* 03/23/2000 IBM Corp. Fixed InvertRect.
|
* 03/23/2000 IBM Corp. Fixed InvertRect.
|
||||||
|
* 05/08/2000 IBM Corp. Fix for trying to us an already freed mGammaTable.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -825,7 +826,7 @@ void nsRenderingContextOS2::SetupDrawingColor( BOOL bForce)
|
|||||||
{
|
{
|
||||||
if( bForce || mColor != mCurrDrawingColor)
|
if( bForce || mColor != mCurrDrawingColor)
|
||||||
{
|
{
|
||||||
long lColor = mPalette->GetGPIColor( mSurface->mPS, mColor);
|
long lColor = mPalette->GetGPIColor( mContext, mSurface->mPS, mColor);
|
||||||
GpiSetAttrs( mSurface->mPS, PRIM_LINE, LBB_COLOR, 0, &lColor);
|
GpiSetAttrs( mSurface->mPS, PRIM_LINE, LBB_COLOR, 0, &lColor);
|
||||||
GpiSetAttrs( mSurface->mPS, PRIM_AREA, ABB_COLOR, 0, &lColor);
|
GpiSetAttrs( mSurface->mPS, PRIM_AREA, ABB_COLOR, 0, &lColor);
|
||||||
mCurrDrawingColor = mColor;
|
mCurrDrawingColor = mColor;
|
||||||
@ -861,7 +862,7 @@ void nsRenderingContextOS2::SetupFontAndColor( BOOL bForce)
|
|||||||
|
|
||||||
if( bForce || mColor != mCurrTextColor)
|
if( bForce || mColor != mCurrTextColor)
|
||||||
{
|
{
|
||||||
long lColor = mPalette->GetGPIColor( mSurface->mPS, mColor);
|
long lColor = mPalette->GetGPIColor( mContext, mSurface->mPS, mColor);
|
||||||
GpiSetAttrs( mSurface->mPS, PRIM_CHAR, CBB_COLOR, 0, &lColor);
|
GpiSetAttrs( mSurface->mPS, PRIM_CHAR, CBB_COLOR, 0, &lColor);
|
||||||
mCurrTextColor = mColor;
|
mCurrTextColor = mColor;
|
||||||
}
|
}
|
||||||
|
@ -17,16 +17,23 @@
|
|||||||
*
|
*
|
||||||
* Contributor(s): Henry Sobotka <sobotka@axess.com>
|
* Contributor(s): Henry Sobotka <sobotka@axess.com>
|
||||||
*
|
*
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/11/2000 IBM Corp. Make more like Windows.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _nsRenderingContextOS2_h
|
#ifndef _nsRenderingContextOS2_h
|
||||||
#define _nsRenderingContextOS2_h
|
#define _nsRenderingContextOS2_h
|
||||||
|
|
||||||
#include "nsIRenderingContext.h"
|
#include "nsIRenderingContext.h"
|
||||||
|
#include "nsCRT.h"
|
||||||
#include "nsTransform2D.h"
|
#include "nsTransform2D.h"
|
||||||
#include "nscoord.h"
|
#include "nscoord.h"
|
||||||
#include "nscolor.h"
|
#include "nsDrawingSurfaceOS2.h"
|
||||||
#include "nsCRT.h"
|
#include "nsRenderingContextImpl.h"
|
||||||
|
|
||||||
class nsIDeviceContext;
|
class nsIDeviceContext;
|
||||||
class nsIFontMetrics;
|
class nsIFontMetrics;
|
||||||
@ -37,137 +44,154 @@ class nsPoint;
|
|||||||
class nsFont;
|
class nsFont;
|
||||||
class nsRect;
|
class nsRect;
|
||||||
|
|
||||||
struct GraphicsState;
|
class GraphicsState;
|
||||||
|
class nsDrawingSurfaceOS2;
|
||||||
|
|
||||||
#include "nsDrawingSurfaceOS2.h"
|
class nsRenderingContextOS2 : public nsRenderingContextImpl
|
||||||
|
|
||||||
class nsRenderingContextOS2 : public nsIRenderingContext
|
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsRenderingContextOS2();
|
nsRenderingContextOS2();
|
||||||
virtual ~nsRenderingContextOS2();
|
|
||||||
|
|
||||||
void *operator new( size_t sz) {
|
NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
|
||||||
void *rv = new char[ sz];
|
|
||||||
nsCRT::zero( rv, sz);
|
|
||||||
return rv;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD Init( nsIDeviceContext* aContext, nsIWidget *aWindow);
|
NS_IMETHOD Init(nsIDeviceContext* aContext, nsIWidget *aWindow);
|
||||||
NS_IMETHOD Init( nsIDeviceContext* aContext, nsDrawingSurface aSurface);
|
NS_IMETHOD Init(nsIDeviceContext* aContext, nsDrawingSurface aSurface);
|
||||||
|
|
||||||
NS_IMETHOD Reset();
|
NS_IMETHOD Reset(void);
|
||||||
|
|
||||||
NS_IMETHOD GetDeviceContext( nsIDeviceContext *&aDeviceContext);
|
NS_IMETHOD GetDeviceContext(nsIDeviceContext *&aContext);
|
||||||
|
|
||||||
NS_IMETHOD LockDrawingSurface( PRInt32 aX, PRInt32 aY,
|
NS_IMETHOD LockDrawingSurface(PRInt32 aX, PRInt32 aY, PRUint32 aWidth, PRUint32 aHeight,
|
||||||
PRUint32 aWidth, PRUint32 aHeight,
|
void **aBits, PRInt32 *aStride, PRInt32 *aWidthBytes,
|
||||||
void **aBits,
|
PRUint32 aFlags);
|
||||||
PRInt32 *aStride, PRInt32 *aWidthBytes,
|
NS_IMETHOD UnlockDrawingSurface(void);
|
||||||
PRUint32 aFlags);
|
|
||||||
NS_IMETHOD UnlockDrawingSurface();
|
|
||||||
|
|
||||||
NS_IMETHOD SelectOffScreenDrawingSurface( nsDrawingSurface aSurface);
|
NS_IMETHOD SelectOffScreenDrawingSurface(nsDrawingSurface aSurface);
|
||||||
NS_IMETHOD GetDrawingSurface( nsDrawingSurface *aSurface);
|
NS_IMETHOD GetDrawingSurface(nsDrawingSurface *aSurface);
|
||||||
|
NS_IMETHOD GetHints(PRUint32& aResult);
|
||||||
|
|
||||||
NS_IMETHOD PushState();
|
NS_IMETHOD PushState(void);
|
||||||
NS_IMETHOD PopState( PRBool &aClipEmpty);
|
NS_IMETHOD PopState(PRBool &aClipState);
|
||||||
|
|
||||||
NS_IMETHOD IsVisibleRect( const nsRect& aRect, PRBool &aIsVisible);
|
NS_IMETHOD IsVisibleRect(const nsRect& aRect, PRBool &aClipState);
|
||||||
|
|
||||||
NS_IMETHOD SetClipRect( const nsRect& aRect, nsClipCombine aCombine, PRBool &aClipEmpty);
|
NS_IMETHOD SetClipRect(const nsRect& aRect, nsClipCombine aCombine, PRBool &aCilpState);
|
||||||
NS_IMETHOD GetClipRect( nsRect &aRect, PRBool &aHasLocalClip);
|
NS_IMETHOD GetClipRect(nsRect &aRect, PRBool &aClipState);
|
||||||
NS_IMETHOD SetClipRegion( const nsIRegion& aRegion, nsClipCombine aCombine, PRBool &aClipEmpty);
|
NS_IMETHOD SetClipRegion(const nsIRegion& aRegion, nsClipCombine aCombine, PRBool &aClipState);
|
||||||
NS_IMETHOD GetClipRegion( nsIRegion **aRegion);
|
NS_IMETHOD CopyClipRegion(nsIRegion &aRegion);
|
||||||
NS_IMETHOD CopyClipRegion(nsIRegion &aRegion);
|
NS_IMETHOD GetClipRegion(nsIRegion **aRegion);
|
||||||
|
|
||||||
NS_IMETHOD SetColor( nscolor aColor);
|
NS_IMETHOD SetLineStyle(nsLineStyle aLineStyle);
|
||||||
NS_IMETHOD GetColor( nscolor &aColor) const;
|
NS_IMETHOD GetLineStyle(nsLineStyle &aLineStyle);
|
||||||
|
|
||||||
NS_IMETHOD SetFont( const nsFont& aFont);
|
NS_IMETHOD SetColor(nscolor aColor);
|
||||||
NS_IMETHOD SetFont( nsIFontMetrics *aFontMetrics);
|
NS_IMETHOD GetColor(nscolor &aColor) const;
|
||||||
|
|
||||||
NS_IMETHOD GetFontMetrics( nsIFontMetrics*& aFontMetrics);
|
NS_IMETHOD SetFont(const nsFont& aFont);
|
||||||
|
NS_IMETHOD SetFont(nsIFontMetrics *aFontMetrics);
|
||||||
|
|
||||||
NS_IMETHOD Translate( nscoord aX, nscoord aY);
|
NS_IMETHOD GetFontMetrics(nsIFontMetrics *&aFontMetrics);
|
||||||
NS_IMETHOD Scale( float aSx, float aSy);
|
|
||||||
NS_IMETHOD GetCurrentTransform( nsTransform2D *&aTransform);
|
|
||||||
|
|
||||||
NS_IMETHOD SetLineStyle( nsLineStyle aLineStyle);
|
NS_IMETHOD Translate(nscoord aX, nscoord aY);
|
||||||
NS_IMETHOD GetLineStyle( nsLineStyle &aLineStyle);
|
NS_IMETHOD Scale(float aSx, float aSy);
|
||||||
|
NS_IMETHOD GetCurrentTransform(nsTransform2D *&aTransform);
|
||||||
|
|
||||||
NS_IMETHOD CreateDrawingSurface( nsRect *aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface);
|
NS_IMETHOD CreateDrawingSurface(nsRect *aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface);
|
||||||
NS_IMETHOD DestroyDrawingSurface( nsDrawingSurface aDS);
|
NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS);
|
||||||
|
|
||||||
NS_IMETHOD DrawLine( nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1);
|
||||||
NS_IMETHOD DrawPolyline( const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
|
|
||||||
NS_IMETHOD DrawRect( const nsRect& aRect);
|
NS_IMETHOD DrawRect(const nsRect& aRect);
|
||||||
NS_IMETHOD DrawRect( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
NS_IMETHOD DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
NS_IMETHOD FillRect( const nsRect& aRect);
|
|
||||||
NS_IMETHOD FillRect( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
|
||||||
|
|
||||||
NS_IMETHOD InvertRect(const nsRect& aRect);
|
NS_IMETHOD FillRect(const nsRect& aRect);
|
||||||
NS_IMETHOD InvertRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
NS_IMETHOD FillRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
|
|
||||||
NS_IMETHOD DrawPolygon( const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD InvertRect(const nsRect& aRect);
|
||||||
NS_IMETHOD FillPolygon( const nsPoint aPoints[], PRInt32 aNumPoints);
|
NS_IMETHOD InvertRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
|
|
||||||
NS_IMETHOD DrawEllipse( const nsRect& aRect);
|
NS_IMETHOD DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
NS_IMETHOD DrawEllipse( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints);
|
||||||
NS_IMETHOD FillEllipse( const nsRect& aRect);
|
|
||||||
NS_IMETHOD FillEllipse( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
|
||||||
|
|
||||||
NS_IMETHOD DrawArc( const nsRect& aRect,
|
NS_IMETHOD DrawEllipse(const nsRect& aRect);
|
||||||
float aStartAngle, float aEndAngle);
|
NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
NS_IMETHOD DrawArc( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
|
NS_IMETHOD FillEllipse(const nsRect& aRect);
|
||||||
float aStartAngle, float aEndAngle);
|
NS_IMETHOD FillEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight);
|
||||||
NS_IMETHOD FillArc( const nsRect& aRect,
|
|
||||||
float aStartAngle, float aEndAngle);
|
NS_IMETHOD DrawArc(const nsRect& aRect,
|
||||||
NS_IMETHOD FillArc( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
|
float aStartAngle, float aEndAngle);
|
||||||
float aStartAngle, float aEndAngle);
|
NS_IMETHOD DrawArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
|
||||||
// String widths
|
float aStartAngle, float aEndAngle);
|
||||||
NS_IMETHOD GetWidth( char aC, nscoord &aWidth);
|
NS_IMETHOD FillArc(const nsRect& aRect,
|
||||||
NS_IMETHOD GetWidth( PRUnichar aC, nscoord &aWidth,
|
float aStartAngle, float aEndAngle);
|
||||||
PRInt32 *aFontID = nsnull);
|
NS_IMETHOD FillArc(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight,
|
||||||
NS_IMETHOD GetWidth( const nsString &aString, nscoord &aWidth,
|
float aStartAngle, float aEndAngle);
|
||||||
PRInt32 *aFontID = nsnull);
|
|
||||||
NS_IMETHOD GetWidth( const char* aString, nscoord &aWidth);
|
NS_IMETHOD GetWidth(char aC, nscoord& aWidth);
|
||||||
NS_IMETHOD GetWidth( const char* aString, PRUint32 aLength,
|
NS_IMETHOD GetWidth( PRUnichar aC, nscoord& aWidth,
|
||||||
nscoord &aWidth);
|
PRInt32 *aFontID = nsnull);
|
||||||
NS_IMETHOD GetWidth( const PRUnichar *aString, PRUint32 aLength,
|
NS_IMETHOD GetWidth( const nsString& aString, nscoord& aWidth,
|
||||||
nscoord &aWidth, PRInt32 *aFontID = nsnull);
|
PRInt32 *aFontID = nsnull);
|
||||||
|
NS_IMETHOD GetWidth(const char* aString, nscoord& aWidth);
|
||||||
|
NS_IMETHOD GetWidth(const char* aString, PRUint32 aLength, nscoord& aWidth);
|
||||||
|
NS_IMETHOD GetWidth( const PRUnichar* aString, PRUint32 aLength,
|
||||||
|
nscoord& aWidth, PRInt32 *aFontID = nsnull);
|
||||||
|
#if 0 // OS2TODO
|
||||||
|
NS_IMETHOD GetWidth(const PRUnichar *aString,
|
||||||
|
PRInt32 aLength,
|
||||||
|
PRInt32 aAvailWidth,
|
||||||
|
PRInt32* aBreaks,
|
||||||
|
PRInt32 aNumBreaks,
|
||||||
|
nscoord& aWidth,
|
||||||
|
PRInt32& aNumCharsFit,
|
||||||
|
PRInt32* aFontID);
|
||||||
|
#endif
|
||||||
|
|
||||||
NS_IMETHOD DrawString( const char *aString, PRUint32 aLength,
|
NS_IMETHOD DrawString( const char *aString, PRUint32 aLength,
|
||||||
nscoord aX, nscoord aY,
|
nscoord aX, nscoord aY,
|
||||||
const nscoord* aSpacing = nsnull);
|
const nscoord* aSpacing = nsnull);
|
||||||
NS_IMETHOD DrawString( const PRUnichar *aString, PRUint32 aLength,
|
NS_IMETHOD DrawString( const PRUnichar *aString, PRUint32 aLength,
|
||||||
nscoord aX, nscoord aY,
|
nscoord aX, nscoord aY,
|
||||||
PRInt32 aFontID = -1,
|
PRInt32 aFontID = -1,
|
||||||
const nscoord* aSpacing = nsnull);
|
const nscoord* aSpacing = nsnull);
|
||||||
NS_IMETHOD DrawString( const nsString& aString,
|
NS_IMETHOD DrawString( const nsString& aString,
|
||||||
nscoord aX, nscoord aY,
|
nscoord aX, nscoord aY,
|
||||||
PRInt32 aFontID = -1,
|
PRInt32 aFontID = -1,
|
||||||
const nscoord* aSpacing = nsnull);
|
const nscoord* aSpacing = nsnull);
|
||||||
|
|
||||||
NS_IMETHOD DrawImage( nsIImage *aImage, nscoord aX, nscoord aY);
|
NS_IMETHOD DrawImage( nsIImage *aImage, nscoord aX, nscoord aY);
|
||||||
NS_IMETHOD DrawImage( nsIImage *aImage, nscoord aX, nscoord aY,
|
NS_IMETHOD DrawImage( nsIImage *aImage, nscoord aX, nscoord aY,
|
||||||
nscoord aWidth, nscoord aHeight);
|
nscoord aWidth, nscoord aHeight);
|
||||||
NS_IMETHOD DrawImage( nsIImage *aImage, const nsRect& aRect);
|
NS_IMETHOD DrawImage( nsIImage *aImage, const nsRect& aRect);
|
||||||
NS_IMETHOD DrawImage( nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
|
NS_IMETHOD DrawImage( nsIImage *aImage, const nsRect& aSRect, const nsRect& aDRect);
|
||||||
|
|
||||||
NS_IMETHOD DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
|
NS_IMETHOD DrawTile(nsIImage *aImage,nscoord aX0,nscoord aY0,nscoord aX1,nscoord aY1,
|
||||||
nscoord aWidth,nscoord aHeight);
|
nscoord aWidth,nscoord aHeight);
|
||||||
|
|
||||||
NS_IMETHOD CopyOffScreenBits( nsDrawingSurface aSrcSurf,
|
|
||||||
PRInt32 aSrcX, PRInt32 aSrcY,
|
|
||||||
const nsRect &aDestBounds,
|
|
||||||
PRUint32 aCopyFlags);
|
|
||||||
|
|
||||||
NS_IMETHOD GetHints( PRUint32 &aResult);
|
NS_IMETHOD CopyOffScreenBits(nsDrawingSurface aSrcSurf, PRInt32 aSrcX, PRInt32 aSrcY,
|
||||||
|
const nsRect &aDestBounds, PRUint32 aCopyFlags);
|
||||||
|
//~~~
|
||||||
|
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);
|
||||||
|
|
||||||
NS_IMETHOD RetrieveCurrentNativeGraphicData(PRUint32 * ngd);
|
|
||||||
|
#if 0 // OS2TODO
|
||||||
|
#ifdef MOZ_MATHML
|
||||||
|
NS_IMETHOD
|
||||||
|
GetBoundingMetrics(const char* aString,
|
||||||
|
PRUint32 aLength,
|
||||||
|
nsBoundingMetrics& aBoundingMetrics);
|
||||||
|
|
||||||
|
NS_IMETHOD
|
||||||
|
GetBoundingMetrics(const PRUnichar* aString,
|
||||||
|
PRUint32 aLength,
|
||||||
|
nsBoundingMetrics& aBoundingMetrics,
|
||||||
|
PRInt32* aFontID);
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// Convert XP-rects to OS/2 space.
|
// Convert XP-rects to OS/2 space.
|
||||||
// World coordinates given & required, double inclusive rcl wanted.
|
// World coordinates given & required, double inclusive rcl wanted.
|
||||||
@ -182,26 +206,36 @@ class nsRenderingContextOS2 : public nsIRenderingContext
|
|||||||
// Convert XP points to OS/2 space.
|
// Convert XP points to OS/2 space.
|
||||||
void NS2PM( PPOINTL aPointl, ULONG cPointls);
|
void NS2PM( PPOINTL aPointl, ULONG cPointls);
|
||||||
|
|
||||||
private:
|
|
||||||
nsresult CommonInit();
|
|
||||||
nsresult SetupPS( HPS oldPS, HPS newPS);
|
|
||||||
void GetTargetHeight( PRUint32 &ht);
|
|
||||||
|
|
||||||
// Colour/font setting; call before drawing things.
|
|
||||||
void SetupDrawingColor( BOOL bForce = FALSE);
|
|
||||||
void SetupFontAndColor( BOOL bForce = FALSE);
|
|
||||||
|
|
||||||
// Primitive draw-ers
|
|
||||||
void PMDrawRect( nsRect &rect, BOOL fill);
|
|
||||||
void PMDrawPoly( const nsPoint aPoints[], PRInt32 aNumPoints, PRBool bFilled);
|
|
||||||
void PMDrawArc( nsRect &rect, PRBool bFilled, PRBool bFull, PRInt32 start=0, PRInt32 end=0);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ConditionRect is used to fix coordinate overflow problems for
|
// ConditionRect is used to fix coordinate overflow problems for
|
||||||
// rectangles after they are transformed to screen coordinates
|
// rectangles after they are transformed to screen coordinates
|
||||||
NS_IMETHOD ConditionRect( nscoord &x, nscoord &y, nscoord &w, nscoord &h );
|
NS_IMETHOD ConditionRect( nscoord &x, nscoord &y, nscoord &w, nscoord &h );
|
||||||
|
|
||||||
|
nsresult CommonInit(void);
|
||||||
|
nsresult SetupPS( HPS oldPS, HPS newPS);
|
||||||
|
void GetTargetHeight( PRUint32 &ht);
|
||||||
|
|
||||||
|
// Colour/font setting; call before drawing things.
|
||||||
|
void SetupDrawingColor( BOOL bForce = FALSE);
|
||||||
|
void SetupFontAndColor( BOOL bForce = FALSE);
|
||||||
|
|
||||||
|
// Primitive draw-ers
|
||||||
|
void PMDrawRect( nsRect &rect, BOOL fill);
|
||||||
|
void PMDrawPoly( const nsPoint aPoints[], PRInt32 aNumPoints, PRBool bFilled);
|
||||||
|
void PMDrawArc( nsRect &rect, PRBool bFilled, PRBool bFull, PRInt32 start=0, PRInt32 end=0);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
~nsRenderingContextOS2();
|
||||||
|
|
||||||
|
#if 0 // OS2TODO
|
||||||
|
/** ---------------------------------------------------
|
||||||
|
* See documentation in nsIRenderingContextImpl.h
|
||||||
|
* @update 4/01/00 dwc
|
||||||
|
*/
|
||||||
|
virtual PRBool CanTile(nscoord aWidth,nscoord aHeight);
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
|
||||||
nsIDeviceContext *mContext; // device context
|
nsIDeviceContext *mContext; // device context
|
||||||
nsIPaletteOS2 *mPalette; // palette from the dc
|
nsIPaletteOS2 *mPalette; // palette from the dc
|
||||||
nsDrawingSurfaceOS2 *mSurface; // draw things here
|
nsDrawingSurfaceOS2 *mSurface; // draw things here
|
||||||
|
@ -44,7 +44,7 @@ EXTRA_DSO_LDOPTS = $(EXTRA_DSO_LIBS) \
|
|||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
||||||
EXTRA_DSO_LDOPTS += libuls.lib
|
EXTRA_DSO_LDOPTS += libuls.$(LIB_SUFFIX) ../libnslocale_s.$(LIB_SUFFIX)
|
||||||
else
|
else
|
||||||
EXTRA_DSO_LDOPTS += -llibuni
|
EXTRA_DSO_LDOPTS += -llibuni
|
||||||
endif
|
endif
|
||||||
@ -53,3 +53,4 @@ include $(topsrcdir)/config/rules.mk
|
|||||||
|
|
||||||
INCLUDES += -I$(srcdir)/..
|
INCLUDES += -I$(srcdir)/..
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,10 +25,10 @@
|
|||||||
#include "ulsitem.h"
|
#include "ulsitem.h"
|
||||||
|
|
||||||
#include "nsDateTimeFormatOS2.h"
|
#include "nsDateTimeFormatOS2.h"
|
||||||
#include "nsILocaleOS2.h"
|
#include "nsIOS2Locale.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
static NS_DEFINE_IID(kILocaleOS2IID, NS_ILOCALEOS2_IID);
|
static NS_DEFINE_IID(kILocaleOS2IID, NS_IOS2LOCALE_IID);
|
||||||
static NS_DEFINE_IID(kIDateTimeFormatIID, NS_IDATETIMEFORMAT_IID);
|
static NS_DEFINE_IID(kIDateTimeFormatIID, NS_IDATETIMEFORMAT_IID);
|
||||||
|
|
||||||
// nsISupports implementation
|
// nsISupports implementation
|
||||||
@ -69,7 +69,7 @@ nsresult nsDateTimeFormatOS2::FormatTMTime( nsILocale *aLocale,
|
|||||||
if( !aLocale || !aTime)
|
if( !aLocale || !aTime)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
nsCOMPtr <nsILocaleOS2> os2locale;
|
nsCOMPtr <nsIOS2Locale> os2locale;
|
||||||
nsresult rc = NS_ERROR_FAILURE;
|
nsresult rc = NS_ERROR_FAILURE;
|
||||||
|
|
||||||
// find a sane locale object
|
// find a sane locale object
|
||||||
@ -173,3 +173,50 @@ nsresult nsDateTimeFormatOS2::FormatTMTime( nsILocale *aLocale,
|
|||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// performs a locale sensitive date formatting operation on the PRTime parameter
|
||||||
|
nsresult nsDateTimeFormatOS2::FormatPRTime(nsILocale* locale,
|
||||||
|
const nsDateFormatSelector dateFormatSelector,
|
||||||
|
const nsTimeFormatSelector timeFormatSelector,
|
||||||
|
const PRTime prTime,
|
||||||
|
nsString& stringOut)
|
||||||
|
{
|
||||||
|
PRExplodedTime explodedTime;
|
||||||
|
PR_ExplodeTime(prTime, PR_LocalTimeParameters, &explodedTime);
|
||||||
|
|
||||||
|
return FormatPRExplodedTime(locale, dateFormatSelector, timeFormatSelector, &explodedTime, stringOut);
|
||||||
|
}
|
||||||
|
|
||||||
|
// performs a locale sensitive date formatting operation on the PRExplodedTime parameter
|
||||||
|
nsresult nsDateTimeFormatOS2::FormatPRExplodedTime(nsILocale* locale,
|
||||||
|
const nsDateFormatSelector dateFormatSelector,
|
||||||
|
const nsTimeFormatSelector timeFormatSelector,
|
||||||
|
const PRExplodedTime* explodedTime,
|
||||||
|
nsString& stringOut)
|
||||||
|
{
|
||||||
|
struct tm tmTime;
|
||||||
|
/* be safe and set all members of struct tm to zero
|
||||||
|
*
|
||||||
|
* there are other fields in the tm struct that we aren't setting
|
||||||
|
* (tm_isdst, tm_gmtoff, tm_zone, should we set these?) and since
|
||||||
|
* tmTime is on the stack, it may be filled with garbage, but
|
||||||
|
* the garbage may vary. (this may explain why some saw bug #10412, and
|
||||||
|
* others did not.
|
||||||
|
*
|
||||||
|
* when tmTime is passed to strftime() with garbage bad things may happen.
|
||||||
|
* see bug #10412
|
||||||
|
*/
|
||||||
|
nsCRT::memset( &tmTime, 0, sizeof(tmTime) );
|
||||||
|
|
||||||
|
tmTime.tm_yday = explodedTime->tm_yday;
|
||||||
|
tmTime.tm_wday = explodedTime->tm_wday;
|
||||||
|
tmTime.tm_year = explodedTime->tm_year;
|
||||||
|
tmTime.tm_year -= 1900;
|
||||||
|
tmTime.tm_mon = explodedTime->tm_month;
|
||||||
|
tmTime.tm_mday = explodedTime->tm_mday;
|
||||||
|
tmTime.tm_hour = explodedTime->tm_hour;
|
||||||
|
tmTime.tm_min = explodedTime->tm_min;
|
||||||
|
tmTime.tm_sec = explodedTime->tm_sec;
|
||||||
|
|
||||||
|
return FormatTMTime(locale, dateFormatSelector, timeFormatSelector, &tmTime, stringOut);
|
||||||
|
}
|
||||||
|
@ -50,6 +50,21 @@ class nsDateTimeFormatOS2 : public nsIDateTimeFormat
|
|||||||
const nsTimeFormatSelector aTimeFormatSelector,
|
const nsTimeFormatSelector aTimeFormatSelector,
|
||||||
const struct tm *aTime,
|
const struct tm *aTime,
|
||||||
nsString &aStringOut);
|
nsString &aStringOut);
|
||||||
|
|
||||||
|
// performs a locale sensitive date formatting operation on the PRTime parameter
|
||||||
|
NS_IMETHOD FormatPRTime(nsILocale* locale,
|
||||||
|
const nsDateFormatSelector dateFormatSelector,
|
||||||
|
const nsTimeFormatSelector timeFormatSelector,
|
||||||
|
const PRTime prTime,
|
||||||
|
nsString& stringOut);
|
||||||
|
|
||||||
|
// performs a locale sensitive date formatting operation on the PRExplodedTime parameter
|
||||||
|
NS_IMETHOD FormatPRExplodedTime(nsILocale* locale,
|
||||||
|
const nsDateFormatSelector dateFormatSelector,
|
||||||
|
const nsTimeFormatSelector timeFormatSelector,
|
||||||
|
const PRExplodedTime* explodedTime,
|
||||||
|
nsString& stringOut);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
|
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "nscore.h"
|
#include "nscore.h"
|
||||||
@ -35,7 +35,7 @@
|
|||||||
static NS_DEFINE_IID(kICollationFactoryIID, NS_ICOLLATIONFACTORY_IID);
|
static NS_DEFINE_IID(kICollationFactoryIID, NS_ICOLLATIONFACTORY_IID);
|
||||||
static NS_DEFINE_IID(kICollationIID, NS_ICOLLATION_IID);
|
static NS_DEFINE_IID(kICollationIID, NS_ICOLLATION_IID);
|
||||||
static NS_DEFINE_IID(kIDateTimeFormatIID, NS_IDATETIMEFORMAT_IID);
|
static NS_DEFINE_IID(kIDateTimeFormatIID, NS_IDATETIMEFORMAT_IID);
|
||||||
static NS_DEFINE_IID(kILocaleFactoryIID,NS_ILOCALEFACTORY_IID);
|
//static NS_DEFINE_IID(kILocaleFactoryIID,NS_ILOCALEFACTORY_IID);
|
||||||
|
|
||||||
static NS_DEFINE_CID(kLocaleFactoryCID, NS_LOCALEFACTORY_CID);
|
static NS_DEFINE_CID(kLocaleFactoryCID, NS_LOCALEFACTORY_CID);
|
||||||
static NS_DEFINE_CID(kCollationFactoryCID, NS_COLLATIONFACTORY_CID);
|
static NS_DEFINE_CID(kCollationFactoryCID, NS_COLLATIONFACTORY_CID);
|
||||||
@ -82,7 +82,7 @@ nsLocaleDllFactory::nsLocaleDllFactory( const nsCID &aClass)
|
|||||||
mClassID = aClass;
|
mClassID = aClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_ISUPPORTS(nsLocaleDllFactory,NS_GET_IID(nsIFactory))
|
NS_IMPL_ISUPPORTS(nsLocaleDllFactory,nsIFactory::GetIID())
|
||||||
|
|
||||||
nsresult nsLocaleDllFactory::CreateInstance( nsISupports *aOuter,
|
nsresult nsLocaleDllFactory::CreateInstance( nsISupports *aOuter,
|
||||||
const nsIID &aIID,
|
const nsIID &aIID,
|
||||||
@ -133,13 +133,13 @@ extern "C" NS_EXPORT nsresult NSGetFactory( nsISupports *aServiceMgr,
|
|||||||
{
|
{
|
||||||
fact = new nsLocaleFactoryOS2;
|
fact = new nsLocaleFactoryOS2;
|
||||||
// XXX this next line looks a bit wrong, but hey...
|
// XXX this next line looks a bit wrong, but hey...
|
||||||
rc = fact->QueryInterface( kILocaleFactoryIID, (void **) aFactory);
|
// rc = fact->QueryInterface( kILocaleFactoryIID, (void **) aFactory);
|
||||||
}
|
}
|
||||||
else // something sensible
|
else // something sensible
|
||||||
{
|
{
|
||||||
fact = new nsLocaleDllFactory( aClass);
|
fact = new nsLocaleDllFactory( aClass);
|
||||||
|
|
||||||
rc = fact->QueryInterface( NS_GET_IID(nsIFactory), (void**)aFactory);
|
rc = fact->QueryInterface( nsIFactory::GetIID(), (void**)aFactory);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( NS_FAILED(rc))
|
if( NS_FAILED(rc))
|
||||||
|
@ -207,10 +207,37 @@ nsLocaleFactoryOS2::CreateInstance(nsISupports* aOuter, REFNSIID aIID,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult nsLocaleFactoryOS2::QueryInterface(const nsIID &aIID,
|
||||||
|
void **aResult)
|
||||||
|
{
|
||||||
|
if (aResult == NULL) {
|
||||||
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Always NULL result, in case of failure
|
||||||
|
*aResult = NULL;
|
||||||
|
|
||||||
|
if (aIID.Equals(kISupportsIID)) {
|
||||||
|
*aResult = (void *)(nsISupports*)this;
|
||||||
|
}
|
||||||
|
else if (aIID.Equals(kIFactoryIID)) {
|
||||||
|
*aResult = (void *)(nsIFactory*)this;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*aResult == NULL) {
|
||||||
|
return NS_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_ADDREF_THIS(); // Increase reference count for caller
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsLocaleFactoryOS2::LockFactory(PRBool aBool)
|
nsLocaleFactoryOS2::LockFactory(PRBool aBool)
|
||||||
{
|
{
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMPL_THREADSAFE_ISUPPORTS1(nsLocaleFactoryOS2, nsIFactory)
|
NS_IMPL_ADDREF(nsLocaleFactoryOS2);
|
||||||
|
NS_IMPL_RELEASE(nsLocaleFactoryOS2);
|
||||||
|
@ -23,11 +23,15 @@
|
|||||||
#include <os2.h>
|
#include <os2.h>
|
||||||
#include "unidef.h"
|
#include "unidef.h"
|
||||||
|
|
||||||
|
#include "nsISupports.h"
|
||||||
#include "nscore.h"
|
#include "nscore.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
#include "nsILocale.h"
|
||||||
#include "nsLocaleOS2.h"
|
#include "nsLocaleOS2.h"
|
||||||
|
#include "nsLocaleCID.h"
|
||||||
|
|
||||||
static NS_DEFINE_IID(kILocaleIID, NS_ILOCALE_IID);
|
static NS_DEFINE_IID(kILocaleIID, NS_ILOCALE_IID);
|
||||||
static NS_DEFINE_IID(kILocaleOS2IID, NS_ILOCALEOS2_IID);
|
static NS_DEFINE_IID(kIOS2LocaleIID, NS_IOS2LOCALE_IID);
|
||||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||||
|
|
||||||
// for now
|
// for now
|
||||||
@ -36,18 +40,18 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// nsISupports implementation
|
// nsISupports implementation
|
||||||
NS_IMPL_ADDREF(nsLocaleOS2)
|
NS_IMPL_ADDREF(nsOS2Locale)
|
||||||
NS_IMPL_RELEASE(nsLocaleOS2)
|
NS_IMPL_RELEASE(nsOS2Locale)
|
||||||
|
|
||||||
nsresult nsLocaleOS2::QueryInterface( const nsIID &aIID, void **aInstancePtr)
|
nsresult nsOS2Locale::QueryInterface( const nsIID &aIID, void **aInstancePtr)
|
||||||
{
|
{
|
||||||
if( !aInstancePtr)
|
if( !aInstancePtr)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
|
||||||
*aInstancePtr = nsnull;
|
*aInstancePtr = nsnull;
|
||||||
|
|
||||||
if( aIID.Equals( kILocaleOS2IID))
|
if( aIID.Equals( kIOS2LocaleIID))
|
||||||
*aInstancePtr = (void*) ((nsILocaleOS2*)this);
|
*aInstancePtr = (void*) ((nsIOS2Locale*)this);
|
||||||
else if( aIID.Equals( kILocaleIID))
|
else if( aIID.Equals( kILocaleIID))
|
||||||
*aInstancePtr = (void*) ((nsILocale*)this);
|
*aInstancePtr = (void*) ((nsILocale*)this);
|
||||||
else if( aIID.Equals( kISupportsIID))
|
else if( aIID.Equals( kISupportsIID))
|
||||||
@ -61,12 +65,12 @@ nsresult nsLocaleOS2::QueryInterface( const nsIID &aIID, void **aInstancePtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ctor-dtor
|
// ctor-dtor
|
||||||
nsLocaleOS2::nsLocaleOS2() : mLocaleObject(nsnull)
|
nsOS2Locale::nsOS2Locale() : mLocaleObject(nsnull)
|
||||||
{
|
{
|
||||||
NS_INIT_REFCNT();
|
NS_INIT_REFCNT();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsLocaleOS2::~nsLocaleOS2()
|
nsOS2Locale::~nsOS2Locale()
|
||||||
{
|
{
|
||||||
if( mLocaleObject)
|
if( mLocaleObject)
|
||||||
UniFreeLocaleObject( mLocaleObject);
|
UniFreeLocaleObject( mLocaleObject);
|
||||||
@ -89,10 +93,10 @@ static int GetLocaleCategory( const nsString *aCat)
|
|||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
// nsILocaleOS2
|
// nsIOS2Locale
|
||||||
|
|
||||||
// Init a complex locale - categories should be magic nsLocale words
|
// Init a complex locale - categories should be magic nsLocale words
|
||||||
nsresult nsLocaleOS2::Init( nsString **aCatList,
|
nsresult nsOS2Locale::Init( nsString **aCatList,
|
||||||
nsString **aValList,
|
nsString **aValList,
|
||||||
PRUint8 aLength)
|
PRUint8 aLength)
|
||||||
{
|
{
|
||||||
@ -166,7 +170,7 @@ nsresult nsLocaleOS2::Init( nsString **aCatList,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Init a locale object from a xx-XX style name
|
// Init a locale object from a xx-XX style name
|
||||||
nsresult nsLocaleOS2::Init( const nsString &aLocaleName)
|
nsresult nsOS2Locale::Init( const nsString &aLocaleName)
|
||||||
{
|
{
|
||||||
char szLocale[7] = { 0 };
|
char szLocale[7] = { 0 };
|
||||||
|
|
||||||
@ -194,7 +198,7 @@ nsresult nsLocaleOS2::Init( const nsString &aLocaleName)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
nsresult nsLocaleOS2::Init( char *pszLocale)
|
nsresult nsOS2Locale::Init( char *pszLocale)
|
||||||
{
|
{
|
||||||
nsresult nr = NS_ERROR_FAILURE;
|
nsresult nr = NS_ERROR_FAILURE;
|
||||||
|
|
||||||
@ -208,7 +212,7 @@ nsresult nsLocaleOS2::Init( char *pszLocale)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the OS/2 locale object
|
// Get the OS/2 locale object
|
||||||
nsresult nsLocaleOS2::GetLocaleObject( LocaleObject *aLocaleObject)
|
nsresult nsOS2Locale::GetLocaleObject( LocaleObject *aLocaleObject)
|
||||||
{
|
{
|
||||||
if( !aLocaleObject)
|
if( !aLocaleObject)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
@ -218,7 +222,7 @@ nsresult nsLocaleOS2::GetLocaleObject( LocaleObject *aLocaleObject)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// nsILocale
|
// nsILocale
|
||||||
nsresult nsLocaleOS2::GetCategory( const nsString *aCat, nsString *aLocale)
|
nsresult nsOS2Locale::GetCategory( const nsString *aCat, nsString *aLocale)
|
||||||
{
|
{
|
||||||
if( !aCat || !aLocale)
|
if( !aCat || !aLocale)
|
||||||
return NS_ERROR_NULL_POINTER;
|
return NS_ERROR_NULL_POINTER;
|
||||||
@ -249,3 +253,16 @@ nsSystemLocale::nsSystemLocale()
|
|||||||
{
|
{
|
||||||
Init( ""); // create locale based on value of LANG and friends
|
Init( ""); // create locale based on value of LANG and friends
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXXX STUBS
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsOS2Locale::GetPlatformLocale(const nsString* locale,char* os2Locale, size_t length)
|
||||||
|
{
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsOS2Locale::GetXPLocale(const char* os2Locale, nsString* locale)
|
||||||
|
{
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
@ -22,14 +22,16 @@
|
|||||||
#ifndef _nslocaleos2_h_
|
#ifndef _nslocaleos2_h_
|
||||||
#define _nslocaleos2_h_
|
#define _nslocaleos2_h_
|
||||||
|
|
||||||
#include "nsILocale.h"
|
#include "nsISupports.h"
|
||||||
#include "nsILocaleOS2.h"
|
#include "nscore.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
#include "nsIOS2Locale.h"
|
||||||
|
|
||||||
class nsLocaleOS2 : public nsILocale, public nsILocaleOS2
|
class nsOS2Locale : public nsIOS2Locale
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsLocaleOS2();
|
nsOS2Locale();
|
||||||
virtual ~nsLocaleOS2();
|
virtual ~nsOS2Locale();
|
||||||
|
|
||||||
// nsISupports
|
// nsISupports
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
@ -37,7 +39,7 @@ class nsLocaleOS2 : public nsILocale, public nsILocaleOS2
|
|||||||
// nsILocale
|
// nsILocale
|
||||||
NS_IMETHOD GetCategory( const nsString *aCat, nsString *aLocale);
|
NS_IMETHOD GetCategory( const nsString *aCat, nsString *aLocale);
|
||||||
|
|
||||||
// nsILocaleOS2
|
// nsIOS2Locale
|
||||||
// Init a complex locale - categories should be magic nsLocale words
|
// Init a complex locale - categories should be magic nsLocale words
|
||||||
NS_IMETHOD Init( nsString **aCatList,
|
NS_IMETHOD Init( nsString **aCatList,
|
||||||
nsString **aValList,
|
nsString **aValList,
|
||||||
@ -49,13 +51,17 @@ class nsLocaleOS2 : public nsILocale, public nsILocaleOS2
|
|||||||
// Get the OS/2 locale object
|
// Get the OS/2 locale object
|
||||||
NS_IMETHOD GetLocaleObject( LocaleObject *aLocaleObject);
|
NS_IMETHOD GetLocaleObject( LocaleObject *aLocaleObject);
|
||||||
|
|
||||||
|
NS_IMETHOD GetPlatformLocale(const nsString* locale,char* os2Locale,
|
||||||
|
size_t length);
|
||||||
|
NS_IMETHOD GetXPLocale(const char* os2Locale, nsString* locale);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LocaleObject mLocaleObject;
|
LocaleObject mLocaleObject;
|
||||||
|
|
||||||
NS_IMETHOD Init( char *pszLocale);
|
NS_IMETHOD Init( char *pszLocale);
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsSystemLocale : public nsLocaleOS2
|
class nsSystemLocale : public nsOS2Locale
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsSystemLocale();
|
nsSystemLocale();
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
* Date Modified by Description of modification
|
* Date Modified by Description of modification
|
||||||
* 03/23/2000 IBM Corp. Fix missing title bars on profile wizard windows.
|
* 03/23/2000 IBM Corp. Fix missing title bars on profile wizard windows.
|
||||||
* 04/11/2000 IBM Corp. Remove assertion.
|
* 04/11/2000 IBM Corp. Remove assertion.
|
||||||
|
* 05/10/2000 IBM Corp. Correct initial position of frame w/titlebar
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Frame window - produced when NS_WINDOW_CID is required.
|
// Frame window - produced when NS_WINDOW_CID is required.
|
||||||
@ -96,9 +97,34 @@ void nsFrameWindow::RealDoCreate( HWND hwndP, nsWindow *aParent,
|
|||||||
|
|
||||||
NS_ASSERTION( hwndFrame, "Couldn't create frame");
|
NS_ASSERTION( hwndFrame, "Couldn't create frame");
|
||||||
|
|
||||||
|
// Frames have a minimum height based on the pieces they are created with,
|
||||||
|
// such as titlebar, menubar, frame borders, etc. We need this minimum
|
||||||
|
// height so we can correctly set the frame position (coordinate flipping).
|
||||||
|
nsRect frameRect = aRect;
|
||||||
|
long minheight;
|
||||||
|
|
||||||
|
if ( fcd.flCreateFlags & FCF_SIZEBORDER) {
|
||||||
|
minheight = 2 * WinQuerySysValue( HWND_DESKTOP, SV_CYSIZEBORDER);
|
||||||
|
}
|
||||||
|
else if ( fcd.flCreateFlags & FCF_DLGBORDER) {
|
||||||
|
minheight = 2 * WinQuerySysValue( HWND_DESKTOP, SV_CYDLGFRAME);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
minheight = 2 * WinQuerySysValue( HWND_DESKTOP, SV_CYBORDER);
|
||||||
|
}
|
||||||
|
if ( fcd.flCreateFlags & FCF_TITLEBAR) {
|
||||||
|
minheight += WinQuerySysValue( HWND_DESKTOP, SV_CYTITLEBAR);
|
||||||
|
}
|
||||||
|
if ( fcd.flCreateFlags & FCF_MENU) {
|
||||||
|
minheight += WinQuerySysValue( HWND_DESKTOP, SV_CYMENU);
|
||||||
|
}
|
||||||
|
if ( frameRect.height < minheight) {
|
||||||
|
frameRect.height = minheight;
|
||||||
|
}
|
||||||
|
|
||||||
// Now create the client as a child of us, triggers resize and sets
|
// Now create the client as a child of us, triggers resize and sets
|
||||||
// up the client size (with any luck...)
|
// up the client size (with any luck...)
|
||||||
nsCanvas::RealDoCreate( hwndFrame, nsnull, aRect, aHandleEventFunction,
|
nsCanvas::RealDoCreate( hwndFrame, nsnull, frameRect, aHandleEventFunction,
|
||||||
aContext, aAppShell, aInitData, hwndO);
|
aContext, aAppShell, aInitData, hwndO);
|
||||||
|
|
||||||
// Subclass frame
|
// Subclass frame
|
||||||
|
@ -16,25 +16,31 @@
|
|||||||
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
|
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s):
|
* Contributor(s):
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 04/20/2000 IBM Corp. Make more like Windows.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _nsLookAndFeel_h
|
#ifndef __nsLookAndFeel
|
||||||
#define _nsLookAndFeel_h
|
#define __nsLookAndFeel
|
||||||
|
|
||||||
#include "nsILookAndFeel.h"
|
#include "nsILookAndFeel.h"
|
||||||
|
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
class nsLookAndFeel: public nsILookAndFeel
|
class nsLookAndFeel: public nsILookAndFeel {
|
||||||
{
|
public:
|
||||||
public:
|
nsLookAndFeel();
|
||||||
nsLookAndFeel();
|
virtual ~nsLookAndFeel();
|
||||||
|
|
||||||
NS_DECL_ISUPPORTS
|
NS_DECL_ISUPPORTS
|
||||||
|
|
||||||
NS_IMETHOD GetColor( const nsColorID aID, nscolor &aColor);
|
NS_IMETHOD GetColor(const nsColorID aID, nscolor &aColor);
|
||||||
NS_IMETHOD GetMetric( const nsMetricID aID, PRInt32 &aMetric);
|
NS_IMETHOD GetMetric(const nsMetricID aID, PRInt32 & aMetric);
|
||||||
NS_IMETHOD GetMetric( const nsMetricFloatID aID, float &aMetric);
|
NS_IMETHOD GetMetric(const nsMetricFloatID aID, float & aMetric);
|
||||||
|
|
||||||
#ifdef NS_DEBUG
|
#ifdef NS_DEBUG
|
||||||
// This method returns the actual (or nearest estimate)
|
// This method returns the actual (or nearest estimate)
|
||||||
|
@ -1932,10 +1932,21 @@ nsresult nsWindow::InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchron
|
|||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
if( mWnd) {
|
if( mWnd) {
|
||||||
HRGN nativeRegion;
|
HRGN nativeRegion;
|
||||||
rv = aRegion->GetNativeRegion((void *&)nativeRegion);
|
rv = aRegion->GetNativeRegion( (void *&)nativeRegion);
|
||||||
if( nativeRegion) {
|
if( nativeRegion) {
|
||||||
if( NS_SUCCEEDED(rv)) {
|
if( NS_SUCCEEDED(rv)) {
|
||||||
WinInvalidateRegion(mWnd, nativeRegion, TRUE);
|
RECTL rcl;
|
||||||
|
LONG height;
|
||||||
|
HPS hps = WinGetScreenPS( HWND_DESKTOP);
|
||||||
|
LONG lComplexity = GpiQueryRegionBox( hps, nativeRegion, &rcl);
|
||||||
|
WinReleasePS( hps);
|
||||||
|
height = rcl.yTop - rcl.yBottom;
|
||||||
|
rcl.yTop = GetClientHeight() - rcl.yBottom;
|
||||||
|
rcl.yBottom = rcl.yTop - height;
|
||||||
|
|
||||||
|
WinInvalidateRect( mWnd, &rcl, FALSE);
|
||||||
|
|
||||||
|
// WinInvalidateRegion( mWnd, nativeRegion, TRUE);
|
||||||
#if 0
|
#if 0
|
||||||
if( PR_TRUE == aIsSynchronous)
|
if( PR_TRUE == aIsSynchronous)
|
||||||
Update();
|
Update();
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
|
|
||||||
#ifdef XP_OS2_VACPP
|
#ifdef XP_OS2_VACPP
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
|
#include "dirent.h"
|
||||||
#define F_OK 0
|
#define F_OK 0
|
||||||
#define X_OK 1
|
#define X_OK 1
|
||||||
#define W_OK 2
|
#define W_OK 2
|
||||||
@ -341,13 +342,13 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
|||||||
if (stricmp(tail, leaf) || tail != nsnull) {
|
if (stricmp(tail, leaf) || tail != nsnull) {
|
||||||
|
|
||||||
// Absolute path
|
// Absolute path
|
||||||
if (mPath[2] == '\\' && mPath[1] == ':') {
|
if (mPath.CharAt(2) == '\\' && mPath.CharAt(1) == ':') {
|
||||||
++tail;
|
++tail;
|
||||||
tail = strchr(tail, '\\');
|
tail = strchr(tail, '\\');
|
||||||
}
|
}
|
||||||
|
|
||||||
// LAN path
|
// LAN path
|
||||||
if (mPath[0] == '\\' && mPath[1] == '\\') {
|
if (mPath.CharAt(0) == '\\' && mPath.CharAt(1) == '\\') {
|
||||||
tail += 2;
|
tail += 2;
|
||||||
tail = strchr(tail, '\\');
|
tail = strchr(tail, '\\');
|
||||||
}
|
}
|
||||||
@ -356,7 +357,7 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
|||||||
size_t idx = len - strlen(tail);
|
size_t idx = len - strlen(tail);
|
||||||
|
|
||||||
while (stricmp(segment, mPath)) {
|
while (stricmp(segment, mPath)) {
|
||||||
memcpy(segment, mPath, idx);
|
memcpy(segment, (char*)mPath, idx);
|
||||||
if (access(segment, F_OK) != 0)
|
if (access(segment, F_OK) != 0)
|
||||||
mkdir(segment, 0);
|
mkdir(segment, 0);
|
||||||
|
|
||||||
@ -480,7 +481,7 @@ NS_IMETHODIMP
|
|||||||
nsLocalFile::GetPath(char **_retval)
|
nsLocalFile::GetPath(char **_retval)
|
||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(_retval);
|
NS_ENSURE_ARG_POINTER(_retval);
|
||||||
*_retval = (char*)nsAllocator::Clone(mPath, strlen(mPath) + 1);
|
*_retval = (char*)nsAllocator::Clone((char*)mPath, strlen(mPath) + 1);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,7 +634,7 @@ nsLocalFile::Delete(PRBool recursive)
|
|||||||
iterator->HasMoreElements(&more);
|
iterator->HasMoreElements(&more);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rmdir(filePath); // todo: save return value?
|
rmdir((char*)filePath); // todo: save return value?
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -662,9 +663,9 @@ nsLocalFile::SetLastModificationDate(PRInt64 aLastModificationDate)
|
|||||||
struct utimbuf ut;
|
struct utimbuf ut;
|
||||||
ut.actime = mStatCache.st_atime;
|
ut.actime = mStatCache.st_atime;
|
||||||
LL_L2UI(ut.modtime, aLastModificationDate);
|
LL_L2UI(ut.modtime, aLastModificationDate);
|
||||||
result = utime((const char*)mPath, &ut);
|
result = utime((char*)mPath, &ut);
|
||||||
} else {
|
} else {
|
||||||
result = utime((const char*)mPath, NULL);
|
result = utime((char*)mPath, NULL);
|
||||||
}
|
}
|
||||||
SetNoStatCache();
|
SetNoStatCache();
|
||||||
return NSRESULT_FOR_RETURN(result);
|
return NSRESULT_FOR_RETURN(result);
|
||||||
@ -769,7 +770,7 @@ nsLocalFile::GetDiskSpaceAvailable(PRInt64 *aDiskSpaceAvailable)
|
|||||||
NS_ENSURE_ARG_POINTER(aDiskSpaceAvailable);
|
NS_ENSURE_ARG_POINTER(aDiskSpaceAvailable);
|
||||||
CHECK_mPath();
|
CHECK_mPath();
|
||||||
|
|
||||||
ULONG ulDriveNo = toupper(mPath[0]) + 1 - 'A';
|
ULONG ulDriveNo = toupper(mPath.CharAt(0)) + 1 - 'A';
|
||||||
FSALLOCATE fsAllocate = { 0 };
|
FSALLOCATE fsAllocate = { 0 };
|
||||||
APIRET rv = DosQueryFSInfo(ulDriveNo, FSIL_ALLOC,
|
APIRET rv = DosQueryFSInfo(ulDriveNo, FSIL_ALLOC,
|
||||||
&fsAllocate, sizeof(fsAllocate));
|
&fsAllocate, sizeof(fsAllocate));
|
||||||
@ -984,7 +985,7 @@ nsLocalFile::GetTarget(char **_retval)
|
|||||||
{
|
{
|
||||||
NS_ENSURE_ARG_POINTER(_retval);
|
NS_ENSURE_ARG_POINTER(_retval);
|
||||||
VALIDATE_STAT_CACHE();
|
VALIDATE_STAT_CACHE();
|
||||||
*_retval = (char*)nsAllocator::Clone(mPath, strlen(mPath) + 1);
|
*_retval = (char*)nsAllocator::Clone((char*)mPath, strlen(mPath) + 1);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,6 +48,10 @@
|
|||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifdef XP_OS2_VACPP
|
||||||
|
#define ENOTDIR EBADPOS
|
||||||
|
#endif
|
||||||
|
|
||||||
#define NSRESULT_FOR_RETURN(ret) (!(ret) ? NS_OK : NSRESULT_FOR_ERRNO())
|
#define NSRESULT_FOR_RETURN(ret) (!(ret) ? NS_OK : NSRESULT_FOR_ERRNO())
|
||||||
|
|
||||||
inline nsresult
|
inline nsresult
|
||||||
|
71
xpfe/appshell/src/nsUserInfoOS2.cpp
Normal file
71
xpfe/appshell/src/nsUserInfoOS2.cpp
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Netscape 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/NPL/
|
||||||
|
*
|
||||||
|
* 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 Communicator client code.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is Netscape Communications
|
||||||
|
* Corporation. Portions created by Netscape are
|
||||||
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||||
|
* Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/11/2000 IBM Corp. Created for OS/2 VisualAge build.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "nsUserInfo.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
#include "nsCRT.h"
|
||||||
|
#include "nsXPIDLString.h"
|
||||||
|
|
||||||
|
nsUserInfo::nsUserInfo()
|
||||||
|
{
|
||||||
|
NS_INIT_REFCNT();
|
||||||
|
}
|
||||||
|
|
||||||
|
nsUserInfo::~nsUserInfo()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo);
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetUsername(char **aUsername)
|
||||||
|
{
|
||||||
|
*aUsername = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetFullname(PRUnichar **aFullname)
|
||||||
|
{
|
||||||
|
*aFullname = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetDomain(char * *aDomain)
|
||||||
|
{
|
||||||
|
*aDomain = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetEmailAddress(char * *aEmailAddress)
|
||||||
|
{
|
||||||
|
*aEmailAddress = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
71
xpfe/components/startup/src/nsUserInfoOS2.cpp
Normal file
71
xpfe/components/startup/src/nsUserInfoOS2.cpp
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Netscape 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/NPL/
|
||||||
|
*
|
||||||
|
* 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 Communicator client code.
|
||||||
|
*
|
||||||
|
* The Initial Developer of the Original Code is Netscape Communications
|
||||||
|
* Corporation. Portions created by Netscape are
|
||||||
|
* Copyright (C) 1998 Netscape Communications Corporation. All
|
||||||
|
* Rights Reserved.
|
||||||
|
*
|
||||||
|
* Contributor(s):
|
||||||
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
||||||
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
||||||
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
||||||
|
*
|
||||||
|
* Date Modified by Description of modification
|
||||||
|
* 05/11/2000 IBM Corp. Created for OS/2 VisualAge build.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "nsUserInfo.h"
|
||||||
|
#include "nsString.h"
|
||||||
|
#include "nsCRT.h"
|
||||||
|
#include "nsXPIDLString.h"
|
||||||
|
|
||||||
|
nsUserInfo::nsUserInfo()
|
||||||
|
{
|
||||||
|
NS_INIT_REFCNT();
|
||||||
|
}
|
||||||
|
|
||||||
|
nsUserInfo::~nsUserInfo()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMPL_ISUPPORTS1(nsUserInfo,nsIUserInfo);
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetUsername(char **aUsername)
|
||||||
|
{
|
||||||
|
*aUsername = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetFullname(PRUnichar **aFullname)
|
||||||
|
{
|
||||||
|
*aFullname = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetDomain(char * *aDomain)
|
||||||
|
{
|
||||||
|
*aDomain = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsUserInfo::GetEmailAddress(char * *aEmailAddress)
|
||||||
|
{
|
||||||
|
*aEmailAddress = nsnull;
|
||||||
|
return NS_ERROR_NOT_IMPLEMENTED;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user