mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 19:01:15 +00:00
Merge branch 'master' of github.com:gnustep/libs-gui into NSAppearance_branch
This commit is contained in:
commit
6ea82bad5f
9 changed files with 228 additions and 77 deletions
|
@ -1,3 +1,11 @@
|
|||
2020-01-19 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Headers/AppKit/NSNibOutletConnector.h,
|
||||
* Headers/AppKit/NSNibControlConnector.h,
|
||||
* Source/NSNibOutletConnector.m,
|
||||
* Source/NSNibControlConnector.m,
|
||||
* Source/NSNibConnector.m: Add files missing in last commit from Gregory.
|
||||
|
||||
2020-01-10 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Images/common_StepperDown.tiff,
|
||||
|
|
|
@ -174,6 +174,8 @@
|
|||
#import <AppKit/NSMovieView.h>
|
||||
#import <AppKit/NSPanGestureRecognizer.h>
|
||||
#import <AppKit/NSNib.h>
|
||||
#import <AppKit/NSNibControlConnector.h>
|
||||
#import <AppKit/NSNibOutletConnector.h>
|
||||
#import <AppKit/NSNibDeclarations.h>
|
||||
#import <AppKit/NSObjectController.h>
|
||||
#import <AppKit/NSOpenGL.h>
|
||||
|
|
|
@ -50,13 +50,8 @@
|
|||
- (void) setSource: (id)anObject;
|
||||
@end
|
||||
|
||||
@interface NSNibControlConnector : NSNibConnector
|
||||
- (void) establishConnection;
|
||||
@end
|
||||
|
||||
@interface NSNibOutletConnector : NSNibConnector
|
||||
- (void) establishConnection;
|
||||
@end
|
||||
#import <AppKit/NSNibControlConnector.h>
|
||||
#import <AppKit/NSNibOutletConnector.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
|
37
Headers/AppKit/NSNibControlConnector.h
Normal file
37
Headers/AppKit/NSNibControlConnector.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
NSNibControlConnector.h
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
Author: Richard Frith-Macdonald <richard@branstorm.co.uk>
|
||||
Date: 1999
|
||||
|
||||
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_NSNibControlConnector
|
||||
#define _GNUstep_H_NSNibControlConnector
|
||||
|
||||
#import <AppKit/NSNibConnector.h>
|
||||
|
||||
@interface NSNibControlConnector : NSNibConnector
|
||||
- (void) establishConnection;
|
||||
@end
|
||||
|
||||
#endif
|
37
Headers/AppKit/NSNibOutletConnector.h
Normal file
37
Headers/AppKit/NSNibOutletConnector.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
NSNibOutletConnector.h
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
Author: Richard Frith-Macdonald <richard@branstorm.co.uk>
|
||||
Date: 1999
|
||||
|
||||
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_NSNibOutletConnector
|
||||
#define _GNUstep_H_NSNibOutletConnector
|
||||
|
||||
#import <AppKit/NSNibConnector.h>
|
||||
|
||||
@interface NSNibOutletConnector : NSNibConnector
|
||||
- (void) establishConnection;
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -159,6 +159,8 @@ NSMovie.m \
|
|||
NSMovieView.m \
|
||||
NSNib.m \
|
||||
NSNibConnector.m \
|
||||
NSNibControlConnector.m \
|
||||
NSNibOutletConnector.m \
|
||||
NSNibBindingConnector.m \
|
||||
NSNibAXAttributeConnector.m \
|
||||
NSNibAXRelationshipConnector.m \
|
||||
|
@ -522,6 +524,8 @@ NSColorPicking.h \
|
|||
NSDragging.h \
|
||||
NSGraphics.h \
|
||||
NSNibConnector.h \
|
||||
NSNibControlConnector.h \
|
||||
NSNibOutletConnector.h \
|
||||
NSNibDeclarations.h \
|
||||
NSNibLoading.h \
|
||||
NSNib.h \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
/*
|
||||
<title>NSNibConnector</title>
|
||||
|
||||
<abstract>Implementation of NSNibConnector and subclasses</abstract>
|
||||
<abstract>Implementation of NSNibConnector</abstract>
|
||||
|
||||
Copyright (C) 1999, 2015 Free Software Foundation, Inc.
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
|||
Date: 1999
|
||||
Author: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: August 2015
|
||||
|
||||
|
||||
This file is part of the GNUstep GUI Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
|
@ -24,16 +24,13 @@
|
|||
|
||||
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,
|
||||
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.
|
||||
*/
|
||||
*/
|
||||
|
||||
#import "config.h"
|
||||
#import <Foundation/NSCoder.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import "AppKit/NSControl.h"
|
||||
#import "AppKit/NSNibConnector.h"
|
||||
|
||||
@implementation NSNibConnector
|
||||
|
@ -93,7 +90,7 @@
|
|||
ASSIGN(_src, [aDecoder decodeObjectForKey: @"NSSource"]);
|
||||
}
|
||||
if ([aDecoder containsValueForKey: @"NSLabel"])
|
||||
{
|
||||
{
|
||||
ASSIGN(_tag, [aDecoder decodeObjectForKey: @"NSLabel"]);
|
||||
}
|
||||
}
|
||||
|
@ -172,66 +169,11 @@
|
|||
|
||||
- (NSString *)description
|
||||
{
|
||||
NSString *desc = [NSString stringWithFormat: @"<%@ src=%@ dst=%@ label=%@>",
|
||||
[super description],
|
||||
[self source],
|
||||
[self destination],
|
||||
[self label]];
|
||||
return desc;
|
||||
return [NSString stringWithFormat: @"<%@ src=%@ dst=%@ label=%@>",
|
||||
[super description],
|
||||
[self source],
|
||||
[self destination],
|
||||
[self label]];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSNibControlConnector
|
||||
- (void) establishConnection
|
||||
{
|
||||
SEL sel = NSSelectorFromString(_tag);
|
||||
|
||||
[_src setTarget: _dst];
|
||||
[_src setAction: sel];
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSNibOutletConnector
|
||||
- (void) establishConnection
|
||||
{
|
||||
NS_DURING
|
||||
{
|
||||
if (_src != nil)
|
||||
{
|
||||
NSString *selName;
|
||||
SEL sel;
|
||||
|
||||
selName = [NSString stringWithFormat: @"set%@%@:",
|
||||
[[_tag substringToIndex: 1] uppercaseString],
|
||||
[_tag substringFromIndex: 1]];
|
||||
sel = NSSelectorFromString(selName);
|
||||
|
||||
if (sel && [_src respondsToSelector: sel])
|
||||
{
|
||||
[_src performSelector: sel withObject: _dst];
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* We cannot use the KVC mechanism here, as this would always retain _dst
|
||||
* and it could also affect _setXXX methods and _XXX ivars that aren't
|
||||
* affected by the Cocoa code.
|
||||
*/
|
||||
const char *name = [_tag cString];
|
||||
Class class = object_getClass(_src);
|
||||
Ivar ivar = class_getInstanceVariable(class, name);
|
||||
|
||||
if (ivar != 0)
|
||||
{
|
||||
object_setIvar(_src, ivar, _dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"Error while establishing connection %@: %@", self, [localException reason]);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
}
|
||||
@end
|
||||
|
|
45
Source/NSNibControlConnector.m
Normal file
45
Source/NSNibControlConnector.m
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
<title>NSNibControlConnector</title>
|
||||
|
||||
<abstract>Implementation of NSNibControlConnector</abstract>
|
||||
|
||||
Copyright (C) 1999, 2015 Free Software Foundation, Inc.
|
||||
|
||||
Author: Richard Frith-Macdonald <richard@branstorm.co.uk>
|
||||
Date: 1999
|
||||
Author: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: August 2015
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#import "AppKit/NSControl.h"
|
||||
#import "AppKit/NSNibControlConnector.h"
|
||||
|
||||
@implementation NSNibControlConnector
|
||||
|
||||
- (void) establishConnection
|
||||
{
|
||||
SEL sel = NSSelectorFromString(_tag);
|
||||
|
||||
[_src setTarget: _dst];
|
||||
[_src setAction: sel];
|
||||
}
|
||||
|
||||
@end
|
81
Source/NSNibOutletConnector.m
Normal file
81
Source/NSNibOutletConnector.m
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
<title>NSNibOutletConnector</title>
|
||||
|
||||
<abstract>Implementation of NSNibOutletConnector</abstract>
|
||||
|
||||
Copyright (C) 1999, 2015 Free Software Foundation, Inc.
|
||||
|
||||
Author: Richard Frith-Macdonald <richard@branstorm.co.uk>
|
||||
Date: 1999
|
||||
Author: Fred Kiefer <fredkiefer@gmx.de>
|
||||
Date: August 2015
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#import "AppKit/NSNibOutletConnector.h"
|
||||
|
||||
@implementation NSNibOutletConnector
|
||||
|
||||
- (void) establishConnection
|
||||
{
|
||||
NS_DURING
|
||||
{
|
||||
if (_src != nil)
|
||||
{
|
||||
NSString *selName;
|
||||
SEL sel;
|
||||
|
||||
selName = [NSString stringWithFormat: @"set%@%@:",
|
||||
[[_tag substringToIndex: 1] uppercaseString],
|
||||
[_tag substringFromIndex: 1]];
|
||||
sel = NSSelectorFromString(selName);
|
||||
|
||||
if (sel && [_src respondsToSelector: sel])
|
||||
{
|
||||
[_src performSelector: sel withObject: _dst];
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* We cannot use the KVC mechanism here, as this would always retain _dst
|
||||
* and it could also affect _setXXX methods and _XXX ivars that aren't
|
||||
* affected by the Cocoa code.
|
||||
*/
|
||||
const char *name = [_tag cString];
|
||||
Class class = object_getClass(_src);
|
||||
Ivar ivar = class_getInstanceVariable(class, name);
|
||||
|
||||
if (ivar != 0)
|
||||
{
|
||||
object_setIvar(_src, ivar, _dst);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"Error while establishing connection %@: %@", self, [localException reason]);
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in a new issue