source: trunk/ICeCoffEE/ICeCoffEE/ICeCoffEETrigger.m@ 184

Last change on this file since 184 was 183, checked in by Nicholas Riley, 17 years ago

ICeCoffEE 1.4.2b1

VERSION, ui.plist, Info*.plist, InfoPlist.strings: Updated for 1.4.2b1.

APEMain.m: Removed PBX support.

ICeCoffEE.[hm]: Don't ICCF_OSErr(C)Assert if we get userCanceledErr:
part of fixing extraneous exception when not selecting anything from
the helper app menu. ICCF_KeyboardAction() and
ICCF_LaunchURLFromTextView() now take an event parameter - since we
have stuff on a timer now, means we get the key modifier state at
mousedown time, rather than some arbitrary time later.
ICCF_LaunchURL() returns NO if the user cancelled, so we don't need to
throw an exception to stop the URL blinking. Moved sanitized mouse
down event generation to ICCF_MouseDownEventWithModifierFlags(). Only
update Services menu at app launch on Panther. Use a timer to delay
URL launching in NSTextView on Tiger, so we accommodate
command-multiple clicking for discontiguous selection. Remove that
ugly goto.

ICeCoffEEShared.h: Turn off debugging in preparation for (beta)
release.

ICeCoffEETerminal.m: Update for new ICCF_LaunchURL() return.

ICeCoffEETrigger.[hm]: Singleton timer wrapper for discontiguous
selection compatibility on Tiger. Singleton global is exported for
efficiency since we have to check it on every mouse down.

ICeCoffEEWebKit.m: Removed incorrect comment (what was I thinking?)
Update for new ICCF_LaunchURL() return. Properly highlight before
ICCF_LaunchURL(), especially noticable with menu.

APEInfo.rtfd: More fixes and updates, final for 1.4.2b1.

File size: 1.5 KB
Line 
1//
2// ICeCoffEETrigger.m
3// ICeCoffEE APE
4//
5// Created by Nicholas Riley on 5/14/05.
6// Copyright 2005 Nicholas Riley. All rights reserved.
7//
8
9#import "ICeCoffEETrigger.h"
10#import "ICeCoffEE.h"
11
12
13ICeCoffEETrigger *ICCF_sharedTrigger = nil;
14
15@implementation ICeCoffEETrigger
16
17- (id)initForEvent:(NSEvent *)anEvent onTarget:(NSText<NSTextInput> *)aTarget;
18{
19 if ( (self = [super init]) != nil) {
20 target = [aTarget retain];
21 event = [anEvent retain];
22 characterIndex = [aTarget characterIndexForPoint: [[aTarget window] convertBaseToScreen: [anEvent locationInWindow]]];
23 timer = [NSTimer scheduledTimerWithTimeInterval: TicksToEventTime(GetDblTime())
24 target: self
25 selector: @selector(timerFired:)
26 userInfo: nil
27 repeats: NO];
28 }
29 return self;
30}
31
32+ (void)setTriggerForEvent:(NSEvent *)event onTarget:(NSText<NSTextInput> *)target;
33{
34 ICCF_sharedTrigger = [[self alloc] initForEvent: event onTarget: target];
35 [ICCF_sharedTrigger release];
36}
37
38- (void)dealloc;
39{
40 timer = nil;
41 [target release];
42 target = nil;
43 [event release];
44 event = nil;
45 ICLog(@"%@ dealloc", self);
46 [super dealloc];
47}
48
49- (void)timerFired:(NSTimer *)timer;
50{
51 ICCF_sharedTrigger = nil;
52 [target setSelectedRange: NSMakeRange(characterIndex, 0)];
53 ICCF_LaunchURLFromTextView(target, event);
54}
55
56- (void)cancel;
57{
58 ICCF_sharedTrigger = nil;
59 [timer invalidate]; // we get dealloced inside here, so don't do anything else
60}
61
62@end
Note: See TracBrowser for help on using the repository browser.