Merge with trunk revision 40072

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40127 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2016-10-05 18:26:49 +00:00
parent e1a1070a18
commit bb5773f64e
6 changed files with 146 additions and 15 deletions

View file

@ -181,20 +181,10 @@ static GSAutocompleteWindow *gsWindow = nil;
}
}
#if 0
// Testplant-MAL-2015-06-25: Fix for main branch code...
// String size caching could cache one of our strings with the wrong sizing
widestWord = [NSString stringWithFormat:@"%@#",widestWord];
// Width
windowWidth = ([cell _sizeText: widestWord].width + [NSScroller scrollerWidth] + 2*bsize.width);
// windowWidth *= 1.1;
#else
// Testplant-MAL-2015-06-25: GUI main branch code...
// Width
cell = [[_tableView tableColumnWithIdentifier: @"content"] dataCell];
windowWidth = 1.1*[cell _sizeText: widestWord].width
+ [NSScroller scrollerWidth] + 2*bsize.width;
#endif
//Height
windowHeight = 2*bsize.height + [_tableView rowHeight]*num
@ -224,7 +214,6 @@ static GSAutocompleteWindow *gsWindow = nil;
[_textView convertRect: stringRect toView: nil].origin];
// Calculate the origin point to the window.
// Testplant-MAL-2015-06-25: Main branch code merge...
if (style == NSMacintoshInterfaceStyle
|| style == NSWindows95InterfaceStyle)
{

View file

@ -131,7 +131,7 @@
}
NS_HANDLER
{
NSLog(@"Exception occured while loading model: %@",[localException reason]);
NSLog(@"Exception occurred while loading model: %@",[localException reason]);
TEST_RELEASE(unarchiver);
}
NS_ENDHANDLER

View file

@ -1230,6 +1230,7 @@ restart: ;
reentrant. Thus, if we are already in use and can't lock our lock,
we create a new instance and let it handle the call. */
// Testplant-MAL-10052016: Recursion monitoring to detect problems...
static NSUInteger RecursionCount = 0;
RecursionCount++;
if (RecursionCount > 1)

View file

@ -110,7 +110,7 @@
}
NS_HANDLER
{
NSLog(@"Exception occured while loading model: %@",[localException reason]);
NSLog(@"Exception occurred while loading model: %@",[localException reason]);
// TEST_RELEASE(unarchiver);
}
NS_ENDHANDLER

View file

@ -45,6 +45,7 @@
#import <Foundation/NSEnumerator.h>
#import <Foundation/NSException.h>
#import <Foundation/NSKeyedArchiver.h>
#import <Foundation/NSKeyValueCoding.h>
#import <Foundation/NSObjCRuntime.h>
#import <Foundation/NSSet.h>
#import <Foundation/NSString.h>
@ -1955,6 +1956,14 @@ static BOOL _isInInterfaceBuilder = NO;
[obj instantiateWithInstantiator: self];
[obj establishConnection];
}
else
{
if ([obj respondsToSelector: @selector(instantiateWithObjectInstantiator:)])
{
[obj instantiateWithObjectInstantiator: self];
[obj establishConnection];
}
}
}
// awaken all objects except proxy objects.
@ -2256,7 +2265,7 @@ static BOOL _isInInterfaceBuilder = NO;
}
if (_marker != nil)
{
[coder encodeObject: _file forKey: @"NSMarker"];
[coder encodeObject: _marker forKey: @"NSMarker"];
}
}
else
@ -2368,3 +2377,117 @@ static BOOL _isInInterfaceBuilder = NO;
return self;
}
@end
@implementation NSIBUserDefinedRuntimeAttributesConnector
- (void) setObject: (id)object
{
ASSIGN(_object, object);
}
- (id) object
{
return _object;
}
- (void) setValues: (id)values
{
ASSIGN(_values, values);
}
- (id) values
{
return _values;
}
- (void) setKeyPaths: (id)keyPaths
{
ASSIGN(_keyPaths, keyPaths);
}
- (id) keyPaths
{
return _keyPaths;
}
- (void) dealloc
{
RELEASE(_object);
RELEASE(_keyPaths);
RELEASE(_values);
[super dealloc];
}
- (void) encodeWithCoder: (NSCoder *)coder
{
if ([coder allowsKeyedCoding])
{
if (_object != nil)
{
[coder encodeObject: _object forKey: @"NSObject"];
}
if (_keyPaths != nil)
{
[coder encodeObject: _keyPaths forKey: @"NSKeyPaths"];
}
if (_values != nil)
{
[coder encodeObject: _values forKey: @"NSValues"];
}
}
else
{
[coder encodeObject: _object];
[coder encodeObject: _keyPaths];
[coder encodeObject: _values];
}
}
- (id) initWithCoder: (NSCoder *)coder
{
if ([coder allowsKeyedCoding])
{
if ([coder containsValueForKey: @"NSObject"])
{
ASSIGN(_object, [coder decodeObjectForKey: @"NSObject"]);
}
if ([coder containsValueForKey: @"NSKeyPaths"])
{
ASSIGN(_keyPaths, [coder decodeObjectForKey: @"NSKeyPaths"]);
}
if ([coder containsValueForKey: @"NSValues"])
{
ASSIGN(_values, [coder decodeObjectForKey: @"NSValues"]);
}
}
else
{
ASSIGN(_object, [coder decodeObject]);
ASSIGN(_keyPaths, [coder decodeObject]);
ASSIGN(_values, [coder decodeObject]);
}
return self;
}
- (void) establishConnection
{
// Loop over key paths and values and use KVC on object
NSEnumerator *keyEn = [_keyPaths objectEnumerator];
NSEnumerator *valEn = [_values objectEnumerator];
id key;
while ((key = [keyEn nextObject]) != nil)
{
id val = [valEn nextObject];
[_object setValue: val forKeyPath: key];
}
}
- (void) instantiateWithObjectInstantiator: (id)instantiator
{
[self setObject: [(id<GSInstantiator>)instantiator instantiateObject: _object]];
// FIXME Should handle values too
}
@end

View file

@ -3,7 +3,7 @@
External data
Copyright (C) 1997 Free Software Foundation, Inc.
Copyright (C) 1997-2016 Free Software Foundation, Inc.
Author: Scott Christley <scottc@net-community.com>
Date: August 1997
@ -416,6 +416,8 @@ NSString* const NSMenuWillSendActionNotification = @"NSMenuWillSendActionNotific
NSString* const NSMenuDidAddItemNotification = @"NSMenuDidAddItemNotification";
NSString* const NSMenuDidRemoveItemNotification = @"NSMenuDidRemoveItemNotification";
NSString* const NSMenuDidChangeItemNotification = @"NSMenuDidChangeItemNotification";
NSString* const NSMenuDidBeginTrackingNotification = @"NSMenuDidBeginTrackingNotification";
NSString* const NSMenuDidEndTrackingNotification = @"NSMenuDidEndTrackingNotification";
// NSPopUpButton notification
NSString *NSPopUpButtonWillPopUpNotification = @"NSPopUpButtonWillPopUpNotification";
@ -612,6 +614,12 @@ NSString *NSToolbarShowFontsItemIdentifier = @"NSToolbarShowFontsItem";
NSString *NSToolbarCustomizeToolbarItemIdentifier = @"NSToolbarCustomizeToolbarItem";
NSString *NSToolbarPrintItemIdentifier = @"NSToolbarPrintItem";
NSString *NSImageNameTrashEmpty = @"NSImageTrashEmpty";
NSString *NSImageNameTrashFull = @"NSImageTrashFull";
// Misc named images
NSString *NSImageNameMultipleDocuments = @"NSImageNameMultipleDocuments";
/*
* NSTextView userInfo for notifications
*/
@ -706,6 +714,16 @@ id NSNotApplicableMarker = @"<NOT APPLICABLE MARKER>";
NSString *NSNibTopLevelObjects = @"NSTopLevelObjects";
NSString *NSNibOwner = @"NSOwner";
// NSImage directly mapped NS named images constants
NSString *NSImageNameUserAccounts = @"NSUserAccounts";
NSString *NSImageNamePreferencesGeneral = @"NSPreferencesGeneral";
NSString *NSImageNameAdvanced = @"NSAdvanced";
NSString *NSImageNameInfo = @"NSInfo";
NSString *NSImageNameFontPanel = @"NSFontPanel";
NSString *NSImageNameColorPanel = @"NSColorPanel";
NSString *NSImageNameCaution = @"NSCaution";
extern void __objc_gui_force_linking (void);
void