Ignore:
Timestamp:
04/18/05 05:30:49 (17 years ago)
Author:
Nicholas Riley
Message:

ICeCoffEE 1.4 and preliminary 1.4.1 changes. Sorry, I forgot to
commit version 1.4 when it was released, so the precise source for
that release has been lost.

See the release notes for details of what changed in these versions.
1.4 was a significant feature release; 1.4.1 is a bug fix for 10.3.9,
incorporating up-to-date Unsanity Installer and APE.

package-ICeCoffEE.sh: use xcodebuild instead of pbxbuild.

File:
1 edited

Legend:

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

    r142 r167  
    6767CFBundleRef ICCF_bundle;
    6868
    69 void APEBundleMain(CFBundleRef inBundle)
     69// With APE 1.3, if we're in the exclude list, APEBundleMainEarlyLoad doesn't get invoked; don't need to use APETools.  But we need to do our own management to avoid loading in non-GUI appllications.
     70Boolean ICCF_shouldLoad;
     71
     72void APEBundleMainEarlyLoad(CFBundleRef inBundle, CFStringRef inAPEToolsApplicationID)
    7073{
    7174    ICCF_MigratePrefs();
     
    7780    SAFE_RELEASE(icVersionRef);
    7881
    79     // first check if this application is in the exclude list;
    80     // if it is, simply return and do not apply any patches.
    81     // APETools will help us with that; APE Manager will take care of
    82     // exclude list management for us.
    83     if (APEToolsIsInExcludeList(kICBundleIdentifier, NULL)) {
    84         ICapeprintf("ICeCoffEE APE: not loading as this application is excluded.\n");
    85         return;
    86     }
     82    ICCF_shouldLoad = false;
    8783
    8884    CPSProcessSerNum psn;
     
    106102        return;
    107103#endif
    108     }
    109     ICapeprintf("ICeCoffEE APE: got process attributes = 0x%lx\n", info.Attributes);
    110     if (info.Attributes & (kCPSBGOnlyAttr | kCPSUIElementAttr | kCPSFullScreenAttr)) {
    111         ICapeprintf("ICeCoffEE APE: not loading as this application is background-only\n");
    112         return;
    113     }
     104    } else {
     105        ICapeprintf("ICeCoffEE APE: got process attributes = 0x%lx\n", info.Attributes);
     106        if (info.Attributes & (kCPSBGOnlyAttr | kCPSUIElementAttr | kCPSFullScreenAttr)) {
     107            ICapeprintf("ICeCoffEE APE: not loading as this application is background-only\n");
     108            return;
     109        }
     110    }
     111    ICCF_shouldLoad = true;
     112}
     113
     114Boolean ICCF_CFBundleIDMatches(CFStringRef bundleID, CFStringRef test) {
     115    return CFStringCompare(bundleID, test, kCFCompareCaseInsensitive) == kCFCompareEqualTo;
     116}
     117
     118void APEBundleMainLateLoad(CFBundleRef inBundle, CFStringRef inAPEToolsApplicationID)
     119{
     120    if (!ICCF_shouldLoad) return;
    114121
    115122    ICCF_bundle = CFBundleGetBundleWithIdentifier(kICBundleIdentifier);
     
    119126    // XXX handle patching error return from ICCF_PatchMethod
    120127    if (bundleID != NULL) {
    121         if (CFStringCompare(bundleID, CFSTR("com.apple.projectbuilder"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
     128        if (ICCF_CFBundleIDMatches(bundleID, CFSTR("com.apple.projectbuilder")) ||
     129            ICCF_CFBundleIDMatches(bundleID, CFSTR("com.apple.xcode"))) {
    122130            ICCF_PatchMethod("PBXTextView", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:");
    123131            ICapeprintf("ICeCoffEE APE: loaded in PBXTextView for PB!\n");
    124132            shouldLoadInNSTextView = NO;
    125         } else if (CFStringCompare(bundleID, CFSTR("com.apple.terminal"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
     133        } else if (ICCF_CFBundleIDMatches(bundleID, CFSTR("com.apple.terminal"))) {
    126134            ICCF_PatchMethod("TermSubview", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:") &&
    127135            ICCF_PatchMethod("TermSubview", "ICeCoffEETerminal", "ICECoffEETermSubviewSuper", "selectedRange") &&
     
    132140            ICCF_PatchMethod("TermSubview", "ICeCoffEETerminal", "ICECoffEETermSubviewSuper", "_optionClickEvent:::") ,
    133141            ICapeprintf("ICeCoffEE APE: loaded in TermSubview for Terminal!\n");
    134         } else if (CFStringCompare(bundleID, CFSTR("com.apple.safari"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
    135 #if ICCF_WEBKIT
    136             ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "mouseUp:") &&
    137             ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "mouseDown:") &&
    138             ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "menuForEvent:") ,
    139             ICapeprintf("ICeCoffEE APE: loaded in WebHTMLView for Safari!\n");
    140 #endif
    141         }
    142     }
    143 
     142        } else if (ICCF_CFBundleIDMatches(bundleID, CFSTR("org.mozilla.navigator"))) {
     143            ICCF_PatchMethod("ChildView", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:");
     144            ICapeprintf("ICeCoffEE APE: loaded in ChildView for Camino\n");
     145        }
     146    }
     147
     148    ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "mouseUp:") &&
     149        ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "mouseDown:") &&
     150        ICCF_PatchMethod("WebHTMLView", "ICeCoffEEWebKit", "ICeCoffEEWebKitSuper", "menuForEvent:"),
     151        ICapeprintf("ICeCoffEE APE: loaded in WebHTMLView for WebKit/Safari\n");
     152   
    144153    if (shouldLoadInNSTextView) {
    145154        ICCF_PatchMethod("NSTextView", "ICeCoffEE", "ICeCoffEESuper", "mouseDown:") &&
Note: See TracChangeset for help on using the changeset viewer.