Oolite 1.91.0.7644-241112-7f5034b
Loading...
Searching...
No Matches
OOMacDebugger Class Reference

#include <OOMacDebugger.h>

+ Inheritance diagram for OOMacDebugger:
+ Collaboration diagram for OOMacDebugger:

Instance Methods

(id) - initWithController:
 
(void) - performConsoleCommand:
 
(id) - configurationValueForKey:
 
(id) - configurationValueForKey:class:defaultValue:
 
(long long- configurationIntValueForKey:defaultValue:
 
(BOOL) - configurationBoolValueForKey:
 
(void) - setConfigurationValue:forKey:
 
(NSArray *) - configurationKeys
 
(void) - dealloc [implementation]
 
(BOOL) - connectDebugMonitor:errorMessage: [implementation]
 
(void) - disconnectDebugMonitor:message: [implementation]
 
(oneway void) - debugMonitor:jsConsoleOutput:colorKey:emphasisRange: [implementation]
 
(oneway void) - debugMonitorClearConsole: [implementation]
 
(oneway void) - debugMonitorShowConsole: [implementation]
 
(oneway void) - debugMonitor:noteConfiguration: [implementation]
 
(oneway void) - debugMonitor:noteChangedConfigrationValue:forKey: [implementation]
 
- Instance Methods inherited from <OODebuggerInterface>

Private Attributes

OODebugMonitor_monitor
 
OOJavaScriptConsoleController_jsConsoleController
 
NSMutableDictionary * _configuration
 

Detailed Description

Definition at line 42 of file OOMacDebugger.h.

Method Documentation

◆ configurationBoolValueForKey:

- (BOOL) configurationBoolValueForKey: (NSString *) key

Definition at line 1 of file OOMacDebugger.m.

106 :(NSString *)key
107{
108 return OOBooleanFromObject([self configurationValueForKey:key], NO);
109}
BOOL OOBooleanFromObject(id object, BOOL defaultValue)

References _jsConsoleController, nil, and OOJavaScriptConsoleController::setDebugger:.

+ Here is the call graph for this function:

◆ configurationIntValueForKey:defaultValue:

- (long long) configurationIntValueForKey: (NSString *) key
defaultValue: (long long) value 

Definition at line 1 of file OOMacDebugger.m.

92 :(NSString *)key defaultValue:(long long)value
93{
94 long long result;
95 id object = nil;
96
97 object = [self configurationValueForKey:key];
98 if ([object respondsToSelector:@selector(longLongValue)]) result = [object longLongValue];
99 else if ([object respondsToSelector:@selector(intValue)]) result = [object intValue];
100 else result = value;
101
102 return result;
103}
return nil
typedef long(ZCALLBACK *tell_file_func) OF((voidpf opaque

◆ configurationKeys

- (NSArray *) configurationKeys

Definition at line 1 of file OOMacDebugger.m.

121{
122 return [[_configuration allKeys] sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
123}

◆ configurationValueForKey:

- (id) configurationValueForKey: (NSString *) key

Definition at line 1 of file OOMacDebugger.m.

72 :(NSString *)key
73{
74 return [self configurationValueForKey:key class:Nil defaultValue:nil];
75}

◆ configurationValueForKey:class:defaultValue:

- (id) configurationValueForKey: (NSString *) key
class: (Class) class
defaultValue: (id) value 

Definition at line 1 of file OOMacDebugger.m.

78 :(NSString *)key class:(Class)class defaultValue:(id)value
79{
80 id result = nil;
81
82 if (class == Nil) class = [NSObject class];
83
84 result = [_configuration objectForKey:key];
85 if (![result isKindOfClass:class] && result != [NSNull null]) result = [[value retain] autorelease];
86 if (result == [NSNull null]) result = nil;
87
88 return result;
89}

◆ connectDebugMonitor:errorMessage:

- (BOOL) connectDebugMonitor: (in OODebugMonitor *) debugMonitor
errorMessage: (out NSString **) message 
implementation

Reimplemented from <OODebuggerInterface>.

Definition at line 1 of file OOMacDebugger.m.

128 :(in OODebugMonitor *)debugMonitor
129 errorMessage:(out NSString **)message
130{
131 if (debugMonitor == _monitor)
132 {
133 if (message != NULL) *message = @"ERROR: attempt to reconnect already-connected debugger!";
134 return NO;
135 }
136
137 if (_monitor != nil)
138 {
139 // Should never happen.
140 [_monitor disconnectDebugger:self message:@"Connected to different monitor."];
141 }
142
143 // Not retained.
144 _monitor = debugMonitor;
145 return YES;
146}
OODebugMonitor * _monitor

◆ dealloc

- (void) dealloc
implementation

Definition at line 1 of file OOMacDebugger.m.

54{
55 [_monitor disconnectDebugger:self message:@"Debugger released."];
56 // _monitor and _jsConsoleController are not retained.
57
58 [_configuration release];
59
60 [super dealloc];
61}

◆ debugMonitor:jsConsoleOutput:colorKey:emphasisRange:

- (oneway void) debugMonitor: (in OODebugMonitor *) debugMonitor
jsConsoleOutput: (in NSString *) output
colorKey: (in NSString *) colorKey
emphasisRange: (in NSRange) emphasisRange 
implementation

Reimplemented from <OODebuggerInterface>.

Definition at line 1 of file OOMacDebugger.m.

176 :(in OODebugMonitor *)debugMonitor
177 jsConsoleOutput:(in NSString *)output
178 colorKey:(in NSString *)colorKey
179 emphasisRange:(in NSRange)emphasisRange
180{
181 [_jsConsoleController appendMessage:output
182 colorKey:colorKey
183 emphasisRange:emphasisRange];
184}

◆ debugMonitor:noteChangedConfigrationValue:forKey:

- (oneway void) debugMonitor: (in OODebugMonitor *) debugMonitor
noteChangedConfigrationValue: (in id) newValue
forKey: (in NSString *) key 
implementation

Reimplemented from <OODebuggerInterface>.

Definition at line 1 of file OOMacDebugger.m.

206 :(in OODebugMonitor *)debugMonitor
207noteChangedConfigrationValue:(in id)newValue
208 forKey:(in NSString *)key
209{
210 if (_configuration == nil) _configuration = [[NSMutableDictionary alloc] init];
211 if (newValue != nil) [_configuration setObject:newValue forKey:key];
212 else [_configuration removeObjectForKey:key];
213
214 [_jsConsoleController noteConfigurationChanged:key];
215}
NSMutableDictionary * _configuration

◆ debugMonitor:noteConfiguration:

- (oneway void) debugMonitor: (in OODebugMonitor *) debugMonitor
noteConfiguration: (in NSDictionary *) configuration 
implementation

Reimplemented from <OODebuggerInterface>.

Definition at line 1 of file OOMacDebugger.m.

196 :(in OODebugMonitor *)debugMonitor
197 noteConfiguration:(in NSDictionary *)configuration
198{
199 [_configuration release];
200 _configuration = [configuration mutableCopy];
201
202 [_jsConsoleController noteConfigurationChanged:nil];
203}

◆ debugMonitorClearConsole:

- (oneway void) debugMonitorClearConsole: (in OODebugMonitor *) debugMonitor
implementation

Reimplemented from <OODebuggerInterface>.

Definition at line 1 of file OOMacDebugger.m.

186 :(in OODebugMonitor *)debugMonitor
187{
188 [_jsConsoleController clearConsole];
189}

◆ debugMonitorShowConsole:

- (oneway void) debugMonitorShowConsole: (in OODebugMonitor *) debugMonitor
implementation

Reimplemented from <OODebuggerInterface>.

Definition at line 1 of file OOMacDebugger.m.

191 :(in OODebugMonitor *)debugMonitor
192{
193 [_jsConsoleController doShowConsole];
194}

◆ disconnectDebugMonitor:message:

- (void) disconnectDebugMonitor: (in OODebugMonitor *) debugMonitor
message: (in NSString *) message 
implementation

Reimplemented from <OODebuggerInterface>.

Definition at line 1 of file OOMacDebugger.m.

148 :(in OODebugMonitor *)debugMonitor
149 message:(in NSString *)message
150{
151 NSString *prefix = nil;
152 NSRange emphasisRange;
153
154 if (debugMonitor == _monitor)
155 {
156 prefix = @"Debugger disconnected: ";
157 emphasisRange = NSMakeRange(0, [prefix length] - 1);
158 [_jsConsoleController appendMessage:[prefix stringByAppendingString:message]
159 colorKey:@"console-internal"
160 emphasisRange:emphasisRange];
161
162 _monitor = nil;
163 }
164 else
165 {
166 prefix = @"ERROR: ";
167 emphasisRange = NSMakeRange(0, [prefix length] - 1);
168 message = [NSString stringWithFormat:@"%@attempt to disconnect unconnected debug monitor %@ with message: %@", prefix, debugMonitor, message];
169 [_jsConsoleController appendMessage:message
170 colorKey:@"console-internal"
171 emphasisRange:emphasisRange];
172 }
173}

◆ initWithController:

- (id) initWithController: (OOJavaScriptConsoleController *) controller

Definition at line 1 of file OOMacDebugger.m.

42{
43 self = [super init];
44 if (self != nil)
45 {
46 _jsConsoleController = controller;
47 [_jsConsoleController setDebugger:self];
48 }
49 return self;
50}
OOJavaScriptConsoleController * _jsConsoleController

◆ performConsoleCommand:

- (void) performConsoleCommand: (NSString *) command

Definition at line 1 of file OOMacDebugger.m.

66 :(NSString *)command
67{
68 [_monitor performJSConsoleCommand:command];
69}

◆ setConfigurationValue:forKey:

- (void) setConfigurationValue: (id) value
forKey: (NSString *) key 

Definition at line 1 of file OOMacDebugger.m.

112 :(id)value forKey:(NSString *)key
113{
114 if (key == nil) return;
115
116 [_monitor setConfigurationValue:value forKey:key];
117}

Member Data Documentation

◆ _configuration

- (NSMutableDictionary*) _configuration
private

Definition at line 51 of file OOMacDebugger.h.

◆ _jsConsoleController

- (OOJavaScriptConsoleController*) _jsConsoleController
private

Definition at line 48 of file OOMacDebugger.h.

Referenced by configurationBoolValueForKey:.

◆ _monitor

- (OODebugMonitor*) _monitor
private

Definition at line 46 of file OOMacDebugger.h.


The documentation for this class was generated from the following files: