From 01f3d318e14048f3de7f548203e7df45df3914c1 Mon Sep 17 00:00:00 2001 From: FredKiefer Date: Sat, 12 Feb 2005 18:15:25 +0000 Subject: [PATCH] Added basic implementation for window alpha handling. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20697 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Headers/Additions/GNUstepGUI/GSDisplayServer.h | 1 + Source/GSDisplayServer.m | 6 ++++++ Source/NSWindow.m | 7 +++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 750b92f3d..ee9ae1bdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-02-12 Fred Kiefer + + * Headers/Additions/GNUstepGUI/GSDisplayServer.h (-setalpha::): Declare. + * Source/GSDisplayServer.m (-setalpha::): New method for window + alpha setting, with empty default implementation. + * Source/NSWindow.m (-setAlphaValue:): Implemented alpha setting + via display server. + (-_initDefaults): Set _alphaValue to 1.0. + 2005-02-12 Fred Kiefer * Model/GMAppKit.m (NSButtonCell-initWithModelUnarchiver:): diff --git a/Headers/Additions/GNUstepGUI/GSDisplayServer.h b/Headers/Additions/GNUstepGUI/GSDisplayServer.h index 46e92cf32..d9f955f11 100644 --- a/Headers/Additions/GNUstepGUI/GSDisplayServer.h +++ b/Headers/Additions/GNUstepGUI/GSDisplayServer.h @@ -142,6 +142,7 @@ APPKIT_EXPORT NSString * GSScreenNumber; - (void) docedited: (int) edited : (int) win; - (void) setinputstate: (int)state : (int)win; - (void) setinputfocus: (int) win; +- (void) setalpha: (float)alpha: (int) win; - (NSPoint) mouselocation; - (NSPoint) mouseLocationOnScreen: (int)aScreen window: (int *)win; diff --git a/Source/GSDisplayServer.m b/Source/GSDisplayServer.m index 4d2112a16..7f66d22ff 100644 --- a/Source/GSDisplayServer.m +++ b/Source/GSDisplayServer.m @@ -706,6 +706,12 @@ GSCurrentServer(void) [self subclassResponsibility: _cmd]; } +/** Sets the transparancy value for the whole window */ +- (void) setalpha: (float)alpha: (int) win +{ + //[self subclassResponsibility: _cmd]; +} + /** Returns the current mouse location on the default screen. If the pointer is not on the default screen, an invalid point (-1,-1} is returned. */ diff --git a/Source/NSWindow.m b/Source/NSWindow.m index f48b3267a..569f2173a 100644 --- a/Source/NSWindow.m +++ b/Source/NSWindow.m @@ -1106,8 +1106,11 @@ many times. - (void) setAlphaValue: (float)windowAlpha { - // FIXME _alphaValue = windowAlpha; + if (_windowNum) + { + [GSServerForWindow(self) setalpha: _alphaValue : _windowNum]; + } } - (float) alphaValue @@ -4209,7 +4212,7 @@ resetCursorRectsForView(NSView *theView) _depthLimit = NSDefaultDepth; _disableFlushWindow = 0; - _alphaValue = 0.0; + _alphaValue = 1.0; _f.is_one_shot = NO; _f.is_autodisplay = YES;