]> git.tdb.fi Git - libs/gui.git/commitdiff
Compatibility changes for building on OS X 10.5
authorMikko Rasa <tdb@tdb.fi>
Sat, 11 Oct 2014 09:45:15 +0000 (12:45 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 11 Oct 2014 10:40:59 +0000 (13:40 +0300)
source/graphics/cocoa/cocoadisplay.m
source/graphics/cocoa/cocoawindow.m
source/graphics/quartz/quartzloader.cpp

index 9c7711e01d2c551323d9d7cb879e27613ed4d67c..c6485a76ef5bbbbbe4ce28ab6141b0ce7dd60209 100644 (file)
@@ -1,4 +1,7 @@
+#include <stdlib.h>
+#include <string.h>
 #import <AppKit/NSApplication.h>
+#import <AppKit/NSEvent.h>
 #import <Foundation/NSAutoReleasePool.h>
 #import <Foundation/NSRunLoop.h>
 #include "cocoadisplay.h"
@@ -20,9 +23,11 @@ CocoaDisplay *create_display()
        CocoaDisplay *display = (CocoaDisplay *)malloc(sizeof(CocoaDisplay));
        display->arp = [[NSAutoreleasePool alloc] init];
        display->app = [NSApplication sharedApplication];
+#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
        // This makes windows appear when run from terminal
        if([display->app respondsToSelector:@selector(setActivationPolicy:)])
                [display->app setActivationPolicy:NSApplicationActivationPolicyRegular];
+#endif
        [display->app finishLaunching];
 
        CFArrayCallBacks callbacks;
index 5b63e8c678e10daed993f181f82207dfd3a3186b..745488bfd3dfc89863d2bf895ee4648cfd3c52fe 100644 (file)
@@ -1,9 +1,16 @@
+#import <AppKit/NSApplication.h>
 #import <AppKit/NSWindow.h>
 #import <CoreFoundation/CFArray.h>
 #include "cocoadisplay.h"
 #include "cocoawindow.h"
 
-@interface WindowDelegate: NSObject <NSWindowDelegate>
+#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+@protocol NSWindowDelegate <NSObject> @end
+#endif
+
+@interface WindowDelegate: NSObject <NSWindowDelegate> {
+       int dummy_member;
+}
 
 - (BOOL)windowShouldClose:(id)sender;
 
index 1fc93ad2b3d36252a1e487e40ac82ad04d80c676..d1baaef549761aac2b50157ab0f4392dc3f09249 100644 (file)
@@ -1,7 +1,5 @@
 #include <algorithm>
-#include <CoreGraphics/CGColorSpace.h>
-#include <CoreGraphics/CGImage.h>
-#include <ImageIO/CGImageSource.h>
+#include <ApplicationServices/ApplicationServices.h>
 // Avoid messing up sigc++ headers
 #undef nil
 #include "quartzloader.h"