├── README.md ├── actionscript └── com │ └── janumedia │ └── ane │ └── uiwebview │ └── UIWebViewExtension.as ├── android ├── .classpath ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── AndroidManifest.xml ├── bin │ └── AndroidManifest.xml ├── gen │ └── com │ │ └── janumedia │ │ └── ane │ │ └── uiwebview │ │ ├── BuildConfig.java │ │ └── R.java ├── libs │ └── android-support-v4.jar ├── proguard-project.txt ├── project.properties ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ ├── drawable-xhdpi │ │ └── ic_launcher.png │ ├── values-v11 │ │ └── styles.xml │ └── values │ │ ├── strings.xml │ │ └── styles.xml └── src │ └── com │ └── janumedia │ └── ane │ └── uiwebview │ ├── UIWebViewContext.java │ ├── UIWebViewDialog.java │ └── UIWebViewExtension.java ├── build ├── UIWebViewANE.ane ├── UIWebViewANE.swc ├── android │ └── libUIWebViewANE.jar ├── extension.xml ├── iOSplatformOptions.xml ├── ios │ └── libUIWebViewANE.a └── library.swf └── xcode └── UIWebViewANE ├── UIWebViewANE.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── UIWebViewANE.xccheckout │ └── xcuserdata │ │ └── Janu.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── Janu.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── UIWebViewANE.xcscheme │ └── xcschememanagement.plist ├── UIWebViewANE ├── FlashRuntimeExtensions.h ├── UIWebViewANE.m ├── UIWebViewController.h └── UIWebViewController.m └── UIWebViewANETests └── Info.plist /README.md: -------------------------------------------------------------------------------- 1 | UIWebView / WebView ANE for Android 2 | ====================================== 3 | 4 | UIWebView / WebView Adobe AIR Native Extension for iOS Android applications 5 | 6 | Also can be use as alternative to StageWebView 7 | 8 | Version 9 | --------- 10 | 11 | This is version 1.0.0 of this extension. 12 | 13 | Extension ID 14 | --------- 15 | ``` 16 | com.janumedia.ane.uiwebview 17 | ``` 18 | 19 | Usage 20 | --------- 21 | 22 | ``` 23 | webExtension:UIWebViewExtension = new UIWebViewExtension; 24 | webExtension.open("http://kompas.com", 5, 200, 350, 400); 25 | 26 | ``` 27 | 28 | Available Methods 29 | 30 | ``` 31 | 32 | webExtension.getVersion (); // return String current ANE versionwebExtension. 33 | webExtension.open (urlPath:String, xPos:int, yPos:int, width:int, height:int) : Boolean 34 | webExtension.loadURL (urlPath:String) : Boolean 35 | webExtension.reload () : Boolean 36 | webExtension.goBack () : Boolean 37 | webExtension.goForward () : Boolean 38 | webExtension.goBackOrForward (steps:int) : Boolean // Android only 39 | webExtension.x // setter / getter 40 | webExtension.y // setter / getter 41 | webExtension.width // setter / getter 42 | webExtension.height // setter / getter 43 | webExtension.close () : Boolean 44 | 45 | ``` 46 | 47 | Author 48 | --------- 49 | 50 | This ANE has been writen by [I Nengah Januartha](https://github.com/janumedia). It belongs to [JanuMedia Inc.](http://www.janumedia.com) and is distributed under the [Apache Licence, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). 51 | -------------------------------------------------------------------------------- /actionscript/com/janumedia/ane/uiwebview/UIWebViewExtension.as: -------------------------------------------------------------------------------- 1 | package com.janumedia.ane.uiwebview 2 | { 3 | import flash.desktop.NativeApplication; 4 | import flash.events.StatusEvent; 5 | import flash.external.ExtensionContext; 6 | 7 | public class UIWebViewExtension 8 | { 9 | public static const EXTENSION_ID:String = "com.janumedia.ane.uiwebview"; 10 | 11 | public static const ON_PAGE_START:String = "ON_PAGE_START"; 12 | public static const ON_PAGE_LOADED:String = "ON_PAGE_LOADED"; 13 | public static const ON_PAGE_ERROR:String = "ON_PAGE_ERROR"; 14 | public static const ON_PROGRESS:String = "ON_PROGRESS"; 15 | 16 | private var _context:ExtensionContext; 17 | 18 | public function UIWebViewExtension () 19 | { 20 | if (!_context) _context = ExtensionContext.createExtensionContext(EXTENSION_ID, null); 21 | 22 | if (isSupported) _context.addEventListener(StatusEvent.STATUS, onContextStatus, false, 0, true); 23 | } 24 | 25 | public final function get isSupported () : Boolean 26 | { 27 | return !!_context; 28 | } 29 | 30 | public final function getVersion () : String 31 | { 32 | if (!_context) return ""; 33 | 34 | return String (_context.call("getVersion")); 35 | } 36 | 37 | public final function open (urlPath:String, xPos:int, yPos:int, width:int, height:int) : Boolean 38 | { 39 | if (!_context) return false; 40 | 41 | return _context.call("open", urlPath, xPos, yPos, width, height); 42 | } 43 | 44 | public final function loadURL (urlPath:String) : Boolean 45 | { 46 | if (!_context) return false; 47 | 48 | return _context.call("loadURL", urlPath); 49 | } 50 | 51 | public final function reload () : Boolean 52 | { 53 | if (!_context) return false; 54 | 55 | return _context.call("reload"); 56 | } 57 | 58 | public final function goBack () : Boolean 59 | { 60 | if (!_context) return false; 61 | 62 | return _context.call("goBack"); 63 | } 64 | 65 | public final function goForward () : Boolean 66 | { 67 | if (!_context) return false; 68 | 69 | return _context.call("goForward"); 70 | } 71 | 72 | public final function goBackOrForward (steps:int) : Boolean 73 | { 74 | if (!_context) return false; 75 | 76 | return _context.call("goBackOrForward"); 77 | } 78 | 79 | public final function set x (newX:int) : void 80 | { 81 | if (!_context) return; 82 | 83 | _context.call("x", newX); 84 | } 85 | 86 | public final function get x () : int 87 | { 88 | if (!_context) return 0; 89 | 90 | return int (_context.call("x")); 91 | } 92 | 93 | public final function set y (newY:int) : void 94 | { 95 | if (!_context) return; 96 | 97 | _context.call("y", newY); 98 | } 99 | 100 | public final function get y () : int 101 | { 102 | if (!_context) return 0; 103 | 104 | return int(_context.call("y")); 105 | } 106 | 107 | public final function set width (newW:int) : void 108 | { 109 | if (!_context) return; 110 | 111 | _context.call("width", newW); 112 | } 113 | 114 | public final function get width () : int 115 | { 116 | if (!_context) return 0; 117 | 118 | return int (_context.call("width")); 119 | } 120 | 121 | public final function set height (newH:int) : void 122 | { 123 | if (!_context) return; 124 | 125 | _context.call("height", newH); 126 | } 127 | 128 | public final function get height () : int 129 | { 130 | if (!_context) return 0; 131 | 132 | return int (_context.call("height")); 133 | } 134 | 135 | public final function close () : Boolean 136 | { 137 | if (!_context) return false; 138 | 139 | return _context.call("close"); 140 | } 141 | 142 | public final function dispose () : void 143 | { 144 | if (!_context) return; 145 | 146 | _context.removeEventListener(StatusEvent.STATUS, onContextStatus); 147 | 148 | _context.dispose(); 149 | 150 | _context = null; 151 | } 152 | 153 | private function onContextStatus(e:StatusEvent):void 154 | { 155 | NativeApplication.nativeApplication.dispatchEvent (e); 156 | } 157 | } 158 | } -------------------------------------------------------------------------------- /android/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | UIWebViewANE 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /android/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /android/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/bin/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 9 | 10 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /android/gen/com/janumedia/ane/uiwebview/BuildConfig.java: -------------------------------------------------------------------------------- 1 | /** Automatically generated file. DO NOT MODIFY */ 2 | package com.janumedia.ane.uiwebview; 3 | 4 | public final class BuildConfig { 5 | public final static boolean DEBUG = true; 6 | } -------------------------------------------------------------------------------- /android/gen/com/janumedia/ane/uiwebview/R.java: -------------------------------------------------------------------------------- 1 | /* AUTO-GENERATED FILE. DO NOT MODIFY. 2 | * 3 | * This class was automatically generated by the 4 | * aapt tool from the resource data it found. It 5 | * should not be modified by hand. 6 | */ 7 | 8 | package com.janumedia.ane.uiwebview; 9 | 10 | public final class R { 11 | public static final class attr { 12 | } 13 | public static final class drawable { 14 | public static final int ic_launcher=0x7f020000; 15 | } 16 | public static final class string { 17 | public static final int app_name=0x7f030000; 18 | } 19 | public static final class style { 20 | /** 21 | Base application theme, dependent on API level. This theme is replaced 22 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices. 23 | 24 | 25 | Theme customizations available in newer API levels can go in 26 | res/values-vXX/styles.xml, while customizations related to 27 | backward-compatibility can go here. 28 | 29 | 30 | Base application theme for API 11+. This theme completely replaces 31 | AppBaseTheme from res/values/styles.xml on API 11+ devices. 32 | 33 | API 11 theme customizations can go here. 34 | */ 35 | public static final int AppBaseTheme=0x7f040000; 36 | /** Application theme. 37 | All customizations that are NOT specific to a particular API-level can go here. 38 | */ 39 | public static final int AppTheme=0x7f040001; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /android/libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/android/libs/android-support-v4.jar -------------------------------------------------------------------------------- /android/proguard-project.txt: -------------------------------------------------------------------------------- 1 | # To enable ProGuard in your project, edit project.properties 2 | # to define the proguard.config property as described in that file. 3 | # 4 | # Add project specific ProGuard rules here. 5 | # By default, the flags in this file are appended to flags specified 6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt 7 | # You can edit the include path and order by changing the ProGuard 8 | # include property in project.properties. 9 | # 10 | # For more details, see 11 | # http://developer.android.com/guide/developing/tools/proguard.html 12 | 13 | # Add any project specific keep options here: 14 | 15 | # If your project uses WebView with JS, uncomment the following 16 | # and specify the fully qualified class name to the JavaScript interface 17 | # class: 18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 19 | # public *; 20 | #} 21 | -------------------------------------------------------------------------------- /android/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-13 15 | -------------------------------------------------------------------------------- /android/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/android/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/android/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/android/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/res/values-v11/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /android/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | UIWebViewANE 4 | 5 | 6 | -------------------------------------------------------------------------------- /android/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 14 | 15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /android/src/com/janumedia/ane/uiwebview/UIWebViewContext.java: -------------------------------------------------------------------------------- 1 | package com.janumedia.ane.uiwebview; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import android.util.Log; 7 | 8 | import com.adobe.fre.FREContext; 9 | import com.adobe.fre.FREFunction; 10 | import com.adobe.fre.FREInvalidObjectException; 11 | import com.adobe.fre.FREObject; 12 | import com.adobe.fre.FRETypeMismatchException; 13 | import com.adobe.fre.FREWrongThreadException; 14 | 15 | public class UIWebViewContext extends FREContext { 16 | 17 | UIWebViewDialog webDialog; 18 | 19 | @Override 20 | public Map getFunctions() { 21 | 22 | Map map = new HashMap(); 23 | 24 | map.put("getVersion", getVersion()); 25 | map.put("open", open()); 26 | map.put("close", close()); 27 | map.put("loadURL", loadURL()); 28 | map.put("reload", reload()); 29 | map.put("goBack", goBack()); 30 | map.put("goForward", goForward()); 31 | map.put("goBackOrForward", goBackOrForward()); 32 | map.put("x", updateXPos()); 33 | map.put("y", updateYPos()); 34 | map.put("width", updateWidth()); 35 | map.put("height", updateHeight()); 36 | 37 | return map; 38 | } 39 | 40 | private FREFunction getVersion() { 41 | return new FREFunction() { 42 | 43 | @Override 44 | public FREObject call(FREContext ctx, FREObject[] args) { 45 | 46 | Log.v("TRACE", "getVersion " + UIWebViewExtension.VERSION); 47 | 48 | try { 49 | return FREObject.newObject(UIWebViewExtension.VERSION); 50 | } catch (FREWrongThreadException e) { 51 | e.printStackTrace(); 52 | } 53 | 54 | return null; 55 | } 56 | }; 57 | } 58 | 59 | private FREFunction open() { 60 | return new FREFunction() { 61 | 62 | @Override 63 | public FREObject call(FREContext ctx, FREObject[] args) { 64 | 65 | Log.v("TRACE", "open"); 66 | 67 | try { 68 | 69 | String urlPath = args[0].getAsString(); 70 | int xpos = args[1].getAsInt(); 71 | int ypos = args[2].getAsInt(); 72 | int w = args[3].getAsInt(); 73 | int h = args[4].getAsInt(); 74 | 75 | webDialog = new UIWebViewDialog(ctx, getActivity(), urlPath, xpos, ypos, w, h); 76 | webDialog.show(); 77 | 78 | return FREObject.newObject(true); 79 | 80 | } catch (IllegalStateException e) { 81 | // TODO Auto-generated catch block 82 | e.printStackTrace(); 83 | } catch (FRETypeMismatchException e) { 84 | // TODO Auto-generated catch block 85 | e.printStackTrace(); 86 | } catch (FREInvalidObjectException e) { 87 | // TODO Auto-generated catch block 88 | e.printStackTrace(); 89 | } catch (FREWrongThreadException e) { 90 | // TODO Auto-generated catch block 91 | e.printStackTrace(); 92 | } 93 | 94 | return null; 95 | } 96 | }; 97 | } 98 | 99 | private FREFunction close() { 100 | 101 | return new FREFunction() { 102 | 103 | @Override 104 | public FREObject call(FREContext ctx, FREObject[] args) { 105 | 106 | Log.v("TRACE", "close"); 107 | 108 | if(webDialog != null) 109 | { 110 | webDialog.dismiss(); 111 | webDialog = null; 112 | } 113 | 114 | try { 115 | return FREObject.newObject(true); 116 | } catch (FREWrongThreadException e) { 117 | e.printStackTrace(); 118 | } 119 | 120 | return null; 121 | } 122 | }; 123 | } 124 | 125 | private FREFunction loadURL() { 126 | return new FREFunction() { 127 | 128 | @Override 129 | public FREObject call(FREContext ctx, FREObject[] args) { 130 | 131 | try { 132 | 133 | String urlPath = args[0].getAsString(); 134 | if(webDialog != null) 135 | { 136 | webDialog.loadURL(urlPath); 137 | 138 | return FREObject.newObject(true); 139 | } 140 | 141 | } catch (IllegalStateException e) { 142 | // TODO Auto-generated catch block 143 | e.printStackTrace(); 144 | } catch (FRETypeMismatchException e) { 145 | // TODO Auto-generated catch block 146 | e.printStackTrace(); 147 | } catch (FREInvalidObjectException e) { 148 | // TODO Auto-generated catch block 149 | e.printStackTrace(); 150 | } catch (FREWrongThreadException e) { 151 | // TODO Auto-generated catch block 152 | e.printStackTrace(); 153 | } 154 | 155 | return null; 156 | } 157 | }; 158 | } 159 | 160 | private FREFunction reload() { 161 | return new FREFunction() { 162 | 163 | @Override 164 | public FREObject call(FREContext ctx, FREObject[] args) { 165 | if(webDialog != null) 166 | { 167 | webDialog.reload(); 168 | } 169 | 170 | try { 171 | return FREObject.newObject(true); 172 | } catch (FREWrongThreadException e) { 173 | e.printStackTrace(); 174 | } 175 | 176 | return null; 177 | } 178 | }; 179 | } 180 | 181 | private FREFunction goBack() { 182 | return new FREFunction() { 183 | 184 | @Override 185 | public FREObject call(FREContext ctx, FREObject[] args) { 186 | if(webDialog != null) 187 | { 188 | webDialog.goBack(); 189 | } 190 | 191 | try { 192 | return FREObject.newObject(true); 193 | } catch (FREWrongThreadException e) { 194 | e.printStackTrace(); 195 | } 196 | 197 | return null; 198 | } 199 | }; 200 | } 201 | 202 | private FREFunction goForward() { 203 | return new FREFunction() { 204 | 205 | @Override 206 | public FREObject call(FREContext ctx, FREObject[] args) { 207 | if(webDialog != null) 208 | { 209 | webDialog.goForward(); 210 | } 211 | 212 | try { 213 | return FREObject.newObject(true); 214 | } catch (FREWrongThreadException e) { 215 | e.printStackTrace(); 216 | } 217 | 218 | return null; 219 | } 220 | }; 221 | } 222 | 223 | private FREFunction goBackOrForward() { 224 | return new FREFunction() { 225 | 226 | @Override 227 | public FREObject call(FREContext ctx, FREObject[] args) { 228 | try { 229 | 230 | int steps = args[0].getAsInt(); 231 | if(webDialog != null) 232 | { 233 | webDialog.goBackOrForward(steps); 234 | 235 | return FREObject.newObject(true); 236 | } 237 | 238 | } catch (IllegalStateException e) { 239 | // TODO Auto-generated catch block 240 | e.printStackTrace(); 241 | } catch (FRETypeMismatchException e) { 242 | // TODO Auto-generated catch block 243 | e.printStackTrace(); 244 | } catch (FREInvalidObjectException e) { 245 | // TODO Auto-generated catch block 246 | e.printStackTrace(); 247 | } catch (FREWrongThreadException e) { 248 | // TODO Auto-generated catch block 249 | e.printStackTrace(); 250 | } 251 | 252 | return null; 253 | } 254 | }; 255 | } 256 | 257 | private FREFunction updateXPos() { 258 | return new FREFunction() { 259 | 260 | @Override 261 | public FREObject call(FREContext ctx, FREObject[] args) { 262 | 263 | try { 264 | 265 | if(webDialog != null) 266 | { 267 | if(args.length == 0) 268 | { 269 | return FREObject.newObject(webDialog.getXPos()); 270 | } 271 | 272 | int newX = args[0].getAsInt(); 273 | webDialog.updateXPos(newX); 274 | 275 | return FREObject.newObject(true); 276 | } 277 | 278 | } catch (IllegalStateException e) { 279 | // TODO Auto-generated catch block 280 | e.printStackTrace(); 281 | } catch (FRETypeMismatchException e) { 282 | // TODO Auto-generated catch block 283 | e.printStackTrace(); 284 | } catch (FREInvalidObjectException e) { 285 | // TODO Auto-generated catch block 286 | e.printStackTrace(); 287 | } catch (FREWrongThreadException e) { 288 | // TODO Auto-generated catch block 289 | e.printStackTrace(); 290 | } 291 | 292 | return null; 293 | } 294 | }; 295 | } 296 | 297 | private FREFunction updateYPos() { 298 | return new FREFunction() { 299 | 300 | @Override 301 | public FREObject call(FREContext ctx, FREObject[] args) { 302 | 303 | try { 304 | 305 | if(webDialog != null) 306 | { 307 | if(args.length == 0) 308 | { 309 | return FREObject.newObject(webDialog.getYPos()); 310 | } 311 | 312 | int newY = args[0].getAsInt(); 313 | 314 | webDialog.updateYPos(newY); 315 | 316 | return FREObject.newObject(true); 317 | } 318 | 319 | } catch (IllegalStateException e) { 320 | // TODO Auto-generated catch block 321 | e.printStackTrace(); 322 | } catch (FRETypeMismatchException e) { 323 | // TODO Auto-generated catch block 324 | e.printStackTrace(); 325 | } catch (FREInvalidObjectException e) { 326 | // TODO Auto-generated catch block 327 | e.printStackTrace(); 328 | } catch (FREWrongThreadException e) { 329 | // TODO Auto-generated catch block 330 | e.printStackTrace(); 331 | } 332 | 333 | return null; 334 | } 335 | }; 336 | } 337 | 338 | private FREFunction updateWidth() { 339 | return new FREFunction() { 340 | 341 | @Override 342 | public FREObject call(FREContext ctx, FREObject[] args) { 343 | 344 | try { 345 | 346 | if(webDialog != null) 347 | { 348 | if(args.length == 0) 349 | { 350 | return FREObject.newObject(webDialog.getWidth()); 351 | } 352 | 353 | int newW = args[0].getAsInt(); 354 | 355 | webDialog.updateWidth(newW); 356 | 357 | return FREObject.newObject(true); 358 | } 359 | 360 | } catch (IllegalStateException e) { 361 | // TODO Auto-generated catch block 362 | e.printStackTrace(); 363 | } catch (FRETypeMismatchException e) { 364 | // TODO Auto-generated catch block 365 | e.printStackTrace(); 366 | } catch (FREInvalidObjectException e) { 367 | // TODO Auto-generated catch block 368 | e.printStackTrace(); 369 | } catch (FREWrongThreadException e) { 370 | // TODO Auto-generated catch block 371 | e.printStackTrace(); 372 | } 373 | 374 | return null; 375 | } 376 | }; 377 | } 378 | 379 | private FREFunction updateHeight() { 380 | return new FREFunction() { 381 | 382 | @Override 383 | public FREObject call(FREContext ctx, FREObject[] args) { 384 | 385 | try { 386 | 387 | if(webDialog != null) 388 | { 389 | if(args.length == 0) 390 | { 391 | return FREObject.newObject(webDialog.getHeight()); 392 | } 393 | 394 | int newH = args[0].getAsInt(); 395 | 396 | webDialog.updateHeight(newH); 397 | 398 | return FREObject.newObject(true); 399 | } 400 | 401 | } catch (IllegalStateException e) { 402 | // TODO Auto-generated catch block 403 | e.printStackTrace(); 404 | } catch (FRETypeMismatchException e) { 405 | // TODO Auto-generated catch block 406 | e.printStackTrace(); 407 | } catch (FREInvalidObjectException e) { 408 | // TODO Auto-generated catch block 409 | e.printStackTrace(); 410 | } catch (FREWrongThreadException e) { 411 | // TODO Auto-generated catch block 412 | e.printStackTrace(); 413 | } 414 | 415 | return null; 416 | } 417 | }; 418 | } 419 | 420 | /* for later support on JavaScript 421 | private FREFunction invokeJS() { 422 | // TODO Auto-generated method stub 423 | return null; 424 | } 425 | */ 426 | 427 | @Override 428 | public void dispose() { 429 | // TODO Auto-generated method stub 430 | 431 | } 432 | 433 | } 434 | -------------------------------------------------------------------------------- /android/src/com/janumedia/ane/uiwebview/UIWebViewDialog.java: -------------------------------------------------------------------------------- 1 | package com.janumedia.ane.uiwebview; 2 | 3 | import com.adobe.fre.FREContext; 4 | 5 | import android.app.Dialog; 6 | import android.content.Context; 7 | import android.graphics.Bitmap; 8 | import android.graphics.Color; 9 | import android.graphics.drawable.ColorDrawable; 10 | import android.view.Gravity; 11 | import android.view.Window; 12 | import android.view.WindowManager; 13 | import android.webkit.WebChromeClient; 14 | import android.webkit.WebView; 15 | import android.webkit.WebViewClient; 16 | import android.widget.RelativeLayout; 17 | import android.widget.RelativeLayout.LayoutParams; 18 | 19 | public class UIWebViewDialog extends Dialog { 20 | 21 | private static String ON_PAGE_START = "ON_PAGE_START"; 22 | private static String ON_PAGE_LOADED = "ON_PAGE_LOADED"; 23 | private static String ON_PAGE_ERROR = "ON_PAGE_ERROR"; 24 | private static String ON_PROGRESS = "ON_PROGRESS"; 25 | 26 | private FREContext freCtx; 27 | private RelativeLayout view; 28 | private WebView web; 29 | 30 | public UIWebViewDialog(FREContext ctx, Context context, String urlPath, int xpos, int ypos, int w, int h) { 31 | 32 | super(context); 33 | 34 | freCtx = ctx; 35 | 36 | Window win = getWindow(); 37 | win.requestFeature(Window.FEATURE_NO_TITLE); 38 | win.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); 39 | win.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); 40 | // disable activity modal ; allow AIR stage touch event 41 | win.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL, WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL); 42 | 43 | WindowManager.LayoutParams wParams = win.getAttributes(); 44 | wParams.gravity = Gravity.TOP | Gravity.LEFT; 45 | wParams.x = xpos; 46 | wParams.y = ypos; 47 | 48 | win.setAttributes(wParams); 49 | 50 | web = new WebView(getContext()); 51 | web.setPivotX(0); 52 | web.setPivotY(0); 53 | web.setPadding(0, 0, 0, 0); 54 | web.setWebChromeClient(new WebChromeClient() 55 | { 56 | @Override 57 | public void onProgressChanged(WebView view, int newProgress) { 58 | super.onProgressChanged(view, newProgress); 59 | 60 | freCtx.dispatchStatusEventAsync(ON_PROGRESS, "" + newProgress); 61 | } 62 | }); 63 | web.setWebViewClient(new WebViewClient() 64 | { 65 | 66 | @Override 67 | public void onPageStarted(WebView view, String url, Bitmap favicon) { 68 | super.onPageStarted(view, url, favicon); 69 | 70 | freCtx.dispatchStatusEventAsync(ON_PAGE_START, url); 71 | } 72 | 73 | @Override 74 | public void onPageFinished(WebView view, String url) { 75 | super.onPageFinished(view, url); 76 | 77 | freCtx.dispatchStatusEventAsync(ON_PAGE_LOADED, url); 78 | } 79 | 80 | @Override 81 | public void onReceivedError(WebView view, int errorCode, 82 | String description, String failingUrl) { 83 | super.onReceivedError(view, errorCode, description, failingUrl); 84 | 85 | freCtx.dispatchStatusEventAsync(ON_PAGE_ERROR, errorCode + "::" + description); 86 | } 87 | }); 88 | 89 | web.loadUrl(urlPath); 90 | 91 | RelativeLayout.LayoutParams lParams = new RelativeLayout.LayoutParams(w, h); 92 | view = new RelativeLayout(getContext()); 93 | view.addView(web, lParams); 94 | 95 | setContentView(view); 96 | } 97 | 98 | public void loadURL (String urlPath) 99 | { 100 | web.loadUrl(urlPath); 101 | } 102 | 103 | public void reload () 104 | { 105 | web.reload(); 106 | } 107 | 108 | public void goBack() { 109 | web.goBack(); 110 | } 111 | 112 | public void goForward() { 113 | web.goForward(); 114 | } 115 | 116 | public void goBackOrForward(int steps) { 117 | web.goBackOrForward(steps); 118 | } 119 | 120 | public void updateXPos(int newX) { 121 | WindowManager.LayoutParams wParams = getWindow().getAttributes(); 122 | wParams.x = newX; 123 | 124 | getWindow().setAttributes(wParams); 125 | } 126 | 127 | public void updateYPos(int newY) { 128 | WindowManager.LayoutParams wParams = getWindow().getAttributes(); 129 | wParams.y = newY; 130 | 131 | getWindow().setAttributes(wParams); 132 | } 133 | 134 | public void updateWidth(int newW) { 135 | RelativeLayout.LayoutParams lParams = (LayoutParams) web.getLayoutParams(); 136 | lParams.width = newW; 137 | 138 | web.setLayoutParams(lParams); 139 | } 140 | 141 | public void updateHeight(int newH) { 142 | RelativeLayout.LayoutParams lParams = (LayoutParams) web.getLayoutParams(); 143 | lParams.height = newH; 144 | 145 | web.setLayoutParams(lParams); 146 | } 147 | 148 | public int getXPos() { 149 | return getWindow().getAttributes().x; 150 | } 151 | 152 | public int getYPos() { 153 | return getWindow().getAttributes().y; 154 | } 155 | 156 | public int getWidth() { 157 | return web.getLayoutParams().width; 158 | } 159 | 160 | public int getHeight() { 161 | return web.getLayoutParams().height; 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /android/src/com/janumedia/ane/uiwebview/UIWebViewExtension.java: -------------------------------------------------------------------------------- 1 | package com.janumedia.ane.uiwebview; 2 | 3 | import android.util.Log; 4 | 5 | import com.adobe.fre.FREContext; 6 | import com.adobe.fre.FREExtension; 7 | 8 | public class UIWebViewExtension implements FREExtension { 9 | 10 | public static String VERSION = "1.0.0"; 11 | 12 | @Override 13 | public FREContext createContext(String arg) { 14 | 15 | Log.v("TRACE", "createContext " + VERSION); 16 | 17 | return new UIWebViewContext (); 18 | } 19 | 20 | @Override 21 | public void dispose() { 22 | // TODO Auto-generated method stub 23 | 24 | } 25 | 26 | @Override 27 | public void initialize() { 28 | // TODO Auto-generated method stub 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /build/UIWebViewANE.ane: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/build/UIWebViewANE.ane -------------------------------------------------------------------------------- /build/UIWebViewANE.swc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/build/UIWebViewANE.swc -------------------------------------------------------------------------------- /build/android/libUIWebViewANE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/build/android/libUIWebViewANE.jar -------------------------------------------------------------------------------- /build/extension.xml: -------------------------------------------------------------------------------- 1 | 2 | com.janumedia.ane.uiwebview 3 | 1.0.0 4 | 5 | 6 | 7 | libUIWebViewANE.a 8 | UIWebViewANEExtInit 9 | UIWebViewANEExtFinal 10 | 11 | 12 | 13 | 14 | libUIWebViewANE.jar 15 | com.janumedia.ane.uiwebview.UIWebViewExtension 16 | com.janumedia.ane.uiwebview.UIWebViewExtension 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /build/iOSplatformOptions.xml: -------------------------------------------------------------------------------- 1 | 2 | 8.1 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /build/ios/libUIWebViewANE.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/build/ios/libUIWebViewANE.a -------------------------------------------------------------------------------- /build/library.swf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/build/library.swf -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 3718873B1C03F03B00217556 /* UIWebViewANE.m in Sources */ = {isa = PBXBuildFile; fileRef = 3718873A1C03F03B00217556 /* UIWebViewANE.m */; }; 11 | 371887411C03F03B00217556 /* libUIWebViewANE.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 371887351C03F03B00217556 /* libUIWebViewANE.a */; }; 12 | 371887511C0402DD00217556 /* UIWebViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 371887501C0402DD00217556 /* UIWebViewController.m */; }; 13 | 371887531C04030F00217556 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 371887521C04030F00217556 /* Foundation.framework */; }; 14 | 371887551C04031E00217556 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 371887541C04031E00217556 /* UIKit.framework */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXContainerItemProxy section */ 18 | 371887421C03F03B00217556 /* PBXContainerItemProxy */ = { 19 | isa = PBXContainerItemProxy; 20 | containerPortal = 3718872D1C03F03B00217556 /* Project object */; 21 | proxyType = 1; 22 | remoteGlobalIDString = 371887341C03F03B00217556; 23 | remoteInfo = UIWebViewANE; 24 | }; 25 | /* End PBXContainerItemProxy section */ 26 | 27 | /* Begin PBXCopyFilesBuildPhase section */ 28 | 371887331C03F03B00217556 /* CopyFiles */ = { 29 | isa = PBXCopyFilesBuildPhase; 30 | buildActionMask = 2147483647; 31 | dstPath = "include/$(PRODUCT_NAME)"; 32 | dstSubfolderSpec = 16; 33 | files = ( 34 | ); 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 371887351C03F03B00217556 /* libUIWebViewANE.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUIWebViewANE.a; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 3718873A1C03F03B00217556 /* UIWebViewANE.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIWebViewANE.m; sourceTree = ""; }; 42 | 371887401C03F03B00217556 /* UIWebViewANETests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UIWebViewANETests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 371887461C03F03B00217556 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 44 | 3718874F1C0402DD00217556 /* UIWebViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIWebViewController.h; sourceTree = ""; }; 45 | 371887501C0402DD00217556 /* UIWebViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIWebViewController.m; sourceTree = ""; }; 46 | 371887521C04030F00217556 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 47 | 371887541C04031E00217556 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 48 | /* End PBXFileReference section */ 49 | 50 | /* Begin PBXFrameworksBuildPhase section */ 51 | 371887321C03F03B00217556 /* Frameworks */ = { 52 | isa = PBXFrameworksBuildPhase; 53 | buildActionMask = 2147483647; 54 | files = ( 55 | 371887551C04031E00217556 /* UIKit.framework in Frameworks */, 56 | 371887531C04030F00217556 /* Foundation.framework in Frameworks */, 57 | ); 58 | runOnlyForDeploymentPostprocessing = 0; 59 | }; 60 | 3718873D1C03F03B00217556 /* Frameworks */ = { 61 | isa = PBXFrameworksBuildPhase; 62 | buildActionMask = 2147483647; 63 | files = ( 64 | 371887411C03F03B00217556 /* libUIWebViewANE.a in Frameworks */, 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 3718872C1C03F03B00217556 = { 72 | isa = PBXGroup; 73 | children = ( 74 | 371887541C04031E00217556 /* UIKit.framework */, 75 | 371887521C04030F00217556 /* Foundation.framework */, 76 | 371887371C03F03B00217556 /* UIWebViewANE */, 77 | 371887441C03F03B00217556 /* UIWebViewANETests */, 78 | 371887361C03F03B00217556 /* Products */, 79 | ); 80 | sourceTree = ""; 81 | }; 82 | 371887361C03F03B00217556 /* Products */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 371887351C03F03B00217556 /* libUIWebViewANE.a */, 86 | 371887401C03F03B00217556 /* UIWebViewANETests.xctest */, 87 | ); 88 | name = Products; 89 | sourceTree = ""; 90 | }; 91 | 371887371C03F03B00217556 /* UIWebViewANE */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 3718873A1C03F03B00217556 /* UIWebViewANE.m */, 95 | 3718874F1C0402DD00217556 /* UIWebViewController.h */, 96 | 371887501C0402DD00217556 /* UIWebViewController.m */, 97 | ); 98 | path = UIWebViewANE; 99 | sourceTree = ""; 100 | }; 101 | 371887441C03F03B00217556 /* UIWebViewANETests */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 371887451C03F03B00217556 /* Supporting Files */, 105 | ); 106 | path = UIWebViewANETests; 107 | sourceTree = ""; 108 | }; 109 | 371887451C03F03B00217556 /* Supporting Files */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 371887461C03F03B00217556 /* Info.plist */, 113 | ); 114 | name = "Supporting Files"; 115 | sourceTree = ""; 116 | }; 117 | /* End PBXGroup section */ 118 | 119 | /* Begin PBXNativeTarget section */ 120 | 371887341C03F03B00217556 /* UIWebViewANE */ = { 121 | isa = PBXNativeTarget; 122 | buildConfigurationList = 371887491C03F03B00217556 /* Build configuration list for PBXNativeTarget "UIWebViewANE" */; 123 | buildPhases = ( 124 | 371887311C03F03B00217556 /* Sources */, 125 | 371887321C03F03B00217556 /* Frameworks */, 126 | 371887331C03F03B00217556 /* CopyFiles */, 127 | ); 128 | buildRules = ( 129 | ); 130 | dependencies = ( 131 | ); 132 | name = UIWebViewANE; 133 | productName = UIWebViewANE; 134 | productReference = 371887351C03F03B00217556 /* libUIWebViewANE.a */; 135 | productType = "com.apple.product-type.library.static"; 136 | }; 137 | 3718873F1C03F03B00217556 /* UIWebViewANETests */ = { 138 | isa = PBXNativeTarget; 139 | buildConfigurationList = 3718874C1C03F03B00217556 /* Build configuration list for PBXNativeTarget "UIWebViewANETests" */; 140 | buildPhases = ( 141 | 3718873C1C03F03B00217556 /* Sources */, 142 | 3718873D1C03F03B00217556 /* Frameworks */, 143 | 3718873E1C03F03B00217556 /* Resources */, 144 | ); 145 | buildRules = ( 146 | ); 147 | dependencies = ( 148 | 371887431C03F03B00217556 /* PBXTargetDependency */, 149 | ); 150 | name = UIWebViewANETests; 151 | productName = UIWebViewANETests; 152 | productReference = 371887401C03F03B00217556 /* UIWebViewANETests.xctest */; 153 | productType = "com.apple.product-type.bundle.unit-test"; 154 | }; 155 | /* End PBXNativeTarget section */ 156 | 157 | /* Begin PBXProject section */ 158 | 3718872D1C03F03B00217556 /* Project object */ = { 159 | isa = PBXProject; 160 | attributes = { 161 | LastUpgradeCheck = 0610; 162 | ORGANIZATIONNAME = "I Nengah Januartha"; 163 | TargetAttributes = { 164 | 371887341C03F03B00217556 = { 165 | CreatedOnToolsVersion = 6.1.1; 166 | }; 167 | 3718873F1C03F03B00217556 = { 168 | CreatedOnToolsVersion = 6.1.1; 169 | }; 170 | }; 171 | }; 172 | buildConfigurationList = 371887301C03F03B00217556 /* Build configuration list for PBXProject "UIWebViewANE" */; 173 | compatibilityVersion = "Xcode 3.2"; 174 | developmentRegion = English; 175 | hasScannedForEncodings = 0; 176 | knownRegions = ( 177 | en, 178 | ); 179 | mainGroup = 3718872C1C03F03B00217556; 180 | productRefGroup = 371887361C03F03B00217556 /* Products */; 181 | projectDirPath = ""; 182 | projectRoot = ""; 183 | targets = ( 184 | 371887341C03F03B00217556 /* UIWebViewANE */, 185 | 3718873F1C03F03B00217556 /* UIWebViewANETests */, 186 | ); 187 | }; 188 | /* End PBXProject section */ 189 | 190 | /* Begin PBXResourcesBuildPhase section */ 191 | 3718873E1C03F03B00217556 /* Resources */ = { 192 | isa = PBXResourcesBuildPhase; 193 | buildActionMask = 2147483647; 194 | files = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | }; 198 | /* End PBXResourcesBuildPhase section */ 199 | 200 | /* Begin PBXSourcesBuildPhase section */ 201 | 371887311C03F03B00217556 /* Sources */ = { 202 | isa = PBXSourcesBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | 3718873B1C03F03B00217556 /* UIWebViewANE.m in Sources */, 206 | 371887511C0402DD00217556 /* UIWebViewController.m in Sources */, 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | 3718873C1C03F03B00217556 /* Sources */ = { 211 | isa = PBXSourcesBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | }; 217 | /* End PBXSourcesBuildPhase section */ 218 | 219 | /* Begin PBXTargetDependency section */ 220 | 371887431C03F03B00217556 /* PBXTargetDependency */ = { 221 | isa = PBXTargetDependency; 222 | target = 371887341C03F03B00217556 /* UIWebViewANE */; 223 | targetProxy = 371887421C03F03B00217556 /* PBXContainerItemProxy */; 224 | }; 225 | /* End PBXTargetDependency section */ 226 | 227 | /* Begin XCBuildConfiguration section */ 228 | 371887471C03F03B00217556 /* Debug */ = { 229 | isa = XCBuildConfiguration; 230 | buildSettings = { 231 | ALWAYS_SEARCH_USER_PATHS = NO; 232 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 233 | CLANG_CXX_LIBRARY = "libc++"; 234 | CLANG_ENABLE_MODULES = YES; 235 | CLANG_ENABLE_OBJC_ARC = YES; 236 | CLANG_WARN_BOOL_CONVERSION = YES; 237 | CLANG_WARN_CONSTANT_CONVERSION = YES; 238 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 239 | CLANG_WARN_EMPTY_BODY = YES; 240 | CLANG_WARN_ENUM_CONVERSION = YES; 241 | CLANG_WARN_INT_CONVERSION = YES; 242 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 243 | CLANG_WARN_UNREACHABLE_CODE = YES; 244 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 245 | COPY_PHASE_STRIP = NO; 246 | ENABLE_STRICT_OBJC_MSGSEND = YES; 247 | GCC_C_LANGUAGE_STANDARD = gnu99; 248 | GCC_DYNAMIC_NO_PIC = NO; 249 | GCC_OPTIMIZATION_LEVEL = 0; 250 | GCC_PREPROCESSOR_DEFINITIONS = ( 251 | "DEBUG=1", 252 | "$(inherited)", 253 | ); 254 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 255 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 256 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 257 | GCC_WARN_UNDECLARED_SELECTOR = YES; 258 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 259 | GCC_WARN_UNUSED_FUNCTION = YES; 260 | GCC_WARN_UNUSED_VARIABLE = YES; 261 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 262 | MTL_ENABLE_DEBUG_INFO = YES; 263 | ONLY_ACTIVE_ARCH = YES; 264 | SDKROOT = iphoneos; 265 | TARGETED_DEVICE_FAMILY = "1,2"; 266 | }; 267 | name = Debug; 268 | }; 269 | 371887481C03F03B00217556 /* Release */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | ALWAYS_SEARCH_USER_PATHS = NO; 273 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 274 | CLANG_CXX_LIBRARY = "libc++"; 275 | CLANG_ENABLE_MODULES = YES; 276 | CLANG_ENABLE_OBJC_ARC = YES; 277 | CLANG_WARN_BOOL_CONVERSION = YES; 278 | CLANG_WARN_CONSTANT_CONVERSION = YES; 279 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 280 | CLANG_WARN_EMPTY_BODY = YES; 281 | CLANG_WARN_ENUM_CONVERSION = YES; 282 | CLANG_WARN_INT_CONVERSION = YES; 283 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 284 | CLANG_WARN_UNREACHABLE_CODE = YES; 285 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 286 | COPY_PHASE_STRIP = YES; 287 | ENABLE_NS_ASSERTIONS = NO; 288 | ENABLE_STRICT_OBJC_MSGSEND = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu99; 290 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 291 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 292 | GCC_WARN_UNDECLARED_SELECTOR = YES; 293 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 294 | GCC_WARN_UNUSED_FUNCTION = YES; 295 | GCC_WARN_UNUSED_VARIABLE = YES; 296 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 297 | MTL_ENABLE_DEBUG_INFO = NO; 298 | SDKROOT = iphoneos; 299 | TARGETED_DEVICE_FAMILY = "1,2"; 300 | VALIDATE_PRODUCT = YES; 301 | }; 302 | name = Release; 303 | }; 304 | 3718874A1C03F03B00217556 /* Debug */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 308 | OTHER_LDFLAGS = "-ObjC"; 309 | PRODUCT_NAME = "$(TARGET_NAME)"; 310 | SKIP_INSTALL = YES; 311 | TARGETED_DEVICE_FAMILY = "1,2"; 312 | }; 313 | name = Debug; 314 | }; 315 | 3718874B1C03F03B00217556 /* Release */ = { 316 | isa = XCBuildConfiguration; 317 | buildSettings = { 318 | IPHONEOS_DEPLOYMENT_TARGET = 6.1; 319 | OTHER_LDFLAGS = "-ObjC"; 320 | PRODUCT_NAME = "$(TARGET_NAME)"; 321 | SKIP_INSTALL = YES; 322 | TARGETED_DEVICE_FAMILY = "1,2"; 323 | }; 324 | name = Release; 325 | }; 326 | 3718874D1C03F03B00217556 /* Debug */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | FRAMEWORK_SEARCH_PATHS = ( 330 | "$(SDKROOT)/Developer/Library/Frameworks", 331 | "$(inherited)", 332 | ); 333 | GCC_PREPROCESSOR_DEFINITIONS = ( 334 | "DEBUG=1", 335 | "$(inherited)", 336 | ); 337 | INFOPLIST_FILE = UIWebViewANETests/Info.plist; 338 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 339 | PRODUCT_NAME = "$(TARGET_NAME)"; 340 | }; 341 | name = Debug; 342 | }; 343 | 3718874E1C03F03B00217556 /* Release */ = { 344 | isa = XCBuildConfiguration; 345 | buildSettings = { 346 | FRAMEWORK_SEARCH_PATHS = ( 347 | "$(SDKROOT)/Developer/Library/Frameworks", 348 | "$(inherited)", 349 | ); 350 | INFOPLIST_FILE = UIWebViewANETests/Info.plist; 351 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 352 | PRODUCT_NAME = "$(TARGET_NAME)"; 353 | }; 354 | name = Release; 355 | }; 356 | /* End XCBuildConfiguration section */ 357 | 358 | /* Begin XCConfigurationList section */ 359 | 371887301C03F03B00217556 /* Build configuration list for PBXProject "UIWebViewANE" */ = { 360 | isa = XCConfigurationList; 361 | buildConfigurations = ( 362 | 371887471C03F03B00217556 /* Debug */, 363 | 371887481C03F03B00217556 /* Release */, 364 | ); 365 | defaultConfigurationIsVisible = 0; 366 | defaultConfigurationName = Release; 367 | }; 368 | 371887491C03F03B00217556 /* Build configuration list for PBXNativeTarget "UIWebViewANE" */ = { 369 | isa = XCConfigurationList; 370 | buildConfigurations = ( 371 | 3718874A1C03F03B00217556 /* Debug */, 372 | 3718874B1C03F03B00217556 /* Release */, 373 | ); 374 | defaultConfigurationIsVisible = 0; 375 | }; 376 | 3718874C1C03F03B00217556 /* Build configuration list for PBXNativeTarget "UIWebViewANETests" */ = { 377 | isa = XCConfigurationList; 378 | buildConfigurations = ( 379 | 3718874D1C03F03B00217556 /* Debug */, 380 | 3718874E1C03F03B00217556 /* Release */, 381 | ); 382 | defaultConfigurationIsVisible = 0; 383 | }; 384 | /* End XCConfigurationList section */ 385 | }; 386 | rootObject = 3718872D1C03F03B00217556 /* Project object */; 387 | } 388 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE.xcodeproj/project.xcworkspace/xcshareddata/UIWebViewANE.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 61769B14-2187-4EBB-AF15-9B7190140B24 9 | IDESourceControlProjectName 10 | UIWebViewANE 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | 2E720606CA01171CDA268651AB459FB1FB818918 14 | https://github.com/janumedia/UIWebViewANE.git 15 | 16 | IDESourceControlProjectPath 17 | xcode/UIWebViewANE/UIWebViewANE.xcodeproj 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | 2E720606CA01171CDA268651AB459FB1FB818918 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | https://github.com/janumedia/UIWebViewANE.git 25 | IDESourceControlProjectVersion 26 | 111 27 | IDESourceControlProjectWCCIdentifier 28 | 2E720606CA01171CDA268651AB459FB1FB818918 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | 2E720606CA01171CDA268651AB459FB1FB818918 36 | IDESourceControlWCCName 37 | UIWebViewANE 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE.xcodeproj/project.xcworkspace/xcuserdata/Janu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/janumedia/UIWebViewANE/ae8deaaabfaa5737e25a27523e5d1664c0c912d0/xcode/UIWebViewANE/UIWebViewANE.xcodeproj/project.xcworkspace/xcuserdata/Janu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE.xcodeproj/xcuserdata/Janu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE.xcodeproj/xcuserdata/Janu.xcuserdatad/xcschemes/UIWebViewANE.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 94 | 100 | 101 | 102 | 103 | 105 | 106 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE.xcodeproj/xcuserdata/Janu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | UIWebViewANE.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 371887341C03F03B00217556 16 | 17 | primary 18 | 19 | 20 | 3718873F1C03F03B00217556 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE/FlashRuntimeExtensions.h: -------------------------------------------------------------------------------- 1 | // ADOBE CONFIDENTIAL 2 | // 3 | // Copyright 2011 Adobe Systems Incorporated All Rights Reserved. 4 | // 5 | // NOTICE: All information contained herein is, and remains the property of 6 | // Adobe Systems Incorporated and its suppliers, if any. The intellectual and 7 | // technical concepts contained herein are proprietary to Adobe Systems 8 | // Incorporated and its suppliers and may be covered by U.S. and Foreign 9 | // Patents, patents in process, and are protected by trade secret or copyright 10 | // law. Dissemination of this information or reproduction of this material 11 | // is strictly forbidden unless prior written permission is obtained from 12 | // Adobe Systems Incorporated. 13 | 14 | // AdobePatentID="P969" 15 | 16 | #ifdef WIN32 17 | typedef unsigned __int32 uint32_t; 18 | typedef unsigned __int8 uint8_t; 19 | typedef __int32 int32_t; 20 | #else 21 | #include 22 | #endif 23 | 24 | #ifndef FRNATIVEEXTENSIONS_H_ 25 | #define FRNATIVEEXTENSIONS_H_ 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | typedef void * FREContext; 32 | typedef void * FREObject; 33 | 34 | /* Initialization *************************************************************/ 35 | 36 | /** 37 | * Defines the signature for native calls that can be invoked via an 38 | * instance of the AS ExtensionContext class. 39 | * 40 | * @return The return value corresponds to the return value 41 | * from the AS ExtensionContext class call() method. It defaults to 42 | * FRE_INVALID_OBJECT, which is reported as null in AS. 43 | */ 44 | 45 | typedef FREObject (*FREFunction)( 46 | FREContext ctx, 47 | void* functionData, 48 | uint32_t argc, 49 | FREObject argv[] 50 | ); 51 | 52 | typedef struct FRENamedFunction_ { 53 | const uint8_t* name; 54 | void* functionData; 55 | FREFunction function; 56 | } FRENamedFunction; 57 | 58 | /** 59 | * Defines the signature for the initializer that is called each time 60 | * a new AS ExtensionContext object is created. 61 | * 62 | * @param extData The extension client data provided to the FREInitializer function as extDataToSet. 63 | * 64 | * @param ctxType Pointer to the contextType string (UTF8) as provided to the AS createExtensionContext call. 65 | * 66 | * @param ctx The FREContext being initialized. 67 | * 68 | * @param numFunctionsToSet The number of elements in the functionsToSet array. 69 | * 70 | * @param functionsToSet A pointer to an array of FRENamedFunction elements. 71 | */ 72 | 73 | typedef void (*FREContextInitializer)( 74 | void* extData , 75 | const uint8_t* ctxType , 76 | FREContext ctx , 77 | uint32_t* numFunctionsToSet, 78 | const FRENamedFunction** functionsToSet 79 | ); 80 | 81 | /** 82 | * Defines the signature for the finalizer that is called each time 83 | * an ExtensionContext instance is disposed. 84 | */ 85 | 86 | typedef void (*FREContextFinalizer)( 87 | FREContext ctx 88 | ); 89 | 90 | /** 91 | * The initialization function provided by each extension must conform 92 | * to the following signature. 93 | * 94 | * @param extDataToSet Provided for the extension to store per-extension instance data. 95 | * For example, if the extension creates 96 | * globals per-instance, it can store a pointer to them here. 97 | * 98 | * @param ctxInitializerToSet Must be set to a pointer to a function 99 | * of type FREContextInitializer. Will be invoked whenever 100 | * the ActionScript code creates a new context for this extension. 101 | * 102 | * @param ctxFinalizerToSet Must be set to a pointer to a function 103 | * of type FREContextFinalizer. 104 | */ 105 | 106 | typedef void (*FREInitializer)( 107 | void** extDataToSet , 108 | FREContextInitializer* ctxInitializerToSet, 109 | FREContextFinalizer* ctxFinalizerToSet 110 | ); 111 | 112 | /** 113 | * Called iff the extension is unloaded from the process. Extensions 114 | * are not guaranteed to be unloaded; the runtime process may exit without 115 | * doing so. 116 | */ 117 | 118 | typedef void (*FREFinalizer)( 119 | void* extData 120 | ); 121 | 122 | /* Result Codes ***************************************************************/ 123 | /** 124 | * These values must not be changed. 125 | */ 126 | 127 | typedef enum { 128 | FRE_OK = 0, 129 | FRE_NO_SUCH_NAME = 1, 130 | FRE_INVALID_OBJECT = 2, 131 | FRE_TYPE_MISMATCH = 3, 132 | FRE_ACTIONSCRIPT_ERROR = 4, 133 | FRE_INVALID_ARGUMENT = 5, 134 | FRE_READ_ONLY = 6, 135 | FRE_WRONG_THREAD = 7, 136 | FRE_ILLEGAL_STATE = 8, 137 | FRE_INSUFFICIENT_MEMORY = 9, 138 | FREResult_ENUMPADDING = 0xfffff /* will ensure that C and C++ treat this enum as the same size. */ 139 | } FREResult; 140 | 141 | /* Context Data ************************************************************/ 142 | 143 | /** 144 | * @returns FRE_OK 145 | * FRE_WRONG_THREAD 146 | * FRE_INVALID_ARGUMENT If nativeData is null. 147 | */ 148 | 149 | FREResult FREGetContextNativeData( FREContext ctx, void** nativeData ); 150 | 151 | /** 152 | * @returns FRE_OK 153 | * FRE_INVALID_ARGUMENT 154 | * FRE_WRONG_THREAD 155 | */ 156 | 157 | FREResult FRESetContextNativeData( FREContext ctx, void* nativeData ); 158 | 159 | /** 160 | * @returns FRE_OK 161 | * FRE_WRONG_THREAD 162 | * FRE_INVALID_ARGUMENT If actionScriptData is null. 163 | */ 164 | 165 | FREResult FREGetContextActionScriptData( FREContext ctx, FREObject *actionScriptData ); 166 | 167 | /** 168 | * @returns FRE_OK 169 | * FRE_WRONG_THREAD 170 | */ 171 | 172 | FREResult FRESetContextActionScriptData( FREContext ctx, FREObject actionScriptData ); 173 | 174 | /* Primitive Types ************************************************************/ 175 | /** 176 | * These values must not be changed. 177 | */ 178 | 179 | typedef enum { 180 | FRE_TYPE_OBJECT = 0, 181 | FRE_TYPE_NUMBER = 1, 182 | FRE_TYPE_STRING = 2, 183 | FRE_TYPE_BYTEARRAY = 3, 184 | FRE_TYPE_ARRAY = 4, 185 | FRE_TYPE_VECTOR = 5, 186 | FRE_TYPE_BITMAPDATA = 6, 187 | FRE_TYPE_BOOLEAN = 7, 188 | FRE_TYPE_NULL = 8, 189 | FREObjectType_ENUMPADDING = 0xfffff /* will ensure that C and C++ treat this enum as the same size. */ 190 | } FREObjectType; 191 | 192 | /** 193 | * @returns FRE_OK 194 | * FRE_INVALID_OBJECT 195 | * FRE_WRONG_THREAD 196 | * FRE_INVALID_ARGUMENT If objectType is null. 197 | */ 198 | 199 | FREResult FREGetObjectType( FREObject object, FREObjectType *objectType ); 200 | 201 | /** 202 | * @return FRE_OK 203 | * FRE_TYPE_MISMATCH 204 | * FRE_INVALID_OBJECT 205 | * FRE_INVALID_ARGUMENT 206 | * FRE_WRONG_THREAD 207 | */ 208 | 209 | FREResult FREGetObjectAsInt32 ( FREObject object, int32_t *value ); 210 | FREResult FREGetObjectAsUint32( FREObject object, uint32_t *value ); 211 | FREResult FREGetObjectAsDouble( FREObject object, double *value ); 212 | FREResult FREGetObjectAsBool ( FREObject object, uint32_t *value ); 213 | 214 | /** 215 | * @return FRE_OK 216 | * FRE_INVALID_ARGUMENT 217 | * FRE_WRONG_THREAD 218 | */ 219 | 220 | FREResult FRENewObjectFromInt32 ( int32_t value, FREObject *object ); 221 | FREResult FRENewObjectFromUint32( uint32_t value, FREObject *object ); 222 | FREResult FRENewObjectFromDouble( double value, FREObject *object ); 223 | FREResult FRENewObjectFromBool ( uint32_t value, FREObject *object ); 224 | 225 | /** 226 | * Retrieves a string representation of the object referred to by 227 | * the given object. The referenced string is immutable and valid 228 | * only for duration of the call to a registered function. If the 229 | * caller wishes to keep the the string, they must keep a copy of it. 230 | * 231 | * @param object The string to be retrieved. 232 | * 233 | * @param length The size, in bytes, of the string. Includes the 234 | * null terminator. 235 | * 236 | * @param value A pointer to a possibly temporary copy of the string. 237 | * 238 | * @return FRE_OK 239 | * FRE_TYPE_MISMATCH 240 | * FRE_INVALID_OBJECT 241 | * FRE_INVALID_ARGUMENT 242 | * FRE_WRONG_THREAD 243 | */ 244 | 245 | FREResult FREGetObjectAsUTF8( 246 | FREObject object, 247 | uint32_t* length, 248 | const uint8_t** value 249 | ); 250 | 251 | /** 252 | * Creates a new String object that contains a copy of the specified 253 | * string. 254 | * 255 | * @param length The length, in bytes, of the original string. Must include 256 | * the null terminator. 257 | * 258 | * @param value A pointer to the original string. 259 | * 260 | * @param object Receives a reference to the new string object. 261 | * 262 | * @return FRE_OK 263 | * FRE_INVALID_ARGUMENT 264 | * FRE_WRONG_THREAD 265 | */ 266 | 267 | FREResult FRENewObjectFromUTF8( 268 | uint32_t length, 269 | const uint8_t* value , 270 | FREObject* object 271 | ); 272 | 273 | /* Object Access **************************************************************/ 274 | 275 | /** 276 | * @param className UTF8-encoded name of the class being constructed. 277 | * 278 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 279 | * Error thrown during execution. May be null if the caller does not 280 | * want to receive this handle. If not null and no error occurs, is set an 281 | * invalid handle value. 282 | * 283 | * @return FRE_OK 284 | * FRE_TYPE_MISMATCH 285 | * FRE_INVALID_OBJECT 286 | * FRE_INVALID_ARGUMENT 287 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from calling this method. 288 | * In this case, thrownException will be set to the handle of the thrown value. 289 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 290 | * FRE_NO_SUCH_NAME 291 | * FRE_WRONG_THREAD 292 | */ 293 | 294 | FREResult FRENewObject( 295 | const uint8_t* className , 296 | uint32_t argc , 297 | FREObject argv[] , 298 | FREObject* object , 299 | FREObject* thrownException 300 | ); 301 | 302 | /** 303 | * @param propertyName UTF8-encoded name of the property being fetched. 304 | * 305 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 306 | * Error thrown during getting the property. May be null if the caller does not 307 | * want to receive this handle. If not null and no error occurs, is set an 308 | * invalid handle value. 309 | * 310 | * @return FRE_OK 311 | * FRE_TYPE_MISMATCH 312 | * FRE_INVALID_OBJECT 313 | * FRE_INVALID_ARGUMENT 314 | * 315 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from getting this property. 316 | * In this case, thrownException will be set to the handle of the thrown value. 317 | * 318 | * FRE_NO_SUCH_NAME If the named property doesn't exist, or if the reference is ambiguous 319 | * because the property exists in more than one namespace. 320 | * 321 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 322 | * 323 | * FRE_WRONG_THREAD 324 | */ 325 | 326 | FREResult FREGetObjectProperty( 327 | FREObject object , 328 | const uint8_t* propertyName , 329 | FREObject* propertyValue , 330 | FREObject* thrownException 331 | ); 332 | 333 | /** 334 | * @param propertyName UTF8-encoded name of the property being set. 335 | * 336 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 337 | * Error thrown during method execution. May be null if the caller does not 338 | * want to receive this handle. If not null and no error occurs, is set an 339 | * invalid handle value. 340 | * 341 | * 342 | * @return FRE_OK 343 | * FRE_TYPE_MISMATCH 344 | * FRE_INVALID_OBJECT 345 | * FRE_INVALID_ARGUMENT 346 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from getting this property. 347 | * In this case, thrownException will be set to the handle of the thrown value. 348 | * 349 | * FRE_NO_SUCH_NAME If the named property doesn't exist, or if the reference is ambiguous 350 | * because the property exists in more than one namespace. 351 | * 352 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 353 | * 354 | * FRE_READ_ONLY 355 | * FRE_WRONG_THREAD 356 | */ 357 | 358 | FREResult FRESetObjectProperty( 359 | FREObject object , 360 | const uint8_t* propertyName , 361 | FREObject propertyValue , 362 | FREObject* thrownException 363 | ); 364 | 365 | /** 366 | * @param methodName UTF8-encoded null-terminated name of the method being invoked. 367 | * 368 | * @param thrownException A pointer to a handle that can receive the handle of any ActionScript 369 | * Error thrown during method execution. May be null if the caller does not 370 | * want to receive this handle. If not null and no error occurs, is set an 371 | * invalid handle value. 372 | * 373 | * @return FRE_OK 374 | * FRE_TYPE_MISMATCH 375 | * FRE_INVALID_OBJECT 376 | * FRE_INVALID_ARGUMENT 377 | * FRE_ACTIONSCRIPT_ERROR If an ActionScript exception results from calling this method. 378 | * In this case, thrownException will be set to the handle of the thrown value. 379 | * 380 | * FRE_NO_SUCH_NAME If the named method doesn't exist, or if the reference is ambiguous 381 | * because the method exists in more than one namespace. 382 | * 383 | * FRE_ILLEGAL_STATE If a ByteArray or BitmapData has been acquired and not yet released. 384 | * 385 | * FRE_WRONG_THREAD 386 | */ 387 | 388 | FREResult FRECallObjectMethod ( 389 | FREObject object , 390 | const uint8_t* methodName , 391 | uint32_t argc , 392 | FREObject argv[] , 393 | FREObject* result , 394 | FREObject* thrownException 395 | ); 396 | 397 | /* BitmapData Access **********************************************************/ 398 | 399 | typedef struct { 400 | uint32_t width; /* width of the BitmapData bitmap */ 401 | uint32_t height; /* height of the BitmapData bitmap */ 402 | uint32_t hasAlpha; /* if non-zero, pixel format is ARGB32, otherwise pixel format is _RGB32, host endianness */ 403 | uint32_t isPremultiplied; /* pixel color values are premultiplied with alpha if non-zero, un-multiplied if zero */ 404 | uint32_t lineStride32; /* line stride in number of 32 bit values, typically the same as width */ 405 | uint32_t* bits32; /* pointer to the first 32-bit pixel of the bitmap data */ 406 | } FREBitmapData; 407 | 408 | typedef struct { 409 | uint32_t width; /* width of the BitmapData bitmap */ 410 | uint32_t height; /* height of the BitmapData bitmap */ 411 | uint32_t hasAlpha; /* if non-zero, pixel format is ARGB32, otherwise pixel format is _RGB32, host endianness */ 412 | uint32_t isPremultiplied; /* pixel color values are premultiplied with alpha if non-zero, un-multiplied if zero */ 413 | uint32_t lineStride32; /* line stride in number of 32 bit values, typically the same as width */ 414 | uint32_t isInvertedY; /* if non-zero, last row of pixels starts at bits32, otherwise, first row of pixels starts at bits32. */ 415 | uint32_t* bits32; /* pointer to the first 32-bit pixel of the bitmap data */ 416 | } FREBitmapData2; 417 | 418 | /** 419 | * Referenced data is valid only for duration of the call 420 | * to a registered function. 421 | * 422 | * @return FRE_OK 423 | * FRE_TYPE_MISMATCH 424 | * FRE_INVALID_OBJECT 425 | * FRE_INVALID_ARGUMENT 426 | * FRE_WRONG_THREAD 427 | * FRE_ILLEGAL_STATE 428 | */ 429 | 430 | FREResult FREAcquireBitmapData( 431 | FREObject object , 432 | FREBitmapData* descriptorToSet 433 | ); 434 | 435 | /** 436 | * Referenced data is valid only for duration of the call 437 | * to a registered function. 438 | * 439 | * Use of this API requires that the extension and application must be packaged for 440 | * the 3.1 namespace or later. 441 | * 442 | * @return FRE_OK 443 | * FRE_TYPE_MISMATCH 444 | * FRE_INVALID_OBJECT 445 | * FRE_INVALID_ARGUMENT 446 | * FRE_WRONG_THREAD 447 | * FRE_ILLEGAL_STATE 448 | */ 449 | 450 | FREResult FREAcquireBitmapData2( 451 | FREObject object , 452 | FREBitmapData2* descriptorToSet 453 | ); 454 | 455 | /** 456 | * BitmapData must be acquired to call this. Clients must invalidate any region 457 | * they modify in order to notify AIR of the changes. Only invalidated regions 458 | * are redrawn. 459 | * 460 | * @return FRE_OK 461 | * FRE_INVALID_OBJECT 462 | * FRE_WRONG_THREAD 463 | * FRE_ILLEGAL_STATE 464 | * FRE_TYPE_MISMATCH 465 | */ 466 | 467 | FREResult FREInvalidateBitmapDataRect( 468 | FREObject object, 469 | uint32_t x , 470 | uint32_t y , 471 | uint32_t width , 472 | uint32_t height 473 | ); 474 | /** 475 | * @return FRE_OK 476 | * FRE_WRONG_THREAD 477 | * FRE_ILLEGAL_STATE 478 | * FRE_TYPE_MISMATCH 479 | */ 480 | 481 | FREResult FREReleaseBitmapData( FREObject object ); 482 | 483 | /** 484 | * Referenced data is valid only for duration of the call 485 | * to a registered function. 486 | * 487 | * @return FRE_OK 488 | * FRE_TYPE_MISMATCH 489 | * FRE_INVALID_OBJECT 490 | * FRE_WRONG_THREAD 491 | */ 492 | 493 | /* ByteArray Access ***********************************************************/ 494 | 495 | typedef struct { 496 | uint32_t length; 497 | uint8_t* bytes; 498 | } FREByteArray; 499 | 500 | /** 501 | * Referenced data is valid only for duration of the call 502 | * to a registered function. 503 | * 504 | * @return FRE_OK 505 | * FRE_TYPE_MISMATCH 506 | * FRE_INVALID_OBJECT 507 | * FRE_INVALID_ARGUMENT 508 | * FRE_WRONG_THREAD 509 | * FRE_ILLEGAL_STATE 510 | */ 511 | 512 | FREResult FREAcquireByteArray( 513 | FREObject object , 514 | FREByteArray* byteArrayToSet 515 | ); 516 | 517 | /** 518 | * @return FRE_OK 519 | * FRE_INVALID_OBJECT 520 | * FRE_ILLEGAL_STATE 521 | * FRE_WRONG_THREAD 522 | */ 523 | 524 | FREResult FREReleaseByteArray( FREObject object ); 525 | 526 | /* Array and Vector Access ****************************************************/ 527 | 528 | /** 529 | * @return FRE_OK 530 | * FRE_INVALID_OBJECT 531 | * FRE_INVALID_ARGUMENT 532 | * FRE_ILLEGAL_STATE 533 | * FRE_TYPE_MISMATCH 534 | * FRE_WRONG_THREAD 535 | */ 536 | 537 | FREResult FREGetArrayLength( 538 | FREObject arrayOrVector, 539 | uint32_t* length 540 | ); 541 | 542 | /** 543 | * @return FRE_OK 544 | * FRE_INVALID_OBJECT 545 | * FRE_TYPE_MISMATCH 546 | * FRE_ILLEGAL_STATE 547 | * FRE_INVALID_ARGUMENT If length is greater than 2^32. 548 | * 549 | * FRE_READ_ONLY If the handle refers to a Vector 550 | * of fixed size. 551 | * 552 | * FRE_WRONG_THREAD 553 | * FRE_INSUFFICIENT_MEMORY 554 | */ 555 | 556 | FREResult FRESetArrayLength( 557 | FREObject arrayOrVector, 558 | uint32_t length 559 | ); 560 | 561 | /** 562 | * If an Array is sparse and an element that isn't defined is requested, the 563 | * return value will be FRE_OK but the handle value will be invalid. 564 | * 565 | * @return FRE_OK 566 | * FRE_ILLEGAL_STATE 567 | * 568 | * FRE_INVALID_ARGUMENT If the handle refers to a vector and the index is 569 | * greater than the size of the array. 570 | * 571 | * FRE_INVALID_OBJECT 572 | * FRE_TYPE_MISMATCH 573 | * FRE_WRONG_THREAD 574 | */ 575 | 576 | FREResult FREGetArrayElementAt( 577 | FREObject arrayOrVector, 578 | uint32_t index , 579 | FREObject* value 580 | ); 581 | 582 | /** 583 | * 584 | * @return FRE_OK 585 | * FRE_INVALID_OBJECT 586 | * FRE_ILLEGAL_STATE 587 | * 588 | * FRE_TYPE_MISMATCH If an attempt to made to set a value in a Vector 589 | * when the type of the value doesn't match the Vector's item type. 590 | * 591 | * FRE_WRONG_THREAD 592 | */ 593 | 594 | FREResult FRESetArrayElementAt( 595 | FREObject arrayOrVector, 596 | uint32_t index , 597 | FREObject value 598 | ); 599 | 600 | /* Callbacks ******************************************************************/ 601 | 602 | /** 603 | * Causes a StatusEvent to be dispatched from the associated 604 | * ExtensionContext object. 605 | * 606 | * Dispatch happens asynchronously, even if this is called during 607 | * a call to a registered function. 608 | * 609 | * The ActionScript portion of this extension can listen for that event 610 | * and, upon receipt, query the native portion for details of the event 611 | * that occurred. 612 | * 613 | * This call is thread-safe and may be invoked from any thread. The string 614 | * values are copied before the call returns. 615 | * 616 | * @return FRE_OK In all circumstances, as the referenced object cannot 617 | * necessarily be checked for validity on the invoking thread. 618 | * However, no event will be dispatched if the object is 619 | * invalid or not an EventDispatcher. 620 | * FRE_INVALID_ARGUMENT If code or level is NULL 621 | */ 622 | 623 | FREResult FREDispatchStatusEventAsync( 624 | FREContext ctx , 625 | const uint8_t* code , 626 | const uint8_t* level 627 | ); 628 | 629 | #ifdef __cplusplus 630 | } 631 | #endif 632 | 633 | #endif /* #ifndef _FLASH_RUNTIME_EXTENSIONS_H_ */ 634 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE/UIWebViewANE.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebViewANE.m 3 | // UIWebViewANE 4 | // 5 | // Created by I Nengah Januartha on 10/15/14. 6 | // Copyright (c) 2014 I Nengah Januartha. All rights reserved. 7 | // 8 | 9 | #import "UIWebViewController.h" 10 | #import "FlashRuntimeExtensions.h" 11 | 12 | static NSString *VERSION = @"1.0.0"; 13 | 14 | UIWebViewController *webController; 15 | 16 | FREObject getVersion (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 17 | { 18 | @autoreleasepool { 19 | 20 | const char *str = [VERSION UTF8String]; 21 | 22 | FREObject result = nil; 23 | FRENewObjectFromUTF8((uint32_t)(strlen(str)+1), (const uint8_t*)str, &result); 24 | return result; 25 | } 26 | } 27 | 28 | FREObject openUIWebView (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 29 | { 30 | @autoreleasepool { 31 | 32 | if(webController == nil) 33 | { 34 | webController = [[UIWebViewController alloc] initWithFREContext:ctx]; 35 | } 36 | 37 | uint32_t urlLength; 38 | const uint8_t *url; 39 | int32_t x; 40 | int32_t y; 41 | uint32_t width; 42 | uint32_t height; 43 | 44 | FREGetObjectAsUTF8(args[0], &urlLength, &url); 45 | FREGetObjectAsInt32(args[1], &x); 46 | FREGetObjectAsInt32(args[2], &y); 47 | FREGetObjectAsUint32(args[3], &width); 48 | FREGetObjectAsUint32(args[4], &height); 49 | 50 | NSString *urlPath = [NSString stringWithUTF8String:(char*)url]; 51 | 52 | [webController open:urlPath x:x y:y w:width h:height]; 53 | 54 | FREObject result = nil; 55 | 56 | FRENewObjectFromBool(YES, &result); 57 | 58 | return result; 59 | } 60 | } 61 | 62 | FREObject loadURL (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 63 | { 64 | @autoreleasepool { 65 | 66 | FREObject result = nil; 67 | 68 | if(webController == nil) return result; 69 | 70 | uint32_t urlLength; 71 | const uint8_t *url; 72 | 73 | FREGetObjectAsUTF8(args[0], &urlLength, &url); 74 | 75 | [webController loadURL:[NSString stringWithUTF8String:(char*)url]]; 76 | 77 | FRENewObjectFromBool(YES, &result); 78 | 79 | return result; 80 | } 81 | } 82 | 83 | FREObject reload (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 84 | { 85 | @autoreleasepool { 86 | 87 | FREObject result = nil; 88 | 89 | if(webController == nil) return result; 90 | 91 | [webController reload]; 92 | 93 | FRENewObjectFromBool(YES, &result); 94 | 95 | return result; 96 | } 97 | } 98 | 99 | FREObject goBack (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 100 | { 101 | @autoreleasepool { 102 | 103 | FREObject result = nil; 104 | 105 | if(webController == nil) return result; 106 | 107 | [webController goBack]; 108 | 109 | FRENewObjectFromBool(YES, &result); 110 | 111 | return result; 112 | } 113 | } 114 | 115 | FREObject goForward (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 116 | { 117 | @autoreleasepool { 118 | 119 | FREObject result = nil; 120 | 121 | if(webController == nil) return result; 122 | 123 | [webController goForward]; 124 | 125 | FRENewObjectFromBool(YES, &result); 126 | 127 | return result; 128 | } 129 | } 130 | 131 | FREObject goBackOrForward (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 132 | { 133 | @autoreleasepool { 134 | FREObject result = nil; 135 | return result; 136 | } 137 | } 138 | 139 | 140 | FREObject xpos (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 141 | { 142 | @autoreleasepool { 143 | 144 | FREObject result = nil; 145 | 146 | if(webController == nil) return result; 147 | 148 | if(argc == 0) 149 | { 150 | 151 | FRENewObjectFromInt32(webController.x, &result); 152 | 153 | return result; 154 | } 155 | 156 | int32_t newX; 157 | 158 | FREGetObjectAsInt32(args[0], &newX); 159 | 160 | webController.x = newX; 161 | 162 | return result; 163 | } 164 | } 165 | 166 | FREObject ypos (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 167 | { 168 | @autoreleasepool { 169 | 170 | FREObject result = nil; 171 | 172 | if(webController == nil) return result; 173 | 174 | if(argc == 0) 175 | { 176 | 177 | FRENewObjectFromInt32(webController.y, &result); 178 | 179 | return result; 180 | } 181 | 182 | int32_t newY; 183 | 184 | FREGetObjectAsInt32(args[0], &newY); 185 | 186 | webController.y = newY; 187 | 188 | return result; 189 | } 190 | } 191 | 192 | FREObject width (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 193 | { 194 | @autoreleasepool { 195 | 196 | FREObject result = nil; 197 | 198 | if(webController == nil) return result; 199 | 200 | if(argc == 0) 201 | { 202 | 203 | FRENewObjectFromInt32(webController.width, &result); 204 | 205 | return result; 206 | } 207 | 208 | int32_t newWidth; 209 | 210 | FREGetObjectAsInt32(args[0], &newWidth); 211 | 212 | webController.width = newWidth; 213 | 214 | return result; 215 | } 216 | } 217 | 218 | FREObject height (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 219 | { 220 | @autoreleasepool { 221 | 222 | FREObject result = nil; 223 | 224 | if(webController == nil) return result; 225 | 226 | if(argc == 0) 227 | { 228 | 229 | FRENewObjectFromInt32(webController.height, &result); 230 | 231 | return result; 232 | } 233 | 234 | int32_t newHeight; 235 | 236 | FREGetObjectAsInt32(args[0], &newHeight); 237 | 238 | webController.height = newHeight; 239 | 240 | return result; 241 | } 242 | } 243 | 244 | FREObject closeUIWebView (FREContext ctx, void *data, uint32_t argc, FREObject args[]) 245 | { 246 | @autoreleasepool { 247 | 248 | FREObject result = nil; 249 | 250 | if(webController == nil) return result; 251 | 252 | [webController close]; 253 | 254 | webController = nil; 255 | 256 | FRENewObjectFromBool(YES, &result); 257 | 258 | return result; 259 | } 260 | } 261 | 262 | 263 | void UIWebViewANEContextInit (void *extData, const uint8_t *ctxType, FREContext ctx, uint32_t *numFuncToTest, const FRENamedFunction **funcToset) 264 | { 265 | *numFuncToTest = 12; 266 | 267 | FRENamedFunction *func = (FRENamedFunction*)malloc(sizeof(FRENamedFunction)*(*numFuncToTest)); 268 | 269 | func[0].name = (const uint8_t*)"getVersion"; 270 | func[0].functionData = NULL; 271 | func[0].function = &getVersion; 272 | 273 | func[1].name = (const uint8_t*)"open"; 274 | func[1].functionData = NULL; 275 | func[1].function = &openUIWebView; 276 | 277 | func[2].name = (const uint8_t*)"loadURL"; 278 | func[2].functionData = NULL; 279 | func[2].function = &loadURL; 280 | 281 | func[3].name = (const uint8_t*)"reload"; 282 | func[3].functionData = NULL; 283 | func[3].function = &reload; 284 | 285 | func[4].name = (const uint8_t*)"goBack"; 286 | func[4].functionData = NULL; 287 | func[4].function = &goBack; 288 | 289 | func[5].name = (const uint8_t*)"goForward"; 290 | func[5].functionData = NULL; 291 | func[5].function = &goForward; 292 | 293 | func[6].name = (const uint8_t*)"goBackOrForward"; 294 | func[6].functionData = NULL; 295 | func[6].function = &goBackOrForward; 296 | 297 | func[7].name = (const uint8_t*)"x"; 298 | func[7].functionData = NULL; 299 | func[7].function = &xpos; 300 | 301 | func[8].name = (const uint8_t*)"y"; 302 | func[8].functionData = NULL; 303 | func[8].function = &ypos; 304 | 305 | func[9].name = (const uint8_t*)"width"; 306 | func[9].functionData = NULL; 307 | func[9].function = &width; 308 | 309 | func[10].name = (const uint8_t*)"height"; 310 | func[10].functionData = NULL; 311 | func[10].function = &height; 312 | 313 | func[11].name = (const uint8_t*)"close"; 314 | func[11].functionData = NULL; 315 | func[11].function = &closeUIWebView; 316 | 317 | *funcToset = func; 318 | } 319 | 320 | void UIWebViewANEContextFinal (FREContext ctx) 321 | { 322 | return; 323 | } 324 | 325 | void UIWebViewANEExtInit (void **extData, FREContextInitializer *ctxInit, FREContextFinalizer *ctxFinal) 326 | { 327 | *extData = NULL; 328 | *ctxInit = &UIWebViewANEContextInit; 329 | *ctxFinal = &UIWebViewANEContextFinal; 330 | } 331 | 332 | void UIWebViewANEExtFinal (void *extData) 333 | { 334 | return; 335 | } -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE/UIWebViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebViewController.h 3 | // UIWebViewANE 4 | // 5 | // Created by I Nengah Januartha on 10/15/14. 6 | // Copyright (c) 2014 I Nengah Januartha. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "FlashRuntimeExtensions.h" 11 | 12 | @interface UIWebViewController : UIViewController 13 | { 14 | FREContext freContext; 15 | UIViewController *rootViewController; 16 | UIWebView *webView; 17 | } 18 | 19 | @property (readwrite) int x; 20 | @property int y; 21 | @property uint width; 22 | @property uint height; 23 | 24 | - (id)initWithFREContext:(FREContext) ctx; 25 | - (void) open:(NSString *) urlPath x:(int) xPos y:(int) yPos w:(int) width h:(int) height; 26 | - (void) loadURL:(NSString*) urlPath; 27 | - (void) reload; 28 | - (void) goBack; 29 | - (void) goForward; 30 | - (void) goBackOrForward:(int) steps; 31 | - (void) close; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANE/UIWebViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIWebViewController.m 3 | // UIWebViewANE 4 | // 5 | // Created by I Nengah Januartha on 10/15/14. 6 | // Copyright (c) 2014 I Nengah Januartha. All rights reserved. 7 | // 8 | 9 | #import "UIWebViewController.h" 10 | 11 | @interface UIWebViewController () 12 | 13 | @end 14 | 15 | NSString *ON_PAGE_START = @"ON_PAGE_START"; 16 | NSString *ON_PAGE_LOADED = @"ON_PAGE_LOADED"; 17 | NSString *ON_PAGE_ERROR = @"ON_PAGE_ERROR"; 18 | NSString *ON_PROGRESS = @"ON_PROGRESS"; 19 | 20 | @implementation UIWebViewController 21 | 22 | @synthesize x = _x; 23 | @synthesize y = _y; 24 | @synthesize width = _width; 25 | @synthesize height = _height; 26 | 27 | - (id)initWithFREContext:(FREContext)ctx 28 | { 29 | if(self == nil) 30 | { 31 | self = [super init]; 32 | } 33 | 34 | freContext = ctx; 35 | 36 | return self; 37 | } 38 | 39 | - (void)viewDidLoad { 40 | [super viewDidLoad]; 41 | // Do any additional setup after loading the view. 42 | } 43 | 44 | - (void)didReceiveMemoryWarning { 45 | [super didReceiveMemoryWarning]; 46 | // Dispose of any resources that can be recreated. 47 | } 48 | 49 | - (void) webViewDidStartLoad:(UIWebView *)web 50 | { 51 | FREDispatchStatusEventAsync(freContext, (uint8_t*)[ON_PAGE_START UTF8String], (uint8_t*)[[[[web request] URL] absoluteString] UTF8String]); 52 | } 53 | 54 | - (void) webViewDidFinishLoad:(UIWebView *)web 55 | { 56 | FREDispatchStatusEventAsync(freContext, (uint8_t*)[ON_PAGE_LOADED UTF8String], (uint8_t*)[[[[web request] URL] absoluteString] UTF8String]);} 57 | 58 | - (void) webView:(UIWebView *)web didFailLoadWithError:(NSError *)error 59 | { 60 | FREDispatchStatusEventAsync(freContext, (uint8_t*)[ON_PAGE_ERROR UTF8String], (uint8_t*)[[error description] UTF8String]);} 61 | 62 | - (void) setX:(int)x 63 | { 64 | _x = x; 65 | 66 | CGRect frame = webView.frame; 67 | 68 | webView.frame = CGRectMake(_x, frame.origin.y, frame.size.width, frame.size.height); 69 | } 70 | 71 | - (int) x 72 | { 73 | return _x; 74 | } 75 | 76 | - (void) setY:(int)y 77 | { 78 | _y = y; 79 | 80 | CGRect frame = webView.frame; 81 | 82 | webView.frame = CGRectMake(frame.origin.x, _y, frame.size.width, frame.size.height); 83 | 84 | } 85 | 86 | - (int) y 87 | { 88 | return _y; 89 | } 90 | 91 | - (void) setWidth:(uint)width 92 | { 93 | _width = width; 94 | 95 | CGRect frame = webView.frame; 96 | 97 | webView.frame = CGRectMake(frame.origin.x, frame.origin.y, _width, frame.size.height); 98 | } 99 | 100 | - (uint) width 101 | { 102 | return _width; 103 | } 104 | 105 | - (void) setHeight:(uint)height 106 | { 107 | _height = height; 108 | 109 | CGRect frame = webView.frame; 110 | 111 | webView.frame = CGRectMake(frame.origin.x, frame.origin.y, frame.size.width, _height); 112 | } 113 | 114 | - (uint) height 115 | { 116 | return _height; 117 | } 118 | 119 | - (void) open:(NSString *)urlPath x:(int)xPos y:(int)yPos w:(int)width h:(int)height 120 | { 121 | _x = xPos; 122 | _y = yPos; 123 | _width = width; 124 | _height = height; 125 | 126 | rootViewController = [[[UIApplication sharedApplication] keyWindow] rootViewController]; 127 | 128 | webView = [[UIWebView alloc] initWithFrame:CGRectMake(_x, _y, _width, _height)]; 129 | [webView setDelegate:self]; 130 | [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlPath]]]; 131 | 132 | [[rootViewController view] addSubview:webView];} 133 | 134 | - (void) loadURL:(NSString *)urlPath 135 | { 136 | [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlPath]]]; 137 | } 138 | 139 | - (void) reload 140 | { 141 | [webView reload]; 142 | } 143 | 144 | - (void) goBack 145 | { 146 | [webView goBack]; 147 | } 148 | 149 | - (void) goForward 150 | { 151 | [webView goForward]; 152 | } 153 | 154 | - (void) goBackOrForward:(int)steps 155 | { 156 | 157 | } 158 | 159 | - (void) close 160 | { 161 | [webView removeFromSuperview]; 162 | 163 | freContext = nil; 164 | } 165 | 166 | 167 | /* 168 | #pragma mark - Navigation 169 | 170 | // In a storyboard-based application, you will often want to do a little preparation before navigation 171 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 172 | // Get the new view controller using [segue destinationViewController]. 173 | // Pass the selected object to the new view controller. 174 | } 175 | */ 176 | 177 | @end 178 | -------------------------------------------------------------------------------- /xcode/UIWebViewANE/UIWebViewANETests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | com.janumedia.ane.uiwebview.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | --------------------------------------------------------------------------------