Separate View/controller

This commit is contained in:
jvernet 2015-12-24 18:36:41 +01:00 committed by Aaron Culliney
parent b04e7760c2
commit bf341731f0
11 changed files with 1223 additions and 12 deletions

View File

@ -122,6 +122,8 @@
4AFC17161AAE9CC000B215FA /* testvm1.nib.gz in Resources */ = {isa = PBXBuildFile; fileRef = 4AFC17101AAE9CC000B215FA /* testvm1.nib.gz */; };
4AFC17171AAE9CC000B215FA /* testvm1.nib.gz in Resources */ = {isa = PBXBuildFile; fileRef = 4AFC17101AAE9CC000B215FA /* testvm1.nib.gz */; };
4AFC17181AAE9CC000B215FA /* testvm1.nib.gz in Resources */ = {isa = PBXBuildFile; fileRef = 4AFC17101AAE9CC000B215FA /* testvm1.nib.gz */; };
4E1733E31C2C5F7600CDF9DF /* iosPrefControllerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E4E62A01C2C5B56002E324F /* iosPrefControllerViewController.m */; };
4E1733E41C2C5F7A00CDF9DF /* AppleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E1733DD1C2C5E5D00CDF9DF /* AppleViewController.m */; };
773B3D101956885A0085CE5F /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 773B3D0F1956885A0085CE5F /* Cocoa.framework */; };
773B3D1A1956885A0085CE5F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 773B3D181956885A0085CE5F /* InfoPlist.strings */; };
773B3D201956885A0085CE5F /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 773B3D1E1956885A0085CE5F /* Credits.rtf */; };
@ -372,7 +374,10 @@
4AFC17091AAE9C3200B215FA /* sha1.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sha1.c; sourceTree = "<group>"; };
4AFC170F1AAE9CC000B215FA /* testdisplay1.nib.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = testdisplay1.nib.gz; sourceTree = "<group>"; };
4AFC17101AAE9CC000B215FA /* testvm1.nib.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = testvm1.nib.gz; sourceTree = "<group>"; };
4E1733DC1C2C5E5D00CDF9DF /* AppleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleViewController.h; sourceTree = "<group>"; };
4E1733DD1C2C5E5D00CDF9DF /* AppleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppleViewController.m; sourceTree = "<group>"; };
4E1ACFE61C2B0F3600C755BB /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Main.strings; sourceTree = "<group>"; };
4E1ACFE71C2B12F900C755BB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
4E4585F91C29F2B9003E74A1 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = "<group>"; };
4E4585FF1C29F393003E74A1 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = "fr.lproj/MainMenu-Test.strings"; sourceTree = "<group>"; };
4E4586001C29F399003E74A1 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = fr; path = fr.lproj/Credits.rtf; sourceTree = "<group>"; };
@ -382,6 +387,8 @@
4E4586041C29F399003E74A1 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Main.strings; sourceTree = "<group>"; };
4E4586051C29F399003E74A1 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
4E4586061C29F39A003E74A1 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Apple2iOS.strings; sourceTree = "<group>"; };
4E4E629F1C2C5B56002E324F /* iosPrefControllerViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iosPrefControllerViewController.h; sourceTree = "<group>"; };
4E4E62A01C2C5B56002E324F /* iosPrefControllerViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = iosPrefControllerViewController.m; sourceTree = "<group>"; };
773B3D0C1956885A0085CE5F /* Apple2Mac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Apple2Mac.app; sourceTree = BUILT_PRODUCTS_DIR; };
773B3D0F1956885A0085CE5F /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
773B3D121956885A0085CE5F /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@ -878,6 +885,10 @@
93206C841C156BD300668153 /* A2IXPopupChoreographer.m */,
935C55491C12BE510013166D /* EAGLView.h */,
935C554A1C12BE510013166D /* EAGLView.m */,
4E4E629F1C2C5B56002E324F /* iosPrefControllerViewController.h */,
4E4E62A01C2C5B56002E324F /* iosPrefControllerViewController.m */,
4E1733DC1C2C5E5D00CDF9DF /* AppleViewController.h */,
4E1733DD1C2C5E5D00CDF9DF /* AppleViewController.m */,
);
name = iOS;
sourceTree = "<group>";
@ -1647,6 +1658,7 @@
935C55541C136DF40013166D /* playqueue.c in Sources */,
935C558E1C1370800013166D /* gltouchmenu.c in Sources */,
935C55571C136DF40013166D /* speaker.c in Sources */,
4E1733E41C2C5F7A00CDF9DF /* AppleViewController.m in Sources */,
935C55581C136DF40013166D /* cpu-supp.c in Sources */,
935C55591C136DF40013166D /* darwin-shim.c in Sources */,
935C55601C136E070013166D /* debugger.c in Sources */,
@ -1655,6 +1667,7 @@
935C555C1C136DF40013166D /* font.c in Sources */,
935C555D1C136DF40013166D /* interface.c in Sources */,
935C555E1C136DF40013166D /* joystick.c in Sources */,
4E1733E31C2C5F7600CDF9DF /* iosPrefControllerViewController.m in Sources */,
935C55A11C13887E0013166D /* sha1.c in Sources */,
935C555F1C136DF40013166D /* keys.c in Sources */,
935C554D1C12BE510013166D /* AppDelegate.m in Sources */,
@ -1706,6 +1719,7 @@
children = (
4E4585F91C29F2B9003E74A1 /* en */,
4E4586021C29F399003E74A1 /* fr */,
4E1ACFE71C2B12F900C755BB /* Base */,
);
name = MainMenu.xib;
sourceTree = "<group>";

View File

@ -0,0 +1,15 @@
//
// AppleViewController.h
// Apple2Mac
//
// Created by Jerome Vernet on 24/12/2015.
// Copyright © 2015 deadc0de.org. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AppleViewController : UIViewController
-(IBAction)rebootItem:(id)sender;
-(IBAction)prefsItem:(id)sender;
@end

View File

@ -0,0 +1,57 @@
//
// AppleViewController.m
// Apple2Mac
//
// Created by Jerome Vernet on 24/12/2015.
// Copyright © 2015 deadc0de.org. All rights reserved.
//
#import "AppleViewController.h"
#import "common.h"
#import "modelUtil.h"
@interface AppleViewController ()
@end
@implementation AppleViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
-(IBAction)rebootItem:(id)sender{
cpu65_reboot();
}
-(IBAction)prefsItem:(id)sender{
//pause
//show pref windows
}
- (IBAction)toggleCPUSpeedItem:(id)sender
{
cpu_pause();
timing_toggleCPUSpeed();
if (video_backend && video_backend->animation_showCPUSpeed)
{
video_backend->animation_showCPUSpeed();
}
cpu_resume();
}
@end

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,13 @@
//
// iosPrefControllerViewController.h
// Apple2Mac
//
// Created by Jerome Vernet on 24/12/2015.
// Copyright © 2015 deadc0de.org. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface iosPrefControllerViewController : UIViewController
@end

View File

@ -0,0 +1,37 @@
//
// iosPrefControllerViewController.m
// Apple2Mac
//
// Created by Jerome Vernet on 24/12/2015.
// Copyright © 2015 deadc0de.org. All rights reserved.
//
#import "iosPrefControllerViewController.h"
@interface iosPrefControllerViewController ()
@end
@implementation iosPrefControllerViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>0.9.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
@ -32,8 +32,7 @@
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>

View File

@ -4,41 +4,80 @@
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
</dependencies>
<scenes>
<!--View Controller-->
<!--Apple View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" sceneMemberID="viewController">
<viewController autoresizesArchivedViewToFullSize="NO" hidesBottomBarWhenPushed="YES" id="BYZ-38-t0r" customClass="AppleViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC" customClass="EAGLView">
<view key="view" contentMode="center" id="8bC-Xf-vdC" customClass="EAGLView">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="bottom" fixedFrame="YES" barStyle="black" translatesAutoresizingMaskIntoConstraints="NO" id="MKz-35-wcI">
<rect key="frame" x="0.0" y="556" width="600" height="44"/>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="redraw" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MKz-35-wcI">
<rect key="frame" x="66" y="278" width="468" height="44"/>
<items>
<barButtonItem title="Reboot" id="pwr-c0-7tW">
<connections>
<action selector="reboot:" destination="dkx-z0-nzr" id="J5h-Ne-PUP"/>
<action selector="rebootItem:" destination="dkx-z0-nzr" id="Unl-Y2-Wio"/>
</connections>
</barButtonItem>
<barButtonItem title="Item" id="d5g-uX-Ssk">
<barButtonItem title="CPU Togle" id="d5g-uX-Ssk">
<connections>
<action selector="chooseDriveA:" destination="dkx-z0-nzr" id="zbL-lp-3IU"/>
<action selector="toggleCPUSpeedItem:" destination="dkx-z0-nzr" id="OmN-nk-Tda"/>
</connections>
</barButtonItem>
<barButtonItem title="Prefs" id="80q-oc-naJ"/>
</items>
</toolbar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<gestureRecognizers/>
</view>
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="287" y="-60"/>
</scene>
<!--Preferences-->
<scene sceneID="BgJ-VP-f1a">
<objects>
<viewController title="Preferences" id="Bdv-8H-ns5" customClass="iosPrefControllerViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Dec-D0-aqO"/>
<viewControllerLayoutGuide type="bottom" id="mhm-yr-MxI"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="RMU-eN-VaS">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="Lr7-yF-mb2">
<rect key="frame" x="127" y="113" width="97" height="30"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="XxD-w4-jxp">
<rect key="frame" x="143" y="196" width="46" height="30"/>
<state key="normal" title="Button"/>
</button>
<toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lfx-xk-tV7">
<rect key="frame" x="0.0" y="556" width="600" height="44"/>
<items>
<barButtonItem title="OK" id="tk3-AG-KR8"/>
</items>
</toolbar>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
<simulatedOrientationMetrics key="simulatedOrientationMetrics"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="tqd-Zi-o6N" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="961" y="-60"/>
</scene>
<!--View Controller-->
<scene sceneID="7d6-Zt-X84">
<objects>

View File

@ -9,7 +9,7 @@
"c93-nC-i3L.text" = "Insert a Disk ][ image file";
/* Class = "UIBarButtonItem"; title = "Item"; ObjectID = "d5g-uX-Ssk"; */
"d5g-uX-Ssk.title" = "Item";
"d5g-uX-Ssk.title" = "Togle CPU";
/* Class = "UILabel"; text = "Save & restore"; ObjectID = "fJA-S4-XoG"; */
"fJA-S4-XoG.text" = "Save & restore";

View File

@ -19,3 +19,6 @@
/* Class = "UILabel"; text = "Quick save and restore"; ObjectID = "t5D-5L-z8k"; */
"t5D-5L-z8k.text" = "Quick save and restore";
/* Class = "UIBarButtonItem"; title = "Item"; ObjectID = "d5g-uX-Ssk"; */
"d5g-uX-Ssk.title" = "CPU";

View File

@ -329,4 +329,5 @@ static inline void _handleTouch(EAGLView *self, SEL _cmd, UITouch *touch, interf
}
}
@end