cinder/Cinder — pull request #399 by pizthewiz (2014-01-07 19:25:24+00:00)
Title: Expose API to interact with OS X 10.9 App Nap

Simple API added to `AppBasic` to expose the new API added in 10.9 to `NSProcessInfo`, that is used to provide hints to the system on an application's special needs. Without hooks into this API, applications are subject to the default OS behavior, which might compromise specific performance needs a Cinder application may have. The behavior is opt-in so Cinder applications don't have a process entitlement complex by default. I have *not* measured the impact for something like receiving OSC messages, but it should be done to better understand the need.

While the OS exposes [several behavioral constants](https://developer.apple.com/library/ios/documentation/cocoa/reference/foundation/Classes/NSProcessInfo_Class/Reference/Reference.html#//apple_ref/c/tdef/NSActivityOptions) the proposed change is limited to the following: `NSActivityIdleSystemSleepDisabled | NSActivitySuddenTerminationDisabled `

One hassle of the proposed is that one must cast to get at it:
```C++
void DisplayApp::setup() {
((AppBasic*)App::get())->beginActivity("OSC I/O and maintain display output");
}
```

It isn't entirely clear to me what platforms Cinder supports for compilation so I'll assume it is the same as execution and the new API is only exposed while complex against the 10.9 SDK or newer. Execution on older OS releases should be fine as it checks if the `NSProcessInfo` instance responds to the new selectors before messaging it.

Compile tested on:
- 10.9.1 Xcode 5.1 DP2 with 10.9 Base SDK / 10.7 Deployment SDK
- 10.9.1 Xcode 5.1 DP2 with 10.8 Base SDK / 10.7 Deployment SDK
- 10.8.5 Xcode 5.0.2 with 10.9 Base SDK / 10.7 Deployment SDK
- 10.8.5 Xcode 5.0.2 with 10.8 Base SDK / 10.7 Deployment SDK

Execution tested with app built with 10.9 Base SDK run on 10.9.1 and 10.8.5.