mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-12 10:40:12 +00:00
OS/2 build bustage with the nsiscreen move - 323254
This commit is contained in:
parent
66cdc786d5
commit
93ccf6c400
@ -76,8 +76,6 @@ CPPSRCS = \
|
||||
nsImageOS2.cpp \
|
||||
nsRegionOS2.cpp \
|
||||
nsDeviceContextSpecFactoryO.cpp \
|
||||
nsScreenOS2.cpp \
|
||||
nsScreenManagerOS2.cpp \
|
||||
nsGfxFactoryOS2.cpp \
|
||||
nsPrintOptionsOS2.cpp \
|
||||
nsGfxDefs.cpp \
|
||||
|
@ -46,7 +46,6 @@
|
||||
#include "nsRenderingContextOS2.h"
|
||||
#include "nsDeviceContextSpecOS2.h"
|
||||
#include "nsDeviceContextSpecFactoryO.h"
|
||||
#include "nsScreenManagerOS2.h"
|
||||
#include "nsScriptableRegion.h"
|
||||
#include "nsDeviceContextOS2.h"
|
||||
#include "nsImageOS2.h"
|
||||
@ -74,7 +73,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecFactoryOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontEnumeratorOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFontList)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsOS2, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsPrinterEnumeratorOS2)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init)
|
||||
@ -326,11 +324,6 @@ static const nsModuleComponentInfo components[] =
|
||||
// "@mozilla.org/gfx/fontlist;1"
|
||||
NS_FONTLIST_CONTRACTID,
|
||||
nsFontListConstructor },
|
||||
{ "OS/2 Screen Manager",
|
||||
NS_SCREENMANAGER_CID,
|
||||
// "@mozilla.org/gfx/screenmanager/gtk;1",
|
||||
"@mozilla.org/gfx/screenmanager;1",
|
||||
nsScreenManagerOS2Constructor },
|
||||
{ "OS/2 Printer Enumerator",
|
||||
NS_PRINTER_ENUMERATOR_CID,
|
||||
// "@mozilla.org/gfx/printer_enumerator/gtk;1",
|
||||
|
@ -83,6 +83,8 @@ CPPSRCS = \
|
||||
nsWidgetFactory.cpp \
|
||||
nsWindow.cpp \
|
||||
nsDragService.cpp \
|
||||
nsScreenOS2.cpp \
|
||||
nsScreenManagerOS2.cpp \
|
||||
$(NULL)
|
||||
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
@ -112,3 +114,5 @@ export::
|
||||
test -f ./res/aliasb.ptr || cp $(srcdir)/res/*.* ./res
|
||||
|
||||
ADD_TO_DEF_FILE = cat < $(srcdir)/extradefs.os2 >>$(DEF_FILE)
|
||||
|
||||
|
||||
|
@ -36,7 +36,6 @@
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsScreenOS2.h"
|
||||
#include "nsGfxDefs.h"
|
||||
|
||||
nsScreenOS2 :: nsScreenOS2 ( )
|
||||
{
|
||||
@ -62,7 +61,7 @@ nsScreenOS2 :: GetRect(PRInt32 *outLeft, PRInt32 *outTop, PRInt32 *outWidth, PRI
|
||||
LONG alArray[2];
|
||||
|
||||
HPS hps = ::WinGetScreenPS( HWND_DESKTOP);
|
||||
HDC hdc = GFX (::GpiQueryDevice (hps), HDC_ERROR);
|
||||
HDC hdc = ::GpiQueryDevice (hps);
|
||||
::DevQueryCaps(hdc, CAPS_WIDTH, 2, alArray);
|
||||
::WinReleasePS(hps);
|
||||
|
||||
@ -131,9 +130,9 @@ nsScreenOS2 :: GetPixelDepth(PRInt32 *aPixelDepth)
|
||||
LONG lCap;
|
||||
|
||||
HPS hps = ::WinGetScreenPS( HWND_DESKTOP);
|
||||
HDC hdc = GFX (::GpiQueryDevice (hps), HDC_ERROR);
|
||||
HDC hdc = ::GpiQueryDevice (hps);
|
||||
|
||||
GFX (::DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, &lCap), FALSE);
|
||||
::DevQueryCaps(hdc, CAPS_COLOR_BITCOUNT, 1, &lCap);
|
||||
|
||||
*aPixelDepth = (PRInt32)lCap;
|
||||
|
||||
|
@ -40,6 +40,10 @@
|
||||
|
||||
#include "nsIScreen.h"
|
||||
|
||||
#define INCL_WIN
|
||||
#define INCL_DOS
|
||||
#include <os2.h>
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
class nsScreenOS2 : public nsIScreen
|
||||
|
@ -78,6 +78,8 @@
|
||||
#include "nsTransferable.h"
|
||||
#include "nsHTMLFormatConverter.h"
|
||||
|
||||
#include "nsScreenManagerOS2.h"
|
||||
|
||||
#include "nsFrameWindow.h" // OS/2 only
|
||||
|
||||
// objects that just require generic constructors
|
||||
@ -95,6 +97,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDragService)
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerOS2)
|
||||
|
||||
// component definition, will be exported using XPCOM
|
||||
static const nsModuleComponentInfo components[] =
|
||||
{
|
||||
@ -149,7 +153,11 @@ static const nsModuleComponentInfo components[] =
|
||||
{ "OS/2 HTML Format Converter",
|
||||
NS_HTMLFORMATCONVERTER_CID,
|
||||
"@mozilla.org/widget/htmlformatconverter;1",
|
||||
nsHTMLFormatConverterConstructor }
|
||||
nsHTMLFormatConverterConstructor },
|
||||
{ "nsScreenManagerWin",
|
||||
NS_SCREENMANAGER_CID,
|
||||
"@mozilla.org/gfx/screenmanager;1",
|
||||
nsScreenManagerOS2Constructor },
|
||||
};
|
||||
|
||||
PR_STATIC_CALLBACK(void)
|
||||
|
@ -1638,12 +1638,14 @@ nsIFontMetrics *nsWindow::GetFont(void)
|
||||
|
||||
if( mToolkit)
|
||||
{
|
||||
char buf[2][128];
|
||||
char fontNameSize[FACESIZE+5]; // FACESIZE + decimal + up to three digits for font size + null terminator
|
||||
char fontName[FACESIZE];
|
||||
int ptSize;
|
||||
|
||||
WinQueryPresParam( mWnd, PP_FONTNAMESIZE, 0, 0, 128, buf[0], 0);
|
||||
WinQueryPresParam( mWnd, PP_FONTNAMESIZE, 0, 0, FACESIZE+5, fontNameSize, 0);
|
||||
|
||||
if( 2 == sscanf( buf[0], "%d.%s", &ptSize, buf[1])) // mmm, scanf()...
|
||||
// FACESIZE = 32, hence the 31 here
|
||||
if( 2 == sscanf( fontNameSize, "%d.%31s", &ptSize, fontName))
|
||||
{
|
||||
float twip2dev, twip2app;
|
||||
twip2dev = mContext->TwipsToDevUnits();
|
||||
@ -1652,7 +1654,7 @@ nsIFontMetrics *nsWindow::GetFont(void)
|
||||
|
||||
nscoord appSize = (nscoord) (twip2app * ptSize * 20);
|
||||
|
||||
nsFont font( buf[1], NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
|
||||
nsFont font( fontName, NS_FONT_STYLE_NORMAL, NS_FONT_VARIANT_NORMAL,
|
||||
NS_FONT_WEIGHT_NORMAL, 0 /*decoration*/, appSize);
|
||||
|
||||
mContext->GetMetricsFor( font, metrics);
|
||||
|
Loading…
x
Reference in New Issue
Block a user