Commit d1290b6e authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

user32: Introduce user_driver_funcs struct.

And use it instead of USER_DRIVER. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 6b59b26f
......@@ -22,23 +22,17 @@
#include <stdio.h>
#include <wchar.h>
#include "windef.h"
#include "winbase.h"
#include "user_private.h"
#include "winnls.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/debug.h"
#include "wine/gdi_driver.h"
#include "user_private.h"
#include "controls.h"
WINE_DEFAULT_DEBUG_CHANNEL(user);
WINE_DECLARE_DEBUG_CHANNEL(winediag);
static USER_DRIVER null_driver, lazy_load_driver;
static struct user_driver_funcs null_driver, lazy_load_driver;
const USER_DRIVER *USER_Driver = &lazy_load_driver;
const struct user_driver_funcs *USER_Driver = &lazy_load_driver;
static char driver_load_error[80];
static BOOL CDECL nodrv_CreateWindow( HWND hwnd );
......@@ -81,11 +75,11 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module )
}
/* load the graphics driver */
static const USER_DRIVER *load_driver(void)
static const struct user_driver_funcs *load_driver(void)
{
void *ptr;
HMODULE graphics_driver = NULL;
USER_DRIVER *driver, *prev;
struct user_driver_funcs *driver, *prev;
driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
*driver = null_driver;
......@@ -169,7 +163,7 @@ static const USER_DRIVER *load_driver(void)
/* unload the graphics driver on process exit */
void USER_unload_driver(void)
{
USER_DRIVER *prev;
struct user_driver_funcs *prev;
/* make sure we don't try to call the driver after it has been detached */
prev = InterlockedExchangePointer( (void **)&USER_Driver, &null_driver );
if (prev != &lazy_load_driver && prev != &null_driver)
......@@ -399,8 +393,9 @@ static void CDECL nulldrv_ThreadDetach( void )
{
}
static USER_DRIVER null_driver =
static struct user_driver_funcs null_driver =
{
{ NULL },
/* keyboard functions */
nulldrv_ActivateKeyboardLayout,
nulldrv_Beep,
......@@ -590,8 +585,9 @@ static BOOL CDECL loaderdrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDW
return load_driver()->pUpdateLayeredWindow( hwnd, info, window_rect );
}
static USER_DRIVER lazy_load_driver =
static struct user_driver_funcs lazy_load_driver =
{
{ NULL },
/* keyboard functions */
loaderdrv_ActivateKeyboardLayout,
loaderdrv_Beep,
......
......@@ -25,15 +25,10 @@
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "winuser.h"
#include "wine/server.h"
#include "win.h"
#include "user_private.h"
#include "win.h"
#include "controls.h"
#include "wine/gdi_driver.h"
#include "wine/server.h"
#include "wine/list.h"
#include "wine/debug.h"
......
......@@ -45,7 +45,6 @@
#include "controls.h"
#include "win.h"
#include "user_private.h"
#include "wine/gdi_driver.h"
#include "wine/asm.h"
#include "wine/debug.h"
......
......@@ -29,6 +29,7 @@
#include "winreg.h"
#include "winternl.h"
#include "hidusage.h"
#include "wine/gdi_driver.h"
#include "wine/heap.h"
#define GET_WORD(ptr) (*(const WORD *)(ptr))
......@@ -61,60 +62,7 @@ enum wine_internal_message
WM_WINE_LAST_DRIVER_MSG = 0x80001fff
};
typedef struct tagUSER_DRIVER {
/* keyboard functions */
BOOL (CDECL *pActivateKeyboardLayout)(HKL, UINT);
void (CDECL *pBeep)(void);
INT (CDECL *pGetKeyNameText)(LONG, LPWSTR, INT);
UINT (CDECL *pGetKeyboardLayoutList)(INT, HKL *);
UINT (CDECL *pMapVirtualKeyEx)(UINT, UINT, HKL);
BOOL (CDECL *pRegisterHotKey)(HWND, UINT, UINT);
INT (CDECL *pToUnicodeEx)(UINT, UINT, const BYTE *, LPWSTR, int, UINT, HKL);
void (CDECL *pUnregisterHotKey)(HWND, UINT, UINT);
SHORT (CDECL *pVkKeyScanEx)(WCHAR, HKL);
/* cursor/icon functions */
void (CDECL *pDestroyCursorIcon)(HCURSOR);
void (CDECL *pSetCursor)(HCURSOR);
BOOL (CDECL *pGetCursorPos)(LPPOINT);
BOOL (CDECL *pSetCursorPos)(INT,INT);
BOOL (CDECL *pClipCursor)(LPCRECT);
/* clipboard functions */
void (CDECL *pUpdateClipboard)(void);
/* display modes */
LONG (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
BOOL (CDECL *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM);
BOOL (CDECL *pEnumDisplaySettingsEx)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
BOOL (CDECL *pGetMonitorInfo)(HMONITOR,MONITORINFO*);
/* windowing functions */
BOOL (CDECL *pCreateDesktopWindow)(HWND);
BOOL (CDECL *pCreateWindow)(HWND);
void (CDECL *pDestroyWindow)(HWND);
void (CDECL *pFlashWindowEx)(FLASHWINFO*);
void (CDECL *pGetDC)(HDC,HWND,HWND,const RECT *,const RECT *,DWORD);
DWORD (CDECL *pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
void (CDECL *pReleaseDC)(HWND,HDC);
BOOL (CDECL *pScrollDC)(HDC,INT,INT,HRGN);
void (CDECL *pSetCapture)(HWND,UINT);
void (CDECL *pSetFocus)(HWND);
void (CDECL *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
void (CDECL *pSetParent)(HWND,HWND,HWND);
void (CDECL *pSetWindowRgn)(HWND,HRGN,BOOL);
void (CDECL *pSetWindowIcon)(HWND,UINT,HICON);
void (CDECL *pSetWindowStyle)(HWND,INT,STYLESTRUCT*);
void (CDECL *pSetWindowText)(HWND,LPCWSTR);
UINT (CDECL *pShowWindow)(HWND,INT,RECT*,UINT);
LRESULT (CDECL *pSysCommand)(HWND,WPARAM,LPARAM);
BOOL (CDECL *pUpdateLayeredWindow)(HWND,const UPDATELAYEREDWINDOWINFO *,const RECT *);
LRESULT (CDECL *pWindowMessage)(HWND,UINT,WPARAM,LPARAM);
BOOL (CDECL *pWindowPosChanging)(HWND,HWND,UINT,const RECT *,const RECT *,RECT *,struct window_surface**);
void (CDECL *pWindowPosChanged)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *,const RECT *,struct window_surface*);
/* system parameters */
BOOL (CDECL *pSystemParametersInfo)(UINT,UINT,void*,UINT);
/* thread management */
void (CDECL *pThreadDetach)(void);
} USER_DRIVER;
extern const USER_DRIVER *USER_Driver DECLSPEC_HIDDEN;
extern const struct user_driver_funcs *USER_Driver DECLSPEC_HIDDEN;
extern void USER_unload_driver(void) DECLSPEC_HIDDEN;
......
......@@ -19,22 +19,18 @@
*/
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include "windef.h"
#include "winbase.h"
#include "user_private.h"
#include "winnls.h"
#include "winver.h"
#include "wine/server.h"
#include "wine/asm.h"
#include "win.h"
#include "user_private.h"
#include "controls.h"
#include "winerror.h"
#include "wine/gdi_driver.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(win);
......
......@@ -19,19 +19,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#include <string.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "user_private.h"
#include "winerror.h"
#include "wine/server.h"
#include "controls.h"
#include "user_private.h"
#include "wine/gdi_driver.h"
#include "win.h"
#include "wine/server.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(win);
......
......@@ -22,8 +22,8 @@
#include "config.h"
#include "macdrv.h"
#define OEMRESOURCE
#include "macdrv.h"
#include "winuser.h"
#include "winreg.h"
#include "wine/server.h"
......
......@@ -22,6 +22,7 @@
#define __WINE_WINE_GDI_DRIVER_H
#include "winternl.h"
#include "ntuser.h"
#include "ddk/d3dkmthk.h"
#include "wine/list.h"
......@@ -228,6 +229,66 @@ static inline ULONG window_surface_release( struct window_surface *surface )
return ret;
}
struct tagUPDATELAYEREDWINDOWINFO;
struct user_driver_funcs
{
struct gdi_dc_funcs dc_funcs;
/* keyboard functions */
BOOL (CDECL *pActivateKeyboardLayout)(HKL, UINT);
void (CDECL *pBeep)(void);
INT (CDECL *pGetKeyNameText)(LONG,LPWSTR,INT);
UINT (CDECL *pGetKeyboardLayoutList)(INT, HKL *);
UINT (CDECL *pMapVirtualKeyEx)(UINT,UINT,HKL);
BOOL (CDECL *pRegisterHotKey)(HWND,UINT,UINT);
INT (CDECL *pToUnicodeEx)(UINT,UINT,const BYTE *,LPWSTR,int,UINT,HKL);
void (CDECL *pUnregisterHotKey)(HWND, UINT, UINT);
SHORT (CDECL *pVkKeyScanEx)(WCHAR, HKL);
/* cursor/icon functions */
void (CDECL *pDestroyCursorIcon)(HCURSOR);
void (CDECL *pSetCursor)(HCURSOR);
BOOL (CDECL *pGetCursorPos)(LPPOINT);
BOOL (CDECL *pSetCursorPos)(INT,INT);
BOOL (CDECL *pClipCursor)(LPCRECT);
/* clipboard functions */
void (CDECL *pUpdateClipboard)(void);
/* display modes */
LONG (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
BOOL (CDECL *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM);
BOOL (CDECL *pEnumDisplaySettingsEx)(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
BOOL (CDECL *pGetMonitorInfo)(HMONITOR,MONITORINFO*);
/* windowing functions */
BOOL (CDECL *pCreateDesktopWindow)(HWND);
BOOL (CDECL *pCreateWindow)(HWND);
void (CDECL *pDestroyWindow)(HWND);
void (CDECL *pFlashWindowEx)(FLASHWINFO*);
void (CDECL *pGetDC)(HDC,HWND,HWND,const RECT *,const RECT *,DWORD);
DWORD (CDECL *pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD);
void (CDECL *pReleaseDC)(HWND,HDC);
BOOL (CDECL *pScrollDC)(HDC,INT,INT,HRGN);
void (CDECL *pSetCapture)(HWND,UINT);
void (CDECL *pSetFocus)(HWND);
void (CDECL *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
void (CDECL *pSetParent)(HWND,HWND,HWND);
void (CDECL *pSetWindowRgn)(HWND,HRGN,BOOL);
void (CDECL *pSetWindowIcon)(HWND,UINT,HICON);
void (CDECL *pSetWindowStyle)(HWND,INT,STYLESTRUCT*);
void (CDECL *pSetWindowText)(HWND,LPCWSTR);
UINT (CDECL *pShowWindow)(HWND,INT,RECT*,UINT);
LRESULT (CDECL *pSysCommand)(HWND,WPARAM,LPARAM);
BOOL (CDECL *pUpdateLayeredWindow)(HWND,const struct tagUPDATELAYEREDWINDOWINFO *,const RECT *);
LRESULT (CDECL *pWindowMessage)(HWND,UINT,WPARAM,LPARAM);
BOOL (CDECL *pWindowPosChanging)(HWND,HWND,UINT,const RECT *,const RECT *,RECT *,
struct window_surface**);
void (CDECL *pWindowPosChanged)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *,
const RECT *,struct window_surface*);
/* system parameters */
BOOL (CDECL *pSystemParametersInfo)(UINT,UINT,void*,UINT);
/* thread management */
void (CDECL *pThreadDetach)(void);
};
/* the DC hook support is only exported on Win16, the 32-bit version is a Wine extension */
#define DCHC_INVALIDVISRGN 0x0001
......
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