Convert to use ARC

This commit is contained in:
Yoshi Sugawara 2016-03-31 17:21:48 -04:00
parent ec07237701
commit 44cad3ea15
23 changed files with 192 additions and 282 deletions

View File

@ -1406,6 +1406,7 @@
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
@ -1443,6 +1444,7 @@
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@ -1481,6 +1483,7 @@
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ENABLE_OBJC_ARC = YES;
CODE_SIGN_ENTITLEMENTS = ""; CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;

View File

@ -9,9 +9,9 @@
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
// int retVal = UIApplicationMain(argc, argv, nil, nil); // int retVal = UIApplicationMain(argc, argv, nil, nil);
int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([activegsAppDelegate class])); int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([activegsAppDelegate class]));
[pool release]; return retVal;
return retVal; }
} }

View File

@ -155,7 +155,7 @@ static NSMutableString *SublayerDescriptionAtLevel(CALayer *layer, int level) {
- (NSString *)subtreeDescription { - (NSString *)subtreeDescription {
NSMutableString *result = NSMutableString *result =
[[[self gtm_subtreeDescriptionLine] mutableCopy] autorelease]; [[self gtm_subtreeDescriptionLine] mutableCopy];
for (UIView *v in [self subviews]) { for (UIView *v in [self subviews]) {
[result appendString:[v gtm_subtreeDescriptionAtLevel:1]]; [result appendString:[v gtm_subtreeDescriptionAtLevel:1]];
} }

View File

@ -79,51 +79,51 @@ enum
} }
@property (nonatomic,retain) UITextField* textField; @property (nonatomic,strong) UITextField* textField;
@property (nonatomic,retain) UIButton *menuButton; @property (nonatomic,strong) UIButton *menuButton;
@property (nonatomic,retain) UIBarButtonItem* optionButton ; @property (nonatomic,strong) UIBarButtonItem* optionButton ;
@property (nonatomic,retain) UIImageView* diskView; @property (nonatomic,strong) UIImageView* diskView;
@property (nonatomic,retain) UIImageView* diskLoadingView; @property (nonatomic,strong) UIImageView* diskLoadingView;
@property (nonatomic,retain) NSMutableArray* diskIcons; @property (nonatomic,strong) NSMutableArray* diskIcons;
@property (nonatomic,retain) UILabel * loaderLabel; @property (nonatomic,strong) UILabel * loaderLabel;
@property (nonatomic,retain) UILabel* debugIndicator; @property (nonatomic,strong) UILabel* debugIndicator;
@property (nonatomic,retain) UILabel* swipeIndicator; @property (nonatomic,strong) UILabel* swipeIndicator;
@property (nonatomic,retain) UILabel* zoomIndicator; @property (nonatomic,strong) UILabel* zoomIndicator;
@property (nonatomic,retain) UILabel* padIndicator; @property (nonatomic,strong) UILabel* padIndicator;
@property (nonatomic,retain) UILabel* mouseButtonIndicator; @property (nonatomic,strong) UILabel* mouseButtonIndicator;
@property (nonatomic,retain) UILabel* inputIndicator; @property (nonatomic,strong) UILabel* inputIndicator;
@property (nonatomic,retain) UIActivityIndicatorView* loader; @property (nonatomic,strong) UIActivityIndicatorView* loader;
@property (nonatomic,retain) NSTimer* loaderTimer; @property (nonatomic,strong) NSTimer* loaderTimer;
#ifdef GRAPHICAL_PAD #ifdef GRAPHICAL_PAD
@property (nonatomic,retain) UIImageView* padBackground; @property (nonatomic,retain) UIImageView* padBackground;
@property (nonatomic,retain) UIImageView* padButton1Down; @property (nonatomic,retain) UIImageView* padButton1Down;
@property (nonatomic,retain) UIImageView* padButton2Down; @property (nonatomic,retain) UIImageView* padButton2Down;
@property (nonatomic,retain) UIImageView* padStick; @property (nonatomic,retain) UIImageView* padStick;
#endif #endif
@property (nonatomic,retain) UIImageView* padCircleOutter; @property (nonatomic,strong) UIImageView* padCircleOutter;
@property (nonatomic,retain) UIImageView* padCircleInner; @property (nonatomic,strong) UIImageView* padCircleInner;
@property (nonatomic,retain) UIImageView* oaButtonView; @property (nonatomic,strong) UIImageView* oaButtonView;
@property (nonatomic,retain) UIImageView* caButtonView; @property (nonatomic,strong) UIImageView* caButtonView;
@property (nonatomic,retain) UITouch* padTouch; @property (nonatomic,strong) UITouch* padTouch;
@property (nonatomic,retain) UITouch* oaButtonTouch; @property (nonatomic,strong) UITouch* oaButtonTouch;
@property (nonatomic,retain) UITouch* caButtonTouch; @property (nonatomic,strong) UITouch* caButtonTouch;
@property (nonatomic,retain) UINavigationItem* emulatorNavItem; @property (nonatomic,strong) UINavigationItem* emulatorNavItem;
@property (nonatomic,retain) UINavigationBar* runtimeView; @property (nonatomic,strong) UINavigationBar* runtimeView;
@property (nonatomic,retain) UIView* interfaceView; @property (nonatomic,strong) UIView* interfaceView;
@property (nonatomic,retain) NSTimer* animateDiskTimer; @property (nonatomic,strong) NSTimer* animateDiskTimer;
@property (nonatomic,retain) NSTimer* hardwarekbdDetectionTimer; @property (nonatomic,strong) NSTimer* hardwarekbdDetectionTimer;
@property (nonatomic,retain) UIImageView* runtimeControls; @property (nonatomic,strong) UIImageView* runtimeControls;
@property (nonatomic,retain) UIView* runtimeControlsOptions; @property (nonatomic,strong) UIView* runtimeControlsOptions;
@property (nonatomic,retain) UIImageView* diskSelection; @property (nonatomic,strong) UIImageView* diskSelection;
@property (nonatomic,retain) UIView* diskSelectionOptions; @property (nonatomic,strong) UIView* diskSelectionOptions;
@property (nonatomic,retain) UIScrollView* uit; @property (nonatomic,strong) UIScrollView* uit;
@property (nonatomic,retain) UIScrollView* uitb; @property (nonatomic,strong) UIScrollView* uitb;
@property (nonatomic,retain) UIView* accessView; @property (nonatomic,strong) UIView* accessView;
@property (nonatomic,retain) UIButton* leftAccessView; @property (nonatomic,strong) UIButton* leftAccessView;
@property (nonatomic,retain) UIButton* rightAccessView; @property (nonatomic,strong) UIButton* rightAccessView;
@property (nonatomic,retain) UINavigationBar* barView; @property (nonatomic,strong) UINavigationBar* barView;
@property (nonatomic,retain) UINavigationBar* specialView; @property (nonatomic,strong) UINavigationBar* specialView;
//@property (assign,getter=inputMode) int inputMode; //@property (assign,getter=inputMode) int inputMode;

View File

@ -236,7 +236,7 @@ UIImageView* loadImage(NSString* _name)
{ {
NSString *imgSource = [[NSBundle mainBundle] pathForResource:_name ofType:@"png"]; NSString *imgSource = [[NSBundle mainBundle] pathForResource:_name ofType:@"png"];
UIImage* img = [[UIImage imageWithContentsOfFile: imgSource] retain]; UIImage* img = [UIImage imageWithContentsOfFile: imgSource];
UIImageView* view = [[UIImageView alloc] initWithImage:img]; UIImageView* view = [[UIImageView alloc] initWithImage:img];
return view; return view;
@ -1034,8 +1034,8 @@ extern int x_frame_rate ;
-(void)addDiskSelection -(void)addDiskSelection
{ {
[self.diskSelectionOptions release]; self.diskSelectionOptions;
[self.diskSelection release]; self.diskSelection;
self.diskSelectionOptions = nil; self.diskSelectionOptions = nil;
self.diskSelection = nil; self.diskSelection = nil;
@ -1212,7 +1212,7 @@ extern int x_frame_rate ;
{ {
printf("removing RuntimeView"); printf("removing RuntimeView");
[self.runtimeView removeFromSuperview]; [self.runtimeView removeFromSuperview];
[self.runtimeView release]; self.runtimeView;
} }
// position par défault // position par défault
@ -2032,7 +2032,7 @@ int x_adb_get_keypad_y()
for(int i=0;i<20;i++) for(int i=0;i<20;i++)
add_event_delay(); add_event_delay();
caButton = TRUE; caButton = TRUE;
self.caButtonTouch = [touch retain];; self.caButtonTouch = touch;;
self.caButtonView.alpha = 1.0; self.caButtonView.alpha = 1.0;
#ifdef GRAPHICAL_PAD #ifdef GRAPHICAL_PAD
self.padButton2Down.hidden = FALSE; self.padButton2Down.hidden = FALSE;
@ -2764,30 +2764,8 @@ const int cycles[]=
NSLog(@"---kbd dealloc"); NSLog(@"---kbd dealloc");
self.textField.delegate = nil; self.textField.delegate = nil;
self.textField = nil;
self.menuButton = nil;
self.optionButton = nil;
self.diskView = nil;
self.diskLoadingView = nil;
self.loaderLabel = nil;
self.debugIndicator = nil;
self.swipeIndicator = nil;
self.zoomIndicator = nil;
self.padIndicator = nil;
self.mouseButtonIndicator = nil;
self.inputIndicator = nil;
self.loader = nil;
self.padCircleOutter = nil;
self.padCircleInner = nil;
self.oaButtonView = nil;
self.caButtonView = nil;
self.emulatorNavItem = nil;
self.barView = nil;
self.hardwarekbdDetectionTimer = nil;
self.animateDiskTimer = nil;
[super dealloc];
} }

View File

@ -156,22 +156,22 @@ extern enum machineSpecsEnum machineSpecs;
-(void)setNotificationText:(NSString*) _text; -(void)setNotificationText:(NSString*) _text;
-(void)updateNotificationView:(CGRect) newRect; -(void)updateNotificationView:(CGRect) newRect;
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation; - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
@property(nonatomic,retain,getter=getEmulatorView) activegsEmulatorController* emulatorController; @property(nonatomic,strong,getter=getEmulatorView) activegsEmulatorController* emulatorController;
@property(nonatomic,retain,getter=getBrowserView) ACTIVEGS_LAUNCHVIEWCONTROLLER* viewController; @property(nonatomic,strong,getter=getBrowserView) ACTIVEGS_LAUNCHVIEWCONTROLLER* viewController;
@property(nonatomic,retain,getter=getInfoView) infoViewController* infoController; @property(nonatomic,strong,getter=getInfoView) infoViewController* infoController;
@property(nonatomic,retain,getter=getDetailView) detailViewController* detailController; @property(nonatomic,strong,getter=getDetailView) detailViewController* detailController;
@property(nonatomic,retain) UIViewController* primaryViewController; @property(nonatomic,strong) UIViewController* primaryViewController;
@property(nonatomic,retain) UIViewController* secondaryViewController; @property(nonatomic,strong) UIViewController* secondaryViewController;
@property(nonatomic,retain) UIView* backgroundView; @property(nonatomic,strong) UIView* backgroundView;
@property(nonatomic,retain) UIImageView* backgroundImageView ; @property(nonatomic,strong) UIImageView* backgroundImageView ;
@property(nonatomic,retain) UIScreen* secondaryScreen ; @property(nonatomic,strong) UIScreen* secondaryScreen ;
@property(nonatomic,retain) UIScreen* primaryScreen ; @property(nonatomic,strong) UIScreen* primaryScreen ;
@property(nonatomic,retain) NSTimer* notificationTimer; @property(nonatomic,strong) NSTimer* notificationTimer;
@property(nonatomic,retain) UILabel* notificationView; @property(nonatomic,strong) UILabel* notificationView;
@property(assign,getter=getAngle) float currentRawReading; @property(assign,getter=getAngle) float currentRawReading;
@property (nonatomic, retain)/* IBOutlet*/ UIWindow *window; @property (nonatomic, strong)/* IBOutlet*/ UIWindow *window;
@property (nonatomic, retain) UIWindow *secondaryWindow; @property (nonatomic, strong) UIWindow *secondaryWindow;
@property(assign) float dpiRatio; @property(assign) float dpiRatio;
@property(assign) float resolutionRatio; @property(assign) float resolutionRatio;

View File

@ -67,9 +67,9 @@ void activegs_apply_default_options(void* _config)
void x_notify_eject() void x_notify_eject()
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(animateDiskEjection:) withObject:nil waitUntilDone:NO]; [[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(animateDiskEjection:) withObject:nil waitUntilDone:NO];
[pool release]; }
} }
@ -89,9 +89,9 @@ void x_notify_paddle(int _on)
printf("x_notify_paddle"); printf("x_notify_paddle");
padAlreadyDisplayedOnce = 1; padAlreadyDisplayedOnce = 1;
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(notifyPaddle:) withObject:nil waitUntilDone:NO]; [[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(notifyPaddle:) withObject:nil waitUntilDone:NO];
[pool release]; }
} }
@ -104,33 +104,33 @@ void x_notify_download_failure(const char*_url)
void x_loadinginprogress(int _on,int _s,int _d) void x_loadinginprogress(int _on,int _s,int _d)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
_d --; _d --;
int param = (_s==5 ? _d : _d +2 ); int param = (_s==5 ? _d : _d +2 );
if (_on) param |= 0x80; if (_on) param |= 0x80;
NSNumber* b = [NSNumber numberWithInt:param] ; NSNumber* b = [NSNumber numberWithInt:param] ;
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(setLoading:) withObject:b waitUntilDone:NO]; [[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(setLoading:) withObject:b waitUntilDone:NO];
[pool release]; }
} }
void x_refresh_panel(int _panel) void x_refresh_panel(int _panel)
{ {
if (!_panel & PANEL_RUNTIME) return ; if (!_panel & PANEL_RUNTIME) return ;
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(refreshControls:) withObject:nil waitUntilDone:NO]; [[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(refreshControls:) withObject:nil waitUntilDone:NO];
[pool release]; }
} }
void x_downloadinginprogress(int _percent) void x_downloadinginprogress(int _percent)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
NSNumber* b = [NSNumber numberWithInt:_percent]; NSNumber* b = [NSNumber numberWithInt:_percent];
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(setDownLoading:) withObject:b waitUntilDone:NO]; [[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(setDownLoading:) withObject:b waitUntilDone:NO];
[pool release]; }
} }
int alertAbort; int alertAbort;
@ -142,15 +142,15 @@ MyString alertMessage;
void x_init_persistent_path(MyString& hp) void x_init_persistent_path(MyString& hp)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
NSArray *paths= NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); NSArray *paths= NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
NSString *dir = [paths objectAtIndex:0]; NSString *dir = [paths objectAtIndex:0];
const char *bar = [dir UTF8String]; const char *bar = [dir UTF8String];
CFStringRef sd = __CFStringMakeConstantString(bar); CFStringRef sd = __CFStringMakeConstantString(bar);
hp= CFStringGetCStringPtr(sd,CFStringGetSystemEncoding()); hp= CFStringGetCStringPtr(sd,CFStringGetSystemEncoding());
[pool release]; }
} }
@ -184,7 +184,7 @@ void x_init_persistent_path(MyString& hp)
NSString* strMsg = [NSString stringWithUTF8String:alertMessage.c_str()]; NSString* strMsg = [NSString stringWithUTF8String:alertMessage.c_str()];
NSString* strTitle = [NSString stringWithUTF8String:alertTitle.c_str()]; NSString* strTitle = [NSString stringWithUTF8String:alertTitle.c_str()];
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:strTitle message:strMsg delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil] autorelease]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:strTitle message:strMsg delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil];
[alert show]; [alert show];
} }
@ -353,7 +353,7 @@ void x_init_persistent_path(MyString& hp)
#endif #endif
self.notificationView = [[[UILabel alloc] initWithFrame:CGRectMake(8,48,200,32)] autorelease]; self.notificationView = [[UILabel alloc] initWithFrame:CGRectMake(8,48,200,32)];
self.notificationView.alpha=0.0; self.notificationView.alpha=0.0;
@ -645,7 +645,7 @@ void x_init_persistent_path(MyString& hp)
self.secondaryScreen = self.primaryScreen; self.secondaryScreen = self.primaryScreen;
self.secondaryWindow.hidden = YES; self.secondaryWindow.hidden = YES;
[self.secondaryWindow release]; self.secondaryWindow;
self.secondaryWindow = nil; self.secondaryWindow = nil;
[a updateView]; [a updateView];
@ -801,12 +801,6 @@ void x_init_persistent_path(MyString& hp)
pMac = NULL; pMac = NULL;
} }
self.viewController = nil;
self.emulatorController = nil;
self.detailController = nil;
self.infoController = nil;
self.window = nil;
[super dealloc];
} }
@ -891,8 +885,8 @@ void x_display_alert(int _abort, const char* _title, const char* _message)
alertAbort = _abort; alertAbort = _abort;
alertTitle = _title; alertTitle = _title;
alertMessage = _message; alertMessage = _message;
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; @autoreleasepool {
[pManager performSelectorOnMainThread:@selector(displayAlert:) withObject:nil waitUntilDone:NO]; [pManager performSelectorOnMainThread:@selector(displayAlert:) withObject:nil waitUntilDone:NO];
[pool release]; }
} }

View File

@ -35,10 +35,10 @@ enum gestureModes
NSTimer* disableTimer; NSTimer* disableTimer;
} }
@property (retain,nonatomic) UISwipeGestureRecognizer* grswipeup; @property (strong,nonatomic) UISwipeGestureRecognizer* grswipeup;
@property (retain,nonatomic) UISwipeGestureRecognizer* grswipedown; @property (strong,nonatomic) UISwipeGestureRecognizer* grswipedown;
@property (retain,nonatomic) UISwipeGestureRecognizer* grswipeleft; @property (strong,nonatomic) UISwipeGestureRecognizer* grswipeleft;
@property (retain,nonatomic) UISwipeGestureRecognizer* grswiperight; @property (strong,nonatomic) UISwipeGestureRecognizer* grswiperight;
-(void)disableGestures:(int)_mode ; -(void)disableGestures:(int)_mode ;
-(void)enableGestures:(int)_mode ; -(void)enableGestures:(int)_mode ;
@ -60,10 +60,6 @@ enum attachMode
@interface activegsEmulatorController : UIVIEWCONTROLLERROOT @interface activegsEmulatorController : UIVIEWCONTROLLERROOT
{ {
NSString* _trackerName;
customView* _contentView;
zoomEmulatorView* _zv;
KBDController* _kbdc ;
@public @public
int attachedTo; int attachedTo;
} }
@ -74,10 +70,10 @@ enum attachMode
-(void) updateView; -(void) updateView;
@property (assign) customView* contentView; @property (nonatomic, strong) customView* contentView;
@property (assign) zoomEmulatorView* zv; @property (nonatomic, strong) zoomEmulatorView* zv;
@property (assign) KBDController* kbdc ; @property (nonatomic, strong) KBDController* kbdc ;
@property (nonatomic, retain) NSString* trackerName ; @property (nonatomic, strong) NSString* trackerName ;
@end @end

View File

@ -99,7 +99,7 @@ int x_lock_zoom = 0;
{ {
// Swipe down to hide keyboard // Swipe down to hide keyboard
self.grswipeup = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeUp:)] autorelease]; self.grswipeup = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeUp:)];
self.grswipeup.direction = UISwipeGestureRecognizerDirectionUp ; self.grswipeup.direction = UISwipeGestureRecognizerDirectionUp ;
self.grswipeup.cancelsTouchesInView = NO; self.grswipeup.cancelsTouchesInView = NO;
self.grswipeup.numberOfTouchesRequired = SWIPENBTOUCHES; self.grswipeup.numberOfTouchesRequired = SWIPENBTOUCHES;
@ -107,14 +107,14 @@ int x_lock_zoom = 0;
// Swipe up to display keyboard // Swipe up to display keyboard
self.grswipedown = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeDown:)] autorelease]; self.grswipedown = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeDown:)];
self.grswipedown.direction = UISwipeGestureRecognizerDirectionDown; self.grswipedown.direction = UISwipeGestureRecognizerDirectionDown;
self.grswipedown.cancelsTouchesInView = NO; self.grswipedown.cancelsTouchesInView = NO;
self.grswipedown.numberOfTouchesRequired = SWIPENBTOUCHES; self.grswipedown.numberOfTouchesRequired = SWIPENBTOUCHES;
[self addGestureRecognizer:self.grswipedown]; [self addGestureRecognizer:self.grswipedown];
// Swipe left to go back to browsing // Swipe left to go back to browsing
self.grswipeleft = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)] autorelease]; self.grswipeleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)];
self.grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft; self.grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
self.grswipeleft.cancelsTouchesInView = NO; self.grswipeleft.cancelsTouchesInView = NO;
self.grswipeleft.numberOfTouchesRequired = SWIPENBTOUCHES; self.grswipeleft.numberOfTouchesRequired = SWIPENBTOUCHES;
@ -122,7 +122,7 @@ int x_lock_zoom = 0;
// Swipe Right to go back to browsing // Swipe Right to go back to browsing
self.grswiperight = [[[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)] autorelease]; self.grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
self.grswiperight.direction = UISwipeGestureRecognizerDirectionRight; self.grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
self.grswiperight.cancelsTouchesInView = NO; self.grswiperight.cancelsTouchesInView = NO;
self.grswiperight.numberOfTouchesRequired = SWIPENBTOUCHES; self.grswiperight.numberOfTouchesRequired = SWIPENBTOUCHES;
@ -386,26 +386,11 @@ int x_lock_zoom = 0;
} }
- (void)dealloc
{
self.grswipedown = nil;
self.grswipeup = nil;
self.grswipeleft = nil;
self.grswiperight = nil;
[super dealloc];
}
@end @end
@implementation activegsEmulatorController @implementation activegsEmulatorController
@synthesize kbdc = _kbdc;
@synthesize zv = _zv;
@synthesize contentView = _contentView;
@synthesize trackerName = _trackerName;
#ifdef USE_CAPPTAIN #ifdef USE_CAPPTAIN
-(NSString*)getCapptainActivityName -(NSString*)getCapptainActivityName
@ -419,7 +404,7 @@ int x_lock_zoom = 0;
{ {
CGRect rv = CGRectMake(0,0,100.0,100.0); CGRect rv = CGRectMake(0,0,100.0,100.0);
self.zv = [[[zoomEmulatorView alloc] initWithFrame:rv ratio:1.0] retain]; self.zv = [[zoomEmulatorView alloc] initWithFrame:rv ratio:1.0];
} }
@ -431,7 +416,7 @@ int x_lock_zoom = 0;
CGRect apprect = [[UIScreen mainScreen] applicationFrame]; CGRect apprect = [[UIScreen mainScreen] applicationFrame];
printf("mainScreen apprect %d x %d\n",(int)apprect.size.width,(int)apprect.size.height); printf("mainScreen apprect %d x %d\n",(int)apprect.size.width,(int)apprect.size.height);
self.contentView = [[[customView alloc] initWithFrame:apprect] autorelease]; self.contentView = [[customView alloc] initWithFrame:apprect];
#ifdef SHOW_COLOR #ifdef SHOW_COLOR
self.contentView.backgroundColor = [UIColor yellowColor]; self.contentView.backgroundColor = [UIColor yellowColor];
#else #else
@ -443,7 +428,7 @@ int x_lock_zoom = 0;
[self.zv setUserInteractionEnabled:TRUE]; [self.zv setUserInteractionEnabled:TRUE];
self.kbdc = [[KBDController alloc] retain]; self.kbdc = [KBDController alloc];
[self.contentView addSubview:self.kbdc.view]; [self.contentView addSubview:self.kbdc.view];
self.view = self.contentView; self.view = self.contentView;
@ -684,10 +669,9 @@ int x_lock_zoom = 0;
- (void)dealloc { - (void)dealloc {
[self.zv release]; self.zv;
self.zv = nil; self.zv = nil;
[super dealloc];
} }
@end @end

View File

@ -66,11 +66,11 @@ enum { ONLY_APPLE2=1, ONLY_2GS=2, ALL=4, ALL_NO_INDEX=8, DOC_LIST=128 };
int filter; int filter;
} }
@property(nonatomic,retain) NSMutableArray* listOfItems; @property(nonatomic,strong) NSMutableArray* listOfItems;
@property(nonatomic,retain) UILabelMargin* warningLabel; @property(nonatomic,strong) UILabelMargin* warningLabel;
@property(nonatomic,retain) NSString* sourceRevision; @property(nonatomic,strong) NSString* sourceRevision;
@property(nonatomic,retain) NSString* sourceName; @property(nonatomic,strong) NSString* sourceName;
@property(nonatomic,retain) NSArray *searchArray ; @property(nonatomic,strong) NSArray *searchArray ;
- (simplexml*)addList:(const char*)_listPath; - (simplexml*)addList:(const char*)_listPath;
- (void)retrieveDocumentList:(MyString&) tempXML withBaseURL:(MyString&)baseURL; - (void)retrieveDocumentList:(MyString&) tempXML withBaseURL:(MyString&)baseURL;

View File

@ -86,7 +86,6 @@ static UIImage* defaultImageII = nil;
{ {
defaultImage2GS = [UIImage imageWithContentsOfFile: imgSource] ; defaultImage2GS = [UIImage imageWithContentsOfFile: imgSource] ;
defaultImage2GS = [AsyncImageView processImage:defaultImage2GS width:64*rr height:40*rr]; defaultImage2GS = [AsyncImageView processImage:defaultImage2GS width:64*rr height:40*rr];
[defaultImage2GS retain];
} }
else else
defaultImage2GS = nil; defaultImage2GS = nil;
@ -96,7 +95,6 @@ static UIImage* defaultImageII = nil;
{ {
defaultImageII = [UIImage imageWithContentsOfFile: imgSource2]; defaultImageII = [UIImage imageWithContentsOfFile: imgSource2];
defaultImageII = [AsyncImageView processImage:defaultImageII width:64*rr height:40*rr]; defaultImageII = [AsyncImageView processImage:defaultImageII width:64*rr height:40*rr];
[defaultImageII retain];
} }
else else
defaultImageII = nil; defaultImageII = nil;
@ -311,7 +309,7 @@ static UIImage* defaultImageII = nil;
for(int i=0;i<list.elements.size();i++) for(int i=0;i<list.elements.size();i++)
{ {
ActiveGSElement* el = &list.elements.at(i); ActiveGSElement* el = &list.elements.at(i);
itemClass* ic = [[itemClass alloc] autorelease]; itemClass* ic = [itemClass alloc];
// itemClass* ic = [itemClass alloc]; // itemClass* ic = [itemClass alloc];
ic->element = el; ic->element = el;
@ -363,7 +361,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
CGSize s = self.view.frame.size; CGSize s = self.view.frame.size;
CGRect r = CGRectMake((s.width-LABELWIDTH)/2,(s.height-LABELHEIGHT)/2,LABELWIDTH,LABELHEIGHT); CGRect r = CGRectMake((s.width-LABELWIDTH)/2,(s.height-LABELHEIGHT)/2,LABELWIDTH,LABELHEIGHT);
self.warningLabel = [[[UILabelMargin alloc]initWithFrame:r ] autorelease]; self.warningLabel = [[UILabelMargin alloc]initWithFrame:r ];
self.warningLabel.backgroundColor = [UIColor colorWithWhite:0.8 alpha:0.5]; self.warningLabel.backgroundColor = [UIColor colorWithWhite:0.8 alpha:0.5];
self.warningLabel.lineBreakMode = UILineBreakModeWordWrap; self.warningLabel.lineBreakMode = UILineBreakModeWordWrap;
self.warningLabel.numberOfLines = 0; self.warningLabel.numberOfLines = 0;
@ -396,7 +394,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
if (!versionPath.IsEmpty()) if (!versionPath.IsEmpty())
{ {
[[[AsyncCommand alloc] initCommand:versionPath.c_str() withObject:self withSelector:@selector(checkUpdateCallback:)] autorelease]; [[AsyncCommand alloc] initCommand:versionPath.c_str() withObject:self withSelector:@selector(checkUpdateCallback:)];
} }
bLoaded = 1; bLoaded = 1;
@ -459,7 +457,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
-(void)reloadData:(BOOL)_forceDownload -(void)reloadData:(BOOL)_forceDownload
{ {
//Initialize the array. //Initialize the array.
self.listOfItems = [[[NSMutableArray alloc] init] autorelease]; self.listOfItems = [[NSMutableArray alloc] init];
list.reset(); list.reset();
// pXML = NULL; // pXML = NULL;
@ -610,7 +608,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
if (cell != nil) if (cell != nil)
return cell; return cell;
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
cell.textLabel.text = cellValue; cell.textLabel.text = cellValue;
@ -625,7 +623,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
AsyncImageView* asyncImage = [[AsyncImageView alloc] autorelease]; AsyncImageView* asyncImage = [AsyncImageView alloc];
float s = [pManager resolutionRatio]*[pManager dpiRatio]; float s = [pManager resolutionRatio]*[pManager dpiRatio];
[asyncImage initImage:ic->element->thumb.c_str() target:cell.imageView width:64*s height:40*s]; [asyncImage initImage:ic->element->thumb.c_str() target:cell.imageView width:64*s height:40*s];
// [asyncImage performSelectorOnMainThread:@selector(loadImage:) withObject:nil waitUntilDone:NO]; // [asyncImage performSelectorOnMainThread:@selector(loadImage:) withObject:nil waitUntilDone:NO];
@ -750,7 +748,6 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
*/ */
list.reset(); list.reset();
[super dealloc];
} }
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

View File

@ -32,12 +32,12 @@
} }
@property (retain,nonatomic) UINavigationItem* navItem; @property (strong,nonatomic) UINavigationItem* navItem;
@property (retain,nonatomic) UINavigationBar* navView; @property (strong,nonatomic) UINavigationBar* navView;
@property (retain,nonatomic) UITabBarController* tabView; @property (strong,nonatomic) UITabBarController* tabView;
@property (retain,nonatomic) UIActivityIndicatorView* loader; @property (strong,nonatomic) UIActivityIndicatorView* loader;
@property (retain,nonatomic) activegsList* docList; @property (strong,nonatomic) activegsList* docList;
@property (retain,nonatomic) activegsList* l0; @property (strong,nonatomic) activegsList* l0;
- (void)loadView; - (void)loadView;
-(void)updateView; -(void)updateView;

View File

@ -86,7 +86,7 @@
[self.loader setFrame:rl]; [self.loader setFrame:rl];
#endif #endif
self.loader = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease]; self.loader = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[self.view addSubview:self.loader]; [self.view addSubview:self.loader];
@ -96,10 +96,10 @@
self.navView = [[[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, r.size.width, BARVIEW_HEIGHT)] autorelease]; self.navView = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, r.size.width, BARVIEW_HEIGHT)];
self.navView.barStyle = UIBarStyleBlack; self.navView.barStyle = UIBarStyleBlack;
// self.navView.delegate = self; // self.navView.delegate = self;
self.navItem = [[[UINavigationItem alloc] initWithTitle:@ACTIVEGS_TITLE] autorelease]; self.navItem = [[UINavigationItem alloc] initWithTitle:@ACTIVEGS_TITLE];
#ifdef ACTIVEGS_BACKGROUNDIMAGE #ifdef ACTIVEGS_BACKGROUNDIMAGE
[self.view addSubview:pManager.backgroundView]; [self.view addSubview:pManager.backgroundView];
@ -132,14 +132,14 @@
[backButton setTitle:@"Back" forState:UIControlStateNormal]; [backButton setTitle:@"Back" forState:UIControlStateNormal];
// create button item -- possible because UIButton subclasses UIView! // create button item -- possible because UIButton subclasses UIView!
UIBarButtonItem* browseItem = [[[UIBarButtonItem alloc] initWithCustomView:backButton] autorelease]; UIBarButtonItem* browseItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
#endif #endif
self.navItem.leftBarButtonItem = browseItem; self.navItem.leftBarButtonItem = browseItem;
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight]; UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
[infoButton addTarget:self action:@selector(infoButton:) forControlEvents:UIControlEventTouchUpInside]; [infoButton addTarget:self action:@selector(infoButton:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem* infoItem = [[[UIBarButtonItem alloc] initWithCustomView:infoButton] autorelease]; UIBarButtonItem* infoItem = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
self.navItem.rightBarButtonItem = infoItem; self.navItem.rightBarButtonItem = infoItem;
@ -148,55 +148,55 @@
r.origin.y = self.navView.frame.size.height; r.origin.y = self.navView.frame.size.height;
r.size.height -= r.origin.y; r.size.height -= r.origin.y;
self.tabView = [[[UITabBarController alloc] init] autorelease]; self.tabView = [[UITabBarController alloc] init];
[self.tabView.view setFrame:r]; [self.tabView.view setFrame:r];
self.tabView.delegate = self; self.tabView.delegate = self;
NSString *imgSource; NSString *imgSource;
self.l0 = [[activegsList alloc] autorelease]; self.l0 = [activegsList alloc];
//imgSource = [[NSBundle mainBundle] pathForResource:@ACTIVEGS_FIRSTTABLIST ofType:@"activegsxml"] ; //imgSource = [[NSBundle mainBundle] pathForResource:@ACTIVEGS_FIRSTTABLIST ofType:@"activegsxml"] ;
self.l0->listPath = pManager->firstTabXML.c_str(); self.l0->listPath = pManager->firstTabXML.c_str();
self.l0->filter= ALL_NO_INDEX ; self.l0->filter= ALL_NO_INDEX ;
self.l0->trackerName = ACTIVEGS_FIRSTTABTRACKER; self.l0->trackerName = ACTIVEGS_FIRSTTABTRACKER;
imgSource = [[NSBundle mainBundle] pathForResource:@ACTIVEGS_FIRSTTABICON ofType:@"png"]; imgSource = [[NSBundle mainBundle] pathForResource:@ACTIVEGS_FIRSTTABICON ofType:@"png"];
self.l0.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@ACTIVEGS_FIRSTTABTITLE image:[UIImage imageWithContentsOfFile: imgSource] tag:0] autorelease]; self.l0.tabBarItem = [[UITabBarItem alloc] initWithTitle:@ACTIVEGS_FIRSTTABTITLE image:[UIImage imageWithContentsOfFile: imgSource] tag:0];
#ifdef ACTIVEGS_SINGLETAB #ifdef ACTIVEGS_SINGLETAB
[self.l0.view setFrame:r]; [self.l0.view setFrame:r];
[self.view addSubview:self.l0.view]; [self.view addSubview:self.l0.view];
#else #else
activegsList* l3 = [[activegsList alloc] autorelease]; activegsList* l3 = [activegsList alloc];
l3->listPath = "http://www.freetoolsassociation.com/xml/list.activegsxml"; l3->listPath = "http://www.freetoolsassociation.com/xml/list.activegsxml";
l3->versionPath = "http://www.freetoolsassociation.com/xml/version.dat"; l3->versionPath = "http://www.freetoolsassociation.com/xml/version.dat";
l3->filter= ALL; l3->filter= ALL;
l3.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"FTA Website" image:[UIImage imageWithContentsOfFile: imgSource] tag:0] autorelease]; ; l3.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"FTA Website" image:[UIImage imageWithContentsOfFile: imgSource] tag:0]; ;
l3->trackerName = "FTA"; l3->trackerName = "FTA";
activegsList* l1 = [[activegsList alloc] autorelease]; activegsList* l1 = [activegsList alloc];
l1->listPath = "http://www.virtualapple.org/xmlfiles/list.zip"; l1->listPath = "http://www.virtualapple.org/xmlfiles/list.zip";
l1->versionPath = "http://www.virtualapple.org/xmlfiles/version.dat"; l1->versionPath = "http://www.virtualapple.org/xmlfiles/version.dat";
l1->filter = ONLY_APPLE2 ; l1->filter = ONLY_APPLE2 ;
l1->trackerName = "VirtualApple2"; l1->trackerName = "VirtualApple2";
/*NSString */imgSource = [[NSBundle mainBundle] pathForResource:@"Tab][" ofType:@"png"]; /*NSString */imgSource = [[NSBundle mainBundle] pathForResource:@"Tab][" ofType:@"png"];
l1.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"Apple II" image:[UIImage imageWithContentsOfFile: imgSource] tag:0] autorelease]; l1.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Apple II" image:[UIImage imageWithContentsOfFile: imgSource] tag:0];
activegsList* l2 = [[activegsList alloc] autorelease]; activegsList* l2 = [activegsList alloc];
l2->listPath = "http://www.virtualapple.org/xmlfiles/list.zip";; l2->listPath = "http://www.virtualapple.org/xmlfiles/list.zip";;
// l2.title = @"Apple IIGS"; // l2.title = @"Apple IIGS";
l2->filter = ONLY_2GS; l2->filter = ONLY_2GS;
l2->trackerName = "VirtualApple2GS"; l2->trackerName = "VirtualApple2GS";
imgSource = [[NSBundle mainBundle] pathForResource:@"Tab2GS" ofType:@"png"]; imgSource = [[NSBundle mainBundle] pathForResource:@"Tab2GS" ofType:@"png"];
l2.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"Apple IIGS" image:[UIImage imageWithContentsOfFile: imgSource] tag:0] autorelease]; l2.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Apple IIGS" image:[UIImage imageWithContentsOfFile: imgSource] tag:0];
#ifndef ACTIVEGS_ENABLE_DOCUMENT #ifndef ACTIVEGS_ENABLE_DOCUMENT
self.docList= nil; self.docList= nil;
#else #else
self.docList = [[activegsList alloc] autorelease]; self.docList = [activegsList alloc];
self.docList->listPath.Empty(); self.docList->listPath.Empty();
self.docList->filter = (int)(ALL_NO_INDEX|DOC_LIST); self.docList->filter = (int)(ALL_NO_INDEX|DOC_LIST);
self.docList->trackerName = "My2GS"; self.docList->trackerName = "My2GS";
//docList.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"My 2GS" image:[UIImage imageWithContentsOfFile: imgSource] tag:0] autorelease]; //docList.tabBarItem = [[[UITabBarItem alloc] initWithTitle:@"My 2GS" image:[UIImage imageWithContentsOfFile: imgSource] tag:0] autorelease];
self.docList.tabBarItem = [[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0] autorelease]; self.docList.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemFavorites tag:0];
#endif #endif
[self.tabView setViewControllers:[NSArray arrayWithObjects:self.l0, l3, l1, l2, self.docList,nil]]; [self.tabView setViewControllers:[NSArray arrayWithObjects:self.l0, l3, l1, l2, self.docList,nil]];
@ -211,13 +211,11 @@
UISwipeGestureRecognizer* grswipeleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)]; UISwipeGestureRecognizer* grswipeleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)];
grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft; grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
[self.view addGestureRecognizer:grswipeleft]; [self.view addGestureRecognizer:grswipeleft];
[grswipeleft release];
// Swipe right to go back to browsing // Swipe right to go back to browsing
UISwipeGestureRecognizer* grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)]; UISwipeGestureRecognizer* grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
grswiperight.direction = UISwipeGestureRecognizerDirectionRight; grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
[self.view addGestureRecognizer:grswiperight]; [self.view addGestureRecognizer:grswiperight];
[grswiperight release];
// pour etre sur qu'il soit visible // pour etre sur qu'il soit visible
[self.view bringSubviewToFront:self.loader]; [self.view bringSubviewToFront:self.loader];
@ -244,7 +242,7 @@
activegsList* l = (activegsList*) self.tabView.selectedViewController; activegsList* l = (activegsList*) self.tabView.selectedViewController;
NSString* fmt = [NSString stringWithFormat:@"Database version v%@ is available!\n(current installed version is v%@)\n\nDo you want to update ?",newVersion,l.sourceRevision]; NSString* fmt = [NSString stringWithFormat:@"Database version v%@ is available!\n(current installed version is v%@)\n\nDo you want to update ?",newVersion,l.sourceRevision];
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:l.sourceName message:fmt delegate:self cancelButtonTitle:@"Later" otherButtonTitles:@"Update Now",nil] autorelease]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:l.sourceName message:fmt delegate:self cancelButtonTitle:@"Later" otherButtonTitles:@"Update Now",nil];
[alert show]; [alert show];
} }
@ -259,7 +257,7 @@
fmt = [NSString stringWithFormat:@"Database v%@\n\nPress Refresh to reload the database.",l.sourceRevision]; fmt = [NSString stringWithFormat:@"Database v%@\n\nPress Refresh to reload the database.",l.sourceRevision];
title = l.sourceName; title = l.sourceName;
} }
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:title message:fmt delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Refresh",nil] autorelease]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:fmt delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Refresh",nil];
[alert show]; [alert show];
} }

View File

@ -15,9 +15,9 @@ NSString *_url;
id callbackObj; id callbackObj;
SEL callbackSel; SEL callbackSel;
} }
@property (retain,nonatomic) NSMutableData* data; @property (strong,nonatomic) NSMutableData* data;
@property (retain,nonatomic) NSURLConnection* theConnection; @property (strong,nonatomic) NSURLConnection* theConnection;
@property (retain,nonatomic) NSString *url; @property (strong,nonatomic) NSString *url;
- (AsyncCommand*)initCommand: (const char*)url withObject:(id)_obj withSelector:(SEL)_sel; - (AsyncCommand*)initCommand: (const char*)url withObject:(id)_obj withSelector:(SEL)_sel;

View File

@ -14,13 +14,6 @@
@synthesize url = _url; @synthesize url = _url;
@synthesize data = _data; @synthesize data = _data;
- (void)dealloc
{
self.data = nil;
self.theConnection = nil;
self.url = nil;
[super dealloc];
}
- (AsyncCommand*)initCommand: (const char*)_myurl withObject:(id)_obj withSelector:(SEL)_sel - (AsyncCommand*)initCommand: (const char*)_myurl withObject:(id)_obj withSelector:(SEL)_sel
{ {
@ -30,10 +23,10 @@
self.url = [NSString stringWithUTF8String:_myurl]; self.url = [NSString stringWithUTF8String:_myurl];
NSURL* urlnoescape = [[[NSURL alloc] initWithString:[self.url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] autorelease]; NSURL* urlnoescape = [[NSURL alloc] initWithString:[self.url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
NSURLRequest* request = [NSURLRequest requestWithURL:urlnoescape cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0]; NSURLRequest* request = [NSURLRequest requestWithURL:urlnoescape cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60.0];
self.theConnection = [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease]; self.theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (!self.theConnection) if (!self.theConnection)
@ -44,7 +37,7 @@
return nil; return nil;
} }
{ {
[self retain]; // ajoute une référence // ajoute une référence
return self; return self;
} }
} }
@ -52,7 +45,7 @@
//the URL connection calls this repeatedly as data arrives //the URL connection calls this repeatedly as data arrives
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)incrementalData { - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)incrementalData {
if (self.data==nil) { self.data = [[[NSMutableData alloc] initWithCapacity:2048] autorelease]; } if (self.data==nil) { self.data = [[NSMutableData alloc] initWithCapacity:2048]; }
[self.data appendData:incrementalData]; [self.data appendData:incrementalData];
} }
@ -62,7 +55,6 @@
printf("callback received\n"); printf("callback received\n");
[callbackObj performSelector:callbackSel withObject:self.data]; [callbackObj performSelector:callbackSel withObject:self.data];
self.data=nil; self.data=nil;
[self release];
} }
@ -72,7 +64,6 @@
printf("callback failed\n",[self.url UTF8String]); printf("callback failed\n",[self.url UTF8String]);
[callbackObj performSelector:callbackSel withObject:nil]; [callbackObj performSelector:callbackSel withObject:nil];
self.data=nil; self.data=nil;
[self release];
} }
@end @end

View File

@ -23,7 +23,7 @@ static UIActivityIndicatorView* asyncloader=nil;
// singleton // singleton
queue = [[asyncImageQueue alloc] init]; queue = [[asyncImageQueue alloc] init];
queue.theQueue = [[[NSMutableArray alloc] init ] autorelease]; queue.theQueue = [[NSMutableArray alloc] init ];
queue.theConnection = nil; queue.theConnection = nil;
asyncloader = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; asyncloader = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
@ -36,14 +36,6 @@ static UIActivityIndicatorView* asyncloader=nil;
return queue; return queue;
} }
- (void)dealloc {
// [self.theConnection cancel]; //in case the URL is still downloading
self.theConnection = nil;
self.theQueue = nil;
[super dealloc];
}
-(void)prioritizeItem:(UIImageView*)_mytarget { -(void)prioritizeItem:(UIImageView*)_mytarget {
@ -54,10 +46,8 @@ static UIActivityIndicatorView* asyncloader=nil;
if (o.target==_mytarget) if (o.target==_mytarget)
{ {
// le remet au début de la pile = A FAIRE DANS CETTE ORDRE // le remet au début de la pile = A FAIRE DANS CETTE ORDRE
[o retain];
[self.theQueue removeObject:o]; [self.theQueue removeObject:o];
[self.theQueue addObject:o]; [self.theQueue addObject:o];
[o release];
debug_printf("image put on top of the cache %s\n",[o.url UTF8String]); debug_printf("image put on top of the cache %s\n",[o.url UTF8String]);
return; return;
} }
@ -100,11 +90,6 @@ static UIActivityIndicatorView* asyncloader=nil;
@synthesize target = _target; @synthesize target = _target;
@synthesize url = _url; @synthesize url = _url;
- (void)dealloc
{
self.data = nil;
[super dealloc];
}
- (void)processDownload { - (void)processDownload {
@ -125,12 +110,11 @@ static UIActivityIndicatorView* asyncloader=nil;
NSURLRequest* request = [NSURLRequest requestWithURL:urlnoescape cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0] ; NSURLRequest* request = [NSURLRequest requestWithURL:urlnoescape cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0] ;
queue.theConnection = [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease] ; queue.theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self] ;
if (!queue.theConnection) if (!queue.theConnection)
printf("NSURLConnection failed\n"); printf("NSURLConnection failed\n");
[urlnoescape release];
} }
@ -188,7 +172,7 @@ static UIActivityIndicatorView* asyncloader=nil;
// absolute path // absolute path
str2 = str ; //[NSString stringWithUTF8String:str]; str2 = str ; //[NSString stringWithUTF8String:str];
} }
imageView = [[UIImage imageWithContentsOfFile:str2] retain]; // to mimic init imageView = [UIImage imageWithContentsOfFile:str2]; // to mimic init
if (!imageView) if (!imageView)
{ {
printf("init image failed (%s)\n",[str2 UTF8String]); printf("init image failed (%s)\n",[str2 UTF8String]);
@ -205,7 +189,7 @@ static UIActivityIndicatorView* asyncloader=nil;
dl.getPersistentDirectoryFile([self.url UTF8String],IPHONETHUMB,cache); dl.getPersistentDirectoryFile([self.url UTF8String],IPHONETHUMB,cache);
NSString* strcache = [NSString stringWithUTF8String:cache.c_str()]; NSString* strcache = [NSString stringWithUTF8String:cache.c_str()];
imageView = [[UIImage imageWithContentsOfFile:strcache] retain]; imageView = [UIImage imageWithContentsOfFile:strcache];
if (imageView) if (imageView)
{ {
debug_printf("image loaded from cache %s\n",getfile(cache.c_str())); debug_printf("image loaded from cache %s\n",getfile(cache.c_str()));
@ -230,7 +214,7 @@ static UIActivityIndicatorView* asyncloader=nil;
//the URL connection calls this repeatedly as data arrives //the URL connection calls this repeatedly as data arrives
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)incrementalData { - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)incrementalData {
if (self.data==nil) { self.data = [[[NSMutableData alloc] initWithCapacity:2048] autorelease]; } if (self.data==nil) { self.data = [[NSMutableData alloc] initWithCapacity:2048]; }
[self.data appendData:incrementalData]; [self.data appendData:incrementalData];
} }
@ -374,7 +358,6 @@ static UIActivityIndicatorView* asyncloader=nil;
printf("cannot update cache %s\n",cachedURL.c_str()); printf("cannot update cache %s\n",cachedURL.c_str());
} }
[_img release];
} }
@end @end

View File

@ -39,22 +39,22 @@
} }
@property (nonatomic, retain) IBOutlet UILabel* diskName; @property (nonatomic, strong) IBOutlet UILabel* diskName;
@property (nonatomic, retain) IBOutlet UILabel* diskYear; @property (nonatomic, strong) IBOutlet UILabel* diskYear;
@property (nonatomic, retain) IBOutlet UILabel* diskCompany; @property (nonatomic, strong) IBOutlet UILabel* diskCompany;
@property (nonatomic, retain) IBOutlet UITextView* diskDescription; @property (nonatomic, strong) IBOutlet UITextView* diskDescription;
@property (nonatomic, retain) IBOutlet UIImageView* diskApple2; @property (nonatomic, strong) IBOutlet UIImageView* diskApple2;
@property (nonatomic, retain) IBOutlet UIImageView* diskApple2GS; @property (nonatomic, strong) IBOutlet UIImageView* diskApple2GS;
@property (nonatomic, retain) IBOutlet UIWebView* diskWebView; @property (nonatomic, strong) IBOutlet UIWebView* diskWebView;
@property (nonatomic, retain) IBOutlet UIImageView* screenShot1; @property (nonatomic, strong) IBOutlet UIImageView* screenShot1;
@property (nonatomic, retain) IBOutlet UIImageView* screenShot2; @property (nonatomic, strong) IBOutlet UIImageView* screenShot2;
@property (nonatomic, retain) IBOutlet UIImageView* screenShot3; @property (nonatomic, strong) IBOutlet UIImageView* screenShot3;
@property (nonatomic, retain) IBOutlet UINavigationBar* navView; @property (nonatomic, strong) IBOutlet UINavigationBar* navView;
/* /*
@property (nonatomic, retain) itemClass* diskSelected; @property (nonatomic, retain) itemClass* diskSelected;
@property (nonatomic, retain) activegsList* list; @property (nonatomic, retain) activegsList* list;
*/ */
@property (nonatomic, retain) UINavigationItem* navItem; @property (nonatomic, strong) UINavigationItem* navItem;
- (IBAction) launchButton:(id)_sender; - (IBAction) launchButton:(id)_sender;

View File

@ -34,13 +34,13 @@
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{ {
requestURL = [[ request URL ] retain]; requestURL = [ request URL ];
// Check to see what protocol/scheme the requested URL is. // Check to see what protocol/scheme the requested URL is.
if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ]
|| [ [ requestURL scheme ] isEqualToString: @"https" ] ) || [ [ requestURL scheme ] isEqualToString: @"https" ] )
&& ( navigationType == UIWebViewNavigationTypeLinkClicked ) ) { && ( navigationType == UIWebViewNavigationTypeLinkClicked ) ) {
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"iPhone" message:@"Link will open in Safari, continue?" delegate:self cancelButtonTitle:@"Yes" otherButtonTitles:@"No",nil] autorelease]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"iPhone" message:@"Link will open in Safari, continue?" delegate:self cancelButtonTitle:@"Yes" otherButtonTitles:@"No",nil];
[alert show]; [alert show];
return NO; return NO;
} }
@ -84,15 +84,15 @@
self.screenShot2.image = nil; self.screenShot2.image = nil;
self.screenShot3.image = nil; self.screenShot3.image = nil;
AsyncImageView* asyncImage1 = [[AsyncImageView alloc] autorelease] ; AsyncImageView* asyncImage1 = [AsyncImageView alloc] ;
[asyncImage1 initImage:self->diskSelected->screenShots[0].c_str() target:self.screenShot1 width:128 height:80]; [asyncImage1 initImage:self->diskSelected->screenShots[0].c_str() target:self.screenShot1 width:128 height:80];
[asyncImage1 loadImage:nil]; [asyncImage1 loadImage:nil];
AsyncImageView* asyncImage2 = [[AsyncImageView alloc] autorelease]; AsyncImageView* asyncImage2 = [AsyncImageView alloc];
[asyncImage2 initImage:self->diskSelected->screenShots[1].c_str() target:self.screenShot2 width:128 height:80]; [asyncImage2 initImage:self->diskSelected->screenShots[1].c_str() target:self.screenShot2 width:128 height:80];
[asyncImage2 loadImage:nil]; [asyncImage2 loadImage:nil];
AsyncImageView* asyncImage3 = [[AsyncImageView alloc] autorelease] ; AsyncImageView* asyncImage3 = [AsyncImageView alloc] ;
[asyncImage3 initImage:self->diskSelected->screenShots[2].c_str() target:self.screenShot3 width:128 height:80]; [asyncImage3 initImage:self->diskSelected->screenShots[2].c_str() target:self.screenShot3 width:128 height:80];
[asyncImage3 loadImage:nil]; [asyncImage3 loadImage:nil];
@ -128,12 +128,6 @@
} }
- (void)dealloc
{
[requestURL release];
[super dealloc];
}
@ -141,7 +135,7 @@
CGRect r = [UIScreen mainScreen].applicationFrame; CGRect r = [UIScreen mainScreen].applicationFrame;
self.navItem = [[[UINavigationItem alloc] initWithTitle:@"Detail"] autorelease]; self.navItem = [[UINavigationItem alloc] initWithTitle:@"Detail"];
[self.navView pushNavigationItem:self.navItem animated:FALSE]; [self.navView pushNavigationItem:self.navItem animated:FALSE];
[self.view setFrame:r]; [self.view setFrame:r];
@ -158,7 +152,7 @@
[backButton setTitle:@"List" forState:UIControlStateNormal]; [backButton setTitle:@"List" forState:UIControlStateNormal];
// create button item -- possible because UIButton subclasses UIView! // create button item -- possible because UIButton subclasses UIView!
UIBarButtonItem* browseItem = [[[UIBarButtonItem alloc] initWithCustomView:backButton] autorelease]; UIBarButtonItem* browseItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
#endif #endif
self.navItem.leftBarButtonItem = browseItem; self.navItem.leftBarButtonItem = browseItem;
@ -168,7 +162,6 @@
grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft; grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
grswipeleft.cancelsTouchesInView = NO; grswipeleft.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:grswipeleft]; [self.view addGestureRecognizer:grswipeleft];
[grswipeleft release];
// Swipe Right to launch // Swipe Right to launch
@ -176,7 +169,6 @@
grswiperight.direction = UISwipeGestureRecognizerDirectionRight; grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
grswiperight.cancelsTouchesInView = NO; grswiperight.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:grswiperight]; [self.view addGestureRecognizer:grswiperight];
[grswiperight release];
} }

View File

@ -15,10 +15,10 @@
UILabel* _versionUILandscape; UILabel* _versionUILandscape;
} }
@property (nonatomic, retain) IBOutlet UILabel* versionUILandscape; @property (nonatomic, strong) IBOutlet UILabel* versionUILandscape;
@property (nonatomic, retain) IBOutlet UILabel* versionUI; @property (nonatomic, strong) IBOutlet UILabel* versionUI;
@property (nonatomic, retain) IBOutlet UIView* portraitView; @property (nonatomic, strong) IBOutlet UIView* portraitView;
@property (nonatomic, retain) IBOutlet UIView* landscapeView; @property (nonatomic, strong) IBOutlet UIView* landscapeView;
- (void)updateView:(UIDeviceOrientation)_orientation ; - (void)updateView:(UIDeviceOrientation)_orientation ;
- (IBAction) doneButton:(id)_sender; - (IBAction) doneButton:(id)_sender;

View File

@ -18,9 +18,6 @@
@synthesize portraitView= _portraitView; @synthesize portraitView= _portraitView;
@synthesize landscapeView = _landscapeView; @synthesize landscapeView = _landscapeView;
- (void)dealloc {
[super dealloc];
}
-(void)viewDidLoad -(void)viewDidLoad
@ -49,14 +46,12 @@
grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft; grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
grswipeleft.cancelsTouchesInView = NO; grswipeleft.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:grswipeleft]; [self.view addGestureRecognizer:grswipeleft];
[grswipeleft release];
// Swipe Right to go back to browsing // Swipe Right to go back to browsing
UISwipeGestureRecognizer* grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)]; UISwipeGestureRecognizer* grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
grswiperight.direction = UISwipeGestureRecognizerDirectionRight; grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
grswiperight.cancelsTouchesInView = NO; grswiperight.cancelsTouchesInView = NO;
[self.view addGestureRecognizer:grswiperight]; [self.view addGestureRecognizer:grswiperight];
[grswiperight release];
} }
@ -130,7 +125,7 @@
- (IBAction) parametersButton:(id)_sender - (IBAction) parametersButton:(id)_sender
{ {
UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"ActiveGS" message:@"Not implemented yet" delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil] autorelease]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"ActiveGS" message:@"Not implemented yet" delegate:self cancelButtonTitle:@"Done" otherButtonTitles:nil];
[alert show]; [alert show];
} }

View File

@ -20,7 +20,7 @@ int x_frame_rate = -1;
if (displayLink) if (displayLink)
[self deactivateEmulatorRefresh]; [self deactivateEmulatorRefresh];
displayLink = [[CADisplayLink displayLinkWithTarget:self selector:@selector(directDraw:)] retain]; displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(directDraw:)];
x_frame_rate = _frameRate; x_frame_rate = _frameRate;
switch(_frameRate) switch(_frameRate)

View File

@ -53,10 +53,10 @@ typedef struct orientationVar orientationVar;
UITouch* _secondTouch; UITouch* _secondTouch;
int curOrientation; int curOrientation;
} }
@property (retain,nonatomic) emulatorView* ew ; @property (strong,nonatomic) emulatorView* ew ;
@property (retain,nonatomic) UIImageView* crt ; @property (strong,nonatomic) UIImageView* crt ;
@property (retain,nonatomic) UITouch* useTouch ; @property (strong,nonatomic) UITouch* useTouch ;
@property (retain,nonatomic) UITouch* secondTouch ; @property (strong,nonatomic) UITouch* secondTouch ;
-(void)updateFrame:(CGRect)frame kbdRect:(CGRect)kbdRect; -(void)updateFrame:(CGRect)frame kbdRect:(CGRect)kbdRect;
-(void)updateScreen:(CGRect)frame ratio:(float)ratio; -(void)updateScreen:(CGRect)frame ratio:(float)ratio;

View File

@ -46,7 +46,7 @@
self.contentSize = CGSizeMake(r.size.width,r.size.height); self.contentSize = CGSizeMake(r.size.width,r.size.height);
self.ew = [[[emulatorView alloc] initWithFrame:r] autorelease]; self.ew = [[emulatorView alloc] initWithFrame:r];
[self.ew setUserInteractionEnabled:TRUE]; [self.ew setUserInteractionEnabled:TRUE];
CGColorSpaceRef innerColorSpace = CGColorSpaceCreateDeviceRGB(); CGColorSpaceRef innerColorSpace = CGColorSpaceCreateDeviceRGB();
@ -62,7 +62,7 @@
} }
CGImageRef innerImageRef = CGBitmapContextCreateImage(icontext); CGImageRef innerImageRef = CGBitmapContextCreateImage(icontext);
UIImage* img = [UIImage imageWithCGImage:innerImageRef]; UIImage* img = [UIImage imageWithCGImage:innerImageRef];
self.crt = [[[UIImageView alloc]initWithImage:img] autorelease]; self.crt = [[UIImageView alloc]initWithImage:img];
self.crt.transform = CGAffineTransformMakeScale(1,0.5); self.crt.transform = CGAffineTransformMakeScale(1,0.5);
[self.crt setFrame:CGRectMake(0,0,r.size.width,r.size.height)]; [self.crt setFrame:CGRectMake(0,0,r.size.width,r.size.height)];
[self.crt setBounds:CGRectMake(0,0,r.size.width,r.size.height*2)]; [self.crt setBounds:CGRectMake(0,0,r.size.width,r.size.height*2)];
@ -801,7 +801,6 @@ float refScaleLandscape;
- (void)dealloc { - (void)dealloc {
self.delegate = nil; self.delegate = nil;
[super dealloc];
} }