Removed a few dependencies on GDI internals from USER dll.
diff --git a/controls/combo.c b/controls/combo.c
index d1b126c..805e303 100644
--- a/controls/combo.c
+++ b/controls/combo.c
@@ -82,7 +82,7 @@
TRACE("combo bitmap [%i,%i]\n", CBitWidth, CBitHeight );
- hPrevB = SelectObject16( hDC, hComboBmp);
+ hPrevB = SelectObject( hDC, hComboBmp);
SetRect( &r, 0, 0, CBitWidth, CBitHeight );
InvertRect( hDC, &r );
SelectObject( hDC, hPrevB );
diff --git a/controls/menu.c b/controls/menu.c
index 9de5f11..dd8ad99 100644
--- a/controls/menu.c
+++ b/controls/menu.c
@@ -1137,7 +1137,7 @@
else
{
SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) );
- MoveTo16( hdc, rect.left, 0 );
+ MoveToEx( hdc, rect.left, 0, NULL );
LineTo( hdc, rect.left, height );
}
}
@@ -1156,7 +1156,7 @@
else
{
SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) );
- MoveTo16( hdc, rect.left, rect.top + SEPARATOR_HEIGHT/2 );
+ MoveToEx( hdc, rect.left, rect.top + SEPARATOR_HEIGHT/2, NULL );
LineTo( hdc, rect.right, rect.top + SEPARATOR_HEIGHT/2 );
}
return;
@@ -1185,7 +1185,7 @@
/* helper lines for debugging */
/* FrameRect(hdc, &rect, GetStockObject(BLACK_BRUSH));
SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) );
- MoveTo16( hdc, rect.left, (rect.top + rect.bottom)/2 );
+ MoveToEx( hdc, rect.left, (rect.top + rect.bottom)/2, NULL );
LineTo( hdc, rect.right, (rect.top + rect.bottom)/2 );
*/
@@ -1479,13 +1479,13 @@
if (TWEAK_WineLook == WIN31_LOOK)
{
SelectObject( hDC, GetSysColorPen(COLOR_WINDOWFRAME) );
- MoveTo16( hDC, lprect->left, lprect->bottom );
+ MoveToEx( hDC, lprect->left, lprect->bottom, NULL );
LineTo( hDC, lprect->right, lprect->bottom );
}
else
{
SelectObject( hDC, GetSysColorPen(COLOR_3DFACE));
- MoveTo16( hDC, lprect->left, lprect->bottom );
+ MoveToEx( hDC, lprect->left, lprect->bottom, NULL );
LineTo( hDC, lprect->right, lprect->bottom );
}
diff --git a/dlls/ttydrv/ttydrv_main.c b/dlls/ttydrv/ttydrv_main.c
index de749ce..7b3b6ff 100644
--- a/dlls/ttydrv/ttydrv_main.c
+++ b/dlls/ttydrv/ttydrv_main.c
@@ -46,6 +46,8 @@
TTYDRV_SetScreenSaveActive,
TTYDRV_GetScreenSaveTimeout,
TTYDRV_SetScreenSaveTimeout,
+ /* resource functions */
+ TTYDRV_LoadOEMResource,
/* windowing functions */
TTYDRV_IsSingleWindow
};
diff --git a/dlls/wineps/init.c b/dlls/wineps/init.c
index 6e9956a..c853870 100644
--- a/dlls/wineps/init.c
+++ b/dlls/wineps/init.c
@@ -65,7 +65,6 @@
NULL, /* pIntersectClipRect */
NULL, /* pInvertRgn */
PSDRV_LineTo, /* pLineTo */
- NULL, /* pLoadOEMResource */
NULL, /* pMoveToEx */
NULL, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrg (optional) */
diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c
index 1280141..03cfbf5 100644
--- a/dlls/x11drv/x11drv_main.c
+++ b/dlls/x11drv/x11drv_main.c
@@ -59,6 +59,8 @@
X11DRV_SetScreenSaveActive,
X11DRV_GetScreenSaveTimeout,
X11DRV_SetScreenSaveTimeout,
+ /* resource functions */
+ X11DRV_LoadOEMResource,
/* windowing functions */
X11DRV_IsSingleWindow
};
diff --git a/graphics/enhmetafiledrv/init.c b/graphics/enhmetafiledrv/init.c
index 9a8e259..07f38bc 100644
--- a/graphics/enhmetafiledrv/init.c
+++ b/graphics/enhmetafiledrv/init.c
@@ -62,7 +62,6 @@
EMFDRV_IntersectClipRect, /* pIntersectClipRect */
EMFDRV_InvertRgn, /* pInvertRgn */
EMFDRV_LineTo, /* pLineTo */
- NULL, /* pLoadOEMResource */
EMFDRV_MoveToEx, /* pMoveToEx */
EMFDRV_OffsetClipRgn, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrg */
diff --git a/graphics/metafiledrv/init.c b/graphics/metafiledrv/init.c
index c78b4e1..b9c64ff 100644
--- a/graphics/metafiledrv/init.c
+++ b/graphics/metafiledrv/init.c
@@ -61,7 +61,6 @@
MFDRV_IntersectClipRect, /* pIntersectClipRect */
MFDRV_InvertRgn, /* pInvertRgn */
MFDRV_LineTo, /* pLineTo */
- NULL, /* pLoadOEMResource */
MFDRV_MoveToEx, /* pMoveToEx */
MFDRV_OffsetClipRgn, /* pOffsetClipRgn */
MFDRV_OffsetViewportOrg, /* pOffsetViewportOrg */
diff --git a/graphics/ttydrv/init.c b/graphics/ttydrv/init.c
index c3150c3..c082036 100644
--- a/graphics/ttydrv/init.c
+++ b/graphics/ttydrv/init.c
@@ -59,7 +59,6 @@
NULL, /* pIntersectClipRect */
NULL, /* pIntersectVisRect */
TTYDRV_DC_LineTo, /* pLineTo */
- TTYDRV_DC_LoadOEMResource, /* pLoadOEMResource */
NULL, /* pMoveToEx */
NULL, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrg (optional) */
diff --git a/graphics/ttydrv/oembitmap.c b/graphics/ttydrv/oembitmap.c
index f67b04a..d4060b9 100644
--- a/graphics/ttydrv/oembitmap.c
+++ b/graphics/ttydrv/oembitmap.c
@@ -11,9 +11,9 @@
DEFAULT_DEBUG_CHANNEL(ttydrv)
/**********************************************************************
- * TTYDRV_DC_LoadOEMBitmap
+ * TTYDRV_LoadOEMBitmap
*/
-static HANDLE TTYDRV_DC_LoadOEMBitmap(WORD resid)
+static HANDLE TTYDRV_LoadOEMBitmap(WORD resid)
{
HBITMAP hbitmap;
@@ -26,31 +26,29 @@
}
/**********************************************************************
- * TTYDRV_DC_LoadOEMCursorIcon
+ * TTYDRV_LoadOEMCursorIcon
*/
-static HANDLE TTYDRV_DC_LoadOEMCursorIcon(WORD resid, BOOL bCursor)
+static HANDLE TTYDRV_LoadOEMCursorIcon(WORD resid, BOOL bCursor)
{
return (HANDLE) NULL;
}
/**********************************************************************
- * TTYDRV_DC_LoadOEMResource
+ * TTYDRV_LoadOEMResource
*/
-HANDLE TTYDRV_DC_LoadOEMResource(WORD resid, WORD type)
+HANDLE TTYDRV_LoadOEMResource(WORD resid, WORD type)
{
switch(type)
{
case OEM_BITMAP:
- return TTYDRV_DC_LoadOEMBitmap(resid);
+ return TTYDRV_LoadOEMBitmap(resid);
case OEM_CURSOR:
- return TTYDRV_DC_LoadOEMCursorIcon(resid, TRUE);
+ return TTYDRV_LoadOEMCursorIcon(resid, TRUE);
case OEM_ICON:
- return TTYDRV_DC_LoadOEMCursorIcon(resid, FALSE);
+ return TTYDRV_LoadOEMCursorIcon(resid, FALSE);
default:
ERR("unknown type (%d)\n", type);
}
return (HANDLE) NULL;
}
-
-
diff --git a/graphics/win16drv/init.c b/graphics/win16drv/init.c
index f368757..d09f25a 100644
--- a/graphics/win16drv/init.c
+++ b/graphics/win16drv/init.c
@@ -87,7 +87,6 @@
NULL, /* pIntersectClipRect */
NULL, /* pInvertRgn */
WIN16DRV_LineTo, /* pLineTo */
- NULL, /* pLoadOEMResource */
WIN16DRV_MoveToEx, /* pMoveToEx */
NULL, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrgEx */
diff --git a/graphics/x11drv/init.c b/graphics/x11drv/init.c
index 521fff0..0fe27ca 100644
--- a/graphics/x11drv/init.c
+++ b/graphics/x11drv/init.c
@@ -71,7 +71,6 @@
NULL, /* pIntersectClipRect */
NULL, /* pInvertRgn */
X11DRV_LineTo, /* pLineTo */
- X11DRV_LoadOEMResource, /* pLoadOEMResource */
NULL, /* pMoveToEx */
NULL, /* pOffsetClipRgn */
NULL, /* pOffsetViewportOrg (optional) */
diff --git a/include/gdi.h b/include/gdi.h
index b970a4d..6cd7a95 100644
--- a/include/gdi.h
+++ b/include/gdi.h
@@ -214,7 +214,6 @@
INT (*pIntersectClipRect)(DC*,INT,INT,INT,INT);
BOOL (*pInvertRgn)(DC*,HRGN);
BOOL (*pLineTo)(DC*,INT,INT);
- HANDLE (*pLoadOEMResource)(WORD,WORD);
BOOL (*pMoveToEx)(DC*,INT,INT,LPPOINT);
INT (*pOffsetClipRgn)(DC*,INT,INT);
BOOL (*pOffsetViewportOrg)(DC*,INT,INT);
diff --git a/include/ttydrv.h b/include/ttydrv.h
index c993cb2..81aba65 100644
--- a/include/ttydrv.h
+++ b/include/ttydrv.h
@@ -88,7 +88,6 @@
extern BOOL TTYDRV_DC_GetTextExtentPoint(struct tagDC *dc, LPCWSTR str, INT count, LPSIZE size);
extern BOOL TTYDRV_DC_GetTextMetrics(struct tagDC *dc, TEXTMETRICA *metrics);
extern BOOL TTYDRV_DC_LineTo(struct tagDC *dc, INT x, INT y);
-extern HANDLE TTYDRV_DC_LoadOEMResource(WORD resid, WORD type);
extern BOOL TTYDRV_DC_PaintRgn(struct tagDC *dc, HRGN hrgn);
extern BOOL TTYDRV_DC_PatBlt(struct tagDC *dc, INT left, INT top, INT width, INT height, DWORD rop);
extern BOOL TTYDRV_DC_Pie(struct tagDC *dc, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend);
@@ -184,6 +183,8 @@
WINDOW *TTYDRV_WND_GetCursesWindow(struct tagWND *wndPtr);
+extern HANDLE TTYDRV_LoadOEMResource(WORD resid, WORD type);
+
extern void TTYDRV_WND_Initialize(struct tagWND *wndPtr);
extern void TTYDRV_WND_Finalize(struct tagWND *wndPtr);
extern BOOL TTYDRV_WND_CreateDesktopWindow(struct tagWND *wndPtr, struct tagCLASS *classPtr, BOOL bUnicode);
@@ -196,8 +197,8 @@
extern void TTYDRV_WND_SetFocus(struct tagWND *wndPtr);
extern void TTYDRV_WND_PreSizeMove(struct tagWND *wndPtr);
extern void TTYDRV_WND_PostSizeMove(struct tagWND *wndPtr);
-extern void TTYDRV_WND_ScrollWindow(struct tagWND *wndPtr, struct tagDC *dcPtr, INT dx, INT dy, const RECT *clipRect, BOOL bUpdate);
-extern void TTYDRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL bSetClipOrigin);
+extern void TTYDRV_WND_ScrollWindow(struct tagWND *wndPtr, HDC hdc, INT dx, INT dy, const RECT *clipRect, BOOL bUpdate);
+extern void TTYDRV_WND_SetDrawable(struct tagWND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigin);
extern BOOL TTYDRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value);
extern BOOL TTYDRV_WND_IsSelfClipping(struct tagWND *wndPtr);
extern void TTYDRV_WND_SetWindowRgn(struct tagWND *wndPtr, HRGN hrgnWnd);
diff --git a/include/user.h b/include/user.h
index a2fe5cc..a91da00 100644
--- a/include/user.h
+++ b/include/user.h
@@ -66,6 +66,8 @@
void (*pSetScreenSaveActive)(BOOL);
int (*pGetScreenSaveTimeout)(void);
void (*pSetScreenSaveTimeout)(int);
+ /* resource functions */
+ HANDLE (*pLoadOEMResource)(WORD,WORD);
/* windowing functions */
BOOL (*pIsSingleWindow)(void);
} USER_DRIVER;
diff --git a/include/win.h b/include/win.h
index b02c9ee..2de2471 100644
--- a/include/win.h
+++ b/include/win.h
@@ -128,8 +128,8 @@
void (*pSetFocus)(WND *);
void (*pPreSizeMove)(WND *);
void (*pPostSizeMove)(WND *);
- void (*pSurfaceCopy)(WND *, struct tagDC *, INT, INT, const RECT *, BOOL);
- void (*pSetDrawable)(WND *, struct tagDC *, WORD, BOOL);
+ void (*pSurfaceCopy)(WND *, HDC, INT, INT, const RECT *, BOOL);
+ void (*pSetDrawable)(WND *, HDC, WORD, BOOL);
BOOL (*pSetHostAttr)(WND *, INT haKey, INT value);
BOOL (*pIsSelfClipping)(WND *);
void (*pSetWindowRgn)(WND *, const HRGN);
diff --git a/include/x11drv.h b/include/x11drv.h
index 501bba3..7887971 100644
--- a/include/x11drv.h
+++ b/include/x11drv.h
@@ -156,7 +156,6 @@
WORD fGet, UINT startscan,
UINT lines, LPSTR bits,
LPBITMAPINFO info, UINT coloruse );
-extern HANDLE X11DRV_LoadOEMResource( WORD id, WORD type );
/* OpenGL / X11 driver functions */
extern int X11DRV_ChoosePixelFormat(DC *dc, const PIXELFORMATDESCRIPTOR *pppfd) ;
@@ -336,6 +335,7 @@
extern void X11DRV_SetScreenSaveActive(BOOL bActivate);
extern int X11DRV_GetScreenSaveTimeout(void);
extern void X11DRV_SetScreenSaveTimeout(int nTimeout);
+extern HANDLE X11DRV_LoadOEMResource( WORD id, WORD type );
extern BOOL X11DRV_IsSingleWindow(void);
/* X11 clipboard driver */
@@ -429,8 +429,8 @@
extern void X11DRV_WND_SetFocus(struct tagWND *wndPtr);
extern void X11DRV_WND_PreSizeMove(struct tagWND *wndPtr);
extern void X11DRV_WND_PostSizeMove(struct tagWND *wndPtr);
-extern void X11DRV_WND_SurfaceCopy(struct tagWND *wndPtr, struct tagDC *dcPtr, INT dx, INT dy, const RECT *clipRect, BOOL bUpdate);
-extern void X11DRV_WND_SetDrawable(struct tagWND *wndPtr, struct tagDC *dc, WORD flags, BOOL bSetClipOrigin);
+extern void X11DRV_WND_SurfaceCopy(struct tagWND *wndPtr, HDC hdc, INT dx, INT dy, const RECT *clipRect, BOOL bUpdate);
+extern void X11DRV_WND_SetDrawable(struct tagWND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigin);
extern BOOL X11DRV_WND_SetHostAttr(struct tagWND *wndPtr, INT haKey, INT value);
extern BOOL X11DRV_WND_IsSelfClipping(struct tagWND *wndPtr);
extern void X11DRV_WND_DockWindow(struct tagWND *wndPtr);
diff --git a/objects/metafile.c b/objects/metafile.c
index 6c52e57..00bca81 100644
--- a/objects/metafile.c
+++ b/objects/metafile.c
@@ -988,7 +988,7 @@
break;
case META_SELECTPALETTE:
- SelectPalette16(hdc, *(ht->objectHandle + *(mr->rdParm+1)),
+ SelectPalette(hdc, *(ht->objectHandle + *(mr->rdParm+1)),
*(mr->rdParm));
break;
@@ -997,7 +997,7 @@
break;
case META_REALIZEPALETTE:
- RealizePalette16(hdc);
+ RealizePalette(hdc);
break;
case META_ESCAPE:
diff --git a/windows/caret.c b/windows/caret.c
index 7b9cc75..843de0a 100644
--- a/windows/caret.c
+++ b/windows/caret.c
@@ -152,8 +152,8 @@
if (bitmap && (bitmap != 1))
{
- BITMAP16 bmp;
- if (!GetObject16( bitmap, sizeof(bmp), &bmp )) return FALSE;
+ BITMAP bmp;
+ if (!GetObjectA( bitmap, sizeof(bmp), &bmp )) return FALSE;
Caret.width = bmp.bmWidth;
Caret.height = bmp.bmHeight;
/* FIXME: we should make a copy of the bitmap instead of a brush */
diff --git a/windows/clipboard.c b/windows/clipboard.c
index 62411b4..0977a87 100644
--- a/windows/clipboard.c
+++ b/windows/clipboard.c
@@ -189,7 +189,7 @@
if (lpFormat->hData32)
DeleteObject(lpFormat->hData32);
if (lpFormat->hData16)
- DeleteObject16(lpFormat->hData16);
+ DeleteObject(lpFormat->hData16);
}
else if( lpFormat->wFormatID == CF_METAFILEPICT )
{
diff --git a/windows/cursoricon.c b/windows/cursoricon.c
index e7b2374..0293578 100644
--- a/windows/cursoricon.c
+++ b/windows/cursoricon.c
@@ -40,8 +40,6 @@
#include "color.h"
#include "bitmap.h"
#include "cursoricon.h"
-#include "dc.h"
-#include "gdi.h"
#include "global.h"
#include "module.h"
#include "debugtools.h"
@@ -429,7 +427,7 @@
{
int sizeAnd, sizeXor;
HBITMAP hAndBits = 0, hXorBits = 0; /* error condition for later */
- BITMAPOBJ *bmpXor, *bmpAnd;
+ BITMAP bmpXor, bmpAnd;
POINT16 hotspot;
BITMAPINFO *bmi;
HDC hdc;
@@ -583,10 +581,10 @@
}
/* Now create the CURSORICONINFO structure */
- bmpXor = (BITMAPOBJ *) GDI_GetObjPtr( hXorBits, BITMAP_MAGIC );
- bmpAnd = (BITMAPOBJ *) GDI_GetObjPtr( hAndBits, BITMAP_MAGIC );
- sizeXor = bmpXor->bitmap.bmHeight * bmpXor->bitmap.bmWidthBytes;
- sizeAnd = bmpAnd->bitmap.bmHeight * bmpAnd->bitmap.bmWidthBytes;
+ GetObjectA( hXorBits, sizeof(bmpXor), &bmpXor );
+ GetObjectA( hAndBits, sizeof(bmpAnd), &bmpAnd );
+ sizeXor = bmpXor.bmHeight * bmpXor.bmWidthBytes;
+ sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes;
if (hObj) hObj = GlobalReAlloc16( hObj,
sizeof(CURSORICONINFO) + sizeXor + sizeAnd, GMEM_MOVEABLE );
@@ -602,11 +600,11 @@
info = (CURSORICONINFO *)GlobalLock16( hObj );
info->ptHotSpot.x = hotspot.x;
info->ptHotSpot.y = hotspot.y;
- info->nWidth = bmpXor->bitmap.bmWidth;
- info->nHeight = bmpXor->bitmap.bmHeight;
- info->nWidthBytes = bmpXor->bitmap.bmWidthBytes;
- info->bPlanes = bmpXor->bitmap.bmPlanes;
- info->bBitsPerPixel = bmpXor->bitmap.bmBitsPixel;
+ info->nWidth = bmpXor.bmWidth;
+ info->nHeight = bmpXor.bmHeight;
+ info->nWidthBytes = bmpXor.bmWidthBytes;
+ info->bPlanes = bmpXor.bmPlanes;
+ info->bBitsPerPixel = bmpXor.bmBitsPixel;
/* Transfer the bitmap bits to the CURSORICONINFO structure */
@@ -693,7 +691,6 @@
else if ( !hInstance ) /* Load OEM cursor/icon */
{
WORD resid;
- HDC hdc;
if ( HIWORD(name) )
{
@@ -710,14 +707,7 @@
}
}
else resid = LOWORD(name);
- hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
- if (hdc) {
- DC *dc = DC_GetDCPtr( hdc );
- if (dc->funcs->pLoadOEMResource)
- h = dc->funcs->pLoadOEMResource( resid, fCursor ? OEM_CURSOR : OEM_ICON );
- GDI_HEAP_UNLOCK( hdc );
- DeleteDC( hdc );
- }
+ h = USER_Driver->pLoadOEMResource( resid, fCursor ? OEM_CURSOR : OEM_ICON );
}
else /* Load from resource */
@@ -1819,16 +1809,17 @@
/**********************************************************************
* CreateIconIndirect (USER32.78)
*/
-HICON WINAPI CreateIconIndirect(LPICONINFO iconinfo) {
- BITMAPOBJ *bmpXor,*bmpAnd;
+HICON WINAPI CreateIconIndirect(LPICONINFO iconinfo)
+{
+ BITMAP bmpXor,bmpAnd;
HICON hObj;
int sizeXor,sizeAnd;
- bmpXor = (BITMAPOBJ *) GDI_GetObjPtr( iconinfo->hbmColor, BITMAP_MAGIC );
- bmpAnd = (BITMAPOBJ *) GDI_GetObjPtr( iconinfo->hbmMask, BITMAP_MAGIC );
+ GetObjectA( iconinfo->hbmColor, sizeof(bmpXor), &bmpXor );
+ GetObjectA( iconinfo->hbmMask, sizeof(bmpAnd), &bmpAnd );
- sizeXor = bmpXor->bitmap.bmHeight * bmpXor->bitmap.bmWidthBytes;
- sizeAnd = bmpAnd->bitmap.bmHeight * bmpAnd->bitmap.bmWidthBytes;
+ sizeXor = bmpXor.bmHeight * bmpXor.bmWidthBytes;
+ sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes;
hObj = GlobalAlloc16( GMEM_MOVEABLE,
sizeof(CURSORICONINFO) + sizeXor + sizeAnd );
@@ -1850,11 +1841,11 @@
info->ptHotSpot.y = iconinfo->yHotspot;
}
- info->nWidth = bmpXor->bitmap.bmWidth;
- info->nHeight = bmpXor->bitmap.bmHeight;
- info->nWidthBytes = bmpXor->bitmap.bmWidthBytes;
- info->bPlanes = bmpXor->bitmap.bmPlanes;
- info->bBitsPerPixel = bmpXor->bitmap.bmBitsPixel;
+ info->nWidth = bmpXor.bmWidth;
+ info->nHeight = bmpXor.bmHeight;
+ info->nWidthBytes = bmpXor.bmWidthBytes;
+ info->bPlanes = bmpXor.bmPlanes;
+ info->bBitsPerPixel = bmpXor.bmBitsPixel;
/* Transfer the bitmap bits to the CURSORICONINFO structure */
@@ -2104,18 +2095,8 @@
if (!(loadflags & LR_LOADFROMFILE)) {
if (!instance) /* OEM bitmap */
{
- HDC hdc;
- DC *dc;
-
if (HIWORD((int)name)) return 0;
- hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL );
- dc = DC_GetDCPtr( hdc );
- if(dc->funcs->pLoadOEMResource)
- hbitmap = dc->funcs->pLoadOEMResource( LOWORD((int)name),
- OEM_BITMAP );
- GDI_HEAP_UNLOCK( hdc );
- DeleteDC( hdc );
- return hbitmap;
+ return USER_Driver->pLoadOEMResource( LOWORD((int)name), OEM_BITMAP );
}
if (!(hRsrc = FindResourceW( instance, name, RT_BITMAPW ))) return 0;
diff --git a/windows/dce.c b/windows/dce.c
index 0ab4c73..c19f8b0 100644
--- a/windows/dce.c
+++ b/windows/dce.c
@@ -80,7 +80,7 @@
WND* wnd;
if (!(dce = HeapAlloc( SystemHeap, 0, sizeof(DCE) ))) return NULL;
- if (!(dce->hDC = CreateDC16( "DISPLAY", NULL, NULL, NULL )))
+ if (!(dce->hDC = CreateDCA( "DISPLAY", NULL, NULL, NULL )))
{
HeapFree( SystemHeap, 0, dce );
return 0;
@@ -806,7 +806,7 @@
bUpdateVisRgn = bUpdateVisRgn || (dc->w.flags & DC_DIRTY);
/* recompute visible region */
- wndPtr->pDriver->pSetDrawable( wndPtr, dc, flags, bUpdateClipOrigin );
+ wndPtr->pDriver->pSetDrawable( wndPtr, hdc, flags, bUpdateClipOrigin );
if( bUpdateVisRgn )
{
@@ -975,7 +975,6 @@
BOOL retv = TRUE;
HRGN hVisRgn;
DCE *dce = (DCE *)data;
- DC *dc;
WND *wndPtr;
TRACE("hDC = %04x, %i\n", hDC, code);
@@ -1000,9 +999,7 @@
/* Update stale DC in DCX */
wndPtr = WIN_FindWndPtr( dce->hwndCurrent);
- dc = (DC *) GDI_GetObjPtr( dce->hDC, DC_MAGIC);
- if( dc && wndPtr)
- wndPtr->pDriver->pSetDrawable( wndPtr, dc,dce->DCXflags,TRUE);
+ if (wndPtr) wndPtr->pDriver->pSetDrawable( wndPtr, hDC, dce->DCXflags, TRUE);
SetHookFlags16(hDC, DCHF_VALIDATEVISRGN);
hVisRgn = DCE_GetVisRgn(dce->hwndCurrent, dce->DCXflags, 0, 0);
diff --git a/windows/dialog.c b/windows/dialog.c
index a35001b..c047e50 100644
--- a/windows/dialog.c
+++ b/windows/dialog.c
@@ -161,12 +161,12 @@
*/
BOOL DIALOG_Init(void)
{
- HDC16 hdc;
+ HDC hdc;
SIZE size;
/* Calculate the dialog base units */
- if (!(hdc = CreateDC16( "DISPLAY", NULL, NULL, NULL ))) return FALSE;
+ if (!(hdc = CreateDCA( "DISPLAY", NULL, NULL, NULL ))) return FALSE;
if (!DIALOG_GetCharSizeFromDC( hdc, 0, &size )) return FALSE;
DeleteDC( hdc );
xBaseUnit = size.cx;
@@ -681,11 +681,11 @@
PROOF_QUALITY, FF_DONTCARE,
(LPCWSTR)template.faceName );
else
- hFont = CreateFont16( -pixels, 0, 0, 0, FW_DONTCARE,
- FALSE, FALSE, FALSE,
- DEFAULT_CHARSET, 0, 0,
- PROOF_QUALITY, FF_DONTCARE,
- template.faceName );
+ hFont = CreateFontA( -pixels, 0, 0, 0, FW_DONTCARE,
+ FALSE, FALSE, FALSE,
+ DEFAULT_CHARSET, 0, 0,
+ PROOF_QUALITY, FF_DONTCARE,
+ template.faceName );
if (hFont)
{
SIZE charSize;
diff --git a/windows/nonclient.c b/windows/nonclient.c
index 5bf6daa..f3f8461 100644
--- a/windows/nonclient.c
+++ b/windows/nonclient.c
@@ -1489,14 +1489,14 @@
SelectObject( hdc, hbrushOld );
}
WIN_ReleaseWndPtr(wndPtr);
- MoveTo16( hdc, r.left, r.bottom );
+ MoveToEx( hdc, r.left, r.bottom, NULL );
LineTo( hdc, r.right, r.bottom );
if (style & WS_SYSMENU)
{
NC_DrawSysButton( hwnd, hdc, FALSE );
r.left += GetSystemMetrics(SM_CXSIZE) + 1;
- MoveTo16( hdc, r.left - 1, r.top );
+ MoveToEx( hdc, r.left - 1, r.top, NULL );
LineTo( hdc, r.left - 1, r.bottom );
}
if (style & WS_MAXIMIZEBOX)
diff --git a/windows/painting.c b/windows/painting.c
index dc1bf70..7bc2e10 100644
--- a/windows/painting.c
+++ b/windows/painting.c
@@ -268,9 +268,29 @@
*/
HDC16 WINAPI BeginPaint16( HWND16 hwnd, LPPAINTSTRUCT16 lps )
{
+ PAINTSTRUCT ps;
+
+ BeginPaint( hwnd, &ps );
+ lps->hdc = ps.hdc;
+ lps->fErase = ps.fErase;
+ lps->rcPaint.top = ps.rcPaint.top;
+ lps->rcPaint.left = ps.rcPaint.left;
+ lps->rcPaint.right = ps.rcPaint.right;
+ lps->rcPaint.bottom = ps.rcPaint.bottom;
+ lps->fRestore = ps.fRestore;
+ lps->fIncUpdate = ps.fIncUpdate;
+ return lps->hdc;
+}
+
+
+/***********************************************************************
+ * BeginPaint (USER32.10)
+ */
+HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
+{
BOOL bIcon;
HRGN hrgnUpdate;
- RECT16 clipRect, clientRect;
+ RECT clipRect, clientRect;
WND *wndPtr = WIN_FindWndPtr( hwnd );
if (!wndPtr) return 0;
@@ -306,7 +326,7 @@
/* Don't clip the output to the update region for CS_PARENTDC window */
if( hrgnUpdate )
DeleteObject(hrgnUpdate);
- lps->hdc = GetDCEx16( hwnd, 0, DCX_WINDOWPAINT | DCX_USESTYLE |
+ lps->hdc = GetDCEx( hwnd, 0, DCX_WINDOWPAINT | DCX_USESTYLE |
(bIcon ? DCX_WINDOW : 0) );
}
else
@@ -314,7 +334,7 @@
if( hrgnUpdate ) /* convert to client coordinates */
OffsetRgn( hrgnUpdate, wndPtr->rectWindow.left - wndPtr->rectClient.left,
wndPtr->rectWindow.top - wndPtr->rectClient.top );
- lps->hdc = GetDCEx16(hwnd, hrgnUpdate, DCX_INTERSECTRGN |
+ lps->hdc = GetDCEx(hwnd, hrgnUpdate, DCX_INTERSECTRGN |
DCX_WINDOWPAINT | DCX_USESTYLE | (bIcon ? DCX_WINDOW : 0) );
/* ReleaseDC() in EndPaint() will delete the region */
}
@@ -333,13 +353,13 @@
than the window itself, so we need to intersect the cliprect with
the window */
- GetClipBox16( lps->hdc, &clipRect );
- GetClientRect16( hwnd, &clientRect );
+ GetClipBox( lps->hdc, &clipRect );
+ GetClientRect( hwnd, &clientRect );
/* The rect obtained by GetClipBox is in logical, so make the client in logical to*/
- DPtoLP16(lps->hdc, (LPPOINT16) &clientRect, 2);
+ DPtoLP(lps->hdc, (LPPOINT)&clientRect, 2);
- IntersectRect16(&lps->rcPaint, &clientRect, &clipRect);
+ IntersectRect(&lps->rcPaint, &clientRect, &clipRect);
TRACE("box = (%i,%i - %i,%i)\n", lps->rcPaint.left, lps->rcPaint.top,
lps->rcPaint.right, lps->rcPaint.bottom );
@@ -347,9 +367,8 @@
if (wndPtr->flags & WIN_NEEDS_ERASEBKGND)
{
wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND;
- lps->fErase = !SendMessage16(hwnd, (bIcon) ? WM_ICONERASEBKGND
- : WM_ERASEBKGND,
- (WPARAM16)lps->hdc, 0 );
+ lps->fErase = !SendMessageA(hwnd, (bIcon) ? WM_ICONERASEBKGND : WM_ERASEBKGND,
+ (WPARAM16)lps->hdc, 0 );
}
else lps->fErase = TRUE;
@@ -359,26 +378,6 @@
/***********************************************************************
- * BeginPaint (USER32.10)
- */
-HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps )
-{
- PAINTSTRUCT16 ps;
-
- BeginPaint16( hwnd, &ps );
- lps->hdc = (HDC)ps.hdc;
- lps->fErase = ps.fErase;
- lps->rcPaint.top = ps.rcPaint.top;
- lps->rcPaint.left = ps.rcPaint.left;
- lps->rcPaint.right = ps.rcPaint.right;
- lps->rcPaint.bottom = ps.rcPaint.bottom;
- lps->fRestore = ps.fRestore;
- lps->fIncUpdate = ps.fIncUpdate;
- return lps->hdc;
-}
-
-
-/***********************************************************************
* EndPaint16 (USER.40)
*/
BOOL16 WINAPI EndPaint16( HWND16 hwnd, const PAINTSTRUCT16* lps )
@@ -405,10 +404,12 @@
*/
void WINAPI FillWindow16( HWND16 hwndParent, HWND16 hwnd, HDC16 hdc, HBRUSH16 hbrush )
{
- RECT16 rect;
- GetClientRect16( hwnd, &rect );
- DPtoLP16( hdc, (LPPOINT16)&rect, 2 );
- PaintRect16( hwndParent, hwnd, hdc, hbrush, &rect );
+ RECT rect;
+ RECT16 rc16;
+ GetClientRect( hwnd, &rect );
+ DPtoLP( hdc, (LPPOINT)&rect, 2 );
+ CONV_RECT32TO16( &rect, &rc16 );
+ PaintRect16( hwndParent, hwnd, hdc, hbrush, &rc16 );
}
@@ -1240,16 +1241,16 @@
*/
INT16 WINAPI FillRect16( HDC16 hdc, const RECT16 *rect, HBRUSH16 hbrush )
{
- HBRUSH16 prevBrush;
+ HBRUSH prevBrush;
/* coordinates are logical so we cannot fast-check 'rect',
* it will be done later in the PatBlt().
*/
- if (!(prevBrush = SelectObject16( hdc, hbrush ))) return 0;
+ if (!(prevBrush = SelectObject( hdc, hbrush ))) return 0;
PatBlt( hdc, rect->left, rect->top,
rect->right - rect->left, rect->bottom - rect->top, PATCOPY );
- SelectObject16( hdc, prevBrush );
+ SelectObject( hdc, prevBrush );
return 1;
}
@@ -1641,3 +1642,20 @@
}
+/***********************************************************************
+ * SelectPalette16 (USER.282)
+ */
+HPALETTE16 WINAPI SelectPalette16( HDC16 hDC, HPALETTE16 hPal,
+ BOOL16 bForceBackground )
+{
+ return SelectPalette( hDC, hPal, bForceBackground );
+}
+
+
+/***********************************************************************
+ * RealizePalette16 (USER.283)
+ */
+UINT16 WINAPI RealizePalette16( HDC16 hDC )
+{
+ return RealizePalette( hDC );
+}
diff --git a/windows/ttydrv/wnd.c b/windows/ttydrv/wnd.c
index 696185e..df64709 100644
--- a/windows/ttydrv/wnd.c
+++ b/windows/ttydrv/wnd.c
@@ -192,20 +192,21 @@
/*****************************************************************
* TTYDRV_WND_ScrollWindow
*/
-void TTYDRV_WND_ScrollWindow(
- WND *wndPtr, DC *dcPtr, INT dx, INT dy,
- const RECT *clipRect, BOOL bUpdate)
+void TTYDRV_WND_ScrollWindow( WND *wndPtr, HDC hdc, INT dx, INT dy,
+ const RECT *clipRect, BOOL bUpdate)
{
- FIXME("(%p, %p, %d, %d, %p, %d): stub\n",
- wndPtr, dcPtr, dx, dy, clipRect, bUpdate);
+ FIXME("(%p, %x, %d, %d, %p, %d): stub\n",
+ wndPtr, hdc, dx, dy, clipRect, bUpdate);
}
/***********************************************************************
* TTYDRV_WND_SetDrawable
*/
-void TTYDRV_WND_SetDrawable(WND *wndPtr, DC *dc, WORD flags, BOOL bSetClipOrigin)
+void TTYDRV_WND_SetDrawable(WND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigin)
{
- TRACE("(%p, %p, %d, %d)\n", wndPtr, dc, flags, bSetClipOrigin);
+ DC *dc = DC_GetDCPtr( hdc );
+ if (!dc) return;
+ TRACE("(%p, %p, %d, %d)\n", wndPtr, dc, flags, bSetClipOrigin);
/* FIXME: Should be done in the common code instead */
if(!wndPtr) {
@@ -220,6 +221,7 @@
dc->w.DCOrgY = wndPtr->rectClient.top;
}
}
+ GDI_HEAP_UNLOCK( hdc );
}
/***********************************************************************
diff --git a/windows/winpos.c b/windows/winpos.c
index 9b4b36c..dedcb6c 100644
--- a/windows/winpos.c
+++ b/windows/winpos.c
@@ -2319,7 +2319,6 @@
{
RECT rClip;
HDC hDC;
- DC* dc;
/* get DC and clip rect with drawable rect to avoid superfluous expose events
from copying clipped areas */
@@ -2339,14 +2338,12 @@
}
rClip.left = rClip.top = 0;
- if( (dc = (DC *)GDI_GetObjPtr(hDC, DC_MAGIC)) )
- {
- if( oh > nh ) r.bottom = r.top + nh;
- if( ow < nw ) r.right = r.left + nw;
+ if( oh > nh ) r.bottom = r.top + nh;
+ if( ow < nw ) r.right = r.left + nw;
- if( IntersectRect( &r, &r, &rClip ) )
- {
- Wnd->pDriver->pSurfaceCopy( Wnd->parent, dc, dx, dy, &r, TRUE );
+ if( IntersectRect( &r, &r, &rClip ) )
+ {
+ Wnd->pDriver->pSurfaceCopy( Wnd->parent, hDC, dx, dy, &r, TRUE );
/* When you copy the bits without repainting, parent doesn't
get validated appropriately. Therefore, we have to validate
@@ -2358,9 +2355,6 @@
OffsetRect(&r, dx, dy);
ValidateRect(Wnd->parent->hwndSelf, &r);
}
- }
-
- GDI_HEAP_UNLOCK( hDC );
}
ReleaseDC( (uFlags & SWP_EX_PAINTSELF) ?
Wnd->hwndSelf : Wnd->parent->hwndSelf, hDC);
diff --git a/windows/x11drv/wnd.c b/windows/x11drv/wnd.c
index 75bc564..a47f088 100644
--- a/windows/x11drv/wnd.c
+++ b/windows/x11drv/wnd.c
@@ -21,6 +21,7 @@
#include "color.h"
#include "debugtools.h"
#include "dce.h"
+#include "dc.h"
#include "options.h"
#include "message.h"
#include "heap.h"
@@ -755,12 +756,15 @@
*
* Copies rect to (rect.left + dx, rect.top + dy).
*/
-void X11DRV_WND_SurfaceCopy(WND* wndPtr, DC *dcPtr, INT dx, INT dy,
+void X11DRV_WND_SurfaceCopy(WND* wndPtr, HDC hdc, INT dx, INT dy,
const RECT *rect, BOOL bUpdate)
{
- X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dcPtr->physDev;
+ X11DRV_PDEVICE *physDev;
POINT dst, src;
-
+ DC *dcPtr = DC_GetDCPtr( hdc );
+
+ if (!dcPtr) return;
+ physDev = (X11DRV_PDEVICE *)dcPtr->physDev;
dst.x = (src.x = dcPtr->w.DCOrgX + rect->left) + dx;
dst.y = (src.y = dcPtr->w.DCOrgY + rect->top) + dy;
@@ -777,6 +781,7 @@
if (bUpdate) /* Make sure exposure events have been processed */
EVENT_Synchronize();
+ GDI_HEAP_UNLOCK( hdc );
}
/***********************************************************************
@@ -785,12 +790,15 @@
* Set the drawable, origin and dimensions for the DC associated to
* a given window.
*/
-void X11DRV_WND_SetDrawable(WND *wndPtr, DC *dc, WORD flags, BOOL bSetClipOrigin)
+void X11DRV_WND_SetDrawable(WND *wndPtr, HDC hdc, WORD flags, BOOL bSetClipOrigin)
{
- X11DRV_PDEVICE *physDev = (X11DRV_PDEVICE *)dc->physDev;
+ DC *dc = DC_GetDCPtr( hdc );
+ X11DRV_PDEVICE *physDev;
INT dcOrgXCopy = 0, dcOrgYCopy = 0;
BOOL offsetClipRgn = FALSE;
+ if (!dc) return;
+ physDev = (X11DRV_PDEVICE *)dc->physDev;
if (!wndPtr) /* Get a DC for the whole screen */
{
dc->w.DCOrgX = 0;
@@ -855,6 +863,7 @@
TSXSetClipOrigin( display, physDev->gc, dc->w.DCOrgX, dc->w.DCOrgY );
#endif
}
+ GDI_HEAP_UNLOCK( hdc );
}
/***********************************************************************