40- (id) initWithObject:(
id <OOWeakReferenceSupport>)object;
51+ (id) inspectorForObject:(
id <OOWeakReferenceSupport>)object
56 if (
object ==
nil)
return nil;
59 key = [NSValue valueWithNonretainedObject:object];
60 inspector = [sActiveInspectors objectForKey:key];
63 if ([inspector
object] ==
object)
return inspector;
67 [sActiveInspectors removeObjectForKey:key];
72 inspector = [[[
self alloc] initWithObject:object] autorelease];
95- (
id <OOWeakReferenceSupport>)
object
99 id result = [_object weakRefUnderlyingObject];
117 [_panel orderFront:nil];
123 [[sActiveInspectors allValues] makeObjectsPerformSelector:@selector(cleanSelfUp)];
127- (id) initWithObject:(
id <OOWeakReferenceSupport>)object
129 if ((
self = [super init]))
131 _key = [[NSValue valueWithNonretainedObject:object] retain];
134 [NSBundle loadNibNamed:@"OODebugInspector" owner:self];
136 _timer = [NSTimer scheduledTimerWithTimeInterval:0.1
138 selector:@selector(updateTick:)
142 _modules = [[(id)object debugInspectorModules] retain];
146 [sActiveInspectors setObject:self forKey:_key];
156 CGFloat totalHeight = 4;
158 NSView *contentView =
nil, *moduleView =
nil;
164 totalHeight += [[module rootView] frame].
size.height;
168 frame = [_panel contentRectForFrameRect:[_panel frame]];
169 frame.size.height = totalHeight + 4;
170 [_panel setFrame:[_panel frameRectForContentRect:frame] display:NO];
172 size = [_panel contentMinSize];
173 size.height = frame.size.height;
174 [_panel setContentMinSize:size];
176 size = [_panel contentMaxSize];
177 size.height = frame.size.height;
178 [_panel setContentMaxSize:size];
181 contentView = [_panel contentView];
184 moduleView = [module rootView];
185 frame = [moduleView frame];
186 totalHeight -= frame.
size.height;
187 frame.origin.y = totalHeight;
188 [moduleView setFrame:frame];
189 [contentView addSubview:moduleView];
198 [_modules makeObjectsPerformSelector:@selector(update)];
202- (void) updateTick:(NSTimer *)timer
208- (void)windowWillClose:(NSNotification *)notification
220 if ([
self object] ==
nil) [
_panel close];
static NSMutableDictionary * sActiveInspectors
OOWeakReference * _object
id< OOWeakReferenceSupport > object()
IBOutlet NSPanel * _panel