/
AtoZ.h
674 lines (534 loc) · 19.6 KB
/
AtoZ.h
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
668
669
670
671
672
673
#import <Availability.h>
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import <SystemConfiguration/SystemConfiguration.h>
#import <MobileCoreServices/MobileCoreServices.h>
#else
#import <SystemConfiguration/SystemConfiguration.h>
#import <CoreServices/CoreServices.h>
#endif
#import <TargetConditionals.h>
#if TARGET_OS_IPHONE
#import <MobileCoreServices/MobileCoreServices.h>
#import <sys/xattr.h>
#else
#import <CoreServices/CoreServices.h>
#endif
#import <libkern/OSAtomic.h>
#import <sys/xattr.h>
#import <sys/sysctl.h>
#import <unistd.h>
#import <dirent.h>
#import <sys/stat.h>
#import <xpc/xpc.h>
#import <objc/runtime.h>
#import <objc/message.h>
#import <sys/time.h>
#include <sys/types.h>
#include <pwd.h>
#import <Cocoa/Cocoa.h>
#import <Quartz/Quartz.h>
#import <Carbon/Carbon.h>
#import <Python/Python.h>
#import <AppKit/AppKit.h>
#import <QuartzCore/QuartzCore.h>
#import <Foundation/Foundation.h>
#import <AudioToolbox/AudioToolbox.h>
#import <ApplicationServices/ApplicationServices.h>
#ifndef DSFavIcon_UINSImage_h
#define DSFavIcon_UINSImage_h
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
#define UINSImage UIImage
#define UINSScreen UIScreen
#else
#import <Cocoa/Cocoa.h>
#define UINSImage NSImage
#define UINSScreen NSScreen
#endif
#endif
//#pragma GCC diagnostic ignored "-Wformat-security"
//#import <NanoStore/NSFNanoObjectProtocol.h>
//#import <NanoStore/NSFNanoObject.h>
//#import <NanoStore/NSFNanoGlobals.h>
//#import <NanoStore/NSFNanoStore.h>
//#import <NanoStore/NSFNanoPredicate.h>
//#import <NanoStore/NSFNanoExpression.h>
//#import <NanoStore/NSFNanoSearch.h>
//#import <NanoStore/NSFNanoSortDescriptor.h>
//#import <NanoStore/NSFNanoResult.h>
//#import <NanoStore/NSFNanoBag.h>
//#import <NanoStore/NSFNanoEngine.h>
//#import <NanoStore/NSFNanoGlobals.h>
//#import <Growl/Growl.h>
//#import "Nu.h"
// ARC is compatible with iOS 4.0 upwards, but you need at least Xcode 4.2 with Clang LLVM 3.0 to compile it.
//#if !__has_feature(objc_arc)
//#error This project must be compiled with ARC (Xcode 4.2+ with LLVM 3.0 and above)
//#endif
//#define EXCLUDE_STUB_PROTOTYPES 1
//#import <PLWeakCompatibility/PLWeakCompatibilityStubs.h>
#import <BlocksKit/BlocksKit.h>
#import <CocoaPuffs/CocoaPuffs.h>
#import <CocoatechCore/CocoatechCore.h>
#import <DrawKit/DKDrawKit.h>
#import <FunSize/FunSize.h>
#import <Lumberjack/Lumberjack.h>
#import <KSHTMLWriterFramework/KSHTMLWriterFramework.h>
#import <MapKit/MapKit.h>
#import <NoodleKit/NoodleKit.h>
//#import <Nu/Nu.h>
#import <PhFacebook/PhFacebook.h>
#import <Rebel/Rebel.h>
#import <TwUI/TUIKit.h>
#import <Zangetsu/Zangetsu.h>
#import <AtoZBezierPath/AtoZBezierPath.h>
#import <AtoZAppKit/BGHUDAppKit.h>
#import "AtoZUmbrella.h"
//#import <AtoZUI/AtoZUI.h>
//#import <RMKit/RMKit.h>
//#import <NanoStore/NanoStore.h>
//#import <KSHTMLWriterFramework/KS>
//#import <MapKit/MapKit.h>
//#import <XPCKit/XPCKit.h>
//#import <Zangetsu/Zangetsu.h>
//typedef void(^log)(NSS*s);
// Log levels: off, error, warn, info, verbose
static const int ddLogLevel = LOG_LEVEL_VERBOSE;
/* MODEL */
#import "JsonElement.h"
#import "AutoCoding.h"
#import "HRCoder.h"
#import "BaseModel.h"
/* ESSENTIAL */
#import "F.h"
#import "NSBag.h"
#import "NSArray+F.h"
#import "NSNumber+F.h"
#import "NSDictionary+F.h"
#import "NSOperationStack.h"
#import "AZStopwatch.h"
#import "ConciseKit.h"
#import "NSArray+AtoZ.h"
#import "AtoZUmbrella.h"
#import "AtoZGeometry.h"
#import "AtoZFunctions.h"
#import "SDToolkit.h"
#import "MAKVONotificationCenter.h"
#import "AZHTTPURLProtocol.h"
#import "BlocksAdditions.h"
#import "PythonOperation.h"
#import "NotificationCenterSpy.h"
#import "TransparentWindow.h"
#import "LoremIpsum.h"
#import "AFNetworking.h"
//#import <RoutingHTTPServer/RoutingHTTPServer.h>
#import "Bootstrap.h"
/* FACEBOOK */
#import "AssetCollection.h"
#import "AZHTTPRouter.h"
#import "AZFacebookConnection.h"
#import "GCDAsyncSocket.h"
#import "HTTPServer.h"
#import "HTTPConnection.h"
#import "HTTPMessage.h"
#import "HTTPResponse.h"
#import "HTTPAuthenticationRequest.h"
#import "DDNumber.h"
#import "DDRange.h"
#import "DDData.h"
#import "HTTPFileResponse.h"
#import "HTTPAsyncFileResponse.h"
#import "WebSocket.h"
#import "HTTPLogging.h"
// CORE
#import "CAScrollView.h"
#import "AssetCollection.h"
#import "AZSpeechRecognition.h"
// END CORE
#import "AZTalker.h"
#import "SynthesizeSingleton.h"
#import "iCarousel.h"
//#import "azCarousel.h"
#import "CTGradient.h"
#import "AZApplePrivate.h"
#import "RuntimeReporter.h"
#import "CTBadge.h"
#import "AZBackgroundProgressBar.h"
// #import "AZPalette.h"
// #import "AZObject.h"
// #import "AZFile.h"
// #import "AtoZModels.h"
// #import "AZObject.h"
// #import "AtoZModels.h"
/* STACKEXCHANGE */
#import "SIConstants.h"
#import "SIAppCookieJar.h"
#import "NSHTTPCookie+Testing.h"
#import "SIWindow.h"
#import "SIInboxDownloader.h"
#import "ASIHTTPRequest.h"
#import "JSONKit.h"
#import "SIInboxModel.h"
#import "SIAuthController.h"
#import "SIViewControllers.h"
//#import "DSURLDataSource.h"
//#import "CKSingleton.h"
#import "AtoZGridView.h"
#import "AtoZGridViewProtocols.h"
#import "AtoZColorWell.h"
#import "AZCalculatorController.h"
#import "AZLayer.h"
#import "AZASIMGV.h"
#import "AZSizer.h"
#import "AZMouser.h"
#import "AtoZModels.h"
#import "KGNoise.h"
/* FOUNDATION CATEGORIES */
#import "NSBundle+AtoZ.h"
#import "NSDictionary+AtoZ.h"
#import "NSFileManager+AtoZ.h"
#import "NSImage+AtoZ.h"
#import "NSImage-Tint.h"
#import "NSIndexSet+AtoZ.h"
#import "NSNotificationCenter+AtoZ.h"
#import "NSNumber+AtoZ.h"
#import "NSObject-Utilities.h"
#import "NSObject+AtoZ.h"
#import "NSObject+Properties.h"
#import "NSScreen+AtoZ.h"
#import "NSString+AtoZ.h"
#import "NSThread+AtoZ.h"
#import "NSUserDefaults+Subscript.h"
#import "NSValue+AtoZ.h"
//#import "NSManagedObjectContext+EasyFetch.h"
//#import "NSUserDefaults+AtoZ.h"
/* COCOA CATEGORIES */
#import "NSDate+AtoZ.h"
#import "NSFont+AtoZ.h"
#import "NSOutlineView+AtoZ.h"
#import "NSTask+OneLineTasksWithOutput.h"
#import "NSEvent+AtoZ.h"
#import "CAAnimation+AtoZ.h"
#import "CALayer+AtoZ.h"
#import "NSApplication+AtoZ.h"
#import "NSURL+AtoZ.h"
#import "NSCell+AtoZ.h"
#import "NSBezierPath+AtoZ.h"
#import "NSColor+AtoZ.h"
#import "NSShadow+AtoZ.h"
#import "NSView+AtoZ.h"
#import "NSWindow+AtoZ.h"
#import "NSTableView+AtoZ.h"
//#import "MondoSwitch.h"
//#import "AZToggleView.h"
/* FOUNDATION CLASSES */
#import "NSOrderedDictionary.h"
#import "AZWeakCollections.h"
/* COLOR AND IMAGE CLASSES */
#import "AZSimpleView.h"
//Classes
#import "AZHomeBrew.h"
#import "AZDebugLayer.h"
#import "AZInstantApp.h"
#import "AddressBookImageLoader.h"
#import "AZHostView.h"
#import "AZSegmentedRect.h"
#import "AZFavIconManager.h"
#import "AZQueue.h"
#import "AZDockQuery.h"
#import "AZAXAuthorization.h"
//#import "AZNotificationCenter.h"
#import "NSLogConsole.h"
#import "AZLaunchServices.h"
#import "AZLassoView.h"
#import "AZBackground.h"
#import "AZCSSColors.h"
#import "AZSound.h"
#import "Transition.h"
#import "LetterView.h"
#import "CPAccelerationTimer.h"
#import "StandardPaths.h"
/* CONTROLS */
#import "AZToggleArrayView.h"
#import "AZDarkButtonCell.h"
//#import "SNRHUDKit.h"
#import "SNRHUDButtonCell.h"
#import "SNRHUDImageCell.h"
#import "SNRHUDScrollView.h"
#import "SNRHUDSegmentedCell.h"
#import "SNRHUDTextFieldCell.h"
#import "SNRHUDTextView.h"
#import "SNRHUDWindow.h"
/* WINDOWS */
#import "AZAttachedWindow.h"
#import "AZBorderlessResizeWindow.h"
#import "AZSemiResponderWindow.h"
#import "AZTrackingWindow.h"
#import "AZWindowExtend.h"
#import "CAWindow.h"
#import "MAAttachedWindow.h"
#import "NSWindow_Flipr.h"
/* CoreScroll */
#import "AZCoreScrollView.h"
#import "AZTimeLineLayout.h"
#import "AZScrollPaneLayer.h"
#import "AZScrollerLayer.h"
#import "WebView+AtoZ.h"
// #import "AZSnapShotLayer.h"
#import "AtoZWebSnapper.h"
#import "AZURLSnapshot.h"
#import "AZHTMLParser.h"
//#import "HTMLNode.h"
// Views
#import "AtoZInfinity.h"
#import "AZBlockView.h"
#import "AZIndeterminateIndicator.h"
#import "AZLassoLayer.h"
#import "AZLassoView.h"
#import "AZFoamView.h"
#import "AZMedallionView.h"
#import "AZPopupWindow.h"
#import "AZPrismView.h"
#import "AZPropellerView.h"
#import "AZProgressIndicator.h"
#import "AZSimpleView.h"
#import "AZBox.h"
#import "AZBoxGrid.h"
#import "AZBoxMagic.h"
#import "AZInfiniteCell.h"
#import "AZSourceList.h"
#import "BBMeshView.h"
#import "CalcModel.h"
#import "NSTextView+AtoZ.h"
#import "StarLayer.h"
#import "NSSplitView+DMAdditions.h"
#import "XLDragDropView.h"
#import "AZVeil.h"
#import "PXListView.h"
#import "PXListViewCell.h"
#import "PXListDocumentView.h"
// TwUI
#import "TUIView+Dimensions.h"
#import "AHLayout.h"
#import "AZExpandableView.h"
// COREDATA
#import "AZImageToDataTransformer.h"
// UNUSED
//#import "AZFileGridView.h"
//#import "AZBoxLayer.h"
//#import "AZOverlay.h"
/* xcode shortcuts @property (nonatomic, assign) <\#type\#> <\#name\#>; */
/* http://stackoverflow.com/questions/4224495/using-an-nsstring-in-a-switch-statement
You can use it as
FilterBlock fb1 = ^id(id element, NSUInteger idx, BOOL *stop){ if ([element isEqualToString:@"YES"]) { NSLog(@"You did it"); *stop = YES;} return element;};
FilterBlock fb2 = ^id(id element, NSUInteger idx, BOOL *stop){ if ([element isEqualToString:@"NO"] ) { NSLog(@"Nope"); *stop = YES;} return element;};
NSArray *filter = @[ fb1, fb2 ];
NSArray *inputArray = @[@"NO",@"YES"];
[inputArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
[obj processByPerformingFilterBlocks:filter];
}];
but you can also do more complicated stuff, like aplied chianed calculations:
FilterBlock b1 = ^id(id element,NSUInteger idx, BOOL *stop) {return [NSNumber numberWithInteger:[(NSNumber *)element integerValue] *2 ];};
FilterBlock b2 = ^id(NSNumber* element,NSUInteger idx, BOOL *stop) {
*stop = YES;
return [NSNumber numberWithInteger:[element integerValue]*[element integerValue]];
};
FilterBlock b3 = ^id(NSNumber* element, NSUInteger idx,BOOL *stop) {return [NSNumber numberWithInteger:[element integerValue]*[element integerValue]];};
NSArray *filterBlocks = @[b1,b2, b3, b3, b3];
NSNumber *numberTwo = [NSNumber numberWithInteger:2];
NSNumber *numberTwoResult = [numberTwo processByPerformingFilterBlocks:filterBlocks];
NSLog(@"%@ %@", numberTwo, numberTwoResult);
*/
typedef id(^FilterBlock)(id element,NSUInteger idx, BOOL *stop);
@interface NSObject (AZFunctional)
-(id)processByPerformingFilterBlocks:(NSArray *)filterBlocks;
@end
//static NSEventMask AZMouseActive = NSMouseMovedMask | NSMouseExitedMask |NSMouseEnteredMask);
//static NSEventMask AZMouseButton = NS | NSMouseExitedMask |NSMouseEnteredMask;
/* A shared operation que that is used to generate thumbnails in the background. */
extern NSOperationQueue *AZSharedOperationQueue(void);
extern NSOperationQueue *AZSharedSingleOperationQueue(void);
extern NSOperationQueue *AZSharedOperationStack(void);
@interface NSObject (debugandreturn)
- (id) debugReturn:(id) val;
@end
extern NSString *const AtoZSharedInstanceUpdated;
extern NSString *const AtoZDockSortedUpdated;
@interface NSObject (AtoZDelegate)
- (void) dockItemDidUpdateValues:(NSNotification*)info;
@end
#import "OperationsRunner.h"
@interface AZDummy : NSObject
+ (instancetype) sharedInstance;
//- (void)addOperation:(NSOperation*)op;
@property (NATOM, STRNG) NSOperationQueue *sharedQ, *sharedSQ, *sharedStack;
@end
/*
@class AZTaskResponder;
typedef void (^asyncTaskCallback)(AZTaskResponder *response);
@interface AZTaskResponder: BaseModel
@property (copy) BKReturnBlock returnBlock;
@property (copy) asyncTaskCallback asyncTask;
@property (NATOM,STRNG) id response;
//Atoz
+ (void) aSyncTask:(asyncTaskCallback)handler;
- (void) parseAsyncTaskResponse;
// this is how we make the call:
// [AtoZ aSyncTask:^(AZTaskResponder *response) { respond to result; }];
@end
*/
@class NSLogConsole;
@interface AtoZ : BaseModel
@property (ASS) IBOutlet NSTextView *stdOutView;
@property (NATOM,STRNG) NSColor* logColor;
- (void) appendToStdOutView:(NSS*)text;
@property (NATOM, STRNG) NSA *basicFunctions;
#ifdef GROWL_ENABLED
- (BOOL) registerGrowl;
<GrowlApplicationBridgeDelegate>
#endif
//+ (NSIMG*)imageNamed:(NSString *)name;
//@property (NATOM, STRNG) SoundManager *sManager;
+ (void) playSound:(id)number;
+ (void) playRandomSound;
+ (NSF*) controlFont;
+ (NSA*) fonts;
+ (NSF*) font:(NSS*)family size:(CGF)size;
@property (NATOM, STRNG) NSA* fonts;
@property (RONLY) NSA* cachedImages;
+ (NSS*) tempFilePathWithExtension:(NSS*)extension;
+ (NSS*) randomFontName;
+ (void) plistToXML: (NSS*) path;
+ (NSA*) dock;
+ (NSA*) dockSorted;
+ (NSA*) runningApps;
+ (NSA*) runningAppsAsStrings;
//+ (void) testSizzle;
//+ (void) testSizzleReplacement;
//+ (NSA*) currentScope;
//+ (NSA*) fengShui;
//+ (NSA*) appFolder;
//+ (NSA*) appCategories;
//+ (NSA*) appFolderSorted;
//+ (NSA*) appFolderSamplerWith: (NSUInteger) apps;
+ (void) trackIt;
- (NSP) convertToScreenFromLocalPoint: (NSP) point relativeToView: (NSV*) view;
- (void) moveMouseToScreenPoint: (NSP) point;
- (void) handleMouseEvent: (NSEventMask)event inView: (NSV*)view withBlock: (void (^)())block;
+ (AZPOS) positionForString: (NSS*)strVal;
+ (NSS*) stringForPosition:(AZPOS)enumVal;
+ (NSS*) stringForType: (id)type;
//+ (NSFont*) fontWithSize: (CGFloat) fontSize;
//- (NSFont*) registerFonts:(CGFloat)size;
- (NSJSONSerialization*) jsonRequest: (NSString*) url;
+ (NSJSONSerialization*) jsonRequest: (NSString*) url;
+ (NSS*) version;
+ (NSB*) bundle;
+ (NSS*) resources;
+ (NSA*) appCategories;
+ (NSA*) macPortsCategories;
@property (nonatomic, retain) NSBundle *bundle;
/*@property (strong, nonatomic) NSLogConsole *console;
- (id)objectForKeyedSubscript:(NSString *)key; - (void)setObject:(id)newValue forKeyedSubscription:(NSString *)key; */
//- (void) performBlock:(VoidBlock)block;
- (void) performBlock:(VoidBlock)block waitUntilDone:(BOOL)wait;
+ (void) playNotificationSound: (NSD*)apsDictionary;
+ (void) badgeApplicationIcon: (NSS*)string;
@end
@interface AtoZ (MiscFunctions)
+ (void) say:(NSS*)thing;
+ (CGF) clamp: (CGF)value from:(CGF)minimum to:(CGF)maximum;
+ (CGF) scaleForSize: (CGS)size inRect:(CGR)rect;
+ (CGR) centerSize: (CGS)size inRect:(CGR)rect;
+ (CGP) centerOfRect: (CGR)rect;
+ (NSR) rectFromPointA:(NSP)pointA andPointB:(NSP)pointB;
+ (void) printRect: (NSR)toPrint;
+ (void) printCGRect: (CGR)cgRect;
+ (void) printPoint: (NSP)toPrint;
+ (void) printCGPoint: (CGP)cgPoint;
+ (void) printTransform:(CGAffineTransform)t;
+ (NSImage*)cropImage:(NSImage*)sourceImage withRect:(NSRect)sourceRect;
@end
typedef void (^KVOLastChangedBlock)( NSS *whatKeyChanged, id whichInstance, id newVal);
@interface BaseModel (AtoZ)
+ (instancetype) objectAtIndex:(NSUI)idx;
+ (void) setLastChangedBlock:(KVOLastChangedBlock)lastChangedBlock;
// Shared instance is the object modified after each key change
// After being notified of change to the shared instance, call this to get last modified key of last modified instance
+ (instancetype) lastModifiedInstance;
+ (NSS*) lastModifiedKey;
+ (void) setLastModifiedKey:(NSS*)key forInstance:(id)object;
- (id) valueForUndefinedKey:(NSString *)key;
//+ (instancetype) swizzleInstanceWithObject:(id)obj;
- (void) swizzleSave;
@property (RONLY) NSString *uniqueID;
- (NSS*) uniqueID;
@property (RONLY) NSA *superProperties;
@property (RONLY) NSUI instanceNumber;
- (NSUI) instanceNumber;
+ (NSUI) instances;
@property (NATOM, ASS) BOOL convertToXML;
+ (NSS*)saveFilePath;
- (id)objectAtIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj atIndexedSubscript:(NSUInteger)idx;
- (void)setObject:(id)obj forKeyedSubscript:(id <NSCopying>)key;
- (id)objectForKeyedSubscript:(id)key;
@end
//
//@implementation NSArray (SubscriptsAdd)
//- (id)objectAtIndexedSubscript:(NSUInteger)index {
// return [self objectAtIndex:index];
//}
//@end
//
//@implementation NSMutableArray (SubscriptsAdd)
//- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index {
// if (index < self.count){
// if (object)
// [self replaceObjectAtIndex:index withObject:object];
// else
// [self removeObjectAtIndex:index];
// } else {
// [self addObject:object];
// }
//}
//@end
//@implementation NSDictionary (SubscriptsAdd)
//- (id)objectForKeyedSubscript:(id)key {
// return [self objectForKey:key];
//}
//@end
//@implementation NSMutableDictionary (SubscriptsAdd)
//- (void)setObject:(id)object forKeyedSubscript:(id)key {
// [self setObject:object forKey:key];
//}
//@end
@interface Box : NSView
@property (ASS) BOOL selected;
@property (RDWRT,CP) CASHL *shapeLayer;
@property (RDWRT,CP) NSC *save, *color;
@end
@interface CAAnimation (NSViewFlipper)
+(CAA*)flipAnimationWithDuration:(NSTI)duration forLayerBeginningOnTop:(BOOL)beginsOnTop scaleFactor:(CGF)scaleFactor;
@end
@interface NSViewFlipperController : NSObject {
NSView *hostView, *frontView, *backView, *topView, *bottomView;
CALayer *topLayer, *bottomLayer;
NSTimeInterval duration;
BOOL isFlipped;
}
@property (RONLY) BOOL isFlipped;
@property (ASS) NSTI duration;
@property (WK,RONLY) NSView *visibleView;
- (id) initWithHostView:(NSV*)newHost frontView:(NSV*)newFrontView backView:(NSV*)newBackView;
-(void) flip;
@end
@interface CAConstraint (brevity)
//+(CAConstraint*)maxX;
@end
/** The appledoc application handler.
This is the principal tool class. It represents the entry point for the application. The main promises of the class are parsing and validating of command line arguments and initiating documentation generation. Generation is divided into several distinct phases:
1. Parsing data from source files: This is the initial phase where input directories and files are parsed into a memory representation (i.e. objects) suitable for subsequent handling. This is where the source code files are parsed and validated for possible file or object-level incosistencies. This step is driven by `GBParser` class.
2. Post-processing of the data parsed in the previous step: At this phase, we already have in-memory representation of all source code objects, so we can post-process and validate things such as links to other objects etc. We can also update in-memory representation with this data and therefore prepare everything for the final phase. This step is driven by `GBProcessor` class.
3. Generating output: This is the final phase where we use in-memory data to generate output. This step is driven by `GBGenerator` class.
@warning *Global settings implementation details:* To be able to properly apply all levels of settings - factory defaults, global settings and command line arguments - we can't solely rely on `DDCli` for parsing command line args. As the user can supply templates path from command line (instead of using one of the default paths), we need to pre-parse command line arguments for templates switches. The last one found is then used to read global settings. This solves proper settings inheritance up to global settings level. Another issue is how to implement code that deals with global settings; there are several possible solutions (the simplest from programmers point of view would be to force the user to pass in templates path as the first parameter, then `DDCli` would first process this and when we would receive notification, we could parse the option, load in global settings and resume operation). At the end I chose to pre-parse command line for template arguments before passing it to `DDCli`. This did require some tweaking to `DDCli` code (specifically the method that converts option string to KVC key was moved to public interface), but ended up as very simple to inject global settings - by simply using the same KCV messages as `DDCli` uses. This small tweak allowed us to use exactly the same path of handling global settings as normal command line arguments. The benefits are many: all argument names are alreay unit tested to properly map to settings values, code reuse for setting the values. */