Commit 83decd25 authored by Alexandre Julliard's avatar Alexandre Julliard

Changed the CreateDC driver entry point to use an HDC instead of a DC

pointer.
parent 37fda71e
......@@ -59,7 +59,7 @@ typedef struct tagDC_FUNCS
BOOL (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT);
BOOL (*pCloseFigure)(PHYSDEV);
BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP);
BOOL (*pCreateDC)(DC *,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
BOOL (*pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*);
HBITMAP (*pCreateDIBSection)(PHYSDEV,BITMAPINFO *,UINT,LPVOID *,HANDLE,DWORD,DWORD);
BOOL (*pDeleteBitmap)(HBITMAP);
BOOL (*pDeleteDC)(PHYSDEV);
......
......@@ -20,7 +20,6 @@
#include "config.h"
#include "gdi.h"
#include "ttydrv.h"
#include "winbase.h"
#include "wine/debug.h"
......@@ -39,14 +38,13 @@ BOOL TTYDRV_GDI_Initialize(void)
/***********************************************************************
* TTYDRV_DC_CreateDC
*/
BOOL TTYDRV_DC_CreateDC(DC *dc, TTYDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device,
BOOL TTYDRV_DC_CreateDC(HDC hdc, TTYDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW *initData)
{
TTYDRV_PDEVICE *physDev;
TRACE("(%p, %s, %s, %s, %p)\n",
dc, debugstr_w(driver), debugstr_w(device),
debugstr_w(output), initData);
hdc, debugstr_w(driver), debugstr_w(device), debugstr_w(output), initData);
physDev = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TTYDRV_PDEVICE));
if(!physDev) {
......@@ -54,10 +52,10 @@ BOOL TTYDRV_DC_CreateDC(DC *dc, TTYDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR d
return FALSE;
}
*pdev = physDev;
physDev->hdc = dc->hSelf;
physDev->hdc = hdc;
physDev->org.x = physDev->org.y = 0;
if(GetObjectType(dc->hSelf) == OBJ_MEMDC) {
if(GetObjectType(hdc) == OBJ_MEMDC) {
physDev->window = NULL;
physDev->cellWidth = 1;
physDev->cellHeight = 1;
......
......@@ -3,7 +3,7 @@
@ cdecl Arc(ptr long long long long long long long long) TTYDRV_DC_Arc
@ cdecl BitBlt(ptr long long long long ptr long long long) TTYDRV_DC_BitBlt
@ cdecl Chord(ptr long long long long long long long long) TTYDRV_DC_Chord
@ cdecl CreateDC(ptr ptr wstr wstr wstr ptr) TTYDRV_DC_CreateDC
@ cdecl CreateDC(long ptr wstr wstr wstr ptr) TTYDRV_DC_CreateDC
@ cdecl DeleteDC(ptr) TTYDRV_DC_DeleteDC
@ cdecl Ellipse(ptr long long long long) TTYDRV_DC_Ellipse
@ cdecl ExtFloodFill(ptr long long long long) TTYDRV_DC_ExtFloodFill
......
......@@ -29,7 +29,6 @@
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include "gdi.h"
#include "psdrv.h"
#include "wine/debug.h"
#include "winreg.h"
......@@ -104,7 +103,7 @@ static PSDRV_DEVMODEA DefaultDevmode =
HANDLE PSDRV_Heap = 0;
static HANDLE PSDRV_DefaultFont = 0;
static HFONT PSDRV_DefaultFont = 0;
static LOGFONTA DefaultLogFont = {
100, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, ANSI_CHARSET, 0, 0,
DEFAULT_QUALITY, FIXED_PITCH | FF_MODERN, ""
......@@ -294,7 +293,7 @@ static LPDEVMODEA DEVMODEdupWtoA(HANDLE heap, const DEVMODEW *dmW)
/**********************************************************************
* PSDRV_CreateDC
*/
BOOL PSDRV_CreateDC( DC *dc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device,
BOOL PSDRV_CreateDC( HDC hdc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW* initData )
{
PSDRV_PDEVICE *physDev;
......@@ -327,8 +326,7 @@ BOOL PSDRV_CreateDC( DC *dc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devic
sizeof(*physDev) );
if (!physDev) return FALSE;
*pdev = physDev;
physDev->hdc = dc->hSelf;
physDev->dc = dc;
physDev->hdc = hdc;
physDev->pi = pi;
......@@ -357,7 +355,7 @@ BOOL PSDRV_CreateDC( DC *dc, PSDRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR devic
}
PSDRV_UpdateDevCaps(physDev);
dc->hFont = PSDRV_DefaultFont;
SelectObject( hdc, PSDRV_DefaultFont );
return TRUE;
}
......
......@@ -327,7 +327,6 @@ typedef struct {
typedef struct {
HDC hdc;
struct tagDC *dc;
PSFONT font; /* Current PS font */
DOWNLOAD *downloaded_fonts;
PSPEN pen;
......
......@@ -2,7 +2,7 @@
@ cdecl Arc(ptr long long long long long long long long) PSDRV_Arc
@ cdecl Chord(ptr long long long long long long long long) PSDRV_Chord
@ cdecl CreateDC(ptr ptr wstr wstr wstr ptr) PSDRV_CreateDC
@ cdecl CreateDC(long ptr wstr wstr wstr ptr) PSDRV_CreateDC
@ cdecl DeleteDC(ptr) PSDRV_DeleteDC
@ cdecl DeviceCapabilities(ptr ptr ptr long ptr ptr) PSDRV_DeviceCapabilities
@ cdecl Ellipse(ptr long long long long) PSDRV_Ellipse
......
......@@ -27,7 +27,6 @@
#include "winbase.h"
#include "x11drv.h"
#include "x11font.h"
#include "gdi.h"
#include "ddrawi.h"
#include "wine/debug.h"
......@@ -85,7 +84,7 @@ void X11DRV_GDI_Finalize(void)
/**********************************************************************
* X11DRV_CreateDC
*/
BOOL X11DRV_CreateDC( DC *dc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device,
BOOL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device,
LPCWSTR output, const DEVMODEW* initData )
{
X11DRV_PDEVICE *physDev;
......@@ -94,9 +93,9 @@ BOOL X11DRV_CreateDC( DC *dc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR dev
if (!physDev) return FALSE;
*pdev = physDev;
physDev->hdc = dc->hSelf;
physDev->hdc = hdc;
if (GetObjectType( dc->hSelf ) == OBJ_MEMDC)
if (GetObjectType( hdc ) == OBJ_MEMDC)
{
physDev->drawable = BITMAP_stock_pixmap;
physDev->depth = 1;
......
......@@ -5,7 +5,7 @@
@ cdecl ChoosePixelFormat(ptr ptr) X11DRV_ChoosePixelFormat
@ cdecl Chord(ptr long long long long long long long long) X11DRV_Chord
@ cdecl CreateBitmap(ptr long) X11DRV_CreateBitmap
@ cdecl CreateDC(ptr ptr wstr wstr wstr ptr) X11DRV_CreateDC
@ cdecl CreateDC(long ptr wstr wstr wstr ptr) X11DRV_CreateDC
@ cdecl CreateDIBSection(ptr ptr long ptr long long long) X11DRV_DIB_CreateDIBSection
@ cdecl DeleteBitmap(long) X11DRV_DeleteBitmap
@ cdecl DeleteDC(ptr) X11DRV_DeleteDC
......
......@@ -603,7 +603,7 @@ HDC WINAPI CreateDCW( LPCWSTR driver, LPCWSTR device, LPCWSTR output,
debugstr_w(driver), debugstr_w(device), debugstr_w(output), dc->hSelf );
if (dc->funcs->pCreateDC &&
!dc->funcs->pCreateDC( dc, &dc->physDev, buf, device, output, initData ))
!dc->funcs->pCreateDC( hdc, &dc->physDev, buf, device, output, initData ))
{
WARN("creation aborted by device\n" );
GDI_FreeObject( dc->hSelf, dc );
......@@ -717,7 +717,7 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
dc->physDev = physDev;
if (dc->funcs->pCreateDC &&
!dc->funcs->pCreateDC( dc, &dc->physDev, NULL, NULL, NULL, NULL ))
!dc->funcs->pCreateDC( dc->hSelf, &dc->physDev, NULL, NULL, NULL, NULL ))
{
WARN("creation aborted by device\n");
GDI_FreeObject( dc->hSelf, dc );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment