mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 00:41:05 +00:00
Merge GSToolbar with NSToolbar and remove all traces of the old class.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27491 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7ce954508f
commit
aed7756d65
11 changed files with 1242 additions and 1405 deletions
|
@ -219,7 +219,6 @@ GSGormLoading.m \
|
|||
GSNibLoading.m \
|
||||
GSTitleView.m \
|
||||
GSToolTips.m \
|
||||
GSToolbar.m \
|
||||
GSToolbarView.m \
|
||||
GSStandardWindowDecorationView.m \
|
||||
GSWindowDecorationView.m \
|
||||
|
@ -423,7 +422,6 @@ GSLayoutManager.h \
|
|||
GSLayoutManager_internal.h \
|
||||
GSTypesetter.h \
|
||||
GSHorizontalTypesetter.h \
|
||||
GSToolbar.h \
|
||||
GSToolbarView.h \
|
||||
GSNibLoading.h \
|
||||
GSDragView.h \
|
||||
|
|
1212
Source/GSToolbar.m
1212
Source/GSToolbar.m
File diff suppressed because it is too large
Load diff
|
@ -44,10 +44,10 @@
|
|||
#include "AppKit/NSImage.h"
|
||||
#include "AppKit/NSMenu.h"
|
||||
#include "AppKit/NSPasteboard.h"
|
||||
#include "AppKit/NSToolbarItem.h" // It contains GSMovableToolbarItemPboardType declaration
|
||||
// It contains GSMovableToolbarItemPboardType declaration
|
||||
#include "AppKit/NSToolbarItem.h"
|
||||
#include "AppKit/NSView.h"
|
||||
#include "AppKit/NSWindow.h"
|
||||
#include "GNUstepGUI/GSToolbar.h"
|
||||
#include "GNUstepGUI/GSToolbarView.h"
|
||||
|
||||
typedef enum {
|
||||
|
@ -141,7 +141,7 @@ static void initSystemExtensionsColors(void)
|
|||
/*
|
||||
* Toolbar related code
|
||||
*/
|
||||
@interface GSToolbar (GNUstepPrivate)
|
||||
@interface NSToolbar (GNUstepPrivate)
|
||||
- (void) _build;
|
||||
|
||||
- (void) _concludeRemoveItem: (NSToolbarItem *)item atIndex: (int)index broadcast: (BOOL)broadcast;
|
||||
|
@ -192,7 +192,7 @@ static void initSystemExtensionsColors(void)
|
|||
|
||||
@interface GSToolbarClippedItemsButton : NSButton
|
||||
{
|
||||
GSToolbar *_toolbar;
|
||||
NSToolbar *_toolbar;
|
||||
}
|
||||
|
||||
- (id) init;
|
||||
|
@ -203,7 +203,7 @@ static void initSystemExtensionsColors(void)
|
|||
method with the same name. */
|
||||
|
||||
- (void) layout;
|
||||
- (void) setToolbar: (GSToolbar *)toolbar;
|
||||
- (void) setToolbar: (NSToolbar *)toolbar;
|
||||
@end
|
||||
|
||||
@interface GSToolbarClipView : NSClipView
|
||||
|
@ -306,7 +306,7 @@ static void initSystemExtensionsColors(void)
|
|||
|
||||
// Accessors
|
||||
|
||||
- (void) setToolbar: (GSToolbar *)toolbar
|
||||
- (void) setToolbar: (NSToolbar *)toolbar
|
||||
{
|
||||
// Don't do an ASSIGN here, the toolbar view retains us.
|
||||
_toolbar = toolbar;
|
||||
|
@ -431,7 +431,7 @@ static void initSystemExtensionsColors(void)
|
|||
|
||||
- (NSDragOperation) draggingEntered: (id <NSDraggingInfo>)info
|
||||
{
|
||||
GSToolbar *toolbar = [self toolbar];
|
||||
NSToolbar *toolbar = [self toolbar];
|
||||
NSArray *allowedItemIdentifiers =
|
||||
[[toolbar delegate] toolbarAllowedItemIdentifiers: toolbar];
|
||||
NSString *itemIdentifier =
|
||||
|
@ -448,7 +448,7 @@ static void initSystemExtensionsColors(void)
|
|||
|
||||
- (NSDragOperation) draggingUpdated: (id <NSDraggingInfo>)info
|
||||
{
|
||||
GSToolbar *toolbar = [self toolbar];
|
||||
NSToolbar *toolbar = [self toolbar];
|
||||
NSArray *allowedItemIdentifiers =
|
||||
[[toolbar delegate] toolbarAllowedItemIdentifiers: toolbar];
|
||||
NSString *itemIdentifier =
|
||||
|
@ -468,7 +468,7 @@ static void initSystemExtensionsColors(void)
|
|||
NSPasteboard *pboard = [info draggingPasteboard];
|
||||
NSString *str = [pboard stringForType: [[pboard types] objectAtIndex: 0]];
|
||||
int index = [str intValue];
|
||||
GSToolbar *toolbar = [self toolbar];
|
||||
NSToolbar *toolbar = [self toolbar];
|
||||
|
||||
[toolbar _concludeRemoveItem:
|
||||
[[info draggingSource] toolbarItem] atIndex: index broadcast: YES];
|
||||
|
@ -489,7 +489,7 @@ static void initSystemExtensionsColors(void)
|
|||
NSPasteboard *pboard = [info draggingPasteboard];
|
||||
NSString *str = [pboard stringForType: [[pboard types] objectAtIndex: 0]];
|
||||
int index = [str intValue];
|
||||
GSToolbar *toolbar = [self toolbar];
|
||||
NSToolbar *toolbar = [self toolbar];
|
||||
NSToolbarItem *item = [[info draggingSource] toolbarItem];
|
||||
int newIndex = [self _insertionIndexAtPoint: [info draggingLocation]];
|
||||
// Calculate the index
|
||||
|
@ -598,7 +598,7 @@ static void initSystemExtensionsColors(void)
|
|||
return _borderMask;
|
||||
}
|
||||
|
||||
- (GSToolbar *) toolbar
|
||||
- (NSToolbar *) toolbar
|
||||
{
|
||||
return _toolbar;
|
||||
}
|
||||
|
@ -656,7 +656,7 @@ static void initSystemExtensionsColors(void)
|
|||
[_clipView setFrame: rect];
|
||||
}
|
||||
|
||||
- (void) setToolbar: (GSToolbar *)toolbar
|
||||
- (void) setToolbar: (NSToolbar *)toolbar
|
||||
{
|
||||
if ([toolbar sizeMode] != _sizeMode)
|
||||
; // FIXME: Raise exception here
|
||||
|
|
1118
Source/NSToolbar.m
1118
Source/NSToolbar.m
File diff suppressed because it is too large
Load diff
|
@ -45,8 +45,8 @@
|
|||
#include "AppKit/NSMenuItem.h"
|
||||
#include "AppKit/NSParagraphStyle.h"
|
||||
#include "AppKit/NSPasteboard.h"
|
||||
#include "AppKit/NSToolbar.h"
|
||||
#include "AppKit/NSView.h"
|
||||
#include "GNUstepGUI/GSToolbar.h"
|
||||
#include "GNUstepGUI/GSToolbarView.h"
|
||||
#include "AppKit/NSToolbarItem.h"
|
||||
|
||||
|
@ -89,7 +89,7 @@ static NSFont *SmallFont = nil;
|
|||
|
||||
NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||
|
||||
@interface GSToolbar (GNUstepPrivate)
|
||||
@interface NSToolbar (GNUstepPrivate)
|
||||
- (GSToolbarView *) _toolbarView;
|
||||
- (int) _indexOfItem: (NSToolbarItem *)item; // Used by drag setup
|
||||
|
||||
|
@ -105,11 +105,10 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
- (BOOL) _isFlexibleSpace;
|
||||
- (BOOL) _isModified;
|
||||
- (BOOL) _selectable;
|
||||
- (GSToolbar *) _toolbar;
|
||||
- (void) _setSelectable: (BOOL)selectable;
|
||||
- (BOOL) _selected;
|
||||
- (void) _setSelected: (BOOL)selected;
|
||||
- (void) _setToolbar: (GSToolbar *)toolbar;
|
||||
- (void) _setToolbar: (NSToolbar *)toolbar;
|
||||
@end
|
||||
|
||||
@interface GSToolbarView (GNUstepPrivate)
|
||||
|
@ -278,7 +277,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
|
||||
- (void) mouseDown: (NSEvent *)event
|
||||
{
|
||||
GSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
NSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
|
||||
if ([event modifierFlags] == NSCommandKeyMask
|
||||
&& [toolbar allowsUserCustomization])
|
||||
|
@ -331,7 +330,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
|
||||
- (void) draggedImage: (NSImage *)dragImage beganAt: (NSPoint)location
|
||||
{
|
||||
GSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
NSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
|
||||
// FIXME: Where is this released?
|
||||
RETAIN(_toolbarItem);
|
||||
|
@ -733,7 +732,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
|
||||
- (void) mouseDown: (NSEvent *)event
|
||||
{
|
||||
GSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
NSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
|
||||
if ([event modifierFlags] == NSCommandKeyMask
|
||||
&& [toolbar allowsUserCustomization])
|
||||
|
@ -783,7 +782,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
|
||||
- (void) draggedImage: (NSImage *)dragImage beganAt: (NSPoint)location
|
||||
{
|
||||
GSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
NSToolbar *toolbar = [_toolbarItem toolbar];
|
||||
|
||||
RETAIN(_toolbarItem);
|
||||
/* We retain the toolbar item to be able to have have it reinsered later by
|
||||
|
@ -1366,7 +1365,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
return _toolTip;
|
||||
}
|
||||
|
||||
- (GSToolbar *) toolbar
|
||||
- (NSToolbar *) toolbar
|
||||
{
|
||||
return _toolbar;
|
||||
}
|
||||
|
@ -1447,11 +1446,6 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
return [(GSToolbarButton *)_backView state];
|
||||
}
|
||||
|
||||
- (GSToolbar *) _toolbar
|
||||
{
|
||||
return _toolbar;
|
||||
}
|
||||
|
||||
- (void) _setSelected: (BOOL)selected
|
||||
{
|
||||
if (_selectable)
|
||||
|
@ -1478,7 +1472,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
|||
}
|
||||
}
|
||||
|
||||
- (void) _setToolbar: (GSToolbar *)toolbar
|
||||
- (void) _setToolbar: (NSToolbar *)toolbar
|
||||
{
|
||||
// Don't do an ASSIGN here, the toolbar itself retains us.
|
||||
_toolbar = toolbar;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
#include "AppKit/NSToolbar.h"
|
||||
#include "GNUstepGUI/GSToolbarView.h"
|
||||
|
||||
@interface GSToolbar (GNUstepPrivate)
|
||||
@interface NSToolbar (GNUstepPrivate)
|
||||
- (GSToolbarView *) _toolbarView;
|
||||
@end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue