Changeset 320 for trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEWebKit.m
- Timestamp:
- 06/15/07 05:15:03 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEWebKit.m
r216 r320 10 10 #import <unistd.h> 11 11 12 // from WebCoreBridge.h 12 // WebCoreBridge, from WebCoreBridge.h (Safari 2) 13 // Web(Core)FrameBridge, from WebCoreFrameBridge.h (Safari 3) 13 14 @interface WebCoreBridge : NSObject 15 16 // can only use setMarkedText:selectedRange: if WebHTMLView is editable 17 // or, should we move to DOM-based accessors, i.e. "setMarkDOMRange"? 18 - (void)selectNSRange:(NSRange)range; 19 20 @end 21 22 // from WebKit, private -- XXX maybe I'm better off going back the other way, relying on public methods in the bridge? 23 @interface WebHTMLView : NSObject 14 24 15 25 - (NSString *)selectedString; 16 26 - (NSRect)selectionRect; 17 18 - ( void)selectNSRange:(NSRange)range;27 - (NSRect)_selectionRect; // Safari 2, supported in Safari 3 only for use with Mail 28 - (NSRange)selectedRange; // XXX same as selectedNSRange in WebCoreFrameBridge.h? 19 29 - (void)deselectAll; 20 30 21 @end 22 23 // from WebKit, private 24 @interface WebHTMLView : NSObject 25 26 - (WebCoreBridge *)_bridge; 27 28 - (NSRange)selectedRange; 31 - (WebCoreBridge *)_bridge; /* WebFrameBridge in Safari 3 (see above) */ 29 32 30 33 - (NSDictionary *)elementAtPoint:(NSPoint)point; … … 48 51 [downEvent release]; downEvent = nil; 49 52 if (ICCF_enabled && ICCF_prefs.commandClickEnabled && ICCF_EventIsCommandMouseDown(e)) { 50 WebCoreBridge *bridge = [(WebHTMLView *)self _bridge];51 53 if ([self respondsToSelector: @selector(selectedRange)]) { 52 54 // save selection: it may be deselected on super mouseDown … … 54 56 } 55 57 [selectedString release]; selectedString = nil; 56 selectedString = [[ bridgeselectedString] retain];58 selectedString = [[(WebHTMLView *)self selectedString] retain]; 57 59 downEvent = [e retain]; 58 60 } … … 77 79 if ([elementDict objectForKey: @"WebElementLinkURL"] != nil) { 78 80 ICLog(@"got a link"); 79 NS_VOIDRETURN; // don Õt activate on links81 NS_VOIDRETURN; // don't activate on links 80 82 } 81 83 if (selectedString == nil || [selectedString length] == 0) { … … 91 93 if (ICCF_LaunchURL(selectedString, ICCF_KeyboardAction(downEvent)) && ICCF_prefs.textBlinkEnabled && canSetSelection) { 92 94 int i; 93 NSRect selectionRect = [bridge selectionRect]; 95 NSRect selectionRect; 96 if ([self respondsToSelector: @selector(selectionRect)]) 97 selectionRect = [(WebHTMLView *)self selectionRect]; 98 else 99 selectionRect = [(WebHTMLView *)self _selectionRect]; 94 100 ICLog(@"selectedRange %@ selectionRect %@ textBlinkCount %d", NSStringFromRange(selectedRange), NSStringFromRect(selectionRect), ICCF_prefs.textBlinkCount); 95 101 for (i = 0 ; i < ICCF_prefs.textBlinkCount ; i++) { 96 [ bridgedeselectAll];102 [(WebHTMLView *)self deselectAll]; 97 103 [self setNeedsDisplayInRect: selectionRect]; 98 104 [self display];
Note:
See TracChangeset
for help on using the changeset viewer.