mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:10:48 +00:00
Coding style fixups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22019 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
397660b06d
commit
6988bf34c2
60 changed files with 577 additions and 513 deletions
64
ChangeLog
64
ChangeLog
|
@ -1,3 +1,67 @@
|
||||||
|
2005-11-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/GSEPSPrintOperation.m:
|
||||||
|
* Source/GSHelpManagerPanel.m:
|
||||||
|
* Source/GSHorizontalTypesetter.m:
|
||||||
|
* Source/GSLayoutManager.m:
|
||||||
|
* Source/GSNibCompatibility.m:
|
||||||
|
* Source/GSNibTemplates.m:
|
||||||
|
* Source/GSPDFPrintOperation.m:
|
||||||
|
* Source/GSPrintOperation.m:
|
||||||
|
* Source/GSPrinting.m:
|
||||||
|
* Source/GSSlideView.m:
|
||||||
|
* Source/GSTable.m:
|
||||||
|
* Source/GSToolbar.m:
|
||||||
|
* Source/NSAlert.m:
|
||||||
|
* Source/NSApplication.m:
|
||||||
|
* Source/NSBezierPath.m:
|
||||||
|
* Source/NSBitmapImageRep+PNM.m:
|
||||||
|
* Source/NSBox.m:
|
||||||
|
* Source/NSBrowser.m:
|
||||||
|
* Source/NSBrowserCell.m:
|
||||||
|
* Source/NSBundleAdditions.m:
|
||||||
|
* Source/NSCell.m:
|
||||||
|
* Source/NSColor.m:
|
||||||
|
* Source/NSColorList.m:
|
||||||
|
* Source/NSColorWell.m:
|
||||||
|
* Source/NSCustomImageRep.m:
|
||||||
|
* Source/NSDataLink.m:
|
||||||
|
* Source/NSDataLinkManager.m:
|
||||||
|
* Source/NSDataLinkPanel.m:
|
||||||
|
* Source/NSDocument.m:
|
||||||
|
* Source/NSForm.m:
|
||||||
|
* Source/NSGraphicsContext.m:
|
||||||
|
* Source/NSHelpManager.m:
|
||||||
|
* Source/NSImage.m:
|
||||||
|
* Source/NSLayoutManager.m:
|
||||||
|
* Source/NSMatrix.m:
|
||||||
|
* Source/NSNib.m:
|
||||||
|
* Source/NSOpenGLPixelFormat.m:
|
||||||
|
* Source/NSOpenGLView.m:
|
||||||
|
* Source/NSOutlineView.m:
|
||||||
|
* Source/NSPageLayout.m:
|
||||||
|
* Source/NSPrintInfo.m:
|
||||||
|
* Source/NSPrintOperation.m:
|
||||||
|
* Source/NSPrintPanel.m:
|
||||||
|
* Source/NSPrinter.m:
|
||||||
|
* Source/NSResponder.m:
|
||||||
|
* Source/NSRulerView.m:
|
||||||
|
* Source/NSSelection.m:
|
||||||
|
* Source/NSSpellChecker.m:
|
||||||
|
* Source/NSSpellServer.m:
|
||||||
|
* Source/NSSplitView.m:
|
||||||
|
* Source/NSStepper.m:
|
||||||
|
* Source/NSTabView.m:
|
||||||
|
* Source/NSTableView.m:
|
||||||
|
* Source/NSTextView.m:
|
||||||
|
* Source/NSTextView_actions.m:
|
||||||
|
* Source/NSToolbarItem.m:
|
||||||
|
* Source/NSView.m:
|
||||||
|
* Source/NSWindow.m:
|
||||||
|
* Source/NSWorkspace.m:
|
||||||
|
Fix some common coding style violations ... should have no effect
|
||||||
|
other than improving readability.
|
||||||
|
|
||||||
2005-11-15 fabien <fabien@sonappart.net>
|
2005-11-15 fabien <fabien@sonappart.net>
|
||||||
|
|
||||||
* Source/NSColor.m : Improved documentation, various cleanups.
|
* Source/NSColor.m : Improved documentation, various cleanups.
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
[[NSProcessInfo processInfo] globallyUniqueString]];
|
[[NSProcessInfo processInfo] globallyUniqueString]];
|
||||||
|
|
||||||
_path = [_path stringByAppendingPathExtension: @"ps"];
|
_path = [_path stringByAppendingPathExtension: @"ps"];
|
||||||
RETAIN( _path );
|
RETAIN(_path);
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ static GSHelpManagerPanel* _GSsharedGSHelpPanel;
|
||||||
|
|
||||||
+ (id) sharedHelpManagerPanel
|
+ (id) sharedHelpManagerPanel
|
||||||
{
|
{
|
||||||
if(!_GSsharedGSHelpPanel)
|
if (!_GSsharedGSHelpPanel)
|
||||||
_GSsharedGSHelpPanel = [[GSHelpManagerPanel alloc] init];
|
_GSsharedGSHelpPanel = [[GSHelpManagerPanel alloc] init];
|
||||||
|
|
||||||
return _GSsharedGSHelpPanel;
|
return _GSsharedGSHelpPanel;
|
||||||
|
|
|
@ -258,7 +258,7 @@ including gi will have been cached.
|
||||||
if (g->g == NSControlGlyph)
|
if (g->g == NSControlGlyph)
|
||||||
return gi + cache_base;
|
return gi + cache_base;
|
||||||
ch = [str characterAtIndex: g->char_index];
|
ch = [str characterAtIndex: g->char_index];
|
||||||
if (ch == 0x20 || ch == 0x0a || ch == 0x0d /* TODO: paragraph/line separator */ )
|
if (ch == 0x20 || ch == 0x0a || ch == 0x0d /* TODO: paragraph/line separator */)
|
||||||
{
|
{
|
||||||
g->dont_show = YES;
|
g->dont_show = YES;
|
||||||
if (gi > 0)
|
if (gi > 0)
|
||||||
|
|
|
@ -97,7 +97,7 @@ Private method used internally by GSLayoutManager for sanity checking.
|
||||||
r->font = [r->font retain];
|
r->font = [r->font retain];
|
||||||
}
|
}
|
||||||
|
|
||||||
-(void ) _run_free_attributes: (glyph_run_t *)r
|
-(void) _run_free_attributes: (glyph_run_t *)r
|
||||||
{
|
{
|
||||||
[r->font release];
|
[r->font release];
|
||||||
}
|
}
|
||||||
|
|
|
@ -160,7 +160,7 @@
|
||||||
|
|
||||||
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
// if we live in the interface builder, give them an instance of
|
// if we live in the interface builder, give them an instance of
|
||||||
// the parent, not the child..
|
// the parent, not the child..
|
||||||
|
@ -278,7 +278,7 @@
|
||||||
|
|
||||||
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
// if we live in the interface builder, give them an instance of
|
// if we live in the interface builder, give them an instance of
|
||||||
// the parent, not the child..
|
// the parent, not the child..
|
||||||
|
@ -374,7 +374,7 @@
|
||||||
|
|
||||||
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
// if we live in the interface builder, give them an instance of
|
// if we live in the interface builder, give them an instance of
|
||||||
// the parent, not the child..
|
// the parent, not the child..
|
||||||
|
@ -478,7 +478,7 @@
|
||||||
|
|
||||||
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
// if we live in the interface builder, give them an instance of
|
// if we live in the interface builder, give them an instance of
|
||||||
// the parent, not the child..
|
// the parent, not the child..
|
||||||
|
@ -578,7 +578,7 @@
|
||||||
|
|
||||||
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
// if we live in the interface builder, give them an instance of
|
// if we live in the interface builder, give them an instance of
|
||||||
// the parent, not the child..
|
// the parent, not the child..
|
||||||
|
@ -679,7 +679,7 @@
|
||||||
|
|
||||||
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
// if we live in the interface builder, give them an instance of
|
// if we live in the interface builder, give them an instance of
|
||||||
// the parent, not the child..
|
// the parent, not the child..
|
||||||
|
@ -719,15 +719,15 @@
|
||||||
[obj setContinuous: [self isContinuous]];
|
[obj setContinuous: [self isContinuous]];
|
||||||
|
|
||||||
// since only some controls have delegates, we need to test
|
// since only some controls have delegates, we need to test
|
||||||
if([obj respondsToSelector: @selector(setDelegate:)])
|
if ([obj respondsToSelector: @selector(setDelegate:)])
|
||||||
[obj setDelegate: _delegate];
|
[obj setDelegate: _delegate];
|
||||||
|
|
||||||
// since only some controls have data sources, we need to test
|
// since only some controls have data sources, we need to test
|
||||||
if([obj respondsToSelector: @selector(setDataSource:)])
|
if ([obj respondsToSelector: @selector(setDataSource:)])
|
||||||
[obj setDataSource: _dataSource];
|
[obj setDataSource: _dataSource];
|
||||||
|
|
||||||
// since only some controls have data sources, we need to test
|
// since only some controls have data sources, we need to test
|
||||||
if([obj respondsToSelector: @selector(setUsesDataSource:)])
|
if ([obj respondsToSelector: @selector(setUsesDataSource:)])
|
||||||
[obj setUsesDataSource: _usesDataSource];
|
[obj setUsesDataSource: _usesDataSource];
|
||||||
|
|
||||||
RELEASE(self);
|
RELEASE(self);
|
||||||
|
@ -802,7 +802,7 @@
|
||||||
|
|
||||||
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
- (id) awakeAfterUsingCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
// if we live in the interface builder, give them an instance of
|
// if we live in the interface builder, give them an instance of
|
||||||
// the parent, not the child..
|
// the parent, not the child..
|
||||||
|
|
|
@ -111,7 +111,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
|
|
||||||
- init
|
- init
|
||||||
{
|
{
|
||||||
if((self = [super init]) != nil)
|
if ((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
* file.
|
* file.
|
||||||
*/
|
*/
|
||||||
obj = [context objectForKey: @"NSTopLevelObjects"];
|
obj = [context objectForKey: @"NSTopLevelObjects"];
|
||||||
if([obj isKindOfClass: [NSMutableArray class]])
|
if ([obj isKindOfClass: [NSMutableArray class]])
|
||||||
{
|
{
|
||||||
topObjects = obj;
|
topObjects = obj;
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
if ([context objectForKey: key] == nil ||
|
if ([context objectForKey: key] == nil ||
|
||||||
[key isEqualToString: @"NSOwner"]) // we want to send the message to the owner
|
[key isEqualToString: @"NSOwner"]) // we want to send the message to the owner
|
||||||
{
|
{
|
||||||
if([key isEqualToString: @"NSWindowsMenu"] == NO && // we don't want to send a message to these menus twice,
|
if ([key isEqualToString: @"NSWindowsMenu"] == NO && // we don't want to send a message to these menus twice,
|
||||||
[key isEqualToString: @"NSServicesMenu"] == NO && // if they're custom classes.
|
[key isEqualToString: @"NSServicesMenu"] == NO && // if they're custom classes.
|
||||||
[key isEqualToString: @"NSVisible"] == NO && // also exclude any other special parts of the nameTable.
|
[key isEqualToString: @"NSVisible"] == NO && // also exclude any other special parts of the nameTable.
|
||||||
[key isEqualToString: @"NSDeferred"] == NO &&
|
[key isEqualToString: @"NSDeferred"] == NO &&
|
||||||
|
@ -276,11 +276,11 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
* then he will get the objects back in an array which he merely must release in
|
* then he will get the objects back in an array which he merely must release in
|
||||||
* order to release the objects held within. GJC
|
* order to release the objects held within. GJC
|
||||||
*/
|
*/
|
||||||
if([key isEqualToString: @"NSOwner"] == NO)
|
if ([key isEqualToString: @"NSOwner"] == NO)
|
||||||
{
|
{
|
||||||
if([topLevelObjects containsObject: o]) // anything already designated a top level item..
|
if ([topLevelObjects containsObject: o]) // anything already designated a top level item..
|
||||||
{
|
{
|
||||||
if(topObjects == nil)
|
if (topObjects == nil)
|
||||||
{
|
{
|
||||||
// It is expected, if the NSTopLevelObjects key is not passed in,
|
// It is expected, if the NSTopLevelObjects key is not passed in,
|
||||||
// that the user has opted to either allow these objects to leak or
|
// that the user has opted to either allow these objects to leak or
|
||||||
|
@ -347,7 +347,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
int version = [GSNibContainer version];
|
int version = [GSNibContainer version];
|
||||||
if(version == GNUSTEP_NIB_VERSION)
|
if (version == GNUSTEP_NIB_VERSION)
|
||||||
{
|
{
|
||||||
[aCoder encodeObject: nameTable];
|
[aCoder encodeObject: nameTable];
|
||||||
[aCoder encodeObject: connections];
|
[aCoder encodeObject: connections];
|
||||||
|
@ -377,13 +377,13 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
int version = [aCoder versionForClassName: @"GSNibContainer"];
|
int version = [aCoder versionForClassName: @"GSNibContainer"];
|
||||||
|
|
||||||
// save the version to the ivar, we need it later.
|
// save the version to the ivar, we need it later.
|
||||||
if(version == GNUSTEP_NIB_VERSION)
|
if (version == GNUSTEP_NIB_VERSION)
|
||||||
{
|
{
|
||||||
[aCoder decodeValueOfObjCType: @encode(id) at: &nameTable];
|
[aCoder decodeValueOfObjCType: @encode(id) at: &nameTable];
|
||||||
[aCoder decodeValueOfObjCType: @encode(id) at: &connections];
|
[aCoder decodeValueOfObjCType: @encode(id) at: &connections];
|
||||||
[aCoder decodeValueOfObjCType: @encode(id) at: &topLevelObjects];
|
[aCoder decodeValueOfObjCType: @encode(id) at: &topLevelObjects];
|
||||||
}
|
}
|
||||||
else if(version == 0)
|
else if (version == 0)
|
||||||
{
|
{
|
||||||
GSNibItemCollector *nibitems = [[GSNibItemCollector alloc] init];
|
GSNibItemCollector *nibitems = [[GSNibItemCollector alloc] init];
|
||||||
NSEnumerator *en;
|
NSEnumerator *en;
|
||||||
|
@ -400,10 +400,10 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
|
|
||||||
// iterate through the objects returned
|
// iterate through the objects returned
|
||||||
en = [nameTable keyEnumerator];
|
en = [nameTable keyEnumerator];
|
||||||
while((key = [en nextObject]) != nil)
|
while ((key = [en nextObject]) != nil)
|
||||||
{
|
{
|
||||||
id o = [nameTable objectForKey: key];
|
id o = [nameTable objectForKey: key];
|
||||||
if(([o isKindOfClass: [NSMenu class]] && [key isEqual: @"NSMenu"]) ||
|
if (([o isKindOfClass: [NSMenu class]] && [key isEqual: @"NSMenu"]) ||
|
||||||
[o isKindOfClass: [NSWindow class]])
|
[o isKindOfClass: [NSWindow class]])
|
||||||
{
|
{
|
||||||
[topLevelObjects addObject: o]; // if it's a top level object, add it.
|
[topLevelObjects addObject: o]; // if it's a top level object, add it.
|
||||||
|
@ -526,9 +526,9 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
// the set of things to be retained. Also, the initial version of the nib container
|
// the set of things to be retained. Also, the initial version of the nib container
|
||||||
// needed this code, but subsequent versions don't, so don't send the notification,
|
// needed this code, but subsequent versions don't, so don't send the notification,
|
||||||
// if the version isn't zero.
|
// if the version isn't zero.
|
||||||
if(obj != nil && [aCoder versionForClassName: NSStringFromClass([GSNibContainer class])] == 0)
|
if (obj != nil && [aCoder versionForClassName: NSStringFromClass([GSNibContainer class])] == 0)
|
||||||
{
|
{
|
||||||
if([self isKindOfClass: [GSNibItem class]] == YES &&
|
if ([self isKindOfClass: [GSNibItem class]] == YES &&
|
||||||
[self isKindOfClass: [GSCustomView class]] == NO)
|
[self isKindOfClass: [GSCustomView class]] == NO)
|
||||||
{
|
{
|
||||||
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
||||||
|
@ -595,13 +595,13 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
|
|
||||||
- (id) initWithObject: (id)object className: (NSString *)className superClassName: (NSString *)superClassName
|
- (id) initWithObject: (id)object className: (NSString *)className superClassName: (NSString *)superClassName
|
||||||
{
|
{
|
||||||
if((self = [self init]) != nil)
|
if ((self = [self init]) != nil)
|
||||||
{
|
{
|
||||||
NSDebugLog(@"Created template %@ -> %@",NSStringFromClass([self class]), className);
|
NSDebugLog(@"Created template %@ -> %@",NSStringFromClass([self class]), className);
|
||||||
ASSIGN(_object, object);
|
ASSIGN(_object, object);
|
||||||
ASSIGN(_className, className);
|
ASSIGN(_className, className);
|
||||||
_superClass = NSClassFromString(superClassName);
|
_superClass = NSClassFromString(superClassName);
|
||||||
if(_superClass == nil)
|
if (_superClass == nil)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInternalInconsistencyException
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Unable to find class '%@', it is not linked into the application.", superClassName];
|
format: @"Unable to find class '%@', it is not linked into the application.", superClassName];
|
||||||
|
@ -612,7 +612,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
|
|
||||||
- init
|
- init
|
||||||
{
|
{
|
||||||
if((self = [super init]) != nil)
|
if ((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
_className = nil;
|
_className = nil;
|
||||||
_superClass = nil;
|
_superClass = nil;
|
||||||
|
@ -642,9 +642,9 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
{
|
{
|
||||||
id obj = nil;
|
id obj = nil;
|
||||||
int version = [coder versionForClassName: @"GSClassSwapper"];
|
int version = [coder versionForClassName: @"GSClassSwapper"];
|
||||||
if(version == 0)
|
if (version == 0)
|
||||||
{
|
{
|
||||||
if((self = [super init]) != nil)
|
if ((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
NSUnarchiver *unarchiver = (NSUnarchiver *)coder;
|
NSUnarchiver *unarchiver = (NSUnarchiver *)coder;
|
||||||
|
|
||||||
|
@ -654,10 +654,10 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
|
|
||||||
// if we are living within the interface builder app, then don't try to
|
// if we are living within the interface builder app, then don't try to
|
||||||
// morph into the subclass.
|
// morph into the subclass.
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
Class aClass = NSClassFromString(_className);
|
Class aClass = NSClassFromString(_className);
|
||||||
if(aClass == nil)
|
if (aClass == nil)
|
||||||
{
|
{
|
||||||
[NSException raise: NSInternalInconsistencyException
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Unable to find class '%@', it is not linked into the application.", _className];
|
format: @"Unable to find class '%@', it is not linked into the application.", _className];
|
||||||
|
@ -687,7 +687,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
[aCoder encodeValueOfObjCType: @encode(id) at: &_className];
|
[aCoder encodeValueOfObjCType: @encode(id) at: &_className];
|
||||||
[aCoder encodeValueOfObjCType: @encode(Class) at: &_superClass];
|
[aCoder encodeValueOfObjCType: @encode(Class) at: &_superClass];
|
||||||
|
|
||||||
if(_object != nil)
|
if (_object != nil)
|
||||||
{
|
{
|
||||||
// Don't call encodeValue, the way templates are used will prevent
|
// Don't call encodeValue, the way templates are used will prevent
|
||||||
// it from being saved correctly. Just call encodeWithCoder directly.
|
// it from being saved correctly. Just call encodeWithCoder directly.
|
||||||
|
@ -698,7 +698,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (BOOL) shouldSwapClass
|
- (BOOL) shouldSwapClass
|
||||||
{
|
{
|
||||||
BOOL result = YES;
|
BOOL result = YES;
|
||||||
if([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
if ([self respondsToSelector: @selector(isInInterfaceBuilder)])
|
||||||
{
|
{
|
||||||
result = !([self isInInterfaceBuilder]);
|
result = !([self isInInterfaceBuilder]);
|
||||||
}
|
}
|
||||||
|
@ -802,7 +802,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
}
|
}
|
||||||
|
|
||||||
// change the origin of the window.
|
// change the origin of the window.
|
||||||
if(changedOrigin)
|
if (changedOrigin)
|
||||||
{
|
{
|
||||||
[window setFrameOrigin: origin];
|
[window setFrameOrigin: origin];
|
||||||
}
|
}
|
||||||
|
@ -812,18 +812,18 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
id obj = [super initWithCoder: coder];
|
id obj = [super initWithCoder: coder];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
int version = [coder versionForClassName: @"GSWindowTemplate"];
|
int version = [coder versionForClassName: @"GSWindowTemplate"];
|
||||||
|
|
||||||
if(version == GSWINDOWT_VERSION)
|
if (version == GSWINDOWT_VERSION)
|
||||||
{
|
{
|
||||||
// decode the defer flag...
|
// decode the defer flag...
|
||||||
[coder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
[coder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
||||||
[coder decodeValueOfObjCType: @encode(unsigned int) at: &_autoPositionMask];
|
[coder decodeValueOfObjCType: @encode(unsigned int) at: &_autoPositionMask];
|
||||||
_screenRect = [coder decodeRect];
|
_screenRect = [coder decodeRect];
|
||||||
}
|
}
|
||||||
else if(version == 0)
|
else if (version == 0)
|
||||||
{
|
{
|
||||||
// decode the defer flag...
|
// decode the defer flag...
|
||||||
[coder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
[coder decodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
||||||
|
@ -831,9 +831,9 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
_screenRect = [[_object screen] frame];
|
_screenRect = [[_object screen] frame];
|
||||||
}
|
}
|
||||||
|
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
if(GSGetMethod([obj class], @selector(initWithContentRect:styleMask:backing:defer:), YES, NO) != NULL
|
if (GSGetMethod([obj class], @selector(initWithContentRect:styleMask:backing:defer:), YES, NO) != NULL
|
||||||
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
||||||
{
|
{
|
||||||
NSView *contentView = [obj contentView];
|
NSView *contentView = [obj contentView];
|
||||||
|
@ -860,7 +860,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
// Set all of the attributes into the object, if it
|
// Set all of the attributes into the object, if it
|
||||||
// responds to any of these methods.
|
// responds to any of these methods.
|
||||||
//
|
//
|
||||||
if([obj respondsToSelector: @selector(setAutoPositionMask:)])
|
if ([obj respondsToSelector: @selector(setAutoPositionMask:)])
|
||||||
{
|
{
|
||||||
[obj setAutoPositionMask: [self autoPositionMask]];
|
[obj setAutoPositionMask: [self autoPositionMask]];
|
||||||
}
|
}
|
||||||
|
@ -876,14 +876,14 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
|
|
||||||
[super encodeWithCoder: coder];
|
[super encodeWithCoder: coder];
|
||||||
|
|
||||||
if(version == GSWINDOWT_VERSION)
|
if (version == GSWINDOWT_VERSION)
|
||||||
{
|
{
|
||||||
_screenRect = [[_object screen] frame];
|
_screenRect = [[_object screen] frame];
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
||||||
[coder encodeValueOfObjCType: @encode(unsigned int) at: &_autoPositionMask];
|
[coder encodeValueOfObjCType: @encode(unsigned int) at: &_autoPositionMask];
|
||||||
[coder encodeRect: _screenRect];
|
[coder encodeRect: _screenRect];
|
||||||
}
|
}
|
||||||
else if(version == 0)
|
else if (version == 0)
|
||||||
{
|
{
|
||||||
[coder encodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
[coder encodeValueOfObjCType: @encode(BOOL) at: &_deferFlag];
|
||||||
}
|
}
|
||||||
|
@ -902,11 +902,11 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
id obj = [super initWithCoder: coder];
|
id obj = [super initWithCoder: coder];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
if(GSGetMethod([obj class],@selector(initWithFrame:), YES, NO) != NULL
|
if (GSGetMethod([obj class],@selector(initWithFrame:), YES, NO) != NULL
|
||||||
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
||||||
{
|
{
|
||||||
NSRect theFrame = [obj frame];
|
NSRect theFrame = [obj frame];
|
||||||
|
@ -932,11 +932,11 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
id obj = [super initWithCoder: coder];
|
id obj = [super initWithCoder: coder];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
if(GSGetMethod([obj class],@selector(initWithFrame:), YES, NO) != NULL
|
if (GSGetMethod([obj class],@selector(initWithFrame:), YES, NO) != NULL
|
||||||
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
||||||
{
|
{
|
||||||
NSRect theFrame = [obj frame];
|
NSRect theFrame = [obj frame];
|
||||||
|
@ -962,11 +962,11 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
id obj = [super initWithCoder: coder];
|
id obj = [super initWithCoder: coder];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
if(GSGetMethod([obj class],@selector(initWithFrame:textContainer:), YES, NO) != NULL
|
if (GSGetMethod([obj class],@selector(initWithFrame:textContainer:), YES, NO) != NULL
|
||||||
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
||||||
{
|
{
|
||||||
NSRect theFrame = [obj frame];
|
NSRect theFrame = [obj frame];
|
||||||
|
@ -994,11 +994,11 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
id obj = [super initWithCoder: coder];
|
id obj = [super initWithCoder: coder];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
if(GSGetMethod([obj class],@selector(initWithTitle:), YES, NO) != NULL
|
if (GSGetMethod([obj class],@selector(initWithTitle:), YES, NO) != NULL
|
||||||
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
||||||
{
|
{
|
||||||
NSString *theTitle = [obj title];
|
NSString *theTitle = [obj title];
|
||||||
|
@ -1025,12 +1025,12 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
id obj = [super initWithCoder: coder];
|
id obj = [super initWithCoder: coder];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
if(GSGetMethod([obj class],@selector(initWithFrame:), YES, NO) != NULL)
|
if (GSGetMethod([obj class],@selector(initWithFrame:), YES, NO) != NULL)
|
||||||
{
|
{
|
||||||
NSRect theFrame = [obj frame];
|
NSRect theFrame = [obj frame];
|
||||||
obj = [obj initWithFrame: theFrame];
|
obj = [obj initWithFrame: theFrame];
|
||||||
|
@ -1055,11 +1055,11 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
id obj = [super initWithCoder: coder];
|
id obj = [super initWithCoder: coder];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
if([self shouldSwapClass])
|
if ([self shouldSwapClass])
|
||||||
{
|
{
|
||||||
if(GSGetMethod([obj class],@selector(init), YES, NO) != NULL
|
if (GSGetMethod([obj class],@selector(init), YES, NO) != NULL
|
||||||
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
&& ![_className isEqualToString: NSStringFromClass(_superClass)])
|
||||||
{
|
{
|
||||||
obj = [self init];
|
obj = [self init];
|
||||||
|
@ -1080,7 +1080,7 @@ static NSString *GSInternalNibItemAddedNotification = @"_GSInternalNibItemAddedN
|
||||||
withSuperClassName: (NSString *)superClassName
|
withSuperClassName: (NSString *)superClassName
|
||||||
{
|
{
|
||||||
id template = nil;
|
id template = nil;
|
||||||
if(object != nil)
|
if (object != nil)
|
||||||
{
|
{
|
||||||
if ([object isKindOfClass: [NSWindow class]])
|
if ([object isKindOfClass: [NSWindow class]])
|
||||||
{
|
{
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
[[NSProcessInfo processInfo] globallyUniqueString]];
|
[[NSProcessInfo processInfo] globallyUniqueString]];
|
||||||
|
|
||||||
_path = [_path stringByAppendingPathExtension: @"pdf"];
|
_path = [_path stringByAppendingPathExtension: @"pdf"];
|
||||||
RETAIN( _path );
|
RETAIN(_path);
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [[principalClass gsPrintOperationClass] allocWithZone: zone];
|
return [[principalClass gsPrintOperationClass] allocWithZone: zone];
|
||||||
|
@ -158,7 +158,7 @@
|
||||||
|
|
||||||
/* We can't remove the temp file because the previewer might still be
|
/* We can't remove the temp file because the previewer might still be
|
||||||
using it, perhaps the printer is also?
|
using it, perhaps the printer is also?
|
||||||
if ( _path )
|
if (_path)
|
||||||
{
|
{
|
||||||
[[NSFileManager defaultManager] removeFileAtPath: _path
|
[[NSFileManager defaultManager] removeFileAtPath: _path
|
||||||
handler: nil];
|
handler: nil];
|
||||||
|
|
|
@ -64,7 +64,7 @@ static NSBundle *printingBundle = nil;
|
||||||
|
|
||||||
libraryPathsEnumerator = [NSStandardLibraryPaths() objectEnumerator];
|
libraryPathsEnumerator = [NSStandardLibraryPaths() objectEnumerator];
|
||||||
|
|
||||||
while( (path = [libraryPathsEnumerator nextObject]) )
|
while ((path = [libraryPathsEnumerator nextObject]))
|
||||||
{
|
{
|
||||||
path = [path stringByAppendingPathComponent: @"Bundles"];
|
path = [path stringByAppendingPathComponent: @"Bundles"];
|
||||||
path = [path stringByAppendingPathComponent: @"GSPrinting"];
|
path = [path stringByAppendingPathComponent: @"GSPrinting"];
|
||||||
|
@ -75,7 +75,7 @@ static NSBundle *printingBundle = nil;
|
||||||
NSBundle *bundle;
|
NSBundle *bundle;
|
||||||
|
|
||||||
bundle = [NSBundle bundleWithPath: path];
|
bundle = [NSBundle bundleWithPath: path];
|
||||||
if( [bundle load] == NO )
|
if ([bundle load] == NO)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"GSPrinting", @"Error loading printing bundle at %@",
|
NSDebugLLog(@"GSPrinting", @"Error loading printing bundle at %@",
|
||||||
path);
|
path);
|
||||||
|
@ -83,7 +83,7 @@ static NSBundle *printingBundle = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
//one last check to make sure the principle class can be loaded
|
//one last check to make sure the principle class can be loaded
|
||||||
if( [bundle principalClass] == Nil)
|
if ([bundle principalClass] == Nil)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"GSPrinting",
|
NSDebugLLog(@"GSPrinting",
|
||||||
@"Error loading principal class from printing bundle at %@",
|
@"Error loading principal class from printing bundle at %@",
|
||||||
|
@ -108,13 +108,13 @@ static NSBundle *printingBundle = nil;
|
||||||
{
|
{
|
||||||
NSBundle *bundle;
|
NSBundle *bundle;
|
||||||
|
|
||||||
if( (bundle = [GSPrinting loadPrintingBundle: @"GSCUPS"]) )
|
if ((bundle = [GSPrinting loadPrintingBundle: @"GSCUPS"]))
|
||||||
return bundle;
|
return bundle;
|
||||||
|
|
||||||
if( (bundle = [GSPrinting loadPrintingBundle: @"GSLPR"]) )
|
if ((bundle = [GSPrinting loadPrintingBundle: @"GSLPR"]))
|
||||||
return bundle;
|
return bundle;
|
||||||
|
|
||||||
if( (bundle = [GSPrinting loadPrintingBundle: @"GSWin32"]) )
|
if ((bundle = [GSPrinting loadPrintingBundle: @"GSWin32"]))
|
||||||
return bundle;
|
return bundle;
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -127,7 +127,7 @@ static NSBundle *printingBundle = nil;
|
||||||
NSString *defaultBundleName;
|
NSString *defaultBundleName;
|
||||||
NSBundle *bundle;
|
NSBundle *bundle;
|
||||||
|
|
||||||
if( printingBundle )
|
if (printingBundle)
|
||||||
{
|
{
|
||||||
return printingBundle;
|
return printingBundle;
|
||||||
}
|
}
|
||||||
|
@ -138,20 +138,20 @@ static NSBundle *printingBundle = nil;
|
||||||
stringForKey: @"GSPrinting"];
|
stringForKey: @"GSPrinting"];
|
||||||
|
|
||||||
/*Which Printing Bundle?*/
|
/*Which Printing Bundle?*/
|
||||||
if( defaultBundleName == nil )
|
if (defaultBundleName == nil)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"GSPrinting",
|
NSDebugLLog(@"GSPrinting",
|
||||||
@"User did not set a printing bundle, trying till something works");
|
@"User did not set a printing bundle, trying till something works");
|
||||||
|
|
||||||
bundle = [GSPrinting loadAnyWorkingPrintingBundle];
|
bundle = [GSPrinting loadAnyWorkingPrintingBundle];
|
||||||
if( bundle == nil )
|
if (bundle == nil)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"GSPrinting",
|
NSDebugLLog(@"GSPrinting",
|
||||||
@"Could not load any working printing bundle");
|
@"Could not load any working printing bundle");
|
||||||
|
|
||||||
NSRunAlertPanel(@"GNUstep Printing Backend System",
|
NSRunAlertPanel(@"GNUstep Printing Backend System",
|
||||||
@"Could not open any working printing bundle. Printing will not work.",
|
@"Could not open any working printing bundle. Printing will not work.",
|
||||||
@"Ok", NULL, NULL );
|
@"Ok", NULL, NULL);
|
||||||
|
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ static NSBundle *printingBundle = nil;
|
||||||
|
|
||||||
bundle = [GSPrinting loadPrintingBundle: defaultBundleName];
|
bundle = [GSPrinting loadPrintingBundle: defaultBundleName];
|
||||||
|
|
||||||
if( bundle == nil )
|
if (bundle == nil)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"GSPrinting",
|
NSDebugLLog(@"GSPrinting",
|
||||||
@"User set %@ as the printing bundle but that did not work.\
|
@"User set %@ as the printing bundle but that did not work.\
|
||||||
|
@ -172,13 +172,13 @@ static NSBundle *printingBundle = nil;
|
||||||
defaultBundleName);
|
defaultBundleName);
|
||||||
|
|
||||||
bundle = [GSPrinting loadAnyWorkingPrintingBundle];
|
bundle = [GSPrinting loadAnyWorkingPrintingBundle];
|
||||||
if( bundle == nil )
|
if (bundle == nil)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"GSPrinting",
|
NSDebugLLog(@"GSPrinting",
|
||||||
@"Could not load any working printing bundle");
|
@"Could not load any working printing bundle");
|
||||||
NSRunAlertPanel(@"GNUstep Printing Backend System",
|
NSRunAlertPanel(@"GNUstep Printing Backend System",
|
||||||
@"Could not open any working printing bundle. Printing will not work.",
|
@"Could not open any working printing bundle. Printing will not work.",
|
||||||
@"Ok", NULL, NULL );
|
@"Ok", NULL, NULL);
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -190,7 +190,7 @@ static NSBundle *printingBundle = nil;
|
||||||
defaultBundleName, [[bundle bundlePath] lastPathComponent]];
|
defaultBundleName, [[bundle bundlePath] lastPathComponent]];
|
||||||
|
|
||||||
NSRunAlertPanel(@"GNUstep Printing Backend System",
|
NSRunAlertPanel(@"GNUstep Printing Backend System",
|
||||||
msg, @"Ok", NULL, NULL );
|
msg, @"Ok", NULL, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
|
|
||||||
[NSEvent startPeriodicEventsAfterDelay: SLIDE_TIME_STEP
|
[NSEvent startPeriodicEventsAfterDelay: SLIDE_TIME_STEP
|
||||||
withPeriod: SLIDE_TIME_STEP];
|
withPeriod: SLIDE_TIME_STEP];
|
||||||
while(steps--)
|
while (steps--)
|
||||||
{
|
{
|
||||||
NSEvent *theEvent = [NSApp nextEventMatchingMask: NSPeriodicMask
|
NSEvent *theEvent = [NSApp nextEventMatchingMask: NSPeriodicMask
|
||||||
untilDate: [NSDate distantFuture]
|
untilDate: [NSDate distantFuture]
|
||||||
|
|
|
@ -189,7 +189,7 @@
|
||||||
|
|
||||||
borderChange = aBorder - _minXBorder;
|
borderChange = aBorder - _minXBorder;
|
||||||
|
|
||||||
for(i = 0; i < _numberOfColumns; i++)
|
for (i = 0; i < _numberOfColumns; i++)
|
||||||
{
|
{
|
||||||
_columnXOrigin[i] += borderChange;
|
_columnXOrigin[i] += borderChange;
|
||||||
[self _updateColumnOrigin: i];
|
[self _updateColumnOrigin: i];
|
||||||
|
@ -229,7 +229,7 @@
|
||||||
|
|
||||||
borderChange = aBorder - _minYBorder;
|
borderChange = aBorder - _minYBorder;
|
||||||
|
|
||||||
for(i = 0; i < _numberOfRows; i++)
|
for (i = 0; i < _numberOfRows; i++)
|
||||||
{
|
{
|
||||||
_rowYOrigin[i] += borderChange;
|
_rowYOrigin[i] += borderChange;
|
||||||
[self _updateRowOrigin: i];
|
[self _updateRowOrigin: i];
|
||||||
|
|
|
@ -681,7 +681,7 @@ static GSValidationCenter *vc;
|
||||||
_customizationPaletteIsRunning =
|
_customizationPaletteIsRunning =
|
||||||
[NSBundle loadNibNamed: @"GSToolbarCustomizationPalette" owner: self];
|
[NSBundle loadNibNamed: @"GSToolbarCustomizationPalette" owner: self];
|
||||||
|
|
||||||
if(!_customizationPaletteIsRunning)
|
if (!_customizationPaletteIsRunning)
|
||||||
{
|
{
|
||||||
NSLog(@"Failed to load gorm for GSToolbarCustomizationPalette");
|
NSLog(@"Failed to load gorm for GSToolbarCustomizationPalette");
|
||||||
}
|
}
|
||||||
|
@ -692,7 +692,7 @@ static GSValidationCenter *vc;
|
||||||
NSEnumerator *e = [[self visibleItems] objectEnumerator];
|
NSEnumerator *e = [[self visibleItems] objectEnumerator];
|
||||||
NSToolbarItem *item = nil;
|
NSToolbarItem *item = nil;
|
||||||
|
|
||||||
while((item = [e nextObject]) != nil)
|
while ((item = [e nextObject]) != nil)
|
||||||
{
|
{
|
||||||
[item validate];
|
[item validate];
|
||||||
}
|
}
|
||||||
|
@ -985,7 +985,7 @@ static GSValidationCenter *vc;
|
||||||
{
|
{
|
||||||
NSToolbarItem *item = nil;
|
NSToolbarItem *item = nil;
|
||||||
|
|
||||||
if([itemIdent isEqual: NSToolbarSeparatorItemIdentifier] ||
|
if ([itemIdent isEqual: NSToolbarSeparatorItemIdentifier] ||
|
||||||
[itemIdent isEqual: NSToolbarSpaceItemIdentifier] ||
|
[itemIdent isEqual: NSToolbarSpaceItemIdentifier] ||
|
||||||
[itemIdent isEqual: NSToolbarFlexibleSpaceItemIdentifier] ||
|
[itemIdent isEqual: NSToolbarFlexibleSpaceItemIdentifier] ||
|
||||||
[itemIdent isEqual: NSToolbarShowColorsItemIdentifier] ||
|
[itemIdent isEqual: NSToolbarShowColorsItemIdentifier] ||
|
||||||
|
@ -1031,7 +1031,7 @@ static GSValidationCenter *vc;
|
||||||
|
|
||||||
allowedItems = [_delegate toolbarAllowedItemIdentifiers: self];
|
allowedItems = [_delegate toolbarAllowedItemIdentifiers: self];
|
||||||
|
|
||||||
if([allowedItems containsObject: itemIdentifier])
|
if ([allowedItems containsObject: itemIdentifier])
|
||||||
{
|
{
|
||||||
item = [self _toolbarItemForIdentifier: itemIdentifier];
|
item = [self _toolbarItemForIdentifier: itemIdentifier];
|
||||||
if (item == nil)
|
if (item == nil)
|
||||||
|
@ -1140,7 +1140,7 @@ static GSValidationCenter *vc;
|
||||||
|
|
||||||
- (void) _setDelegate: (id)delegate broadcast: (BOOL)broadcast
|
- (void) _setDelegate: (id)delegate broadcast: (BOOL)broadcast
|
||||||
{
|
{
|
||||||
//if(_delegate)
|
//if (_delegate)
|
||||||
// [nc removeObserver: _delegate name: nil object: self];
|
// [nc removeObserver: _delegate name: nil object: self];
|
||||||
|
|
||||||
if (_delegate == delegate)
|
if (_delegate == delegate)
|
||||||
|
|
|
@ -289,7 +289,7 @@ makeScrollViewWithRect(NSRect rect)
|
||||||
[button setButtonType: NSMomentaryPushButton];
|
[button setButtonType: NSMomentaryPushButton];
|
||||||
[button setTitle: @""];
|
[button setTitle: @""];
|
||||||
[button setTarget: self];
|
[button setTarget: self];
|
||||||
[button setAction: @selector(buttonAction: )];
|
[button setAction: @selector(buttonAction:)];
|
||||||
[button setFont: [NSFont systemFontOfSize: 0]];
|
[button setFont: [NSFont systemFontOfSize: 0]];
|
||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
@ -1334,7 +1334,7 @@ void NSBeginInformationalAlertSheet(NSString *title,
|
||||||
[button setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin];
|
[button setAutoresizingMask: NSViewMinXMargin | NSViewMaxYMargin];
|
||||||
[button setButtonType: NSMomentaryPushButton];
|
[button setButtonType: NSMomentaryPushButton];
|
||||||
[button setTarget: self];
|
[button setTarget: self];
|
||||||
[button setAction: @selector(buttonAction: )];
|
[button setAction: @selector(buttonAction:)];
|
||||||
[button setFont: [NSFont systemFontOfSize: 0]];
|
[button setFont: [NSFont systemFontOfSize: 0]];
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -178,7 +178,7 @@ gnustep_backend_path (NSString *dir, NSString *name)
|
||||||
static NSString *
|
static NSString *
|
||||||
gnustep_backend_framework (NSString *bundleName)
|
gnustep_backend_framework (NSString *bundleName)
|
||||||
{
|
{
|
||||||
if ( bundleName == nil )
|
if (bundleName == nil)
|
||||||
bundleName = @"GNUstep_back.framework";
|
bundleName = @"GNUstep_back.framework";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -208,7 +208,7 @@ gnustep_backend_bundle(NSString *bundleName)
|
||||||
NSString *path, *bundleWithVersion;
|
NSString *path, *bundleWithVersion;
|
||||||
int version = GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GUI_MINOR_VERSION;
|
int version = GNUSTEP_GUI_MAJOR_VERSION * 100 + GNUSTEP_GUI_MINOR_VERSION;
|
||||||
|
|
||||||
if ( bundleName == nil )
|
if (bundleName == nil)
|
||||||
bundleName = @"libgnustep-back";
|
bundleName = @"libgnustep-back";
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -91,7 +91,7 @@ typedef struct _PathElement
|
||||||
|
|
||||||
+ (void)initialize
|
+ (void)initialize
|
||||||
{
|
{
|
||||||
if(self == [NSBezierPath class])
|
if (self == [NSBezierPath class])
|
||||||
NSBezierPath_concrete_class = [GSBezierPath class];
|
NSBezierPath_concrete_class = [GSBezierPath class];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ typedef struct _PathElement
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
if(_cacheImage != nil)
|
if (_cacheImage != nil)
|
||||||
RELEASE(_cacheImage);
|
RELEASE(_cacheImage);
|
||||||
|
|
||||||
if (_dash_pattern != NULL)
|
if (_dash_pattern != NULL)
|
||||||
|
@ -470,13 +470,13 @@ typedef struct _PathElement
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
if(_cachesBezierPath)
|
if (_cachesBezierPath)
|
||||||
{
|
{
|
||||||
NSRect bounds = [self bounds];
|
NSRect bounds = [self bounds];
|
||||||
NSPoint origin = bounds.origin;
|
NSPoint origin = bounds.origin;
|
||||||
|
|
||||||
// FIXME: I don't see how this should work with color changes
|
// FIXME: I don't see how this should work with color changes
|
||||||
if(_cacheImage == nil)
|
if (_cacheImage == nil)
|
||||||
{
|
{
|
||||||
_cacheImage = [[NSImage alloc] initWithSize: bounds.size];
|
_cacheImage = [[NSImage alloc] initWithSize: bounds.size];
|
||||||
[_cacheImage lockFocus];
|
[_cacheImage lockFocus];
|
||||||
|
@ -498,19 +498,19 @@ typedef struct _PathElement
|
||||||
{
|
{
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
if(_cachesBezierPath)
|
if (_cachesBezierPath)
|
||||||
{
|
{
|
||||||
NSRect bounds = [self bounds];
|
NSRect bounds = [self bounds];
|
||||||
NSPoint origin = bounds.origin;
|
NSPoint origin = bounds.origin;
|
||||||
|
|
||||||
// FIXME: I don't see how this should work with color changes
|
// FIXME: I don't see how this should work with color changes
|
||||||
if(_cacheImage == nil)
|
if (_cacheImage == nil)
|
||||||
{
|
{
|
||||||
_cacheImage = [[NSImage alloc] initWithSize: bounds.size];
|
_cacheImage = [[NSImage alloc] initWithSize: bounds.size];
|
||||||
[_cacheImage lockFocus];
|
[_cacheImage lockFocus];
|
||||||
DPStranslate(ctxt, -origin.x, -origin.y);
|
DPStranslate(ctxt, -origin.x, -origin.y);
|
||||||
[ctxt GSSendBezierPath: self];
|
[ctxt GSSendBezierPath: self];
|
||||||
if([self windingRule] == NSNonZeroWindingRule)
|
if ([self windingRule] == NSNonZeroWindingRule)
|
||||||
DPSfill(ctxt);
|
DPSfill(ctxt);
|
||||||
else
|
else
|
||||||
DPSeofill(ctxt);
|
DPSeofill(ctxt);
|
||||||
|
@ -521,7 +521,7 @@ typedef struct _PathElement
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
[ctxt GSSendBezierPath: self];
|
[ctxt GSSendBezierPath: self];
|
||||||
if([self windingRule] == NSNonZeroWindingRule)
|
if ([self windingRule] == NSNonZeroWindingRule)
|
||||||
DPSfill(ctxt);
|
DPSfill(ctxt);
|
||||||
else
|
else
|
||||||
DPSeofill(ctxt);
|
DPSeofill(ctxt);
|
||||||
|
@ -533,7 +533,7 @@ typedef struct _PathElement
|
||||||
NSGraphicsContext *ctxt = GSCurrentContext();
|
NSGraphicsContext *ctxt = GSCurrentContext();
|
||||||
|
|
||||||
[ctxt GSSendBezierPath: self];
|
[ctxt GSSendBezierPath: self];
|
||||||
if([self windingRule] == NSNonZeroWindingRule)
|
if ([self windingRule] == NSNonZeroWindingRule)
|
||||||
DPSclip(ctxt);
|
DPSclip(ctxt);
|
||||||
else
|
else
|
||||||
DPSeoclip(ctxt);
|
DPSeoclip(ctxt);
|
||||||
|
@ -545,7 +545,7 @@ typedef struct _PathElement
|
||||||
|
|
||||||
DPSinitclip(ctxt);
|
DPSinitclip(ctxt);
|
||||||
[ctxt GSSendBezierPath: self];
|
[ctxt GSSendBezierPath: self];
|
||||||
if([self windingRule] == NSNonZeroWindingRule)
|
if ([self windingRule] == NSNonZeroWindingRule)
|
||||||
DPSclip(ctxt);
|
DPSclip(ctxt);
|
||||||
else
|
else
|
||||||
DPSeoclip(ctxt);
|
DPSeoclip(ctxt);
|
||||||
|
@ -569,7 +569,7 @@ typedef struct _PathElement
|
||||||
last_p = NSZeroPoint;
|
last_p = NSZeroPoint;
|
||||||
|
|
||||||
count = [self elementCount];
|
count = [self elementCount];
|
||||||
for(i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
type = [self elementAtIndex: i associatedPoints: pts];
|
type = [self elementAtIndex: i associatedPoints: pts];
|
||||||
switch(type)
|
switch(type)
|
||||||
|
@ -627,7 +627,7 @@ typedef struct _PathElement
|
||||||
|
|
||||||
last_type = NSMoveToBezierPathElement;
|
last_type = NSMoveToBezierPathElement;
|
||||||
count = [self elementCount];
|
count = [self elementCount];
|
||||||
for(i = count - 1; i >= 0; i--)
|
for (i = count - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
type = [self elementAtIndex: i associatedPoints: pts];
|
type = [self elementAtIndex: i associatedPoints: pts];
|
||||||
switch(type)
|
switch(type)
|
||||||
|
@ -702,7 +702,7 @@ typedef struct _PathElement
|
||||||
int i, count;
|
int i, count;
|
||||||
|
|
||||||
count = [self elementCount];
|
count = [self elementCount];
|
||||||
for(i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
type = [self elementAtIndex: i associatedPoints: pts];
|
type = [self elementAtIndex: i associatedPoints: pts];
|
||||||
switch(type)
|
switch(type)
|
||||||
|
@ -1491,7 +1491,7 @@ static int winding_curve(double_point from, double_point to, double_point c1,
|
||||||
{
|
{
|
||||||
int sum;
|
int sum;
|
||||||
|
|
||||||
if(![self elementCount])
|
if (![self elementCount])
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
if (!NSPointInRect(point, [self bounds]))
|
if (!NSPointInRect(point, [self bounds]))
|
||||||
|
@ -1529,7 +1529,7 @@ static int winding_curve(double_point from, double_point to, double_point c1,
|
||||||
{
|
{
|
||||||
_cachesBezierPath = flag;
|
_cachesBezierPath = flag;
|
||||||
|
|
||||||
if(!flag)
|
if (!flag)
|
||||||
INVALIDATE_CACHE();
|
INVALIDATE_CACHE();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1556,7 +1556,7 @@ static int winding_curve(double_point from, double_point to, double_point c1,
|
||||||
count = [self elementCount];
|
count = [self elementCount];
|
||||||
[aCoder encodeValueOfObjCType: @encode(int) at: &count];
|
[aCoder encodeValueOfObjCType: @encode(int) at: &count];
|
||||||
|
|
||||||
for(i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
type = [self elementAtIndex: i associatedPoints: pts];
|
type = [self elementAtIndex: i associatedPoints: pts];
|
||||||
[aCoder encodeValueOfObjCType: @encode(NSBezierPathElement) at: &type];
|
[aCoder encodeValueOfObjCType: @encode(NSBezierPathElement) at: &type];
|
||||||
|
@ -1603,7 +1603,7 @@ static int winding_curve(double_point from, double_point to, double_point c1,
|
||||||
|
|
||||||
[aCoder decodeValueOfObjCType: @encode(int) at: &count];
|
[aCoder decodeValueOfObjCType: @encode(int) at: &count];
|
||||||
|
|
||||||
for(i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
[aCoder decodeValueOfObjCType: @encode(NSBezierPathElement) at: &type];
|
[aCoder decodeValueOfObjCType: @encode(NSBezierPathElement) at: &type];
|
||||||
switch(type)
|
switch(type)
|
||||||
|
@ -1639,7 +1639,7 @@ static int winding_curve(double_point from, double_point to, double_point c1,
|
||||||
{
|
{
|
||||||
NSBezierPath *path = (NSBezierPath*)NSCopyObject (self, 0, zone);
|
NSBezierPath *path = (NSBezierPath*)NSCopyObject (self, 0, zone);
|
||||||
|
|
||||||
if(_cachesBezierPath && _cacheImage)
|
if (_cachesBezierPath && _cacheImage)
|
||||||
path->_cacheImage = [_cacheImage copy];
|
path->_cacheImage = [_cacheImage copy];
|
||||||
|
|
||||||
if (_dash_pattern != NULL)
|
if (_dash_pattern != NULL)
|
||||||
|
@ -1900,11 +1900,11 @@ static NSPoint point_on_curve(double t, NSPoint a, NSPoint b, NSPoint c,
|
||||||
|
|
||||||
if (points != NULL)
|
if (points != NULL)
|
||||||
{
|
{
|
||||||
if(type == NSMoveToBezierPathElement || type == NSLineToBezierPathElement)
|
if (type == NSMoveToBezierPathElement || type == NSLineToBezierPathElement)
|
||||||
{
|
{
|
||||||
points[0] = elm.points[0];
|
points[0] = elm.points[0];
|
||||||
}
|
}
|
||||||
else if(type == NSCurveToBezierPathElement)
|
else if (type == NSCurveToBezierPathElement)
|
||||||
{
|
{
|
||||||
points[0] = elm.points[0];
|
points[0] = elm.points[0];
|
||||||
points[1] = elm.points[1];
|
points[1] = elm.points[1];
|
||||||
|
@ -1964,7 +1964,7 @@ static NSPoint point_on_curve(double t, NSPoint a, NSPoint b, NSPoint c,
|
||||||
[transform methodForSelector: transformPointSel];
|
[transform methodForSelector: transformPointSel];
|
||||||
|
|
||||||
count = GSIArrayCount(pathElements);
|
count = GSIArrayCount(pathElements);
|
||||||
for(i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
type = elments[i].type;
|
type = elments[i].type;
|
||||||
switch(type)
|
switch(type)
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
char *p = buffer; \
|
char *p = buffer; \
|
||||||
while ( *ptr != '\n' && *ptr != '\r' && (ptr-bytes) < length) \
|
while (*ptr != '\n' && *ptr != '\r' && (ptr-bytes) < length) \
|
||||||
{ \
|
{ \
|
||||||
*p++ = *ptr++; \
|
*p++ = *ptr++; \
|
||||||
if (p == &buffer[sizeof(buffer)]) \
|
if (p == &buffer[sizeof(buffer)]) \
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
bytesPerRow: 0
|
bytesPerRow: 0
|
||||||
bitsPerPixel: 0];
|
bitsPerPixel: 0];
|
||||||
|
|
||||||
if ([self bytesPerRow] * ysize > (length - (ptr - bytes)) )
|
if ([self bytesPerRow] * ysize > (length - (ptr - bytes)))
|
||||||
ERRMSG(@"Invalid PNM file (short data)");
|
ERRMSG(@"Invalid PNM file (short data)");
|
||||||
pchar = [self bitmapData];
|
pchar = [self bitmapData];
|
||||||
if (levels < 256)
|
if (levels < 256)
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>EXPLAINS NSBox</p>
|
* <p>EXPLAINS NSBox</p>
|
||||||
*<p> TODO : explains how is resized the rects ( margins etc... ) </p>
|
*<p> TODO : explains how is resized the rects (margins etc...) </p>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@implementation NSBox
|
@implementation NSBox
|
||||||
|
|
|
@ -1863,7 +1863,7 @@ static NSTextFieldCell *titleCell;
|
||||||
|
|
||||||
a = [sender selectedCells];
|
a = [sender selectedCells];
|
||||||
aCount = [a count];
|
aCount = [a count];
|
||||||
if(aCount == 0)
|
if (aCount == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
selectedCells = [a mutableCopy];
|
selectedCells = [a mutableCopy];
|
||||||
|
@ -2277,7 +2277,7 @@ static NSTextFieldCell *titleCell;
|
||||||
IMP lcarc = [self methodForSelector: lcarcSel];
|
IMP lcarc = [self methodForSelector: lcarcSel];
|
||||||
|
|
||||||
selectedColumn = [self selectedColumn];
|
selectedColumn = [self selectedColumn];
|
||||||
if(selectedColumn != -1)
|
if (selectedColumn != -1)
|
||||||
{
|
{
|
||||||
matrix = [self matrixInColumn: selectedColumn];
|
matrix = [self matrixInColumn: selectedColumn];
|
||||||
n = [matrix numberOfRows];
|
n = [matrix numberOfRows];
|
||||||
|
@ -2828,7 +2828,7 @@ static NSTextFieldCell *titleCell;
|
||||||
// Get the selected cell
|
// Get the selected cell
|
||||||
// Use its string value as the title
|
// Use its string value as the title
|
||||||
// Only if it is not a leaf
|
// Only if it is not a leaf
|
||||||
if(_allowsMultipleSelection == NO)
|
if (_allowsMultipleSelection == NO)
|
||||||
{
|
{
|
||||||
c = [self selectedCellInColumn: column - 1];
|
c = [self selectedCellInColumn: column - 1];
|
||||||
}
|
}
|
||||||
|
@ -2842,7 +2842,7 @@ static NSTextFieldCell *titleCell;
|
||||||
|
|
||||||
selectedCells = [matrix selectedCells];
|
selectedCells = [matrix selectedCells];
|
||||||
|
|
||||||
if([selectedCells count] == 1)
|
if ([selectedCells count] == 1)
|
||||||
{
|
{
|
||||||
c = [selectedCells objectAtIndex:0];
|
c = [selectedCells objectAtIndex:0];
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ static NSFont *_leafFont;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*<p>Returns the alternate image in the NSBrowserCell
|
*<p>Returns the alternate image in the NSBrowserCell
|
||||||
* ( used when the cell is highlighted ) </p>
|
* (used when the cell is highlighted) </p>
|
||||||
*<p>See Also: -setAlternateImage:</p>
|
*<p>See Also: -setAlternateImage:</p>
|
||||||
*/
|
*/
|
||||||
- (NSImage*) alternateImage
|
- (NSImage*) alternateImage
|
||||||
|
@ -163,7 +163,7 @@ static NSFont *_leafFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*<p>Sets the altenate image ( used when the cell is highlighted ) to anImage
|
*<p>Sets the altenate image (used when the cell is highlighted) to anImage
|
||||||
*</p><p>See Also: -alternateImage</p>
|
*</p><p>See Also: -alternateImage</p>
|
||||||
*/
|
*/
|
||||||
- (void) setAlternateImage: (NSImage *)anImage
|
- (void) setAlternateImage: (NSImage *)anImage
|
||||||
|
|
|
@ -271,12 +271,12 @@ Class gmodel_class(void)
|
||||||
NSFileManager *mgr = [NSFileManager defaultManager];
|
NSFileManager *mgr = [NSFileManager defaultManager];
|
||||||
BOOL isDir = NO;
|
BOOL isDir = NO;
|
||||||
|
|
||||||
if([mgr fileExistsAtPath: fileName isDirectory: &isDir])
|
if ([mgr fileExistsAtPath: fileName isDirectory: &isDir])
|
||||||
{
|
{
|
||||||
NSData *data = nil;
|
NSData *data = nil;
|
||||||
|
|
||||||
// if the data is in a directory, then load from objects.gorm in the directory
|
// if the data is in a directory, then load from objects.gorm in the directory
|
||||||
if(isDir == NO)
|
if (isDir == NO)
|
||||||
{
|
{
|
||||||
data = [NSData dataWithContentsOfFile: fileName];
|
data = [NSData dataWithContentsOfFile: fileName];
|
||||||
NSDebugLog(@"Loaded data from file...");
|
NSDebugLog(@"Loaded data from file...");
|
||||||
|
@ -420,7 +420,7 @@ Class gmodel_class(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
path = [rootPath stringByAppendingPathExtension: ext];
|
path = [rootPath stringByAppendingPathExtension: ext];
|
||||||
if([mgr isReadableFileAtPath: path])
|
if ([mgr isReadableFileAtPath: path])
|
||||||
{
|
{
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
|
@ -715,8 +715,8 @@ static NSColor *shadowCol;
|
||||||
|
|
||||||
/**<p>Sets the NSCell's state. Please use always symbolic constants when
|
/**<p>Sets the NSCell's state. Please use always symbolic constants when
|
||||||
calling this method. The integer values could be changed in the this
|
calling this method. The integer values could be changed in the this
|
||||||
implementation. ( Currently they match the Cocoa values but they are
|
implementation. (Currently they match the Cocoa values but they are
|
||||||
quite strange )</p> <p>See Also: -state</p>
|
quite strange)</p> <p>See Also: -state</p>
|
||||||
*/
|
*/
|
||||||
- (void) setState: (int)value
|
- (void) setState: (int)value
|
||||||
{
|
{
|
||||||
|
@ -1338,7 +1338,7 @@ static NSColor *shadowCol;
|
||||||
{
|
{
|
||||||
SEL action = [self action];
|
SEL action = [self action];
|
||||||
|
|
||||||
if(_cell.is_disabled == YES)
|
if (_cell.is_disabled == YES)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1677,7 +1677,7 @@ static NSColor *shadowCol;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**<p>Does nothing. This method is used by subclasses to recalculate sizes</p>
|
/**<p>Does nothing. This method is used by subclasses to recalculate sizes</p>
|
||||||
* <p>It is usally called by a NSControl object ( [NSControl-calcSize] )</p>
|
* <p>It is usally called by a NSControl object ([NSControl-calcSize])</p>
|
||||||
*/
|
*/
|
||||||
- (void) calcDrawInfo: (NSRect)aRect
|
- (void) calcDrawInfo: (NSRect)aRect
|
||||||
{
|
{
|
||||||
|
@ -1690,7 +1690,7 @@ static NSColor *shadowCol;
|
||||||
<p>- the TODO ... if the cell is type of NSTextCellType
|
<p>- the TODO ... if the cell is type of NSTextCellType
|
||||||
or the image size if the cell has a NSImageCellType type.</p>
|
or the image size if the cell has a NSImageCellType type.</p>
|
||||||
<p>This method returns NSZeroSize if the cell has a NSNullCellType type
|
<p>This method returns NSZeroSize if the cell has a NSNullCellType type
|
||||||
( Cocoa returns a very big size instead ).
|
(Cocoa returns a very big size instead).
|
||||||
</p>
|
</p>
|
||||||
*/
|
*/
|
||||||
- (NSSize) cellSize
|
- (NSSize) cellSize
|
||||||
|
|
|
@ -919,7 +919,7 @@ systemColorWithName(NSString *name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** <p>Returns the alpha component ( 1.0 by default ) </p>
|
/** <p>Returns the alpha component (1.0 by default) </p>
|
||||||
*/
|
*/
|
||||||
- (float) alphaComponent
|
- (float) alphaComponent
|
||||||
{
|
{
|
||||||
|
|
|
@ -497,7 +497,7 @@ static NSLock *_gnustep_color_list_lock = nil;
|
||||||
*/
|
*/
|
||||||
if (path_is_standard && ([fm fileExistsAtPath: path] == NO))
|
if (path_is_standard && ([fm fileExistsAtPath: path] == NO))
|
||||||
{
|
{
|
||||||
if([fm createDirectoryAtPath: path
|
if ([fm createDirectoryAtPath: path
|
||||||
attributes: nil])
|
attributes: nil])
|
||||||
{
|
{
|
||||||
NSLog (@"Created standard directory %@", path);
|
NSLog (@"Created standard directory %@", path);
|
||||||
|
|
|
@ -281,7 +281,7 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
||||||
// OPENSTEP 4.2 and OSX behavior indicates that the colorwell doesn't
|
// OPENSTEP 4.2 and OSX behavior indicates that the colorwell doesn't
|
||||||
// work when the widget is marked as disabled.
|
// work when the widget is marked as disabled.
|
||||||
//
|
//
|
||||||
if([self isEnabled])
|
if ([self isEnabled])
|
||||||
{
|
{
|
||||||
NSPoint point = [self convertPoint: [theEvent locationInWindow]
|
NSPoint point = [self convertPoint: [theEvent locationInWindow]
|
||||||
fromView: nil];
|
fromView: nil];
|
||||||
|
|
|
@ -119,7 +119,7 @@
|
||||||
ctxt = GSCurrentContext();
|
ctxt = GSCurrentContext();
|
||||||
|
|
||||||
// if either is zero, don't scale at all.
|
// if either is zero, don't scale at all.
|
||||||
if(_size.width == 0 || _size.height == 0)
|
if (_size.width == 0 || _size.height == 0)
|
||||||
{
|
{
|
||||||
scale = NSMakeSize(NSWidth(aRect),
|
scale = NSMakeSize(NSWidth(aRect),
|
||||||
NSHeight(aRect));
|
NSHeight(aRect));
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
//
|
//
|
||||||
- (id)initLinkedToFile:(NSString *)filename
|
- (id)initLinkedToFile:(NSString *)filename
|
||||||
{
|
{
|
||||||
if((self = [self init]) != nil)
|
if ((self = [self init]) != nil)
|
||||||
{
|
{
|
||||||
NSData *data = [NSData dataWithBytes: [filename cString] length: [filename cStringLength]];
|
NSData *data = [NSData dataWithBytes: [filename cString] length: [filename cStringLength]];
|
||||||
NSSelection *selection = [NSSelection selectionWithDescriptionData: data];
|
NSSelection *selection = [NSSelection selectionWithDescriptionData: data];
|
||||||
|
@ -70,7 +70,7 @@
|
||||||
managedBy:(NSDataLinkManager *)linkManager
|
managedBy:(NSDataLinkManager *)linkManager
|
||||||
supportingTypes:(NSArray *)newTypes
|
supportingTypes:(NSArray *)newTypes
|
||||||
{
|
{
|
||||||
if((self = [self init]) != nil)
|
if ((self = [self init]) != nil)
|
||||||
{
|
{
|
||||||
ASSIGN(sourceSelection,selection);
|
ASSIGN(sourceSelection,selection);
|
||||||
ASSIGN(sourceManager,linkManager);
|
ASSIGN(sourceManager,linkManager);
|
||||||
|
@ -130,7 +130,7 @@
|
||||||
{
|
{
|
||||||
NSString *path = filename;
|
NSString *path = filename;
|
||||||
|
|
||||||
if([[path pathExtension] isEqual: NSDataLinkFilenameExtension] == NO)
|
if ([[path pathExtension] isEqual: NSDataLinkFilenameExtension] == NO)
|
||||||
{
|
{
|
||||||
path = [filename stringByAppendingPathExtension: NSDataLinkFilenameExtension];
|
path = [filename stringByAppendingPathExtension: NSDataLinkFilenameExtension];
|
||||||
}
|
}
|
||||||
|
@ -225,12 +225,12 @@
|
||||||
// circumstances a link cannot be broken, so this method
|
// circumstances a link cannot be broken, so this method
|
||||||
// always returns YES.
|
// always returns YES.
|
||||||
|
|
||||||
if([srcDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)])
|
if ([srcDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)])
|
||||||
{
|
{
|
||||||
[srcDelegate dataLinkManager: sourceManager didBreakLink: self];
|
[srcDelegate dataLinkManager: sourceManager didBreakLink: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
if([dstDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)])
|
if ([dstDelegate respondsToSelector: @selector(dataLinkManager:didBreakLink:)])
|
||||||
{
|
{
|
||||||
[dstDelegate dataLinkManager: destinationManager didBreakLink: self];
|
[dstDelegate dataLinkManager: destinationManager didBreakLink: self];
|
||||||
}
|
}
|
||||||
|
@ -242,7 +242,7 @@
|
||||||
{
|
{
|
||||||
_flags.isDirty = YES;
|
_flags.isDirty = YES;
|
||||||
|
|
||||||
if(updateMode != NSUpdateNever)
|
if (updateMode != NSUpdateNever)
|
||||||
{
|
{
|
||||||
[sourceManager noteDocumentEdited];
|
[sourceManager noteDocumentEdited];
|
||||||
}
|
}
|
||||||
|
@ -304,7 +304,7 @@
|
||||||
{
|
{
|
||||||
int version = [aCoder versionForClassName: @"NSDataLink"];
|
int version = [aCoder versionForClassName: @"NSDataLink"];
|
||||||
|
|
||||||
if(version == 0)
|
if (version == 0)
|
||||||
{
|
{
|
||||||
BOOL flag = NO;
|
BOOL flag = NO;
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
if(self != nil)
|
if (self != nil)
|
||||||
{
|
{
|
||||||
ASSIGN(delegate,anObject);
|
ASSIGN(delegate,anObject);
|
||||||
filename = nil;
|
filename = nil;
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
if(self != nil)
|
if (self != nil)
|
||||||
{
|
{
|
||||||
ASSIGN(delegate,anObject);
|
ASSIGN(delegate,anObject);
|
||||||
ASSIGN(filename,path);
|
ASSIGN(filename,path);
|
||||||
|
@ -148,7 +148,7 @@
|
||||||
[link setDestinationSelection: selection];
|
[link setDestinationSelection: selection];
|
||||||
[link setDestinationManager: self];
|
[link setDestinationManager: self];
|
||||||
|
|
||||||
if([destinationLinks containsObject: link] == NO)
|
if ([destinationLinks containsObject: link] == NO)
|
||||||
{
|
{
|
||||||
[destinationLinks addObject: link];
|
[destinationLinks addObject: link];
|
||||||
result = YES;
|
result = YES;
|
||||||
|
@ -173,9 +173,9 @@
|
||||||
NSEnumerator *en = [links objectEnumerator];
|
NSEnumerator *en = [links objectEnumerator];
|
||||||
NSDataLink *link = nil;
|
NSDataLink *link = nil;
|
||||||
|
|
||||||
while((link = [en nextObject]) != nil)
|
while ((link = [en nextObject]) != nil)
|
||||||
{
|
{
|
||||||
if([link destinationSelection] == oldSelection)
|
if ([link destinationSelection] == oldSelection)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@
|
||||||
NSEnumerator *en = [allLinks objectEnumerator];
|
NSEnumerator *en = [allLinks objectEnumerator];
|
||||||
id obj = nil;
|
id obj = nil;
|
||||||
|
|
||||||
while((obj = [en nextObject]) != nil)
|
while ((obj = [en nextObject]) != nil)
|
||||||
{
|
{
|
||||||
[obj break];
|
[obj break];
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
NSEnumerator *en = [allLinks objectEnumerator];
|
NSEnumerator *en = [allLinks objectEnumerator];
|
||||||
id obj = nil;
|
id obj = nil;
|
||||||
|
|
||||||
while((obj = [en nextObject]) != nil)
|
while ((obj = [en nextObject]) != nil)
|
||||||
{
|
{
|
||||||
[obj writeToPasteboard: pasteboard];
|
[obj writeToPasteboard: pasteboard];
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,7 @@
|
||||||
//
|
//
|
||||||
- (void)noteDocumentClosed
|
- (void)noteDocumentClosed
|
||||||
{
|
{
|
||||||
if([delegate respondsToSelector: @selector(dataLinkManagerCloseDocument:)])
|
if ([delegate respondsToSelector: @selector(dataLinkManagerCloseDocument:)])
|
||||||
{
|
{
|
||||||
[delegate dataLinkManagerCloseDocument: self];
|
[delegate dataLinkManagerCloseDocument: self];
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@
|
||||||
|
|
||||||
- (void)noteDocumentEdited
|
- (void)noteDocumentEdited
|
||||||
{
|
{
|
||||||
if([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
if ([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
||||||
{
|
{
|
||||||
[delegate dataLinkManagerDidEditLinks: self];
|
[delegate dataLinkManagerDidEditLinks: self];
|
||||||
}
|
}
|
||||||
|
@ -228,7 +228,7 @@
|
||||||
|
|
||||||
- (void)noteDocumentReverted
|
- (void)noteDocumentReverted
|
||||||
{
|
{
|
||||||
if([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
if ([delegate respondsToSelector: @selector(dataLinkManagerDidEditLinks:)])
|
||||||
{
|
{
|
||||||
[delegate dataLinkManagerDidEditLinks: self];
|
[delegate dataLinkManagerDidEditLinks: self];
|
||||||
}
|
}
|
||||||
|
@ -305,9 +305,9 @@
|
||||||
NSEnumerator *en = [self destinationLinkEnumerator];
|
NSEnumerator *en = [self destinationLinkEnumerator];
|
||||||
id obj = nil;
|
id obj = nil;
|
||||||
|
|
||||||
while((obj = [en nextObject]) != nil)
|
while ((obj = [en nextObject]) != nil)
|
||||||
{
|
{
|
||||||
if([obj destinationSelection] == destSel)
|
if ([obj destinationSelection] == destSel)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -351,7 +351,7 @@
|
||||||
{
|
{
|
||||||
int version = [aCoder versionForClassName: @"NSDataLinkManager"];
|
int version = [aCoder versionForClassName: @"NSDataLinkManager"];
|
||||||
|
|
||||||
if(version == 0)
|
if (version == 0)
|
||||||
{
|
{
|
||||||
BOOL flag = NO;
|
BOOL flag = NO;
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ static NSDataLinkPanel *_sharedDataLinkPanel;
|
||||||
NSString *panelPath;
|
NSString *panelPath;
|
||||||
NSDictionary *table;
|
NSDictionary *table;
|
||||||
|
|
||||||
if((self = [super init]) != nil)
|
if ((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
panelPath = [GSGuiBundle() pathForResource: @"GSDataLinkPanel"
|
panelPath = [GSGuiBundle() pathForResource: @"GSDataLinkPanel"
|
||||||
ofType: @"gorm"
|
ofType: @"gorm"
|
||||||
|
@ -113,7 +113,7 @@ static NSDataLinkPanel *_sharedDataLinkPanel;
|
||||||
*/
|
*/
|
||||||
+ (NSDataLinkPanel *)sharedDataLinkPanel
|
+ (NSDataLinkPanel *)sharedDataLinkPanel
|
||||||
{
|
{
|
||||||
if(_sharedDataLinkPanel == nil)
|
if (_sharedDataLinkPanel == nil)
|
||||||
{
|
{
|
||||||
id controller = [[GSDataLinkPanelController alloc] init];
|
id controller = [[GSDataLinkPanelController alloc] init];
|
||||||
_sharedDataLinkPanel = [controller panel];
|
_sharedDataLinkPanel = [controller panel];
|
||||||
|
|
|
@ -589,13 +589,13 @@
|
||||||
}
|
}
|
||||||
else if (sel_eq(action, @selector(undo:)))
|
else if (sel_eq(action, @selector(undo:)))
|
||||||
{
|
{
|
||||||
if(_undoManager == nil)
|
if (_undoManager == nil)
|
||||||
{
|
{
|
||||||
result = NO;
|
result = NO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if([_undoManager canUndo])
|
if ([_undoManager canUndo])
|
||||||
{
|
{
|
||||||
[anItem setTitle: [_undoManager undoMenuItemTitle]];
|
[anItem setTitle: [_undoManager undoMenuItemTitle]];
|
||||||
result = YES;
|
result = YES;
|
||||||
|
@ -609,13 +609,13 @@
|
||||||
}
|
}
|
||||||
else if (sel_eq(action, @selector(redo:)))
|
else if (sel_eq(action, @selector(redo:)))
|
||||||
{
|
{
|
||||||
if(_undoManager == nil)
|
if (_undoManager == nil)
|
||||||
{
|
{
|
||||||
result = NO;
|
result = NO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if([_undoManager canRedo])
|
if ([_undoManager canRedo])
|
||||||
{
|
{
|
||||||
[anItem setTitle: [_undoManager redoMenuItemTitle]];
|
[anItem setTitle: [_undoManager redoMenuItemTitle]];
|
||||||
result = YES;
|
result = YES;
|
||||||
|
|
|
@ -131,7 +131,7 @@ static Class defaultCellClass = nil;
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter]
|
[[NSNotificationCenter defaultCenter]
|
||||||
addObserver: self
|
addObserver: self
|
||||||
selector: @selector(_setTitleWidthNeedsUpdate: )
|
selector: @selector(_setTitleWidthNeedsUpdate:)
|
||||||
name: _NSFormCellDidChangeTitleWidthNotification
|
name: _NSFormCellDidChangeTitleWidthNotification
|
||||||
object: newCell];
|
object: newCell];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1351,7 +1351,7 @@ NSGraphicsContext *GSCurrentContext(void)
|
||||||
DPSsetdash(self, pattern, count, phase);
|
DPSsetdash(self, pattern, count, phase);
|
||||||
|
|
||||||
count = [path elementCount];
|
count = [path elementCount];
|
||||||
for(i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
type = [path elementAtIndex: i associatedPoints: pts];
|
type = [path elementAtIndex: i associatedPoints: pts];
|
||||||
switch(type)
|
switch(type)
|
||||||
|
|
|
@ -48,12 +48,12 @@
|
||||||
RETAIN([NSDictionary dictionaryWithContentsOfFile:
|
RETAIN([NSDictionary dictionaryWithContentsOfFile:
|
||||||
[self pathForResource: @"Help" ofType: @"plist"]]);
|
[self pathForResource: @"Help" ofType: @"plist"]]);
|
||||||
|
|
||||||
if(contextHelp)
|
if (contextHelp)
|
||||||
{
|
{
|
||||||
helpFile = [contextHelp objectForKey: key];
|
helpFile = [contextHelp objectForKey: key];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(helpFile)
|
if (helpFile)
|
||||||
{
|
{
|
||||||
return [NSUnarchiver unarchiveObjectWithData:
|
return [NSUnarchiver unarchiveObjectWithData:
|
||||||
[helpFile objectForKey: @"NSHelpRTFContents"]];
|
[helpFile objectForKey: @"NSHelpRTFContents"]];
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
help = [info objectForKey: @"GSHelpContentsFile"];
|
help = [info objectForKey: @"GSHelpContentsFile"];
|
||||||
|
|
||||||
if(!help)
|
if (!help)
|
||||||
{
|
{
|
||||||
help = [info objectForKey: @"NSExecutable"];
|
help = [info objectForKey: @"NSExecutable"];
|
||||||
// If there's no specification, we look for a file named "appname.rtf"
|
// If there's no specification, we look for a file named "appname.rtf"
|
||||||
|
@ -176,9 +176,9 @@ static BOOL _gnu_contextHelpActive = NO;
|
||||||
// their context help is.
|
// their context help is.
|
||||||
|
|
||||||
id hc = NSMapGet(contextHelpTopics, object);
|
id hc = NSMapGet(contextHelpTopics, object);
|
||||||
if(hc)
|
if (hc)
|
||||||
{
|
{
|
||||||
if(![hc isKindOfClass: [NSAttributedString class]])
|
if (![hc isKindOfClass: [NSAttributedString class]])
|
||||||
{
|
{
|
||||||
hc = [[NSBundle mainBundle] contextHelpForKey: hc];
|
hc = [[NSBundle mainBundle] contextHelpForKey: hc];
|
||||||
/* We store the retrieved value, or remove the key from
|
/* We store the retrieved value, or remove the key from
|
||||||
|
|
|
@ -661,7 +661,7 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
i = [_reps count];
|
i = [_reps count];
|
||||||
while(i--)
|
while (i--)
|
||||||
{
|
{
|
||||||
GSRepData *repd;
|
GSRepData *repd;
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ first. Remaining cases, highest priority first:
|
||||||
int lo, hi, mid; \
|
int lo, hi, mid; \
|
||||||
\
|
\
|
||||||
lf = tc->linefrags; \
|
lf = tc->linefrags; \
|
||||||
for (lo = 0, hi = tc->num_linefrags - 1; lo < hi; ) \
|
for (lo = 0, hi = tc->num_linefrags - 1; lo < hi;) \
|
||||||
{ \
|
{ \
|
||||||
mid = (lo + hi) / 2; \
|
mid = (lo + hi) / 2; \
|
||||||
if (lf[mid].pos > glyph) \
|
if (lf[mid].pos > glyph) \
|
||||||
|
@ -472,7 +472,7 @@ line frag rect. */
|
||||||
/* Find first glyph in bounds. */
|
/* Find first glyph in bounds. */
|
||||||
|
|
||||||
/* Find right "line", ie. the first "line" not above bounds. */
|
/* Find right "line", ie. the first "line" not above bounds. */
|
||||||
for (low = 0, high = tc->num_linefrags - 1; low < high; )
|
for (low = 0, high = tc->num_linefrags - 1; low < high;)
|
||||||
{
|
{
|
||||||
mid = (low + high) / 2;
|
mid = (low + high) / 2;
|
||||||
lf = &tc->linefrags[mid];
|
lf = &tc->linefrags[mid];
|
||||||
|
@ -507,7 +507,7 @@ line frag rect. */
|
||||||
/* Find last glyph in bounds. */
|
/* Find last glyph in bounds. */
|
||||||
|
|
||||||
/* Find right "line", ie. last "line" not below bounds. */
|
/* Find right "line", ie. last "line" not below bounds. */
|
||||||
for (low = 0, high = tc->num_linefrags - 1; low < high; )
|
for (low = 0, high = tc->num_linefrags - 1; low < high;)
|
||||||
{
|
{
|
||||||
mid = (low + high) / 2;
|
mid = (low + high) / 2;
|
||||||
lf = &tc->linefrags[mid];
|
lf = &tc->linefrags[mid];
|
||||||
|
@ -693,7 +693,7 @@ anything visible
|
||||||
prev = lp->p.x;
|
prev = lp->p.x;
|
||||||
|
|
||||||
last_visible = lf->pos;
|
last_visible = lf->pos;
|
||||||
for (j = lp->pos - glyph_pos; j + glyph_pos < lp->pos + lp->length; )
|
for (j = lp->pos - glyph_pos; j + glyph_pos < lp->pos + lp->length;)
|
||||||
{
|
{
|
||||||
if (r->glyphs[j].isNotShown || r->glyphs[j].g == NSControlGlyph ||
|
if (r->glyphs[j].isNotShown || r->glyphs[j].g == NSControlGlyph ||
|
||||||
!r->glyphs[j].g)
|
!r->glyphs[j].g)
|
||||||
|
|
|
@ -886,18 +886,18 @@ static SEL getSel;
|
||||||
{
|
{
|
||||||
if (_cells[i][j] == aCell)
|
if (_cells[i][j] == aCell)
|
||||||
{
|
{
|
||||||
if(row)
|
if (row)
|
||||||
*row = i;
|
*row = i;
|
||||||
if(column)
|
if (column)
|
||||||
*column = j;
|
*column = j;
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(row)
|
if (row)
|
||||||
*row = -1;
|
*row = -1;
|
||||||
if(column)
|
if (column)
|
||||||
*column = -1;
|
*column = -1;
|
||||||
|
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -1465,7 +1465,7 @@ static SEL getSel;
|
||||||
{
|
{
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
else if(_cells != 0)
|
else if (_cells != 0)
|
||||||
{
|
{
|
||||||
return _cells[_dottedRow][_dottedColumn];
|
return _cells[_dottedRow][_dottedColumn];
|
||||||
}
|
}
|
||||||
|
@ -1607,7 +1607,7 @@ static SEL getSel;
|
||||||
case NSTabTextMovement:
|
case NSTabTextMovement:
|
||||||
if (_tabKeyTraversesCells)
|
if (_tabKeyTraversesCells)
|
||||||
{
|
{
|
||||||
if([self _selectNextSelectableCellAfterRow: _selectedRow
|
if ([self _selectNextSelectableCellAfterRow: _selectedRow
|
||||||
column: _selectedColumn])
|
column: _selectedColumn])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1617,7 +1617,7 @@ static SEL getSel;
|
||||||
{
|
{
|
||||||
if (_tabKeyTraversesCells)
|
if (_tabKeyTraversesCells)
|
||||||
{
|
{
|
||||||
if([self _selectNextSelectableCellAfterRow: -1
|
if ([self _selectNextSelectableCellAfterRow: -1
|
||||||
column: -1])
|
column: -1])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1627,7 +1627,7 @@ static SEL getSel;
|
||||||
case NSBacktabTextMovement:
|
case NSBacktabTextMovement:
|
||||||
if (_tabKeyTraversesCells)
|
if (_tabKeyTraversesCells)
|
||||||
{
|
{
|
||||||
if([self _selectPreviousSelectableCellBeforeRow: _selectedRow
|
if ([self _selectPreviousSelectableCellBeforeRow: _selectedRow
|
||||||
column: _selectedColumn])
|
column: _selectedColumn])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1637,7 +1637,7 @@ static SEL getSel;
|
||||||
{
|
{
|
||||||
if (_tabKeyTraversesCells)
|
if (_tabKeyTraversesCells)
|
||||||
{
|
{
|
||||||
if([self _selectPreviousSelectableCellBeforeRow: _numRows
|
if ([self _selectPreviousSelectableCellBeforeRow: _numRows
|
||||||
column: _numCols])
|
column: _numCols])
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3384,13 +3384,13 @@ static SEL getSel;
|
||||||
{
|
{
|
||||||
if ([theEvent modifierFlags] & NSShiftKeyMask)
|
if ([theEvent modifierFlags] & NSShiftKeyMask)
|
||||||
{
|
{
|
||||||
if([self _selectNextSelectableCellAfterRow: _selectedRow
|
if ([self _selectNextSelectableCellAfterRow: _selectedRow
|
||||||
column: _selectedColumn])
|
column: _selectedColumn])
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if([self _selectPreviousSelectableCellBeforeRow: _selectedRow
|
if ([self _selectPreviousSelectableCellBeforeRow: _selectedRow
|
||||||
column: _selectedColumn])
|
column: _selectedColumn])
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,10 @@
|
||||||
ASSIGN(newFileName, fileName);
|
ASSIGN(newFileName, fileName);
|
||||||
|
|
||||||
// detect if it's a directory or not...
|
// detect if it's a directory or not...
|
||||||
if([mgr fileExistsAtPath: fileName isDirectory: &isDir])
|
if ([mgr fileExistsAtPath: fileName isDirectory: &isDir])
|
||||||
{
|
{
|
||||||
// if the data is in a directory, then load from objects.gorm in the directory
|
// if the data is in a directory, then load from objects.gorm in the directory
|
||||||
if(isDir == YES)
|
if (isDir == YES)
|
||||||
{
|
{
|
||||||
newFileName = [fileName stringByAppendingPathComponent: @"objects.gorm"];
|
newFileName = [fileName stringByAppendingPathComponent: @"objects.gorm"];
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@
|
||||||
{
|
{
|
||||||
NSMutableDictionary *ctx = nil;
|
NSMutableDictionary *ctx = nil;
|
||||||
|
|
||||||
if(dict != nil)
|
if (dict != nil)
|
||||||
{
|
{
|
||||||
id obj = nil;
|
id obj = nil;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
|
|
||||||
// remove and set the owner...
|
// remove and set the owner...
|
||||||
obj = [ctx objectForKey: @"NSNibOwner"];
|
obj = [ctx objectForKey: @"NSNibOwner"];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
[ctx removeObjectForKey: @"NSNibOwner"];
|
[ctx removeObjectForKey: @"NSNibOwner"];
|
||||||
[ctx setObject: obj forKey: @"NSOwner"];
|
[ctx setObject: obj forKey: @"NSOwner"];
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
|
|
||||||
// Remove and set the top level objects...
|
// Remove and set the top level objects...
|
||||||
obj = [ctx objectForKey: @"NSNibTopLevelObjects"];
|
obj = [ctx objectForKey: @"NSNibTopLevelObjects"];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
[ctx removeObjectForKey: @"NSNibTopLevelObjects"];
|
[ctx removeObjectForKey: @"NSNibTopLevelObjects"];
|
||||||
[ctx setObject: obj forKey: @"NSTopLevelObjects"];
|
[ctx setObject: obj forKey: @"NSTopLevelObjects"];
|
||||||
|
@ -151,7 +151,7 @@
|
||||||
*/
|
*/
|
||||||
- (id)initWithContentsOfURL: (NSURL *)nibFileURL
|
- (id)initWithContentsOfURL: (NSURL *)nibFileURL
|
||||||
{
|
{
|
||||||
if((self = [super init]) != nil)
|
if ((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
// load the nib data into memory...
|
// load the nib data into memory...
|
||||||
_nibData = [NSData dataWithContentsOfURL: nibFileURL];
|
_nibData = [NSData dataWithContentsOfURL: nibFileURL];
|
||||||
|
@ -166,12 +166,12 @@
|
||||||
*/
|
*/
|
||||||
- (id)initWithNibNamed: (NSString *)nibNamed bundle: (NSBundle *)bundle
|
- (id)initWithNibNamed: (NSString *)nibNamed bundle: (NSBundle *)bundle
|
||||||
{
|
{
|
||||||
if((self = [super init]) != nil)
|
if ((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
NSString *bundlePath = nil;
|
NSString *bundlePath = nil;
|
||||||
NSString *fileName = nil;
|
NSString *fileName = nil;
|
||||||
|
|
||||||
if(bundle == nil)
|
if (bundle == nil)
|
||||||
{
|
{
|
||||||
bundle = [NSBundle mainBundle];
|
bundle = [NSBundle mainBundle];
|
||||||
}
|
}
|
||||||
|
@ -265,7 +265,7 @@
|
||||||
// add the necessary things to the table...
|
// add the necessary things to the table...
|
||||||
[externalNameTable setObject: owner forKey: @"NSNibOwner"];
|
[externalNameTable setObject: owner forKey: @"NSNibOwner"];
|
||||||
|
|
||||||
if(topLevelObjects != 0)
|
if (topLevelObjects != 0)
|
||||||
{
|
{
|
||||||
*topLevelObjects = [NSMutableArray array];
|
*topLevelObjects = [NSMutableArray array];
|
||||||
[externalNameTable setObject: *topLevelObjects forKey: @"NSNibTopLevelObjects"];
|
[externalNameTable setObject: *topLevelObjects forKey: @"NSNibTopLevelObjects"];
|
||||||
|
@ -276,7 +276,7 @@
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder *)coder
|
- (id) initWithCoder: (NSCoder *)coder
|
||||||
{
|
{
|
||||||
if((self = [super init]) != nil)
|
if ((self = [super init]) != nil)
|
||||||
{
|
{
|
||||||
[coder decodeValueOfObjCType: @encode(id)
|
[coder decodeValueOfObjCType: @encode(id)
|
||||||
at: &_nibData];
|
at: &_nibData];
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
{
|
{
|
||||||
Class glPixelFormatClass = [GSCurrentServer() glPixelFormatClass];
|
Class glPixelFormatClass = [GSCurrentServer() glPixelFormatClass];
|
||||||
|
|
||||||
if ( glPixelFormatClass == nil )
|
if (glPixelFormatClass == nil)
|
||||||
{
|
{
|
||||||
NSWarnMLog(@"Backend doesn't have any glPixelFormatClass");
|
NSWarnMLog(@"Backend doesn't have any glPixelFormatClass");
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
// + (void) initialize
|
// + (void) initialize
|
||||||
// {
|
// {
|
||||||
// if ( self == [NSOpenGLPixelFormat class] )
|
// if (self == [NSOpenGLPixelFormat class])
|
||||||
// {
|
// {
|
||||||
// temp = (GSGLPixelFormat *) NSAllocateObject([GSGLPixelFormat class], 0,
|
// temp = (GSGLPixelFormat *) NSAllocateObject([GSGLPixelFormat class], 0,
|
||||||
// NSDefaultMallocZone());
|
// NSDefaultMallocZone());
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
+ allocWithZone: (NSZone *) z
|
+ allocWithZone: (NSZone *) z
|
||||||
{
|
{
|
||||||
Class c = [self _classPixelFormat];
|
Class c = [self _classPixelFormat];
|
||||||
if ( c )
|
if (c)
|
||||||
return NSAllocateObject(c, 0, z);
|
return NSAllocateObject(c, 0, z);
|
||||||
else
|
else
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
*/
|
*/
|
||||||
- (NSOpenGLContext*)openGLContext
|
- (NSOpenGLContext*)openGLContext
|
||||||
{
|
{
|
||||||
if ( glcontext == nil )
|
if (glcontext == nil)
|
||||||
{
|
{
|
||||||
glcontext = [[NSOpenGLContext alloc] initWithFormat: pixel_format
|
glcontext = [[NSOpenGLContext alloc] initWithFormat: pixel_format
|
||||||
shareContext: nil];
|
shareContext: nil];
|
||||||
|
@ -181,12 +181,12 @@
|
||||||
- (void) lockFocusInRect: (NSRect) aRect
|
- (void) lockFocusInRect: (NSRect) aRect
|
||||||
{
|
{
|
||||||
[super lockFocusInRect: aRect];
|
[super lockFocusInRect: aRect];
|
||||||
if ( !glcontext )
|
if (!glcontext)
|
||||||
{
|
{
|
||||||
[self openGLContext];
|
[self openGLContext];
|
||||||
NSAssert(glcontext, NSInternalInconsistencyException);
|
NSAssert(glcontext, NSInternalInconsistencyException);
|
||||||
}
|
}
|
||||||
if ( attached == NO && glcontext != nil )
|
if (attached == NO && glcontext != nil)
|
||||||
{
|
{
|
||||||
NSDebugMLLog(@"GL", @"Attaching context to the view");
|
NSDebugMLLog(@"GL", @"Attaching context to the view");
|
||||||
[glcontext setView: self];
|
[glcontext setView: self];
|
||||||
|
|
|
@ -165,7 +165,7 @@ static NSImage *unexpandable = nil;
|
||||||
NSFreeMapTable(_itemDict);
|
NSFreeMapTable(_itemDict);
|
||||||
NSFreeMapTable(_levelOfItems);
|
NSFreeMapTable(_levelOfItems);
|
||||||
|
|
||||||
if(_autosaveExpandedItems)
|
if (_autosaveExpandedItems)
|
||||||
{
|
{
|
||||||
// notify when an item expands...
|
// notify when an item expands...
|
||||||
[nc removeObserver: self
|
[nc removeObserver: self
|
||||||
|
@ -218,12 +218,12 @@ static NSImage *unexpandable = nil;
|
||||||
const SEL shouldSelector = @selector(outlineView:shouldCollapseItem:);
|
const SEL shouldSelector = @selector(outlineView:shouldCollapseItem:);
|
||||||
BOOL canCollapse = YES;
|
BOOL canCollapse = YES;
|
||||||
|
|
||||||
if([_delegate respondsToSelector: shouldSelector])
|
if ([_delegate respondsToSelector: shouldSelector])
|
||||||
{
|
{
|
||||||
canCollapse = [_delegate outlineView: self shouldCollapseItem: item];
|
canCollapse = [_delegate outlineView: self shouldCollapseItem: item];
|
||||||
}
|
}
|
||||||
|
|
||||||
if([self isExpandable: item] && [self isItemExpanded: item] && canCollapse)
|
if ([self isExpandable: item] && [self isItemExpanded: item] && canCollapse)
|
||||||
{
|
{
|
||||||
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
|
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
|
||||||
unsigned int row;
|
unsigned int row;
|
||||||
|
@ -258,7 +258,7 @@ static NSImage *unexpandable = nil;
|
||||||
userInfo: infoDict];
|
userInfo: infoDict];
|
||||||
|
|
||||||
// recursively find all children and call this method to open them.
|
// recursively find all children and call this method to open them.
|
||||||
if(collapseChildren) // collapse all
|
if (collapseChildren) // collapse all
|
||||||
{
|
{
|
||||||
NSMutableArray *allChildren = nil;
|
NSMutableArray *allChildren = nil;
|
||||||
int numchild = 0;
|
int numchild = 0;
|
||||||
|
@ -268,11 +268,11 @@ static NSImage *unexpandable = nil;
|
||||||
allChildren = NSMapGet(_itemDict, sitem);
|
allChildren = NSMapGet(_itemDict, sitem);
|
||||||
numchild = [allChildren count];
|
numchild = [allChildren count];
|
||||||
|
|
||||||
for(index = 0;index < numchild;index++)
|
for (index = 0;index < numchild;index++)
|
||||||
{
|
{
|
||||||
id child = [allChildren objectAtIndex: index];
|
id child = [allChildren objectAtIndex: index];
|
||||||
|
|
||||||
if([self isExpandable: child])
|
if ([self isExpandable: child])
|
||||||
{
|
{
|
||||||
[self collapseItem: child collapseChildren: collapseChildren];
|
[self collapseItem: child collapseChildren: collapseChildren];
|
||||||
}
|
}
|
||||||
|
@ -303,16 +303,16 @@ static NSImage *unexpandable = nil;
|
||||||
const SEL shouldExpandSelector = @selector(outlineView:shouldExpandItem:);
|
const SEL shouldExpandSelector = @selector(outlineView:shouldExpandItem:);
|
||||||
BOOL canExpand = YES;
|
BOOL canExpand = YES;
|
||||||
|
|
||||||
if([_delegate respondsToSelector: shouldExpandSelector])
|
if ([_delegate respondsToSelector: shouldExpandSelector])
|
||||||
{
|
{
|
||||||
canExpand = [_delegate outlineView: self shouldExpandItem: item];
|
canExpand = [_delegate outlineView: self shouldExpandItem: item];
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the item is expandable
|
// if the item is expandable
|
||||||
if([self isExpandable: item])
|
if ([self isExpandable: item])
|
||||||
{
|
{
|
||||||
// if it is not already expanded and it can be expanded, then expand
|
// if it is not already expanded and it can be expanded, then expand
|
||||||
if(![self isItemExpanded: item] && canExpand)
|
if (![self isItemExpanded: item] && canExpand)
|
||||||
{
|
{
|
||||||
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
|
NSMutableDictionary *infoDict = [NSMutableDictionary dictionary];
|
||||||
unsigned int row;
|
unsigned int row;
|
||||||
|
@ -349,7 +349,7 @@ static NSImage *unexpandable = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
// recursively find all children and call this method to open them.
|
// recursively find all children and call this method to open them.
|
||||||
if(expandChildren) // expand all
|
if (expandChildren) // expand all
|
||||||
{
|
{
|
||||||
NSMutableArray *allChildren = nil;
|
NSMutableArray *allChildren = nil;
|
||||||
int numchild = 0;
|
int numchild = 0;
|
||||||
|
@ -359,11 +359,11 @@ static NSImage *unexpandable = nil;
|
||||||
allChildren = NSMapGet(_itemDict, sitem);
|
allChildren = NSMapGet(_itemDict, sitem);
|
||||||
numchild = [allChildren count];
|
numchild = [allChildren count];
|
||||||
|
|
||||||
for(index = 0;index < numchild;index++)
|
for (index = 0;index < numchild;index++)
|
||||||
{
|
{
|
||||||
id child = [allChildren objectAtIndex: index];
|
id child = [allChildren objectAtIndex: index];
|
||||||
|
|
||||||
if([self isExpandable: child])
|
if ([self isExpandable: child])
|
||||||
{
|
{
|
||||||
[self expandItem: child expandChildren: expandChildren];
|
[self expandItem: child expandChildren: expandChildren];
|
||||||
}
|
}
|
||||||
|
@ -407,7 +407,7 @@ static NSImage *unexpandable = nil;
|
||||||
*/
|
*/
|
||||||
- (BOOL)isItemExpanded: (id)item
|
- (BOOL)isItemExpanded: (id)item
|
||||||
{
|
{
|
||||||
if(item == nil)
|
if (item == nil)
|
||||||
return YES;
|
return YES;
|
||||||
|
|
||||||
// Check the array to determine if it is expanded.
|
// Check the array to determine if it is expanded.
|
||||||
|
@ -427,7 +427,7 @@ static NSImage *unexpandable = nil;
|
||||||
*/
|
*/
|
||||||
- (int)levelForItem: (id)item
|
- (int)levelForItem: (id)item
|
||||||
{
|
{
|
||||||
if(item != nil)
|
if (item != nil)
|
||||||
{
|
{
|
||||||
id object = NSMapGet(_levelOfItems, item);
|
id object = NSMapGet(_levelOfItems, item);
|
||||||
return [object intValue];
|
return [object intValue];
|
||||||
|
@ -522,7 +522,7 @@ static NSImage *unexpandable = nil;
|
||||||
- (int)rowForItem: (id)item
|
- (int)rowForItem: (id)item
|
||||||
{
|
{
|
||||||
int row;
|
int row;
|
||||||
if(item == nil)
|
if (item == nil)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
row = [_items indexOfObject: item];
|
row = [_items indexOfObject: item];
|
||||||
|
@ -546,13 +546,13 @@ static NSImage *unexpandable = nil;
|
||||||
*/
|
*/
|
||||||
- (void)setAutosaveExpandedItems: (BOOL)flag
|
- (void)setAutosaveExpandedItems: (BOOL)flag
|
||||||
{
|
{
|
||||||
if(flag == _autosaveExpandedItems)
|
if (flag == _autosaveExpandedItems)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_autosaveExpandedItems = flag;
|
_autosaveExpandedItems = flag;
|
||||||
if(flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
[self _autoloadExpandedItems];
|
[self _autoloadExpandedItems];
|
||||||
// notify when an item expands...
|
// notify when an item expands...
|
||||||
|
@ -693,17 +693,17 @@ static NSImage *unexpandable = nil;
|
||||||
- (void) reloadData
|
- (void) reloadData
|
||||||
{
|
{
|
||||||
// release the old array
|
// release the old array
|
||||||
if(_items != nil)
|
if (_items != nil)
|
||||||
{
|
{
|
||||||
RELEASE(_items);
|
RELEASE(_items);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_itemDict != NULL)
|
if (_itemDict != NULL)
|
||||||
{
|
{
|
||||||
NSFreeMapTable(_itemDict);
|
NSFreeMapTable(_itemDict);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_levelOfItems != NULL)
|
if (_levelOfItems != NULL)
|
||||||
{
|
{
|
||||||
NSFreeMapTable(_levelOfItems);
|
NSFreeMapTable(_levelOfItems);
|
||||||
}
|
}
|
||||||
|
@ -859,7 +859,7 @@ static NSImage *unexpandable = nil;
|
||||||
/* Using columnAtPoint: here would make it called twice per row per drawn
|
/* Using columnAtPoint: here would make it called twice per row per drawn
|
||||||
rect - so we avoid it and do it natively */
|
rect - so we avoid it and do it natively */
|
||||||
|
|
||||||
if(rowIndex >= _numberOfRows)
|
if (rowIndex >= _numberOfRows)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -906,7 +906,7 @@ static NSImage *unexpandable = nil;
|
||||||
drawingRect = [self frameOfCellAtColumn: i
|
drawingRect = [self frameOfCellAtColumn: i
|
||||||
row: rowIndex];
|
row: rowIndex];
|
||||||
|
|
||||||
if(tb == _outlineTableColumn)
|
if (tb == _outlineTableColumn)
|
||||||
{
|
{
|
||||||
NSImage *image = nil;
|
NSImage *image = nil;
|
||||||
int level = 0;
|
int level = 0;
|
||||||
|
@ -914,7 +914,7 @@ static NSImage *unexpandable = nil;
|
||||||
// float originalWidth = drawingRect.size.width;
|
// float originalWidth = drawingRect.size.width;
|
||||||
|
|
||||||
// display the correct arrow...
|
// display the correct arrow...
|
||||||
if([self isItemExpanded: item])
|
if ([self isItemExpanded: item])
|
||||||
{
|
{
|
||||||
image = expanded;
|
image = expanded;
|
||||||
}
|
}
|
||||||
|
@ -923,7 +923,7 @@ static NSImage *unexpandable = nil;
|
||||||
image = collapsed;
|
image = collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(![self isExpandable: item])
|
if (![self isExpandable: item])
|
||||||
{
|
{
|
||||||
image = unexpandable;
|
image = unexpandable;
|
||||||
}
|
}
|
||||||
|
@ -932,7 +932,7 @@ static NSImage *unexpandable = nil;
|
||||||
indentationFactor = _indentationPerLevel * level;
|
indentationFactor = _indentationPerLevel * level;
|
||||||
imageCell = [[NSCell alloc] initImageCell: image];
|
imageCell = [[NSCell alloc] initImageCell: image];
|
||||||
|
|
||||||
if(_indentationMarkerFollowsCell)
|
if (_indentationMarkerFollowsCell)
|
||||||
{
|
{
|
||||||
imageRect.origin.x = drawingRect.origin.x + indentationFactor;
|
imageRect.origin.x = drawingRect.origin.x + indentationFactor;
|
||||||
imageRect.origin.y = drawingRect.origin.y;
|
imageRect.origin.y = drawingRect.origin.y;
|
||||||
|
@ -952,7 +952,7 @@ static NSImage *unexpandable = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do not indent if the delegate set the image to nil. */
|
/* Do not indent if the delegate set the image to nil. */
|
||||||
if ( [imageCell image] )
|
if ([imageCell image])
|
||||||
{
|
{
|
||||||
imageRect.size.width = [image size].width;
|
imageRect.size.width = [image size].width;
|
||||||
imageRect.size.height = [image size].height;
|
imageRect.size.height = [image size].height;
|
||||||
|
@ -978,17 +978,17 @@ static NSImage *unexpandable = nil;
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
if(_autoResizesOutlineColumn)
|
if (_autoResizesOutlineColumn)
|
||||||
{
|
{
|
||||||
float widest = 0;
|
float widest = 0;
|
||||||
for(index = 0;index < _numberOfRows; index++)
|
for (index = 0;index < _numberOfRows; index++)
|
||||||
{
|
{
|
||||||
float offset = [self levelForRow: index] *
|
float offset = [self levelForRow: index] *
|
||||||
[self indentationPerLevel];
|
[self indentationPerLevel];
|
||||||
NSRect drawingRect = [self frameOfCellAtColumn: 0
|
NSRect drawingRect = [self frameOfCellAtColumn: 0
|
||||||
row: index];
|
row: index];
|
||||||
float length = drawingRect.size.width + offset;
|
float length = drawingRect.size.width + offset;
|
||||||
if(widest < length) widest = length;
|
if (widest < length) widest = length;
|
||||||
}
|
}
|
||||||
// [_outlineTableColumn setWidth: widest];
|
// [_outlineTableColumn setWidth: widest];
|
||||||
}
|
}
|
||||||
|
@ -1063,7 +1063,7 @@ static NSImage *unexpandable = nil;
|
||||||
|
|
||||||
|
|
||||||
if ((verticalQuarterPosition - oldProposedDropRow * 4 <= 2) &&
|
if ((verticalQuarterPosition - oldProposedDropRow * 4 <= 2) &&
|
||||||
(verticalQuarterPosition - oldProposedDropRow * 4 >= -3) )
|
(verticalQuarterPosition - oldProposedDropRow * 4 >= -3))
|
||||||
{
|
{
|
||||||
row = oldProposedDropRow;
|
row = oldProposedDropRow;
|
||||||
}
|
}
|
||||||
|
@ -1129,7 +1129,7 @@ static NSImage *unexpandable = nil;
|
||||||
int i;
|
int i;
|
||||||
int j = 0;
|
int j = 0;
|
||||||
int lvl;
|
int lvl;
|
||||||
for ( i = row - 1; i >= 0; i-- )
|
for (i = row - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
lvl = [self levelForRow: i];
|
lvl = [self levelForRow: i];
|
||||||
if (lvl == level - 1)
|
if (lvl == level - 1)
|
||||||
|
@ -1268,7 +1268,7 @@ static NSImage *unexpandable = nil;
|
||||||
{
|
{
|
||||||
int lvl, i, j = 0;
|
int lvl, i, j = 0;
|
||||||
|
|
||||||
for ( i = currentDropRow - 1; i >= 0; i-- )
|
for (i = currentDropRow - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
lvl = [self levelForRow: i];
|
lvl = [self levelForRow: i];
|
||||||
if (lvl == currentDropLevel - 1)
|
if (lvl == currentDropLevel - 1)
|
||||||
|
@ -1410,7 +1410,7 @@ static NSImage *unexpandable = nil;
|
||||||
_textObject = [_editedCell setUpFieldEditorAttributes: t];
|
_textObject = [_editedCell setUpFieldEditorAttributes: t];
|
||||||
|
|
||||||
// determine which image to use...
|
// determine which image to use...
|
||||||
if([self isItemExpanded: item])
|
if ([self isItemExpanded: item])
|
||||||
{
|
{
|
||||||
image = expanded;
|
image = expanded;
|
||||||
}
|
}
|
||||||
|
@ -1419,7 +1419,7 @@ static NSImage *unexpandable = nil;
|
||||||
image = collapsed;
|
image = collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(![self isExpandable: item])
|
if (![self isExpandable: item])
|
||||||
{
|
{
|
||||||
image = unexpandable;
|
image = unexpandable;
|
||||||
}
|
}
|
||||||
|
@ -1428,7 +1428,7 @@ static NSImage *unexpandable = nil;
|
||||||
|
|
||||||
[self lockFocus];
|
[self lockFocus];
|
||||||
|
|
||||||
if(tb == [self outlineTableColumn])
|
if (tb == [self outlineTableColumn])
|
||||||
{
|
{
|
||||||
level = [self levelForItem: item];
|
level = [self levelForItem: item];
|
||||||
indentationFactor = _indentationPerLevel * level;
|
indentationFactor = _indentationPerLevel * level;
|
||||||
|
@ -1437,7 +1437,7 @@ static NSImage *unexpandable = nil;
|
||||||
|
|
||||||
// create the image cell..
|
// create the image cell..
|
||||||
imageCell = [[NSCell alloc] initImageCell: image];
|
imageCell = [[NSCell alloc] initImageCell: image];
|
||||||
if(_indentationMarkerFollowsCell)
|
if (_indentationMarkerFollowsCell)
|
||||||
{
|
{
|
||||||
imageRect.origin.x = drawingRect.origin.x + indentationFactor;
|
imageRect.origin.x = drawingRect.origin.x + indentationFactor;
|
||||||
imageRect.origin.y = drawingRect.origin.y;
|
imageRect.origin.y = drawingRect.origin.y;
|
||||||
|
@ -1606,7 +1606,7 @@ static NSImage *unexpandable = nil;
|
||||||
NSMutableArray *itemArray = [NSMutableArray
|
NSMutableArray *itemArray = [NSMutableArray
|
||||||
arrayWithCapacity: count];
|
arrayWithCapacity: count];
|
||||||
|
|
||||||
for ( i = 0; i < count; i++ )
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
[itemArray addObject:
|
[itemArray addObject:
|
||||||
[self itemAtRow:
|
[self itemAtRow:
|
||||||
|
@ -1634,7 +1634,7 @@ static NSImage *unexpandable = nil;
|
||||||
{
|
{
|
||||||
id result = nil;
|
id result = nil;
|
||||||
|
|
||||||
if([_dataSource respondsToSelector:
|
if ([_dataSource respondsToSelector:
|
||||||
@selector(outlineView:objectValueForTableColumn:byItem:)])
|
@selector(outlineView:objectValueForTableColumn:byItem:)])
|
||||||
{
|
{
|
||||||
id item = [self itemAtRow: index];
|
id item = [self itemAtRow: index];
|
||||||
|
@ -1651,7 +1651,7 @@ static NSImage *unexpandable = nil;
|
||||||
forTableColumn: (NSTableColumn *)tb
|
forTableColumn: (NSTableColumn *)tb
|
||||||
row: (int) index
|
row: (int) index
|
||||||
{
|
{
|
||||||
if([_dataSource respondsToSelector:
|
if ([_dataSource respondsToSelector:
|
||||||
@selector(outlineView:setObjectValue:forTableColumn:byItem:)])
|
@selector(outlineView:setObjectValue:forTableColumn:byItem:)])
|
||||||
{
|
{
|
||||||
id item = [self itemAtRow: index];
|
id item = [self itemAtRow: index];
|
||||||
|
@ -1723,7 +1723,7 @@ static NSImage *unexpandable = nil;
|
||||||
id anitem = [anarray objectAtIndex: i];
|
id anitem = [anarray objectAtIndex: i];
|
||||||
|
|
||||||
// Only collect the children if the item is expanded
|
// Only collect the children if the item is expanded
|
||||||
if([self isItemExpanded: startitem])
|
if ([self isItemExpanded: startitem])
|
||||||
{
|
{
|
||||||
[allChildren addObject: anitem];
|
[allChildren addObject: anitem];
|
||||||
}
|
}
|
||||||
|
@ -1772,14 +1772,14 @@ static NSImage *unexpandable = nil;
|
||||||
numchildren = [removeAll count];
|
numchildren = [removeAll count];
|
||||||
|
|
||||||
// close the item...
|
// close the item...
|
||||||
if(item != nil)
|
if (item != nil)
|
||||||
{
|
{
|
||||||
[_expandedItems removeObject: item];
|
[_expandedItems removeObject: item];
|
||||||
}
|
}
|
||||||
|
|
||||||
// For the close method it doesn't matter what order they are
|
// For the close method it doesn't matter what order they are
|
||||||
// removed in.
|
// removed in.
|
||||||
for(i=0; i < numchildren; i++)
|
for (i=0; i < numchildren; i++)
|
||||||
{
|
{
|
||||||
id child = [removeAll objectAtIndex: i];
|
id child = [removeAll objectAtIndex: i];
|
||||||
[_items removeObject: child];
|
[_items removeObject: child];
|
||||||
|
@ -1798,13 +1798,13 @@ static NSImage *unexpandable = nil;
|
||||||
numchildren = [object count];
|
numchildren = [object count];
|
||||||
|
|
||||||
// open the item...
|
// open the item...
|
||||||
if(item != nil)
|
if (item != nil)
|
||||||
{
|
{
|
||||||
[_expandedItems addObject: item];
|
[_expandedItems addObject: item];
|
||||||
}
|
}
|
||||||
|
|
||||||
insertionPoint = [_items indexOfObject: item];
|
insertionPoint = [_items indexOfObject: item];
|
||||||
if(insertionPoint == NSNotFound)
|
if (insertionPoint == NSNotFound)
|
||||||
{
|
{
|
||||||
insertionPoint = 0;
|
insertionPoint = 0;
|
||||||
}
|
}
|
||||||
|
@ -1813,20 +1813,20 @@ static NSImage *unexpandable = nil;
|
||||||
insertionPoint++;
|
insertionPoint++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i=numchildren-1; i >= 0; i--)
|
for (i=numchildren-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
id obj = NSMapGet(_itemDict, sitem);
|
id obj = NSMapGet(_itemDict, sitem);
|
||||||
id child = [obj objectAtIndex: i];
|
id child = [obj objectAtIndex: i];
|
||||||
|
|
||||||
// Add all of the children...
|
// Add all of the children...
|
||||||
if([self isItemExpanded: child])
|
if ([self isItemExpanded: child])
|
||||||
{
|
{
|
||||||
NSMutableArray *insertAll = [NSMutableArray array];
|
NSMutableArray *insertAll = [NSMutableArray array];
|
||||||
int i = 0, numitems = 0;
|
int i = 0, numitems = 0;
|
||||||
|
|
||||||
[self _collectItemsStartingWith: child into: insertAll];
|
[self _collectItemsStartingWith: child into: insertAll];
|
||||||
numitems = [insertAll count];
|
numitems = [insertAll count];
|
||||||
for(i = numitems-1; i >= 0; i--)
|
for (i = numitems-1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
[_items insertObject: [insertAll objectAtIndex: i]
|
[_items insertObject: [insertAll objectAtIndex: i]
|
||||||
atIndex: insertionPoint];
|
atIndex: insertionPoint];
|
||||||
|
|
|
@ -232,7 +232,7 @@ enum {
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [[principalClass pageLayoutClass] allocWithZone: zone];
|
return [[principalClass pageLayoutClass] allocWithZone: zone];
|
||||||
|
@ -481,13 +481,13 @@ enum {
|
||||||
|
|
||||||
customPapers = [globalDomain objectForKey: @"GSPageLayoutCustomPaperSizes"];
|
customPapers = [globalDomain objectForKey: @"GSPageLayoutCustomPaperSizes"];
|
||||||
|
|
||||||
if( customPapers )
|
if (customPapers)
|
||||||
{
|
{
|
||||||
customPapers = [customPapers mutableCopy];
|
customPapers = [customPapers mutableCopy];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
customPapers = RETAIN( [NSMutableDictionary dictionary] );
|
customPapers = RETAIN([NSMutableDictionary dictionary]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -499,7 +499,7 @@ enum {
|
||||||
//an ivar.
|
//an ivar.
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
for( n = 100; n <= 105; n++ )
|
for (n = 100; n <= 105; n++)
|
||||||
{
|
{
|
||||||
NSTextField *textField;
|
NSTextField *textField;
|
||||||
textField = [[[tabView tabViewItemAtIndex:1] view] viewWithTag: n];
|
textField = [[[tabView tabViewItemAtIndex:1] view] viewWithTag: n];
|
||||||
|
@ -522,8 +522,8 @@ enum {
|
||||||
|
|
||||||
-(void) dealloc
|
-(void) dealloc
|
||||||
{
|
{
|
||||||
RELEASE( customPapers );
|
RELEASE(customPapers);
|
||||||
RELEASE( measurementString );
|
RELEASE(measurementString);
|
||||||
|
|
||||||
[super release];
|
[super release];
|
||||||
}
|
}
|
||||||
|
@ -576,7 +576,7 @@ enum {
|
||||||
|
|
||||||
-(void) paperRadioMatrixClicked: (id) sender
|
-(void) paperRadioMatrixClicked: (id) sender
|
||||||
{
|
{
|
||||||
if( [sender selectedRow] == 0) //Standard Paper Sizes
|
if ([sender selectedRow] == 0) //Standard Paper Sizes
|
||||||
{
|
{
|
||||||
[customPaperSizePopUp setEnabled: NO];
|
[customPaperSizePopUp setEnabled: NO];
|
||||||
[standardPaperSizePopUp setEnabled: YES];
|
[standardPaperSizePopUp setEnabled: YES];
|
||||||
|
@ -616,29 +616,29 @@ enum {
|
||||||
string = [defaults objectForKey: @"NSMeasurementUnit"];
|
string = [defaults objectForKey: @"NSMeasurementUnit"];
|
||||||
NSLog(@"NSMeasurementUnit is %@", string);
|
NSLog(@"NSMeasurementUnit is %@", string);
|
||||||
|
|
||||||
if( string == nil ) //default to cm, most of the world is metric...
|
if (string == nil) //default to cm, most of the world is metric...
|
||||||
{
|
{
|
||||||
measurementString = @"cm";
|
measurementString = @"cm";
|
||||||
factorValue = 2.54/72.0;
|
factorValue = 2.54/72.0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( [string caseInsensitiveCompare: @"CENTIMETERS"] == NSOrderedSame )
|
if ([string caseInsensitiveCompare: @"CENTIMETERS"] == NSOrderedSame)
|
||||||
{
|
{
|
||||||
measurementString = @"cm";
|
measurementString = @"cm";
|
||||||
factorValue = 2.54/72.0;
|
factorValue = 2.54/72.0;
|
||||||
}
|
}
|
||||||
else if( [string caseInsensitiveCompare: @"INCHES"] == NSOrderedSame )
|
else if ([string caseInsensitiveCompare: @"INCHES"] == NSOrderedSame)
|
||||||
{
|
{
|
||||||
measurementString = @"in";
|
measurementString = @"in";
|
||||||
factorValue = 1.0/72.0;
|
factorValue = 1.0/72.0;
|
||||||
}
|
}
|
||||||
else if( [string caseInsensitiveCompare: @"POINTS"] == NSOrderedSame )
|
else if ([string caseInsensitiveCompare: @"POINTS"] == NSOrderedSame)
|
||||||
{
|
{
|
||||||
measurementString = @"pt";
|
measurementString = @"pt";
|
||||||
factorValue = 1.0;
|
factorValue = 1.0;
|
||||||
}
|
}
|
||||||
else if( [string caseInsensitiveCompare: @"PICAS"] == NSOrderedSame )
|
else if ([string caseInsensitiveCompare: @"PICAS"] == NSOrderedSame)
|
||||||
{
|
{
|
||||||
measurementString = @"pi";
|
measurementString = @"pi";
|
||||||
factorValue = 1.0/12.0;
|
factorValue = 1.0/12.0;
|
||||||
|
@ -668,7 +668,7 @@ enum {
|
||||||
printer = [NSPrinter printerWithName: [printerPopUp titleOfSelectedItem]];
|
printer = [NSPrinter printerWithName: [printerPopUp titleOfSelectedItem]];
|
||||||
|
|
||||||
//Get the paper name and size
|
//Get the paper name and size
|
||||||
if( [paperRadioMatrix selectedRow] == 0) //Standard Papers
|
if ([paperRadioMatrix selectedRow] == 0) //Standard Papers
|
||||||
{
|
{
|
||||||
paperName = [standardPaperSizePopUp titleOfSelectedItem];
|
paperName = [standardPaperSizePopUp titleOfSelectedItem];
|
||||||
paperSize = [printer pageSizeForPaper: paperName];
|
paperSize = [printer pageSizeForPaper: paperName];
|
||||||
|
@ -715,7 +715,7 @@ enum {
|
||||||
|
|
||||||
-(void) setPrintInfo:(NSPrintInfo*)printInfo
|
-(void) setPrintInfo:(NSPrintInfo*)printInfo
|
||||||
{
|
{
|
||||||
ASSIGN( _printInfo, printInfo);
|
ASSIGN(_printInfo, printInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
-(NSView*) accessoryView
|
-(NSView*) accessoryView
|
||||||
|
@ -725,7 +725,7 @@ enum {
|
||||||
|
|
||||||
-(void) setAccessoryView:(NSView*)accessoryView
|
-(void) setAccessoryView:(NSView*)accessoryView
|
||||||
{
|
{
|
||||||
ASSIGN( _accessoryView, accessoryView);
|
ASSIGN(_accessoryView, accessoryView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -744,7 +744,7 @@ enum {
|
||||||
|
|
||||||
//Fill in the printers
|
//Fill in the printers
|
||||||
printerNames = [NSPrinter printerNames];
|
printerNames = [NSPrinter printerNames];
|
||||||
if( [printerNames count] == 0 ) //NO PRINTERS
|
if ([printerNames count] == 0) //NO PRINTERS
|
||||||
{
|
{
|
||||||
[printerPopUp addItemWithTitle: @"(none)"];
|
[printerPopUp addItemWithTitle: @"(none)"];
|
||||||
[printerPopUp setEnabled: NO];
|
[printerPopUp setEnabled: NO];
|
||||||
|
@ -786,7 +786,7 @@ enum {
|
||||||
NSString *paperName;
|
NSString *paperName;
|
||||||
NSNumber *scaleNumber;
|
NSNumber *scaleNumber;
|
||||||
|
|
||||||
NSLog( @"readPrintInfo: %@", [[_printInfo dictionary] description]);
|
NSLog(@"readPrintInfo: %@", [[_printInfo dictionary] description]);
|
||||||
|
|
||||||
printer = [_printInfo printer];
|
printer = [_printInfo printer];
|
||||||
|
|
||||||
|
@ -795,15 +795,15 @@ enum {
|
||||||
//set the paper. Try to set the custom paper first.
|
//set the paper. Try to set the custom paper first.
|
||||||
paperName = [_printInfo paperName];
|
paperName = [_printInfo paperName];
|
||||||
|
|
||||||
if(([customPaperSizePopUp isEnabled] == YES) &&
|
if (([customPaperSizePopUp isEnabled] == YES) &&
|
||||||
([customPaperSizePopUp indexOfItemWithTitle: paperName] != -1 ))
|
([customPaperSizePopUp indexOfItemWithTitle: paperName] != -1))
|
||||||
{
|
{
|
||||||
[paperRadioMatrix selectCellAtRow: 1
|
[paperRadioMatrix selectCellAtRow: 1
|
||||||
column: 0];
|
column: 0];
|
||||||
|
|
||||||
[customPaperSizePopUp selectItemWithTitle: paperName];
|
[customPaperSizePopUp selectItemWithTitle: paperName];
|
||||||
}
|
}
|
||||||
else if( [standardPaperSizePopUp isEnabled] == YES)
|
else if ([standardPaperSizePopUp isEnabled] == YES)
|
||||||
{
|
{
|
||||||
[paperRadioMatrix selectCellAtRow: 0
|
[paperRadioMatrix selectCellAtRow: 0
|
||||||
column: 0];
|
column: 0];
|
||||||
|
@ -812,7 +812,7 @@ enum {
|
||||||
}
|
}
|
||||||
|
|
||||||
//set the orientation
|
//set the orientation
|
||||||
if( [_printInfo orientation] == NSPortraitOrientation)
|
if ([_printInfo orientation] == NSPortraitOrientation)
|
||||||
{
|
{
|
||||||
[paperOrientationMatrix selectCellAtRow: 0
|
[paperOrientationMatrix selectCellAtRow: 0
|
||||||
column: 0];
|
column: 0];
|
||||||
|
@ -846,7 +846,7 @@ enum {
|
||||||
NSNumber *scaleNumber;
|
NSNumber *scaleNumber;
|
||||||
|
|
||||||
//Write printer object
|
//Write printer object
|
||||||
if( [printerPopUp isEnabled] == NO) //NO PRINTERS
|
if ([printerPopUp isEnabled] == NO) //NO PRINTERS
|
||||||
{
|
{
|
||||||
printer = nil;
|
printer = nil;
|
||||||
}
|
}
|
||||||
|
@ -857,13 +857,13 @@ enum {
|
||||||
[_printInfo setPrinter: printer];
|
[_printInfo setPrinter: printer];
|
||||||
|
|
||||||
//write paper name
|
//write paper name
|
||||||
if(([paperRadioMatrix selectedRow] == 0) &&
|
if (([paperRadioMatrix selectedRow] == 0) &&
|
||||||
([standardPaperSizePopUp isEnabled] == YES)) //standard paper sizes
|
([standardPaperSizePopUp isEnabled] == YES)) //standard paper sizes
|
||||||
{
|
{
|
||||||
paperName = [standardPaperSizePopUp titleOfSelectedItem];
|
paperName = [standardPaperSizePopUp titleOfSelectedItem];
|
||||||
[_printInfo setPaperName: paperName];
|
[_printInfo setPaperName: paperName];
|
||||||
}
|
}
|
||||||
else if(([paperRadioMatrix selectedRow] == 1) &&
|
else if (([paperRadioMatrix selectedRow] == 1) &&
|
||||||
([customPaperSizePopUp isEnabled] == YES)) //custom paper size
|
([customPaperSizePopUp isEnabled] == YES)) //custom paper size
|
||||||
{
|
{
|
||||||
NSDictionary *customPaper;
|
NSDictionary *customPaper;
|
||||||
|
@ -896,7 +896,7 @@ enum {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Write orientation
|
//Write orientation
|
||||||
if( [paperOrientationMatrix selectedColumn] == 0)
|
if ([paperOrientationMatrix selectedColumn] == 0)
|
||||||
{
|
{
|
||||||
[_printInfo setOrientation: NSPortraitOrientation];
|
[_printInfo setOrientation: NSPortraitOrientation];
|
||||||
}
|
}
|
||||||
|
@ -910,7 +910,7 @@ enum {
|
||||||
[[_printInfo dictionary] setObject: scaleNumber
|
[[_printInfo dictionary] setObject: scaleNumber
|
||||||
forKey: NSPrintScalingFactor];
|
forKey: NSPrintScalingFactor];
|
||||||
|
|
||||||
NSLog( @"writePrintInfo: %@", [[_printInfo dictionary] description]);
|
NSLog(@"writePrintInfo: %@", [[_printInfo dictionary] description]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -943,7 +943,7 @@ enum {
|
||||||
//NSTableView datasource handlers
|
//NSTableView datasource handlers
|
||||||
-(int) numberOfRowsInTableView:(NSTableView*) tableView
|
-(int) numberOfRowsInTableView:(NSTableView*) tableView
|
||||||
{
|
{
|
||||||
if( tableView == customPaperTableView)
|
if (tableView == customPaperTableView)
|
||||||
{
|
{
|
||||||
return [customPapers count];
|
return [customPapers count];
|
||||||
}
|
}
|
||||||
|
@ -958,16 +958,16 @@ enum {
|
||||||
objectValueForTableColumn: (NSTableColumn*) tableColumn
|
objectValueForTableColumn: (NSTableColumn*) tableColumn
|
||||||
row: (int) index
|
row: (int) index
|
||||||
{
|
{
|
||||||
if( tableView == customPaperTableView)
|
if (tableView == customPaperTableView)
|
||||||
{
|
{
|
||||||
|
|
||||||
return [[customPapers allKeys] objectAtIndex: index];
|
return [[customPapers allKeys] objectAtIndex: index];
|
||||||
}
|
}
|
||||||
else //summaryTableView
|
else //summaryTableView
|
||||||
{
|
{
|
||||||
if( tableColumn == summarySettingColumn )
|
if (tableColumn == summarySettingColumn)
|
||||||
{
|
{
|
||||||
switch( index )
|
switch(index)
|
||||||
{
|
{
|
||||||
case 0: return @"Name";
|
case 0: return @"Name";
|
||||||
case 1: return @"Dimensions";
|
case 1: return @"Dimensions";
|
||||||
|
@ -991,7 +991,7 @@ enum {
|
||||||
printerName = [printerPopUp titleOfSelectedItem];
|
printerName = [printerPopUp titleOfSelectedItem];
|
||||||
printer = [NSPrinter printerWithName: printerName];
|
printer = [NSPrinter printerWithName: printerName];
|
||||||
|
|
||||||
if( [paperRadioMatrix selectedRow] == 0 ) //standard papers
|
if ([paperRadioMatrix selectedRow] == 0) //standard papers
|
||||||
{
|
{
|
||||||
NSRect imageRect;
|
NSRect imageRect;
|
||||||
NSSize paperSize;
|
NSSize paperSize;
|
||||||
|
@ -1017,14 +1017,14 @@ enum {
|
||||||
rightMargin = [[customPapers objectForKey: @"RightMargin"]
|
rightMargin = [[customPapers objectForKey: @"RightMargin"]
|
||||||
doubleValue];
|
doubleValue];
|
||||||
}
|
}
|
||||||
switch( index )
|
switch(index)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
return paperName;
|
return paperName;
|
||||||
case 1:
|
case 1:
|
||||||
return [dimensionsTextField stringValue];
|
return [dimensionsTextField stringValue];
|
||||||
case 2:
|
case 2:
|
||||||
if( [paperOrientationMatrix selectedColumn] == 0)
|
if ([paperOrientationMatrix selectedColumn] == 0)
|
||||||
{
|
{
|
||||||
return @"Portrait";
|
return @"Portrait";
|
||||||
}
|
}
|
||||||
|
@ -1058,7 +1058,7 @@ enum {
|
||||||
-(void) tabView: (NSTabView*) tabView
|
-(void) tabView: (NSTabView*) tabView
|
||||||
willSelectTabViewItem: (NSTabViewItem*) tabViewItem
|
willSelectTabViewItem: (NSTabViewItem*) tabViewItem
|
||||||
{
|
{
|
||||||
if( tabViewItem == summaryTabViewItem )
|
if (tabViewItem == summaryTabViewItem)
|
||||||
{
|
{
|
||||||
[summaryTableView sizeToFit];
|
[summaryTableView sizeToFit];
|
||||||
}
|
}
|
||||||
|
@ -1109,7 +1109,7 @@ enum {
|
||||||
//Figure out if we we should scale according to the
|
//Figure out if we we should scale according to the
|
||||||
//the width or the height
|
//the width or the height
|
||||||
//
|
//
|
||||||
if( _paperSize.width >= _paperSize.height)
|
if (_paperSize.width >= _paperSize.height)
|
||||||
{
|
{
|
||||||
ratio = _paperSize.height/ _paperSize.width;
|
ratio = _paperSize.height/ _paperSize.width;
|
||||||
width = bounds.size.width;
|
width = bounds.size.width;
|
||||||
|
@ -1132,7 +1132,7 @@ enum {
|
||||||
paper.size.height = height;
|
paper.size.height = height;
|
||||||
|
|
||||||
shadow = paper;
|
shadow = paper;
|
||||||
if( [self isFlipped] == NO)
|
if ([self isFlipped] == NO)
|
||||||
shadow.origin.y -= 2;
|
shadow.origin.y -= 2;
|
||||||
else
|
else
|
||||||
shadow.origin.y += 2;
|
shadow.origin.y += 2;
|
||||||
|
@ -1152,7 +1152,7 @@ enum {
|
||||||
[NSBezierPath strokeRect: paper];
|
[NSBezierPath strokeRect: paper];
|
||||||
|
|
||||||
//Draw the margins?
|
//Draw the margins?
|
||||||
if( _drawsMargins == YES )
|
if (_drawsMargins == YES)
|
||||||
{
|
{
|
||||||
NSRect margins;
|
NSRect margins;
|
||||||
double scale;
|
double scale;
|
||||||
|
|
|
@ -84,7 +84,7 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [[principalClass printInfoClass] allocWithZone: zone];
|
return [[principalClass printInfoClass] allocWithZone: zone];
|
||||||
|
@ -124,7 +124,7 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [[principalClass printInfoClass] defaultPrinter];
|
return [[principalClass printInfoClass] defaultPrinter];
|
||||||
|
@ -136,7 +136,7 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
[[principalClass printInfoClass] setDefaultPrinter: printer];
|
[[principalClass printInfoClass] setDefaultPrinter: printer];
|
||||||
|
@ -195,18 +195,18 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if( aDict != nil )
|
if (aDict != nil)
|
||||||
{
|
{
|
||||||
[_info addEntriesFromDictionary: aDict];
|
[_info addEntriesFromDictionary: aDict];
|
||||||
|
|
||||||
if([[_info objectForKey: NSPrintPrinter] isKindOfClass: [NSString class]])
|
if ([[_info objectForKey: NSPrintPrinter] isKindOfClass: [NSString class]])
|
||||||
{
|
{
|
||||||
NSString *printerName;
|
NSString *printerName;
|
||||||
|
|
||||||
printerName = [_info objectForKey: NSPrintPrinter];
|
printerName = [_info objectForKey: NSPrintPrinter];
|
||||||
printer = [NSPrinter printerWithName: printerName];
|
printer = [NSPrinter printerWithName: printerName];
|
||||||
|
|
||||||
if( printer )
|
if (printer)
|
||||||
[self setPrinter: printer];
|
[self setPrinter: printer];
|
||||||
else
|
else
|
||||||
[_info removeObjectForKey: NSPrintPrinter];
|
[_info removeObjectForKey: NSPrintPrinter];
|
||||||
|
@ -456,7 +456,7 @@ static NSPrintInfo *sharedPrintInfo = nil;
|
||||||
printerName = [_info objectForKey: NSPrintPrinter];
|
printerName = [_info objectForKey: NSPrintPrinter];
|
||||||
printer = [NSPrinter printerWithName: printerName];
|
printer = [NSPrinter printerWithName: printerName];
|
||||||
|
|
||||||
if( printer )
|
if (printer)
|
||||||
[self setPrinter: printer];
|
[self setPrinter: printer];
|
||||||
else
|
else
|
||||||
[_info removeObjectForKey: NSPrintPrinter];
|
[_info removeObjectForKey: NSPrintPrinter];
|
||||||
|
|
|
@ -879,7 +879,7 @@ scaleRect(NSRect rect, double scale)
|
||||||
{
|
{
|
||||||
viewPageRange = NSMakeRange(1, (info.xpages * info.ypages));
|
viewPageRange = NSMakeRange(1, (info.xpages * info.ypages));
|
||||||
}
|
}
|
||||||
[dict setObject: NSNUMBER(NSMaxRange(viewPageRange) )
|
[dict setObject: NSNUMBER(NSMaxRange(viewPageRange))
|
||||||
forKey: @"NSPrintTotalPages"];
|
forKey: @"NSPrintTotalPages"];
|
||||||
if (allPages == YES)
|
if (allPages == YES)
|
||||||
{
|
{
|
||||||
|
@ -986,7 +986,7 @@ scaleRect(NSRect rect, double scale)
|
||||||
} /* Print each page */
|
} /* Print each page */
|
||||||
|
|
||||||
/* Make sure we end the sheet */
|
/* Make sure we end the sheet */
|
||||||
if ( info.nup > 1 && (info.last - info.first) % info.nup != info.nup - 1 )
|
if (info.nup > 1 && (info.last - info.first) % info.nup != info.nup - 1)
|
||||||
{
|
{
|
||||||
[_view drawSheetBorderWithSize: info.paperBounds.size];
|
[_view drawSheetBorderWithSize: info.paperBounds.size];
|
||||||
[_view _endSheet];
|
[_view _endSheet];
|
||||||
|
@ -1082,7 +1082,7 @@ scaleRect(NSRect rect, double scale)
|
||||||
[self endPage];
|
[self endPage];
|
||||||
|
|
||||||
/* End a physical page */
|
/* End a physical page */
|
||||||
if ( ((currentPage - info.first) % info.nup == info.nup-1) )
|
if (((currentPage - info.first) % info.nup == info.nup-1))
|
||||||
{
|
{
|
||||||
[self drawSheetBorderWithSize: info.paperBounds.size];
|
[self drawSheetBorderWithSize: info.paperBounds.size];
|
||||||
[self _endSheet];
|
[self _endSheet];
|
||||||
|
|
|
@ -85,7 +85,7 @@ static NSPrintPanel *shared_instance;
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [[principalClass printPanelClass] allocWithZone: zone];
|
return [[principalClass printPanelClass] allocWithZone: zone];
|
||||||
|
@ -273,7 +273,7 @@ static NSPrintPanel *shared_instance;
|
||||||
{
|
{
|
||||||
_picked = NSPPPreviewButton;
|
_picked = NSPPPreviewButton;
|
||||||
}
|
}
|
||||||
else if (tag ==NSFaxButton )
|
else if (tag ==NSFaxButton)
|
||||||
{
|
{
|
||||||
_picked = NSFaxButton;
|
_picked = NSFaxButton;
|
||||||
NSRunAlertPanel(@"Sorry", @"Faxing of print file not implemented",
|
NSRunAlertPanel(@"Sorry", @"Faxing of print file not implemented",
|
||||||
|
|
|
@ -121,7 +121,7 @@ static NSMutableDictionary* printerCache;
|
||||||
// Initial version
|
// Initial version
|
||||||
[self setVersion:1];
|
[self setVersion:1];
|
||||||
}
|
}
|
||||||
printerCache = RETAIN( [NSMutableDictionary dictionary] );
|
printerCache = RETAIN([NSMutableDictionary dictionary]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Load the appropriate bundle for the Printer
|
/** Load the appropriate bundle for the Printer
|
||||||
|
@ -133,7 +133,7 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [[principalClass printerClass] allocWithZone: zone];
|
return [[principalClass printerClass] allocWithZone: zone];
|
||||||
|
@ -152,23 +152,23 @@ static NSMutableDictionary* printerCache;
|
||||||
//First, the cache has to be managed.
|
//First, the cache has to be managed.
|
||||||
//Take into account any deleted printers.
|
//Take into account any deleted printers.
|
||||||
keyEnum = [[printerCache allKeys] objectEnumerator];
|
keyEnum = [[printerCache allKeys] objectEnumerator];
|
||||||
while( (key = [keyEnum nextObject]) )
|
while ((key = [keyEnum nextObject]))
|
||||||
{
|
{
|
||||||
NSEnumerator *namesEnum;
|
NSEnumerator *namesEnum;
|
||||||
NSString *validName;
|
NSString *validName;
|
||||||
BOOL stillValid = NO;
|
BOOL stillValid = NO;
|
||||||
|
|
||||||
namesEnum = [[self printerNames] objectEnumerator];
|
namesEnum = [[self printerNames] objectEnumerator];
|
||||||
while( (validName = [namesEnum nextObject]) )
|
while ((validName = [namesEnum nextObject]))
|
||||||
{
|
{
|
||||||
if( [validName isEqualToString: key] )
|
if ([validName isEqualToString: key])
|
||||||
{
|
{
|
||||||
stillValid = YES;
|
stillValid = YES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( stillValid == NO )
|
if (stillValid == NO)
|
||||||
{
|
{
|
||||||
[printerCache removeObjectForKey: key];
|
[printerCache removeObjectForKey: key];
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
printer = [printerCache objectForKey: name];
|
printer = [printerCache objectForKey: name];
|
||||||
|
|
||||||
if( printer )
|
if (printer)
|
||||||
{
|
{
|
||||||
return printer;
|
return printer;
|
||||||
}
|
}
|
||||||
|
@ -186,12 +186,12 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
printer = [[principalClass printerClass] printerWithName: name];
|
printer = [[principalClass printerClass] printerWithName: name];
|
||||||
|
|
||||||
if( printer )
|
if (printer)
|
||||||
{
|
{
|
||||||
[printerCache setObject: printer
|
[printerCache setObject: printer
|
||||||
forKey: name];
|
forKey: name];
|
||||||
|
@ -225,13 +225,13 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
printerNamesEnum = [[self printerNames] objectEnumerator];
|
printerNamesEnum = [[self printerNames] objectEnumerator];
|
||||||
|
|
||||||
while( (printerName = [printerNamesEnum nextObject]) )
|
while ((printerName = [printerNamesEnum nextObject]))
|
||||||
{
|
{
|
||||||
NSPrinter *printer;
|
NSPrinter *printer;
|
||||||
|
|
||||||
printer = [self printerWithName: printerName];
|
printer = [self printerWithName: printerName];
|
||||||
|
|
||||||
if( [[printer type] isEqualToString: type] )
|
if ([[printer type] isEqualToString: type])
|
||||||
{
|
{
|
||||||
return printer;
|
return printer;
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
principalClass = [[GSPrinting printingBundle] principalClass];
|
principalClass = [[GSPrinting printingBundle] principalClass];
|
||||||
|
|
||||||
if( principalClass == nil )
|
if (principalClass == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [[principalClass printerClass] printerNames];
|
return [[principalClass printerClass] printerNames];
|
||||||
|
@ -265,7 +265,7 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
printerNamesEnum = [[self printerNames] objectEnumerator];
|
printerNamesEnum = [[self printerNames] objectEnumerator];
|
||||||
|
|
||||||
while( (printerName = [printerNamesEnum nextObject]) )
|
while ((printerName = [printerNamesEnum nextObject]))
|
||||||
{
|
{
|
||||||
printer = [self printerWithName: printerName];
|
printer = [self printerWithName: printerName];
|
||||||
|
|
||||||
|
@ -319,12 +319,12 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
protocols = [NSScanner scannerWithString: result];
|
protocols = [NSScanner scannerWithString: result];
|
||||||
|
|
||||||
while( ![protocols isAtEnd] )
|
while (![protocols isAtEnd])
|
||||||
{
|
{
|
||||||
[protocols scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet]
|
[protocols scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet]
|
||||||
intoString: &result];
|
intoString: &result];
|
||||||
|
|
||||||
if ( [result isEqual:@"BCP"] )
|
if ([result isEqual:@"BCP"])
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ static NSMutableDictionary* printerCache;
|
||||||
if (!result)
|
if (!result)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
if ( [result caseInsensitiveCompare: @"REVERSE"] == NSOrderedSame)
|
if ([result caseInsensitiveCompare: @"REVERSE"] == NSOrderedSame)
|
||||||
return YES;
|
return YES;
|
||||||
else
|
else
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -415,7 +415,7 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
result = [NSMutableDictionary dictionary];
|
result = [NSMutableDictionary dictionary];
|
||||||
|
|
||||||
if( [self isKey: @"DefaultResolution"
|
if ([self isKey: @"DefaultResolution"
|
||||||
inTable:@"PPD"])
|
inTable:@"PPD"])
|
||||||
{
|
{
|
||||||
int dpi = [self intForKey: @"DefaultResolution"
|
int dpi = [self intForKey: @"DefaultResolution"
|
||||||
|
@ -425,7 +425,7 @@ static NSMutableDictionary* printerCache;
|
||||||
forKey: NSDeviceResolution];
|
forKey: NSDeviceResolution];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( [self isKey: @"ColorDevice"
|
if ([self isKey: @"ColorDevice"
|
||||||
inTable: @"PPD"])
|
inTable: @"PPD"])
|
||||||
{
|
{
|
||||||
BOOL color = [self booleanForKey: @"ColorDevice"
|
BOOL color = [self booleanForKey: @"ColorDevice"
|
||||||
|
@ -434,7 +434,7 @@ static NSMutableDictionary* printerCache;
|
||||||
// FIXME: Should NSDeviceWhiteColorSpace be NSDeviceBlackColorSpace?
|
// FIXME: Should NSDeviceWhiteColorSpace be NSDeviceBlackColorSpace?
|
||||||
// FIXME #2: Are they calibrated?
|
// FIXME #2: Are they calibrated?
|
||||||
// Basically I'm not sure which color spaces should be used...
|
// Basically I'm not sure which color spaces should be used...
|
||||||
if( color == YES )
|
if (color == YES)
|
||||||
{
|
{
|
||||||
[result setObject: NSDeviceCMYKColorSpace
|
[result setObject: NSDeviceCMYKColorSpace
|
||||||
forKey: NSDeviceColorSpaceName];
|
forKey: NSDeviceColorSpaceName];
|
||||||
|
@ -446,8 +446,8 @@ static NSMutableDictionary* printerCache;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( [self isKey: @"DefaultBitsPerPixel"
|
if ([self isKey: @"DefaultBitsPerPixel"
|
||||||
inTable: @"PPD"] )
|
inTable: @"PPD"])
|
||||||
{
|
{
|
||||||
int bits = [self intForKey: @"DefaultBitsPerPixel"
|
int bits = [self intForKey: @"DefaultBitsPerPixel"
|
||||||
inTable: @"PPD"];
|
inTable: @"PPD"];
|
||||||
|
@ -456,13 +456,13 @@ static NSMutableDictionary* printerCache;
|
||||||
forKey: NSDeviceBitsPerSample];
|
forKey: NSDeviceBitsPerSample];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( [self isKey: @"DefaultPageSize"
|
if ([self isKey: @"DefaultPageSize"
|
||||||
inTable: @"PPD"] )
|
inTable: @"PPD"])
|
||||||
{
|
{
|
||||||
NSString* defaultPageSize = [self stringForKey: @"DefaultPageSize"
|
NSString* defaultPageSize = [self stringForKey: @"DefaultPageSize"
|
||||||
inTable: @"PPD"];
|
inTable: @"PPD"];
|
||||||
|
|
||||||
if( defaultPageSize )
|
if (defaultPageSize)
|
||||||
{
|
{
|
||||||
NSSize paperSize = [self pageSizeForPaper: defaultPageSize];
|
NSSize paperSize = [self pageSizeForPaper: defaultPageSize];
|
||||||
|
|
||||||
|
@ -567,7 +567,7 @@ static NSMutableDictionary* printerCache;
|
||||||
results = [self stringListForKey: key
|
results = [self stringListForKey: key
|
||||||
inTable: table];
|
inTable: table];
|
||||||
|
|
||||||
if( results == nil)
|
if (results == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
return [results objectAtIndex: 0];
|
return [results objectAtIndex: 0];
|
||||||
|
@ -584,7 +584,7 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
tableObj = [_tables objectForKey: table ];
|
tableObj = [_tables objectForKey: table ];
|
||||||
|
|
||||||
if( tableObj == nil )
|
if (tableObj == nil)
|
||||||
{
|
{
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"Could not find table %@", table];
|
format: @"Could not find table %@", table];
|
||||||
|
@ -610,7 +610,7 @@ static NSMutableDictionary* printerCache;
|
||||||
// Select correct table
|
// Select correct table
|
||||||
tableObj = [_tables objectForKey: table];
|
tableObj = [_tables objectForKey: table];
|
||||||
|
|
||||||
if( tableObj == nil )
|
if (tableObj == nil)
|
||||||
return NSPrinterTableNotFound;
|
return NSPrinterTableNotFound;
|
||||||
else
|
else
|
||||||
return NSPrinterTableOK;
|
return NSPrinterTableOK;
|
||||||
|
@ -627,7 +627,7 @@ static NSMutableDictionary* printerCache;
|
||||||
// Select correct table
|
// Select correct table
|
||||||
tableObj = [_tables objectForKey: table];
|
tableObj = [_tables objectForKey: table];
|
||||||
|
|
||||||
if( tableObj == nil )
|
if (tableObj == nil)
|
||||||
{
|
{
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"Could not find table %@", table];
|
format: @"Could not find table %@", table];
|
||||||
|
@ -635,7 +635,7 @@ static NSMutableDictionary* printerCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
// And check it
|
// And check it
|
||||||
if ( [tableObj objectForKey: key] == nil)
|
if ([tableObj objectForKey: key] == nil)
|
||||||
return NO;
|
return NO;
|
||||||
else
|
else
|
||||||
return YES;
|
return YES;
|
||||||
|
@ -690,7 +690,7 @@ static NSMutableDictionary* printerCache;
|
||||||
ASSIGN(_printerHost, host);
|
ASSIGN(_printerHost, host);
|
||||||
ASSIGN(_printerNote, note);
|
ASSIGN(_printerNote, note);
|
||||||
|
|
||||||
_tables = RETAIN( [NSMutableDictionary dictionary] );
|
_tables = RETAIN([NSMutableDictionary dictionary]);
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -723,28 +723,28 @@ static NSMutableDictionary* printerCache;
|
||||||
NSMutableArray* valArray;
|
NSMutableArray* valArray;
|
||||||
|
|
||||||
//make sure the class variables for scanning are created
|
//make sure the class variables for scanning are created
|
||||||
if( !newlineSet)
|
if (!newlineSet)
|
||||||
{
|
{
|
||||||
newlineSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r"];
|
newlineSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r"];
|
||||||
RETAIN( newlineSet );
|
RETAIN(newlineSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !keyEndSet )
|
if (!keyEndSet)
|
||||||
{
|
{
|
||||||
keyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r\t: "];
|
keyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r\t: "];
|
||||||
RETAIN( keyEndSet );
|
RETAIN(keyEndSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !optKeyEndSet )
|
if (!optKeyEndSet)
|
||||||
{
|
{
|
||||||
optKeyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r:/"];
|
optKeyEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r:/"];
|
||||||
RETAIN( optKeyEndSet );
|
RETAIN(optKeyEndSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !valueEndSet )
|
if (!valueEndSet)
|
||||||
{
|
{
|
||||||
valueEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r/"];
|
valueEndSet = [NSCharacterSet characterSetWithCharactersInString: @"\n\r/"];
|
||||||
RETAIN( valueEndSet );
|
RETAIN(valueEndSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -786,24 +786,24 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
// Search the PPD dictionary for symbolvalues and substitute them.
|
// Search the PPD dictionary for symbolvalues and substitute them.
|
||||||
objEnum = [[_tables objectForKey: @"PPD"] objectEnumerator];
|
objEnum = [[_tables objectForKey: @"PPD"] objectEnumerator];
|
||||||
while( (valArray = [objEnum nextObject]) )
|
while ((valArray = [objEnum nextObject]))
|
||||||
{
|
{
|
||||||
NSString *oldValue;
|
NSString *oldValue;
|
||||||
NSString *newValue;
|
NSString *newValue;
|
||||||
int i, max;
|
int i, max;
|
||||||
|
|
||||||
max = [valArray count];
|
max = [valArray count];
|
||||||
for( i=0 ; i < max ; i++ )
|
for (i=0 ; i < max ; i++)
|
||||||
{
|
{
|
||||||
oldValue = [valArray objectAtIndex: i];
|
oldValue = [valArray objectAtIndex: i];
|
||||||
if( [oldValue isKindOfClass: [NSString class]]
|
if ([oldValue isKindOfClass: [NSString class]]
|
||||||
&& ![oldValue isEqual: @""]
|
&& ![oldValue isEqual: @""]
|
||||||
&& [[oldValue substringToIndex: 1] isEqual: @"^"])
|
&& [[oldValue substringToIndex: 1] isEqual: @"^"])
|
||||||
{
|
{
|
||||||
newValue = [ppdSymbolValues
|
newValue = [ppdSymbolValues
|
||||||
objectForKey: [oldValue substringFromIndex: 1]];
|
objectForKey: [oldValue substringFromIndex: 1]];
|
||||||
|
|
||||||
if( !newValue )
|
if (!newValue)
|
||||||
{
|
{
|
||||||
[NSException raise: NSPPDParseException
|
[NSException raise: NSPPDParseException
|
||||||
format: @"Unknown symbol value, ^%@ in PPD file %@.ppd",
|
format: @"Unknown symbol value, ^%@ in PPD file %@.ppd",
|
||||||
|
@ -837,10 +837,10 @@ static NSMutableDictionary* printerCache;
|
||||||
@"PPD-Adobe",
|
@"PPD-Adobe",
|
||||||
nil] objectEnumerator];
|
nil] objectEnumerator];
|
||||||
|
|
||||||
while( (checkVal = [objEnum nextObject]) )
|
while ((checkVal = [objEnum nextObject]))
|
||||||
{
|
{
|
||||||
if( ![self isKey: checkVal
|
if (![self isKey: checkVal
|
||||||
inTable: @"PPD"] )
|
inTable: @"PPD"])
|
||||||
{
|
{
|
||||||
[NSException raise:NSPPDParseException
|
[NSException raise:NSPPDParseException
|
||||||
format:@"Required keyword *%@ not found in PPD file %@.ppd",
|
format:@"Required keyword *%@ not found in PPD file %@.ppd",
|
||||||
|
@ -850,7 +850,7 @@ static NSMutableDictionary* printerCache;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Release the local autoreleasePool
|
// Release the local autoreleasePool
|
||||||
RELEASE( subpool );
|
RELEASE(subpool);
|
||||||
|
|
||||||
|
|
||||||
//Sometimes it's good to see the tables...
|
//Sometimes it's good to see the tables...
|
||||||
|
@ -914,7 +914,7 @@ static NSMutableDictionary* printerCache;
|
||||||
[ppdData setCharactersToBeSkipped: [NSCharacterSet whitespaceCharacterSet]];
|
[ppdData setCharactersToBeSkipped: [NSCharacterSet whitespaceCharacterSet]];
|
||||||
|
|
||||||
// Main processing starts here...
|
// Main processing starts here...
|
||||||
while( YES ) //Only check for the end after accounting for whitespace
|
while (YES) //Only check for the end after accounting for whitespace
|
||||||
{
|
{
|
||||||
// Get to the start of a new keyword, skipping blank lines
|
// Get to the start of a new keyword, skipping blank lines
|
||||||
[ppdData scanCharactersFromSet:
|
[ppdData scanCharactersFromSet:
|
||||||
|
@ -922,12 +922,12 @@ static NSMutableDictionary* printerCache;
|
||||||
intoString: NULL];
|
intoString: NULL];
|
||||||
|
|
||||||
//this could be the end...
|
//this could be the end...
|
||||||
if( [ppdData isAtEnd] )
|
if ([ppdData isAtEnd])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// All new entries should starts '*'
|
// All new entries should starts '*'
|
||||||
if( ![ppdData scanString: @"*"
|
if (![ppdData scanString: @"*"
|
||||||
intoString: NULL] )
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[NSException raise: NSPPDParseException
|
[NSException raise: NSPPDParseException
|
||||||
format: @"Line not starting with * in PPD file %@",
|
format: @"Line not starting with * in PPD file %@",
|
||||||
|
@ -935,7 +935,7 @@ static NSMutableDictionary* printerCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip lines starting '*%', '*End', '*SymbolLength', or '*SymbolEnd'
|
// Skip lines starting '*%', '*End', '*SymbolLength', or '*SymbolEnd'
|
||||||
if ( [ppdData scanString: @"%"
|
if ([ppdData scanString: @"%"
|
||||||
intoString: NULL]
|
intoString: NULL]
|
||||||
|| [ppdData scanString: @"End" //if we get this there is problem, yes?
|
|| [ppdData scanString: @"End" //if we get this there is problem, yes?
|
||||||
intoString: NULL]
|
intoString: NULL]
|
||||||
|
@ -954,24 +954,24 @@ static NSMutableDictionary* printerCache;
|
||||||
intoString: &keyword];
|
intoString: &keyword];
|
||||||
|
|
||||||
// Loop if there is no value section, these keywords are ignored
|
// Loop if there is no value section, these keywords are ignored
|
||||||
if( [ppdData scanCharactersFromSet: newlineSet
|
if ([ppdData scanCharactersFromSet: newlineSet
|
||||||
intoString: NULL] )
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add the line to the relevant table
|
// Add the line to the relevant table
|
||||||
if( [keyword isEqual: @"OrderDependency"] )
|
if ([keyword isEqual: @"OrderDependency"])
|
||||||
{
|
{
|
||||||
[self addPPDOrderDependency: ppdData
|
[self addPPDOrderDependency: ppdData
|
||||||
withPPDPath: ppdPath];
|
withPPDPath: ppdPath];
|
||||||
}
|
}
|
||||||
else if( [keyword isEqual: @"UIConstraints"] )
|
else if ([keyword isEqual: @"UIConstraints"])
|
||||||
{
|
{
|
||||||
[self addPPDUIConstraint: ppdData
|
[self addPPDUIConstraint: ppdData
|
||||||
withPPDPath: ppdPath];
|
withPPDPath: ppdPath];
|
||||||
}
|
}
|
||||||
else if( [keyword isEqual: @"Include"] )
|
else if ([keyword isEqual: @"Include"])
|
||||||
{
|
{
|
||||||
NSFileManager *fileManager;
|
NSFileManager *fileManager;
|
||||||
NSString *fileName = nil;
|
NSString *fileName = nil;
|
||||||
|
@ -993,16 +993,16 @@ static NSMutableDictionary* printerCache;
|
||||||
intoString: NULL];
|
intoString: NULL];
|
||||||
|
|
||||||
//the fileName could be an absolute path or just a filename.
|
//the fileName could be an absolute path or just a filename.
|
||||||
if( [fileManager fileExistsAtPath: fileName] )
|
if ([fileManager fileExistsAtPath: fileName])
|
||||||
{
|
{
|
||||||
//it was absolute, we are done
|
//it was absolute, we are done
|
||||||
path = fileName;
|
path = fileName;
|
||||||
}
|
}
|
||||||
//it was not absolute. Check to see if it exists in the
|
//it was not absolute. Check to see if it exists in the
|
||||||
//directory of this ppd
|
//directory of this ppd
|
||||||
else if( [fileManager fileExistsAtPath:
|
else if ([fileManager fileExistsAtPath:
|
||||||
[[ppdPath stringByDeletingLastPathComponent]
|
[[ppdPath stringByDeletingLastPathComponent]
|
||||||
stringByAppendingPathComponent: fileName] ] )
|
stringByAppendingPathComponent: fileName] ])
|
||||||
{
|
{
|
||||||
path = [[ppdPath stringByDeletingLastPathComponent]
|
path = [[ppdPath stringByDeletingLastPathComponent]
|
||||||
stringByAppendingPathComponent: fileName];
|
stringByAppendingPathComponent: fileName];
|
||||||
|
@ -1022,7 +1022,7 @@ static NSMutableDictionary* printerCache;
|
||||||
NSString *symbolName;
|
NSString *symbolName;
|
||||||
NSString *symbolVal;
|
NSString *symbolVal;
|
||||||
|
|
||||||
if( ![ppdData scanString: @"^"
|
if (![ppdData scanString: @"^"
|
||||||
intoString: NULL])
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[NSException raise: NSPPDParseException
|
[NSException raise: NSPPDParseException
|
||||||
|
@ -1043,7 +1043,7 @@ static NSMutableDictionary* printerCache;
|
||||||
[ppdData scanUpToString: @"\"" /*"*/
|
[ppdData scanUpToString: @"\"" /*"*/
|
||||||
intoString: &symbolVal];
|
intoString: &symbolVal];
|
||||||
|
|
||||||
if ( !symbolVal )
|
if (!symbolVal)
|
||||||
symbolVal = @"";
|
symbolVal = @"";
|
||||||
|
|
||||||
[ppdData scanString: @"\"" /*"*/
|
[ppdData scanString: @"\"" /*"*/
|
||||||
|
@ -1096,7 +1096,7 @@ static NSMutableDictionary* printerCache;
|
||||||
[ppdData scanUpToCharactersFromSet: optKeyEndSet
|
[ppdData scanUpToCharactersFromSet: optKeyEndSet
|
||||||
intoString: &optionKeyword];
|
intoString: &optionKeyword];
|
||||||
|
|
||||||
if( [ppdData scanCharactersFromSet: newlineSet
|
if ([ppdData scanCharactersFromSet: newlineSet
|
||||||
intoString: NULL])
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[NSException raise: NSPPDParseException
|
[NSException raise: NSPPDParseException
|
||||||
|
@ -1104,8 +1104,8 @@ static NSMutableDictionary* printerCache;
|
||||||
ppdPath];
|
ppdPath];
|
||||||
}
|
}
|
||||||
|
|
||||||
if( [ppdData scanString: @"/"
|
if ([ppdData scanString: @"/"
|
||||||
intoString: NULL] )
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
// Option keyword translation exists - scan it
|
// Option keyword translation exists - scan it
|
||||||
[ppdData scanUpToString: @":"
|
[ppdData scanUpToString: @":"
|
||||||
|
@ -1118,13 +1118,13 @@ static NSMutableDictionary* printerCache;
|
||||||
// Read the value part
|
// Read the value part
|
||||||
// Values starting with a " are read until the second ", ignoring \n etc.
|
// Values starting with a " are read until the second ", ignoring \n etc.
|
||||||
|
|
||||||
if( [ppdData scanString: @"\"" /*"*/
|
if ([ppdData scanString: @"\"" /*"*/
|
||||||
intoString: NULL] )
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[ppdData scanUpToString: @"\"" /*"*/
|
[ppdData scanUpToString: @"\"" /*"*/
|
||||||
intoString: &value];
|
intoString: &value];
|
||||||
|
|
||||||
if ( !value )
|
if (!value)
|
||||||
value = @"";
|
value = @"";
|
||||||
|
|
||||||
[ppdData scanString: @"\"" /*"*/
|
[ppdData scanString: @"\"" /*"*/
|
||||||
|
@ -1132,7 +1132,7 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
// It is a QuotedValue if it's in quotes, and there is no option
|
// It is a QuotedValue if it's in quotes, and there is no option
|
||||||
// key, or the main key is a *JCL keyword
|
// key, or the main key is a *JCL keyword
|
||||||
if ( !optionKeyword || [[mainKeyword substringToIndex:3]
|
if (!optionKeyword || [[mainKeyword substringToIndex:3]
|
||||||
isEqualToString: @"JCL"])
|
isEqualToString: @"JCL"])
|
||||||
{
|
{
|
||||||
value = [self interpretQuotedValue: value];
|
value = [self interpretQuotedValue: value];
|
||||||
|
@ -1145,8 +1145,8 @@ static NSMutableDictionary* printerCache;
|
||||||
intoString: &value];
|
intoString: &value];
|
||||||
}
|
}
|
||||||
// If there is a value translation, scan it
|
// If there is a value translation, scan it
|
||||||
if( [ppdData scanString: @"/"
|
if ([ppdData scanString: @"/"
|
||||||
intoString: NULL] )
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[ppdData scanUpToCharactersFromSet: newlineSet
|
[ppdData scanUpToCharactersFromSet: newlineSet
|
||||||
intoString: &valueTranslation];
|
intoString: &valueTranslation];
|
||||||
|
@ -1165,15 +1165,15 @@ static NSMutableDictionary* printerCache;
|
||||||
// If a keyword is read twice, 'first instance is correct', according to
|
// If a keyword is read twice, 'first instance is correct', according to
|
||||||
// the standard.
|
// the standard.
|
||||||
// Finally, add the strings to the tables
|
// Finally, add the strings to the tables
|
||||||
if( optionKeyword )
|
if (optionKeyword)
|
||||||
{
|
{
|
||||||
NSString *mainAndOptionKeyword;
|
NSString *mainAndOptionKeyword;
|
||||||
|
|
||||||
mainAndOptionKeyword=[mainKeyword stringByAppendingFormat: @"/%@",
|
mainAndOptionKeyword=[mainKeyword stringByAppendingFormat: @"/%@",
|
||||||
optionKeyword];
|
optionKeyword];
|
||||||
|
|
||||||
if( [self isKey: mainAndOptionKeyword
|
if ([self isKey: mainAndOptionKeyword
|
||||||
inTable: @"PPD"] )
|
inTable: @"PPD"])
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1190,7 +1190,7 @@ static NSMutableDictionary* printerCache;
|
||||||
// option keywords.
|
// option keywords.
|
||||||
// This is done by making the first item in the array an empty
|
// This is done by making the first item in the array an empty
|
||||||
// string, which will be skipped by stringListForKey:, if necessary
|
// string, which will be skipped by stringListForKey:, if necessary
|
||||||
if( ![[_tables objectForKey: @"PPD"] objectForKey: mainKeyword] )
|
if (![[_tables objectForKey: @"PPD"] objectForKey: mainKeyword])
|
||||||
{
|
{
|
||||||
[self addString: @""
|
[self addString: @""
|
||||||
forKey: mainKeyword
|
forKey: mainKeyword
|
||||||
|
@ -1213,9 +1213,9 @@ static NSMutableDictionary* printerCache;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( [self isKey: mainKeyword
|
if ([self isKey: mainKeyword
|
||||||
inTable: @"PPD"] &&
|
inTable: @"PPD"] &&
|
||||||
![repKeys containsObject: mainKeyword] )
|
![repKeys containsObject: mainKeyword])
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1237,8 +1237,8 @@ static NSMutableDictionary* printerCache;
|
||||||
NSString* optionKey2 = nil;
|
NSString* optionKey2 = nil;
|
||||||
|
|
||||||
// UIConstraint should have no option keyword
|
// UIConstraint should have no option keyword
|
||||||
if( ![constraint scanString: @":"
|
if (![constraint scanString: @":"
|
||||||
intoString: NULL] )
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[NSException raise:NSPPDParseException
|
[NSException raise:NSPPDParseException
|
||||||
format:@"UIConstraints has option keyword in PPD File %@",
|
format:@"UIConstraints has option keyword in PPD File %@",
|
||||||
|
@ -1253,8 +1253,8 @@ static NSMutableDictionary* printerCache;
|
||||||
[constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet]
|
[constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet]
|
||||||
intoString: &mainKey1];
|
intoString: &mainKey1];
|
||||||
|
|
||||||
if( ![constraint scanString: @"*"
|
if (![constraint scanString: @"*"
|
||||||
intoString: NULL] )
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet]
|
[constraint scanUpToCharactersFromSet: [NSCharacterSet whitespaceCharacterSet]
|
||||||
intoString: &optionKey1];
|
intoString: &optionKey1];
|
||||||
|
@ -1268,7 +1268,7 @@ static NSMutableDictionary* printerCache;
|
||||||
[NSCharacterSet whitespaceAndNewlineCharacterSet]
|
[NSCharacterSet whitespaceAndNewlineCharacterSet]
|
||||||
intoString: &mainKey2];
|
intoString: &mainKey2];
|
||||||
|
|
||||||
if( ![constraint scanCharactersFromSet: newlineSet
|
if (![constraint scanCharactersFromSet: newlineSet
|
||||||
intoString: NULL])
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[constraint scanUpToCharactersFromSet:
|
[constraint scanUpToCharactersFromSet:
|
||||||
|
@ -1281,7 +1281,7 @@ static NSMutableDictionary* printerCache;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add to table
|
// Add to table
|
||||||
if( optionKey1 )
|
if (optionKey1)
|
||||||
mainKey1 = [mainKey1 stringByAppendingFormat: @"/%@", optionKey1];
|
mainKey1 = [mainKey1 stringByAppendingFormat: @"/%@", optionKey1];
|
||||||
|
|
||||||
[self addString: mainKey2
|
[self addString: mainKey2
|
||||||
|
@ -1305,7 +1305,7 @@ static NSMutableDictionary* printerCache;
|
||||||
NSString *optionKeyword = nil;
|
NSString *optionKeyword = nil;
|
||||||
|
|
||||||
// Order dependency should have no option keyword
|
// Order dependency should have no option keyword
|
||||||
if( ![dependency scanString: @":"
|
if (![dependency scanString: @":"
|
||||||
intoString: NULL])
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
[NSException raise: NSPPDParseException
|
[NSException raise: NSPPDParseException
|
||||||
|
@ -1326,7 +1326,7 @@ static NSMutableDictionary* printerCache;
|
||||||
[NSCharacterSet whitespaceAndNewlineCharacterSet]
|
[NSCharacterSet whitespaceAndNewlineCharacterSet]
|
||||||
intoString: &keyword];
|
intoString: &keyword];
|
||||||
|
|
||||||
if( ![dependency scanCharactersFromSet: newlineSet
|
if (![dependency scanCharactersFromSet: newlineSet
|
||||||
intoString: NULL])
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
// Optional keyword exists
|
// Optional keyword exists
|
||||||
|
@ -1340,7 +1340,7 @@ static NSMutableDictionary* printerCache;
|
||||||
intoString: NULL];
|
intoString: NULL];
|
||||||
|
|
||||||
// Add to table
|
// Add to table
|
||||||
if(optionKeyword)
|
if (optionKeyword)
|
||||||
keyword = [keyword stringByAppendingFormat: @"/%@", optionKeyword];
|
keyword = [keyword stringByAppendingFormat: @"/%@", optionKeyword];
|
||||||
|
|
||||||
[self addString: realValue
|
[self addString: realValue
|
||||||
|
@ -1366,14 +1366,14 @@ static NSMutableDictionary* printerCache;
|
||||||
forKey: key
|
forKey: key
|
||||||
inTable: @"PPD"];
|
inTable: @"PPD"];
|
||||||
|
|
||||||
if(valueTranslation)
|
if (valueTranslation)
|
||||||
{
|
{
|
||||||
[self addString: valueTranslation
|
[self addString: valueTranslation
|
||||||
forKey: key
|
forKey: key
|
||||||
inTable: @"PPDArgumentTranslation"];
|
inTable: @"PPDArgumentTranslation"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(optionTranslation)
|
if (optionTranslation)
|
||||||
{
|
{
|
||||||
[self addString: optionTranslation
|
[self addString: optionTranslation
|
||||||
forKey: key
|
forKey: key
|
||||||
|
@ -1396,12 +1396,12 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
tableObj = [_tables objectForKey: table];
|
tableObj = [_tables objectForKey: table];
|
||||||
|
|
||||||
if( tableObj == nil )
|
if (tableObj == nil)
|
||||||
NSDebugMLLog( @"GSPrinting", @"Could not find table %@!", table);
|
NSDebugMLLog(@"GSPrinting", @"Could not find table %@!", table);
|
||||||
|
|
||||||
array = (NSMutableArray*)[tableObj objectForKey:key];
|
array = (NSMutableArray*)[tableObj objectForKey:key];
|
||||||
|
|
||||||
if( array == nil ) //it does not exist, create it
|
if (array == nil) //it does not exist, create it
|
||||||
{
|
{
|
||||||
array = [NSMutableArray array];
|
array = [NSMutableArray array];
|
||||||
[tableObj setObject: array
|
[tableObj setObject: array
|
||||||
|
@ -1428,22 +1428,22 @@ static NSMutableDictionary* printerCache;
|
||||||
|
|
||||||
// Don't bother unless there's something to convert
|
// Don't bother unless there's something to convert
|
||||||
range = [qString rangeOfString: @"<"];
|
range = [qString rangeOfString: @"<"];
|
||||||
if( !range.length )
|
if (!range.length)
|
||||||
return qString;
|
return qString;
|
||||||
|
|
||||||
scanner = [NSScanner scannerWithString: qString];
|
scanner = [NSScanner scannerWithString: qString];
|
||||||
emptySet = [NSCharacterSet characterSetWithCharactersInString: @""];
|
emptySet = [NSCharacterSet characterSetWithCharactersInString: @""];
|
||||||
[scanner setCharactersToBeSkipped: emptySet];
|
[scanner setCharactersToBeSkipped: emptySet];
|
||||||
|
|
||||||
if( ![scanner scanUpToString: @"<"
|
if (![scanner scanUpToString: @"<"
|
||||||
intoString: &value] )
|
intoString: &value])
|
||||||
{
|
{
|
||||||
value = [NSString string];
|
value = [NSString string];
|
||||||
}
|
}
|
||||||
|
|
||||||
stringLength = [qString length];
|
stringLength = [qString length];
|
||||||
|
|
||||||
while ( ![scanner isAtEnd] )
|
while (![scanner isAtEnd])
|
||||||
{
|
{
|
||||||
[scanner scanString: @"<"
|
[scanner scanString: @"<"
|
||||||
intoString: NULL];
|
intoString: NULL];
|
||||||
|
@ -1451,11 +1451,11 @@ static NSMutableDictionary* printerCache;
|
||||||
[scanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]
|
[scanner scanCharactersFromSet: [NSCharacterSet whitespaceAndNewlineCharacterSet]
|
||||||
intoString: NULL];
|
intoString: NULL];
|
||||||
|
|
||||||
while( ![scanner scanString: @">"
|
while (![scanner scanString: @">"
|
||||||
intoString: NULL])
|
intoString: NULL])
|
||||||
{
|
{
|
||||||
location = [scanner scanLocation];
|
location = [scanner scanLocation];
|
||||||
if( location+2 > stringLength )
|
if (location+2 > stringLength)
|
||||||
{
|
{
|
||||||
[NSException raise: NSPPDParseException
|
[NSException raise: NSPPDParseException
|
||||||
format: @"Badly formatted hexadecimal substring in \
|
format: @"Badly formatted hexadecimal substring in \
|
||||||
|
@ -1472,7 +1472,7 @@ static NSMutableDictionary* printerCache;
|
||||||
intoString: NULL];
|
intoString: NULL];
|
||||||
}
|
}
|
||||||
|
|
||||||
if([scanner scanUpToString:@"<" intoString:&part])
|
if ([scanner scanUpToString:@"<" intoString:&part])
|
||||||
{
|
{
|
||||||
value = [value stringByAppendingString: part];
|
value = [value stringByAppendingString: part];
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,7 @@
|
||||||
|
|
||||||
- (void) helpRequested: (NSEvent*)theEvent
|
- (void) helpRequested: (NSEvent*)theEvent
|
||||||
{
|
{
|
||||||
if(![[NSHelpManager sharedHelpManager]
|
if (![[NSHelpManager sharedHelpManager]
|
||||||
showContextHelpForObject: self
|
showContextHelpForObject: self
|
||||||
locationHint: [theEvent locationInWindow]])
|
locationHint: [theEvent locationInWindow]])
|
||||||
if (_next_responder)
|
if (_next_responder)
|
||||||
|
@ -338,20 +338,20 @@
|
||||||
*/
|
*/
|
||||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
if([aCoder allowsKeyedCoding])
|
if ([aCoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
if(_interface_style != NSNoInterfaceStyle)
|
if (_interface_style != NSNoInterfaceStyle)
|
||||||
{
|
{
|
||||||
[aCoder encodeInt: _interface_style
|
[aCoder encodeInt: _interface_style
|
||||||
forKey: @"NSInterfaceStyle"];
|
forKey: @"NSInterfaceStyle"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if([self menu] != nil)
|
if ([self menu] != nil)
|
||||||
{
|
{
|
||||||
[aCoder encodeObject: [self menu]
|
[aCoder encodeObject: [self menu]
|
||||||
forKey: @"NSMenu"];
|
forKey: @"NSMenu"];
|
||||||
}
|
}
|
||||||
if([self nextResponder] != nil)
|
if ([self nextResponder] != nil)
|
||||||
{
|
{
|
||||||
[aCoder encodeConditionalObject: [self nextResponder]
|
[aCoder encodeConditionalObject: [self nextResponder]
|
||||||
forKey: @"NSNextResponder"];
|
forKey: @"NSNextResponder"];
|
||||||
|
@ -369,19 +369,19 @@
|
||||||
{
|
{
|
||||||
id obj = nil;
|
id obj = nil;
|
||||||
|
|
||||||
if([aDecoder allowsKeyedCoding])
|
if ([aDecoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
if([aDecoder containsValueForKey: @"NSInterfaceStyle"])
|
if ([aDecoder containsValueForKey: @"NSInterfaceStyle"])
|
||||||
{
|
{
|
||||||
_interface_style = [aDecoder decodeIntForKey: @"NSInterfaceStyle"];
|
_interface_style = [aDecoder decodeIntForKey: @"NSInterfaceStyle"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if([aDecoder containsValueForKey: @"NSMenu"])
|
if ([aDecoder containsValueForKey: @"NSMenu"])
|
||||||
{
|
{
|
||||||
obj = [aDecoder decodeObjectForKey: @"NSMenu"];
|
obj = [aDecoder decodeObjectForKey: @"NSMenu"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if([aDecoder containsValueForKey: @"NSNextResponder"])
|
if ([aDecoder containsValueForKey: @"NSNextResponder"])
|
||||||
{
|
{
|
||||||
[self setNextResponder: [aDecoder decodeObjectForKey: @"NSNextResponder"]];
|
[self setNextResponder: [aDecoder decodeObjectForKey: @"NSNextResponder"]];
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,7 +466,7 @@ static NSMutableDictionary *units = nil;
|
||||||
/* test markers in reverse order so that markers drawn on top
|
/* test markers in reverse order so that markers drawn on top
|
||||||
are tested before those underneath */
|
are tested before those underneath */
|
||||||
markerEnum = [_markers reverseObjectEnumerator];
|
markerEnum = [_markers reverseObjectEnumerator];
|
||||||
while ( (marker = [markerEnum nextObject]) != nil)
|
while ((marker = [markerEnum nextObject]) != nil)
|
||||||
{
|
{
|
||||||
if (NSMouseInRect (point, [marker imageRectInRuler], flipped))
|
if (NSMouseInRect (point, [marker imageRectInRuler], flipped))
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,7 +109,7 @@ typedef enum
|
||||||
//
|
//
|
||||||
+ (NSSelection *)allSelection
|
+ (NSSelection *)allSelection
|
||||||
{
|
{
|
||||||
if(!_sharedAllSelection)
|
if (!_sharedAllSelection)
|
||||||
{
|
{
|
||||||
_sharedAllSelection =
|
_sharedAllSelection =
|
||||||
[NSSelection _wellKnownSelection: "GNUstep All selection marker"];
|
[NSSelection _wellKnownSelection: "GNUstep All selection marker"];
|
||||||
|
@ -120,7 +120,7 @@ typedef enum
|
||||||
|
|
||||||
+ (NSSelection *)currentSelection
|
+ (NSSelection *)currentSelection
|
||||||
{
|
{
|
||||||
if(!_sharedCurrentSelection)
|
if (!_sharedCurrentSelection)
|
||||||
{
|
{
|
||||||
_sharedCurrentSelection =
|
_sharedCurrentSelection =
|
||||||
[NSSelection _wellKnownSelection: "GNUstep Current selection marker"];
|
[NSSelection _wellKnownSelection: "GNUstep Current selection marker"];
|
||||||
|
@ -131,7 +131,7 @@ typedef enum
|
||||||
|
|
||||||
+ (NSSelection *)emptySelection
|
+ (NSSelection *)emptySelection
|
||||||
{
|
{
|
||||||
if(!_sharedEmptySelection)
|
if (!_sharedEmptySelection)
|
||||||
{
|
{
|
||||||
_sharedEmptySelection =
|
_sharedEmptySelection =
|
||||||
[NSSelection _wellKnownSelection: "GNUstep Empty selection marker"];
|
[NSSelection _wellKnownSelection: "GNUstep Empty selection marker"];
|
||||||
|
@ -230,7 +230,7 @@ typedef enum
|
||||||
at: _descriptionData];
|
at: _descriptionData];
|
||||||
|
|
||||||
// if it's a well known selection then determine which one it is.
|
// if it's a well known selection then determine which one it is.
|
||||||
if(_isWellKnownSelection)
|
if (_isWellKnownSelection)
|
||||||
{
|
{
|
||||||
switch(_selectionType)
|
switch(_selectionType)
|
||||||
{
|
{
|
||||||
|
|
|
@ -162,7 +162,7 @@ static int __documentTag = 0;
|
||||||
+ (NSSpellChecker *)sharedSpellChecker
|
+ (NSSpellChecker *)sharedSpellChecker
|
||||||
{
|
{
|
||||||
// Create the shared instance.
|
// Create the shared instance.
|
||||||
if(__sharedSpellChecker == nil)
|
if (__sharedSpellChecker == nil)
|
||||||
{
|
{
|
||||||
__sharedSpellChecker = [[NSSpellChecker alloc] init];
|
__sharedSpellChecker = [[NSSpellChecker alloc] init];
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ static int __documentTag = 0;
|
||||||
// Start the service for this language
|
// Start the service for this language
|
||||||
proxy = [[NSApp _listener] _launchSpellCheckerForLanguage: language];
|
proxy = [[NSApp _listener] _launchSpellCheckerForLanguage: language];
|
||||||
|
|
||||||
if(proxy == nil)
|
if (proxy == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"Failed to get the spellserver");
|
NSLog(@"Failed to get the spellserver");
|
||||||
}
|
}
|
||||||
|
@ -217,12 +217,12 @@ static int __documentTag = 0;
|
||||||
|
|
||||||
- (id)_serverProxy
|
- (id)_serverProxy
|
||||||
{
|
{
|
||||||
if(_serverProxy == nil)
|
if (_serverProxy == nil)
|
||||||
{
|
{
|
||||||
// Start the server and retain the reference to the
|
// Start the server and retain the reference to the
|
||||||
// proxy.
|
// proxy.
|
||||||
id<NSSpellServerPrivateProtocol> proxy = [self _startServerForLanguage: _language];
|
id<NSSpellServerPrivateProtocol> proxy = [self _startServerForLanguage: _language];
|
||||||
if(proxy != nil)
|
if (proxy != nil)
|
||||||
{
|
{
|
||||||
_serverProxy = proxy;
|
_serverProxy = proxy;
|
||||||
RETAIN(_serverProxy);
|
RETAIN(_serverProxy);
|
||||||
|
@ -271,7 +271,7 @@ static int __documentTag = 0;
|
||||||
// Load the gmodel file
|
// Load the gmodel file
|
||||||
panel = [GSGuiBundle() pathForResource: @"GSSpellPanel" ofType: @"gorm"
|
panel = [GSGuiBundle() pathForResource: @"GSSpellPanel" ofType: @"gorm"
|
||||||
inDirectory: nil];
|
inDirectory: nil];
|
||||||
if(![NSBundle loadNibFile: panel
|
if (![NSBundle loadNibFile: panel
|
||||||
externalNameTable: [NSDictionary dictionaryWithObject: self forKey: @"NSOwner"]
|
externalNameTable: [NSDictionary dictionaryWithObject: self forKey: @"NSOwner"]
|
||||||
withZone: [self zone]])
|
withZone: [self zone]])
|
||||||
{
|
{
|
||||||
|
@ -357,13 +357,13 @@ static int __documentTag = 0;
|
||||||
|
|
||||||
_currentTag = tag;
|
_currentTag = tag;
|
||||||
// We have no string to work with
|
// We have no string to work with
|
||||||
if(stringToCheck == nil)
|
if (stringToCheck == nil)
|
||||||
{
|
{
|
||||||
return NSMakeRange(0,0);
|
return NSMakeRange(0,0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// The string is zero length
|
// The string is zero length
|
||||||
if([stringToCheck length] == 0)
|
if ([stringToCheck length] == 0)
|
||||||
{
|
{
|
||||||
return NSMakeRange(0,0);
|
return NSMakeRange(0,0);
|
||||||
}
|
}
|
||||||
|
@ -385,14 +385,14 @@ static int __documentTag = 0;
|
||||||
wordCount: wordCount
|
wordCount: wordCount
|
||||||
countOnly: NO];
|
countOnly: NO];
|
||||||
|
|
||||||
if(r.length != 0)
|
if (r.length != 0)
|
||||||
{
|
{
|
||||||
// Adjust results relative to the original string
|
// Adjust results relative to the original string
|
||||||
r.location += startingOffset;
|
r.location += startingOffset;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(wrapFlag)
|
if (wrapFlag)
|
||||||
{
|
{
|
||||||
// Check the second half of the string
|
// Check the second half of the string
|
||||||
NSString *firstHalfOfString = [stringToCheck
|
NSString *firstHalfOfString = [stringToCheck
|
||||||
|
@ -449,7 +449,7 @@ static int __documentTag = 0;
|
||||||
BOOL result = NO;
|
BOOL result = NO;
|
||||||
|
|
||||||
index = [_dictionaryPulldown indexOfItemWithTitle: aLanguage];
|
index = [_dictionaryPulldown indexOfItemWithTitle: aLanguage];
|
||||||
if(index != -1)
|
if (index != -1)
|
||||||
{
|
{
|
||||||
[_dictionaryPulldown selectItemAtIndex: index];
|
[_dictionaryPulldown selectItemAtIndex: index];
|
||||||
result = YES;
|
result = YES;
|
||||||
|
@ -477,10 +477,10 @@ inSpellDocumentWithTag:(int)tag
|
||||||
NSNumber *key = [NSNumber numberWithInt: tag];
|
NSNumber *key = [NSNumber numberWithInt: tag];
|
||||||
NSMutableSet *words = [_ignoredWords objectForKey: key];
|
NSMutableSet *words = [_ignoredWords objectForKey: key];
|
||||||
|
|
||||||
if(![wordToIgnore isEqualToString: @""])
|
if (![wordToIgnore isEqualToString: @""])
|
||||||
{
|
{
|
||||||
// If there is a dictionary add to it, if not create one.
|
// If there is a dictionary add to it, if not create one.
|
||||||
if(words == nil)
|
if (words == nil)
|
||||||
{
|
{
|
||||||
words = [NSMutableSet setWithObject: wordToIgnore];
|
words = [NSMutableSet setWithObject: wordToIgnore];
|
||||||
[_ignoredWords setObject: words forKey: key];
|
[_ignoredWords setObject: words forKey: key];
|
||||||
|
@ -536,7 +536,7 @@ inSpellDocumentWithTag:(int)tag
|
||||||
to: nil
|
to: nil
|
||||||
from: _spellPanel];
|
from: _spellPanel];
|
||||||
|
|
||||||
if(!processed)
|
if (!processed)
|
||||||
{
|
{
|
||||||
NSLog(@"No responder found");
|
NSLog(@"No responder found");
|
||||||
}
|
}
|
||||||
|
@ -595,7 +595,7 @@ inSpellDocumentWithTag:(int)tag
|
||||||
to: nil
|
to: nil
|
||||||
from: _wordField];
|
from: _wordField];
|
||||||
|
|
||||||
if(!processed)
|
if (!processed)
|
||||||
{
|
{
|
||||||
NSLog(@"_ignore: No responder found");
|
NSLog(@"_ignore: No responder found");
|
||||||
}
|
}
|
||||||
|
@ -618,7 +618,7 @@ inSpellDocumentWithTag:(int)tag
|
||||||
to: nil
|
to: nil
|
||||||
from: _wordField];
|
from: _wordField];
|
||||||
|
|
||||||
if(!processed)
|
if (!processed)
|
||||||
{
|
{
|
||||||
NSLog(@"No responder found");
|
NSLog(@"No responder found");
|
||||||
}
|
}
|
||||||
|
@ -634,11 +634,11 @@ inSpellDocumentWithTag:(int)tag
|
||||||
|
|
||||||
// Start the service for this language
|
// Start the service for this language
|
||||||
language = [_dictionaryPulldown stringValue];
|
language = [_dictionaryPulldown stringValue];
|
||||||
if(![language isEqualToString: _language])
|
if (![language isEqualToString: _language])
|
||||||
{
|
{
|
||||||
NSLog(@"Language = %@",language);
|
NSLog(@"Language = %@",language);
|
||||||
proxy = [self _startServerForLanguage: language];
|
proxy = [self _startServerForLanguage: language];
|
||||||
if(proxy != nil)
|
if (proxy != nil)
|
||||||
{
|
{
|
||||||
ASSIGN(_language, language);
|
ASSIGN(_language, language);
|
||||||
ASSIGN(_serverProxy, proxy);
|
ASSIGN(_serverProxy, proxy);
|
||||||
|
@ -716,7 +716,7 @@ inSpellDocumentWithTag:(int)tag
|
||||||
NSBrowserCell *cell= nil;
|
NSBrowserCell *cell= nil;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while((word = [e nextObject]) != nil)
|
while ((word = [e nextObject]) != nil)
|
||||||
{
|
{
|
||||||
[matrix insertRow: i withCells: nil];
|
[matrix insertRow: i withCells: nil];
|
||||||
cell = [matrix cellAtRow: i column: 0];
|
cell = [matrix cellAtRow: i column: 0];
|
||||||
|
|
|
@ -49,7 +49,7 @@ GSSpellServerName(NSString *vendor, NSString *language)
|
||||||
{
|
{
|
||||||
NSString *serverName = nil;
|
NSString *serverName = nil;
|
||||||
|
|
||||||
if(language == nil || vendor == nil)
|
if (language == nil || vendor == nil)
|
||||||
{
|
{
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
@ -111,13 +111,13 @@ GSSpellServerName(NSString *vendor, NSString *language)
|
||||||
NSConnection *connection = nil;
|
NSConnection *connection = nil;
|
||||||
BOOL result = NO;
|
BOOL result = NO;
|
||||||
|
|
||||||
if(serverName == nil)
|
if (serverName == nil)
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
connection = [[NSConnection alloc] init];
|
connection = [[NSConnection alloc] init];
|
||||||
if(connection)
|
if (connection)
|
||||||
{
|
{
|
||||||
RETAIN(connection);
|
RETAIN(connection);
|
||||||
[connection setRootObject: self];
|
[connection setRootObject: self];
|
||||||
|
@ -188,12 +188,12 @@ GSSpellServerName(NSString *vendor, NSString *language)
|
||||||
|
|
||||||
if (![mgr fileExistsAtPath: path ])
|
if (![mgr fileExistsAtPath: path ])
|
||||||
{
|
{
|
||||||
if([mgr fileExistsAtPath: dirPath])
|
if ([mgr fileExistsAtPath: dirPath])
|
||||||
{
|
{
|
||||||
// The directory exists create the file.
|
// The directory exists create the file.
|
||||||
NSArray *emptyDict = [NSArray array];
|
NSArray *emptyDict = [NSArray array];
|
||||||
|
|
||||||
if(![emptyDict writeToFile: path atomically: YES])
|
if (![emptyDict writeToFile: path atomically: YES])
|
||||||
{
|
{
|
||||||
NSLog(@"Failed to create %@",path);
|
NSLog(@"Failed to create %@",path);
|
||||||
path = nil;
|
path = nil;
|
||||||
|
@ -202,12 +202,12 @@ GSSpellServerName(NSString *vendor, NSString *language)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// The directory does not exist create it.
|
// The directory does not exist create it.
|
||||||
if([mgr createDirectoryAtPath: dirPath attributes: nil])
|
if ([mgr createDirectoryAtPath: dirPath attributes: nil])
|
||||||
{
|
{
|
||||||
// Directory created. Now create the empty file.
|
// Directory created. Now create the empty file.
|
||||||
NSArray *emptyDict = [NSArray array];
|
NSArray *emptyDict = [NSArray array];
|
||||||
|
|
||||||
if(![emptyDict writeToFile: path atomically: YES])
|
if (![emptyDict writeToFile: path atomically: YES])
|
||||||
{
|
{
|
||||||
NSLog(@"Failed to create %@",path);
|
NSLog(@"Failed to create %@",path);
|
||||||
path = nil;
|
path = nil;
|
||||||
|
@ -232,12 +232,12 @@ GSSpellServerName(NSString *vendor, NSString *language)
|
||||||
NSString *path = nil;
|
NSString *path = nil;
|
||||||
NSMutableSet *words = nil;
|
NSMutableSet *words = nil;
|
||||||
|
|
||||||
if((words = [_userDictionaries objectForKey: language]) == nil)
|
if ((words = [_userDictionaries objectForKey: language]) == nil)
|
||||||
{
|
{
|
||||||
if((path = [self _pathToDictionary: language]) != nil)
|
if ((path = [self _pathToDictionary: language]) != nil)
|
||||||
{
|
{
|
||||||
NSArray *wordarray = [NSArray arrayWithContentsOfFile: path];
|
NSArray *wordarray = [NSArray arrayWithContentsOfFile: path];
|
||||||
if(wordarray == nil)
|
if (wordarray == nil)
|
||||||
{
|
{
|
||||||
NSLog(@"Unable to load user dictionary from path %@",path);
|
NSLog(@"Unable to load user dictionary from path %@",path);
|
||||||
}
|
}
|
||||||
|
@ -268,23 +268,23 @@ GSSpellServerName(NSString *vendor, NSString *language)
|
||||||
NSEnumerator *setEnumerator = nil;
|
NSEnumerator *setEnumerator = nil;
|
||||||
|
|
||||||
// Catch the odd cases before they start trouble later on...
|
// Catch the odd cases before they start trouble later on...
|
||||||
if(word == nil || dict == nil)
|
if (word == nil || dict == nil)
|
||||||
{
|
{
|
||||||
return NO; // avoid checking, if NIL.
|
return NO; // avoid checking, if NIL.
|
||||||
}
|
}
|
||||||
|
|
||||||
if([word length] == 0 || [dict count] == 0)
|
if ([word length] == 0 || [dict count] == 0)
|
||||||
{
|
{
|
||||||
return NO; // avoid checking, if has no length.
|
return NO; // avoid checking, if has no length.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the dictionary for the word...
|
// Check the dictionary for the word...
|
||||||
setEnumerator = [dict objectEnumerator];
|
setEnumerator = [dict objectEnumerator];
|
||||||
while((dictWord = [setEnumerator nextObject]) && result == NO)
|
while ((dictWord = [setEnumerator nextObject]) && result == NO)
|
||||||
{
|
{
|
||||||
// If the case is important then uppercase both strings
|
// If the case is important then uppercase both strings
|
||||||
// and compare, otherwise do the comparison.
|
// and compare, otherwise do the comparison.
|
||||||
if(flag == NO)
|
if (flag == NO)
|
||||||
{
|
{
|
||||||
NSString *upperWord = [word uppercaseString];
|
NSString *upperWord = [word uppercaseString];
|
||||||
NSString *upperDictWord = [dictWord uppercaseString];
|
NSString *upperDictWord = [dictWord uppercaseString];
|
||||||
|
@ -297,16 +297,16 @@ GSSpellServerName(NSString *vendor, NSString *language)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result == NO && _ignoredWords)
|
if (result == NO && _ignoredWords)
|
||||||
{
|
{
|
||||||
NSEnumerator *arrayEnumerator = [_ignoredWords objectEnumerator];
|
NSEnumerator *arrayEnumerator = [_ignoredWords objectEnumerator];
|
||||||
NSString *iword = nil;
|
NSString *iword = nil;
|
||||||
|
|
||||||
while((iword = [arrayEnumerator nextObject]) && result == NO)
|
while ((iword = [arrayEnumerator nextObject]) && result == NO)
|
||||||
{
|
{
|
||||||
// If the case is important then uppercase both strings
|
// If the case is important then uppercase both strings
|
||||||
// and compare, otherwise do the comparison.
|
// and compare, otherwise do the comparison.
|
||||||
if(flag == NO)
|
if (flag == NO)
|
||||||
{
|
{
|
||||||
NSString *upperWord = [word uppercaseString];
|
NSString *upperWord = [word uppercaseString];
|
||||||
NSString *upperIWord = [iword uppercaseString];
|
NSString *upperIWord = [iword uppercaseString];
|
||||||
|
@ -334,7 +334,7 @@ is a set of words learned by the spell service for that particular user.
|
||||||
NSSet *userDict = [self _openUserDictionary: _currentLanguage];
|
NSSet *userDict = [self _openUserDictionary: _currentLanguage];
|
||||||
BOOL result = NO;
|
BOOL result = NO;
|
||||||
|
|
||||||
if(userDict)
|
if (userDict)
|
||||||
{
|
{
|
||||||
result = [self _isWord: word
|
result = [self _isWord: word
|
||||||
inDictionary: userDict
|
inDictionary: userDict
|
||||||
|
@ -349,10 +349,10 @@ is a set of words learned by the spell service for that particular user.
|
||||||
{
|
{
|
||||||
NSString *path = nil;
|
NSString *path = nil;
|
||||||
|
|
||||||
if((path = [self _pathToDictionary: language]) != nil)
|
if ((path = [self _pathToDictionary: language]) != nil)
|
||||||
{
|
{
|
||||||
NSMutableSet *set = [_userDictionaries objectForKey: language];
|
NSMutableSet *set = [_userDictionaries objectForKey: language];
|
||||||
if(![[set allObjects] writeToFile: path atomically: YES])
|
if (![[set allObjects] writeToFile: path atomically: YES])
|
||||||
{
|
{
|
||||||
NSLog(@"Unable to save dictionary to path %@",path);
|
NSLog(@"Unable to save dictionary to path %@",path);
|
||||||
return NO;
|
return NO;
|
||||||
|
|
|
@ -514,7 +514,7 @@ static NSNotificationCenter *nc = nil;
|
||||||
inMode: NSEventTrackingRunLoopMode
|
inMode: NSEventTrackingRunLoopMode
|
||||||
dequeue: YES];
|
dequeue: YES];
|
||||||
}
|
}
|
||||||
while(ee != nil);
|
while (ee != nil);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -883,7 +883,7 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
|
||||||
#define SET_DELEGATE_NOTIFICATION(notif_name) \
|
#define SET_DELEGATE_NOTIFICATION(notif_name) \
|
||||||
if ([_delegate respondsToSelector: @selector(splitView##notif_name:)]) \
|
if ([_delegate respondsToSelector: @selector(splitView##notif_name:)]) \
|
||||||
[nc addObserver: _delegate \
|
[nc addObserver: _delegate \
|
||||||
selector: @selector(splitView##notif_name: ) \
|
selector: @selector(splitView##notif_name:) \
|
||||||
name: NSSplitView##notif_name##Notification \
|
name: NSSplitView##notif_name##Notification \
|
||||||
object: self]
|
object: self]
|
||||||
|
|
||||||
|
|
|
@ -172,10 +172,10 @@ id _nsstepperCellClass = nil;
|
||||||
BOOL isDirectionUp;
|
BOOL isDirectionUp;
|
||||||
BOOL autorepeat = [_cell autorepeat];
|
BOOL autorepeat = [_cell autorepeat];
|
||||||
|
|
||||||
if([_cell isEnabled] == NO)
|
if ([_cell isEnabled] == NO)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if([event type] != NSLeftMouseDown)
|
if ([event type] != NSLeftMouseDown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
upRect = [_cell upButtonRectWithFrame: _bounds];
|
upRect = [_cell upButtonRectWithFrame: _bounds];
|
||||||
|
@ -232,7 +232,7 @@ id _nsstepperCellClass = nil;
|
||||||
untilDate: farAway
|
untilDate: farAway
|
||||||
inMode: NSEventTrackingRunLoopMode
|
inMode: NSEventTrackingRunLoopMode
|
||||||
dequeue: YES];
|
dequeue: YES];
|
||||||
while([event type] != NSLeftMouseUp)
|
while ([event type] != NSLeftMouseUp)
|
||||||
{
|
{
|
||||||
if ([event type] == NSPeriodic)
|
if ([event type] == NSPeriodic)
|
||||||
{
|
{
|
||||||
|
|
|
@ -667,7 +667,7 @@
|
||||||
{
|
{
|
||||||
NSTabViewItem *anItem = [_items objectAtIndex: i];
|
NSTabViewItem *anItem = [_items objectAtIndex: i];
|
||||||
|
|
||||||
if(NSPointInRect(point,[anItem _tabRect]))
|
if (NSPointInRect(point,[anItem _tabRect]))
|
||||||
return anItem;
|
return anItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,10 +142,10 @@ void quick_sort_internal(columnSorting *data, int p, int r)
|
||||||
int i = p - 1;
|
int i = p - 1;
|
||||||
int j = r + 1;
|
int j = r + 1;
|
||||||
columnSorting exchange;
|
columnSorting exchange;
|
||||||
while(1)
|
while (1)
|
||||||
{
|
{
|
||||||
j--;
|
j--;
|
||||||
for(;
|
for (;
|
||||||
(data[j].width > x)
|
(data[j].width > x)
|
||||||
|| ((data[j].width == x)
|
|| ((data[j].width == x)
|
||||||
&& (data[j].isMax == YES)
|
&& (data[j].isMax == YES)
|
||||||
|
@ -154,14 +154,14 @@ void quick_sort_internal(columnSorting *data, int p, int r)
|
||||||
;
|
;
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
for(;
|
for (;
|
||||||
(data[i].width < x)
|
(data[i].width < x)
|
||||||
|| ((data[i].width == x)
|
|| ((data[i].width == x)
|
||||||
&& (data[i].isMax == NO)
|
&& (data[i].isMax == NO)
|
||||||
&& (y == YES));
|
&& (y == YES));
|
||||||
i++)
|
i++)
|
||||||
;
|
;
|
||||||
if ( i < j )
|
if (i < j)
|
||||||
{
|
{
|
||||||
exchange = data[j];
|
exchange = data[j];
|
||||||
data[j] = data[i];
|
data[j] = data[i];
|
||||||
|
@ -572,10 +572,10 @@ static void computeNewSelection
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( (selectionMode & ALLOWS_MULTIPLE)
|
else if ((selectionMode & ALLOWS_MULTIPLE)
|
||||||
&& ((selectionMode & SHIFT_DOWN) == 0)
|
&& ((selectionMode & SHIFT_DOWN) == 0)
|
||||||
&& (selectionMode & ALLOWS_EMPTY)
|
&& (selectionMode & ALLOWS_EMPTY)
|
||||||
)
|
)
|
||||||
// ic, sr : ok
|
// ic, sr : ok
|
||||||
// new multiple selection (empty possible)
|
// new multiple selection (empty possible)
|
||||||
{
|
{
|
||||||
|
@ -804,7 +804,7 @@ static void computeNewSelection
|
||||||
&& ((selectionMode & SHIFT_DOWN) == 0)
|
&& ((selectionMode & SHIFT_DOWN) == 0)
|
||||||
&& ((selectionMode & ALLOWS_EMPTY) == 0)
|
&& ((selectionMode & ALLOWS_EMPTY) == 0)
|
||||||
&& ((selectionMode & ADDING_ROW) == 0))
|
&& ((selectionMode & ADDING_ROW) == 0))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (_oldRow == -1)
|
if (_oldRow == -1)
|
||||||
{
|
{
|
||||||
|
@ -1297,7 +1297,7 @@ static void computeNewSelection
|
||||||
notified = YES;
|
notified = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow >= _originalRow)
|
&& (*_selectedRow >= _originalRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1323,7 +1323,7 @@ static void computeNewSelection
|
||||||
notified = YES;
|
notified = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow >= _originalRow)
|
&& (*_selectedRow >= _originalRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1364,7 +1364,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow > _oldRow)
|
&& (*_selectedRow > _oldRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1422,7 +1422,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow < _oldRow)
|
&& (*_selectedRow < _oldRow)
|
||||||
&& (*_selectedRow >= _currentRow))
|
&& (*_selectedRow >= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1499,7 +1499,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow > _oldRow)
|
&& (*_selectedRow > _oldRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1551,7 +1551,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow > _oldRow)
|
&& (*_selectedRow > _oldRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1597,7 +1597,7 @@ static void computeNewSelection
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow >= _originalRow)
|
&& (*_selectedRow >= _originalRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1625,7 +1625,7 @@ static void computeNewSelection
|
||||||
count--;
|
count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow >= _originalRow)
|
&& (*_selectedRow >= _originalRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1668,7 +1668,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow > _oldRow)
|
&& (*_selectedRow > _oldRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1728,7 +1728,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow < _oldRow)
|
&& (*_selectedRow < _oldRow)
|
||||||
&& (*_selectedRow >= _currentRow))
|
&& (*_selectedRow >= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1806,7 +1806,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow > _oldRow)
|
&& (*_selectedRow > _oldRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -1859,7 +1859,7 @@ static void computeNewSelection
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( notified
|
if (notified
|
||||||
&& (*_selectedRow > _oldRow)
|
&& (*_selectedRow > _oldRow)
|
||||||
&& (*_selectedRow <= _currentRow))
|
&& (*_selectedRow <= _currentRow))
|
||||||
{
|
{
|
||||||
|
@ -4104,7 +4104,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
remainingWidth -=
|
remainingWidth -=
|
||||||
(nextPoint - previousPoint) * numberOfCurrentColumns;
|
(nextPoint - previousPoint) * numberOfCurrentColumns;
|
||||||
|
|
||||||
for(j = 0; j < _numberOfColumns; j++)
|
for (j = 0; j < _numberOfColumns; j++)
|
||||||
{
|
{
|
||||||
if (minWidth[j] <= previousPoint
|
if (minWidth[j] <= previousPoint
|
||||||
&& maxWidth[j] >= nextPoint)
|
&& maxWidth[j] >= nextPoint)
|
||||||
|
@ -4125,7 +4125,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
int remainder = remainingInt - quotient * numberOfCurrentColumns;
|
int remainder = remainingInt - quotient * numberOfCurrentColumns;
|
||||||
int oldRemainder = remainder;
|
int oldRemainder = remainder;
|
||||||
|
|
||||||
for(j = _numberOfColumns - 1; j >= 0; j--)
|
for (j = _numberOfColumns - 1; j >= 0; j--)
|
||||||
{
|
{
|
||||||
if (minWidth[j] <= previousPoint
|
if (minWidth[j] <= previousPoint
|
||||||
&& maxWidth[j] >= nextPoint)
|
&& maxWidth[j] >= nextPoint)
|
||||||
|
@ -4142,7 +4142,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
while (oldRemainder > remainder && remainder > 0)
|
while (oldRemainder > remainder && remainder > 0)
|
||||||
{
|
{
|
||||||
oldRemainder = remainder;
|
oldRemainder = remainder;
|
||||||
for(j = 0; j < _numberOfColumns; j++)
|
for (j = 0; j < _numberOfColumns; j++)
|
||||||
{
|
{
|
||||||
if (minWidth[j] <= previousPoint
|
if (minWidth[j] <= previousPoint
|
||||||
&& maxWidth[j] >= nextPoint)
|
&& maxWidth[j] >= nextPoint)
|
||||||
|
@ -4865,14 +4865,14 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
// Send action ?
|
// Send action ?
|
||||||
break;
|
break;
|
||||||
case NSTabTextMovement:
|
case NSTabTextMovement:
|
||||||
if([self _editNextEditableCellAfterRow: row column: column] == YES)
|
if ([self _editNextEditableCellAfterRow: row column: column] == YES)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
[_window selectKeyViewFollowingView: self];
|
[_window selectKeyViewFollowingView: self];
|
||||||
break;
|
break;
|
||||||
case NSBacktabTextMovement:
|
case NSBacktabTextMovement:
|
||||||
if([self _editPreviousEditableCellBeforeRow: row column: column] == YES)
|
if ([self _editPreviousEditableCellBeforeRow: row column: column] == YES)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -5478,7 +5478,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
fromView: _super_view].size.width;
|
fromView: _super_view].size.width;
|
||||||
float table_width = 0;
|
float table_width = 0;
|
||||||
|
|
||||||
if(_numberOfColumns > 0)
|
if (_numberOfColumns > 0)
|
||||||
{
|
{
|
||||||
table_width =
|
table_width =
|
||||||
_columnOrigins[_numberOfColumns - 1] +
|
_columnOrigins[_numberOfColumns - 1] +
|
||||||
|
@ -5496,20 +5496,20 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
NSLog(@"_superview_width %f", _superview_width);
|
NSLog(@"_superview_width %f", _superview_width);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( table_width - _superview_width <= 0.001
|
if (table_width - _superview_width <= 0.001
|
||||||
&& table_width - _superview_width >= -0.001 )
|
&& table_width - _superview_width >= -0.001)
|
||||||
{
|
{
|
||||||
// the last column had been sized to fit
|
// the last column had been sized to fit
|
||||||
[self sizeToFit];
|
[self sizeToFit];
|
||||||
}
|
}
|
||||||
else if ( table_width <= _superview_width
|
else if (table_width <= _superview_width
|
||||||
&& table_width >= visible_width )
|
&& table_width >= visible_width)
|
||||||
{
|
{
|
||||||
// the tableView was too small and is now too large
|
// the tableView was too small and is now too large
|
||||||
[self sizeToFit];
|
[self sizeToFit];
|
||||||
}
|
}
|
||||||
else if (table_width >= _superview_width
|
else if (table_width >= _superview_width
|
||||||
&& table_width <= visible_width )
|
&& table_width <= visible_width)
|
||||||
{
|
{
|
||||||
// the tableView was too large and is now too small
|
// the tableView was too large and is now too small
|
||||||
if (_numberOfColumns > 0)
|
if (_numberOfColumns > 0)
|
||||||
|
@ -5524,7 +5524,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
fromView: _super_view].size.width;
|
fromView: _super_view].size.width;
|
||||||
float table_width = 0;
|
float table_width = 0;
|
||||||
|
|
||||||
if(_numberOfColumns > 0)
|
if (_numberOfColumns > 0)
|
||||||
{
|
{
|
||||||
table_width =
|
table_width =
|
||||||
_columnOrigins[_numberOfColumns - 1] +
|
_columnOrigins[_numberOfColumns - 1] +
|
||||||
|
@ -5542,20 +5542,20 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
NSLog(@"_superview_width %f", _superview_width);
|
NSLog(@"_superview_width %f", _superview_width);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( table_width - _superview_width <= 0.001
|
if (table_width - _superview_width <= 0.001
|
||||||
&& table_width - _superview_width >= -0.001 )
|
&& table_width - _superview_width >= -0.001)
|
||||||
{
|
{
|
||||||
// the last column had been sized to fit
|
// the last column had been sized to fit
|
||||||
[self sizeLastColumnToFit];
|
[self sizeLastColumnToFit];
|
||||||
}
|
}
|
||||||
else if ( table_width <= _superview_width
|
else if (table_width <= _superview_width
|
||||||
&& table_width >= visible_width )
|
&& table_width >= visible_width)
|
||||||
{
|
{
|
||||||
// the tableView was too small and is now too large
|
// the tableView was too small and is now too large
|
||||||
[self sizeLastColumnToFit];
|
[self sizeLastColumnToFit];
|
||||||
}
|
}
|
||||||
else if (table_width >= _superview_width
|
else if (table_width >= _superview_width
|
||||||
&& table_width <= visible_width )
|
&& table_width <= visible_width)
|
||||||
{
|
{
|
||||||
// the tableView was too large and is now too small
|
// the tableView was too large and is now too small
|
||||||
if (_numberOfColumns > 0)
|
if (_numberOfColumns > 0)
|
||||||
|
@ -5624,7 +5624,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
quarterPosition = (p.y - _bounds.origin.y) / _rowHeight * 4.;
|
quarterPosition = (p.y - _bounds.origin.y) / _rowHeight * 4.;
|
||||||
|
|
||||||
if ((quarterPosition - oldDropRow * 4 <= 2) &&
|
if ((quarterPosition - oldDropRow * 4 <= 2) &&
|
||||||
(quarterPosition - oldDropRow * 4 >= -3) )
|
(quarterPosition - oldDropRow * 4 >= -3))
|
||||||
{
|
{
|
||||||
row = oldDropRow;
|
row = oldDropRow;
|
||||||
}
|
}
|
||||||
|
@ -5634,7 +5634,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Are we in the two middle quarters of the row? Use TableViewDropOn
|
// Are we in the two middle quarters of the row? Use TableViewDropOn
|
||||||
if(positionInRow > _rowHeight/4 && positionInRow <= (3*_rowHeight)/4)
|
if (positionInRow > _rowHeight/4 && positionInRow <= (3*_rowHeight)/4)
|
||||||
{
|
{
|
||||||
currentDropRow = (int)(p.y - _bounds.origin.y) / (int)_rowHeight;
|
currentDropRow = (int)(p.y - _bounds.origin.y) / (int)_rowHeight;
|
||||||
currentDropOperation = NSTableViewDropOn;
|
currentDropOperation = NSTableViewDropOn;
|
||||||
|
@ -5906,7 +5906,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
{
|
{
|
||||||
id result = nil;
|
id result = nil;
|
||||||
|
|
||||||
if([_dataSource respondsToSelector:
|
if ([_dataSource respondsToSelector:
|
||||||
@selector(tableView:objectValueForTableColumn:row:)])
|
@selector(tableView:objectValueForTableColumn:row:)])
|
||||||
{
|
{
|
||||||
result = [_dataSource tableView: self
|
result = [_dataSource tableView: self
|
||||||
|
@ -5921,7 +5921,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
|
||||||
forTableColumn: (NSTableColumn *)tb
|
forTableColumn: (NSTableColumn *)tb
|
||||||
row: (int) index
|
row: (int) index
|
||||||
{
|
{
|
||||||
if([_dataSource respondsToSelector:
|
if ([_dataSource respondsToSelector:
|
||||||
@selector(tableView:setObjectValue:forTableColumn:row:)])
|
@selector(tableView:setObjectValue:forTableColumn:row:)])
|
||||||
{
|
{
|
||||||
[_dataSource tableView: self
|
[_dataSource tableView: self
|
||||||
|
|
|
@ -197,9 +197,9 @@ Helpers are here, the actual methods are in the main implementation. */
|
||||||
|
|
||||||
|
|
||||||
#define SET_DELEGATE_NOTIFICATION(notif_name) \
|
#define SET_DELEGATE_NOTIFICATION(notif_name) \
|
||||||
if ([_delegate respondsToSelector: @selector(text##notif_name: )]) \
|
if ([_delegate respondsToSelector: @selector(text##notif_name:)]) \
|
||||||
[notificationCenter addObserver: _delegate \
|
[notificationCenter addObserver: _delegate \
|
||||||
selector: @selector(text##notif_name: ) \
|
selector: @selector(text##notif_name:) \
|
||||||
name: NSText##notif_name##Notification \
|
name: NSText##notif_name##Notification \
|
||||||
object: _notifObject]
|
object: _notifObject]
|
||||||
|
|
||||||
|
@ -1534,7 +1534,7 @@ before this TODO can be removed
|
||||||
[cv documentView] == self)
|
[cv documentView] == self)
|
||||||
{
|
{
|
||||||
NSSize b = [cv bounds].size;
|
NSSize b = [cv bounds].size;
|
||||||
effectiveMinSize.width = MAX(effectiveMinSize.width , b.width );
|
effectiveMinSize.width = MAX(effectiveMinSize.width , b.width);
|
||||||
effectiveMinSize.height = MAX(effectiveMinSize.height, b.height);
|
effectiveMinSize.height = MAX(effectiveMinSize.height, b.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,7 +174,7 @@ send -shouldChangeTextInRange:replacementString: or -didChangeText.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
[_textStorage beginEditing];
|
[_textStorage beginEditing];
|
||||||
for (i = r.location; i < NSMaxRange(r); )
|
for (i = r.location; i < NSMaxRange(r);)
|
||||||
{
|
{
|
||||||
current = [_textStorage attribute: name
|
current = [_textStorage attribute: name
|
||||||
atIndex: i
|
atIndex: i
|
||||||
|
|
|
@ -1144,7 +1144,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
|
|
||||||
- (BOOL) isEnabled
|
- (BOOL) isEnabled
|
||||||
{
|
{
|
||||||
if(_flags._isEnabled)
|
if (_flags._isEnabled)
|
||||||
{
|
{
|
||||||
return [(id)_backView isEnabled];
|
return [(id)_backView isEnabled];
|
||||||
}
|
}
|
||||||
|
@ -1153,7 +1153,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
|
|
||||||
- (NSImage *)image
|
- (NSImage *)image
|
||||||
{
|
{
|
||||||
if(_flags._image)
|
if (_flags._image)
|
||||||
{
|
{
|
||||||
return _image;
|
return _image;
|
||||||
}
|
}
|
||||||
|
@ -1203,7 +1203,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
|
|
||||||
- (void) setAction: (SEL)action
|
- (void) setAction: (SEL)action
|
||||||
{
|
{
|
||||||
if(_flags._setAction)
|
if (_flags._setAction)
|
||||||
{
|
{
|
||||||
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
||||||
[(GSToolbarButton *)_backView setToolbarItemAction: action];
|
[(GSToolbarButton *)_backView setToolbarItemAction: action];
|
||||||
|
@ -1221,13 +1221,13 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
|
|
||||||
- (void) setEnabled: (BOOL)enabled
|
- (void) setEnabled: (BOOL)enabled
|
||||||
{
|
{
|
||||||
if(_flags._setEnabled)
|
if (_flags._setEnabled)
|
||||||
[(id)_backView setEnabled: enabled];
|
[(id)_backView setEnabled: enabled];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setImage: (NSImage *)image
|
- (void) setImage: (NSImage *)image
|
||||||
{
|
{
|
||||||
if(_flags._setImage)
|
if (_flags._setImage)
|
||||||
{
|
{
|
||||||
ASSIGN(_image, image);
|
ASSIGN(_image, image);
|
||||||
|
|
||||||
|
@ -1273,13 +1273,13 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
|
|
||||||
- (void) setTag: (int)tag
|
- (void) setTag: (int)tag
|
||||||
{
|
{
|
||||||
if(_flags._tag)
|
if (_flags._tag)
|
||||||
_tag = tag;
|
_tag = tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setTarget: (id)target
|
- (void) setTarget: (id)target
|
||||||
{
|
{
|
||||||
if(_flags._target)
|
if (_flags._target)
|
||||||
{
|
{
|
||||||
if ([_backView isKindOfClass: [NSButton class]])
|
if ([_backView isKindOfClass: [NSButton class]])
|
||||||
[(NSButton *)_backView setTarget: target];
|
[(NSButton *)_backView setTarget: target];
|
||||||
|
@ -1332,7 +1332,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
|
|
||||||
- (int) tag
|
- (int) tag
|
||||||
{
|
{
|
||||||
if(_flags._tag)
|
if (_flags._tag)
|
||||||
return _tag;
|
return _tag;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1463,7 +1463,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
// NSValidatedUserInterfaceItem protocol
|
// NSValidatedUserInterfaceItem protocol
|
||||||
- (SEL) action
|
- (SEL) action
|
||||||
{
|
{
|
||||||
if(_flags._action)
|
if (_flags._action)
|
||||||
{
|
{
|
||||||
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
if ([_backView isKindOfClass: [GSToolbarButton class]])
|
||||||
return [(GSToolbarButton *)_backView toolbarItemAction];
|
return [(GSToolbarButton *)_backView toolbarItemAction];
|
||||||
|
@ -1473,7 +1473,7 @@ NSString *GSMovableToolbarItemPboardType = @"GSMovableToolbarItemPboardType";
|
||||||
|
|
||||||
- (id) target
|
- (id) target
|
||||||
{
|
{
|
||||||
if(_flags._target)
|
if (_flags._target)
|
||||||
{
|
{
|
||||||
if ([_backView isKindOfClass: [NSButton class]])
|
if ([_backView isKindOfClass: [NSButton class]])
|
||||||
return [(NSButton *)_backView target];
|
return [(NSButton *)_backView target];
|
||||||
|
|
|
@ -892,7 +892,7 @@ GSSetDragTypes(NSView* obj, NSArray *types)
|
||||||
/**
|
/**
|
||||||
* Notifies the receiver that it will now be a view of newWindow.
|
* Notifies the receiver that it will now be a view of newWindow.
|
||||||
* Note, this method is also used when removing a view from a window
|
* Note, this method is also used when removing a view from a window
|
||||||
* (in which case, newWindow is nil ) to let all the subviews know
|
* (in which case, newWindow is nil) to let all the subviews know
|
||||||
* that they have also been removed from the window.
|
* that they have also been removed from the window.
|
||||||
*/
|
*/
|
||||||
- (void) viewWillMoveToWindow: (NSWindow*)newWindow
|
- (void) viewWillMoveToWindow: (NSWindow*)newWindow
|
||||||
|
@ -3884,7 +3884,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
*/
|
*/
|
||||||
- (void) encodeWithCoder: (NSCoder*)aCoder
|
- (void) encodeWithCoder: (NSCoder*)aCoder
|
||||||
{
|
{
|
||||||
if([aCoder allowsKeyedCoding])
|
if ([aCoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
int vFlags = 0;
|
int vFlags = 0;
|
||||||
|
|
||||||
|
@ -3902,13 +3902,13 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level)
|
||||||
vFlags = _autoresizingMask;
|
vFlags = _autoresizingMask;
|
||||||
|
|
||||||
// add the autoresize flag.
|
// add the autoresize flag.
|
||||||
if(_autoresizes_subviews)
|
if (_autoresizes_subviews)
|
||||||
{
|
{
|
||||||
vFlags |= 0x100;
|
vFlags |= 0x100;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add the hidden flag
|
// add the hidden flag
|
||||||
if(_is_hidden)
|
if (_is_hidden)
|
||||||
{
|
{
|
||||||
vFlags |= 0x80000000;
|
vFlags |= 0x80000000;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4199,7 +4199,7 @@ resetCursorRectsForView(NSView *theView)
|
||||||
|
|
||||||
/* If the image has been specified, use it, if not use the default. */
|
/* If the image has been specified, use it, if not use the default. */
|
||||||
obj = [aDecoder decodeObject];
|
obj = [aDecoder decodeObject];
|
||||||
if(obj != nil)
|
if (obj != nil)
|
||||||
{
|
{
|
||||||
ASSIGN(_miniaturizedImage, obj);
|
ASSIGN(_miniaturizedImage, obj);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,13 +305,13 @@ static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
|
||||||
* NSTypes = (
|
* NSTypes = (
|
||||||
* {
|
* {
|
||||||
* NSIcon = "tiff.tiff";
|
* NSIcon = "tiff.tiff";
|
||||||
* NSUnixExtensions = ( tiff, tif );
|
* NSUnixExtensions = (tiff, tif);
|
||||||
* },
|
* },
|
||||||
* {
|
* {
|
||||||
* NSIcon = "xbm.tiff";
|
* NSIcon = "xbm.tiff";
|
||||||
* NSUnixExtensions = ( xbm );
|
* NSUnixExtensions = (xbm);
|
||||||
* }
|
* }
|
||||||
* );
|
*);
|
||||||
* }
|
* }
|
||||||
* </example>
|
* </example>
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue