Commit b6532660 authored by Sam Lantinga's avatar Sam Lantinga

Tell the dock about command-line launched applications

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40477
parent 9f74acc7
...@@ -13,6 +13,21 @@ ...@@ -13,6 +13,21 @@
/* Use this flag to determine whether we use SDLMain.nib or not */ /* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0 #define SDL_USE_NIB_FILE 0
/* Use this flag to determine whether we use CPS (docking) or not */
#define SDL_USE_CPS 1
#ifdef SDL_USE_CPS
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
#endif /* SDL_USE_CPS */
static int gArgc; static int gArgc;
static char **gArgv; static char **gArgv;
...@@ -162,6 +177,17 @@ void CustomApplicationMain (argc, argv) ...@@ -162,6 +177,17 @@ void CustomApplicationMain (argc, argv)
/* Ensure the application object is initialised */ /* Ensure the application object is initialised */
[SDLApplication sharedApplication]; [SDLApplication sharedApplication];
#ifdef SDL_USE_CPS
{
CPSProcessSerNum PSN;
/* Tell the dock about us */
if (!CPSGetCurrentProcess(&PSN))
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
if (!CPSSetFrontProcess(&PSN))
[SDLApplication sharedApplication];
}
#endif /* SDL_USE_CPS */
/* Set up the menubar */ /* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]]; [NSApp setMainMenu:[[NSMenu alloc] init]];
setupAppleMenu(); setupAppleMenu();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment