/* Debugging category */
#include <gst/gstinfo.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
+#define NSEventTypeMouseMoved NSMouseMoved
+#define NSEventTypeLeftMouseDown NSLeftMouseDown
+#define NSEventTypeLeftMouseUp NSLeftMouseUp
+#define NSEventTypeRightMouseDown NSRightMouseDown
+#define NSEventTypeRightMouseUp NSRightMouseUp
+#endif
+
static
const gchar* gst_keycode_to_keyname(gint16 keycode)
{
return;
switch ([event type]) {
- case NSMouseMoved:
+ case NSEventTypeMouseMoved:
button = 0;
break;
- case NSLeftMouseDown:
- case NSLeftMouseUp:
+ case NSEventTypeLeftMouseDown:
+ case NSEventTypeLeftMouseUp:
button = 1;
break;
- case NSRightMouseDown:
- case NSRightMouseUp:
+ case NSEventTypeRightMouseDown:
+ case NSEventTypeRightMouseUp:
button = 2;
break;
default:
static GstOSXVideoSinkClass *sink_class = NULL;
static GstVideoSinkClass *parent_class = NULL;
+#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
+#define NSEventMaskAny NSAnyEventMask
+#define NSWindowStyleMaskTitled NSTitledWindowMask
+#define NSWindowStyleMaskClosable NSClosableWindowMask
+#define NSWindowStyleMaskResizable NSResizableWindowMask
+#define NSWindowStyleMaskTexturedBackground NSTexturedBackgroundWindowMask
+#define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
+#endif
+
/* Helper to trigger calls from the main thread */
static void
gst_osx_video_sink_call_from_main_thread(GstOSXVideoSink *osxvideosink,
pollTime = [NSDate distantFuture];
do {
- event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:pollTime
+ event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:pollTime
inMode:NSDefaultRunLoopMode dequeue:YES];
[NSApp sendEvent:event];
}
osxwindow->internal = TRUE;
- mask = NSTitledWindowMask |
- NSClosableWindowMask |
- NSResizableWindowMask |
- NSTexturedBackgroundWindowMask |
- NSMiniaturizableWindowMask;
+ mask = NSWindowStyleMaskTitled |
+ NSWindowStyleMaskClosable |
+ NSWindowStyleMaskResizable |
+ NSWindowStyleMaskTexturedBackground |
+ NSWindowStyleMaskMiniaturizable;
rect.origin.x = 100.0;
rect.origin.y = 100.0;