#include <Draw_Window.hxx>
#include <Cocoa_LocalPool.hxx>
+#if !defined(MAC_OS_X_VERSION_10_12) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12)
+ // replacements for macOS versions before 10.12
+ #define NSEventTypeLeftMouseDown NSLeftMouseDown
+ #define NSEventTypeRightMouseDown NSRightMouseDown
+ #define NSEventTypeLeftMouseDragged NSLeftMouseDragged
+ #define NSEventTypeMouseMoved NSMouseMoved
+
+ #define NSEventMaskLeftMouseDragged NSLeftMouseDraggedMask
+ #define NSEventMaskMouseMoved NSMouseMovedMask
+ #define NSEventMaskLeftMouseDown NSLeftMouseDownMask
+ #define NSEventMaskRightMouseDown NSRightMouseDownMask
+
+ #define NSWindowStyleMaskResizable NSResizableWindowMask
+ #define NSWindowStyleMaskClosable NSClosableWindowMask
+ #define NSWindowStyleMaskTitled NSTitledWindowMask
+
+ #define NSCompositingOperationSourceOver NSCompositeSourceOver
+#endif
+
@interface Draw_CocoaView : NSView
{
NSImage* myImage;
[myImage drawInRect: aBounds
fromRect: NSZeroRect
- operation: NSCompositeSourceOver
+ operation: NSCompositingOperationSourceOver
fraction: 1
respectFlipped: YES
hints: nil];
if (myWindow == NULL)
{
NSRect aRectNs = NSMakeRect (theXLeft, anYTop, theWidth, theHeight);
- NSUInteger aWinStyle = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
+ NSUInteger aWinStyle = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable;
myWindow = [[NSWindow alloc] initWithContentRect: aRectNs
styleMask: aWinStyle
{
Cocoa_LocalPool aLocalPool;
- unsigned int anEventMatchMask = NSLeftMouseDownMask | NSRightMouseDownMask;
+ unsigned int anEventMatchMask = NSEventMaskLeftMouseDown | NSEventMaskRightMouseDown;
if (!theWait)
{
- anEventMatchMask = anEventMatchMask | NSMouseMovedMask | NSLeftMouseDraggedMask;
+ anEventMatchMask = anEventMatchMask | NSEventMaskMouseMoved | NSEventMaskLeftMouseDragged;
Draw_IsInZoomingMode = Standard_True;
}
NSEventType anEventType = [anEvent type];
- if (anEventType == NSLeftMouseDown)
+ if (anEventType == NSEventTypeLeftMouseDown)
{
theButton = 1;
}
- else if (anEventType == NSRightMouseDown)
+ else if (anEventType == NSEventTypeRightMouseDown)
{
theButton = 3;
}
- else if ((anEventType == NSMouseMoved || anEventType == NSLeftMouseDragged) && !theWait)
+ else if ((anEventType == NSEventTypeMouseMoved || anEventType == NSEventTypeLeftMouseDragged) && !theWait)
{
theButton = 0;
}