├── GraphicsServices.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── GraphicsServices ├── GraphicsServices.h ├── CGSEventTypes.h ├── GSEventTypes.h ├── CFBase.c ├── GSBase.h ├── Info.plist ├── GSEventQueue.h ├── GSEvent.h ├── GSCoreFoundationBridge.h ├── GSApp.h ├── GSEventQueue.c ├── GSPrivate.h ├── GSApp.c ├── GSPrivate.c ├── GSEvent.c └── GSEventTypes.def ├── .gitignore ├── LICENSE └── README.md /GraphicsServices.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GraphicsServices/GraphicsServices.h: -------------------------------------------------------------------------------- 1 | // 2 | // GraphicsServices.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GRAPHICS_SERVICES_H 10 | #define GRAPHICS_SERVICES_H 11 | 12 | #include "GSBase.h" 13 | #include "GSApp.h" 14 | #include "GSEvent.h" 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /GraphicsServices/CGSEventTypes.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSEventTypes.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 10/25/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSEVENT_TYPES_H 10 | #define GSEVENT_TYPES_H 11 | 12 | #include "GSEventTypes.def" 13 | 14 | typedef enum { 15 | #define X(EVT, VAL) EVT = VAL, 16 | GS_EVENT_TYPES_TABLE 17 | #undef X 18 | } CGSEventType; 19 | 20 | 21 | #endif /* GSEVENT_TYPES_H */ 22 | -------------------------------------------------------------------------------- /GraphicsServices/GSEventTypes.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSEventTypes.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 10/25/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSEVENT_TYPES_H 10 | #define GSEVENT_TYPES_H 11 | 12 | #include "GSEventTypes.def" 13 | 14 | typedef enum { 15 | #define X(EVT, VAL, IDX) EVT = VAL, 16 | GS_EVENT_TYPES_TABLE 17 | #undef X 18 | } CGSEventType; 19 | 20 | #endif /* GSEVENT_TYPES_H */ 21 | -------------------------------------------------------------------------------- /GraphicsServices/CFBase.c: -------------------------------------------------------------------------------- 1 | // 2 | // CFBase.c 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #include "GSPrivate.h" 10 | 11 | const CFStringRef kGSEventReceiveRunLoopMode = CFSTR("GSEventReceiveRunLoopMode"); 12 | 13 | void GSInitialize() { 14 | static bool initOnce; 15 | if (initOnce == false) { 16 | _GSEventClassInitialize(); 17 | initOnce = true; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /GraphicsServices/GSBase.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSBase.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSBASE_H 10 | #define GSBASE_H 11 | 12 | #include 13 | 14 | /// Sets up initial state. 15 | /// 16 | /// This function should be invoked before interacting with any other part of GraphicsServices. 17 | CF_EXPORT void GSInitialize(void); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | build/ 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | *.xccheckout 14 | *.moved-aside 15 | DerivedData 16 | *.hmap 17 | *.ipa 18 | *.xcuserstate 19 | 20 | # CocoaPods 21 | # 22 | # We recommend against adding the Pods directory to your .gitignore. However 23 | # you should judge for yourself, the pros and cons are mentioned at: 24 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 25 | # 26 | #Pods/ 27 | -------------------------------------------------------------------------------- /GraphicsServices/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSHumanReadableCopyright 24 | Copyright © 2015 CodaFi. All rights reserved. 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /GraphicsServices/GSEventQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSEventQueue.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 8/1/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSEVENTQUEUE_H 10 | #define GSEVENTQUEUE_H 11 | 12 | #include "GSEvent.h" 13 | 14 | typedef struct GSPurpleEventPair { 15 | GSEventRef event; 16 | struct GSPurpleEventPair *next; 17 | } *GSPurpleEventPairRef; 18 | 19 | typedef struct GSPurpleQueue { 20 | GSPurpleEventPairRef front; 21 | GSPurpleEventPairRef back; 22 | } *GSPurpleQueueRef; 23 | 24 | /// Returns the event queue local to the current thread of execution. 25 | CF_EXPORT GSPurpleQueueRef GSEventQueueGetThreadLocalQueue(void); 26 | 27 | /// Returns true iff the given queue is empty, else false. 28 | CF_EXPORT bool GSEventQueueIsEmpty(GSPurpleQueueRef); 29 | 30 | /// Pushes an event to the back of the thread's event queue. 31 | CF_EXPORT void GSEventQueuePushEvent(GSEventRef event); 32 | 33 | /// Pops and deallocates an event from the front of the thread's event queue. 34 | CF_EXPORT void GSEventQueuePopEvent(void); 35 | 36 | /// Peeks at the event at the front of the thread's event queue. 37 | CF_EXPORT GSEventRef GSEventQueueGetCurrentEvent(void); 38 | 39 | #endif /* GSEVENTQUEUE_H */ 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GraphicsServices 2 | A reimplementation of OS X's Event Pump in the style of GraphicsServices. 3 | 4 | # Why 5 | OS X, like any modern operating system, has two faces: The kernel and userland. 6 | While the kernel is written in tight, modular, K&R-style C, userland is 7 | a hodge-podge of decisions [read: mistakes] made decades ago that still have not 8 | been cleaned up. Notably, though we are not allowed to interact with Carbon and 9 | its constituent sub-frameworks, Carbon has been kept alive on all of our systems 10 | and is the driving force behind integral UI components like voiceover, print 11 | panels, status bar windows, and event handling. Carbon's influence is so broad 12 | even AppKit must delegate to it frequently for platform behaviors. 13 | 14 | Carbon controls far too much, and interacting with it in some form remains 15 | a necessary evil if one wishes to get an app off the ground and into the dock. 16 | That is, frankly, unacceptable. We can do better, we must do better! In that 17 | spirit this framework draws upon the essence of 18 | [GraphicsServices](http://iphonedevwiki.net/index.php/GraphicsServices.framework), 19 | iOS' eventing and high-level graphics extension library to redo the fundamental 20 | event pump machinery in OS X. 21 | 22 | -------------------------------------------------------------------------------- /GraphicsServices/GSEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSEvent.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSEVENT_H 10 | #define GSEVENT_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | typedef struct __GSEvent *GSEventRef; 19 | 20 | /// Returns the type identifier for the GSEvent opaque type. 21 | CF_EXPORT CFTypeID GSEventGetTypeID(void); 22 | 23 | /// 24 | CF_EXPORT GSEventRef GSEventCreateWithCGEvent(CFAllocatorRef allocator, CGEventRef event); 25 | 26 | /// Returns the type of the given event. 27 | CF_EXPORT CGSEventType GSEventGetType(GSEventRef); 28 | 29 | /// Returns the location of the given event in the base coordinate system of the associated window. 30 | CF_EXPORT CGPoint GSEventGetLocationInWindow(GSEventRef); 31 | 32 | /// The time when the event occurred in seconds since system startup. 33 | CF_EXPORT CFAbsoluteTime GSEventGetTimestamp(GSEventRef); 34 | 35 | /// The window ID the event was dispatched to. 36 | CF_EXPORT CGWindowID GSEventGetWindowID(GSEventRef); 37 | 38 | /// The underlying CGEvent for this event ref. 39 | CF_EXPORT CGEventRef GSEventGetCGEvent(GSEventRef); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /GraphicsServices/GSCoreFoundationBridge.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSCoreFoundationBridge.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSCOREFOUNDATIONBRIDGE_H 10 | #define GSCOREFOUNDATIONBRIDGE_H 11 | 12 | enum { 13 | _kCFRuntimeNotATypeID = 0 14 | }; 15 | 16 | typedef struct __CFRuntimeBase { 17 | uintptr_t _cfisa; 18 | uint8_t _cfinfo[4]; 19 | #if __LP64__ 20 | uint32_t _rc; 21 | #endif 22 | } CFRuntimeBase; 23 | 24 | typedef struct __CFRuntimeClass { // Version 0 struct 25 | CFIndex version; 26 | const char *className; 27 | void (*init)(CFTypeRef cf); 28 | CFTypeRef (*copy)(CFAllocatorRef allocator, CFTypeRef cf); 29 | #if MAC_OS_X_VERSION_10_2 <= MAC_OS_X_VERSION_MAX_ALLOWED 30 | void (*finalize)(CFTypeRef cf); 31 | #else 32 | void (*dealloc)(CFTypeRef cf); 33 | #endif 34 | Boolean (*equal)(CFTypeRef cf1, CFTypeRef cf2); 35 | CFHashCode (*hash)(CFTypeRef cf); 36 | CFStringRef (*copyFormattingDesc)(CFTypeRef cf, CFDictionaryRef formatOptions); // str with retain 37 | CFStringRef (*copyDebugDesc)(CFTypeRef cf); // str with retain 38 | #if MAC_OS_X_VERSION_10_5 <= MAC_OS_X_VERSION_MAX_ALLOWED 39 | #define CF_RECLAIM_AVAILABLE 1 40 | void (*reclaim)(CFTypeRef cf); 41 | #endif 42 | } CFRuntimeClass; 43 | 44 | CF_EXPORT CFTypeID _CFRuntimeRegisterClass(const CFRuntimeClass * const cls); 45 | CF_EXPORT CFTypeRef _CFRuntimeCreateInstance(CFAllocatorRef allocator, CFTypeID typeID, CFIndex extraBytes, unsigned char *category); 46 | 47 | #endif /* GSCOREFOUNDATIONBRIDGE_H */ 48 | -------------------------------------------------------------------------------- /GraphicsServices/GSApp.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSApp.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 8/1/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSAPP_H 10 | #define GSAPP_H 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | 18 | #pragma mark - Application Initialization 19 | 20 | 21 | /// Initializes the event pump. 22 | CF_EXPORT void GSAppInitialize(void); 23 | 24 | 25 | #pragma mark - Run Loops 26 | 27 | 28 | /// The run loop mode GraphicsServices spins the event loop in. 29 | CF_EXPORT const CFStringRef kGSEventReceiveRunLoopMode; 30 | 31 | /// Spins the runloop in the current mode. 32 | CF_EXPORT void GSAppRun(void); 33 | 34 | /// Pushes a new run loop mode onto the top of the stack. 35 | CF_EXPORT void GSAppPushRunLoopMode(CFStringRef mode); 36 | 37 | /// Pops the topmost run loop mode from the stack. 38 | /// 39 | /// If there are no modes or the last mode has been popped the application will terminate. 40 | CF_EXPORT void GSAppPopRunLoopMode(CFStringRef mode); 41 | 42 | /// Spins the runloop in the topmost mode by initiating a modal session in the previous runloop. 43 | /// 44 | /// If the `disallowsRestarts` flag is set the runloop will not automatically restart once it has 45 | /// stopped. 46 | CF_EXPORT void GSAppRunModal(bool disallowsRestarts); 47 | 48 | /// Stops the topmost runloop and transfers control to the initiator of the modal session. 49 | CF_EXPORT void GSAppStopModal(void); 50 | 51 | 52 | #pragma mark - Callbacks 53 | 54 | 55 | /// Registers a callback with the event pump. 56 | CF_EXPORT void GSAppRegisterEventCallBack(void (^callback)(GSEventRef)); 57 | 58 | 59 | 60 | #endif /* GSAPP_H */ 61 | -------------------------------------------------------------------------------- /GraphicsServices/GSEventQueue.c: -------------------------------------------------------------------------------- 1 | // 2 | // GSEventQueue.c 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 8/1/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #include "GSEventQueue.h" 10 | #include 11 | 12 | static pthread_once_t GSThreadLocalContextOnce = PTHREAD_ONCE_INIT; 13 | static pthread_key_t GSThreadLocalContextKey; 14 | 15 | static void GSFreeContextStack(void *queue) { 16 | GSPurpleQueueRef queueref = (GSPurpleQueueRef)queue; 17 | while (!GSEventQueueIsEmpty(queueref)) { 18 | GSEventQueuePopEvent(); 19 | } 20 | free(queueref); 21 | } 22 | 23 | static void GSCreateContextOnceKey() { 24 | pthread_key_create(&GSThreadLocalContextKey, GSFreeContextStack); 25 | } 26 | 27 | GSPurpleQueueRef GSEventQueueGetThreadLocalQueue() { 28 | pthread_once(&GSThreadLocalContextOnce, GSCreateContextOnceKey); 29 | GSPurpleQueueRef contexts = pthread_getspecific(GSThreadLocalContextKey); 30 | if (contexts == NULL) { 31 | GSPurpleQueueRef queue; 32 | 33 | queue = malloc(sizeof(*queue)); 34 | queue->front = queue->back = NULL; 35 | pthread_setspecific(GSThreadLocalContextKey, queue); 36 | 37 | return queue; 38 | } 39 | return contexts; 40 | } 41 | 42 | bool GSEventQueueIsEmpty(GSPurpleQueueRef queue) { 43 | return (queue == NULL) || (queue->front == NULL); 44 | } 45 | 46 | GSEventRef GSEventQueueGetCurrentEvent() { 47 | GSPurpleQueueRef queue = GSEventQueueGetThreadLocalQueue(); 48 | if (queue->front == NULL) { 49 | return NULL; 50 | } 51 | return queue->front->event; 52 | } 53 | 54 | void GSEventQueuePopEvent() { 55 | GSPurpleQueueRef queue = GSEventQueueGetThreadLocalQueue(); 56 | GSPurpleEventPairRef deadNode = queue->front; 57 | 58 | if (queue->front == NULL) { 59 | return; 60 | } 61 | 62 | if (queue->front == queue->back) { 63 | queue->front = queue->back = NULL; 64 | } else { 65 | queue->front = queue->front->next; 66 | } 67 | 68 | if (deadNode->event != NULL) { 69 | CFRelease(deadNode->event); 70 | } 71 | free(deadNode); 72 | } 73 | 74 | void GSEventQueuePushEvent(GSEventRef event) { 75 | GSPurpleQueueRef queue = GSEventQueueGetThreadLocalQueue(); 76 | GSPurpleEventPairRef pair; 77 | 78 | pair = malloc(sizeof(*pair)); 79 | pair->event = (GSEventRef)CFRetain(event); 80 | pair->next = NULL; 81 | 82 | if (queue->front == NULL) { 83 | queue->front = queue->back = pair; 84 | } else { 85 | queue->back->next = pair; 86 | queue->back = pair; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /GraphicsServices/GSPrivate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GSPrivate.h 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #ifndef GSPRIVATE_H 10 | #define GSPRIVATE_H 11 | 12 | #include 13 | #include "GSEvent.h" 14 | #include "GSEventQueue.h" 15 | 16 | CF_EXPORT CFRunLoopRef ___eventRunLoop; 17 | CF_EXPORT mach_port_name_t ___lastRecievedPort; 18 | CF_EXPORT void (^___eventCallBack)(GSEventRef); 19 | 20 | CF_EXPORT 21 | void __GSEventInitializeShared(dispatch_queue_t); 22 | 23 | CF_EXPORT 24 | void _GSEventClassInitialize(void); 25 | 26 | CF_EXPORT 27 | void _GSAddRunLoopSourceForEventPort(mach_port_t port, CFStringRef mode, int64_t contextID); 28 | 29 | CF_EXPORT 30 | void _GSAddSourceForEventPort(mach_port_t port, dispatch_queue_t queue, int64_t contextID); 31 | 32 | CF_EXPORT 33 | CGEventRef CGEventCreateNextEvent(int64_t); 34 | 35 | typedef unsigned short CGSEventRecordVersion; 36 | typedef unsigned long long CGSEventRecordTime; /* nanosecond timer */ 37 | typedef unsigned long CGSEventFlag; 38 | typedef unsigned long CGSByteCount; 39 | typedef uint32_t CGSConnectionID; 40 | 41 | typedef struct { 42 | NXEventData eventData; 43 | SInt32 _padding[4]; 44 | } CGSEventRecordData; 45 | 46 | typedef struct _CGSEventRecord { 47 | CGSEventRecordVersion major; /*0x0*/ 48 | CGSEventRecordVersion minor; /*0x2*/ 49 | CGSByteCount length; /*0x4*/ /* Length of complete event record */ 50 | CGSEventType type; /*0x8*/ /* An event type from above */ 51 | CGPoint location; /*0x10*/ /* Base coordinates (global), from upper-left */ 52 | CGPoint windowLocation; /*0x20*/ /* Coordinates relative to window */ 53 | CGSEventRecordTime time; /*0x30*/ /* nanoseconds since startup */ 54 | CGSEventFlag flags; /* key state flags */ 55 | CGWindowID window; /* window number of assigned window */ 56 | CGSConnectionID connection; /* connection the event came from */ 57 | struct __CGEventSourceData { 58 | int source; 59 | unsigned int sourceUID; 60 | unsigned int sourceGID; 61 | unsigned int flags; 62 | unsigned long long userData; 63 | unsigned int sourceState; 64 | unsigned short localEventSuppressionInterval; 65 | unsigned char suppressionIntervalFlags; 66 | unsigned char remoteMouseDragFlags; 67 | unsigned long long serviceID; 68 | } eventSource; 69 | struct _CGEventProcess { 70 | int pid; 71 | unsigned int psnHi; 72 | unsigned int psnLo; 73 | unsigned int targetID; 74 | unsigned int flags; 75 | } eventProcess; 76 | NXEventData eventData; 77 | SInt32 _padding[4]; 78 | void *ioEventData; 79 | unsigned short _field16; 80 | unsigned short _field17; 81 | struct _CGSEventAppendix { 82 | unsigned short windowHeight; 83 | unsigned short mainDisplayHeight; 84 | unsigned short *unicodePayload; 85 | unsigned int eventOwner; 86 | unsigned char passedThrough; 87 | } *appendix; 88 | unsigned int _field18; 89 | bool passedThrough; 90 | CFDataRef data; 91 | } CGSEventRecord; 92 | 93 | #if MAC_OS_X_VERSION_10_13 94 | /// Retrieves the location of this event in the coordinate space of the window 95 | /// it occured in. 96 | CG_EXTERN CGPoint CGEventGetWindowLocation(CGEventRef event); 97 | #else 98 | /// Gets the event record for a given `CGEventRef`. 99 | /// 100 | /// For Carbon events, use `GetEventPlatformEventRecord`. 101 | CG_EXTERN CGError CGEventGetEventRecord(CGEventRef event, CGSEventRecord *outRecord, size_t recSize); 102 | #endif 103 | 104 | #endif /* GSPRIVATE_H */ 105 | -------------------------------------------------------------------------------- /GraphicsServices/GSApp.c: -------------------------------------------------------------------------------- 1 | // 2 | // GSApp.c 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 8/1/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #include "GSApp.h" 10 | #include "GSPrivate.h" 11 | 12 | #include 13 | 14 | void GSAppRun() { 15 | GSAppRunModal(false); 16 | } 17 | 18 | void GSAppRegisterEventCallBack(void (^callback)(GSEventRef)) { 19 | ___eventCallBack = callback; 20 | } 21 | 22 | static CFMutableArrayRef ___runLoopModeStack; 23 | static bool ___exitRunModal; 24 | 25 | void GSAppPushRunLoopMode(CFStringRef mode) { 26 | if (___runLoopModeStack == NULL) { 27 | ___runLoopModeStack = CFArrayCreateMutable(NULL, 0, &kCFTypeArrayCallBacks); 28 | } 29 | CFArrayAppendValue(___runLoopModeStack, mode); 30 | CFRunLoopStop(___eventRunLoop); 31 | } 32 | 33 | void GSAppPopRunLoopMode(CFStringRef mode) { 34 | if ((___runLoopModeStack == NULL) || (CFArrayGetCount(___runLoopModeStack) <= 0)) { 35 | CFRunLoopStop(___eventRunLoop); 36 | return; 37 | } 38 | 39 | CFStringRef topLoopMode = CFArrayGetValueAtIndex(___runLoopModeStack, CFArrayGetCount(___runLoopModeStack) - 1); 40 | if ((topLoopMode != NULL) && (CFStringCompare(mode, topLoopMode, 0) == kCFCompareEqualTo)) { 41 | CFArrayRemoveValueAtIndex(___runLoopModeStack, CFArrayGetCount(___runLoopModeStack) - 1); 42 | } 43 | CFRunLoopStop(___eventRunLoop); 44 | } 45 | 46 | void GSAppRunModal(bool disallowsRestarts) { 47 | while (true) { 48 | if (disallowsRestarts == false) { 49 | if ((___runLoopModeStack == NULL) || (CFArrayGetCount(___runLoopModeStack) <= 0)) { 50 | fprintf(stderr, "%s: NULL run loop mode. Exiting loop\n", "GSAppRunModal"); 51 | ___exitRunModal = false; 52 | return; 53 | } 54 | } 55 | 56 | if (___exitRunModal) { 57 | ___exitRunModal = false; 58 | return; 59 | } 60 | 61 | CFStringRef topRunLoopMode = CFArrayGetValueAtIndex(___runLoopModeStack, CFArrayGetCount(___runLoopModeStack) - 1); 62 | if (topRunLoopMode == NULL) { 63 | fprintf(stderr, "%s: NULL run loop mode. Exiting loop\n", "GSAppRunModal"); 64 | ___exitRunModal = false; 65 | return; 66 | } 67 | 68 | CFRunLoopRunInMode(topRunLoopMode, kCFAbsoluteTimeIntervalSince1970, disallowsRestarts); 69 | } 70 | } 71 | 72 | void GSAppStopModal() { 73 | ___exitRunModal = true; 74 | CFRunLoopStop(CFRunLoopGetCurrent()); 75 | } 76 | 77 | static mach_port_t ___applicationPort; 78 | extern CGError CGSGetEventPort(int64_t, mach_port_t *); 79 | extern int64_t CGSMainConnectionID(void); 80 | 81 | void __GSEventInitializeApp(dispatch_queue_t queue) { 82 | static bool _initialized; 83 | 84 | if (_initialized == true) { 85 | return; 86 | } 87 | _initialized = true; 88 | 89 | __GSEventInitializeShared(queue); 90 | 91 | int64_t context = CGSMainConnectionID(); 92 | if (CGSGetEventPort(context, &___applicationPort) != kCGErrorSuccess) { 93 | fprintf(stderr, "Fatal: failed to create main application connection port"); 94 | abort(); 95 | } 96 | 97 | if (queue != NULL) { 98 | mach_port_limits_t qlimits; 99 | qlimits.mpl_qlimit = 0x100; 100 | mach_port_set_attributes(mach_task_self(), ___applicationPort, MACH_PORT_LIMITS_INFO, (mach_port_info_t)&qlimits, MACH_PORT_LIMITS_INFO_COUNT); 101 | _GSAddSourceForEventPort(___applicationPort, queue, context); 102 | } 103 | 104 | if (___eventRunLoop != NULL) { 105 | _GSAddRunLoopSourceForEventPort(___applicationPort, kCFRunLoopCommonModes, context); 106 | _GSAddRunLoopSourceForEventPort(___applicationPort, kGSEventReceiveRunLoopMode, context); 107 | } 108 | // int err = mach_port_insert_right(mach_task_self(), ___applicationPort, ___applicationPort, MACH_MSG_TYPE_MAKE_SEND); 109 | // if (err != KERN_SUCCESS) { 110 | // fprintf(stderr, "mach_port_insert_right() error: %s\n", mach_error_string(err)); 111 | // abort(); 112 | // } 113 | } 114 | 115 | void GSAppInitialize() { 116 | __GSEventInitializeApp(NULL); 117 | } 118 | -------------------------------------------------------------------------------- /GraphicsServices/GSPrivate.c: -------------------------------------------------------------------------------- 1 | // 2 | // GSPrivate.c 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #include "GSPrivate.h" 10 | #include "GSApp.h" 11 | #include "GSEvent.h" 12 | #include "GSEventQueue.h" 13 | 14 | mach_port_name_t ___lastRecievedPort; 15 | static CFRunLoopSourceRef ___signalRunLoopSource; 16 | CFRunLoopRef ___eventRunLoop; 17 | static dispatch_queue_t ___eventDeliveryQueue; 18 | void (^___eventCallBack)(GSEventRef); 19 | 20 | static void _ReceiveEvent(CFMachPortRef port, void *msg, CFIndex size, void *info); 21 | static void _PurpleEventSignalCallback(void *context); 22 | static void __PurpleEventCallback(GSEventRef event); 23 | 24 | void _GSAddRunLoopSourceForEventPort(mach_port_t p, CFStringRef mode, int64_t contextID) { 25 | CFMachPortContext context = (CFMachPortContext){ 26 | 1, 27 | (void *)contextID, 28 | NULL, 29 | NULL, 30 | NULL, 31 | }; 32 | CFMachPortRef port = CFMachPortCreateWithPort(NULL, p, _ReceiveEvent, &context, NULL); 33 | CFRunLoopSourceRef eventSource = CFMachPortCreateRunLoopSource(NULL, port, -1); 34 | CFRunLoopAddSource(___eventRunLoop, eventSource, mode); 35 | CFRelease(eventSource); 36 | } 37 | 38 | void _GSAddSourceForEventPort(mach_port_t eport, dispatch_queue_t queue, int64_t contextID) { 39 | if (queue != NULL) { 40 | dispatch_source_t source = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, (mach_port_name_t)eport, 0, queue); 41 | dispatch_source_set_event_handler(source, ^{ 42 | mach_port_name_t port = (mach_port_name_t)dispatch_source_get_handle(source); 43 | if (port != 0) { 44 | ___lastRecievedPort = port; 45 | } 46 | _ReceiveEvent(NULL, NULL, 0, NULL); 47 | do { 48 | // __PurpleEventCallback(receivedEvent); 49 | if (GSEventQueueIsEmpty(GSEventQueueGetThreadLocalQueue())) { 50 | break; 51 | } 52 | } while (true); 53 | return; 54 | }); 55 | dispatch_resume(source); 56 | } else { 57 | _GSAddRunLoopSourceForEventPort(eport, kCFRunLoopCommonModes, contextID); 58 | _GSAddRunLoopSourceForEventPort(eport, kGSEventReceiveRunLoopMode, contextID); 59 | } 60 | } 61 | 62 | static void _ReceiveEvent(CFMachPortRef port, void *msg, CFIndex size, void *info) { 63 | CGEventRef event = CGEventCreateNextEvent((int64_t)info); 64 | if (event == NULL) { 65 | return; 66 | } 67 | 68 | GSEventRef gsEvent = GSEventCreateWithCGEvent(NULL, event); 69 | if (gsEvent == NULL) { 70 | return; 71 | } 72 | __PurpleEventCallback(gsEvent); 73 | } 74 | 75 | void __GSEventInitializeShared(dispatch_queue_t callbackQueue) { 76 | if (callbackQueue != NULL) { 77 | ___eventDeliveryQueue = callbackQueue; 78 | dispatch_retain(___eventDeliveryQueue); 79 | } else { 80 | ___eventRunLoop = CFRunLoopGetCurrent(); 81 | CFRetain(___eventRunLoop); 82 | } 83 | if (___eventRunLoop != NULL) { 84 | CFRunLoopSourceContext context = (CFRunLoopSourceContext){ 85 | .perform = _PurpleEventSignalCallback, 86 | }; 87 | ___signalRunLoopSource = CFRunLoopSourceCreate(NULL, -1, &context); 88 | CFRunLoopAddSource(___eventRunLoop, ___signalRunLoopSource, kCFRunLoopCommonModes); 89 | CFRunLoopAddSource(___eventRunLoop, ___signalRunLoopSource, kGSEventReceiveRunLoopMode); 90 | } 91 | } 92 | 93 | static void _PurpleEventSignalCallback(void *context) { 94 | __PurpleEventCallback(NULL); 95 | } 96 | 97 | static void __PurpleEventCallback(GSEventRef event) { 98 | if (event != NULL) { 99 | GSEventQueuePushEvent(event); 100 | } 101 | 102 | 103 | if (___lastRecievedPort != 0) { 104 | // CGEventRef recievedEvent = NULL; 105 | // while ((recievedEvent = CGEventCreateNextEvent()) != NULL) { 106 | // GSEventRef evt = GSEventCreateWithCGEvent(NULL, recievedEvent); 107 | // if (evt != NULL) { 108 | // GSEventQueuePushEvent(evt); 109 | // } 110 | // } 111 | } 112 | 113 | event = GSEventQueueGetCurrentEvent(); 114 | if (event == NULL) { 115 | goto fail; 116 | } 117 | 118 | if (___eventCallBack != NULL) { 119 | ___eventCallBack(event); 120 | } 121 | 122 | CFRelease(event); 123 | 124 | fail: 125 | GSEventQueuePopEvent(); 126 | if (___signalRunLoopSource != NULL) { 127 | CFRunLoopSourceSignal(___signalRunLoopSource); 128 | } 129 | } 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /GraphicsServices/GSEvent.c: -------------------------------------------------------------------------------- 1 | // 2 | // GSEvent.c 3 | // GraphicsServices 4 | // 5 | // Created by Robert Widmann on 7/31/15. 6 | // Copyright © 2015 CodaFi. All rights reserved. 7 | // 8 | 9 | #include "GSEvent.h" 10 | #include "GSCoreFoundationBridge.h" 11 | #include "GSPrivate.h" 12 | 13 | CFTypeRef _GSEventCopy(CFAllocatorRef, CFTypeRef); 14 | CFStringRef _GSEventCopyDescription(CFTypeRef); 15 | Boolean _GSEventEqualToEvent(CFTypeRef, CFTypeRef); 16 | 17 | static CFTypeID kGSEventTypeID = _kCFRuntimeNotATypeID; 18 | 19 | static const CFRuntimeClass _GSEventClass = { 20 | 0, 21 | "GSEventClass", 22 | NULL, // init 23 | _GSEventCopy, // copy 24 | NULL, // dealloc 25 | _GSEventEqualToEvent, // isEqual 26 | NULL, // hash 27 | NULL, // formatting description 28 | _GSEventCopyDescription, // description 29 | }; 30 | 31 | 32 | struct __GSEvent { 33 | CFRuntimeBase _base; // 0x0 34 | CGSEventType type; // 0x10 35 | // 36 | // 37 | // 38 | CGFloat windowLocationX; // 0x28 39 | CGFloat windowLocationY; // 0x30 40 | // 41 | CFAbsoluteTime timestamp; // 0x40 42 | CGWindowID windowID; 43 | CGEventRef cgEvent; 44 | }; 45 | 46 | void _GSEventClassInitialize() { 47 | kGSEventTypeID = _CFRuntimeRegisterClass(&_GSEventClass); 48 | } 49 | 50 | CFTypeRef _GSEventCopy(CFAllocatorRef allocator, CFTypeRef cf) { 51 | GSEventRef copiedEvent = (GSEventRef)_CFRuntimeCreateInstance(NULL, kGSEventTypeID, /*cf->usagePage*/ 0, 0); 52 | if (copiedEvent != NULL) { 53 | memcpy(copiedEvent + sizeof(CFRuntimeBase), cf + sizeof(CFRuntimeBase), sizeof(struct __GSEvent) - sizeof(CFRuntimeBase)); 54 | } 55 | return copiedEvent; 56 | } 57 | 58 | static const char *GSEventTypeTable[] = { 59 | #define X(EVT, VAL, IDX) #EVT, 60 | GS_EVENT_TYPES_TABLE 61 | #undef X 62 | }; 63 | 64 | static const uint32_t GSEventIndexTable[][2] = { 65 | #define X(EVT, VAL, IDX) { VAL, IDX }, 66 | GS_EVENT_TYPES_TABLE 67 | #undef X 68 | }; 69 | 70 | static const char *CGSDescribeType(CGSEventType type) { 71 | for (uint32_t i = 0; i < kCGSEventCount; i++) { 72 | const uint32_t *tpp = GSEventIndexTable[i]; 73 | if (tpp[0] == type) { 74 | return GSEventTypeTable[tpp[1]]; 75 | } 76 | } 77 | return NULL; 78 | } 79 | 80 | CFStringRef _GSEventCopyDescription(CFTypeRef t) { 81 | struct __GSEvent *evt = (struct __GSEvent *)t; 82 | return CFStringCreateWithFormat(CFGetAllocator(t), NULL, CFSTR("{type = %s, windowLoc = (%f, %f)}"), t, CGSDescribeType(evt->type), evt->windowLocationX, evt->windowLocationY); 83 | } 84 | 85 | Boolean _GSEventEqualToEvent(CFTypeRef cf1, CFTypeRef cf2) { 86 | if (cf1 == NULL || cf2 == NULL) { 87 | return false; 88 | } 89 | 90 | struct __GSEvent *evt1 = (struct __GSEvent *)cf1; 91 | struct __GSEvent *evt2 = (struct __GSEvent *)cf2; 92 | return (evt1->type == evt2->type) && (evt1->timestamp == evt2->timestamp) && (evt1->windowID == evt2->windowID); 93 | } 94 | 95 | CFTypeID GSEventGetTypeID() { 96 | return kGSEventTypeID; 97 | } 98 | 99 | GSEventRef GSEventCreateWithCGEvent(CFAllocatorRef allocator, CGEventRef event) { 100 | if (event == NULL) { 101 | return NULL; 102 | } 103 | 104 | uint32_t size = sizeof(struct __GSEvent) - sizeof(CFRuntimeBase); 105 | GSEventRef memory = (void *)_CFRuntimeCreateInstance(allocator, GSEventGetTypeID(), size, NULL); 106 | if (memory == NULL) { 107 | return NULL; 108 | } 109 | 110 | memory->cgEvent = (CGEventRef)CFRetain(event); 111 | memory->type = CGEventGetType(event); 112 | memory->windowID = (CGWindowID)CGEventGetIntegerValueField(event, kCGMouseEventWindowUnderMousePointer); 113 | CGPoint windowLoc = CGEventGetWindowLocation(event); 114 | memory->windowLocationX = windowLoc.x; 115 | memory->windowLocationY = windowLoc.y; 116 | return memory; 117 | } 118 | 119 | CGSEventType GSEventGetType(GSEventRef ref) { 120 | if (ref == NULL) { 121 | return -1; 122 | } 123 | return ref->type; 124 | } 125 | 126 | CGPoint GSEventGetLocationInWindow(GSEventRef ref) { 127 | if (ref == NULL) { 128 | return CGPointZero; 129 | } 130 | return (CGPoint){ ref->windowLocationX, ref->windowLocationY }; 131 | } 132 | 133 | CFAbsoluteTime GSEventGetTimestamp(GSEventRef ref) { 134 | if (ref == NULL) { 135 | return 0; 136 | } 137 | return ref->timestamp; 138 | } 139 | 140 | CGWindowID GSEventGetWindowID(GSEventRef ref) { 141 | if (ref == NULL) { 142 | return 0; 143 | } 144 | return ref->windowID; 145 | } 146 | 147 | CGEventRef GSEventGetCGEvent(GSEventRef ref) { 148 | if (ref == NULL) { 149 | return 0; 150 | } 151 | return ref->cgEvent; 152 | } 153 | -------------------------------------------------------------------------------- /GraphicsServices/GSEventTypes.def: -------------------------------------------------------------------------------- 1 | #define GS_EVENT_TYPES_TABLE \ 2 | X(kCGSDisplayWillReconfigure, 100, 0) \ 3 | X(kCGSDisplayDidReconfigure, 101, 1) \ 4 | X(kCGSDisplayWillSleep, 102, 2) \ 5 | X(kCGSDisplayDidWake, 103, 3) \ 6 | X(kCGSDisplayIsCaptured, 106, 4) \ 7 | X(kCGSDisplayIsReleased, 107, 5) \ 8 | X(kCGSDisplayAllDisplaysReleased, 108, 6) \ 9 | X(kCGSDisplayHardwareChanged, 111, 7) \ 10 | X(kCGSDisplayDidReconfigure2, 115, 8) \ 11 | X(kCGSDisplayFullScreenAppRunning, 116, 9) \ 12 | X(kCGSDisplayFullScreenAppDone, 117, 10) \ 13 | X(kCGSDisplayReconfigureHappened, 118, 11) \ 14 | X(kCGSDisplayColorProfileChanged, 119, 12) \ 15 | X(kCGSDisplayZoomStateChanged, 120, 13) \ 16 | X(kCGSDisplayAcceleratorChanged, 121, 14) \ 17 | X(kCGSDebugOptionsChangedNotification, 200, 15) \ 18 | X(kCGSDebugPrintResourcesNotification, 203, 16) \ 19 | X(kCGSDebugPrintResourcesMemoryNotification, 205, 17) \ 20 | X(kCGSDebugPrintResourcesContextNotification, 206, 18) \ 21 | X(kCGSDebugPrintResourcesImageNotification, 208, 19) \ 22 | X(kCGSServerConnDirtyScreenNotification, 300, 20) \ 23 | X(kCGSServerLoginNotification, 301, 21) \ 24 | X(kCGSServerShutdownNotification, 302, 22) \ 25 | X(kCGSServerUserPreferencesLoadedNotification, 303, 23) \ 26 | X(kCGSServerUpdateDisplayNotification, 304, 24) \ 27 | X(kCGSServerCAContextDidCommitNotification, 305, 25) \ 28 | X(kCGSServerUpdateDisplayCompletedNotification, 306, 26) \ 29 | X(kCPXForegroundProcessSwitched, 400, 27) \ 30 | X(kCPXSpecialKeyPressed, 401, 28) \ 31 | X(kCPXForegroundProcessSwitchRequestedButRedundant, 402, 29) \ 32 | X(kCGSSpecialKeyEventNotification, 700, 30) \ 33 | X(kCGSEventNotificationNullEvent, 710, 31) \ 34 | X(kCGSEventNotificationLeftMouseDown, 711, 32) \ 35 | X(kCGSEventNotificationLeftMouseUp, 712, 33) \ 36 | X(kCGSEventNotificationRightMouseDown, 713, 34) \ 37 | X(kCGSEventNotificationRightMouseUp, 714, 35) \ 38 | X(kCGSEventNotificationMouseMoved, 715, 36) \ 39 | X(kCGSEventNotificationLeftMouseDragged, 716, 37) \ 40 | X(kCGSEventNotificationRightMouseDragged, 717, 38) \ 41 | X(kCGSEventNotificationMouseEntered, 718, 39) \ 42 | X(kCGSEventNotificationMouseExited, 719, 40) \ 43 | X(kCGSEventNotificationKeyDown, 720, 41) \ 44 | X(kCGSEventNotificationKeyUp, 721, 42) \ 45 | X(kCGSEventNotificationFlagsChanged, 722, 43) \ 46 | X(kCGSEventNotificationKitDefined, 723, 44) \ 47 | X(kCGSEventNotificationSystemDefined, 724, 45) \ 48 | X(kCGSEventNotificationApplicationDefined, 725, 46) \ 49 | X(kCGSEventNotificationTimer, 726, 47) \ 50 | X(kCGSEventNotificationCursorUpdate, 727, 48) \ 51 | X(kCGSEventNotificationSuspend, 729, 49) \ 52 | X(kCGSEventNotificationResume, 730, 50) \ 53 | X(kCGSEventNotificationNotification, 731, 51) \ 54 | X(kCGSEventNotificationScrollWheel, 732, 52) \ 55 | X(kCGSEventNotificationTabletPointer, 733, 53) \ 56 | X(kCGSEventNotificationTabletProximity, 734, 54) \ 57 | X(kCGSEventNotificationOtherMouseDown, 735, 55) \ 58 | X(kCGSEventNotificationOtherMouseUp, 736, 56) \ 59 | X(kCGSEventNotificationOtherMouseDragged, 737, 57) \ 60 | X(kCGSEventNotificationZoom, 738, 58) \ 61 | X(kCGSEventNotificationAppIsUnresponsive, 750, 59) \ 62 | X(kCGSEventNotificationAppIsNoLongerUnresponsive, 751, 60) \ 63 | X(kCGSEventSecureTextInputIsActive, 752, 61) \ 64 | X(kCGSEventSecureTextInputIsOff, 753, 62) \ 65 | X(kCGSEventNotificationSymbolicHotKeyChanged, 760, 63) \ 66 | X(kCGSEventNotificationSymbolicHotKeyDisabled, 761, 64) \ 67 | X(kCGSEventNotificationSymbolicHotKeyEnabled, 762, 65) \ 68 | X(kCGSEventNotificationHotKeysGloballyDisabled, 763, 66) \ 69 | X(kCGSEventNotificationHotKeysGloballyEnabled, 764, 67) \ 70 | X(kCGSEventNotificationHotKeysExceptUniversalAccessGloballyDisabled, 765, 68) \ 71 | X(kCGSEventNotificationHotKeysExceptUniversalAccessGloballyEnabled, 766, 69) \ 72 | X(kCGSWindowIsObscured, 800, 70) \ 73 | X(kCGSWindowIsUnobscured, 801, 71) \ 74 | X(kCGSWindowIsOrderedIn, 802, 72) \ 75 | X(kCGSWindowIsOrderedOut, 803, 73) \ 76 | X(kCGSWindowIsTerminated, 804, 74) \ 77 | X(kCGSWindowIsChangingScreens, 805, 75) \ 78 | X(kCGSWindowDidMove, 806, 76) \ 79 | X(kCGSWindowDidResize, 807, 77) \ 80 | X(kCGSWindowDidChangeOrder, 808, 78) \ 81 | X(kCGSWindowGeometryDidChange, 809, 79) \ 82 | X(kCGSWindowMonitorDataPending, 810, 80) \ 83 | X(kCGSWindowDidCreate, 811, 81) \ 84 | X(kCGSWindowRightsGrantOffered, 812, 82) \ 85 | X(kCGSWindowRightsGrantCompleted, 813, 83) \ 86 | X(kCGSWindowRecordForTermination, 814, 84) \ 87 | X(kCGSWindowIsVisible, 815, 85) \ 88 | X(kCGSWindowIsInvisible, 816, 86) \ 89 | X(kCGSLikelyUnbalancedDisableUpdateNotification, 902, 87) \ 90 | X(kCGSConnectionWindowsBecameVisible, 904, 88) \ 91 | X(kCGSConnectionWindowsBecameOccluded, 905, 89) \ 92 | X(kCGSConnectionWindowModificationsStarted, 906, 90) \ 93 | X(kCGSConnectionWindowModificationsStopped, 907, 91) \ 94 | X(kCGSWindowBecameVisible, 912, 92) \ 95 | X(kCGSWindowBecameOccluded, 913, 93) \ 96 | X(kCGSServerWindowDidCreate, 1000, 94) \ 97 | X(kCGSServerWindowWillTerminate, 1001, 95) \ 98 | X(kCGSServerWindowOrderDidChange, 1002, 96) \ 99 | X(kCGSServerWindowDidTerminate, 1003, 97) \ 100 | X(kCGSServerMenuBarCreated, 1300, 98) \ 101 | X(kCGSServerHidBackstopMenuBar, 1301, 99) \ 102 | X(kCGSServerShowBackstopMenuBar, 1302, 100) \ 103 | X(kCGSServerMenuBarDrawingStyleChanged, 1303, 101) \ 104 | X(kCGSServerPersistentAppsRegistered, 1304, 102) \ 105 | X(kCGSServerPersistentCheckinComplete, 1305, 103) \ 106 | X(kCGSPackagesWorkspacesDisabled, 1306, 104) \ 107 | X(kCGSPackagesWorkspacesEnabled, 1307, 105) \ 108 | X(kCGSPackagesStatusBarSpaceChanged, 1308, 106) \ 109 | X(kCGSWorkspaceWillChange, 1400, 107) \ 110 | X(kCGSWorkspaceDidChange, 1401, 108) \ 111 | X(kCGSWorkspaceWindowIsViewable, 1402, 109) \ 112 | X(kCGSWorkspaceWindowIsNotViewable, 1403, 110) \ 113 | X(kCGSWorkspaceWindowDidMove, 1404, 111) \ 114 | X(kCGSWorkspacePrefsDidChange, 1405, 112) \ 115 | X(kCGSWorkspacesWindowDragDidStart, 1411, 113) \ 116 | X(kCGSWorkspacesWindowDragDidEnd, 1412, 114) \ 117 | X(kCGSWorkspacesWindowDragWillEnd, 1413, 115) \ 118 | X(kCGSWorkspacesShowSpaceForProcess, 1414, 116) \ 119 | X(kCGSWorkspacesWindowDidOrderInOnNonCurrentManagedSpacesOnly, 1415, 117) \ 120 | X(kCGSWorkspacesWindowDidOrderOutOnNonCurrentManagedSpaces, 1416, 118) \ 121 | X(kCGSessionConsoleConnect, 1500, 119) \ 122 | X(kCGSessionConsoleDisconnect, 1501, 120) \ 123 | X(kCGSessionRemoteConnect, 1502, 121) \ 124 | X(kCGSessionRemoteDisconnect, 1503, 122) \ 125 | X(kCGSessionLoggedOn, 1504, 123) \ 126 | X(kCGSessionLoggedOff, 1505, 124) \ 127 | X(kCGSessionConsoleWillDisconnect, 1506, 125) \ 128 | X(kCGXWillCreateSession, 1550, 126) \ 129 | X(kCGXDidCreateSession, 1551, 127) \ 130 | X(kCGXWillDestroySession, 1552, 128) \ 131 | X(kCGXDidDestroySession, 1553, 129) \ 132 | X(kCGXWorkspaceConnected, 1554, 130) \ 133 | X(kCGXSessionReleased, 1555, 131) \ 134 | X(kCGSTransitionDidFinish, 1700, 132) \ 135 | X(kCGXServerDisplayHardwareWillReset, 1800, 133) \ 136 | X(kCGXServerDesktopShapeChanged, 1801, 134) \ 137 | X(kCGXServerDisplayConfigurationChanged, 1802, 135) \ 138 | X(kCGXServerDisplayAcceleratorOffline, 1803, 136) \ 139 | X(kCGXServerDisplayAcceleratorDeactivate, 1804, 137) \ 140 | X(kCGSEventCount, 138, 138) 141 | -------------------------------------------------------------------------------- /GraphicsServices.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 82573C601BDD64AD00549861 /* GSEventTypes.def in Headers */ = {isa = PBXBuildFile; fileRef = 82573C5F1BDD64AD00549861 /* GSEventTypes.def */; settings = {ATTRIBUTES = (Public, ); }; }; 11 | 82573C621BDD65FD00549861 /* GSEventTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 82573C611BDD64C700549861 /* GSEventTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 829F155E1B6C5FAB00F8E692 /* GraphicsServices.h in Headers */ = {isa = PBXBuildFile; fileRef = 829F155D1B6C5FAB00F8E692 /* GraphicsServices.h */; settings = {ATTRIBUTES = (Public, ); }; }; 13 | 829F15661B6C5FCD00F8E692 /* GSBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 829F15651B6C5FCD00F8E692 /* GSBase.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | 829F15691B6C600900F8E692 /* GSEvent.c in Sources */ = {isa = PBXBuildFile; fileRef = 829F15671B6C600900F8E692 /* GSEvent.c */; }; 15 | 829F156A1B6C600900F8E692 /* GSEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 829F15681B6C600900F8E692 /* GSEvent.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | 829F156C1B6C60A300F8E692 /* GSCoreFoundationBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 829F156B1B6C60A300F8E692 /* GSCoreFoundationBridge.h */; }; 17 | 829F156F1B6C67D800F8E692 /* GSPrivate.c in Sources */ = {isa = PBXBuildFile; fileRef = 829F156D1B6C67D800F8E692 /* GSPrivate.c */; }; 18 | 829F15701B6C67D800F8E692 /* GSPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 829F156E1B6C67D800F8E692 /* GSPrivate.h */; }; 19 | 829F15721B6C85EA00F8E692 /* CFBase.c in Sources */ = {isa = PBXBuildFile; fileRef = 829F15711B6C85EA00F8E692 /* CFBase.c */; }; 20 | 829F15751B6D3D7B00F8E692 /* GSEventQueue.c in Sources */ = {isa = PBXBuildFile; fileRef = 829F15731B6D3D7B00F8E692 /* GSEventQueue.c */; }; 21 | 829F15761B6D3D7B00F8E692 /* GSEventQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 829F15741B6D3D7B00F8E692 /* GSEventQueue.h */; }; 22 | 829F157E1B6D4CFD00F8E692 /* GSApp.c in Sources */ = {isa = PBXBuildFile; fileRef = 829F157C1B6D4CFD00F8E692 /* GSApp.c */; }; 23 | 829F157F1B6D4CFD00F8E692 /* GSApp.h in Headers */ = {isa = PBXBuildFile; fileRef = 829F157D1B6D4CFD00F8E692 /* GSApp.h */; settings = {ATTRIBUTES = (Public, ); }; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 82573C5F1BDD64AD00549861 /* GSEventTypes.def */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = GSEventTypes.def; sourceTree = ""; }; 28 | 82573C611BDD64C700549861 /* GSEventTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GSEventTypes.h; sourceTree = ""; }; 29 | 829F155A1B6C5FAB00F8E692 /* GraphicsServices.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GraphicsServices.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 829F155D1B6C5FAB00F8E692 /* GraphicsServices.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GraphicsServices.h; path = GraphicsServices/GraphicsServices.h; sourceTree = ""; }; 31 | 829F155F1B6C5FAB00F8E692 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 829F15651B6C5FCD00F8E692 /* GSBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSBase.h; sourceTree = ""; }; 33 | 829F15671B6C600900F8E692 /* GSEvent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GSEvent.c; sourceTree = ""; }; 34 | 829F15681B6C600900F8E692 /* GSEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSEvent.h; sourceTree = ""; }; 35 | 829F156B1B6C60A300F8E692 /* GSCoreFoundationBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSCoreFoundationBridge.h; sourceTree = ""; }; 36 | 829F156D1B6C67D800F8E692 /* GSPrivate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GSPrivate.c; sourceTree = ""; }; 37 | 829F156E1B6C67D800F8E692 /* GSPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSPrivate.h; sourceTree = ""; }; 38 | 829F15711B6C85EA00F8E692 /* CFBase.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = CFBase.c; sourceTree = ""; }; 39 | 829F15731B6D3D7B00F8E692 /* GSEventQueue.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GSEventQueue.c; sourceTree = ""; }; 40 | 829F15741B6D3D7B00F8E692 /* GSEventQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSEventQueue.h; sourceTree = ""; }; 41 | 829F157C1B6D4CFD00F8E692 /* GSApp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = GSApp.c; sourceTree = ""; }; 42 | 829F157D1B6D4CFD00F8E692 /* GSApp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GSApp.h; sourceTree = ""; }; 43 | /* End PBXFileReference section */ 44 | 45 | /* Begin PBXFrameworksBuildPhase section */ 46 | 829F15561B6C5FAB00F8E692 /* Frameworks */ = { 47 | isa = PBXFrameworksBuildPhase; 48 | buildActionMask = 2147483647; 49 | files = ( 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 829F15501B6C5FAB00F8E692 = { 57 | isa = PBXGroup; 58 | children = ( 59 | 829F155D1B6C5FAB00F8E692 /* GraphicsServices.h */, 60 | 829F155C1B6C5FAB00F8E692 /* GraphicsServices */, 61 | 829F155B1B6C5FAB00F8E692 /* Products */, 62 | ); 63 | indentWidth = 4; 64 | sourceTree = ""; 65 | tabWidth = 4; 66 | usesTabs = 1; 67 | }; 68 | 829F155B1B6C5FAB00F8E692 /* Products */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | 829F155A1B6C5FAB00F8E692 /* GraphicsServices.framework */, 72 | ); 73 | name = Products; 74 | sourceTree = ""; 75 | }; 76 | 829F155C1B6C5FAB00F8E692 /* GraphicsServices */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 829F15651B6C5FCD00F8E692 /* GSBase.h */, 80 | 829F15711B6C85EA00F8E692 /* CFBase.c */, 81 | 829F157C1B6D4CFD00F8E692 /* GSApp.c */, 82 | 829F157D1B6D4CFD00F8E692 /* GSApp.h */, 83 | 829F15671B6C600900F8E692 /* GSEvent.c */, 84 | 829F15681B6C600900F8E692 /* GSEvent.h */, 85 | 82573C611BDD64C700549861 /* GSEventTypes.h */, 86 | 82573C5F1BDD64AD00549861 /* GSEventTypes.def */, 87 | 829F15731B6D3D7B00F8E692 /* GSEventQueue.c */, 88 | 829F15741B6D3D7B00F8E692 /* GSEventQueue.h */, 89 | 829F156D1B6C67D800F8E692 /* GSPrivate.c */, 90 | 829F156E1B6C67D800F8E692 /* GSPrivate.h */, 91 | 829F156B1B6C60A300F8E692 /* GSCoreFoundationBridge.h */, 92 | 829F157B1B6D4C9A00F8E692 /* Supporting Files */, 93 | ); 94 | path = GraphicsServices; 95 | sourceTree = ""; 96 | }; 97 | 829F157B1B6D4C9A00F8E692 /* Supporting Files */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 829F155F1B6C5FAB00F8E692 /* Info.plist */, 101 | ); 102 | name = "Supporting Files"; 103 | sourceTree = ""; 104 | }; 105 | /* End PBXGroup section */ 106 | 107 | /* Begin PBXHeadersBuildPhase section */ 108 | 829F15571B6C5FAB00F8E692 /* Headers */ = { 109 | isa = PBXHeadersBuildPhase; 110 | buildActionMask = 2147483647; 111 | files = ( 112 | 82573C601BDD64AD00549861 /* GSEventTypes.def in Headers */, 113 | 829F157F1B6D4CFD00F8E692 /* GSApp.h in Headers */, 114 | 829F155E1B6C5FAB00F8E692 /* GraphicsServices.h in Headers */, 115 | 82573C621BDD65FD00549861 /* GSEventTypes.h in Headers */, 116 | 829F156C1B6C60A300F8E692 /* GSCoreFoundationBridge.h in Headers */, 117 | 829F15661B6C5FCD00F8E692 /* GSBase.h in Headers */, 118 | 829F15701B6C67D800F8E692 /* GSPrivate.h in Headers */, 119 | 829F15761B6D3D7B00F8E692 /* GSEventQueue.h in Headers */, 120 | 829F156A1B6C600900F8E692 /* GSEvent.h in Headers */, 121 | ); 122 | runOnlyForDeploymentPostprocessing = 0; 123 | }; 124 | /* End PBXHeadersBuildPhase section */ 125 | 126 | /* Begin PBXNativeTarget section */ 127 | 829F15591B6C5FAB00F8E692 /* GraphicsServices */ = { 128 | isa = PBXNativeTarget; 129 | buildConfigurationList = 829F15621B6C5FAB00F8E692 /* Build configuration list for PBXNativeTarget "GraphicsServices" */; 130 | buildPhases = ( 131 | 829F15551B6C5FAB00F8E692 /* Sources */, 132 | 829F15561B6C5FAB00F8E692 /* Frameworks */, 133 | 829F15571B6C5FAB00F8E692 /* Headers */, 134 | 829F15581B6C5FAB00F8E692 /* Resources */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = GraphicsServices; 141 | productName = GraphicsServices; 142 | productReference = 829F155A1B6C5FAB00F8E692 /* GraphicsServices.framework */; 143 | productType = "com.apple.product-type.framework"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 829F15511B6C5FAB00F8E692 /* Project object */ = { 149 | isa = PBXProject; 150 | attributes = { 151 | LastUpgradeCheck = 0900; 152 | ORGANIZATIONNAME = CodaFi; 153 | TargetAttributes = { 154 | 829F15591B6C5FAB00F8E692 = { 155 | CreatedOnToolsVersion = 7.0; 156 | }; 157 | }; 158 | }; 159 | buildConfigurationList = 829F15541B6C5FAB00F8E692 /* Build configuration list for PBXProject "GraphicsServices" */; 160 | compatibilityVersion = "Xcode 3.2"; 161 | developmentRegion = English; 162 | hasScannedForEncodings = 0; 163 | knownRegions = ( 164 | en, 165 | ); 166 | mainGroup = 829F15501B6C5FAB00F8E692; 167 | productRefGroup = 829F155B1B6C5FAB00F8E692 /* Products */; 168 | projectDirPath = ""; 169 | projectRoot = ""; 170 | targets = ( 171 | 829F15591B6C5FAB00F8E692 /* GraphicsServices */, 172 | ); 173 | }; 174 | /* End PBXProject section */ 175 | 176 | /* Begin PBXResourcesBuildPhase section */ 177 | 829F15581B6C5FAB00F8E692 /* Resources */ = { 178 | isa = PBXResourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | }; 184 | /* End PBXResourcesBuildPhase section */ 185 | 186 | /* Begin PBXSourcesBuildPhase section */ 187 | 829F15551B6C5FAB00F8E692 /* Sources */ = { 188 | isa = PBXSourcesBuildPhase; 189 | buildActionMask = 2147483647; 190 | files = ( 191 | 829F157E1B6D4CFD00F8E692 /* GSApp.c in Sources */, 192 | 829F15691B6C600900F8E692 /* GSEvent.c in Sources */, 193 | 829F15751B6D3D7B00F8E692 /* GSEventQueue.c in Sources */, 194 | 829F156F1B6C67D800F8E692 /* GSPrivate.c in Sources */, 195 | 829F15721B6C85EA00F8E692 /* CFBase.c in Sources */, 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | /* End PBXSourcesBuildPhase section */ 200 | 201 | /* Begin XCBuildConfiguration section */ 202 | 829F15601B6C5FAB00F8E692 /* Debug */ = { 203 | isa = XCBuildConfiguration; 204 | buildSettings = { 205 | ALWAYS_SEARCH_USER_PATHS = NO; 206 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 207 | CLANG_CXX_LIBRARY = "libc++"; 208 | CLANG_ENABLE_MODULES = YES; 209 | CLANG_ENABLE_OBJC_ARC = YES; 210 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 211 | CLANG_WARN_BOOL_CONVERSION = YES; 212 | CLANG_WARN_COMMA = YES; 213 | CLANG_WARN_CONSTANT_CONVERSION = YES; 214 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 215 | CLANG_WARN_EMPTY_BODY = YES; 216 | CLANG_WARN_ENUM_CONVERSION = YES; 217 | CLANG_WARN_INFINITE_RECURSION = YES; 218 | CLANG_WARN_INT_CONVERSION = YES; 219 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 220 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 221 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 222 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 223 | CLANG_WARN_STRICT_PROTOTYPES = YES; 224 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 225 | CLANG_WARN_UNREACHABLE_CODE = YES; 226 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 227 | COPY_PHASE_STRIP = NO; 228 | CURRENT_PROJECT_VERSION = 1; 229 | DEBUG_INFORMATION_FORMAT = dwarf; 230 | ENABLE_STRICT_OBJC_MSGSEND = YES; 231 | ENABLE_TESTABILITY = YES; 232 | GCC_C_LANGUAGE_STANDARD = gnu99; 233 | GCC_DYNAMIC_NO_PIC = NO; 234 | GCC_NO_COMMON_BLOCKS = YES; 235 | GCC_OPTIMIZATION_LEVEL = 0; 236 | GCC_PREPROCESSOR_DEFINITIONS = ( 237 | "DEBUG=1", 238 | "$(inherited)", 239 | ); 240 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 241 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 242 | GCC_WARN_UNDECLARED_SELECTOR = YES; 243 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 244 | GCC_WARN_UNUSED_FUNCTION = YES; 245 | GCC_WARN_UNUSED_VARIABLE = YES; 246 | MACOSX_DEPLOYMENT_TARGET = 10.10; 247 | MTL_ENABLE_DEBUG_INFO = YES; 248 | ONLY_ACTIVE_ARCH = YES; 249 | SDKROOT = macosx; 250 | VERSIONING_SYSTEM = "apple-generic"; 251 | VERSION_INFO_PREFIX = ""; 252 | }; 253 | name = Debug; 254 | }; 255 | 829F15611B6C5FAB00F8E692 /* Release */ = { 256 | isa = XCBuildConfiguration; 257 | buildSettings = { 258 | ALWAYS_SEARCH_USER_PATHS = NO; 259 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 260 | CLANG_CXX_LIBRARY = "libc++"; 261 | CLANG_ENABLE_MODULES = YES; 262 | CLANG_ENABLE_OBJC_ARC = YES; 263 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 264 | CLANG_WARN_BOOL_CONVERSION = YES; 265 | CLANG_WARN_COMMA = YES; 266 | CLANG_WARN_CONSTANT_CONVERSION = YES; 267 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 268 | CLANG_WARN_EMPTY_BODY = YES; 269 | CLANG_WARN_ENUM_CONVERSION = YES; 270 | CLANG_WARN_INFINITE_RECURSION = YES; 271 | CLANG_WARN_INT_CONVERSION = YES; 272 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 273 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 274 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 275 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 276 | CLANG_WARN_STRICT_PROTOTYPES = YES; 277 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 278 | CLANG_WARN_UNREACHABLE_CODE = YES; 279 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 280 | COPY_PHASE_STRIP = NO; 281 | CURRENT_PROJECT_VERSION = 1; 282 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 283 | ENABLE_NS_ASSERTIONS = NO; 284 | ENABLE_STRICT_OBJC_MSGSEND = YES; 285 | GCC_C_LANGUAGE_STANDARD = gnu99; 286 | GCC_NO_COMMON_BLOCKS = YES; 287 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 288 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 289 | GCC_WARN_UNDECLARED_SELECTOR = YES; 290 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 291 | GCC_WARN_UNUSED_FUNCTION = YES; 292 | GCC_WARN_UNUSED_VARIABLE = YES; 293 | MACOSX_DEPLOYMENT_TARGET = 10.10; 294 | MTL_ENABLE_DEBUG_INFO = NO; 295 | SDKROOT = macosx; 296 | VERSIONING_SYSTEM = "apple-generic"; 297 | VERSION_INFO_PREFIX = ""; 298 | }; 299 | name = Release; 300 | }; 301 | 829F15631B6C5FAB00F8E692 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | COMBINE_HIDPI_IMAGES = YES; 305 | DEFINES_MODULE = YES; 306 | DYLIB_COMPATIBILITY_VERSION = 1; 307 | DYLIB_CURRENT_VERSION = 1; 308 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 309 | FRAMEWORK_VERSION = A; 310 | INFOPLIST_FILE = GraphicsServices/Info.plist; 311 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 312 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 313 | PRODUCT_BUNDLE_IDENTIFIER = com.CodaFi.GraphicsServices; 314 | PRODUCT_NAME = "$(TARGET_NAME)"; 315 | SKIP_INSTALL = YES; 316 | }; 317 | name = Debug; 318 | }; 319 | 829F15641B6C5FAB00F8E692 /* Release */ = { 320 | isa = XCBuildConfiguration; 321 | buildSettings = { 322 | COMBINE_HIDPI_IMAGES = YES; 323 | DEFINES_MODULE = YES; 324 | DYLIB_COMPATIBILITY_VERSION = 1; 325 | DYLIB_CURRENT_VERSION = 1; 326 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 327 | FRAMEWORK_VERSION = A; 328 | INFOPLIST_FILE = GraphicsServices/Info.plist; 329 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 330 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; 331 | PRODUCT_BUNDLE_IDENTIFIER = com.CodaFi.GraphicsServices; 332 | PRODUCT_NAME = "$(TARGET_NAME)"; 333 | SKIP_INSTALL = YES; 334 | }; 335 | name = Release; 336 | }; 337 | /* End XCBuildConfiguration section */ 338 | 339 | /* Begin XCConfigurationList section */ 340 | 829F15541B6C5FAB00F8E692 /* Build configuration list for PBXProject "GraphicsServices" */ = { 341 | isa = XCConfigurationList; 342 | buildConfigurations = ( 343 | 829F15601B6C5FAB00F8E692 /* Debug */, 344 | 829F15611B6C5FAB00F8E692 /* Release */, 345 | ); 346 | defaultConfigurationIsVisible = 0; 347 | defaultConfigurationName = Release; 348 | }; 349 | 829F15621B6C5FAB00F8E692 /* Build configuration list for PBXNativeTarget "GraphicsServices" */ = { 350 | isa = XCConfigurationList; 351 | buildConfigurations = ( 352 | 829F15631B6C5FAB00F8E692 /* Debug */, 353 | 829F15641B6C5FAB00F8E692 /* Release */, 354 | ); 355 | defaultConfigurationIsVisible = 0; 356 | defaultConfigurationName = Release; 357 | }; 358 | /* End XCConfigurationList section */ 359 | }; 360 | rootObject = 829F15511B6C5FAB00F8E692 /* Project object */; 361 | } 362 | --------------------------------------------------------------------------------