Search
lxdream.org :: lxdream/src/cocoaui/cocoa_win.m :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/cocoaui/cocoa_win.m
changeset 1028:f99eeaf084c2
prev964:f2f3c7612d06
next1098:4f2750753a6c
author nkeynes
date Sun Jun 14 11:44:19 2009 +0000 (10 years ago)
permissions -rw-r--r--
last change Add fullscreen support
file annotate diff log raw
1.1 --- a/src/cocoaui/cocoa_win.m Thu Jan 15 04:15:11 2009 +0000
1.2 +++ b/src/cocoaui/cocoa_win.m Sun Jun 14 11:44:19 2009 +0000
1.3 @@ -21,6 +21,7 @@
1.4 #include "dreamcast.h"
1.5 #include "gdrom/gdrom.h"
1.6 #include <ApplicationServices/ApplicationServices.h>
1.7 +#include <Carbon/Carbon.h>
1.8
1.9 @interface NSWindow (OSX10_5_and_later)
1.10 #ifndef CGFLOAT_DEFINED
1.11 @@ -207,6 +208,29 @@
1.12 [self setStatusText: _("Stopped")];
1.13 }
1.14 }
1.15 +- (BOOL)isFullscreen
1.16 +{
1.17 + return isFullscreen;
1.18 +}
1.19 +- (void)setFullscreen:(BOOL)full
1.20 +{
1.21 + if( full != isFullscreen ) {
1.22 + isFullscreen = full;
1.23 +
1.24 + if( full ) {
1.25 + savedFrame = [self frame];
1.26 + SetSystemUIMode( kUIModeAllHidden, 0 );
1.27 + NSRect screenRect = [[NSScreen mainScreen] frame];
1.28 + screenRect.size.height += STATUSBAR_HEIGHT;
1.29 + screenRect.origin.y -= STATUSBAR_HEIGHT;
1.30 + NSRect targetRect = [self frameRectForContentRect: screenRect];
1.31 + [self setFrame: targetRect display: YES];
1.32 + } else {
1.33 + SetSystemUIMode( kUIModeNormal, 0 );
1.34 + [self setFrame: savedFrame display: YES];
1.35 + }
1.36 + }
1.37 +}
1.38 - (BOOL)isGrabbed
1.39 {
1.40 return isGrabbed;
1.41 @@ -249,6 +273,10 @@
1.42 [self setIsGrabbed: NO];
1.43 return useGrab ? self : nil;
1.44 }
1.45 +- (NSRect)constrainFrameRect:(NSRect)frameRect toScreen:(NSScreen *)aScreen
1.46 +{
1.47 + return frameRect;
1.48 +}
1.49 @end
1.50
1.51 LxdreamMainWindow *cocoa_gui_create_main_window()
.