Search
lxdream.org :: lxdream/src/cocoaui/cocoa_win.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoa_win.c
changeset 736:a02d1475ccfd
prev705:03dd1ea35c69
next738:0cbff49086b8
author nkeynes
date Mon Jul 14 07:44:42 2008 +0000 (13 years ago)
permissions -rw-r--r--
last change Re-indent everything consistently
Fix include guards for consistency as well
file annotate diff log raw
1.1 --- a/src/cocoaui/cocoa_win.c Wed Jun 25 00:39:02 2008 +0000
1.2 +++ b/src/cocoaui/cocoa_win.c Mon Jul 14 07:44:42 2008 +0000
1.3 @@ -29,7 +29,8 @@
1.4 NSDictionary *items;
1.5 }
1.6 - (NSToolbarItem *) createToolbarItem: (NSString *)id label: (NSString *) label
1.7 - tooltip: (NSString *)tooltip icon: (NSString *)icon action: (SEL) action;
1.8 + tooltip: (NSString *)tooltip
1.9 + icon: (NSString *)icon action: (SEL) action;
1.10 @end
1.11
1.12 @implementation LxdreamToolbarDelegate
1.13 @@ -45,27 +46,27 @@
1.14 tooltip: @"Pause dreamcast" icon: @"tb-pause"
1.15 action: @selector(pause_action:)];
1.16 NSToolbarItem *run = [self createToolbarItem: @"Run" label: @"Resume"
1.17 - tooltip: @"Resume" icon: @"tb-run"
1.18 - action: @selector(run_action:)];
1.19 + tooltip: @"Resume" icon: @"tb-run"
1.20 + action: @selector(run_action:)];
1.21 NSToolbarItem *load = [self createToolbarItem: @"LoadState" label: @"Load State..."
1.22 - tooltip: @"Load an lxdream save state" icon: @"tb-load"
1.23 - action: @selector(load_action:)];
1.24 + tooltip: @"Load an lxdream save state" icon: @"tb-load"
1.25 + action: @selector(load_action:)];
1.26 NSToolbarItem *save = [self createToolbarItem: @"SaveState" label: @"Save State..."
1.27 - tooltip: @"Create an lxdream save state" icon: @"tb-save"
1.28 - action: @selector(save_action:)];
1.29 + tooltip: @"Create an lxdream save state" icon: @"tb-save"
1.30 + action: @selector(save_action:)];
1.31 [pause setEnabled: NO];
1.32 identifiers =
1.33 [NSArray arrayWithObjects: @"GdromMount", @"Reset", @"Pause", @"Run", @"LoadState", @"SaveState", nil ];
1.34 defaults =
1.35 [NSArray arrayWithObjects: @"GdromMount", @"Reset", @"Pause", @"Run",
1.36 - NSToolbarSeparatorItemIdentifier, @"LoadState", @"SaveState", nil ];
1.37 + NSToolbarSeparatorItemIdentifier, @"LoadState", @"SaveState", nil ];
1.38 NSArray *values = [NSArray arrayWithObjects: mount, reset, pause, run, load, save, nil ];
1.39 items = [NSDictionary dictionaryWithObjects: values forKeys: identifiers];
1.40 return self;
1.41 }
1.42
1.43 - (NSToolbarItem *) createToolbarItem: (NSString *)id label: (NSString *) label
1.44 - tooltip: (NSString *)tooltip icon: (NSString *)icon action: (SEL) action
1.45 +tooltip: (NSString *)tooltip icon: (NSString *)icon action: (SEL) action
1.46 {
1.47 NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier: id];
1.48 [item setLabel: label];
1.49 @@ -94,9 +95,9 @@
1.50 }
1.51
1.52 - (NSToolbarItem *) toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier
1.53 - willBeInsertedIntoToolbar:(BOOL)flag
1.54 +willBeInsertedIntoToolbar:(BOOL)flag
1.55 {
1.56 - return [items objectForKey: itemIdentifier];
1.57 + return [items objectForKey: itemIdentifier];
1.58 }
1.59 @end
1.60
1.61 @@ -106,16 +107,16 @@
1.62 NSRect contentRect = NSMakeRect(videoRect.origin.x,videoRect.origin.y,
1.63 videoRect.size.width,videoRect.size.height+STATUSBAR_HEIGHT);
1.64 if( [super initWithContentRect: contentRect
1.65 - styleMask: ( NSTitledWindowMask | NSClosableWindowMask |
1.66 - NSMiniaturizableWindowMask | NSResizableWindowMask |
1.67 - NSUnifiedTitleAndToolbarWindowMask )
1.68 - backing: NSBackingStoreBuffered defer: NO ] == nil ) {
1.69 + styleMask: ( NSTitledWindowMask | NSClosableWindowMask |
1.70 + NSMiniaturizableWindowMask | NSResizableWindowMask |
1.71 + NSUnifiedTitleAndToolbarWindowMask )
1.72 + backing: NSBackingStoreBuffered defer: NO ] == nil ) {
1.73 return nil;
1.74 } else {
1.75 isGrabbed = NO;
1.76 video = video_osx_create_drawable();
1.77 [video setFrameOrigin: NSMakePoint(0.0,STATUSBAR_HEIGHT)];
1.78 -
1.79 +
1.80 status =
1.81 [[NSTextField alloc] initWithFrame: NSMakeRect(0.0,0.0,videoRect.size.width,STATUS_TEXT_HEIGHT)];
1.82 [status setStringValue: @"Idle"];
1.83 @@ -185,7 +186,7 @@
1.84
1.85 NSWindow *cocoa_gui_create_main_window()
1.86 {
1.87 - NSRect contentRect = {{0,0},{640,480}};
1.88 - NSWindow *main_win = [[LxdreamMainWindow alloc] initWithContentRect: contentRect];
1.89 - return main_win;
1.90 + NSRect contentRect = {{0,0},{640,480}};
1.91 + NSWindow *main_win = [[LxdreamMainWindow alloc] initWithContentRect: contentRect];
1.92 + return main_win;
1.93 }
.