diff --git a/ActiveGS_iOS/infoViewController.xib b/ActiveGS_iOS/infoViewController.xib index 1950059..8f7635d 100644 --- a/ActiveGS_iOS/infoViewController.xib +++ b/ActiveGS_iOS/infoViewController.xib @@ -1,931 +1,1001 @@ - - - - 1552 - 13F34 - 6254 - 1265.21 - 698.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 6247 - - - IBProxyObject - IBUIButton - IBUIImageView - IBUILabel - IBUIView - - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - PluginDependencyRecalculationVersion - - - - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - - - 293 - {{120, 59}, {80, 77}} - - - - NO - YES - 4 - YES - IBCocoaTouchFramework - - NSImage - ActiveGS.png - - - - - 269 - {{109, 339}, {101, 37}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - 1 - MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA - - - 3 - MQA - - I'm Happy! - - 3 - MC41AA - - - Helvetica-Bold - Helvetica - 2 - 15 - - - Helvetica-Bold - 15 - 16 - - - - - 293 - {{0, 20}, {320, 43}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - ActiveGS - - 1 - MCAwIDAAA - darkTextColor - - - - {2, 2} - 1 - 10 - 1 - - Helvetica-Bold - Helvetica - 2 - 36 - - - Helvetica-Bold - 36 - 16 - - YES - - - - 293 - {{46, 139}, {228, 25}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - (version) - - - 1 - 10 - 1 - - 1 - 17 - - - HelveticaNeue - 17 - 16 - - YES - - - - 269 - {{76, 392}, {180, 30}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - For support and/or feedback, visit - - - 1 - 10 - 3 - 1 - - Helvetica - Helvetica - 0 - 12 - - - Helvetica - 12 - 16 - - 180 - - - - 317 - {{23, 191}, {280, 134}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - c3dpcGUgZG93biBmb3IgcnVuLXRpbWUgbWVudQpzd2lwZSB1cCBmb3Iga2V5Ym9hcmQKc3dpcGUgdXAg -Zm9yIGpveXBhZCAod2hpbGUga2V5Ym9hcmQgaXMgc2hvd24pCmRvdWJsZSB0YXAgZm9yIG1vdXNlIGNs -aWNrCnRyaXBsZSB0YXAgZm9yIG1vdXNlIGRvdWJsZS1jbGljawpzd2lwZSBsZWZ0L3JpZ2h0IG9uIHRv -cCBzY3JlZW4gZm9yIHNob3J0Y3V0IHRvIGJyb3dzZQo - - - {0, 0} - 1 - 4 - 0 - 1 - 2 - - - 280 - - - - 317 - {{79, 186}, {162, 17}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Commands: - - - 1 - 10 - 3 - 1 - - Helvetica-Bold - Helvetica - 2 - 17 - - - Helvetica-Bold - 17 - 16 - - 162 - - - - 269 - {{143, 417}, {32, 32}} - - - - NO - IBCocoaTouchFramework - 0 - 0 - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - Facebook - - - NSImage - facebook-logo.png - - - - - - - 269 - {{15, 444}, {290, 30}} - - - - NO - YES - 7 - NO - IBCocoaTouchFramework - (Dedicated to Benzebut, ActiveGS chief bug hunter!) - - - 1 - 3 - 1 - - - 290 - - - {320, 480} - - - - - 3 - MQA - - 2 - - - - IBUISimulatedFreeformSizeMetricsSentinel - Freeform - - IBCocoaTouchFramework - - - - 274 - - - - 293 - {{120, 20}, {80, 77}} - - - NO - YES - 4 - YES - IBCocoaTouchFramework - - - - - 265 - {{359, 256}, {101, 37}} - - NO - IBCocoaTouchFramework - 0 - 0 - 1 - - - I'm Happy! - - - - - - - 293 - {{208, 52}, {265, 38}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - ActiveGS - - - - {2, 2} - 1 - 10 - - - YES - - - - 293 - {{126, 93}, {228, 25}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - (version) - - - 1 - 10 - 1 - - - YES - - - - 268 - {{20, 261}, {180, 30}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - For support and/or feedback, visit - - - 1 - 10 - 3 - 1 - - - 180 - - - - 317 - {{100, 131}, {280, 134}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - c3dpcGUgZG93biBmb3IgcnVuLXRpbWUgbWVudQpzd2lwZSB1cCBmb3Iga2V5Ym9hcmQKc3dpcGUgdXAg -Zm9yIGpveXBhZCAod2hpbGUga2V5Ym9hcmQgaXMgc2hvd24pCmRvdWJsZSB0YXAgZm9yIG1vdXNlIGNs -aWNrCnRyaXBsZSB0YXAgZm9yIG1vdXNlIGRvdWJsZS1jbGljawpzd2lwZSBsZWZ0L3JpZ2h0IG9uIHRv -cCBzY3JlZW4gZm9yIHNob3J0Y3V0IHRvIGJyb3dzZQo - - - {0, 0} - 1 - 4 - 0 - 1 - 2 - - - 280 - - - - 317 - {{159, 131}, {162, 17}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - Commands: - - - 1 - 10 - 3 - 1 - - - 162 - - - - 269 - {{213, 259}, {32, 32}} - - - NO - IBCocoaTouchFramework - 0 - 0 - - 1 - MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA - - - Facebook - - - - - - - - 269 - {{93, 290}, {294, 30}} - - - NO - YES - 7 - NO - IBCocoaTouchFramework - (Dedicated to Benzebut, ActiveGS chief bug hunter!) - - - 1 - 3 - 1 - - - 294 - - - {480, 320} - - - 3 - MQA - - - - 3 - 3 - - - IBCocoaTouchFramework - - - - - - - view - - - - 3 - - - - versionUI - - - - 12 - - - - landscapeView - - - - 33 - - - - portraitView - - - - 34 - - - - versionUILandscape - - - - 35 - - - - doneButton: - - - 7 - - 9 - - - - doneButton: - - - 7 - - 31 - - - - emailButton: - - - 1 - - 50 - - - - emailButton: - - - 1 - - 51 - - - - - - 0 - - - - - - 1 - - - - - - - - - - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 4 - - - - - 5 - - - - - 10 - - - - - 11 - - - - - 13 - - - - - 23 - - - - - - - - - - - - - - ViewLandscape - - - 24 - - - - - 25 - - - - - 27 - - - - - 28 - - - - - 29 - - - - - 36 - - - - - 37 - - - - - 38 - - - - - 39 - - - - - 44 - - - - - 45 - - - - - 47 - - - - - 48 - - - - - - - infoViewController - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIResponder - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - - - 51 - - - - - infoViewController - UIVIEWCONTROLLERROOT - - id - id - id - - - - doneButton: - id - - - emailButton: - id - - - parametersButton: - id - - - - UIView - UIView - UILabel - UILabel - - - - landscapeView - UIView - - - portraitView - UIView - - - versionUI - UILabel - - - versionUILandscape - UILabel - - - - IBProjectSource - ../../Common.iphone/infoViewController.h - - - - infoViewController - - id - id - id - - - - doneButton: - id - - - emailButton: - id - - - parametersButton: - id - - - - IBProjectSource - ../../Common.iphone/infoViewController.mm - - - - - - UIButton - UIControl - - IBFrameworkSource - UIKit.framework/Headers/UIButton.h - - - - UIControl - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIControl.h - - - - UIGestureRecognizer - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIGestureRecognizer.h - - - - UIImageView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIImageView.h - - - - UILabel - UIView - - IBFrameworkSource - UIKit.framework/Headers/UILabel.h - - - - UIResponder - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - - 0 - IBCocoaTouchFramework - NO - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - 3 - - {80, 80} - {128, 128} - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + swipe down for run-time menu +swipe up for keyboard +swipe up for joypad (while keyboard is shown) +double tap for mouse click +triple tap for mouse double-click +swipe left/right on top screen for shortcut to browse + + + + + + + + + Loading Your Own Disk Images + + + + + + + + - Use iTunes or other application (iExplorer, iFunBox) to transfer files to the ActiveGS Documents folder. + +- To load multi-disk games/applications, make sure the filenames are similar enough so that they share the same prefix, and that the first disk image in the series contains the phrase "disk1". Spaces and capitalization are ignored, so as long as you have that phrase, the program will be recognized as multi-disk. All disk image files following the first will be added in order. + +The following are examples of programs recognized as multi-disk: + + + + + + + + Rastan Disk 1.zip +Rastan Disk 2.zip + +Task Force-disk1.zip +Task Force-disk2.zip + +Final Fantasy XV (Disk 1 of 62500) + + + + + + + + + + + + + + +Final Fantasy XV (Disk 2 of 62500) + + + + + + + + + + + + + + +Cg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Cgo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Cgo + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Tap the "Favorites" tab to view your loaded disk images. + +- Swipe down while your program is running to reveal the top menu. For multi-disk programs, you will see a spinning disk icon on the upper right. + +- Tap on the spinning disk icon to mount a different disk. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Support + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - Both Made for iPhone (mFi) and iCade controllers are supported. + +- To use an mFi controller, pair your controller to your iOS device. It should automatically be detected. Analog controls are mapped to the left thumbstick. Apple joystick button 0 is mapped to the Y button, and joystick button 1 is mapped to the A button. + +- To use an iCade controller, pair it with your iOS device. In the Options menu, select "iCade" under Pad Input. Entering 'up-up-down-down' on your iCade controller while a game is running will also enable the controller after pairing as well. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +- Are supported and they work..most of the time! Save states are specific to each program and you have 6 available slots. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Common.iphone/activegsList.mm b/Common.iphone/activegsList.mm index 183e527..8f149b5 100644 --- a/Common.iphone/activegsList.mm +++ b/Common.iphone/activegsList.mm @@ -61,6 +61,13 @@ void xmltostring(simplexml* _this,MyString& _output) } +@interface DiskImageInfo : NSObject +@property (strong, nonatomic) NSString *name; +@property (nonatomic) NSUInteger slotNumber; +@end + +@implementation DiskImageInfo +@end static UIImage* defaultImage2GS = nil; static UIImage* defaultImageII = nil; @@ -101,101 +108,151 @@ static UIImage* defaultImageII = nil; } --(void)retrieveDocumentList:(MyString&) tempXML withBaseURL:(MyString&) _baseUrl; -{ - - tempXML = "\n"; - tempXML += "My 2GS"; - - NSArray *dopaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); +-(void) createXmlUsingStringRef:(MyString&)tempXML withBaseURLRef:(MyString&)_baseUrl { + + tempXML = "\n"; + tempXML += "My 2GS"; + + NSArray *dopaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [dopaths objectAtIndex:0]; - NSFileManager *manager = [NSFileManager defaultManager]; -// NSArray *fileList = [manager directoryContentsAtPath:documentsDirectory]; - NSError* err; - NSArray *fileList = [manager contentsOfDirectoryAtPath:documentsDirectory error:&err]; - - MyString ignoreList; - - const char* utf8docdir = [documentsDirectory UTF8String]; + NSFileManager *manager = [NSFileManager defaultManager]; + // NSArray *fileList = [manager directoryContentsAtPath:documentsDirectory]; + NSError* err; + NSArray *fileList = [manager contentsOfDirectoryAtPath:documentsDirectory error:&err]; + + MyString ignoreList; + + const char* utf8docdir = [documentsDirectory UTF8String]; listPath.Format("%s/LOCAL.ACTIVEGSXML",utf8docdir); _baseUrl =listPath; - + CDownload dl(utf8docdir); - dl.bNotifyDownloadFailure = true; - - - // parse déjà les fichier .activegsxml - + dl.bNotifyDownloadFailure = true; + + + // parse déjà les fichier .activegsxml + for (NSString *s in fileList) - { - const char* fn = [s UTF8String]; - const char* ext = getext(fn); - - if (strcasecmp(ext,"activegsxml")) - continue; - - /* - MyString fullpathname = utf8docdir; - fullpathname += "/"; - fullpathname += fn; - */ - MyString path; - MyString shortname; - - dl.retrieveFile(fn,path,shortname); - FILE* f= fopen(path.c_str(),"rb"); - if (!f) continue; - fseek(f,0,SEEK_END); - int si = ftell(f); - - - fseek(f,0,SEEK_SET); - char *buf = new char[si+1]; - memset(buf,0,si+1); - fread(buf,1,si,f); - simplexml* p = new simplexml(buf); - if (!p) - { - delete buf; - continue; - } - if (!strcasecmp(p->key(),"config")) - { - MyString temp; - xmltostring(p,temp); - printf("%s",temp.c_str()); - tempXML += temp.c_str(); - - // rajoute les images dans une liste blackliste - for(int i=0;inumber_of_children();i++) - { - simplexml* child = p->child(i); - if (!strcmp(child->key(),"image")) - { - int order; - MyString path; - int isLocal = dl.parseFilenameAndMakeAbsolute(child->value(), order, path); - if (isLocal) - { - ignoreList+="?"; - ignoreList+=getfile(path); - ignoreList+="?"; - // printf("ignoring:%s",getfile(path.c_str())); - } - } - } - } - delete buf; - fclose(f); - } - - // parse les autres fichiers - for (NSString *s in fileList) - { - const char* fn = [s UTF8String]; - const char* ext = getext(fn); - - if ( strcasecmp(ext,"zip") + { + const char* fn = [s UTF8String]; + const char* ext = getext(fn); + + if (strcasecmp(ext,"activegsxml")) + continue; + + /* + MyString fullpathname = utf8docdir; + fullpathname += "/"; + fullpathname += fn; + */ + MyString path; + MyString shortname; + + dl.retrieveFile(fn,path,shortname); + FILE* f= fopen(path.c_str(),"rb"); + if (!f) continue; + fseek(f,0,SEEK_END); + int si = ftell(f); + + + fseek(f,0,SEEK_SET); + char *buf = new char[si+1]; + memset(buf,0,si+1); + fread(buf,1,si,f); + simplexml* p = new simplexml(buf); + if (!p) + { + delete buf; + continue; + } + if (!strcasecmp(p->key(),"config")) + { + MyString temp; + xmltostring(p,temp); + printf("%s",temp.c_str()); + tempXML += temp.c_str(); + + // rajoute les images dans une liste blackliste + for(int i=0;inumber_of_children();i++) + { + simplexml* child = p->child(i); + if (!strcmp(child->key(),"image")) + { + int order; + MyString path; + int isLocal = dl.parseFilenameAndMakeAbsolute(child->value(), order, path); + if (isLocal) + { + ignoreList+="?"; + ignoreList+=getfile(path); + ignoreList+="?"; + // printf("ignoring:%s",getfile(path.c_str())); + } + } + } + } + delete buf; + fclose(f); + } + + // support multi-disk images by checking for the presence of "disk1" and create multiple disk image elements + + // setup multi disk detection + NSString *currentMultiDiskPrefix = nil; + NSMutableArray *currentMultiDiskFilenames = [NSMutableArray array]; + + // block to write out xml for individual programs + void (^generateXmlForDiskImages)(NSArray *) = ^(NSArray *diskImages) { + DiskImageInfo *firstImage = [diskImages firstObject]; + const char* cFilename = [firstImage.name UTF8String]; + int slot = (int) firstImage.slotNumber; + + tempXML += ""; + tempXML += ""; + tempXML += getfilenoext(cFilename); + tempXML += ""; + + if (slot==6) + tempXML += "APPLE 2"; + else + tempXML += "2GS"; + + tempXML += ""; + // tempXML += utf8docdir; + // tempXML += "/"; + tempXML += getfilenoext(cFilename); + tempXML += ".png"; + + MyString slotstr; + slotstr.Format("%d",slot); + + BOOL isIIGSMultiMoreThanTwoDisks = slot != 6 && diskImages.count > 2; + + [diskImages enumerateObjectsUsingBlock:^(DiskImageInfo *diskImage, NSUInteger idx, BOOL * _Nonnull stop) { + unsigned long diskIndex = idx + 1; + if ( slot == 6 || isIIGSMultiMoreThanTwoDisks ) { + // for Apple II disks, assume 1 disk drive + // for Apple IIGS that have more than 2 disks, use 1 drive + diskIndex = 1; + } + tempXML += "",diskIndex] UTF8String]; + tempXML += [diskImage.name UTF8String]; + tempXML += ""; + }]; + tempXML += ""; + tempXML += slotstr; + tempXML += ""; + tempXML += ""; + }; + + for (NSString *s in fileList) + { + const char* fn = [s UTF8String]; + const char* ext = getext(fn); + + if ( strcasecmp(ext,"zip") && strcasecmp(ext,"2mg") && strcasecmp(ext,"raw") && strcasecmp(ext,"dsk") @@ -203,73 +260,82 @@ static UIImage* defaultImageII = nil; && strcasecmp(ext,"do") && strcasecmp(ext,"nib") && strcasecmp(ext,"bin")) - continue; - - // si le fichier est dans la liste des blacklistée : ignore - MyString pat; - pat.Format("?%s?",fn); - if (ignoreList.Find(pat)!=-1) - continue; - - /* - MyString fullpathname = utf8docdir; - fullpathname += "/"; - fullpathname += fn; - */ - - MyString path; - MyString shortname; - // CDownload dl; - // dl.bNotifyDownloadFailure = true; - dl.retrieveFile(fn,path,shortname); - FILE* f= fopen(path.c_str(),"rb"); - if (!f) continue; - fseek(f,0,SEEK_END); - int si = ftell(f); - - int slot; - if (si < 800*1024) - slot = 6; - else - if (si < 900*1024) - slot = 5; - else - slot = 7; - - tempXML += ""; - tempXML += ""; - tempXML += getfilenoext(fn); - tempXML += ""; - - if (slot==6) - tempXML += "APPLE 2"; - else - tempXML += "2GS"; - - tempXML += ""; -// tempXML += utf8docdir; -// tempXML += "/"; - tempXML += getfilenoext(fn); - tempXML += ".png"; - - tempXML += ""; - tempXML += fn; - tempXML += ""; - tempXML += ""; - tempXML += slotstr; - tempXML += ""; - tempXML += ""; - - - fclose(f); + continue; + + // si le fichier est dans la liste des blacklistée : ignore + MyString pat; + pat.Format("?%s?",fn); + if (ignoreList.Find(pat)!=-1) + continue; + + // check if file exists + MyString path; + MyString shortname; + dl.retrieveFile(fn,path,shortname); + FILE* f= fopen(path.c_str(),"rb"); + if (!f) continue; + + // determine slot based on disk size + fseek(f,0,SEEK_END); + int si = (int) ftell(f); + int slot; + if (si < 800*1024) + slot = 6; + else + if (si < 900*1024) + slot = 5; + else + slot = 7; + fclose(f); + + // strip out the spaces in the filename to help in comparison + NSString *comparisonFilename = [[s stringByReplacingOccurrencesOfString:@" " withString:@""] lowercaseString]; + + if ( currentMultiDiskPrefix != nil && [comparisonFilename containsString:currentMultiDiskPrefix] ) { + // in the middle of multidisk images, add this and continue + DiskImageInfo *info = [[DiskImageInfo alloc] init]; + info.name = s; + info.slotNumber = slot; + [currentMultiDiskFilenames addObject:info]; + continue; + } + + // finish up creating the last multidisk images, if necessary + if ( [currentMultiDiskFilenames count] > 0 ) { + generateXmlForDiskImages(currentMultiDiskFilenames); + [currentMultiDiskFilenames removeAllObjects]; + currentMultiDiskPrefix = nil; + } + + // this is a new disk image set + // check if multi disk + NSRange rangeOfMultiDiskIndicator = [comparisonFilename rangeOfString:@"disk1"]; + if ( rangeOfMultiDiskIndicator.location != NSNotFound ) { + [currentMultiDiskFilenames removeAllObjects]; + DiskImageInfo *info = [[DiskImageInfo alloc] init]; + info.name = s; + info.slotNumber = slot; + [currentMultiDiskFilenames addObject:info]; + currentMultiDiskPrefix = [[comparisonFilename substringWithRange:NSMakeRange(0, rangeOfMultiDiskIndicator.location)] lowercaseString]; + continue; + } + + // single disk + DiskImageInfo *diskImage = [[DiskImageInfo alloc] init]; + diskImage.name = s; + diskImage.slotNumber = slot; + generateXmlForDiskImages(@[diskImage]); } - - tempXML+=""; - printf(tempXML.c_str()); + + // deal with any left over multidisk images + if ( [currentMultiDiskFilenames count] > 0 ) { + generateXmlForDiskImages(currentMultiDiskFilenames); + [currentMultiDiskFilenames removeAllObjects]; + currentMultiDiskPrefix = nil; + } + + tempXML+=""; + printf(tempXML.c_str()); } - (simplexml*)addList:(const char*)_listPath @@ -293,7 +359,8 @@ static UIImage* defaultImageII = nil; else { MyString baseURL; - [self retrieveDocumentList:xmlString withBaseURL:baseURL]; + [self createXmlUsingStringRef:xmlString withBaseURLRef:baseURL]; +// [self retrieveDocumentList:xmlString withBaseURL:baseURL]; list.pathName = baseURL; list.processString(xmlString.c_str()); diff --git a/Common.iphone/infoViewController.h b/Common.iphone/infoViewController.h index a5acd11..3c05c55 100644 --- a/Common.iphone/infoViewController.h +++ b/Common.iphone/infoViewController.h @@ -10,18 +10,13 @@ // Properties UIView* _portraitView; - UIView* _landscapeView; UILabel* _versionUI; - UILabel* _versionUILandscape; } -@property (nonatomic, strong) IBOutlet UILabel* versionUILandscape; @property (nonatomic, strong) IBOutlet UILabel* versionUI; @property (nonatomic, strong) IBOutlet UIView* portraitView; -@property (nonatomic, strong) IBOutlet UIView* landscapeView; +@property (nonatomic, strong) IBOutlet UIScrollView *instructionsView; -//- (void)updateView:(UIDeviceOrientation)_orientation ; -- (void)updateView ; - (IBAction) doneButton:(id)_sender; - (IBAction) parametersButton:(id)_sender; - (IBAction) emailButton:(id)_sender; diff --git a/Common.iphone/infoViewController.mm b/Common.iphone/infoViewController.mm index 3bda18a..8fdd9e0 100644 --- a/Common.iphone/infoViewController.mm +++ b/Common.iphone/infoViewController.mm @@ -14,11 +14,7 @@ @implementation infoViewController @synthesize versionUI=_versionIU; -@synthesize versionUILandscape=_versionUILandscape; @synthesize portraitView= _portraitView; -@synthesize landscapeView = _landscapeView; - - -(void)viewDidLoad { @@ -27,19 +23,15 @@ NSString *buildVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]; - self.versionUILandscape.text= self.versionUI.text = [NSString stringWithFormat: @"v%@.%@ -- ActiveGS "TOSTRING(ACTIVEGSMAJOR)"."TOSTRING(ACTIVEGSMINOR)"."TOSTRING(ACTIVEGSBUILD)"",appVersion,buildVersion]; - [self.portraitView setFrame:[[UIScreen mainScreen] bounds] ]; - [self.landscapeView setFrame:[[UIScreen mainScreen] bounds] ]; - // [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; } -(void)viewDidAppear:(BOOL)animated { printf("viewDidAppear"); - + [super viewDidAppear:animated]; // Swipe left to go back to browsing UISwipeGestureRecognizer* grswipeleft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(swipeLeft:)]; @@ -53,32 +45,7 @@ grswiperight.cancelsTouchesInView = NO; [self.view addGestureRecognizer:grswiperight]; -} - -/* --(void)updateView:(UIDeviceOrientation)_orientation -{ - -} -*/ - --(void)updateView -{ - debug_printf("updateView infoViewController"); - - - BOOL isPortrait = abs([pManager getAngle])==90.0f ; - - if (isPortrait) - self.view = self.portraitView; - else - self.view = self.landscapeView; - - self.view = self.portraitView; - - // pour réactiver les gestures - [self viewDidAppear:FALSE]; - + [self.instructionsView flashScrollIndicators]; } @@ -135,15 +102,4 @@ return UIInterfaceOrientationMaskAll; } -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator -{ - [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; - [coordinator animateAlongsideTransition:^(id context) { - [self updateView]; - - } completion:^(id context) { - - }]; -} - @end