Allow to switch off the showing of the applications icon.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22892 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2006-05-10 21:48:15 +00:00
parent 8952b82d93
commit b6341d6e1a
4 changed files with 56 additions and 39 deletions

View file

@ -1,3 +1,12 @@
2006-05-10 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSApplication.m (-finishLaunching): Don't display the
application icon window if the GSDontShowAppIcon is set to YES.
Patch by Saso Kiselkov <diablos@manga.sk>.
* Documentation/GuiUser/DefaultsSuppary.gsdoc: Document GSDontShowAppIcon.
* Source/GSDragView.m: Resorted method definitions to remove
compiler warnings.
2006-05-10 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSBundleAdditions.m: ([loadNibNamed:owner:]) if the NIB can't

View file

@ -194,6 +194,14 @@
application. This is a new feature and has not been tested.
</p>
</desc>
<term>GSDontShowAppIcon</term>
<desc>
<p>
A boolean value, <code>NO</code> by default. Specifies wether the
application icon window should be displayed. Set to <code>YES</code>
for background server applications.
</p>
</desc>
<term>NSInterfaceStyleDefault</term>
<desc>
<p>

View file

@ -69,6 +69,7 @@
position: (NSPoint)eventLocation
timestamp: (NSTimeInterval)time
toWindow: (NSWindow*)dWindow;
- (void) _handleDrag: (NSEvent*)theEvent slidePoint: (NSPoint)slidePoint;
- (void) _handleEventDuringDragging: (NSEvent *)theEvent;
- (void) _updateAndMoveImageToCorrectPosition;
- (void) _moveDraggedImageToNewPosition;
@ -110,7 +111,7 @@
static GSDragView *sharedDragView = nil;
+ (GSDragView*) sharedDragView
+ (id) sharedDragView
{
if (sharedDragView == nil)
{
@ -306,6 +307,32 @@ static GSDragView *sharedDragView = nil;
}
}
- (void) sendExternalEvent: (GSAppKitSubtype)subtype
action: (NSDragOperation)action
position: (NSPoint)eventLocation
timestamp: (NSTimeInterval)time
toWindow: (int)dWindowNumber
{
}
/*
Return the window that lies below the cursor and accepts drag and drop.
In mouseWindowRef the OS reference for this window is returned, this is even
set, if there is a native window, but no GNUstep window at this location.
*/
- (NSWindow*) windowAcceptingDnDunder: (NSPoint)mouseLocation
windowRef: (int*)mouseWindowRef
{
int win;
*mouseWindowRef = 0;
win = [GSServerForWindow(_window) findWindowAt: mouseLocation
windowRef: mouseWindowRef
excluding: [_window windowNumber]];
return GSWindowWithNumber(win);
}
@end
@implementation GSDragView (Private)
@ -531,14 +558,6 @@ static GSDragView *sharedDragView = nil;
[dWindow sendEvent: e];
}
- (void) sendExternalEvent: (GSAppKitSubtype)subtype
action: (NSDragOperation)action
position: (NSPoint)eventLocation
timestamp: (NSTimeInterval)time
toWindow: (int)dWindowNumber
{
}
/*
The dragging support works by hijacking the NSApp event loop.
@ -980,22 +999,4 @@ static GSDragView *sharedDragView = nil;
}
}
/*
Return the window that lies below the cursor and accepts drag and drop.
In mouseWindowRef the OS reference for this window is returned, this is even
set, if there is a native window, but no GNUstep window at this location.
*/
- (NSWindow*) windowAcceptingDnDunder: (NSPoint)mouseLocation
windowRef: (int*)mouseWindowRef
{
int win;
*mouseWindowRef = 0;
win = [GSServerForWindow(_window) findWindowAt: mouseLocation
windowRef: mouseWindowRef
excluding: [_window windowNumber]];
return GSWindowWithNumber(win);
}
@end

View file

@ -930,18 +930,22 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
unsigned count;
unsigned i;
BOOL hadDuplicates = NO;
NSImage *image = nil;
appIconFile = [infoDict objectForKey: @"NSIcon"];
if (appIconFile && ![appIconFile isEqual: @""])
{
NSImage *image = [NSImage imageNamed: appIconFile];
if (image != nil)
{
[self setApplicationIconImage: image];
}
image = [NSImage imageNamed: appIconFile];
}
if (image == nil)
{
image = [NSImage imageNamed: @"GNUstep"];
}
[self setApplicationIconImage: image];
if (![defs boolForKey: @"GSDontShowAppIcon"])
{
[self _appIconInit];
}
[self _appIconInit];
mainModelFile = [infoDict objectForKey: @"NSMainNibFile"];
if (mainModelFile != nil && [mainModelFile isEqual: @""] == NO)
@ -3330,11 +3334,6 @@ image.</p><p>See Also: -applicationIconImage</p>
NSSize iconSize = [GSCurrentServer() iconSize];
NSRect iconRect = NSMakeRect(0, 0, iconSize.width, iconSize.height);
if (_app_icon == nil)
{
[self setApplicationIconImage: [NSImage imageNamed: @"GNUstep"]];
}
_app_icon_window = [[NSIconWindow alloc] initWithContentRect: iconRect
styleMask: NSIconWindowMask
backing: NSBackingStoreRetained