From 43faeba934276e0490d80242520fad9cb33c9989 Mon Sep 17 00:00:00 2001 From: Adam Fedor Date: Tue, 14 Sep 1999 21:40:29 +0000 Subject: [PATCH] Update for MacOSX git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4895 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 5 +++++ Headers/gnustep/gui/NSScreen.h | 5 +++++ Source/NSScreen.m | 36 +++++++++++++++++++++++++++++++--- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 31c037075..742bc22b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1999-09-13 Pedro Ivo Andrade Tavares + + * NSScreen.m: added the Mac OS X messages -visibleFrame: and + -supportedWindowDepths. The messages are not generalized right now. + 1999-09-14 Adam Fedor * Source/NSCell.m ([NSCell diff --git a/Headers/gnustep/gui/NSScreen.h b/Headers/gnustep/gui/NSScreen.h index aba881f8a..45a1fdf1f 100644 --- a/Headers/gnustep/gui/NSScreen.h +++ b/Headers/gnustep/gui/NSScreen.h @@ -61,6 +61,11 @@ - (NSRect)frame; - (NSDictionary *)deviceDescription; +#ifndef STRICT_OPENSTEP +- (const NSWindowDepth*) supportedWindowDepths; +- (NSRect) visibleFrame; +#endif + @end #ifndef NO_GNUSTEP diff --git a/Source/NSScreen.m b/Source/NSScreen.m index 3493637d7..c04897410 100644 --- a/Source/NSScreen.m +++ b/Source/NSScreen.m @@ -28,7 +28,10 @@ #include #include +#include +#include #include +#include @@ -37,7 +40,7 @@ // // Class variables // -NSScreen *mainScreen = nil; +static NSScreen *mainScreen = nil; // // Class methods @@ -66,12 +69,12 @@ NSScreen *mainScreen = nil; + (NSScreen *)deepestScreen { - return nil; + return [self mainScreen]; } + (NSArray *)screens { - return nil; + return [NSArray arrayWithObject: [self mainScreen]]; } // @@ -114,4 +117,31 @@ NSDictionary *d = [[NSDictionary alloc] initWithDictionary: device_desc]; return d; } +// Mac OS X methods +- (const NSWindowDepth*) supportedWindowDepths +{ + // Skeletal implementation + NSWindowDepth* retval = NSZoneMalloc([self zone], sizeof(NSWindowDepth)*2); + retval[1] = depth; + retval[2] = 0; + return retval; +} + +-(NSRect) visibleFrame +{ + NSRect visFrame = frame; + switch ([NSApp interfaceStyle]) + { + case NSMacintoshInterfaceStyle: + // What is the size of the Mac menubar? + visFrame.size.height -= 25; + return visFrame; + case NSWindows95InterfaceStyle: + case NSNextStepInterfaceStyle: + case NSNoInterfaceStyle: + default: + return frame; + } +} + @end