diff --git a/ChangeLog b/ChangeLog index c6d58d146..98fe8c52f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Tue Sep 8 1998 Felipe A. Rodriguez + + * NSMenu.m->NSMenuMatrix in insertItemWithTitle: removed call to + _resizeMenuForCellSize for performance reasons. _resizeMenuForCellSize + is called later on a sizeToFit. + * NSMenu.m->NSMenuMatrix in removeItem: removed call to + _resizeMenuForCellSize for performance reasons. _resizeMenuForCellSize + is called later on a sizeToFit. + * NSMenu.m->NSMenu in insertItemWithTitle: replaced call to _menuChanged + with menuHasChanged=YES for performance reasons. + * NSMenu.m->NSMenu in removeItem: replaced call to _menuChanged with + menuHasChanged=YES for performance reasons. + Tue Sep 8 16:30:00 1998 Richard Frith-Macdonald * Source/NSScroller.m: Minor efficiency hacks (inspired by xraw) plus diff --git a/Headers/gnustep/gui/NSStringDrawing.h b/Headers/gnustep/gui/NSStringDrawing.h index e7b41aa20..5776c6192 100644 --- a/Headers/gnustep/gui/NSStringDrawing.h +++ b/Headers/gnustep/gui/NSStringDrawing.h @@ -36,25 +36,28 @@ // global NSString attribute names used in ascessing // the respective property in a text attributes - // dictionary. if the key is not in the dictionary the - // default value is assumed -extern NSString *NSFontAttributeName; // NSFont, defaults to Helvetica 12 - // NSParagraphStyle, default is defaultParagraphStyle -extern NSString *NSParagraphStyleAttributeName; - // NSColor, default is blackColor -extern NSString *NSForegroundColorAttributeName; - // int, default 0 = no underline -extern NSString *NSUnderlineStyleAttributeName; -extern NSString *NSSuperscriptAttributeName; // int, default 0 - // NSColor, default nil = no background color -extern NSString *NSBackgroundColorAttributeName; -extern NSString *NSAttachmentAttributeName; // NSTextAttachment, default nil - // int, default 1, 0 = no ligatures, 2 = all ligatures -extern NSString *NSLigatureAttributeName; -extern NSString *NSBaselineOffsetAttributeName; // float, default 0 in points; - // float, offset from baseline, -extern NSString *NSKernAttributeName; // amount to modify default - // kerning, if 0 kerning is off + // dictionary. if the key is not in the dictionary + // the default value is assumed +extern NSString *NSFontAttributeName; // NSFont, Helvetica 12 +extern NSString *NSParagraphStyleAttributeName; // defaultParagraphStyle +extern NSString *NSForegroundColorAttributeName; // NSColor, blackColor +extern NSString *NSUnderlineStyleAttributeName; // NSNumber int, 0 no line +extern NSString *NSSuperscriptAttributeName; // NSNumber int, 0 +extern NSString *NSBackgroundColorAttributeName; // NSColor, nil +extern NSString *NSAttachmentAttributeName; // NSTextAttachment, nil +extern NSString *NSLigatureAttributeName; // NSNumber int, 1 +extern NSString *NSBaselineOffsetAttributeName; // NSNumber float, 0 points +extern NSString *NSKernAttributeName; // NSNumber float, 0 +// +// Extended definitions: +// +// NSParagraphStyleAttributeName NSParagraphStyle, default is +// defaultParagraphStyle +// +// NSKernAttributeName NSNumber float, offset from +// baseline, amount tomodify default +// kerning, if 0 kerning is off + enum { // Currently supported values for NSSingleUnderlineStyle = 1 // NSUnderlineStyleAttributeName diff --git a/Source/NSFileWrapper.m b/Source/NSFileWrapper.m index 307731189..3b17e1fc2 100644 --- a/Source/NSFileWrapper.m +++ b/Source/NSFileWrapper.m @@ -37,26 +37,24 @@ // // Initialization // - // Init instance of directory type -- (id)initDirectoryWithFileWrappers:(NSDictionary *)docs -{ +- (id)initDirectoryWithFileWrappers:(NSDictionary *)docs // Init instance of +{ // directory type return nil; } - // Init instance of regular file type -- (id)initRegularFileWithContents:(NSData *)data -{ + +- (id)initRegularFileWithContents:(NSData *)data // Init instance of +{ // regular file type return nil; } - // Init instance of symbolic link type -- (id)initSymbolicLinkWithDestination:(NSString *)path -{ + +- (id)initSymbolicLinkWithDestination:(NSString *)path // Init instance of +{ // symbolic link type return nil; } // Init an instance from the file, // directory, or symbolic link at path. - // This can create a tree of instances -- (id)initWithPath:(NSString *)path // with a directory instance at the top -{ +- (id)initWithPath:(NSString *)path // This can create a tree of instances +{ // with a directory instance at the top return nil; } // Init an instance from data in std diff --git a/Source/NSMatrix.m b/Source/NSMatrix.m index ea4f4709f..516391b5d 100644 --- a/Source/NSMatrix.m +++ b/Source/NSMatrix.m @@ -901,7 +901,7 @@ fprintf(stderr, " NSMatrix: selectText --- "); - (id)selectTextAtRow:(int)row column:(int)column { // TODO - NSCell* aCell = [self cellAtRow:row column:column]; +// NSCell* aCell = [self cellAtRow:row column:column]; fprintf(stderr, " NSMatrix: selectTextAtRow --- "); @@ -1164,7 +1164,7 @@ static MPoint anchor = {0, 0}; [NSEvent startPeriodicEventsAfterDelay:0.05 withPeriod:0.05]; ASSIGN(lastEvent, theEvent); - [[self window] captureMouse: self]; // grab the mouse + [window captureMouse: self]; // grab the mouse [self lockFocus]; // selection involves two steps, first // a loop that continues until the left while (!done) // mouse goes up; then a series of @@ -1324,7 +1324,7 @@ static MPoint anchor = {0, 0}; lastLocation = [self convertPoint:lastLocation fromView:nil]; } - [[self window] releaseMouse: self]; // Release the mouse + [window releaseMouse: self]; // Release the mouse switch (mode) // Finish the selection { // process diff --git a/Source/NSMenu.m b/Source/NSMenu.m index eade071a9..30de7b49e 100644 --- a/Source/NSMenu.m +++ b/Source/NSMenu.m @@ -141,9 +141,9 @@ static NSFont* menuFont = nil; } - (id )insertItemWithTitle:(NSString*)aString - action:(SEL)aSelector - keyEquivalent:(NSString*)charCode - atIndex:(unsigned int)index + action:(SEL)aSelector + keyEquivalent:(NSString*)charCode + atIndex:(unsigned int)index { id menuCell = [[[NSMenu cellClass] new] autorelease]; @@ -154,7 +154,6 @@ static NSFont* menuFont = nil; [menuCell setKeyEquivalent:charCode]; [cells insertObject:menuCell atIndex:index]; - [self _resizeMenuForCellSize]; return menuCell; } @@ -167,7 +166,6 @@ static NSFont* menuFont = nil; return; [cells removeObjectAtIndex:row]; - [self _resizeMenuForCellSize]; } - (NSArray*)itemArray { return cells; } @@ -343,25 +341,25 @@ static Class menuCellClass = nil; } - (id )addItemWithTitle:(NSString*)aString - action:(SEL)aSelector - keyEquivalent:(NSString*)charCode + action:(SEL)aSelector + keyEquivalent:(NSString*)charCode { return [self insertItemWithTitle:aString - action:aSelector - keyEquivalent:charCode - atIndex:[[menuCells itemArray] count]]; + action:aSelector + keyEquivalent:charCode + atIndex:[[menuCells itemArray] count]]; } - (id )insertItemWithTitle:(NSString*)aString - action:(SEL)aSelector - keyEquivalent:(NSString*)charCode - atIndex:(unsigned int)index + action:(SEL)aSelector + keyEquivalent:(NSString*)charCode + atIndex:(unsigned int)index { id menuCell = [menuCells insertItemWithTitle:aString - action:aSelector - keyEquivalent:charCode - atIndex:index]; - [self _menuChanged]; + action:aSelector + keyEquivalent:charCode + atIndex:index]; + menuHasChanged = YES; // menu needs update return menuCell; } @@ -369,7 +367,7 @@ static Class menuCellClass = nil; - (void)removeItem:(id )anItem { [menuCells removeItem:anItem]; - [self _menuChanged]; + menuHasChanged = YES; // menu needs update } - (NSArray*)itemArray @@ -592,7 +590,8 @@ static Class menuCellClass = nil; /* Reenable displaying of menus */ [self setMenuChangedMessagesEnabled:YES]; - [self sizeToFit]; + if(menuHasChanged) // resize if menu + [self sizeToFit]; // has been changed } - (void)performActionForItem:(id )cell