ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/Controller.mm
(Generate patch)

Comparing BasiliskII/src/MacOSX/Controller.mm (file contents):
Revision 1.4 by nigel, 2002-05-30T12:50:21Z vs.
Revision 1.8 by nigel, 2003-03-26T00:20:54Z

# Line 33 | Line 33
33   #define DEBUG 0
34   #import <debug.h>
35  
36 + #import "misc_macosx.h"
37   #import "video_macosx.h"
38  
39   //
# Line 42 | Line 43
43   - (id) init
44   {
45   #ifdef ENABLE_MULTIPLE
46 <        emulators  = [[NSMutableArray alloc] init];
46 >        emulators  = [NSMutableArray new];
47   #endif
48          return [super init];
49   }
# Line 192 | Line 193
193                                    type: (NSEventType)type                              
194   {
195          EmulatorView    *view;
196 +        BOOL                    fullScreen;
197  
198   #ifdef ENABLE_MULTIPLE
199          // We need to work out what window's Emulator should receive these messages
# Line 203 | Line 205
205          {
206                  theEmulator = [emulators objectAtIndex: tmp];
207                  view = [theEmulator screen];
208 +                fullScreen = [view isFullScreen];
209  
210                  if ( [theEmulator isRunning] &&
211 <                                ( [[theEmulator window] isMainWindow] || [view isFullScreen] ) )
211 >                                ( fullScreen || [[theEmulator window] isMainWindow] ) )
212                          break;
213          }
214          
215          if ( tmp < [emulators count] )          // i.e. if we exited the for loop
216   #else
217          view = [theEmulator screen];
218 +        fullScreen = [view isFullScreen];
219  
220          if ( [theEmulator isRunning] &&
221 <                                ( [[theEmulator window] isMainWindow] || [view isFullScreen] ) )
221 >                                ( fullScreen || [[theEmulator window] isMainWindow] ) )
222   #endif
223          {
224 <                if ( [view mouseInView: event] )
224 >                if ( fullScreen || [view mouseInView: event] )
225                  {
226                          switch ( type )
227                          {
# Line 229 | Line 233
233                                          break;
234                                  case NSLeftMouseDragged:
235                                  case NSMouseMoved:
236 <                                        [view processMouseMove: event];
236 >                                        if ( fullScreen )
237 >                                                [view fullscreenMouseMove];
238 >                                        else
239 >                                                [view processMouseMove: event];
240                                          break;
241                                  default:
242                                          [super sendEvent: event];               // NSApplication default
# Line 248 | Line 255
255                  [super sendEvent: event];
256   }
257  
258 +
259 + // Methods to display documentation:
260 +
261 + - (IBAction) HelpHowTo: (id)sender
262 + {
263 +    NSString    *path = [[NSBundle mainBundle] pathForResource: @"HowTo"
264 +                                                        ofType: @"html"];
265 +
266 +    if ( ! path )
267 +        InfoSheet(@"Cannot find HowTo.html", [theEmulator window]);
268 +    else
269 +        if ( ! [[NSWorkspace sharedWorkspace] openFile: path
270 +                                       withApplication: @"TextEdit"] )
271 +            InfoSheet(@"Cannot open HowTo.html with TextEdit", [theEmulator window]);
272 + }
273 +
274 + - (IBAction) HelpToDo: (id)sender
275 + {
276 +    NSString    *path = [[NSBundle mainBundle] pathForResource: @"ToDo"
277 +                                                        ofType: @"html"];
278 +
279 +    if ( ! path )
280 +        InfoSheet(@"Cannot find ToDo.html", [theEmulator window]);
281 +    else
282 +        if ( ! [[NSWorkspace sharedWorkspace] openFile: path
283 +                                       withApplication: @"TextEdit"] )
284 +            InfoSheet(@"Cannot open ToDo.html with TextEdit", [theEmulator window]);
285 + }
286 +
287 + - (IBAction) HelpVersions: (id)sender
288 + {
289 +    NSString    *path = [[NSBundle mainBundle] pathForResource: @"Versions"
290 +                                                        ofType: @"html"];
291 +
292 +    if ( ! path )
293 +        InfoSheet(@"Cannot find Versions.html", [theEmulator window]);
294 +    else
295 +        if ( ! [[NSWorkspace sharedWorkspace] openFile: path
296 +                                       withApplication: @"TextEdit"] )
297 +            InfoSheet(@"Cannot open Versions.html with TextEdit",
298 +                                                                                                [theEmulator window]);
299 + }
300 +
301 +
302 + // Menu items which for managing more than one window
303 +
304   #ifdef ENABLE_MULTIPLE
305  
306   - (IBAction) NewEmulator: (id)sender

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines