Ignore:
Timestamp:
06/15/07 05:15:03 (17 years ago)
Author:
Nicholas Riley
Message:

ICeCoffEE.m: I was wrong in [319] about the selection extension stuff
being dumb; explain why in code, even though it's not fixed.
Implement some of the same parens support I did in Terminal. Update
for more robust service info dictionary format.

ICeCoffEEServicePrefController.m: Update for more robust service info
dictionary format.

ICeCoffEEServices.[hm]: Renamed from ICeCoffEESetServicesMenu.[hm],
since we do more now. Service info dictionary-creating code now makes
more sense and no longer has naming collision issues.

ICeCoffEEWebKit.m: Some preliminary Safari 3 compatibility stuff, not
quite working yet. An outstanding question - is it better to rely on
"public" WebCore API or private WebKit API? So far it seems the
latter is more stable.

English.lproj/APEInfo.rtfd: The Bored Zo has a name: use it. Remove
now-erroneous reference to SimpleText since TextEdit support is gone.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ICeCoffEE/ICeCoffEE/ICeCoffEEWebKit.m

    r216 r320  
    1010#import <unistd.h>
    1111
    12 // from WebCoreBridge.h
     12// WebCoreBridge, from WebCoreBridge.h (Safari 2)
     13// Web(Core)FrameBridge, from WebCoreFrameBridge.h (Safari 3)
    1314@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
    1424
    1525- (NSString *)selectedString;
    1626- (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?
    1929- (void)deselectAll;
    2030
    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) */
    2932
    3033- (NSDictionary *)elementAtPoint:(NSPoint)point;
     
    4851    [downEvent release]; downEvent = nil;
    4952    if (ICCF_enabled && ICCF_prefs.commandClickEnabled && ICCF_EventIsCommandMouseDown(e)) {
    50         WebCoreBridge *bridge = [(WebHTMLView *)self _bridge];
    5153        if ([self respondsToSelector: @selector(selectedRange)]) {
    5254            // save selection: it may be deselected on super mouseDown
     
    5456        }
    5557        [selectedString release]; selectedString = nil;
    56         selectedString = [[bridge selectedString] retain];
     58        selectedString = [[(WebHTMLView *)self selectedString] retain];
    5759        downEvent = [e retain];
    5860    }
     
    7779            if ([elementDict objectForKey: @"WebElementLinkURL"] != nil) {
    7880                ICLog(@"got a link");
    79                 NS_VOIDRETURN; // donÕt activate on links
     81                NS_VOIDRETURN; // don't activate on links
    8082            }
    8183            if (selectedString == nil || [selectedString length] == 0) {
     
    9193            if (ICCF_LaunchURL(selectedString, ICCF_KeyboardAction(downEvent)) && ICCF_prefs.textBlinkEnabled && canSetSelection) {
    9294                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];
    94100                ICLog(@"selectedRange %@ selectionRect %@ textBlinkCount %d", NSStringFromRange(selectedRange), NSStringFromRect(selectionRect), ICCF_prefs.textBlinkCount);
    95101                for (i = 0 ; i < ICCF_prefs.textBlinkCount ; i++) {
    96                     [bridge deselectAll];
     102                    [(WebHTMLView *)self deselectAll];
    97103                    [self setNeedsDisplayInRect: selectionRect];
    98104                    [self display];
Note: See TracChangeset for help on using the changeset viewer.