资源简介
robocup rescue server
代码片段和文件信息
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser
Non-NIB-Code & other changes: Max Horn
Feel free to customize this file to suit your needs
*/
#import “SDL.h“
#import “SDLMain.h“
#import /* for MAXPATHLEN */
#import
/* For some reaon Apple removed setAppleMenu from the headers in 10.4
but the method still is there and works. To avoid warnings we declare
it ourselves here. */
@interface NSApplication(SDL_Missing_Methods)
- (void)setAppleMenu:(NSMenu *)menu;
@end
/* Use this flag to determine whether we use SDLMain.nib or not */
#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 char **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
static NSString *getApplicationName(void)
{
NSDictionary *dict;
NSString *appName = 0;
/* Determine the application name */
dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
appName = [dict objectForKey: @“CFBundleName“];
if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
return appName;
}
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#endif
@interface SDLApplication : NSApplication
@end
@implementation SDLApplication
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end
/* The main class of the application the application‘s delegate */
@implementation SDLMain
/* Set the working directory to the .app‘s parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
if (shouldChdir)
{
char parentdir[MAXPATHLEN];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0 url);
if (CFURLGetFileSystemRepresentation(url2 true (UInt8 *)parentdir MAXPATHLEN)) {
assert ( chdir (parentdir) == 0 ); /* chdir to the binary app‘s parent */
}
CFRelease(url);
CFRelease(url2);
}
}
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of “SDL App“ */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuIte
相关资源
- USB.Over.Network.Server 注册机
- Uninstall_Cortana_WINCLIENT.CN.rar
- B/S 网上订餐系统
- 代码客:G-TcpServer(IOCP) 1.0 正式版及
- 用IdFTPServer写的一个FTPServer程序
- Radmin Server-3.5 完美绿色破解版x32 x64通
- Linux版的telnet安装包telnet、telnet-serv
- Intel(R) 82579V网卡驱动for server20033
- 最好用的FTP服务器
- 基于IBM eserver x440+FAStT700+VMware的系统整
- IBM CAW for Microsoft Cluster Server 简介
- 飞康NSS、CDP力保Windows Server 2008数据迁
- 64bit.server2008或win10下安装git服务器
- VisualSVN Server 4.0.0 企业破解版
- 网上购物商城系统完整版
- Server 2008R2 AD服务器搭建图解
- Windows Server 2012 R2 上部署与安装AD域
- eServer z 系列服务器数据挖掘解决方案
- SAP Business One 中文版 + IBM eServer x 系列
- IBM eServer xSeries 445 EXP400在Linux下的双
- IBM eServer xSeries 365 EXP400在Windwos下的双
- IBM eServer xSeries 电信服务器
- 联想System X 3650 M5210RAID卡驱动 for ser
- WindowsServer2003.WindowsXP-KB926139-v2-x64-EN
- Wing FTP Server FTP服务器 v6.1.9
- Coinstor Backup Server数据容灾解决方案
-
HP Integrity Non
stop NS14000 Server产品手册 - telnet-server-0.17-25.i386.rpm
- VSuite Ramdisk Server V4.6.7 真正破解版(修
- IBM eServer zSeries力助德国电信屹立世界
评论
共有 条评论