From b4ea5587cd6e3ed4a87e065eb9329ce5f6214c80 Mon Sep 17 00:00:00 2001 From: Jesse Allen Date: Tue, 20 Nov 2007 12:54:34 -0700 Subject: [PATCH] dibdrv: Implement basic Create/Delete DC --- dlls/winedib.drv/Makefile.in | 3 ++- dlls/winedib.drv/dibdrv.h | 32 ++++++++++++++++++++++ dlls/winedib.drv/init.c | 56 +++++++++++++++++++++++++++++++++++++++ dlls/winedib.drv/winedib.drv.spec | 3 ++- 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 dlls/winedib.drv/dibdrv.h create mode 100644 dlls/winedib.drv/init.c diff --git a/dlls/winedib.drv/Makefile.in b/dlls/winedib.drv/Makefile.in index 2fba1e65e77..83fc99b5501 100644 --- a/dlls/winedib.drv/Makefile.in +++ b/dlls/winedib.drv/Makefile.in @@ -6,7 +6,8 @@ MODULE = winedib.drv IMPORTS = user32 gdi32 advapi32 kernel32 ntdll C_SRCS = \ - dibdrv_main.c + dibdrv_main.c \ + init.c @MAKE_DLL_RULES@ diff --git a/dlls/winedib.drv/dibdrv.h b/dlls/winedib.drv/dibdrv.h new file mode 100644 index 00000000000..2e7b384c678 --- /dev/null +++ b/dlls/winedib.drv/dibdrv.h @@ -0,0 +1,32 @@ +/* + * DIB driver private definitions + * + * Copyright 2007 Jesse Allen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_DIBDRV_H +#define __WINE_DIBDRV_H + +#include "wingdi.h" + +/* DIB driver physical device */ +typedef struct _DIBDRVPHYSDEV +{ + HDC hdc; +} DIBDRVPHYSDEV; + +#endif /* __WINE_DIBDRV_H */ diff --git a/dlls/winedib.drv/init.c b/dlls/winedib.drv/init.c new file mode 100644 index 00000000000..dac4dc3bef7 --- /dev/null +++ b/dlls/winedib.drv/init.c @@ -0,0 +1,56 @@ +/* + * DIB driver initialization functions + * + * Copyright 2007 Jesse Allen + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +#include "dibdrv.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dibdrv); + +/********************************************************************** + * DIBDRV_CreateDC + */ +BOOL DIBDRV_CreateDC( HDC hdc, DIBDRVPHYSDEV **pdev, LPCWSTR driver, LPCWSTR device, + LPCWSTR output, const DEVMODEW* initData ) +{ + DIBDRVPHYSDEV *physDev; + + physDev = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*physDev) ); + if (!physDev) return FALSE; + + *pdev = physDev; + physDev->hdc = hdc; + + return TRUE; +} + +/********************************************************************** + * DIBDRV_DeleteDC + */ +BOOL DIBDRV_DeleteDC( DIBDRVPHYSDEV *physDev ) +{ + HeapFree( GetProcessHeap(), 0, physDev ); + return TRUE; +} diff --git a/dlls/winedib.drv/winedib.drv.spec b/dlls/winedib.drv/winedib.drv.spec index d98d860e3eb..362b771ef8a 100644 --- a/dlls/winedib.drv/winedib.drv.spec +++ b/dlls/winedib.drv/winedib.drv.spec @@ -1 +1,2 @@ -# Nothing Yet +@ cdecl CreateDC(long ptr wstr wstr wstr ptr) DIBDRV_CreateDC +@ cdecl DeleteDC(ptr) DIBDRV_DeleteDC -- 2.11.4.GIT