diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2009-09-16 20:46:06 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:13:59 +0000 |
commit | 8cc8eb1ca0ee78a62a14187f1a45ee676d20ece8 (patch) | |
tree | 02f8a26f0a0f55fdc93c8b0c206adc437da06900 /Cydia.mm | |
parent | 4eb59b62e96fcb850bd0f291a5e8f2f7c6bdcf3c (diff) |
I hate you Apple, and your tiny little iframes, too.
Diffstat (limited to 'Cydia.mm')
-rw-r--r-- | Cydia.mm | 69 |
1 files changed, 15 insertions, 54 deletions
@@ -189,56 +189,6 @@ void PrintTimes() { #define _end } /* }}} */ -/* Objective-C Handle<> {{{ */ -template <typename Type_> -class _H { - typedef _H<Type_> This_; - - private: - Type_ *value_; - - _finline void Retain_() { - if (value_ != nil) - [value_ retain]; - } - - _finline void Clear_() { - if (value_ != nil) - [value_ release]; - } - - public: - _finline _H(const This_ &rhs) : - value_(rhs.value_ == nil ? nil : [rhs.value_ retain]) - { - } - - _finline _H(Type_ *value = NULL, bool mended = false) : - value_(value) - { - if (!mended) - Retain_(); - } - - _finline ~_H() { - Clear_(); - } - - _finline operator Type_ *() const { - return value_; - } - - _finline This_ &operator =(Type_ *value) { - if (value_ != value) { - Type_ *old(value_); - value_ = value; - Retain_(); - if (old != nil) - [old release]; - } return *this; - } -}; -/* }}} */ #define _pooled _H<NSAutoreleasePool> _pool([[NSAutoreleasePool alloc] init], true); @@ -426,15 +376,15 @@ static const CFStringCompareFlags LaxCompareFlags_ = kCFCompareCaseInsensitive | #define TraceLogging (1 && !ForRelease) #define HistogramInsertionSort (0 && !ForRelease) #define ProfileTimes (0 && !ForRelease) -#define ForSaurik (0 && !ForRelease) +#define ForSaurik (1 && !ForRelease) #define LogBrowser (0 && !ForRelease) #define TrackResize (0 && !ForRelease) -#define ManualRefresh (0 && !ForRelease) +#define ManualRefresh (1 && !ForRelease) #define ShowInternals (0 && !ForRelease) #define IgnoreInstall (0 && !ForRelease) #define RecycleWebViews 0 -#define RecyclePackageViews 1 -#define AlwaysReload (0 && !ForRelease) +#define RecyclePackageViews (1 && ForRelease) +#define AlwaysReload (1 && !ForRelease) #if !TraceLogging #undef _trace @@ -3680,6 +3630,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { + (NSString *) webScriptNameForSelector:(SEL)selector { if (selector == @selector(close)) return @"close"; + else if (selector == @selector(getInstalledPackages)) + return @"getInstalledPackages"; else if (selector == @selector(getPackageById:)) return @"getPackageById"; else if (selector == @selector(setAutoPopup:)) @@ -3718,6 +3670,15 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { return [feature isEqualToString:@"window.open"]; } +- (NSArray *) getInstalledPackages { + NSArray *packages([[Database sharedInstance] packages]); + NSMutableArray *installed([NSMutableArray arrayWithCapacity:[packages count]]); + for (Package *package in installed) + if ([package installed] != nil) + [installed addObject:package]; + return installed; +} + - (Package *) getPackageById:(NSString *)id { Package *package([[Database sharedInstance] packageWithName:id]); [package parse]; |