Prefixed ivar delegate with underscore

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5392 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 1999-12-07 05:53:26 +00:00
parent f06480bd44
commit aea0593982
2 changed files with 52 additions and 52 deletions

View file

@ -96,7 +96,7 @@ extern NSSize NSTokenSize;
id first_responder; id first_responder;
id original_responder; id original_responder;
NSView *_initial_first_responder; NSView *_initial_first_responder;
id delegate; id _delegate;
id _fieldEditor; id _fieldEditor;
id _lastDragView; id _lastDragView;
int window_num; int window_num;

View file

@ -529,9 +529,9 @@ static NSMapTable* windowmaps = NULL;
- (NSText *) fieldEditor: (BOOL)createFlag forObject: (id)anObject - (NSText *) fieldEditor: (BOOL)createFlag forObject: (id)anObject
{ {
/* ask delegate if it can provide a field editor */ /* ask delegate if it can provide a field editor */
if ([delegate respondsToSelector: if ([_delegate respondsToSelector:
@selector(windowWillReturnFieldEditor:toObject:)]) @selector(windowWillReturnFieldEditor:toObject:)])
return [delegate windowWillReturnFieldEditor: self toObject: anObject]; return [_delegate windowWillReturnFieldEditor: self toObject: anObject];
/* /*
* Each window has a global text field editor, if it doesn't exist create it * Each window has a global text field editor, if it doesn't exist create it
@ -886,9 +886,9 @@ static NSMapTable* windowmaps = NULL;
if (NSEqualSizes(frameRect.size, frame.size) == NO) if (NSEqualSizes(frameRect.size, frame.size) == NO)
{ {
if ([delegate respondsToSelector: @selector(windowWillResize:toSize:)]) if ([_delegate respondsToSelector: @selector(windowWillResize:toSize:)])
{ {
frameRect.size = [delegate windowWillResize: self frameRect.size = [_delegate windowWillResize: self
toSize: frameRect.size]; toSize: frameRect.size];
} }
} }
@ -1378,13 +1378,13 @@ resetCursorRectsForView(NSView *theView)
return; return;
} }
if ([delegate respondsToSelector: @selector(windowShouldClose:)]) if ([_delegate respondsToSelector: @selector(windowShouldClose:)])
{ {
/* /*
* if delegate responds to windowShouldClose query it to see if * if delegate responds to windowShouldClose query it to see if
* it's ok to close the window * it's ok to close the window
*/ */
if (![delegate windowShouldClose: self]) if (![_delegate windowShouldClose: self])
{ {
NSBeep(); NSBeep();
return; return;
@ -2014,14 +2014,14 @@ resetCursorRectsForView(NSView *theView)
break; break;
#define GSPerformDragSelector(view, sel, info, action) \ #define GSPerformDragSelector(view, sel, info, action) \
if (view == content_view && delegate) \ if (view == content_view && _delegate) \
action = (int)[delegate performSelector: sel withObject: \ action = (int)[_delegate performSelector: sel withObject: \
info]; \ info]; \
else \ else \
action = (int)[view performSelector: sel withObject: info] action = (int)[view performSelector: sel withObject: info]
#define GSPerformVoidDragSelector(view, sel, info) \ #define GSPerformVoidDragSelector(view, sel, info) \
if (view == content_view && delegate) \ if (view == content_view && _delegate) \
[delegate performSelector: sel withObject: info]; \ [_delegate performSelector: sel withObject: info]; \
else \ else \
[view performSelector: sel withObject: info] [view performSelector: sel withObject: info]
@ -2303,8 +2303,8 @@ resetCursorRectsForView(NSView *theView)
{ {
id result = nil; id result = nil;
if (delegate && [delegate respondsToSelector: _cmd]) if (_delegate && [_delegate respondsToSelector: _cmd])
result = [delegate validRequestorForSendType: sendType result = [_delegate validRequestorForSendType: sendType
returnType: returnType]; returnType: returnType];
if (result == nil) if (result == nil)
@ -2616,20 +2616,20 @@ resetCursorRectsForView(NSView *theView)
*/ */
- (id) delegate - (id) delegate
{ {
return delegate; return _delegate;
} }
- (void) setDelegate: (id)anObject - (void) setDelegate: (id)anObject
{ {
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
if (delegate) if (_delegate)
[nc removeObserver: delegate name: nil object: self]; [nc removeObserver: _delegate name: nil object: self];
delegate = anObject; _delegate = anObject;
#define SET_DELEGATE_NOTIFICATION(notif_name) \ #define SET_DELEGATE_NOTIFICATION(notif_name) \
if ([delegate respondsToSelector: @selector(window##notif_name:)]) \ if ([_delegate respondsToSelector: @selector(window##notif_name:)]) \
[nc addObserver: delegate \ [nc addObserver: _delegate \
selector: @selector(window##notif_name:) \ selector: @selector(window##notif_name:) \
name: NSWindow##notif_name##Notification object: self] name: NSWindow##notif_name##Notification object: self]
@ -2654,11 +2654,11 @@ resetCursorRectsForView(NSView *theView)
*/ */
- (BOOL) windowShouldClose: (id)sender - (BOOL) windowShouldClose: (id)sender
{ {
if ([delegate respondsToSelector: @selector(windowShouldClose:)]) if ([_delegate respondsToSelector: @selector(windowShouldClose:)])
{ {
BOOL ourReturn; BOOL ourReturn;
ourReturn = [delegate windowShouldClose: sender]; ourReturn = [_delegate windowShouldClose: sender];
if (ourReturn) if (ourReturn)
{ {
@ -2673,8 +2673,8 @@ resetCursorRectsForView(NSView *theView)
- (NSSize) windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize - (NSSize) windowWillResize: (NSWindow *)sender toSize: (NSSize)frameSize
{ {
if ([delegate respondsToSelector: @selector(windowWillResize:toSize:)]) if ([_delegate respondsToSelector: @selector(windowWillResize:toSize:)])
return [delegate windowWillResize: sender toSize: frameSize]; return [_delegate windowWillResize: sender toSize: frameSize];
else else
return frameSize; return frameSize;
} }
@ -2686,86 +2686,86 @@ resetCursorRectsForView(NSView *theView)
- (void) windowDidBecomeKey: (NSNotification *)aNotification - (void) windowDidBecomeKey: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidBecomeKey:)]) if ([_delegate respondsToSelector: @selector(windowDidBecomeKey:)])
return [delegate windowDidBecomeKey: aNotification]; return [_delegate windowDidBecomeKey: aNotification];
} }
- (void) windowDidBecomeMain: (NSNotification *)aNotification - (void) windowDidBecomeMain: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidBecomeMain:)]) if ([_delegate respondsToSelector: @selector(windowDidBecomeMain:)])
return [delegate windowDidBecomeMain: aNotification]; return [_delegate windowDidBecomeMain: aNotification];
} }
- (void) windowDidChangeScreen: (NSNotification *)aNotification - (void) windowDidChangeScreen: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidChangeScreen:)]) if ([_delegate respondsToSelector: @selector(windowDidChangeScreen:)])
return [delegate windowDidChangeScreen: aNotification]; return [_delegate windowDidChangeScreen: aNotification];
} }
- (void) windowDidDeminiaturize: (NSNotification *)aNotification - (void) windowDidDeminiaturize: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidDeminiaturize:)]) if ([_delegate respondsToSelector: @selector(windowDidDeminiaturize:)])
return [delegate windowDidDeminiaturize: aNotification]; return [_delegate windowDidDeminiaturize: aNotification];
} }
- (void) windowDidExpose: (NSNotification *)aNotification - (void) windowDidExpose: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidExpose:)]) if ([_delegate respondsToSelector: @selector(windowDidExpose:)])
return [delegate windowDidExpose: aNotification]; return [_delegate windowDidExpose: aNotification];
} }
- (void) windowDidMiniaturize: (NSNotification *)aNotification - (void) windowDidMiniaturize: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidMiniaturize:)]) if ([_delegate respondsToSelector: @selector(windowDidMiniaturize:)])
return [delegate windowDidMiniaturize: aNotification]; return [_delegate windowDidMiniaturize: aNotification];
} }
- (void) windowDidMove: (NSNotification *)aNotification - (void) windowDidMove: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidMove:)]) if ([_delegate respondsToSelector: @selector(windowDidMove:)])
return [delegate windowDidMove: aNotification]; return [_delegate windowDidMove: aNotification];
} }
- (void) windowDidResignKey: (NSNotification *)aNotification - (void) windowDidResignKey: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidResignKey:)]) if ([_delegate respondsToSelector: @selector(windowDidResignKey:)])
return [delegate windowDidResignKey: aNotification]; return [_delegate windowDidResignKey: aNotification];
} }
- (void) windowDidResignMain: (NSNotification *)aNotification - (void) windowDidResignMain: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidResignMain:)]) if ([_delegate respondsToSelector: @selector(windowDidResignMain:)])
return [delegate windowDidResignMain: aNotification]; return [_delegate windowDidResignMain: aNotification];
} }
- (void) windowDidResize: (NSNotification *)aNotification - (void) windowDidResize: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidResize:)]) if ([_delegate respondsToSelector: @selector(windowDidResize:)])
return [delegate windowDidResize: aNotification]; return [_delegate windowDidResize: aNotification];
} }
- (void) windowDidUpdate: (NSNotification *)aNotification - (void) windowDidUpdate: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowDidUpdate:)]) if ([_delegate respondsToSelector: @selector(windowDidUpdate:)])
return [delegate windowDidUpdate: aNotification]; return [_delegate windowDidUpdate: aNotification];
} }
- (void) windowWillClose: (NSNotification *)aNotification - (void) windowWillClose: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowWillClose:)]) if ([_delegate respondsToSelector: @selector(windowWillClose:)])
return [delegate windowWillClose: aNotification]; return [_delegate windowWillClose: aNotification];
} }
- (void) windowWillMiniaturize: (NSNotification *)aNotification - (void) windowWillMiniaturize: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowWillMiniaturize:)]) if ([_delegate respondsToSelector: @selector(windowWillMiniaturize:)])
return [delegate windowWillMiniaturize: aNotification]; return [_delegate windowWillMiniaturize: aNotification];
} }
- (void) windowWillMove: (NSNotification *)aNotification - (void) windowWillMove: (NSNotification *)aNotification
{ {
if ([delegate respondsToSelector: @selector(windowWillMove:)]) if ([_delegate respondsToSelector: @selector(windowWillMove:)])
return [delegate windowWillMove: aNotification]; return [_delegate windowWillMove: aNotification];
} }
/* /*
@ -2979,7 +2979,7 @@ resetCursorRectsForView(NSView *theView)
original_responder = nil; original_responder = nil;
_initial_first_responder = nil; _initial_first_responder = nil;
_selection_direction = NSDirectSelection; _selection_direction = NSDirectSelection;
delegate = nil; _delegate = nil;
window_num = 0; window_num = 0;
gstate = 0; gstate = 0;
background_color = RETAIN([NSColor controlColor]); background_color = RETAIN([NSColor controlColor]);