Revision: 2448
http://sourceforge.net/p/swingme/code/2448
Author: yuranet
Date: 2021-06-11 12:20:55 +0000 (Fri, 11 Jun 2021)
Log Message:
-----------
iOSME added, compiles but does not run yet
Modified Paths:
--------------
AndroidME/build.gradle
SwingME/build.xml
Added Paths:
-----------
SwingME/build.gradle
SwingME/lib/m3gbasic.jar
SwingME/lib/midletrunner.jar
SwingME/lib/opt.jar
iOSME/
iOSME/build.gradle
iOSME/src/
iOSME/src/android/
iOSME/src/android/graphics/
iOSME/src/android/graphics/ColorMatrix.java
iOSME/src/com/
iOSME/src/com/nokia/
iOSME/src/com/nokia/mid/
iOSME/src/com/nokia/mid/ui/
iOSME/src/com/nokia/mid/ui/DirectGraphics.java
iOSME/src/com/nokia/mid/ui/DirectUtils.java
iOSME/src/javax/
iOSME/src/javax/microedition/
iOSME/src/javax/microedition/amms/
iOSME/src/javax/microedition/amms/GlobalManager.java
iOSME/src/javax/microedition/amms/MediaProcessor.java
iOSME/src/javax/microedition/amms/control/
iOSME/src/javax/microedition/amms/control/ImageFormatControl.java
iOSME/src/javax/microedition/io/
iOSME/src/javax/microedition/io/Connection.java
iOSME/src/javax/microedition/io/ConnectionNotFoundException.java
iOSME/src/javax/microedition/io/Connector.java
iOSME/src/javax/microedition/io/ContentConnection.java
iOSME/src/javax/microedition/io/HttpConnection.java
iOSME/src/javax/microedition/io/HttpsConnection.java
iOSME/src/javax/microedition/io/InputConnection.java
iOSME/src/javax/microedition/io/OutputConnection.java
iOSME/src/javax/microedition/io/SecurityInfo.java
iOSME/src/javax/microedition/io/ServerSocketConnection.java
iOSME/src/javax/microedition/io/SocketConnection.java
iOSME/src/javax/microedition/io/StreamConnection.java
iOSME/src/javax/microedition/io/StreamConnectionNotifier.java
iOSME/src/javax/microedition/io/file/
iOSME/src/javax/microedition/io/file/FileConnection.java
iOSME/src/javax/microedition/io/file/FileSystemListener.java
iOSME/src/javax/microedition/io/file/FileSystemRegistry.java
iOSME/src/javax/microedition/lcdui/
iOSME/src/javax/microedition/lcdui/AlertType.java
iOSME/src/javax/microedition/lcdui/Canvas.java
iOSME/src/javax/microedition/lcdui/Command.java
iOSME/src/javax/microedition/lcdui/CommandListener.java
iOSME/src/javax/microedition/lcdui/Display.java
iOSME/src/javax/microedition/lcdui/Displayable.java
iOSME/src/javax/microedition/lcdui/Font.java
iOSME/src/javax/microedition/lcdui/Graphics.java
iOSME/src/javax/microedition/lcdui/Image.java
iOSME/src/javax/microedition/lcdui/Screen.java
iOSME/src/javax/microedition/lcdui/TextBox.java
iOSME/src/javax/microedition/lcdui/TextField.java
iOSME/src/javax/microedition/lcdui/game/
iOSME/src/javax/microedition/lcdui/game/GameCanvas.java
iOSME/src/javax/microedition/lcdui/game/Layer.java
iOSME/src/javax/microedition/lcdui/game/Sprite.java
iOSME/src/javax/microedition/m3g/
iOSME/src/javax/microedition/m3g/Background.java
iOSME/src/javax/microedition/m3g/Graphics3D.java
iOSME/src/javax/microedition/m3g/Image2D.java
iOSME/src/javax/microedition/media/
iOSME/src/javax/microedition/media/Control.java
iOSME/src/javax/microedition/media/Controllable.java
iOSME/src/javax/microedition/media/Manager.java
iOSME/src/javax/microedition/media/MediaException.java
iOSME/src/javax/microedition/media/Player.java
iOSME/src/javax/microedition/media/PlayerListener.java
iOSME/src/javax/microedition/media/TonePlayer.java
iOSME/src/javax/microedition/media/control/
iOSME/src/javax/microedition/media/control/ToneControl.java
iOSME/src/javax/microedition/media/control/VolumeControl.java
iOSME/src/javax/microedition/midlet/
iOSME/src/javax/microedition/midlet/MIDlet.java
iOSME/src/javax/microedition/midlet/MIDletStateChangeException.java
iOSME/src/javax/microedition/pki/
iOSME/src/javax/microedition/pki/Certificate.java
iOSME/src/javax/microedition/pki/CertificateException.java
iOSME/src/net/
iOSME/src/net/yura/
iOSME/src/net/yura/ios/
iOSME/src/net/yura/ios/AppController.java
iOSME/src/net/yura/ios/CanvasView.java
iOSME/src/net/yura/ios/SwingMEiOSApplication.java
iOSME/src/net/yura/ios/iOSJpegEncoder.java
Modified: AndroidME/build.gradle
===================================================================
--- AndroidME/build.gradle 2021-05-12 21:58:52 UTC (rev 2447)
+++ AndroidME/build.gradle 2021-06-11 12:20:55 UTC (rev 2448)
@@ -21,7 +21,7 @@
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
- java.srcDirs = ['src_Android','src_JSR120_SMS','src_JSR135_Multimedia','src_JSR179_Location','src_JSR184_3D','src_JSR234_Advanced_Multimedia','src_JSR82_Bluetooth','src_MIDP','src_SwingME_plaf','../UtilME/src','../SwingME/src']
+ java.srcDirs = ['src_Android','src_JSR120_SMS','src_JSR135_Multimedia','src_JSR179_Location','src_JSR184_3D','src_JSR234_Advanced_Multimedia','src_JSR82_Bluetooth','src_MIDP','src_SwingME_plaf']
res.srcDirs = ['res']
}
}
@@ -29,3 +29,7 @@
minSdkVersion 4
}
}
+
+dependencies {
+ api project(":SwingME")
+}
Added: SwingME/build.gradle
===================================================================
--- SwingME/build.gradle (rev 0)
+++ SwingME/build.gradle 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,20 @@
+apply plugin: 'java-library'
+
+compileJava {
+ targetCompatibility = 1.6
+ sourceCompatibility = 1.6
+ options.encoding = "cp1252"
+}
+
+sourceSets {
+ main {
+ java {
+ srcDirs = ['src', '../UtilME/src', '../UtilME/src_se']
+ }
+ }
+}
+
+dependencies {
+ compileOnly fileTree(dir: 'lib', include: ['*.jar'])
+ api fileTree(dir: '../UtilME/lib', include: ['*.jar'])
+}
Property changes on: SwingME/build.gradle
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: SwingME/build.xml
===================================================================
--- SwingME/build.xml 2021-05-12 21:58:52 UTC (rev 2447)
+++ SwingME/build.xml 2021-06-11 12:20:55 UTC (rev 2448)
@@ -18,7 +18,7 @@
<mkdir dir="build"/>
<mkdir dir="dist"/>
- <javac debug="on" srcdir="src" destdir="build" source="1.4" target="1.4" classpath="../SwingMETest/lib/midletrunner.jar:../SwingMETest/lib/opt.jar:../SwingMETest/lib/m3gbasic.jar:lib/UtilME.jar" encoding="Cp1252"/>
+ <javac debug="on" srcdir="src" destdir="build" source="1.4" target="1.4" classpath="lib/UtilME.jar:lib/midletrunner.jar:lib/m3gbasic.jar:lib/opt.jar" encoding="Cp1252"/>
<unzip src="lib/UtilME.jar" dest="build"/>
Copied: SwingME/lib/m3gbasic.jar (from rev 2447, SwingMETest/lib/m3gbasic.jar)
===================================================================
(Binary files differ)
Copied: SwingME/lib/midletrunner.jar (from rev 2447, SwingMETest/lib/midletrunner.jar)
===================================================================
(Binary files differ)
Copied: SwingME/lib/opt.jar (from rev 2447, SwingMETest/lib/opt.jar)
===================================================================
(Binary files differ)
Added: iOSME/build.gradle
===================================================================
--- iOSME/build.gradle (rev 0)
+++ iOSME/build.gradle 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,25 @@
+buildscript {
+ repositories {
+ jcenter()
+ }
+ dependencies {
+ classpath group: 'org.multi-os-engine', name: 'moe-gradle', version: '1.7.+'
+ }
+}
+
+apply plugin: 'moe-sdk'
+
+sourceCompatibility = "1.8"
+targetCompatibility = "1.8"
+
+sourceSets {
+ main {
+ java {
+ srcDirs('src')
+ }
+ }
+}
+
+dependencies {
+ compileOnly files(moe.platformJar, moe.sdk.coreJar)
+}
\ No newline at end of file
Property changes on: iOSME/build.gradle
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/android/graphics/ColorMatrix.java
===================================================================
--- iOSME/src/android/graphics/ColorMatrix.java (rev 0)
+++ iOSME/src/android/graphics/ColorMatrix.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,180 @@
+package android.graphics;
+
+public class ColorMatrix {
+ private final float[] mArray = new float[20];
+
+ public ColorMatrix() {
+ this.reset();
+ }
+
+ public ColorMatrix(float[] src) {
+ System.arraycopy(src, 0, this.mArray, 0, 20);
+ }
+
+ public ColorMatrix(ColorMatrix src) {
+ System.arraycopy(src.mArray, 0, this.mArray, 0, 20);
+ }
+
+ public final float[] getArray() {
+ return this.mArray;
+ }
+
+ public void reset() {
+ float[] a = this.mArray;
+
+ for(int i = 19; i > 0; --i) {
+ a[i] = 0.0F;
+ }
+
+ a[0] = a[6] = a[12] = a[18] = 1.0F;
+ }
+
+ public void set(ColorMatrix src) {
+ System.arraycopy(src.mArray, 0, this.mArray, 0, 20);
+ }
+
+ public void set(float[] src) {
+ System.arraycopy(src, 0, this.mArray, 0, 20);
+ }
+
+ public void setScale(float rScale, float gScale, float bScale, float aScale) {
+ float[] a = this.mArray;
+
+ for(int i = 19; i > 0; --i) {
+ a[i] = 0.0F;
+ }
+
+ a[0] = rScale;
+ a[6] = gScale;
+ a[12] = bScale;
+ a[18] = aScale;
+ }
+
+ public void setRotate(int axis, float degrees) {
+ this.reset();
+ float radians = degrees * 3.1415927F / 180.0F;
+ float cosine = (float)Math.cos((double)radians);
+ float sine = (float)Math.sin((double)radians);
+ switch(axis) {
+ case 0:
+ this.mArray[6] = this.mArray[12] = cosine;
+ this.mArray[7] = sine;
+ this.mArray[11] = -sine;
+ break;
+ case 1:
+ this.mArray[0] = this.mArray[17] = cosine;
+ this.mArray[2] = sine;
+ this.mArray[15] = -sine;
+ break;
+ case 2:
+ this.mArray[0] = this.mArray[6] = cosine;
+ this.mArray[1] = sine;
+ this.mArray[5] = -sine;
+ break;
+ default:
+ throw new RuntimeException();
+ }
+
+ }
+
+ public void setConcat(ColorMatrix matA, ColorMatrix matB) {
+ Object tmp = null;
+ float[] var9;
+ if(matA != this && matB != this) {
+ var9 = this.mArray;
+ } else {
+ var9 = new float[20];
+ }
+
+ float[] a = matA.mArray;
+ float[] b = matB.mArray;
+ int index = 0;
+
+ for(int j = 0; j < 20; j += 5) {
+ for(int i = 0; i < 4; ++i) {
+ var9[index++] = a[j + 0] * b[i + 0] + a[j + 1] * b[i + 5] + a[j + 2] * b[i + 10] + a[j + 3] * b[i + 15];
+ }
+
+ var9[index++] = a[j + 0] * b[4] + a[j + 1] * b[9] + a[j + 2] * b[14] + a[j + 3] * b[19] + a[j + 4];
+ }
+
+ if(var9 != this.mArray) {
+ System.arraycopy(var9, 0, this.mArray, 0, 20);
+ }
+
+ }
+
+ public void preConcat(ColorMatrix prematrix) {
+ this.setConcat(this, prematrix);
+ }
+
+ public void postConcat(ColorMatrix postmatrix) {
+ this.setConcat(postmatrix, this);
+ }
+
+ public void setSaturation(float sat) {
+ this.reset();
+ float[] m = this.mArray;
+ float invSat = 1.0F - sat;
+ float R = 0.213F * invSat;
+ float G = 0.715F * invSat;
+ float B = 0.072F * invSat;
+ m[0] = R + sat;
+ m[1] = G;
+ m[2] = B;
+ m[5] = R;
+ m[6] = G + sat;
+ m[7] = B;
+ m[10] = R;
+ m[11] = G;
+ m[12] = B + sat;
+ }
+
+ public void setRGB2YUV() {
+ this.reset();
+ float[] m = this.mArray;
+ m[0] = 0.299F;
+ m[1] = 0.587F;
+ m[2] = 0.114F;
+ m[5] = -0.16874F;
+ m[6] = -0.33126F;
+ m[7] = 0.5F;
+ m[10] = 0.5F;
+ m[11] = -0.41869F;
+ m[12] = -0.08131F;
+ }
+
+ public void setYUV2RGB() {
+ this.reset();
+ float[] m = this.mArray;
+ m[2] = 1.402F;
+ m[5] = 1.0F;
+ m[6] = -0.34414F;
+ m[7] = -0.71414F;
+ m[10] = 1.0F;
+ m[11] = 1.772F;
+ m[12] = 0.0F;
+ }
+
+ public int filterRGB(int x, int y, int rgb) {
+ int R = rgb >> 16 & 255;
+ int G = rgb >> 8 & 255;
+ int B = rgb >> 0 & 255;
+ int A = rgb >> 24 & 255;
+ int r = clamp(this.mArray[0] * (float)R + this.mArray[1] * (float)G + this.mArray[2] * (float)B + this.mArray[3] * (float)A + this.mArray[4]);
+ int g = clamp(this.mArray[5] * (float)R + this.mArray[6] * (float)G + this.mArray[7] * (float)B + this.mArray[8] * (float)A + this.mArray[9]);
+ int b = clamp(this.mArray[10] * (float)R + this.mArray[11] * (float)G + this.mArray[12] * (float)B + this.mArray[13] * (float)A + this.mArray[14]);
+ int a = clamp(this.mArray[15] * (float)R + this.mArray[16] * (float)G + this.mArray[17] * (float)B + this.mArray[18] * (float)A + this.mArray[19]);
+ return (a & 255) << 24 | (r & 255) << 16 | (g & 255) << 8 | (b & 255) << 0;
+ }
+
+ private static int clamp(float value) {
+ if(value < 0.0F) {
+ value = 0.0F;
+ } else if(value > 255.0F) {
+ value = 255.0F;
+ }
+
+ return (int)value;
+ }
+}
Property changes on: iOSME/src/android/graphics/ColorMatrix.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/com/nokia/mid/ui/DirectGraphics.java
===================================================================
--- iOSME/src/com/nokia/mid/ui/DirectGraphics.java (rev 0)
+++ iOSME/src/com/nokia/mid/ui/DirectGraphics.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,36 @@
+package com.nokia.mid.ui;
+
+import javax.microedition.lcdui.Graphics;
+import apple.coregraphics.opaque.CGContextRef;
+import apple.coregraphics.c.CoreGraphics;
+import apple.uikit.UIColor;
+
+public class DirectGraphics {
+
+ private Graphics g;
+
+ public DirectGraphics(Graphics graphics) {
+ g = graphics;
+ }
+
+ public void fillPolygon(int[] xPoints, int xOffset, int[] yPoints, int yOffset, int nPoints, int argbColor) {
+ int tx = g.getTranslateX();
+ int ty = g.getTranslateY();
+ CGContextRef context = g.getContext();
+
+ if (nPoints > 0) {
+ CoreGraphics.CGContextSetLineWidth(context, 1.0);
+ CoreGraphics.CGContextMoveToPoint(context, tx + xPoints[xOffset++], ty + yPoints[yOffset++]);
+ for (int i = 1; i < nPoints; ++i) {
+ CoreGraphics.CGContextAddLineToPoint(context, tx + xPoints[xOffset++], ty + yPoints[yOffset++]);
+ }
+ CoreGraphics.CGContextClosePath(context);
+ CoreGraphics.CGContextSetFillColorWithColor(context, Graphics.getColor(argbColor).CGColor());
+ CoreGraphics.CGContextFillPath(context);
+ }
+ }
+
+ public void setARGBColor(int rgb) {
+ CoreGraphics.CGContextSetStrokeColorWithColor(g.getContext(), Graphics.getColor(rgb).CGColor());
+ }
+}
Property changes on: iOSME/src/com/nokia/mid/ui/DirectGraphics.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/com/nokia/mid/ui/DirectUtils.java
===================================================================
--- iOSME/src/com/nokia/mid/ui/DirectUtils.java (rev 0)
+++ iOSME/src/com/nokia/mid/ui/DirectUtils.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,9 @@
+package com.nokia.mid.ui;
+
+import javax.microedition.lcdui.Graphics;
+
+public class DirectUtils {
+ public static DirectGraphics getDirectGraphics(Graphics graphics) {
+ return new DirectGraphics(graphics);
+ }
+}
Property changes on: iOSME/src/com/nokia/mid/ui/DirectUtils.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/amms/GlobalManager.java
===================================================================
--- iOSME/src/javax/microedition/amms/GlobalManager.java (rev 0)
+++ iOSME/src/javax/microedition/amms/GlobalManager.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,12 @@
+package javax.microedition.amms;
+
+import net.yura.ios.iOSJpegEncoder;
+
+public class GlobalManager {
+ public static MediaProcessor createMediaProcessor(String string) {
+ if ("image/raw".equals(string)) {
+ return new iOSJpegEncoder();
+ }
+ throw new RuntimeException();
+ }
+}
Property changes on: iOSME/src/javax/microedition/amms/GlobalManager.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/amms/MediaProcessor.java
===================================================================
--- iOSME/src/javax/microedition/amms/MediaProcessor.java (rev 0)
+++ iOSME/src/javax/microedition/amms/MediaProcessor.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,17 @@
+package javax.microedition.amms;
+
+import java.io.OutputStream;
+
+public interface MediaProcessor extends javax.microedition.media.Controllable {
+
+ /**
+ * The API for this method says it HAS to take an {@link Object}, or we could get a NoSuchMethodError
+ * But the only Object that is allowed is {@link javax.microedition.lcdui.Image}
+ * @param image an instance of {@link javax.microedition.lcdui.Image}
+ */
+ void setInput(Object image);
+
+ void setOutput(OutputStream outputStream);
+
+ void complete() throws javax.microedition.media.MediaException;
+}
Property changes on: iOSME/src/javax/microedition/amms/MediaProcessor.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/amms/control/ImageFormatControl.java
===================================================================
--- iOSME/src/javax/microedition/amms/control/ImageFormatControl.java (rev 0)
+++ iOSME/src/javax/microedition/amms/control/ImageFormatControl.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,10 @@
+package javax.microedition.amms.control;
+
+public interface ImageFormatControl extends javax.microedition.media.Control {
+
+ /**
+ * @param string "image/jpeg" or "image/png"
+ */
+ public void setFormat(String string);
+
+}
Property changes on: iOSME/src/javax/microedition/amms/control/ImageFormatControl.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/Connection.java
===================================================================
--- iOSME/src/javax/microedition/io/Connection.java (rev 0)
+++ iOSME/src/javax/microedition/io/Connection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,8 @@
+package javax.microedition.io;
+
+import java.io.IOException;
+
+public interface Connection
+{
+ void close() throws IOException;
+}
Property changes on: iOSME/src/javax/microedition/io/Connection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/ConnectionNotFoundException.java
===================================================================
--- iOSME/src/javax/microedition/io/ConnectionNotFoundException.java (rev 0)
+++ iOSME/src/javax/microedition/io/ConnectionNotFoundException.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,11 @@
+package javax.microedition.io;
+
+import java.io.IOException;
+
+public class ConnectionNotFoundException extends IOException
+{
+ public ConnectionNotFoundException( String message )
+ {
+ super( message );
+ }
+}
Property changes on: iOSME/src/javax/microedition/io/ConnectionNotFoundException.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/Connector.java
===================================================================
--- iOSME/src/javax/microedition/io/Connector.java (rev 0)
+++ iOSME/src/javax/microedition/io/Connector.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,104 @@
+package javax.microedition.io;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class Connector {
+ public static final int READ = 0x01;
+ public static final int WRITE = 0x02;
+ public static final int READ_WRITE = READ | WRITE;
+
+ private static final String PROTOCOL_ASSET = "file:///android_asset/";
+ private static final String PROTOCOL_FILE = "file:";
+ private static final String PROTOCOL_SOCKET = "socket:";
+ private static final String PROTOCOL_SSL = "ssl:";
+ private static final String PROTOCOL_HTTP = "http:";
+ private static final String PROTOCOL_HTTPS = "https:";
+ private static final String PROTOCOL_SMS = "sms:";
+
+ public static final Connection open(String name) throws IOException {
+ return open(name, READ_WRITE);
+ }
+
+ public static final Connection open(String name, int mode)
+ throws IOException {
+ Connection connection = null;
+ if (name.startsWith(PROTOCOL_ASSET)) {
+ //connection = new AndroidAssetConnection(name.substring( PROTOCOL_ASSET.length() ));
+ }
+ else if (name.startsWith(PROTOCOL_FILE)) {
+ //connection = new AndroidFileConnection(name);
+ }
+ else if (name.startsWith(PROTOCOL_SOCKET)) {
+ //connection = getSocketConnection(name);
+ }
+ else if (name.startsWith(PROTOCOL_SSL)) {
+ //connection = getSSLSocketConnection(name);
+ }
+ else if (name.startsWith(PROTOCOL_SMS)) {
+ //connection = new MessageConnectionImpl(name);
+ }
+ else if (name.startsWith(PROTOCOL_HTTP)) {
+ //connection = new HttpConnectionImpl(name, mode);
+ }
+ else if (name.startsWith(PROTOCOL_HTTPS)) {
+ //connection = new HttpsConnectionImpl(name, mode);
+ }
+ else {
+ //connection = new AndroidURLConnection(name);
+ }
+
+ if (connection == null) {
+ throw new UnsupportedOperationException(name);
+ }
+
+ return connection;
+ }
+
+ public static final DataInputStream openDataInputStream(String name)
+ throws IOException {
+ return new DataInputStream(openInputStream(name));
+ }
+
+ public static final DataOutputStream openDataOutputStream(String name)
+ throws IOException {
+ return new DataOutputStream(openOutputStream(name));
+ }
+
+ public static final InputStream openInputStream(String name)
+ throws IOException {
+ Connection connection = open(name, READ);
+ return ((InputConnection) connection).openInputStream();
+ }
+
+ public static final OutputStream openOutputStream(String name)
+ throws IOException {
+ Connection connection = open(name, WRITE);
+ return ((OutputConnection) connection).openOutputStream();
+ }
+/*
+ private static Connection getSocketConnection(String name) throws IOException {
+ int portSepIndex = name.lastIndexOf(':');
+ int port = Integer.parseInt(name.substring(portSepIndex + 1));
+ String host = name.substring( (PROTOCOL_SOCKET+"//").length(), portSepIndex);
+
+ if (host.length() > 0) {
+ return new SocketConnection(host, port);
+ } else {
+ return new ServerSocketConnection(port);
+ }
+ }
+
+ private static Connection getSSLSocketConnection(String name) throws IOException {
+ int portSepIndex = name.lastIndexOf(':');
+ int port = Integer.parseInt(name.substring(portSepIndex + 1));
+ String host = name.substring( (PROTOCOL_SSL+"//").length(), portSepIndex);
+
+ java.net.Socket socket = javax.net.ssl.SSLSocketFactory.getDefault().createSocket(host,port);
+ return new SocketConnection(socket);
+ }
+*/
+}
Property changes on: iOSME/src/javax/microedition/io/Connector.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/ContentConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/ContentConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/ContentConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,37 @@
+/**
+ * MicroEmulator
+ * Copyright (C) 2001 Bartek Teodorczyk <ba...@ba...>
+ *
+ * It is licensed under the following two licenses as alternatives:
+ * 1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
+ * 2. Apache License (the "AL") Version 2.0
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above two licenses.
+ *
+ * You may obtain a copy of the LGPL at
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
+ *
+ * You may obtain a copy of the AL at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the LGPL or the AL for the specific language governing permissions and
+ * limitations.
+ *
+ * @version $Id: ContentConnection.java 1605 2008-02-25 21:07:14Z barteo $
+ */
+
+package javax.microedition.io;
+
+public interface ContentConnection extends StreamConnection {
+
+ String getType();
+
+ String getEncoding();
+
+ long getLength();
+
+}
Property changes on: iOSME/src/javax/microedition/io/ContentConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/HttpConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/HttpConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/HttpConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,118 @@
+/*
+ * MicroEmulator
+ * Copyright (C) 2001 Bartek Teodorczyk <ba...@ba...>
+ *
+ * It is licensed under the following two licenses as alternatives:
+ * 1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
+ * 2. Apache License (the "AL") Version 2.0
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above two licenses.
+ *
+ * You may obtain a copy of the LGPL at
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
+ *
+ * You may obtain a copy of the AL at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the LGPL or the AL for the specific language governing permissions and
+ * limitations.
+ */
+
+package javax.microedition.io;
+
+import java.io.IOException;
+
+public interface HttpConnection extends ContentConnection {
+
+ static final String HEAD = "HEAD";
+ static final String GET = "GET";
+ static final String POST = "POST";
+
+ static final int HTTP_OK = 200;
+ static final int HTTP_CREATED = 201;
+ static final int HTTP_ACCEPTED = 202;
+ static final int HTTP_NOT_AUTHORITATIVE = 203;
+ static final int HTTP_NO_CONTENT = 204;
+ static final int HTTP_RESET = 205;
+ static final int HTTP_PARTIAL = 206;
+
+ static final int HTTP_MULT_CHOICE = 300;
+ static final int HTTP_MOVED_PERM = 301;
+ static final int HTTP_MOVED_TEMP = 302;
+ static final int HTTP_SEE_OTHER = 303;
+ static final int HTTP_NOT_MODIFIED = 304;
+ static final int HTTP_USE_PROXY = 305;
+ static final int HTTP_TEMP_REDIRECT = 307;
+
+ static final int HTTP_BAD_REQUEST = 400;
+ static final int HTTP_UNAUTHORIZED = 401;
+ static final int HTTP_PAYMENT_REQUIRED = 402;
+ static final int HTTP_FORBIDDEN = 403;
+ static final int HTTP_NOT_FOUND = 404;
+ static final int HTTP_BAD_METHOD = 405;
+ static final int HTTP_NOT_ACCEPTABLE = 406;
+ static final int HTTP_PROXY_AUTH = 407;
+ static final int HTTP_CLIENT_TIMEOUT = 408;
+ static final int HTTP_CONFLICT = 409;
+ static final int HTTP_GONE = 410;
+ static final int HTTP_LENGTH_REQUIRED = 411;
+ static final int HTTP_PRECON_FAILED = 412;
+ static final int HTTP_ENTITY_TOO_LARGE = 413;
+ static final int HTTP_REQ_TOO_LONG = 414;
+ static final int HTTP_UNSUPPORTED_TYPE = 415;
+ static final int HTTP_UNSUPPORTED_RANGE = 416;
+ static final int HTTP_EXPECT_FAILED = 417;
+
+ static final int HTTP_INTERNAL_ERROR = 500;
+ static final int HTTP_NOT_IMPLEMENTED = 501;
+ static final int HTTP_BAD_GATEWAY = 502;
+ static final int HTTP_UNAVAILABLE = 503;
+ static final int HTTP_GATEWAY_TIMEOUT = 504;
+ static final int HTTP_VERSION = 505;
+
+ String getURL();
+
+ String getProtocol();
+
+ String getHost();
+
+ String getFile();
+
+ String getRef();
+
+ String getQuery();
+
+ int getPort();
+
+ String getRequestMethod();
+
+ void setRequestMethod(String method) throws IOException;
+
+ String getRequestProperty(String key);
+
+ void setRequestProperty(String key, String value) throws IOException;
+
+ int getResponseCode() throws IOException;
+
+ String getResponseMessage() throws IOException;
+
+ long getExpiration() throws IOException;
+
+ long getDate() throws IOException;
+
+ long getLastModified() throws IOException;
+
+ String getHeaderField(String name) throws IOException;
+
+ int getHeaderFieldInt(String name, int def) throws IOException;
+
+ long getHeaderFieldDate(String name, long def) throws IOException;
+
+ String getHeaderField(int n) throws IOException;
+
+ String getHeaderFieldKey(int n) throws IOException;
+}
Property changes on: iOSME/src/javax/microedition/io/HttpConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/HttpsConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/HttpsConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/HttpsConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,10 @@
+package javax.microedition.io;
+
+import java.io.*;
+
+public interface HttpsConnection extends HttpConnection {
+
+ public SecurityInfo getSecurityInfo() throws IOException;
+
+ public int getPort();
+}
Property changes on: iOSME/src/javax/microedition/io/HttpsConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/InputConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/InputConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/InputConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,14 @@
+package javax.microedition.io;
+
+import java.io.DataInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+public interface InputConnection extends Connection
+{
+ DataInputStream openDataInputStream()
+ throws IOException;
+
+ InputStream openInputStream()
+ throws IOException;
+}
Property changes on: iOSME/src/javax/microedition/io/InputConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/OutputConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/OutputConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/OutputConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,14 @@
+package javax.microedition.io;
+
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+public interface OutputConnection extends Connection
+{
+ DataOutputStream openDataOutputStream()
+ throws IOException;
+
+ OutputStream openOutputStream()
+ throws IOException;
+}
Property changes on: iOSME/src/javax/microedition/io/OutputConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/SecurityInfo.java
===================================================================
--- iOSME/src/javax/microedition/io/SecurityInfo.java (rev 0)
+++ iOSME/src/javax/microedition/io/SecurityInfo.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,14 @@
+package javax.microedition.io;
+
+import javax.microedition.pki.Certificate;
+
+public interface SecurityInfo {
+
+ public Certificate getServerCertificate();
+
+ public String getProtocolVersion();
+
+ public String getProtocolName();
+
+ public String getCipherSuite();
+}
Property changes on: iOSME/src/javax/microedition/io/SecurityInfo.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/ServerSocketConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/ServerSocketConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/ServerSocketConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,35 @@
+/*
+ * MicroEmulator
+ * Copyright (C) 2001-2006 Bartek Teodorczyk <ba...@ba...>
+ *
+ * It is licensed under the following two licenses as alternatives:
+ * 1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
+ * 2. Apache License (the "AL") Version 2.0
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above two licenses.
+ *
+ * You may obtain a copy of the LGPL at
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
+ *
+ * You may obtain a copy of the AL at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the LGPL or the AL for the specific language governing permissions and
+ * limitations.
+ */
+
+package javax.microedition.io;
+
+import java.io.IOException;
+
+public interface ServerSocketConnection extends StreamConnectionNotifier {
+
+ public String getLocalAddress() throws IOException;
+
+ public int getLocalPort() throws IOException;
+
+}
Property changes on: iOSME/src/javax/microedition/io/ServerSocketConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/SocketConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/SocketConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/SocketConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,55 @@
+/*
+ * MicroEmulator
+ * Copyright (C) 2006 Bartek Teodorczyk <ba...@ba...>
+ *
+ * It is licensed under the following two licenses as alternatives:
+ * 1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
+ * 2. Apache License (the "AL") Version 2.0
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above two licenses.
+ *
+ * You may obtain a copy of the LGPL at
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
+ *
+ * You may obtain a copy of the AL at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the LGPL or the AL for the specific language governing permissions and
+ * limitations.
+ */
+
+package javax.microedition.io;
+
+import java.io.IOException;
+
+public interface SocketConnection extends StreamConnection {
+
+ public static final byte DELAY = 0;
+
+ public static final byte LINGER = 1;
+
+ public static final byte KEEPALIVE = 2;
+
+ public static final byte RCVBUF = 3;
+
+ public static final byte SNDBUF = 4;
+
+ public void setSocketOption(byte option, int value)
+ throws IllegalArgumentException, IOException;
+
+ public int getSocketOption(byte option) throws IllegalArgumentException,
+ IOException;
+
+ public String getLocalAddress() throws IOException;
+
+ public int getLocalPort() throws IOException;
+
+ public String getAddress() throws IOException;
+
+ public int getPort() throws IOException;
+
+}
Property changes on: iOSME/src/javax/microedition/io/SocketConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/StreamConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/StreamConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/StreamConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,6 @@
+package javax.microedition.io;
+
+public interface StreamConnection extends InputConnection, OutputConnection
+{
+
+}
Property changes on: iOSME/src/javax/microedition/io/StreamConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/StreamConnectionNotifier.java
===================================================================
--- iOSME/src/javax/microedition/io/StreamConnectionNotifier.java (rev 0)
+++ iOSME/src/javax/microedition/io/StreamConnectionNotifier.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,35 @@
+/**
+ * MicroEmulator
+ * Copyright (C) 2001 Bartek Teodorczyk <ba...@ba...>
+ *
+ * It is licensed under the following two licenses as alternatives:
+ * 1. GNU Lesser General Public License (the "LGPL") version 2.1 or any newer version
+ * 2. Apache License (the "AL") Version 2.0
+ *
+ * You may not use this file except in compliance with at least one of
+ * the above two licenses.
+ *
+ * You may obtain a copy of the LGPL at
+ * http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
+ *
+ * You may obtain a copy of the AL at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the LGPL or the AL for the specific language governing permissions and
+ * limitations.
+ *
+ * @version $Id: StreamConnectionNotifier.java 1605 2008-02-25 21:07:14Z barteo $
+ */
+
+package javax.microedition.io;
+
+import java.io.IOException;
+
+public interface StreamConnectionNotifier extends Connection {
+
+ StreamConnection acceptAndOpen() throws IOException;
+
+}
Property changes on: iOSME/src/javax/microedition/io/StreamConnectionNotifier.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/file/FileConnection.java
===================================================================
--- iOSME/src/javax/microedition/io/file/FileConnection.java (rev 0)
+++ iOSME/src/javax/microedition/io/file/FileConnection.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,43 @@
+package javax.microedition.io.file;
+
+import java.io.IOException;
+
+import javax.microedition.io.InputConnection;
+import javax.microedition.io.OutputConnection;
+import javax.microedition.io.StreamConnection;
+
+public interface FileConnection extends javax.microedition.io.Connection, InputConnection,
+ OutputConnection, StreamConnection {
+
+ long availableSize();
+ boolean canRead();
+ boolean canWrite();
+ void create() throws IOException;
+ void delete() throws IOException;
+ long directorySize(boolean includeSubDirs) throws IOException;
+ boolean exists();
+ long fileSize() throws IOException;
+ java.lang.String getName();
+ java.lang.String getPath();
+ java.lang.String getURL();
+ boolean isDirectory();
+ boolean isHidden();
+ boolean isOpen();
+ long lastModified();
+ java.util.Enumeration list() throws IOException;
+ java.util.Enumeration list(java.lang.String filter, boolean includeHidden) throws IOException;
+ void mkdir() throws IOException;
+ java.io.DataInputStream openDataInputStream() throws IOException;
+ java.io.DataOutputStream openDataOutputStream() throws IOException;
+ java.io.InputStream openInputStream() throws IOException;
+ java.io.OutputStream openOutputStream() throws IOException;
+ java.io.OutputStream openOutputStream(long byteOffset) throws IOException;
+ void rename(java.lang.String newName) throws IOException;
+ void setFileConnection(java.lang.String fileName) throws IOException;
+ void setHidden(boolean hidden) throws IOException;
+ void setReadable(boolean readable) throws IOException;
+ void setWritable(boolean writable) throws IOException;
+ long totalSize();
+ void truncate(long byteOffset) throws IOException;
+ long usedSize();
+}
Property changes on: iOSME/src/javax/microedition/io/file/FileConnection.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/file/FileSystemListener.java
===================================================================
--- iOSME/src/javax/microedition/io/file/FileSystemListener.java (rev 0)
+++ iOSME/src/javax/microedition/io/file/FileSystemListener.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,8 @@
+package javax.microedition.io.file;
+
+public interface FileSystemListener {
+ public static final int ROOT_ADDED = 0;
+ public static final int ROOT_REMOVED = 1;
+
+ void rootChanged( int state, String rootName );
+}
Property changes on: iOSME/src/javax/microedition/io/file/FileSystemListener.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/io/file/FileSystemRegistry.java
===================================================================
--- iOSME/src/javax/microedition/io/file/FileSystemRegistry.java (rev 0)
+++ iOSME/src/javax/microedition/io/file/FileSystemRegistry.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,32 @@
+package javax.microedition.io.file;
+
+import java.io.File;
+import java.util.Enumeration;
+import java.util.Vector;
+
+public class FileSystemRegistry {
+
+ public static boolean addFileSystemListener(FileSystemListener listener) {
+ return false;
+ }
+
+ public static boolean removeFileSystemListener(FileSystemListener listener) {
+ return false;
+ }
+
+ public static Enumeration listRoots() {
+ File[] roots = File.listRoots();
+ Vector<String> rootsArray = new Vector<String>(roots.length);
+ for (File root : roots) {
+ try {
+ String path = root.getCanonicalPath();
+ rootsArray.add(path);
+ }
+ catch (Exception e) {
+ //Logger.warn("error with " + root, e);
+ e.printStackTrace(); // TODO
+ }
+ }
+ return rootsArray.elements();
+ }
+}
Property changes on: iOSME/src/javax/microedition/io/file/FileSystemRegistry.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/lcdui/AlertType.java
===================================================================
--- iOSME/src/javax/microedition/lcdui/AlertType.java (rev 0)
+++ iOSME/src/javax/microedition/lcdui/AlertType.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,67 @@
+// ME4SE - A MicroEdition Emulation for J2SE
+//
+// Copyright (C) 2001 Stefan Haustein, Oberhausen (Rhld.), Germany
+//
+// Contributors:
+//
+// STATUS: API complete
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License as
+// published by the Free Software Foundation; either version 2 of the
+// License, or (at your option) any later version. This program is
+// distributed in the hope that it will be useful, but WITHOUT ANY
+// WARRANTY; without even the implied warranty of MERCHANTABILITY or
+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+// License for more details. You should have received a copy of the
+// GNU General Public License along with this program; if not, write
+// to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+package javax.microedition.lcdui;
+
+/**
+ * @API MIDP-1.0
+ */
+public class AlertType {
+
+ /**
+ * @API MIDP-1.0
+ */
+ public static final AlertType INFO = new AlertType();
+
+ /**
+ * @API MIDP-1.0
+ */
+ public static final AlertType WARNING = new AlertType();
+
+ /**
+ * @API MIDP-1.0
+ */
+ public static final AlertType ERROR = new AlertType();
+
+ /**
+ * @API MIDP-1.0
+ */
+ public static final AlertType ALARM = new AlertType();
+
+ /**
+ * @API MIDP-1.0
+ */
+ public static final AlertType CONFIRMATION = new AlertType();
+
+ /**
+ * @API MIDP-1.0
+ */
+ protected AlertType() {
+ }
+
+ /**
+ * @API MIDP-1.0
+ */
+ public boolean playSound(Display display) {
+ // TODO
+ return true;
+ }
+
+}
Property changes on: iOSME/src/javax/microedition/lcdui/AlertType.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/lcdui/Canvas.java
===================================================================
--- iOSME/src/javax/microedition/lcdui/Canvas.java (rev 0)
+++ iOSME/src/javax/microedition/lcdui/Canvas.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,215 @@
+package javax.microedition.lcdui;
+
+import net.yura.ios.AppController;
+import net.yura.ios.CanvasView;
+import apple.coregraphics.struct.CGPoint;
+import apple.coregraphics.struct.CGRect;
+import apple.coregraphics.struct.CGSize;
+import apple.uikit.UIView;
+
+public abstract class Canvas extends Displayable {
+
+ public static final int UP = 1;
+ public static final int DOWN = 6;
+ public static final int LEFT = 2;
+ public static final int RIGHT = 5;
+ public static final int FIRE = 8;
+
+ public static final int GAME_A = 9;
+ public static final int GAME_B = 10;
+ public static final int GAME_C = 11;
+ public static final int GAME_D = 12;
+
+ public static final int KEY_NUM0 = 48;
+ public static final int KEY_NUM1 = 49;
+ public static final int KEY_NUM2 = 50;
+ public static final int KEY_NUM3 = 51;
+ public static final int KEY_NUM4 = 52;
+ public static final int KEY_NUM5 = 53;
+ public static final int KEY_NUM6 = 54;
+ public static final int KEY_NUM7 = 55;
+ public static final int KEY_NUM8 = 56;
+ public static final int KEY_NUM9 = 57;
+ public static final int KEY_STAR = 42;
+ public static final int KEY_POUND = 35;
+
+ private int usedWidth,usedHeight;
+
+ CanvasView canvasView;
+
+ protected Canvas() {
+
+ }
+
+ public void setFullScreenMode(boolean fullScreen) {
+ // do nothing, is this possible on android?
+ }
+
+ public int getGameAction(int keyCode) {
+ int res;
+ switch (keyCode) {
+ case -5:
+ case -10:
+ res = Canvas.FIRE;
+ break;
+ case -1:
+ res = Canvas.UP;
+ break;
+ case -2:
+ case '\t': // this is the tab key, and same as code = 9
+ res = Canvas.DOWN;
+ break;
+ case -3:
+ res = Canvas.LEFT;
+ break;
+ case -4:
+ res = Canvas.RIGHT;
+ break;
+ case '7':
+ res = Canvas.GAME_A;
+ break;
+ case '9':
+ res = Canvas.GAME_B;
+ break;
+ case '*':
+ res = Canvas.GAME_C;
+ break;
+ case '#':
+ res = Canvas.GAME_D;
+ break;
+ default:
+ res = 0;
+ break;
+ }
+ return res;
+ }
+
+ public int getKeyCode(int gameAction) {
+ int res;
+ switch (gameAction) {
+ case Canvas.FIRE:
+ res = -5;
+ break;
+ case Canvas.UP:
+ res = -1;
+ break;
+ case Canvas.DOWN:
+ res = -2;
+ break;
+ case Canvas.LEFT:
+ res = -3;
+ break;
+ case Canvas.RIGHT:
+ res = -4;
+ break;
+ case Canvas.GAME_A:
+ res = '7';
+ break;
+ case Canvas.GAME_B:
+ res = '9';
+ break;
+ case Canvas.GAME_C:
+ res = '*';
+ break;
+ case Canvas.GAME_D:
+ res = '#';
+ break;
+ default:
+ res = 0;
+ break;
+ }
+ return res;
+ }
+
+ public void repaint(int x, int y, int w, int h) {
+ CGRect rect = new CGRect(new CGPoint(x, y), new CGSize(w, h));
+ canvasView.setNeedsDisplayInRect(rect);
+ }
+
+ public void repaint() {
+ if (canvasView != null) {
+ canvasView.setNeedsDisplay();
+ }
+ }
+
+ protected void keyPressed(int keyCode) {
+ }
+
+ protected void keyReleased(int keyCode) {
+
+ }
+
+ protected void keyRepeated(int keyCode) {
+
+ }
+
+ protected abstract void paint(Graphics g);
+
+ public final void doPaint(Graphics g) {
+ paint(g);
+ }
+
+ public boolean hasPointerEvents() {
+ return true;
+ }
+
+ protected void pointerPressed(int x, int y) {
+
+ }
+
+ protected void pointerReleased(int x, int y) {
+
+ }
+
+ protected void pointerDragged(int x, int y) {
+
+ }
+
+ // Multi-touch. Not available in MIDP
+ public void multitouchEvent(int[] type, int[] x, int[] y) {
+
+ }
+
+ protected void sizeChanged(int w, int h) {
+
+ }
+
+ public final void fireSizeChanged(int w, int h) {
+ sizeChanged(w, h);
+ }
+
+ @Override
+ public void initDisplayable(AppController controller) {
+ if (canvasView == null) {
+ canvasView = CanvasView.alloc().initWithFrame(controller.view().bounds());
+ canvasView.setCanvas(this);
+ controller.setRendererView(canvasView);
+ }
+ }
+
+ @Override
+ public UIView getView() {
+ return canvasView;
+ }
+
+ protected void hideNotify() {}
+
+ protected void showNotify() {}
+
+ public final void fireHideNotify() {
+ hideNotify();
+ }
+
+ public final void fireShowNotify() {
+ showNotify();
+ }
+
+ public void serviceRepaints() {
+ throw new RuntimeException("not implemented");
+ //AndroidMeApp.getIntance().invokeAndWait(new Thread());
+ }
+
+ public String getKeyName(int keyCode) {
+ return null;
+ }
+}
Property changes on: iOSME/src/javax/microedition/lcdui/Canvas.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/lcdui/Command.java
===================================================================
--- iOSME/src/javax/microedition/lcdui/Command.java (rev 0)
+++ iOSME/src/javax/microedition/lcdui/Command.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,46 @@
+package javax.microedition.lcdui;
+
+
+public class Command
+{
+ public static final int BACK = 1;
+ public static final int CANCEL = 2;
+ public static final int EXIT = 3;
+ public static final int HELP = 4;
+ public static final int ITEM = 5;
+ public static final int OK = 6;
+ public static final int SCREEN = 7;
+ public static final int STOP = 8;
+
+ private int priority;
+ private int commandType;
+ private String label;
+ private String longLabel;
+
+ public Command( String label, int commandType, int priority ) {
+ this( label, null, commandType, priority );
+ }
+
+ public Command( String label, String longLabel, int commandType, int priority )
+ {
+ this.label = label;
+ this.longLabel = longLabel;
+ this.commandType = commandType;
+ this.priority = priority;
+ }
+
+ public int getCommandType()
+ {
+ return this.commandType;
+ }
+
+ public String getLabel()
+ {
+ return this.label;
+ }
+
+ public int getPriority()
+ {
+ return this.priority;
+ }
+}
Property changes on: iOSME/src/javax/microedition/lcdui/Command.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/lcdui/CommandListener.java
===================================================================
--- iOSME/src/javax/microedition/lcdui/CommandListener.java (rev 0)
+++ iOSME/src/javax/microedition/lcdui/CommandListener.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,6 @@
+package javax.microedition.lcdui;
+
+public interface CommandListener
+{
+ void commandAction( Command c, Displayable d );
+}
Property changes on: iOSME/src/javax/microedition/lcdui/CommandListener.java
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: iOSME/src/javax/microedition/lcdui/Display.java
===================================================================
--- iOSME/src/javax/microedition/lcdui/Display.java (rev 0)
+++ iOSME/src/javax/microedition/lcdui/Display.java 2021-06-11 12:20:55 UTC (rev 2448)
@@ -0,0 +1,220 @@
+package javax.microedition.lcdui;
+
+import net.yura.ios.AppController;
+import java.util.Hashtable;
+import javax.microedition.midlet.MIDlet;
+import apple.foundation.NSOperationQueue;
+
+public class Display {
+
+ public static final int COLOR_BACKGROUND = 0;
+ public static final int COLOR_FOREGROUND = 1;
+ public static final int COLOR_BORDER = 2;
+ public static final int COLOR_HIGHLIGHTED_BACKGROUND = 3;
+ public static final int COLOR_HIGHLIGHTED_FOREGROUND = 4;
+ public static final int COLOR_HIGHLIGHTED_BORDER = 5;
+
+
+ public static final int LIST_ELEMENT = 0;
+ public static final int ALERT = 1;
+ public static final int CHOICE_GROUP_ELEMENT = 2;
+
+ private static final Hashtable<MIDlet, Display> DISPLAYS = new Hashtable<MIDlet, Display>( 1 );
+
+ public static Display getDisplay(MIDlet midlet) {
+ Display display = DISPLAYS.get(midlet);
+ if( display == null )
+ {
+ display = new Display(midlet);
+ DISPLAYS.put(midlet, display);
+ }
+ return display;
+ }
+
+ private AppController appController;
+
+ private Displayable current;
+ //TODO: Create accessor
+ public Displayable hiddenDisplay;
+ private MIDlet midlet;
+
+ private Display(MIDlet midlet) {
+ this.midlet = midlet;
+ }
+
+ public Displayable getCurrent() {
+ return this.current;
+ }
+
+ public int getColor( int colorSpecifier ) {
+ // TODO :is there any way to look this up
+ int color;
+ switch( colorSpecifier ) {
+ case COLOR_BACKGROUND:
+ color = 0x000000;
+ break;
+ case COLOR_FOREGROUND:
+ color = 0xFFFFFF;
+ break;
+ case COLOR_BORDER:
+ color = 0x888888;
+ break;
+ case COLOR_HIGHLIGHTED_BACKGROUND:
+ color = 0xff8600;
+ break;
+ case COLOR_HIGHLIGHTED_FOREGROUND:
+ color = 0x000000;
+ break;
+ case COLOR_HIGHLIGHTED_BORDER:
+ color = 0xAAAAAA;
+ break;
+ default:
+ color = 0xFF0000;
+ break;
+ }
+ return color;
+ }
+
+ public int getBestImageWidth( int imageType ) {
+ return 48;
+ }
+
+ public int getBestImageHeight( int imageType ) {
+ return 48;
+ }
+
+ public MIDlet getMIDlet()
+ {
+ return this.midlet;
+ }
+
+ public void setController(AppController appController) {
+ this.appController = appController;
+
+ if (current instanceof Canvas) {
+ current.initDisplayable(appController);
+ }
+ }
+
+ public void setCurrent(final Displayable newCurrent) {
+
+ if (newCurrent == null) {
+ // TODO hide app, then return
+ throw new UnsupportedOperationException();
+ }
+
+ // Hide Keyboard, any time a new Displayable is set
+ if (!(newCurrent instanceof TextBox) && current instanceof Canvas) {
+ //((Canvas) current).hideSoftKeyboard();
+ }
+
+ //if (activity == null) {
+ // hiddenDisplay = newCurrent;
+ // return;
+ //}
+ hiddenDisplay = null;
+
+ if (newCurrent != current) {
+
+ newCurrent.setCurrentDisplay(Display.this);
+
+ if (appController != null) {
+ newCurrent.initDisplayable(appController);
+ }
+
+ current = newCurrent;
+ /*
+ AndroidMeApp.getIntance().invokeAndWait(new Runnable() {
+ public void run() {
+
+ // TextBox is special... we don't really have any UI
+ if (newCurrent instanceof TextBox) {
+ newCurrent.initDisplayable(null);
+ return;
+ ...
[truncated message content] |