Replace direct use of the isa pointer with a call to object_getClass()

to make David happy.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33545 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2011-07-14 07:17:24 +00:00
parent bd8a409d6b
commit 5c93b41e6d
15 changed files with 60 additions and 37 deletions

View file

@ -1,3 +1,21 @@
2011-07-14 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSSound.m
* Source/GSWindowDecorationView.m
* Source/NSMatrix.m
* Source/NSBitmapImageRep.m
* Source/NSForm.m
* Source/GSHorizontalTypesetter.m
* Source/NSMovie.m
* Source/NSFontDescriptor.m
* Source/NSImage.m
* Source/NSScrollView.m
* Source/NSCell.m
* Source/NSBrowserCell.m
* Source/GSDragView.m
* Source/NSDocument.m: Replace direct use of the isa pointer with
a call to object_getClass().
2011-07-13 Eric Wasylishen <ewasylishen@gmail.com> 2011-07-13 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSColorPanel.m: Make a magnifying glass cursor when using * Source/NSColorPanel.m: Make a magnifying glass cursor when using

View file

@ -141,7 +141,7 @@ static GSDragView *sharedDragView = nil;
if (self != nil) if (self != nil)
{ {
NSRect winRect = {{0, 0}, {DWZ, DWZ}}; NSRect winRect = {{0, 0}, {DWZ, DWZ}};
NSWindow *sharedDragWindow = [[[isa windowClass] alloc] NSWindow *sharedDragWindow = [[[object_getClass(self) windowClass] alloc]
initWithContentRect: winRect initWithContentRect: winRect
styleMask: NSBorderlessWindowMask styleMask: NSBorderlessWindowMask
backing: NSBackingStoreNonretained backing: NSBackingStoreNonretained

View file

@ -1210,7 +1210,7 @@ restart: ;
we create a new instance and let it handle the call. */ we create a new instance and let it handle the call. */
GSHorizontalTypesetter *temp; GSHorizontalTypesetter *temp;
temp = [[isa alloc] init]; temp = [[object_getClass(self) alloc] init];
ret = [temp layoutGlyphsInLayoutManager: layoutManager ret = [temp layoutGlyphsInLayoutManager: layoutManager
inTextContainer: textContainer inTextContainer: textContainer
startingAtGlyphIndex: glyphIndex startingAtGlyphIndex: glyphIndex

View file

@ -155,8 +155,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
window = w; window = w;
// Content rect will be everything apart from the border // Content rect will be everything apart from the border
// that is including menu, toolbar and the like. // that is including menu, toolbar and the like.
contentRect = [isa contentRectForFrameRect: frame contentRect = [object_getClass(self)
styleMask: [w styleMask]]; contentRectForFrameRect: frame
styleMask: [w styleMask]];
} }
return self; return self;
} }
@ -184,8 +185,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
- (NSRect) contentRectForFrameRect: (NSRect)aRect - (NSRect) contentRectForFrameRect: (NSRect)aRect
styleMask: (unsigned int)aStyle styleMask: (unsigned int)aStyle
{ {
NSRect content = [isa contentRectForFrameRect: aRect NSRect content = [object_getClass(self)
styleMask: aStyle]; contentRectForFrameRect: aRect
styleMask: aStyle];
NSToolbar *tb = [_window toolbar]; NSToolbar *tb = [_window toolbar];
if ([_window menu] != nil) if ([_window menu] != nil)
@ -228,8 +230,8 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
aRect.size.height += [tv _heightFromLayout]; aRect.size.height += [tv _heightFromLayout];
} }
return [isa frameRectForContentRect: aRect return [object_getClass(self) frameRectForContentRect: aRect
styleMask: aStyle]; styleMask: aStyle];
} }
/* If the contentView is removed from the window we must make sure the /* If the contentView is removed from the window we must make sure the
@ -286,8 +288,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
NSView *windowContentView = [_window contentView]; NSView *windowContentView = [_window contentView];
frame.origin = NSZeroPoint; frame.origin = NSZeroPoint;
contentViewFrame = [isa contentRectForFrameRect: frame contentViewFrame = [object_getClass(self)
styleMask: [window styleMask]]; contentRectForFrameRect: frame
styleMask: [window styleMask]];
if (hasMenu) if (hasMenu)
{ {
@ -346,8 +349,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
NSRect windowContentFrame; NSRect windowContentFrame;
contentRect.size.height += difference; contentRect.size.height += difference;
windowFrame = [isa frameRectForContentRect: contentRect windowFrame = [object_getClass(self)
styleMask: [window styleMask]]; frameRectForContentRect: contentRect
styleMask: [window styleMask]];
// Set the local frame without changing the contents view // Set the local frame without changing the contents view
windowContentFrame = windowFrame; windowContentFrame = windowFrame;
@ -377,8 +381,9 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
_autoresizes_subviews = NO; _autoresizes_subviews = NO;
[super setFrame: frameRect]; [super setFrame: frameRect];
contentRect = [isa contentRectForFrameRect: frameRect contentRect = [object_getClass(self)
styleMask: [window styleMask]]; contentRectForFrameRect: frameRect
styleMask: [window styleMask]];
// Safety Check. // Safety Check.
[cv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [cv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];

View file

@ -295,22 +295,22 @@
return nil; return nil;
} }
if ([isa _bitmapIsPNG: imageData]) if ([object_getClass(self) _bitmapIsPNG: imageData])
return [self _initBitmapFromPNG: imageData]; return [self _initBitmapFromPNG: imageData];
if ([isa _bitmapIsPNM: imageData]) if ([object_getClass(self) _bitmapIsPNM: imageData])
return [self _initBitmapFromPNM: imageData return [self _initBitmapFromPNM: imageData
errorMessage: NULL]; errorMessage: NULL];
if ([isa _bitmapIsJPEG: imageData]) if ([object_getClass(self) _bitmapIsJPEG: imageData])
return [self _initBitmapFromJPEG: imageData return [self _initBitmapFromJPEG: imageData
errorMessage: NULL]; errorMessage: NULL];
if ([isa _bitmapIsGIF: imageData]) if ([object_getClass(self) _bitmapIsGIF: imageData])
return [self _initBitmapFromGIF: imageData return [self _initBitmapFromGIF: imageData
errorMessage: NULL]; errorMessage: NULL];
if ([isa _bitmapIsICNS: imageData]) if ([object_getClass(self) _bitmapIsICNS: imageData])
return [self _initBitmapFromICNS: imageData]; return [self _initBitmapFromICNS: imageData];
image = NSTiffOpenDataRead((char *)[imageData bytes], [imageData length]); image = NSTiffOpenDataRead((char *)[imageData bytes], [imageData length]);

View file

@ -274,7 +274,7 @@ static NSFont *_leafFont;
backColor = [self highlightColorInView: controlView]; backColor = [self highlightColorInView: controlView];
[backColor set]; [backColor set];
if (!_browsercell_is_leaf) if (!_browsercell_is_leaf)
branch_image = [isa highlightedBranchImage]; branch_image = [object_getClass(self) highlightedBranchImage];
cell_image = [self alternateImage]; cell_image = [self alternateImage];
} }
else else
@ -282,7 +282,7 @@ static NSFont *_leafFont;
backColor = [cvWin backgroundColor]; backColor = [cvWin backgroundColor];
[backColor set]; [backColor set];
if (!_browsercell_is_leaf) if (!_browsercell_is_leaf)
branch_image = [isa branchImage]; branch_image = [object_getClass(self) branchImage];
cell_image = [self image]; cell_image = [self image];
} }

View file

@ -177,8 +177,8 @@ static NSColor *dtxtCol;
//_cell.state = 0; //_cell.state = 0;
//_cell.line_break_mode = NSLineBreakByWordWrapping; //_cell.line_break_mode = NSLineBreakByWordWrapping;
_action_mask = NSLeftMouseUpMask; _action_mask = NSLeftMouseUpMask;
_menu = [isa defaultMenu]; _menu = [object_getClass(self) defaultMenu];
[self setFocusRingType: [isa defaultFocusRingType]]; [self setFocusRingType: [object_getClass(self) defaultFocusRingType]];
return self; return self;
} }
@ -208,8 +208,8 @@ static NSColor *dtxtCol;
//_cell.is_selectable = NO; //_cell.is_selectable = NO;
//_cell.line_break_mode = NSLineBreakByWordWrapping; //_cell.line_break_mode = NSLineBreakByWordWrapping;
_action_mask = NSLeftMouseUpMask; _action_mask = NSLeftMouseUpMask;
_menu = [isa defaultMenu]; _menu = [object_getClass(self) defaultMenu];
[self setFocusRingType: [isa defaultFocusRingType]]; [self setFocusRingType: [object_getClass(self) defaultFocusRingType]];
return self; return self;
} }

View file

@ -1250,7 +1250,7 @@ originalContentsURL: (NSURL *)orig
- (NSArray *) writableTypesForSaveOperation: (NSSaveOperationType)op - (NSArray *) writableTypesForSaveOperation: (NSSaveOperationType)op
{ {
NSArray *types = [isa writableTypes]; NSArray *types = [object_getClass(self) writableTypes];
NSMutableArray *muTypes; NSMutableArray *muTypes;
int i, len; int i, len;

View file

@ -83,7 +83,7 @@
[m addEntriesFromDictionary: attributes]; [m addEntriesFromDictionary: attributes];
new = [isa fontDescriptorWithFontAttributes: m]; new = [object_getClass(self) fontDescriptorWithFontAttributes: m];
RELEASE(m); RELEASE(m);
return new; return new;
@ -184,7 +184,7 @@
- (id) copyWithZone: (NSZone *)z - (id) copyWithZone: (NSZone *)z
{ {
NSFontDescriptor *f = [isa allocWithZone: z]; NSFontDescriptor *f = [object_getClass(self) allocWithZone: z];
if (f != nil) if (f != nil)
{ {

View file

@ -110,7 +110,7 @@ static Class defaultCellClass = nil;
- (NSFormCell*) insertEntry: (NSString*)title - (NSFormCell*) insertEntry: (NSString*)title
atIndex: (int)index atIndex: (int)index
{ {
NSFormCell *new_cell = [[[isa cellClass] alloc] initTextCell: title]; NSFormCell *new_cell = [[[object_getClass(self) cellClass] alloc] initTextCell: title];
[self insertRow: index]; [self insertRow: index];
[self putCell: new_cell atRow: index column: 0]; [self putCell: new_cell atRow: index column: 0];

View file

@ -2189,7 +2189,7 @@ iterate_reps_for_types(NSArray* imageReps, SEL method)
ext = [[fileName pathExtension] lowercaseString]; ext = [[fileName pathExtension] lowercaseString];
if (!ext) if (!ext)
return NO; return NO;
array = [isa imageFileTypes]; array = [object_getClass(self) imageFileTypes];
if ([array indexOfObject: ext] == NSNotFound) if ([array indexOfObject: ext] == NSNotFound)
return NO; return NO;

View file

@ -249,7 +249,7 @@ static SEL getSel;
{ {
return [self initWithFrame: NSZeroRect return [self initWithFrame: NSZeroRect
mode: NSRadioModeMatrix mode: NSRadioModeMatrix
cellClass: [isa cellClass] cellClass: [object_getClass(self) cellClass]
numberOfRows: 0 numberOfRows: 0
numberOfColumns: 0]; numberOfColumns: 0];
} }
@ -263,7 +263,7 @@ static SEL getSel;
{ {
return [self initWithFrame: frameRect return [self initWithFrame: frameRect
mode: NSRadioModeMatrix mode: NSRadioModeMatrix
cellClass: [isa cellClass] cellClass: [object_getClass(self) cellClass]
numberOfRows: 0 numberOfRows: 0
numberOfColumns: 0]; numberOfColumns: 0];
} }
@ -2894,7 +2894,7 @@ static SEL getSel;
if (_cellPrototype == nil) if (_cellPrototype == nil)
{ {
[self setCellClass: [isa cellClass]]; [self setCellClass: [object_getClass(self) cellClass]];
} }
[aDecoder decodeValueOfObjCType: @encode (int) at: &rows]; [aDecoder decodeValueOfObjCType: @encode (int) at: &rows];

View file

@ -95,7 +95,7 @@
NSData* data; NSData* data;
type = [pasteboard availableTypeFromArray: type = [pasteboard availableTypeFromArray:
[isa movieUnfilteredPasteboardTypes]]; [object_getClass(self) movieUnfilteredPasteboardTypes]];
if (type == nil) if (type == nil)
{ {
//NSArray *array = [pasteboard propertyListForType: NSFilenamesPboardType]; //NSArray *array = [pasteboard propertyListForType: NSFilenamesPboardType];

View file

@ -959,7 +959,7 @@ static float scrollerWidth;
_hasHorizRuler = flag; _hasHorizRuler = flag;
if (_hasHorizRuler && _horizRuler == nil) if (_hasHorizRuler && _horizRuler == nil)
{ {
_horizRuler = [[isa rulerViewClass] alloc]; _horizRuler = [[object_getClass(self) rulerViewClass] alloc];
_horizRuler = [_horizRuler initWithScrollView: self _horizRuler = [_horizRuler initWithScrollView: self
orientation: NSHorizontalRuler]; orientation: NSHorizontalRuler];
} }
@ -1010,7 +1010,7 @@ static float scrollerWidth;
_hasVertRuler = flag; _hasVertRuler = flag;
if (_hasVertRuler && _vertRuler == nil) if (_hasVertRuler && _vertRuler == nil)
{ {
_vertRuler = [[isa rulerViewClass] alloc]; _vertRuler = [[object_getClass(self) rulerViewClass] alloc];
_vertRuler = [_vertRuler initWithScrollView: self _vertRuler = [_vertRuler initWithScrollView: self
orientation: NSVerticalRuler]; orientation: NSVerticalRuler];
} }

View file

@ -332,7 +332,7 @@ static inline void _loadNSSoundPlugIns (void)
- (id) initWithPasteboard: (NSPasteboard *)pasteboard - (id) initWithPasteboard: (NSPasteboard *)pasteboard
{ {
if ([isa canInitWithPasteboard: pasteboard] == YES) if ([object_getClass(self) canInitWithPasteboard: pasteboard] == YES)
{ {
/* FIXME: Should this be @"NSGeneralPboardType" or @"NSSoundPboardType"? /* FIXME: Should this be @"NSGeneralPboardType" or @"NSSoundPboardType"?
Apple also defines "NSString *NSSoundPboardType". */ Apple also defines "NSString *NSSoundPboardType". */