Remove the NSWindow+Toolbar files and merge their contents into other

files.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27562 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-01-09 09:14:13 +00:00
parent 1326dfa1b4
commit 5d7b8487b9
9 changed files with 117 additions and 176 deletions

View file

@ -1,3 +1,15 @@
2009-01-09 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/NSWindow+Toolbar.h,
* Source/NSWindow+Toolbar.m: Remove these file and move all code ...
* Headers/AppKit/NSWindow.h,
* Source/NSWindow.m: ... to here.
* Source/NSToolbarFrameworkPrivate.h,
* Headers/AppKit/AppKit.h,
* Source/GNUmakefile: Remove references to these files.
* Source/NSToolbar.m (-_toolbarView): Create the toolbar view here
and not in [NSWindow setToolbar:].
2009-01-08 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSTheme.m: Fix nil pointer exception.

View file

@ -175,7 +175,6 @@
#include <AppKit/NSUserDefaultsController.h>
#include <AppKit/NSUserInterfaceValidation.h>
#include <AppKit/NSWindowController.h>
#include <AppKit/NSWindow+Toolbar.h>
#endif
#include <AppKit/PSOperators.h>

View file

@ -1,44 +0,0 @@
/*
NSWindow+Toolbar.h
The window toolbar category
Copyright (C) 2004 Free Software Foundation, Inc.
Author: Quentin Mathe <qmathe@club-internet.fr>
Date: January 2004
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef _GNUstep_H_NSWindow_Toolbar
#define _GNUstep_H_NSWindow_Toolbar
#include "AppKit/NSWindow.h"
@class NSToolbar;
@interface NSWindow (Toolbar)
- (void) runToolbarCustomizationPalette: (id)sender;
- (void) toggleToolbarShown: (id)sender;
- (NSToolbar *) toolbar;
- (void) setToolbar: (NSToolbar*)toolbar;
@end
#endif

View file

@ -3,7 +3,7 @@
The window class
Copyright (C) 1996,1999 Free Software Foundation, Inc.
Copyright (C) 1996,1999,2004 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: 1996
@ -11,6 +11,8 @@
Date: June 1998
Modified: Richard Frith-Macdonald <richard@brainstorm.co.uk>
Date: 1998,1999
Author: Quentin Mathe <qmathe@club-internet.fr>
Date: January 2004
This file is part of the GNUstep GUI Library.
@ -746,6 +748,15 @@ APPKIT_EXPORT NSSize NSTokenSize;
@end
@class NSToolbar;
@interface NSWindow (Toolbar)
- (void) runToolbarCustomizationPalette: (id)sender;
- (void) toggleToolbarShown: (id)sender;
- (NSToolbar *) toolbar;
- (void) setToolbar: (NSToolbar*)toolbar;
@end
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
/*
* GNUstep backend methods

View file

@ -180,7 +180,6 @@ NSTokenField.m \
NSTokenFieldCell.m \
NSUserDefaultsController.m \
NSView.m \
NSWindow+Toolbar.m \
NSWindow.m \
NSWindowController.m \
NSWorkspace.m \
@ -378,7 +377,6 @@ NSUserDefaultsController.h \
NSView.h \
NSWindow.h \
NSWindowController.h \
NSWindow+Toolbar.h \
NSWorkspace.h \
NSAttributedString.h \
NSColorPicking.h \

View file

@ -48,7 +48,6 @@
#include "AppKit/NSToolbarItem.h"
#include "AppKit/NSView.h"
#include "AppKit/NSWindow.h"
#include "AppKit/NSWindow+Toolbar.h"
#include "GNUstepGUI/GSToolbarView.h"
#include "AppKit/NSToolbar.h"
@ -837,8 +836,12 @@ static GSValidationCenter *vc = nil;
- (void) setShowsBaselineSeparator: (BOOL)flag
{
// FIXME
_showsBaselineSeparator = flag;
if (_showsBaselineSeparator)
[_toolbarView setBorderMask: GSToolbarViewBottomBorder];
else
[_toolbarView setBorderMask: 0];
}
// Private methods
@ -1226,6 +1229,26 @@ static GSValidationCenter *vc = nil;
- (GSToolbarView *) _toolbarView
{
if (_toolbarView == nil)
{
// Instantiate the toolbar view
// addToolbarView: method will set the toolbar view to the right
// frame
GSToolbarView *toolbarView = [[GSToolbarView alloc]
initWithFrame:
NSMakeRect(0, 0, 100, 100)];
[toolbarView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin];
if (_showsBaselineSeparator)
[toolbarView setBorderMask: GSToolbarViewBottomBorder];
else
[toolbarView setBorderMask: 0];
// Load the toolbar view inside the toolbar
_toolbarView = toolbarView;
[_toolbarView setToolbar: self];
}
return _toolbarView;
}

View file

@ -32,7 +32,6 @@
#include "AppKit/NSToolbar.h"
#include "AppKit/NSToolbarItem.h"
#include "AppKit/NSWindow+Toolbar.h"
#include "GNUstepGUI/GSToolbarView.h"
#include "GSWindowDecorationView.h"

View file

@ -1,124 +0,0 @@
/** <title>NSWindow+Toolbar</title>
<abstract>The window class category to include toolbar support</abstract>
Copyright (C) 2004 Free Software Foundation, Inc.
Author: Quentin Mathe <qmathe@club-internet.fr>
Date: January 2004
This file is part of the GNUstep GUI Library.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; see the file COPYING.LIB.
If not, see <http://www.gnu.org/licenses/> or write to the
Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <Foundation/NSDebug.h>
#include <Foundation/NSException.h>
#include <Foundation/NSAutoreleasePool.h>
#include "AppKit/NSWindow+Toolbar.h"
#include "AppKit/NSView.h"
#include "AppKit/NSToolbar.h"
#include "GNUstepGUI/GSToolbarView.h"
#include "NSToolbarFrameworkPrivate.h"
@implementation NSWindow (Toolbar)
- (void) runToolbarCustomizationPalette: (id)sender
{
[[self toolbar] runCustomizationPalette: sender];
}
- (void) toggleToolbarShown: (id)sender
{
NSToolbar *toolbar = [self toolbar];
BOOL isVisible = [toolbar isVisible];
if (!toolbar)
return;
if (isVisible)
{
[_wv removeToolbarView: [toolbar _toolbarView]];
}
else
{
[_wv addToolbarView: [toolbar _toolbarView]];
}
[toolbar setVisible: !isVisible];
[self display];
}
// Accessors
- (NSToolbar *) toolbar
{
return _toolbar;
}
- (void) setToolbar: (NSToolbar*)toolbar
{
if (toolbar == _toolbar)
return;
if (_toolbar != nil)
{
// We throw the last toolbar out
if ([_toolbar isVisible])
{
[_wv removeToolbarView: [_toolbar _toolbarView]];
}
}
ASSIGN(_toolbar, toolbar);
if (toolbar != nil)
{
GSToolbarView *toolbarView = [toolbar _toolbarView];
if (toolbarView == nil)
{
// Instantiate the toolbar view
toolbarView = [[GSToolbarView alloc]
initWithFrame:
NSMakeRect(0, 0,
[NSWindow contentRectForFrameRect: [self frame]
styleMask: [self styleMask]].size.width, 100)];
// addToolbarView: method will set the toolbar view to the right
// frame
[toolbarView setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin];
[toolbarView setBorderMask: GSToolbarViewBottomBorder];
// Load the toolbar view inside the toolbar
[toolbar _setToolbarView: toolbarView];
RELEASE(toolbarView);
}
// Make the toolbar view visible
if ([toolbar isVisible])
{
[_wv addToolbarView: toolbarView];
}
}
// To show the changed toolbar
[self displayIfNeeded];
}
@end

View file

@ -74,13 +74,13 @@
#include "AppKit/NSTextFieldCell.h"
#include "AppKit/NSView.h"
#include "AppKit/NSWindow.h"
#include "AppKit/NSWindow+Toolbar.h"
#include "AppKit/NSWindowController.h"
#include "AppKit/PSOperators.h"
#include "GNUstepGUI/GSTrackingRect.h"
#include "GNUstepGUI/GSDisplayServer.h"
#include "GSToolTips.h"
#include "GSWindowDecorationView.h"
#include "NSToolbarFrameworkPrivate.h"
static GSToolTips *toolTipVisible = nil;
static id<GSWindowDecorator> windowDecorator = nil;
@ -5074,6 +5074,73 @@ current key view.<br />
@end
@implementation NSWindow (Toolbar)
- (void) runToolbarCustomizationPalette: (id)sender
{
[[self toolbar] runCustomizationPalette: sender];
}
- (void) toggleToolbarShown: (id)sender
{
NSToolbar *toolbar = [self toolbar];
BOOL isVisible = [toolbar isVisible];
if (!toolbar)
return;
if (isVisible)
{
[_wv removeToolbarView: [toolbar _toolbarView]];
}
else
{
[_wv addToolbarView: [toolbar _toolbarView]];
}
[toolbar setVisible: !isVisible];
[self display];
}
// Accessors
- (NSToolbar *) toolbar
{
return _toolbar;
}
- (void) setToolbar: (NSToolbar*)toolbar
{
if (toolbar == _toolbar)
return;
if (_toolbar != nil)
{
if ([_toolbar isVisible])
{
// Throw the last toolbar view out
[_wv removeToolbarView: [_toolbar _toolbarView]];
}
}
ASSIGN(_toolbar, toolbar);
if (_toolbar != nil)
{
if ([_toolbar isVisible])
{
// Make the new toolbar view visible
[_wv addToolbarView: [_toolbar _toolbarView]];
}
}
// To show the changed toolbar
[self displayIfNeeded];
}
@end
/*
* GNUstep backend methods
*/