r= mkaply@us.ibm.com
OS/2 bringup
This commit is contained in:
mkaply%us.ibm.com 2000-04-04 00:07:04 +00:00
Родитель e9faf678e6
Коммит 7e138ea359
7 изменённых файлов: 108 добавлений и 34 удалений

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

@ -16,7 +16,16 @@
* Copyright (C) 1999 John Fairhurst. 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
* 03/28/2000 IBM Corp. Changes to make os2.h file similar to windows.h file
*/
#ifndef _nsDeviceContextOS2_h
@ -35,38 +44,52 @@ class nsDrawingSurfaceOS2;
class nsDeviceContextOS2 : public DeviceContextImpl
{
public:
public:
nsDeviceContextOS2();
NS_IMETHOD Init( nsNativeWidget aWidget);
// what a bizarre method. These floats are app units.
NS_IMETHOD GetScrollBarDimensions( float &aWidth, float &aHeight) const;
NS_IMETHOD CreateRenderingContext( nsIRenderingContext *&aContext);
NS_IMETHOD SupportsNativeWidgets( PRBool &aSupportsWidgets);
NS_IMETHOD GetCanonicalPixelScale( float &aScale) const;
NS_IMETHOD GetScrollBarDimensions( float &aWidth, float &aHeight) const;
NS_IMETHOD GetSystemAttribute( nsSystemAttrID anID, SystemAttrStruct *aInfo) const;
// get a low level drawing surface for rendering. the rendering context
// that is passed in is used to create the drawing surface if there isn't
// already one in the device context. the drawing surface is then cached
// in the device context for re-use.
NS_IMETHOD GetDrawingSurface( nsIRenderingContext &aContext,
nsDrawingSurface &aSurface);
NS_IMETHOD GetDrawingSurface( nsIRenderingContext &aContext, nsDrawingSurface &aSurface);
NS_IMETHOD CheckFontExistence( const nsString &aFontName);
NS_IMETHOD GetDepth( PRUint32 &aDepth);
NS_IMETHOD GetILColorSpace( IL_ColorSpace*& aColorSpace);
NS_IMETHOD GetPaletteInfo( nsPaletteInfo &);
NS_IMETHOD ConvertPixel( nscolor aColor, PRUint32 & aPixel);
NS_IMETHOD GetDeviceSurfaceDimensions( PRInt32 &aWidth, PRInt32 &aHeight);
NS_IMETHOD GetClientRect(nsRect &aRect);
NS_IMETHOD SupportsNativeWidgets( PRBool &aSupportsWidgets);
NS_IMETHOD GetCanonicalPixelScale( float &aScale) const;
NS_IMETHOD GetDeviceContextFor( nsIDeviceContextSpec *aDevice,
nsIDeviceContext *&aContext);
NS_IMETHOD CreateRenderingContext( nsIRenderingContext *&aContext);
NS_IMETHOD BeginDocument();
NS_IMETHOD EndDocument();
NS_IMETHOD BeginPage();
NS_IMETHOD EndPage();
NS_IMETHOD GetDeviceContextFor( nsIDeviceContextSpec *aDevice,
nsIDeviceContext *&aContext);
NS_IMETHOD BeginDocument(void);
NS_IMETHOD EndDocument(void);
NS_IMETHOD BeginPage(void);
NS_IMETHOD EndPage(void);
// XXXX Copped from GTK version to remove warning about hidden virtual; nothing in Windows
NS_IMETHOD CreateRenderingContext(nsIView *aView, nsIRenderingContext *&aContext) {return (DeviceContextImpl::CreateRenderingContext(aView,aContext));}
NS_IMETHOD CreateRenderingContext(nsIWidget *aWidget, nsIRenderingContext *&aContext) {return (DeviceContextImpl::CreateRenderingContext(aWidget,aContext));}
// OS2 specific methods
public:
@ -76,9 +99,8 @@ class nsDeviceContextOS2 : public DeviceContextImpl
// Release when done.
nsresult GetPalette( nsIPaletteOS2 *&apalette);
// Init from a HDC for printing purposes
nsresult Init( nsNativeDeviceContext aContext,
nsIDeviceContext *aOrigContext);
void CommonInit( HDC aDC);
void CommonInit(HDC aDC);
nsresult Init( nsNativeDeviceContext aContext, nsIDeviceContext *aOrigContext);
// Needed by the fontmetrics - can't rely on having a widget.
HPS GetRepresentativePS() const;
@ -92,8 +114,8 @@ class nsDeviceContextOS2 : public DeviceContextImpl
nsDrawingSurfaceOS2 *mSurface;
PRUint32 mDepth; // bit depth of device
nsPaletteInfo mPaletteInfo;
nsIPaletteOS2 *mPalette;
float mPixelScale;
nsIPaletteOS2 *mPalette;
PRInt32 mWidth;
PRInt32 mHeight;
HDC mDC; // PrintDC. Owned by libprint.
@ -107,4 +129,4 @@ class nsDeviceContextOS2 : public DeviceContextImpl
} mPrintState;
};
#endif
#endif /* nsDeviceContextOS2_h__ */

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

@ -16,7 +16,16 @@
* Copyright (C) 1999 John Fairhurst. 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
* 03/28/2000 IBM Corp. Changes to make os2.h file similar to windows.h file
*/
// This class is part of the strange printing `architecture'.
@ -38,10 +47,11 @@ class nsDeviceContextSpecFactoryOS2 : public nsIDeviceContextSpecFactory
NS_DECL_ISUPPORTS
NS_IMETHOD Init();
NS_IMETHOD Init(void);
NS_IMETHOD CreateDeviceContextSpec( nsIDeviceContextSpec *aOldSpec,
nsIDeviceContextSpec *&aNewSpec,
PRBool aQuiet);
protected:
virtual ~nsDeviceContextSpecFactoryOS2() {}
};

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

@ -16,7 +16,6 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* Contributor(s):
*
*/
#ifndef _nsDeviceContextSpecOS2_h

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

@ -16,7 +16,16 @@
* Copyright (C) 1999 John Fairhurst. 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
* 03/28/2000 IBM Corp. Changes to make os2.h file similar to windows.h file
*/
#ifndef _nsDrawingSurfaceOS2_h
@ -48,10 +57,6 @@ class nsDrawingSurfaceOS2 : public nsIDrawingSurface
long mTopID; // highest used lcid
nsIPaletteOS2 *mPalette; // palette
protected:
void DeselectPalette();
void DisposeFonts(); // MUST be called before disposing of PS
public:
nsDrawingSurfaceOS2();
virtual ~nsDrawingSurfaceOS2();
@ -70,6 +75,10 @@ class nsDrawingSurfaceOS2 : public nsIDrawingSurface
NS_IMETHOD GetBitmap( HBITMAP &aBitmap); // yuck (for blender, may go)
NS_IMETHOD RequiresInvertedMask( PRBool *aBool); // double yuck (images)
protected:
void DeselectPalette();
void DisposeFonts(); // MUST be called before disposing of PS
};
// Offscreen surface. Others depend on this.

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

@ -15,8 +15,16 @@
* <john_fairhurst@iname.com>. Portions created by John Fairhurst are
* Copyright (C) 1999 John Fairhurst. 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
* 03/28/2000 IBM Corp. Changes to make os2.h file similar to windows.h file
*/
#ifndef _nsFontMetricsOS2_h
@ -60,13 +68,14 @@ class nsFontMetricsOS2 : public nsIFontMetrics
NS_IMETHOD GetSubscriptOffset( nscoord &aResult);
NS_IMETHOD GetStrikeout( nscoord &aOffset, nscoord &aSize);
NS_IMETHOD GetUnderline( nscoord &aOffset, nscoord &aSize);
NS_IMETHOD GetHeight( nscoord &aHeight);
NS_IMETHOD GetLeading( nscoord &aLeading);
NS_IMETHOD GetMaxAscent( nscoord &aAscent);
NS_IMETHOD GetMaxDescent( nscoord &aDescent);
NS_IMETHOD GetMaxAdvance( nscoord &aAdvance);
NS_IMETHOD GetFont( const nsFont *&aFont);
// NS_IMETHOD GetLangGroup(nsIAtom** aLangGroup);
NS_IMETHOD GetFontHandle( nsFontHandle &aHandle);
// NS_IMETHOD GetLangGroup(nsIAtom** aLangGroup);
@ -78,8 +87,6 @@ class nsFontMetricsOS2 : public nsIFontMetrics
nsresult RealizeFont();
nsFont *mFont;
nscoord mXHeight;
nscoord mSuperscriptYOffset;
nscoord mSubscriptYOffset;
nscoord mStrikeoutPosition;
@ -91,9 +98,10 @@ class nsFontMetricsOS2 : public nsIFontMetrics
nscoord mMaxAscent;
nscoord mMaxDescent;
nscoord mMaxAdvance;
nscoord mSpaceWidth;
nscoord mXHeight;
PRUint32 mDevMaxAscent;
nscoord mSpaceWidth;
nsFontHandleOS2 *mFontHandle;
nsDeviceContextOS2 *mContext; // sigh.. broken broken broken XP interfaces...

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

@ -16,7 +16,20 @@
* Copyright (C) 1999 John Fairhurst. All Rights Reserved.
*
* 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
* 03/31/2000 IBM Corp. Get rid of mBusy message and call default WndProc. Message is
* put out while wizards (i.e. Mail) is active.
*
*/
#define INCL_DOS
@ -233,8 +246,10 @@ MRESULT nsTimerManager::HandleMsg( ULONG msg, MPARAM mp1, MPARAM mp2)
ProcessTimeouts( 0);
mBusy = FALSE;
}
else
printf( "mBusy == TRUE but want to fire Timer!\n");
else {
// printf( "mBusy == TRUE but want to fire Timer!\n");
mRC = WinDefWindowProc( mHWNDTimer, msg, mp1, mp2); // handle the message
}
}
else
mRC = WinDefWindowProc( mHWNDTimer, msg, mp1, mp2);

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

@ -19,6 +19,17 @@
* 00/01/06: general review and update against Win/Unix versions;
* replaced nsFileSpec::Execute implementation with system() call
* which properly launches OS/2 PM|VIO, WinOS2 and DOS programs
*
* 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
* 03/23/2000 IBM Corp. Fixed bug where 2 char or less profile names treated as drive letters.
*/
// This file is #include-d by nsFileSpec.cpp and contains OS/2 specific
@ -79,7 +90,7 @@ void nsFileSpecHelpers::UnixToNative( nsSimpleCharString &ioPath)
ioPath[1] = ':';
// yucky specialcase for drive roots: "H:" is not valid, has to be "H:\"
if( ioPath[2] == '\0')
if(( ioPath[2] == '\0') && (ioPath[1] == ':') && (ioPath[0] != '\0'))
{
char dl = ioPath[0];
ioPath = " :\\";