mirror of https://github.com/BOINC/boinc.git
lib: Mac: continue replacing deprecated Mac APIs
This commit is contained in:
parent
4e9cc22f6b
commit
a8252e983e
|
@ -102,6 +102,8 @@ public:
|
|||
};
|
||||
|
||||
#ifdef __APPLE__
|
||||
int get_system_uptime();
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
double getTimeSinceBoot(void);
|
||||
void getPathToThisApp(char* pathBuf, size_t bufSize);
|
||||
void BringAppToFront();
|
||||
void BringAppWithPidToFront(pid_t pid);
|
||||
pid_t getPidIfRunning(char * bundleID);
|
||||
|
||||
#endif // _MAC_UTIL_H_
|
||||
|
|
|
@ -43,6 +43,11 @@ void BringAppToFront() {
|
|||
}
|
||||
|
||||
|
||||
void BringAppWithPidToFront(pid_t pid) {
|
||||
[ [NSRunningApplication runningApplicationWithProcessIdentifier:pid] activateWithOptions:NSApplicationActivateIgnoringOtherApps | NSApplicationActivateAllWindows ];
|
||||
}
|
||||
|
||||
|
||||
pid_t getPidIfRunning(char * bundleID) {
|
||||
NSString *NSBundleID = [[NSString alloc] initWithUTF8String:bundleID];
|
||||
NSArray * runningApps = [NSRunningApplication runningApplicationsWithBundleIdentifier:NSBundleID];
|
||||
|
|
Loading…
Reference in New Issue