diff options
author | David Robillard <d@drobilla.net> | 2017-12-16 09:06:11 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2017-12-16 09:06:11 +0100 |
commit | d551d03a33c23010c63874ce41fe3c30781f3b75 (patch) | |
tree | c53e635b590a54209079b682eafcaf004cb9e3a0 /src | |
parent | 9e9cf2fbcafc4fe673e7bc65418b401671a4be88 (diff) | |
download | suil-d551d03a33c23010c63874ce41fe3c30781f3b75.tar.gz suil-d551d03a33c23010c63874ce41fe3c30781f3b75.tar.bz2 suil-d551d03a33c23010c63874ce41fe3c30781f3b75.zip |
Fix Mac deprecation warnings
Diffstat (limited to 'src')
-rw-r--r-- | src/cocoa_in_gtk2.mm | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/src/cocoa_in_gtk2.mm b/src/cocoa_in_gtk2.mm index 0d796fb..3ff87d0 100644 --- a/src/cocoa_in_gtk2.mm +++ b/src/cocoa_in_gtk2.mm @@ -1,5 +1,5 @@ /* - Copyright 2011-2015 David Robillard <http://drobilla.net> + Copyright 2011-2017 David Robillard <http://drobilla.net> Copyright 2014 Robin Gareus <robin@gareus.org> Permission to use, copy, modify, and/or distribute this software for any @@ -25,6 +25,19 @@ #include "lv2/lv2plug.in/ns/ext/options/options.h" #include "lv2/lv2plug.in/ns/ext/urid/urid.h" +#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12 +#define NSEventTypeFlagsChanged NSFlagsChanged +#define NSEventTypeLeftMouseDown NSLeftMouseDown +#define NSEventTypeLeftMouseDragged NSLeftMouseDragged +#define NSEventTypeLeftMouseUp NSLeftMouseUp +#define NSEventTypeMouseEntered NSMouseEntered +#define NSEventTypeMouseExited NSMouseExited +#define NSEventTypeMouseMoved NSMouseMoved +#define NSEventTypeRightMouseDown NSRightMouseDown +#define NSEventTypeRightMouseUp NSRightMouseUp +#define NSEventTypeScrollWheel NSScrollWheel +#endif + extern "C" { #define SUIL_TYPE_COCOA_WRAPPER (suil_cocoa_wrapper_get_type()) @@ -267,37 +280,37 @@ event_filter(GdkXEvent* xevent, GdkEvent* event, gpointer data) NSView* view = (NSView*)wrap->instance->ui_widget; if (view && nsevent) { switch([nsevent type]) { - case NSFlagsChanged: + case NSEventTypeFlagsChanged: [view flagsChanged:nsevent]; return GDK_FILTER_REMOVE; - case NSMouseEntered: + case NSEventTypeMouseEntered: [view mouseEntered:nsevent]; return GDK_FILTER_REMOVE; - case NSMouseExited: + case NSEventTypeMouseExited: [view mouseExited:nsevent]; return GDK_FILTER_REMOVE; /* Explicitly pass though mouse events. Needed for mouse-drags leaving the window, and mouse-up after that. */ - case NSMouseMoved: + case NSEventTypeMouseMoved: [view mouseMoved:nsevent]; break; - case NSLeftMouseDragged: + case NSEventTypeLeftMouseDragged: [view mouseDragged:nsevent]; break; - case NSLeftMouseDown: + case NSEventTypeLeftMouseDown: [view mouseDown:nsevent]; break; - case NSLeftMouseUp: + case NSEventTypeLeftMouseUp: [view mouseUp:nsevent]; break; - case NSRightMouseDown: + case NSEventTypeRightMouseDown: [view rightMouseDown:nsevent]; break; - case NSRightMouseUp: + case NSEventTypeRightMouseUp: [view rightMouseUp:nsevent]; break; - case NSScrollWheel: + case NSEventTypeScrollWheel: [view scrollWheel:nsevent]; break; default: |