From 8ecb682579e5a8236cddf151ec200f5ea07d3292 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 17 Mar 2020 18:43:41 +0100 Subject: Use clearer names for pointer events These old "notify" names are a smell from X11 which is a bit strange and inconsistent here, since nearly everything is a "notification" of sorts. I think the new names here are much more clear since they are consistent with the keyboard focus events. --- pugl/detail/mac.m | 6 +++--- pugl/detail/win.c | 6 +++--- pugl/detail/x11.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'pugl/detail') diff --git a/pugl/detail/mac.m b/pugl/detail/mac.m index 8a0f0c2..bd1fdcf 100644 --- a/pugl/detail/mac.m +++ b/pugl/detail/mac.m @@ -271,12 +271,12 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type) - (void) mouseEntered:(NSEvent*)event { - handleCrossing(self, event, PUGL_ENTER_NOTIFY); + handleCrossing(self, event, PUGL_POINTER_IN); } - (void) mouseExited:(NSEvent*)event { - handleCrossing(self, event, PUGL_LEAVE_NOTIFY); + handleCrossing(self, event, PUGL_POINTER_OUT); } - (void) mouseMoved:(NSEvent*)event @@ -284,7 +284,7 @@ handleCrossing(PuglWrapperView* view, NSEvent* event, const PuglEventType type) const NSPoint wloc = [self eventLocation:event]; const NSPoint rloc = [NSEvent mouseLocation]; const PuglEventMotion ev = { - PUGL_MOTION_NOTIFY, + PUGL_MOTION, 0, [event timestamp], wloc.x, diff --git a/pugl/detail/win.c b/pugl/detail/win.c index 7678607..4606d60 100644 --- a/pugl/detail/win.c +++ b/pugl/detail/win.c @@ -617,12 +617,12 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) tme.hwndTrack = view->impl->hwnd; TrackMouseEvent(&tme); - handleCrossing(view, PUGL_ENTER_NOTIFY, pt); + handleCrossing(view, PUGL_POINTER_IN, pt); view->impl->mouseTracked = true; } ClientToScreen(view->impl->hwnd, &pt); - event.motion.type = PUGL_MOTION_NOTIFY; + event.motion.type = PUGL_MOTION; event.motion.time = GetMessageTime() / 1e3; event.motion.x = GET_X_LPARAM(lParam); event.motion.y = GET_Y_LPARAM(lParam); @@ -634,7 +634,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam) case WM_MOUSELEAVE: GetCursorPos(&pt); ScreenToClient(view->impl->hwnd, &pt); - handleCrossing(view, PUGL_LEAVE_NOTIFY, pt); + handleCrossing(view, PUGL_POINTER_OUT, pt); view->impl->mouseTracked = false; break; case WM_LBUTTONDOWN: diff --git a/pugl/detail/x11.c b/pugl/detail/x11.c index 9613dfb..1511b7b 100644 --- a/pugl/detail/x11.c +++ b/pugl/detail/x11.c @@ -493,7 +493,7 @@ translateEvent(PuglView* view, XEvent xevent) event.expose.count = xevent.xexpose.count; break; case MotionNotify: - event.type = PUGL_MOTION_NOTIFY; + event.type = PUGL_MOTION; event.motion.time = xevent.xmotion.time / 1e3; event.motion.x = xevent.xmotion.x; event.motion.y = xevent.xmotion.y; @@ -552,8 +552,8 @@ translateEvent(PuglView* view, XEvent xevent) case EnterNotify: case LeaveNotify: event.type = ((xevent.type == EnterNotify) - ? PUGL_ENTER_NOTIFY - : PUGL_LEAVE_NOTIFY); + ? PUGL_POINTER_IN + : PUGL_POINTER_OUT); event.crossing.time = xevent.xcrossing.time / 1e3; event.crossing.x = xevent.xcrossing.x; event.crossing.y = xevent.xcrossing.y; -- cgit v1.2.1