资源简介
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
相关资源
- robocup机器人大赛——足球机器人
- Serv-U FTP Server V6.3.0.1 汉化绿色破解版
- OPC Server仿真模拟器
- WindowsServer2016管理员操作手册
- fileZilla_Server 中文版与英文版
- jmeter serverAgent-2.2.1
- Windows端Frp服务器一键搭建
- VisualSVN Server 2.7.6
- ServerAgent-2.2.1
- FactorySoft OPC Server Toolkit
- KEPServerEX6 data logger中文说明书完整版
- ESP8266的 TCP通信(server)
- Windows+Server+2008中安装Exchange+Server+20
- Project server 2007中文版完全安装
- Apache FTPServer的配置与使用&API
- MDaemon Server 11.0.3 简体中文破解补丁
- TFS(Team Foundation Server)配置使用和迁
- kepServerEX6.4破解
- .NET3层架构家庭理财系统,内含水晶报
- Robocup入门资料
- Api-server.zip
- window server 2008 安装及设置优化图解
- 配置TCPIP SimaticNetV6.0和Intouch7.11 IOSer
- modbus TCPIP协议client-Server端源代码以及
- IEDriverServer_x64_2.53.1.zip
- WINDOWS SERVER 2008 IIS负载均衡群集搭建
- 联想ThinkServer RD330 RAID卡配置指导.do
- rabbitmq-server-3.7.12
- Webserver Stress Tool 8.0.0.1010 Setup (Free
- FileZilla Server beta 0.9.43
评论
共有 条评论