mirror of
https://github.com/ogoguel/activegs-ios.git
synced 2024-12-21 08:32:10 +00:00
Convert to use ARC
This commit is contained in:
parent
ec07237701
commit
44cad3ea15
@ -1406,6 +1406,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = "";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
@ -1443,6 +1444,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = "";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
@ -1481,6 +1483,7 @@
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = "";
|
||||
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
|
@ -9,9 +9,9 @@
|
||||
|
||||
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, NSStringFromClass([activegsAppDelegate class]));
|
||||
[pool release];
|
||||
return retVal;
|
||||
int retVal = UIApplicationMain(argc, argv, nil, NSStringFromClass([activegsAppDelegate class]));
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ static NSMutableString *SublayerDescriptionAtLevel(CALayer *layer, int level) {
|
||||
|
||||
- (NSString *)subtreeDescription {
|
||||
NSMutableString *result =
|
||||
[[[self gtm_subtreeDescriptionLine] mutableCopy] autorelease];
|
||||
[[self gtm_subtreeDescriptionLine] mutableCopy];
|
||||
for (UIView *v in [self subviews]) {
|
||||
[result appendString:[v gtm_subtreeDescriptionAtLevel:1]];
|
||||
}
|
||||
|
@ -79,51 +79,51 @@ enum
|
||||
|
||||
}
|
||||
|
||||
@property (nonatomic,retain) UITextField* textField;
|
||||
@property (nonatomic,strong) UITextField* textField;
|
||||
|
||||
@property (nonatomic,retain) UIButton *menuButton;
|
||||
@property (nonatomic,retain) UIBarButtonItem* optionButton ;
|
||||
@property (nonatomic,retain) UIImageView* diskView;
|
||||
@property (nonatomic,retain) UIImageView* diskLoadingView;
|
||||
@property (nonatomic,retain) NSMutableArray* diskIcons;
|
||||
@property (nonatomic,retain) UILabel * loaderLabel;
|
||||
@property (nonatomic,retain) UILabel* debugIndicator;
|
||||
@property (nonatomic,retain) UILabel* swipeIndicator;
|
||||
@property (nonatomic,retain) UILabel* zoomIndicator;
|
||||
@property (nonatomic,retain) UILabel* padIndicator;
|
||||
@property (nonatomic,retain) UILabel* mouseButtonIndicator;
|
||||
@property (nonatomic,retain) UILabel* inputIndicator;
|
||||
@property (nonatomic,retain) UIActivityIndicatorView* loader;
|
||||
@property (nonatomic,retain) NSTimer* loaderTimer;
|
||||
@property (nonatomic,strong) UIButton *menuButton;
|
||||
@property (nonatomic,strong) UIBarButtonItem* optionButton ;
|
||||
@property (nonatomic,strong) UIImageView* diskView;
|
||||
@property (nonatomic,strong) UIImageView* diskLoadingView;
|
||||
@property (nonatomic,strong) NSMutableArray* diskIcons;
|
||||
@property (nonatomic,strong) UILabel * loaderLabel;
|
||||
@property (nonatomic,strong) UILabel* debugIndicator;
|
||||
@property (nonatomic,strong) UILabel* swipeIndicator;
|
||||
@property (nonatomic,strong) UILabel* zoomIndicator;
|
||||
@property (nonatomic,strong) UILabel* padIndicator;
|
||||
@property (nonatomic,strong) UILabel* mouseButtonIndicator;
|
||||
@property (nonatomic,strong) UILabel* inputIndicator;
|
||||
@property (nonatomic,strong) UIActivityIndicatorView* loader;
|
||||
@property (nonatomic,strong) NSTimer* loaderTimer;
|
||||
#ifdef GRAPHICAL_PAD
|
||||
@property (nonatomic,retain) UIImageView* padBackground;
|
||||
@property (nonatomic,retain) UIImageView* padButton1Down;
|
||||
@property (nonatomic,retain) UIImageView* padButton2Down;
|
||||
@property (nonatomic,retain) UIImageView* padStick;
|
||||
#endif
|
||||
@property (nonatomic,retain) UIImageView* padCircleOutter;
|
||||
@property (nonatomic,retain) UIImageView* padCircleInner;
|
||||
@property (nonatomic,retain) UIImageView* oaButtonView;
|
||||
@property (nonatomic,retain) UIImageView* caButtonView;
|
||||
@property (nonatomic,retain) UITouch* padTouch;
|
||||
@property (nonatomic,retain) UITouch* oaButtonTouch;
|
||||
@property (nonatomic,retain) UITouch* caButtonTouch;
|
||||
@property (nonatomic,retain) UINavigationItem* emulatorNavItem;
|
||||
@property (nonatomic,retain) UINavigationBar* runtimeView;
|
||||
@property (nonatomic,retain) UIView* interfaceView;
|
||||
@property (nonatomic,retain) NSTimer* animateDiskTimer;
|
||||
@property (nonatomic,retain) NSTimer* hardwarekbdDetectionTimer;
|
||||
@property (nonatomic,retain) UIImageView* runtimeControls;
|
||||
@property (nonatomic,retain) UIView* runtimeControlsOptions;
|
||||
@property (nonatomic,retain) UIImageView* diskSelection;
|
||||
@property (nonatomic,retain) UIView* diskSelectionOptions;
|
||||
@property (nonatomic,retain) UIScrollView* uit;
|
||||
@property (nonatomic,retain) UIScrollView* uitb;
|
||||
@property (nonatomic,retain) UIView* accessView;
|
||||
@property (nonatomic,retain) UIButton* leftAccessView;
|
||||
@property (nonatomic,retain) UIButton* rightAccessView;
|
||||
@property (nonatomic,retain) UINavigationBar* barView;
|
||||
@property (nonatomic,retain) UINavigationBar* specialView;
|
||||
@property (nonatomic,strong) UIImageView* padCircleOutter;
|
||||
@property (nonatomic,strong) UIImageView* padCircleInner;
|
||||
@property (nonatomic,strong) UIImageView* oaButtonView;
|
||||
@property (nonatomic,strong) UIImageView* caButtonView;
|
||||
@property (nonatomic,strong) UITouch* padTouch;
|
||||
@property (nonatomic,strong) UITouch* oaButtonTouch;
|
||||
@property (nonatomic,strong) UITouch* caButtonTouch;
|
||||
@property (nonatomic,strong) UINavigationItem* emulatorNavItem;
|
||||
@property (nonatomic,strong) UINavigationBar* runtimeView;
|
||||
@property (nonatomic,strong) UIView* interfaceView;
|
||||
@property (nonatomic,strong) NSTimer* animateDiskTimer;
|
||||
@property (nonatomic,strong) NSTimer* hardwarekbdDetectionTimer;
|
||||
@property (nonatomic,strong) UIImageView* runtimeControls;
|
||||
@property (nonatomic,strong) UIView* runtimeControlsOptions;
|
||||
@property (nonatomic,strong) UIImageView* diskSelection;
|
||||
@property (nonatomic,strong) UIView* diskSelectionOptions;
|
||||
@property (nonatomic,strong) UIScrollView* uit;
|
||||
@property (nonatomic,strong) UIScrollView* uitb;
|
||||
@property (nonatomic,strong) UIView* accessView;
|
||||
@property (nonatomic,strong) UIButton* leftAccessView;
|
||||
@property (nonatomic,strong) UIButton* rightAccessView;
|
||||
@property (nonatomic,strong) UINavigationBar* barView;
|
||||
@property (nonatomic,strong) UINavigationBar* specialView;
|
||||
//@property (assign,getter=inputMode) int inputMode;
|
||||
|
||||
|
||||
|
@ -236,7 +236,7 @@ UIImageView* loadImage(NSString* _name)
|
||||
{
|
||||
|
||||
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];
|
||||
return view;
|
||||
|
||||
@ -1034,8 +1034,8 @@ extern int x_frame_rate ;
|
||||
-(void)addDiskSelection
|
||||
{
|
||||
|
||||
[self.diskSelectionOptions release];
|
||||
[self.diskSelection release];
|
||||
self.diskSelectionOptions;
|
||||
self.diskSelection;
|
||||
|
||||
self.diskSelectionOptions = nil;
|
||||
self.diskSelection = nil;
|
||||
@ -1212,7 +1212,7 @@ extern int x_frame_rate ;
|
||||
{
|
||||
printf("removing RuntimeView");
|
||||
[self.runtimeView removeFromSuperview];
|
||||
[self.runtimeView release];
|
||||
self.runtimeView;
|
||||
}
|
||||
|
||||
// position par défault
|
||||
@ -2032,7 +2032,7 @@ int x_adb_get_keypad_y()
|
||||
for(int i=0;i<20;i++)
|
||||
add_event_delay();
|
||||
caButton = TRUE;
|
||||
self.caButtonTouch = [touch retain];;
|
||||
self.caButtonTouch = touch;;
|
||||
self.caButtonView.alpha = 1.0;
|
||||
#ifdef GRAPHICAL_PAD
|
||||
self.padButton2Down.hidden = FALSE;
|
||||
@ -2764,30 +2764,8 @@ const int cycles[]=
|
||||
|
||||
NSLog(@"---kbd dealloc");
|
||||
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];
|
||||
|
||||
}
|
||||
|
||||
|
@ -156,22 +156,22 @@ extern enum machineSpecsEnum machineSpecs;
|
||||
-(void)setNotificationText:(NSString*) _text;
|
||||
-(void)updateNotificationView:(CGRect) newRect;
|
||||
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;
|
||||
@property(nonatomic,retain,getter=getEmulatorView) activegsEmulatorController* emulatorController;
|
||||
@property(nonatomic,retain,getter=getBrowserView) ACTIVEGS_LAUNCHVIEWCONTROLLER* viewController;
|
||||
@property(nonatomic,retain,getter=getInfoView) infoViewController* infoController;
|
||||
@property(nonatomic,retain,getter=getDetailView) detailViewController* detailController;
|
||||
@property(nonatomic,retain) UIViewController* primaryViewController;
|
||||
@property(nonatomic,retain) UIViewController* secondaryViewController;
|
||||
@property(nonatomic,retain) UIView* backgroundView;
|
||||
@property(nonatomic,retain) UIImageView* backgroundImageView ;
|
||||
@property(nonatomic,retain) UIScreen* secondaryScreen ;
|
||||
@property(nonatomic,retain) UIScreen* primaryScreen ;
|
||||
@property(nonatomic,strong,getter=getEmulatorView) activegsEmulatorController* emulatorController;
|
||||
@property(nonatomic,strong,getter=getBrowserView) ACTIVEGS_LAUNCHVIEWCONTROLLER* viewController;
|
||||
@property(nonatomic,strong,getter=getInfoView) infoViewController* infoController;
|
||||
@property(nonatomic,strong,getter=getDetailView) detailViewController* detailController;
|
||||
@property(nonatomic,strong) UIViewController* primaryViewController;
|
||||
@property(nonatomic,strong) UIViewController* secondaryViewController;
|
||||
@property(nonatomic,strong) UIView* backgroundView;
|
||||
@property(nonatomic,strong) UIImageView* backgroundImageView ;
|
||||
@property(nonatomic,strong) UIScreen* secondaryScreen ;
|
||||
@property(nonatomic,strong) UIScreen* primaryScreen ;
|
||||
|
||||
@property(nonatomic,retain) NSTimer* notificationTimer;
|
||||
@property(nonatomic,retain) UILabel* notificationView;
|
||||
@property(nonatomic,strong) NSTimer* notificationTimer;
|
||||
@property(nonatomic,strong) UILabel* notificationView;
|
||||
@property(assign,getter=getAngle) float currentRawReading;
|
||||
@property (nonatomic, retain)/* IBOutlet*/ UIWindow *window;
|
||||
@property (nonatomic, retain) UIWindow *secondaryWindow;
|
||||
@property (nonatomic, strong)/* IBOutlet*/ UIWindow *window;
|
||||
@property (nonatomic, strong) UIWindow *secondaryWindow;
|
||||
@property(assign) float dpiRatio;
|
||||
@property(assign) float resolutionRatio;
|
||||
|
||||
|
@ -67,9 +67,9 @@ void activegs_apply_default_options(void* _config)
|
||||
|
||||
void x_notify_eject()
|
||||
{
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(animateDiskEjection:) withObject:nil waitUntilDone:NO];
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(animateDiskEjection:) withObject:nil waitUntilDone:NO];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -89,9 +89,9 @@ void x_notify_paddle(int _on)
|
||||
printf("x_notify_paddle");
|
||||
padAlreadyDisplayedOnce = 1;
|
||||
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(notifyPaddle:) withObject:nil waitUntilDone:NO];
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(notifyPaddle:) withObject:nil waitUntilDone:NO];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -104,33 +104,33 @@ void x_notify_download_failure(const char*_url)
|
||||
|
||||
void x_loadinginprogress(int _on,int _s,int _d)
|
||||
{
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
@autoreleasepool {
|
||||
|
||||
|
||||
_d --;
|
||||
int param = (_s==5 ? _d : _d +2 );
|
||||
if (_on) param |= 0x80;
|
||||
|
||||
NSNumber* b = [NSNumber numberWithInt:param] ;
|
||||
_d --;
|
||||
int param = (_s==5 ? _d : _d +2 );
|
||||
if (_on) param |= 0x80;
|
||||
|
||||
NSNumber* b = [NSNumber numberWithInt:param] ;
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(setLoading:) withObject:b waitUntilDone:NO];
|
||||
[pool release];
|
||||
}
|
||||
}
|
||||
|
||||
void x_refresh_panel(int _panel)
|
||||
{
|
||||
if (!_panel & PANEL_RUNTIME) return ;
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(refreshControls:) withObject:nil waitUntilDone:NO];
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(refreshControls:) withObject:nil waitUntilDone:NO];
|
||||
}
|
||||
}
|
||||
|
||||
void x_downloadinginprogress(int _percent)
|
||||
{
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
@autoreleasepool {
|
||||
|
||||
NSNumber* b = [NSNumber numberWithInt:_percent];
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(setDownLoading:) withObject:b waitUntilDone:NO];
|
||||
[pool release];
|
||||
NSNumber* b = [NSNumber numberWithInt:_percent];
|
||||
[[pManager getEmulatorView].kbdc performSelectorOnMainThread:@selector(setDownLoading:) withObject:b waitUntilDone:NO];
|
||||
}
|
||||
}
|
||||
|
||||
int alertAbort;
|
||||
@ -142,15 +142,15 @@ MyString alertMessage;
|
||||
|
||||
void x_init_persistent_path(MyString& hp)
|
||||
{
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
@autoreleasepool {
|
||||
|
||||
NSArray *paths= NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||
NSString *dir = [paths objectAtIndex:0];
|
||||
const char *bar = [dir UTF8String];
|
||||
CFStringRef sd = __CFStringMakeConstantString(bar);
|
||||
hp= CFStringGetCStringPtr(sd,CFStringGetSystemEncoding());
|
||||
NSArray *paths= NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
|
||||
NSString *dir = [paths objectAtIndex:0];
|
||||
const char *bar = [dir UTF8String];
|
||||
CFStringRef sd = __CFStringMakeConstantString(bar);
|
||||
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* 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];
|
||||
}
|
||||
|
||||
@ -353,7 +353,7 @@ void x_init_persistent_path(MyString& hp)
|
||||
#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;
|
||||
@ -645,7 +645,7 @@ void x_init_persistent_path(MyString& hp)
|
||||
|
||||
self.secondaryScreen = self.primaryScreen;
|
||||
self.secondaryWindow.hidden = YES;
|
||||
[self.secondaryWindow release];
|
||||
self.secondaryWindow;
|
||||
self.secondaryWindow = nil;
|
||||
|
||||
[a updateView];
|
||||
@ -801,12 +801,6 @@ void x_init_persistent_path(MyString& hp)
|
||||
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;
|
||||
alertTitle = _title;
|
||||
alertMessage = _message;
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
[pManager performSelectorOnMainThread:@selector(displayAlert:) withObject:nil waitUntilDone:NO];
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
[pManager performSelectorOnMainThread:@selector(displayAlert:) withObject:nil waitUntilDone:NO];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -35,10 +35,10 @@ enum gestureModes
|
||||
NSTimer* disableTimer;
|
||||
}
|
||||
|
||||
@property (retain,nonatomic) UISwipeGestureRecognizer* grswipeup;
|
||||
@property (retain,nonatomic) UISwipeGestureRecognizer* grswipedown;
|
||||
@property (retain,nonatomic) UISwipeGestureRecognizer* grswipeleft;
|
||||
@property (retain,nonatomic) UISwipeGestureRecognizer* grswiperight;
|
||||
@property (strong,nonatomic) UISwipeGestureRecognizer* grswipeup;
|
||||
@property (strong,nonatomic) UISwipeGestureRecognizer* grswipedown;
|
||||
@property (strong,nonatomic) UISwipeGestureRecognizer* grswipeleft;
|
||||
@property (strong,nonatomic) UISwipeGestureRecognizer* grswiperight;
|
||||
|
||||
-(void)disableGestures:(int)_mode ;
|
||||
-(void)enableGestures:(int)_mode ;
|
||||
@ -60,10 +60,6 @@ enum attachMode
|
||||
|
||||
@interface activegsEmulatorController : UIVIEWCONTROLLERROOT
|
||||
{
|
||||
NSString* _trackerName;
|
||||
customView* _contentView;
|
||||
zoomEmulatorView* _zv;
|
||||
KBDController* _kbdc ;
|
||||
@public
|
||||
int attachedTo;
|
||||
}
|
||||
@ -74,10 +70,10 @@ enum attachMode
|
||||
|
||||
-(void) updateView;
|
||||
|
||||
@property (assign) customView* contentView;
|
||||
@property (assign) zoomEmulatorView* zv;
|
||||
@property (assign) KBDController* kbdc ;
|
||||
@property (nonatomic, retain) NSString* trackerName ;
|
||||
@property (nonatomic, strong) customView* contentView;
|
||||
@property (nonatomic, strong) zoomEmulatorView* zv;
|
||||
@property (nonatomic, strong) KBDController* kbdc ;
|
||||
@property (nonatomic, strong) NSString* trackerName ;
|
||||
|
||||
|
||||
@end
|
||||
|
@ -99,7 +99,7 @@ int x_lock_zoom = 0;
|
||||
{
|
||||
|
||||
// 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.cancelsTouchesInView = NO;
|
||||
self.grswipeup.numberOfTouchesRequired = SWIPENBTOUCHES;
|
||||
@ -107,14 +107,14 @@ int x_lock_zoom = 0;
|
||||
|
||||
|
||||
// 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.cancelsTouchesInView = NO;
|
||||
self.grswipedown.numberOfTouchesRequired = SWIPENBTOUCHES;
|
||||
[self addGestureRecognizer:self.grswipedown];
|
||||
|
||||
// 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.cancelsTouchesInView = NO;
|
||||
self.grswipeleft.numberOfTouchesRequired = SWIPENBTOUCHES;
|
||||
@ -122,7 +122,7 @@ int x_lock_zoom = 0;
|
||||
|
||||
|
||||
// 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.cancelsTouchesInView = NO;
|
||||
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
|
||||
|
||||
@implementation activegsEmulatorController
|
||||
|
||||
@synthesize kbdc = _kbdc;
|
||||
@synthesize zv = _zv;
|
||||
@synthesize contentView = _contentView;
|
||||
@synthesize trackerName = _trackerName;
|
||||
|
||||
|
||||
#ifdef USE_CAPPTAIN
|
||||
-(NSString*)getCapptainActivityName
|
||||
@ -419,7 +404,7 @@ int x_lock_zoom = 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];
|
||||
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
|
||||
self.contentView.backgroundColor = [UIColor yellowColor];
|
||||
#else
|
||||
@ -443,7 +428,7 @@ int x_lock_zoom = 0;
|
||||
|
||||
[self.zv setUserInteractionEnabled:TRUE];
|
||||
|
||||
self.kbdc = [[KBDController alloc] retain];
|
||||
self.kbdc = [KBDController alloc];
|
||||
[self.contentView addSubview:self.kbdc.view];
|
||||
|
||||
self.view = self.contentView;
|
||||
@ -684,10 +669,9 @@ int x_lock_zoom = 0;
|
||||
|
||||
- (void)dealloc {
|
||||
|
||||
[self.zv release];
|
||||
self.zv;
|
||||
self.zv = nil;
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -66,11 +66,11 @@ enum { ONLY_APPLE2=1, ONLY_2GS=2, ALL=4, ALL_NO_INDEX=8, DOC_LIST=128 };
|
||||
int filter;
|
||||
}
|
||||
|
||||
@property(nonatomic,retain) NSMutableArray* listOfItems;
|
||||
@property(nonatomic,retain) UILabelMargin* warningLabel;
|
||||
@property(nonatomic,retain) NSString* sourceRevision;
|
||||
@property(nonatomic,retain) NSString* sourceName;
|
||||
@property(nonatomic,retain) NSArray *searchArray ;
|
||||
@property(nonatomic,strong) NSMutableArray* listOfItems;
|
||||
@property(nonatomic,strong) UILabelMargin* warningLabel;
|
||||
@property(nonatomic,strong) NSString* sourceRevision;
|
||||
@property(nonatomic,strong) NSString* sourceName;
|
||||
@property(nonatomic,strong) NSArray *searchArray ;
|
||||
|
||||
- (simplexml*)addList:(const char*)_listPath;
|
||||
- (void)retrieveDocumentList:(MyString&) tempXML withBaseURL:(MyString&)baseURL;
|
||||
|
@ -86,7 +86,6 @@ static UIImage* defaultImageII = nil;
|
||||
{
|
||||
defaultImage2GS = [UIImage imageWithContentsOfFile: imgSource] ;
|
||||
defaultImage2GS = [AsyncImageView processImage:defaultImage2GS width:64*rr height:40*rr];
|
||||
[defaultImage2GS retain];
|
||||
}
|
||||
else
|
||||
defaultImage2GS = nil;
|
||||
@ -96,7 +95,6 @@ static UIImage* defaultImageII = nil;
|
||||
{
|
||||
defaultImageII = [UIImage imageWithContentsOfFile: imgSource2];
|
||||
defaultImageII = [AsyncImageView processImage:defaultImageII width:64*rr height:40*rr];
|
||||
[defaultImageII retain];
|
||||
}
|
||||
else
|
||||
defaultImageII = nil;
|
||||
@ -311,7 +309,7 @@ static UIImage* defaultImageII = nil;
|
||||
for(int i=0;i<list.elements.size();i++)
|
||||
{
|
||||
ActiveGSElement* el = &list.elements.at(i);
|
||||
itemClass* ic = [[itemClass alloc] autorelease];
|
||||
itemClass* ic = [itemClass alloc];
|
||||
// itemClass* ic = [itemClass alloc];
|
||||
|
||||
ic->element = el;
|
||||
@ -363,7 +361,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
|
||||
CGSize s = self.view.frame.size;
|
||||
|
||||
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.lineBreakMode = UILineBreakModeWordWrap;
|
||||
self.warningLabel.numberOfLines = 0;
|
||||
@ -396,7 +394,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
|
||||
|
||||
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;
|
||||
@ -459,7 +457,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
|
||||
-(void)reloadData:(BOOL)_forceDownload
|
||||
{
|
||||
//Initialize the array.
|
||||
self.listOfItems = [[[NSMutableArray alloc] init] autorelease];
|
||||
self.listOfItems = [[NSMutableArray alloc] init];
|
||||
|
||||
list.reset();
|
||||
// pXML = NULL;
|
||||
@ -610,7 +608,7 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
|
||||
if (cell != nil)
|
||||
return cell;
|
||||
|
||||
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
|
||||
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
|
||||
|
||||
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];
|
||||
[asyncImage initImage:ic->element->thumb.c_str() target:cell.imageView width:64*s height:40*s];
|
||||
// [asyncImage performSelectorOnMainThread:@selector(loadImage:) withObject:nil waitUntilDone:NO];
|
||||
@ -750,7 +748,6 @@ static NSInteger compareImagesUsingSelector(id p1, id p2, void *context)
|
||||
*/
|
||||
list.reset();
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
||||
|
@ -32,12 +32,12 @@
|
||||
|
||||
}
|
||||
|
||||
@property (retain,nonatomic) UINavigationItem* navItem;
|
||||
@property (retain,nonatomic) UINavigationBar* navView;
|
||||
@property (retain,nonatomic) UITabBarController* tabView;
|
||||
@property (retain,nonatomic) UIActivityIndicatorView* loader;
|
||||
@property (retain,nonatomic) activegsList* docList;
|
||||
@property (retain,nonatomic) activegsList* l0;
|
||||
@property (strong,nonatomic) UINavigationItem* navItem;
|
||||
@property (strong,nonatomic) UINavigationBar* navView;
|
||||
@property (strong,nonatomic) UITabBarController* tabView;
|
||||
@property (strong,nonatomic) UIActivityIndicatorView* loader;
|
||||
@property (strong,nonatomic) activegsList* docList;
|
||||
@property (strong,nonatomic) activegsList* l0;
|
||||
|
||||
- (void)loadView;
|
||||
-(void)updateView;
|
||||
|
@ -86,7 +86,7 @@
|
||||
[self.loader setFrame:rl];
|
||||
|
||||
#endif
|
||||
self.loader = [[[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray] autorelease];
|
||||
self.loader = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
|
||||
|
||||
[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.delegate = self;
|
||||
self.navItem = [[[UINavigationItem alloc] initWithTitle:@ACTIVEGS_TITLE] autorelease];
|
||||
self.navItem = [[UINavigationItem alloc] initWithTitle:@ACTIVEGS_TITLE];
|
||||
|
||||
#ifdef ACTIVEGS_BACKGROUNDIMAGE
|
||||
[self.view addSubview:pManager.backgroundView];
|
||||
@ -132,14 +132,14 @@
|
||||
[backButton setTitle:@"Back" forState:UIControlStateNormal];
|
||||
|
||||
// create button item -- possible because UIButton subclasses UIView!
|
||||
UIBarButtonItem* browseItem = [[[UIBarButtonItem alloc] initWithCustomView:backButton] autorelease];
|
||||
UIBarButtonItem* browseItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
|
||||
#endif
|
||||
|
||||
self.navItem.leftBarButtonItem = browseItem;
|
||||
|
||||
UIButton* infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
|
||||
[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;
|
||||
|
||||
@ -148,55 +148,55 @@
|
||||
r.origin.y = self.navView.frame.size.height;
|
||||
r.size.height -= r.origin.y;
|
||||
|
||||
self.tabView = [[[UITabBarController alloc] init] autorelease];
|
||||
self.tabView = [[UITabBarController alloc] init];
|
||||
[self.tabView.view setFrame:r];
|
||||
self.tabView.delegate = self;
|
||||
NSString *imgSource;
|
||||
|
||||
self.l0 = [[activegsList alloc] autorelease];
|
||||
self.l0 = [activegsList alloc];
|
||||
//imgSource = [[NSBundle mainBundle] pathForResource:@ACTIVEGS_FIRSTTABLIST ofType:@"activegsxml"] ;
|
||||
self.l0->listPath = pManager->firstTabXML.c_str();
|
||||
self.l0->filter= ALL_NO_INDEX ;
|
||||
self.l0->trackerName = ACTIVEGS_FIRSTTABTRACKER;
|
||||
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
|
||||
[self.l0.view setFrame:r];
|
||||
[self.view addSubview:self.l0.view];
|
||||
#else
|
||||
activegsList* l3 = [[activegsList alloc] autorelease];
|
||||
activegsList* l3 = [activegsList alloc];
|
||||
l3->listPath = "http://www.freetoolsassociation.com/xml/list.activegsxml";
|
||||
l3->versionPath = "http://www.freetoolsassociation.com/xml/version.dat";
|
||||
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";
|
||||
|
||||
activegsList* l1 = [[activegsList alloc] autorelease];
|
||||
activegsList* l1 = [activegsList alloc];
|
||||
l1->listPath = "http://www.virtualapple.org/xmlfiles/list.zip";
|
||||
l1->versionPath = "http://www.virtualapple.org/xmlfiles/version.dat";
|
||||
l1->filter = ONLY_APPLE2 ;
|
||||
l1->trackerName = "VirtualApple2";
|
||||
/*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.title = @"Apple IIGS";
|
||||
l2->filter = ONLY_2GS;
|
||||
l2->trackerName = "VirtualApple2GS";
|
||||
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
|
||||
self.docList= nil;
|
||||
#else
|
||||
self.docList = [[activegsList alloc] autorelease];
|
||||
self.docList = [activegsList alloc];
|
||||
self.docList->listPath.Empty();
|
||||
self.docList->filter = (int)(ALL_NO_INDEX|DOC_LIST);
|
||||
self.docList->trackerName = "My2GS";
|
||||
//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
|
||||
|
||||
[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:)];
|
||||
grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
|
||||
[self.view addGestureRecognizer:grswipeleft];
|
||||
[grswipeleft release];
|
||||
|
||||
// Swipe right to go back to browsing
|
||||
UISwipeGestureRecognizer* grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
|
||||
grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
|
||||
[self.view addGestureRecognizer:grswiperight];
|
||||
[grswiperight release];
|
||||
|
||||
// pour etre sur qu'il soit visible
|
||||
[self.view bringSubviewToFront:self.loader];
|
||||
@ -244,7 +242,7 @@
|
||||
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];
|
||||
|
||||
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];
|
||||
}
|
||||
|
||||
@ -259,7 +257,7 @@
|
||||
fmt = [NSString stringWithFormat:@"Database v%@\n\nPress Refresh to reload the database.",l.sourceRevision];
|
||||
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];
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,9 @@ NSString *_url;
|
||||
id callbackObj;
|
||||
SEL callbackSel;
|
||||
}
|
||||
@property (retain,nonatomic) NSMutableData* data;
|
||||
@property (retain,nonatomic) NSURLConnection* theConnection;
|
||||
@property (retain,nonatomic) NSString *url;
|
||||
@property (strong,nonatomic) NSMutableData* data;
|
||||
@property (strong,nonatomic) NSURLConnection* theConnection;
|
||||
@property (strong,nonatomic) NSString *url;
|
||||
|
||||
- (AsyncCommand*)initCommand: (const char*)url withObject:(id)_obj withSelector:(SEL)_sel;
|
||||
|
||||
|
@ -14,13 +14,6 @@
|
||||
@synthesize url = _url;
|
||||
@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
|
||||
{
|
||||
@ -30,10 +23,10 @@
|
||||
|
||||
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];
|
||||
self.theConnection = [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease];
|
||||
self.theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
|
||||
|
||||
|
||||
if (!self.theConnection)
|
||||
@ -44,7 +37,7 @@
|
||||
return nil;
|
||||
}
|
||||
{
|
||||
[self retain]; // ajoute une référence
|
||||
// ajoute une référence
|
||||
return self;
|
||||
}
|
||||
}
|
||||
@ -52,7 +45,7 @@
|
||||
|
||||
//the URL connection calls this repeatedly as data arrives
|
||||
- (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];
|
||||
}
|
||||
|
||||
@ -62,7 +55,6 @@
|
||||
printf("callback received\n");
|
||||
[callbackObj performSelector:callbackSel withObject:self.data];
|
||||
self.data=nil;
|
||||
[self release];
|
||||
|
||||
}
|
||||
|
||||
@ -72,7 +64,6 @@
|
||||
printf("callback failed\n",[self.url UTF8String]);
|
||||
[callbackObj performSelector:callbackSel withObject:nil];
|
||||
self.data=nil;
|
||||
[self release];
|
||||
}
|
||||
|
||||
@end
|
||||
|
@ -23,7 +23,7 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
|
||||
// singleton
|
||||
queue = [[asyncImageQueue alloc] init];
|
||||
queue.theQueue = [[[NSMutableArray alloc] init ] autorelease];
|
||||
queue.theQueue = [[NSMutableArray alloc] init ];
|
||||
queue.theConnection = nil;
|
||||
|
||||
asyncloader = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
|
||||
@ -36,14 +36,6 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
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 {
|
||||
|
||||
@ -54,10 +46,8 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
if (o.target==_mytarget)
|
||||
{
|
||||
// le remet au début de la pile = A FAIRE DANS CETTE ORDRE
|
||||
[o retain];
|
||||
[self.theQueue removeObject:o];
|
||||
[self.theQueue addObject:o];
|
||||
[o release];
|
||||
debug_printf("image put on top of the cache %s\n",[o.url UTF8String]);
|
||||
return;
|
||||
}
|
||||
@ -100,11 +90,6 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
@synthesize target = _target;
|
||||
@synthesize url = _url;
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
self.data = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
- (void)processDownload {
|
||||
@ -125,12 +110,11 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
|
||||
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)
|
||||
printf("NSURLConnection failed\n");
|
||||
|
||||
[urlnoescape release];
|
||||
|
||||
}
|
||||
|
||||
@ -188,7 +172,7 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
// absolute path
|
||||
str2 = str ; //[NSString stringWithUTF8String:str];
|
||||
}
|
||||
imageView = [[UIImage imageWithContentsOfFile:str2] retain]; // to mimic init
|
||||
imageView = [UIImage imageWithContentsOfFile:str2]; // to mimic init
|
||||
if (!imageView)
|
||||
{
|
||||
printf("init image failed (%s)\n",[str2 UTF8String]);
|
||||
@ -205,7 +189,7 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
|
||||
dl.getPersistentDirectoryFile([self.url UTF8String],IPHONETHUMB,cache);
|
||||
NSString* strcache = [NSString stringWithUTF8String:cache.c_str()];
|
||||
imageView = [[UIImage imageWithContentsOfFile:strcache] retain];
|
||||
imageView = [UIImage imageWithContentsOfFile:strcache];
|
||||
if (imageView)
|
||||
{
|
||||
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
|
||||
- (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];
|
||||
}
|
||||
|
||||
@ -374,7 +358,6 @@ static UIActivityIndicatorView* asyncloader=nil;
|
||||
printf("cannot update cache %s\n",cachedURL.c_str());
|
||||
}
|
||||
|
||||
[_img release];
|
||||
|
||||
}
|
||||
@end
|
||||
|
@ -39,22 +39,22 @@
|
||||
}
|
||||
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UILabel* diskName;
|
||||
@property (nonatomic, retain) IBOutlet UILabel* diskYear;
|
||||
@property (nonatomic, retain) IBOutlet UILabel* diskCompany;
|
||||
@property (nonatomic, retain) IBOutlet UITextView* diskDescription;
|
||||
@property (nonatomic, retain) IBOutlet UIImageView* diskApple2;
|
||||
@property (nonatomic, retain) IBOutlet UIImageView* diskApple2GS;
|
||||
@property (nonatomic, retain) IBOutlet UIWebView* diskWebView;
|
||||
@property (nonatomic, retain) IBOutlet UIImageView* screenShot1;
|
||||
@property (nonatomic, retain) IBOutlet UIImageView* screenShot2;
|
||||
@property (nonatomic, retain) IBOutlet UIImageView* screenShot3;
|
||||
@property (nonatomic, retain) IBOutlet UINavigationBar* navView;
|
||||
@property (nonatomic, strong) IBOutlet UILabel* diskName;
|
||||
@property (nonatomic, strong) IBOutlet UILabel* diskYear;
|
||||
@property (nonatomic, strong) IBOutlet UILabel* diskCompany;
|
||||
@property (nonatomic, strong) IBOutlet UITextView* diskDescription;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* diskApple2;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* diskApple2GS;
|
||||
@property (nonatomic, strong) IBOutlet UIWebView* diskWebView;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* screenShot1;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* screenShot2;
|
||||
@property (nonatomic, strong) IBOutlet UIImageView* screenShot3;
|
||||
@property (nonatomic, strong) IBOutlet UINavigationBar* navView;
|
||||
/*
|
||||
@property (nonatomic, retain) itemClass* diskSelected;
|
||||
@property (nonatomic, retain) activegsList* list;
|
||||
*/
|
||||
@property (nonatomic, retain) UINavigationItem* navItem;
|
||||
@property (nonatomic, strong) UINavigationItem* navItem;
|
||||
|
||||
|
||||
- (IBAction) launchButton:(id)_sender;
|
||||
|
@ -34,13 +34,13 @@
|
||||
- (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.
|
||||
if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ]
|
||||
|| [ [ requestURL scheme ] isEqualToString: @"https" ] )
|
||||
&& ( 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];
|
||||
return NO;
|
||||
}
|
||||
@ -84,15 +84,15 @@
|
||||
self.screenShot2.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 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 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 loadImage:nil];
|
||||
|
||||
@ -128,12 +128,6 @@
|
||||
}
|
||||
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
|
||||
[requestURL release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -141,7 +135,7 @@
|
||||
|
||||
|
||||
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.view setFrame:r];
|
||||
@ -158,7 +152,7 @@
|
||||
[backButton setTitle:@"List" forState:UIControlStateNormal];
|
||||
|
||||
// create button item -- possible because UIButton subclasses UIView!
|
||||
UIBarButtonItem* browseItem = [[[UIBarButtonItem alloc] initWithCustomView:backButton] autorelease];
|
||||
UIBarButtonItem* browseItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
|
||||
#endif
|
||||
|
||||
self.navItem.leftBarButtonItem = browseItem;
|
||||
@ -168,7 +162,6 @@
|
||||
grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
|
||||
grswipeleft.cancelsTouchesInView = NO;
|
||||
[self.view addGestureRecognizer:grswipeleft];
|
||||
[grswipeleft release];
|
||||
|
||||
|
||||
// Swipe Right to launch
|
||||
@ -176,7 +169,6 @@
|
||||
grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
|
||||
grswiperight.cancelsTouchesInView = NO;
|
||||
[self.view addGestureRecognizer:grswiperight];
|
||||
[grswiperight release];
|
||||
|
||||
|
||||
}
|
||||
|
@ -15,10 +15,10 @@
|
||||
UILabel* _versionUILandscape;
|
||||
}
|
||||
|
||||
@property (nonatomic, retain) IBOutlet UILabel* versionUILandscape;
|
||||
@property (nonatomic, retain) IBOutlet UILabel* versionUI;
|
||||
@property (nonatomic, retain) IBOutlet UIView* portraitView;
|
||||
@property (nonatomic, retain) IBOutlet UIView* landscapeView;
|
||||
@property (nonatomic, strong) IBOutlet UILabel* versionUILandscape;
|
||||
@property (nonatomic, strong) IBOutlet UILabel* versionUI;
|
||||
@property (nonatomic, strong) IBOutlet UIView* portraitView;
|
||||
@property (nonatomic, strong) IBOutlet UIView* landscapeView;
|
||||
|
||||
- (void)updateView:(UIDeviceOrientation)_orientation ;
|
||||
- (IBAction) doneButton:(id)_sender;
|
||||
|
@ -18,9 +18,6 @@
|
||||
@synthesize portraitView= _portraitView;
|
||||
@synthesize landscapeView = _landscapeView;
|
||||
|
||||
- (void)dealloc {
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
-(void)viewDidLoad
|
||||
@ -49,14 +46,12 @@
|
||||
grswipeleft.direction = UISwipeGestureRecognizerDirectionLeft;
|
||||
grswipeleft.cancelsTouchesInView = NO;
|
||||
[self.view addGestureRecognizer:grswipeleft];
|
||||
[grswipeleft release];
|
||||
|
||||
// Swipe Right to go back to browsing
|
||||
UISwipeGestureRecognizer* grswiperight = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeRight:)];
|
||||
grswiperight.direction = UISwipeGestureRecognizerDirectionRight;
|
||||
grswiperight.cancelsTouchesInView = NO;
|
||||
[self.view addGestureRecognizer:grswiperight];
|
||||
[grswiperight release];
|
||||
|
||||
}
|
||||
|
||||
@ -130,7 +125,7 @@
|
||||
|
||||
- (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];
|
||||
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ int x_frame_rate = -1;
|
||||
if (displayLink)
|
||||
[self deactivateEmulatorRefresh];
|
||||
|
||||
displayLink = [[CADisplayLink displayLinkWithTarget:self selector:@selector(directDraw:)] retain];
|
||||
displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(directDraw:)];
|
||||
|
||||
x_frame_rate = _frameRate;
|
||||
switch(_frameRate)
|
||||
|
@ -53,10 +53,10 @@ typedef struct orientationVar orientationVar;
|
||||
UITouch* _secondTouch;
|
||||
int curOrientation;
|
||||
}
|
||||
@property (retain,nonatomic) emulatorView* ew ;
|
||||
@property (retain,nonatomic) UIImageView* crt ;
|
||||
@property (retain,nonatomic) UITouch* useTouch ;
|
||||
@property (retain,nonatomic) UITouch* secondTouch ;
|
||||
@property (strong,nonatomic) emulatorView* ew ;
|
||||
@property (strong,nonatomic) UIImageView* crt ;
|
||||
@property (strong,nonatomic) UITouch* useTouch ;
|
||||
@property (strong,nonatomic) UITouch* secondTouch ;
|
||||
|
||||
-(void)updateFrame:(CGRect)frame kbdRect:(CGRect)kbdRect;
|
||||
-(void)updateScreen:(CGRect)frame ratio:(float)ratio;
|
||||
|
@ -46,7 +46,7 @@
|
||||
|
||||
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];
|
||||
|
||||
CGColorSpaceRef innerColorSpace = CGColorSpaceCreateDeviceRGB();
|
||||
@ -62,7 +62,7 @@
|
||||
}
|
||||
CGImageRef innerImageRef = CGBitmapContextCreateImage(icontext);
|
||||
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 setFrame:CGRectMake(0,0,r.size.width,r.size.height)];
|
||||
[self.crt setBounds:CGRectMake(0,0,r.size.width,r.size.height*2)];
|
||||
@ -801,7 +801,6 @@ float refScaleLandscape;
|
||||
- (void)dealloc {
|
||||
|
||||
self.delegate = nil;
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user