Commit 38f7a4d5 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Implement GetCursorPos().

parent b79d9553
......@@ -815,3 +815,20 @@ void macdrv_set_cursor(CFStringRef name, CFArrayRef frames)
}
}
}
/***********************************************************************
* macdrv_get_cursor_position
*
* Obtains the current cursor position. Returns zero on failure,
* non-zero on success.
*/
int macdrv_get_cursor_position(CGPoint *pos)
{
OnMainThread(^{
NSPoint location = [NSEvent mouseLocation];
location = [NSApp flippedMouseLocation:location];
*pos = NSPointToCGPoint(location);
});
return TRUE;
}
......@@ -120,6 +120,7 @@ extern void macdrv_beep(void) DECLSPEC_HIDDEN;
/* cursor */
extern void macdrv_set_cursor(CFStringRef name, CFArrayRef frames) DECLSPEC_HIDDEN;
extern int macdrv_get_cursor_position(CGPoint *pos) DECLSPEC_HIDDEN;
/* display */
......
......@@ -736,6 +736,25 @@ void CDECL macdrv_DestroyCursorIcon(HCURSOR cursor)
/***********************************************************************
* GetCursorPos (MACDRV.@)
*/
BOOL CDECL macdrv_GetCursorPos(LPPOINT pos)
{
CGPoint pt;
BOOL ret;
ret = macdrv_get_cursor_position(&pt);
if (ret)
{
TRACE("pointer at (%g,%g) server pos %d,%d\n", pt.x, pt.y, pos->x, pos->y);
pos->x = pt.x;
pos->y = pt.y;
}
return ret;
}
/***********************************************************************
* SetCursor (MACDRV.@)
*/
void CDECL macdrv_SetCursor(HCURSOR cursor)
......
......@@ -13,6 +13,7 @@
@ cdecl DestroyWindow(long) macdrv_DestroyWindow
@ cdecl EnumDisplayMonitors(long ptr ptr long) macdrv_EnumDisplayMonitors
@ cdecl EnumDisplaySettingsEx(ptr long ptr long) macdrv_EnumDisplaySettingsEx
@ cdecl GetCursorPos(ptr) macdrv_GetCursorPos
@ cdecl GetKeyboardLayout(long) macdrv_GetKeyboardLayout
@ cdecl GetKeyboardLayoutName(ptr) macdrv_GetKeyboardLayoutName
@ cdecl GetKeyNameText(long ptr long) macdrv_GetKeyNameText
......
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