Mercurial > sdl-ios-xcode
comparison src/video/quartz/SDL_QuartzWM.m @ 158:4382c38dfbee
Date: Tue, 21 Aug 2001 03:50:01 +0200
From: Max Horn <max@quendi.de>
Subject: New patch for OS X
Attached a .patch file for SDL/OSX with some nice bug fixes / enhancments.
* fixes the activation issues, which also caused the window to be
always drawn like an inactive. The close/minimize widgets now are
animated properly, too.
* the menu items are automatically adjusted to use the app name
instead of just "SDL App". I did this so that we really can use one
central SDLMain.nib file, w/o requiring developers to make a copy of
it and adjust it.
* libSDLMain now contains the proper cocoa code, not as before the
carbon code. This means apps no longer have to carry a copy of
SDLMain.m/SDLMain.h
* revamped configure.in to properly build a Cocoa/Quartz SDL lib, not
a Carbon based SDL lib
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 21 Aug 2001 07:19:59 +0000 |
parents | bd6b0a910a65 |
children | e92aa316c517 |
comparison
equal
deleted
inserted
replaced
157:de04f423389a | 158:4382c38dfbee |
---|---|
94 CGDisplayMoveCursorToPoint(display_id, p); | 94 CGDisplayMoveCursorToPoint(display_id, p); |
95 else { | 95 else { |
96 /* Convert to absolute screen coordinates */ | 96 /* Convert to absolute screen coordinates */ |
97 NSPoint base, screen; | 97 NSPoint base, screen; |
98 base = NSMakePoint (p.x, p.y); | 98 base = NSMakePoint (p.x, p.y); |
99 screen = [ window convertBaseToScreen:base ]; | 99 screen = [ qz_window convertBaseToScreen:base ]; |
100 p.x = screen.x; | 100 p.x = screen.x; |
101 p.y = device_height - screen.y; | 101 p.y = device_height - screen.y; |
102 CGDisplayMoveCursorToPoint (display_id, p); | 102 CGDisplayMoveCursorToPoint (display_id, p); |
103 } | 103 } |
104 } | 104 } |
120 static void QZ_MoveWMCursor (_THIS, int x, int y) { } | 120 static void QZ_MoveWMCursor (_THIS, int x, int y) { } |
121 static void QZ_CheckMouseMode (_THIS) { } | 121 static void QZ_CheckMouseMode (_THIS) { } |
122 | 122 |
123 static void QZ_SetCaption (_THIS, const char *title, const char *icon) { | 123 static void QZ_SetCaption (_THIS, const char *title, const char *icon) { |
124 | 124 |
125 if ( window != nil ) { | 125 if ( qz_window != nil ) { |
126 NSString *string; | 126 NSString *string; |
127 if ( title != NULL ) { | 127 if ( title != NULL ) { |
128 string = [ [ NSString alloc ] initWithCString:title ]; | 128 string = [ [ NSString alloc ] initWithCString:title ]; |
129 [ window setTitle:string ]; | 129 [ qz_window setTitle:string ]; |
130 [ string release ]; | 130 [ string release ]; |
131 } | 131 } |
132 if ( icon != NULL ) { | 132 if ( icon != NULL ) { |
133 string = [ [ NSString alloc ] initWithCString:icon ]; | 133 string = [ [ NSString alloc ] initWithCString:icon ]; |
134 [ window setMiniwindowTitle:string ]; | 134 [ qz_window setMiniwindowTitle:string ]; |
135 [ string release ]; | 135 [ string release ]; |
136 } | 136 } |
137 } | 137 } |
138 } | 138 } |
139 | 139 |
142 } | 142 } |
143 | 143 |
144 static int QZ_IconifyWindow (_THIS) { | 144 static int QZ_IconifyWindow (_THIS) { |
145 | 145 |
146 /* Bug! minimize erases the framebuffer */ | 146 /* Bug! minimize erases the framebuffer */ |
147 if ( ! [ window isMiniaturized ] ) { | 147 if ( ! [ qz_window isMiniaturized ] ) { |
148 [ window miniaturize:nil ]; | 148 [ qz_window miniaturize:nil ]; |
149 return 1; | 149 return 1; |
150 } | 150 } |
151 else { | 151 else { |
152 SDL_SetError ("window already iconified"); | 152 SDL_SetError ("qz_window already iconified"); |
153 return 0; | 153 return 0; |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 /* | 157 /* |
158 static int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info) { | 158 static int QZ_GetWMInfo (_THIS, SDL_SysWMinfo *info) { |
159 info->nsWindowPtr = window; | 159 info->nsWindowPtr = qz_window; |
160 return 0; | 160 return 0; |
161 }*/ | 161 }*/ |
162 | 162 |
163 static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode) { | 163 static SDL_GrabMode QZ_GrabInput (_THIS, SDL_GrabMode grab_mode) { |
164 | 164 |