From dc6f0e64613aa8eb1e7551e6129e467cac72ce36 Mon Sep 17 00:00:00 2001 From: kanato Date: Thu, 5 Feb 2009 04:36:17 +0000 Subject: [PATCH] Added GetMouseEventLocation Carbon wrapper function. --- .../MacOS/CarbonBindings/CarbonAPI.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs b/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs index c4061763..0b28a31d 100644 --- a/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs +++ b/Source/OpenTK/Platform/MacOS/CarbonBindings/CarbonAPI.cs @@ -617,6 +617,25 @@ namespace OpenTK.Platform.MacOS.Carbon return result; } + } + static internal OSStatus GetEventMouseLocation(IntPtr inEvent, out HIPoint pt) + { + HIPoint point; + + unsafe + { + HIPoint* parm = &point; + + OSStatus result = API.GetEventParameter(inEvent, + EventParamName.MouseLocation, EventParamType.typeHIPoint, IntPtr.Zero, + (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(HIPoint)), IntPtr.Zero, + (IntPtr)parm); + + pt = point; + + return result; + } + } static internal MacOSKeyModifiers GetEventKeyModifiers(IntPtr inEvent) { @@ -676,6 +695,7 @@ namespace OpenTK.Platform.MacOS.Carbon internal static void InstallApplicationEventHandler(IntPtr uppHandlerProc, EventTypeSpec[] eventTypes, IntPtr userData, IntPtr handlerRef) { + OSStatus error = _InstallEventHandler(GetApplicationEventTarget(), uppHandlerProc, eventTypes.Length, eventTypes, userData, handlerRef);