mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 11:20:37 +00:00
Added new connectors and implemented keyed coding in split view.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@25520 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b3ce13417d
commit
6e46b25f8b
7 changed files with 285 additions and 19 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2007-10-06 23:03-EDT Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* Headers/Additions/GNUstepGUI/GSNibCompatibility.h
|
||||||
|
* Source/GNUmakefile: Added new classes.
|
||||||
|
* Source/NSNibAXAttributeConnector.m
|
||||||
|
* Source/NSNibAXRelationshipConnector.m
|
||||||
|
* Source/NSNibBindingConnector.m: Implementation of special
|
||||||
|
connectors for Key-Value binding.
|
||||||
|
* Source/NSSplitView.m: Added ode for keyed coding
|
||||||
|
|
||||||
2007-10-02 Fred Kiefer <FredKiefer@gmx.de>
|
2007-10-02 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/NSWindow.m (-deminiaturize:, -miniaturize:): Try to
|
* Source/NSWindow.m (-deminiaturize:, -miniaturize:): Try to
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#define _GNUstep_H_GSNibCompatibility
|
#define _GNUstep_H_GSNibCompatibility
|
||||||
|
|
||||||
#include <Foundation/NSObject.h>
|
#include <Foundation/NSObject.h>
|
||||||
|
|
||||||
#include <AppKit/NSWindow.h>
|
#include <AppKit/NSWindow.h>
|
||||||
#include <AppKit/NSMenu.h>
|
#include <AppKit/NSMenu.h>
|
||||||
#include <AppKit/NSView.h>
|
#include <AppKit/NSView.h>
|
||||||
|
@ -34,11 +35,12 @@
|
||||||
#include <AppKit/NSTextView.h>
|
#include <AppKit/NSTextView.h>
|
||||||
#include <AppKit/NSControl.h>
|
#include <AppKit/NSControl.h>
|
||||||
#include <AppKit/NSButton.h>
|
#include <AppKit/NSButton.h>
|
||||||
|
|
||||||
#include <AppKit/NSGraphicsContext.h>
|
#include <AppKit/NSGraphicsContext.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
#include <AppKit/NSResponder.h>
|
#include <AppKit/NSResponder.h>
|
||||||
#include <AppKit/NSEvent.h>
|
#include <AppKit/NSEvent.h>
|
||||||
|
#include <AppKit/NSNibConnector.h>
|
||||||
|
|
||||||
#include "GNUstepGUI/GSNibContainer.h"
|
#include "GNUstepGUI/GSNibContainer.h"
|
||||||
#include "GNUstepGUI/GSInstantiator.h"
|
#include "GNUstepGUI/GSInstantiator.h"
|
||||||
|
|
||||||
|
@ -285,4 +287,49 @@ typedef struct _GSWindowTemplateFlags
|
||||||
@interface NSPSMatrix : NSObject
|
@interface NSPSMatrix : NSObject
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface NSNibAXAttributeConnector : NSObject <NSCoding>
|
||||||
|
{
|
||||||
|
NSString *_attributeType;
|
||||||
|
NSString *_attributeValue;
|
||||||
|
id _destination;
|
||||||
|
id _source;
|
||||||
|
NSString *_label;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attribute name/type.
|
||||||
|
- (NSString *) attributeType;
|
||||||
|
- (void) setAttributeType: (NSString *)type;
|
||||||
|
- (NSString *) attributeValue;
|
||||||
|
- (void) setAttributeValue: (NSString *)value;
|
||||||
|
|
||||||
|
// Source destination, connectors.
|
||||||
|
- (id) destination;
|
||||||
|
- (void) setDestination: (id)destination;
|
||||||
|
- (NSString *) label;
|
||||||
|
- (void) setLabel: (NSString *)label;
|
||||||
|
- (id) source;
|
||||||
|
- (void) setSource: (id)source;
|
||||||
|
|
||||||
|
// establish connection...
|
||||||
|
- (void) establishConnection;
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface NSNibAXRelationshipConnector : NSNibConnector
|
||||||
|
@end
|
||||||
|
|
||||||
|
@interface NSNibBindingConnector: NSNibConnector
|
||||||
|
{
|
||||||
|
NSDictionary *_options;
|
||||||
|
NSString *_binding;
|
||||||
|
NSString *_keyPath;
|
||||||
|
BOOL _hasEstablishedConnection;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) binding;
|
||||||
|
- (NSString *) keyPath;
|
||||||
|
- (NSDictionary *) options;
|
||||||
|
- (void) setBinding: (NSString *)bindings;
|
||||||
|
- (void) setKeyPath: (NSString *)keyPath;
|
||||||
|
- (void) setOptions: (NSDictionary *)options;
|
||||||
|
@end
|
||||||
#endif /* _GNUstep_H_GSNibCompatibility */
|
#endif /* _GNUstep_H_GSNibCompatibility */
|
||||||
|
|
|
@ -117,6 +117,9 @@ NSMenuItemCell.m \
|
||||||
NSMovie.m \
|
NSMovie.m \
|
||||||
NSMovieView.m \
|
NSMovieView.m \
|
||||||
NSNib.m \
|
NSNib.m \
|
||||||
|
NSNibBindingConnector.m \
|
||||||
|
NSNibAXAttributeConnector.m \
|
||||||
|
NSNibAXRelationshipConnector.m \
|
||||||
NSObjectController.m \
|
NSObjectController.m \
|
||||||
NSOpenGLContext.m \
|
NSOpenGLContext.m \
|
||||||
NSOpenGLPixelFormat.m \
|
NSOpenGLPixelFormat.m \
|
||||||
|
|
104
Source/NSNibAXAttributeConnector.m
Normal file
104
Source/NSNibAXAttributeConnector.m
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
/** <title>NSNibAXAttributeConnector</title>
|
||||||
|
|
||||||
|
<abstract>
|
||||||
|
</abstract>
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Gregory John Casamento
|
||||||
|
Date: 2007
|
||||||
|
|
||||||
|
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 Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library;
|
||||||
|
If not, write to the Free Software Foundation,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <GNUstepGUI/GSNibCompatibility.h>
|
||||||
|
#import <Foundation/NSString.h>
|
||||||
|
|
||||||
|
@implementation NSNibAXAttributeConnector
|
||||||
|
// Attribute name/type.
|
||||||
|
- (NSString *) attributeType
|
||||||
|
{
|
||||||
|
return _attributeType;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setAttributeType: (NSString *)type
|
||||||
|
{
|
||||||
|
ASSIGN(_attributeType, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) attributeValue
|
||||||
|
{
|
||||||
|
return _attributeValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setAttributeValue: (NSString *)value
|
||||||
|
{
|
||||||
|
ASSIGN(_attributeValue, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Source destination, connectors.
|
||||||
|
- (id) destination
|
||||||
|
{
|
||||||
|
return _destination;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setDestination: (id)destination
|
||||||
|
{
|
||||||
|
ASSIGN(_destination, destination);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) label
|
||||||
|
{
|
||||||
|
return _label;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setLabel: (NSString *)label
|
||||||
|
{
|
||||||
|
ASSIGN(_label, label);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) source
|
||||||
|
{
|
||||||
|
return _source;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setSource: (id)source
|
||||||
|
{
|
||||||
|
ASSIGN(_source, source);
|
||||||
|
}
|
||||||
|
|
||||||
|
// establish connection...
|
||||||
|
- (void) establishConnection
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// archiving....
|
||||||
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
|
{
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) encodeWithCoder: (NSCoder *)coder
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) dealloc
|
||||||
|
{
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
@end
|
33
Source/NSNibAXRelationshipConnector.m
Normal file
33
Source/NSNibAXRelationshipConnector.m
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
/** <title>NSNibAXAttributeConnector</title>
|
||||||
|
|
||||||
|
<abstract>
|
||||||
|
</abstract>
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Gregory John Casamento
|
||||||
|
Date: 2007
|
||||||
|
|
||||||
|
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 Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library;
|
||||||
|
If not, write to the Free Software Foundation,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <GNUstepGUI/GSNibCompatibility.h>
|
||||||
|
#import <Foundation/NSString.h>
|
||||||
|
|
||||||
|
@implementation NSNibAXRelationshipConnector
|
||||||
|
@end
|
63
Source/NSNibBindingConnector.m
Normal file
63
Source/NSNibBindingConnector.m
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
/** <title>NSNibAXAttributeConnector</title>
|
||||||
|
|
||||||
|
<abstract>
|
||||||
|
</abstract>
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
Author: Gregory John Casamento
|
||||||
|
Date: 2007
|
||||||
|
|
||||||
|
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 Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with this library;
|
||||||
|
If not, write to the Free Software Foundation,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <GNUstepGUI/GSNibCompatibility.h>
|
||||||
|
#import <Foundation/NSString.h>
|
||||||
|
#import <Foundation/NSDictionary.h>
|
||||||
|
|
||||||
|
@implementation NSNibBindingConnector
|
||||||
|
- (NSString *) binding
|
||||||
|
{
|
||||||
|
return _binding;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) keyPath
|
||||||
|
{
|
||||||
|
return _keyPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSDictionary *) options
|
||||||
|
{
|
||||||
|
return _options;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setBinding: (NSString *)binding
|
||||||
|
{
|
||||||
|
ASSIGN(_binding, binding);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setKeyPath: (NSString *)keyPath
|
||||||
|
{
|
||||||
|
ASSIGN(_keyPath, keyPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setOptions: (NSDictionary *)options
|
||||||
|
{
|
||||||
|
ASSIGN(_options, options);
|
||||||
|
}
|
||||||
|
@end
|
|
@ -881,24 +881,30 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
||||||
- (void) encodeWithCoder: (NSCoder *)aCoder
|
- (void) encodeWithCoder: (NSCoder *)aCoder
|
||||||
{
|
{
|
||||||
[super encodeWithCoder: aCoder];
|
[super encodeWithCoder: aCoder];
|
||||||
|
if([aCoder allowsKeyedCoding])
|
||||||
/*
|
{
|
||||||
* Encode objects we don't own.
|
[aCoder encodeBool: _isVertical forKey: @"NSIsVertical"];
|
||||||
*/
|
}
|
||||||
[aCoder encodeConditionalObject: _delegate];
|
else
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
* Encode the objects we do own.
|
* Encode objects we don't own.
|
||||||
*/
|
*/
|
||||||
[aCoder encodeObject: _dimpleImage];
|
[aCoder encodeConditionalObject: _delegate];
|
||||||
[aCoder encodeObject: _backgroundColor];
|
|
||||||
[aCoder encodeObject: _dividerColor];
|
/*
|
||||||
|
* Encode the objects we do own.
|
||||||
/*
|
*/
|
||||||
* Encode the rest of the ivar data.
|
[aCoder encodeObject: _dimpleImage];
|
||||||
*/
|
[aCoder encodeObject: _backgroundColor];
|
||||||
[aCoder encodeValueOfObjCType: @encode(int) at: &_draggedBarWidth];
|
[aCoder encodeObject: _dividerColor];
|
||||||
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isVertical];
|
|
||||||
|
/*
|
||||||
|
* Encode the rest of the ivar data.
|
||||||
|
*/
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(int) at: &_draggedBarWidth];
|
||||||
|
[aCoder encodeValueOfObjCType: @encode(BOOL) at: &_isVertical];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder *)aDecoder
|
- (id) initWithCoder: (NSCoder *)aDecoder
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue