-
Notifications
You must be signed in to change notification settings - Fork 2
/
SRCommon.m
507 lines (384 loc) · 20.3 KB
/
SRCommon.m
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
//
// SRCommon.m
// ShortcutRecorder
//
// Copyright 2006-2007 Contributors. All rights reserved.
//
// License: BSD
//
// Contributors:
// David Dauer
// Jesper
// Jamie Kirkpatrick
#import "SRCommon.h"
#import "SRKeyCodeTransformer.h"
//#define SRCommon_PotentiallyUsefulDebugInfo
#ifdef SRCommon_PotentiallyUsefulDebugInfo
#define PUDNSLog(X, ...) NSLog(X, ## __VA_ARGS__)
#else
#define PUDNSLog(X, ...) {; }
#endif
#pragma mark -
#pragma mark dummy class
@implementation SRDummyClass @end
#pragma mark -
//----------------------------------------------------------
// SRStringForKeyCode()
//----------------------------------------------------------
NSString * SRStringForKeyCode(signed short keyCode) {
static SRKeyCodeTransformer *keyCodeTransformer = nil;
if (!keyCodeTransformer) keyCodeTransformer = [[SRKeyCodeTransformer alloc] init];
return [keyCodeTransformer transformedValue:[NSNumber numberWithShort:keyCode]];
}
//----------------------------------------------------------
// SRStringForCarbonModifierFlags()
//----------------------------------------------------------
NSString * SRStringForCarbonModifierFlags(unsigned int flags) {
NSString *modifierFlagsString = [NSString stringWithFormat:@"%@%@%@%@",
(flags & controlKey ? [NSString stringWithFormat : @"%C", (unichar)KeyboardControlGlyph] : @""),
(flags & optionKey ? [NSString stringWithFormat : @"%C", (unichar)KeyboardOptionGlyph] : @""),
(flags & shiftKey ? [NSString stringWithFormat : @"%C", (unichar)KeyboardShiftGlyph] : @""),
(flags & cmdKey ? [NSString stringWithFormat : @"%C", (unichar)KeyboardCommandGlyph] : @"")];
return modifierFlagsString;
}
//----------------------------------------------------------
// SRStringForCarbonModifierFlagsAndKeyCode()
//----------------------------------------------------------
NSString * SRStringForCarbonModifierFlagsAndKeyCode(unsigned int flags, signed short keyCode) {
return [NSString stringWithFormat:@"%@%@",
SRStringForCarbonModifierFlags(flags),
SRStringForKeyCode(keyCode)];
}
//----------------------------------------------------------
// SRStringForCocoaModifierFlags()
//----------------------------------------------------------
NSString * SRStringForCocoaModifierFlags(unsigned int flags) {
NSString *modifierFlagsString = [NSString stringWithFormat:@"%@%@%@%@",
(flags & NSEventModifierFlagControl ? [NSString stringWithFormat : @"%C", (unichar)KeyboardControlGlyph] : @""),
(flags & NSEventModifierFlagOption ? [NSString stringWithFormat : @"%C", (unichar)KeyboardOptionGlyph] : @""),
(flags & NSEventModifierFlagShift ? [NSString stringWithFormat : @"%C", (unichar)KeyboardShiftGlyph] : @""),
(flags & NSEventModifierFlagCommand ? [NSString stringWithFormat : @"%C", (unichar)KeyboardCommandGlyph] : @"")];
return modifierFlagsString;
}
//----------------------------------------------------------
// SRStringForCocoaModifierFlagsAndKeyCode()
//----------------------------------------------------------
NSString * SRStringForCocoaModifierFlagsAndKeyCode(unsigned int flags, signed short keyCode) {
return [NSString stringWithFormat:@"%@%@",
SRStringForCocoaModifierFlags(flags),
SRStringForKeyCode(keyCode)];
}
//----------------------------------------------------------
// SRReadableStringForCarbonModifierFlagsAndKeyCode()
//----------------------------------------------------------
NSString * SRReadableStringForCarbonModifierFlagsAndKeyCode(unsigned int flags, signed short keyCode) {
NSString *readableString = [NSString stringWithFormat:@"%@%@%@%@%@",
(flags & cmdKey ? SRLoc(@"Command + ") : @""),
(flags & optionKey ? SRLoc(@"Option + ") : @""),
(flags & controlKey ? SRLoc(@"Control + ") : @""),
(flags & shiftKey ? SRLoc(@"Shift + ") : @""),
SRStringForKeyCode(keyCode)];
return readableString;
}
//----------------------------------------------------------
// SRReadableStringForCocoaModifierFlagsAndKeyCode()
//----------------------------------------------------------
NSString * SRReadableStringForCocoaModifierFlagsAndKeyCode(unsigned int flags, signed short keyCode) {
NSString *readableString = [NSString stringWithFormat:@"%@%@%@%@%@",
(flags & NSEventModifierFlagCommand ? SRLoc(@"Command + ") : @""),
(flags & NSEventModifierFlagOption ? SRLoc(@"Option + ") : @""),
(flags & NSEventModifierFlagControl ? SRLoc(@"Control + ") : @""),
(flags & NSEventModifierFlagShift ? SRLoc(@"Shift + ") : @""),
SRStringForKeyCode(keyCode)];
return readableString;
}
//----------------------------------------------------------
// SRCarbonToCocoaFlags()
//----------------------------------------------------------
unsigned int SRCarbonToCocoaFlags(unsigned int carbonFlags) {
unsigned int cocoaFlags = ShortcutRecorderEmptyFlags;
if (carbonFlags & cmdKey) cocoaFlags |= NSEventModifierFlagCommand;
if (carbonFlags & optionKey) cocoaFlags |= NSEventModifierFlagOption;
if (carbonFlags & controlKey) cocoaFlags |= NSEventModifierFlagControl;
if (carbonFlags & shiftKey) cocoaFlags |= NSEventModifierFlagShift;
if (carbonFlags & NSEventModifierFlagFunction) cocoaFlags += NSEventModifierFlagFunction;
return cocoaFlags;
}
//----------------------------------------------------------
// SRCocoaToCarbonFlags()
//----------------------------------------------------------
unsigned int SRCocoaToCarbonFlags(unsigned int cocoaFlags) {
unsigned int carbonFlags = ShortcutRecorderEmptyFlags;
if (cocoaFlags & NSEventModifierFlagCommand) carbonFlags |= cmdKey;
if (cocoaFlags & NSEventModifierFlagOption) carbonFlags |= optionKey;
if (cocoaFlags & NSEventModifierFlagControl) carbonFlags |= controlKey;
if (cocoaFlags & NSEventModifierFlagShift) carbonFlags |= shiftKey;
if (cocoaFlags & NSEventModifierFlagFunction) carbonFlags |= NSEventModifierFlagFunction;
return carbonFlags;
}
//----------------------------------------------------------
// SRCharacterForKeyCodeAndCarbonFlags()
//----------------------------------------------------------
NSString * SRCharacterForKeyCodeAndCarbonFlags(signed short keyCode, unsigned int carbonFlags) {
return SRCharacterForKeyCodeAndCocoaFlags(keyCode, SRCarbonToCocoaFlags(carbonFlags));
}
//----------------------------------------------------------
// SRCharacterForKeyCodeAndCocoaFlags()
//----------------------------------------------------------
NSString * SRCharacterForKeyCodeAndCocoaFlags(signed short keyCode, unsigned int cocoaFlags) {
PUDNSLog(@"SRCharacterForKeyCodeAndCocoaFlags, keyCode: %hi, cocoaFlags: %u",
keyCode, cocoaFlags);
// Fall back to string based on key code:
#define FailWithNaiveString SRStringForKeyCode(keyCode)
UCKeyboardLayout *uchrData;
void *KCHRData;
SInt32 keyLayoutKind;
KeyboardLayoutRef currentLayout;
UInt32 keyTranslateState;
// UInt32 deadKeyState;
OSStatus err = noErr;
CFLocaleRef locale = CFLocaleCopyCurrent();
CFMutableStringRef resultString;
err = KLGetCurrentKeyboardLayout(¤tLayout);
if (err != noErr) return FailWithNaiveString;
err = KLGetKeyboardLayoutProperty(currentLayout, kKLKind, (const void **)&keyLayoutKind);
if (err != noErr) return FailWithNaiveString;
if (keyLayoutKind == kKLKCHRKind) {
PUDNSLog(@"KCHR kind key layout");
err = KLGetKeyboardLayoutProperty(currentLayout, kKLKCHRData, (const void **)&KCHRData);
if (err != noErr) return FailWithNaiveString;
} else {
PUDNSLog(@"uchr kind key layout");
err = KLGetKeyboardLayoutProperty(currentLayout, kKLuchrData, (const void **)&uchrData);
if (err != noErr) return FailWithNaiveString;
}
if (keyLayoutKind == kKLKCHRKind) {
UInt16 keyc = (UInt16)keyCode;
keyc |= (1 << 7);
if (cocoaFlags & NSEventModifierFlagOption) keyc |= optionKey;
if (cocoaFlags & NSEventModifierFlagShift) keyc |= shiftKey;
UInt32 charCode = KeyTranslate(KCHRData, keyc, &keyTranslateState);
charCode = CFSwapInt32BigToHost(charCode);
PUDNSLog(@"char code: %X", charCode);
UniChar chars[2];
CFIndex length = 0;
// Thanks to Peter Hosey for this particular piece of henious villainy.
union {
UInt32 uint32;
struct { // No, we don't need to conditionally compile these with different orders since we swap the int.
char reserved1;
char char1;
char reserved2;
char char2;
} charStruct;
} charactersUnion;
charactersUnion.uint32 = charCode;
if (charactersUnion.charStruct.char1) {
chars[0] = charactersUnion.charStruct.char1;
chars[1] = charactersUnion.charStruct.char2;
length = 2;
} else {
chars[0] = charactersUnion.charStruct.char2;
length = 1;
}
CFStringRef temp = CFStringCreateWithCharacters(kCFAllocatorDefault, chars, length);
resultString = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, temp);
if (temp) CFRelease(temp);
} else {
// EventModifiers modifiers = 0;
// if (cocoaFlags & NSEventModifierFlagOption) modifiers |= optionKey;
// if (cocoaFlags & NSEventModifierFlagShift) modifiers |= shiftKey;
// UniCharCount maxStringLength = 4, actualStringLength;
UniChar unicodeString[4];
// err = UCKeyTranslate(uchrData, (UInt16)keyCode, kUCKeyActionDisplay, modifiers, LMGetKbdType(), kUCKeyTranslateNoDeadKeysBit, &deadKeyState, maxStringLength, &actualStringLength, unicodeString);
CFStringRef temp = CFStringCreateWithCharacters(kCFAllocatorDefault, unicodeString, 1);
resultString = CFStringCreateMutableCopy(kCFAllocatorDefault, 0, temp);
if (temp) CFRelease(temp);
}
CFStringCapitalize(resultString, locale);
CFRelease(locale);
PUDNSLog(@"character: -%@-", (NSString *)resultString);
return (NSString *)resultString;
}
#pragma mark Animation Easing
// From: http://developer.apple.com/samplecode/AnimatedSlider/ as "easeFunction"
double SRAnimationEaseInOut(double t) {
// This function implements a sinusoidal ease-in/ease-out for t = 0 to 1.0. T is scaled to represent the interval of one full period of the sine function, and transposed to lie above the X axis.
double x = ((sin((t * M_PI) - M_PI_2) + 1.0) / 2.0);
// NSLog(@"SRAnimationEaseInOut: %f. a: %f, b: %f, c: %f, d: %f, e: %f", t, (t * M_PI), ((t * M_PI) - M_PI_2), sin((t * M_PI) - M_PI_2), (sin((t * M_PI) - M_PI_2) + 1.0), x);
return x;
}
#pragma mark -
#pragma mark additions
@implementation NSBezierPath (SRAdditions)
//----------------------------------------------------------
// + bezierPathWithSRCRoundRectInRect:radius:
//----------------------------------------------------------
+ (NSBezierPath *)bezierPathWithSRCRoundRectInRect:(NSRect)aRect radius:(float)radius {
NSBezierPath *path = [self bezierPath];
radius = MIN(radius, 0.5f * MIN(NSWidth(aRect), NSHeight(aRect)));
NSRect rect = NSInsetRect(aRect, radius, radius);
[path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMinY(rect)) radius:radius startAngle:180.0 endAngle:270.0];
[path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMinY(rect)) radius:radius startAngle:270.0 endAngle:360.0];
[path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMaxY(rect)) radius:radius startAngle:0.0 endAngle:90.0];
[path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMaxY(rect)) radius:radius startAngle:90.0 endAngle:180.0];
[path closePath];
return path;
}
@end
@implementation NSError (SRAdditions)
- (NSString *)localizedDescription {
return [[self userInfo] objectForKey:@"NSLocalizedDescription"];
}
- (NSString *)localizedFailureReason {
return [[self userInfo] objectForKey:@"NSLocalizedFailureReasonErrorKey"];
}
- (NSString *)localizedRecoverySuggestion {
return [[self userInfo] objectForKey:@"NSLocalizedRecoverySuggestionErrorKey"];
}
- (NSArray *)localizedRecoveryOptions {
return [[self userInfo] objectForKey:@"NSLocalizedRecoveryOptionsKey"];
}
@end
@implementation NSAlert (SRAdditions)
//----------------------------------------------------------
// + alertWithNonRecoverableError:
//----------------------------------------------------------
+ (NSAlert *)alertWithNonRecoverableError:(NSError *)error;
{
NSString *reason = [error localizedRecoverySuggestion];
reason = reason ? reason : @"";
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
[alert setMessageText:[error localizedDescription]];
[alert setInformativeText:[NSString stringWithFormat:@"%@", reason]];
[alert addButtonWithTitle:[[error localizedRecoveryOptions] objectAtIndex:0]];
return alert;
}
@end
static NSMutableDictionary *SRSharedImageCache = nil;
@interface SRSharedImageProvider (Private)
+ (void)_drawSRSnapback:(id)anNSCustomImageRep;
+ (NSValue *)_sizeSRSnapback;
+ (void)_drawSRRemoveShortcut:(id)anNSCustomImageRep;
+ (NSValue *)_sizeSRRemoveShortcut;
+ (void)_drawSRRemoveShortcutRollover:(id)anNSCustomImageRep;
+ (NSValue *)_sizeSRRemoveShortcutRollover;
+ (void)_drawSRRemoveShortcutPressed:(id)anNSCustomImageRep;
+ (NSValue *)_sizeSRRemoveShortcutPressed;
+ (void)_drawARemoveShortcutBoxUsingRep:(id)anNSCustomImageRep opacity:(double)opacity;
@end
@implementation SRSharedImageProvider
+ (NSImage *)supportingImageWithName:(NSString *)name {
// NSLog(@"supportingImageWithName: %@", name);
if (nil == SRSharedImageCache) {
SRSharedImageCache = [[NSMutableDictionary dictionary] retain];
// NSLog(@"inited cache");
}
NSImage *cachedImage = nil;
if (nil != (cachedImage = [SRSharedImageCache objectForKey:name])) {
// NSLog(@"returned cached image: %@", cachedImage);
return cachedImage;
}
// NSLog(@"constructing image");
NSSize size;
NSValue *sizeValue = [self performSelector:NSSelectorFromString([NSString stringWithFormat:@"_size%@", name])];
size = [sizeValue sizeValue];
// NSLog(@"size: %@", NSStringFromSize(size));
NSCustomImageRep *customImageRep = [[NSCustomImageRep alloc] initWithDrawSelector:NSSelectorFromString([NSString stringWithFormat:@"_draw%@:", name]) delegate:self];
[customImageRep setSize:size];
// NSLog(@"created customImageRep: %@", customImageRep);
NSImage *returnImage = [[NSImage alloc] initWithSize:size];
[returnImage addRepresentation:customImageRep];
[SRSharedImageCache setObject:returnImage forKey:name];
#ifdef SRCommonWriteDebugImagery
NSData *tiff = [returnImage TIFFRepresentation];
[tiff writeToURL:[NSURL fileURLWithPath:[[NSString stringWithFormat:@"~/Desktop/m_%@.tiff", name] stringByExpandingTildeInPath]] atomically:YES];
NSSize sizeQDRPL = NSMakeSize(size.width * 4.0, size.height * 4.0);
// sizeQDRPL = NSMakeSize(70.0,70.0);
NSCustomImageRep *customImageRepQDRPL = [[NSCustomImageRep alloc] initWithDrawSelector:NSSelectorFromString([NSString stringWithFormat:@"_draw%@:", name]) delegate:self];
[customImageRepQDRPL setSize:sizeQDRPL];
// NSLog(@"created customImageRepQDRPL: %@", customImageRepQDRPL);
NSImage *returnImageQDRPL = [[NSImage alloc] initWithSize:sizeQDRPL];
[returnImageQDRPL addRepresentation:customImageRepQDRPL];
[returnImageQDRPL setScalesWhenResized:YES];
[returnImageQDRPL setFlipped:YES];
NSData *tiffQDRPL = [returnImageQDRPL TIFFRepresentation];
[tiffQDRPL writeToURL:[NSURL fileURLWithPath:[[NSString stringWithFormat:@"~/Desktop/m_QDRPL_%@.tiff", name] stringByExpandingTildeInPath]] atomically:YES];
#endif
// NSLog(@"returned image: %@", returnImage);
return [returnImage autorelease];
}
@end
@implementation SRSharedImageProvider (Private)
#define MakeRelativePoint(x, y) NSMakePoint(x * hScale, y * vScale)
+ (NSValue *)_sizeSRSnapback {
return [NSValue valueWithSize:NSMakeSize(14.0, 14.0)];
}
+ (void)_drawSRSnapback:(id)anNSCustomImageRep {
// NSLog(@"drawSRSnapback using: %@", anNSCustomImageRep);
NSCustomImageRep *rep = anNSCustomImageRep;
NSSize size = [rep size];
[[NSColor whiteColor] setFill];
double hScale = (size.width / 1.0);
double vScale = (size.height / 1.0);
NSBezierPath *bp = [[[NSBezierPath alloc] init] autorelease];
[bp setLineWidth:hScale];
[bp moveToPoint:MakeRelativePoint(0.0489685, 0.6181513)];
[bp lineToPoint:MakeRelativePoint(0.4085750, 0.9469318)];
[bp lineToPoint:MakeRelativePoint(0.4085750, 0.7226146)];
[bp curveToPoint:MakeRelativePoint(0.8508247, 0.4836237) controlPoint1:MakeRelativePoint(0.4085750, 0.7226146) controlPoint2:MakeRelativePoint(0.8371143, 0.7491841)];
[bp curveToPoint:MakeRelativePoint(0.5507195, 0.0530682) controlPoint1:MakeRelativePoint(0.8677834, 0.1545071) controlPoint2:MakeRelativePoint(0.5507195, 0.0530682)];
[bp curveToPoint:MakeRelativePoint(0.7421721, 0.3391942) controlPoint1:MakeRelativePoint(0.5507195, 0.0530682) controlPoint2:MakeRelativePoint(0.7458685, 0.1913146)];
[bp curveToPoint:MakeRelativePoint(0.4085750, 0.5154130) controlPoint1:MakeRelativePoint(0.7383412, 0.4930328) controlPoint2:MakeRelativePoint(0.4085750, 0.5154130)];
[bp lineToPoint:MakeRelativePoint(0.4085750, 0.2654000)];
NSAffineTransform *flip = [[[NSAffineTransform alloc] init] autorelease];
// [flip translateXBy:0.95 yBy:-1.0];
[flip scaleXBy:0.9 yBy:1.0];
[flip translateXBy:0.5 yBy:-0.5];
[bp transformUsingAffineTransform:flip];
NSShadow *sh = [[[NSShadow alloc] init] autorelease];
[sh setShadowColor:[[NSColor blackColor] colorWithAlphaComponent:0.45]];
[sh setShadowBlurRadius:1.0];
[sh setShadowOffset:NSMakeSize(0.0, -1.0)];
[sh set];
[bp fill];
}
+ (NSValue *)_sizeSRRemoveShortcut {
return [NSValue valueWithSize:NSMakeSize(14.0, 14.0)];
}
+ (NSValue *)_sizeSRRemoveShortcutRollover {
return [self _sizeSRRemoveShortcut];
}
+ (NSValue *)_sizeSRRemoveShortcutPressed {
return [self _sizeSRRemoveShortcut];
}
+ (void)_drawARemoveShortcutBoxUsingRep:(id)anNSCustomImageRep opacity:(double)opacity {
// NSLog(@"drawARemoveShortcutBoxUsingRep: %@ opacity: %f", anNSCustomImageRep, opacity);
NSCustomImageRep *rep = anNSCustomImageRep;
NSSize size = [rep size];
[[NSColor colorWithCalibratedWhite:0.0 alpha:1 - opacity] setFill];
double hScale = (size.width / 14.0);
double vScale = (size.height / 14.0);
[[NSBezierPath bezierPathWithOvalInRect:NSMakeRect(0.0, 0.0, size.width, size.height)] fill];
[[NSColor whiteColor] setStroke];
NSBezierPath *cross = [[[NSBezierPath alloc] init] autorelease];
[cross setLineWidth:hScale * 1.2];
[cross moveToPoint:MakeRelativePoint(4, 4)];
[cross lineToPoint:MakeRelativePoint(10, 10)];
[cross moveToPoint:MakeRelativePoint(10, 4)];
[cross lineToPoint:MakeRelativePoint(4, 10)];
[cross stroke];
}
+ (void)_drawSRRemoveShortcut:(id)anNSCustomImageRep {
// NSLog(@"drawSRRemoveShortcut using: %@", anNSCustomImageRep);
[self _drawARemoveShortcutBoxUsingRep:anNSCustomImageRep opacity:0.75];
}
+ (void)_drawSRRemoveShortcutRollover:(id)anNSCustomImageRep {
// NSLog(@"drawSRRemoveShortcutRollover using: %@", anNSCustomImageRep);
[self _drawARemoveShortcutBoxUsingRep:anNSCustomImageRep opacity:0.65];
}
+ (void)_drawSRRemoveShortcutPressed:(id)anNSCustomImageRep {
// NSLog(@"drawSRRemoveShortcutPressed using: %@", anNSCustomImageRep);
[self _drawARemoveShortcutBoxUsingRep:anNSCustomImageRep opacity:0.55];
}
@end