-
Notifications
You must be signed in to change notification settings - Fork 1
/
OOOutlineDataSource.mm
667 lines (647 loc) · 19.3 KB
/
OOOutlineDataSource.mm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
/*-
* Copyright (c) 2017 David T. Chisnall
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
#import "OpenOutliner.h"
#include <vector>
/**
* Helper class that handles events from cells in the outline view.
*/
@interface OOOutlineCellDelegate : NSObject <NSTextFieldDelegate>
/**
* The row for which this is handling actions.
*/
@property (nonatomic) OOOutlineRow *row;
/**
* The column number for which this is handling actions.
*/
@property (nonatomic) NSUInteger columnNumber;
/**
* The column for which this is handling actions.
*/
@property (nonatomic) OOOutlineColumn *column;
/**
* The controller displaying the outline.
*/
@property (nonatomic, unsafe_unretained) OOOutlineDataSource *controller;
@end
auto *OOOUtlineRowsPasteboardType = @"org.theravensnest.openoutliner.internal.drag";
auto *OOOUtlineXMLPasteboardType = @"org.theravensnest.openoutliner.xml";
namespace {
/**
* Find the parent and indexes of all of the specified rows. When removing rows
* from the outline, we must find their parents and remove them. We don't want
* to remove any of the nodes where we're already removing the parents.
*/
void collectRowsToRemove(OOOutlineDocument *doc,
NSArray<OOOutlineRow*> *rows,
object_map<OOOutlineRow*, NSMutableIndexSet*> &removals)
{
NSSet *set = [NSSet setWithArray: rows];
for (OOOutlineRow *r : rows)
{
OOOutlineRow *p = [doc parentForRow: r];
// Skip any where we're already removing the parent.
if ([set containsObject: p])
{
continue;
}
auto idx = [p.children indexOfObject: r];
auto &idxs = removals[p];
if (!idxs)
{
idxs = [NSMutableIndexSet indexSetWithIndex: idx];
}
else
{
[idxs addIndex: idx];
}
}
}
} // Anon namespace
@implementation OOOutlineDataSource
{
/**
* Weak to strong map of items to row views. Lets us access the row view
* without having to query the outline view, which could end up with
* infinite recursion.
*/
NSMapTable *rowViews;
/**
* Lazily created window controller for the column inspector.
*/
OOColumnInspectorController *columnInspector;
}
@synthesize
document,
view;
- (void)awakeFromNib
{
rowViews = [NSMapTable weakToStrongObjectsMapTable];
OOOutlineDocument *doc = document;
NSOutlineView *v = view;
[v setDraggingSourceOperationMask: NSDragOperationCopy forLocal: NO];
[v setAllowsColumnSelection: YES];
auto *cols = [doc columns];
auto *c = [cols objectAtIndex: 0];
auto *tc = [v outlineTableColumn];
[tc setMinWidth: c.minWidth];
[tc setMaxWidth: c.maxWidth];
[tc setTitle: [c.title string]];
[tc setWidth: c.width];
[tc setIdentifier: @"0"];
for (NSUInteger i = 1 ; i<[doc columnCount] ; i++)
{
c = [cols objectAtIndex: i];
tc = [[NSTableColumn alloc] initWithIdentifier: [NSString stringWithFormat: @"%d", (int)i]];
[tc setMinWidth: c.minWidth];
[tc setMaxWidth: c.maxWidth];
[tc setTitle: [c.title string]];
[v addTableColumn: tc];
// Adding the column to the table will reset its width to minWidth, so we must set its width afterwards.
[tc setWidth: c.width];
}
std::function<void(OOOutlineRow*)> visit = [&](OOOutlineRow *r)
{
if ([r isExpanded])
{
[view expandItem: r];
}
for (OOOutlineRow *c in r.children)
{
visit(c);
}
};
visit(doc.root);
[v registerForDraggedTypes: @[ OOOUtlineRowsPasteboardType, OOOUtlineXMLPasteboardType ]];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector(columnsDidChange:)
name: OOOutlineColumnsDidChangeNotification
object: doc];
}
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
}
- (void)columnsDidChange: (NSNotification*)aNotification
{
auto *cols = [document columns];
OOOutlineDocument *doc = document;
NSOutlineView *v = view;
auto *c = [cols objectAtIndex: 0];
auto *tc = [v outlineTableColumn];
[tc setMinWidth: c.minWidth];
[tc setMaxWidth: c.maxWidth];
[tc setTitle: [c.title string]];
[tc setWidth: c.width];
[tc setIdentifier: @"0"];
NSUInteger removeIdx = 0;
while ([v numberOfColumns] > 1)
{
auto *col = [[v tableColumns] objectAtIndex: removeIdx];
if (col == tc)
{
removeIdx++;
continue;
}
[v removeTableColumn: col];
}
for (NSUInteger i = 1 ; i<[doc columnCount] ; i++)
{
c = [cols objectAtIndex: i];
tc = [[NSTableColumn alloc] initWithIdentifier: [NSString stringWithFormat: @"%d", (int)i]];
[tc setMinWidth: c.minWidth];
[tc setMaxWidth: c.maxWidth];
[tc setTitle: [c.title string]];
[v addTableColumn: tc];
// Adding the column to the table will reset its width to minWidth, so we must set its width afterwards.
[tc setWidth: c.width];
}
[v reloadItem: nil reloadChildren: YES];
}
- (id)outlineView: (NSOutlineView*)outlineView
child: (NSInteger)index
ofItem: (OOOutlineRow*)item
{
if (item == nil)
{
item = document.root;
}
return [item.children objectAtIndex: (NSUInteger)index];
}
- (BOOL)outlineView: (NSOutlineView*)outlineView
isItemExpandable: item
{
return [self outlineView: outlineView numberOfChildrenOfItem: item] > 0;
}
- (NSInteger)outlineView: (NSOutlineView*)outlineView
numberOfChildrenOfItem: (OOOutlineRow*)item
{
if (item == nil)
{
item = document.root;
}
return (NSInteger)[item.children count];
}
- (id)outlineView: (NSOutlineView*)outlineView
objectValueForTableColumn: (NSTableColumn*)tableColumn
byItem: (OOOutlineRow*)item
{
@try
{
NSUInteger idx = get<NSUInteger>([tableColumn identifier]);
if ([item isKindOfClass: [OOOutlineRow class]])
{
id val = [[[item values] objectAtIndex: idx] value];
if (val == nil)
{
OOOutlineColumn *col = [document.columns objectAtIndex: idx];
if (auto *summary = col.summary)
{
val = [summary computeSummaryForRow: item
inColumn: idx].value;
}
}
return val;
}
return idx == 0 ? item : nil;
}
@catch (...)
{
// FIXME: Big hammer error handling. We shouldn't be getting exceptions
// here at all.
return nil;
}
}
- (BOOL)outlineView: (NSOutlineView*)outlineView
isGroupItem: item
{
return [item isKindOfClass: [NSAttributedString class]];
}
- (NSView*)outlineView: (NSOutlineView*)outlineView
viewForTableColumn: (NSTableColumn*)tableColumn
item: item
{
// TODO: This code creates a lot of views. Some caching
// might be appropriate, but profile first to see if it's
// actually a bottleneck.
OOOutlineDocument *doc = document;
NSInteger idx = get<NSInteger>([tableColumn identifier]);
auto *modelColumn = [doc.columns objectAtIndex: (NSUInteger)idx];
auto applyStyle = [&](auto *v) {
v.formatter = modelColumn.formatter;
v.drawsBackground = NO;
v.allowsEditingTextAttributes = YES;
v.editable = YES;
};
// If this is an enumeration, present it as a combo box, populated with the enumeration kinds.
if (modelColumn.columnType == OOOutlineColumnTypeEnumeration)
{
auto *v = [NSComboBox new];
v.bordered = NO;
[v addItemsWithObjectValues: [[modelColumn enumValues] allValues]];
v.bordered = NO;
v.buttonBordered = NO;
v.bezeled = NO;
v.completes = YES;
applyStyle(v);
v.delegate = v.target;
return v;
}
else if (modelColumn.columnType == OOOutlineColumnTypeCheckBox)
{
auto *v = [NSButton new];
v.allowsMixedState = YES;
[v setButtonType: NSSwitchButton];
[v setTitle: @""];
return v;
}
auto *v = [NSTextField new];
v.bordered = NO;
applyStyle(v);
return v;
}
- (NSTableRowView*)outlineView: (NSOutlineView*)outlineView
rowViewForItem: (id)anItem
{
OOOutlineTableRowView *v = [rowViews objectForKey: anItem];
if (v == nil)
{
v = [OOOutlineTableRowView new];
[v setOutlineView: view];
[v setRow: anItem];
[rowViews setObject: v forKey: anItem];
}
return v;
}
- (CGFloat)outlineView: (NSOutlineView*)outlineView
heightOfRowByItem: (OOOutlineRow*)aRow
{
if ([aRow note] != nil)
{
return 43;
}
return 23;
}
- (BOOL)outlineView: (NSOutlineView*)outlineView
acceptDrop: (id<NSDraggingInfo>)info
item: (OOOutlineRow*)item
childIndex: (NSInteger)index
{
auto *doc = document;
auto *v = view;
if (item == nil)
{
item = doc.root;
}
BOOL isMove = NO;
NSDictionary *options = nil;
// If this is a copy operation, then remove the type that will give us
// pointers to existing objects.
if (([info draggingSourceOperationMask] & NSDragOperationCopy) ||
([info draggingSource] != outlineView))
{
options = @{ NSPasteboardURLReadingContentsConformToTypesKey : @[ OOOUtlineXMLPasteboardType ] };
isMove = YES;
currentDocument = doc;
}
// FIXME: Handle index == -1 correctly
NSArray<OOOutlineRow*> *rows = [[info draggingPasteboard] readObjectsForClasses: @[ [OOOutlineRow class] ]
options: options];
currentDocument = nil;
auto *insertIndexes = [NSIndexSet indexSetWithIndexesInRange: NSMakeRange((NSUInteger)index, [rows count])];
object_map<OOOutlineRow*, NSMutableIndexSet*> removals;
// If we're not moving objects, then don't bother to find where they came
// from, they're all new.
if (isMove)
{
collectRowsToRemove(doc, rows, removals);
}
scoped_undo_grouping undo([doc undoManager], @"move rows");
// Register the reload first, so that it will be invoked after undoing all
// of the changes.
[undo.record(v) reloadItem: nil reloadChildren: YES];
[item.children insertObjects: rows atIndexes: insertIndexes];
[undo.record(item.children) removeObjectsAtIndexes: insertIndexes];
for (auto &[ row, indexes] : removals)
{
if (row == item)
{
[indexes shiftIndexesStartingAtIndex: (NSUInteger)index
by: (NSInteger)[rows count]];
}
auto *toRemove = [row.children objectsAtIndexes: indexes];
[undo.record(row.children) insertObjects: toRemove
atIndexes: indexes];
[row.children removeObjectsAtIndexes: indexes];
}
[v reloadItem: nil reloadChildren: YES];
return YES;
}
- (NSDragOperation)outlineView: (NSOutlineView*)outlineView
validateDrop: (id<NSDraggingInfo>)info
proposedItem: item
proposedChildIndex: (NSInteger)index
{
if ([info draggingSource] == view)
{
return NSDragOperationMove;
}
return NSDragOperationCopy;
}
- (BOOL)outlineView: (NSOutlineView*)outlineView
writeItems: (NSArray*)items
toPasteboard: (NSPasteboard*)pasteboard
{
[pasteboard writeObjects: items];
return YES;
}
- (id<NSPasteboardWriting>)outlineView: (NSOutlineView*)outlineView
pasteboardWriterForItem: item
{
return item;
}
- (std::tuple<OOOutlineRow*, NSMutableArray*, NSUInteger>)insertPoint
{
auto *doc = document;
auto *v = view;
OOOutlineRow *selected = [v itemAtRow: [v selectedRow]];
OOOutlineRow *row = (selected == nil) ? doc.root : [doc parentForRow: selected];
OOOutlineRow *parent = row;
if (row == doc.root)
{
parent = nil;
}
auto *children = row.children;
NSUInteger idx = selected ? [children indexOfObject: selected] + 1 : 0;
return { parent, children, idx };
}
- (IBAction)addRow: sender
{
auto *doc = document;
auto *v = view;
auto [ parent, children, idx ] = [self insertPoint];
auto *newRow = [[OOOutlineRow alloc] initInDocument: doc];
scoped_undo_grouping undo([doc undoManager], @"insert row");
[undo.record(v) reloadItem: parent reloadChildren: YES];
[undo.record(children) removeObjectAtIndex: idx];
[children insertObject: newRow atIndex: idx];
[v reloadItem: parent reloadChildren: YES];
[v selectRowIndexes: [NSIndexSet indexSetWithIndex: (NSUInteger)[v rowForItem: newRow]] byExtendingSelection: NO];
}
- (NSArray<OOOutlineRow*>*)selectedRows
{
NSIndexSet *selectedRows = [view selectedRowIndexes];
auto *v = view;
auto *rows = [NSMutableArray new];
for (auto i : IndexSetRange<>(selectedRows))
{
id item = [v itemAtRow: (NSInteger)i];
if ([item isKindOfClass: [OOOutlineRow class]])
{
[rows addObject: item];
}
}
return rows;
}
- (IBAction)deleteSelectedRows:(id)sender
{
auto *rows = [self selectedRows];
auto *doc = document;
auto *v = view;
object_map<OOOutlineRow*, NSMutableIndexSet*> removals;
collectRowsToRemove(doc, rows, removals);
scoped_undo_grouping undo([doc undoManager], @"delete rows");
// Register the reload first, so that it will be invoked after undoing all
// of the changes.
[undo.record(v) reloadItem: nil reloadChildren: YES];
for (auto &[row, indexes] : removals)
{
auto *toRemove = [row.children objectsAtIndexes: indexes];
[undo.record(row.children) insertObjects: toRemove
atIndexes: indexes];
[row.children removeObjectsAtIndexes: indexes];
}
[v reloadItem: nil reloadChildren: YES];
}
- (NSSet<OOOutlineRow*>*)selectedRowsExcludingChildren
{
auto *rows = [self selectedRows];
auto *rowSet = [NSMutableSet setWithArray: rows];
auto *doc = document;
// Filter out any rows that have a parent in the selection.
// These will be moved as a result of moving their parents.
for (OOOutlineRow *row : rows)
{
OOOutlineRow *parent = row;
while ((parent = [doc parentForRow: parent]))
{
if ([rowSet containsObject: parent])
{
[rowSet removeObject: row];
break;
}
}
}
return rowSet;
}
- (IBAction)increaseIndentLevel: (id)sender
{
auto *v = view;
auto *selectedIndexes = [v selectedRowIndexes];
auto *rows = [self selectedRowsExcludingChildren];
if ([rows count] == 0)
{
return;
}
auto *doc = document;
scoped_undo_grouping undo([doc undoManager], @"indent");
[undo.record(v) reloadItem: nil reloadChildren: YES];
std::vector<OOOutlineRow*> rowsToExpand;
for (OOOutlineRow *row in rows)
{
auto *parent = [doc parentForRow: row];
NSUInteger idx = [parent.children indexOfObject: row];
// You can't increase the indent level of a node that is already the
// first child of its parent, because there's no new parent to attach it
// to without reordering.
if (idx == 0)
{
continue;
}
auto *newParent = [parent.children objectAtIndex: idx-1];
[undo.record(parent.children) insertObject: row atIndex: idx];
[undo.record(newParent.children) removeObjectAtIndex: [newParent.children count]];
[newParent.children addObject: row];
[parent.children removeObjectAtIndex: idx];
if (!newParent.isExpanded)
{
[undo.record(newParent) setIsExpanded: NO];
[newParent setIsExpanded: YES];
}
rowsToExpand.push_back(newParent);
}
[v reloadItem: nil reloadChildren: YES];
for (OOOutlineRow *row in rows)
{
[[rowViews objectForKey: row] layout];
}
for (auto *r : rowsToExpand)
{
[v expandItem: r];
}
[v selectRowIndexes: selectedIndexes byExtendingSelection: NO];
}
- (void)runBlock: (void(^)(void))aBlock
{
aBlock();
}
- (IBAction)decreaseIndentLevel: (id)sender
{
auto *v = view;
auto *selectedIndexes = [v selectedRowIndexes];
auto *rows = [self selectedRowsExcludingChildren];
if ([rows count] == 0)
{
return;
}
auto *collapsedRows = [NSMutableArray new];
auto *doc = document;
scoped_undo_grouping undo([doc undoManager], @"unindent");
[undo.record(self) runBlock: ^()
{
for (OOOutlineRow *row in collapsedRows)
{
[v expandItem: row];
}
}];
[undo.record(v) reloadItem: nil reloadChildren: YES];
for (OOOutlineRow *row in rows)
{
auto *parent = [doc parentForRow: row];
auto *grandparent = [doc parentForRow: parent];
if (grandparent == nil)
{
continue;
}
NSUInteger newIdx = [grandparent.children indexOfObject: parent] +1;
NSUInteger oldIdx = [parent.children indexOfObject: row];
[undo.record(parent.children) insertObject: row atIndex: oldIdx];
[undo.record(grandparent.children) removeObjectAtIndex: newIdx];
[grandparent.children insertObject: row atIndex: newIdx];
[parent.children removeObjectAtIndex: oldIdx];
if ([parent isExpanded] && ([parent.children count] == 0))
{
[collapsedRows addObject: parent];
}
}
[v reloadItem: nil reloadChildren: YES];
for (OOOutlineRow *row in rows)
{
[[rowViews objectForKey: row] layout];
}
[v selectRowIndexes: selectedIndexes byExtendingSelection: NO];
}
- (IBAction)editNotes: (id)sender
{
auto *v = view;
NSInteger selectedRow = [v selectedRow];
if (selectedRow == -1)
{
return;
}
OOOutlineRow *row = [v itemAtRow: selectedRow];
// If this is already a notes row, then don't try to add it.
if (![row isKindOfClass: [OOOutlineRow class]])
{
return;
}
if (![row note])
{
[row setNote: [NSMutableAttributedString new]];
[v noteHeightOfRowsWithIndexesChanged: [NSIndexSet indexSetWithIndex: (NSUInteger)selectedRow]];
[v reloadItem: row reloadChildren: YES];
}
[[rowViews objectForKey: row] editNote];
}
- (IBAction)inspectColumns: (id)sender
{
if (columnInspector == nil)
{
columnInspector = [[OOColumnInspectorController alloc] initWithWindowNibName: @"ColumnInspector"];
[columnInspector setOutlineDocument: document];
}
[[columnInspector window] makeKeyAndOrderFront: self];
}
- (void)pasteFromPasteboard: (NSPasteboard*)aPasteboard
{
@try
{
currentDocument = document;
auto *objs = [aPasteboard readObjectsForClasses: @[ [OOOutlineRow class]]
options: nil];
// FIXME: We should do a lot more validation of number and types of rows!
auto [ parent, children, idx ] = [self insertPoint];
auto *doc = document;
auto *v = view;
scoped_undo_grouping undo([doc undoManager], @"paste");
[undo.record(v) reloadItem: parent reloadChildren: YES];
OOOutlineRow *newRow = nil;
for (newRow in objs)
{
[undo.record(children) removeObjectAtIndex: idx];
[children insertObject: newRow atIndex: idx++];
}
NSUInteger newIdx = static_cast<NSUInteger>([v selectedRow]) + [objs count];
[v reloadItem: parent reloadChildren: YES];
[v selectRowIndexes: [NSIndexSet indexSetWithIndex: newIdx]
byExtendingSelection: NO];
}
@finally
{
currentDocument = nil;
}
}
- (BOOL)canCopy
{
return [[view selectedRowIndexes] count] > 0;
}
- (BOOL)canPaste
{
auto *pb = [NSPasteboard generalPasteboard];
return [[pb types] containsObject: OOOUtlineXMLPasteboardType];
}
#ifdef TRACE_METHOD_QUERIES
- (BOOL)respondsToSelector:(SEL)aSelector
{
if (![super respondsToSelector: aSelector])
{
NSLog(@"%@", NSStringFromSelector(aSelector));
return NO;
}
return YES;
}
#endif
@end