Skip to content
Snippets Groups Projects
Commit fd675485 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard
Browse files

user32: Use user_driver_funcs to expose user driver function from drivers.

parent d1290b6e
No related branches found
No related tags found
No related merge requests found
Showing
with 411 additions and 482 deletions
......@@ -59,9 +59,17 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module )
size = sizeof(path);
if (!RegQueryValueExW( hkey, L"GraphicsDriver", NULL, NULL, (BYTE *)path, &size ))
{
if ((ret = !wcscmp( path, L"null" ))) *module = NULL;
else ret = (*module = LoadLibraryW( path )) != NULL;
if (!ret) ERR( "failed to load %s\n", debugstr_w(path) );
if (wcscmp( path, L"null" ))
{
ret = (*module = LoadLibraryW( path )) != NULL;
if (!ret) ERR( "failed to load %s\n", debugstr_w(path) );
}
else
{
__wine_set_user_driver( &null_driver, WINE_GDI_DRIVER_VERSION );
*module = NULL;
ret = TRUE;
}
TRACE( "%s %p\n", debugstr_w(path), *module );
}
else
......@@ -77,87 +85,25 @@ static BOOL load_desktop_driver( HWND hwnd, HMODULE *module )
/* load the graphics driver */
static const struct user_driver_funcs *load_driver(void)
{
void *ptr;
HMODULE graphics_driver = NULL;
struct user_driver_funcs *driver, *prev;
driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
*driver = null_driver;
struct user_driver_funcs driver;
USEROBJECTFLAGS flags;
HWINSTA winstation;
HMODULE module;
if (!load_desktop_driver( GetDesktopWindow(), &graphics_driver ))
if (!load_desktop_driver( GetDesktopWindow(), &module ) || USER_Driver == &lazy_load_driver)
{
USEROBJECTFLAGS flags;
HWINSTA winstation;
memset( &driver, 0, sizeof(driver) );
winstation = NtUserGetProcessWindowStation();
if (!GetUserObjectInformationA(winstation, UOI_FLAGS, &flags, sizeof(flags), NULL)
if (!NtUserGetObjectInformation( winstation, UOI_FLAGS, &flags, sizeof(flags), NULL )
|| (flags.dwFlags & WSF_VISIBLE))
driver->pCreateWindow = nodrv_CreateWindow;
}
else if (graphics_driver)
{
#define GET_USER_FUNC(name) \
do { if ((ptr = GetProcAddress( graphics_driver, #name ))) driver->p##name = ptr; } while(0)
GET_USER_FUNC(ActivateKeyboardLayout);
GET_USER_FUNC(Beep);
GET_USER_FUNC(GetKeyNameText);
GET_USER_FUNC(GetKeyboardLayoutList);
GET_USER_FUNC(MapVirtualKeyEx);
GET_USER_FUNC(RegisterHotKey);
GET_USER_FUNC(ToUnicodeEx);
GET_USER_FUNC(UnregisterHotKey);
GET_USER_FUNC(VkKeyScanEx);
GET_USER_FUNC(DestroyCursorIcon);
GET_USER_FUNC(SetCursor);
GET_USER_FUNC(GetCursorPos);
GET_USER_FUNC(SetCursorPos);
GET_USER_FUNC(ClipCursor);
GET_USER_FUNC(UpdateClipboard);
GET_USER_FUNC(ChangeDisplaySettingsEx);
GET_USER_FUNC(EnumDisplayMonitors);
GET_USER_FUNC(EnumDisplaySettingsEx);
GET_USER_FUNC(GetMonitorInfo);
GET_USER_FUNC(CreateDesktopWindow);
GET_USER_FUNC(CreateWindow);
GET_USER_FUNC(DestroyWindow);
GET_USER_FUNC(FlashWindowEx);
GET_USER_FUNC(GetDC);
GET_USER_FUNC(MsgWaitForMultipleObjectsEx);
GET_USER_FUNC(ReleaseDC);
GET_USER_FUNC(ScrollDC);
GET_USER_FUNC(SetCapture);
GET_USER_FUNC(SetFocus);
GET_USER_FUNC(SetLayeredWindowAttributes);
GET_USER_FUNC(SetParent);
GET_USER_FUNC(SetWindowRgn);
GET_USER_FUNC(SetWindowIcon);
GET_USER_FUNC(SetWindowStyle);
GET_USER_FUNC(SetWindowText);
GET_USER_FUNC(ShowWindow);
GET_USER_FUNC(SysCommand);
GET_USER_FUNC(UpdateLayeredWindow);
GET_USER_FUNC(WindowMessage);
GET_USER_FUNC(WindowPosChanging);
GET_USER_FUNC(WindowPosChanged);
GET_USER_FUNC(SystemParametersInfo);
GET_USER_FUNC(ThreadDetach);
#undef GET_USER_FUNC
}
driver.pCreateWindow = nodrv_CreateWindow;
prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
if (prev != &lazy_load_driver)
{
/* another thread beat us to it */
HeapFree( GetProcessHeap(), 0, driver );
driver = prev;
__wine_set_user_driver( &driver, WINE_GDI_DRIVER_VERSION );
}
else LdrAddRefDll( 0, graphics_driver );
__wine_set_display_driver( graphics_driver );
if (module) __wine_set_display_driver( module );
register_builtin_classes();
return driver;
return USER_Driver;
}
/* unload the graphics driver on process exit */
......@@ -639,3 +585,72 @@ static struct user_driver_funcs lazy_load_driver =
/* thread management */
nulldrv_ThreadDetach
};
void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version )
{
struct user_driver_funcs *driver, *prev;
if (version != WINE_GDI_DRIVER_VERSION)
{
ERR( "version mismatch, driver wants %u but user32 has %u\n", version, WINE_GDI_DRIVER_VERSION );
return;
}
driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver) );
*driver = *funcs;
#define SET_USER_FUNC(name) \
do { if (!driver->p##name) driver->p##name = nulldrv_##name; } while(0)
SET_USER_FUNC(ActivateKeyboardLayout);
SET_USER_FUNC(Beep);
SET_USER_FUNC(GetKeyNameText);
SET_USER_FUNC(GetKeyboardLayoutList);
SET_USER_FUNC(MapVirtualKeyEx);
SET_USER_FUNC(RegisterHotKey);
SET_USER_FUNC(ToUnicodeEx);
SET_USER_FUNC(UnregisterHotKey);
SET_USER_FUNC(VkKeyScanEx);
SET_USER_FUNC(DestroyCursorIcon);
SET_USER_FUNC(SetCursor);
SET_USER_FUNC(GetCursorPos);
SET_USER_FUNC(SetCursorPos);
SET_USER_FUNC(ClipCursor);
SET_USER_FUNC(UpdateClipboard);
SET_USER_FUNC(ChangeDisplaySettingsEx);
SET_USER_FUNC(EnumDisplayMonitors);
SET_USER_FUNC(EnumDisplaySettingsEx);
SET_USER_FUNC(GetMonitorInfo);
SET_USER_FUNC(CreateDesktopWindow);
SET_USER_FUNC(CreateWindow);
SET_USER_FUNC(DestroyWindow);
SET_USER_FUNC(FlashWindowEx);
SET_USER_FUNC(GetDC);
SET_USER_FUNC(MsgWaitForMultipleObjectsEx);
SET_USER_FUNC(ReleaseDC);
SET_USER_FUNC(ScrollDC);
SET_USER_FUNC(SetCapture);
SET_USER_FUNC(SetFocus);
SET_USER_FUNC(SetLayeredWindowAttributes);
SET_USER_FUNC(SetParent);
SET_USER_FUNC(SetWindowRgn);
SET_USER_FUNC(SetWindowIcon);
SET_USER_FUNC(SetWindowStyle);
SET_USER_FUNC(SetWindowText);
SET_USER_FUNC(ShowWindow);
SET_USER_FUNC(SysCommand);
SET_USER_FUNC(UpdateLayeredWindow);
SET_USER_FUNC(WindowMessage);
SET_USER_FUNC(WindowPosChanging);
SET_USER_FUNC(WindowPosChanged);
SET_USER_FUNC(SystemParametersInfo);
SET_USER_FUNC(ThreadDetach);
#undef SET_USER_FUNC
prev = InterlockedCompareExchangePointer( (void **)&USER_Driver, driver, &lazy_load_driver );
if (prev != &lazy_load_driver)
{
/* another thread beat us to it */
HeapFree( GetProcessHeap(), 0, driver );
}
}
......@@ -838,3 +838,4 @@
#
@ cdecl __wine_send_input(long ptr ptr)
@ cdecl __wine_set_pixel_format(long long)
@ cdecl __wine_set_user_driver(ptr long)
......@@ -80,6 +80,33 @@ extern int ioctl_set_cursor( int id, int width, int height,
* USER driver
*/
extern INT CDECL ANDROID_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) DECLSPEC_HIDDEN;
extern UINT CDECL ANDROID_MapVirtualKeyEx( UINT code, UINT maptype, HKL hkl ) DECLSPEC_HIDDEN;
extern SHORT CDECL ANDROID_VkKeyScanEx( WCHAR ch, HKL hkl ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
extern BOOL CDECL ANDROID_CreateWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_DestroyWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern DWORD CDECL ANDROID_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout,
DWORD mask, DWORD flags ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha,
DWORD flags ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_SetParent( HWND hwnd, HWND parent, HWND old_parent ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_SetCapture( HWND hwnd, UINT flags ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) DECLSPEC_HIDDEN;
extern UINT CDECL ANDROID_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) DECLSPEC_HIDDEN;
extern BOOL CDECL ANDROID_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect ) DECLSPEC_HIDDEN;
extern LRESULT CDECL ANDROID_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) DECLSPEC_HIDDEN;
extern BOOL CDECL ANDROID_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect,
RECT *visible_rect, struct window_surface **surface ) DECLSPEC_HIDDEN;
extern void CDECL ANDROID_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect,
const RECT *visible_rect, const RECT *valid_rects,
struct window_surface *surface ) DECLSPEC_HIDDEN;
extern unsigned int screen_width DECLSPEC_HIDDEN;
extern unsigned int screen_height DECLSPEC_HIDDEN;
extern RECT virtual_screen_rect DECLSPEC_HIDDEN;
......
......@@ -58,7 +58,7 @@ typedef struct
struct gdi_physdev dev;
} ANDROID_PDEVICE;
static const struct gdi_dc_funcs android_drv_funcs;
static const struct user_driver_funcs android_drv_funcs;
/******************************************************************************
......@@ -158,7 +158,7 @@ static BOOL CDECL ANDROID_CreateDC( PHYSDEV *pdev, LPCWSTR device, LPCWSTR outpu
if (!physdev) return FALSE;
push_dc_driver( pdev, &physdev->dev, &android_drv_funcs );
push_dc_driver( pdev, &physdev->dev, &android_drv_funcs.dc_funcs );
return TRUE;
}
......@@ -172,7 +172,7 @@ static BOOL CDECL ANDROID_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
if (!physdev) return FALSE;
push_dc_driver( pdev, &physdev->dev, &android_drv_funcs );
push_dc_driver( pdev, &physdev->dev, &android_drv_funcs.dc_funcs );
return TRUE;
}
......@@ -281,102 +281,35 @@ static struct opengl_funcs * CDECL ANDROID_wine_get_wgl_driver( PHYSDEV dev, UIN
}
static const struct gdi_dc_funcs android_drv_funcs =
static const struct user_driver_funcs android_drv_funcs =
{
NULL, /* pAbortDoc */
NULL, /* pAbortPath */
NULL, /* pAlphaBlend */
NULL, /* pAngleArc */
NULL, /* pArc */
NULL, /* pArcTo */
NULL, /* pBeginPath */
NULL, /* pBlendImage */
NULL, /* pChord */
NULL, /* pCloseFigure */
ANDROID_CreateCompatibleDC, /* pCreateCompatibleDC */
ANDROID_CreateDC, /* pCreateDC */
ANDROID_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
NULL, /* pEndPath */
NULL, /* pEnumFonts */
NULL, /* pExtEscape */
NULL, /* pExtFloodFill */
NULL, /* pExtTextOut */
NULL, /* pFillPath */
NULL, /* pFillRgn */
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
NULL, /* pGetCharWidth */
NULL, /* pGetCharWidthInfo */
NULL, /* pGetDeviceCaps */
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */
NULL, /* pGetICMProfile */
NULL, /* pGetImage */
NULL, /* pGetKerningPairs */
NULL, /* pGetNearestColor */
NULL, /* pGetOutlineTextMetrics */
NULL, /* pGetPixel */
NULL, /* pGetSystemPaletteEntries */
NULL, /* pGetTextCharsetInfo */
NULL, /* pGetTextExtentExPoint */
NULL, /* pGetTextExtentExPointI */
NULL, /* pGetTextFace */
NULL, /* pGetTextMetrics */
NULL, /* pGradientFill */
NULL, /* pInvertRgn */
NULL, /* pLineTo */
NULL, /* pMoveTo */
NULL, /* pPaintRgn */
NULL, /* pPatBlt */
NULL, /* pPie */
NULL, /* pPolyBezier */
NULL, /* pPolyBezierTo */
NULL, /* pPolyDraw */
NULL, /* pPolyPolygon */
NULL, /* pPolyPolyline */
NULL, /* pPolylineTo */
NULL, /* pPutImage */
NULL, /* pRealizeDefaultPalette */
NULL, /* pRealizePalette */
NULL, /* pRectangle */
NULL, /* pResetDC */
NULL, /* pRoundRect */
NULL, /* pSelectBitmap */
NULL, /* pSelectBrush */
NULL, /* pSelectFont */
NULL, /* pSelectPen */
NULL, /* pSetBkColor */
NULL, /* pSetBoundsRect */
NULL, /* pSetDCBrushColor */
NULL, /* pSetDCPenColor */
NULL, /* pSetDIBitsToDevice */
NULL, /* pSetDeviceClipping */
NULL, /* pSetDeviceGammaRamp */
NULL, /* pSetPixel */
NULL, /* pSetTextColor */
NULL, /* pStartDoc */
NULL, /* pStartPage */
NULL, /* pStretchBlt */
NULL, /* pStretchDIBits */
NULL, /* pStrokeAndFillPath */
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
ANDROID_wine_get_wgl_driver, /* wine_get_wgl_driver */
NULL, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
.dc_funcs.pCreateCompatibleDC = ANDROID_CreateCompatibleDC,
.dc_funcs.pCreateDC = ANDROID_CreateDC,
.dc_funcs.pDeleteDC = ANDROID_DeleteDC,
.dc_funcs.wine_get_wgl_driver = ANDROID_wine_get_wgl_driver,
.dc_funcs.priority = GDI_PRIORITY_GRAPHICS_DRV,
.pGetKeyNameText = ANDROID_GetKeyNameText,
.pMapVirtualKeyEx = ANDROID_MapVirtualKeyEx,
.pVkKeyScanEx = ANDROID_VkKeyScanEx,
.pSetCursor = ANDROID_SetCursor,
.pChangeDisplaySettingsEx = ANDROID_ChangeDisplaySettingsEx,
.pEnumDisplayMonitors = ANDROID_EnumDisplayMonitors,
.pEnumDisplaySettingsEx = ANDROID_EnumDisplaySettingsEx,
.pGetMonitorInfo = ANDROID_GetMonitorInfo,
.pCreateWindow = ANDROID_CreateWindow,
.pDestroyWindow = ANDROID_DestroyWindow,
.pMsgWaitForMultipleObjectsEx = ANDROID_MsgWaitForMultipleObjectsEx,
.pSetCapture = ANDROID_SetCapture,
.pSetLayeredWindowAttributes = ANDROID_SetLayeredWindowAttributes,
.pSetParent = ANDROID_SetParent,
.pSetWindowRgn = ANDROID_SetWindowRgn,
.pSetWindowStyle = ANDROID_SetWindowStyle,
.pShowWindow = ANDROID_ShowWindow,
.pUpdateLayeredWindow = ANDROID_UpdateLayeredWindow,
.pWindowMessage = ANDROID_WindowMessage,
.pWindowPosChanging = ANDROID_WindowPosChanging,
.pWindowPosChanged = ANDROID_WindowPosChanged,
};
......@@ -390,7 +323,7 @@ const struct gdi_dc_funcs * CDECL ANDROID_get_gdi_driver( unsigned int version )
ERR( "version mismatch, gdi32 wants %u but wineandroid has %u\n", version, WINE_GDI_DRIVER_VERSION );
return NULL;
}
return &android_drv_funcs;
return &android_drv_funcs.dc_funcs;
}
......@@ -620,6 +553,7 @@ static BOOL process_attach(void)
__asm__( "mov %0,%%fs" :: "r" (old_fs) );
#endif
}
__wine_set_user_driver( &android_drv_funcs, WINE_GDI_DRIVER_VERSION );
return TRUE;
}
......
......@@ -2,30 +2,6 @@
@ cdecl wine_get_gdi_driver(long) ANDROID_get_gdi_driver
# USER driver
@ cdecl GetKeyNameText(long ptr long) ANDROID_GetKeyNameText
@ cdecl MapVirtualKeyEx(long long long) ANDROID_MapVirtualKeyEx
@ cdecl VkKeyScanEx(long long) ANDROID_VkKeyScanEx
@ cdecl SetCursor(long) ANDROID_SetCursor
@ cdecl ChangeDisplaySettingsEx(ptr ptr long long long) ANDROID_ChangeDisplaySettingsEx
@ cdecl EnumDisplayMonitors(long ptr ptr long) ANDROID_EnumDisplayMonitors
@ cdecl EnumDisplaySettingsEx(ptr long ptr long) ANDROID_EnumDisplaySettingsEx
@ cdecl GetMonitorInfo(long ptr) ANDROID_GetMonitorInfo
@ cdecl CreateWindow(long) ANDROID_CreateWindow
@ cdecl DestroyWindow(long) ANDROID_DestroyWindow
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) ANDROID_MsgWaitForMultipleObjectsEx
@ cdecl SetCapture(long long) ANDROID_SetCapture
@ cdecl SetLayeredWindowAttributes(long long long long) ANDROID_SetLayeredWindowAttributes
@ cdecl SetParent(long long long) ANDROID_SetParent
@ cdecl SetWindowRgn(long long long) ANDROID_SetWindowRgn
@ cdecl SetWindowStyle(ptr long ptr) ANDROID_SetWindowStyle
@ cdecl ShowWindow(long long ptr long) ANDROID_ShowWindow
@ cdecl UpdateLayeredWindow(long ptr ptr) ANDROID_UpdateLayeredWindow
@ cdecl WindowMessage(long long long long) ANDROID_WindowMessage
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) ANDROID_WindowPosChanging
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) ANDROID_WindowPosChanged
# Desktop
@ cdecl wine_create_desktop(long long) ANDROID_create_desktop
......
......@@ -57,7 +57,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
static CRITICAL_SECTION device_data_section = { &critsect_debug, -1, 0, 0, 0, 0 };
static const struct gdi_dc_funcs macdrv_funcs;
static const struct user_driver_funcs macdrv_funcs;
/***********************************************************************
* compute_desktop_rect
......@@ -184,7 +184,7 @@ static BOOL CDECL macdrv_CreateDC(PHYSDEV *pdev, LPCWSTR device, LPCWSTR output,
if (!physDev) return FALSE;
push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
push_dc_driver(pdev, &physDev->dev, &macdrv_funcs.dc_funcs);
return TRUE;
}
......@@ -201,7 +201,7 @@ static BOOL CDECL macdrv_CreateCompatibleDC(PHYSDEV orig, PHYSDEV *pdev)
if (!physDev) return FALSE;
push_dc_driver(pdev, &physDev->dev, &macdrv_funcs);
push_dc_driver(pdev, &physDev->dev, &macdrv_funcs.dc_funcs);
return TRUE;
}
......@@ -260,105 +260,63 @@ static INT CDECL macdrv_GetDeviceCaps(PHYSDEV dev, INT cap)
}
static const struct gdi_dc_funcs macdrv_funcs =
static const struct user_driver_funcs macdrv_funcs =
{
NULL, /* pAbortDoc */
NULL, /* pAbortPath */
NULL, /* pAlphaBlend */
NULL, /* pAngleArc */
NULL, /* pArc */
NULL, /* pArcTo */
NULL, /* pBeginPath */
NULL, /* pBlendImage */
NULL, /* pChord */
NULL, /* pCloseFigure */
macdrv_CreateCompatibleDC, /* pCreateCompatibleDC */
macdrv_CreateDC, /* pCreateDC */
macdrv_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
NULL, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
NULL, /* pEndPath */
NULL, /* pEnumFonts */
NULL, /* pExtEscape */
NULL, /* pExtFloodFill */
NULL, /* pExtTextOut */
NULL, /* pFillPath */
NULL, /* pFillRgn */
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
NULL, /* pGetCharWidth */
NULL, /* pGetCharWidthInfo */
macdrv_GetDeviceCaps, /* pGetDeviceCaps */
macdrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */
NULL, /* pGetICMProfile */
NULL, /* pGetImage */
NULL, /* pGetKerningPairs */
NULL, /* pGetNearestColor */
NULL, /* pGetOutlineTextMetrics */
NULL, /* pGetPixel */
NULL, /* pGetSystemPaletteEntries */
NULL, /* pGetTextCharsetInfo */
NULL, /* pGetTextExtentExPoint */
NULL, /* pGetTextExtentExPointI */
NULL, /* pGetTextFace */
NULL, /* pGetTextMetrics */
NULL, /* pGradientFill */
NULL, /* pInvertRgn */
NULL, /* pLineTo */
NULL, /* pMoveTo */
NULL, /* pPaintRgn */
NULL, /* pPatBlt */
NULL, /* pPie */
NULL, /* pPolyBezier */
NULL, /* pPolyBezierTo */
NULL, /* pPolyDraw */
NULL, /* pPolyPolygon */
NULL, /* pPolyPolyline */
NULL, /* pPolylineTo */
NULL, /* pPutImage */
NULL, /* pRealizeDefaultPalette */
NULL, /* pRealizePalette */
NULL, /* pRectangle */
NULL, /* pResetDC */
NULL, /* pRoundRect */
NULL, /* pSelectBitmap */
NULL, /* pSelectBrush */
NULL, /* pSelectFont */
NULL, /* pSelectPen */
NULL, /* pSetBkColor */
NULL, /* pSetBoundsRect */
NULL, /* pSetDCBrushColor */
NULL, /* pSetDCPenColor */
NULL, /* pSetDIBitsToDevice */
NULL, /* pSetDeviceClipping */
macdrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */
NULL, /* pSetPixel */
NULL, /* pSetTextColor */
NULL, /* pStartDoc */
NULL, /* pStartPage */
NULL, /* pStretchBlt */
NULL, /* pStretchDIBits */
NULL, /* pStrokeAndFillPath */
NULL, /* pStrokePath */
NULL, /* pUnrealizePalette */
NULL, /* pD3DKMTCheckVidPnExclusiveOwnership */
NULL, /* pD3DKMTSetVidPnSourceOwner */
macdrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
macdrv_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
.dc_funcs.pCreateCompatibleDC = macdrv_CreateCompatibleDC,
.dc_funcs.pCreateDC = macdrv_CreateDC,
.dc_funcs.pDeleteDC = macdrv_DeleteDC,
.dc_funcs.pGetDeviceCaps = macdrv_GetDeviceCaps,
.dc_funcs.pGetDeviceGammaRamp = macdrv_GetDeviceGammaRamp,
.dc_funcs.pSetDeviceGammaRamp = macdrv_SetDeviceGammaRamp,
.dc_funcs.wine_get_wgl_driver = macdrv_wine_get_wgl_driver,
.dc_funcs.wine_get_vulkan_driver = macdrv_wine_get_vulkan_driver,
.dc_funcs.priority = GDI_PRIORITY_GRAPHICS_DRV,
.pActivateKeyboardLayout = macdrv_ActivateKeyboardLayout,
.pBeep = macdrv_Beep,
.pChangeDisplaySettingsEx = macdrv_ChangeDisplaySettingsEx,
.pClipCursor = macdrv_ClipCursor,
.pCreateDesktopWindow = macdrv_CreateDesktopWindow,
.pCreateWindow = macdrv_CreateWindow,
.pDestroyCursorIcon = macdrv_DestroyCursorIcon,
.pDestroyWindow = macdrv_DestroyWindow,
.pEnumDisplaySettingsEx = macdrv_EnumDisplaySettingsEx,
.pGetCursorPos = macdrv_GetCursorPos,
.pGetKeyboardLayoutList = macdrv_GetKeyboardLayoutList,
.pGetKeyNameText = macdrv_GetKeyNameText,
.pMapVirtualKeyEx = macdrv_MapVirtualKeyEx,
.pMsgWaitForMultipleObjectsEx = macdrv_MsgWaitForMultipleObjectsEx,
.pRegisterHotKey = macdrv_RegisterHotKey,
.pSetCapture = macdrv_SetCapture,
.pSetCursor = macdrv_SetCursor,
.pSetCursorPos = macdrv_SetCursorPos,
.pSetFocus = macdrv_SetFocus,
.pSetLayeredWindowAttributes = macdrv_SetLayeredWindowAttributes,
.pSetParent = macdrv_SetParent,
.pSetWindowRgn = macdrv_SetWindowRgn,
.pSetWindowStyle = macdrv_SetWindowStyle,
.pSetWindowText = macdrv_SetWindowText,
.pShowWindow = macdrv_ShowWindow,
.pSysCommand =macdrv_SysCommand,
.pSystemParametersInfo = macdrv_SystemParametersInfo,
.pThreadDetach = macdrv_ThreadDetach,
.pToUnicodeEx = macdrv_ToUnicodeEx,
.pUnregisterHotKey = macdrv_UnregisterHotKey,
.pUpdateClipboard = macdrv_UpdateClipboard,
.pUpdateLayeredWindow = macdrv_UpdateLayeredWindow,
.pVkKeyScanEx = macdrv_VkKeyScanEx,
.pWindowMessage = macdrv_WindowMessage,
.pWindowPosChanged = macdrv_WindowPosChanged,
.pWindowPosChanging = macdrv_WindowPosChanging,
};
void init_user_driver(void)
{
__wine_set_user_driver( &macdrv_funcs, WINE_GDI_DRIVER_VERSION );
}
/******************************************************************************
* macdrv_get_gdi_driver
*/
......@@ -369,5 +327,5 @@ const struct gdi_dc_funcs * CDECL macdrv_get_gdi_driver(unsigned int version)
ERR("version mismatch, gdi32 wants %u but winemac has %u\n", version, WINE_GDI_DRIVER_VERSION);
return NULL;
}
return &macdrv_funcs;
return &macdrv_funcs.dc_funcs;
}
......@@ -124,6 +124,58 @@ static inline RECT rect_from_cgrect(CGRect cgrect)
}
extern BOOL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags) DECLSPEC_HIDDEN;
extern void CDECL macdrv_Beep(void) DECLSPEC_HIDDEN;
extern LONG CDECL macdrv_ChangeDisplaySettingsEx(LPCWSTR devname, LPDEVMODEW devmode,
HWND hwnd, DWORD flags, LPVOID lpvoid) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode,
LPDEVMODEW devmode, DWORD flags) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_GetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_SetDeviceGammaRamp(PHYSDEV dev, LPVOID ramp) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_ClipCursor(LPCRECT clip) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_CreateDesktopWindow(HWND hwnd) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_CreateWindow(HWND hwnd) DECLSPEC_HIDDEN;
extern void CDECL macdrv_DestroyWindow(HWND hwnd) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetFocus(HWND hwnd) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetLayeredWindowAttributes(HWND hwnd, COLORREF key, BYTE alpha,
DWORD flags) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetParent(HWND hwnd, HWND parent, HWND old_parent) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetWindowRgn(HWND hwnd, HRGN hrgn, BOOL redraw) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetWindowStyle(HWND hwnd, INT offset, STYLESTRUCT *style) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetWindowText(HWND hwnd, LPCWSTR text) DECLSPEC_HIDDEN;
extern UINT CDECL macdrv_ShowWindow(HWND hwnd, INT cmd, RECT *rect, UINT swp) DECLSPEC_HIDDEN;
extern LRESULT CDECL macdrv_SysCommand(HWND hwnd, WPARAM wparam, LPARAM lparam) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_UpdateLayeredWindow(HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect) DECLSPEC_HIDDEN;
extern LRESULT CDECL macdrv_WindowMessage(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_WindowPosChanging(HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect,
RECT *visible_rect, struct window_surface **surface) DECLSPEC_HIDDEN;
extern void CDECL macdrv_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect,
const RECT *visible_rect, const RECT *valid_rects,
struct window_surface *surface) DECLSPEC_HIDDEN;
extern void CDECL macdrv_DestroyCursorIcon(HCURSOR cursor) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_ClipCursor(LPCRECT clip) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_GetCursorPos(LPPOINT pos) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetCapture(HWND hwnd, UINT flags) DECLSPEC_HIDDEN;
extern void CDECL macdrv_SetCursor(HCURSOR cursor) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_SetCursorPos(INT x, INT y) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_RegisterHotKey(HWND hwnd, UINT mod_flags, UINT vkey) DECLSPEC_HIDDEN;
extern void CDECL macdrv_UnregisterHotKey(HWND hwnd, UINT modifiers, UINT vkey) DECLSPEC_HIDDEN;
extern SHORT CDECL macdrv_VkKeyScanEx(WCHAR wChar, HKL hkl) DECLSPEC_HIDDEN;
extern UINT CDECL macdrv_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl) DECLSPEC_HIDDEN;
extern INT CDECL macdrv_ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
LPWSTR bufW, int bufW_size, UINT flags, HKL hkl) DECLSPEC_HIDDEN;
extern UINT CDECL macdrv_GetKeyboardLayoutList(INT size, HKL *list) DECLSPEC_HIDDEN;
extern INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size) DECLSPEC_HIDDEN;
extern BOOL CDECL macdrv_SystemParametersInfo(UINT action, UINT int_param, void *ptr_param,
UINT flags) DECLSPEC_HIDDEN;
extern DWORD CDECL macdrv_MsgWaitForMultipleObjectsEx(DWORD count, const HANDLE *handles,
DWORD timeout, DWORD mask, DWORD flags) DECLSPEC_HIDDEN;
extern void CDECL macdrv_ThreadDetach(void) DECLSPEC_HIDDEN;
/* macdrv private window data */
struct macdrv_win_data
{
......@@ -225,6 +277,7 @@ extern CGImageRef create_cgimage_from_icon_bitmaps(HDC hdc, HANDLE icon, HBITMAP
extern void check_retina_status(void) DECLSPEC_HIDDEN;
extern void macdrv_init_display_devices(BOOL force) DECLSPEC_HIDDEN;
extern void init_user_driver(void) DECLSPEC_HIDDEN;
/**************************************************************************
* Mac IME driver
......
......@@ -300,6 +300,7 @@ static BOOL process_attach(void)
}
macdrv_init_display_devices(FALSE);
init_user_driver();
return TRUE;
}
......
......@@ -2,45 +2,6 @@
@ cdecl wine_get_gdi_driver(long) macdrv_get_gdi_driver
# USER driver
@ cdecl ActivateKeyboardLayout(long long) macdrv_ActivateKeyboardLayout
@ cdecl Beep() macdrv_Beep
@ cdecl ChangeDisplaySettingsEx(ptr ptr long long long) macdrv_ChangeDisplaySettingsEx
@ cdecl ClipCursor(ptr) macdrv_ClipCursor
@ cdecl CreateDesktopWindow(long) macdrv_CreateDesktopWindow
@ cdecl CreateWindow(long) macdrv_CreateWindow
@ cdecl DestroyCursorIcon(long) macdrv_DestroyCursorIcon
@ cdecl DestroyWindow(long) macdrv_DestroyWindow
@ cdecl EnumDisplaySettingsEx(ptr long ptr long) macdrv_EnumDisplaySettingsEx
@ cdecl GetCursorPos(ptr) macdrv_GetCursorPos
@ cdecl GetKeyboardLayoutList(long ptr) macdrv_GetKeyboardLayoutList
@ cdecl GetKeyNameText(long ptr long) macdrv_GetKeyNameText
@ cdecl MapVirtualKeyEx(long long long) macdrv_MapVirtualKeyEx
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) macdrv_MsgWaitForMultipleObjectsEx
@ cdecl RegisterHotKey(long long long) macdrv_RegisterHotKey
@ cdecl SetCapture(long long) macdrv_SetCapture
@ cdecl SetCursor(long) macdrv_SetCursor
@ cdecl SetCursorPos(long long) macdrv_SetCursorPos
@ cdecl SetFocus(long) macdrv_SetFocus
@ cdecl SetLayeredWindowAttributes(long long long long) macdrv_SetLayeredWindowAttributes
@ cdecl SetParent(long long long) macdrv_SetParent
@ cdecl SetWindowRgn(long long long) macdrv_SetWindowRgn
@ cdecl SetWindowStyle(ptr long ptr) macdrv_SetWindowStyle
@ cdecl SetWindowText(long wstr) macdrv_SetWindowText
@ cdecl ShowWindow(long long ptr long) macdrv_ShowWindow
@ cdecl SysCommand(long long long) macdrv_SysCommand
@ cdecl SystemParametersInfo(long long ptr long) macdrv_SystemParametersInfo
@ cdecl ThreadDetach() macdrv_ThreadDetach
@ cdecl ToUnicodeEx(long long ptr ptr long long long) macdrv_ToUnicodeEx
@ cdecl UnregisterHotKey(long long long) macdrv_UnregisterHotKey
@ cdecl UpdateClipboard() macdrv_UpdateClipboard
@ cdecl UpdateLayeredWindow(long ptr ptr) macdrv_UpdateLayeredWindow
@ cdecl VkKeyScanEx(long long) macdrv_VkKeyScanEx
@ cdecl WindowMessage(long long long long) macdrv_WindowMessage
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) macdrv_WindowPosChanged
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) macdrv_WindowPosChanging
# System tray
@ cdecl wine_notify_icon(long ptr)
......
......@@ -24,7 +24,6 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "rpc.h"
#include "winreg.h"
#include "cfgmgr32.h"
......
......@@ -37,8 +37,6 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "x11drv.h"
......
......@@ -39,7 +39,7 @@ static Pixmap stock_bitmap_pixmap; /* phys bitmap for the default stock bitmap
static INIT_ONCE init_once = INIT_ONCE_STATIC_INIT;
static const struct gdi_dc_funcs x11drv_funcs;
static const struct user_driver_funcs x11drv_funcs;
static const struct gdi_dc_funcs *xrender_funcs;
/**********************************************************************
......@@ -93,7 +93,7 @@ static BOOL CDECL X11DRV_CreateDC( PHYSDEV *pdev, LPCWSTR device, LPCWSTR output
physDev->color_shifts = &X11DRV_PALETTE_default_shifts;
physDev->dc_rect = get_virtual_screen_rect();
OffsetRect( &physDev->dc_rect, -physDev->dc_rect.left, -physDev->dc_rect.top );
push_dc_driver( pdev, &physDev->dev, &x11drv_funcs );
push_dc_driver( pdev, &physDev->dev, &x11drv_funcs.dc_funcs );
if (xrender_funcs && !xrender_funcs->pCreateDC( pdev, device, output, initData )) return FALSE;
return TRUE;
}
......@@ -110,7 +110,7 @@ static BOOL CDECL X11DRV_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
physDev->depth = 1;
SetRect( &physDev->dc_rect, 0, 0, 1, 1 );
push_dc_driver( pdev, &physDev->dev, &x11drv_funcs );
push_dc_driver( pdev, &physDev->dev, &x11drv_funcs.dc_funcs );
if (orig) return TRUE; /* we already went through Xrender if we have an orig device */
if (xrender_funcs && !xrender_funcs->pCreateCompatibleDC( NULL, pdev )) return FALSE;
return TRUE;
......@@ -340,105 +340,101 @@ static const struct vulkan_funcs * CDECL X11DRV_wine_get_vulkan_driver( PHYSDEV
}
static const struct gdi_dc_funcs x11drv_funcs =
static const struct user_driver_funcs x11drv_funcs =
{
NULL, /* pAbortDoc */
NULL, /* pAbortPath */
NULL, /* pAlphaBlend */
NULL, /* pAngleArc */
X11DRV_Arc, /* pArc */
NULL, /* pArcTo */
NULL, /* pBeginPath */
NULL, /* pBlendImage */
X11DRV_Chord, /* pChord */
NULL, /* pCloseFigure */
X11DRV_CreateCompatibleDC, /* pCreateCompatibleDC */
X11DRV_CreateDC, /* pCreateDC */
X11DRV_DeleteDC, /* pDeleteDC */
NULL, /* pDeleteObject */
X11DRV_Ellipse, /* pEllipse */
NULL, /* pEndDoc */
NULL, /* pEndPage */
NULL, /* pEndPath */
NULL, /* pEnumFonts */
X11DRV_ExtEscape, /* pExtEscape */
X11DRV_ExtFloodFill, /* pExtFloodFill */
NULL, /* pExtTextOut */
X11DRV_FillPath, /* pFillPath */
NULL, /* pFillRgn */
NULL, /* pFontIsLinked */
NULL, /* pFrameRgn */
NULL, /* pGetBoundsRect */
NULL, /* pGetCharABCWidths */
NULL, /* pGetCharABCWidthsI */
NULL, /* pGetCharWidth */
NULL, /* pGetCharWidthInfo */
X11DRV_GetDeviceCaps, /* pGetDeviceCaps */
X11DRV_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
NULL, /* pGetFontRealizationInfo */
NULL, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */
X11DRV_GetICMProfile, /* pGetICMProfile */
X11DRV_GetImage, /* pGetImage */
NULL, /* pGetKerningPairs */
X11DRV_GetNearestColor, /* pGetNearestColor */
NULL, /* pGetOutlineTextMetrics */
NULL, /* pGetPixel */
X11DRV_GetSystemPaletteEntries, /* pGetSystemPaletteEntries */
NULL, /* pGetTextCharsetInfo */
NULL, /* pGetTextExtentExPoint */
NULL, /* pGetTextExtentExPointI */
NULL, /* pGetTextFace */
NULL, /* pGetTextMetrics */
X11DRV_GradientFill, /* pGradientFill */
NULL, /* pInvertRgn */
X11DRV_LineTo, /* pLineTo */
NULL, /* pMoveTo */
X11DRV_PaintRgn, /* pPaintRgn */
X11DRV_PatBlt, /* pPatBlt */
X11DRV_Pie, /* pPie */
NULL, /* pPolyBezier */
NULL, /* pPolyBezierTo */
NULL, /* pPolyDraw */
X11DRV_PolyPolygon, /* pPolyPolygon */
X11DRV_PolyPolyline, /* pPolyPolyline */
NULL, /* pPolylineTo */
X11DRV_PutImage, /* pPutImage */
X11DRV_RealizeDefaultPalette, /* pRealizeDefaultPalette */
X11DRV_RealizePalette, /* pRealizePalette */
X11DRV_Rectangle, /* pRectangle */
NULL, /* pResetDC */
X11DRV_RoundRect, /* pRoundRect */
NULL, /* pSelectBitmap */
X11DRV_SelectBrush, /* pSelectBrush */
X11DRV_SelectFont, /* pSelectFont */
X11DRV_SelectPen, /* pSelectPen */
NULL, /* pSetBkColor */
X11DRV_SetBoundsRect, /* pSetBoundsRect */
X11DRV_SetDCBrushColor, /* pSetDCBrushColor */
X11DRV_SetDCPenColor, /* pSetDCPenColor */
NULL, /* pSetDIBitsToDevice */
X11DRV_SetDeviceClipping, /* pSetDeviceClipping */
X11DRV_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */
X11DRV_SetPixel, /* pSetPixel */
NULL, /* pSetTextColor */
NULL, /* pStartDoc */
NULL, /* pStartPage */
X11DRV_StretchBlt, /* pStretchBlt */
NULL, /* pStretchDIBits */
X11DRV_StrokeAndFillPath, /* pStrokeAndFillPath */
X11DRV_StrokePath, /* pStrokePath */
X11DRV_UnrealizePalette, /* pUnrealizePalette */
X11DRV_D3DKMTCheckVidPnExclusiveOwnership, /* pD3DKMTCheckVidPnExclusiveOwnership */
X11DRV_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */
X11DRV_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
GDI_PRIORITY_GRAPHICS_DRV /* priority */
.dc_funcs.pArc = X11DRV_Arc,
.dc_funcs.pChord = X11DRV_Chord,
.dc_funcs.pCreateCompatibleDC = X11DRV_CreateCompatibleDC,
.dc_funcs.pCreateDC = X11DRV_CreateDC,
.dc_funcs.pDeleteDC = X11DRV_DeleteDC,
.dc_funcs.pEllipse = X11DRV_Ellipse,
.dc_funcs.pExtEscape = X11DRV_ExtEscape,
.dc_funcs.pExtFloodFill = X11DRV_ExtFloodFill,
.dc_funcs.pFillPath = X11DRV_FillPath,
.dc_funcs.pGetDeviceCaps = X11DRV_GetDeviceCaps,
.dc_funcs.pGetDeviceGammaRamp = X11DRV_GetDeviceGammaRamp,
.dc_funcs.pGetICMProfile = X11DRV_GetICMProfile,
.dc_funcs.pGetImage = X11DRV_GetImage,
.dc_funcs.pGetNearestColor = X11DRV_GetNearestColor,
.dc_funcs.pGetSystemPaletteEntries = X11DRV_GetSystemPaletteEntries,
.dc_funcs.pGradientFill = X11DRV_GradientFill,
.dc_funcs.pLineTo = X11DRV_LineTo,
.dc_funcs.pPaintRgn = X11DRV_PaintRgn,
.dc_funcs.pPatBlt = X11DRV_PatBlt,
.dc_funcs.pPie = X11DRV_Pie,
.dc_funcs.pPolyPolygon = X11DRV_PolyPolygon,
.dc_funcs.pPolyPolyline = X11DRV_PolyPolyline,
.dc_funcs.pPutImage = X11DRV_PutImage,
.dc_funcs.pRealizeDefaultPalette = X11DRV_RealizeDefaultPalette,
.dc_funcs.pRealizePalette = X11DRV_RealizePalette,
.dc_funcs.pRectangle = X11DRV_Rectangle,
.dc_funcs.pRoundRect = X11DRV_RoundRect,
.dc_funcs.pSelectBrush = X11DRV_SelectBrush,
.dc_funcs.pSelectFont = X11DRV_SelectFont,
.dc_funcs.pSelectPen = X11DRV_SelectPen,
.dc_funcs.pSetBoundsRect = X11DRV_SetBoundsRect,
.dc_funcs.pSetDCBrushColor = X11DRV_SetDCBrushColor,
.dc_funcs.pSetDCPenColor = X11DRV_SetDCPenColor,
.dc_funcs.pSetDeviceClipping = X11DRV_SetDeviceClipping,
.dc_funcs.pSetDeviceGammaRamp = X11DRV_SetDeviceGammaRamp,
.dc_funcs.pSetPixel = X11DRV_SetPixel,
.dc_funcs.pStretchBlt = X11DRV_StretchBlt,
.dc_funcs.pStrokeAndFillPath = X11DRV_StrokeAndFillPath,
.dc_funcs.pStrokePath = X11DRV_StrokePath,
.dc_funcs.pUnrealizePalette = X11DRV_UnrealizePalette,
.dc_funcs.pD3DKMTCheckVidPnExclusiveOwnership = X11DRV_D3DKMTCheckVidPnExclusiveOwnership,
.dc_funcs.pD3DKMTSetVidPnSourceOwner = X11DRV_D3DKMTSetVidPnSourceOwner,
.dc_funcs.wine_get_wgl_driver = X11DRV_wine_get_wgl_driver,
.dc_funcs.wine_get_vulkan_driver = X11DRV_wine_get_vulkan_driver,
.dc_funcs.priority = GDI_PRIORITY_GRAPHICS_DRV,
.pActivateKeyboardLayout = X11DRV_ActivateKeyboardLayout,
.pBeep = X11DRV_Beep,
.pGetKeyNameText = X11DRV_GetKeyNameText,
.pMapVirtualKeyEx = X11DRV_MapVirtualKeyEx,
.pToUnicodeEx = X11DRV_ToUnicodeEx,
.pVkKeyScanEx = X11DRV_VkKeyScanEx,
.pDestroyCursorIcon = X11DRV_DestroyCursorIcon,
.pSetCursor = X11DRV_SetCursor,
.pGetCursorPos = X11DRV_GetCursorPos,
.pSetCursorPos = X11DRV_SetCursorPos,
.pClipCursor = X11DRV_ClipCursor,
.pChangeDisplaySettingsEx = X11DRV_ChangeDisplaySettingsEx,
.pEnumDisplaySettingsEx = X11DRV_EnumDisplaySettingsEx,
.pCreateDesktopWindow = X11DRV_CreateDesktopWindow,
.pCreateWindow = X11DRV_CreateWindow,
.pDestroyWindow = X11DRV_DestroyWindow,
.pFlashWindowEx = X11DRV_FlashWindowEx,
.pGetDC = X11DRV_GetDC,
.pMsgWaitForMultipleObjectsEx = X11DRV_MsgWaitForMultipleObjectsEx,
.pReleaseDC = X11DRV_ReleaseDC,
.pScrollDC = X11DRV_ScrollDC,
.pSetCapture = X11DRV_SetCapture,
.pSetFocus = X11DRV_SetFocus,
.pSetLayeredWindowAttributes = X11DRV_SetLayeredWindowAttributes,
.pSetParent = X11DRV_SetParent,
.pSetWindowIcon = X11DRV_SetWindowIcon,
.pSetWindowRgn = X11DRV_SetWindowRgn,
.pSetWindowStyle = X11DRV_SetWindowStyle,
.pSetWindowText = X11DRV_SetWindowText,
.pShowWindow = X11DRV_ShowWindow,
.pSysCommand = X11DRV_SysCommand,
.pUpdateClipboard = X11DRV_UpdateClipboard,
.pUpdateLayeredWindow = X11DRV_UpdateLayeredWindow,
.pWindowMessage = X11DRV_WindowMessage,
.pWindowPosChanging = X11DRV_WindowPosChanging,
.pWindowPosChanged = X11DRV_WindowPosChanged,
.pSystemParametersInfo = X11DRV_SystemParametersInfo,
.pThreadDetach = X11DRV_ThreadDetach,
};
void init_user_driver(void)
{
__wine_set_user_driver( &x11drv_funcs, WINE_GDI_DRIVER_VERSION );
}
/******************************************************************************
* X11DRV_get_gdi_driver
*/
......@@ -449,5 +445,5 @@ const struct gdi_dc_funcs * CDECL X11DRV_get_gdi_driver( unsigned int version )
ERR( "version mismatch, gdi32 wants %u but winex11 has %u\n", version, WINE_GDI_DRIVER_VERSION );
return NULL;
}
return &x11drv_funcs;
return &x11drv_funcs.dc_funcs;
}
......@@ -2,47 +2,6 @@
@ cdecl wine_get_gdi_driver(long) X11DRV_get_gdi_driver
# USER driver
@ cdecl ActivateKeyboardLayout(long long) X11DRV_ActivateKeyboardLayout
@ cdecl Beep() X11DRV_Beep
@ cdecl GetKeyNameText(long ptr long) X11DRV_GetKeyNameText
@ cdecl MapVirtualKeyEx(long long long) X11DRV_MapVirtualKeyEx
@ cdecl ToUnicodeEx(long long ptr ptr long long long) X11DRV_ToUnicodeEx
@ cdecl VkKeyScanEx(long long) X11DRV_VkKeyScanEx
@ cdecl DestroyCursorIcon(long) X11DRV_DestroyCursorIcon
@ cdecl SetCursor(long) X11DRV_SetCursor
@ cdecl GetCursorPos(ptr) X11DRV_GetCursorPos
@ cdecl SetCursorPos(long long) X11DRV_SetCursorPos
@ cdecl ClipCursor(ptr) X11DRV_ClipCursor
@ cdecl ChangeDisplaySettingsEx(ptr ptr long long long) X11DRV_ChangeDisplaySettingsEx
@ cdecl EnumDisplaySettingsEx(ptr long ptr long) X11DRV_EnumDisplaySettingsEx
@ cdecl CreateDesktopWindow(long) X11DRV_CreateDesktopWindow
@ cdecl CreateWindow(long) X11DRV_CreateWindow
@ cdecl DestroyWindow(long) X11DRV_DestroyWindow
@ cdecl FlashWindowEx(ptr) X11DRV_FlashWindowEx
@ cdecl GetDC(long long long ptr ptr long) X11DRV_GetDC
@ cdecl MsgWaitForMultipleObjectsEx(long ptr long long long) X11DRV_MsgWaitForMultipleObjectsEx
@ cdecl ReleaseDC(long long) X11DRV_ReleaseDC
@ cdecl ScrollDC(long long long long) X11DRV_ScrollDC
@ cdecl SetCapture(long long) X11DRV_SetCapture
@ cdecl SetFocus(long) X11DRV_SetFocus
@ cdecl SetLayeredWindowAttributes(long long long long) X11DRV_SetLayeredWindowAttributes
@ cdecl SetParent(long long long) X11DRV_SetParent
@ cdecl SetWindowIcon(long long long) X11DRV_SetWindowIcon
@ cdecl SetWindowRgn(long long long) X11DRV_SetWindowRgn
@ cdecl SetWindowStyle(ptr long ptr) X11DRV_SetWindowStyle
@ cdecl SetWindowText(long wstr) X11DRV_SetWindowText
@ cdecl ShowWindow(long long ptr long) X11DRV_ShowWindow
@ cdecl SysCommand(long long long) X11DRV_SysCommand
@ cdecl UpdateClipboard() X11DRV_UpdateClipboard
@ cdecl UpdateLayeredWindow(long ptr ptr) X11DRV_UpdateLayeredWindow
@ cdecl WindowMessage(long long long long) X11DRV_WindowMessage
@ cdecl WindowPosChanging(long long long ptr ptr ptr ptr) X11DRV_WindowPosChanging
@ cdecl WindowPosChanged(long long long ptr ptr ptr ptr ptr) X11DRV_WindowPosChanged
@ cdecl SystemParametersInfo(long long ptr long) X11DRV_SystemParametersInfo
@ cdecl ThreadDetach() X11DRV_ThreadDetach
# WinTab32
@ cdecl AttachEventQueueToTablet(long) X11DRV_AttachEventQueueToTablet
@ cdecl GetCurrentPacket(ptr) X11DRV_GetCurrentPacket
......
......@@ -193,6 +193,55 @@ extern BOOL CDECL X11DRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_UnrealizePalette( HPALETTE hpal ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_ActivateKeyboardLayout( HKL hkl, UINT flags ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_Beep(void) DECLSPEC_HIDDEN;
extern INT CDECL X11DRV_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) DECLSPEC_HIDDEN;
extern UINT CDECL X11DRV_MapVirtualKeyEx( UINT code, UINT map_type, HKL hkl ) DECLSPEC_HIDDEN;
extern INT CDECL X11DRV_ToUnicodeEx( UINT virtKey, UINT scanCode, const BYTE *lpKeyState,
LPWSTR bufW, int bufW_size, UINT flags, HKL hkl ) DECLSPEC_HIDDEN;
extern SHORT CDECL X11DRV_VkKeyScanEx( WCHAR wChar, HKL hkl ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_DestroyCursorIcon( HCURSOR handle ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetCursor( HCURSOR handle ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_SetCursorPos( INT x, INT y ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_GetCursorPos( LPPOINT pos ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_ClipCursor( LPCRECT clip ) DECLSPEC_HIDDEN;
extern LONG CDECL X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode,
HWND hwnd, DWORD flags, LPVOID lpvoid ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode,
DWORD flags ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_CreateDesktopWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_CreateWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_DestroyWindow( HWND hwnd ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_FlashWindowEx( PFLASHWINFO pfinfo ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
const RECT *top_rect, DWORD flags ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_ReleaseDC( HWND hwnd, HDC hdc ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, HRGN update ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetCapture( HWND hwnd, UINT flags ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha,
DWORD flags ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_SetWindowText( HWND hwnd, LPCWSTR text ) DECLSPEC_HIDDEN;
extern UINT CDECL X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) DECLSPEC_HIDDEN;
extern LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_UpdateClipboard(void) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info,
const RECT *window_rect ) DECLSPEC_HIDDEN;
extern LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect, RECT *visible_rect,
struct window_surface **surface ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *rectWindow, const RECT *rectClient,
const RECT *visible_rect, const RECT *valid_rects,
struct window_surface *surface ) DECLSPEC_HIDDEN;
extern BOOL CDECL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param,
UINT flags ) DECLSPEC_HIDDEN;
extern void CDECL X11DRV_ThreadDetach(void) DECLSPEC_HIDDEN;
/* X11 driver internal functions */
extern void X11DRV_Xcursor_Init(void) DECLSPEC_HIDDEN;
......@@ -713,6 +762,7 @@ void X11DRV_Settings_Init(void) DECLSPEC_HIDDEN;
void X11DRV_XF86VM_Init(void) DECLSPEC_HIDDEN;
void X11DRV_XRandR_Init(void) DECLSPEC_HIDDEN;
void init_user_driver(void) DECLSPEC_HIDDEN;
/* X11 display device handler. Used to initialize display device registry data */
......
......@@ -632,6 +632,7 @@ static BOOL process_attach(void)
if (use_xim) use_xim = X11DRV_InitXIM( input_style );
X11DRV_DisplayDevices_Init(FALSE);
init_user_driver();
return TRUE;
}
......
......@@ -25,8 +25,6 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "wingdi.h"
#include "winnls.h"
#include "winternl.h"
#include "x11drv.h"
......
......@@ -289,6 +289,8 @@ struct user_driver_funcs
void (CDECL *pThreadDetach)(void);
};
extern void CDECL __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version );
/* the DC hook support is only exported on Win16, the 32-bit version is a Wine extension */
#define DCHC_INVALIDVISRGN 0x0001
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment