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