Application compiles and runs, with some caveats. Full list of changes: - minor changes related to Qt4->Qt5 API differences - Replaced calls to Carbon framework by Cocoa - Removed registering of AE event handler. Seems to be done automatically in Qt5. - temporarily removed Podcast functionality, pending (presumably) complete re-write due to Quicktime being obsolete in newer OS X versions. - Created OBCocoa namespace, and associated files src/core/OBCocoa.h/.mm, to handle OS X - specific system calls. Currently used only by UBApplication, but can in the future provide a useful interface between the cocoa framework and OB, to avoid having too much OSX-specific code in various filespreferencesAboutTextFull
parent
7a4e9d2e83
commit
91cc74fbd7
@ -0,0 +1,11 @@ |
|||||||
|
/*
|
||||||
|
OBCocoa.h |
||||||
|
|
||||||
|
Header file permitting access to Mac OSX / Cocoa specific functions |
||||||
|
|
||||||
|
*/ |
||||||
|
|
||||||
|
|
||||||
|
namespace OBCocoa { |
||||||
|
void setFrontProcess(); |
||||||
|
} |
@ -0,0 +1,24 @@ |
|||||||
|
#include "OBCocoa.h" |
||||||
|
#include "UBApplicationController.h" |
||||||
|
|
||||||
|
#include <QDebug> |
||||||
|
#import <Cocoa/Cocoa.h> |
||||||
|
|
||||||
|
namespace OBCocoa { |
||||||
|
|
||||||
|
/** |
||||||
|
* @brief Activate the current application |
||||||
|
*/ |
||||||
|
void setFrontProcess() |
||||||
|
{ |
||||||
|
NSRunningApplication* app = [NSRunningApplication currentApplication]; |
||||||
|
|
||||||
|
// activate the application, forcing focus on it |
||||||
|
[app activateWithOptions: NSApplicationActivateIgnoringOtherApps]; |
||||||
|
|
||||||
|
// other option:NSApplicationActivateAllWindows. This won't steal focus from another app, e.g |
||||||
|
// if the user is doing something else while waiting for OpenBoard to load |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} // namespace OBCocoa |
Loading…
Reference in new issue