diff --git a/.gitignore b/.gitignore index 0dae35b4d..073f9ee0d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,20 +1,5 @@ -mode/processing-core.zip -mode/mode/AndroidMode.jar -mode/mode/gradle-tooling-api* -mode/mode/slf4j* - -mode/mode/percent.jar -mode/mode/recyclerview-v7.jar -mode/mode/support-* -mode/mode/wearable.jar - -mode/libraries/vr/library -mode/libraries/ar/library -mode/tools/SDKUpdater/tool -mode/tools/SDKUpdater/lib - -debug/.gradle -debug/.idea +.gradle +.idea **/examples/**/AndroidManifest.xml diff --git a/apps/armarkers/build.gradle b/apps/armarkers/build.gradle new file mode 100644 index 000000000..bd89203e2 --- /dev/null +++ b/apps/armarkers/build.gradle @@ -0,0 +1,36 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 33 + defaultConfig { + applicationId "processing.tests.armarkers" + minSdkVersion 23 + targetSdkVersion 33 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + productFlavors { + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + namespace 'armarkers' +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + testImplementation 'junit:junit:4.13.2' + implementation project(':libs:processing-core') + implementation project(':libs:processing-ar') + implementation 'androidx.appcompat:appcompat:1.6.0' + implementation 'com.google.ar:core:1.35.0' +} \ No newline at end of file diff --git a/debug/apps/arscene/gradle.properties b/apps/armarkers/gradle.properties similarity index 100% rename from debug/apps/arscene/gradle.properties rename to apps/armarkers/gradle.properties diff --git a/debug/apps/arscene/src/main/AndroidManifest.xml b/apps/armarkers/src/main/AndroidManifest.xml similarity index 91% rename from debug/apps/arscene/src/main/AndroidManifest.xml rename to apps/armarkers/src/main/AndroidManifest.xml index 22804ae65..fcf1ffe6b 100644 --- a/debug/apps/arscene/src/main/AndroidManifest.xml +++ b/apps/armarkers/src/main/AndroidManifest.xml @@ -2,9 +2,9 @@ + android:versionName="1.0"> + + + + + + + + + + + + + + + + diff --git a/debug/apps/arscene/src/main/java/arscene/MainActivity.java b/apps/arscene/src/main/java/arscene/MainActivity.java similarity index 88% rename from debug/apps/arscene/src/main/java/arscene/MainActivity.java rename to apps/arscene/src/main/java/arscene/MainActivity.java index b7127b85f..8e1837290 100644 --- a/debug/apps/arscene/src/main/java/arscene/MainActivity.java +++ b/apps/arscene/src/main/java/arscene/MainActivity.java @@ -20,6 +20,7 @@ public class MainActivity extends AppCompatActivity { private static final int CAMERA_PERMISSION_CODE = 0; + private static boolean CAMERA_PERMISSION_REQUESTED = false; private static final String CAMERA_PERMISSION = Manifest.permission.CAMERA; private static final String CAMERA_PERMISSION_MESSAGE = "Camera permission is needed to use AR"; @@ -46,6 +47,7 @@ protected void onResume() { @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (!hasCameraPermission()) { Toast.makeText(this, CAMERA_PERMISSION_MESSAGE, Toast.LENGTH_LONG).show(); if (!shouldShowRequestPermissionRationale()) { @@ -57,6 +59,8 @@ public void onRequestPermissionsResult(int requestCode, String permissions[], in if (sketch != null) { sketch.onRequestPermissionsResult(requestCode, permissions, grantResults); } + + CAMERA_PERMISSION_REQUESTED = false; } @Override @@ -88,7 +92,10 @@ private boolean hasCameraPermission() { } private void requestCameraPermission() { - ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CAMERA_PERMISSION_CODE); + if (!CAMERA_PERMISSION_REQUESTED) { + CAMERA_PERMISSION_REQUESTED = true; + ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CAMERA_PERMISSION_CODE); + } } private boolean shouldShowRequestPermissionRationale() { diff --git a/debug/apps/arscene/src/main/java/arscene/Sketch.java b/apps/arscene/src/main/java/arscene/Sketch.java similarity index 100% rename from debug/apps/arscene/src/main/java/arscene/Sketch.java rename to apps/arscene/src/main/java/arscene/Sketch.java diff --git a/debug/apps/vrcube/src/main/res/layout/main.xml b/apps/arscene/src/main/res/layout/main.xml similarity index 100% rename from debug/apps/vrcube/src/main/res/layout/main.xml rename to apps/arscene/src/main/res/layout/main.xml diff --git a/debug/apps/fast2d/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/arscene/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from debug/apps/fast2d/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/arscene/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/debug/apps/fast2d/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/arscene/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from debug/apps/fast2d/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/arscene/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/debug/apps/fast2d/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/arscene/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from debug/apps/fast2d/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/arscene/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/debug/apps/fast2d/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/arscene/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/fast2d/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/arscene/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/debug/apps/fast2d/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/arscene/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/fast2d/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to apps/arscene/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/apps/arscene/src/main/res/values/strings.xml b/apps/arscene/src/main/res/values/strings.xml new file mode 100644 index 000000000..f57f444bd --- /dev/null +++ b/apps/arscene/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + AR Test + diff --git a/apps/arscene/src/main/res/values/styles.xml b/apps/arscene/src/main/res/values/styles.xml new file mode 100644 index 000000000..375954d4a --- /dev/null +++ b/apps/arscene/src/main/res/values/styles.xml @@ -0,0 +1,9 @@ + + + diff --git a/debug/apps/fast2d/build.gradle b/apps/fast2d/build.gradle similarity index 76% rename from debug/apps/fast2d/build.gradle rename to apps/fast2d/build.gradle index 3c735f125..9a69129be 100644 --- a/debug/apps/fast2d/build.gradle +++ b/apps/fast2d/build.gradle @@ -1,11 +1,12 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { - compileSdkVersion 29 defaultConfig { applicationId "processing.tests.fast2d" minSdkVersion 17 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" } @@ -21,11 +22,12 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + namespace 'fast2d' } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' implementation project(':libs:processing-core') - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.6.0' } diff --git a/debug/apps/simple/gradle.properties b/apps/fast2d/gradle.properties similarity index 100% rename from debug/apps/simple/gradle.properties rename to apps/fast2d/gradle.properties diff --git a/debug/apps/simple/src/main/AndroidManifest.xml b/apps/fast2d/src/main/AndroidManifest.xml similarity index 81% rename from debug/apps/simple/src/main/AndroidManifest.xml rename to apps/fast2d/src/main/AndroidManifest.xml index d132cc39d..5204a615a 100644 --- a/debug/apps/simple/src/main/AndroidManifest.xml +++ b/apps/fast2d/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + - + diff --git a/debug/apps/fast2d/src/main/assets/blur.glsl b/apps/fast2d/src/main/assets/blur.glsl similarity index 100% rename from debug/apps/fast2d/src/main/assets/blur.glsl rename to apps/fast2d/src/main/assets/blur.glsl diff --git a/debug/apps/fast2d/src/main/assets/bot1.svg b/apps/fast2d/src/main/assets/bot1.svg similarity index 100% rename from debug/apps/fast2d/src/main/assets/bot1.svg rename to apps/fast2d/src/main/assets/bot1.svg diff --git a/debug/apps/fast2d/src/main/assets/edges.glsl b/apps/fast2d/src/main/assets/edges.glsl similarity index 100% rename from debug/apps/fast2d/src/main/assets/edges.glsl rename to apps/fast2d/src/main/assets/edges.glsl diff --git a/debug/apps/fast2d/src/main/assets/frag.glsl b/apps/fast2d/src/main/assets/frag.glsl similarity index 100% rename from debug/apps/fast2d/src/main/assets/frag.glsl rename to apps/fast2d/src/main/assets/frag.glsl diff --git a/debug/apps/fast2d/src/main/assets/img.png b/apps/fast2d/src/main/assets/img.png similarity index 100% rename from debug/apps/fast2d/src/main/assets/img.png rename to apps/fast2d/src/main/assets/img.png diff --git a/debug/apps/fast2d/src/main/assets/leaves.jpg b/apps/fast2d/src/main/assets/leaves.jpg similarity index 100% rename from debug/apps/fast2d/src/main/assets/leaves.jpg rename to apps/fast2d/src/main/assets/leaves.jpg diff --git a/debug/apps/fast2d/src/main/assets/vert.glsl b/apps/fast2d/src/main/assets/vert.glsl similarity index 100% rename from debug/apps/fast2d/src/main/assets/vert.glsl rename to apps/fast2d/src/main/assets/vert.glsl diff --git a/debug/apps/fast2d/src/main/java/fast2d/MainActivity.java b/apps/fast2d/src/main/java/fast2d/MainActivity.java similarity index 96% rename from debug/apps/fast2d/src/main/java/fast2d/MainActivity.java rename to apps/fast2d/src/main/java/fast2d/MainActivity.java index 91a930307..c164255fa 100644 --- a/debug/apps/fast2d/src/main/java/fast2d/MainActivity.java +++ b/apps/fast2d/src/main/java/fast2d/MainActivity.java @@ -72,9 +72,10 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (sketch != null) { sketch.onRequestPermissionsResult( - requestCode, permissions, grantResults); + requestCode, permissions, grantResults); } } diff --git a/debug/apps/fast2d/src/main/java/fast2d/Sketch.java b/apps/fast2d/src/main/java/fast2d/Sketch.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/Sketch.java rename to apps/fast2d/src/main/java/fast2d/Sketch.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchArcTest.java b/apps/fast2d/src/main/java/fast2d/SketchArcTest.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchArcTest.java rename to apps/fast2d/src/main/java/fast2d/SketchArcTest.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchBasicPoly.java b/apps/fast2d/src/main/java/fast2d/SketchBasicPoly.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchBasicPoly.java rename to apps/fast2d/src/main/java/fast2d/SketchBasicPoly.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchCurveTest.java b/apps/fast2d/src/main/java/fast2d/SketchCurveTest.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchCurveTest.java rename to apps/fast2d/src/main/java/fast2d/SketchCurveTest.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchCustomShader.java b/apps/fast2d/src/main/java/fast2d/SketchCustomShader.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchCustomShader.java rename to apps/fast2d/src/main/java/fast2d/SketchCustomShader.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchDisplayText.java b/apps/fast2d/src/main/java/fast2d/SketchDisplayText.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchDisplayText.java rename to apps/fast2d/src/main/java/fast2d/SketchDisplayText.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchDuplicatedVert.java b/apps/fast2d/src/main/java/fast2d/SketchDuplicatedVert.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchDuplicatedVert.java rename to apps/fast2d/src/main/java/fast2d/SketchDuplicatedVert.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchFilterTest.java b/apps/fast2d/src/main/java/fast2d/SketchFilterTest.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchFilterTest.java rename to apps/fast2d/src/main/java/fast2d/SketchFilterTest.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchLoadDisplaySVG.java b/apps/fast2d/src/main/java/fast2d/SketchLoadDisplaySVG.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchLoadDisplaySVG.java rename to apps/fast2d/src/main/java/fast2d/SketchLoadDisplaySVG.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchMousePoly.java b/apps/fast2d/src/main/java/fast2d/SketchMousePoly.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchMousePoly.java rename to apps/fast2d/src/main/java/fast2d/SketchMousePoly.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchPrimitiveTypes.java b/apps/fast2d/src/main/java/fast2d/SketchPrimitiveTypes.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchPrimitiveTypes.java rename to apps/fast2d/src/main/java/fast2d/SketchPrimitiveTypes.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchShaderNoTex.java b/apps/fast2d/src/main/java/fast2d/SketchShaderNoTex.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchShaderNoTex.java rename to apps/fast2d/src/main/java/fast2d/SketchShaderNoTex.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java b/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java rename to apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchTexturedPoly.java b/apps/fast2d/src/main/java/fast2d/SketchTexturedPoly.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchTexturedPoly.java rename to apps/fast2d/src/main/java/fast2d/SketchTexturedPoly.java diff --git a/debug/apps/fast2d/src/main/java/fast2d/SketchUserDefinedContours.java b/apps/fast2d/src/main/java/fast2d/SketchUserDefinedContours.java similarity index 100% rename from debug/apps/fast2d/src/main/java/fast2d/SketchUserDefinedContours.java rename to apps/fast2d/src/main/java/fast2d/SketchUserDefinedContours.java diff --git a/debug/apps/fast2d/src/main/res/layout/activity_main.xml b/apps/fast2d/src/main/res/layout/activity_main.xml similarity index 100% rename from debug/apps/fast2d/src/main/res/layout/activity_main.xml rename to apps/fast2d/src/main/res/layout/activity_main.xml diff --git a/debug/apps/simple/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/fast2d/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from debug/apps/simple/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/fast2d/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/debug/apps/simple/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/fast2d/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from debug/apps/simple/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/fast2d/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/debug/apps/simple/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/fast2d/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from debug/apps/simple/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/fast2d/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/debug/apps/simple/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/fast2d/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/simple/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/fast2d/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/debug/apps/simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/fast2d/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to apps/fast2d/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/debug/apps/fast2d/src/main/res/values-w820dp/dimens.xml b/apps/fast2d/src/main/res/values-w820dp/dimens.xml similarity index 100% rename from debug/apps/fast2d/src/main/res/values-w820dp/dimens.xml rename to apps/fast2d/src/main/res/values-w820dp/dimens.xml diff --git a/debug/apps/fast2d/src/main/res/values/colors.xml b/apps/fast2d/src/main/res/values/colors.xml similarity index 100% rename from debug/apps/fast2d/src/main/res/values/colors.xml rename to apps/fast2d/src/main/res/values/colors.xml diff --git a/debug/apps/fast2d/src/main/res/values/dimens.xml b/apps/fast2d/src/main/res/values/dimens.xml similarity index 100% rename from debug/apps/fast2d/src/main/res/values/dimens.xml rename to apps/fast2d/src/main/res/values/dimens.xml diff --git a/debug/apps/fast2d/src/main/res/values/strings.xml b/apps/fast2d/src/main/res/values/strings.xml similarity index 100% rename from debug/apps/fast2d/src/main/res/values/strings.xml rename to apps/fast2d/src/main/res/values/strings.xml diff --git a/debug/apps/fast2d/src/main/res/values/styles.xml b/apps/fast2d/src/main/res/values/styles.xml similarity index 100% rename from debug/apps/fast2d/src/main/res/values/styles.xml rename to apps/fast2d/src/main/res/values/styles.xml diff --git a/debug/apps/simple/build.gradle b/apps/simple/build.gradle similarity index 62% rename from debug/apps/simple/build.gradle rename to apps/simple/build.gradle index 20e8b60cc..6310d85d3 100644 --- a/debug/apps/simple/build.gradle +++ b/apps/simple/build.gradle @@ -1,22 +1,26 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { - compileSdkVersion 29 + namespace 'processing.tests.simple' + compileSdkVersion 33 + defaultConfig { applicationId "processing.tests.simple" minSdkVersion 17 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" } + buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } - productFlavors { - } + compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -24,8 +28,8 @@ android { } dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' + implementation 'androidx.appcompat:appcompat:1.6.1' + implementation project(':libs:processing-core') - implementation 'androidx.appcompat:appcompat:1.2.0' } diff --git a/apps/simple/proguard-rules.pro b/apps/simple/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/apps/simple/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/debug/apps/fast2d/src/main/AndroidManifest.xml b/apps/simple/src/main/AndroidManifest.xml similarity index 80% rename from debug/apps/fast2d/src/main/AndroidManifest.xml rename to apps/simple/src/main/AndroidManifest.xml index b36c2301f..f4ca7c1cd 100644 --- a/debug/apps/fast2d/src/main/AndroidManifest.xml +++ b/apps/simple/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + - + diff --git a/debug/apps/simple/src/main/assets/leaf.png b/apps/simple/src/main/assets/leaf.png similarity index 100% rename from debug/apps/simple/src/main/assets/leaf.png rename to apps/simple/src/main/assets/leaf.png diff --git a/debug/apps/simple/src/main/java/simple/MainActivity.java b/apps/simple/src/main/java/simple/MainActivity.java similarity index 92% rename from debug/apps/simple/src/main/java/simple/MainActivity.java rename to apps/simple/src/main/java/simple/MainActivity.java index 49eba36c7..7328c802f 100644 --- a/debug/apps/simple/src/main/java/simple/MainActivity.java +++ b/apps/simple/src/main/java/simple/MainActivity.java @@ -28,9 +28,10 @@ protected void onCreate(Bundle savedInstanceState) { @Override public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (sketch != null) { sketch.onRequestPermissionsResult( - requestCode, permissions, grantResults); + requestCode, permissions, grantResults); } } diff --git a/debug/apps/simple/src/main/java/simple/Sketch.java b/apps/simple/src/main/java/simple/Sketch.java similarity index 100% rename from debug/apps/simple/src/main/java/simple/Sketch.java rename to apps/simple/src/main/java/simple/Sketch.java diff --git a/debug/apps/simple/src/main/res/layout/activity_main.xml b/apps/simple/src/main/res/layout/activity_main.xml similarity index 100% rename from debug/apps/simple/src/main/res/layout/activity_main.xml rename to apps/simple/src/main/res/layout/activity_main.xml diff --git a/debug/apps/vrcube/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/simple/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from debug/apps/vrcube/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/simple/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/debug/apps/vrcube/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/simple/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from debug/apps/vrcube/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/simple/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/debug/apps/vrcube/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/simple/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from debug/apps/vrcube/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/simple/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/debug/apps/vrcube/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/simple/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/vrcube/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/simple/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/debug/apps/vrcube/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/vrcube/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to apps/simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/debug/apps/simple/src/main/res/values-w820dp/dimens.xml b/apps/simple/src/main/res/values-w820dp/dimens.xml similarity index 100% rename from debug/apps/simple/src/main/res/values-w820dp/dimens.xml rename to apps/simple/src/main/res/values-w820dp/dimens.xml diff --git a/debug/apps/simple/src/main/res/values/colors.xml b/apps/simple/src/main/res/values/colors.xml similarity index 100% rename from debug/apps/simple/src/main/res/values/colors.xml rename to apps/simple/src/main/res/values/colors.xml diff --git a/debug/apps/simple/src/main/res/values/dimens.xml b/apps/simple/src/main/res/values/dimens.xml similarity index 100% rename from debug/apps/simple/src/main/res/values/dimens.xml rename to apps/simple/src/main/res/values/dimens.xml diff --git a/debug/apps/simple/src/main/res/values/strings.xml b/apps/simple/src/main/res/values/strings.xml similarity index 100% rename from debug/apps/simple/src/main/res/values/strings.xml rename to apps/simple/src/main/res/values/strings.xml diff --git a/debug/apps/simple/src/main/res/values/styles.xml b/apps/simple/src/main/res/values/styles.xml similarity index 100% rename from debug/apps/simple/src/main/res/values/styles.xml rename to apps/simple/src/main/res/values/styles.xml diff --git a/debug/apps/vrcube/build.gradle b/apps/vrcube/build.gradle similarity index 68% rename from debug/apps/vrcube/build.gradle rename to apps/vrcube/build.gradle index 33401996c..b062a918f 100644 --- a/debug/apps/vrcube/build.gradle +++ b/apps/vrcube/build.gradle @@ -1,11 +1,12 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { - compileSdkVersion 29 defaultConfig { applicationId "processing.tests.vrcube" minSdkVersion 19 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" } @@ -21,13 +22,15 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + namespace 'vrcube' } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' implementation project(':libs:processing-core') + implementation project(':libs:google-vr') implementation project(':libs:processing-vr') - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'com.google.vr:sdk-base:1.180.0' + implementation 'com.google.protobuf.nano:protobuf-javanano:3.1.0' + implementation 'androidx.appcompat:appcompat:1.6.0' } diff --git a/debug/apps/vrcube/gradle.properties b/apps/vrcube/gradle.properties similarity index 100% rename from debug/apps/vrcube/gradle.properties rename to apps/vrcube/gradle.properties diff --git a/debug/apps/vrcube/src/main/AndroidManifest.xml b/apps/vrcube/src/main/AndroidManifest.xml similarity index 86% rename from debug/apps/vrcube/src/main/AndroidManifest.xml rename to apps/vrcube/src/main/AndroidManifest.xml index ae44159fd..03513aece 100644 --- a/debug/apps/vrcube/src/main/AndroidManifest.xml +++ b/apps/vrcube/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + @@ -12,9 +12,10 @@ android:label="@string/app_name" android:theme="@style/VrActivityTheme"> + android:screenOrientation="landscape" + android:exported="true"> diff --git a/apps/vrcube/src/main/java/vrcube/MainActivity.java b/apps/vrcube/src/main/java/vrcube/MainActivity.java new file mode 100644 index 000000000..22ef6a835 --- /dev/null +++ b/apps/vrcube/src/main/java/vrcube/MainActivity.java @@ -0,0 +1,23 @@ +package vrcube; + +import android.os.Build; +import android.os.Bundle; +import android.view.WindowManager; + +import processing.vr.VRActivity; +import processing.core.PApplet; + +public class MainActivity extends VRActivity { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); + getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + + PApplet sketch = new Sketch(); + setSketch(sketch); + } +} \ No newline at end of file diff --git a/debug/apps/vrcube/src/main/java/vrcube/Sketch.java b/apps/vrcube/src/main/java/vrcube/Sketch.java similarity index 100% rename from debug/apps/vrcube/src/main/java/vrcube/Sketch.java rename to apps/vrcube/src/main/java/vrcube/Sketch.java diff --git a/apps/vrcube/src/main/res/layout/main.xml b/apps/vrcube/src/main/res/layout/main.xml new file mode 100644 index 000000000..4b602d5f6 --- /dev/null +++ b/apps/vrcube/src/main/res/layout/main.xml @@ -0,0 +1,7 @@ + diff --git a/debug/apps/wallpaper/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/vrcube/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from debug/apps/wallpaper/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/vrcube/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/debug/apps/wallpaper/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/vrcube/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from debug/apps/wallpaper/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/vrcube/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/debug/apps/wallpaper/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/vrcube/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from debug/apps/wallpaper/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/vrcube/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/debug/apps/wallpaper/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/vrcube/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/wallpaper/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/vrcube/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/debug/apps/wallpaper/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/vrcube/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/wallpaper/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to apps/vrcube/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/debug/apps/vrcube/src/main/res/values/strings.xml b/apps/vrcube/src/main/res/values/strings.xml similarity index 100% rename from debug/apps/vrcube/src/main/res/values/strings.xml rename to apps/vrcube/src/main/res/values/strings.xml diff --git a/debug/apps/vrcube/src/main/res/values/styles.xml b/apps/vrcube/src/main/res/values/styles.xml similarity index 100% rename from debug/apps/vrcube/src/main/res/values/styles.xml rename to apps/vrcube/src/main/res/values/styles.xml diff --git a/debug/apps/wallpaper/build.gradle b/apps/wallpaper/build.gradle similarity index 75% rename from debug/apps/wallpaper/build.gradle rename to apps/wallpaper/build.gradle index c050f8d72..aec131e52 100644 --- a/debug/apps/wallpaper/build.gradle +++ b/apps/wallpaper/build.gradle @@ -1,11 +1,12 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { - compileSdkVersion 29 defaultConfig { applicationId "processing.tests.wallpaper" minSdkVersion 17 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" } @@ -21,11 +22,12 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + namespace 'wallpaper' } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' implementation project(':libs:processing-core') - implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.appcompat:appcompat:1.6.0' } \ No newline at end of file diff --git a/debug/apps/wallpaper/gradle.properties b/apps/wallpaper/gradle.properties similarity index 100% rename from debug/apps/wallpaper/gradle.properties rename to apps/wallpaper/gradle.properties diff --git a/debug/apps/wallpaper/src/main/AndroidManifest.xml b/apps/wallpaper/src/main/AndroidManifest.xml similarity index 69% rename from debug/apps/wallpaper/src/main/AndroidManifest.xml rename to apps/wallpaper/src/main/AndroidManifest.xml index 3e10a48ed..37695c4da 100644 --- a/debug/apps/wallpaper/src/main/AndroidManifest.xml +++ b/apps/wallpaper/src/main/AndroidManifest.xml @@ -1,15 +1,19 @@ - + - + - + diff --git a/debug/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java b/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java similarity index 100% rename from debug/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java rename to apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java diff --git a/debug/apps/wallpaper/src/main/java/wallpaper/MainService.java b/apps/wallpaper/src/main/java/wallpaper/MainService.java similarity index 100% rename from debug/apps/wallpaper/src/main/java/wallpaper/MainService.java rename to apps/wallpaper/src/main/java/wallpaper/MainService.java diff --git a/debug/apps/wallpaper/src/main/java/wallpaper/Sketch.java b/apps/wallpaper/src/main/java/wallpaper/Sketch.java similarity index 100% rename from debug/apps/wallpaper/src/main/java/wallpaper/Sketch.java rename to apps/wallpaper/src/main/java/wallpaper/Sketch.java diff --git a/debug/apps/wallpaper/src/main/res/layout/main.xml b/apps/wallpaper/src/main/res/layout/main.xml similarity index 100% rename from debug/apps/wallpaper/src/main/res/layout/main.xml rename to apps/wallpaper/src/main/res/layout/main.xml diff --git a/debug/apps/watchface/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/wallpaper/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from debug/apps/watchface/src/main/res/mipmap-hdpi/ic_launcher.png rename to apps/wallpaper/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/debug/apps/watchface/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/wallpaper/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from debug/apps/watchface/src/main/res/mipmap-mdpi/ic_launcher.png rename to apps/wallpaper/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/debug/apps/watchface/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/wallpaper/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from debug/apps/watchface/src/main/res/mipmap-xhdpi/ic_launcher.png rename to apps/wallpaper/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/debug/apps/watchface/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/wallpaper/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from debug/apps/watchface/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to apps/wallpaper/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/apps/wallpaper/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/apps/wallpaper/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..aee44e138 Binary files /dev/null and b/apps/wallpaper/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/debug/apps/wallpaper/src/main/res/values-w820dp/dimens.xml b/apps/wallpaper/src/main/res/values-w820dp/dimens.xml similarity index 78% rename from debug/apps/wallpaper/src/main/res/values-w820dp/dimens.xml rename to apps/wallpaper/src/main/res/values-w820dp/dimens.xml index 63fc81644..a2d24bc10 100644 --- a/debug/apps/wallpaper/src/main/res/values-w820dp/dimens.xml +++ b/apps/wallpaper/src/main/res/values-w820dp/dimens.xml @@ -2,5 +2,5 @@ - 64dp - + + \ No newline at end of file diff --git a/apps/wallpaper/src/main/res/values/dimens.xml b/apps/wallpaper/src/main/res/values/dimens.xml new file mode 100644 index 000000000..9cfe70043 --- /dev/null +++ b/apps/wallpaper/src/main/res/values/dimens.xml @@ -0,0 +1,3 @@ + + 16dp + \ No newline at end of file diff --git a/debug/apps/wallpaper/src/main/res/values/strings.xml b/apps/wallpaper/src/main/res/values/strings.xml similarity index 100% rename from debug/apps/wallpaper/src/main/res/values/strings.xml rename to apps/wallpaper/src/main/res/values/strings.xml diff --git a/debug/apps/wallpaper/src/main/res/xml/wallpaper.xml b/apps/wallpaper/src/main/res/xml/wallpaper.xml similarity index 100% rename from debug/apps/wallpaper/src/main/res/xml/wallpaper.xml rename to apps/wallpaper/src/main/res/xml/wallpaper.xml diff --git a/debug/apps/watchface/build.gradle b/apps/watchface/build.gradle similarity index 72% rename from debug/apps/watchface/build.gradle rename to apps/watchface/build.gradle index f8f450bc1..212b286f8 100644 --- a/debug/apps/watchface/build.gradle +++ b/apps/watchface/build.gradle @@ -1,11 +1,12 @@ -apply plugin: 'com.android.application' +plugins { + id 'com.android.application' +} android { - compileSdkVersion 29 defaultConfig { applicationId "processing.tests.watchface" minSdkVersion 25 - targetSdkVersion 29 + targetSdkVersion 33 versionCode 1 versionName "1.0" multiDexEnabled true @@ -22,13 +23,14 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + namespace 'watchface' } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' implementation project(':libs:processing-core') - implementation 'com.google.android.gms:play-services-wearable:17.0.0' - implementation 'com.google.android.support:wearable:2.8.1' - compileOnly 'com.google.android.wearable:wearable:2.8.1' + implementation 'com.google.android.gms:play-services-wearable:18.0.0' + implementation 'com.google.android.support:wearable:2.9.0' + compileOnly 'com.google.android.wearable:wearable:2.9.0' } diff --git a/debug/apps/watchface/gradle.properties b/apps/watchface/gradle.properties similarity index 100% rename from debug/apps/watchface/gradle.properties rename to apps/watchface/gradle.properties diff --git a/debug/apps/watchface/src/main/AndroidManifest.xml b/apps/watchface/src/main/AndroidManifest.xml similarity index 85% rename from debug/apps/watchface/src/main/AndroidManifest.xml rename to apps/watchface/src/main/AndroidManifest.xml index 3ed6fa21c..e6f990184 100644 --- a/debug/apps/watchface/src/main/AndroidManifest.xml +++ b/apps/watchface/src/main/AndroidManifest.xml @@ -1,11 +1,14 @@ - + - + diff --git a/debug/apps/watchface/src/main/java/watchface/MainService.java b/apps/watchface/src/main/java/watchface/MainService.java similarity index 100% rename from debug/apps/watchface/src/main/java/watchface/MainService.java rename to apps/watchface/src/main/java/watchface/MainService.java diff --git a/debug/apps/watchface/src/main/java/watchface/Sketch.java b/apps/watchface/src/main/java/watchface/Sketch.java similarity index 100% rename from debug/apps/watchface/src/main/java/watchface/Sketch.java rename to apps/watchface/src/main/java/watchface/Sketch.java diff --git a/debug/apps/watchface/src/main/res/drawable-nodpi/bg.png b/apps/watchface/src/main/res/drawable-nodpi/bg.png similarity index 100% rename from debug/apps/watchface/src/main/res/drawable-nodpi/bg.png rename to apps/watchface/src/main/res/drawable-nodpi/bg.png diff --git a/debug/apps/watchface/src/main/res/drawable-nodpi/preview_analog.png b/apps/watchface/src/main/res/drawable-nodpi/preview_analog.png similarity index 100% rename from debug/apps/watchface/src/main/res/drawable-nodpi/preview_analog.png rename to apps/watchface/src/main/res/drawable-nodpi/preview_analog.png diff --git a/debug/apps/watchface/src/main/res/layout/main.xml b/apps/watchface/src/main/res/layout/main.xml similarity index 100% rename from debug/apps/watchface/src/main/res/layout/main.xml rename to apps/watchface/src/main/res/layout/main.xml diff --git a/apps/watchface/src/main/res/mipmap-hdpi/ic_launcher.png b/apps/watchface/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..cde69bccc Binary files /dev/null and b/apps/watchface/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/apps/watchface/src/main/res/mipmap-mdpi/ic_launcher.png b/apps/watchface/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..c133a0cbd Binary files /dev/null and b/apps/watchface/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/apps/watchface/src/main/res/mipmap-xhdpi/ic_launcher.png b/apps/watchface/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..bfa42f0e7 Binary files /dev/null and b/apps/watchface/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/apps/watchface/src/main/res/mipmap-xxhdpi/ic_launcher.png b/apps/watchface/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..324e72cdd Binary files /dev/null and b/apps/watchface/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/debug/apps/watchface/src/main/res/values/strings.xml b/apps/watchface/src/main/res/values/strings.xml similarity index 100% rename from debug/apps/watchface/src/main/res/values/strings.xml rename to apps/watchface/src/main/res/values/strings.xml diff --git a/debug/apps/watchface/src/main/res/xml/watch_face.xml b/apps/watchface/src/main/res/xml/watch_face.xml similarity index 100% rename from debug/apps/watchface/src/main/res/xml/watch_face.xml rename to apps/watchface/src/main/res/xml/watch_face.xml diff --git a/build.gradle b/build.gradle index c342c76c8..5bb77278f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,167 +1,55 @@ -import java.nio.file.Files -import org.zeroturnaround.zip.ZipUtil -import org.apache.commons.io.FileUtils -import java.util.regex.Pattern -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; +// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() mavenCentral() } - dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' - classpath group: 'commons-io', name: 'commons-io', version: '2.8.0' - classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.14' - } -} + dependencies { + classpath 'com.android.tools.build:gradle:8.0.2' -plugins { - id 'java' - id('io.github.gradle-nexus.publish-plugin') version '1.1.0' + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + } } -apply from: "${rootDir}/scripts/publish-root.gradle" - allprojects { - apply plugin: 'java' - apply plugin: 'java-library' - - Properties versions = new Properties() - versions.load(project.rootProject.file("mode/version.properties").newDataInputStream()) - ext.targetSdkVersion = versions.getProperty("android-platform") - ext.appcompatVersion = versions.getProperty("androidx.appcompat%appcompat") - ext.v4legacyVersion = versions.getProperty("androidx.legacy%legacy-support-v4") - ext.wearVersion = versions.getProperty("com.google.android.support%wearable") - ext.gvrVersion = versions.getProperty("com.google.vr") - ext.garVersion = versions.getProperty("com.google.ar") - ext.processingVersion = versions.getProperty("org.processing") - ext.toolingVersion = versions.getProperty("org.gradle%gradle-tooling-api") - ext.slf4jVersion = versions.getProperty("org.slf4j") - ext.gradlewVersion = versions.getProperty("gradle-wrapper") - ext.toolsLibVersion = versions.getProperty("android-toolslib") - ext.jdtVersion = versions.getProperty("org.eclipse.jdt") - - Properties modeProperties = new Properties() - modeProperties.load(project.rootProject.file("mode/mode.properties").newDataInputStream()) - ext.modeVersion = modeProperties.getProperty("prettyVersion") + repositories { + // This was was added to address an issue in JCenter with some Android packages (https://stackoverflow.com/questions/50563338/could-not-find-runtime-jar-android-arch-lifecycleruntime1-0-0/50564224). + // JCenter is no longer used but keep it just in case. + maven { url "https://maven.google.com" } - Properties vrProperties = new Properties() - vrProperties.load(project.rootProject.file("mode/libraries/vr/library.properties").newDataInputStream()) - ext.vrLibVersion = vrProperties.getProperty("prettyVersion") + // Apparently needed by AndroidX dependencies + maven { url "https://jitpack.io" } - Properties arProperties = new Properties() - arProperties.load(project.rootProject.file("mode/libraries/ar/library.properties").newDataInputStream()) - ext.arLibVersion = arProperties.getProperty("prettyVersion") + // Needed to get google-vr dependencies + maven { url 'https://repo.gradle.org/gradle/libs-releases' } + mavenCentral() + google() + } - def fn = project.rootProject.file("local.properties") - if (!fn.exists()) { - if (System.env["ANDROID_SDK"] != null) { - def syspath = System.env["ANDROID_SDK"] - def parts = syspath.split(Pattern.quote(File.separator)) - def path = String.join("/", parts) - fn.withWriterAppend { w -> - w << "sdk.dir=${path}\n" + // Set Java compatibility for all projects + plugins.withType(JavaPlugin).configureEach { + java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) } - } else { - throw new GradleException( - "The file local.properties does not exist, and there is no ANDROID_SDK environmental variable defined in the system.\n" + - "Define ANDROID_SDK so it points to the location of the Android SDK, or create the local.properties file manually\n" + - "and add the following line to it:\n" + - "sdk.dir=") } } - - Properties localProperties = new Properties() - localProperties.load(project.rootProject.file("local.properties").newDataInputStream()) - def sdkDir = localProperties.getProperty("sdk.dir") - ext.androidPlatformPath = "${sdkDir}/platforms/android-${targetSdkVersion}" - ext.coreZipPath = "${rootDir}/mode/processing-core.zip" - - repositories { - google() - mavenCentral() - maven { url "https://maven.google.com" } - maven { url "https://jitpack.io" } - maven { url 'https://repo.gradle.org/gradle/libs-releases' } - flatDir dirs: androidPlatformPath - flatDir dirs: "${rootDir}/core/build/libs" - } - - compileJava { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - - // Uncomment this option when building with Java 11+ - // https://github.com/processing/processing-android/issues/625 - // options.release = 8 + // Set Android compatibility for all Android projects + plugins.withType(com.android.build.gradle.BasePlugin).configureEach { + android { + compileSdkVersion 33 + compileOptions { + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + } } } -clean.doFirst { - delete "dist" -} - -task dist { - dependsOn subprojects.build - doLast { - def root = "${buildDir}/zip/AndroidMode" - - // Copy assets to build dir - FileUtils.copyDirectory(file("mode/templates"), file("${root}/templates")) - FileUtils.copyDirectory(file("mode/examples"), file("${root}/examples")) - FileUtils.copyDirectory(file("mode/icons"), file("${root}/icons")) - FileUtils.copyDirectory(file("mode/theme"), file("${root}/theme")) - FileUtils.copyDirectory(file("mode/mode"), file("${root}/mode")) - delete "${root}/mode/jdi.jar" - delete "${root}/mode/jdimodel.jar" - - Files.copy(file("mode/processing-core.zip").toPath(), - file("${root}/processing-core.zip").toPath(), REPLACE_EXISTING) - - Files.copy(file("mode/keywords.txt").toPath(), - file("${root}/keywords.txt").toPath(), REPLACE_EXISTING) - - Files.copy(file("mode/version.properties").toPath(), - file("${root}/version.properties").toPath(), REPLACE_EXISTING) - - Files.copy(file("mode/mode.properties").toPath(), - file("${root}/mode.properties").toPath(), REPLACE_EXISTING) - - FileUtils.copyDirectory(file("mode/languages"), - file("${root}/languages")) - - FileUtils.copyDirectory(file("mode/tools/SDKUpdater/tool"), - file("${root}/tools/SDKUpdater/tool")) - FileUtils.copyDirectory(file("mode/tools/SDKUpdater/lib"), - file("${root}/tools/SDKUpdater/lib")) - FileUtils.copyDirectory(file("mode/tools/SDKUpdater/src"), - file("${root}/tools/SDKUpdater/src")) - - FileUtils.copyDirectory(file("mode/libraries/vr/examples"), - file("${root}/libraries/vr/examples")) - FileUtils.copyDirectory(file("mode/libraries/vr/library"), - file("${root}/libraries/vr/library")) - FileUtils.copyDirectory(file("mode/libraries/vr/src"), - file("${root}/libraries/vr/src")) - Files.copy(file("mode/libraries/vr/library.properties").toPath(), - file("${root}/libraries/vr/library.properties").toPath(), REPLACE_EXISTING) - - FileUtils.copyDirectory(file("mode/libraries/ar/examples"), - file("${root}/libraries/ar/examples")) - FileUtils.copyDirectory(file("mode/libraries/ar/library"), - file("${root}/libraries/ar/library")) - FileUtils.copyDirectory(file("mode/libraries/ar/src"), - file("${root}/libraries/ar/src")) - Files.copy(file("mode/libraries/ar/library.properties").toPath(), - file("${root}/libraries/ar/library.properties").toPath(), REPLACE_EXISTING) - - File distFolder = file("dist") - distFolder.mkdirs() - ZipUtil.pack(file("${buildDir}/zip"), new File("dist/AndroidMode.zip")) - Files.copy(file("mode/mode.properties").toPath(), - file("dist/AndroidMode.txt").toPath(), REPLACE_EXISTING) - } -} +tasks.register('clean', Delete) { + delete rootProject.buildDir +} \ No newline at end of file diff --git a/buildSrc/src/main/groovy/processing/android/ImportAar.groovy b/buildSrc/src/main/groovy/processing/android/ImportAar.groovy deleted file mode 100644 index 8880ff931..000000000 --- a/buildSrc/src/main/groovy/processing/android/ImportAar.groovy +++ /dev/null @@ -1,125 +0,0 @@ -package processing.android - -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.api.plugins.PluginManager -import org.gradle.api.plugins.ExtensionContainer -import org.gradle.plugins.ide.idea.IdeaPlugin -import org.gradle.plugins.ide.idea.model.IdeaModel -import org.gradle.plugins.ide.idea.model.IdeaModule -import org.gradle.api.artifacts.Configuration -import org.gradle.api.artifacts.transform.ArtifactTransform - -import static org.gradle.api.internal.artifacts.ArtifactAttributes.ARTIFACT_FORMAT -import com.android.build.gradle.internal.dependency.AarTransform -import com.android.build.gradle.internal.dependency.ExtractAarTransform -import com.android.build.gradle.internal.publishing.AndroidArtifacts -import com.android.builder.aar.AarExtractor -import com.google.common.collect.ImmutableList -import java.util.regex.Pattern -import static com.android.SdkConstants.FD_JARS -import static com.android.SdkConstants.FN_CLASSES_JAR - -import java.io.File -import java.nio.file.Files -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING - -/** - * Build Gradle plgin needed to use aar files as dependencies in a pure java library project. - * Adapted from the following plugin by nekocode - * https://github.com/nekocode/Gradle-Import-Aar - * Ported to Groovy, and made specific to the needs of the Android mode build process (i.e.: this plugin - * is not meant to be used with other projects). - */ -class ImportAar implements Plugin { - - final String CONFIG_NAME_POSTFIX = "Aar" - - void apply(Project project) { - def aar = AndroidArtifacts.TYPE_AAR - def jar = AndroidArtifacts.TYPE_JAR - def exp = AndroidArtifacts.TYPE_EXPLODED_AAR - - // // Create aar configurations - Collection allConfigs = project.getConfigurations().toList() - for (Configuration config: allConfigs) { - Configuration aarConfig = project.configurations.maybeCreate(config.name + CONFIG_NAME_POSTFIX) - - // Add extracted jars to original configuration after project evaluating - aarConfig.getAttributes().attribute(ARTIFACT_FORMAT, jar) - project.afterEvaluate { - for (File jarFile: aarConfig) { - // print "================================================> FILE " - // println jarFile - // println jarFile.getName() - // for (String s: project.sourceSets.main.compileClasspath) { - // println s - // } - // project.getDependencies().add(config.name, project.files(jarFile)) - - // Add jar file to classpath - project.sourceSets.main.compileClasspath += project.files(jarFile) - - File libraryFolder = new File(System.getProperty("user.dir"), "build/libs") - libraryFolder.mkdirs() - - // Strip version number when copying - String name = jarFile.getName() - int p = name.lastIndexOf("-") - String libName = name.substring(0, p) + ".jar" - File libraryJar = new File(libraryFolder, libName) - Files.copy(jarFile.toPath(), libraryJar.toPath(), REPLACE_EXISTING) - } - - } - - // Tell Idea about our aar configuration - PluginManager pluginManager = project.getPluginManager() - pluginManager.apply(IdeaPlugin.class) - ExtensionContainer extensions = project.getExtensions() - // IdeaModel model = extensions.getByType​(IdeaModel.class) - IdeaModel model = extensions.getByName("idea") - IdeaModule module = model.getModule() - module.scopes.PROVIDED.plus += [aarConfig] - } - - // Register aar transform - project.dependencies { - registerTransform { - from.attribute(ARTIFACT_FORMAT, aar) - to.attribute(ARTIFACT_FORMAT, jar) - artifactTransform(AarJarArtifactTransform.class) - } - } - } - - static class AarJarArtifactTransform extends ArtifactTransform { - @Override - List transform(File file) { - // println "Transforming---------------------------------" - // println outputDirectory - // println file - File explodedDir = new File(getOutputDirectory(), "exploded") - // println explodedDir - - AarExtractor aarExtractor = new AarExtractor() - aarExtractor.extract(file, explodedDir) - File classesJar = new File(new File(explodedDir, FD_JARS), FN_CLASSES_JAR) - // println classesJar - - // String[] names = file.getPath().split(Pattern.quote(File.separator)) - // print "NAMES " - // println names - // print "NAME " - // println file.getName() - // String aarName = names[names.length - 4].replace(".aar", "") - String aarName = file.getName().replace(".aar", "") - // print "AAR NAME " - // println aarName - File renamedJar = new File(getOutputDirectory(), aarName + ".jar") - renamedJar << classesJar.bytes - - return ImmutableList.of(renamedJar) - } - } -} \ No newline at end of file diff --git a/buildSrc/src/main/resources/META-INF/gradle-plugins/aar.properties b/buildSrc/src/main/resources/META-INF/gradle-plugins/aar.properties deleted file mode 100644 index 42d81af01..000000000 --- a/buildSrc/src/main/resources/META-INF/gradle-plugins/aar.properties +++ /dev/null @@ -1 +0,0 @@ -implementation-class=processing.android.ImportAar \ No newline at end of file diff --git a/core/build.gradle b/core/build.gradle deleted file mode 100644 index 512be73a3..000000000 --- a/core/build.gradle +++ /dev/null @@ -1,83 +0,0 @@ -import org.apache.tools.ant.Project -import java.nio.file.Files -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; - -plugins { - id 'aar' -} - -dependencies { - implementation name: "android" - implementationAar "androidx.legacy:legacy-support-v4:${v4legacyVersion}" - implementationAar "com.google.android.support:wearable:${wearVersion}" -} - -sourceSets { - main { - java { - srcDirs = ["src/"] - } - resources { - srcDirs = ["src/"] - } - } -} - -task sourceJar(type: Jar, dependsOn: classes) { - duplicatesStrategy = DuplicatesStrategy.INCLUDE - classifier = "sources" - from sourceSets.main.allSource -} - -// Does not work because of Processing-specific tags in source code, such as @webref -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = "javadoc" - from javadoc.destinationDir -} - -artifacts { -// archives javadocJar - archives sourceJar -} - -jar.doLast { task -> - ant.checksum file: task.archivePath -} - -clean.doFirst { - delete "dist" - delete "${coreZipPath}" -} - -compileJava.doFirst { - String[] deps = ["wearable.jar"] - for (String fn : deps) { - Files.copy(file("${rootDir}/build/libs/" + fn).toPath(), - file("${rootDir}/mode/mode/" + fn).toPath(), REPLACE_EXISTING) - } -} - -build.doLast { - // Copying core jar as zip inside the mode folder - Files.copy(file("${buildDir}/libs/core.jar").toPath(), - file("${coreZipPath}").toPath(), REPLACE_EXISTING) - // Renaming artifacts for maven publishing - Files.move(file("${buildDir}/libs/core.jar").toPath(), - file("$buildDir/libs/processing-core-${modeVersion}.jar").toPath(), REPLACE_EXISTING); - Files.move(file("${buildDir}/libs/core-sources.jar").toPath(), - file("$buildDir/libs/processing-core-${modeVersion}-sources.jar").toPath(), REPLACE_EXISTING); - Files.move(file("${buildDir}/libs/core.jar.MD5").toPath(), - file("$buildDir/libs/processing-core-${modeVersion}.jar.md5").toPath(), REPLACE_EXISTING); -} - -ext { - libName = 'processing-core' - libVersion = modeVersion - libJar = "${buildDir}/libs/${libName}-${libVersion}.jar" - libSrc = "${buildDir}/libs/${libName}-${libVersion}-sources.jar" - libMd5 = "${buildDir}/libs/${libName}-${libVersion}-sources.jar.md5" - libDependencies = [[name: 'legacy-support-v4', group: 'androidx.legacy', version: v4legacyVersion], - [name: 'wearable', group: 'com.google.android.support', version: wearVersion], - [name: 'android']] -} -apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" diff --git a/debug/apps/vrcube/src/main/java/vrcube/MainActivity.java b/debug/apps/vrcube/src/main/java/vrcube/MainActivity.java deleted file mode 100644 index 073189db3..000000000 --- a/debug/apps/vrcube/src/main/java/vrcube/MainActivity.java +++ /dev/null @@ -1,15 +0,0 @@ -package vrcube; - -import android.os.Bundle; - -import processing.vr.VRActivity; -import processing.core.PApplet; - -public class MainActivity extends VRActivity { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - PApplet sketch = new Sketch(); - setSketch(sketch); - } -} \ No newline at end of file diff --git a/debug/build.gradle b/debug/build.gradle deleted file mode 100644 index 5906cc6d9..000000000 --- a/debug/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:4.1.3' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - } -} - -allprojects { - repositories { - // This was was added to address an issue in JCenter with some Android packages (https://stackoverflow.com/questions/50563338/could-not-find-runtime-jar-android-arch-lifecycleruntime1-0-0/50564224). - // JCenter is no longer used but keep it just in case. - maven { url "https://maven.google.com" } - - // Apparently needed by AndroidX dependencies - maven { url "https://jitpack.io" } - - // Needed to get google-vr dependencies - maven { url 'https://repo.gradle.org/gradle/libs-releases' } - - mavenCentral() - google() - - google() - mavenCentral() - } -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/debug/gradle.properties b/debug/gradle.properties deleted file mode 100644 index 84242e19d..000000000 --- a/debug/gradle.properties +++ /dev/null @@ -1,15 +0,0 @@ -## For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx1024m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -# -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true -#Wed Dec 30 11:02:34 EST 2020 -android.enableJetifier=true -android.useAndroidX=true diff --git a/debug/libs/processing-ar/AndroidManifest.xml b/debug/libs/processing-ar/AndroidManifest.xml deleted file mode 100755 index 8c707a40f..000000000 --- a/debug/libs/processing-ar/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/debug/libs/processing-ar/build.gradle b/debug/libs/processing-ar/build.gradle deleted file mode 100755 index 9974ed113..000000000 --- a/debug/libs/processing-ar/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 29 - defaultConfig { - minSdkVersion 19 - targetSdkVersion 29 - } - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['../../../mode/libraries/ar/src'] - assets.srcDirs = ['../../../mode/libraries/ar/src/assets'] - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - productFlavors { - } -} - -dependencies { - implementation project(':libs:processing-core') - implementation 'com.google.ar:core:1.22.0' -} \ No newline at end of file diff --git a/debug/libs/processing-ar/gradle.properties b/debug/libs/processing-ar/gradle.properties deleted file mode 100755 index 0b8af424f..000000000 --- a/debug/libs/processing-ar/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -POM_NAME=Processing for Android AR Library -POM_ARTIFACT_ID=processing-ar -POM_PACKAGING=aar -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/debug/libs/processing-ar/project.properties b/debug/libs/processing-ar/project.properties deleted file mode 100755 index 91d2b0246..000000000 --- a/debug/libs/processing-ar/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-19 -android.library=true diff --git a/debug/libs/processing-core/AndroidManifest.xml b/debug/libs/processing-core/AndroidManifest.xml deleted file mode 100755 index 5587f2ed2..000000000 --- a/debug/libs/processing-core/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/debug/libs/processing-core/build.gradle b/debug/libs/processing-core/build.gradle deleted file mode 100644 index beadab8b9..000000000 --- a/debug/libs/processing-core/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 29 - defaultConfig { - minSdkVersion 17 - targetSdkVersion 29 - } - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['../../../core/src'] - assets.srcDirs = ['../../../core/src/assets'] - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - productFlavors { - } -} - -dependencies { - implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'com.google.android.support:wearable:2.8.1' - compileOnly 'com.google.android.wearable:wearable:2.8.1' -} \ No newline at end of file diff --git a/debug/libs/processing-core/gradle.properties b/debug/libs/processing-core/gradle.properties deleted file mode 100755 index 7420d96aa..000000000 --- a/debug/libs/processing-core/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -POM_NAME=Processing for Android Core Library -POM_ARTIFACT_ID=processing-core -POM_PACKAGING=aar -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/debug/libs/processing-core/project.properties b/debug/libs/processing-core/project.properties deleted file mode 100755 index 36f15941e..000000000 --- a/debug/libs/processing-core/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-15 -android.library=true diff --git a/debug/libs/processing-vr/AndroidManifest.xml b/debug/libs/processing-vr/AndroidManifest.xml deleted file mode 100755 index bd9f8c46f..000000000 --- a/debug/libs/processing-vr/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/debug/libs/processing-vr/build.gradle b/debug/libs/processing-vr/build.gradle deleted file mode 100644 index 81b91cbd0..000000000 --- a/debug/libs/processing-vr/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 29 - defaultConfig { - minSdkVersion 19 - targetSdkVersion 29 - } - sourceSets { - main { - manifest.srcFile 'AndroidManifest.xml' - java.srcDirs = ['../../../mode/libraries/vr/src'] - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - productFlavors { - } -} - -dependencies { - implementation project(':libs:processing-core') - implementation 'com.google.vr:sdk-audio:1.180.0' - implementation 'com.google.vr:sdk-base:1.180.0' -} \ No newline at end of file diff --git a/debug/libs/processing-vr/gradle.properties b/debug/libs/processing-vr/gradle.properties deleted file mode 100755 index 66fa090a2..000000000 --- a/debug/libs/processing-vr/gradle.properties +++ /dev/null @@ -1,5 +0,0 @@ -POM_NAME=Processing for Android VR Library -POM_ARTIFACT_ID=processing-vr -POM_PACKAGING=aar -android.enableJetifier=true -android.useAndroidX=true \ No newline at end of file diff --git a/debug/libs/processing-vr/project.properties b/debug/libs/processing-vr/project.properties deleted file mode 100755 index 91d2b0246..000000000 --- a/debug/libs/processing-vr/project.properties +++ /dev/null @@ -1,15 +0,0 @@ -# This file is automatically generated by Android Tools. -# Do not modify this file -- YOUR CHANGES WILL BE ERASED! -# -# This file must be checked in Version Control Systems. -# -# To customize properties used by the Ant build system edit -# "ant.properties", and override values to adapt the script to your -# project structure. -# -# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): -#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt - -# Project target. -target=android-19 -android.library=true diff --git a/debug/settings.gradle b/debug/settings.gradle deleted file mode 100644 index 6ea6f5dc0..000000000 --- a/debug/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':apps:simple', ':apps:wallpaper', ':apps:vrcube', ':apps:arscene', ':apps:watchface', ':apps:fast2d', ':libs:processing-core', ':libs:processing-vr', ':libs:processing-ar' \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index e708b1c02..41d9927a4 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d9132e..d6e308a63 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 4f906e0c8..f5feea6d6 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,69 +15,104 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +122,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,88 +133,120 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. # For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=`expr $i + 1` + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/libs/google-vr/build.gradle b/libs/google-vr/build.gradle new file mode 100644 index 000000000..9d7c8f77b --- /dev/null +++ b/libs/google-vr/build.gradle @@ -0,0 +1,7 @@ +// Dummy Gradle project to be able to import local aar files: +// https://stackoverflow.com/a/60888941 + +configurations.maybeCreate("default") +artifacts.add("default", file('sdk-base-1.180.0.aar')) +artifacts.add("default", file('sdk-common-1.180.0.aar')) +artifacts.add("default", file('sdk-audio-1.180.0.aar')) diff --git a/libs/google-vr/sdk-audio-1.180.0.aar b/libs/google-vr/sdk-audio-1.180.0.aar new file mode 100644 index 000000000..007485cf4 Binary files /dev/null and b/libs/google-vr/sdk-audio-1.180.0.aar differ diff --git a/libs/google-vr/sdk-base-1.180.0.aar b/libs/google-vr/sdk-base-1.180.0.aar new file mode 100644 index 000000000..e9047d226 Binary files /dev/null and b/libs/google-vr/sdk-base-1.180.0.aar differ diff --git a/libs/google-vr/sdk-common-1.180.0.aar b/libs/google-vr/sdk-common-1.180.0.aar new file mode 100644 index 000000000..7ba5cff92 Binary files /dev/null and b/libs/google-vr/sdk-common-1.180.0.aar differ diff --git a/libs/processing-ar/build.gradle b/libs/processing-ar/build.gradle new file mode 100755 index 000000000..f0681e6de --- /dev/null +++ b/libs/processing-ar/build.gradle @@ -0,0 +1,29 @@ +plugins { + id 'com.android.library' +} + +android { + namespace "processing.ar" + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 33 + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + implementation project(':libs:processing-core') + implementation 'com.google.ar:core:1.35.0' +} \ No newline at end of file diff --git a/libs/processing-ar/proguard-rules.pro b/libs/processing-ar/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/libs/processing-ar/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/libs/processing-ar/src/main/AndroidManifest.xml b/libs/processing-ar/src/main/AndroidManifest.xml new file mode 100755 index 000000000..97330b776 --- /dev/null +++ b/libs/processing-ar/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/mode/libraries/ar/src/assets/shaders/ARLightFrag.glsl b/libs/processing-ar/src/main/assets/shaders/ARLightFrag.glsl similarity index 100% rename from mode/libraries/ar/src/assets/shaders/ARLightFrag.glsl rename to libs/processing-ar/src/main/assets/shaders/ARLightFrag.glsl diff --git a/mode/libraries/ar/src/assets/shaders/ARLightVert.glsl b/libs/processing-ar/src/main/assets/shaders/ARLightVert.glsl similarity index 100% rename from mode/libraries/ar/src/assets/shaders/ARLightVert.glsl rename to libs/processing-ar/src/main/assets/shaders/ARLightVert.glsl diff --git a/mode/libraries/ar/src/assets/shaders/ARTexLightFrag.glsl b/libs/processing-ar/src/main/assets/shaders/ARTexLightFrag.glsl similarity index 100% rename from mode/libraries/ar/src/assets/shaders/ARTexLightFrag.glsl rename to libs/processing-ar/src/main/assets/shaders/ARTexLightFrag.glsl diff --git a/mode/libraries/ar/src/assets/shaders/ARTexLightVert.glsl b/libs/processing-ar/src/main/assets/shaders/ARTexLightVert.glsl similarity index 100% rename from mode/libraries/ar/src/assets/shaders/ARTexLightVert.glsl rename to libs/processing-ar/src/main/assets/shaders/ARTexLightVert.glsl diff --git a/mode/libraries/ar/src/assets/shaders/BackgroundFrag.glsl b/libs/processing-ar/src/main/assets/shaders/BackgroundFrag.glsl similarity index 100% rename from mode/libraries/ar/src/assets/shaders/BackgroundFrag.glsl rename to libs/processing-ar/src/main/assets/shaders/BackgroundFrag.glsl diff --git a/mode/libraries/ar/src/assets/shaders/BackgroundVert.glsl b/libs/processing-ar/src/main/assets/shaders/BackgroundVert.glsl similarity index 100% rename from mode/libraries/ar/src/assets/shaders/BackgroundVert.glsl rename to libs/processing-ar/src/main/assets/shaders/BackgroundVert.glsl diff --git a/mode/libraries/ar/src/processing/ar/ARAnchor.java b/libs/processing-ar/src/main/java/processing/ar/ARAnchor.java similarity index 100% rename from mode/libraries/ar/src/processing/ar/ARAnchor.java rename to libs/processing-ar/src/main/java/processing/ar/ARAnchor.java diff --git a/mode/libraries/ar/src/processing/ar/ARGraphics.java b/libs/processing-ar/src/main/java/processing/ar/ARGraphics.java similarity index 60% rename from mode/libraries/ar/src/processing/ar/ARGraphics.java rename to libs/processing-ar/src/main/java/processing/ar/ARGraphics.java index fc31e12ae..3cdfba0b9 100644 --- a/mode/libraries/ar/src/processing/ar/ARGraphics.java +++ b/libs/processing-ar/src/main/java/processing/ar/ARGraphics.java @@ -3,7 +3,7 @@ /* Part of the Processing project - http://processing.org - Copyright (c) 2019 The Processing Foundation + Copyright (c) 2019-23 The Processing Foundation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -25,11 +25,14 @@ import android.view.SurfaceHolder; import com.google.ar.core.Anchor; +import com.google.ar.core.AugmentedImage; import com.google.ar.core.HitResult; import com.google.ar.core.Plane; import com.google.ar.core.Pose; import com.google.ar.core.Trackable; import com.google.ar.core.TrackingState; +import com.google.ar.core.Config; +import com.google.ar.core.Session; import java.net.URL; import java.nio.FloatBuffer; @@ -54,6 +57,7 @@ public class ARGraphics extends PGraphics3D { static protected final int PLANE_CEILING = 1; static protected final int PLANE_WALL = 2; static protected final int POINT = 3; + static protected final int IMAGE = 4; static protected final int TRACKING = 0; static protected final int PAUSED = 1; @@ -70,12 +74,12 @@ public class ARGraphics extends PGraphics3D { protected float[] colorCorrection = new float[4]; protected ArrayList trackers = new ArrayList(); - protected ArrayList trackPlanes = new ArrayList(); - protected HashMap trackMatrices = new HashMap(); - protected HashMap trackIds = new HashMap(); + protected ArrayList trackObjects = new ArrayList(); + protected HashMap trackMatrices = new HashMap(); + protected HashMap trackIds = new HashMap(); protected HashMap trackIdx = new HashMap(); - protected ArrayList newPlanes = new ArrayList(); + protected ArrayList newObjects = new ArrayList(); protected ArrayList delAnchors = new ArrayList(); protected HashMap anchors = new HashMap(); @@ -98,6 +102,7 @@ public class ARGraphics extends PGraphics3D { protected PShader arLightShader; protected PShader arTexlightShader; + public ARGraphics() { } @@ -120,6 +125,14 @@ protected PGL createPGL(PGraphicsOpenGL pGraphicsOpenGL) { } + @Override + public void eye() { + super.ortho(0, width, -height, 0, -1, +1); + + eyeDist = 1; + resetMatrix(); + } + @Override public void beginDraw() { super.beginDraw(); @@ -210,13 +223,12 @@ public void removeTracker(ARTracker tracker) { public int trackableCount() { - return trackPlanes.size(); + return trackObjects.size(); } - public int trackableId(int i) { - return trackIds.get(trackPlanes.get(i)); + return trackIds.get(trackObjects.get(i)); } @@ -224,45 +236,72 @@ public int trackableIndex(int id) { return trackIdx.get(id); } + + public String trackableName(int i) { + Trackable track = trackObjects.get(i); + if (track instanceof AugmentedImage) { + AugmentedImage img = ((AugmentedImage)track); + return img.getName(); + } + return null; + } + + public int trackableType(int i) { - Plane plane = trackPlanes.get(i); - if (plane.getType() == Plane.Type.HORIZONTAL_UPWARD_FACING) { - return PLANE_FLOOR; - } else if (plane.getType() == Plane.Type.HORIZONTAL_DOWNWARD_FACING) { - return PLANE_CEILING; - } else if (plane.getType() == Plane.Type.VERTICAL) { - return PLANE_WALL; + Trackable track = trackObjects.get(i); + if (track instanceof Plane) { + Plane plane = (Plane)track; + if (plane.getType() == Plane.Type.HORIZONTAL_UPWARD_FACING) { + return PLANE_FLOOR; + } else if (plane.getType() == Plane.Type.HORIZONTAL_DOWNWARD_FACING) { + return PLANE_CEILING; + } else if (plane.getType() == Plane.Type.VERTICAL) { + return PLANE_WALL; + } + } else if (track instanceof AugmentedImage) { + return IMAGE; } return UNKNOWN; } + public int trackableStatus(int i) { - Plane plane = trackPlanes.get(i); - if (plane.getTrackingState() == TrackingState.PAUSED) { + Trackable track = trackObjects.get(i); + if (track.getTrackingState() == TrackingState.PAUSED) { return PAUSED; - } else if (plane.getTrackingState() == TrackingState.TRACKING) { + } else if (track.getTrackingState() == TrackingState.TRACKING) { return TRACKING; - } else if (plane.getTrackingState() == TrackingState.STOPPED) { + } else if (track.getTrackingState() == TrackingState.STOPPED) { return STOPPED; } return UNKNOWN; } + public boolean trackableNew(int i) { - Plane plane = trackPlanes.get(i); - return newPlanes.contains(plane); + Trackable track = trackObjects.get(i); + return newObjects.contains(track); } + public boolean trackableSelected(int i, int mx, int my) { - Plane planei = trackPlanes.get(i); + Trackable tracki = trackObjects.get(i); for (HitResult hit : surfar.frame.hitTest(mx, my)) { Trackable trackable = hit.getTrackable(); + Pose hitPose = hit.getHitPose(); if (trackable instanceof Plane) { Plane plane = (Plane)trackable; - if (planei.equals(plane) && plane.isPoseInPolygon(hit.getHitPose())) { + if (tracki.equals(plane) && plane.isPoseInPolygon(hitPose)) { return true; } - } + } else if (trackable instanceof AugmentedImage) { + AugmentedImage image = (AugmentedImage)trackable; + Pose anchorPose = image.getCenterPose(); + Pose localHitPose = anchorPose.compose(hitPose); + if (tracki.equals(image) && isPoseInsideAugmentedImage(localHitPose, image)) { + return true; + } + } } return false; } @@ -271,49 +310,114 @@ public boolean trackableSelected(int i, int mx, int my) { protected HitResult getHitResult(int mx, int my) { for (HitResult hit : surfar.frame.hitTest(mx, my)) { Trackable trackable = hit.getTrackable(); + Pose hitPose = hit.getHitPose(); if (trackable instanceof Plane) { Plane plane = (Plane)trackable; - if (trackPlanes.contains(plane) && plane.isPoseInPolygon(hit.getHitPose())) { + if (trackObjects.contains(plane) && plane.isPoseInPolygon(hitPose)) { return hit; } + } else if (trackable instanceof AugmentedImage) { + AugmentedImage image = (AugmentedImage)trackable; + Pose anchorPose = image.getCenterPose(); + Pose localHitPose = anchorPose.compose(hitPose); + if (trackObjects.contains(image) && isPoseInsideAugmentedImage(localHitPose, image)) { + return hit; + } } } return null; } + + private boolean isPoseInsideAugmentedImage(Pose pose, AugmentedImage image) { + // Get the four corners of the AugmentedImage's defining rectangle + float[] corners = new float[16]; + image.getCenterPose().toMatrix(corners, 0); + + // Define the vertices of the rectangle in 2D (assuming the image is flat on the XZ plane) + float imageMinX = Float.POSITIVE_INFINITY; + float imageMaxX = Float.NEGATIVE_INFINITY; + float imageMinZ = Float.POSITIVE_INFINITY; + float imageMaxZ = Float.NEGATIVE_INFINITY; + + // Extract the X and Z coordinates of the corners + for (int i = 0; i < 8; i += 2) { + float cornerX = corners[i]; + float cornerZ = corners[i + 2]; + + if (cornerX < imageMinX) { + imageMinX = cornerX; + } + if (cornerX > imageMaxX) { + imageMaxX = cornerX; + } + if (cornerZ < imageMinZ) { + imageMinZ = cornerZ; + } + if (cornerZ > imageMaxZ) { + imageMaxZ = cornerZ; + } + } + + // Check if the Pose's position (X, Z) is within the bounds of the AugmentedImage's rectangle + float poseX = pose.tx(); + float poseZ = pose.tz(); + return (imageMinX <= poseX && poseX <= imageMaxX && imageMinZ <= poseZ && poseZ <= imageMaxZ); + } + + protected int getTrackable(HitResult hit) { - Plane plane = (Plane) hit.getTrackable(); - return trackPlanes.indexOf(plane); + Trackable track = hit.getTrackable(); + return trackObjects.indexOf(track); } + public float[] getTrackablePolygon(int i) { return getTrackablePolygon(i, null); } public float[] getTrackablePolygon(int i, float[] points) { - Plane plane = trackPlanes.get(i); - FloatBuffer buffer = plane.getPolygon(); - buffer.rewind(); - if (points == null || points.length < buffer.capacity()) { - points = new float[buffer.capacity()]; + Trackable track = trackObjects.get(i); + if (track instanceof Plane) { + Plane plane = (Plane)track; + FloatBuffer buffer = plane.getPolygon(); + buffer.rewind(); + if (points == null || points.length < buffer.capacity()) { + points = new float[buffer.capacity()]; + } + buffer.get(points, 0, buffer.capacity()); + } else if (track instanceof AugmentedImage) { + AugmentedImage image = (AugmentedImage)track; + points = new float[8]; + image.getCenterPose().toMatrix(points, 0); } - buffer.get(points, 0, buffer.capacity()); return points; } public float getTrackableExtentX(int i) { - Plane plane = trackPlanes.get(i); - return plane.getExtentX(); + Trackable track = trackObjects.get(i); + if (track instanceof Plane) { + return ((Plane)track).getExtentX(); + } else if (track instanceof AugmentedImage) { + return ((AugmentedImage)track).getExtentX(); + } + return -1; } public float getTrackableExtentZ(int i) { - Plane plane = trackPlanes.get(i); - return plane.getExtentZ(); + Trackable track = trackObjects.get(i); + if (track instanceof Plane) { + return ((Plane)track).getExtentZ(); + } else if (track instanceof AugmentedImage) { + return ((AugmentedImage)track).getExtentZ(); + } + return -1; } + public PMatrix3D getTrackableMatrix(int i) { return getTrackableMatrix(i, null); } @@ -324,7 +428,7 @@ public PMatrix3D getTrackableMatrix(int i, PMatrix3D target) { target = new PMatrix3D(); } - Plane plane = trackPlanes.get(i); + Plane plane = (Plane)trackObjects.get(i); float[] mat = trackMatrices.get(plane); target.set(mat[0], mat[4], mat[8], mat[12], mat[1], mat[5], mat[9], mat[13], @@ -336,27 +440,45 @@ public PMatrix3D getTrackableMatrix(int i, PMatrix3D target) { public int createAnchor(int i, float x, float y, float z) { - Plane plane = trackPlanes.get(i); - Pose planePose = plane.getCenterPose(); - pointIn[0] = x; - pointIn[1] = y; - pointIn[2] = z; - planePose.transformPoint(pointIn, 0, pointOut, 0); - Pose anchorPose = Pose.makeTranslation(pointOut); - Anchor anchor = plane.createAnchor(anchorPose); - anchors.put(++lastAnchorId, anchor); - return lastAnchorId; + Trackable track = trackObjects.get(i); + Pose centerPose = null; + if (track instanceof Plane) { + Plane plane = (Plane)track; + centerPose = plane.getCenterPose(); + } else if (track instanceof AugmentedImage) { + AugmentedImage img = (AugmentedImage)track; + centerPose = img.getCenterPose(); + } + if (centerPose != null) { + pointIn[0] = x; + pointIn[1] = y; + pointIn[2] = z; + centerPose.transformPoint(pointIn, 0, pointOut, 0); + Pose anchorPose = Pose.makeTranslation(pointOut); + Anchor anchor = track.createAnchor(anchorPose); + anchors.put(++lastAnchorId, anchor); + return lastAnchorId; + } + return -1; } public int createAnchor(int mx, int my) { for (HitResult hit : surfar.frame.hitTest(mx, my)) { Trackable trackable = hit.getTrackable(); + Pose hitPose = hit.getHitPose(); if (trackable instanceof Plane) { Plane plane = (Plane)trackable; - if (trackPlanes.contains(plane) && plane.isPoseInPolygon(hit.getHitPose())) { + if (trackObjects.contains(plane) && plane.isPoseInPolygon(hitPose)) { return createAnchor(hit); } + } else if (trackable instanceof AugmentedImage) { + AugmentedImage image = (AugmentedImage)trackable; + Pose anchorPose = image.getCenterPose(); + Pose localHitPose = anchorPose.compose(hitPose); + if (trackObjects.contains(image) && isPoseInsideAugmentedImage(localHitPose, image)) { + return createAnchor(hit); + } } } return 0; @@ -428,10 +550,12 @@ protected void createBackgroundRenderer() { backgroundRenderer = new BackgroundRenderer(surfar.getActivity()); } + protected void setCameraTexture() { surfar.session.setCameraTextureName(backgroundRenderer.getTextureId()); } + protected void updateMatrices() { surfar.camera.getProjectionMatrix(projMatrix, 0, 0.1f, 100.0f); surfar.camera.getViewMatrix(viewMatrix, 0); @@ -442,48 +566,73 @@ protected void updateMatrices() { protected void updateTrackables() { Collection planes = surfar.frame.getUpdatedTrackables(Plane.class); for (Plane plane: planes) { - if (plane.getSubsumedBy() != null) continue; - float[] mat; - if (trackMatrices.containsKey(plane)) { - mat = trackMatrices.get(plane); - } else { - mat = new float[16]; - trackMatrices.put(plane, mat); - trackPlanes.add(plane); - trackIds.put(plane, ++lastTrackableId); - newPlanes.add(plane); - } - Pose pose = plane.getCenterPose(); - pose.toMatrix(mat, 0); + addNewPlane(plane); + } + + Collection images = surfar.frame.getUpdatedTrackables(AugmentedImage.class); + for (AugmentedImage image: images) { + addNewImage(image); } // Remove stopped and subsummed trackables - for (int i = trackPlanes.size() - 1; i >= 0; i--) { - Plane plane = trackPlanes.get(i); - if (plane.getTrackingState() == TrackingState.STOPPED || plane.getSubsumedBy() != null) { - trackPlanes.remove(i); - trackMatrices.remove(plane); - int pid = trackIds.remove(plane); - trackIdx.remove(pid); - for (ARTracker t: trackers) t.remove(pid); + for (int i = trackObjects.size() - 1; i >= 0; i--) { + Trackable track = trackObjects.get(i); + if (track instanceof Plane) { + Plane plane = (Plane)track; + if (plane.getTrackingState() == TrackingState.STOPPED || plane.getSubsumedBy() != null) { + trackObjects.remove(i); + trackMatrices.remove(plane); + int pid = trackIds.remove(plane); + trackIdx.remove(pid); + for (ARTracker t: trackers) t.remove(pid); + } } } // Update indices - for (int i = 0; i < trackPlanes.size(); i++) { - Plane plane = trackPlanes.get(i); - int pid = trackIds.get(plane); + for (int i = 0; i < trackObjects.size(); i++) { + Trackable track = trackObjects.get(i); + int pid = trackIds.get(track); trackIdx.put(pid, i); - if (newPlanes.contains(plane)) { + if (newObjects.contains(track)) { for (ARTracker t: trackers) t.create(i); } } } - protected void cleanup() { - newPlanes.clear(); + protected void addNewPlane(Plane plane) { + if (plane.getSubsumedBy() != null) return; + float[] mat = addNewMatrix(plane); + Pose pose = plane.getCenterPose(); + if (pose != null) pose.toMatrix(mat, 0); + } + + + protected void addNewImage(AugmentedImage image) { + float[] mat = addNewMatrix(image); + Pose pose = image.getCenterPose(); + if (pose != null) pose.toMatrix(mat, 0); + } + + protected float[] addNewMatrix(Trackable obj) { + float[] mat; + if (trackMatrices.containsKey(obj)) { + mat = trackMatrices.get(obj); + } else { + mat = new float[16]; + trackMatrices.put(obj, mat); + trackObjects.add(obj); + trackIds.put(obj, ++lastTrackableId); + newObjects.add(obj); + } + return mat; + } + + + protected void cleanup() { + newObjects.clear(); for (int id: delAnchors) { Anchor anchor = anchors.remove(id); anchor.detach(); diff --git a/mode/libraries/ar/src/processing/ar/ARSurface.java b/libs/processing-ar/src/main/java/processing/ar/ARSurface.java similarity index 100% rename from mode/libraries/ar/src/processing/ar/ARSurface.java rename to libs/processing-ar/src/main/java/processing/ar/ARSurface.java diff --git a/mode/libraries/ar/src/processing/ar/ARTrackable.java b/libs/processing-ar/src/main/java/processing/ar/ARTrackable.java similarity index 91% rename from mode/libraries/ar/src/processing/ar/ARTrackable.java rename to libs/processing-ar/src/main/java/processing/ar/ARTrackable.java index cddf64147..c939b95d8 100644 --- a/mode/libraries/ar/src/processing/ar/ARTrackable.java +++ b/libs/processing-ar/src/main/java/processing/ar/ARTrackable.java @@ -30,15 +30,17 @@ public class ARTrackable { protected ARGraphics g; protected HitResult hit; + private String name; private int id; private PMatrix3D m; private float[] points; - public ARTrackable(ARGraphics g, int id) { + public ARTrackable(ARGraphics g, int id, String name) { this.g = g; this.id = id; + this.name = name; } - + public String id() { return String.valueOf(id); } @@ -48,7 +50,7 @@ public PMatrix3D matrix() { m = g.getTrackableMatrix(idx, m); return m; } - + public void transform() { g.applyMatrix(matrix()); } @@ -59,23 +61,23 @@ public float[] getPolygon() { return points; } - public float lengthX() { int idx = g.trackableIndex(id); return g.getTrackableExtentX(idx); } - public float lengthY() { return 0; } - public float lengthZ() { int idx = g.trackableIndex(id); return g.getTrackableExtentZ(idx); } + public String getName() { + return name; + } public boolean isSelected(int mx, int my) { int idx = g.trackableIndex(id); @@ -115,6 +117,11 @@ public boolean isFloorPlane() { return g.trackableType(idx) == ARGraphics.PLANE_FLOOR; } + public boolean isImage(){ + int idx = g.trackableIndex(id); + return g.trackableType(idx)== ARGraphics.IMAGE; + } + public boolean isCeilingPlane() { int idx = g.trackableIndex(id); return g.trackableType(idx) == ARGraphics.PLANE_CEILING; diff --git a/mode/libraries/ar/src/processing/ar/ARTracker.java b/libs/processing-ar/src/main/java/processing/ar/ARTracker.java similarity index 77% rename from mode/libraries/ar/src/processing/ar/ARTracker.java rename to libs/processing-ar/src/main/java/processing/ar/ARTracker.java index 9a27fdfda..9beb70bd7 100644 --- a/mode/libraries/ar/src/processing/ar/ARTracker.java +++ b/libs/processing-ar/src/main/java/processing/ar/ARTracker.java @@ -22,7 +22,12 @@ package processing.ar; +import android.graphics.Bitmap; + import com.google.ar.core.HitResult; +import com.google.ar.core.AugmentedImageDatabase; +import com.google.ar.core.Config; +import com.google.ar.core.Session; import java.lang.reflect.Method; import java.util.ArrayList; @@ -31,10 +36,12 @@ import java.util.Set; import processing.core.PApplet; +import processing.core.PImage; public class ARTracker { protected PApplet p; protected ARGraphics g; + protected AugmentedImageDatabase db; private HashMap trackables = new HashMap(); private ArrayList toRemove = new ArrayList(); @@ -42,10 +49,37 @@ public class ARTracker { public ARTracker(PApplet parent) { this.p = parent; - this.g = (ARGraphics) p.g; + this.g = (ARGraphics)p.g; setEventHandler(); } + public void addImage(String name, PImage img) { + addImageImp(name, img, null); + } + + public void addImage(String name, PImage img, float size) { + addImageImp(name, img, size); + } + + private void addImageImp(String name, PImage img, Float size) { + if (db == null) { + // Creating a new database of augmented images. + db = new AugmentedImageDatabase(g.surfar.session); + } + + Bitmap bitmap = (Bitmap)img.getNative(); + if (size != null) { + db.addImage(name, bitmap, size); + } else { + db.addImage(name, bitmap); + } + + // Reset the session config with the updated image database + Config config = new Config(g.surfar.session); + config.setAugmentedImageDatabase(db); + g.surfar.session.configure(config); + } + public void start() { cleanup(); g.addTracker(this); @@ -61,9 +95,10 @@ public int count() { public ARTrackable get(int idx) { int id = g.trackableId(idx); + String name = g.trackableName(idx); String sid = String.valueOf(id); if (!trackables.containsKey(sid)) { - ARTrackable t = new ARTrackable(g, id); + ARTrackable t = new ARTrackable(g, id, name); trackables.put(sid, t); } return get(sid); @@ -128,7 +163,6 @@ protected void remove(String id) { trackables.remove(id); } - protected void setEventHandler() { try { trackableEventMethod = p.getClass().getMethod("trackableEvent", ARTrackable.class); diff --git a/mode/libraries/ar/src/processing/ar/BackgroundRenderer.java b/libs/processing-ar/src/main/java/processing/ar/BackgroundRenderer.java similarity index 100% rename from mode/libraries/ar/src/processing/ar/BackgroundRenderer.java rename to libs/processing-ar/src/main/java/processing/ar/BackgroundRenderer.java diff --git a/mode/libraries/ar/src/processing/ar/RotationHandler.java b/libs/processing-ar/src/main/java/processing/ar/RotationHandler.java similarity index 77% rename from mode/libraries/ar/src/processing/ar/RotationHandler.java rename to libs/processing-ar/src/main/java/processing/ar/RotationHandler.java index cece970cc..e11c4b8e3 100644 --- a/mode/libraries/ar/src/processing/ar/RotationHandler.java +++ b/libs/processing-ar/src/main/java/processing/ar/RotationHandler.java @@ -18,15 +18,16 @@ public class RotationHandler implements DisplayManager.DisplayListener { public RotationHandler(Context context) { this.context = context; - display = context.getSystemService(WindowManager.class).getDefaultDisplay(); + WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); + display = windowManager.getDefaultDisplay(); } public void onResume() { - context.getSystemService(DisplayManager.class).registerDisplayListener(this, null); + ((DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE)).registerDisplayListener(this, null); } public void onPause() { - context.getSystemService(DisplayManager.class).unregisterDisplayListener(this); + ((DisplayManager) context.getSystemService(Context.DISPLAY_SERVICE)).unregisterDisplayListener(this); } public void onSurfaceChanged(int width, int height) { @@ -59,4 +60,4 @@ public void onDisplayRemoved(int displayId) { public void onDisplayChanged(int displayId) { viewportChanged = true; } -} +} \ No newline at end of file diff --git a/mode/libraries/ar/src/processing/ar/ShaderUtils.java b/libs/processing-ar/src/main/java/processing/ar/ShaderUtils.java similarity index 100% rename from mode/libraries/ar/src/processing/ar/ShaderUtils.java rename to libs/processing-ar/src/main/java/processing/ar/ShaderUtils.java diff --git a/libs/processing-core/build.gradle b/libs/processing-core/build.gradle new file mode 100644 index 000000000..b7952ec4d --- /dev/null +++ b/libs/processing-core/build.gradle @@ -0,0 +1,33 @@ +plugins { + id 'com.android.library' +} + +android { + + namespace "processing.core" + + defaultConfig { + minSdkVersion 17 + targetSdkVersion 33 + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + testImplementation 'junit:junit:4.13.2' + + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.support:wearable:2.9.0' + compileOnly 'com.google.android.wearable:wearable:2.9.0' +} \ No newline at end of file diff --git a/libs/processing-core/proguard-rules.pro b/libs/processing-core/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/libs/processing-core/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/libs/processing-core/src/main/AndroidManifest.xml b/libs/processing-core/src/main/AndroidManifest.xml new file mode 100755 index 000000000..97330b776 --- /dev/null +++ b/libs/processing-core/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/core/src/assets/shaders/ColorFrag.glsl b/libs/processing-core/src/main/assets/shaders/ColorFrag.glsl similarity index 100% rename from core/src/assets/shaders/ColorFrag.glsl rename to libs/processing-core/src/main/assets/shaders/ColorFrag.glsl diff --git a/core/src/assets/shaders/ColorVert.glsl b/libs/processing-core/src/main/assets/shaders/ColorVert.glsl similarity index 100% rename from core/src/assets/shaders/ColorVert.glsl rename to libs/processing-core/src/main/assets/shaders/ColorVert.glsl diff --git a/core/src/assets/shaders/LightFrag.glsl b/libs/processing-core/src/main/assets/shaders/LightFrag.glsl similarity index 100% rename from core/src/assets/shaders/LightFrag.glsl rename to libs/processing-core/src/main/assets/shaders/LightFrag.glsl diff --git a/core/src/assets/shaders/LightVert.glsl b/libs/processing-core/src/main/assets/shaders/LightVert.glsl similarity index 100% rename from core/src/assets/shaders/LightVert.glsl rename to libs/processing-core/src/main/assets/shaders/LightVert.glsl diff --git a/core/src/assets/shaders/LineFrag.glsl b/libs/processing-core/src/main/assets/shaders/LineFrag.glsl similarity index 100% rename from core/src/assets/shaders/LineFrag.glsl rename to libs/processing-core/src/main/assets/shaders/LineFrag.glsl diff --git a/core/src/assets/shaders/LineVert.glsl b/libs/processing-core/src/main/assets/shaders/LineVert.glsl similarity index 100% rename from core/src/assets/shaders/LineVert.glsl rename to libs/processing-core/src/main/assets/shaders/LineVert.glsl diff --git a/core/src/assets/shaders/MaskFrag.glsl b/libs/processing-core/src/main/assets/shaders/MaskFrag.glsl similarity index 100% rename from core/src/assets/shaders/MaskFrag.glsl rename to libs/processing-core/src/main/assets/shaders/MaskFrag.glsl diff --git a/core/src/assets/shaders/P2DFrag.glsl b/libs/processing-core/src/main/assets/shaders/P2DFrag.glsl similarity index 100% rename from core/src/assets/shaders/P2DFrag.glsl rename to libs/processing-core/src/main/assets/shaders/P2DFrag.glsl diff --git a/core/src/assets/shaders/P2DVert.glsl b/libs/processing-core/src/main/assets/shaders/P2DVert.glsl similarity index 100% rename from core/src/assets/shaders/P2DVert.glsl rename to libs/processing-core/src/main/assets/shaders/P2DVert.glsl diff --git a/core/src/assets/shaders/PointFrag.glsl b/libs/processing-core/src/main/assets/shaders/PointFrag.glsl similarity index 100% rename from core/src/assets/shaders/PointFrag.glsl rename to libs/processing-core/src/main/assets/shaders/PointFrag.glsl diff --git a/core/src/assets/shaders/PointVert.glsl b/libs/processing-core/src/main/assets/shaders/PointVert.glsl similarity index 100% rename from core/src/assets/shaders/PointVert.glsl rename to libs/processing-core/src/main/assets/shaders/PointVert.glsl diff --git a/core/src/assets/shaders/TexFrag.glsl b/libs/processing-core/src/main/assets/shaders/TexFrag.glsl similarity index 100% rename from core/src/assets/shaders/TexFrag.glsl rename to libs/processing-core/src/main/assets/shaders/TexFrag.glsl diff --git a/core/src/assets/shaders/TexLightFrag.glsl b/libs/processing-core/src/main/assets/shaders/TexLightFrag.glsl similarity index 100% rename from core/src/assets/shaders/TexLightFrag.glsl rename to libs/processing-core/src/main/assets/shaders/TexLightFrag.glsl diff --git a/core/src/assets/shaders/TexLightVert.glsl b/libs/processing-core/src/main/assets/shaders/TexLightVert.glsl similarity index 100% rename from core/src/assets/shaders/TexLightVert.glsl rename to libs/processing-core/src/main/assets/shaders/TexLightVert.glsl diff --git a/core/src/assets/shaders/TexVert.glsl b/libs/processing-core/src/main/assets/shaders/TexVert.glsl similarity index 100% rename from core/src/assets/shaders/TexVert.glsl rename to libs/processing-core/src/main/assets/shaders/TexVert.glsl diff --git a/core/src/processing/a2d/PGraphicsAndroid2D.java b/libs/processing-core/src/main/java/processing/a2d/PGraphicsAndroid2D.java similarity index 99% rename from core/src/processing/a2d/PGraphicsAndroid2D.java rename to libs/processing-core/src/main/java/processing/a2d/PGraphicsAndroid2D.java index ed52de298..b82ced644 100644 --- a/core/src/processing/a2d/PGraphicsAndroid2D.java +++ b/libs/processing-core/src/main/java/processing/a2d/PGraphicsAndroid2D.java @@ -453,6 +453,12 @@ public void vertex(float x, float y, float z) { } + @Override + public void vertex(float[] v) { + vertex(v[X], v[Y]); + } + + @Override public void vertex(float x, float y, float u, float v) { showVariationWarning("vertex(x, y, u, v)"); diff --git a/core/src/processing/a2d/PShapeAndroid2D.java b/libs/processing-core/src/main/java/processing/a2d/PShapeAndroid2D.java similarity index 100% rename from core/src/processing/a2d/PShapeAndroid2D.java rename to libs/processing-core/src/main/java/processing/a2d/PShapeAndroid2D.java diff --git a/core/src/processing/a2d/PSurfaceAndroid2D.java b/libs/processing-core/src/main/java/processing/a2d/PSurfaceAndroid2D.java similarity index 100% rename from core/src/processing/a2d/PSurfaceAndroid2D.java rename to libs/processing-core/src/main/java/processing/a2d/PSurfaceAndroid2D.java diff --git a/core/src/processing/android/ActivityAPI.java b/libs/processing-core/src/main/java/processing/android/ActivityAPI.java similarity index 100% rename from core/src/processing/android/ActivityAPI.java rename to libs/processing-core/src/main/java/processing/android/ActivityAPI.java diff --git a/core/src/processing/android/AppComponent.java b/libs/processing-core/src/main/java/processing/android/AppComponent.java similarity index 100% rename from core/src/processing/android/AppComponent.java rename to libs/processing-core/src/main/java/processing/android/AppComponent.java diff --git a/core/src/processing/android/CompatUtils.java b/libs/processing-core/src/main/java/processing/android/CompatUtils.java similarity index 100% rename from core/src/processing/android/CompatUtils.java rename to libs/processing-core/src/main/java/processing/android/CompatUtils.java diff --git a/core/src/processing/android/PFragment.java b/libs/processing-core/src/main/java/processing/android/PFragment.java similarity index 99% rename from core/src/processing/android/PFragment.java rename to libs/processing-core/src/main/java/processing/android/PFragment.java index a6be21fbf..8fe80d72c 100644 --- a/core/src/processing/android/PFragment.java +++ b/libs/processing-core/src/main/java/processing/android/PFragment.java @@ -219,7 +219,7 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { } @Override - public boolean onOptionsItemSelected(MenuItem item){ + public boolean onOptionsItemSelected(MenuItem item) { if (sketch != null) return sketch.onOptionsItemSelected(item); return super.onOptionsItemSelected(item); } diff --git a/core/src/processing/android/PWallpaper.java b/libs/processing-core/src/main/java/processing/android/PWallpaper.java similarity index 100% rename from core/src/processing/android/PWallpaper.java rename to libs/processing-core/src/main/java/processing/android/PWallpaper.java diff --git a/core/src/processing/android/PWatchFaceCanvas.java b/libs/processing-core/src/main/java/processing/android/PWatchFaceCanvas.java similarity index 100% rename from core/src/processing/android/PWatchFaceCanvas.java rename to libs/processing-core/src/main/java/processing/android/PWatchFaceCanvas.java diff --git a/core/src/processing/android/PWatchFaceGLES.java b/libs/processing-core/src/main/java/processing/android/PWatchFaceGLES.java similarity index 98% rename from core/src/processing/android/PWatchFaceGLES.java rename to libs/processing-core/src/main/java/processing/android/PWatchFaceGLES.java index 0fae68c50..e62ab7eb4 100644 --- a/core/src/processing/android/PWatchFaceGLES.java +++ b/libs/processing-core/src/main/java/processing/android/PWatchFaceGLES.java @@ -173,9 +173,9 @@ public void onCreate(SurfaceHolder surfaceHolder) { public EGLConfig chooseEglConfig(EGLDisplay eglDisplay) { int[] numEglConfigs = new int[1]; EGLConfig[] eglConfigs = new EGLConfig[1]; - if(!EGL14.eglChooseConfig(eglDisplay, CONFIG_ATTRIB_LIST, 0, eglConfigs, 0, eglConfigs.length, numEglConfigs, 0)) { + if (!EGL14.eglChooseConfig(eglDisplay, CONFIG_ATTRIB_LIST, 0, eglConfigs, 0, eglConfigs.length, numEglConfigs, 0)) { throw new RuntimeException("eglChooseConfig failed"); - } else if(numEglConfigs[0] == 0) { + } else if (numEglConfigs[0] == 0) { throw new RuntimeException("no matching EGL configs"); } else { return eglConfigs[0]; diff --git a/core/src/processing/android/PermissionRequestor.java b/libs/processing-core/src/main/java/processing/android/PermissionRequestor.java similarity index 96% rename from core/src/processing/android/PermissionRequestor.java rename to libs/processing-core/src/main/java/processing/android/PermissionRequestor.java index 0754badc3..deac0d852 100644 --- a/core/src/processing/android/PermissionRequestor.java +++ b/libs/processing-core/src/main/java/processing/android/PermissionRequestor.java @@ -27,6 +27,7 @@ import android.support.v4.os.ResultReceiver; import androidx.core.app.ActivityCompat; +import androidx.annotation.RestrictTo; // A simple utility activity to request permissions in a service. public class PermissionRequestor extends Activity { @@ -49,6 +50,7 @@ protected void onStart() { } @Override + @SuppressWarnings("RestrictedApi") public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { Bundle resultData = new Bundle(); resultData.putStringArray(KEY_PERMISSIONS, permissions); diff --git a/core/src/processing/android/ServiceEngine.java b/libs/processing-core/src/main/java/processing/android/ServiceEngine.java similarity index 100% rename from core/src/processing/android/ServiceEngine.java rename to libs/processing-core/src/main/java/processing/android/ServiceEngine.java diff --git a/core/src/processing/core/PApplet.java b/libs/processing-core/src/main/java/processing/core/PApplet.java similarity index 99% rename from core/src/processing/core/PApplet.java rename to libs/processing-core/src/main/java/processing/core/PApplet.java index b01e9caeb..2b55cf67c 100644 --- a/core/src/processing/core/PApplet.java +++ b/libs/processing-core/src/main/java/processing/core/PApplet.java @@ -916,7 +916,7 @@ public void surfaceWindowFocusChanged(boolean hasFocus) { /** - * If you override this function without calling super.onTouchEvent(), + * If you override this function without calling super.surfaceTouchEvent(), * then motionX, motionY, motionPressed, and motionEvent will not be set. */ public boolean surfaceTouchEvent(MotionEvent event) { @@ -2283,47 +2283,56 @@ protected void nativeMotionEvent(MotionEvent motionEvent) { protected void enqueueTouchEvents(MotionEvent event, int button, int modifiers) { - int action = event.getAction(); - int actionMasked = action & MotionEvent.ACTION_MASK; - int paction = 0; + int actionMasked = event.getActionMasked(); + int pAction = 0; + int pointerUp = 0; + int pointerUpIdx = -1; switch (actionMasked) { case MotionEvent.ACTION_DOWN: - paction = TouchEvent.START; + pAction = TouchEvent.START; break; case MotionEvent.ACTION_POINTER_DOWN: - paction = TouchEvent.START; + pAction = TouchEvent.START; break; case MotionEvent.ACTION_MOVE: - paction = TouchEvent.MOVE; + pAction = TouchEvent.MOVE; break; case MotionEvent.ACTION_UP: - paction = TouchEvent.END; + pAction = TouchEvent.END; break; case MotionEvent.ACTION_POINTER_UP: - paction = TouchEvent.END; + pAction = TouchEvent.END; + pointerUp = 1; + // We get the index of the pointer that is being released: + // https://developer.android.com/reference/android/view/MotionEvent#getActionIndex() + pointerUpIdx = event.getActionIndex(); break; default: // Covers any other action value, including ACTION_CANCEL - paction = TouchEvent.CANCEL; + pAction = TouchEvent.CANCEL; break; } - if (paction == TouchEvent.START || paction == TouchEvent.END) { + if (pAction == TouchEvent.START || pAction == TouchEvent.END || pAction == TouchEvent.CANCEL) { touchPointerId = event.getPointerId(0); } - int pointerCount = event.getPointerCount(); + // getPointerCount() will return the count including the pointer that is being released, so + // we substract 1 if if this current event is a pointer up + int activePointerCount = event.getPointerCount() - pointerUp; if (actionMasked == MotionEvent.ACTION_MOVE) { // Post historical movement events, if any. int historySize = event.getHistorySize(); for (int h = 0; h < historySize; h++) { TouchEvent touchEvent = new TouchEvent(event, event.getHistoricalEventTime(h), - paction, modifiers, button); - touchEvent.setNumPointers(pointerCount); - for (int p = 0; p < pointerCount; p++) { - touchEvent.setPointer(p, event.getPointerId(p), event.getHistoricalX(p, h), event.getHistoricalY(p, h), - event.getHistoricalSize(p, h), event.getHistoricalPressure(p, h)); + pAction, modifiers, button); + touchEvent.setNumPointers(activePointerCount); + int p = 0; + for (int idx = 0; idx < event.getPointerCount(); idx++) { + if (idx == pointerUpIdx) continue; // Skip the released pointer + touchEvent.setPointer(p++, event.getPointerId(idx), event.getHistoricalX(idx, h), event.getHistoricalY(idx, h), + event.getHistoricalSize(idx, h), event.getHistoricalPressure(idx, h)); } postEvent(touchEvent); } @@ -2331,16 +2340,18 @@ protected void enqueueTouchEvents(MotionEvent event, int button, int modifiers) // Current event TouchEvent touchEvent = new TouchEvent(event, event.getEventTime(), - paction, modifiers, button); - if (actionMasked == MotionEvent.ACTION_UP) { + pAction, modifiers, button); + if (actionMasked == MotionEvent.ACTION_UP || actionMasked == MotionEvent.ACTION_CANCEL) { // Last pointer up touchEvent.setNumPointers(0); } else { // We still have some pointers left - touchEvent.setNumPointers(pointerCount); - for (int p = 0; p < event.getPointerCount(); p++) { - touchEvent.setPointer(p, event.getPointerId(p), event.getX(p), event.getY(p), - event.getSize(p), event.getPressure(p)); + touchEvent.setNumPointers(activePointerCount); + int p = 0; + for (int idx = 0; idx < event.getPointerCount(); idx++) { + if (idx == pointerUpIdx) continue; // Skip the released pointer + touchEvent.setPointer(p++, event.getPointerId(idx), event.getX(idx), event.getY(idx), + event.getSize(idx), event.getPressure(idx)); } } postEvent(touchEvent); @@ -2348,12 +2359,12 @@ protected void enqueueTouchEvents(MotionEvent event, int button, int modifiers) protected void enqueueMouseEvents(MotionEvent event, int button, int modifiers) { - int action = event.getAction(); + int actionMasked = event.getActionMasked(); int clickCount = 1; // not really set... (i.e. not catching double taps) int index; - switch (action & MotionEvent.ACTION_MASK) { + switch (actionMasked) { case MotionEvent.ACTION_DOWN: mousePointerId = event.getPointerId(0); postEvent(new MouseEvent(event, event.getEventTime(), @@ -6585,7 +6596,7 @@ static final public boolean parseBoolean(float what) { * @return true if 'what' is "true" or "TRUE", false otherwise */ static final public boolean parseBoolean(String what) { - return new Boolean(what).booleanValue(); + return Boolean.valueOf(what); } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @@ -6643,7 +6654,7 @@ static final public boolean[] parseBoolean(float what[]) { static final public boolean[] parseBoolean(String what[]) { boolean outgoing[] = new boolean[what.length]; for (int i = 0; i < what.length; i++) { - outgoing[i] = new Boolean(what[i]).booleanValue(); + outgoing[i] = Boolean.valueOf(what[i]); } return outgoing; } @@ -6932,7 +6943,7 @@ static final public float parseFloat(String what) { static final public float parseFloat(String what, float otherwise) { try { - return new Float(what).floatValue(); + return Float.valueOf(what); } catch (NumberFormatException e) { } return otherwise; @@ -6982,7 +6993,7 @@ static final public float[] parseFloat(String what[], float missing) { float output[] = new float[what.length]; for (int i = 0; i < what.length; i++) { try { - output[i] = new Float(what[i]).floatValue(); + output[i] = Float.valueOf(what[i]); } catch (NumberFormatException e) { output[i] = missing; } diff --git a/core/src/processing/core/PConstants.java b/libs/processing-core/src/main/java/processing/core/PConstants.java similarity index 100% rename from core/src/processing/core/PConstants.java rename to libs/processing-core/src/main/java/processing/core/PConstants.java diff --git a/core/src/processing/core/PFont.java b/libs/processing-core/src/main/java/processing/core/PFont.java similarity index 100% rename from core/src/processing/core/PFont.java rename to libs/processing-core/src/main/java/processing/core/PFont.java diff --git a/core/src/processing/core/PGraphics.java b/libs/processing-core/src/main/java/processing/core/PGraphics.java similarity index 100% rename from core/src/processing/core/PGraphics.java rename to libs/processing-core/src/main/java/processing/core/PGraphics.java diff --git a/core/src/processing/core/PImage.java b/libs/processing-core/src/main/java/processing/core/PImage.java similarity index 100% rename from core/src/processing/core/PImage.java rename to libs/processing-core/src/main/java/processing/core/PImage.java diff --git a/core/src/processing/core/PMatrix.java b/libs/processing-core/src/main/java/processing/core/PMatrix.java similarity index 100% rename from core/src/processing/core/PMatrix.java rename to libs/processing-core/src/main/java/processing/core/PMatrix.java diff --git a/core/src/processing/core/PMatrix2D.java b/libs/processing-core/src/main/java/processing/core/PMatrix2D.java similarity index 100% rename from core/src/processing/core/PMatrix2D.java rename to libs/processing-core/src/main/java/processing/core/PMatrix2D.java diff --git a/core/src/processing/core/PMatrix3D.java b/libs/processing-core/src/main/java/processing/core/PMatrix3D.java similarity index 100% rename from core/src/processing/core/PMatrix3D.java rename to libs/processing-core/src/main/java/processing/core/PMatrix3D.java diff --git a/core/src/processing/core/PShape.java b/libs/processing-core/src/main/java/processing/core/PShape.java similarity index 100% rename from core/src/processing/core/PShape.java rename to libs/processing-core/src/main/java/processing/core/PShape.java diff --git a/core/src/processing/core/PShapeOBJ.java b/libs/processing-core/src/main/java/processing/core/PShapeOBJ.java similarity index 99% rename from core/src/processing/core/PShapeOBJ.java rename to libs/processing-core/src/main/java/processing/core/PShapeOBJ.java index 96e0bc8de..470f3820a 100644 --- a/core/src/processing/core/PShapeOBJ.java +++ b/libs/processing-core/src/main/java/processing/core/PShapeOBJ.java @@ -358,7 +358,7 @@ static protected void parseMTL(PApplet parent, String path, // Starting new material. String mtlname = parts[1]; currentMtl = new OBJMaterial(mtlname); - materialsHash.put(mtlname, new Integer(materials.size())); + materialsHash.put(mtlname, Integer.valueOf(materials.size())); materials.add(currentMtl); } else if (parts[0].equals("map_Kd") && parts.length > 1) { // Loading texture map. diff --git a/core/src/processing/core/PShapeSVG.java b/libs/processing-core/src/main/java/processing/core/PShapeSVG.java similarity index 100% rename from core/src/processing/core/PShapeSVG.java rename to libs/processing-core/src/main/java/processing/core/PShapeSVG.java diff --git a/core/src/processing/core/PStyle.java b/libs/processing-core/src/main/java/processing/core/PStyle.java similarity index 100% rename from core/src/processing/core/PStyle.java rename to libs/processing-core/src/main/java/processing/core/PStyle.java diff --git a/core/src/processing/core/PSurface.java b/libs/processing-core/src/main/java/processing/core/PSurface.java similarity index 100% rename from core/src/processing/core/PSurface.java rename to libs/processing-core/src/main/java/processing/core/PSurface.java diff --git a/core/src/processing/core/PSurfaceNone.java b/libs/processing-core/src/main/java/processing/core/PSurfaceNone.java similarity index 97% rename from core/src/processing/core/PSurfaceNone.java rename to libs/processing-core/src/main/java/processing/core/PSurfaceNone.java index 46cb92050..5858ed1f7 100644 --- a/core/src/processing/core/PSurfaceNone.java +++ b/libs/processing-core/src/main/java/processing/core/PSurfaceNone.java @@ -32,8 +32,6 @@ import android.os.Bundle; import android.os.Handler; import android.os.Looper; -import android.service.wallpaper.WallpaperService; -import android.support.wearable.watchface.WatchFaceService; import android.view.LayoutInflater; import android.view.SurfaceHolder; import android.view.SurfaceView; @@ -42,7 +40,10 @@ import android.view.ViewGroup.LayoutParams; import android.widget.LinearLayout; import android.widget.RelativeLayout; -import android.support.v4.os.ResultReceiver; +import android.os.ResultReceiver; + +import android.service.wallpaper.WallpaperService; +import android.support.wearable.watchface.WatchFaceService; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; @@ -76,7 +77,7 @@ public class PSurfaceNone implements PSurface, PConstants { protected boolean requestedThreadStart = false; protected Thread thread; protected boolean paused; - protected Object pauseObject = new Object(); + protected final Object pauseObject = new Object(); protected float frameRateTarget = 60; protected long frameRatePeriod = 1000000000L / 60L; @@ -90,15 +91,14 @@ public AppComponent getComponent() { @Override public Context getContext() { - return activity; - /*if (component.getKind() == AppComponent.FRAGMENT) { + if (component.getKind() == AppComponent.FRAGMENT) { return activity; } else if (component.getKind() == AppComponent.WALLPAPER) { return wallpaper; } else if (component.getKind() == AppComponent.WATCHFACE) { return watchface; } - */ + return null; } @@ -332,8 +332,7 @@ public InputStream openFileInput(String filename) { try { return activity.openFileInput(filename); } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + System.err.println("Cannot open file " + filename); } } return null; @@ -531,7 +530,9 @@ public void run() { // not good to make this synchronized, locks things up try { Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L)); noDelays = 0; // Got some sleep, not delaying anymore - } catch (InterruptedException ex) { } + } catch (InterruptedException ex) { + System.err.println("Cannot properly set the timing for the draw animation."); + } overSleepTime = (System.nanoTime() - afterTime) - sleepTime; diff --git a/core/src/processing/core/PVector.java b/libs/processing-core/src/main/java/processing/core/PVector.java similarity index 100% rename from core/src/processing/core/PVector.java rename to libs/processing-core/src/main/java/processing/core/PVector.java diff --git a/core/src/processing/data/DoubleDict.java b/libs/processing-core/src/main/java/processing/data/DoubleDict.java similarity index 100% rename from core/src/processing/data/DoubleDict.java rename to libs/processing-core/src/main/java/processing/data/DoubleDict.java diff --git a/core/src/processing/data/DoubleList.java b/libs/processing-core/src/main/java/processing/data/DoubleList.java similarity index 100% rename from core/src/processing/data/DoubleList.java rename to libs/processing-core/src/main/java/processing/data/DoubleList.java diff --git a/core/src/processing/data/FloatDict.java b/libs/processing-core/src/main/java/processing/data/FloatDict.java similarity index 100% rename from core/src/processing/data/FloatDict.java rename to libs/processing-core/src/main/java/processing/data/FloatDict.java diff --git a/core/src/processing/data/FloatList.java b/libs/processing-core/src/main/java/processing/data/FloatList.java similarity index 100% rename from core/src/processing/data/FloatList.java rename to libs/processing-core/src/main/java/processing/data/FloatList.java diff --git a/core/src/processing/data/IntDict.java b/libs/processing-core/src/main/java/processing/data/IntDict.java similarity index 100% rename from core/src/processing/data/IntDict.java rename to libs/processing-core/src/main/java/processing/data/IntDict.java diff --git a/core/src/processing/data/IntList.java b/libs/processing-core/src/main/java/processing/data/IntList.java similarity index 100% rename from core/src/processing/data/IntList.java rename to libs/processing-core/src/main/java/processing/data/IntList.java diff --git a/core/src/processing/data/JSONArray.java b/libs/processing-core/src/main/java/processing/data/JSONArray.java similarity index 100% rename from core/src/processing/data/JSONArray.java rename to libs/processing-core/src/main/java/processing/data/JSONArray.java diff --git a/core/src/processing/data/JSONObject.java b/libs/processing-core/src/main/java/processing/data/JSONObject.java similarity index 100% rename from core/src/processing/data/JSONObject.java rename to libs/processing-core/src/main/java/processing/data/JSONObject.java diff --git a/core/src/processing/data/JSONTokener.java b/libs/processing-core/src/main/java/processing/data/JSONTokener.java similarity index 100% rename from core/src/processing/data/JSONTokener.java rename to libs/processing-core/src/main/java/processing/data/JSONTokener.java diff --git a/core/src/processing/data/LongDict.java b/libs/processing-core/src/main/java/processing/data/LongDict.java similarity index 100% rename from core/src/processing/data/LongDict.java rename to libs/processing-core/src/main/java/processing/data/LongDict.java diff --git a/core/src/processing/data/LongList.java b/libs/processing-core/src/main/java/processing/data/LongList.java similarity index 100% rename from core/src/processing/data/LongList.java rename to libs/processing-core/src/main/java/processing/data/LongList.java diff --git a/core/src/processing/data/Sort.java b/libs/processing-core/src/main/java/processing/data/Sort.java similarity index 100% rename from core/src/processing/data/Sort.java rename to libs/processing-core/src/main/java/processing/data/Sort.java diff --git a/core/src/processing/data/StringDict.java b/libs/processing-core/src/main/java/processing/data/StringDict.java similarity index 100% rename from core/src/processing/data/StringDict.java rename to libs/processing-core/src/main/java/processing/data/StringDict.java diff --git a/core/src/processing/data/StringList.java b/libs/processing-core/src/main/java/processing/data/StringList.java similarity index 100% rename from core/src/processing/data/StringList.java rename to libs/processing-core/src/main/java/processing/data/StringList.java diff --git a/core/src/processing/data/Table.java b/libs/processing-core/src/main/java/processing/data/Table.java similarity index 100% rename from core/src/processing/data/Table.java rename to libs/processing-core/src/main/java/processing/data/Table.java diff --git a/core/src/processing/data/TableRow.java b/libs/processing-core/src/main/java/processing/data/TableRow.java similarity index 100% rename from core/src/processing/data/TableRow.java rename to libs/processing-core/src/main/java/processing/data/TableRow.java diff --git a/core/src/processing/data/XML.java b/libs/processing-core/src/main/java/processing/data/XML.java similarity index 100% rename from core/src/processing/data/XML.java rename to libs/processing-core/src/main/java/processing/data/XML.java diff --git a/core/src/processing/event/Event.java b/libs/processing-core/src/main/java/processing/event/Event.java similarity index 100% rename from core/src/processing/event/Event.java rename to libs/processing-core/src/main/java/processing/event/Event.java diff --git a/core/src/processing/event/KeyEvent.java b/libs/processing-core/src/main/java/processing/event/KeyEvent.java similarity index 100% rename from core/src/processing/event/KeyEvent.java rename to libs/processing-core/src/main/java/processing/event/KeyEvent.java diff --git a/core/src/processing/event/MouseEvent.java b/libs/processing-core/src/main/java/processing/event/MouseEvent.java similarity index 100% rename from core/src/processing/event/MouseEvent.java rename to libs/processing-core/src/main/java/processing/event/MouseEvent.java diff --git a/core/src/processing/event/TouchEvent.java b/libs/processing-core/src/main/java/processing/event/TouchEvent.java similarity index 100% rename from core/src/processing/event/TouchEvent.java rename to libs/processing-core/src/main/java/processing/event/TouchEvent.java diff --git a/core/src/processing/opengl/FontTexture.java b/libs/processing-core/src/main/java/processing/opengl/FontTexture.java similarity index 100% rename from core/src/processing/opengl/FontTexture.java rename to libs/processing-core/src/main/java/processing/opengl/FontTexture.java diff --git a/core/src/processing/opengl/FrameBuffer.java b/libs/processing-core/src/main/java/processing/opengl/FrameBuffer.java similarity index 100% rename from core/src/processing/opengl/FrameBuffer.java rename to libs/processing-core/src/main/java/processing/opengl/FrameBuffer.java diff --git a/core/src/processing/opengl/LinePath.java b/libs/processing-core/src/main/java/processing/opengl/LinePath.java similarity index 100% rename from core/src/processing/opengl/LinePath.java rename to libs/processing-core/src/main/java/processing/opengl/LinePath.java diff --git a/core/src/processing/opengl/LineStroker.java b/libs/processing-core/src/main/java/processing/opengl/LineStroker.java similarity index 100% rename from core/src/processing/opengl/LineStroker.java rename to libs/processing-core/src/main/java/processing/opengl/LineStroker.java diff --git a/core/src/processing/opengl/PGL.java b/libs/processing-core/src/main/java/processing/opengl/PGL.java similarity index 100% rename from core/src/processing/opengl/PGL.java rename to libs/processing-core/src/main/java/processing/opengl/PGL.java diff --git a/core/src/processing/opengl/PGLES.java b/libs/processing-core/src/main/java/processing/opengl/PGLES.java similarity index 100% rename from core/src/processing/opengl/PGLES.java rename to libs/processing-core/src/main/java/processing/opengl/PGLES.java diff --git a/core/src/processing/opengl/PGraphics2D.java b/libs/processing-core/src/main/java/processing/opengl/PGraphics2D.java similarity index 100% rename from core/src/processing/opengl/PGraphics2D.java rename to libs/processing-core/src/main/java/processing/opengl/PGraphics2D.java diff --git a/core/src/processing/opengl/PGraphics2DX.java b/libs/processing-core/src/main/java/processing/opengl/PGraphics2DX.java similarity index 100% rename from core/src/processing/opengl/PGraphics2DX.java rename to libs/processing-core/src/main/java/processing/opengl/PGraphics2DX.java diff --git a/core/src/processing/opengl/PGraphics3D.java b/libs/processing-core/src/main/java/processing/opengl/PGraphics3D.java similarity index 100% rename from core/src/processing/opengl/PGraphics3D.java rename to libs/processing-core/src/main/java/processing/opengl/PGraphics3D.java diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/libs/processing-core/src/main/java/processing/opengl/PGraphicsOpenGL.java similarity index 99% rename from core/src/processing/opengl/PGraphicsOpenGL.java rename to libs/processing-core/src/main/java/processing/opengl/PGraphicsOpenGL.java index d778c1127..478a2f13b 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/libs/processing-core/src/main/java/processing/opengl/PGraphicsOpenGL.java @@ -4413,7 +4413,7 @@ static protected void invScale(PMatrix3D matrix, float x, float y, float z) { static protected void invScale(PMatrix2D matrix, float x, float y) { - matrix.preApply(1/x, 0, 0, 1/y, 0, 0); + matrix.preApply(1/x, 0, 0, 0, 1/y, 0); } @@ -6774,25 +6774,25 @@ public void copy(PImage src, int scrX0, scrX1; int scrY0, scrY1; if (invX) { - scrX0 = dx + dw; - scrX1 = dx; + scrX0 = (dx + dw) / src.pixelDensity; + scrX1 = dx / src.pixelDensity; } else { - scrX0 = dx; - scrX1 = dx + dw; + scrX0 = dx / src.pixelDensity; + scrX1 = (dx + dw) / src.pixelDensity; } int texX0 = sx; int texX1 = sx + sw; int texY0, texY1; if (invY) { - scrY0 = height - (dy + dh); - scrY1 = height - dy; + scrY0 = height - (dy + dh) / src.pixelDensity; + scrY1 = height - dy / src.pixelDensity; texY0 = tex.height - (sy + sh); texY1 = tex.height - sy; } else { // Because drawTexture uses bottom-to-top orientation of Y axis. - scrY0 = height - dy; - scrY1 = height - (dy + dh); + scrY0 = height - dy / src.pixelDensity; + scrY1 = height - (dy + dh) / src.pixelDensity; texY0 = sy; texY1 = sy + sh; } diff --git a/core/src/processing/opengl/PShader.java b/libs/processing-core/src/main/java/processing/opengl/PShader.java similarity index 100% rename from core/src/processing/opengl/PShader.java rename to libs/processing-core/src/main/java/processing/opengl/PShader.java diff --git a/core/src/processing/opengl/PShapeOpenGL.java b/libs/processing-core/src/main/java/processing/opengl/PShapeOpenGL.java similarity index 99% rename from core/src/processing/opengl/PShapeOpenGL.java rename to libs/processing-core/src/main/java/processing/opengl/PShapeOpenGL.java index ed64ce032..3f65727b4 100644 --- a/core/src/processing/opengl/PShapeOpenGL.java +++ b/libs/processing-core/src/main/java/processing/opengl/PShapeOpenGL.java @@ -1251,7 +1251,11 @@ public void translate(float tx, float ty, float tz) { @Override public void rotate(float angle) { - transform(ROTATE, angle); + if (is3D) { + transform(ROTATE, angle, 0, 0, 1); + } else { + transform(ROTATE, angle); + } } diff --git a/core/src/processing/opengl/PSurfaceGLES.java b/libs/processing-core/src/main/java/processing/opengl/PSurfaceGLES.java similarity index 100% rename from core/src/processing/opengl/PSurfaceGLES.java rename to libs/processing-core/src/main/java/processing/opengl/PSurfaceGLES.java diff --git a/core/src/processing/opengl/Texture.java b/libs/processing-core/src/main/java/processing/opengl/Texture.java similarity index 100% rename from core/src/processing/opengl/Texture.java rename to libs/processing-core/src/main/java/processing/opengl/Texture.java diff --git a/core/src/processing/opengl/VertexBuffer.java b/libs/processing-core/src/main/java/processing/opengl/VertexBuffer.java similarity index 100% rename from core/src/processing/opengl/VertexBuffer.java rename to libs/processing-core/src/main/java/processing/opengl/VertexBuffer.java diff --git a/core/src/processing/opengl/tess/ActiveRegion.java b/libs/processing-core/src/main/java/processing/opengl/tess/ActiveRegion.java similarity index 100% rename from core/src/processing/opengl/tess/ActiveRegion.java rename to libs/processing-core/src/main/java/processing/opengl/tess/ActiveRegion.java diff --git a/core/src/processing/opengl/tess/CachedVertex.java b/libs/processing-core/src/main/java/processing/opengl/tess/CachedVertex.java similarity index 100% rename from core/src/processing/opengl/tess/CachedVertex.java rename to libs/processing-core/src/main/java/processing/opengl/tess/CachedVertex.java diff --git a/core/src/processing/opengl/tess/Dict.java b/libs/processing-core/src/main/java/processing/opengl/tess/Dict.java similarity index 100% rename from core/src/processing/opengl/tess/Dict.java rename to libs/processing-core/src/main/java/processing/opengl/tess/Dict.java diff --git a/core/src/processing/opengl/tess/DictNode.java b/libs/processing-core/src/main/java/processing/opengl/tess/DictNode.java similarity index 100% rename from core/src/processing/opengl/tess/DictNode.java rename to libs/processing-core/src/main/java/processing/opengl/tess/DictNode.java diff --git a/core/src/processing/opengl/tess/GLUface.java b/libs/processing-core/src/main/java/processing/opengl/tess/GLUface.java similarity index 100% rename from core/src/processing/opengl/tess/GLUface.java rename to libs/processing-core/src/main/java/processing/opengl/tess/GLUface.java diff --git a/core/src/processing/opengl/tess/GLUhalfEdge.java b/libs/processing-core/src/main/java/processing/opengl/tess/GLUhalfEdge.java similarity index 100% rename from core/src/processing/opengl/tess/GLUhalfEdge.java rename to libs/processing-core/src/main/java/processing/opengl/tess/GLUhalfEdge.java diff --git a/core/src/processing/opengl/tess/GLUmesh.java b/libs/processing-core/src/main/java/processing/opengl/tess/GLUmesh.java similarity index 100% rename from core/src/processing/opengl/tess/GLUmesh.java rename to libs/processing-core/src/main/java/processing/opengl/tess/GLUmesh.java diff --git a/core/src/processing/opengl/tess/GLUtessellatorImpl.java b/libs/processing-core/src/main/java/processing/opengl/tess/GLUtessellatorImpl.java similarity index 100% rename from core/src/processing/opengl/tess/GLUtessellatorImpl.java rename to libs/processing-core/src/main/java/processing/opengl/tess/GLUtessellatorImpl.java diff --git a/core/src/processing/opengl/tess/GLUvertex.java b/libs/processing-core/src/main/java/processing/opengl/tess/GLUvertex.java similarity index 100% rename from core/src/processing/opengl/tess/GLUvertex.java rename to libs/processing-core/src/main/java/processing/opengl/tess/GLUvertex.java diff --git a/core/src/processing/opengl/tess/Geom.java b/libs/processing-core/src/main/java/processing/opengl/tess/Geom.java similarity index 100% rename from core/src/processing/opengl/tess/Geom.java rename to libs/processing-core/src/main/java/processing/opengl/tess/Geom.java diff --git a/core/src/processing/opengl/tess/Mesh.java b/libs/processing-core/src/main/java/processing/opengl/tess/Mesh.java similarity index 100% rename from core/src/processing/opengl/tess/Mesh.java rename to libs/processing-core/src/main/java/processing/opengl/tess/Mesh.java diff --git a/core/src/processing/opengl/tess/Normal.java b/libs/processing-core/src/main/java/processing/opengl/tess/Normal.java similarity index 100% rename from core/src/processing/opengl/tess/Normal.java rename to libs/processing-core/src/main/java/processing/opengl/tess/Normal.java diff --git a/core/src/processing/opengl/tess/PGLU.java b/libs/processing-core/src/main/java/processing/opengl/tess/PGLU.java similarity index 100% rename from core/src/processing/opengl/tess/PGLU.java rename to libs/processing-core/src/main/java/processing/opengl/tess/PGLU.java diff --git a/core/src/processing/opengl/tess/PGLUtessellator.java b/libs/processing-core/src/main/java/processing/opengl/tess/PGLUtessellator.java similarity index 100% rename from core/src/processing/opengl/tess/PGLUtessellator.java rename to libs/processing-core/src/main/java/processing/opengl/tess/PGLUtessellator.java diff --git a/core/src/processing/opengl/tess/PGLUtessellatorCallback.java b/libs/processing-core/src/main/java/processing/opengl/tess/PGLUtessellatorCallback.java similarity index 100% rename from core/src/processing/opengl/tess/PGLUtessellatorCallback.java rename to libs/processing-core/src/main/java/processing/opengl/tess/PGLUtessellatorCallback.java diff --git a/core/src/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java b/libs/processing-core/src/main/java/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java similarity index 100% rename from core/src/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java rename to libs/processing-core/src/main/java/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java diff --git a/core/src/processing/opengl/tess/PriorityQ.java b/libs/processing-core/src/main/java/processing/opengl/tess/PriorityQ.java similarity index 100% rename from core/src/processing/opengl/tess/PriorityQ.java rename to libs/processing-core/src/main/java/processing/opengl/tess/PriorityQ.java diff --git a/core/src/processing/opengl/tess/PriorityQHeap.java b/libs/processing-core/src/main/java/processing/opengl/tess/PriorityQHeap.java similarity index 100% rename from core/src/processing/opengl/tess/PriorityQHeap.java rename to libs/processing-core/src/main/java/processing/opengl/tess/PriorityQHeap.java diff --git a/core/src/processing/opengl/tess/PriorityQSort.java b/libs/processing-core/src/main/java/processing/opengl/tess/PriorityQSort.java similarity index 100% rename from core/src/processing/opengl/tess/PriorityQSort.java rename to libs/processing-core/src/main/java/processing/opengl/tess/PriorityQSort.java diff --git a/core/src/processing/opengl/tess/Render.java b/libs/processing-core/src/main/java/processing/opengl/tess/Render.java similarity index 100% rename from core/src/processing/opengl/tess/Render.java rename to libs/processing-core/src/main/java/processing/opengl/tess/Render.java diff --git a/core/src/processing/opengl/tess/Sweep.java b/libs/processing-core/src/main/java/processing/opengl/tess/Sweep.java similarity index 100% rename from core/src/processing/opengl/tess/Sweep.java rename to libs/processing-core/src/main/java/processing/opengl/tess/Sweep.java diff --git a/core/src/processing/opengl/tess/TessMono.java b/libs/processing-core/src/main/java/processing/opengl/tess/TessMono.java similarity index 100% rename from core/src/processing/opengl/tess/TessMono.java rename to libs/processing-core/src/main/java/processing/opengl/tess/TessMono.java diff --git a/core/src/processing/opengl/tess/TessState.java b/libs/processing-core/src/main/java/processing/opengl/tess/TessState.java similarity index 100% rename from core/src/processing/opengl/tess/TessState.java rename to libs/processing-core/src/main/java/processing/opengl/tess/TessState.java diff --git a/libs/processing-vr/build.gradle b/libs/processing-vr/build.gradle new file mode 100644 index 000000000..06328948e --- /dev/null +++ b/libs/processing-vr/build.gradle @@ -0,0 +1,24 @@ +plugins { + id 'com.android.library' +} + +android { + namespace "processing.vr" + + defaultConfig { + minSdkVersion 19 + targetSdkVersion 33 + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + productFlavors { + } +} + +dependencies { + implementation project(':libs:processing-core') + implementation project(':libs:google-vr') +} \ No newline at end of file diff --git a/libs/processing-vr/proguard-rules.pro b/libs/processing-vr/proguard-rules.pro new file mode 100644 index 000000000..f1b424510 --- /dev/null +++ b/libs/processing-vr/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/libs/processing-vr/src/main/AndroidManifest.xml b/libs/processing-vr/src/main/AndroidManifest.xml new file mode 100755 index 000000000..97330b776 --- /dev/null +++ b/libs/processing-vr/src/main/AndroidManifest.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/mode/libraries/vr/src/processing/vr/VRActivity.java b/libs/processing-vr/src/main/java/processing/vr/VRActivity.java similarity index 94% rename from mode/libraries/vr/src/processing/vr/VRActivity.java rename to libs/processing-vr/src/main/java/processing/vr/VRActivity.java index d3433bfba..28e199585 100644 --- a/mode/libraries/vr/src/processing/vr/VRActivity.java +++ b/libs/processing-vr/src/main/java/processing/vr/VRActivity.java @@ -22,10 +22,13 @@ package processing.vr; -import com.google.vr.sdk.base.GvrActivity; - import android.content.Intent; import android.util.DisplayMetrics; + +// This will give a "Cannot resolve symbol 'base'" error in Android Studio because it cannot get +// the classes from inside the local .aar files for google-vr. But any VR app runs and can also be debugged. +import com.google.vr.sdk.base.GvrActivity; + import processing.android.AppComponent; import processing.android.ServiceEngine; import processing.core.PApplet; diff --git a/mode/libraries/vr/src/processing/vr/VRCamera.java b/libs/processing-vr/src/main/java/processing/vr/VRCamera.java similarity index 100% rename from mode/libraries/vr/src/processing/vr/VRCamera.java rename to libs/processing-vr/src/main/java/processing/vr/VRCamera.java diff --git a/mode/libraries/vr/src/processing/vr/VRGraphics.java b/libs/processing-vr/src/main/java/processing/vr/VRGraphics.java similarity index 100% rename from mode/libraries/vr/src/processing/vr/VRGraphics.java rename to libs/processing-vr/src/main/java/processing/vr/VRGraphics.java diff --git a/mode/libraries/vr/src/processing/vr/VRGraphicsMono.java b/libs/processing-vr/src/main/java/processing/vr/VRGraphicsMono.java similarity index 100% rename from mode/libraries/vr/src/processing/vr/VRGraphicsMono.java rename to libs/processing-vr/src/main/java/processing/vr/VRGraphicsMono.java diff --git a/mode/libraries/vr/src/processing/vr/VRGraphicsStereo.java b/libs/processing-vr/src/main/java/processing/vr/VRGraphicsStereo.java similarity index 100% rename from mode/libraries/vr/src/processing/vr/VRGraphicsStereo.java rename to libs/processing-vr/src/main/java/processing/vr/VRGraphicsStereo.java diff --git a/mode/libraries/vr/src/processing/vr/VRSurface.java b/libs/processing-vr/src/main/java/processing/vr/VRSurface.java similarity index 100% rename from mode/libraries/vr/src/processing/vr/VRSurface.java rename to libs/processing-vr/src/main/java/processing/vr/VRSurface.java diff --git a/mode/.classpath b/mode/.classpath deleted file mode 100644 index 104768529..000000000 --- a/mode/.classpath +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/mode/.project b/mode/.project deleted file mode 100644 index 9b2d77470..000000000 --- a/mode/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - android-mode - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/mode/build.gradle b/mode/build.gradle deleted file mode 100644 index b1f5dc9b9..000000000 --- a/mode/build.gradle +++ /dev/null @@ -1,94 +0,0 @@ -import java.nio.file.Files -import org.zeroturnaround.zip.ZipUtil -import org.apache.commons.io.FileUtils -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; - - -// Extend compile to copy the jars from gradle-tooling and slf4j: -// https://stackoverflow.com/a/43602463 -configurations { - implementation.extendsFrom implementationCopy - implementation.extendsFrom implementationExtract -} - -dependencies { - implementation group: "org.processing", name: "core", version: "${processingVersion}" - implementation group: "org.processing", name: "pde", version: "${processingVersion}" - implementation group: "org.processing", name: "java-mode", version: "${processingVersion}" - - implementationExtract "org.eclipse.jdt:org.eclipse.jdt.debug:${jdtVersion}" - - implementationCopy "org.gradle:gradle-tooling-api:${toolingVersion}" - implementationCopy "org.slf4j:slf4j-api:${slf4jVersion}" - implementationCopy "org.slf4j:slf4j-simple:${slf4jVersion}" - - implementation fileTree(include: ["jdi.jar", "jdimodel.jar"], dir: 'mode') -} - -// This task copies the gradle tooling jar into the mode folder -task copyToLib(type: Copy) { - from configurations.implementationCopy.files - into "mode" -} -build.dependsOn(copyToLib) -compileJava.dependsOn(copyToLib) - -sourceSets { - main { - java { - srcDirs = ["src/"] - } - } -} - -task getjdi(type: Copy) { - // This task extracts the jar files inside org.eclipse.jdt.debug, which are - // jdi.jar and jdimodel.jar and needed to build the debugger. - from(zipTree(configurations.implementationExtract.files[0])) { - include '**/*.jar' - exclude 'META-INF' - } - into "mode" -} - -task permissions(type:Exec) { - // This task retrieves the latest list of Android permissions and adds them - // to the Permissions.java file. The python scripts requries BeautifulSoup - workingDir "scripts" - commandLine "python", "permissions.py" -} - -task wrapper(type: Wrapper) { - gradleVersion = "${gradlewVersion}" // version required for gradle wrapper -} - -wrapper.doLast { - File wrapperFolder = file("mode/gradlew"); - wrapperFolder.mkdirs(); - file("gradle").renameTo(file("mode/gradlew/gradle")) - file("gradlew").renameTo(file("mode/gradlew/gradlew")) - file("gradlew.bat").renameTo(file("mode/gradlew/gradlew.bat")) - FileUtils.copyDirectory(file("gradle"), file("../debug/gradle")) - delete "gradle" - ZipUtil.pack(file("mode/gradlew"), new File("mode/mode/gradlew.zip")); - delete "mode/gradlew" -} - -clean.doFirst { - delete fileTree("mode") { - include "**/*.jar" - exclude "jdi.jar" - exclude "jdimodel.jar" - exclude "istack-commons-runtime.jar" - exclude "javax.activation-api.jar" - exclude "jaxb-api.jar" - exclude "jaxb-jxc.jar" - exclude "jaxb-runtime.jar" - exclude "jaxb-xjc.jar" - } -} - -build.doLast { - Files.copy(file("$buildDir/libs/mode.jar").toPath(), - file("mode/AndroidMode.jar").toPath(), REPLACE_EXISTING); -} diff --git a/mode/icons/launcher_144.png b/mode/icons/launcher_144.png deleted file mode 100644 index ebc41bc8d..000000000 Binary files a/mode/icons/launcher_144.png and /dev/null differ diff --git a/mode/icons/launcher_192.png b/mode/icons/launcher_192.png deleted file mode 100644 index 40932779b..000000000 Binary files a/mode/icons/launcher_192.png and /dev/null differ diff --git a/mode/icons/launcher_36.png b/mode/icons/launcher_36.png deleted file mode 100644 index 4412d4f69..000000000 Binary files a/mode/icons/launcher_36.png and /dev/null differ diff --git a/mode/icons/launcher_48.png b/mode/icons/launcher_48.png deleted file mode 100644 index 0359b7c88..000000000 Binary files a/mode/icons/launcher_48.png and /dev/null differ diff --git a/mode/icons/launcher_72.png b/mode/icons/launcher_72.png deleted file mode 100644 index 8f19510ff..000000000 Binary files a/mode/icons/launcher_72.png and /dev/null differ diff --git a/mode/icons/launcher_96.png b/mode/icons/launcher_96.png deleted file mode 100644 index c9016cf0c..000000000 Binary files a/mode/icons/launcher_96.png and /dev/null differ diff --git a/mode/icons/preview_circular.png b/mode/icons/preview_circular.png deleted file mode 100644 index 940afd811..000000000 Binary files a/mode/icons/preview_circular.png and /dev/null differ diff --git a/mode/icons/preview_rectangular.png b/mode/icons/preview_rectangular.png deleted file mode 100644 index 277a466e4..000000000 Binary files a/mode/icons/preview_rectangular.png and /dev/null differ diff --git a/mode/libraries/ar/build.gradle b/mode/libraries/ar/build.gradle deleted file mode 100644 index 68b337b7b..000000000 --- a/mode/libraries/ar/build.gradle +++ /dev/null @@ -1,84 +0,0 @@ -import java.nio.file.Files -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; - -plugins { - id 'aar' -} - -dependencies { - compileOnly name: "android" - compileOnly "org.p5android:processing-core:${modeVersion}" - implementationAar "com.google.ar:core:${garVersion}" -} - -task sourceJar(type: Jar) { - from sourceSets.main.allJava - archiveClassifier = "sources" -} - -sourceSets { - main { - java { - srcDirs = ["src/"] - } - resources { - srcDirs = ["src/"] - } - } -} - -// Does not work because of Processing-specific tags in source code, such as @webref -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = "javadoc" - from javadoc.destinationDir -} - -artifacts { -// archives javadocJar - archives sourceJar -} - -jar.doLast { task -> - ant.checksum file: task.archivePath -} - -clean.doFirst { - delete "dist" - delete "library/ar.jar" -} - -compileJava.doFirst { - String[] deps = ["core.jar"] - File libFolder = file("library") - libFolder.mkdirs() - for (String fn : deps) { - Files.copy(file("${rootDir}/build/libs/" + fn).toPath(), - file("library/" + fn).toPath(), REPLACE_EXISTING); - } -} - -build.doLast { - // Copying ar jar to library folder - File arJar = file("library/ar.jar") - arJar.mkdirs(); - Files.copy(file("$buildDir/libs/ar.jar").toPath(), - arJar.toPath(), REPLACE_EXISTING); - // Renaming artifacts for maven publishing - Files.move(file("$buildDir/libs/ar.jar").toPath(), - file("$buildDir/libs/processing-ar-${arLibVersion}.jar").toPath(), REPLACE_EXISTING); - Files.move(file("$buildDir/libs/ar-sources.jar").toPath(), - file("$buildDir/libs/processing-ar-${arLibVersion}-sources.jar").toPath(), REPLACE_EXISTING); - Files.move(file("$buildDir/libs/ar.jar.MD5").toPath(), - file("$buildDir/libs/processing-ar-${arLibVersion}.jar.md5").toPath(), REPLACE_EXISTING); -} - -ext { - libName = 'processing-ar' - libVersion = arLibVersion - libJar = "${buildDir}/libs/${libName}-${libVersion}.jar" - libSrc = "${buildDir}/libs/${libName}-${libVersion}-sources.jar" - libMd5 = "${buildDir}/libs/${libName}-${libVersion}-sources.jar.md5" - libDependencies = [[group: 'org.p5android', name: 'processing-core', version: modeVersion], - [group: 'com.google.ar', name: 'core', version: garVersion]] -} -apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" \ No newline at end of file diff --git a/mode/libraries/vr/build.gradle b/mode/libraries/vr/build.gradle deleted file mode 100644 index b3bb7aa51..000000000 --- a/mode/libraries/vr/build.gradle +++ /dev/null @@ -1,85 +0,0 @@ -import java.nio.file.Files -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING - -plugins { - id 'aar' -} - -dependencies { - compileOnly name: "android" - compileOnly "org.p5android:processing-core:${modeVersion}" - implementationAar "com.google.vr:sdk-audio:${gvrVersion}" - implementationAar "com.google.vr:sdk-base:${gvrVersion}" -} - -task sourceJar(type: Jar, dependsOn: classes) { - classifier = "sources" - from sourceSets.main.allSource -} - -sourceSets { - main { - java { - srcDirs = ["src/"] - } - } -} - -// Does not work because of Processing-specific tags in source code, such as @webref -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = "javadoc" - from javadoc.destinationDir -} - -artifacts { -// archives javadocJar - archives sourceJar -} - -jar.doLast { task -> - ant.checksum file: task.archivePath -} - -clean.doFirst { - delete "dist" - delete "library/vr.jar" -} - -compileJava.doFirst { - String[] deps = ["sdk-audio.jar", - "sdk-base.jar", - "sdk-common.jar"] - File libFolder = file("library") - libFolder.mkdirs() - for (String fn : deps) { - Files.copy(file("${rootDir}/build/libs/" + fn).toPath(), - file("library/" + fn).toPath(), REPLACE_EXISTING); - } -} - -build.doLast { - // Copying vr jar to library folder - File vrJar = file("library/vr.jar") - vrJar.mkdirs(); - Files.copy(file("$buildDir/libs/vr.jar").toPath(), - vrJar.toPath(), REPLACE_EXISTING); - // Renaming artifacts for maven publishing - Files.move(file("$buildDir/libs/vr.jar").toPath(), - file("$buildDir/libs/processing-vr-${vrLibVersion}.jar").toPath(), REPLACE_EXISTING); - Files.move(file("$buildDir/libs/vr-sources.jar").toPath(), - file("$buildDir/libs/processing-vr-${vrLibVersion}-sources.jar").toPath(), REPLACE_EXISTING); - Files.move(file("$buildDir/libs/vr.jar.MD5").toPath(), - file("$buildDir/libs/processing-vr-${vrLibVersion}.jar.md5").toPath(), REPLACE_EXISTING); -} - -ext { - libName = 'processing-vr' - libVersion = vrLibVersion - libJar = "${buildDir}/libs/${libName}-${libVersion}.jar" - libSrc = "${buildDir}/libs/${libName}-${libVersion}-sources.jar" - libMd5 = "${buildDir}/libs/${libName}-${libVersion}-sources.jar.md5" - libDependencies = [[group: 'org.p5android', name: 'processing-core', version: modeVersion], - [group: 'com.google.vr', name: 'sdk-base', version: gvrVersion], - [group: 'com.google.vr', name: 'sdk-audio', version: gvrVersion]] -} -apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" \ No newline at end of file diff --git a/mode/mode.properties b/mode/mode.properties deleted file mode 100644 index 973e8676c..000000000 --- a/mode/mode.properties +++ /dev/null @@ -1,10 +0,0 @@ -name = Android Mode -authorList = [The Processing Foundation](https://processingfoundation.org/) -url = http://android.processing.org -sentence = Create projects with Processing for Android devices -paragraph = This version of the Android Mode is for Processing 3.1+ -imports=processing.mode.java.JavaMode -version = 279 -prettyVersion = 4.2.1 -minRevision = 249 -maxRevision = 1269 diff --git a/mode/mode/gradlew.zip b/mode/mode/gradlew.zip deleted file mode 100644 index 9cebfd7a5..000000000 Binary files a/mode/mode/gradlew.zip and /dev/null differ diff --git a/mode/src/processing/mode/android/AndroidPreprocessor.java b/mode/src/processing/mode/android/AndroidPreprocessor.java deleted file mode 100644 index b134a7a2f..000000000 --- a/mode/src/processing/mode/android/AndroidPreprocessor.java +++ /dev/null @@ -1,314 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-21 The Processing Foundation - Copyright (c) 2009-12 Ben Fry and Casey Reas - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. - - 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 processing.mode.android; - -import java.io.IOException; -import java.io.PrintWriter; -//import java.io.Writer; -import java.util.List; -import processing.app.*; -import processing.core.PApplet; -import processing.mode.java.preproc.PdePreprocessor; -import processing.mode.java.preproc.SurfaceInfo; - - -/** - * Processing preprocessor, supporting the Android specifics. - */ -public class AndroidPreprocessor extends PdePreprocessor { - protected Sketch sketch; - protected String packageName; - - protected String smoothStatement; - protected String sketchQuality; - - protected String kindStatement; - protected String sketchKind; - - public static final String SMOOTH_REGEX = - "(?:^|\\s|;)smooth\\s*\\(\\s*([^\\s,]+)\\s*\\)\\s*\\;"; - - public AndroidPreprocessor(final String sketchName) { - super(sketchName); - } - - public AndroidPreprocessor(final Sketch sketch, - final String packageName) throws IOException { - super(sketch.getName()); - this.sketch = sketch; - this.packageName = packageName; - } - - - public SurfaceInfo initSketchSize(String code) throws SketchException { - SurfaceInfo surfaceInfo = parseSketchSize(code, true); - if (surfaceInfo == null) { - System.err.println(AndroidMode.getTextString("android_preprocessor.error.cannot_parse_size")); - throw new SketchException(AndroidMode.getTextString("android_preprocessor.error.cannot_parse_size_exception")); - } - return surfaceInfo; - } - - - public String[] initSketchSmooth(String code) throws SketchException { - String[] info = parseSketchSmooth(code, true); - if (info == null) { - System.err.println(AndroidMode.getTextString("android_preprocessor.error.cannot_smooth_size")); - throw new SketchException(AndroidMode.getTextString("android_preprocessor.error.cannot_parse_smooth_exception")); - } - smoothStatement = info[0]; - sketchQuality = info[1]; - return info; - } - - - static public String[] parseSketchSmooth(String code, boolean fussy) { - String[] matches = PApplet.match(scrubComments(code), SMOOTH_REGEX); - - if (matches != null) { - boolean badSmooth = false; - - if (PApplet.parseInt(matches[1], -1) == -1) { - badSmooth = true; - } - - if (badSmooth && fussy) { - // found a reference to smooth, but it didn't seem to contain numbers - Messages.showWarning(AndroidMode.getTextString("android_preprocessor.warn.cannot_find_smooth_level_title"), - AndroidMode.getTextString("android_preprocessor.warn.cannot_find_smooth_level_body"), null); - return null; - } - - return matches; - } - return new String[] { null, null }; // not an error, just empty - } - - - @Override - protected int writeImports(final PrintWriter out, - final List programImports, - final List codeFolderImports) { - out.println("package " + packageName + ";"); - out.println(); - int count = 2; - count += super.writeImports(out, programImports, codeFolderImports); -// count += writeImportList(out, getAndroidImports()); - return count; - } - - - @Override - protected void writeFooter(PrintWriter out, String className) { - SurfaceInfo info = null; - try { - info = initSketchSize(sketch.getMainProgram()); - } catch (SketchException e) { - e.printStackTrace(); - } - - if (info == null) { - // Cannot get size info, just use parent's implementation. - super.writeFooter(out, className); - } else { - // Same as in the parent, but without writing the main() method, which is - // not needed in Android. - - if (mode == Mode.STATIC) { - // close off setup() definition - out.println(indent + indent + "noLoop();"); - out.println(indent + "}"); - out.println(); - } - - if ((mode == Mode.STATIC) || (mode == Mode.ACTIVE)) { - // doesn't remove the original size() method, but calling size() - // again in setup() is harmless. - if (!hasMethod("settings") && info.hasSettings()) { - out.println(indent + "public void settings() { " + info.getSettings() + " }"); - } - - // close off the class definition - out.println("}"); - } - } - } - - -//////////////////////////////////////////////////////////////////////////////// -// Assorted commented out code -// - - // As of revision 0215 (2.0b7-ish), the default imports are now identical - // between desktop and Android (to avoid unintended incompatibilities). - /* - @Override - public String[] getCoreImports() { - return new String[] { - "processing.core.*", - "processing.data.*", - "processing.event.*", - "processing.opengl.*" - }; - } - - - @Override - public String[] getDefaultImports() { - final String prefsLine = Preferences.get("android.preproc.imports"); - if (prefsLine != null) { - return PApplet.splitTokens(prefsLine, ", "); - } - - // The initial values are stored in here for the day when Android - // is broken out as a separate mode. - - // In the future, this may include standard classes for phone or - // accelerometer access within the Android APIs. This is currently living - // in code rather than preferences.txt because Android mode needs to - // maintain its independence from the rest of processing.app. - final String[] androidImports = new String[] { -// "android.view.MotionEvent", "android.view.KeyEvent", -// "android.graphics.Bitmap", //"java.awt.Image", - "java.io.*", // for BufferedReader, InputStream, etc - //"java.net.*", "java.text.*", // leaving otu for now - "java.util.*" // for ArrayList and friends - //"java.util.zip.*", "java.util.regex.*" // not necessary w/ newer i/o - }; - - Preferences.set("android.preproc.imports", - PApplet.join(androidImports, ",")); - - return androidImports; - } - */ - - // No need for it now - /* - public String[] getDefaultImports() { -// String[] defs = super.getDefaultImports(); -// return defs; - return new String[] { - "java.util.HashMap", - "java.util.ArrayList", - "java.io.File", - "java.io.BufferedReader", - "java.io.PrintWriter", - "java.io.InputStream", - "java.io.OutputStream", - "java.io.IOException", - "android.app.Activity", - "android.app.Fragment" - }; - } - - - public String[] getAndroidImports() { - return new String[] { - "processing.android.ServiceEngine" - }; - } - */ - - /* - protected boolean parseSketchSize() { - // This matches against any uses of the size() function, whether numbers - // or variables or whatever. This way, no warning is shown if size() isn't - // actually used in the applet, which is the case especially for anyone - // who is cutting/pasting from the reference. - - String scrubbed = processing.mode.java.JavaBuild.scrubComments(sketch.getCode(0).getProgram()); - String[] matches = PApplet.match(scrubbed, processing.mode.java.JavaBuild.SIZE_REGEX); -// PApplet.println("matches: " + Sketch.SIZE_REGEX); -// PApplet.println(matches); - - if (matches != null) { - boolean badSize = false; - - if (matches[1].equals("screenWidth") || - matches[1].equals("screenHeight") || - matches[2].equals("screenWidth") || - matches[2].equals("screenHeight")) { - final String message = - "The screenWidth and screenHeight variables are named\n" + - "displayWidth and displayHeight in this release of Processing."; - Base.showWarning("Time for a quick update", message, null); - return false; - } - - if (!matches[1].equals("displayWidth") && - !matches[1].equals("displayHeight") && - PApplet.parseInt(matches[1], -1) == -1) { - badSize = true; - } - if (!matches[2].equals("displayWidth") && - !matches[2].equals("displayHeight") && - PApplet.parseInt(matches[2], -1) == -1) { - badSize = true; - } - - if (badSize) { - // found a reference to size, but it didn't seem to contain numbers - final String message = - "The size of this applet could not automatically be determined\n" + - "from your code. Use only numeric values (not variables) for the\n" + - "size() command. See the size() reference for more information."; - Base.showWarning("Could not find sketch size", message, null); - System.out.println("More about the size() command on Android can be"); - System.out.println("found here: http://wiki.processing.org/w/Android"); - return false; - } - -// PApplet.println(matches); - sizeStatement = matches[0]; // the full method to be removed from the source - sketchWidth = matches[1]; - sketchHeight = matches[2]; - sketchRenderer = matches[3].trim(); - if (sketchRenderer.length() == 0) { - sketchRenderer = null; - } - } else { - sizeStatement = null; - sketchWidth = null; - sketchHeight = null; - sketchRenderer = null; - } - return true; - } - */ - - - /* - public PreprocessorResult write(Writer out, String program, String[] codeFolderPackages) - throws SketchException, RecognitionException, TokenStreamException { - if (sizeStatement != null) { - int start = program.indexOf(sizeStatement); - program = program.substring(0, start) + - program.substring(start + sizeStatement.length()); - } - // the OpenGL package is back in 2.0a5 - //program = program.replaceAll("import\\s+processing\\.opengl\\.\\S+;", ""); - return super.write(out, program, codeFolderPackages); - } - */ -} \ No newline at end of file diff --git a/mode/src/processing/mode/android/JarSigner.java b/mode/src/processing/mode/android/JarSigner.java deleted file mode 100644 index 17e22de66..000000000 --- a/mode/src/processing/mode/android/JarSigner.java +++ /dev/null @@ -1,290 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2014-21 The Processing Foundation - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation. - - 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 processing.mode.android; - -import java.io.*; - -import java.security.*; -import java.security.cert.X509Certificate; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.jar.Attributes; -import java.util.jar.JarEntry; -import java.util.jar.JarFile; -import java.util.jar.JarOutputStream; -import java.util.jar.Manifest; -import java.util.zip.ZipEntry; -import java.util.zip.ZipInputStream; -import java.util.Base64; -import sun.security.pkcs.SignerInfo; -import sun.security.x509.AlgorithmId; -import sun.security.x509.X500Name; -import sun.security.pkcs.PKCS7; -import sun.security.pkcs.ContentInfo; - -/** - * Created by ibziy_000 on 17.08.2014. - */ -public class JarSigner { - private static final String DIGEST_ALGORITHM = "SHA1"; - private static final String DIGEST_ATTR = "SHA1-Digest"; - private static final String DIGEST_MANIFEST_ATTR = "SHA1-Digest-Manifest"; - private static SignatureOutputStream certFileContents = null; - private static byte[] buffer; - - public static void signJar(File jarToSign, File outputJar, String alias, - String keypass, String keystore, String storepass) - throws GeneralSecurityException, IOException, NoSuchAlgorithmException { - - PrivateKey privateKey = null; - X509Certificate x509Cert = null; - Manifest manifest = null; - - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - FileInputStream fis = new FileInputStream(keystore); - keyStore.load(fis, storepass.toCharArray()); - fis.close(); - - KeyStore.PrivateKeyEntry entry = (KeyStore.PrivateKeyEntry)keyStore.getEntry( - alias, new KeyStore.PasswordProtection(keypass.toCharArray())); - if (entry != null) { - privateKey = entry.getPrivateKey(); - x509Cert = (X509Certificate) entry.getCertificate(); - } else { - throw new KeyStoreException("Couldn't get key"); - } - - JarOutputStream signedJar = new JarOutputStream(new FileOutputStream(outputJar, false)); - signedJar.setLevel(9); - if (privateKey != null && x509Cert != null) { - manifest = new Manifest(); - Attributes main = manifest.getMainAttributes(); - main.putValue("Manifest-Version", "1.0"); - main.putValue("Created-By", "1.0 (Android)"); - } - - writeZip(new FileInputStream(jarToSign), signedJar, manifest); - - closeJar(signedJar, manifest, privateKey, x509Cert); - } - - private static void writeZip(InputStream input, JarOutputStream output, Manifest manifest) - throws IOException, NoSuchAlgorithmException { - Base64.Encoder base64Encoder = Base64.getEncoder(); - MessageDigest messageDigest = MessageDigest.getInstance(DIGEST_ALGORITHM); - buffer = new byte[4096]; - - ZipInputStream zis = new ZipInputStream(input); - - try { - // loop on the entries of the intermediary package and put them in the final package. - ZipEntry entry; - while ((entry = zis.getNextEntry()) != null) { - String name = entry.getName(); - - // do not take directories or anything inside a potential META-INF folder. - if (entry.isDirectory() || name.startsWith("META-INF/")) { - continue; - } - - JarEntry newEntry; - - // Preserve the STORED method of the input entry. - if (entry.getMethod() == JarEntry.STORED) { - newEntry = new JarEntry(entry); - } else { - // Create a new entry so that the compressed len is recomputed. - newEntry = new JarEntry(name); - } - - writeEntry(output, zis, newEntry, messageDigest, manifest, base64Encoder); - - zis.closeEntry(); - } - } finally { - zis.close(); - } - } - - private static void writeEntry(JarOutputStream output, InputStream input, JarEntry entry, - MessageDigest digest, Manifest manifest, Base64.Encoder encoder) throws IOException { - output.putNextEntry(entry); - - // Write input stream to the jar output. - int count; - while ((count = input.read(buffer)) != -1) { - output.write(buffer, 0, count); - - if (digest != null) digest.update(buffer, 0, count); - } - - output.closeEntry(); - - if (manifest != null) { - Attributes attr = manifest.getAttributes(entry.getName()); - if (attr == null) { - attr = new Attributes(); - manifest.getEntries().put(entry.getName(), attr); - } - attr.putValue(DIGEST_ATTR, encoder.encodeToString(digest.digest())); - } - } - - private static void closeJar(JarOutputStream jar, Manifest manifest, - PrivateKey key, X509Certificate cert) - throws IOException, GeneralSecurityException { - if (manifest != null) { - // write the manifest to the jar file - jar.putNextEntry(new JarEntry(JarFile.MANIFEST_NAME)); - manifest.write(jar); - - // CERT.SF - Signature signature = Signature.getInstance("SHA1with" + key.getAlgorithm()); - signature.initSign(key); - jar.putNextEntry(new JarEntry("META-INF/CERT.SF")); - //Caching the SignatureOutputStream object for future use by the signature provider extensions. - certFileContents = new SignatureOutputStream(jar, signature); - writeSignatureFile(certFileContents, manifest); - - // CERT.* - jar.putNextEntry(new JarEntry("META-INF/CERT." + key.getAlgorithm())); - writeSignature(jar, signature, cert, key); - } - - jar.close(); - } - - // Writes a .SF file with a digest to the manifest. - private static void writeSignatureFile(SignatureOutputStream out, Manifest manifest) - throws IOException, GeneralSecurityException { - Manifest sf = new Manifest(); - Attributes main = sf.getMainAttributes(); - main.putValue("Signature-Version", "1.0"); - main.putValue("Created-By", "1.0 (Android)"); - - Base64.Encoder base64 = Base64.getEncoder(); - MessageDigest md = MessageDigest.getInstance(DIGEST_ALGORITHM); - PrintStream print = new PrintStream( - new DigestOutputStream(new ByteArrayOutputStream(), md), - true, "UTF-8"); - - // Digest of the entire manifest - manifest.write(print); - print.flush(); - main.putValue(DIGEST_MANIFEST_ATTR, base64.encodeToString(md.digest())); - - Map entries = manifest.getEntries(); - for (Map.Entry entry : entries.entrySet()) { - // Digest of the manifest stanza for this entry. - print.print("Name: " + entry.getKey() + "\r\n"); - for (Map.Entry att : entry.getValue().entrySet()) { - print.print(att.getKey() + ": " + att.getValue() + "\r\n"); - } - print.print("\r\n"); - print.flush(); - - Attributes sfAttr = new Attributes(); - sfAttr.putValue(DIGEST_ATTR, base64.encodeToString(md.digest())); - sf.getEntries().put(entry.getKey(), sfAttr); - } - - sf.write(out); - - // A bug in the java.util.jar implementation of Android platforms - // up to version 1.6 will cause a spurious IOException to be thrown - // if the length of the signature file is a multiple of 1024 bytes. - // As a workaround, add an extra CRLF in this case. - if ((out.size() % 1024) == 0) { - out.write('\r'); - out.write('\n'); - } - } - - private static void writeSignature(JarOutputStream outputJar, - Signature signature, X509Certificate publicKey, PrivateKey privateKey) - throws IOException, GeneralSecurityException{ - writeSignatureBlock(outputJar, signature, publicKey, privateKey); - } - - // Write the certificate file with a digital signature. - private static void writeSignatureBlock(JarOutputStream outputJar, - Signature signature, X509Certificate publicKey, PrivateKey privateKey) - throws IOException, GeneralSecurityException { - - SignerInfo signerInfo = new SignerInfo( - new X500Name(publicKey.getIssuerX500Principal().getName()), - publicKey.getSerialNumber(), - AlgorithmId.get(DIGEST_ALGORITHM), - AlgorithmId.get(privateKey.getAlgorithm()), - signature.sign()); - - PKCS7 pkcs7 = new PKCS7( - new AlgorithmId[] { AlgorithmId.get(DIGEST_ALGORITHM) }, - new ContentInfo(ContentInfo.DATA_OID, null), - new X509Certificate[] { publicKey }, - new SignerInfo[] { signerInfo }); - - pkcs7.encodeSignedData(outputJar); - } - - private static class SignatureOutputStream extends FilterOutputStream { - private Signature signature; - private int count = 0; - private List contents = new ArrayList(); - - public SignatureOutputStream(OutputStream out, Signature sig) { - super(out); - signature = sig; - } - - @Override - public void write(int b) throws IOException { - try { - signature.update((byte) b); - contents.add((byte)b); - } catch (SignatureException e) { - throw new IOException("SignatureException: " + e); - } - super.write(b); - count++; - } - - @Override - public void write(byte[] b, int off, int len) throws IOException { - try { - signature.update(b, off, len); - for (byte myByte: b) { - contents.add(myByte); - } - } catch (SignatureException e) { - throw new IOException("SignatureException: " + e); - } - super.write(b, off, len); - count += len; - } - - public int size() { - return count; - } - } -} \ No newline at end of file diff --git a/mode/templates/VRActivity.java.tmpl b/mode/templates/VRActivity.java.tmpl deleted file mode 100644 index 304996a34..000000000 --- a/mode/templates/VRActivity.java.tmpl +++ /dev/null @@ -1,16 +0,0 @@ -package @@package_name@@; - -import android.os.Bundle; - -import processing.vr.VRActivity; -import processing.core.PApplet; - -public class MainActivity extends VRActivity { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - PApplet sketch = new @@sketch_class_name@@(); - @@external@@ - setSketch(sketch); - } -} \ No newline at end of file diff --git a/mode/tools/SDKUpdater/.classpath b/mode/tools/SDKUpdater/.classpath deleted file mode 100644 index d1600092a..000000000 --- a/mode/tools/SDKUpdater/.classpath +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/mode/tools/SDKUpdater/.project b/mode/tools/SDKUpdater/.project deleted file mode 100644 index 82aae162e..000000000 --- a/mode/tools/SDKUpdater/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - android-mode-sdkupdater - - - - - - org.eclipse.jdt.core.javabuilder - - - - - - org.eclipse.jdt.core.javanature - - diff --git a/mode/version.properties b/mode/version.properties deleted file mode 100644 index c36a34497..000000000 --- a/mode/version.properties +++ /dev/null @@ -1,27 +0,0 @@ -# Basics -android-platform = 29 -android-toolslib = 27.1.1 -android-gradle-plugin = 4.1.3 -gradle-wrapper = 6.8.3 - -# Minimum SDK versions for each type of project -android-min-app = 17 -android-min-wallpaper = 17 -android-min-vr = 19 -android-min-ar = 24 -android-min-wear = 25 - -# Dependencies. Latest versions could be found at: -# https://mvnrepository.com -# https://repo.gradle.org -# The format below is group%artifact -androidx.appcompat%appcompat = 1.2.0 -androidx.legacy%legacy-support-v4 = 1.0.0 -com.google.android.support%wearable = 2.8.1 -com.google.android.gms%play-services-wearable = 17.0.0 -com.google.vr = 1.180.0 -com.google.ar = 1.22.0 -org.processing = 3.3.7 -org.gradle%gradle-tooling-api = 6.8.3 -org.slf4j = 1.7.30 -org.eclipse.jdt = 3.11.100 \ No newline at end of file diff --git a/processing/.gitignore b/processing/.gitignore new file mode 100644 index 000000000..9c6eb9d40 --- /dev/null +++ b/processing/.gitignore @@ -0,0 +1,14 @@ +mode/processing-core.zip +mode/mode/AndroidMode.jar +mode/mode/gradle-tooling-api* +mode/mode/slf4j* + +mode/mode/percent.jar +mode/mode/recyclerview-v7.jar +mode/mode/support-* +mode/mode/wearable.jar + +mode/libraries/vr/library +mode/libraries/ar/library +mode/tools/SDKUpdater/tool +mode/tools/SDKUpdater/lib diff --git a/processing/README.md b/processing/README.md new file mode 100644 index 000000000..743c8422c --- /dev/null +++ b/processing/README.md @@ -0,0 +1,6 @@ +Processing for Android +====================== + +This is the main repository for Processing for Android. It includes the core library inside the core folder, and the mode itself in the root. See the [wiki](https://github.com/processing/processing-android/wiki) for build instructions. + + diff --git a/processing/build.gradle b/processing/build.gradle new file mode 100644 index 000000000..9823664a5 --- /dev/null +++ b/processing/build.gradle @@ -0,0 +1,175 @@ +import java.nio.file.Files +import org.zeroturnaround.zip.ZipUtil +import org.apache.commons.io.FileUtils +import java.util.regex.Pattern +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath 'com.android.tools.build:gradle:7.3.1' + classpath group: 'commons-io', name: 'commons-io', version: '2.12.0' + classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.15' + } +} + +plugins { + id 'java' + id('io.github.gradle-nexus.publish-plugin') version '1.1.0' +} + +apply from: "${rootDir}/scripts/publish-root.gradle" + +allprojects { + apply plugin: 'java' + apply plugin: 'java-library' + + Properties versions = new Properties() + versions.load(project.rootProject.file("mode/version.properties").newDataInputStream()) + ext.targetSdkVersion = versions.getProperty("android-platform") + ext.appcompatVersion = versions.getProperty("androidx.appcompat%appcompat") + ext.v4legacyVersion = versions.getProperty("androidx.legacy%legacy-support-v4") + ext.wearVersion = versions.getProperty("com.google.android.support%wearable") + ext.gvrVersion = versions.getProperty("com.google.vr") + ext.garVersion = versions.getProperty("com.google.ar") + ext.processingVersion = versions.getProperty("org.processing") + ext.toolingVersion = versions.getProperty("org.gradle%gradle-tooling-api") + ext.slf4jVersion = versions.getProperty("org.slf4j") + ext.gradlewVersion = versions.getProperty("gradle-wrapper") + ext.toolsLibVersion = versions.getProperty("android-toolslib") + ext.jdtVersion = versions.getProperty("org.eclipse.jdt") + + Properties modeProperties = new Properties() + modeProperties.load(project.rootProject.file("mode/mode.properties").newDataInputStream()) + ext.modeVersion = modeProperties.getProperty("prettyVersion") + + Properties vrProperties = new Properties() + vrProperties.load(project.rootProject.file("mode/libraries/vr/library.properties").newDataInputStream()) + ext.vrLibVersion = vrProperties.getProperty("prettyVersion") + + Properties arProperties = new Properties() + arProperties.load(project.rootProject.file("mode/libraries/ar/library.properties").newDataInputStream()) + ext.arLibVersion = arProperties.getProperty("prettyVersion") + + + def fn = project.rootProject.file("local.properties") + if (!fn.exists()) { + if (System.env["ANDROID_SDK"] != null) { + def syspath = System.env["ANDROID_SDK"] + def parts = syspath.split(Pattern.quote(File.separator)) + def path = String.join("/", parts) + fn.withWriterAppend { w -> + w << "sdk.dir=${path}\n" + } + } else { + throw new GradleException( + "The file local.properties does not exist, and there is no ANDROID_SDK environmental variable defined in the system.\n" + + "Define ANDROID_SDK so it points to the location of the Android SDK, or create the local.properties file manually\n" + + "and add the following line to it:\n" + + "sdk.dir=") + } + } + + + Properties localProperties = new Properties() + localProperties.load(project.rootProject.file("local.properties").newDataInputStream()) + def sdkDir = localProperties.getProperty("sdk.dir") + ext.androidPlatformPath = "${sdkDir}/platforms/android-${targetSdkVersion}" + ext.coreZipPath = "${rootDir}/mode/processing-core.zip" + + repositories { + google() + mavenCentral() + maven { url "https://maven.google.com" } + maven { url "https://jitpack.io" } + maven { url 'https://repo.gradle.org/gradle/libs-releases' } + flatDir dirs: androidPlatformPath + flatDir dirs: "${rootDir}/core/build/libs" + } + + compileJava { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + + // Uncomment this option when building with Java 11+ + // https://github.com/processing/processing-android/issues/625 + // options.release = 8 + } +} + +clean.doFirst { + delete "dist" +} + +task dist { + dependsOn subprojects.build + doLast { + def root = "${buildDir}/zip/AndroidMode" + + // Copy assets to build dir + FileUtils.copyDirectory(file("mode/templates"), file("${root}/templates")) + FileUtils.copyDirectory(file("mode/examples"), file("${root}/examples")) + FileUtils.copyDirectory(file("mode/icons"), file("${root}/icons")) + FileUtils.copyDirectory(file("mode/theme"), file("${root}/theme")) + FileUtils.copyDirectory(file("mode/mode"), file("${root}/mode")) + delete "${root}/mode/core.jar" + delete "${root}/mode/pde.jar" + delete "${root}/mode/JavaMode.jar" + // delete "${root}/mode/jdi.jar" + // delete "${root}/mode/jdimodel.jar" + + Files.copy(file("mode/processing-core.zip").toPath(), + file("${root}/processing-core.zip").toPath(), REPLACE_EXISTING) + + Files.copy(file("mode/keywords.txt").toPath(), + file("${root}/keywords.txt").toPath(), REPLACE_EXISTING) + + Files.copy(file("mode/version.properties").toPath(), + file("${root}/version.properties").toPath(), REPLACE_EXISTING) + + Files.copy(file("mode/mode.properties").toPath(), + file("${root}/mode.properties").toPath(), REPLACE_EXISTING) + + FileUtils.copyDirectory(file("mode/languages"), + file("${root}/languages")) + + FileUtils.copyDirectory(file("mode/resources"), + file("${root}/resources")) + + FileUtils.copyDirectory(file("mode/tools/SDKUpdater/tool"), + file("${root}/tools/SDKUpdater/tool")) + FileUtils.copyDirectory(file("mode/tools/SDKUpdater/lib"), + file("${root}/tools/SDKUpdater/lib")) + FileUtils.copyDirectory(file("mode/tools/SDKUpdater/src"), + file("${root}/tools/SDKUpdater/src")) + + FileUtils.copyDirectory(file("mode/libraries/vr/examples"), + file("${root}/libraries/vr/examples")) + FileUtils.copyDirectory(file("mode/libraries/vr/library"), + file("${root}/libraries/vr/library")) + FileUtils.copyDirectory(file("mode/libraries/vr/libs"), + file("${root}/libraries/vr/libs")) + FileUtils.copyDirectory(file("../libs/processing-vr/src/main/java/"), + file("${root}/libraries/vr/src")) + Files.copy(file("mode/libraries/vr/library.properties").toPath(), + file("${root}/libraries/vr/library.properties").toPath(), REPLACE_EXISTING) + + FileUtils.copyDirectory(file("mode/libraries/ar/examples"), + file("${root}/libraries/ar/examples")) + FileUtils.copyDirectory(file("mode/libraries/ar/library"), + file("${root}/libraries/ar/library")) + FileUtils.copyDirectory(file("../libs/processing-ar/src/main/java/"), + file("${root}/libraries/ar/src")) + Files.copy(file("mode/libraries/ar/library.properties").toPath(), + file("${root}/libraries/ar/library.properties").toPath(), REPLACE_EXISTING) + + File distFolder = file("dist") + distFolder.mkdirs() + ZipUtil.pack(file("${buildDir}/zip"), new File("dist/AndroidMode.zip")) + Files.copy(file("mode/mode.properties").toPath(), + file("dist/AndroidMode.txt").toPath(), REPLACE_EXISTING) + } +} diff --git a/buildSrc/build.gradle b/processing/buildSrc/build.gradle similarity index 53% rename from buildSrc/build.gradle rename to processing/buildSrc/build.gradle index a95a3cb68..e6ffdbeb9 100644 --- a/buildSrc/build.gradle +++ b/processing/buildSrc/build.gradle @@ -11,5 +11,7 @@ repositories { dependencies { implementation gradleApi() implementation localGroovy() - implementation 'com.android.tools.build:gradle:4.1.1' + implementation 'com.android.tools.build:gradle:7.3.1' + implementation 'com.google.guava:guava:32.0.0-jre' + implementation 'com.android.tools:common:25.3.0' } \ No newline at end of file diff --git a/processing/buildSrc/src/main/groovy/ImportAar.groovy b/processing/buildSrc/src/main/groovy/ImportAar.groovy new file mode 100644 index 000000000..fc20588f1 --- /dev/null +++ b/processing/buildSrc/src/main/groovy/ImportAar.groovy @@ -0,0 +1,237 @@ +// import org.gradle.api.Plugin +// import org.gradle.api.Project +// import org.gradle.api.artifacts.Configuration +// import org.gradle.api.artifacts.transform.TransformAction +// import org.gradle.api.artifacts.transform.TransformParameters +// import org.gradle.api.artifacts.transform.InputArtifact +// import org.gradle.api.artifacts.transform.TransformOutputs +// import org.gradle.api.file.FileSystemLocation +// import org.gradle.api.provider.Provider +// import org.gradle.api.tasks.PathSensitive +// import org.gradle.api.tasks.PathSensitivity + +// import org.gradle.api.attributes.LibraryElements +// import org.gradle.api.attributes.Usage +// import org.gradle.api.attributes.Category + +// import com.android.build.gradle.internal.dependency.AarTransform +// import com.android.build.gradle.internal.dependency.ExtractAarTransform +// import com.android.build.gradle.internal.publishing.AndroidArtifacts +// import com.android.builder.aar.AarExtractor +// import com.google.common.collect.ImmutableList + +// import java.nio.file.Files +// import static java.nio.file.StandardCopyOption.REPLACE_EXISTING + + +// import org.gradle.api.Plugin +// import org.gradle.api.Project +// import org.gradle.api.artifacts.Configuration +// import org.gradle.api.artifacts.ResolvedArtifact +// import java.util.zip.ZipFile + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration +import org.gradle.api.tasks.TaskAction +import java.util.zip.ZipFile + +/** + * Build Gradle plgin needed to use aar files as dependencies in a pure java library project. + * Adapted from the following plugin by nekocode + * https://github.com/nekocode/Gradle-Import-Aar + * Ported to Groovy, and made specific to the needs of the Android mode build process (i.e.: this plugin + * is not meant to be used with other projects). + * Ported to Gradle 8 replacing the deprecated ArtifactTransform with the new TransformAction API. + */ +class ImportAar implements Plugin { + final String CONFIG_NAME_POSTFIX = "Aar" + + @Override + void apply(Project project) { + // def aar = AndroidArtifacts.TYPE_AAR + // def jar = AndroidArtifacts.TYPE_JAR + + println ">>> Calling ImportAar" + + // Create a custom resolvable configuration + project.configurations.create('aarExtractorResolvable') { + canBeResolved = true + canBeConsumed = false + extendsFrom project.configurations.implementation + } + + project.tasks.register('extractAarJars', ExtractAarJarsTask) { + group = 'build' + description = 'Extracts JAR files from AAR dependencies and places them in build/libs.' + } + + + // project.task('extractAarJars') { + // doLast { + // println "=======> Calling extractAarJars task" + + // project.configurations.each { Configuration config -> + // config.resolvedConfiguration.resolvedArtifacts.each { ResolvedArtifact artifact -> + // println "Resolved artifact: ${artifact}" + // if (artifact.type == 'aar') { + // extractJarFromAar(artifact, project) + // } + // } + // } + // } + // } + + + +/* + // Create AAR configurations + Collection allConfigs = project.getConfigurations().toList() + for (Configuration config: allConfigs) { + println config + Configuration aarConfig = project.configurations.maybeCreate(config.name + CONFIG_NAME_POSTFIX) + println aarConfig + + // Add extracted jars to original configuration after project evaluating + aarConfig.attributes { + attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements, LibraryElements.JAR)) + attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage, Usage.JAVA_RUNTIME)) + attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category, Category.LIBRARY)) + } + + project.afterEvaluate { + println "-> In afterEvaluate" + aarConfig.resolvedConfiguration.resolvedArtifacts.each { artifact -> + File jarFile = artifact.file + print "================================================> FILE " + println jarFile + println jarFile.getName() + + // Add jar file to classpath + project.sourceSets.main.compileClasspath += project.files(jarFile) + + File libraryFolder = new File(project.buildDir, "libs") + libraryFolder.mkdirs() + + // Strip version number when copying + String name = jarFile.name + int p = name.lastIndexOf("-") + String libName = name.substring(0, p) + ".jar" + File libraryJar = new File(libraryFolder, libName) + Files.copy(jarFile.toPath(), libraryJar.toPath(), REPLACE_EXISTING) + } + } + } + + // Register aar transform + project.dependencies { + registerTransform(AarToJarTransform) { + from.attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements, aar)) + to.attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, project.objects.named(LibraryElements, jar)) + } + } + */ + } + + // void extractJarFromAar(ResolvedArtifact artifact, Project project) { + // println "Input AAR: ${aarFile}" + // def aarFile = artifact.file + // def zipFile = new ZipFile(aarFile) + // def entry = zipFile.getEntry('classes.jar') + // if (entry) { + // project.copy { + // from project.zipTree(aarFile) + // include 'classes.jar' + // into "${project.buildDir}/libs" + // rename { "${artifact.name}-${artifact.moduleVersion.id.version}.jar" } + // } + // } + // zipFile.close() + // } + + + // abstract static class AarToJarTransform implements TransformAction { + // AarToJarTransform() { + // println "AarToJarTransform instantiated" + // } + + // @InputArtifact + // @PathSensitive(PathSensitivity.NAME_ONLY) + // abstract Provider getInputArtifact() + + // @Override + // void transform(TransformOutputs outputs) { + // File inputFile = inputArtifact.get().asFile + // println "Input AAR: ${inputFile}" + // File explodedDir = new File(outputs.getOutputDirectory(), "exploded") + // println "Exploded Directory: ${explodedDir}" + + // AarExtractor aarExtractor = new AarExtractor() + // aarExtractor.extract(inputFile, explodedDir) + // File classesJar = new File(new File(explodedDir, "jars"), "classes.jar") + // if (classesJar.exists()) { + // println "Classes JAR found: ${classesJar}" + // String aarName = inputFile.name.replace(".aar", "") + // File renamedJar = outputs.file("${aarName}.jar") + // Files.copy(classesJar.toPath(), renamedJar.toPath(), REPLACE_EXISTING) + // println "Transformed JAR: ${renamedJar}" + // } else { + // println "Error: classes.jar not found in ${explodedDir}" + // } + // } + // } +} + + +class ExtractAarJarsTask extends org.gradle.api.DefaultTask { + @TaskAction + void extractJars() { + //File outputDir = new File(project.buildDir, 'libs') + File outputDir = new File(System.getProperty("user.dir"), "build/libs") + outputDir.mkdirs() + + // Configuration compileClasspath = project.configurations.getByName('implementation') + Configuration aarExtractorResolvable = project.configurations.getByName('aarExtractorResolvable') + + // compileClasspath.resolvedConfiguration.resolvedArtifacts.each { artifact -> + aarExtractorResolvable.resolvedConfiguration.resolvedArtifacts.each { artifact -> + if (artifact.type == 'aar') { + File aarFile = artifact.file + println "Processing AAR: ${aarFile.name}" + + // Extract the AAR file + ZipFile zipFile = new ZipFile(aarFile) + zipFile.entries().each { entry -> + if (entry.name.endsWith('.jar')) { + println "Classes JAR found: ${entry}" + String aarName = aarFile.name.replace(".aar", "") + String jarName = "${aarName}.jar".replaceFirst(/-\d+(\.\d+)*(?=\.jar$)/, '') + + File jarOutput = new File(outputDir, jarName) + jarOutput.parentFile.mkdirs() + + // Write the JAR file to the output directory + zipFile.getInputStream(entry).withCloseable { inputStream -> + jarOutput.withOutputStream { outputStream -> + copyStream(inputStream, outputStream) + } + } + println "Extracted JAR: ${jarOutput.absolutePath}" + } + } + } + } + } + + /** + * Copies data from an InputStream to an OutputStream. + */ + void copyStream(InputStream input, OutputStream output) { + byte[] buffer = new byte[1024] + int bytesRead + while ((bytesRead = input.read(buffer)) != -1) { + output.write(buffer, 0, bytesRead) + } + } +} + diff --git a/processing/buildSrc/src/main/resources/META-INF/gradle-plugins/ImportAar.properties b/processing/buildSrc/src/main/resources/META-INF/gradle-plugins/ImportAar.properties new file mode 100644 index 000000000..f41e15936 --- /dev/null +++ b/processing/buildSrc/src/main/resources/META-INF/gradle-plugins/ImportAar.properties @@ -0,0 +1 @@ +implementation-class=ImportAar \ No newline at end of file diff --git a/processing/core/build.gradle b/processing/core/build.gradle new file mode 100644 index 000000000..07a8b8b73 --- /dev/null +++ b/processing/core/build.gradle @@ -0,0 +1,110 @@ +import org.apache.tools.ant.Project +import java.nio.file.Files +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + +plugins { + id 'ImportAar' + id 'java-library' + id 'maven-publish' +} + +dependencies { + implementation name: "android" + implementation "androidx.legacy:legacy-support-v4:${v4legacyVersion}" + implementation "com.google.android.support:wearable:${wearVersion}" +} + +sourceSets.main { + java.srcDir("../../libs/processing-core/src/main/java/") + resources.srcDir("../../libs/processing-core/src/main/") + resources.exclude("AndroidManifest.xml", "**/java/**") +} + +tasks.register('sourceJar', Jar) { + dependsOn classes + duplicatesStrategy = DuplicatesStrategy.INCLUDE + archiveClassifier.set("sources") + from sourceSets.main.allSource +} + +// Does not work because of Processing-specific tags in source code, such as @webref +tasks.register('javadocJar', Jar) { + dependsOn javadoc + archiveClassifier.set("javadoc") + from javadoc.destinationDir +} + +// project.afterEvaluate { +// tasks.named('extractAarJars').configure { +// dependsOn configurations.runtimeClasspath +// } +// } + +// project.tasks.named('build').configure { +// finalizedBy('extractAarJars') +// } + +artifacts { +// archives javadocJar + archives sourceJar +} + +jar.doLast { task -> + ant.checksum file: task.archiveFile.get().asFile +} + +tasks.named('clean').configure { + doFirst { + delete "dist" + delete "${coreZipPath}" + } +} + +tasks.named('compileJava').configure { + doFirst { + String[] deps = ["wearable.jar"] + deps.each { fn -> + Files.copy(file("${rootDir}/build/libs/${fn}").toPath(), + file("${rootDir}/mode/mode/${fn}").toPath(), REPLACE_EXISTING) + } + } +} + +tasks.named('build').configure { + doLast { + // Need to check the existance of the files before using as the files + // will get generated only if Task :core:jar is not being skipped + // Task :core:jar will be skipped if source files are unchanged or jar task is UP-TO-DATE + if (file("${buildDir}/libs/core.jar").exists()) { + // Copying core jar as zip inside the mode folder + Files.copy(file("${buildDir}/libs/core.jar").toPath(), + file("${coreZipPath}").toPath(), REPLACE_EXISTING) + } + // Renaming artifacts for maven publishing + if (file("${buildDir}/libs/core.jar").exists()) { + Files.move(file("${buildDir}/libs/core.jar").toPath(), + file("$buildDir/libs/processing-core-${modeVersion}.jar").toPath(), REPLACE_EXISTING) + } + if (file("${buildDir}/libs/core-sources.jar").exists()) { + Files.move(file("${buildDir}/libs/core-sources.jar").toPath(), + file("$buildDir/libs/processing-core-${modeVersion}-sources.jar").toPath(), REPLACE_EXISTING) + } + if (file("${buildDir}/libs/core.jar.MD5").exists()) { + Files.move(file("${buildDir}/libs/core.jar.MD5").toPath(), + file("$buildDir/libs/processing-core-${modeVersion}.jar.md5").toPath(), REPLACE_EXISTING) + } + } +} + +ext { + libName = 'processing-core' + libVersion = modeVersion + libJar = "${buildDir}/libs/${libName}-${libVersion}.jar" + libSrc = "${buildDir}/libs/${libName}-${libVersion}-sources.jar" + libMd5 = "${buildDir}/libs/${libName}-${libVersion}-sources.jar.md5" + libDependencies = [[name: 'legacy-support-v4', group: 'androidx.legacy', version: v4legacyVersion], + [name: 'wearable', group: 'com.google.android.support', version: wearVersion], + [name: 'android']] +} + +apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" diff --git a/processing/gradle.properties b/processing/gradle.properties new file mode 100644 index 000000000..5465fec0e --- /dev/null +++ b/processing/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true \ No newline at end of file diff --git a/debug/gradle/wrapper/gradle-wrapper.jar b/processing/gradle/wrapper/gradle-wrapper.jar similarity index 61% rename from debug/gradle/wrapper/gradle-wrapper.jar rename to processing/gradle/wrapper/gradle-wrapper.jar index e708b1c02..41d9927a4 100644 Binary files a/debug/gradle/wrapper/gradle-wrapper.jar and b/processing/gradle/wrapper/gradle-wrapper.jar differ diff --git a/debug/gradle/wrapper/gradle-wrapper.properties b/processing/gradle/wrapper/gradle-wrapper.properties similarity index 92% rename from debug/gradle/wrapper/gradle-wrapper.properties rename to processing/gradle/wrapper/gradle-wrapper.properties index 442d9132e..d6e308a63 100644 --- a/debug/gradle/wrapper/gradle-wrapper.properties +++ b/processing/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/processing/gradlew b/processing/gradlew new file mode 100755 index 000000000..1b6c78733 --- /dev/null +++ b/processing/gradlew @@ -0,0 +1,234 @@ +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://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 License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit + +APP_NAME="Gradle" +APP_BASE_NAME=${0##*/} + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/processing/gradlew.bat similarity index 100% rename from gradlew.bat rename to processing/gradlew.bat diff --git a/processing/mode/.classpath b/processing/mode/.classpath new file mode 100644 index 000000000..3242dff64 --- /dev/null +++ b/processing/mode/.classpath @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/processing/mode/.project b/processing/mode/.project new file mode 100644 index 000000000..e89bdfe07 --- /dev/null +++ b/processing/mode/.project @@ -0,0 +1,34 @@ + + + android-mode + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1675640664215 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/processing/mode/.settings/org.eclipse.buildship.core.prefs b/processing/mode/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..e8895216f --- /dev/null +++ b/processing/mode/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/mode/tools/SDKUpdater/.settings/org.eclipse.jdt.core.prefs b/processing/mode/.settings/org.eclipse.jdt.core.prefs similarity index 61% rename from mode/tools/SDKUpdater/.settings/org.eclipse.jdt.core.prefs rename to processing/mode/.settings/org.eclipse.jdt.core.prefs index d17b6724d..0fee6a9c4 100644 --- a/mode/tools/SDKUpdater/.settings/org.eclipse.jdt.core.prefs +++ b/processing/mode/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,15 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=disabled +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/processing/mode/build.gradle b/processing/mode/build.gradle new file mode 100644 index 000000000..0f34a95d9 --- /dev/null +++ b/processing/mode/build.gradle @@ -0,0 +1,102 @@ +import java.nio.file.Files +import org.zeroturnaround.zip.ZipUtil +import org.apache.commons.io.FileUtils +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + +plugins { + id 'java' +} + +// Extend compile to copy the jars from gradle-tooling and slf4j: +// https://stackoverflow.com/a/43602463 +configurations { + implementationCopy + implementationExtract +} + +dependencies { + // implementation group: "org.processing", name: "core", version: "${processingVersion}" + // implementation group: "org.processing", name: "pde", version: "${processingVersion}" + // implementation group: "org.processing", name: "java-mode", version: "${processingVersion}" + + implementationExtract "org.eclipse.jdt:org.eclipse.jdt.debug:${jdtVersion}" + + implementationCopy "org.gradle:gradle-tooling-api:${toolingVersion}" + implementationCopy "org.slf4j:slf4j-api:${slf4jVersion}" + implementationCopy "org.slf4j:slf4j-simple:${slf4jVersion}" + + implementation fileTree(include: ["jdi.jar", "jdimodel.jar", "core.jar", "pde.jar", "JavaMode.jar"], dir: 'mode') +} + +// This task copies the gradle tooling jar into the mode folder +tasks.register("copyToLib", Copy) { + from(configurations.implementationCopy) + into("mode") +} + +tasks.named('build') { + dependsOn 'copyToLib' +} + +tasks.named('compileJava') { + dependsOn 'copyToLib' +} + +sourceSets.main.java.srcDir("src/") + +tasks.register('getjdi', Copy) { + // This task extracts the jar files inside org.eclipse.jdt.debug, which are + // jdi.jar and jdimodel.jar and needed to build the debugger. + from(zipTree(configurations.implementationExtract.singleFile)) { + include '**/*.jar' + exclude 'META-INF' + } + into "mode" +} + +tasks.register('permissions', Exec) { + // This task retrieves the latest list of Android permissions and adds them + // to the Permissions.java file. The python scripts requries BeautifulSoup + workingDir "scripts" + commandLine "python", "permissions.py" +} + + +tasks.register("wrapper", Wrapper) { + gradleVersion = "${gradlewVersion}" // version required for gradle wrapper +} + +tasks.named("wrapper").configure { + doLast { + def wrapperFolder = file("mode/gradlew") + wrapperFolder.mkdirs() + file("gradle").renameTo(file("mode/gradlew/gradle")) + file("gradlew").renameTo(file("mode/gradlew/gradlew")) + file("gradlew.bat").renameTo(file("mode/gradlew/gradlew.bat")) + FileUtils.copyDirectory(file("gradle"), file("../debug/gradle")) + delete("gradle") + ZipUtil.pack(file("mode/gradlew"), new File("mode/mode/gradlew.zip")) + delete("mode/gradlew") + } +} + +tasks.named('clean') { + doFirst { + delete fileTree("mode") { + include "**/*.jar" + exclude "jdi.jar", "jdimodel.jar", "istack-commons-runtime.jar", "javax.activation-api.jar", + "jaxb-api.jar", "jaxb-jxc.jar", "jaxb-runtime.jar", "jaxb-xjc.jar", "core.jar", + "pde.jar", "JavaMode.jar", "org.eclipse.core.contenttype.jar", "org.eclipse.core.jobs.jar", + "org.eclipse.core.resources.jar", "org.eclipse.core.runtime.jar", "org.eclipse.equinox.common.jar", + "org.eclipse.equinox.preferences.jar", "org.eclipse.jdt.core.jar", "org.eclipse.osgi.jar", + "org.eclipse.text.jar" + } + } +} + +tasks.named('build') { + doLast { + Files.copy(file("$buildDir/libs/mode.jar").toPath(), + file("mode/AndroidMode.jar").toPath(), REPLACE_EXISTING) + } +} \ No newline at end of file diff --git a/mode/examples/Basics/Arrays/Array/Array.pde b/processing/mode/examples/Basics/Arrays/Array/Array.pde similarity index 100% rename from mode/examples/Basics/Arrays/Array/Array.pde rename to processing/mode/examples/Basics/Arrays/Array/Array.pde diff --git a/mode/examples/Basics/Arrays/Array2D/Array2D.pde b/processing/mode/examples/Basics/Arrays/Array2D/Array2D.pde similarity index 100% rename from mode/examples/Basics/Arrays/Array2D/Array2D.pde rename to processing/mode/examples/Basics/Arrays/Array2D/Array2D.pde diff --git a/mode/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde b/processing/mode/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde similarity index 100% rename from mode/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde rename to processing/mode/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde diff --git a/mode/examples/Basics/Arrays/ArrayObjects/Module.pde b/processing/mode/examples/Basics/Arrays/ArrayObjects/Module.pde similarity index 100% rename from mode/examples/Basics/Arrays/ArrayObjects/Module.pde rename to processing/mode/examples/Basics/Arrays/ArrayObjects/Module.pde diff --git a/mode/examples/Basics/Camera/MoveEye/MoveEye.pde b/processing/mode/examples/Basics/Camera/MoveEye/MoveEye.pde similarity index 100% rename from mode/examples/Basics/Camera/MoveEye/MoveEye.pde rename to processing/mode/examples/Basics/Camera/MoveEye/MoveEye.pde diff --git a/mode/examples/Basics/Camera/Perspective/Perspective.pde b/processing/mode/examples/Basics/Camera/Perspective/Perspective.pde similarity index 100% rename from mode/examples/Basics/Camera/Perspective/Perspective.pde rename to processing/mode/examples/Basics/Camera/Perspective/Perspective.pde diff --git a/mode/examples/Basics/Color/Brightness/Brightness.pde b/processing/mode/examples/Basics/Color/Brightness/Brightness.pde similarity index 100% rename from mode/examples/Basics/Color/Brightness/Brightness.pde rename to processing/mode/examples/Basics/Color/Brightness/Brightness.pde diff --git a/mode/examples/Basics/Color/ColorWheel/ColorWheel.pde b/processing/mode/examples/Basics/Color/ColorWheel/ColorWheel.pde similarity index 100% rename from mode/examples/Basics/Color/ColorWheel/ColorWheel.pde rename to processing/mode/examples/Basics/Color/ColorWheel/ColorWheel.pde diff --git a/mode/examples/Basics/Color/Creating/Creating.pde b/processing/mode/examples/Basics/Color/Creating/Creating.pde similarity index 100% rename from mode/examples/Basics/Color/Creating/Creating.pde rename to processing/mode/examples/Basics/Color/Creating/Creating.pde diff --git a/mode/examples/Basics/Color/Hue/Hue.pde b/processing/mode/examples/Basics/Color/Hue/Hue.pde similarity index 100% rename from mode/examples/Basics/Color/Hue/Hue.pde rename to processing/mode/examples/Basics/Color/Hue/Hue.pde diff --git a/mode/examples/Basics/Color/LinearGradient/LinearGradient.pde b/processing/mode/examples/Basics/Color/LinearGradient/LinearGradient.pde similarity index 100% rename from mode/examples/Basics/Color/LinearGradient/LinearGradient.pde rename to processing/mode/examples/Basics/Color/LinearGradient/LinearGradient.pde diff --git a/mode/examples/Basics/Color/RadialGradient/RadialGradient.pde b/processing/mode/examples/Basics/Color/RadialGradient/RadialGradient.pde similarity index 100% rename from mode/examples/Basics/Color/RadialGradient/RadialGradient.pde rename to processing/mode/examples/Basics/Color/RadialGradient/RadialGradient.pde diff --git a/mode/examples/Basics/Color/RadialGradient2/RadialGradient2.pde b/processing/mode/examples/Basics/Color/RadialGradient2/RadialGradient2.pde similarity index 100% rename from mode/examples/Basics/Color/RadialGradient2/RadialGradient2.pde rename to processing/mode/examples/Basics/Color/RadialGradient2/RadialGradient2.pde diff --git a/mode/examples/Basics/Color/Reading/Reading.pde b/processing/mode/examples/Basics/Color/Reading/Reading.pde similarity index 100% rename from mode/examples/Basics/Color/Reading/Reading.pde rename to processing/mode/examples/Basics/Color/Reading/Reading.pde diff --git a/mode/examples/Basics/Color/Reading/data/cait.jpg b/processing/mode/examples/Basics/Color/Reading/data/cait.jpg similarity index 100% rename from mode/examples/Basics/Color/Reading/data/cait.jpg rename to processing/mode/examples/Basics/Color/Reading/data/cait.jpg diff --git a/mode/examples/Basics/Color/Relativity/Relativity.pde b/processing/mode/examples/Basics/Color/Relativity/Relativity.pde similarity index 100% rename from mode/examples/Basics/Color/Relativity/Relativity.pde rename to processing/mode/examples/Basics/Color/Relativity/Relativity.pde diff --git a/mode/examples/Basics/Color/Saturation/Saturation.pde b/processing/mode/examples/Basics/Color/Saturation/Saturation.pde similarity index 100% rename from mode/examples/Basics/Color/Saturation/Saturation.pde rename to processing/mode/examples/Basics/Color/Saturation/Saturation.pde diff --git a/mode/examples/Basics/Color/WaveGradient/WaveGradient.pde b/processing/mode/examples/Basics/Color/WaveGradient/WaveGradient.pde similarity index 100% rename from mode/examples/Basics/Color/WaveGradient/WaveGradient.pde rename to processing/mode/examples/Basics/Color/WaveGradient/WaveGradient.pde diff --git a/mode/examples/Basics/Control/Conditionals1/Conditionals1.pde b/processing/mode/examples/Basics/Control/Conditionals1/Conditionals1.pde similarity index 100% rename from mode/examples/Basics/Control/Conditionals1/Conditionals1.pde rename to processing/mode/examples/Basics/Control/Conditionals1/Conditionals1.pde diff --git a/mode/examples/Basics/Control/Conditionals2/Conditionals2.pde b/processing/mode/examples/Basics/Control/Conditionals2/Conditionals2.pde similarity index 100% rename from mode/examples/Basics/Control/Conditionals2/Conditionals2.pde rename to processing/mode/examples/Basics/Control/Conditionals2/Conditionals2.pde diff --git a/mode/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde b/processing/mode/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde similarity index 100% rename from mode/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde rename to processing/mode/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde diff --git a/mode/examples/Basics/Control/Iteration/Iteration.pde b/processing/mode/examples/Basics/Control/Iteration/Iteration.pde similarity index 100% rename from mode/examples/Basics/Control/Iteration/Iteration.pde rename to processing/mode/examples/Basics/Control/Iteration/Iteration.pde diff --git a/mode/examples/Basics/Control/LogicalOperators/LogicalOperators.pde b/processing/mode/examples/Basics/Control/LogicalOperators/LogicalOperators.pde similarity index 100% rename from mode/examples/Basics/Control/LogicalOperators/LogicalOperators.pde rename to processing/mode/examples/Basics/Control/LogicalOperators/LogicalOperators.pde diff --git a/mode/examples/Basics/Data/CharactersStrings/CharactersStrings.pde b/processing/mode/examples/Basics/Data/CharactersStrings/CharactersStrings.pde similarity index 100% rename from mode/examples/Basics/Data/CharactersStrings/CharactersStrings.pde rename to processing/mode/examples/Basics/Data/CharactersStrings/CharactersStrings.pde diff --git a/mode/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw b/processing/mode/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw similarity index 100% rename from mode/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw rename to processing/mode/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw diff --git a/mode/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg b/processing/mode/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg similarity index 100% rename from mode/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg rename to processing/mode/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg diff --git a/mode/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde b/processing/mode/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde similarity index 100% rename from mode/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde rename to processing/mode/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde diff --git a/mode/examples/Basics/Data/IntegersFloats/IntegersFloats.pde b/processing/mode/examples/Basics/Data/IntegersFloats/IntegersFloats.pde similarity index 100% rename from mode/examples/Basics/Data/IntegersFloats/IntegersFloats.pde rename to processing/mode/examples/Basics/Data/IntegersFloats/IntegersFloats.pde diff --git a/mode/examples/Basics/Data/TrueFalse/TrueFalse.pde b/processing/mode/examples/Basics/Data/TrueFalse/TrueFalse.pde similarity index 100% rename from mode/examples/Basics/Data/TrueFalse/TrueFalse.pde rename to processing/mode/examples/Basics/Data/TrueFalse/TrueFalse.pde diff --git a/mode/examples/Basics/Data/VariableScope/VariableScope.pde b/processing/mode/examples/Basics/Data/VariableScope/VariableScope.pde similarity index 100% rename from mode/examples/Basics/Data/VariableScope/VariableScope.pde rename to processing/mode/examples/Basics/Data/VariableScope/VariableScope.pde diff --git a/mode/examples/Basics/Data/Variables/Variables.pde b/processing/mode/examples/Basics/Data/Variables/Variables.pde similarity index 100% rename from mode/examples/Basics/Data/Variables/Variables.pde rename to processing/mode/examples/Basics/Data/Variables/Variables.pde diff --git a/mode/examples/Basics/Form/Bezier/Bezier.pde b/processing/mode/examples/Basics/Form/Bezier/Bezier.pde similarity index 100% rename from mode/examples/Basics/Form/Bezier/Bezier.pde rename to processing/mode/examples/Basics/Form/Bezier/Bezier.pde diff --git a/mode/examples/Basics/Form/BezierEllipse/BezierEllipse.pde b/processing/mode/examples/Basics/Form/BezierEllipse/BezierEllipse.pde similarity index 100% rename from mode/examples/Basics/Form/BezierEllipse/BezierEllipse.pde rename to processing/mode/examples/Basics/Form/BezierEllipse/BezierEllipse.pde diff --git a/mode/examples/Basics/Form/PieChart/PieChart.pde b/processing/mode/examples/Basics/Form/PieChart/PieChart.pde similarity index 100% rename from mode/examples/Basics/Form/PieChart/PieChart.pde rename to processing/mode/examples/Basics/Form/PieChart/PieChart.pde diff --git a/mode/examples/Basics/Form/PointsLines/PointsLines.pde b/processing/mode/examples/Basics/Form/PointsLines/PointsLines.pde similarity index 100% rename from mode/examples/Basics/Form/PointsLines/PointsLines.pde rename to processing/mode/examples/Basics/Form/PointsLines/PointsLines.pde diff --git a/mode/examples/Basics/Form/Primitives3D/Primitives3D.pde b/processing/mode/examples/Basics/Form/Primitives3D/Primitives3D.pde similarity index 100% rename from mode/examples/Basics/Form/Primitives3D/Primitives3D.pde rename to processing/mode/examples/Basics/Form/Primitives3D/Primitives3D.pde diff --git a/mode/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde b/processing/mode/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde similarity index 100% rename from mode/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde rename to processing/mode/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde diff --git a/mode/examples/Basics/Form/SimpleCurves/SimpleCurves.pde b/processing/mode/examples/Basics/Form/SimpleCurves/SimpleCurves.pde similarity index 100% rename from mode/examples/Basics/Form/SimpleCurves/SimpleCurves.pde rename to processing/mode/examples/Basics/Form/SimpleCurves/SimpleCurves.pde diff --git a/mode/examples/Basics/Form/TriangleStrip/TriangleStrip.pde b/processing/mode/examples/Basics/Form/TriangleStrip/TriangleStrip.pde similarity index 100% rename from mode/examples/Basics/Form/TriangleStrip/TriangleStrip.pde rename to processing/mode/examples/Basics/Form/TriangleStrip/TriangleStrip.pde diff --git a/mode/examples/Basics/Form/Vertices/Vertices.pde b/processing/mode/examples/Basics/Form/Vertices/Vertices.pde similarity index 100% rename from mode/examples/Basics/Form/Vertices/Vertices.pde rename to processing/mode/examples/Basics/Form/Vertices/Vertices.pde diff --git a/mode/examples/Basics/Image/Alphamask/Alphamask.pde b/processing/mode/examples/Basics/Image/Alphamask/Alphamask.pde similarity index 100% rename from mode/examples/Basics/Image/Alphamask/Alphamask.pde rename to processing/mode/examples/Basics/Image/Alphamask/Alphamask.pde diff --git a/mode/examples/Basics/Image/Alphamask/data/mask.jpg b/processing/mode/examples/Basics/Image/Alphamask/data/mask.jpg similarity index 100% rename from mode/examples/Basics/Image/Alphamask/data/mask.jpg rename to processing/mode/examples/Basics/Image/Alphamask/data/mask.jpg diff --git a/mode/examples/Basics/Image/Alphamask/data/test.jpg b/processing/mode/examples/Basics/Image/Alphamask/data/test.jpg similarity index 100% rename from mode/examples/Basics/Image/Alphamask/data/test.jpg rename to processing/mode/examples/Basics/Image/Alphamask/data/test.jpg diff --git a/mode/examples/Basics/Image/BackgroundImage/BackgroundImage.pde b/processing/mode/examples/Basics/Image/BackgroundImage/BackgroundImage.pde similarity index 100% rename from mode/examples/Basics/Image/BackgroundImage/BackgroundImage.pde rename to processing/mode/examples/Basics/Image/BackgroundImage/BackgroundImage.pde diff --git a/mode/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg b/processing/mode/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg similarity index 100% rename from mode/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg rename to processing/mode/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg diff --git a/mode/examples/Basics/Image/CreateImage/CreateImage.pde b/processing/mode/examples/Basics/Image/CreateImage/CreateImage.pde similarity index 100% rename from mode/examples/Basics/Image/CreateImage/CreateImage.pde rename to processing/mode/examples/Basics/Image/CreateImage/CreateImage.pde diff --git a/mode/examples/Basics/Image/CreateImage/data/mask.jpg b/processing/mode/examples/Basics/Image/CreateImage/data/mask.jpg similarity index 100% rename from mode/examples/Basics/Image/CreateImage/data/mask.jpg rename to processing/mode/examples/Basics/Image/CreateImage/data/mask.jpg diff --git a/mode/examples/Basics/Image/CreateImage/data/test.jpg b/processing/mode/examples/Basics/Image/CreateImage/data/test.jpg similarity index 100% rename from mode/examples/Basics/Image/CreateImage/data/test.jpg rename to processing/mode/examples/Basics/Image/CreateImage/data/test.jpg diff --git a/mode/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde b/processing/mode/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde similarity index 93% rename from mode/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde rename to processing/mode/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde index 8252c5cbc..495d1f124 100644 --- a/mode/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde +++ b/processing/mode/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde @@ -12,7 +12,6 @@ void setup() { // The file "jelly.jpg" must be in the data folder // of the current sketch to load successfully a = loadImage("jelly.jpg"); // Load the image into the program - noLoop(); // Makes draw() only run once } void draw() { diff --git a/mode/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg b/processing/mode/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg similarity index 100% rename from mode/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg rename to processing/mode/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg diff --git a/mode/examples/Basics/Image/Pointillism/Pointillism.pde b/processing/mode/examples/Basics/Image/Pointillism/Pointillism.pde similarity index 100% rename from mode/examples/Basics/Image/Pointillism/Pointillism.pde rename to processing/mode/examples/Basics/Image/Pointillism/Pointillism.pde diff --git a/mode/examples/Basics/Image/Pointillism/data/eames.jpg b/processing/mode/examples/Basics/Image/Pointillism/data/eames.jpg similarity index 100% rename from mode/examples/Basics/Image/Pointillism/data/eames.jpg rename to processing/mode/examples/Basics/Image/Pointillism/data/eames.jpg diff --git a/mode/examples/Basics/Image/Pointillism/data/sunflower.jpg b/processing/mode/examples/Basics/Image/Pointillism/data/sunflower.jpg similarity index 100% rename from mode/examples/Basics/Image/Pointillism/data/sunflower.jpg rename to processing/mode/examples/Basics/Image/Pointillism/data/sunflower.jpg diff --git a/mode/examples/Basics/Image/RequestImage/RequestImage.pde b/processing/mode/examples/Basics/Image/RequestImage/RequestImage.pde similarity index 100% rename from mode/examples/Basics/Image/RequestImage/RequestImage.pde rename to processing/mode/examples/Basics/Image/RequestImage/RequestImage.pde diff --git a/mode/examples/Basics/Image/Sprite/Sprite.pde b/processing/mode/examples/Basics/Image/Sprite/Sprite.pde similarity index 100% rename from mode/examples/Basics/Image/Sprite/Sprite.pde rename to processing/mode/examples/Basics/Image/Sprite/Sprite.pde diff --git a/mode/examples/Basics/Image/Sprite/data/teddy.gif b/processing/mode/examples/Basics/Image/Sprite/data/teddy.gif similarity index 100% rename from mode/examples/Basics/Image/Sprite/data/teddy.gif rename to processing/mode/examples/Basics/Image/Sprite/data/teddy.gif diff --git a/mode/examples/Basics/Image/Sprite2/Sprite2.pde b/processing/mode/examples/Basics/Image/Sprite2/Sprite2.pde similarity index 100% rename from mode/examples/Basics/Image/Sprite2/Sprite2.pde rename to processing/mode/examples/Basics/Image/Sprite2/Sprite2.pde diff --git a/mode/examples/Basics/Image/Sprite2/data/sky.jpg b/processing/mode/examples/Basics/Image/Sprite2/data/sky.jpg similarity index 100% rename from mode/examples/Basics/Image/Sprite2/data/sky.jpg rename to processing/mode/examples/Basics/Image/Sprite2/data/sky.jpg diff --git a/mode/examples/Basics/Image/Sprite2/data/teddy.gif b/processing/mode/examples/Basics/Image/Sprite2/data/teddy.gif similarity index 100% rename from mode/examples/Basics/Image/Sprite2/data/teddy.gif rename to processing/mode/examples/Basics/Image/Sprite2/data/teddy.gif diff --git a/mode/examples/Basics/Image/Transparency/Transparency.pde b/processing/mode/examples/Basics/Image/Transparency/Transparency.pde similarity index 100% rename from mode/examples/Basics/Image/Transparency/Transparency.pde rename to processing/mode/examples/Basics/Image/Transparency/Transparency.pde diff --git a/mode/examples/Basics/Image/Transparency/data/construct.jpg b/processing/mode/examples/Basics/Image/Transparency/data/construct.jpg similarity index 100% rename from mode/examples/Basics/Image/Transparency/data/construct.jpg rename to processing/mode/examples/Basics/Image/Transparency/data/construct.jpg diff --git a/mode/examples/Basics/Image/Transparency/data/wash.jpg b/processing/mode/examples/Basics/Image/Transparency/data/wash.jpg similarity index 100% rename from mode/examples/Basics/Image/Transparency/data/wash.jpg rename to processing/mode/examples/Basics/Image/Transparency/data/wash.jpg diff --git a/mode/examples/Basics/Input/Clock/Clock.pde b/processing/mode/examples/Basics/Input/Clock/Clock.pde similarity index 100% rename from mode/examples/Basics/Input/Clock/Clock.pde rename to processing/mode/examples/Basics/Input/Clock/Clock.pde diff --git a/mode/examples/Basics/Input/Constrain/Constrain.pde b/processing/mode/examples/Basics/Input/Constrain/Constrain.pde similarity index 100% rename from mode/examples/Basics/Input/Constrain/Constrain.pde rename to processing/mode/examples/Basics/Input/Constrain/Constrain.pde diff --git a/mode/examples/Basics/Input/Easing/Easing.pde b/processing/mode/examples/Basics/Input/Easing/Easing.pde similarity index 100% rename from mode/examples/Basics/Input/Easing/Easing.pde rename to processing/mode/examples/Basics/Input/Easing/Easing.pde diff --git a/mode/examples/Basics/Input/Keyboard/Keyboard.pde b/processing/mode/examples/Basics/Input/Keyboard/Keyboard.pde similarity index 100% rename from mode/examples/Basics/Input/Keyboard/Keyboard.pde rename to processing/mode/examples/Basics/Input/Keyboard/Keyboard.pde diff --git a/mode/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde b/processing/mode/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde similarity index 100% rename from mode/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde rename to processing/mode/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde diff --git a/mode/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg b/processing/mode/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg similarity index 100% rename from mode/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg rename to processing/mode/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg diff --git a/mode/examples/Basics/Input/Milliseconds/Milliseconds.pde b/processing/mode/examples/Basics/Input/Milliseconds/Milliseconds.pde similarity index 100% rename from mode/examples/Basics/Input/Milliseconds/Milliseconds.pde rename to processing/mode/examples/Basics/Input/Milliseconds/Milliseconds.pde diff --git a/mode/examples/Basics/Input/Mouse1D/Mouse1D.pde b/processing/mode/examples/Basics/Input/Mouse1D/Mouse1D.pde similarity index 100% rename from mode/examples/Basics/Input/Mouse1D/Mouse1D.pde rename to processing/mode/examples/Basics/Input/Mouse1D/Mouse1D.pde diff --git a/mode/examples/Basics/Input/Mouse2D/Mouse2D.pde b/processing/mode/examples/Basics/Input/Mouse2D/Mouse2D.pde similarity index 100% rename from mode/examples/Basics/Input/Mouse2D/Mouse2D.pde rename to processing/mode/examples/Basics/Input/Mouse2D/Mouse2D.pde diff --git a/mode/examples/Basics/Input/MouseFunctions/MouseFunctions.pde b/processing/mode/examples/Basics/Input/MouseFunctions/MouseFunctions.pde similarity index 100% rename from mode/examples/Basics/Input/MouseFunctions/MouseFunctions.pde rename to processing/mode/examples/Basics/Input/MouseFunctions/MouseFunctions.pde diff --git a/mode/examples/Basics/Input/MousePress/MousePress.pde b/processing/mode/examples/Basics/Input/MousePress/MousePress.pde similarity index 100% rename from mode/examples/Basics/Input/MousePress/MousePress.pde rename to processing/mode/examples/Basics/Input/MousePress/MousePress.pde diff --git a/mode/examples/Basics/Input/MouseSignals/MouseSignals.pde b/processing/mode/examples/Basics/Input/MouseSignals/MouseSignals.pde similarity index 100% rename from mode/examples/Basics/Input/MouseSignals/MouseSignals.pde rename to processing/mode/examples/Basics/Input/MouseSignals/MouseSignals.pde diff --git a/mode/examples/Basics/Input/StoringInput/StoringInput.pde b/processing/mode/examples/Basics/Input/StoringInput/StoringInput.pde similarity index 100% rename from mode/examples/Basics/Input/StoringInput/StoringInput.pde rename to processing/mode/examples/Basics/Input/StoringInput/StoringInput.pde diff --git a/mode/examples/Basics/Lights/Directional/Directional.pde b/processing/mode/examples/Basics/Lights/Directional/Directional.pde similarity index 100% rename from mode/examples/Basics/Lights/Directional/Directional.pde rename to processing/mode/examples/Basics/Lights/Directional/Directional.pde diff --git a/mode/examples/Basics/Lights/Mixture/Mixture.pde b/processing/mode/examples/Basics/Lights/Mixture/Mixture.pde similarity index 100% rename from mode/examples/Basics/Lights/Mixture/Mixture.pde rename to processing/mode/examples/Basics/Lights/Mixture/Mixture.pde diff --git a/mode/examples/Basics/Lights/MixtureGrid/MixtureGrid.pde b/processing/mode/examples/Basics/Lights/MixtureGrid/MixtureGrid.pde similarity index 100% rename from mode/examples/Basics/Lights/MixtureGrid/MixtureGrid.pde rename to processing/mode/examples/Basics/Lights/MixtureGrid/MixtureGrid.pde diff --git a/mode/examples/Basics/Lights/OnOff/OnOff.pde b/processing/mode/examples/Basics/Lights/OnOff/OnOff.pde similarity index 100% rename from mode/examples/Basics/Lights/OnOff/OnOff.pde rename to processing/mode/examples/Basics/Lights/OnOff/OnOff.pde diff --git a/mode/examples/Basics/Lights/Reflection/Reflection.pde b/processing/mode/examples/Basics/Lights/Reflection/Reflection.pde similarity index 100% rename from mode/examples/Basics/Lights/Reflection/Reflection.pde rename to processing/mode/examples/Basics/Lights/Reflection/Reflection.pde diff --git a/mode/examples/Basics/Lights/Spot/Spot.pde b/processing/mode/examples/Basics/Lights/Spot/Spot.pde similarity index 100% rename from mode/examples/Basics/Lights/Spot/Spot.pde rename to processing/mode/examples/Basics/Lights/Spot/Spot.pde diff --git a/mode/examples/Basics/Math/AdditiveWave/AdditiveWave.pde b/processing/mode/examples/Basics/Math/AdditiveWave/AdditiveWave.pde similarity index 100% rename from mode/examples/Basics/Math/AdditiveWave/AdditiveWave.pde rename to processing/mode/examples/Basics/Math/AdditiveWave/AdditiveWave.pde diff --git a/mode/examples/Basics/Math/Arctangent/Arctangent.pde b/processing/mode/examples/Basics/Math/Arctangent/Arctangent.pde similarity index 100% rename from mode/examples/Basics/Math/Arctangent/Arctangent.pde rename to processing/mode/examples/Basics/Math/Arctangent/Arctangent.pde diff --git a/mode/examples/Basics/Math/Distance1D/Distance1D.pde b/processing/mode/examples/Basics/Math/Distance1D/Distance1D.pde similarity index 100% rename from mode/examples/Basics/Math/Distance1D/Distance1D.pde rename to processing/mode/examples/Basics/Math/Distance1D/Distance1D.pde diff --git a/mode/examples/Basics/Math/Distance2D/Distance2D.pde b/processing/mode/examples/Basics/Math/Distance2D/Distance2D.pde similarity index 100% rename from mode/examples/Basics/Math/Distance2D/Distance2D.pde rename to processing/mode/examples/Basics/Math/Distance2D/Distance2D.pde diff --git a/mode/examples/Basics/Math/DoubleRandom/DoubleRandom.pde b/processing/mode/examples/Basics/Math/DoubleRandom/DoubleRandom.pde similarity index 100% rename from mode/examples/Basics/Math/DoubleRandom/DoubleRandom.pde rename to processing/mode/examples/Basics/Math/DoubleRandom/DoubleRandom.pde diff --git a/mode/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde b/processing/mode/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde similarity index 100% rename from mode/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde rename to processing/mode/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde diff --git a/mode/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde b/processing/mode/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde similarity index 100% rename from mode/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde rename to processing/mode/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde diff --git a/mode/examples/Basics/Math/Modulo/Modulo.pde b/processing/mode/examples/Basics/Math/Modulo/Modulo.pde similarity index 100% rename from mode/examples/Basics/Math/Modulo/Modulo.pde rename to processing/mode/examples/Basics/Math/Modulo/Modulo.pde diff --git a/mode/examples/Basics/Math/Noise1D/Noise1D.pde b/processing/mode/examples/Basics/Math/Noise1D/Noise1D.pde similarity index 100% rename from mode/examples/Basics/Math/Noise1D/Noise1D.pde rename to processing/mode/examples/Basics/Math/Noise1D/Noise1D.pde diff --git a/mode/examples/Basics/Math/Noise2D/Noise2D.pde b/processing/mode/examples/Basics/Math/Noise2D/Noise2D.pde similarity index 100% rename from mode/examples/Basics/Math/Noise2D/Noise2D.pde rename to processing/mode/examples/Basics/Math/Noise2D/Noise2D.pde diff --git a/mode/examples/Basics/Math/Noise3D/Noise3D.pde b/processing/mode/examples/Basics/Math/Noise3D/Noise3D.pde similarity index 100% rename from mode/examples/Basics/Math/Noise3D/Noise3D.pde rename to processing/mode/examples/Basics/Math/Noise3D/Noise3D.pde diff --git a/mode/examples/Basics/Math/NoiseWave/NoiseWave.pde b/processing/mode/examples/Basics/Math/NoiseWave/NoiseWave.pde similarity index 100% rename from mode/examples/Basics/Math/NoiseWave/NoiseWave.pde rename to processing/mode/examples/Basics/Math/NoiseWave/NoiseWave.pde diff --git a/mode/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde b/processing/mode/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde similarity index 100% rename from mode/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde rename to processing/mode/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde diff --git a/mode/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde b/processing/mode/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde similarity index 100% rename from mode/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde rename to processing/mode/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde diff --git a/mode/examples/Basics/Math/Random/Random.pde b/processing/mode/examples/Basics/Math/Random/Random.pde similarity index 100% rename from mode/examples/Basics/Math/Random/Random.pde rename to processing/mode/examples/Basics/Math/Random/Random.pde diff --git a/mode/examples/Basics/Math/Sine/Sine.pde b/processing/mode/examples/Basics/Math/Sine/Sine.pde similarity index 100% rename from mode/examples/Basics/Math/Sine/Sine.pde rename to processing/mode/examples/Basics/Math/Sine/Sine.pde diff --git a/mode/examples/Basics/Math/SineCosine/SineCosine.pde b/processing/mode/examples/Basics/Math/SineCosine/SineCosine.pde similarity index 100% rename from mode/examples/Basics/Math/SineCosine/SineCosine.pde rename to processing/mode/examples/Basics/Math/SineCosine/SineCosine.pde diff --git a/mode/examples/Basics/Math/SineWave/SineWave.pde b/processing/mode/examples/Basics/Math/SineWave/SineWave.pde similarity index 100% rename from mode/examples/Basics/Math/SineWave/SineWave.pde rename to processing/mode/examples/Basics/Math/SineWave/SineWave.pde diff --git a/mode/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde b/processing/mode/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde similarity index 100% rename from mode/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde rename to processing/mode/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde diff --git a/mode/examples/Basics/Objects/CompositeObjects/Egg.pde b/processing/mode/examples/Basics/Objects/CompositeObjects/Egg.pde similarity index 100% rename from mode/examples/Basics/Objects/CompositeObjects/Egg.pde rename to processing/mode/examples/Basics/Objects/CompositeObjects/Egg.pde diff --git a/mode/examples/Basics/Objects/CompositeObjects/EggRing.pde b/processing/mode/examples/Basics/Objects/CompositeObjects/EggRing.pde similarity index 100% rename from mode/examples/Basics/Objects/CompositeObjects/EggRing.pde rename to processing/mode/examples/Basics/Objects/CompositeObjects/EggRing.pde diff --git a/mode/examples/Basics/Objects/CompositeObjects/Ring.pde b/processing/mode/examples/Basics/Objects/CompositeObjects/Ring.pde similarity index 100% rename from mode/examples/Basics/Objects/CompositeObjects/Ring.pde rename to processing/mode/examples/Basics/Objects/CompositeObjects/Ring.pde diff --git a/mode/examples/Basics/Objects/Inheritance/Inheritance.pde b/processing/mode/examples/Basics/Objects/Inheritance/Inheritance.pde similarity index 100% rename from mode/examples/Basics/Objects/Inheritance/Inheritance.pde rename to processing/mode/examples/Basics/Objects/Inheritance/Inheritance.pde diff --git a/mode/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde b/processing/mode/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde similarity index 100% rename from mode/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde rename to processing/mode/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde diff --git a/mode/examples/Basics/Objects/Neighborhood/Neighborhood.pde b/processing/mode/examples/Basics/Objects/Neighborhood/Neighborhood.pde similarity index 100% rename from mode/examples/Basics/Objects/Neighborhood/Neighborhood.pde rename to processing/mode/examples/Basics/Objects/Neighborhood/Neighborhood.pde diff --git a/mode/examples/Basics/Objects/Objects/Objects.pde b/processing/mode/examples/Basics/Objects/Objects/Objects.pde similarity index 100% rename from mode/examples/Basics/Objects/Objects/Objects.pde rename to processing/mode/examples/Basics/Objects/Objects/Objects.pde diff --git a/mode/examples/Basics/Shape/DisableStyle/DisableStyle.pde b/processing/mode/examples/Basics/Shape/DisableStyle/DisableStyle.pde similarity index 100% rename from mode/examples/Basics/Shape/DisableStyle/DisableStyle.pde rename to processing/mode/examples/Basics/Shape/DisableStyle/DisableStyle.pde diff --git a/mode/examples/Basics/Shape/DisableStyle/data/bot1.svg b/processing/mode/examples/Basics/Shape/DisableStyle/data/bot1.svg similarity index 100% rename from mode/examples/Basics/Shape/DisableStyle/data/bot1.svg rename to processing/mode/examples/Basics/Shape/DisableStyle/data/bot1.svg diff --git a/mode/examples/Basics/Shape/GetChild/GetChild.pde b/processing/mode/examples/Basics/Shape/GetChild/GetChild.pde similarity index 100% rename from mode/examples/Basics/Shape/GetChild/GetChild.pde rename to processing/mode/examples/Basics/Shape/GetChild/GetChild.pde diff --git a/mode/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg b/processing/mode/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg similarity index 100% rename from mode/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg rename to processing/mode/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg diff --git a/mode/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde b/processing/mode/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde similarity index 100% rename from mode/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde rename to processing/mode/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde diff --git a/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl b/processing/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl similarity index 100% rename from mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl rename to processing/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl diff --git a/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj b/processing/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj similarity index 100% rename from mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj rename to processing/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj diff --git a/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png b/processing/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png similarity index 100% rename from mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png rename to processing/mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png diff --git a/mode/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde b/processing/mode/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde similarity index 100% rename from mode/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde rename to processing/mode/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde diff --git a/mode/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg b/processing/mode/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg similarity index 100% rename from mode/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg rename to processing/mode/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg diff --git a/mode/examples/Basics/Shape/ScaleShape/ScaleShape.pde b/processing/mode/examples/Basics/Shape/ScaleShape/ScaleShape.pde similarity index 100% rename from mode/examples/Basics/Shape/ScaleShape/ScaleShape.pde rename to processing/mode/examples/Basics/Shape/ScaleShape/ScaleShape.pde diff --git a/mode/examples/Basics/Shape/ScaleShape/data/bot1.svg b/processing/mode/examples/Basics/Shape/ScaleShape/data/bot1.svg similarity index 100% rename from mode/examples/Basics/Shape/ScaleShape/data/bot1.svg rename to processing/mode/examples/Basics/Shape/ScaleShape/data/bot1.svg diff --git a/mode/examples/Basics/Structure/Coordinates/Coordinates.pde b/processing/mode/examples/Basics/Structure/Coordinates/Coordinates.pde similarity index 100% rename from mode/examples/Basics/Structure/Coordinates/Coordinates.pde rename to processing/mode/examples/Basics/Structure/Coordinates/Coordinates.pde diff --git a/mode/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde b/processing/mode/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde similarity index 100% rename from mode/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde rename to processing/mode/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde diff --git a/mode/examples/Basics/Structure/CreateGraphics/data/mask.jpg b/processing/mode/examples/Basics/Structure/CreateGraphics/data/mask.jpg similarity index 100% rename from mode/examples/Basics/Structure/CreateGraphics/data/mask.jpg rename to processing/mode/examples/Basics/Structure/CreateGraphics/data/mask.jpg diff --git a/mode/examples/Basics/Structure/CreateGraphics/data/test.jpg b/processing/mode/examples/Basics/Structure/CreateGraphics/data/test.jpg similarity index 100% rename from mode/examples/Basics/Structure/CreateGraphics/data/test.jpg rename to processing/mode/examples/Basics/Structure/CreateGraphics/data/test.jpg diff --git a/mode/examples/Basics/Structure/Functions/Functions.pde b/processing/mode/examples/Basics/Structure/Functions/Functions.pde similarity index 100% rename from mode/examples/Basics/Structure/Functions/Functions.pde rename to processing/mode/examples/Basics/Structure/Functions/Functions.pde diff --git a/mode/examples/Basics/Structure/Loop/Loop.pde b/processing/mode/examples/Basics/Structure/Loop/Loop.pde similarity index 100% rename from mode/examples/Basics/Structure/Loop/Loop.pde rename to processing/mode/examples/Basics/Structure/Loop/Loop.pde diff --git a/mode/examples/Basics/Structure/NoLoop/NoLoop.pde b/processing/mode/examples/Basics/Structure/NoLoop/NoLoop.pde similarity index 100% rename from mode/examples/Basics/Structure/NoLoop/NoLoop.pde rename to processing/mode/examples/Basics/Structure/NoLoop/NoLoop.pde diff --git a/mode/examples/Basics/Structure/Recursion/Recursion.pde b/processing/mode/examples/Basics/Structure/Recursion/Recursion.pde similarity index 100% rename from mode/examples/Basics/Structure/Recursion/Recursion.pde rename to processing/mode/examples/Basics/Structure/Recursion/Recursion.pde diff --git a/mode/examples/Basics/Structure/Recursion2/Recursion2.pde b/processing/mode/examples/Basics/Structure/Recursion2/Recursion2.pde similarity index 100% rename from mode/examples/Basics/Structure/Recursion2/Recursion2.pde rename to processing/mode/examples/Basics/Structure/Recursion2/Recursion2.pde diff --git a/mode/examples/Basics/Structure/Redraw/Redraw.pde b/processing/mode/examples/Basics/Structure/Redraw/Redraw.pde similarity index 100% rename from mode/examples/Basics/Structure/Redraw/Redraw.pde rename to processing/mode/examples/Basics/Structure/Redraw/Redraw.pde diff --git a/mode/examples/Basics/Structure/SetupDraw/SetupDraw.pde b/processing/mode/examples/Basics/Structure/SetupDraw/SetupDraw.pde similarity index 100% rename from mode/examples/Basics/Structure/SetupDraw/SetupDraw.pde rename to processing/mode/examples/Basics/Structure/SetupDraw/SetupDraw.pde diff --git a/mode/examples/Basics/Structure/StatementsComments/StatementsComments.pde b/processing/mode/examples/Basics/Structure/StatementsComments/StatementsComments.pde similarity index 100% rename from mode/examples/Basics/Structure/StatementsComments/StatementsComments.pde rename to processing/mode/examples/Basics/Structure/StatementsComments/StatementsComments.pde diff --git a/mode/examples/Basics/Structure/WidthHeight/WidthHeight.pde b/processing/mode/examples/Basics/Structure/WidthHeight/WidthHeight.pde similarity index 100% rename from mode/examples/Basics/Structure/WidthHeight/WidthHeight.pde rename to processing/mode/examples/Basics/Structure/WidthHeight/WidthHeight.pde diff --git a/mode/examples/Basics/Transform/Arm/Arm.pde b/processing/mode/examples/Basics/Transform/Arm/Arm.pde similarity index 100% rename from mode/examples/Basics/Transform/Arm/Arm.pde rename to processing/mode/examples/Basics/Transform/Arm/Arm.pde diff --git a/mode/examples/Basics/Transform/Rotate/Rotate.pde b/processing/mode/examples/Basics/Transform/Rotate/Rotate.pde similarity index 100% rename from mode/examples/Basics/Transform/Rotate/Rotate.pde rename to processing/mode/examples/Basics/Transform/Rotate/Rotate.pde diff --git a/mode/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde b/processing/mode/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde similarity index 100% rename from mode/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde rename to processing/mode/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde diff --git a/mode/examples/Basics/Transform/RotateXY/RotateXY.pde b/processing/mode/examples/Basics/Transform/RotateXY/RotateXY.pde similarity index 100% rename from mode/examples/Basics/Transform/RotateXY/RotateXY.pde rename to processing/mode/examples/Basics/Transform/RotateXY/RotateXY.pde diff --git a/mode/examples/Basics/Transform/Scale/Scale.pde b/processing/mode/examples/Basics/Transform/Scale/Scale.pde similarity index 100% rename from mode/examples/Basics/Transform/Scale/Scale.pde rename to processing/mode/examples/Basics/Transform/Scale/Scale.pde diff --git a/mode/examples/Basics/Transform/Translate/Translate.pde b/processing/mode/examples/Basics/Transform/Translate/Translate.pde similarity index 100% rename from mode/examples/Basics/Transform/Translate/Translate.pde rename to processing/mode/examples/Basics/Transform/Translate/Translate.pde diff --git a/mode/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde b/processing/mode/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde similarity index 100% rename from mode/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde rename to processing/mode/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde diff --git a/mode/examples/Basics/Typography/Letters/Letters.pde b/processing/mode/examples/Basics/Typography/Letters/Letters.pde similarity index 100% rename from mode/examples/Basics/Typography/Letters/Letters.pde rename to processing/mode/examples/Basics/Typography/Letters/Letters.pde diff --git a/mode/examples/Basics/Typography/Letters/data/CourierNew36.vlw b/processing/mode/examples/Basics/Typography/Letters/data/CourierNew36.vlw similarity index 100% rename from mode/examples/Basics/Typography/Letters/data/CourierNew36.vlw rename to processing/mode/examples/Basics/Typography/Letters/data/CourierNew36.vlw diff --git a/mode/examples/Basics/Typography/Words/Words.pde b/processing/mode/examples/Basics/Typography/Words/Words.pde similarity index 100% rename from mode/examples/Basics/Typography/Words/Words.pde rename to processing/mode/examples/Basics/Typography/Words/Words.pde diff --git a/mode/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw b/processing/mode/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw similarity index 100% rename from mode/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw rename to processing/mode/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw diff --git a/mode/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde b/processing/mode/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde similarity index 100% rename from mode/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde rename to processing/mode/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde diff --git a/mode/examples/Basics/Web/LoadingImages/LoadingImages.pde b/processing/mode/examples/Basics/Web/LoadingImages/LoadingImages.pde similarity index 100% rename from mode/examples/Basics/Web/LoadingImages/LoadingImages.pde rename to processing/mode/examples/Basics/Web/LoadingImages/LoadingImages.pde diff --git a/mode/examples/Demos/Graphics/Particles/Particle.pde b/processing/mode/examples/Demos/Graphics/Particles/Particle.pde similarity index 100% rename from mode/examples/Demos/Graphics/Particles/Particle.pde rename to processing/mode/examples/Demos/Graphics/Particles/Particle.pde diff --git a/mode/examples/Demos/Graphics/Particles/ParticleSystem.pde b/processing/mode/examples/Demos/Graphics/Particles/ParticleSystem.pde similarity index 100% rename from mode/examples/Demos/Graphics/Particles/ParticleSystem.pde rename to processing/mode/examples/Demos/Graphics/Particles/ParticleSystem.pde diff --git a/mode/examples/Demos/Graphics/Particles/Particles.pde b/processing/mode/examples/Demos/Graphics/Particles/Particles.pde similarity index 100% rename from mode/examples/Demos/Graphics/Particles/Particles.pde rename to processing/mode/examples/Demos/Graphics/Particles/Particles.pde diff --git a/mode/examples/Demos/Graphics/Particles/data/sprite.png b/processing/mode/examples/Demos/Graphics/Particles/data/sprite.png similarity index 100% rename from mode/examples/Demos/Graphics/Particles/data/sprite.png rename to processing/mode/examples/Demos/Graphics/Particles/data/sprite.png diff --git a/mode/examples/Demos/Graphics/Patch/Patch.pde b/processing/mode/examples/Demos/Graphics/Patch/Patch.pde similarity index 100% rename from mode/examples/Demos/Graphics/Patch/Patch.pde rename to processing/mode/examples/Demos/Graphics/Patch/Patch.pde diff --git a/mode/examples/Demos/Graphics/Planets/Perlin.pde b/processing/mode/examples/Demos/Graphics/Planets/Perlin.pde similarity index 100% rename from mode/examples/Demos/Graphics/Planets/Perlin.pde rename to processing/mode/examples/Demos/Graphics/Planets/Perlin.pde diff --git a/mode/examples/Demos/Graphics/Planets/Planets.pde b/processing/mode/examples/Demos/Graphics/Planets/Planets.pde similarity index 100% rename from mode/examples/Demos/Graphics/Planets/Planets.pde rename to processing/mode/examples/Demos/Graphics/Planets/Planets.pde diff --git a/mode/examples/Demos/Graphics/Planets/data/mercury.jpg b/processing/mode/examples/Demos/Graphics/Planets/data/mercury.jpg similarity index 100% rename from mode/examples/Demos/Graphics/Planets/data/mercury.jpg rename to processing/mode/examples/Demos/Graphics/Planets/data/mercury.jpg diff --git a/mode/examples/Demos/Graphics/Planets/data/planet.jpg b/processing/mode/examples/Demos/Graphics/Planets/data/planet.jpg similarity index 100% rename from mode/examples/Demos/Graphics/Planets/data/planet.jpg rename to processing/mode/examples/Demos/Graphics/Planets/data/planet.jpg diff --git a/mode/examples/Demos/Graphics/Planets/data/starfield.jpg b/processing/mode/examples/Demos/Graphics/Planets/data/starfield.jpg similarity index 100% rename from mode/examples/Demos/Graphics/Planets/data/starfield.jpg rename to processing/mode/examples/Demos/Graphics/Planets/data/starfield.jpg diff --git a/mode/examples/Demos/Graphics/Planets/data/sun.jpg b/processing/mode/examples/Demos/Graphics/Planets/data/sun.jpg similarity index 100% rename from mode/examples/Demos/Graphics/Planets/data/sun.jpg rename to processing/mode/examples/Demos/Graphics/Planets/data/sun.jpg diff --git a/mode/examples/Demos/Graphics/Ribbons/ArcBall.pde b/processing/mode/examples/Demos/Graphics/Ribbons/ArcBall.pde similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/ArcBall.pde rename to processing/mode/examples/Demos/Graphics/Ribbons/ArcBall.pde diff --git a/mode/examples/Demos/Graphics/Ribbons/BSpline.pde b/processing/mode/examples/Demos/Graphics/Ribbons/BSpline.pde similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/BSpline.pde rename to processing/mode/examples/Demos/Graphics/Ribbons/BSpline.pde diff --git a/mode/examples/Demos/Graphics/Ribbons/Geometry.pde b/processing/mode/examples/Demos/Graphics/Ribbons/Geometry.pde similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/Geometry.pde rename to processing/mode/examples/Demos/Graphics/Ribbons/Geometry.pde diff --git a/mode/examples/Demos/Graphics/Ribbons/PDB.pde b/processing/mode/examples/Demos/Graphics/Ribbons/PDB.pde similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/PDB.pde rename to processing/mode/examples/Demos/Graphics/Ribbons/PDB.pde diff --git a/mode/examples/Demos/Graphics/Ribbons/Ribbons.pde b/processing/mode/examples/Demos/Graphics/Ribbons/Ribbons.pde similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/Ribbons.pde rename to processing/mode/examples/Demos/Graphics/Ribbons/Ribbons.pde diff --git a/mode/examples/Demos/Graphics/Ribbons/data/1CBS.pdb b/processing/mode/examples/Demos/Graphics/Ribbons/data/1CBS.pdb similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/data/1CBS.pdb rename to processing/mode/examples/Demos/Graphics/Ribbons/data/1CBS.pdb diff --git a/mode/examples/Demos/Graphics/Ribbons/data/2POR.pdb b/processing/mode/examples/Demos/Graphics/Ribbons/data/2POR.pdb similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/data/2POR.pdb rename to processing/mode/examples/Demos/Graphics/Ribbons/data/2POR.pdb diff --git a/mode/examples/Demos/Graphics/Ribbons/data/4HHB.pdb b/processing/mode/examples/Demos/Graphics/Ribbons/data/4HHB.pdb similarity index 100% rename from mode/examples/Demos/Graphics/Ribbons/data/4HHB.pdb rename to processing/mode/examples/Demos/Graphics/Ribbons/data/4HHB.pdb diff --git a/mode/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde b/processing/mode/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde similarity index 100% rename from mode/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde rename to processing/mode/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde diff --git a/mode/examples/Demos/Graphics/Trefoil/Surface.pde b/processing/mode/examples/Demos/Graphics/Trefoil/Surface.pde similarity index 100% rename from mode/examples/Demos/Graphics/Trefoil/Surface.pde rename to processing/mode/examples/Demos/Graphics/Trefoil/Surface.pde diff --git a/mode/examples/Demos/Graphics/Trefoil/Trefoil.pde b/processing/mode/examples/Demos/Graphics/Trefoil/Trefoil.pde similarity index 100% rename from mode/examples/Demos/Graphics/Trefoil/Trefoil.pde rename to processing/mode/examples/Demos/Graphics/Trefoil/Trefoil.pde diff --git a/mode/examples/Demos/Graphics/Trefoil/data/particle.png b/processing/mode/examples/Demos/Graphics/Trefoil/data/particle.png similarity index 100% rename from mode/examples/Demos/Graphics/Trefoil/data/particle.png rename to processing/mode/examples/Demos/Graphics/Trefoil/data/particle.png diff --git a/mode/examples/Demos/Graphics/Wiggling/Wiggling.pde b/processing/mode/examples/Demos/Graphics/Wiggling/Wiggling.pde similarity index 100% rename from mode/examples/Demos/Graphics/Wiggling/Wiggling.pde rename to processing/mode/examples/Demos/Graphics/Wiggling/Wiggling.pde diff --git a/mode/examples/Demos/Graphics/Yellowtail/Gesture.pde b/processing/mode/examples/Demos/Graphics/Yellowtail/Gesture.pde similarity index 100% rename from mode/examples/Demos/Graphics/Yellowtail/Gesture.pde rename to processing/mode/examples/Demos/Graphics/Yellowtail/Gesture.pde diff --git a/mode/examples/Demos/Graphics/Yellowtail/Polygon.pde b/processing/mode/examples/Demos/Graphics/Yellowtail/Polygon.pde similarity index 100% rename from mode/examples/Demos/Graphics/Yellowtail/Polygon.pde rename to processing/mode/examples/Demos/Graphics/Yellowtail/Polygon.pde diff --git a/mode/examples/Demos/Graphics/Yellowtail/Vec3f.pde b/processing/mode/examples/Demos/Graphics/Yellowtail/Vec3f.pde similarity index 100% rename from mode/examples/Demos/Graphics/Yellowtail/Vec3f.pde rename to processing/mode/examples/Demos/Graphics/Yellowtail/Vec3f.pde diff --git a/mode/examples/Demos/Graphics/Yellowtail/Yellowtail.pde b/processing/mode/examples/Demos/Graphics/Yellowtail/Yellowtail.pde similarity index 100% rename from mode/examples/Demos/Graphics/Yellowtail/Yellowtail.pde rename to processing/mode/examples/Demos/Graphics/Yellowtail/Yellowtail.pde diff --git a/mode/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde b/processing/mode/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde similarity index 100% rename from mode/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde rename to processing/mode/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde diff --git a/mode/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde b/processing/mode/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde similarity index 100% rename from mode/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde rename to processing/mode/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde diff --git a/mode/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde b/processing/mode/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde similarity index 100% rename from mode/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde rename to processing/mode/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde diff --git a/mode/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png b/processing/mode/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png similarity index 100% rename from mode/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png rename to processing/mode/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png diff --git a/mode/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde b/processing/mode/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde similarity index 100% rename from mode/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde rename to processing/mode/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde diff --git a/mode/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png b/processing/mode/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png similarity index 100% rename from mode/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png rename to processing/mode/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png diff --git a/mode/examples/Demos/Performance/Esfera/Esfera.pde b/processing/mode/examples/Demos/Performance/Esfera/Esfera.pde similarity index 100% rename from mode/examples/Demos/Performance/Esfera/Esfera.pde rename to processing/mode/examples/Demos/Performance/Esfera/Esfera.pde diff --git a/mode/examples/Demos/Performance/LineRendering/LineRendering.pde b/processing/mode/examples/Demos/Performance/LineRendering/LineRendering.pde similarity index 100% rename from mode/examples/Demos/Performance/LineRendering/LineRendering.pde rename to processing/mode/examples/Demos/Performance/LineRendering/LineRendering.pde diff --git a/mode/examples/Demos/Performance/P2DXDemo/P2DXDemo.pde b/processing/mode/examples/Demos/Performance/P2DXDemo/P2DXDemo.pde similarity index 100% rename from mode/examples/Demos/Performance/P2DXDemo/P2DXDemo.pde rename to processing/mode/examples/Demos/Performance/P2DXDemo/P2DXDemo.pde diff --git a/mode/examples/Demos/Performance/QuadRendering/QuadRendering.pde b/processing/mode/examples/Demos/Performance/QuadRendering/QuadRendering.pde similarity index 100% rename from mode/examples/Demos/Performance/QuadRendering/QuadRendering.pde rename to processing/mode/examples/Demos/Performance/QuadRendering/QuadRendering.pde diff --git a/mode/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde b/processing/mode/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde similarity index 100% rename from mode/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde rename to processing/mode/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde diff --git a/mode/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png b/processing/mode/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png similarity index 100% rename from mode/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png rename to processing/mode/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png diff --git a/mode/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde b/processing/mode/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde similarity index 100% rename from mode/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde rename to processing/mode/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde diff --git a/mode/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png b/processing/mode/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png similarity index 100% rename from mode/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png rename to processing/mode/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png diff --git a/mode/examples/Demos/Performance/TextRendering/TextRendering.pde b/processing/mode/examples/Demos/Performance/TextRendering/TextRendering.pde similarity index 100% rename from mode/examples/Demos/Performance/TextRendering/TextRendering.pde rename to processing/mode/examples/Demos/Performance/TextRendering/TextRendering.pde diff --git a/mode/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde b/processing/mode/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde similarity index 100% rename from mode/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde rename to processing/mode/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde diff --git a/mode/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde b/processing/mode/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde similarity index 100% rename from mode/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde rename to processing/mode/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde diff --git a/mode/examples/Demos/Tests/RedrawTest/RedrawTest.pde b/processing/mode/examples/Demos/Tests/RedrawTest/RedrawTest.pde similarity index 100% rename from mode/examples/Demos/Tests/RedrawTest/RedrawTest.pde rename to processing/mode/examples/Demos/Tests/RedrawTest/RedrawTest.pde diff --git a/mode/examples/Sensors/Accelerometer/Accelerometer.pde b/processing/mode/examples/Sensors/Accelerometer/Accelerometer.pde similarity index 100% rename from mode/examples/Sensors/Accelerometer/Accelerometer.pde rename to processing/mode/examples/Sensors/Accelerometer/Accelerometer.pde diff --git a/mode/examples/Sensors/Accelerometer/AccelerometerManager.java b/processing/mode/examples/Sensors/Accelerometer/AccelerometerManager.java similarity index 100% rename from mode/examples/Sensors/Accelerometer/AccelerometerManager.java rename to processing/mode/examples/Sensors/Accelerometer/AccelerometerManager.java diff --git a/mode/examples/Sensors/Compass/Compass.pde b/processing/mode/examples/Sensors/Compass/Compass.pde similarity index 100% rename from mode/examples/Sensors/Compass/Compass.pde rename to processing/mode/examples/Sensors/Compass/Compass.pde diff --git a/mode/examples/Sensors/Compass/CompassManager.java b/processing/mode/examples/Sensors/Compass/CompassManager.java similarity index 100% rename from mode/examples/Sensors/Compass/CompassManager.java rename to processing/mode/examples/Sensors/Compass/CompassManager.java diff --git a/mode/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde b/processing/mode/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde similarity index 100% rename from mode/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde rename to processing/mode/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde diff --git a/mode/examples/Topics/Advanced Data/ArrayListClass/Ball.pde b/processing/mode/examples/Topics/Advanced Data/ArrayListClass/Ball.pde similarity index 100% rename from mode/examples/Topics/Advanced Data/ArrayListClass/Ball.pde rename to processing/mode/examples/Topics/Advanced Data/ArrayListClass/Ball.pde diff --git a/mode/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde b/processing/mode/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde similarity index 100% rename from mode/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde rename to processing/mode/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde diff --git a/mode/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde b/processing/mode/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde similarity index 100% rename from mode/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde rename to processing/mode/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde diff --git a/mode/examples/Topics/Advanced Data/HashMapClass/Word.pde b/processing/mode/examples/Topics/Advanced Data/HashMapClass/Word.pde similarity index 100% rename from mode/examples/Topics/Advanced Data/HashMapClass/Word.pde rename to processing/mode/examples/Topics/Advanced Data/HashMapClass/Word.pde diff --git a/mode/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt b/processing/mode/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt similarity index 100% rename from mode/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt rename to processing/mode/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt diff --git a/mode/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt b/processing/mode/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt similarity index 100% rename from mode/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt rename to processing/mode/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt diff --git a/mode/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde b/processing/mode/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde rename to processing/mode/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde diff --git a/mode/examples/Topics/Animation/AnimatedSprite/Animation.pde b/processing/mode/examples/Topics/Animation/AnimatedSprite/Animation.pde similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/Animation.pde rename to processing/mode/examples/Topics/Animation/AnimatedSprite/Animation.pde diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif diff --git a/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif b/processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif similarity index 100% rename from mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif rename to processing/mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif diff --git a/mode/examples/Topics/Animation/Sequential/Sequential.pde b/processing/mode/examples/Topics/Animation/Sequential/Sequential.pde similarity index 100% rename from mode/examples/Topics/Animation/Sequential/Sequential.pde rename to processing/mode/examples/Topics/Animation/Sequential/Sequential.pde diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0000.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0000.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0000.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0000.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0001.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0001.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0001.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0001.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0002.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0002.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0002.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0002.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0003.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0003.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0003.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0003.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0004.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0004.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0004.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0004.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0005.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0005.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0005.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0005.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0006.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0006.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0006.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0006.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0007.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0007.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0007.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0007.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0008.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0008.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0008.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0008.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0009.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0009.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0009.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0009.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0010.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0010.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0010.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0010.gif diff --git a/mode/examples/Topics/Animation/Sequential/data/PT_anim0011.gif b/processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0011.gif similarity index 100% rename from mode/examples/Topics/Animation/Sequential/data/PT_anim0011.gif rename to processing/mode/examples/Topics/Animation/Sequential/data/PT_anim0011.gif diff --git a/mode/examples/Topics/Cellular Automata/Conway/Conway.pde b/processing/mode/examples/Topics/Cellular Automata/Conway/Conway.pde similarity index 100% rename from mode/examples/Topics/Cellular Automata/Conway/Conway.pde rename to processing/mode/examples/Topics/Cellular Automata/Conway/Conway.pde diff --git a/mode/examples/Topics/Cellular Automata/Spore1/Spore1.pde b/processing/mode/examples/Topics/Cellular Automata/Spore1/Spore1.pde similarity index 100% rename from mode/examples/Topics/Cellular Automata/Spore1/Spore1.pde rename to processing/mode/examples/Topics/Cellular Automata/Spore1/Spore1.pde diff --git a/mode/examples/Topics/Cellular Automata/Spore2/Spore2.pde b/processing/mode/examples/Topics/Cellular Automata/Spore2/Spore2.pde similarity index 100% rename from mode/examples/Topics/Cellular Automata/Spore2/Spore2.pde rename to processing/mode/examples/Topics/Cellular Automata/Spore2/Spore2.pde diff --git a/mode/examples/Topics/Cellular Automata/Wolfram/CA.pde b/processing/mode/examples/Topics/Cellular Automata/Wolfram/CA.pde similarity index 100% rename from mode/examples/Topics/Cellular Automata/Wolfram/CA.pde rename to processing/mode/examples/Topics/Cellular Automata/Wolfram/CA.pde diff --git a/mode/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde b/processing/mode/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde similarity index 100% rename from mode/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde rename to processing/mode/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde diff --git a/mode/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde b/processing/mode/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde rename to processing/mode/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde diff --git a/mode/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde b/processing/mode/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde rename to processing/mode/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde diff --git a/mode/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde b/processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde rename to processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde diff --git a/mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde b/processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde rename to processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde diff --git a/mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde b/processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde rename to processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde diff --git a/mode/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png b/processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png similarity index 100% rename from mode/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png rename to processing/mode/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png diff --git a/mode/examples/Topics/Create Shapes/PathPShape/PathPShape.pde b/processing/mode/examples/Topics/Create Shapes/PathPShape/PathPShape.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PathPShape/PathPShape.pde rename to processing/mode/examples/Topics/Create Shapes/PathPShape/PathPShape.pde diff --git a/mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde b/processing/mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde rename to processing/mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde diff --git a/mode/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde b/processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde rename to processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde diff --git a/mode/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde b/processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde rename to processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde diff --git a/mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde b/processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde rename to processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde diff --git a/mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde b/processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde rename to processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde diff --git a/mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde b/processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde rename to processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde diff --git a/mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde b/processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde rename to processing/mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde diff --git a/mode/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde b/processing/mode/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde rename to processing/mode/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde diff --git a/mode/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde b/processing/mode/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde rename to processing/mode/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde diff --git a/mode/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde b/processing/mode/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde similarity index 100% rename from mode/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde rename to processing/mode/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde diff --git a/mode/examples/Topics/Drawing/Animator/Animator.pde b/processing/mode/examples/Topics/Drawing/Animator/Animator.pde similarity index 100% rename from mode/examples/Topics/Drawing/Animator/Animator.pde rename to processing/mode/examples/Topics/Drawing/Animator/Animator.pde diff --git a/mode/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde b/processing/mode/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde similarity index 100% rename from mode/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde rename to processing/mode/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde diff --git a/mode/examples/Topics/Drawing/CustomTool/CustomTool.pde b/processing/mode/examples/Topics/Drawing/CustomTool/CustomTool.pde similarity index 100% rename from mode/examples/Topics/Drawing/CustomTool/CustomTool.pde rename to processing/mode/examples/Topics/Drawing/CustomTool/CustomTool.pde diff --git a/mode/examples/Topics/Drawing/CustomTool/data/milan.jpg b/processing/mode/examples/Topics/Drawing/CustomTool/data/milan.jpg similarity index 100% rename from mode/examples/Topics/Drawing/CustomTool/data/milan.jpg rename to processing/mode/examples/Topics/Drawing/CustomTool/data/milan.jpg diff --git a/mode/examples/Topics/Drawing/CustomTool/data/paris.jpg b/processing/mode/examples/Topics/Drawing/CustomTool/data/paris.jpg similarity index 100% rename from mode/examples/Topics/Drawing/CustomTool/data/paris.jpg rename to processing/mode/examples/Topics/Drawing/CustomTool/data/paris.jpg diff --git a/mode/examples/Topics/Drawing/Pattern/Pattern.pde b/processing/mode/examples/Topics/Drawing/Pattern/Pattern.pde similarity index 100% rename from mode/examples/Topics/Drawing/Pattern/Pattern.pde rename to processing/mode/examples/Topics/Drawing/Pattern/Pattern.pde diff --git a/mode/examples/Topics/Drawing/Pulses/Pulses.pde b/processing/mode/examples/Topics/Drawing/Pulses/Pulses.pde similarity index 100% rename from mode/examples/Topics/Drawing/Pulses/Pulses.pde rename to processing/mode/examples/Topics/Drawing/Pulses/Pulses.pde diff --git a/mode/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde b/processing/mode/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde similarity index 100% rename from mode/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde rename to processing/mode/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde diff --git a/mode/examples/Topics/Effects/FireCube/FireCube.pde b/processing/mode/examples/Topics/Effects/FireCube/FireCube.pde similarity index 100% rename from mode/examples/Topics/Effects/FireCube/FireCube.pde rename to processing/mode/examples/Topics/Effects/FireCube/FireCube.pde diff --git a/mode/examples/Topics/Effects/Lens/Lens.pde b/processing/mode/examples/Topics/Effects/Lens/Lens.pde similarity index 100% rename from mode/examples/Topics/Effects/Lens/Lens.pde rename to processing/mode/examples/Topics/Effects/Lens/Lens.pde diff --git a/mode/examples/Topics/Effects/Lens/data/red_smoke.jpg b/processing/mode/examples/Topics/Effects/Lens/data/red_smoke.jpg similarity index 100% rename from mode/examples/Topics/Effects/Lens/data/red_smoke.jpg rename to processing/mode/examples/Topics/Effects/Lens/data/red_smoke.jpg diff --git a/mode/examples/Topics/Effects/Metaball/Metaball.pde b/processing/mode/examples/Topics/Effects/Metaball/Metaball.pde similarity index 100% rename from mode/examples/Topics/Effects/Metaball/Metaball.pde rename to processing/mode/examples/Topics/Effects/Metaball/Metaball.pde diff --git a/mode/examples/Topics/Effects/Plasma/Plasma.pde b/processing/mode/examples/Topics/Effects/Plasma/Plasma.pde similarity index 100% rename from mode/examples/Topics/Effects/Plasma/Plasma.pde rename to processing/mode/examples/Topics/Effects/Plasma/Plasma.pde diff --git a/mode/examples/Topics/Effects/Tunnel/Tunnel.pde b/processing/mode/examples/Topics/Effects/Tunnel/Tunnel.pde similarity index 100% rename from mode/examples/Topics/Effects/Tunnel/Tunnel.pde rename to processing/mode/examples/Topics/Effects/Tunnel/Tunnel.pde diff --git a/mode/examples/Topics/Effects/Tunnel/data/red_smoke.jpg b/processing/mode/examples/Topics/Effects/Tunnel/data/red_smoke.jpg similarity index 100% rename from mode/examples/Topics/Effects/Tunnel/data/red_smoke.jpg rename to processing/mode/examples/Topics/Effects/Tunnel/data/red_smoke.jpg diff --git a/mode/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde b/processing/mode/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde similarity index 100% rename from mode/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde rename to processing/mode/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde diff --git a/mode/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png b/processing/mode/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png similarity index 100% rename from mode/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png rename to processing/mode/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png diff --git a/mode/examples/Topics/Effects/Wormhole/Wormhole.pde b/processing/mode/examples/Topics/Effects/Wormhole/Wormhole.pde similarity index 100% rename from mode/examples/Topics/Effects/Wormhole/Wormhole.pde rename to processing/mode/examples/Topics/Effects/Wormhole/Wormhole.pde diff --git a/mode/examples/Topics/Effects/Wormhole/data/texture.gif b/processing/mode/examples/Topics/Effects/Wormhole/data/texture.gif similarity index 100% rename from mode/examples/Topics/Effects/Wormhole/data/texture.gif rename to processing/mode/examples/Topics/Effects/Wormhole/data/texture.gif diff --git a/mode/examples/Topics/Effects/Wormhole/data/wormhole.png b/processing/mode/examples/Topics/Effects/Wormhole/data/wormhole.png similarity index 100% rename from mode/examples/Topics/Effects/Wormhole/data/wormhole.png rename to processing/mode/examples/Topics/Effects/Wormhole/data/wormhole.png diff --git a/mode/examples/Topics/File IO/LoadFile1/LoadFile1.pde b/processing/mode/examples/Topics/File IO/LoadFile1/LoadFile1.pde similarity index 100% rename from mode/examples/Topics/File IO/LoadFile1/LoadFile1.pde rename to processing/mode/examples/Topics/File IO/LoadFile1/LoadFile1.pde diff --git a/mode/examples/Topics/File IO/LoadFile1/data/positions.txt b/processing/mode/examples/Topics/File IO/LoadFile1/data/positions.txt similarity index 100% rename from mode/examples/Topics/File IO/LoadFile1/data/positions.txt rename to processing/mode/examples/Topics/File IO/LoadFile1/data/positions.txt diff --git a/mode/examples/Topics/File IO/LoadFile2/LoadFile2.pde b/processing/mode/examples/Topics/File IO/LoadFile2/LoadFile2.pde similarity index 100% rename from mode/examples/Topics/File IO/LoadFile2/LoadFile2.pde rename to processing/mode/examples/Topics/File IO/LoadFile2/LoadFile2.pde diff --git a/mode/examples/Topics/File IO/LoadFile2/Record.pde b/processing/mode/examples/Topics/File IO/LoadFile2/Record.pde similarity index 100% rename from mode/examples/Topics/File IO/LoadFile2/Record.pde rename to processing/mode/examples/Topics/File IO/LoadFile2/Record.pde diff --git a/mode/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw b/processing/mode/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw similarity index 100% rename from mode/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw rename to processing/mode/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw diff --git a/mode/examples/Topics/File IO/LoadFile2/data/cars2.tsv b/processing/mode/examples/Topics/File IO/LoadFile2/data/cars2.tsv similarity index 100% rename from mode/examples/Topics/File IO/LoadFile2/data/cars2.tsv rename to processing/mode/examples/Topics/File IO/LoadFile2/data/cars2.tsv diff --git a/mode/examples/Topics/File IO/SaveFile1/SaveFile1.pde b/processing/mode/examples/Topics/File IO/SaveFile1/SaveFile1.pde similarity index 100% rename from mode/examples/Topics/File IO/SaveFile1/SaveFile1.pde rename to processing/mode/examples/Topics/File IO/SaveFile1/SaveFile1.pde diff --git a/mode/examples/Topics/File IO/SaveFile2/SaveFile2.pde b/processing/mode/examples/Topics/File IO/SaveFile2/SaveFile2.pde similarity index 100% rename from mode/examples/Topics/File IO/SaveFile2/SaveFile2.pde rename to processing/mode/examples/Topics/File IO/SaveFile2/SaveFile2.pde diff --git a/mode/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde b/processing/mode/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde similarity index 100% rename from mode/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde rename to processing/mode/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde diff --git a/mode/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde b/processing/mode/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde similarity index 100% rename from mode/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde rename to processing/mode/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde diff --git a/mode/examples/Topics/File IO/TileImages/TileImages.pde b/processing/mode/examples/Topics/File IO/TileImages/TileImages.pde similarity index 100% rename from mode/examples/Topics/File IO/TileImages/TileImages.pde rename to processing/mode/examples/Topics/File IO/TileImages/TileImages.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/Koch/Koch.pde b/processing/mode/examples/Topics/Fractals and L-Systems/Koch/Koch.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/Koch/Koch.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/Koch/Koch.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde b/processing/mode/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde b/processing/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde b/processing/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde b/processing/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde b/processing/mode/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde b/processing/mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde b/processing/mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde b/processing/mode/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde b/processing/mode/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde b/processing/mode/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde diff --git a/mode/examples/Topics/Fractals and L-Systems/Tree/Tree.pde b/processing/mode/examples/Topics/Fractals and L-Systems/Tree/Tree.pde similarity index 100% rename from mode/examples/Topics/Fractals and L-Systems/Tree/Tree.pde rename to processing/mode/examples/Topics/Fractals and L-Systems/Tree/Tree.pde diff --git a/mode/examples/Topics/GUI/Button/Button.pde b/processing/mode/examples/Topics/GUI/Button/Button.pde similarity index 100% rename from mode/examples/Topics/GUI/Button/Button.pde rename to processing/mode/examples/Topics/GUI/Button/Button.pde diff --git a/mode/examples/Topics/GUI/Buttons/Buttons.pde b/processing/mode/examples/Topics/GUI/Buttons/Buttons.pde similarity index 100% rename from mode/examples/Topics/GUI/Buttons/Buttons.pde rename to processing/mode/examples/Topics/GUI/Buttons/Buttons.pde diff --git a/mode/examples/Topics/GUI/Handles/Handles.pde b/processing/mode/examples/Topics/GUI/Handles/Handles.pde similarity index 100% rename from mode/examples/Topics/GUI/Handles/Handles.pde rename to processing/mode/examples/Topics/GUI/Handles/Handles.pde diff --git a/mode/examples/Topics/GUI/ImageButton/ImageButton.pde b/processing/mode/examples/Topics/GUI/ImageButton/ImageButton.pde similarity index 100% rename from mode/examples/Topics/GUI/ImageButton/ImageButton.pde rename to processing/mode/examples/Topics/GUI/ImageButton/ImageButton.pde diff --git a/mode/examples/Topics/GUI/ImageButton/data/base.gif b/processing/mode/examples/Topics/GUI/ImageButton/data/base.gif similarity index 100% rename from mode/examples/Topics/GUI/ImageButton/data/base.gif rename to processing/mode/examples/Topics/GUI/ImageButton/data/base.gif diff --git a/mode/examples/Topics/GUI/ImageButton/data/down.gif b/processing/mode/examples/Topics/GUI/ImageButton/data/down.gif similarity index 100% rename from mode/examples/Topics/GUI/ImageButton/data/down.gif rename to processing/mode/examples/Topics/GUI/ImageButton/data/down.gif diff --git a/mode/examples/Topics/GUI/ImageButton/data/roll.gif b/processing/mode/examples/Topics/GUI/ImageButton/data/roll.gif similarity index 100% rename from mode/examples/Topics/GUI/ImageButton/data/roll.gif rename to processing/mode/examples/Topics/GUI/ImageButton/data/roll.gif diff --git a/mode/examples/Topics/GUI/Rollover/Rollover.pde b/processing/mode/examples/Topics/GUI/Rollover/Rollover.pde similarity index 100% rename from mode/examples/Topics/GUI/Rollover/Rollover.pde rename to processing/mode/examples/Topics/GUI/Rollover/Rollover.pde diff --git a/mode/examples/Topics/GUI/Scrollbar/Scrollbar.pde b/processing/mode/examples/Topics/GUI/Scrollbar/Scrollbar.pde similarity index 100% rename from mode/examples/Topics/GUI/Scrollbar/Scrollbar.pde rename to processing/mode/examples/Topics/GUI/Scrollbar/Scrollbar.pde diff --git a/mode/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg b/processing/mode/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg similarity index 100% rename from mode/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg rename to processing/mode/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg diff --git a/mode/examples/Topics/GUI/Scrollbar/data/seedTop.jpg b/processing/mode/examples/Topics/GUI/Scrollbar/data/seedTop.jpg similarity index 100% rename from mode/examples/Topics/GUI/Scrollbar/data/seedTop.jpg rename to processing/mode/examples/Topics/GUI/Scrollbar/data/seedTop.jpg diff --git a/mode/examples/Topics/Geometry/Icosahedra/Dimension3D.pde b/processing/mode/examples/Topics/Geometry/Icosahedra/Dimension3D.pde similarity index 100% rename from mode/examples/Topics/Geometry/Icosahedra/Dimension3D.pde rename to processing/mode/examples/Topics/Geometry/Icosahedra/Dimension3D.pde diff --git a/mode/examples/Topics/Geometry/Icosahedra/Icosahedra.pde b/processing/mode/examples/Topics/Geometry/Icosahedra/Icosahedra.pde similarity index 100% rename from mode/examples/Topics/Geometry/Icosahedra/Icosahedra.pde rename to processing/mode/examples/Topics/Geometry/Icosahedra/Icosahedra.pde diff --git a/mode/examples/Topics/Geometry/Icosahedra/Icosahedron.pde b/processing/mode/examples/Topics/Geometry/Icosahedra/Icosahedron.pde similarity index 100% rename from mode/examples/Topics/Geometry/Icosahedra/Icosahedron.pde rename to processing/mode/examples/Topics/Geometry/Icosahedra/Icosahedron.pde diff --git a/mode/examples/Topics/Geometry/Icosahedra/Shape3D.pde b/processing/mode/examples/Topics/Geometry/Icosahedra/Shape3D.pde similarity index 100% rename from mode/examples/Topics/Geometry/Icosahedra/Shape3D.pde rename to processing/mode/examples/Topics/Geometry/Icosahedra/Shape3D.pde diff --git a/mode/examples/Topics/Geometry/NoiseSphere/NoiseSphere.pde b/processing/mode/examples/Topics/Geometry/NoiseSphere/NoiseSphere.pde similarity index 100% rename from mode/examples/Topics/Geometry/NoiseSphere/NoiseSphere.pde rename to processing/mode/examples/Topics/Geometry/NoiseSphere/NoiseSphere.pde diff --git a/mode/examples/Topics/Geometry/RGBCube/RGBCube.pde b/processing/mode/examples/Topics/Geometry/RGBCube/RGBCube.pde similarity index 100% rename from mode/examples/Topics/Geometry/RGBCube/RGBCube.pde rename to processing/mode/examples/Topics/Geometry/RGBCube/RGBCube.pde diff --git a/mode/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde b/processing/mode/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde similarity index 100% rename from mode/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde rename to processing/mode/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde diff --git a/mode/examples/Topics/Geometry/SpaceJunk/Cube.pde b/processing/mode/examples/Topics/Geometry/SpaceJunk/Cube.pde similarity index 100% rename from mode/examples/Topics/Geometry/SpaceJunk/Cube.pde rename to processing/mode/examples/Topics/Geometry/SpaceJunk/Cube.pde diff --git a/mode/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde b/processing/mode/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde similarity index 100% rename from mode/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde rename to processing/mode/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde diff --git a/mode/examples/Topics/Geometry/Toroid/Toroid.pde b/processing/mode/examples/Topics/Geometry/Toroid/Toroid.pde similarity index 100% rename from mode/examples/Topics/Geometry/Toroid/Toroid.pde rename to processing/mode/examples/Topics/Geometry/Toroid/Toroid.pde diff --git a/mode/examples/Topics/Geometry/Vertices/Vertices.pde b/processing/mode/examples/Topics/Geometry/Vertices/Vertices.pde similarity index 100% rename from mode/examples/Topics/Geometry/Vertices/Vertices.pde rename to processing/mode/examples/Topics/Geometry/Vertices/Vertices.pde diff --git a/mode/examples/Topics/Image Processing/Blur/Blur.pde b/processing/mode/examples/Topics/Image Processing/Blur/Blur.pde similarity index 100% rename from mode/examples/Topics/Image Processing/Blur/Blur.pde rename to processing/mode/examples/Topics/Image Processing/Blur/Blur.pde diff --git a/mode/examples/Topics/Image Processing/Blur/data/trees.jpg b/processing/mode/examples/Topics/Image Processing/Blur/data/trees.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/Blur/data/trees.jpg rename to processing/mode/examples/Topics/Image Processing/Blur/data/trees.jpg diff --git a/mode/examples/Topics/Image Processing/Brightness/Brightness.pde b/processing/mode/examples/Topics/Image Processing/Brightness/Brightness.pde similarity index 100% rename from mode/examples/Topics/Image Processing/Brightness/Brightness.pde rename to processing/mode/examples/Topics/Image Processing/Brightness/Brightness.pde diff --git a/mode/examples/Topics/Image Processing/Brightness/data/wires.jpg b/processing/mode/examples/Topics/Image Processing/Brightness/data/wires.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/Brightness/data/wires.jpg rename to processing/mode/examples/Topics/Image Processing/Brightness/data/wires.jpg diff --git a/mode/examples/Topics/Image Processing/Convolution/Convolution.pde b/processing/mode/examples/Topics/Image Processing/Convolution/Convolution.pde similarity index 100% rename from mode/examples/Topics/Image Processing/Convolution/Convolution.pde rename to processing/mode/examples/Topics/Image Processing/Convolution/Convolution.pde diff --git a/mode/examples/Topics/Image Processing/Convolution/data/end.jpg b/processing/mode/examples/Topics/Image Processing/Convolution/data/end.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/Convolution/data/end.jpg rename to processing/mode/examples/Topics/Image Processing/Convolution/data/end.jpg diff --git a/mode/examples/Topics/Image Processing/Convolution/data/sunflower.jpg b/processing/mode/examples/Topics/Image Processing/Convolution/data/sunflower.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/Convolution/data/sunflower.jpg rename to processing/mode/examples/Topics/Image Processing/Convolution/data/sunflower.jpg diff --git a/mode/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde b/processing/mode/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde similarity index 100% rename from mode/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde rename to processing/mode/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde diff --git a/mode/examples/Topics/Image Processing/EdgeDetection/data/house.jpg b/processing/mode/examples/Topics/Image Processing/EdgeDetection/data/house.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/EdgeDetection/data/house.jpg rename to processing/mode/examples/Topics/Image Processing/EdgeDetection/data/house.jpg diff --git a/mode/examples/Topics/Image Processing/Histogram/Histogram.pde b/processing/mode/examples/Topics/Image Processing/Histogram/Histogram.pde similarity index 100% rename from mode/examples/Topics/Image Processing/Histogram/Histogram.pde rename to processing/mode/examples/Topics/Image Processing/Histogram/Histogram.pde diff --git a/mode/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg b/processing/mode/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg rename to processing/mode/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg diff --git a/mode/examples/Topics/Image Processing/Histogram/data/ystone08.jpg b/processing/mode/examples/Topics/Image Processing/Histogram/data/ystone08.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/Histogram/data/ystone08.jpg rename to processing/mode/examples/Topics/Image Processing/Histogram/data/ystone08.jpg diff --git a/mode/examples/Topics/Image Processing/LinearImage/LinearImage.pde b/processing/mode/examples/Topics/Image Processing/LinearImage/LinearImage.pde similarity index 100% rename from mode/examples/Topics/Image Processing/LinearImage/LinearImage.pde rename to processing/mode/examples/Topics/Image Processing/LinearImage/LinearImage.pde diff --git a/mode/examples/Topics/Image Processing/LinearImage/data/florence03.jpg b/processing/mode/examples/Topics/Image Processing/LinearImage/data/florence03.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/LinearImage/data/florence03.jpg rename to processing/mode/examples/Topics/Image Processing/LinearImage/data/florence03.jpg diff --git a/mode/examples/Topics/Image Processing/PixelArray/PixelArray.pde b/processing/mode/examples/Topics/Image Processing/PixelArray/PixelArray.pde similarity index 100% rename from mode/examples/Topics/Image Processing/PixelArray/PixelArray.pde rename to processing/mode/examples/Topics/Image Processing/PixelArray/PixelArray.pde diff --git a/mode/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg b/processing/mode/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg similarity index 100% rename from mode/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg rename to processing/mode/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg diff --git a/mode/examples/Topics/Interaction/Follow1/Follow1.pde b/processing/mode/examples/Topics/Interaction/Follow1/Follow1.pde similarity index 100% rename from mode/examples/Topics/Interaction/Follow1/Follow1.pde rename to processing/mode/examples/Topics/Interaction/Follow1/Follow1.pde diff --git a/mode/examples/Topics/Interaction/Follow2/Follow2.pde b/processing/mode/examples/Topics/Interaction/Follow2/Follow2.pde similarity index 100% rename from mode/examples/Topics/Interaction/Follow2/Follow2.pde rename to processing/mode/examples/Topics/Interaction/Follow2/Follow2.pde diff --git a/mode/examples/Topics/Interaction/Follow3/Follow3.pde b/processing/mode/examples/Topics/Interaction/Follow3/Follow3.pde similarity index 100% rename from mode/examples/Topics/Interaction/Follow3/Follow3.pde rename to processing/mode/examples/Topics/Interaction/Follow3/Follow3.pde diff --git a/mode/examples/Topics/Interaction/Multitouch/Multitouch.pde b/processing/mode/examples/Topics/Interaction/Multitouch/Multitouch.pde similarity index 100% rename from mode/examples/Topics/Interaction/Multitouch/Multitouch.pde rename to processing/mode/examples/Topics/Interaction/Multitouch/Multitouch.pde diff --git a/mode/examples/Topics/Interaction/Reach1/Reach1.pde b/processing/mode/examples/Topics/Interaction/Reach1/Reach1.pde similarity index 100% rename from mode/examples/Topics/Interaction/Reach1/Reach1.pde rename to processing/mode/examples/Topics/Interaction/Reach1/Reach1.pde diff --git a/mode/examples/Topics/Interaction/Reach2/Reach2.pde b/processing/mode/examples/Topics/Interaction/Reach2/Reach2.pde similarity index 100% rename from mode/examples/Topics/Interaction/Reach2/Reach2.pde rename to processing/mode/examples/Topics/Interaction/Reach2/Reach2.pde diff --git a/mode/examples/Topics/Interaction/Reach3/Reach3.pde b/processing/mode/examples/Topics/Interaction/Reach3/Reach3.pde similarity index 100% rename from mode/examples/Topics/Interaction/Reach3/Reach3.pde rename to processing/mode/examples/Topics/Interaction/Reach3/Reach3.pde diff --git a/mode/examples/Topics/Interaction/Tickle/Tickle.pde b/processing/mode/examples/Topics/Interaction/Tickle/Tickle.pde similarity index 100% rename from mode/examples/Topics/Interaction/Tickle/Tickle.pde rename to processing/mode/examples/Topics/Interaction/Tickle/Tickle.pde diff --git a/mode/examples/Topics/Interaction/Tickle/data/AmericanTypewriter-24.vlw b/processing/mode/examples/Topics/Interaction/Tickle/data/AmericanTypewriter-24.vlw similarity index 100% rename from mode/examples/Topics/Interaction/Tickle/data/AmericanTypewriter-24.vlw rename to processing/mode/examples/Topics/Interaction/Tickle/data/AmericanTypewriter-24.vlw diff --git a/mode/examples/Topics/Motion/Bounce/Bounce.pde b/processing/mode/examples/Topics/Motion/Bounce/Bounce.pde similarity index 100% rename from mode/examples/Topics/Motion/Bounce/Bounce.pde rename to processing/mode/examples/Topics/Motion/Bounce/Bounce.pde diff --git a/mode/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde b/processing/mode/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde similarity index 100% rename from mode/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde rename to processing/mode/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde diff --git a/mode/examples/Topics/Motion/Brownian/Brownian.pde b/processing/mode/examples/Topics/Motion/Brownian/Brownian.pde similarity index 100% rename from mode/examples/Topics/Motion/Brownian/Brownian.pde rename to processing/mode/examples/Topics/Motion/Brownian/Brownian.pde diff --git a/mode/examples/Topics/Motion/CircleCollision/Ball.pde b/processing/mode/examples/Topics/Motion/CircleCollision/Ball.pde similarity index 100% rename from mode/examples/Topics/Motion/CircleCollision/Ball.pde rename to processing/mode/examples/Topics/Motion/CircleCollision/Ball.pde diff --git a/mode/examples/Topics/Motion/CircleCollision/CircleCollision.pde b/processing/mode/examples/Topics/Motion/CircleCollision/CircleCollision.pde similarity index 100% rename from mode/examples/Topics/Motion/CircleCollision/CircleCollision.pde rename to processing/mode/examples/Topics/Motion/CircleCollision/CircleCollision.pde diff --git a/mode/examples/Topics/Motion/Collision/Collision.pde b/processing/mode/examples/Topics/Motion/Collision/Collision.pde similarity index 100% rename from mode/examples/Topics/Motion/Collision/Collision.pde rename to processing/mode/examples/Topics/Motion/Collision/Collision.pde diff --git a/mode/examples/Topics/Motion/Linear/Linear.pde b/processing/mode/examples/Topics/Motion/Linear/Linear.pde similarity index 100% rename from mode/examples/Topics/Motion/Linear/Linear.pde rename to processing/mode/examples/Topics/Motion/Linear/Linear.pde diff --git a/mode/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde b/processing/mode/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde similarity index 100% rename from mode/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde rename to processing/mode/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde diff --git a/mode/examples/Topics/Motion/Puff/Puff.pde b/processing/mode/examples/Topics/Motion/Puff/Puff.pde similarity index 100% rename from mode/examples/Topics/Motion/Puff/Puff.pde rename to processing/mode/examples/Topics/Motion/Puff/Puff.pde diff --git a/mode/examples/Topics/Motion/Reflection1/Reflection1.pde b/processing/mode/examples/Topics/Motion/Reflection1/Reflection1.pde similarity index 100% rename from mode/examples/Topics/Motion/Reflection1/Reflection1.pde rename to processing/mode/examples/Topics/Motion/Reflection1/Reflection1.pde diff --git a/mode/examples/Topics/Motion/Reflection2/Ground.pde b/processing/mode/examples/Topics/Motion/Reflection2/Ground.pde similarity index 100% rename from mode/examples/Topics/Motion/Reflection2/Ground.pde rename to processing/mode/examples/Topics/Motion/Reflection2/Ground.pde diff --git a/mode/examples/Topics/Motion/Reflection2/Orb.pde b/processing/mode/examples/Topics/Motion/Reflection2/Orb.pde similarity index 100% rename from mode/examples/Topics/Motion/Reflection2/Orb.pde rename to processing/mode/examples/Topics/Motion/Reflection2/Orb.pde diff --git a/mode/examples/Topics/Motion/Reflection2/Reflection2.pde b/processing/mode/examples/Topics/Motion/Reflection2/Reflection2.pde similarity index 100% rename from mode/examples/Topics/Motion/Reflection2/Reflection2.pde rename to processing/mode/examples/Topics/Motion/Reflection2/Reflection2.pde diff --git a/mode/examples/Topics/Shaders/BlurFilter/BlurFilter.pde b/processing/mode/examples/Topics/Shaders/BlurFilter/BlurFilter.pde similarity index 100% rename from mode/examples/Topics/Shaders/BlurFilter/BlurFilter.pde rename to processing/mode/examples/Topics/Shaders/BlurFilter/BlurFilter.pde diff --git a/mode/examples/Topics/Shaders/BlurFilter/data/blur.glsl b/processing/mode/examples/Topics/Shaders/BlurFilter/data/blur.glsl similarity index 100% rename from mode/examples/Topics/Shaders/BlurFilter/data/blur.glsl rename to processing/mode/examples/Topics/Shaders/BlurFilter/data/blur.glsl diff --git a/mode/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde b/processing/mode/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde similarity index 100% rename from mode/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde rename to processing/mode/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde diff --git a/mode/examples/Topics/Shaders/EdgeDetect/data/edges.glsl b/processing/mode/examples/Topics/Shaders/EdgeDetect/data/edges.glsl similarity index 100% rename from mode/examples/Topics/Shaders/EdgeDetect/data/edges.glsl rename to processing/mode/examples/Topics/Shaders/EdgeDetect/data/edges.glsl diff --git a/mode/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg b/processing/mode/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg similarity index 100% rename from mode/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg rename to processing/mode/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg diff --git a/mode/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde b/processing/mode/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde similarity index 100% rename from mode/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde rename to processing/mode/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde diff --git a/mode/examples/Topics/Shaders/EdgeFilter/data/edges.glsl b/processing/mode/examples/Topics/Shaders/EdgeFilter/data/edges.glsl similarity index 100% rename from mode/examples/Topics/Shaders/EdgeFilter/data/edges.glsl rename to processing/mode/examples/Topics/Shaders/EdgeFilter/data/edges.glsl diff --git a/mode/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde b/processing/mode/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde similarity index 100% rename from mode/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde rename to processing/mode/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde diff --git a/mode/examples/Topics/Shaders/LowLevelGL/data/frag.glsl b/processing/mode/examples/Topics/Shaders/LowLevelGL/data/frag.glsl similarity index 100% rename from mode/examples/Topics/Shaders/LowLevelGL/data/frag.glsl rename to processing/mode/examples/Topics/Shaders/LowLevelGL/data/frag.glsl diff --git a/mode/examples/Topics/Shaders/LowLevelGL/data/vert.glsl b/processing/mode/examples/Topics/Shaders/LowLevelGL/data/vert.glsl similarity index 100% rename from mode/examples/Topics/Shaders/LowLevelGL/data/vert.glsl rename to processing/mode/examples/Topics/Shaders/LowLevelGL/data/vert.glsl diff --git a/mode/examples/Topics/Shaders/ToonShading/ToonShading.pde b/processing/mode/examples/Topics/Shaders/ToonShading/ToonShading.pde similarity index 100% rename from mode/examples/Topics/Shaders/ToonShading/ToonShading.pde rename to processing/mode/examples/Topics/Shaders/ToonShading/ToonShading.pde diff --git a/mode/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl b/processing/mode/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl similarity index 100% rename from mode/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl rename to processing/mode/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl diff --git a/mode/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl b/processing/mode/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl similarity index 100% rename from mode/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl rename to processing/mode/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl diff --git a/mode/examples/Topics/Simulate/Chain/Chain.pde b/processing/mode/examples/Topics/Simulate/Chain/Chain.pde similarity index 100% rename from mode/examples/Topics/Simulate/Chain/Chain.pde rename to processing/mode/examples/Topics/Simulate/Chain/Chain.pde diff --git a/mode/examples/Topics/Simulate/Flocking/Boid.pde b/processing/mode/examples/Topics/Simulate/Flocking/Boid.pde similarity index 100% rename from mode/examples/Topics/Simulate/Flocking/Boid.pde rename to processing/mode/examples/Topics/Simulate/Flocking/Boid.pde diff --git a/mode/examples/Topics/Simulate/Flocking/Flock.pde b/processing/mode/examples/Topics/Simulate/Flocking/Flock.pde similarity index 100% rename from mode/examples/Topics/Simulate/Flocking/Flock.pde rename to processing/mode/examples/Topics/Simulate/Flocking/Flock.pde diff --git a/mode/examples/Topics/Simulate/Flocking/Flocking.pde b/processing/mode/examples/Topics/Simulate/Flocking/Flocking.pde similarity index 100% rename from mode/examples/Topics/Simulate/Flocking/Flocking.pde rename to processing/mode/examples/Topics/Simulate/Flocking/Flocking.pde diff --git a/mode/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde b/processing/mode/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde similarity index 100% rename from mode/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde rename to processing/mode/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde diff --git a/mode/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde b/processing/mode/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde similarity index 100% rename from mode/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde rename to processing/mode/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde diff --git a/mode/examples/Topics/Simulate/ForcesWithVectors/Mover.pde b/processing/mode/examples/Topics/Simulate/ForcesWithVectors/Mover.pde similarity index 100% rename from mode/examples/Topics/Simulate/ForcesWithVectors/Mover.pde rename to processing/mode/examples/Topics/Simulate/ForcesWithVectors/Mover.pde diff --git a/mode/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde b/processing/mode/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde similarity index 100% rename from mode/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde rename to processing/mode/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde diff --git a/mode/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde b/processing/mode/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde similarity index 100% rename from mode/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde rename to processing/mode/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde diff --git a/mode/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde b/processing/mode/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde similarity index 100% rename from mode/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde rename to processing/mode/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde diff --git a/mode/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde b/processing/mode/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde similarity index 100% rename from mode/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde rename to processing/mode/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde diff --git a/mode/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde b/processing/mode/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde similarity index 100% rename from mode/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde rename to processing/mode/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde diff --git a/mode/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde b/processing/mode/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde similarity index 100% rename from mode/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde rename to processing/mode/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde diff --git a/mode/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde b/processing/mode/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde similarity index 100% rename from mode/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde rename to processing/mode/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde diff --git a/mode/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde b/processing/mode/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde similarity index 100% rename from mode/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde rename to processing/mode/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde diff --git a/mode/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde b/processing/mode/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde similarity index 100% rename from mode/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde rename to processing/mode/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde diff --git a/mode/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde b/processing/mode/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde similarity index 100% rename from mode/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde rename to processing/mode/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde diff --git a/mode/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde b/processing/mode/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde similarity index 100% rename from mode/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde rename to processing/mode/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde diff --git a/mode/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde b/processing/mode/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde similarity index 100% rename from mode/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde rename to processing/mode/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde diff --git a/mode/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde b/processing/mode/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde similarity index 100% rename from mode/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde rename to processing/mode/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde diff --git a/mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif b/processing/mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif similarity index 100% rename from mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif rename to processing/mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif diff --git a/mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.png b/processing/mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.png similarity index 100% rename from mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.png rename to processing/mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.png diff --git a/mode/examples/Topics/Simulate/SoftBody/SoftBody.pde b/processing/mode/examples/Topics/Simulate/SoftBody/SoftBody.pde similarity index 100% rename from mode/examples/Topics/Simulate/SoftBody/SoftBody.pde rename to processing/mode/examples/Topics/Simulate/SoftBody/SoftBody.pde diff --git a/mode/examples/Topics/Simulate/Spring/Spring.pde b/processing/mode/examples/Topics/Simulate/Spring/Spring.pde similarity index 100% rename from mode/examples/Topics/Simulate/Spring/Spring.pde rename to processing/mode/examples/Topics/Simulate/Spring/Spring.pde diff --git a/mode/examples/Topics/Simulate/Springs/Springs.pde b/processing/mode/examples/Topics/Simulate/Springs/Springs.pde similarity index 100% rename from mode/examples/Topics/Simulate/Springs/Springs.pde rename to processing/mode/examples/Topics/Simulate/Springs/Springs.pde diff --git a/mode/examples/Topics/Textures/TextureCube/TextureCube.pde b/processing/mode/examples/Topics/Textures/TextureCube/TextureCube.pde similarity index 100% rename from mode/examples/Topics/Textures/TextureCube/TextureCube.pde rename to processing/mode/examples/Topics/Textures/TextureCube/TextureCube.pde diff --git a/mode/examples/Topics/Textures/TextureCube/data/berlin-1.jpg b/processing/mode/examples/Topics/Textures/TextureCube/data/berlin-1.jpg similarity index 100% rename from mode/examples/Topics/Textures/TextureCube/data/berlin-1.jpg rename to processing/mode/examples/Topics/Textures/TextureCube/data/berlin-1.jpg diff --git a/mode/examples/Topics/Textures/TextureCube/data/uvtex.jpg b/processing/mode/examples/Topics/Textures/TextureCube/data/uvtex.jpg similarity index 100% rename from mode/examples/Topics/Textures/TextureCube/data/uvtex.jpg rename to processing/mode/examples/Topics/Textures/TextureCube/data/uvtex.jpg diff --git a/mode/examples/Topics/Textures/TextureCylinder/TextureCylinder.pde b/processing/mode/examples/Topics/Textures/TextureCylinder/TextureCylinder.pde similarity index 100% rename from mode/examples/Topics/Textures/TextureCylinder/TextureCylinder.pde rename to processing/mode/examples/Topics/Textures/TextureCylinder/TextureCylinder.pde diff --git a/mode/examples/Topics/Textures/TextureCylinder/data/berlin-1.jpg b/processing/mode/examples/Topics/Textures/TextureCylinder/data/berlin-1.jpg similarity index 100% rename from mode/examples/Topics/Textures/TextureCylinder/data/berlin-1.jpg rename to processing/mode/examples/Topics/Textures/TextureCylinder/data/berlin-1.jpg diff --git a/mode/examples/Topics/Textures/TextureQuad/TextureQuad.pde b/processing/mode/examples/Topics/Textures/TextureQuad/TextureQuad.pde similarity index 100% rename from mode/examples/Topics/Textures/TextureQuad/TextureQuad.pde rename to processing/mode/examples/Topics/Textures/TextureQuad/TextureQuad.pde diff --git a/mode/examples/Topics/Textures/TextureQuad/data/berlin-1.jpg b/processing/mode/examples/Topics/Textures/TextureQuad/data/berlin-1.jpg similarity index 100% rename from mode/examples/Topics/Textures/TextureQuad/data/berlin-1.jpg rename to processing/mode/examples/Topics/Textures/TextureQuad/data/berlin-1.jpg diff --git a/mode/examples/Topics/Textures/TextureSphere/TextureSphere.pde b/processing/mode/examples/Topics/Textures/TextureSphere/TextureSphere.pde similarity index 100% rename from mode/examples/Topics/Textures/TextureSphere/TextureSphere.pde rename to processing/mode/examples/Topics/Textures/TextureSphere/TextureSphere.pde diff --git a/mode/examples/Topics/Textures/TextureSphere/data/world32k.jpg b/processing/mode/examples/Topics/Textures/TextureSphere/data/world32k.jpg similarity index 100% rename from mode/examples/Topics/Textures/TextureSphere/data/world32k.jpg rename to processing/mode/examples/Topics/Textures/TextureSphere/data/world32k.jpg diff --git a/mode/examples/Topics/Textures/TextureTriangle/TextureTriangle.pde b/processing/mode/examples/Topics/Textures/TextureTriangle/TextureTriangle.pde similarity index 100% rename from mode/examples/Topics/Textures/TextureTriangle/TextureTriangle.pde rename to processing/mode/examples/Topics/Textures/TextureTriangle/TextureTriangle.pde diff --git a/mode/examples/Topics/Textures/TextureTriangle/data/berlin-1.jpg b/processing/mode/examples/Topics/Textures/TextureTriangle/data/berlin-1.jpg similarity index 100% rename from mode/examples/Topics/Textures/TextureTriangle/data/berlin-1.jpg rename to processing/mode/examples/Topics/Textures/TextureTriangle/data/berlin-1.jpg diff --git a/mode/examples/Topics/Vectors/AccelerationWithVectors/AccelerationWithVectors.pde b/processing/mode/examples/Topics/Vectors/AccelerationWithVectors/AccelerationWithVectors.pde similarity index 100% rename from mode/examples/Topics/Vectors/AccelerationWithVectors/AccelerationWithVectors.pde rename to processing/mode/examples/Topics/Vectors/AccelerationWithVectors/AccelerationWithVectors.pde diff --git a/mode/examples/Topics/Vectors/AccelerationWithVectors/Mover.pde b/processing/mode/examples/Topics/Vectors/AccelerationWithVectors/Mover.pde similarity index 100% rename from mode/examples/Topics/Vectors/AccelerationWithVectors/Mover.pde rename to processing/mode/examples/Topics/Vectors/AccelerationWithVectors/Mover.pde diff --git a/mode/examples/Topics/Vectors/BouncingBall/BouncingBall.pde b/processing/mode/examples/Topics/Vectors/BouncingBall/BouncingBall.pde similarity index 100% rename from mode/examples/Topics/Vectors/BouncingBall/BouncingBall.pde rename to processing/mode/examples/Topics/Vectors/BouncingBall/BouncingBall.pde diff --git a/mode/examples/Topics/Vectors/Normalize/Normalize.pde b/processing/mode/examples/Topics/Vectors/Normalize/Normalize.pde similarity index 100% rename from mode/examples/Topics/Vectors/Normalize/Normalize.pde rename to processing/mode/examples/Topics/Vectors/Normalize/Normalize.pde diff --git a/mode/examples/Topics/Vectors/VectorMath/VectorMath.pde b/processing/mode/examples/Topics/Vectors/VectorMath/VectorMath.pde similarity index 100% rename from mode/examples/Topics/Vectors/VectorMath/VectorMath.pde rename to processing/mode/examples/Topics/Vectors/VectorMath/VectorMath.pde diff --git a/mode/examples/Topics/Wallpapers/Circles/Circles.pde b/processing/mode/examples/Topics/Wallpapers/Circles/Circles.pde similarity index 100% rename from mode/examples/Topics/Wallpapers/Circles/Circles.pde rename to processing/mode/examples/Topics/Wallpapers/Circles/Circles.pde diff --git a/mode/examples/Topics/Wallpapers/Circles/code/sketch.properties b/processing/mode/examples/Topics/Wallpapers/Circles/code/sketch.properties similarity index 100% rename from mode/examples/Topics/Wallpapers/Circles/code/sketch.properties rename to processing/mode/examples/Topics/Wallpapers/Circles/code/sketch.properties diff --git a/mode/examples/Topics/Watchfaces/WatchFace/WatchFace.pde b/processing/mode/examples/Topics/Watchfaces/WatchFace/WatchFace.pde similarity index 100% rename from mode/examples/Topics/Watchfaces/WatchFace/WatchFace.pde rename to processing/mode/examples/Topics/Watchfaces/WatchFace/WatchFace.pde diff --git a/mode/examples/Topics/Watchfaces/WatchFace/code/sketch.properties b/processing/mode/examples/Topics/Watchfaces/WatchFace/code/sketch.properties similarity index 100% rename from mode/examples/Topics/Watchfaces/WatchFace/code/sketch.properties rename to processing/mode/examples/Topics/Watchfaces/WatchFace/code/sketch.properties diff --git a/processing/mode/icons/launcher_144.png b/processing/mode/icons/launcher_144.png new file mode 100644 index 000000000..78fed6592 Binary files /dev/null and b/processing/mode/icons/launcher_144.png differ diff --git a/processing/mode/icons/launcher_192.png b/processing/mode/icons/launcher_192.png new file mode 100644 index 000000000..48d3a34fe Binary files /dev/null and b/processing/mode/icons/launcher_192.png differ diff --git a/processing/mode/icons/launcher_36.png b/processing/mode/icons/launcher_36.png new file mode 100644 index 000000000..e276bbd6f Binary files /dev/null and b/processing/mode/icons/launcher_36.png differ diff --git a/processing/mode/icons/launcher_48.png b/processing/mode/icons/launcher_48.png new file mode 100644 index 000000000..9dde1a58f Binary files /dev/null and b/processing/mode/icons/launcher_48.png differ diff --git a/processing/mode/icons/launcher_72.png b/processing/mode/icons/launcher_72.png new file mode 100644 index 000000000..ff769c587 Binary files /dev/null and b/processing/mode/icons/launcher_72.png differ diff --git a/processing/mode/icons/launcher_96.png b/processing/mode/icons/launcher_96.png new file mode 100644 index 000000000..d9b25dba2 Binary files /dev/null and b/processing/mode/icons/launcher_96.png differ diff --git a/processing/mode/icons/preview_circular.png b/processing/mode/icons/preview_circular.png new file mode 100644 index 000000000..40a11bf0d Binary files /dev/null and b/processing/mode/icons/preview_circular.png differ diff --git a/processing/mode/icons/preview_rectangular.png b/processing/mode/icons/preview_rectangular.png new file mode 100644 index 000000000..9c9d9ed41 Binary files /dev/null and b/processing/mode/icons/preview_rectangular.png differ diff --git a/mode/keywords.txt b/processing/mode/keywords.txt similarity index 100% rename from mode/keywords.txt rename to processing/mode/keywords.txt diff --git a/mode/languages/mode.properties b/processing/mode/languages/mode.properties similarity index 88% rename from mode/languages/mode.properties rename to processing/mode/languages/mode.properties index fc025df53..a87ae41d9 100644 --- a/mode/languages/mode.properties +++ b/processing/mode/languages/mode.properties @@ -11,9 +11,22 @@ # | File | Edit | Sketch | Android | Tools | Help | # | File | +menu.sketch.stop = Stop +menu.file.new = New +menu.file.open = Open +menu.file.save = Save + menu.file.export_signed_package = Export Signed Package +menu.file.export_signed_bundle = Export Signed Bundle menu.file.export_android_project = Export Android Project + +# | File | Edit | Sketch | Android | Tools | Help | +# | Sketch | + +menu.sketch.run_on_device = Run on Device +menu.sketch.run_in_emulator = Run in Emulator + # | File | Edit | Sketch | Android | Tools | Help | # | Android | @@ -45,7 +58,7 @@ android_build.error.zip_files_not_allowed = .zip files are not allowed in Androi android_build.error.cannot_copy_icons = Problem while copying icons. android_build.error.cannot_create_icon_folder = Could not create "%s" folder android_build.warn.cannot_find_zipalign.title = Cannot find zipaling... -android_build.warn.cannot_find_zipalign.body = The zipalign build tool needed to prepare the export package is missing.\nMake sure that your Android SDK was downloaded correctly. +android_build.warn.cannot_find_zipalign.body = The zipalign build tool needed to prepare the export bundle is missing.\nMake sure that your Android SDK was downloaded correctly. # --------------------------------------- # Android Debugger @@ -63,6 +76,10 @@ android_editor.status.project_export_failed = Error with project export. android_editor.status.exporting_package = Exporting signed package... android_editor.status.package_export_completed = Done with package export. android_editor.status.package_export_failed = Error with package export. +android_editor.status.exporting_bundle = Exporting signed bundle... +android_editor.status.bundle_export_completed = Done with bundle export. +android_editor.status.bundle_export_failed = Error with bundle export. + android_editor.error.cannot_create_sketch_properties = Error While creating sketch properties file "%s": %s # --------------------------------------- @@ -78,25 +95,28 @@ android_keystore.error.cannot_create_keystore = The keystore could not be create # Android Mode android_mode.dialog.watchface_debug_title = Is the watch connected to the computer? -android_mode.dialog.watchface_debug_body = Processing will install watch faces on a smartwatch either over Wi-Fi or via Bluetooth, in which case the watch needs to be paired with a phone.

Read this guide on debugging an Android Wear App for more details. +android_mode.dialog.watchface_debug_body = Processing will install watch faces on a smartwatch either over Wi-Fi or via Bluetooth, in which case the watch needs to be paired with a phone.

Read this guide on debugging an Android Wear App for more details. android_mode.dialog.wallpaper_installed_title = Wallpaper installed! android_mode.dialog.wallpaper_installed_body = Processing just built and installed your sketch as a live wallpaper on the selected device.

You need to open the wallpaper picker in the device in order to select it as the new background. android_mode.dialog.watchface_installed_title = Watch face installed! android_mode.dialog.watchface_installed_body = Processing just built and installed your sketch as a watch face on the selected device.

You need to add it as a favourite watch face on the device and then select it from the watch face picker in order to run it. -android_mode.dialog.cannot_export_package_title = Cannot export package... -android_mode.dialog.cannot_export_package_body = The sketch still has the default package name. Not good, since this name will uniquely identify your app on the Play store... for ever! Come up with a different package name and write in the AndroidManifest.xml file in the sketch folder, after the "package=" attribute inside the manifest tag, which also contains version code and name. Once you have done that, try exporting the sketch again.

For more info on distributing apps from Processing,
check this online tutorial. -android_mode.dialog.cannot_use_default_icons_title = Cannot export package... -android_mode.dialog.cannot_use_default_icons_body = The sketch does not include all required app icons. Processing could use its default set of Android icons, which are okay to test the app on your device, but a bad idea to distribute it on the Play store. Create a full set of unique icons for your app, and copy them into the sketch folder. Once you have done that, try exporting the sketch again.

For more info on distributing apps from Processing,
check this online tutorial. +android_mode.dialog.cannot_export_package_title = Cannot complete export... +android_mode.dialog.cannot_export_package_body = The sketch still has the default package name. Not good, since this name will uniquely identify your app on the Play store... for ever! Come up with a different package name and write in the AndroidManifest.xml file in the sketch folder, after the "package=" attribute inside the manifest tag, which also contains version code and name. Once you have done that, try exporting the sketch again.

For more info on distributing apps from Processing,
check this online tutorial. +android_mode.dialog.cannot_use_default_icons_title = Cannot complete export... +android_mode.dialog.cannot_use_default_icons_body = The sketch does not include all required app icons. Processing could use its default set of Android icons, which are okay to test the app on your device, but a bad idea to distribute it on the Play store. Create a full set of unique icons for your app, and copy them into the sketch folder. Once you have done that, try exporting the sketch again.

For more info on distributing apps from Processing,
check this online tutorial. android_mode.warn.cannot_load_sdk_title = Bad news... android_mode.warn.cannot_load_sdk_body = The Android SDK could not be loaded.\nThe Android Mode will be disabled. android_mode.info.cannot_open_sdk_path = "Android SDK path couldn't be opened."; android_mode.error.cannot_create_avd = "Could not create a virtual device for the emulator."; +android_mode.error.emulator_installation_failed = "Encountered Issues with the emulator installation. Result Code is non-zero"; android_mode.dialog.no_devices_found_title = No devices found! android_mode.dialog.no_devices_found_body = Processing did not find any device where to run\nyour sketch on. Make sure that your handheld or\nwearable is properly connected to the computer\nand that USB or Bluetooth debugging is enabled. android_mode.status.no_devices_found = No devices found. android_mode.status.starting_project_build = Starting build... android_mode.status.building_project = Building Android project... android_mode.status.project_build_failed = Build failed. +android_mode.status.downloading_emulator = Downloading Emulator... +android_mode.status.downloading_emulator_successful = Emulator installation was successful. # --------------------------------------- # Android Preprocessor @@ -139,9 +159,9 @@ android_sdk.dialog.found_installed_sdk_body = Processing found a valid Android S android_sdk.option.use_existing_sdk = Use existing SDK android_sdk.option.download_new_sdk = Download new SDK android_sdk.dialog.cannot_find_sdk_title = Cannot find an Android SDK... -android_sdk.dialog.cannot_find_sdk_body = Processing did not find an Android SDK on this computer. If there is one, and you know where it is, click "Locate SDK path" to select it, or "Download SDK" to let Processing download the SDK automatically.

If you want to download the SDK manually, you can get the command line tools from here. Make sure to install the SDK platform for API %s. +android_sdk.dialog.cannot_find_sdk_body = Processing did not find an Android SDK on this computer. If there is one, and you know where it is, click "Locate SDK path" to select it, or "Download SDK" to let Processing download the SDK automatically.

If you want to download the SDK manually, you can get the command line tools from here. Make sure to install the SDK platform for API %s. android_sdk.dialog.invalid_sdk_title = Android SDK is not valid... -android_sdk.dialog.invalid_sdk_body = Processing found an Android SDK, but is not valid. It could be missing some files, or might not be including the required platform for API %s.

If a valid SDK is available in a different location, click "Locate SDK path" to select it, or "Download SDK" to let Processing download the SDK automatically.

If you want to download the SDK manually, you can get the command line tools from here. Make sure to install the SDK platform for API %s. +android_sdk.dialog.invalid_sdk_body = Processing found an Android SDK, but is not valid. It could be missing some files, or might not be including the required platform for API %s.

If a valid SDK is available in a different location, click "Locate SDK path" to select it, or "Download SDK" to let Processing download the SDK automatically.

If you want to download the SDK manually, you can get the command line tools from here. Make sure to install the SDK platform for API %s. android_sdk.option.download_sdk = Download SDK automatically android_sdk.option.locate_sdk = Locate SDK path manually android_sdk.dialog.download_phone_image_title = Download phone system image? @@ -153,22 +173,23 @@ android_sdk.error.sdk_selection_canceled = User canceled attempt to find SDK android_sdk.error.sdk_download_canceled = User canceled SDK download android_sdk.error.sdk_download_failed = SDK could not be downloaded android_sdk.dialog.sdk_installed_title = SDK installed! -android_sdk.dialog.sdk_installed_body = Processing just downloaded and installed the Android SDK successfully. The Android mode is now ready to use!

For documentation, examples, and tutorials, visit the Processing for Android website, and if you updated from version 3 of the mode, check the what's new page. -android_sdk.dialog.install_usb_driver =

If you are planning to use Google Nexus devices, then you need the Google USB Driver to connect them to Processing. You will have to install the driver manually following these instructions.

The installation files are available in this folder:
%s +android_sdk.dialog.sdk_installed_body = Processing just downloaded and installed the Android SDK successfully. The Android mode is now ready to use!

For documentation, examples, and tutorials, visit the Processing for Android website, and if you updated from version 3 of the mode, check the what's new page. +android_sdk.dialog.install_usb_driver =

If you are planning to use Google Nexus devices, then you need the Google USB Driver to connect them to Processing. You will have to install the driver manually following these instructions.

The installation files are available in this folder:
%s android_sdk.dialog.sdk_license_rejected_title = SDK license not accepted android_sdk.dialog.sdk_license_rejected_body = The Android SDK was installed, but will not be usable. You can accept the license at a later time by opening a terminal, changing to the SDK folder, and then running the following command:

tools/bin/sdkmanager --licenses android_sdk.dialog.32bit_system_title = System is 32 bit... -android_sdk.dialog.32bit_system_body = The Android SDK no longer includes 32 bit platform tools (adb, etc.), and so they will not work.

This thread provides some possible workarounds. +android_sdk.dialog.32bit_system_body = The Android SDK no longer includes 32 bit platform tools (adb, etc.), and so they will not work.

This thread provides some possible workarounds. android_sdk.error.emulator_download_canceled = User canceled emulator download android_sdk.error.emulator_download_failed = Emulator could not be downloaded android_sdk.dialog.using_existing_sdk_title = SDK configured! -android_sdk.dialog.using_existing_sdk_body = Processing will use the existing Android SDK. The Android mode is now ready to use!

For documentation, examples, and tutorials, visit the Processing for Android website, and if you updated from version 3 of the mode, check the what's new page. +android_sdk.dialog.using_existing_sdk_body = Processing will use the existing Android SDK. The Android mode is now ready to use!

For documentation, examples, and tutorials, visit the Processing for Android website, and if you updated from version 3 of the mode, check the what's new page. android_sdk.dialog.accept_sdk_license_title = Accept SDK license? -android_sdk.dialog.accept_sdk_license_body = You need to accept the terms of the Android SDK license from Google in order to use the SDK. Read the license from here. +android_sdk.dialog.accept_sdk_license_body = You need to accept the terms of the Android SDK license from Google in order to use the SDK. Read the license from here. android_sdk.warn.cannot_run_adb_title = Trouble with adb! android_sdk.warn.cannot_run_adb_body = Could not run the adb tool from the Android SDK.\nOne possibility is that its executable permission\nis not properly set. You can try setting this\npermission manually, or re-installing the SDK.\n\nThe mode will be disabled until this problem is fixed.\n android_sdk.error.missing_sdk_folder = %s does not exist -android_sdk.error.missing_tools_folder = There is no tools folder in %s +android_sdk.error.missing_cmdtools_folder_found_sdktools = There is no cmdline-tools/latest folder in %s and SDK Tools(sdk/tools) got deprecated.\nInstall cmdline-tools in the existing SDK specifically or Create New SDK. +android_sdk.error.missing_cmdtools_folder = There is no `cmdline-tools/latest` folder in %s \nInstall cmdline-tools in the existing SDK specifically or Create New SDK. android_sdk.error.missing_platform_tools_folder = There is no platform-tools folder in %s android_sdk.error.missing_build_tools_folder = There is no build-tools folder in %s android_sdk.error.missing_platforms_folder = There is no platforms folder in %s @@ -192,7 +213,7 @@ android_avd.error.cannot_load_avd_body = This could mean that the Android tools android_avd.error.sdk_wrong_install_title = The SDK is not properly installed -android_avd.error.sdk_wrong_install_body = Please re-read the installation instructions for Processing
found in this online tutorial. +android_avd.error.sdk_wrong_install_body = Please re-read the installation instructions for Processing
found in this online tutorial. # --------------------------------------- # Devices @@ -201,7 +222,7 @@ android_devices.error.cannot_get_device_list = Received unfamiliar output from \ android_devices.error.no_permissions_title = Found devices with no permissions! -android_devices.error.no_permissions_body = Make sure that the device has USB debugging enabled, and that the required USB drivers are installed on Windows, and that permissions are properly configured on Linux. Also, on Linux, don't set the USB configuration to "charging" while debugging.

Read this guide on running apps on hardware device for more details. +android_devices.error.no_permissions_body = Make sure that the device has USB debugging enabled, and that the required USB drivers are installed on Windows, and that permissions are properly configured on Linux. Also, on Linux, don't set the USB configuration to "charging" while debugging.

Read this guide on running apps on hardware device for more details. private static final String DEVICE_PERMISSIONS_URL = "https://developer.android.com/studio/run/device.html"; @@ -214,7 +235,7 @@ android_devices.error.no_permissions_body = Make sure that the device has USB de # --------------------------------------- # Keystore manager -keystore_manager.top_label = Please enter the information below so we can generate a private key for you.
Fields marked bold are required, though you may consider to fill some of optional fields below those to avoid potential problems.
More about private keys can be found here. +keystore_manager.top_label = Please enter the information below so we can generate a private key for you.
Fields marked bold are required, though you may consider to fill some of optional fields below those to avoid potential problems.
More about private keys can be found here. keystore_manager.reset_password = Reset password keystore_manager.dialog.reset_keyboard_title = Reset password keystore_manager.dialog.reset_keyboard_body_part1 = Are you sure you want to reset the password? @@ -239,13 +260,13 @@ keystore_manager.country_code_label = Country code (XX): # Manifest manifest.warn.cannot_handle_file_title = Error handling %s -manifest.warn.cannot_handle_file_body = Errors occurred while reading or writing %s\nwhich means lots of things are likely to stop working properly.\nTo prevent losing any data, it's recommended that you use “Save As”\n"to save a separate copy of your sketch, and then restart Processing."; +manifest.warn.cannot_handle_file_body = Errors occurred while reading or writing %s\nwhich means lots of things are likely to stop working properly.\nTo prevent losing any data, it's recommended that you use “Save As”\n"to save a separate copy of your sketch, and then restart Processing."; # --------------------------------------- # Permissions permissions.dialog.label = Android applications must specifically ask for permission\nto do things like connect to the internet, write a file,\nor make phone calls. When installing your application,\nusers will be asked whether they want to allow such access. -permissions.dialog.url = More about permissions can be found here. +permissions.dialog.url = More about permissions can be found here. # --------------------------------------- # SDK Downloader @@ -263,10 +284,10 @@ sdk_downloader.download_sdk_label = Downloading Android SDK... # System image downloader sys_image_downloader.dialog.select_image_title = Choose system image type to download... -sys_image_downloader.dialog.select_image_body = The Android emulator requires a system image to run. There are two types of system images available:

1) ARM image - slow but compatible with all computers, no extra configuration needed.

2) x86 image - fast but compatible only with Intel CPUs, extra configuration may be needed, see this guide for more details. +sys_image_downloader.dialog.select_image_body = The Android emulator requires a system image to run. There are two types of system images available:

1) ARM image - slow but compatible with all computers, no extra configuration needed.

2) x86 image - fast but compatible only with Intel CPUs, extra configuration may be needed, see this guide for more details. sys_image_downloader.dialog.accel_images_title = Some words of caution... sys_image_downloader.dialog.haxm_install_body = Processing will install x86 images in the emulator. These images are fast, but also need the Intel Hardware Accelerated Execution Manager (Intel HAXM).

Processing will try to run the HAXM installer now, which may ask for your administrator password or additional permissions. -sys_image_downloader.dialog.kvm_config_body = You chose to run x86 images in the emulator. This is great but you need to configure VM acceleration on Linux using the KVM package.

Follow these instructions to configure KVM. +sys_image_downloader.dialog.kvm_config_body = You chose to run x86 images in the emulator. This is great but you need to configure VM acceleration on Linux using the KVM package.

Follow these instructions to configure KVM. sys_image_downloader.dialog.ia32libs_title = Additional setup may be required... sys_image_downloader.dialog.ia32libs_body = Looks like you are running a 64-bit version of Linux. In order
to create the SD card in the emulator, Processing needs the
ia32-libs compatibility package. On Ubuntu Linux, you can
install it by runing the following command:

sudo apt-get install lib32stdc++6 sys_image_downloader.option.x86_image = Use x86 image @@ -305,4 +326,3 @@ sdk_updater.download_canceled_message = Download canceled sdk_updater.update_button_label = Update sdk_updater.cancel_button_label = Cancel sdk_updater.close_button_label = Close - diff --git a/mode/languages/mode_ko.properties b/processing/mode/languages/mode_ko.properties similarity index 88% rename from mode/languages/mode_ko.properties rename to processing/mode/languages/mode_ko.properties index bac8efac5..2890bf447 100644 --- a/mode/languages/mode_ko.properties +++ b/processing/mode/languages/mode_ko.properties @@ -12,6 +12,7 @@ # | File | menu.file.export_signed_package = 서명 된 패키지 내보내기 +menu.file.export_signed_bundle = 안드로이드 번들 내보내기 menu.file.export_android_project = 안드로이드 프로젝트 내보내기 # | File | Edit | Sketch | Android | Tools | Help | @@ -27,4 +28,4 @@ menu.android.ar = AR menu.android.devices = 장치들 menu.android.devices.no_connected_devices = 연결된 기기 없음 menu.android.sdk_updater = SDK 업데이터 -menu.android.reset_adb = ADB 재설정 \ No newline at end of file +menu.android.reset_adb = ADB 재설정 diff --git a/processing/mode/languages/mode_zh-Hans.properties b/processing/mode/languages/mode_zh-Hans.properties new file mode 100644 index 000000000..a43428a19 --- /dev/null +++ b/processing/mode/languages/mode_zh-Hans.properties @@ -0,0 +1,328 @@ + + +# --------------------------------------- +# Language: Chinese (zh-Hans) +# --------------------------------------- + + +# --------------------------------------- +# Menu + +# | File | Edit | Sketch | Android | Tools | Help | +# | File | + +menu.sketch.stop = 停止 +menu.file.new = 新建 +menu.file.open = 打开 +menu.file.save = 保存 + +menu.file.export_signed_package = 导出已签名的软件包 +menu.file.export_signed_bundle = 导出已签名的捆绑包 +menu.file.export_android_project = 导出Android项目 + + +# | File | Edit | Sketch | Android | Tools | Help | +# | Sketch | + +menu.sketch.run_on_device = 运行在设备上 +menu.sketch.run_in_emulator = 在模拟器中运行 + +# | File | Edit | Sketch | Android | Tools | Help | +# | Android | + +menu.android = Android +menu.android.sketch_permissions = 画图权限 +menu.android.app = 应用 +menu.android.wallpaper = 壁纸 +menu.android.watch_face = 手表表盘 +menu.android.vr = VR +menu.android.ar = AR +menu.android.devices = 设备 +menu.android.devices.no_connected_devices = 没有连接设备 +menu.android.sdk_updater = SDK 更新器 +menu.android.reset_adb = 重置 ADB + +# | File | Edit | Sketch | Android | Tools | Help | +# | Help | + +menu.help.processing_for_android_site = Processing for Android 网站 +menu.help.android_developer_site = Android 开发者网站 + +# --------------------------------------- +# Android Build + +android_build.error.build_folder = 构建文件夹: %s +android_build.error.export_file_does_not_exist = “%s” 在 export.txt 中被提及,但它是虚假的,不存在。 +android_build.error.cannot_create_build_folder = 无法创建临时目录“%s”以构建 Android Sketch +android_build.error.zip_files_not_allowed = Android 库不允许使用 .zip 文件。\n请将 “%s” 重命名为 .jar 文件。 +android_build.error.cannot_copy_icons = 复制图标时出现问题。 +android_build.error.cannot_create_icon_folder = 无法创建 “%s” 文件夹 +android_build.warn.cannot_find_zipalign.title = 找不到 zipalign... +android_build.warn.cannot_find_zipalign.body = 需要 zipalign 构建工具来准备导出包。\n请确保您的 Android SDK 已正确下载。 + +# --------------------------------------- +# Android Debugger + +android_debugger.info.attaching_debugger = 正在附加调试器... +android_debugger.info.debugger_attached = 调试器已附加 +android_debugger.error.debugger_exception = 调试器错误:%s + +# --------------------------------------- +# Android Editor + +android_editor.status.exporting_project = 正在导出 Sketch 的 Android 项目... +android_editor.status.project_export_completed = 项目导出完成。 +android_editor.status.project_export_failed = 项目导出失败。 +android_editor.status.exporting_package = 正在导出已签名的包... +android_editor.status.package_export_completed = 包导出完成。 +android_editor.status.package_export_failed = 包导出失败。 +android_editor.status.exporting_bundle = 正在导出已签名的 bundle... +android_editor.status.bundle_export_completed = bundle 导出完成。 +android_editor.status.bundle_export_failed = bundle 导出失败。 + +android_editor.error.cannot_create_sketch_properties = 创建 Sketch 属性文件“%s”时出错:%s + +# --------------------------------------- +# Android Keystore + +android_keystore.warn.cannot_create_folders.title = 文件夹,文件夹,文件夹 +android_keystore.warn.cannot_create_folders.body = 无法创建必要的文件夹以进行构建。\n也许您需要解决一些文件权限问题吗? +android_keystore.warn.cannot_find_keystore.title = 哦,这出乎意料... +android_keystore.warn.cannot_find_keystore.body = Keystore 已成功创建,但无法找到。\n难道是意外删除了吗? +android_keystore.error.cannot_create_keystore = 无法创建 Keystore,原因如下: + +# --------------------------------------- +# Android Mode + +android_mode.dialog.watchface_debug_title = 手表是否已连接到计算机? +android_mode.dialog.watchface_debug_body = Processing 将通过 Wi-Fi 或蓝牙在智能手表上安装手表面板,此时手表需要与手机配对。

阅读有关调试 Android Wear 应用程序的指南以获取更多详细信息。 +android_mode.dialog.wallpaper_installed_title = 壁纸已安装! +android_mode.dialog.wallpaper_installed_body = Processing 刚刚将您的 Sketch 构建并作为一款动态壁纸安装在所选设备上。

您需要在设备中打开壁纸选择器,才能将其作为新的背景选择。 +android_mode.dialog.watchface_installed_title = 手表面板已安装! +android_mode.dialog.watchface_installed_body = Processing 刚刚将您的 Sketch 构建并作为手表面板安装在所选设备上。

您需要将其添加为设备上最喜欢的手表面板,然后在手表面板选择器中选择它才能运行它。 +android_mode.dialog.cannot_export_package_title = 无法完成导出... +android_mode.dialog.cannot_export_package_body = Sketch 仍然使用默认软件包名称。这不好,因为此名称将永久地唯一标识您的应用程序在 Play 商店中...。想出不同的软件包名称,并在 AndroidManifest.xml 文件中的 Sketch 文件夹中写入“package=”属性内的清单标记之后。一旦您完成此操作,请再次尝试导出 Sketch。

了解有关从 Processing 发布应用程序的更多信息,请查看此在线教程。 +android_mode.dialog.cannot_use_default_icons_title = 无法完成导出... +android_mode.dialog.cannot_use_default_icons_body = Sketch 不包含所有所需的应用程序图标。Processing 可以使用其默认的 Android 图标集在您的设备上测试应用程序,但在 Play 商店中分发它是一个糟糕的想法。为您的应用程序创建一组完整的独特图标,并将它们复制到 Sketch 文件夹中。一旦您完成此操作,请再次尝试导出 Sketch。

了解有关从 Processing 发布应用程序的更多信息,请查看此在线教程。 +android_mode.warn.cannot_load_sdk_title = 坏消息... +android_mode.warn.cannot_load_sdk_body = 无法加载 Android SDK。\n将禁用 Android Mode。 +android_mode.info.cannot_open_sdk_path = “Android SDK 路径无法打开。”; +android_mode.error.cannot_create_avd = “无法为模拟器创建虚拟设备。”; +android_mode.error.emulator_installation_failed = “安装模拟器时遇到问题。结果代码不为零”; +android_mode.dialog.no_devices_found_title = 找不到设备! +android_mode.dialog.no_devices_found_body = Processing 没有发现任何可运行 Sketch 的设备。\n确保您的手持设备或可穿戴设备已正确连接到计算机,并且 USB 或蓝牙调试已启用。 +android_mode.status.no_devices_found = 找不到设备。 +android_mode.status.starting_project_build = 开始构建... +android_mode.status.building_project = 正在构建 Android 项目... +android_mode.status.project_build_failed = 构建失败。 +android_mode.status.downloading_emulator = 下载模拟器... +android_mode.status.downloading_emulator_successful = 模拟器安装成功。 + +# --------------------------------------- +# Android 预处理器 + +android_preprocessor.error.cannot_parse_size = 关于在 Android 上使用 size() 命令的更多信息,请参阅此处:http://wiki.processing.org/w/Android +android_preprocessor.error.cannot_parse_size_exception = 无法解析 size() 命令。 +android_preprocessor.error.cannot_parse_smooth = 关于在 Android 上使用 smooth() 命令的更多信息,请参阅此处:http://wiki.processing.org/w/Android +android_preprocessor.error.cannot_parse_smooth_exception = 无法解析 smooth() 命令。 +android_preprocessor.warn.cannot_find_smooth_level_title = 找不到平滑级别 +android_preprocessor.warn.cannot_find_smooth_level_body = 该应用程序的平滑级别无法从您的代码中自动确定。\n仅针对 smooth() 命令使用数字值(而非变量)。\n请查看 smooth() 参考文档以获取解释。 + +# --------------------------------------- +# Android Runner + +android_runner.status.waiting_for_device = 正在等待 %s 可用... +android_runner.status.lost_connection_with_device = 在启动时与 %s 的连接断开。请重试。 +android_runner.status.cannot_install_sketch = 无法安装 Sketch。 +android_runner.warn.non_watch_device_title = 所选设备不是手表... +android_runner.warn.non_watch_device_body = 您正在尝试在非手表设备上安装手表面板。请选择正确的设备或使用模拟器。 +android_runner.warn.watch_device_title = 所选设备是手表... +android_runner.warn.watch_device_body = 您正在尝试在手表上安装非手表应用程序。请选择正确的设备或使用模拟器。 +android_runner.status.installing_sketch = 正在在 %s 上安装 Sketch +android_runner.status.lost_connection = 在安装时与 %s 的连接断开。请重试。 +android_runner.status.sketch_installed = Sketch 已安装 +android_runner.status.cannot_install_sketch = 无法安装 Sketch。 +android_runner.status.launching_sketch = 正在启动 %s 上的 Sketch +android_runner.status.sketch_launched= Sketch 已启动 +android_runner.status.cannot_launch_sketch = 无法启动 Sketch。 +android_runner.status.in_emulator = 在模拟器中 +android_runner.status.on_device = 在设备上 +android_runner.status.cancel_waiting_for_device = 不,我改变主意了,我放弃等待那个 +android_runner.error.cannot_parse_stacktrace = 无法解析此异常行: +android_runner.status.unknwon_exception = 未知异常 + +# --------------------------------------- +# Android SDK + +android_sdk.dialog.found_installed_sdk_title = 发现 Android SDK! +android_sdk.dialog.found_installed_sdk_body = Processing 发现了一个有效的、似乎已经在使用的 Android SDK。Processing 也可以使用这个 SDK,或者下载一个新的。

在不同的开发工具(如 Processing 和 Android Studio)之间共享相同的 SDK 将节省空间(SDK 可以使用几个 GB),但当一个工具更新 SDK 时,可能会在另一个工具上出现问题。如果 Processing 下载了一个新的 SDK,它将与刚刚发现的 SDK 分开。

你想怎么办? +android_sdk.option.use_existing_sdk = 使用现有的 SDK +android_sdk.option.download_new_sdk = 下载新的 SDK +android_sdk.dialog.cannot_find_sdk_title = 找不到 Android SDK... +android_sdk.dialog.cannot_find_sdk_body = Processing 在这台计算机上没有找到 Android SDK。如果有一个 SDK,并且你知道它在哪里,请点击“定位 SDK 路径”选择它,或者点击“下载 SDK”让 Processing 自动下载 SDK。

如果你想手动下载 SDK,可以从这里获取命令行工具:这里。确保安装 API %s 的 SDK 平台。 +android_sdk.dialog.invalid_sdk_title = Android SDK 无效... +android_sdk.dialog.invalid_sdk_body = Processing 发现了一个 Android SDK,但是它无效。可能缺少一些文件,或者可能没有包括所需的 API %s 平台。

如果在不同的位置上有一个有效的 SDK,请点击“定位 SDK 路径”选择它,或者点击“下载 SDK”让 Processing 自动下载 SDK。

如果你想手动下载 SDK,可以从这里获取命令行工具:这里。确保安装 API %s 的 SDK 平台。 +android_sdk.option.download_sdk = 自动下载 SDK +android_sdk.option.locate_sdk = 手动选择 SDK 路径 +android_sdk.dialog.download_phone_image_title = 下载手机系统镜像? +android_sdk.dialog.download_phone_image_body = 模拟器需要的系统镜像似乎没有安装。你想让 Processing 现在下载并安装它吗? +android_sdk.dialog.download_watch_image_title = 下载手表系统镜像? +android_sdk.dialog.download_watch_image_body = 模拟器需要的系统镜像似乎没有安装。你想让 Processing 现在下载并安装它吗? +android_sdk.dialog.select_sdk_folder = 选择 Android SDK 的位置 +android_sdk.error.sdk_selection_canceled = 用户取消了查找 SDK 的尝试 +android_sdk.error.sdk_download_canceled = 用户取消了 SDK 下载 +android_sdk.error.sdk_download_failed = 无法下载 SDK +android_sdk.dialog.sdk_installed_title = SDK 已安装! +android_sdk.dialog.sdk_installed_body = Processing 刚刚成功下载并安装了 Android SDK。Android 模式现在可以使用了!

有关文档、示例和教程,请访问Processing for Android 网站,如果您从模式的第 3 版更新,请查看新内容页面。 +android_sdk.dialog.install_usb_driver =

如果您计划使用 Google Nexus 设备,则需要 Google USB 驱动程序将它们连接到 Processing。您将不得不按照这些说明手动安装驱动程序。

安装文件可在此文件夹中找到:
%s +android_sdk.dialog.sdk_license_rejected_title = SDK 许可证未被接受 +android_sdk.dialog.sdk_license_rejected_body = Android SDK 已安装,但不能使用。您可以稍后接受许可证,方法是打开终端,切换到 SDK 文件夹,然后运行以下命令:

tools/bin/sdkmanager --licenses +android_sdk.dialog.32bit_system_title = 系统是 32 位的... +android_sdk.dialog.32bit_system_body = Android SDK 不再包括 32 位平台工具(adb 等),因此它们将无法工作。

这个线程提供了一些可能的解决方法。 +android_sdk.error.emulator_download_canceled = 用户取消了模拟器下载 +android_sdk.error.emulator_download_failed = 无法下载模拟器 +android_sdk.dialog.using_existing_sdk_title = SDK 配置完成! +android_sdk.dialog.using_existing_sdk_body = Processing 将使用现有的 Android SDK。Android 模式现在可以使用了!

有关文档、示例和教程,请访问Processing for Android 网站,如果您从模式的第 3 版更新,请查看新内容页面。 +android_sdk.dialog.accept_sdk_license_title = 接受 SDK 许可证? +android_sdk.dialog.accept_sdk_license_body = 你需要接受 Google 的 Android SDK 许可证条款才能使用 SDK。阅读这里的许可证。 +android_sdk.warn.cannot_run_adb_title = adb 出了问题! +android_sdk.warn.cannot_run_adb_body = 无法运行 Android SDK 中的 adb 工具。\n一种可能是它的可执行权限\n没有正确设置。您可以尝试手动设置此\n权限,或重新安装 SDK。\n\n在解决此问题之前,该模式将被禁用。\n +android_sdk.error.missing_sdk_folder = %s 不存在 +android_sdk.error.missing_cmdtools_folder_found_sdktools = 在%s中没有cmdline-tools/latest文件夹,而SDK工具(sdk/tools)已被弃用。\n请在现有SDK中专门安装cmdline-tools,或创建新的SDK。 +android_sdk.error.missing_cmdtools_folder = 在%s中没有`cmdline-tools/latest`文件夹。\n请在现有SDK中专门安装cmdline-tools,或创建新的SDK。 +android_sdk.error.missing_platform_tools_folder = 在%s中没有platform-tools文件夹。 +android_sdk.error.missing_build_tools_folder = 在%s中没有build-tools文件夹。 +android_sdk.error.missing_platforms_folder = 在%s中没有platforms文件夹。 +android_sdk.error.missing_target_platform = 在%s中没有Android版本%s。 +android_sdk.error.missing_android_jar = 在%s中缺少平台%s的android.jar文件。 +android_sdk.error.missing_emulator = 缺少模拟器文件。 +android_debugger.info.removing_expired_keystore = 正在删除过期的debug.keystore文件。 +android_debugger.error.cannot_remove_expired_keystore = 无法删除过期的debug.keystore文件。 +android_debugger.error.request_removing_keystore = 请删除文件%s。 +android_debugger.error.invalid_keystore_timestamp = 日期“%s”无法解析。 +android_debugger.error.request_bug_report = 请报告此问题,以便我们可以修复它。 + +# --------------------------------------- +# AVD + +android_avd.error.cannot_create_avd_title = 无法创建AVD(Android虚拟设备) +android_avd.error.cannot_create_avd_body = 默认的Android模拟器无法设置。请确保Android SDK已正确安装,且系统映像已安装到级别%s。(私下里,偶尔此错误是一个误导,你的sketch可能很快就会启动。) + +android_avd.error.cannot_load_avd_title = 无法加载AVD(Android虚拟设备) +android_avd.error.cannot_load_avd_body = 这可能意味着需要更新Android工具或者Processing AVD应该被删除(下一次运行Processing时,它将自动重新创建)。您可以使用avdmanager命令行工具手动创建AVDs并列出当前AVDs。 + + +android_avd.error.sdk_wrong_install_title = SDK(软件开发工具包)未正确安装 +android_avd.error.sdk_wrong_install_body = 请重新阅读Processing的安装说明,该说明在此在线教程中找到。 + +# --------------------------------------- +# Devices + +android_devices.error.cannot_get_device_list = “adb devices”收到了陌生的输出。设备列表可能有错误。 + +android_devices.error.no_permissions_title = 发现未授权的设备! + +android_devices.error.no_permissions_body = 确保设备已启用USB调试,并在Windows上安装了所需的USB驱动程序,在Linux上正确配置了权限。此外,在调试期间,在Linux上不要将USB配置设置为“充电”。了解更多详细信息,请阅读有关在硬件设备上运行应用的指南。 + +private static final String DEVICE_PERMISSIONS_URL = + "https://developer.android.com/studio/run/device.html"; + +private static final String DEVICE_PERMISSIONS_TITLE = + ""; + +private static final String DEVICE_PERMISSIONS_MESSAGE = + +# --------------------------------------- +# 密钥库管理器 + +keystore_manager.top_label = 请填写以下信息,以便我们为您生成一个私密密钥。
加粗的字段为必填项,不过您可能要考虑在下面的可选字段中填写一些内容,以避免潜在的问题。
有关私密密钥的更多信息可以在此处找到。 +keystore_manager.reset_password = 重置密码 +keystore_manager.dialog.reset_keyboard_title = 重置密码 +keystore_manager.dialog.reset_keyboard_body_part1 = 您确定要重置密码吗? +keystore_manager.dialog.reset_keyboard_body_part2 = 为了进行此操作,我们将必须重置密钥库,这意味着您将无法上传使用新密钥库签名的应用程序更新到Google Play。

我们会为旧密钥库创建一个备份。 +keystore_manager.warn.cannot_remove_keystore_title = Android密钥库 +keystore_manager.warn.cannot_remove_keystore_body = 无法删除密钥库 +keystore_manager.warn.password_missmatch_title = 密码 +keystore_manager.warn.password_missmatch_body = 密钥库密码不匹配 +keystore_manager.warn.short_password_title = 密码 +keystore_manager.warn.short_password_body = 密钥库密码应至少为6个字符 +keystore_manager.password_label = 密钥库密码: +keystore_manager.repeat_password_label = 重复输入密钥库密码: +keystore_manager.issuer_credentials_header = 密钥库颁发者凭据 +keystore_manager.common_name_label = 名称: +keystore_manager.organizational_unitl_label = 组织单位: +keystore_manager.organization_name_label = 组织名称: +keystore_manager.city_name_label = 城市或地区: +keystore_manager.state_name_label = 州省名: +keystore_manager.country_code_label = 国家代码(XX): + +# --------------------------------------- +# Manifest + +manifest.warn.cannot_handle_file_title = 处理%s时出错 +manifest.warn.cannot_handle_file_body = 在读取或写入%s时发生错误,这意味着很多东西可能无法正常工作。
为了防止数据丢失,建议您使用“另存为”
保存您的sketch的单独副本,然后重新启动Processing。 + +# --------------------------------------- +# Permissions + +permissions.dialog.label = Android应用程序必须明确请求权限
进行诸如连接到互联网、写入文件或拨打电话等操作。
在安装您的应用程序时,用户将被询问是否允许这样的访问。 +permissions.dialog.url = 有关权限的更多信息可以在此处找到。 + +# --------------------------------------- +# SDK Downloader + +sdk_downloader.error_cannot_find_platform_files = 找不到平台文件 +sdk_downloader.error_cannot_find_platform_tools = 找不到平台工具 +sdk_downloader.error_cannot_find_build_tools = 找不到构建工具 +sdk_downloader.error_cannot_find_tools = 找不到工具 +sdk_downloader.error_cannot_find_emulator = 找不到模拟器 +sdk_downloader.error.cannot_unpack_platform = 解压平台至“%s”时出错 +sdk_downloader.download_title = SDK下载 +sdk_downloader.download_sdk_label = 正在下载Android SDK… + +# --------------------------------------- +# System image downloader + +sys_image_downloader.dialog.select_image_title = 选择要下载的系统镜像类型… +sys_image_downloader.dialog.select_image_body = Android模拟器需要系统镜像才能运行。有两种系统镜像可用:

1) ARM镜像——速度慢,但兼容所有计算机,没有额外配置需要。

2) x86镜像——速度快,但仅兼容Intel CPU,可能需要额外的配置,请参阅此指南了解更多详细信息。 +sys_image_downloader.dialog.accel_images_title = 几点忠告… +sys_image_downloader.dialog.haxm_install_body = Processing将在模拟器中安装x86映像。这些映像很快,但也需要Intel的硬件加速执行管理器(Intel HAXM)。

Processing现在将尝试运行HAXM安装程序,该程序可能会要求您输入管理员密码或其他权限。 +sys_image_downloader.dialog.kvm_config_body = 您选择在模拟器中运行x86映像。这很棒,但您需要在Linux上使用KVM包配置VM加速。

请按照这些说明配置KVM。 +sys_image_downloader.dialog.ia32libs_title = 可能需要进行其他设置… +sys_image_downloader.dialog.ia32libs_body = 看起来您正在运行64位版本的Linux。为了
在模拟器中创建SD卡,Processing需要
ia32-libs兼容性包。在Ubuntu Linux上,您可以
通过运行以下命令安装它:

sudo apt-get install lib32stdc++6 +sys_image_downloader.option.x86_image = 使用x86镜像 +sys_image_downloader.option.arm_image = 使用ARM镜像 +sys_image_downloader.download_title = 系统镜像下载 +sys_image_downloader.download_watch_label = 下载手表系统镜像… +sys_image_downloader.download_phone_label = 下载手机系统镜像… + +# --------------------------------------- +# Download strings + +download_property.change_event_total = 总计 +download_property.change_event_downloaded = 已下载 +download_prompt.cancel = 取消下载 + +# --------------------------------------- +# SDK Updater tool + +sdk_updater.name_column = 包名称 +sdk_updater.version_column = 已安装版本 +sdk_updater.available_column = 可用更新 + +sdk_updater.query_message = 正在查询套件… + +sdk_updater.no_updates_message = 没有可用的更新 +sdk_updater.one_updates_message = 发现1个更新! +sdk_updater.many_updates_message = 发现“%d”个更新! + +sdk_updater.warning_failed_finding_package = 无法找到包“%s” +sdk_updater.warning_failed_computing_dependency_list = 无法计算完整的依赖关系列表。 + +sdk_updater.refresh_package_message = 正在刷新套件… +sdk_updater.download_package_message = 正在下载可用更新… +sdk_updater.download_canceled_message = 下载已取消 + +sdk_updater.update_button_label = 更新 +sdk_updater.cancel_button_label = 取消 +sdk_updater.close_button_label = 关闭 diff --git a/mode/libraries/ar/README.md b/processing/mode/libraries/ar/README.md similarity index 100% rename from mode/libraries/ar/README.md rename to processing/mode/libraries/ar/README.md diff --git a/processing/mode/libraries/ar/build.gradle b/processing/mode/libraries/ar/build.gradle new file mode 100644 index 000000000..5b47b90b4 --- /dev/null +++ b/processing/mode/libraries/ar/build.gradle @@ -0,0 +1,123 @@ +import java.nio.file.Files +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; + +plugins { + id 'java-library' + id 'maven-publish' +} + +dependencies { + compileOnly name: "android" + compileOnly "org.p5android:processing-core:${modeVersion}" + implementation "com.google.ar:core:${garVersion}" +} + +sourceSets { + main { + java.srcDir("../../../../libs/processing-ar/src/main/java/") + resources { + srcDir("../../../../libs/processing-ar/src/main/") + exclude "AndroidManifest.xml" + exclude "**/java/**" + } + } +} + +java { + withSourcesJar() +} + +tasks.named('jar') { + duplicatesStrategy = DuplicatesStrategy.INCLUDE +} + +tasks.register("sourceJar", Jar) { + from sourceSets.main.allJava + archiveClassifier.set("sources") +} + +// Does not work because of Processing-specific tags in source code, such as @webref +tasks.register("javadocJar", Jar) { + dependsOn javadoc + archiveClassifier.set("javadoc") + from javadoc.destinationDir +} + +artifacts { +// archives javadocJar + archives sourceJar +} + +tasks.jar { + doLast { + ant.checksum file: archiveFile.get().asFile + } +} + +tasks.clean { + doFirst { + delete "dist" + delete "library/ar.jar" + } +} + +tasks.compileJava { + doFirst { + String[] deps = ["core.jar"] + File libFolder = file("library") + libFolder.mkdirs() + deps.each { String fn -> + Files.copy( + file("${rootDir}/build/libs/" + fn).toPath(), + file("library/" + fn).toPath(), + REPLACE_EXISTING + ) + } + } +} + +tasks.build { + doLast { + // Copying ar jar to library folder + File arJar = file("library/ar.jar") + arJar.mkdirs() + + // Need to check the existance of the files before using as the files + // will get generated only if Task ':mode:libraries:ar:jar' is not being skipped + // Task ':mode:libraries:ar:jar' will be skipped if source files are unchanged or jar task is UP-TO-DATE + def arJarFile = file("$buildDir/libs/ar.jar") + if (arJarFile.exists()) { + Files.copy(arJarFile.toPath(), arJar.toPath(), REPLACE_EXISTING) + } + + // Rename artifacts for Maven publishing + def processingArJar = file("$buildDir/libs/processing-ar-${arLibVersion}.jar") + if (arJarFile.exists()) { + Files.move(arJarFile.toPath(), processingArJar.toPath(), REPLACE_EXISTING) + } + + def processingArSourcesJar = file("$buildDir/libs/processing-ar-${arLibVersion}-sources.jar") + def arSourcesJar = file("$buildDir/libs/ar-sources.jar") + if (arSourcesJar.exists()) { + Files.move(arSourcesJar.toPath(), processingArSourcesJar.toPath(), REPLACE_EXISTING) + } + + def arMd5File = file("$buildDir/libs/ar.jar.MD5") + def processingArMd5File = file("$buildDir/libs/processing-ar-${arLibVersion}.jar.md5") + if (arMd5File.exists()) { + Files.move(arMd5File.toPath(), processingArMd5File.toPath(), REPLACE_EXISTING) + } + } +} + +ext { + libName = 'processing-ar' + libVersion = arLibVersion + libJar = "${buildDir}/libs/${libName}-${libVersion}.jar" + libSrc = "${buildDir}/libs/${libName}-${libVersion}-sources.jar" + libMd5 = "${buildDir}/libs/${libName}-${libVersion}-sources.jar.md5" + libDependencies = [[group: 'org.p5android', name: 'processing-core', version: modeVersion], + [group: 'com.google.ar', name: 'core', version: garVersion]] +} + +apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" diff --git a/mode/libraries/ar/examples/Cubes/Cubes.pde b/processing/mode/libraries/ar/examples/Cubes/Cubes.pde similarity index 100% rename from mode/libraries/ar/examples/Cubes/Cubes.pde rename to processing/mode/libraries/ar/examples/Cubes/Cubes.pde diff --git a/mode/libraries/ar/examples/Cubes/code/sketch.properties b/processing/mode/libraries/ar/examples/Cubes/code/sketch.properties similarity index 100% rename from mode/libraries/ar/examples/Cubes/code/sketch.properties rename to processing/mode/libraries/ar/examples/Cubes/code/sketch.properties diff --git a/processing/mode/libraries/ar/examples/ImageMarkers/ImageMarkers.pde b/processing/mode/libraries/ar/examples/ImageMarkers/ImageMarkers.pde new file mode 100644 index 000000000..6b346c7f2 --- /dev/null +++ b/processing/mode/libraries/ar/examples/ImageMarkers/ImageMarkers.pde @@ -0,0 +1,43 @@ +import processing.ar.*; + +ARTracker tracker; +ARAnchor anchor; +PShape earth; + +void setup() { + fullScreen(AR); + + tracker = new ARTracker(this); + + PImage earthImg = loadImage("earth.jpg"); + tracker.start(); + + // Add the image to use as a marker to the AR tracker + tracker.addImage("earth", earthImg); + + // If you know the size (in meters) of the image in the physical space, + // you can specify it in the addImage(), this is optional but it would + // speed up the detection since the AR library will know the size of the + // marker beforehand + // tracker.addImage("earth", earthImg, 0.25); + + earth = createShape(SPHERE, 0.15); +} + +void draw() { + lights(); + + if (mousePressed) { + // Create new anchor at the current touch point + if (anchor != null) anchor.dispose(); + ARTrackable hit = tracker.get(mouseX, mouseY); + if (hit != null && hit.isImage() && hit.getName().equals("earth")) anchor = new ARAnchor(hit); + else anchor = null; + } + + if (anchor != null) { + anchor.attach(); + shape(earth); + anchor.detach(); + } +} \ No newline at end of file diff --git a/mode/libraries/ar/examples/ImportObj/code/sketch.properties b/processing/mode/libraries/ar/examples/ImageMarkers/code/sketch.properties similarity index 100% rename from mode/libraries/ar/examples/ImportObj/code/sketch.properties rename to processing/mode/libraries/ar/examples/ImageMarkers/code/sketch.properties diff --git a/processing/mode/libraries/ar/examples/ImageMarkers/data/earth.jpg b/processing/mode/libraries/ar/examples/ImageMarkers/data/earth.jpg new file mode 100644 index 000000000..73ebe8431 Binary files /dev/null and b/processing/mode/libraries/ar/examples/ImageMarkers/data/earth.jpg differ diff --git a/mode/libraries/ar/examples/ImportObj/ImportObj.pde b/processing/mode/libraries/ar/examples/ImportObj/ImportObj.pde similarity index 100% rename from mode/libraries/ar/examples/ImportObj/ImportObj.pde rename to processing/mode/libraries/ar/examples/ImportObj/ImportObj.pde diff --git a/processing/mode/libraries/ar/examples/ImportObj/code/sketch.properties b/processing/mode/libraries/ar/examples/ImportObj/code/sketch.properties new file mode 100644 index 000000000..db8eaa0b5 --- /dev/null +++ b/processing/mode/libraries/ar/examples/ImportObj/code/sketch.properties @@ -0,0 +1 @@ +component=ar diff --git a/mode/libraries/ar/examples/ImportObj/data/grey.png b/processing/mode/libraries/ar/examples/ImportObj/data/grey.png similarity index 100% rename from mode/libraries/ar/examples/ImportObj/data/grey.png rename to processing/mode/libraries/ar/examples/ImportObj/data/grey.png diff --git a/mode/libraries/ar/examples/ImportObj/data/materials.mtl b/processing/mode/libraries/ar/examples/ImportObj/data/materials.mtl similarity index 100% rename from mode/libraries/ar/examples/ImportObj/data/materials.mtl rename to processing/mode/libraries/ar/examples/ImportObj/data/materials.mtl diff --git a/mode/libraries/ar/examples/ImportObj/data/model.obj b/processing/mode/libraries/ar/examples/ImportObj/data/model.obj similarity index 100% rename from mode/libraries/ar/examples/ImportObj/data/model.obj rename to processing/mode/libraries/ar/examples/ImportObj/data/model.obj diff --git a/mode/libraries/ar/examples/Spheres/Spheres.pde b/processing/mode/libraries/ar/examples/Spheres/Spheres.pde similarity index 100% rename from mode/libraries/ar/examples/Spheres/Spheres.pde rename to processing/mode/libraries/ar/examples/Spheres/Spheres.pde diff --git a/mode/libraries/ar/examples/Spheres/code/sketch.properties b/processing/mode/libraries/ar/examples/Spheres/code/sketch.properties similarity index 100% rename from mode/libraries/ar/examples/Spheres/code/sketch.properties rename to processing/mode/libraries/ar/examples/Spheres/code/sketch.properties diff --git a/mode/libraries/ar/library.properties b/processing/mode/libraries/ar/library.properties similarity index 84% rename from mode/libraries/ar/library.properties rename to processing/mode/libraries/ar/library.properties index c9e600b01..e5f844ae3 100644 --- a/mode/libraries/ar/library.properties +++ b/processing/mode/libraries/ar/library.properties @@ -1,6 +1,6 @@ name = AR authorList = The Processing Foundation, Syam Sundar K -url = http://android.processing.org +url = https://android.processing.org category = 3D sentence = Renderer to develop AR apps paragraph = diff --git a/mode/libraries/vr/README.md b/processing/mode/libraries/vr/README.md similarity index 100% rename from mode/libraries/vr/README.md rename to processing/mode/libraries/vr/README.md diff --git a/processing/mode/libraries/vr/build.gradle b/processing/mode/libraries/vr/build.gradle new file mode 100644 index 000000000..b223c4910 --- /dev/null +++ b/processing/mode/libraries/vr/build.gradle @@ -0,0 +1,132 @@ +import java.nio.file.Files +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING + +plugins { + id 'java-library' + id 'maven-publish' +} + +dependencies { + compileOnly name: "android" + compileOnly "org.p5android:processing-core:${modeVersion}" + +// commenting due to issue #718 +// implementationAar "com.google.vr:sdk-audio:${gvrVersion}" +// implementationAar "com.google.vr:sdk-base:${gvrVersion}" + +// fix for Issue #718 + implementation fileTree(dir: "../../../../libs/google-vr/", include: ["*.aar"]) +} + +sourceSets { + main { + java.srcDir("../../../../libs/processing-vr/src/main/java/") + resources { + srcDir("../../../../libs/processing-vr/src/main/") + exclude "AndroidManifest.xml" + exclude "**/java/**" + } + } +} + +java { + withSourcesJar() +} + +tasks.named('jar') { + duplicatesStrategy = DuplicatesStrategy.INCLUDE +} + +tasks.register("sourceJar", Jar) { + from sourceSets.main.allJava + archiveClassifier.set("sources") +} + +// Does not work because of Processing-specific tags in source code, such as @webref +tasks.register("javadocJar", Jar) { + dependsOn javadoc + archiveClassifier.set("javadoc") + from javadoc.destinationDir +} + +artifacts { +// archives javadocJar + archives sourceJar +} + +tasks.jar { + doLast { + ant.checksum file: archiveFile.get().asFile + } +} + +tasks.clean { + doFirst { + delete "dist" + delete "library/vr.jar" + } +} + +tasks.compileJava { + doFirst { + String[] deps = ["sdk-audio.jar", + "sdk-base.jar", + "sdk-common.jar"] + File libFolder = file("library") + libFolder.mkdirs() + deps.each { String fn -> + Files.copy( + file("${rootDir}/build/libs/" + fn).toPath(), + file("library/" + fn).toPath(), + REPLACE_EXISTING + ) + } + } +} + +tasks.build { + doLast { + // Copying vr jar to library folder + File vrJar = file("library/vr.jar") + vrJar.mkdirs() + + // Need to check the existance of the files before using as the files + // will get generated only if Task ':mode:libraries:vr:jar' is not being skipped + // Task ':mode:libraries:vr:jar' will be skipped if source files are unchanged or jar task is UP-TO-DATE + def vrJarFile = file("$buildDir/libs/vr.jar") + if (vrJarFile.exists()) { + Files.copy(vrJarFile.toPath(), vrJar.toPath(), REPLACE_EXISTING) + } + + // Renaming artifacts for maven publishing + def processingVrJar = file("$buildDir/libs/processing-vr-${vrLibVersion}.jar") + if (vrJarFile.exists()) { + Files.move(vrJarFile.toPath(), processingVrJar.toPath(), REPLACE_EXISTING) + } + + def processingVrSourcesJar = file("$buildDir/libs/processing-vr-${vrLibVersion}-sources.jar") + def vrSourcesJar = file("$buildDir/libs/vr-sources.jar") + if (vrSourcesJar.exists()) { + Files.move(vrSourcesJar.toPath(), processingVrSourcesJar.toPath(), REPLACE_EXISTING) + } + + def vrMd5File = file("$buildDir/libs/vr.jar.MD5") + def processingVrMd5File = file("$buildDir/libs/processing-vr-${vrLibVersion}.jar.md5") + if (vrMd5File.exists()) { + Files.move(vrMd5File.toPath(), processingVrMd5File.toPath(), REPLACE_EXISTING) + } + } +} + +ext { + libName = 'processing-vr' + libVersion = vrLibVersion + libJar = "${buildDir}/libs/${libName}-${libVersion}.jar" + libSrc = "${buildDir}/libs/${libName}-${libVersion}-sources.jar" + libMd5 = "${buildDir}/libs/${libName}-${libVersion}-sources.jar.md5" + libDependencies = [[group: 'org.p5android', name: 'processing-core', version: modeVersion], + [group: 'com.google.vr', name: 'sdk-base', version: gvrVersion], + [group: 'com.google.vr', name: 'sdk-audio', version: gvrVersion]] +} + +apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" diff --git a/mode/libraries/vr/examples/Cube/Cube.pde b/processing/mode/libraries/vr/examples/Cube/Cube.pde similarity index 100% rename from mode/libraries/vr/examples/Cube/Cube.pde rename to processing/mode/libraries/vr/examples/Cube/Cube.pde diff --git a/mode/libraries/vr/examples/Cube/code/sketch.properties b/processing/mode/libraries/vr/examples/Cube/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/Cube/code/sketch.properties rename to processing/mode/libraries/vr/examples/Cube/code/sketch.properties diff --git a/mode/libraries/vr/examples/GenerateRay/GenerateRay.pde b/processing/mode/libraries/vr/examples/GenerateRay/GenerateRay.pde similarity index 100% rename from mode/libraries/vr/examples/GenerateRay/GenerateRay.pde rename to processing/mode/libraries/vr/examples/GenerateRay/GenerateRay.pde diff --git a/mode/libraries/vr/examples/GenerateRay/code/sketch.properties b/processing/mode/libraries/vr/examples/GenerateRay/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/GenerateRay/code/sketch.properties rename to processing/mode/libraries/vr/examples/GenerateRay/code/sketch.properties diff --git a/mode/libraries/vr/examples/IntersectsBox/IntersectsBox.pde b/processing/mode/libraries/vr/examples/IntersectsBox/IntersectsBox.pde similarity index 100% rename from mode/libraries/vr/examples/IntersectsBox/IntersectsBox.pde rename to processing/mode/libraries/vr/examples/IntersectsBox/IntersectsBox.pde diff --git a/mode/libraries/vr/examples/IntersectsBox/code/sketch.properties b/processing/mode/libraries/vr/examples/IntersectsBox/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/IntersectsBox/code/sketch.properties rename to processing/mode/libraries/vr/examples/IntersectsBox/code/sketch.properties diff --git a/mode/libraries/vr/examples/IntersectsPlane/IntersectsPlane.pde b/processing/mode/libraries/vr/examples/IntersectsPlane/IntersectsPlane.pde similarity index 100% rename from mode/libraries/vr/examples/IntersectsPlane/IntersectsPlane.pde rename to processing/mode/libraries/vr/examples/IntersectsPlane/IntersectsPlane.pde diff --git a/mode/libraries/vr/examples/IntersectsPlane/code/sketch.properties b/processing/mode/libraries/vr/examples/IntersectsPlane/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/IntersectsPlane/code/sketch.properties rename to processing/mode/libraries/vr/examples/IntersectsPlane/code/sketch.properties diff --git a/mode/libraries/vr/examples/IntersectsSphere/IntersectsSphere.pde b/processing/mode/libraries/vr/examples/IntersectsSphere/IntersectsSphere.pde similarity index 100% rename from mode/libraries/vr/examples/IntersectsSphere/IntersectsSphere.pde rename to processing/mode/libraries/vr/examples/IntersectsSphere/IntersectsSphere.pde diff --git a/mode/libraries/vr/examples/IntersectsSphere/code/sketch.properties b/processing/mode/libraries/vr/examples/IntersectsSphere/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/IntersectsSphere/code/sketch.properties rename to processing/mode/libraries/vr/examples/IntersectsSphere/code/sketch.properties diff --git a/mode/libraries/vr/examples/Mono/Mono.pde b/processing/mode/libraries/vr/examples/Mono/Mono.pde similarity index 100% rename from mode/libraries/vr/examples/Mono/Mono.pde rename to processing/mode/libraries/vr/examples/Mono/Mono.pde diff --git a/mode/libraries/vr/examples/Mono/code/sketch.properties b/processing/mode/libraries/vr/examples/Mono/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/Mono/code/sketch.properties rename to processing/mode/libraries/vr/examples/Mono/code/sketch.properties diff --git a/mode/libraries/vr/examples/Stereoscopy/Stereoscopy.pde b/processing/mode/libraries/vr/examples/Stereoscopy/Stereoscopy.pde similarity index 100% rename from mode/libraries/vr/examples/Stereoscopy/Stereoscopy.pde rename to processing/mode/libraries/vr/examples/Stereoscopy/Stereoscopy.pde diff --git a/mode/libraries/vr/examples/Stereoscopy/code/sketch.properties b/processing/mode/libraries/vr/examples/Stereoscopy/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/Stereoscopy/code/sketch.properties rename to processing/mode/libraries/vr/examples/Stereoscopy/code/sketch.properties diff --git a/mode/libraries/vr/examples/drawAim/code/sketch.properties b/processing/mode/libraries/vr/examples/drawAim/code/sketch.properties similarity index 100% rename from mode/libraries/vr/examples/drawAim/code/sketch.properties rename to processing/mode/libraries/vr/examples/drawAim/code/sketch.properties diff --git a/mode/libraries/vr/examples/drawAim/drawAim.pde b/processing/mode/libraries/vr/examples/drawAim/drawAim.pde similarity index 100% rename from mode/libraries/vr/examples/drawAim/drawAim.pde rename to processing/mode/libraries/vr/examples/drawAim/drawAim.pde diff --git a/mode/libraries/vr/library.properties b/processing/mode/libraries/vr/library.properties similarity index 83% rename from mode/libraries/vr/library.properties rename to processing/mode/libraries/vr/library.properties index 2b6aecb22..7c92c2cff 100644 --- a/mode/libraries/vr/library.properties +++ b/processing/mode/libraries/vr/library.properties @@ -1,6 +1,6 @@ name = VR authorList = Processing Foundation -url = http://android.processing.org +url = https://android.processing.org category = 3D sentence = Renderer to develop VR apps paragraph = diff --git a/processing/mode/mode.properties b/processing/mode/mode.properties new file mode 100644 index 000000000..a03cb0ece --- /dev/null +++ b/processing/mode/mode.properties @@ -0,0 +1,10 @@ +name = Android Mode for Processing 4 +authorList = [The Processing Foundation](https://processingfoundation.org/) +url = https://android.processing.org +sentence = This mode lets you use Processing to create Android apps +paragraph = +imports=processing.mode.java.JavaMode +version = 412 +prettyVersion = 4.6.0 +minRevision = 1283 +maxRevision = 0 \ No newline at end of file diff --git a/processing/mode/mode/JavaMode.jar b/processing/mode/mode/JavaMode.jar new file mode 100644 index 000000000..04c55cc15 Binary files /dev/null and b/processing/mode/mode/JavaMode.jar differ diff --git a/processing/mode/mode/core.jar b/processing/mode/mode/core.jar new file mode 100644 index 000000000..e7b82a144 Binary files /dev/null and b/processing/mode/mode/core.jar differ diff --git a/processing/mode/mode/gradlew.zip b/processing/mode/mode/gradlew.zip new file mode 100644 index 000000000..5f7697c8a Binary files /dev/null and b/processing/mode/mode/gradlew.zip differ diff --git a/processing/mode/mode/istack-commons-runtime.jar b/processing/mode/mode/istack-commons-runtime.jar new file mode 100644 index 000000000..b91ea56ba Binary files /dev/null and b/processing/mode/mode/istack-commons-runtime.jar differ diff --git a/processing/mode/mode/javax.activation-api.jar b/processing/mode/mode/javax.activation-api.jar new file mode 100644 index 000000000..986c36509 Binary files /dev/null and b/processing/mode/mode/javax.activation-api.jar differ diff --git a/processing/mode/mode/jaxb-api.jar b/processing/mode/mode/jaxb-api.jar new file mode 100644 index 000000000..456586547 Binary files /dev/null and b/processing/mode/mode/jaxb-api.jar differ diff --git a/processing/mode/mode/jaxb-jxc.jar b/processing/mode/mode/jaxb-jxc.jar new file mode 100644 index 000000000..039e6cb2d Binary files /dev/null and b/processing/mode/mode/jaxb-jxc.jar differ diff --git a/processing/mode/mode/jaxb-runtime.jar b/processing/mode/mode/jaxb-runtime.jar new file mode 100644 index 000000000..0b9ef67c4 Binary files /dev/null and b/processing/mode/mode/jaxb-runtime.jar differ diff --git a/processing/mode/mode/jaxb-xjc.jar b/processing/mode/mode/jaxb-xjc.jar new file mode 100644 index 000000000..aab6be555 Binary files /dev/null and b/processing/mode/mode/jaxb-xjc.jar differ diff --git a/mode/mode/jdi.jar b/processing/mode/mode/jdi.jar similarity index 100% rename from mode/mode/jdi.jar rename to processing/mode/mode/jdi.jar diff --git a/mode/mode/jdimodel.jar b/processing/mode/mode/jdimodel.jar similarity index 100% rename from mode/mode/jdimodel.jar rename to processing/mode/mode/jdimodel.jar diff --git a/processing/mode/mode/org.eclipse.core.contenttype.jar b/processing/mode/mode/org.eclipse.core.contenttype.jar new file mode 100644 index 000000000..2d8f772d1 Binary files /dev/null and b/processing/mode/mode/org.eclipse.core.contenttype.jar differ diff --git a/processing/mode/mode/org.eclipse.core.jobs.jar b/processing/mode/mode/org.eclipse.core.jobs.jar new file mode 100644 index 000000000..579555f49 Binary files /dev/null and b/processing/mode/mode/org.eclipse.core.jobs.jar differ diff --git a/processing/mode/mode/org.eclipse.core.resources.jar b/processing/mode/mode/org.eclipse.core.resources.jar new file mode 100644 index 000000000..dd04e3eef Binary files /dev/null and b/processing/mode/mode/org.eclipse.core.resources.jar differ diff --git a/processing/mode/mode/org.eclipse.core.runtime.jar b/processing/mode/mode/org.eclipse.core.runtime.jar new file mode 100644 index 000000000..4b46a1262 Binary files /dev/null and b/processing/mode/mode/org.eclipse.core.runtime.jar differ diff --git a/processing/mode/mode/org.eclipse.equinox.common.jar b/processing/mode/mode/org.eclipse.equinox.common.jar new file mode 100644 index 000000000..c2a745e12 Binary files /dev/null and b/processing/mode/mode/org.eclipse.equinox.common.jar differ diff --git a/processing/mode/mode/org.eclipse.equinox.preferences.jar b/processing/mode/mode/org.eclipse.equinox.preferences.jar new file mode 100644 index 000000000..d6cb801c6 Binary files /dev/null and b/processing/mode/mode/org.eclipse.equinox.preferences.jar differ diff --git a/processing/mode/mode/org.eclipse.jdt.core.jar b/processing/mode/mode/org.eclipse.jdt.core.jar new file mode 100644 index 000000000..2b675bc84 Binary files /dev/null and b/processing/mode/mode/org.eclipse.jdt.core.jar differ diff --git a/processing/mode/mode/org.eclipse.osgi.jar b/processing/mode/mode/org.eclipse.osgi.jar new file mode 100644 index 000000000..91f36da60 Binary files /dev/null and b/processing/mode/mode/org.eclipse.osgi.jar differ diff --git a/processing/mode/mode/org.eclipse.text.jar b/processing/mode/mode/org.eclipse.text.jar new file mode 100644 index 000000000..e1263c239 Binary files /dev/null and b/processing/mode/mode/org.eclipse.text.jar differ diff --git a/processing/mode/mode/pde.jar b/processing/mode/mode/pde.jar new file mode 100644 index 000000000..0eba179a6 Binary files /dev/null and b/processing/mode/mode/pde.jar differ diff --git a/processing/mode/resources/device-art-resources/device-art.xml b/processing/mode/resources/device-art-resources/device-art.xml new file mode 100644 index 000000000..b67fa2033 --- /dev/null +++ b/processing/mode/resources/device-art-resources/device-art.xml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/processing/mode/resources/device-art-resources/pixel_3/layout b/processing/mode/resources/device-art-resources/pixel_3/layout new file mode 100644 index 000000000..4615fb58d --- /dev/null +++ b/processing/mode/resources/device-art-resources/pixel_3/layout @@ -0,0 +1,38 @@ +parts { + device { + display { + width 1080 + height 2160 + x 0 + y 0 + } + } + portrait { + background { + image port_back.webp + } + foreground { + mask round_corners.webp + } + onion { + image port_fore.webp + } + } +} +layouts { + portrait { + width 1194 + height 2532 + event EV_SW:0:1 + part1 { + name portrait + x 0 + y 0 + } + part2 { + name device + x 54 + y 196 + } + } +} diff --git a/processing/mode/resources/device-art-resources/pixel_3/port_back.webp b/processing/mode/resources/device-art-resources/pixel_3/port_back.webp new file mode 100644 index 000000000..6037b7963 Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_3/port_back.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_3/round_corners.webp b/processing/mode/resources/device-art-resources/pixel_3/round_corners.webp new file mode 100644 index 000000000..9dad9033a Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_3/round_corners.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_6/back.webp b/processing/mode/resources/device-art-resources/pixel_6/back.webp new file mode 100644 index 000000000..a41256802 Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_6/back.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_6/layout b/processing/mode/resources/device-art-resources/pixel_6/layout new file mode 100644 index 000000000..ae638d344 --- /dev/null +++ b/processing/mode/resources/device-art-resources/pixel_6/layout @@ -0,0 +1,36 @@ +parts { + device { + display { + width 1080 + height 2400 + x 0 + y 0 + } + } + portrait { + background { + image back.webp + } + foreground { + mask mask.webp + cutout hole + } + } +} +layouts { + portrait { + width 1209 + height 2553 + event EV_SW:0:1 + part1 { + name portrait + x 0 + y 0 + } + part2 { + name device + x 60 + y 69 + } + } +} diff --git a/processing/mode/resources/device-art-resources/pixel_6/mask.webp b/processing/mode/resources/device-art-resources/pixel_6/mask.webp new file mode 100644 index 000000000..c658b192d Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_6/mask.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_c/land_back.webp b/processing/mode/resources/device-art-resources/pixel_c/land_back.webp new file mode 100644 index 000000000..4cec52875 Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_c/land_back.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_c/land_fore.webp b/processing/mode/resources/device-art-resources/pixel_c/land_fore.webp new file mode 100644 index 000000000..66a0b9df0 Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_c/land_fore.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_c/land_shadow.webp b/processing/mode/resources/device-art-resources/pixel_c/land_shadow.webp new file mode 100644 index 000000000..15acd8679 Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_c/land_shadow.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_c/layout b/processing/mode/resources/device-art-resources/pixel_c/layout new file mode 100644 index 000000000..7378ba8c5 --- /dev/null +++ b/processing/mode/resources/device-art-resources/pixel_c/layout @@ -0,0 +1,59 @@ +parts { + device { + display { + width 1800 + height 2560 + x 0 + y 0 + } + } + portrait { + background { + image port_back.webp + } + onion { + image port_fore.webp + } + } + landscape { + background { + image land_back.webp + } + onion { + image land_fore.webp + } + } +} +layouts { + portrait { + width 2307 + height 2971 + event EV_SW:0:1 + part1 { + name portrait + x 0 + y 0 + } + part2 { + name device + x 259 + y 181 + } + } + landscape { + width 3096 + height 2215 + event EV_SW:0:0 + part1 { + name landscape + x 0 + y 0 + } + part2 { + name device + x 269 + y 1988 + rotation 3 + } + } +} diff --git a/processing/mode/resources/device-art-resources/pixel_c/port_back.webp b/processing/mode/resources/device-art-resources/pixel_c/port_back.webp new file mode 100644 index 000000000..ee9e3eaea Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_c/port_back.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_c/port_fore.webp b/processing/mode/resources/device-art-resources/pixel_c/port_fore.webp new file mode 100644 index 000000000..f2e6b7ca5 Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_c/port_fore.webp differ diff --git a/processing/mode/resources/device-art-resources/pixel_c/port_shadow.webp b/processing/mode/resources/device-art-resources/pixel_c/port_shadow.webp new file mode 100644 index 000000000..e7c1e74bf Binary files /dev/null and b/processing/mode/resources/device-art-resources/pixel_c/port_shadow.webp differ diff --git a/processing/mode/resources/device-art-resources/wearos_small_round/device_bezel.png b/processing/mode/resources/device-art-resources/wearos_small_round/device_bezel.png new file mode 100644 index 000000000..5eccf08ce Binary files /dev/null and b/processing/mode/resources/device-art-resources/wearos_small_round/device_bezel.png differ diff --git a/processing/mode/resources/device-art-resources/wearos_small_round/hardware.ini b/processing/mode/resources/device-art-resources/wearos_small_round/hardware.ini new file mode 100644 index 000000000..3f8ab78b8 --- /dev/null +++ b/processing/mode/resources/device-art-resources/wearos_small_round/hardware.ini @@ -0,0 +1,3 @@ +# skin-specific hardware values +hw.rotaryInput=yes +hw.sensors.heart_rate=yes diff --git a/processing/mode/resources/device-art-resources/wearos_small_round/layout b/processing/mode/resources/device-art-resources/wearos_small_round/layout new file mode 100644 index 000000000..6c45bac29 --- /dev/null +++ b/processing/mode/resources/device-art-resources/wearos_small_round/layout @@ -0,0 +1,46 @@ +parts { + portrait { + background { + image device_bezel.png + } + } + + device { + display { + width 384 + height 384 + x 0 + y 0 + } + } +} + +layouts { + portrait { + width 456 + height 456 + color 0x1f1f1f + event EV_SW:0:1 + + part1 { + name portrait + x 0 + y 0 + } + + part2 { + name device + x 36 + y 36 + } + } +} + +keyboard { + charmap qwerty2 +} + +network { + speed full + delay none +} diff --git a/processing/mode/resources/device-art-resources/wearos_square/device_bezel.png b/processing/mode/resources/device-art-resources/wearos_square/device_bezel.png new file mode 100644 index 000000000..01c5cc146 Binary files /dev/null and b/processing/mode/resources/device-art-resources/wearos_square/device_bezel.png differ diff --git a/processing/mode/resources/device-art-resources/wearos_square/hardware.ini b/processing/mode/resources/device-art-resources/wearos_square/hardware.ini new file mode 100644 index 000000000..3f8ab78b8 --- /dev/null +++ b/processing/mode/resources/device-art-resources/wearos_square/hardware.ini @@ -0,0 +1,3 @@ +# skin-specific hardware values +hw.rotaryInput=yes +hw.sensors.heart_rate=yes diff --git a/processing/mode/resources/device-art-resources/wearos_square/layout b/processing/mode/resources/device-art-resources/wearos_square/layout new file mode 100644 index 000000000..d1f9278d1 --- /dev/null +++ b/processing/mode/resources/device-art-resources/wearos_square/layout @@ -0,0 +1,46 @@ +parts { + portrait { + background { + image device_bezel.png + } + } + + device { + display { + width 360 + height 360 + x 0 + y 0 + } + } +} + +layouts { + portrait { + width 432 + height 432 + color 0x1f1f1f + event EV_SW:0:1 + + part1 { + name portrait + x 18 + y 18 + } + + part2 { + name device + x 36 + y 36 + } + } +} + +keyboard { + charmap qwerty2 +} + +network { + speed full + delay none +} diff --git a/mode/scripts/permissions.py b/processing/mode/scripts/permissions.py similarity index 100% rename from mode/scripts/permissions.py rename to processing/mode/scripts/permissions.py diff --git a/mode/scripts/requirements.txt b/processing/mode/scripts/requirements.txt similarity index 75% rename from mode/scripts/requirements.txt rename to processing/mode/scripts/requirements.txt index c1f5f713c..6f83e94d2 100644 --- a/mode/scripts/requirements.txt +++ b/processing/mode/scripts/requirements.txt @@ -1 +1,2 @@ beautifulsoup4 +lxml diff --git a/mode/src/processing/mode/android/AVD.java b/processing/mode/src/processing/mode/android/AVD.java similarity index 78% rename from mode/src/processing/mode/android/AVD.java rename to processing/mode/src/processing/mode/android/AVD.java index 90bc6f81a..7674bc6b6 100644 --- a/mode/src/processing/mode/android/AVD.java +++ b/processing/mode/src/processing/mode/android/AVD.java @@ -24,7 +24,6 @@ import processing.app.Base; import processing.app.Platform; import processing.app.Preferences; -import processing.app.exec.LineProcessor; import processing.app.exec.StreamPump; import processing.core.PApplet; @@ -39,23 +38,19 @@ public class AVD { final static private int WEAR = 1; final static public String DEFAULT_ABI = "x86"; - - public static final String TARGET_SDK_ARM = "24"; public final static String DEFAULT_PHONE_PORT = "5566"; public final static String DEFAULT_WEAR_PORT = "5576"; private static final String GETTING_START_TUT_URL = - "http://android.processing.org/tutorials/getting_started/index.html"; - - static final String DEFAULT_SDCARD_SIZE = "64M"; - - static final String DEVICE_DEFINITION = "Nexus One"; - static final String DEVICE_SKIN = "480x800"; - - static final String DEVICE_WEAR_DEFINITION = "wear_square_280_280dpi"; - static final String DEVICE_WEAR_SKIN = "280x280"; - + "https://android.processing.org/tutorials/getting_started/index.html"; + + static final String DEVICE_DEFINITION = "pixel_6"; + static final String DEVICE_SKIN = "pixel_6"; + + static final String DEVICE_WEAR_DEFINITION = "wearos_square"; + static final String DEVICE_WEAR_SKIN = "wearos_square"; + /** Name of this avd. */ protected String name; @@ -98,18 +93,22 @@ static public String getName(boolean wear) { return AVD.phoneAVD.name; } } - + + static public String getTargetSDK(boolean wear, String abi) { + if (abi.equals("arm")) { + // The ARM images using Google APIs are too slow, so use the + // older Android (AOSP) images. + // TODO check if we can move to the regular ARM images... + return AndroidBuild.TARGET_WEAR_SDK_ARM; + } else if (abi.equals("arm64-v8a")) { + return wear ? AndroidBuild.TARGET_WEAR_SDK : AndroidBuild.TARGET_SDK; + } else { // x86 + return wear ? AndroidBuild.TARGET_WEAR_SDK : AndroidBuild.TARGET_SDK; + } + } static public String getPreferredPlatform(boolean wear, String abi) { - if (wear) { - return AndroidBuild.TARGET_PLATFORM; - } else if (abi.equals("arm")) { - // The ARM images using Google APIs are too slow, so use the - // older Android (AOSP) images. - return "android-" + TARGET_SDK_ARM; - } else { - return AndroidBuild.TARGET_PLATFORM; - } + return "android-" + getTargetSDK(wear, abi); } static public String getPreferredPort(boolean wear) { @@ -134,10 +133,9 @@ static public String getPreferredPort(boolean wear) { static protected String getPreferredTag(boolean wear, String abi) { if (wear) { return "android-wear"; - } else if (abi.equals("arm")) { - // The ARM images using Google APIs are too slow, so use the - // older Android (AOSP) images. - return "default"; +// } else if (abi.contains("arm")) { +// // The ARM images are located in the default folder. No, apparently ARM images are in google_apis too +// return "default"; } else { return "google_apis"; } @@ -296,10 +294,10 @@ protected void getImages(final ArrayList images, final AndroidSDK sdk, "create", "avd", "-n", "dummy", "-k", "dummy" - }; - - // Dummy avdmanager creation command to get the list of installed images - // TODO : Find a better way to get the list of installed images + }; + + // Dummy avdmanager creation command to get the list of installed images, + // so far this is the only method available get that list. ProcessBuilder pb = new ProcessBuilder(cmd); if (Base.DEBUG) { @@ -313,23 +311,20 @@ protected void getImages(final ArrayList images, final AndroidSDK sdk, try { process = pb.start(); + StringWriter outWriter = new StringWriter(); + new StreamPump(process.getInputStream(), "out: ").addTarget(outWriter).start(); + process.waitFor(); - StreamPump output = new StreamPump(process.getInputStream(), "out: "); - output.addTarget(new LineProcessor() { - @Override - public void processLine(String line) { -// System.out.println("dummy output ---> " + line); - if (images != null && - line.contains(";" + imagePlatform) && - line.contains(";" + imageTag) && - line.contains(";" + imageAbi)) { -// System.out.println(" added image!"); - images.add(line); - } + String[] lines = PApplet.split(outWriter.toString(), '\n'); + for (String line : lines) { + if (images != null && + line.contains(";" + imagePlatform) && + line.contains(";" + imageTag) && + line.contains(";" + imageAbi)) { + images.add(line); } - }).start(); + } - process.waitFor(); } catch (final InterruptedException ie) { ie.printStackTrace(); } finally { @@ -355,6 +350,16 @@ protected String getSdkId() throws IOException { return "null"; } + protected void copyDeviceSkins(final AndroidSDK sdk, final AndroidMode mode) { + File skinsFolder = new File(sdk.getFolder(), "skins"); + if (!skinsFolder.exists()) { + // The skins in this folder come from Android Studio, on Mac they are in the folder: + // /Applications/Android Studio.app/Contents/plugins/android/resources/device-art-resources + // Apparently the skins are not available as a SDK download. + File artFolder = new File(mode.getResourcesFolder(), "device-art-resources"); + AndroidUtil.copyDir(artFolder, skinsFolder); + } + } protected boolean create(final AndroidSDK sdk) throws IOException { File sketchbookFolder = processing.app.Base.getSketchbookFolder(); @@ -368,10 +373,10 @@ protected boolean create(final AndroidSDK sdk) throws IOException { "create", "avd", "-n", name, "-k", getSdkId(), - "-c", DEFAULT_SDCARD_SIZE, - "-d", device, "-p", avdPath.getAbsolutePath(), - "-f" + "-d", device, + "--skin", skin, + "--force" }; ProcessBuilder pb = new ProcessBuilder(cmd); @@ -381,9 +386,8 @@ protected boolean create(final AndroidSDK sdk) throws IOException { } // avdmanager create avd -n "Wear-Processing-0254" -k "system-images;android-25;google_apis;x86" -c 64M - // Set the list to null so that exists() will check again - avdList = null; +// avdList = null; Map env = pb.environment(); env.clear(); @@ -394,13 +398,13 @@ protected boolean create(final AndroidSDK sdk) throws IOException { process = pb.start(); // Passes 'no' to "Do you wish to create a custom hardware profile [no]" - OutputStream os = process.getOutputStream(); - PrintWriter pw = new PrintWriter(new OutputStreamWriter(os)); - pw.println("no"); - pw.flush(); - pw.close(); - os.flush(); - os.close(); +// OutputStream os = process.getOutputStream(); +// PrintWriter pw = new PrintWriter(new OutputStreamWriter(os)); +// pw.println("no"); +// pw.flush(); +// pw.close(); +// os.flush(); +// os.close(); StringWriter outWriter = new StringWriter(); new StreamPump(process.getInputStream(), "out: ").addTarget(outWriter).start(); @@ -409,13 +413,13 @@ protected boolean create(final AndroidSDK sdk) throws IOException { if (process.exitValue() == 0) { // Add skin to AVD's config file - File configFile = new File(avdPath, "config.ini"); - if (configFile.exists()) { - try (PrintWriter output = new PrintWriter(new FileWriter(configFile.getAbsolutePath(), true))) { - output.printf("%s\r\n", "skin.name=" + skin); - } - catch (Exception e) {} - } +// File configFile = new File(avdPath, "config.ini"); +// if (configFile.exists()) { +// try (PrintWriter output = new PrintWriter(new FileWriter(configFile.getAbsolutePath(), true))) { +// output.printf("%s\r\n", "skin.name=" + skin); +// } +// catch (Exception e) {} +// } return true; } @@ -429,7 +433,6 @@ protected boolean create(final AndroidSDK sdk) throws IOException { AndroidMode.getTextString("android_avd.error.cannot_create_avd_body", AndroidBuild.TARGET_SDK)); } System.err.println(outWriter.toString()); - //System.err.println(createAvdResult); } catch (final InterruptedException ie) { ie.printStackTrace(); } finally { @@ -458,13 +461,14 @@ static public boolean ensureProperAVD(final Frame window, final AndroidMode mode // ABI again. AVD other = wear ? phoneAVD : watchAVD; boolean ask = !other.hasImages(sdk); - boolean res = AndroidSDK.locateSysImage(window, mode, wear, ask); + boolean res = AndroidSDK.requestSysImage(window, mode, wear, ask); if (!res) { return false; } else { avd.refreshImages(sdk); } } + avd.copyDeviceSkins(sdk, mode); if (avd.create(sdk)) { return true; } diff --git a/mode/src/processing/mode/android/AndroidBuild.java b/processing/mode/src/processing/mode/android/AndroidBuild.java similarity index 74% rename from mode/src/processing/mode/android/AndroidBuild.java rename to processing/mode/src/processing/mode/android/AndroidBuild.java index 379dd3217..78a16f8a3 100644 --- a/mode/src/processing/mode/android/AndroidBuild.java +++ b/processing/mode/src/processing/mode/android/AndroidBuild.java @@ -23,9 +23,9 @@ package processing.mode.android; import org.gradle.tooling.*; + import processing.app.Base; import processing.app.Library; -import processing.app.Messages; import processing.app.Platform; import processing.app.Preferences; import processing.app.Sketch; @@ -33,12 +33,17 @@ import processing.app.Util; import processing.core.PApplet; import processing.mode.java.JavaBuild; -import processing.mode.java.preproc.SurfaceInfo; +import processing.mode.java.preproc.PdePreprocessor; import java.io.*; import java.util.HashMap; import java.util.Properties; +import java.util.*; +import processing.app.SketchCode; +import processing.mode.java.preproc.PreprocessorResult; + + /** * Class with all the infrastructure needed to build a sketch in the Android * mode and run it either on the device or in the emulator, using Gradle as the @@ -61,8 +66,9 @@ class AndroidBuild extends JavaBuild { static public String MIN_SDK_WATCHFACE; // Versions of all required dependencies - static public String TARGET_SDK; - static public String TARGET_PLATFORM; + static public String TARGET_SDK; + static public String TARGET_WEAR_SDK_ARM; + static public String TARGET_WEAR_SDK; static public String GRADLE_PLUGIN_VER; static public String APPCOMPAT_VER; static public String V4LEGACY_VER; @@ -90,6 +96,7 @@ class AndroidBuild extends JavaBuild { // Gradle build files static private final String GRADLE_SETTINGS_TEMPLATE = "Settings.gradle.tmpl"; static private final String GRADLE_PROPERTIES_TEMPLATE = "Properties.gradle.tmpl"; + static private final String EXPORTED_GRADLE_PROPERTIES_TEMPLATE = "ExpProperties.gradle.tmpl"; static private final String LOCAL_PROPERTIES_TEMPLATE = "Properties.local.tmpl"; static private final String TOP_GRADLE_BUILD_TEMPLATE = "TopBuild.gradle.tmpl"; static private final String APP_GRADLE_BUILD_ECJ_TEMPLATE = "AppBuildECJ.gradle.tmpl"; @@ -181,14 +188,28 @@ public boolean usesOpenGL() { public String getPathForAPK() { - String suffix = target.equals("release") ? "release_unsigned" : "debug"; + String suffix = target.equals("release") ? "release" : "debug"; String apkName = getPathToAPK() + sketch.getName().toLowerCase() + "_" + suffix + ".apk"; final File apkFile = new File(tmpFolder, apkName); if (!apkFile.exists()) { return null; } return apkFile.getAbsolutePath(); - } + } + + /** + * Build into temporary folders for building bundles (needed for the Windows 8.3 bugs in the Android SDK) + * @param target "debug" or "release" + * @throws SketchException + * @throws IOException + */ + public File buildBundle(String target, String password) throws IOException, SketchException { + this.target = target; + File folder = createProject(true, password); + if (folder == null) return null; + if (!gradleBuildBundle()) return null; + return folder; + } /** @@ -197,11 +218,11 @@ public String getPathForAPK() { * @throws SketchException * @throws IOException */ - public File build(String target) throws IOException, SketchException { + public File build(String target, String password) throws IOException, SketchException { this.target = target; - File folder = createProject(true); + File folder = createProject(true, password); if (folder == null) return null; - if (!gradleBuild()) return null; + if (!gradleBuildPackage()) return null; return folder; } @@ -211,7 +232,7 @@ public File build(String target) throws IOException, SketchException { * sketch. Creates the top and app modules in the case of regular, VR, AR and * wallpapers, and top, mobile and wear modules in the case of watch faces. */ - protected File createProject(boolean external) + protected File createProject(boolean external, String password) throws IOException, SketchException { tmpFolder = createTempBuildFolder(sketch); System.out.println(AndroidMode.getTextString("android_build.error.build_folder", tmpFolder.getAbsolutePath())); @@ -224,27 +245,74 @@ protected File createProject(boolean external) } manifest = new Manifest(sketch, appComponent, mode.getFolder(), false); - manifest.setSdkTarget(TARGET_SDK); - - // build the preproc and get to work - AndroidPreprocessor preproc = new AndroidPreprocessor(sketch, getPackageName()); - // On Android, this init will throw a SketchException if there's a problem with size() - SurfaceInfo info = preproc.initSketchSize(sketch.getMainProgram()); - preproc.initSketchSmooth(sketch.getMainProgram()); - sketchClassName = preprocess(srcFolder, getPackageName(), preproc, false); - if (sketchClassName != null) { - renderer = info.getRenderer(); - writeMainClass(srcFolder, renderer, external); - createTopModule("':" + module +"'"); - createAppModule(module); + // build the preproc and get to work + String pckgName = getPackageName(); + PdePreprocessor preprocessor = PdePreprocessor.builderFor(sketch.getName()).setDestinationPackage(pckgName).build(); + PreprocessorResult result = preprocess(srcFolder, pckgName, preprocessor, false); + if (result != null) { + sketchClassName = result.getClassName(); + if (sketchClassName != null) { + renderer = result.getSketchRenderer(); + if (renderer == null) { + renderer = "JAVA2D"; + } + writeMainClass(srcFolder, external); + createTopModule("':" + module + "'", password); + createAppModule(module); + } } return tmpFolder; } + + + protected boolean gradleBuildBundle() throws SketchException { + ProjectConnection connection = GradleConnector.newConnector() + .forProjectDirectory(tmpFolder) + .connect(); + + boolean success = false; + BuildLauncher build = connection.newBuild(); + build.setStandardOutput(System.out); + build.setStandardError(System.err); + + try { + if (target.equals("debug")) build.forTasks("bundleDebug"); + else build.forTasks("bundleRelease"); + build.run(); + renameAAB(); + success = true; + } catch (org.gradle.tooling.UnsupportedVersionException e) { + e.printStackTrace(); + success = false; + } catch (org.gradle.tooling.BuildException e) { + e.printStackTrace(); + success = false; + } catch (org.gradle.tooling.BuildCancelledException e) { + e.printStackTrace(); + success = false; + } catch (org.gradle.tooling.GradleConnectionException e) { + e.printStackTrace(); + success = false; + } catch (Exception e) { + e.printStackTrace(); + success = false; + } finally { + connection.close(); + } + + try { + removeKeyPassword(); + } catch (IOException e) { + e.printStackTrace(); + } + + return success; + } - protected boolean gradleBuild() throws SketchException { + protected boolean gradleBuildPackage() throws SketchException { ProjectConnection connection = GradleConnector.newConnector() .forProjectDirectory(tmpFolder) .connect(); @@ -279,6 +347,12 @@ protected boolean gradleBuild() throws SketchException { connection.close(); } + try { + removeKeyPassword(); + } catch (IOException e) { + e.printStackTrace(); + } + return success; } @@ -287,7 +361,7 @@ protected boolean gradleBuild() throws SketchException { // Gradle modules - private void createTopModule(String projectModules) + private void createTopModule(String projectModules, String keyPassword) throws IOException { HashMap replaceMap = new HashMap(); @@ -296,14 +370,36 @@ private void createTopModule(String projectModules) replaceMap.put("@@gradle_plugin_version@@", GRADLE_PLUGIN_VER); AndroidUtil.createFileFromTemplate(buildTemplate, buildlFile, replaceMap); - File gradlePropsTemplate = mode.getContentFile("templates/" + GRADLE_PROPERTIES_TEMPLATE); +// File gradlePropsTemplate = mode.getContentFile("templates/" + GRADLE_PROPERTIES_TEMPLATE); +// File gradlePropsFile = new File(tmpFolder, "gradle.properties"); +// Util.copyFile(gradlePropsTemplate, gradlePropsFile); + File gradlePropsTemplate; + if (exportProject) { + gradlePropsTemplate = mode.getContentFile("templates/" + EXPORTED_GRADLE_PROPERTIES_TEMPLATE); + } else { + gradlePropsTemplate = mode.getContentFile("templates/" + GRADLE_PROPERTIES_TEMPLATE); + } File gradlePropsFile = new File(tmpFolder, "gradle.properties"); - Util.copyFile(gradlePropsTemplate, gradlePropsFile); + String javaHome = Platform.getJavaHome().getAbsolutePath(); + replaceMap.clear(); + replaceMap.put("@@java_home@@", javaHome); + if (!keyPassword.equals("") && AndroidKeyStore.getKeyStore() != null) { + replaceMap.put("@@keystore_file@@", AndroidKeyStore.getKeyStore().getAbsolutePath().replace('\\', '/')); + replaceMap.put("@@key_alias@@", AndroidKeyStore.ALIAS_STRING); + replaceMap.put("@@key_password@@", keyPassword); + } + AndroidUtil.createFileFromTemplate(gradlePropsTemplate, gradlePropsFile, replaceMap); File settingsTemplate = mode.getContentFile("templates/" + GRADLE_SETTINGS_TEMPLATE); File settingsFile = new File(tmpFolder, "settings.gradle"); replaceMap.clear(); - replaceMap.put("@@project_modules@@", projectModules); + if (getAppComponent() == VR) { + // The local google-vr has to be added to the settings to fix Issue #718 + replaceMap.put("@@project_modules@@", projectModules + ", ':app:libs:google-vr'"); + } else { + replaceMap.put("@@project_modules@@", projectModules); + } + AndroidUtil.createFileFromTemplate(settingsTemplate, settingsFile, replaceMap); File localPropsTemplate = mode.getContentFile("templates/" + LOCAL_PROPERTIES_TEMPLATE); @@ -342,12 +438,14 @@ private void createAppModule(String moduleName) tmplFile = exportProject ? APP_GRADLE_BUILD_TEMPLATE : APP_GRADLE_BUILD_ECJ_TEMPLATE; } + String modePath = new File(mode.getFolder(), "mode").getPath().replace('\\', '/'); String toolPath = Base.getToolsFolder().getPath().replace('\\', '/'); String platformPath = sdk.getTargetPlatform(TARGET_SDK).getPath().replace('\\', '/'); File appBuildTemplate = mode.getContentFile("templates/" + tmplFile); File appBuildFile = new File(moduleFolder, "build.gradle"); HashMap replaceMap = new HashMap(); + replaceMap.put("@@mode_folder@@", modePath); replaceMap.put("@@tools_folder@@", toolPath); replaceMap.put("@@target_platform@@", platformPath); replaceMap.put("@@package_name@@", getPackageName()); @@ -383,15 +481,10 @@ private void createAppModule(String moduleName) copyImportedLibs(libsFolder, mainFolder, assetsFolder); copyCodeFolder(libsFolder); - // Copy any system libraries needed by the project -// copyWearLib(libsFolder); -// copySupportLibs(libsFolder); -// if (getAppComponent() == APP) { -// copyAppCompatLib(libsFolder); -// } -// if (getAppComponent() == VR) { -// copyGVRLibs(libsFolder); -// } + if (getAppComponent() == VR) { + // Need to call this to fix Issue #718 + copyGVRLibs(libsFolder); + } // Copy the data folder (if one exists) to the project's 'assets' folder final File sketchDataFolder = sketch.getDataFolder(); @@ -412,8 +505,7 @@ private void createAppModule(String moduleName) // Templates - private void writeMainClass(final File srcDirectory, - final String renderer, final boolean external) { + private void writeMainClass(final File srcDirectory, final boolean external) { int comp = getAppComponent(); String[] permissions = manifest.getPermissions(); if (comp == APP) { @@ -669,14 +761,29 @@ public File exportProject() throws IOException, SketchException { target = "debug"; exportProject = true; - File projectFolder = createProject(false); + File projectFolder = createProject(false, ""); exportProject = false; File exportFolder = createExportFolder("android"); Util.copyDir(projectFolder, exportFolder); installGradlew(exportFolder); return exportFolder; - } + } + + + // --------------------------------------------------------------------------- + // Export bundle + + + public File exportBundle(String keyStorePassword) throws Exception { + File projectFolder = buildBundle("release", keyStorePassword); + if (projectFolder == null) return null; + + // Final export folder + File exportFolder = createExportFolder("buildBundle"); + Util.copyDir(new File(projectFolder, getPathToAAB()), exportFolder); + return exportFolder; + } // --------------------------------------------------------------------------- @@ -684,66 +791,14 @@ public File exportProject() throws IOException, SketchException { public File exportPackage(String keyStorePassword) throws Exception { - File projectFolder = build("release"); + File projectFolder = build("release", keyStorePassword); if (projectFolder == null) return null; - File signedPackage = signPackage(projectFolder, keyStorePassword); - if (signedPackage == null) return null; - // Final export folder - File exportFolder = createExportFolder("build"); + File exportFolder = createExportFolder("buildPackage"); Util.copyDir(new File(projectFolder, getPathToAPK()), exportFolder); return exportFolder; } - - - private File signPackage(File projectFolder, String keyStorePassword) throws Exception { - File keyStore = AndroidKeyStore.getKeyStore(); - if (keyStore == null) return null; - - File unsignedPackage = new File(projectFolder, - getPathToAPK() + sketch.getName().toLowerCase() + "_release_unsigned.apk"); - if (!unsignedPackage.exists()) return null; - File signedPackage = new File(projectFolder, - getPathToAPK() + sketch.getName().toLowerCase() + "_release_signed.apk"); - - JarSigner.signJar(unsignedPackage, signedPackage, - AndroidKeyStore.ALIAS_STRING, keyStorePassword, - keyStore.getAbsolutePath(), keyStorePassword); - - File alignedPackage = zipalignPackage(signedPackage, projectFolder); - return alignedPackage; - } - - - private File zipalignPackage(File signedPackage, File projectFolder) - throws IOException, InterruptedException { - File zipAlign = sdk.getZipAlignTool(); - if (zipAlign == null || !zipAlign.exists()) { - Messages.showWarning(AndroidMode.getTextString("android_build.warn.cannot_find_zipalign.title"), - AndroidMode.getTextString("android_build.warn.cannot_find_zipalign.body")); - return null; - } - - File alignedPackage = new File(projectFolder, - getPathToAPK() + sketch.getName().toLowerCase() + "_release_signed_aligned.apk"); - - String[] args = { - zipAlign.getAbsolutePath(), "-v", "-f", "4", - signedPackage.getAbsolutePath(), alignedPackage.getAbsolutePath() - }; - - Process alignProcess = Runtime.getRuntime().exec(args); - // Need to consume output for the process to finish, as discussed here - // https://stackoverflow.com/questions/5483830/process-waitfor-never-returns - // Using StreamPump as in other parts of the mode does not seem to work for some reason - BufferedReader reader = new BufferedReader(new InputStreamReader(alignProcess.getInputStream())); - while ((reader.readLine()) != null) {} - alignProcess.waitFor(); - - if (alignedPackage.exists()) return alignedPackage; - return null; - } //--------------------------------------------------------------------------- @@ -780,51 +835,79 @@ private void copyImportedLibs(final File libsFolder, final File mainFolder, final File assetsFolder) throws IOException { for (Library library : getImportedLibraries()) { - // add each item from the library folder / export list to the output - for (File exportFile : library.getAndroidExports()) { - String exportName = exportFile.getName(); + // Add each item from the library folder / export list to the output + for (File exportFile : library.getApplicationExports("armeabi")) { + copyImportedLib(libsFolder, mainFolder, assetsFolder, exportFile); + } + for (File exportFile : library.getApplicationExports("armeabi-v7a")) { + copyImportedLib(libsFolder, mainFolder, assetsFolder, exportFile); + } + for (File exportFile : library.getApplicationExports("x86")) { + copyImportedLib(libsFolder, mainFolder, assetsFolder, exportFile); + } + for (File exportFile : library.getApplicationExports("arm64-v8a")) { + copyImportedLib(libsFolder, mainFolder, assetsFolder, exportFile); + } + for (File exportFile : library.getApplicationExports("x86_64")) { + copyImportedLib(libsFolder, mainFolder, assetsFolder, exportFile); + } + } + } + + private void copyImportedLib(final File libsFolder, + final File mainFolder, + final File assetsFolder, + final File exportFile) throws IOException { + String exportName = exportFile.getName(); - // Skip the GVR and ARCore jars, because gradle will resolve the dependencies - if (appComponent == VR && exportName.toLowerCase().startsWith("sdk")) continue; - if (appComponent == AR && exportName.toLowerCase().startsWith("core")) continue; - - if (!exportFile.exists()) { - System.err.println(AndroidMode.getTextString("android_build.error.export_file_does_not_exist", exportFile.getName())); - } else if (exportFile.isDirectory()) { - // Copy native library folders to the correct location - if (exportName.equals("armeabi") || - exportName.equals("armeabi-v7a") || - exportName.equals("x86") || - exportName.equals("arm64-v8a") || - exportName.equals("x86_64")) - { - Util.copyDir(exportFile, new File(libsFolder, exportName)); - } - // Copy jni libraries (.so files) to the correct location - else if (exportName.equals("jniLibs")) { - Util.copyDir(exportFile, new File(mainFolder, exportName)); - } - else { - // Copy any other directory to the assets folder - Util.copyDir(exportFile, new File(assetsFolder, exportName)); - } - } else if (exportName.toLowerCase().endsWith(".zip")) { - // As of r4 of the Android SDK, it looks like .zip files - // are ignored in the libs folder, so rename to .jar - System.err.println(AndroidMode.getTextString("android_build.error.zip_files_not_allowed", exportFile.getName())); - String jarName = exportName.substring(0, exportName.length() - 4) + ".jar"; - Util.copyFile(exportFile, new File(libsFolder, jarName)); + // Skip the GVR and ARCore jars, because gradle will resolve the dependencies + if (appComponent == VR && exportName.toLowerCase().startsWith("sdk")) return; + if (appComponent == AR && exportName.toLowerCase().startsWith("core")) return; + + if (!exportFile.exists()) { + System.err.println(AndroidMode.getTextString("android_build.error.export_file_does_not_exist", exportFile.getName())); + } else if (exportFile.isDirectory()) { + // Copy native library folders to the correct location + if (exportName.equals("armeabi") || + exportName.equals("armeabi-v7a") || + exportName.equals("x86") || + exportName.equals("arm64-v8a") || + exportName.equals("x86_64")) + { + Util.copyDir(exportFile, new File(libsFolder, exportName)); + } + // Copy jni libraries (.so files) to the correct location + else if (exportName.equals("jniLibs")) { + Util.copyDir(exportFile, new File(mainFolder, exportName)); + } + else { + // Copy any other directory to the assets folder + Util.copyDir(exportFile, new File(assetsFolder, exportName)); + } + } else if (exportName.toLowerCase().endsWith(".zip")) { + // As of r4 of the Android SDK, it looks like .zip files + // are ignored in the libs folder, so rename to .jar + System.err.println(AndroidMode.getTextString("android_build.error.zip_files_not_allowed", exportFile.getName())); + String jarName = exportName.substring(0, exportName.length() - 4) + ".jar"; + Util.copyFile(exportFile, new File(libsFolder, jarName)); - } else if (exportName.toLowerCase().endsWith(".jar")) { - Util.copyFile(exportFile, new File(libsFolder, exportName)); + } else if (exportName.toLowerCase().endsWith(".jar")) { + Util.copyFile(exportFile, new File(libsFolder, exportName)); - } else { - Util.copyFile(exportFile, new File(assetsFolder, exportName)); - } - } + } else { + Util.copyFile(exportFile, new File(assetsFolder, exportName)); } } + /** + * Copy the dummy Gradle project containing aar files from Google VR, + * so they can be imported locally from the project + */ + private void copyGVRLibs(final File libsFolder) throws IOException { + File srcFolder = new File(mode.getFolder(), "libraries/vr/libs/google-vr"); + File dstFolder = new File(libsFolder, "google-vr"); + Util.copyDir(srcFolder, dstFolder); + } private void copyCodeFolder(final File libsFolder) throws IOException { // Copy files from the 'code' directory into the 'libs' folder @@ -841,15 +924,32 @@ private void copyCodeFolder(final File libsFolder) throws IOException { } } } - } + } + + private void renameAAB() { + String suffix = target.equals("release") ? "release" : "debug"; + String aabName = getPathToAAB() + module + "-" + suffix + ".aab"; + final File aabFile = new File(tmpFolder, aabName); + if (aabFile.exists()) { + String suffixNew = target.equals("release") ? "release" : "debug"; + String aabNameNew = getPathToAAB() + + sketch.getName().toLowerCase() + "_" + suffixNew + ".aab"; + final File aabFileNew = new File(tmpFolder, aabNameNew); + aabFile.renameTo(aabFileNew); + } + } + + private String getPathToAAB() { + return module + "/build/outputs/bundle/" + target + "/"; + } private void renameAPK() { - String suffix = target.equals("release") ? "release-unsigned" : "debug"; + String suffix = target.equals("release") ? "release" : "debug"; String apkName = getPathToAPK() + module + "-" + suffix + ".apk"; final File apkFile = new File(tmpFolder, apkName); if (apkFile.exists()) { - String suffixNew = target.equals("release") ? "release_unsigned" : "debug"; + String suffixNew = target.equals("release") ? "release" : "debug"; String apkNameNew = getPathToAPK() + sketch.getName().toLowerCase() + "_" + suffixNew + ".apk"; final File apkFileNew = new File(tmpFolder, apkNameNew); @@ -857,6 +957,13 @@ private void renameAPK() { } } + + private void removeKeyPassword() throws IOException { + File gradlePropsTemplate = mode.getContentFile("templates/" + GRADLE_PROPERTIES_TEMPLATE); + File gradlePropsFile = new File(tmpFolder, "gradle.properties"); + Util.copyFile(gradlePropsTemplate, gradlePropsFile); + } + private String getPathToAPK() { return module + "/build/outputs/apk/" + target + "/"; @@ -884,7 +991,7 @@ private File createTempBuildFolder(final Sketch sketch) throws IOException { private void installGradlew(File exportFolder) throws IOException { File gradlewFile = mode.getContentFile("mode/gradlew.zip"); - AndroidUtil.extractFolder(gradlewFile, exportFolder, false, true); + AndroidUtil.extractFolder(gradlewFile, exportFolder); if (Platform.isMacOS() || Platform.isLinux()) { File execFile = new File(exportFolder, "gradlew"); execFile.setExecutable(true); @@ -926,8 +1033,21 @@ static public void initVersions(File file) { TARGET_SDK = defTargetSDK; Preferences.set("android.sdk.target", TARGET_SDK); } - TARGET_PLATFORM = "android-" + TARGET_SDK; - + + TARGET_WEAR_SDK_ARM = Preferences.get("android.sdk.target.wear_arm"); + String defTargetWearSDKArm = props.getProperty("android-platform-wear-arm"); + if (TARGET_WEAR_SDK_ARM == null || PApplet.parseInt(TARGET_WEAR_SDK_ARM) != PApplet.parseInt(defTargetWearSDKArm)) { + TARGET_WEAR_SDK_ARM = defTargetWearSDKArm; + Preferences.set("android.sdk.target.wear_arm", TARGET_WEAR_SDK_ARM); + } + + TARGET_WEAR_SDK = Preferences.get("android.sdk.target.wear"); + String defTargetWearSDK = props.getProperty("android-platform-wear"); + if (TARGET_WEAR_SDK == null || PApplet.parseInt(TARGET_WEAR_SDK) != PApplet.parseInt(defTargetWearSDK)) { + TARGET_WEAR_SDK = defTargetWearSDK; + Preferences.set("android.sdk.target.wear", TARGET_WEAR_SDK); + } + APPCOMPAT_VER = Preferences.get("android.sdk.appcompat"); String defAppCompatVer = props.getProperty("androidx.appcompat%appcompat"); if (APPCOMPAT_VER == null || !versionCheck(APPCOMPAT_VER, defAppCompatVer)) { @@ -1014,4 +1134,4 @@ static private boolean versionCheck(String currentVersion, String minVersion) { return false; } -} \ No newline at end of file +} diff --git a/mode/src/processing/mode/android/AndroidDebugger.java b/processing/mode/src/processing/mode/android/AndroidDebugger.java similarity index 92% rename from mode/src/processing/mode/android/AndroidDebugger.java rename to processing/mode/src/processing/mode/android/AndroidDebugger.java index 08a5ec746..f68766cca 100644 --- a/mode/src/processing/mode/android/AndroidDebugger.java +++ b/processing/mode/src/processing/mode/android/AndroidDebugger.java @@ -23,15 +23,16 @@ import com.sun.jdi.*; import com.sun.jdi.event.*; +import com.sun.jdi.event.Event; import com.sun.jdi.request.ClassPrepareRequest; import com.sun.jdi.request.EventRequestManager; import com.sun.jdi.request.StepRequest; +import processing.app.Language; import processing.app.Messages; -import processing.mode.java.Debugger; -import processing.mode.java.debug.ClassLoadListener; -import processing.mode.java.debug.LineBreakpoint; -import processing.mode.java.debug.LineID; +import processing.mode.java.debug.*; +import javax.swing.*; +import java.awt.*; import java.io.IOException; // Developed by Manav Jain as part of GSoC 2018 @@ -43,6 +44,7 @@ public class AndroidDebugger extends Debugger { protected boolean isEnabled; + private String pkgName = ""; private String sketchClassName = ""; @@ -58,6 +60,19 @@ public boolean isEnabled() { public void toggleDebug() { isEnabled = !isEnabled; + inspector.setVisible(enabled); + if (isEnabled) { + debugItem.setText(Language.text("menu.debug.disable")); + } else { + debugItem.setText(Language.text("menu.debug.enable")); + } + + for (Component item : debugMenu.getMenuComponents()) { + if (item instanceof JMenuItem && item != debugItem) { + item.setEnabled(isEnabled); + } + } + } @Override @@ -71,6 +86,11 @@ public synchronized void startDebug(AndroidRunner runner, Device device) { return; // do nothing } + inspector.reset(); + + // make the inspector instance visible on which tree nodes would be reflected + inspector.setVisible(true); + runtime = runner; pkgName = runner.build.getPackageName(); sketchClassName = runner.build.getSketchClassName(); @@ -222,9 +242,10 @@ public void run() { } } + @Override public synchronized void continueDebug() { editor.activateContinue(); - editor.variableInspector().lock(); + inspector.lock(); //editor.clearSelection(); //clearHighlight(); editor.clearCurrentLine(); @@ -234,14 +255,16 @@ public void run() { runtime.vm().resume(); paused = false; editor.statusBusy(); - } + } } + + @Override protected void step(int stepDepth) { if (!isStarted()) { startDebug(); } else if (isPaused()) { - editor.variableInspector().lock(); + inspector.lock(); editor.activateStep(); // use global to mark that there is a step request pending @@ -254,8 +277,10 @@ public void run() { } } + + @Override public synchronized void stopDebug() { - editor.variableInspector().lock(); + inspector.lock(); if (runtime != null) { for (LineBreakpoint bp : breakpoints) { @@ -272,13 +297,14 @@ public void run() { stopTrackingLineChanges(); started = false; - editor.deactivateDebug(); + // editor.deactivateDebug(); editor.deactivateContinue(); editor.deactivateStep(); editor.statusEmpty(); } + /** * Watch all classes ({@value sketchClassName}) variable */ @@ -317,7 +343,7 @@ LineBreakpoint breakpointOnLine(LineID line) { return null; } - synchronized void toggleBreakpoint(int lineIdx) { + synchronized public void toggleBreakpoint(int lineIdx) { LineID line = editor.getLineIDInCurrentTab(lineIdx); int index = line.lineIdx(); if (hasBreakpoint(line)) { @@ -341,7 +367,7 @@ synchronized void setBreakpoint(int lineIdx) { setBreakpoint(editor.getLineIDInCurrentTab(lineIdx)); } - synchronized void setBreakpoint(LineID line) { + synchronized public void setBreakpoint(LineID line) { // do nothing if we are kinda busy if (isStarted() && !isPaused()) { return; diff --git a/mode/src/processing/mode/android/AndroidEditor.java b/processing/mode/src/processing/mode/android/AndroidEditor.java similarity index 86% rename from mode/src/processing/mode/android/AndroidEditor.java rename to processing/mode/src/processing/mode/android/AndroidEditor.java index e9c366395..d45cb4ad9 100644 --- a/mode/src/processing/mode/android/AndroidEditor.java +++ b/processing/mode/src/processing/mode/android/AndroidEditor.java @@ -24,6 +24,7 @@ import processing.app.Base; import processing.app.Mode; +import processing.app.Language; import processing.app.Platform; import processing.app.Settings; import processing.app.SketchException; @@ -33,6 +34,7 @@ import processing.app.ui.EditorToolbar; import processing.app.ui.Toolkit; import processing.mode.java.JavaEditor; +import processing.mode.java.debug.Debugger; import processing.mode.java.debug.LineID; import processing.mode.java.preproc.PdePreprocessor; @@ -61,6 +63,7 @@ public class AndroidEditor extends JavaEditor { private int appComponent; + protected JMenu debugMenu; private AndroidDebugger debugger; private Settings settings; @@ -82,7 +85,6 @@ protected AndroidEditor(Base base, String path, EditorState state, androidMode.resetUserSelection(); androidMode.checkSDK(this); - initDebugger(); androidTools = loadAndroidTools(); addToolsToMenu(); @@ -90,10 +92,10 @@ protected AndroidEditor(Base base, String path, EditorState state, loadModeSettings(); } - @Override - public PdePreprocessor createPreprocessor(final String sketchName) { - return new AndroidPreprocessor(sketchName); - } +// @Override +// public PdePreprocessor createPreprocessor(final String sketchName) { +// return new AndroidPreprocessor(sketchName); +// } public EditorToolbar createToolbar() { @@ -120,15 +122,25 @@ public boolean handleSaveAs() { public JMenu buildFileMenu() { - String exportPkgTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT, false); - JMenuItem exportPackage = Toolkit.newJMenuItem(exportPkgTitle, 'E'); + String exportPackageTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT_PACKAGE); + JMenuItem exportPackage = Toolkit.newJMenuItemShift(exportPackageTitle, 'X'); exportPackage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleExportPackage(); } }); - String exportProjectTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT, true); + + String exportBundleTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT_BUNDLE); + JMenuItem exportBundle = Toolkit.newJMenuItemShift(exportBundleTitle, 'B'); + exportBundle.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + handleExportBundle(); + } + }); + + + String exportProjectTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT_PROJECT); JMenuItem exportProject = Toolkit.newJMenuItemShift(exportProjectTitle, 'E'); exportProject.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -136,36 +148,39 @@ public void actionPerformed(ActionEvent e) { } }); - return buildFileMenu(new JMenuItem[] { exportPackage, exportProject}); + return buildFileMenu(new JMenuItem[] {exportPackage, exportBundle, exportProject}); } public JMenu buildSketchMenu() { - JMenuItem runItem = Toolkit.newJMenuItem(AndroidToolbar.getTitle(AndroidToolbar.RUN, false), 'R'); + JMenuItem runItem = Toolkit.newJMenuItem(AndroidToolbar.getTitle(AndroidToolbar.RUN_ON_DEVICE), 'R'); runItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleRunDevice(); } }); - JMenuItem presentItem = Toolkit.newJMenuItemShift(AndroidToolbar.getTitle(AndroidToolbar.RUN, true), 'R'); + JMenuItem presentItem = Toolkit.newJMenuItemShift(AndroidToolbar.getTitle(AndroidToolbar.RUN_IN_EMULATOR), 'R'); presentItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleRunEmulator(); } }); - JMenuItem stopItem = new JMenuItem(AndroidToolbar.getTitle(AndroidToolbar.STOP, false)); + JMenuItem stopItem = new JMenuItem(AndroidToolbar.getTitle(AndroidToolbar.STOP)); stopItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleStop(); } }); return buildSketchMenu(new JMenuItem[] { buildDebugMenu(), runItem, presentItem, stopItem }); +// return buildSketchMenu(new JMenuItem[] { runItem, presentItem, stopItem }); } public JMenu buildModeMenu() { + super.buildModeMenu(); + androidMenu = new JMenu(AndroidMode.getTextString("menu.android")); JMenuItem item; @@ -286,10 +301,17 @@ public void menuCanceled(MenuEvent e) { }); androidMenu.addSeparator(); - + return androidMenu; } + private JMenu buildDebugMenu() { + initDebugger(); + debugMenu = new JMenu(Language.text("menu.debug")); + debugger.populateMenu(debugMenu); + return debugMenu; + } + private void setAppComponent(int comp) { if (appComponent != comp) { @@ -326,7 +348,7 @@ public JMenu buildHelpMenu() { item = new JMenuItem(AndroidMode.getTextString("menu.help.processing_for_android_site")); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - Platform.openURL("http://android.processing.org/"); + Platform.openURL("https://android.processing.org/"); } }); menu.add(item); @@ -335,7 +357,7 @@ public void actionPerformed(ActionEvent e) { item = new JMenuItem(AndroidMode.getTextString("menu.help.android_developer_site")); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - Platform.openURL("http://developer.android.com/"); + Platform.openURL("https://developer.android.com/"); } }); menu.add(item); @@ -409,6 +431,7 @@ public void run() { public void handleStop() { + /* if (debugger.isStarted()) { debugger.stopDebug(); @@ -421,6 +444,14 @@ public void handleStop() { // focus the PDE again after quitting presentation mode [toxi 030903] toFront(); } + */ + toolbar.activateStop(); + androidMode.handleStop(this); + toolbar.deactivateStop(); + toolbar.deactivateRun(); + + // focus the PDE again after quitting presentation mode [toxi 030903] + toFront(); } @Override @@ -428,29 +459,34 @@ public AndroidDebugger getDebugger() { return debugger; } - @Override protected void deactivateDebug() { - super.deactivateDebug(); - } + +// @Override protected void deactivateDebug() { +// super.deactivateDebug(); +// } - @Override protected void activateContinue() { + @Override public void activateContinue() { ((AndroidToolbar) toolbar).activateContinue(); } - @Override protected void deactivateContinue() { + @Override public void deactivateContinue() { ((AndroidToolbar) toolbar).deactivateContinue(); } - @Override protected void activateStep() { + @Override public void activateStep() { ((AndroidToolbar) toolbar).activateStep(); } - @Override protected void deactivateStep() { + @Override public void deactivateStep() { ((AndroidToolbar) toolbar).deactivateStep(); } + + @Override public void toggleDebug() { super.toggleDebug(); + // make the unused inspector invisible + super.debugger.dispose(); debugger.toggleDebug(); } @@ -460,7 +496,7 @@ public void toggleBreakpoint(int lineIndex) { } @Override - protected LineID getCurrentLineID() { + public LineID getCurrentLineID() { return super.getCurrentLineID(); } @@ -496,19 +532,16 @@ public void run() { } } - /** - * Create a release build of the sketch and install its apk files on the - * attached device. + * Create a release package of the sketch */ public void handleExportPackage() { if (androidMode.checkPackageName(sketch, appComponent) && androidMode.checkAppIcons(sketch, appComponent) && handleExportCheckModified()) { - new KeyStoreManager(this); + new KeyStoreManager(this, KeyStoreManager.PACKAGE); } } - public void startExportPackage(final String keyStorePassword) { new Thread() { public void run() { @@ -536,7 +569,46 @@ public void run() { } }.start(); } - + + + /** + * Create a release bundle of the sketch + */ + public void handleExportBundle() { + if (androidMode.checkPackageName(sketch, appComponent) && + androidMode.checkAppIcons(sketch, appComponent) && handleExportCheckModified()) { + new KeyStoreManager(this, KeyStoreManager.BUNDLE); + } + } + + public void startExportBundle(final String keyStorePassword) { + new Thread() { + public void run() { + startIndeterminate(); + statusNotice(AndroidMode.getTextString("android_editor.status.exporting_bundle")); + AndroidBuild build = new AndroidBuild(sketch, androidMode, appComponent); + try { + File projectFolder = build.exportBundle(keyStorePassword); + if (projectFolder != null) { + statusNotice(AndroidMode.getTextString("android_editor.status.bundle_export_completed")); + Platform.openFolder(projectFolder); + } else { + statusError(AndroidMode.getTextString("android_editor.status.bundle_export_failed")); + } + } catch (IOException e) { + statusError(e); + } catch (SketchException e) { + statusError(e); + } catch (InterruptedException e) { + e.printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + } + stopIndeterminate(); + } + }.start(); + } + public int getAppComponent() { return appComponent; @@ -657,9 +729,9 @@ public void actionPerformed(ActionEvent e) { private void initDebugger() { debugger = new AndroidDebugger(this, androidMode); // Set saved breakpoints when sketch is opened for the first time - for (LineID lineID : stripBreakpointComments()) { - debugger.setBreakpoint(lineID); - } +// for (LineID lineID : stripBreakpointComments()) { +// debugger.setBreakpoint(lineID); +// } super.debugger = debugger; } @@ -753,4 +825,4 @@ public void actionPerformed(ActionEvent e) { } } } -} \ No newline at end of file +} diff --git a/mode/src/processing/mode/android/AndroidKeyStore.java b/processing/mode/src/processing/mode/android/AndroidKeyStore.java similarity index 94% rename from mode/src/processing/mode/android/AndroidKeyStore.java rename to processing/mode/src/processing/mode/android/AndroidKeyStore.java index 2929d99fe..711678f56 100644 --- a/mode/src/processing/mode/android/AndroidKeyStore.java +++ b/processing/mode/src/processing/mode/android/AndroidKeyStore.java @@ -32,8 +32,9 @@ * their apps. */ public class AndroidKeyStore { - public static final String ALIAS_STRING = "processing-keystore"; - public static final String KEYSTORE_FILE_NAME = "android-release-key.keystore"; + public static final String ALIAS_STRING = "p5android-key"; + public static final int KEY_VALIDITY_YEARS = 25; + public static final String KEYSTORE_FILE_NAME = "processing-upload-keystore.jks"; public static File getKeyStore() { return getKeyStore(KEYSTORE_FILE_NAME); @@ -78,7 +79,7 @@ public static void generateKeyStore(String password, "-alias", ALIAS_STRING, "-keyalg", "RSA", "-keysize", "2048", - "-validity", "10000", + "-validity", Integer.toString(KEY_VALIDITY_YEARS * 365), "-keypass", password, "-storepass", password, "-dname", dname diff --git a/mode/src/processing/mode/android/AndroidLineBreakpoint.java b/processing/mode/src/processing/mode/android/AndroidLineBreakpoint.java similarity index 96% rename from mode/src/processing/mode/android/AndroidLineBreakpoint.java rename to processing/mode/src/processing/mode/android/AndroidLineBreakpoint.java index 3604c2cb1..3716826b1 100644 --- a/mode/src/processing/mode/android/AndroidLineBreakpoint.java +++ b/processing/mode/src/processing/mode/android/AndroidLineBreakpoint.java @@ -22,7 +22,7 @@ package processing.mode.android; import com.sun.jdi.ReferenceType; -import processing.mode.java.Debugger; +import processing.mode.java.debug.Debugger; import processing.mode.java.debug.LineBreakpoint; import processing.mode.java.debug.LineID; @@ -51,7 +51,7 @@ public AndroidLineBreakpoint(int lineIdx, Debugger dbg) { * the logical class name to the VM (Physical) class name */ private void addPackageName() { - if (!alreadyAdded){ + if (!alreadyAdded) { className = ((AndroidDebugger) dbg).getPackageName() + "." + className; alreadyAdded = !alreadyAdded; } diff --git a/mode/src/processing/mode/android/AndroidMode.java b/processing/mode/src/processing/mode/android/AndroidMode.java similarity index 92% rename from mode/src/processing/mode/android/AndroidMode.java rename to processing/mode/src/processing/mode/android/AndroidMode.java index 574bf1c7c..1d341c164 100644 --- a/mode/src/processing/mode/android/AndroidMode.java +++ b/processing/mode/src/processing/mode/android/AndroidMode.java @@ -65,10 +65,10 @@ public class AndroidMode extends JavaMode { private static final String VERSIONS_FILE = "version.properties"; private static final String BLUETOOTH_DEBUG_URL = - "https://developer.android.com/training/wearables/apps/debugging.html"; + "https://developer.android.com/training/wearables/get-started/debugging"; private static final String DISTRIBUTING_APPS_TUT_URL = - "http://android.processing.org/tutorials/distributing/index.html"; + "https://android.processing.org/tutorials/distributing/index.html"; public AndroidMode(Base base, File folder) { super(base, folder); @@ -188,7 +188,12 @@ public void checkSDK(Editor editor) { public AndroidSDK getSDK() { return sdk; } - + + + public File getResourcesFolder() { + return new File(getFolder(), "resources"); + } + public String getModeJar() { String modePath = new File(getFolder(), "mode").getAbsolutePath(); @@ -238,7 +243,20 @@ public void handleRunEmulator(Sketch sketch, AndroidEditor editor, AndroidBuild build = new AndroidBuild(sketch, this, editor.getAppComponent()); listener.statusNotice(AndroidMode.getTextString("android_mode.status.building_project")); - build.build("debug"); + build.build("debug", ""); + + if (sdk.getEmulatorTool() == null) { + // System.out.println("Try to download the emulator using the SDK Manager..."); + listener.statusNotice(AndroidMode.getTextString("android_mode.status.downloading_emulator")); + boolean emulatorInstallationSucceded = sdk.downloadEmuOnDemand(); + if (!emulatorInstallationSucceded) { + SketchException emulatorInstallationErrorException = new SketchException(AndroidMode.getTextString("android_mode.error.emulator_installation_failed")); + emulatorInstallationErrorException.hideStackTrace(); + throw emulatorInstallationErrorException; + } else { + System.out.println(AndroidMode.getTextString("android_mode.status.downloading_emulator_successful")); + } + } boolean avd = AVD.ensureProperAVD(editor, this, sdk, build.isWear()); if (!avd) { @@ -273,7 +291,7 @@ public void handleRunDevice(Sketch sketch, AndroidEditor editor, AndroidBuild build = new AndroidBuild(sketch, this, editor.getAppComponent()); listener.statusNotice(AndroidMode.getTextString("android_mode.status.building_project")); - File projectFolder = build.build("debug"); + File projectFolder = build.build("debug", ""); if (projectFolder == null) { listener.statusError(AndroidMode.getTextString("android_mode.status.project_build_failed")); return; @@ -357,7 +375,7 @@ public boolean checkAppIcons(Sketch sketch, int comp) { // The user did not set custom icons, show error and stop AndroidUtil.showMessage(AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_title"), AndroidMode.getTextString("android_mode.dialog.cannot_use_default_icons_body", DISTRIBUTING_APPS_TUT_URL)); - return false; + return false; } return true; } @@ -419,4 +437,5 @@ static public String getTextString(String key, Object... arguments) { } return String.format(value, arguments); } -} \ No newline at end of file +} + diff --git a/mode/src/processing/mode/android/AndroidRunner.java b/processing/mode/src/processing/mode/android/AndroidRunner.java similarity index 96% rename from mode/src/processing/mode/android/AndroidRunner.java rename to processing/mode/src/processing/mode/android/AndroidRunner.java index 284c0dc5b..ea22aa93d 100644 --- a/mode/src/processing/mode/android/AndroidRunner.java +++ b/processing/mode/src/processing/mode/android/AndroidRunner.java @@ -62,7 +62,7 @@ public AndroidRunner(AndroidBuild build, RunnerListener listener) { this.build = build; this.listener = listener; - if (listener instanceof AndroidEditor){ + if (listener instanceof AndroidEditor) { isDebugEnabled = ((AndroidEditor) listener).isDebuggerEnabled(); } @@ -139,7 +139,7 @@ public boolean launch(Future deviceFuture, int comp, boolean emu) { } // Start Debug if Debugger is enabled - if (isDebugEnabled){ + if (isDebugEnabled) { ((AndroidEditor) listener).getDebugger() .startDebug(this, device); } @@ -183,7 +183,7 @@ private VirtualMachine connect( return connector.attach(args); } - public VirtualMachine vm(){ + public VirtualMachine vm() { return vm; } diff --git a/mode/src/processing/mode/android/AndroidSDK.java b/processing/mode/src/processing/mode/android/AndroidSDK.java similarity index 82% rename from mode/src/processing/mode/android/AndroidSDK.java rename to processing/mode/src/processing/mode/android/AndroidSDK.java index 6274810fe..36e7423a1 100644 --- a/mode/src/processing/mode/android/AndroidSDK.java +++ b/processing/mode/src/processing/mode/android/AndroidSDK.java @@ -41,11 +41,18 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; +import java.nio.file.attribute.PosixFilePermission; + +import java.io.PrintWriter; +import java.util.Set; /** * Class holding all needed references (path, tools, etc) to the SDK used by @@ -67,17 +74,19 @@ class AndroidSDK { private final File cmdlineTools; private final File avdManager; private final File sdkManager; - private final File emulator; - - private static final String SDK_DOWNLOAD_URL = - "https://developer.android.com/studio/index.html#downloads"; + private final File adb; + + private File emulator; private static final String PROCESSING_FOR_ANDROID_URL = - "http://android.processing.org/"; + "https://android.processing.org/"; private static final String WHATS_NEW_URL = - "http://android.processing.org/whatsnew.html"; - + "https://android.processing.org/whatsnew"; + + private static final String SDK_DOWNLOAD_URL = + "https://developer.android.com/studio/index.html#android-studio-downloads"; + private static final String DRIVER_INSTALL_URL = "https://developer.android.com/studio/run/oem-usb.html#InstallingDriver"; @@ -99,13 +108,19 @@ public AndroidSDK(File folder) throws BadSDKException, IOException { throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_sdk_folder", folder)); } - File tmp = new File(folder, "cmdline-tools/latest"); - if (!tmp.exists()) { - tmp = new File(folder, "tools"); - } else if (!tmp.exists()) { - throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_tools_folder", folder)); - } - cmdlineTools = tmp; + cmdlineTools = new File(folder, "cmdline-tools/latest"); + // We need only command line tools, as sdk/tools got deprecated and can't be used with java 17 + if (!cmdlineTools.exists()) { + // Let's be more specific to show the error + File sdkTools = new File(folder, "tools"); + if (sdkTools.exists()) { + throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_cmdtools_folder_found_sdktools", folder)); + } else { + throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_cmdtools_folder", folder)); + } + } + // If we reached here, that means command line tools exists + // ok to go with the command line tools platformTools = new File(folder, "platform-tools"); if (!platformTools.exists()) { @@ -123,30 +138,54 @@ public AndroidSDK(File folder) throws BadSDKException, IOException { } // Retrieve the highest platform from the available targets - ArrayList targets = getAvailableSdkTargets(); - int highest = 1; - for (SDKTarget targ: targets) { - if (highest < targ.version) { - highest = targ.version; + ArrayList targets = getAvailableSdkTargets(); + int highestBuild = 1; + int highestTarget = 1; + String highestName = ""; + for (Target targ: targets) { + if (highestBuild < targ.build) { + highestBuild = targ.build; + highestTarget = targ.sdk; + highestName = targ.name; } } - if (highest < PApplet.parseInt(AndroidBuild.TARGET_SDK)) { + if (highestTarget < PApplet.parseInt(AndroidBuild.TARGET_SDK)) { throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_target_platform", AndroidBuild.TARGET_SDK, platforms.getAbsolutePath())); } - - highestPlatform = new File(platforms, "android-" + highest); + highestPlatform = new File(platforms, highestName); androidJar = new File(highestPlatform, "android.jar"); if (!androidJar.exists()) { throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_android_jar", AndroidBuild.TARGET_SDK, highestPlatform.getAbsolutePath())); } + // Collecting the tools needed by the mode + adb = findCliTool(platformTools, "adb"); avdManager = findCliTool(new File(cmdlineTools, "bin"), "avdmanager"); sdkManager = findCliTool(new File(cmdlineTools, "bin"), "sdkmanager"); + + initEmu(); + String path = Platform.getenv("PATH"); + + Platform.setenv("ANDROID_SDK", folder.getCanonicalPath()); + path = platformTools.getCanonicalPath() + File.pathSeparator + + cmdlineTools.getCanonicalPath() + File.pathSeparator + path; + + String javaHomeProp = System.getProperty("java.home"); + File javaHome = new File(javaHomeProp).getCanonicalFile(); + Platform.setenv("JAVA_HOME", javaHome.getCanonicalPath()); + + path = new File(javaHome, "bin").getCanonicalPath() + File.pathSeparator + path; + Platform.setenv("PATH", path); + + checkDebugCertificate(); + } + + private void initEmu() throws BadSDKException, IOException { File emuFolder = new File(folder, "emulator"); if (emuFolder.exists()) { // First try the new location of the emulator inside its own folder @@ -158,28 +197,49 @@ public AndroidSDK(File folder) throws BadSDKException, IOException { emulator = findCliTool(cmdlineTools, "emulator"); } else { emulator = null; - if (SDKDownloader.DOWNLOAD_EMU) { + if (SDKDownloader.DOWNLOAD_EMU_WITH_SDK) { // Only throw an exception if the downloader was supposed to download the emulator throw new BadSDKException(AndroidMode.getTextString("android_sdk.error.missing_emulator", AndroidBuild.TARGET_SDK, highestPlatform.getAbsolutePath())); } } } - - String path = Platform.getenv("PATH"); - - Platform.setenv("ANDROID_SDK", folder.getCanonicalPath()); - path = platformTools.getCanonicalPath() + File.pathSeparator + - cmdlineTools.getCanonicalPath() + File.pathSeparator + path; + } + public boolean downloadEmuOnDemand() { + final String[] cmd = new String[] { + sdkManager.getAbsolutePath(), + "emulator" + }; + + ProcessBuilder pb = new ProcessBuilder(cmd); + Process process = null; + try { + process = pb.start(); + } catch (IOException e) { + e.printStackTrace(); + } - String javaHomeProp = System.getProperty("java.home"); - File javaHome = new File(javaHomeProp).getCanonicalFile(); - Platform.setenv("JAVA_HOME", javaHome.getCanonicalPath()); - - path = new File(javaHome, "bin").getCanonicalPath() + File.pathSeparator + path; - Platform.setenv("PATH", path); + try { + new RedirectStreamHandler(new PrintWriter(System.out, true), process.getInputStream()); + new RedirectStreamHandler(new PrintWriter(System.out, true), process.getErrorStream()); + + int emulatorDownloadResultCode = process.waitFor(); + System.out.println("Output from emulator download " + emulatorDownloadResultCode); + if (emulatorDownloadResultCode == 0) { + initEmu(); + return true; + } + } catch (IOException e) { + e.printStackTrace(); + } catch (BadSDKException e) { + e.printStackTrace(); + } catch (InterruptedException e) { + e.printStackTrace(); + } finally { + process.destroy(); + } - checkDebugCertificate(); + return false; } @@ -260,7 +320,7 @@ public File getCommandLineToolsFolder() { return cmdlineTools; } - + public File getEmulatorTool() { return emulator; } @@ -279,18 +339,7 @@ public File getHighestPlatform() { public File getTargetPlatform(String target) { return new File(platforms, "android-" + target); } - - - public File getZipAlignTool() { - File[] files = buildTools.listFiles(); - String name = Platform.isWindows() ? "zipalign.exe" : "zipalign"; - for (File f: files) { - File z = new File(f, name); - if (z.exists()) return z; - } - return null; - } - + // Write to the process input, so the licenses will be accepted. In // principle, we only need 7 'y', one for the 'yes' to the first @@ -354,18 +403,48 @@ static public File getGoogleDriverFolder() { * for the SDK installation. Also figures out the name of android/android.bat/android.exe * so that it can be called explicitly. */ - private static File findCliTool(final File tools, String name) + private static File findCliTool(final File toolDir, String toolName) throws BadSDKException { - if (new File(tools, name + ".bat").exists()) { - return new File(tools, name + ".bat"); - } - if (new File(tools, name + ".exe").exists()) { - return new File(tools, name + ".exe"); - } - if (new File(tools, name).exists()) { - return new File(tools, name); + File toolFile; + if (Platform.isWindows()) { + toolFile = new File(toolDir, toolName + ".exe"); + if (!toolFile.exists()) { + toolFile = new File(toolDir, toolName + ".bat"); + } + } else { + toolFile = new File(toolDir, toolName); + } + + if (!toolFile.exists()) { + throw new BadSDKException("Cannot find " + toolName + " in " + toolDir); + } + + if (!Platform.isWindows()) { + try { + // Get the POSIX file permissions + Path toolPath = Paths.get(toolFile.getAbsolutePath()); + Set permissions = Files.getPosixFilePermissions(toolPath); + + boolean addedPerm = false; + if (!permissions.contains(PosixFilePermission.OWNER_EXECUTE)) { + permissions.add(PosixFilePermission.OWNER_EXECUTE); + addedPerm = true; + } + if (!permissions.contains(PosixFilePermission.GROUP_EXECUTE)) { + permissions.add(PosixFilePermission.GROUP_EXECUTE); + addedPerm = true; + } + + if (addedPerm) { + // Set the missing POSIX execute (group and owner) permissions + Files.setPosixFilePermissions(toolPath, permissions); + } + } catch (Exception e) { + e.printStackTrace(); + } } - throw new BadSDKException("Cannot find " + name + " in " + tools); + + return toolFile; } @@ -473,8 +552,8 @@ static public AndroidSDK locate(final Frame window, final AndroidMode androidMod } } - static public boolean locateSysImage(final Frame window, - final AndroidMode androidMode, final boolean wear, final boolean ask) + static public boolean requestSysImage(final Frame window, + final AndroidMode androidMode, final boolean wear, final boolean ask) throws BadSDKException, CancelException, IOException { final int result = showDownloadSysImageDialog(window, wear); if (result == JOptionPane.YES_OPTION) { @@ -513,10 +592,10 @@ static public AndroidSDK download(final Frame editor, final AndroidMode androidM AndroidMode.getTextString("android_sdk.dialog.sdk_license_rejected_body")); } - if (Platform.isLinux() && Platform.getNativeBits() == 32) { - AndroidUtil.showMessage(AndroidMode.getTextString("android_sdk.dialog.32bit_system_title"), - AndroidMode.getTextString("android_sdk.dialog.32bit_system_body", SYSTEM_32BIT_URL)); - } + // if (Platform.isLinux() && Platform.getNativeBits() == 32) { + // AndroidUtil.showMessage(AndroidMode.getTextString("android_sdk.dialog.32bit_system_title"), + // AndroidMode.getTextString("android_sdk.dialog.32bit_system_body", SYSTEM_32BIT_URL)); + // } return sdk; } @@ -735,25 +814,20 @@ static public File selectFolder(String prompt, File folder, Frame frame) { private static final String ADB_DAEMON_MSG_1 = "daemon not running"; private static final String ADB_DAEMON_MSG_2 = "daemon started successfully"; - public ProcessResult runADB(final String... cmd) + public ProcessResult runAdb(final String... cmd) throws InterruptedException, IOException { if (adbDisabled) { throw new IOException("adb is currently disabled"); } - - final String[] adbCmd; - if (!cmd[0].contains("adb")) { - File abdPath = Platform.isWindows() ? new File(platformTools, "adb.exe") : - new File(platformTools, "adb"); - adbCmd = PApplet.splice(cmd, abdPath.getCanonicalPath(), 0); - } else { - adbCmd = cmd; - } - // printing this here to see if anyone else is killing the adb server + + final String[] adbCmd = PApplet.splice(cmd, adb.getCanonicalPath(), 0); + if (processing.app.Base.DEBUG) { + // printing this here to see if anyone else is killing the adb server PApplet.printArray(adbCmd); } + try { ProcessResult adbResult = new ProcessHelper(adbCmd).execute(); // Ignore messages about starting up an adb daemon @@ -783,36 +857,71 @@ public ProcessResult runADB(final String... cmd) } } - static class SDKTarget { - public int version = 0; - public String name; + public Process getAdbProcess(final String... cmd) + throws IOException { + + if (adbDisabled) { + throw new IOException("adb is currently disabled"); + } + + final String[] adbCmd = PApplet.splice(cmd, adb.getCanonicalPath(), 0); + + if (processing.app.Base.DEBUG) { + // printing this here to see if anyone else is killing the adb server + PApplet.printArray(adbCmd); + } + + try { + Process process = Runtime.getRuntime().exec(adbCmd); + return process; + } catch (IOException ioe) { + if (-1 < ioe.getMessage().indexOf("Permission denied")) { + Messages.showWarning(AndroidMode.getTextString("android_sdk.warn.cannot_run_adb_title"), + AndroidMode.getTextString("android_sdk.warn.cannot_run_adb_body")); + adbDisabled = true; + } + throw ioe; + } + } + + static private class Target { + public int sdk = 0; + public String release = ""; + public int build = 0; + public String name = ""; } - public ArrayList getAvailableSdkTargets() throws IOException { - ArrayList targets = new ArrayList(); + private ArrayList getAvailableSdkTargets() throws IOException { + ArrayList targets = new ArrayList(); for (File platform : platforms.listFiles()) { File propFile = new File(platform, "build.prop"); if (!propFile.exists()) continue; - SDKTarget target = new SDKTarget(); + Target target = new Target(); BufferedReader br = new BufferedReader(new FileReader(propFile)); String line; while ((line = br.readLine()) != null) { String[] lineData = line.split("="); - if (lineData[0].equals("ro.build.version.sdk")) { - target.version = Integer.valueOf(lineData[1]); + + if (lineData[0].equals("ro.system.build.version.incremental")) { + target.build = Integer.valueOf(lineData[1]); } if (lineData[0].equals("ro.build.version.release")) { - target.name = lineData[1]; - break; + target.release = lineData[1]; } + + if (lineData[0].equals("ro.build.version.sdk")) { + target.sdk = Integer.valueOf(lineData[1]); + } + + target.name = platform.getName(); } br.close(); - if (target.version != 0 && target.name != null) targets.add(target); + if (target.sdk != 0 && target.build != 0 && target.name != "") targets.add(target); } return targets; @@ -831,4 +940,4 @@ public CancelException(final String message) { super(message); } } -} \ No newline at end of file +} diff --git a/mode/src/processing/mode/android/AndroidTool.java b/processing/mode/src/processing/mode/android/AndroidTool.java similarity index 86% rename from mode/src/processing/mode/android/AndroidTool.java rename to processing/mode/src/processing/mode/android/AndroidTool.java index 3dbdb932b..7bab241d7 100644 --- a/mode/src/processing/mode/android/AndroidTool.java +++ b/processing/mode/src/processing/mode/android/AndroidTool.java @@ -93,27 +93,34 @@ public String initLoader(String className) throws Exception { File[] toolArchives = Util.listJarFiles(toolDir); File[] libArchives = Util.listJarFiles(libDir); - if (toolArchives != null && toolArchives.length > 0 && - libArchives != null && libArchives.length > 0) { - URL[] urlList = new URL[toolArchives.length + libArchives.length + 1]; + if (toolArchives != null && toolArchives.length > 0) { + + int nArchives = toolArchives.length + 1; + if (libArchives != null && libArchives.length > 0) { + nArchives += libArchives.length; + } + URL[] urlList = new URL[nArchives]; int j; for (j = 0; j < toolArchives.length; j++) { Messages.log("Found archive " + toolArchives[j] + " for " + getName()); urlList[j] = toolArchives[j].toURI().toURL(); } - for (int k = 0; k < libArchives.length; k++, j++) { - Messages.log("Found archive " + libArchives[k] + " for " + getName()); - urlList[j] = libArchives[k].toURI().toURL(); + if (libArchives != null) { + for (int k = 0; k < libArchives.length; k++, j++) { + Messages.log("Found archive " + libArchives[k] + " for " + getName()); + urlList[j] = libArchives[k].toURI().toURL(); + } } urlList[urlList.length - 1] = new File(mode.getModeJar()).toURI().toURL(); - // String modePath = new File(dmode.getFolder(), "mode").getAbsolutePath(); // urlList[urlList.length - 1] = new File(modePath + File.separator + "JavaMode.jar").toURI().toURL(); loader = new URLClassLoader(urlList); Messages.log("loading above JARs with loader " + loader); + } else { + throw new IgnorableException("Could not find any files inside " + toolDir.getAbsolutePath()); } } diff --git a/mode/src/processing/mode/android/AndroidToolbar.java b/processing/mode/src/processing/mode/android/AndroidToolbar.java similarity index 70% rename from mode/src/processing/mode/android/AndroidToolbar.java rename to processing/mode/src/processing/mode/android/AndroidToolbar.java index 8632f7689..960cd30b0 100644 --- a/mode/src/processing/mode/android/AndroidToolbar.java +++ b/processing/mode/src/processing/mode/android/AndroidToolbar.java @@ -39,13 +39,18 @@ @SuppressWarnings("serial") public class AndroidToolbar extends EditorToolbar { - static protected final int RUN = 0; - static protected final int STOP = 1; + static protected final int RUN_ON_DEVICE = 0; + static protected final int RUN_IN_EMULATOR = 1; + static protected final int STOP = 2; + + static protected final int NEW = 3; + static protected final int OPEN = 4; + static protected final int SAVE = 5; + + static protected final int EXPORT_PACKAGE = 6; + static protected final int EXPORT_BUNDLE = 7; + static protected final int EXPORT_PROJECT = 8; - static protected final int NEW = 2; - static protected final int OPEN = 3; - static protected final int SAVE = 4; - static protected final int EXPORT = 5; private AndroidEditor aEditor; @@ -58,80 +63,28 @@ public AndroidToolbar(Editor editor, Base base) { } - // TODO: - // Buttons are initialized in createButtons, see code of EditorToolbar.rebuild() -// public void init() { -// Image[][] images = loadImages(); -// for (int i = 0; i < 6; i++) { -// addButton(getTitle(i, false), getTitle(i, true), images[i], i == NEW); -// } -// } - - - static public String getTitle(int index, boolean shift) { + static public String getTitle(int index) { switch (index) { - case RUN: return !shift ? "Run on Device" : "Run in Emulator"; - case STOP: return "Stop"; - case NEW: return "New"; - case OPEN: return "Open"; - case SAVE: return "Save"; - case EXPORT: return !shift ? AndroidMode.getTextString("menu.file.export_signed_package") : - AndroidMode.getTextString("menu.file.export_android_project"); + case RUN_ON_DEVICE: return AndroidMode.getTextString("menu.sketch.run_on_device"); + case RUN_IN_EMULATOR: return AndroidMode.getTextString("menu.sketch.run_in_emulator"); + case STOP: return AndroidMode.getTextString("menu.sketch.stop"); + case NEW: return AndroidMode.getTextString("menu.file.new"); + case OPEN: return AndroidMode.getTextString("menu.file.open"); + case SAVE: return AndroidMode.getTextString("menu.file.save"); + case EXPORT_PACKAGE: return AndroidMode.getTextString("menu.file.export_signed_package"); + case EXPORT_BUNDLE: return AndroidMode.getTextString("menu.file.export_signed_bundle"); + case EXPORT_PROJECT: return AndroidMode.getTextString("menu.file.export_android_project"); } return null; } -/* - public void handlePressed(MouseEvent e, int sel) { - boolean shift = e.isShiftDown(); - AndroidEditor aeditor = (AndroidEditor) editor; - - switch (sel) { - case RUN: - if (!shift) { - aeditor.handleRunDevice(); - } else { - aeditor.handleRunEmulator(); - } - break; - - case STOP: - aeditor.handleStop(); - break; - - case OPEN: - // TODO I think we need a longer chain of accessors here. - JPopupMenu popup = editor.getMode().getToolbarMenu().getPopupMenu(); - popup.show(this, e.getX(), e.getY()); - break; - - case NEW: -// if (shift) { - base.handleNew(); -// } else { -// base.handleNewReplace(); -// } - break; - - case SAVE: - aeditor.handleSave(false); - break; - - case EXPORT: - if (!shift) { - aeditor.handleExportPackage(); - } else { - aeditor.handleExportProject(); - } - break; - } - } -*/ @Override public List createButtons() { // aEditor not ready yet because this is called by super() final boolean debug = ((AndroidEditor) editor).isDebuggerEnabled(); + // final boolean debug = false; + ArrayList toReturn = new ArrayList(); final String runText = debug ? @@ -156,7 +109,7 @@ public void actionPerformed(ActionEvent e) { @Override public void actionPerformed(ActionEvent e) { final int mask = ActionEvent.SHIFT_MASK | ActionEvent.ALT_MASK; - aEditor.handleStep(e.getModifiers() & mask); + handleStep(e.getModifiers() & mask); } }; toReturn.add(stepButton); @@ -166,7 +119,7 @@ public void actionPerformed(ActionEvent e) { Language.text("menu.debug.continue")) { @Override public void actionPerformed(ActionEvent e) { - aEditor.handleContinue(); + aEditor.getDebugger().continueDebug(); } }; toReturn.add(continueButton); @@ -185,8 +138,19 @@ public void actionPerformed(ActionEvent e) { return toReturn; } + private void handleStep(int modifiers) { + if (modifiers == 0) { + aEditor.getDebugger().stepOver(); + } else if ((modifiers & ActionEvent.SHIFT_MASK) != 0) { + aEditor.getDebugger().stepInto(); + } else if ((modifiers & ActionEvent.ALT_MASK) != 0) { + aEditor.getDebugger().stepOut(); + } + } + @Override public void addModeButtons(Box box, JLabel label) { + EditorButton debugButton = new EditorButton(this, "/lib/toolbar/debug", Language.text("toolbar.debug")) { @@ -202,6 +166,7 @@ public void actionPerformed(ActionEvent e) { // debugButton.setRolloverLabel(label); box.add(debugButton); addGap(box); + } @Override @@ -250,4 +215,4 @@ public void deactivateStep() { stepButton.setSelected(false); repaint(); } -} \ No newline at end of file +} diff --git a/mode/src/processing/mode/android/AndroidUtil.java b/processing/mode/src/processing/mode/android/AndroidUtil.java similarity index 82% rename from mode/src/processing/mode/android/AndroidUtil.java rename to processing/mode/src/processing/mode/android/AndroidUtil.java index 80772bafb..9e0a215f4 100644 --- a/mode/src/processing/mode/android/AndroidUtil.java +++ b/processing/mode/src/processing/mode/android/AndroidUtil.java @@ -33,7 +33,12 @@ import java.util.zip.ZipFile; import java.nio.file.Files; import java.nio.file.StandardCopyOption; - +import java.nio.file.Paths; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.FileVisitResult; +import java.nio.file.attribute.BasicFileAttributes; + import javax.swing.JEditorPane; import javax.swing.JLabel; import javax.swing.JOptionPane; @@ -61,6 +66,7 @@ public class AndroidUtil { // Creates a message dialog, where the text can contain clickable links. static public void showMessage(String title, String text) { + System.out.println(text); if (title == null) title = "Message"; if (Base.isCommandLine()) { System.out.println(title + ": " + text); @@ -71,17 +77,26 @@ static public void showMessage(String title, String text) { "margin: " + TEXT_MARGIN + "px; " + "width: " + TEXT_WIDTH + "px }" + " " + - "

" + text + "

"; - JEditorPane pane = new JEditorPane("text/html", htmlString); + "

" + text + "

"; + JEditorPane pane = new JEditorPane(); + pane.setContentType("text/html"); + pane.setText(htmlString); + pane.setEditable(false); + pane.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { - Platform.openURL(e.getURL().toString()); + if (e.getURL() != null) { + Platform.openURL(e.getURL().toString()); + } else { + String description = e.getDescription(); + System.err.println("Cannot open this URL: " + description); + } } } }); - pane.setEditable(false); + JLabel label = new JLabel(); pane.setBackground(label.getBackground()); JOptionPane.showMessageDialog(null, pane, title, @@ -95,8 +110,7 @@ static public void writeFile(final File file, String[] lines) { writer.flush(); writer.close(); } - - + static public File createPath(final File parent, final String name) throws SketchException { final File result = new File(parent, name); @@ -105,12 +119,10 @@ static public File createPath(final File parent, final String name) } return result; } - - + static public void createFileFromTemplate(final File tmplFile, final File destFile) { createFileFromTemplate(tmplFile, destFile, null); - } - + } static public void createFileFromTemplate(final File tmplFile, final File destFile, final HashMap replaceMap) { @@ -134,8 +146,7 @@ static public void createFileFromTemplate(final File tmplFile, final File destFi pw.flush(); pw.close(); } - - + static public File createSubFolder(File parent, String name) throws IOException { File newFolder = new File(parent, name); if (newFolder.exists()) { @@ -175,15 +186,9 @@ static public File createSubFolder(File parent, String name) throws IOException } return newFolder; } - - - static public void extractFolder(File file, File newPath, boolean setExec) + + static public void extractFolder(File file, File newPath) throws IOException { - extractFolder(file, newPath, setExec, false); - } - - static public void extractFolder(File file, File newPath, boolean setExec, - boolean remRoot) throws IOException { int BUFFER = 2048; ZipFile zip = new ZipFile(file); @@ -194,18 +199,7 @@ static public void extractFolder(File file, File newPath, boolean setExec, // grab a zip file entry ZipEntry entry = zipFileEntries.nextElement(); String currentEntry = entry.getName(); - - if (remRoot) { - // Remove root folder from path - int idx = currentEntry.indexOf("/"); - if (idx == -1) { - // Let's try the system file separator - // https://stackoverflow.com/a/16485210 - idx = currentEntry.indexOf(File.separator); - } - currentEntry = currentEntry.substring(idx + 1); - } - + File destFile = new File(newPath, currentEntry); //destFile = new File(newPath, destFile.getName()); File destinationParent = destFile.getParentFile(); @@ -213,13 +207,6 @@ static public void extractFolder(File file, File newPath, boolean setExec, // create the parent directory structure if needed destinationParent.mkdirs(); - String ext = PApplet.getExtension(currentEntry); - if (setExec && ext.equals("unknown")) { - // On some OS X machines the android binaries lose their executable - // attribute, rendering the mode unusable - destFile.setExecutable(true); - } - if (!entry.isDirectory()) { // should preserve permissions // https://bitbucket.org/atlassian/amps/pull-requests/21/amps-904-preserve-executable-file-status/diff @@ -248,17 +235,15 @@ static public void extractClassesJarFromAar(File wearFile, File explodeDir, File jarFile) throws IOException { extractClassesJarFromAar(wearFile, explodeDir, jarFile, true); } - - + static public void extractClassesJarFromAar(File wearFile, File explodeDir, File jarFile, boolean removeDir) throws IOException { - extractFolder(wearFile, explodeDir, false); + extractFolder(wearFile, explodeDir); File classFile = new File(explodeDir, "classes.jar"); Util.copyFile(classFile, jarFile); Util.removeDir(explodeDir); } - static public File[] getFileList(File folder, String[] names) { return getFileList(folder, names, null); } @@ -274,8 +259,7 @@ static public File[] getFileList(File folder, String[] names, String[] altNames) } return icons; } - - + static public File[] getFileList(Mode mode, String prefix, String[] names) { File[] icons = new File[names.length]; for (int i = 0; i < names.length; i++) { @@ -290,8 +274,7 @@ static public boolean allFilesExists(File[] files) { } return true; } - - + static public boolean noFileExists(File[] files) { for (File f: files) { if (f.exists()) return false; @@ -306,4 +289,37 @@ static public void moveDir(File from, File to) { ex.printStackTrace(); } } + + static public void copyDir(File from, File to) { + final Path source = Paths.get(from.toURI()); + final Path target = Paths.get(to.toURI()); + + SimpleFileVisitor copyVisitor = new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { + Path resolve = target.resolve(source.relativize(dir)); + if (Files.notExists(resolve)) Files.createDirectories(resolve); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + Path resolve = target.resolve(source.relativize(file)); + Files.copy(file, resolve, StandardCopyOption.REPLACE_EXISTING); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFileFailed(Path file, IOException exc) { + System.err.format("Unable to copy: %s: %s%n", file, exc); + return FileVisitResult.CONTINUE; + } + }; + + try { + Files.walkFileTree(source, copyVisitor); + } catch (IOException e) { + e.printStackTrace(); + } + } } diff --git a/mode/src/processing/mode/android/Commander.java b/processing/mode/src/processing/mode/android/Commander.java similarity index 99% rename from mode/src/processing/mode/android/Commander.java rename to processing/mode/src/processing/mode/android/Commander.java index 07264a1a9..437dab96b 100644 --- a/mode/src/processing/mode/android/Commander.java +++ b/processing/mode/src/processing/mode/android/Commander.java @@ -237,7 +237,7 @@ private void execute() { sketch = new Sketch(pdePath, androidMode); if (task == BUILD || task == RUN) { AndroidBuild build = new AndroidBuild(sketch, androidMode, appComponent); - build.build(target); + build.build(target, ""); if (task == RUN) { AndroidRunner runner = new AndroidRunner(build, this); diff --git a/mode/src/processing/mode/android/Device.java b/processing/mode/src/processing/mode/android/Device.java similarity index 92% rename from mode/src/processing/mode/android/Device.java rename to processing/mode/src/processing/mode/android/Device.java index 5298d6594..017250da0 100644 --- a/mode/src/processing/mode/android/Device.java +++ b/processing/mode/src/processing/mode/android/Device.java @@ -22,7 +22,6 @@ package processing.mode.android; import processing.app.Base; -import processing.app.Platform; import processing.app.RunnerListener; import processing.app.exec.LineProcessor; import processing.app.exec.ProcessRegistry; @@ -31,7 +30,6 @@ import processing.core.PApplet; import processing.mode.android.LogEntry.Severity; -import java.io.File; import java.io.IOException; import java.util.*; import java.util.regex.Matcher; @@ -73,8 +71,8 @@ public Device(final Devices env, final String id) { public void bringLauncherToFront() { try { adb("shell", "am", "start", - "-a", "android.intent.action.MAIN", - "-c", "android.intent.category.HOME"); + "-a", "android.intent.action.MAIN", + "-c", "android.intent.category.HOME"); } catch (final Exception e) { e.printStackTrace(System.err); } @@ -88,12 +86,12 @@ public String getName() { String name = ""; try { - ProcessResult result = env.getSDK().runADB("-s", id, "shell", "getprop", "ro.product.brand"); + ProcessResult result = adb("shell", "getprop", "ro.product.brand"); if (result.succeeded()) { name += result.getStdout() + " "; } - result = env.getSDK().runADB("-s", id, "shell", "getprop", "ro.product.model"); + result = adb("shell", "getprop", "ro.product.model"); if (result.succeeded()) { name += result.getStdout(); } @@ -189,7 +187,7 @@ public boolean launchApp(final String packageName, boolean isDebuggerEnabled) return false; } ProcessResult pr; - if (isDebuggerEnabled){ + if (isDebuggerEnabled) { String[] cmd = { "shell", "am", "start", "-e", "debug", "true", @@ -208,7 +206,6 @@ public boolean launchApp(final String packageName, boolean isDebuggerEnabled) }; pr = adb(cmd); } -// PApplet.println(cmd); if (Base.DEBUG) { System.out.println(pr.toString()); @@ -226,8 +223,9 @@ public boolean launchApp(final String packageName, boolean isDebuggerEnabled) public void forwardPort(int tcpPort) throws IOException, InterruptedException { // Start ADB Server adb("start-server"); - final String[] jdwpcmd = generateAdbCommand("jdwp"); - Process deviceId = Runtime.getRuntime().exec(jdwpcmd); + + Process deviceId = adbProc("jdwp"); + // Get Process ID from ADB command `adb jdwp` JDWPProcessor pIDProcessor = new JDWPProcessor(); new StreamPump(deviceId.getInputStream(), "jdwp: ").addTarget( @@ -236,7 +234,8 @@ public void forwardPort(int tcpPort) throws IOException, InterruptedException { System.err).start(); Thread.sleep(1000); - // forward to tcp port + + // Forward to tcp port adb("forward", "tcp:" + tcpPort, "jdwp:" + pIDProcessor.getId()); } @@ -245,7 +244,7 @@ private class JDWPProcessor implements LineProcessor { public void processLine(final String line) { pId = Integer.parseInt(line); } - public int getId(){ + public int getId() { return pId; } } @@ -389,9 +388,11 @@ private void reportStackTrace(final LogEntry entry) { void initialize() throws IOException, InterruptedException { adb("logcat", "-c"); - final String[] cmd = generateAdbCommand("logcat", "-v", "brief"); + + final String[] cmd = genAdbCommand("logcat", "-v", "brief"); final String title = PApplet.join(cmd, ' '); - logcat = Runtime.getRuntime().exec(cmd); + logcat = env.getSDK().getAdbProcess(cmd); + ProcessRegistry.watch(logcat); new StreamPump(logcat.getInputStream(), "log: " + title).addTarget( new LogLineProcessor()).start(); @@ -465,15 +466,17 @@ public void removeListener(final DeviceListener listener) { } private ProcessResult adb(final String... cmd) throws InterruptedException, IOException { - final String[] adbCmd = generateAdbCommand(cmd); - return env.getSDK().runADB(adbCmd); + final String[] adbCmd = genAdbCommand(cmd); + return env.getSDK().runAdb(adbCmd); + } + + private Process adbProc(final String... cmd) throws IOException { + final String[] adbCmd = genAdbCommand(cmd); + return env.getSDK().getAdbProcess(adbCmd); } - private String[] generateAdbCommand(final String... cmd) throws IOException { - File toolsPath = env.getSDK().getPlatformToolsFolder(); - File abdPath = Platform.isWindows() ? new File(toolsPath, "adb.exe") : - new File(toolsPath, "adb"); - return PApplet.concat(new String[] { abdPath.getCanonicalPath(), "-s", getId() }, cmd); + private String[] genAdbCommand(final String... cmd) { + return PApplet.concat(new String[] { "-s", getId() }, cmd); } @Override diff --git a/mode/src/processing/mode/android/DeviceListener.java b/processing/mode/src/processing/mode/android/DeviceListener.java similarity index 100% rename from mode/src/processing/mode/android/DeviceListener.java rename to processing/mode/src/processing/mode/android/DeviceListener.java diff --git a/mode/src/processing/mode/android/Devices.java b/processing/mode/src/processing/mode/android/Devices.java similarity index 95% rename from mode/src/processing/mode/android/Devices.java rename to processing/mode/src/processing/mode/android/Devices.java index c893f1de0..92f1e2208 100644 --- a/mode/src/processing/mode/android/Devices.java +++ b/processing/mode/src/processing/mode/android/Devices.java @@ -83,7 +83,7 @@ public void killAdbServer() { System.out.print("Shutting down any existing adb server..."); System.out.flush(); try { - sdk.runADB("kill-server"); + sdk.runAdb("kill-server"); System.out.println(" Done."); } catch (final Exception e) { System.err.println("/nDevices.killAdbServer() failed."); @@ -95,7 +95,7 @@ public void startAdbServer() { System.out.print("Starting a new adb server..."); System.out.flush(); try { - sdk.runADB("start-server"); + sdk.runAdb("start-server"); System.out.println(" Done."); } catch (final Exception e) { System.err.println("/nDevices.startAdbServer() failed."); @@ -118,9 +118,9 @@ public void enableBluetoothDebugging() { try { // Try Enable debugging over bluetooth // http://developer.android.com/training/wearables/apps/bt-debugging.html - sdk.runADB("-s", device.getId(), "forward", "tcp:" + BT_DEBUG_PORT, + sdk.runAdb("-s", device.getId(), "forward", "tcp:" + BT_DEBUG_PORT, "localabstract:/adb-hub"); - sdk.runADB("connect", "127.0.0.1:" + BT_DEBUG_PORT); + sdk.runAdb("connect", "127.0.0.1:" + BT_DEBUG_PORT); } catch (final Exception e) { e.printStackTrace(); } @@ -349,7 +349,7 @@ public List list() { ProcessResult result; try { // System.out.println("listing devices 00"); - result = sdk.runADB("devices"); + result = sdk.runAdb("devices"); // System.out.println("listing devices 05"); } catch (InterruptedException e) { return Collections.emptyList(); diff --git a/mode/src/processing/mode/android/EmulatorController.java b/processing/mode/src/processing/mode/android/EmulatorController.java similarity index 99% rename from mode/src/processing/mode/android/EmulatorController.java rename to processing/mode/src/processing/mode/android/EmulatorController.java index 0e2288591..e3d9b7a13 100644 --- a/mode/src/processing/mode/android/EmulatorController.java +++ b/processing/mode/src/processing/mode/android/EmulatorController.java @@ -146,7 +146,7 @@ public void run() { } Thread.sleep(2000); //System.out.println("done sleeping"); - ProcessResult result = sdk.runADB("-s", "emulator-" + portString, + ProcessResult result = sdk.runAdb("-s", "emulator-" + portString, "shell", "getprop", "dev.bootcomplete"); if (result.getStdout().trim().equals("1")) { setState(State.RUNNING); diff --git a/mode/src/processing/mode/android/KeyStoreManager.java b/processing/mode/src/processing/mode/android/KeyStoreManager.java similarity index 94% rename from mode/src/processing/mode/android/KeyStoreManager.java rename to processing/mode/src/processing/mode/android/KeyStoreManager.java index d32f42e0a..d968687ca 100644 --- a/mode/src/processing/mode/android/KeyStoreManager.java +++ b/processing/mode/src/processing/mode/android/KeyStoreManager.java @@ -42,6 +42,9 @@ @SuppressWarnings("serial") public class KeyStoreManager extends JFrame { + final static protected int PACKAGE = 0; + final static protected int BUNDLE = 1; + final static private int BOX_BORDER = Toolkit.zoom(13); final static private int PASS_BORDER = Toolkit.zoom(15); final static private int LABEL_WIDTH = Toolkit.zoom(400); @@ -64,14 +67,14 @@ public class KeyStoreManager extends JFrame { JTextField country; JTextField stateName; - public KeyStoreManager(final AndroidEditor editor) { + public KeyStoreManager(final AndroidEditor editor, final int kind) { super("Android keystore manager"); this.editor = editor; - createLayout(); + createLayout(kind); } - private void createLayout() { + private void createLayout(int kind) { Container outer = getContentPane(); outer.removeAll(); @@ -105,13 +108,21 @@ public void actionPerformed(ActionEvent e) { localityName.getText(), stateName.getText(), country.getText()); setVisible(false); - editor.startExportPackage(new String(passwordField.getPassword())); + if (kind == KeyStoreManager.BUNDLE) { + editor.startExportBundle(new String(passwordField.getPassword())); + } else { + editor.startExportPackage(new String(passwordField.getPassword())); + } } catch (Exception e1) { e1.printStackTrace(); } } else { setVisible(false); - editor.startExportPackage(new String(passwordField.getPassword())); + if (kind == KeyStoreManager.BUNDLE) { + editor.startExportBundle(new String(passwordField.getPassword())); + } else { + editor.startExportPackage(new String(passwordField.getPassword())); + } } } } @@ -147,7 +158,7 @@ public void actionPerformed(ActionEvent e) { setVisible(true); } else { keyStore = null; - createLayout(); + createLayout(kind); } } } diff --git a/mode/src/processing/mode/android/Keys.java b/processing/mode/src/processing/mode/android/Keys.java similarity index 100% rename from mode/src/processing/mode/android/Keys.java rename to processing/mode/src/processing/mode/android/Keys.java diff --git a/mode/src/processing/mode/android/LogEntry.java b/processing/mode/src/processing/mode/android/LogEntry.java similarity index 100% rename from mode/src/processing/mode/android/LogEntry.java rename to processing/mode/src/processing/mode/android/LogEntry.java diff --git a/mode/src/processing/mode/android/Manifest.java b/processing/mode/src/processing/mode/android/Manifest.java similarity index 91% rename from mode/src/processing/mode/android/Manifest.java rename to processing/mode/src/processing/mode/android/Manifest.java index c50075fee..1cc755f86 100644 --- a/mode/src/processing/mode/android/Manifest.java +++ b/processing/mode/src/processing/mode/android/Manifest.java @@ -120,15 +120,6 @@ public void setPackageName(String packageName) { save(); } - - public void setSdkTarget(String version) { - XML usesSdk = xml.getChild("uses-sdk"); - if (usesSdk != null) { - usesSdk.setString("android:targetSdkVersion", version); - save(); - } - } - public String[] getPermissions() { XML[] elements = xml.getChildren("uses-permission"); @@ -137,7 +128,7 @@ public String[] getPermissions() { for (int i = 0; i < count; i++) { String tmp = elements[i].getString("android:name"); if (tmp.indexOf("android.permission") == 0) { - // Standard permission, remove perfix + // Standard permission, remove prefix int idx = tmp.lastIndexOf("."); names[i] = tmp.substring(idx + 1); } else { @@ -173,7 +164,7 @@ public void setPermissions(String[] names) { hasReadExtStorage = true; continue; } - if(appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")){ + if (appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")) { hasCameraAccess = true; continue; } @@ -244,7 +235,7 @@ private void fixPermissions(XML mf) { hasReadExtStorage = true; continue; } - if (appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")){ + if (appComp == AndroidBuild.AR && name.equals(PERMISSION_PREFIX + "CAMERA")) { hasCameraAccess = true; continue; } @@ -270,22 +261,9 @@ private void fixPermissions(XML mf) { private void writeBlankManifest(final File xmlFile, final int appComp) { - File xmlTemplate = new File(modeFolder, "templates/" + MANIFEST_TEMPLATE[appComp]); - + File xmlTemplate = new File(modeFolder, "templates/" + MANIFEST_TEMPLATE[appComp]); HashMap replaceMap = new HashMap(); - if (appComp == AndroidBuild.APP) { - replaceMap.put("@@min_sdk@@", AndroidBuild.MIN_SDK_APP); - } else if (appComp == AndroidBuild.WALLPAPER) { - replaceMap.put("@@min_sdk@@", AndroidBuild.MIN_SDK_WALLPAPER); - } else if (appComp == AndroidBuild.WATCHFACE) { - replaceMap.put("@@min_sdk@@", AndroidBuild.MIN_SDK_WATCHFACE); - } else if (appComp == AndroidBuild.VR) { - replaceMap.put("@@min_sdk@@", AndroidBuild.MIN_SDK_VR); - } else if (appComp == AndroidBuild.AR) { - replaceMap.put("@@min_sdk@@", AndroidBuild.MIN_SDK_AR); - } - - AndroidUtil.createFileFromTemplate(xmlTemplate, xmlFile, replaceMap); + AndroidUtil.createFileFromTemplate(xmlTemplate, xmlFile, replaceMap); } @@ -345,15 +323,37 @@ protected void load(boolean forceNew) { if (manifestFile.exists()) { try { xml = new XML(manifestFile); - + + boolean saveOld = false; + XML app = xml.getChild("application"); String icon = app.getString("android:icon"); if (icon.equals("@drawable/icon")) { // Manifest file generated with older version of the mode, replace icon and save app.setString("android:icon", "@mipmap/ic_launcher"); - if (!forceNew) save(); - } - + saveOld = true; + } + + XML activity = app.getChild("activity"); + XML service = app.getChild("service"); + if (activity != null && activity.getString("android:name").equals(".MainActivity")) { + addExportedAttrib(activity); + saveOld = true; + } + if (service != null && service.getString("android:name").equals(".MainService")) { + addExportedAttrib(service); + saveOld = true; + } + + XML usesSDK = xml.getChild("uses-sdk"); + if (usesSDK != null) { + // Manifest file generated with older version of the mode, uses-sdk is no longer needed in manifest + xml.removeChild(usesSDK); + saveOld = true; + } + + if (saveOld && !forceNew) save(); + } catch (Exception e) { e.printStackTrace(); System.err.println("Problem reading AndroidManifest.xml, creating a new version"); @@ -416,6 +416,13 @@ protected void load(boolean forceNew) { } } + protected void addExportedAttrib(XML child) { + if (!child.hasAttribute("android:exported")) { + // Manifest file generated with older version of the mode, missing android:exported attributed + child.setString("android:exported", "true"); + } + } + protected void save() { save(getManifestFile()); } diff --git a/processing/mode/src/processing/mode/android/Pair.java b/processing/mode/src/processing/mode/android/Pair.java new file mode 100644 index 000000000..04ef7ea81 --- /dev/null +++ b/processing/mode/src/processing/mode/android/Pair.java @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2016 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License 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 License for the specific language governing permissions and + * limitations under the License. + */ + + package processing.mode.android; + +/** + * Pair of two elements. + */ +public final class Pair { + private final A mFirst; + private final B mSecond; + private Pair(A first, B second) { + mFirst = first; + mSecond = second; + } + public static Pair create(A first, B second) { + return new Pair(first, second); + } + public A getFirst() { + return mFirst; + } + public B getSecond() { + return mSecond; + } + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((mFirst == null) ? 0 : mFirst.hashCode()); + result = prime * result + ((mSecond == null) ? 0 : mSecond.hashCode()); + return result; + } + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + @SuppressWarnings("rawtypes") + Pair other = (Pair) obj; + if (mFirst == null) { + if (other.mFirst != null) { + return false; + } + } else if (!mFirst.equals(other.mFirst)) { + return false; + } + if (mSecond == null) { + if (other.mSecond != null) { + return false; + } + } else if (!mSecond.equals(other.mSecond)) { + return false; + } + return true; + } +} \ No newline at end of file diff --git a/mode/src/processing/mode/android/Permissions.java b/processing/mode/src/processing/mode/android/Permissions.java similarity index 59% rename from mode/src/processing/mode/android/Permissions.java rename to processing/mode/src/processing/mode/android/Permissions.java index 83a02f928..10b80f98f 100644 --- a/mode/src/processing/mode/android/Permissions.java +++ b/processing/mode/src/processing/mode/android/Permissions.java @@ -252,9 +252,11 @@ public String getMenuTitle() { static final String[] listing = { "ACCEPT_HANDOVER", "Allows a calling app to continue a call which was started in another app.", "ACCESS_BACKGROUND_LOCATION", "Allows an app to access location in the background.", + "ACCESS_BLOBS_ACROSS_USERS", "Allows an application to access data blobs across users.", "ACCESS_CHECKIN_PROPERTIES", "Allows read/write access to the \"properties\" table in the checkin database, to change values that get uploaded.", "ACCESS_COARSE_LOCATION", "Allows an app to access approximate location.", "ACCESS_FINE_LOCATION", "Allows an app to access precise location.", + "ACCESS_HIDDEN_PROFILES", "Allows applications to access profiles with ACCESS_HIDDEN_PROFILES user property", "ACCESS_LOCATION_EXTRA_COMMANDS", "Allows an application to access extra location provider commands.", "ACCESS_MEDIA_LOCATION", "Allows an application to access any geographic locations persisted in the user's shared collection.", "ACCESS_NETWORK_STATE", "Allows applications to access information about networks.", @@ -274,6 +276,7 @@ public String getMenuTitle() { "BIND_COMPANION_DEVICE_SERVICE", "Must be required by any CompanionDeviceService s to ensure that only the system can bind to it.", "BIND_CONDITION_PROVIDER_SERVICE", "Must be required by a ConditionProviderService , to ensure that only the system can bind to it.", "BIND_CONTROLS", "Allows SystemUI to request third party controls.", + "BIND_CREDENTIAL_PROVIDER_SERVICE", "Must be required by a CredentialProviderService to ensure that only the system can bind to it.", "BIND_DEVICE_ADMIN", "Must be required by device administration receiver, to ensure that only the system can interact with it.", "BIND_DREAM_SERVICE", "Must be required by an DreamService , to ensure that only the system can bind to it.", "BIND_INCALL_SERVICE", "Must be required by a InCallService , to ensure that only the system can bind to it.", @@ -289,6 +292,7 @@ public String getMenuTitle() { "BIND_TELECOM_CONNECTION_SERVICE", "Must be required by a ConnectionService , to ensure that only the system can bind to it.", "BIND_TEXT_SERVICE", "Must be required by a TextService (e.g. SpellCheckerService) to ensure that only the system can bind to it.", "BIND_TV_INPUT", "Must be required by a TvInputService to ensure that only the system can bind to it.", + "BIND_TV_INTERACTIVE_APP", "Must be required by a TvInteractiveAppService to ensure that only the system can bind to it.", "BIND_VISUAL_VOICEMAIL_SERVICE", "Must be required by a link VisualVoicemailService to ensure that only the system can bind to it.", "BIND_VOICE_INTERACTION", "Must be required by a VoiceInteractionService , to ensure that only the system can bind to it.", "BIND_VPN_SERVICE", "Must be required by a VpnService , to ensure that only the system can bind to it.", @@ -296,10 +300,12 @@ public String getMenuTitle() { "BIND_WALLPAPER", "Must be required by a WallpaperService , to ensure that only the system can bind to it.", "BLUETOOTH", "Allows applications to connect to paired bluetooth devices.", "BLUETOOTH_ADMIN", "Allows applications to discover and pair bluetooth devices.", + "BLUETOOTH_ADVERTISE", "Required to be able to advertise to nearby Bluetooth devices.", "BLUETOOTH_CONNECT", "Required to be able to connect to paired Bluetooth devices.", "BLUETOOTH_PRIVILEGED", "Allows applications to pair bluetooth devices without user interaction, and to allow or disallow phonebook access or message access.", "BLUETOOTH_SCAN", "Required to be able to discover and pair nearby Bluetooth devices.", "BODY_SENSORS", "Allows an application to access data from sensors that the user uses to measure what is happening inside their body, such as heart rate.", + "BODY_SENSORS_BACKGROUND", "Allows an application to access data from sensors that the user uses to measure what is happening inside their body, such as heart rate.", "BROADCAST_PACKAGE_REMOVED", "Allows an application to broadcast a notification that an application package has been removed.", "BROADCAST_SMS", "Allows an application to broadcast an SMS receipt notification.", "BROADCAST_STICKY", "Allows an application to broadcast sticky intents.", @@ -315,15 +321,37 @@ public String getMenuTitle() { "CHANGE_WIFI_MULTICAST_STATE", "Allows applications to enter Wi-Fi Multicast mode.", "CHANGE_WIFI_STATE", "Allows applications to change Wi-Fi connectivity state.", "CLEAR_APP_CACHE", "Allows an application to clear the caches of all installed applications on the device.", + "CONFIGURE_WIFI_DISPLAY", "Allows an application to configure and connect to Wifi displays", "CONTROL_LOCATION_UPDATES", "Allows enabling/disabling location update notifications from the radio.", + "CREDENTIAL_MANAGER_QUERY_CANDIDATE_CREDENTIALS", "Allows a browser to invoke the set of query apis to get metadata about credential candidates prepared during the CredentialManager.prepareGetCredential API.", + "CREDENTIAL_MANAGER_SET_ALLOWED_PROVIDERS", "Allows specifying candidate credential providers to be queried in Credential Manager get flows, or to be preferred as a default in the Credential Manager create flows.", + "CREDENTIAL_MANAGER_SET_ORIGIN", "Allows a browser to invoke credential manager APIs on behalf of another RP.", "DELETE_CACHE_FILES", "Old permission for deleting an app's cache files, no longer used, but signals for us to quietly ignore calls instead of throwing an exception.", "DELETE_PACKAGES", "Allows an application to delete packages.", + "DELIVER_COMPANION_MESSAGES", "Allows an application to deliver companion messages to system", + "DETECT_SCREEN_CAPTURE", "Allows an application to get notified when a screen capture of its windows is attempted.", + "DETECT_SCREEN_RECORDING", "Allows an application to get notified when it is being recorded.", "DIAGNOSTIC", "Allows applications to RW to diagnostic resources.", "DISABLE_KEYGUARD", "Allows applications to disable the keyguard if it is not secure.", "DUMP", "Allows an application to retrieve state dump information from system services.", + "ENFORCE_UPDATE_OWNERSHIP", "Allows an application to indicate via PackageInstaller.SessionParams.setRequestUpdateOwnership(boolean) that it has the intention of becoming the update owner.", + "EXECUTE_APP_ACTION", "Allows an assistive application to perform actions on behalf of users inside of applications.", "EXPAND_STATUS_BAR", "Allows an application to expand or collapse the status bar.", "FACTORY_TEST", "Run as a manufacturer test application, running as the root user.", "FOREGROUND_SERVICE", "Allows a regular application to use Service.startForeground .", + "FOREGROUND_SERVICE_CAMERA", "Allows a regular application to use Service.startForeground with the type \"camera\".", + "FOREGROUND_SERVICE_CONNECTED_DEVICE", "Allows a regular application to use Service.startForeground with the type \"connectedDevice\".", + "FOREGROUND_SERVICE_DATA_SYNC", "Allows a regular application to use Service.startForeground with the type \"dataSync\".", + "FOREGROUND_SERVICE_HEALTH", "Allows a regular application to use Service.startForeground with the type \"health\".", + "FOREGROUND_SERVICE_LOCATION", "Allows a regular application to use Service.startForeground with the type \"location\".", + "FOREGROUND_SERVICE_MEDIA_PLAYBACK", "Allows a regular application to use Service.startForeground with the type \"mediaPlayback\".", + "FOREGROUND_SERVICE_MEDIA_PROCESSING", "Allows a regular application to use Service.startForeground with the type \"mediaProcessing\".", + "FOREGROUND_SERVICE_MEDIA_PROJECTION", "Allows a regular application to use Service.startForeground with the type \"mediaProjection\".", + "FOREGROUND_SERVICE_MICROPHONE", "Allows a regular application to use Service.startForeground with the type \"microphone\".", + "FOREGROUND_SERVICE_PHONE_CALL", "Allows a regular application to use Service.startForeground with the type \"phoneCall\".", + "FOREGROUND_SERVICE_REMOTE_MESSAGING", "Allows a regular application to use Service.startForeground with the type \"remoteMessaging\".", + "FOREGROUND_SERVICE_SPECIAL_USE", "Allows a regular application to use Service.startForeground with the type \"specialUse\".", + "FOREGROUND_SERVICE_SYSTEM_EXEMPTED", "Allows a regular application to use Service.startForeground with the type \"systemExempted\".", "GET_ACCOUNTS", "Allows access to the list of accounts in the Accounts Service.", "GET_ACCOUNTS_PRIVILEGED", "Allows access to the list of accounts in the Accounts Service.", "GET_PACKAGE_SIZE", "Allows an application to find out the space used by any package.", @@ -337,29 +365,130 @@ public String getMenuTitle() { "INTERACT_ACROSS_PROFILES", "Allows interaction across profiles in the same profile group.", "INTERNET", "Allows applications to open network sockets.", "KILL_BACKGROUND_PROCESSES", "Allows an application to call ActivityManager.killBackgroundProcesses(String) .", + "LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE", "Allows an application to capture screen content to perform a screenshot using the intent action Intent.ACTION_LAUNCH_CAPTURE_CONTENT_ACTIVITY_FOR_NOTE .", + "LAUNCH_MULTI_PANE_SETTINGS_DEEP_LINK", "An application needs this permission for Settings.ACTION_SETTINGS_EMBED_DEEP_LINK_ACTIVITY to show its Activity embedded in Settings app.", "LOADER_USAGE_STATS", "Allows a data loader to read a package's access logs.", "LOCATION_HARDWARE", "Allows an application to use location features in hardware, such as the geofencing api.", + "MANAGE_DEVICE_LOCK_STATE", "Allows financed device kiosk apps to perform actions on the Device Lock service", + "MANAGE_DEVICE_POLICY_ACCESSIBILITY", "Allows an application to manage policy related to accessibility.", + "MANAGE_DEVICE_POLICY_ACCOUNT_MANAGEMENT", "Allows an application to set policy related to account management.", + "MANAGE_DEVICE_POLICY_ACROSS_USERS", "Allows an application to set device policies outside the current user that are required for securing device ownership without accessing user data.", + "MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL", "Allows an application to set device policies outside the current user.", + "MANAGE_DEVICE_POLICY_ACROSS_USERS_SECURITY_CRITICAL", "Allows an application to set device policies outside the current user that are critical for securing data within the current user.", + "MANAGE_DEVICE_POLICY_AIRPLANE_MODE", "Allows an application to set policy related to airplane mode.", + "MANAGE_DEVICE_POLICY_APPS_CONTROL", "Allows an application to manage policy regarding modifying applications.", + "MANAGE_DEVICE_POLICY_APP_RESTRICTIONS", "Allows an application to manage application restrictions.", + "MANAGE_DEVICE_POLICY_APP_USER_DATA", "Allows an application to manage policy related to application user data.", + "MANAGE_DEVICE_POLICY_ASSIST_CONTENT", "Allows an application to set policy related to sending assist content to a privileged app such as the Assistant app.", + "MANAGE_DEVICE_POLICY_AUDIO_OUTPUT", "Allows an application to set policy related to audio output.", + "MANAGE_DEVICE_POLICY_AUTOFILL", "Allows an application to set policy related to autofill.", + "MANAGE_DEVICE_POLICY_BACKUP_SERVICE", "Allows an application to manage backup service policy.", + "MANAGE_DEVICE_POLICY_BLOCK_UNINSTALL", "Allows an application to manage policy related to block package uninstallation.", + "MANAGE_DEVICE_POLICY_BLUETOOTH", "Allows an application to set policy related to bluetooth.", + "MANAGE_DEVICE_POLICY_BUGREPORT", "Allows an application to request bugreports with user consent.", + "MANAGE_DEVICE_POLICY_CALLS", "Allows an application to manage calling policy.", + "MANAGE_DEVICE_POLICY_CAMERA", "Allows an application to set policy related to restricting a user's ability to use or enable and disable the camera.", + "MANAGE_DEVICE_POLICY_CAMERA_TOGGLE", "Allows an application to manage policy related to camera toggle.", + "MANAGE_DEVICE_POLICY_CERTIFICATES", "Allows an application to set policy related to certificates.", + "MANAGE_DEVICE_POLICY_COMMON_CRITERIA_MODE", "Allows an application to manage policy related to common criteria mode.", + "MANAGE_DEVICE_POLICY_CONTENT_PROTECTION", "Allows an application to manage policy related to content protection.", + "MANAGE_DEVICE_POLICY_DEBUGGING_FEATURES", "Allows an application to manage debugging features policy.", + "MANAGE_DEVICE_POLICY_DEFAULT_SMS", "Allows an application to set policy related to the default sms application.", + "MANAGE_DEVICE_POLICY_DEVICE_IDENTIFIERS", "Allows an application to manage policy related to device identifiers.", + "MANAGE_DEVICE_POLICY_DISPLAY", "Allows an application to set policy related to the display.", + "MANAGE_DEVICE_POLICY_FACTORY_RESET", "Allows an application to set policy related to factory reset.", + "MANAGE_DEVICE_POLICY_FUN", "Allows an application to set policy related to fun.", + "MANAGE_DEVICE_POLICY_INPUT_METHODS", "Allows an application to set policy related to input methods.", + "MANAGE_DEVICE_POLICY_INSTALL_UNKNOWN_SOURCES", "Allows an application to manage installing from unknown sources policy.", + "MANAGE_DEVICE_POLICY_KEEP_UNINSTALLED_PACKAGES", "Allows an application to set policy related to keeping uninstalled packages.", + "MANAGE_DEVICE_POLICY_KEYGUARD", "Allows an application to manage policy related to keyguard.", + "MANAGE_DEVICE_POLICY_LOCALE", "Allows an application to set policy related to locale.", + "MANAGE_DEVICE_POLICY_LOCATION", "Allows an application to set policy related to location.", + "MANAGE_DEVICE_POLICY_LOCK", "Allows an application to lock a profile or the device with the appropriate cross-user permission.", + "MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS", "Allows an application to set policy related to lock credentials.", + "MANAGE_DEVICE_POLICY_LOCK_TASK", "Allows an application to manage lock task policy.", + "MANAGE_DEVICE_POLICY_MANAGED_SUBSCRIPTIONS", "Allows an application to set policy related to subscriptions downloaded by an admin.", + "MANAGE_DEVICE_POLICY_METERED_DATA", "Allows an application to manage policy related to metered data.", + "MANAGE_DEVICE_POLICY_MICROPHONE", "Allows an application to set policy related to restricting a user's ability to use or enable and disable the microphone.", + "MANAGE_DEVICE_POLICY_MICROPHONE_TOGGLE", "Allows an application to manage policy related to microphone toggle.", + "MANAGE_DEVICE_POLICY_MOBILE_NETWORK", "Allows an application to set policy related to mobile networks.", + "MANAGE_DEVICE_POLICY_MODIFY_USERS", "Allows an application to manage policy preventing users from modifying users.", + "MANAGE_DEVICE_POLICY_MTE", "Allows an application to manage policy related to the Memory Tagging Extension (MTE).", + "MANAGE_DEVICE_POLICY_NEARBY_COMMUNICATION", "Allows an application to set policy related to nearby communications (e.g. Beam and nearby streaming).", + "MANAGE_DEVICE_POLICY_NETWORK_LOGGING", "Allows an application to set policy related to network logging.", + "MANAGE_DEVICE_POLICY_ORGANIZATION_IDENTITY", "Allows an application to manage the identity of the managing organization.", + "MANAGE_DEVICE_POLICY_OVERRIDE_APN", "Allows an application to set policy related to override APNs.", + "MANAGE_DEVICE_POLICY_PACKAGE_STATE", "Allows an application to set policy related to hiding and suspending packages.", + "MANAGE_DEVICE_POLICY_PHYSICAL_MEDIA", "Allows an application to set policy related to physical media.", + "MANAGE_DEVICE_POLICY_PRINTING", "Allows an application to set policy related to printing.", + "MANAGE_DEVICE_POLICY_PRIVATE_DNS", "Allows an application to set policy related to private DNS.", + "MANAGE_DEVICE_POLICY_PROFILES", "Allows an application to set policy related to profiles.", + "MANAGE_DEVICE_POLICY_PROFILE_INTERACTION", "Allows an application to set policy related to interacting with profiles (e.g. Disallowing cross-profile copy and paste).", + "MANAGE_DEVICE_POLICY_PROXY", "Allows an application to set a network-independent global HTTP proxy.", + "MANAGE_DEVICE_POLICY_QUERY_SYSTEM_UPDATES", "Allows an application query system updates.", + "MANAGE_DEVICE_POLICY_RESET_PASSWORD", "Allows an application to force set a new device unlock password or a managed profile challenge on current user.", + "MANAGE_DEVICE_POLICY_RESTRICT_PRIVATE_DNS", "Allows an application to set policy related to restricting the user from configuring private DNS.", + "MANAGE_DEVICE_POLICY_RUNTIME_PERMISSIONS", "Allows an application to set the grant state of runtime permissions on packages.", + "MANAGE_DEVICE_POLICY_RUN_IN_BACKGROUND", "Allows an application to set policy related to users running in the background.", + "MANAGE_DEVICE_POLICY_SAFE_BOOT", "Allows an application to manage safe boot policy.", + "MANAGE_DEVICE_POLICY_SCREEN_CAPTURE", "Allows an application to set policy related to screen capture.", + "MANAGE_DEVICE_POLICY_SCREEN_CONTENT", "Allows an application to set policy related to the usage of the contents of the screen.", + "MANAGE_DEVICE_POLICY_SECURITY_LOGGING", "Allows an application to set policy related to security logging.", + "MANAGE_DEVICE_POLICY_SETTINGS", "Allows an application to set policy related to settings.", + "MANAGE_DEVICE_POLICY_SMS", "Allows an application to set policy related to sms.", + "MANAGE_DEVICE_POLICY_STATUS_BAR", "Allows an application to set policy related to the status bar.", + "MANAGE_DEVICE_POLICY_SUPPORT_MESSAGE", "Allows an application to set support messages for when a user action is affected by an active policy.", + "MANAGE_DEVICE_POLICY_SUSPEND_PERSONAL_APPS", "Allows an application to set policy related to suspending personal apps.", + "MANAGE_DEVICE_POLICY_SYSTEM_APPS", "Allows an application to manage policy related to system apps.", + "MANAGE_DEVICE_POLICY_SYSTEM_DIALOGS", "Allows an application to set policy related to system dialogs.", + "MANAGE_DEVICE_POLICY_SYSTEM_UPDATES", "Allows an application to set policy related to system updates.", + "MANAGE_DEVICE_POLICY_TIME", "Allows an application to manage device policy relating to time.", + "MANAGE_DEVICE_POLICY_USB_DATA_SIGNALLING", "Allows an application to set policy related to usb data signalling.", + "MANAGE_DEVICE_POLICY_USB_FILE_TRANSFER", "Allows an application to set policy related to usb file transfers.", + "MANAGE_DEVICE_POLICY_USERS", "Allows an application to set policy related to users.", + "MANAGE_DEVICE_POLICY_VPN", "Allows an application to set policy related to VPNs.", + "MANAGE_DEVICE_POLICY_WALLPAPER", "Allows an application to set policy related to the wallpaper.", + "MANAGE_DEVICE_POLICY_WIFI", "Allows an application to set policy related to Wifi.", + "MANAGE_DEVICE_POLICY_WINDOWS", "Allows an application to set policy related to windows.", + "MANAGE_DEVICE_POLICY_WIPE_DATA", "Allows an application to manage policy related to wiping data.", "MANAGE_DOCUMENTS", "Allows an application to manage access to documents, usually as part of a document picker.", "MANAGE_EXTERNAL_STORAGE", "Allows an application a broad access to external storage in scoped storage.", "MANAGE_MEDIA", "Allows an application to modify and delete media files on this device or any connected storage device without user confirmation.", "MANAGE_ONGOING_CALLS", "Allows to query ongoing call details and manage ongoing calls", "MANAGE_OWN_CALLS", "Allows a calling application which manages its own calls through the self-managed ConnectionService APIs.", + "MANAGE_WIFI_INTERFACES", "Allows applications to get notified when a Wi-Fi interface request cannot be satisfied without tearing down one or more other interfaces, and provide a decision whether to approve the request or reject it.", + "MANAGE_WIFI_NETWORK_SELECTION", "This permission is used to let OEMs grant their trusted app access to a subset of privileged wifi APIs to improve wifi performance.", "MASTER_CLEAR", "Not for use by third-party applications.", "MEDIA_CONTENT_CONTROL", "Allows an application to know what content is playing and control its playback.", + "MEDIA_ROUTING_CONTROL", "Allows an application to control the routing of media apps.", "MODIFY_AUDIO_SETTINGS", "Allows an application to modify global audio settings.", "MODIFY_PHONE_STATE", "Allows modification of the telephony state - power on, mmi, etc.", "MOUNT_FORMAT_FILESYSTEMS", "Allows formatting file systems for removable storage.", "MOUNT_UNMOUNT_FILESYSTEMS", "Allows mounting and unmounting file systems for removable storage.", + "NEARBY_WIFI_DEVICES", "Required to be able to advertise and connect to nearby devices via Wi-Fi.", "NFC", "Allows applications to perform I/O operations over NFC.", "NFC_PREFERRED_PAYMENT_INFO", "Allows applications to receive NFC preferred payment service information.", "NFC_TRANSACTION_EVENT", "Allows applications to receive NFC transaction events.", + "OVERRIDE_WIFI_CONFIG", "Allows an application to modify any wifi configuration, even if created by another application.", "PACKAGE_USAGE_STATS", "Allows an application to collect component usage statistics", + "POST_NOTIFICATIONS", "Allows an app to post notifications", + "PROVIDE_OWN_AUTOFILL_SUGGESTIONS", "Allows an application to display its suggestions using the autofill framework.", + "PROVIDE_REMOTE_CREDENTIALS", "Allows an application to be able to store and retrieve credentials from a remote device.", "QUERY_ALL_PACKAGES", "Allows query of any normal app on the device, regardless of manifest declarations.", + "READ_ASSISTANT_APP_SEARCH_DATA", "Allows an application to query over global data in AppSearch that's visible to the ASSISTANT role.", + "READ_BASIC_PHONE_STATE", "Allows read only access to phone state with a non dangerous permission, including the information like cellular network type, software version.", "READ_CALENDAR", "Allows an application to read the user's calendar data.", "READ_CALL_LOG", "Allows an application to read the user's call log.", "READ_CONTACTS", "Allows an application to read the user's contacts data.", + "READ_DROPBOX_DATA", "Allows an application to access the data in Dropbox.", "READ_EXTERNAL_STORAGE", "Allows an application to read from external storage.", + "READ_HOME_APP_SEARCH_DATA", "Allows an application to query over global data in AppSearch that's visible to the HOME role.", "READ_LOGS", "Allows an application to read the low-level system log files.", + "READ_MEDIA_AUDIO", "Allows an application to read audio files from external storage.", + "READ_MEDIA_IMAGES", "Allows an application to read image files from external storage.", + "READ_MEDIA_VIDEO", "Allows an application to read video files from external storage.", + "READ_MEDIA_VISUAL_USER_SELECTED", "Allows an application to read image or video files from external storage that a user has selected via the permission prompt photo picker.", + "READ_NEARBY_STREAMING_POLICY", "Allows an application to read nearby streaming policy.", "READ_PHONE_NUMBERS", "Allows read access to the device's phone number(s).", "READ_PHONE_STATE", "Allows read only access to phone state, including the current cellular network information, the status of any ongoing calls, and a list of any PhoneAccount s registered on the device.", "READ_PRECISE_PHONE_STATE", "Allows read only access to precise phone state.", @@ -374,20 +503,29 @@ public String getMenuTitle() { "RECEIVE_WAP_PUSH", "Allows an application to receive WAP push messages.", "RECORD_AUDIO", "Allows an application to record audio.", "REORDER_TASKS", "Allows an application to change the Z-order of tasks.", + "REQUEST_COMPANION_PROFILE_APP_STREAMING", "Allows application to request to be associated with a virtual display capable of streaming Android applications ( AssociationRequest.DEVICE_PROFILE_APP_STREAMING ) by CompanionDeviceManager .", + "REQUEST_COMPANION_PROFILE_AUTOMOTIVE_PROJECTION", "Allows application to request to be associated with a vehicle head unit capable of automotive projection ( AssociationRequest.DEVICE_PROFILE_AUTOMOTIVE_PROJECTION ) by CompanionDeviceManager .", + "REQUEST_COMPANION_PROFILE_COMPUTER", "Allows application to request to be associated with a computer to share functionality and/or data with other devices, such as notifications, photos and media ( AssociationRequest.DEVICE_PROFILE_COMPUTER ) by CompanionDeviceManager .", + "REQUEST_COMPANION_PROFILE_GLASSES", "Allows app to request to be associated with a device via CompanionDeviceManager as \"glasses\"", + "REQUEST_COMPANION_PROFILE_NEARBY_DEVICE_STREAMING", "Allows application to request to stream content from an Android host to a nearby device ( AssociationRequest.DEVICE_PROFILE_NEARBY_DEVICE_STREAMING ) by CompanionDeviceManager .", "REQUEST_COMPANION_PROFILE_WATCH", "Allows app to request to be associated with a device via CompanionDeviceManager as a \"watch\"", "REQUEST_COMPANION_RUN_IN_BACKGROUND", "Allows a companion app to run in the background.", + "REQUEST_COMPANION_SELF_MANAGED", "Allows an application to create a \"self-managed\" association.", + "REQUEST_COMPANION_START_FOREGROUND_SERVICES_FROM_BACKGROUND", "Allows a companion app to start a foreground service from the background.", "REQUEST_COMPANION_USE_DATA_IN_BACKGROUND", "Allows a companion app to use data in the background.", "REQUEST_DELETE_PACKAGES", "Allows an application to request deleting packages.", "REQUEST_IGNORE_BATTERY_OPTIMIZATIONS", "Permission an application must hold in order to use Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS .", "REQUEST_INSTALL_PACKAGES", "Allows an application to request installing packages.", "REQUEST_OBSERVE_COMPANION_DEVICE_PRESENCE", "Allows an application to subscribe to notifications about the presence status change of their associated companion device", "REQUEST_PASSWORD_COMPLEXITY", "Allows an application to request the screen lock complexity and prompt users to update the screen lock to a certain complexity level.", - "SCHEDULE_EXACT_ALARM", "Allows an app to use exact alarm scheduling APIs to perform timing sensitive background work.", + "RUN_USER_INITIATED_JOBS", "Allows applications to use the user-initiated jobs API.", + "SCHEDULE_EXACT_ALARM", "Allows applications to use exact alarm APIs.", "SEND_RESPOND_VIA_MESSAGE", "Allows an application (Phone) to send a request to other applications to handle the respond-via-message action during incoming calls.", "SEND_SMS", "Allows an application to send SMS messages.", "SET_ALARM", "Allows an application to broadcast an Intent to set an alarm for the user.", "SET_ALWAYS_FINISH", "Allows an application to control whether activities are immediately finished when put in the background.", "SET_ANIMATION_SCALE", "Modify the global animation scaling factor.", + "SET_BIOMETRIC_DIALOG_ADVANCED", "Allows an application to set the advanced features on BiometricDialog (SystemUI), including logo, logo description, and content view with more options button.", "SET_DEBUG_APP", "Configure an application for debugging.", "SET_PROCESS_LIMIT", "Allows an application to set the maximum number of (not needed) application processes that can be running.", "SET_TIME", "Allows applications to set the system time directly.", @@ -395,21 +533,27 @@ public String getMenuTitle() { "SET_WALLPAPER", "Allows applications to set the wallpaper.", "SET_WALLPAPER_HINTS", "Allows applications to set the wallpaper hints.", "SIGNAL_PERSISTENT_PROCESSES", "Allow an application to request that a signal be sent to all persistent processes.", - "START_FOREGROUND_SERVICES_FROM_BACKGROUND", "Allows an application to start foreground services from background, can only be granted to privileged apps or app that is SMS/EMERGENCY/SYSTEM GALLERY roles.", + "START_FOREGROUND_SERVICES_FROM_BACKGROUND", "Allows an application to start foreground services from the background at any time.", + "START_VIEW_APP_FEATURES", "Allows the holder to start the screen with a list of app features.", "START_VIEW_PERMISSION_USAGE", "Allows the holder to start the permission usage screen for an app.", "STATUS_BAR", "Allows an application to open, close, or disable the status bar and its icons.", + "SUBSCRIBE_TO_KEYGUARD_LOCKED_STATE", "Allows an application to subscribe to keyguard locked (i.e., showing) state.", "SYSTEM_ALERT_WINDOW", "Allows an app to create windows using the type WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY , shown on top of all other apps.", "TRANSMIT_IR", "Allows using the device's IR transmitter, if available.", + "TURN_SCREEN_ON", "Allows an app to turn on the screen on, e.g. with PowerManager.ACQUIRE_CAUSES_WAKEUP .", "UPDATE_DEVICE_STATS", "Allows an application to update device statistics.", + "UPDATE_PACKAGES_WITHOUT_USER_ACTION", "Allows an application to indicate via PackageInstaller.SessionParams.setRequireUserAction(int) that user action should not be required for an app update.", "USE_BIOMETRIC", "Allows an app to use device supported biometric modalities.", + "USE_EXACT_ALARM", "Allows apps to use exact alarms just like with SCHEDULE_EXACT_ALARM but without needing to request this permission from the user.", "USE_FULL_SCREEN_INTENT", "Required for apps targeting Build.VERSION_CODES.Q that want to use notification full screen intents .", "USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER", "Allows to read device identifiers and use ICC based authentication like EAP-AKA.", "USE_SIP", "Allows an application to use SIP service.", + "UWB_RANGING", "Required to be able to range to devices using ultra-wideband.", "VIBRATE", "Allows access to the vibrator.", "WAKE_LOCK", "Allows using PowerManager WakeLocks to keep processor from sleeping or screen from dimming.", "WRITE_APN_SETTINGS", "Allows applications to write the apn settings and read sensitive fields of an existing apn settings like user and password.", "WRITE_CALENDAR", "Allows an application to write the user's calendar data.", - "WRITE_CALL_LOG", "Allows an application to write (but not read) the user's call log data.", + "WRITE_CALL_LOG", "Allows an application to write and read the user's call log data.", "WRITE_CONTACTS", "Allows an application to write the user's contacts data.", "WRITE_EXTERNAL_STORAGE", "Allows an application to write to external storage.", "WRITE_GSERVICES", "Allows an application to modify the Google service map.", @@ -430,16 +574,24 @@ public String getMenuTitle() { "ACTIVITY_RECOGNITION", "ADD_VOICEMAIL", "ANSWER_PHONE_CALLS", + "BLUETOOTH_ADVERTISE", "BLUETOOTH_CONNECT", "BLUETOOTH_SCAN", "BODY_SENSORS", + "BODY_SENSORS_BACKGROUND", "CALL_PHONE", "CAMERA", "GET_ACCOUNTS", + "NEARBY_WIFI_DEVICES", + "POST_NOTIFICATIONS", "READ_CALENDAR", "READ_CALL_LOG", "READ_CONTACTS", "READ_EXTERNAL_STORAGE", + "READ_MEDIA_AUDIO", + "READ_MEDIA_IMAGES", + "READ_MEDIA_VIDEO", + "READ_MEDIA_VISUAL_USER_SELECTED", "READ_PHONE_NUMBERS", "READ_PHONE_STATE", "READ_SMS", @@ -449,6 +601,7 @@ public String getMenuTitle() { "RECORD_AUDIO", "SEND_SMS", "USE_SIP", + "UWB_RANGING", "WRITE_CALENDAR", "WRITE_CALL_LOG", "WRITE_CONTACTS", diff --git a/processing/mode/src/processing/mode/android/RedirectStreamHandler.java b/processing/mode/src/processing/mode/android/RedirectStreamHandler.java new file mode 100644 index 000000000..933669106 --- /dev/null +++ b/processing/mode/src/processing/mode/android/RedirectStreamHandler.java @@ -0,0 +1,34 @@ +package processing.mode.android; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.PrintWriter; + + +public class RedirectStreamHandler extends Thread { + // Streams Redirection- from and to + private final InputStream input; + private final PrintWriter output; + + RedirectStreamHandler(PrintWriter output, InputStream input) { + this.input = input; + this.output = output; + start(); + } + + @Override + public void run() { + try { + BufferedReader reader = new BufferedReader(new InputStreamReader(input)); + String line; + while ((line = reader.readLine()) != null) { + // print to output line by line + output.println(line); + } + } catch (IOException ioException) { + System.out.println("I/O Redirection failure: "+ ioException.toString()); + } + } + } diff --git a/mode/src/processing/mode/android/SDKDownloader.java b/processing/mode/src/processing/mode/android/SDKDownloader.java similarity index 92% rename from mode/src/processing/mode/android/SDKDownloader.java rename to processing/mode/src/processing/mode/android/SDKDownloader.java index 6fa2d30d8..2f9312b81 100644 --- a/mode/src/processing/mode/android/SDKDownloader.java +++ b/processing/mode/src/processing/mode/android/SDKDownloader.java @@ -63,10 +63,10 @@ public class SDKDownloader extends JDialog implements PropertyChangeListener { private static final String REPOSITORY_URL = "https://dl.google.com/android/repository/"; private static final String HAXM_URL = "https://dl.google.com/android/repository/extras/intel/"; - private static final String REPOSITORY_LIST = "repository2-1.xml"; - private static final String ADDON_LIST = "addon2-1.xml"; + private static final String REPOSITORY_LIST = "repository2-3.xml"; + private static final String ADDON_LIST = "addon2-3.xml"; - public static final boolean DOWNLOAD_EMU = false; + public static final boolean DOWNLOAD_EMU_WITH_SDK = false; private JProgressBar progressBar; private JLabel downloadedTextArea; @@ -114,7 +114,7 @@ protected Object doInBackground() throws Exception { File haxmFolder = new File(extrasFolder, "intel/HAXM"); if (!haxmFolder.exists()) haxmFolder.mkdirs(); - if (DOWNLOAD_EMU) { + if (DOWNLOAD_EMU_WITH_SDK) { File emulatorFolder = new File(sdkFolder, "emulator"); if (!emulatorFolder.exists()) emulatorFolder.mkdir(); } @@ -128,14 +128,20 @@ protected Object doInBackground() throws Exception { String repositoryUrl = REPOSITORY_URL + REPOSITORY_LIST; String addonUrl = REPOSITORY_URL + ADDON_LIST; String haxmUrl = HAXM_URL + ADDON_LIST; - getMainDownloadUrls(downloadUrls, repositoryUrl, Platform.getName()); - getExtrasDownloadUrls(downloadUrls, addonUrl, Platform.getName()); - getHaxmDownloadUrl(downloadUrls, haxmUrl, Platform.getName()); + + String platformName = Platform.getName(); + System.out.println("PLATFORM NAME " + platformName); + if (platformName.equals("macos")) { + platformName = "macosx"; + } + getMainDownloadUrls(downloadUrls, repositoryUrl, platformName); + getExtrasDownloadUrls(downloadUrls, addonUrl, platformName); + getHaxmDownloadUrl(downloadUrls, haxmUrl, platformName); firePropertyChange(AndroidMode.getTextString("download_property.change_event_total"), 0, downloadUrls.totalSize); // Command-line tools File downloadedCmdLineTools = new File(tempFolder, downloadUrls.cmdlineToolsFilename); - downloadAndUnpack(downloadUrls.cmdlineToolsUrl, downloadedCmdLineTools, sdkFolder, true); + downloadAndUnpack(downloadUrls.cmdlineToolsUrl, downloadedCmdLineTools, sdkFolder); File tmpFrom = new File(sdkFolder, "cmdline-tools"); File tmpTo = new File(sdkFolder, "cmdline-tmp"); AndroidUtil.moveDir(tmpFrom, tmpTo); @@ -145,33 +151,33 @@ protected Object doInBackground() throws Exception { // Platform tools File downloadedPlatformTools = new File(tempFolder, downloadUrls.platformToolsFilename); - downloadAndUnpack(downloadUrls.platformToolsUrl, downloadedPlatformTools, sdkFolder, true); + downloadAndUnpack(downloadUrls.platformToolsUrl, downloadedPlatformTools, sdkFolder); // Build tools File downloadedBuildTools = new File(tempFolder, downloadUrls.buildToolsFilename); - downloadAndUnpack(downloadUrls.buildToolsUrl, downloadedBuildTools, buildToolsFolder, true); + downloadAndUnpack(downloadUrls.buildToolsUrl, downloadedBuildTools, buildToolsFolder); // Platform File downloadedPlatform = new File(tempFolder, downloadUrls.platformFilename); - downloadAndUnpack(downloadUrls.platformUrl, downloadedPlatform, platformsFolder, false); + downloadAndUnpack(downloadUrls.platformUrl, downloadedPlatform, platformsFolder); // USB driver - if (Platform.isWindows()) { + if (Platform.isWindows() && downloadUrls.usbDriverFilename != null) { File downloadedFolder = new File(tempFolder, downloadUrls.usbDriverFilename); - downloadAndUnpack(downloadUrls.usbDriverUrl, downloadedFolder, googleRepoFolder, false); + downloadAndUnpack(downloadUrls.usbDriverUrl, downloadedFolder, googleRepoFolder); } // HAXM - if (!Platform.isLinux()) { + if (!Platform.isLinux() && downloadUrls.haxmFilename != null) { File downloadedFolder = new File(tempFolder, downloadUrls.haxmFilename); - downloadAndUnpack(downloadUrls.haxmUrl, downloadedFolder, haxmFolder, true); + downloadAndUnpack(downloadUrls.haxmUrl, downloadedFolder, haxmFolder); } - if (DOWNLOAD_EMU) { + if (DOWNLOAD_EMU_WITH_SDK && downloadUrls.emulatorFilename != null) { // Emulator, unpacks directly to sdk folder File downloadedEmulator = new File(tempFolder, downloadUrls.emulatorFilename); - downloadAndUnpack(downloadUrls.emulatorUrl, downloadedEmulator, sdkFolder, true); - } + downloadAndUnpack(downloadUrls.emulatorUrl, downloadedEmulator, sdkFolder); + } if (Platform.isLinux() || Platform.isMacOS()) { Runtime.getRuntime().exec("chmod -R 755 " + sdkFolder.getAbsolutePath()); @@ -180,10 +186,11 @@ protected Object doInBackground() throws Exception { for (File f: tempFolder.listFiles()) f.delete(); tempFolder.delete(); - // Normalize built-tools and platform folders to android- - String actualName = platformsFolder.listFiles()[0].getName(); - renameFolder(platformsFolder, "android-" + AndroidBuild.TARGET_SDK, actualName); - actualName = buildToolsFolder.listFiles()[0].getName(); + +// String actualName = platformsFolder.listFiles()[0].getName(); +// renameFolder(platformsFolder, "android-" + AndroidBuild.TARGET_SDK, actualName); + // Rename build-tools folder to the expected name if it's not that already + String actualName = buildToolsFolder.listFiles()[0].getName(); renameFolder(buildToolsFolder, downloadUrls.buildToolsVersion, actualName); // Done, let's set the environment and load the new SDK! @@ -210,7 +217,7 @@ protected void done() { } private void downloadAndUnpack(String urlString, File saveTo, - File unpackTo, boolean setExec) throws IOException { + File unpackTo) throws IOException { URL url = null; try { url = new URL(urlString); @@ -242,11 +249,11 @@ private void downloadAndUnpack(String urlString, File saveTo, inputStream.close(); outputStream.close(); - AndroidUtil.extractFolder(saveTo, unpackTo, setExec); + AndroidUtil.extractFolder(saveTo, unpackTo); } private void getMainDownloadUrls(SDKUrlHolder urlHolder, - String repositoryUrl, String requiredHostOs) + String repositoryUrl, String requiredHostOs) throws ParserConfigurationException, IOException, SAXException, XPathException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); @@ -308,15 +315,18 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, NodeList childNodes = remotePackages.item(buildTool).getChildNodes(); NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef"); - if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) + if (!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) { continue; // Stable channel only, skip others + } NodeList revision = ((Element) childNodes).getElementsByTagName("revision"); String major = (((Element) revision.item(0)).getElementsByTagName("major")).item(0).getTextContent(); String minor = (((Element) revision.item(0)).getElementsByTagName("minor")).item(0).getTextContent(); String micro = (((Element) revision.item(0)).getElementsByTagName("micro")).item(0).getTextContent(); - if(!major.equals(AndroidBuild.TARGET_SDK)) // Allows only the latest build tools for the target platform - continue; + if (!major.equals(AndroidBuild.TARGET_SDK)) { + continue; // Allows only the latest build tools for the target platform + } + urlHolder.buildToolsVersion = major + "." + minor + "." + micro; NodeList archives = ((Element) childNodes).getElementsByTagName("archive"); @@ -354,8 +364,9 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, NodeList childNodes = remotePackages.item(tool).getChildNodes(); NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef"); - if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) - continue; // Stable channel only, skip others + if (!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) { + continue; // Stable channel only, skip others + } NodeList archives = ((Element) childNodes).getElementsByTagName("archive"); for (int i = 0; i < archives.getLength(); ++i) { @@ -381,7 +392,7 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, throw new IOException(AndroidMode.getTextString("sdk_downloader.error_cannot_find_tools")); } - if (DOWNLOAD_EMU) { + if (DOWNLOAD_EMU_WITH_SDK) { // ----------------------------------------------------------------------- // Emulator expr = xpath.compile("//remotePackage[@path=\"emulator\"]"); @@ -392,8 +403,9 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, NodeList childNodes = remotePackages.item(i).getChildNodes(); NodeList channel = ((Element) childNodes).getElementsByTagName("channelRef"); - if(!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) + if (!channel.item(0).getAttributes().item(0).getNodeValue().equals("channel-0")) { continue; //Stable channel only, skip others + } NodeList archives = ((Element) childNodes).getElementsByTagName("archive"); @@ -424,7 +436,7 @@ private void getMainDownloadUrls(SDKUrlHolder urlHolder, } private void getExtrasDownloadUrls(SDKUrlHolder urlHolder, - String repositoryUrl, String requiredHostOs) + String repositoryUrl, String requiredHostOs) throws ParserConfigurationException, IOException, SAXException, XPathException { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); DocumentBuilder db = dbf.newDocumentBuilder(); @@ -485,8 +497,9 @@ private void getHaxmDownloadUrl(SDKUrlHolder urlHolder, NodeList archive = archives.item(0).getChildNodes(); NodeList os = ((Element) archive).getElementsByTagName("host-os"); - if (!os.item(0).getTextContent().equals(requiredHostOs)) + if (!os.item(0).getTextContent().equals(requiredHostOs)) { continue; + } NodeList complete = ((Element) archive).getElementsByTagName("complete"); NodeList url = ((Element) complete.item(0)).getElementsByTagName("url"); @@ -514,8 +527,9 @@ private void parseAndSet(SDKUrlHolder urlHolder, NodeList remotePackages, String switch (packageN) { case PLATFORM_TOOLS: NodeList os = ((Element) archive).getElementsByTagName("host-os"); - if (!os.item(0).getTextContent().equals(requiredHostOs)) + if (!os.item(0).getTextContent().equals(requiredHostOs)) { continue; + } urlHolder.platformToolsFilename = url.item(0).getTextContent(); urlHolder.platformToolsUrl = REPOSITORY_URL + urlHolder.platformToolsFilename; urlHolder.totalSize += Integer.parseInt(size.item(0).getTextContent()); diff --git a/mode/src/processing/mode/android/SysImageDownloader.java b/processing/mode/src/processing/mode/android/SysImageDownloader.java similarity index 92% rename from mode/src/processing/mode/android/SysImageDownloader.java rename to processing/mode/src/processing/mode/android/SysImageDownloader.java index 3f380cca3..d665991f4 100644 --- a/mode/src/processing/mode/android/SysImageDownloader.java +++ b/processing/mode/src/processing/mode/android/SysImageDownloader.java @@ -2,18 +2,18 @@ /* Part of the Processing project - http://processing.org - + Copyright (c) 2016-21 The Processing Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. - + 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 @@ -61,10 +61,10 @@ public class SysImageDownloader extends JDialog implements PropertyChangeListene private static final String SYS_IMAGES_ARM_URL = "https://dl.google.com/android/repository/sys-img/android/"; private static final String SYS_IMAGES_PHONE_URL = "https://dl.google.com/android/repository/sys-img/google_apis/"; - private static final String SYS_IMAGES_PHONE_LIST = "sys-img2-1.xml"; + private static final String SYS_IMAGES_PHONE_LIST = "sys-img2-3.xml"; private static final String SYS_IMAGES_WEAR_URL = "https://dl.google.com/android/repository/sys-img/android-wear/"; - private static final String SYS_IMAGES_WEAR_LIST = "sys-img2-1.xml"; + private static final String SYS_IMAGES_WEAR_LIST = "sys-img2-3.xml"; private static final String EMULATOR_GUIDE_URL = "https://developer.android.com/studio/run/emulator-acceleration.html"; @@ -139,26 +139,25 @@ protected Object doInBackground() throws Exception { firePropertyChange(AndroidMode.getTextString("download_property.change_event_total"), 0, downloadUrls.totalSize); totalSize = downloadUrls.totalSize; + String level = AVD.getTargetSDK(wear, abi); + if (wear) { // wear system images File downloadedSysImgWear = new File(tempFolder, downloadUrls.sysImgWearFilename); - File tmp = new File(sysImgFolder, "android-" + AndroidBuild.TARGET_SDK); + File tmp = new File(sysImgFolder, "android-" + level); if (!tmp.exists()) tmp.mkdir(); File sysImgWearFinalFolder = new File(tmp, downloadUrls.sysImgWearTag); if (!sysImgWearFinalFolder.exists()) sysImgWearFinalFolder.mkdir(); - downloadAndUnpack(downloadUrls.sysImgWearUrl, downloadedSysImgWear, sysImgWearFinalFolder, false); + downloadAndUnpack(downloadUrls.sysImgWearUrl, downloadedSysImgWear, sysImgWearFinalFolder); fixSourceProperties(sysImgWearFinalFolder); } else { // mobile system images - File downloadedSysImg = new File(tempFolder, downloadUrls.sysImgFilename); - - String level = abi.equals("arm") ? AVD.TARGET_SDK_ARM : AndroidBuild.TARGET_SDK; - File tmp = new File(sysImgFolder, "android-" + level); - + File downloadedSysImg = new File(tempFolder, downloadUrls.sysImgFilename); + File tmp = new File(sysImgFolder, "android-" + level); if (!tmp.exists()) tmp.mkdir(); File sysImgFinalFolder = new File(tmp, downloadUrls.sysImgTag); if (!sysImgFinalFolder.exists()) sysImgFinalFolder.mkdir(); - downloadAndUnpack(downloadUrls.sysImgUrl, downloadedSysImg, sysImgFinalFolder, false); + downloadAndUnpack(downloadUrls.sysImgUrl, downloadedSysImg, sysImgFinalFolder); fixSourceProperties(sysImgFinalFolder); } @@ -194,7 +193,7 @@ protected void done() { } private void downloadAndUnpack(String urlString, File saveTo, - File unpackTo, boolean setExec) throws IOException { + File unpackTo) throws IOException { URL url = null; try { url = new URL(urlString); @@ -219,7 +218,7 @@ private void downloadAndUnpack(String urlString, File saveTo, inputStream.close(); outputStream.close(); - AndroidUtil.extractFolder(saveTo, unpackTo, setExec); + AndroidUtil.extractFolder(saveTo, unpackTo); } // For some reason the source.properties file includes Addon entries, @@ -253,18 +252,23 @@ private void getDownloadUrls(UrlHolder urlHolder, XPathExpression expr; NodeList remotePackages; - if (abi.equals("arm")) - expr = xpath.compile("//remotePackage[contains(@path, '" + AVD.TARGET_SDK_ARM + "')" + - "and contains(@path, \"armeabi-v7a\")]"); - else - expr = xpath.compile("//remotePackage[contains(@path, '" + AndroidBuild.TARGET_SDK + "')" + - "and contains(@path, \"x86\")]"); + String targetSDK = AVD.getTargetSDK(wear, abi); + if (abi.equals("arm")) { + expr = xpath.compile("//remotePackage[contains(@path, '" + targetSDK + "')" + + "and contains(@path, \"armeabi-v7a\")]"); + } if (abi.equals("arm64-v8a")) { + expr = xpath.compile("//remotePackage[contains(@path, '" + targetSDK + "')" + + "and contains(@path, \"arm64-v8a\")]"); + } else { + expr = xpath.compile("//remotePackage[contains(@path, '" + targetSDK + "')" + + "and contains(@path, \"x86\")]"); + } if (wear) { Document docSysImgWear = db.parse(new URL(repositoryUrl).openStream()); + remotePackages = (NodeList) expr.evaluate(docSysImgWear, XPathConstants.NODESET); NodeList childNodes = remotePackages.item(0).getChildNodes(); - NodeList typeDetails = ((Element) childNodes).getElementsByTagName("type-details"); NodeList tag = ((Element) typeDetails.item(0)).getElementsByTagName("tag"); NodeList id = ((Element) tag.item(0)).getElementsByTagName("id"); @@ -386,7 +390,8 @@ public void run() { // Either there was no image architecture selected, or the default was set. // In this case, we give the user the option to choose between ARM and x86 - final int result; + int result = 0; + boolean arm64 = false; // PROCESSOR_IDENTIFIER is only defined on Windows. For cross-platform CPU // info, in the future we could use OSHI: https://github.com/oshi/oshi String procId = System.getenv("PROCESSOR_IDENTIFIER"); @@ -399,14 +404,22 @@ public void run() { result = JOptionPane.NO_OPTION; } } else if (Platform.isMacOS()) { - // Macs only have Intel CPUs, so we also go for the x86 abi - result = JOptionPane.YES_OPTION; + if (Platform.getNativeArch().equals("aarch64")) { + // Apple Silicon Mac, so we go for the arm64 abi + arm64 = true; + result = JOptionPane.NO_OPTION; + } else { + // Intel Mac, so we go for the x86 abi + result = JOptionPane.YES_OPTION; + } } else { result = showSysImageMessage(); } if (result == JOptionPane.YES_OPTION || result == JOptionPane.CLOSED_OPTION) { abi = "x86"; installHAXM(); + } else if (arm64) { + abi = "arm64-v8a"; } else { abi = "arm"; } @@ -468,6 +481,9 @@ public void processLine(String line) { process.waitFor(); } catch (final InterruptedException ie) { ie.printStackTrace(); + System.out.println("Processing was not able to install HAXM automatically, " + + "but the installation package was downloaded into android/sdk/extras/intel/HAXM. " + + "You can try install to install it manually from there."); } finally { process.destroy(); } @@ -552,4 +568,4 @@ public void actionPerformed(ActionEvent actionEvent) { setResizable(false); setLocationRelativeTo(editor); } -} \ No newline at end of file +} diff --git a/mode/templates/ARActivity.java.tmpl b/processing/mode/templates/ARActivity.java.tmpl similarity index 90% rename from mode/templates/ARActivity.java.tmpl rename to processing/mode/templates/ARActivity.java.tmpl index ade8e71a3..ca441712f 100644 --- a/mode/templates/ARActivity.java.tmpl +++ b/processing/mode/templates/ARActivity.java.tmpl @@ -20,6 +20,7 @@ import processing.core.PApplet; public class MainActivity extends AppCompatActivity { private static final int CAMERA_PERMISSION_CODE = 0; + private static boolean CAMERA_PERMISSION_REQUESTED = false; private static final String CAMERA_PERMISSION = Manifest.permission.CAMERA; private static final String CAMERA_PERMISSION_MESSAGE = "Camera permission is needed to use AR"; @@ -57,6 +58,7 @@ public class MainActivity extends AppCompatActivity { if (sketch != null) { sketch.onRequestPermissionsResult(requestCode, permissions, grantResults); } + CAMERA_PERMISSION_REQUESTED = false; } @Override @@ -86,7 +88,10 @@ public class MainActivity extends AppCompatActivity { } private void requestCameraPermission() { - ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CAMERA_PERMISSION_CODE); + if (!CAMERA_PERMISSION_REQUESTED) { + CAMERA_PERMISSION_REQUESTED = true; + ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.CAMERA}, CAMERA_PERMISSION_CODE); + } } private boolean shouldShowRequestPermissionRationale() { diff --git a/mode/templates/ARBuild.gradle.tmpl b/processing/mode/templates/ARBuild.gradle.tmpl similarity index 71% rename from mode/templates/ARBuild.gradle.tmpl rename to processing/mode/templates/ARBuild.gradle.tmpl index c9c533104..9bd31923a 100644 --- a/mode/templates/ARBuild.gradle.tmpl +++ b/processing/mode/templates/ARBuild.gradle.tmpl @@ -7,7 +7,7 @@ android { } compileSdkVersion @@target_sdk@@ defaultConfig { - applicationId "@@target_sdk@@" + applicationId "@@package_name@@" minSdkVersion @@min_sdk@@ targetSdkVersion @@target_sdk@@ versionCode @@version_code@@ @@ -17,12 +17,23 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + signingConfigs { + release { + if (project.hasProperty('PROCESSING_UPLOAD_KEYSTORE_FILE')) { + storeFile file(PROCESSING_UPLOAD_KEYSTORE_FILE) + storePassword PROCESSING_UPLOAD_STORE_PASSWORD + keyAlias PROCESSING_UPLOAD_KEY_ALIAS + keyPassword PROCESSING_UPLOAD_KEY_PASSWORD + } + } + } buildTypes { debug { - debuggable true + debuggable true } release { minifyEnabled false + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } diff --git a/mode/templates/ARBuildECJ.gradle.tmpl b/processing/mode/templates/ARBuildECJ.gradle.tmpl similarity index 87% rename from mode/templates/ARBuildECJ.gradle.tmpl rename to processing/mode/templates/ARBuildECJ.gradle.tmpl index e2512ce24..45e72f569 100644 --- a/mode/templates/ARBuildECJ.gradle.tmpl +++ b/processing/mode/templates/ARBuildECJ.gradle.tmpl @@ -17,12 +17,23 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + signingConfigs { + release { + if (project.hasProperty('PROCESSING_UPLOAD_KEYSTORE_FILE')) { + storeFile file(PROCESSING_UPLOAD_KEYSTORE_FILE) + storePassword PROCESSING_UPLOAD_STORE_PASSWORD + keyAlias PROCESSING_UPLOAD_KEY_ALIAS + keyPassword PROCESSING_UPLOAD_KEY_PASSWORD + } + } + } buildTypes { debug { debuggable true } release { minifyEnabled false + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -80,7 +91,7 @@ android { } dependencies { - compileOnly files('@@tools_folder@@/../modes/java/mode/org.eclipse.jdt.core.jar') + compileOnly files('@@mode_folder@@/org.eclipse.jdt.core.jar') implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' implementation 'com.google.ar:core:@@gar_version@@' diff --git a/mode/templates/ARManifest.xml.tmpl b/processing/mode/templates/ARManifest.xml.tmpl similarity index 92% rename from mode/templates/ARManifest.xml.tmpl rename to processing/mode/templates/ARManifest.xml.tmpl index 4201872b1..1b31e497b 100644 --- a/mode/templates/ARManifest.xml.tmpl +++ b/processing/mode/templates/ARManifest.xml.tmpl @@ -5,7 +5,6 @@ package="" android:versionCode="1" android:versionName="1.0"> - @@ -16,8 +15,7 @@ android:theme="@style/ArActivityTheme" android:usesCleartextTraffic="false" tools:ignore="GoogleAppIndexingWarning"> - - + android:versionName="1.0"> + android:theme="@style/Theme.AppCompat.Light.NoActionBar.FullScreen" + android:exported="true"> diff --git a/mode/templates/Properties.gradle.tmpl b/processing/mode/templates/ExpProperties.gradle.tmpl similarity index 100% rename from mode/templates/Properties.gradle.tmpl rename to processing/mode/templates/ExpProperties.gradle.tmpl diff --git a/mode/templates/LayoutActivity.xml.tmpl b/processing/mode/templates/LayoutActivity.xml.tmpl similarity index 100% rename from mode/templates/LayoutActivity.xml.tmpl rename to processing/mode/templates/LayoutActivity.xml.tmpl diff --git a/processing/mode/templates/Properties.gradle.tmpl b/processing/mode/templates/Properties.gradle.tmpl new file mode 100644 index 000000000..6511be76b --- /dev/null +++ b/processing/mode/templates/Properties.gradle.tmpl @@ -0,0 +1,12 @@ +org.gradle.jvmargs=-Xmx1536m +android.enableJetifier=true +android.useAndroidX=true + +PROCESSING_UPLOAD_KEYSTORE_FILE=@@keystore_file@@ +PROCESSING_UPLOAD_KEY_ALIAS=@@key_alias@@ +PROCESSING_UPLOAD_STORE_PASSWORD=@@key_password@@ +PROCESSING_UPLOAD_KEY_PASSWORD=@@key_password@@ + + + + diff --git a/mode/templates/Properties.local.tmpl b/processing/mode/templates/Properties.local.tmpl similarity index 100% rename from mode/templates/Properties.local.tmpl rename to processing/mode/templates/Properties.local.tmpl diff --git a/mode/templates/Settings.gradle.tmpl b/processing/mode/templates/Settings.gradle.tmpl similarity index 100% rename from mode/templates/Settings.gradle.tmpl rename to processing/mode/templates/Settings.gradle.tmpl diff --git a/mode/templates/StringsWallpaper.xml.tmpl b/processing/mode/templates/StringsWallpaper.xml.tmpl similarity index 100% rename from mode/templates/StringsWallpaper.xml.tmpl rename to processing/mode/templates/StringsWallpaper.xml.tmpl diff --git a/mode/templates/StylesAR.xml.tmpl b/processing/mode/templates/StylesAR.xml.tmpl similarity index 100% rename from mode/templates/StylesAR.xml.tmpl rename to processing/mode/templates/StylesAR.xml.tmpl diff --git a/mode/templates/StylesFragment.xml.tmpl b/processing/mode/templates/StylesFragment.xml.tmpl similarity index 100% rename from mode/templates/StylesFragment.xml.tmpl rename to processing/mode/templates/StylesFragment.xml.tmpl diff --git a/mode/templates/StylesVR.xml.tmpl b/processing/mode/templates/StylesVR.xml.tmpl similarity index 100% rename from mode/templates/StylesVR.xml.tmpl rename to processing/mode/templates/StylesVR.xml.tmpl diff --git a/mode/templates/TopBuild.gradle.tmpl b/processing/mode/templates/TopBuild.gradle.tmpl similarity index 100% rename from mode/templates/TopBuild.gradle.tmpl rename to processing/mode/templates/TopBuild.gradle.tmpl diff --git a/processing/mode/templates/VRActivity.java.tmpl b/processing/mode/templates/VRActivity.java.tmpl new file mode 100644 index 000000000..bd2b73cce --- /dev/null +++ b/processing/mode/templates/VRActivity.java.tmpl @@ -0,0 +1,24 @@ +package @@package_name@@; + +import android.os.Build; +import android.os.Bundle; +import android.view.WindowManager; + +import processing.vr.VRActivity; +import processing.core.PApplet; + +public class MainActivity extends VRActivity { + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + // This is to ensure that the app shows in fullscreen mode with display cutout: + // https://stackoverflow.com/questions/49190381/fullscreen-app-with-displaycutout + getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); + getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; + } + PApplet sketch = new @@sketch_class_name@@(); + @@external@@ + setSketch(sketch); + } +} \ No newline at end of file diff --git a/mode/templates/VRBuild.gradle.tmpl b/processing/mode/templates/VRBuild.gradle.tmpl similarity index 70% rename from mode/templates/VRBuild.gradle.tmpl rename to processing/mode/templates/VRBuild.gradle.tmpl index b1f082242..3837b763a 100644 --- a/mode/templates/VRBuild.gradle.tmpl +++ b/processing/mode/templates/VRBuild.gradle.tmpl @@ -17,12 +17,23 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + signingConfigs { + release { + if (project.hasProperty('PROCESSING_UPLOAD_KEYSTORE_FILE')) { + storeFile file(PROCESSING_UPLOAD_KEYSTORE_FILE) + storePassword PROCESSING_UPLOAD_STORE_PASSWORD + keyAlias PROCESSING_UPLOAD_KEY_ALIAS + keyPassword PROCESSING_UPLOAD_KEY_PASSWORD + } + } + } buildTypes { debug { debuggable true - } + } release { minifyEnabled false + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -38,10 +49,10 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' - implementation 'com.google.vr:sdk-audio:@@gvr_version@@' - implementation 'com.google.vr:sdk-base:@@gvr_version@@' + implementation project('libs:google-vr') implementation files('libs/processing-core.jar') implementation files('libs/vr.jar') + implementation 'com.google.protobuf.nano:protobuf-javanano:3.1.0' androidTestImplementation 'com.android.support.test:runner:1.3.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' testImplementation 'junit:junit:4.13' diff --git a/mode/templates/VRBuildECJ.gradle.tmpl b/processing/mode/templates/VRBuildECJ.gradle.tmpl similarity index 85% rename from mode/templates/VRBuildECJ.gradle.tmpl rename to processing/mode/templates/VRBuildECJ.gradle.tmpl index 9f55cafc1..d8368f00f 100644 --- a/mode/templates/VRBuildECJ.gradle.tmpl +++ b/processing/mode/templates/VRBuildECJ.gradle.tmpl @@ -17,12 +17,23 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + signingConfigs { + release { + if (project.hasProperty('PROCESSING_UPLOAD_KEYSTORE_FILE')) { + storeFile file(PROCESSING_UPLOAD_KEYSTORE_FILE) + storePassword PROCESSING_UPLOAD_STORE_PASSWORD + keyAlias PROCESSING_UPLOAD_KEY_ALIAS + keyPassword PROCESSING_UPLOAD_KEY_PASSWORD + } + } + } buildTypes { debug { debuggable true - } + } release { minifyEnabled false + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } @@ -84,11 +95,11 @@ android { } dependencies { - compileOnly files('@@tools_folder@@/../modes/java/mode/org.eclipse.jdt.core.jar') + compileOnly files('@@mode_folder@@/org.eclipse.jdt.core.jar') implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:@@appcompat_version@@' - implementation 'com.google.vr:sdk-audio:@@gvr_version@@' - implementation 'com.google.vr:sdk-base:@@gvr_version@@' + implementation project('libs:google-vr') implementation files('libs/processing-core.jar') implementation files('libs/vr.jar') + implementation 'com.google.protobuf.nano:protobuf-javanano:3.1.0' } diff --git a/mode/templates/VRManifest.xml.tmpl b/processing/mode/templates/VRManifest.xml.tmpl similarity index 90% rename from mode/templates/VRManifest.xml.tmpl rename to processing/mode/templates/VRManifest.xml.tmpl index e6e842b01..0c550cfa0 100644 --- a/mode/templates/VRManifest.xml.tmpl +++ b/processing/mode/templates/VRManifest.xml.tmpl @@ -2,8 +2,7 @@ - + android:versionName="1.0"> @@ -17,7 +16,8 @@ + android:resizeableActivity="false" + android:exported="true"> diff --git a/mode/templates/WallpaperManifest.xml.tmpl b/processing/mode/templates/WallpaperManifest.xml.tmpl similarity index 85% rename from mode/templates/WallpaperManifest.xml.tmpl rename to processing/mode/templates/WallpaperManifest.xml.tmpl index 1bd1b42d8..baec25eb5 100644 --- a/mode/templates/WallpaperManifest.xml.tmpl +++ b/processing/mode/templates/WallpaperManifest.xml.tmpl @@ -2,20 +2,20 @@ - + android:versionName="1.0"> + android:permission="android.permission.BIND_WALLPAPER" + android:exported="true"> - +
diff --git a/mode/templates/WallpaperService.java.tmpl b/processing/mode/templates/WallpaperService.java.tmpl similarity index 100% rename from mode/templates/WallpaperService.java.tmpl rename to processing/mode/templates/WallpaperService.java.tmpl diff --git a/mode/templates/WatchFaceManifest.xml.tmpl b/processing/mode/templates/WatchFaceManifest.xml.tmpl similarity index 94% rename from mode/templates/WatchFaceManifest.xml.tmpl rename to processing/mode/templates/WatchFaceManifest.xml.tmpl index a00fa0407..28d8119da 100644 --- a/mode/templates/WatchFaceManifest.xml.tmpl +++ b/processing/mode/templates/WatchFaceManifest.xml.tmpl @@ -2,8 +2,7 @@ - + android:versionName="1.0"> + android:permission="android.permission.BIND_WALLPAPER" + android:exported="true"> + + + + + + + + + + + + + + + + + + + + diff --git a/mode/tools/SDKUpdater/.gitignore b/processing/mode/tools/SDKUpdater/.gitignore similarity index 100% rename from mode/tools/SDKUpdater/.gitignore rename to processing/mode/tools/SDKUpdater/.gitignore diff --git a/processing/mode/tools/SDKUpdater/.project b/processing/mode/tools/SDKUpdater/.project new file mode 100644 index 000000000..730c03fa8 --- /dev/null +++ b/processing/mode/tools/SDKUpdater/.project @@ -0,0 +1,34 @@ + + + android-mode-sdkupdater + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.buildship.core.gradleprojectbuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.buildship.core.gradleprojectnature + + + + 1675640664206 + + 30 + + org.eclipse.core.resources.regexFilterMatcher + node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ + + + + diff --git a/processing/mode/tools/SDKUpdater/.settings/org.eclipse.buildship.core.prefs b/processing/mode/tools/SDKUpdater/.settings/org.eclipse.buildship.core.prefs new file mode 100644 index 000000000..e8895216f --- /dev/null +++ b/processing/mode/tools/SDKUpdater/.settings/org.eclipse.buildship.core.prefs @@ -0,0 +1,2 @@ +connection.project.dir= +eclipse.preferences.version=1 diff --git a/mode/.settings/org.eclipse.jdt.core.prefs b/processing/mode/tools/SDKUpdater/.settings/org.eclipse.jdt.core.prefs similarity index 78% rename from mode/.settings/org.eclipse.jdt.core.prefs rename to processing/mode/tools/SDKUpdater/.settings/org.eclipse.jdt.core.prefs index d17b6724d..6558ab78f 100644 --- a/mode/.settings/org.eclipse.jdt.core.prefs +++ b/processing/mode/tools/SDKUpdater/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,12 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=17 diff --git a/mode/tools/SDKUpdater/build.gradle b/processing/mode/tools/SDKUpdater/build.gradle similarity index 56% rename from mode/tools/SDKUpdater/build.gradle rename to processing/mode/tools/SDKUpdater/build.gradle index 257901506..a47fffbb1 100644 --- a/mode/tools/SDKUpdater/build.gradle +++ b/processing/mode/tools/SDKUpdater/build.gradle @@ -7,26 +7,33 @@ configurations { dependencies { // implementation group: "org.processing", name: "pde", version: "${processingVersion}" - implementation group: "org.processing", name: "java-mode", version: "${processingVersion}" - implementation fileTree(include: ["AndroidMode.jar"], dir: '../../mode') + // implementation group: "org.processing", name: "java-mode", version: "${processingVersion}" + implementation fileTree(include: ["AndroidMode.jar", "pde.jar", "JavaMode.jar"], dir: '../../mode') implementationCopy group: "com.android.tools", name: "sdklib", version: "${toolsLibVersion}" implementationCopy group: "com.android.tools", name: "repository", version: "${toolsLibVersion}" + implementationCopy group: "com.android.tools", name: "common", version: "${toolsLibVersion}" } // This task copies the gradle tooling jar into the mode folder task copyToLib(type: Copy) { from configurations.implementationCopy.files { - include '**/annotations-*' - include '**/common-*' - include '**/dvlib-*' - include '**/gson-*' - include '**/guava-*' - include '**/httpcore-*' - include '**/kotlin-stdlib-*' - include '**/layoutlib-api-*' - include '**/repository-*' - include '**/sdklib-*' + + include '**/common-*jar' + include '**/commons-compress-*jar' + include '**/guava-*jar' + include '**/httpcore-*jar' + include '**/istack-*jar' + include '**/jakarta.activation-api-*jar' + include '**/jakarta.xml.bind-api-*jar' + include '**/jaxb-runtime-*jar' + include '**/kotlin-stdlib-1*jar' + include '**/shared-*jar' + include '**/protos-*jar' + include '**/protob*jar' + include '**/sdklib-*jar' + include '**/repository-*jar' + } into "lib" } diff --git a/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java b/processing/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java similarity index 75% rename from mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java rename to processing/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java index 0344eb57c..685b6716c 100644 --- a/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java +++ b/processing/mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java @@ -4,7 +4,7 @@ Part of the Processing project - http://processing.org Copyright (c) 2017 The Processing Foundation - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. @@ -23,13 +23,12 @@ import com.android.repository.api.*; import com.android.repository.impl.meta.RepositoryPackages; -import com.android.repository.io.FileOpUtils; -import com.android.repository.io.impl.FileSystemFileOp; import com.android.repository.util.InstallerUtil; import com.android.sdklib.repository.AndroidSdkHandler; import com.android.sdklib.repository.installer.SdkInstallerUtil; import com.android.sdklib.repository.legacy.LegacyDownloader; import com.android.sdklib.tool.sdkmanager.SdkManagerCli; +import com.android.prefs.AndroidLocationsSingleton; import processing.app.Base; import processing.app.Preferences; @@ -59,22 +58,22 @@ @SuppressWarnings("serial") public class SDKUpdater extends JFrame implements PropertyChangeListener, Tool { - final static private int NUM_ROWS = 10; + final static private int NUM_ROWS = 10; final static private int COL_WIDTH = Toolkit.zoom(220); - + final static private int BORDER = Toolkit.zoom(13); final static private int GAP = Toolkit.zoom(13); final static private int INSET = Toolkit.zoom(1); - final static private int BUTTON_WIDTH = Toolkit.zoom(75); + final static private int BUTTON_WIDTH = Toolkit.zoom(85); final static private int BUTTON_HEIGHT = Toolkit.zoom(25); - -// private final Vector columns = new Vector<>(Arrays.asList( -// AndroidMode.getTextString("sdk_updater.name_column"), + + // private final Vector columns = new Vector<>(Arrays.asList( +// AndroidMode.getTextString("sdk_updater.name_column"), // AndroidMode.getTextString("sdk_updater.version_column"), -// AndroidMode.getTextString("sdk_updater.available_column"))); +// AndroidMode.getTextString("sdk_updater.available_column"))); private final Vector columns = new Vector<>(Arrays.asList( - "Package name", "Installed version", "Available update" )); - + "Package name", "Installed version", "Available update" )); + private static final String PROPERTY_CHANGE_QUERY = "query"; private File sdkFolder; @@ -84,72 +83,77 @@ public class SDKUpdater extends JFrame implements PropertyChangeListener, Tool { private boolean downloadTaskRunning; private Vector> packageList; - private DefaultTableModel packageTable; + private DefaultTableModel packageTable; private int numUpdates; private JProgressBar progressBar; private JLabel status; + private JLabel statusSecondary; private JButton actionButton; private JTable table; - + @Override public void init(Base base) { createLayout(base.getActiveEditor() == null); } - + @Override public void run() { setVisible(true); String path = Preferences.get("android.sdk.path"); - sdkFolder = new File(path); + sdkFolder = new File(path); queryTask = new QueryTask(); queryTask.addPropertyChangeListener(this); queryTask.execute(); // status.setText(AndroidMode.getTextString("sdk_updater.query_message")); - status.setText("Querying packages..."); + status.setText("Querying packages..."); + statusSecondary.setText(""); } - - + + @Override - public String getMenuTitle() { + public String getMenuTitle() { // return AndroidMode.getTextString("menu.android.sdk_updater"); return "SDK Updater"; } - - + + @Override public void propertyChange(PropertyChangeEvent evt) { switch (evt.getPropertyName()) { - case PROPERTY_CHANGE_QUERY: - progressBar.setIndeterminate(false); - if (numUpdates == 0) { - actionButton.setEnabled(false); -// status.setText(AndroidMode.getTextString("sdk_updater.no_updates_message")); - status.setText("No updates available"); - } else { - actionButton.setEnabled(true); - if (numUpdates == 1) { + case PROPERTY_CHANGE_QUERY: + progressBar.setIndeterminate(false); + if (numUpdates == 0) { + actionButton.setEnabled(false); +// status.setText(AndroidMode.getTextString("sdk_updater.no_updates_message")); + status.setText("No updates available"); + statusSecondary.setText(""); + } else { + actionButton.setEnabled(true); + if (numUpdates == 1) { // status.setText(AndroidMode.getTextString("sdk_updater.one_updates_message")); - status.setText("1 update found!"); - } else { + status.setText("1 update found!"); + statusSecondary.setText(""); + } else { // status.setText(AndroidMode.getTextString("sdk_updater.many_updates_message", numUpdates)); - status.setText(numUpdates + " updates found!"); - } - } - break; + status.setText(numUpdates + " updates found!"); + statusSecondary.setText(""); + } + } + break; } } class QueryTask extends SwingWorker { ProgressIndicator progress; - + QueryTask() { super(); - progress = new ConsoleProgressIndicator(); + progress = new CustomProgressIndicatorToMonitor(); } - + @Override protected Object doInBackground() throws Exception { numUpdates = 0; @@ -158,11 +162,10 @@ protected Object doInBackground() throws Exception { /* Following code is from listPackages() of com.android.sdklib.tool.SdkManagerCli with some changes */ - AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(sdkFolder); - - FileSystemFileOp fop = (FileSystemFileOp) FileOpUtils.create(); + AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(AndroidLocationsSingleton.INSTANCE, sdkFolder.toPath()); + RepoManager mRepoManager = mHandler.getSdkManager(progress); - mRepoManager.loadSynchronously(0, progress, new LegacyDownloader(fop, new SettingsController() { + mRepoManager.loadSynchronously(0, progress, new LegacyDownloader(new SettingsController() { @Override public boolean getForceHttp() { return false; @@ -186,7 +189,7 @@ public void setDisableSdkPatches(boolean arg0) { } }), null); - RepositoryPackages packages = mRepoManager.getPackages(); + RepositoryPackages packages = mRepoManager.getPackages(); HashMap> installed = new HashMap>(); for (LocalPackage local : packages.getLocalPackages().values()) { String path = local.getPath(); @@ -202,17 +205,17 @@ public void setDisableSdkPatches(boolean arg0) { String major = ver.substring(0, maj); int pos = name.indexOf(major); if (-1 < pos) { - name = name.substring(0, pos).trim(); + name = name.substring(0, pos).trim(); } } installed.put(path, Arrays.asList(name, ver)); } HashMap> updated = new HashMap>(); - for (UpdatablePackage update : packages.getUpdatedPkgs()) { + for (UpdatablePackage update : packages.getUpdatedPkgs()) { String path = update.getPath(); String loc = update.getLocal().getVersion().toString(); - String rem = update.getRemote().getVersion().toString(); + String rem = update.getRemote().getVersion().toString(); updated.put(path, Arrays.asList(loc, rem)); } @@ -223,12 +226,12 @@ public void setDisableSdkPatches(boolean arg0) { info.add(locInfo.get(1)); if (updated.containsKey(path)) { String upVer = updated.get(path).get(1); - info.add(upVer); + info.add(upVer); numUpdates++; } else { info.add(""); } - packageList.add(info); + packageList.add(info); } return null; @@ -241,7 +244,7 @@ protected void done() { try { get(); firePropertyChange(PROPERTY_CHANGE_QUERY, "query", "SUCCESS"); - + if (packageList != null) { packageTable.setDataVector(packageList, columns); packageTable.fireTableDataChanged(); @@ -251,7 +254,7 @@ protected void done() { } catch (ExecutionException e) { this.cancel(true); JOptionPane.showMessageDialog(null, - e.getCause().toString(), "Error", JOptionPane.ERROR_MESSAGE); + e.getCause().toString(), "Error", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); } } @@ -261,10 +264,10 @@ class DownloadTask extends SwingWorker { ProgressIndicator progress; DownloadTask() { - super(); - progress = new ConsoleProgressIndicator(); + super(); + progress = new CustomProgressIndicatorToMonitor(); } - + @Override protected Object doInBackground() throws Exception { downloadTaskRunning = true; @@ -272,15 +275,14 @@ protected Object doInBackground() throws Exception { /* Following code is from installPackages() of com.android.sdklib.tool.SdkManagerCli with some changes */ - AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(sdkFolder); + AndroidSdkHandler mHandler = AndroidSdkHandler.getInstance(AndroidLocationsSingleton.INSTANCE, sdkFolder.toPath()); - FileSystemFileOp fop = (FileSystemFileOp) FileOpUtils.create(); CustomSettings settings = new CustomSettings(); - Downloader downloader = new LegacyDownloader(fop, settings); + Downloader downloader = new LegacyDownloader(settings); RepoManager mRepoManager = mHandler.getSdkManager(progress); mRepoManager.loadSynchronously(0, progress, downloader, settings); - + List remotes = new ArrayList<>(); for (String path : settings.getPaths(mRepoManager)) { RemotePackage p = mRepoManager.getPackages().getRemotePackages().get(path); @@ -292,18 +294,18 @@ protected Object doInBackground() throws Exception { remotes.add(p); } remotes = InstallerUtil.computeRequiredPackages( - remotes, mRepoManager.getPackages(), progress); + remotes, mRepoManager.getPackages(), progress); if (remotes != null) { for (RemotePackage p : remotes) { Installer installer = SdkInstallerUtil.findBestInstallerFactory(p, mHandler) - .createInstaller(p, mRepoManager, downloader, mHandler.getFileOp()); + .createInstaller(p, mRepoManager, downloader); if (!(installer.prepare(progress) && installer.complete(progress))) { // there was an error, abort. throw new SdkManagerCli.CommandFailedException(); } } } else { -// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_computing_dependency_list")); +// progress.logWarning(AndroidMode.getTextString("sdk_updater.warning_failed_computing_dependency_list")); progress.logWarning("Unable to compute a complete list of dependencies."); throw new SdkManagerCli.CommandFailedException(); } @@ -320,6 +322,7 @@ protected void done() { actionButton.setEnabled(false); // status.setText(AndroidMode.getTextString("sdk_updater.refresh_package_message")); status.setText("Refreshing packages..."); + statusSecondary.setText(""); queryTask = new QueryTask(); queryTask.addPropertyChangeListener(SDKUpdater.this); queryTask.execute(); @@ -328,7 +331,7 @@ protected void done() { } catch (ExecutionException e) { this.cancel(true); JOptionPane.showMessageDialog(null, - e.getCause().toString(), "Error", JOptionPane.ERROR_MESSAGE); + e.getCause().toString(), "Error", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); } finally { downloadTaskRunning = false; @@ -356,7 +359,7 @@ public Channel getChannel() { public java.util.List getPaths(RepoManager mgr) { List updates = new ArrayList<>(); for(UpdatablePackage upd : mgr.getPackages().getUpdatedPkgs()) { - if(!upd.getRemote().obsolete()) { + if (!upd.getRemote().obsolete()) { updates.add(upd.getRepresentative().getPath()); } } @@ -371,14 +374,14 @@ public boolean getDisableSdkPatches() { @Override public void setDisableSdkPatches(boolean arg0) { // TODO Auto-generated method stub - + } } } private void createLayout(final boolean standalone) { setTitle(getMenuTitle()); - + Container outer = getContentPane(); outer.removeAll(); @@ -404,20 +407,20 @@ public Class getColumnClass(int columnIndex) { return String.class; } }; - + table = new JTable(packageTable) { @Override public String getColumnName(int column) { return columns.get(column); } - }; + }; table.setFillsViewportHeight(true); table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS); table.setRowHeight(Toolkit.zoom(table.getRowHeight())); - Dimension dim = new Dimension(table.getColumnCount() * COL_WIDTH, - table.getRowHeight() * NUM_ROWS); + Dimension dim = new Dimension(table.getColumnCount() * COL_WIDTH, + table.getRowHeight() * NUM_ROWS); table.setPreferredScrollableViewportSize(dim); - + packagesPanel.add(new JScrollPane(table)); JPanel controlPanel = new JPanel(); @@ -426,20 +429,26 @@ public String getColumnName(int column) { GridBagConstraints gbc = new GridBagConstraints(); gbc.insets = new Insets(INSET, INSET, INSET, INSET); - + status = new JLabel(); status.setText("Starting up..."); gbc.gridx = 0; gbc.gridy = 0; controlPanel.add(status, gbc); - // Using an indeterminate progress bar from now until we learn + statusSecondary = new JLabel(); + statusSecondary.setText("Getting Detailed Information Here..."); + statusSecondary.setFont(new Font("Calibri", Font.PLAIN, 12)); + gbc.gridx = 0; + gbc.gridy = 1; + controlPanel.add(statusSecondary, gbc); + + // Using an indeterminate progress bar from now until we learn // how to update the fraction of the query/download process: // https://github.com/processing/processing-android/issues/362 progressBar = new JProgressBar(); - progressBar.setIndeterminate(true); gbc.gridx = 0; - gbc.gridy = 1; + gbc.gridy = 2; gbc.weightx = 1.0; gbc.fill = GridBagConstraints.HORIZONTAL; controlPanel.add(progressBar, gbc); @@ -451,25 +460,12 @@ public void actionPerformed(ActionEvent e) { cancelTasks(); } else { // i.e button state is Update downloadTask = new DownloadTask(); - progressBar.setIndeterminate(true); downloadTask.execute(); - // getFraction() always returns 0.0, needs to be set somewhere (??) -// Thread update = new Thread() { -// @Override -// public void run() { -// while (downloadTaskRunning) { -// try { -// Thread.sleep(100); -// } catch (InterruptedException e) { } -// System.out.println("Updating: " + downloadTask.progress.getFraction()); -// } -// } -// }; -// update.start(); - + // status.setText(AndroidMode.getTextString("sdk_updater.download_package_message")); status.setText("Downloading available updates..."); + statusSecondary.setText(""); // actionButton.setText(AndroidMode.getTextString("sdk_updater.cancel_button_label")); actionButton.setText("Cancel"); } @@ -478,9 +474,9 @@ public void actionPerformed(ActionEvent e) { actionButton.setEnabled(false); actionButton.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT)); gbc.gridx = 1; - gbc.gridy = 0; + gbc.gridy = 0; gbc.weightx = 0.0; - gbc.fill = GridBagConstraints.HORIZONTAL; + gbc.fill = GridBagConstraints.HORIZONTAL; controlPanel.add(actionButton, gbc); ActionListener disposer = new ActionListener() { @@ -493,7 +489,7 @@ public void actionPerformed(ActionEvent actionEvent) { } } }; - + // JButton closeButton = new JButton(AndroidMode.getTextString("sdk_updater.close_button_label")); JButton closeButton = new JButton("Close"); closeButton.setPreferredSize(new Dimension(BUTTON_WIDTH, BUTTON_HEIGHT)); @@ -522,30 +518,31 @@ public void windowClosing(WindowEvent e) { super.windowClosing(e); } }); - - registerWindowCloseKeys(getRootPane(), disposer); - + + registerWindowCloseKeys(getRootPane(), disposer); + setLocationRelativeTo(null); setResizable(false); setVisible(false); } - + public void cancelTasks() { queryTask.cancel(true); if (downloadTaskRunning) { downloadTask.cancel(true); // status.setText(AndroidMode.getTextString("sdk_updater.download_canceled_message")); status.setText("Download canceled"); + statusSecondary.setText(""); JOptionPane.showMessageDialog(null, // AndroidMode.getTextString("sdk_updater.download_canceled_message"), - "Download canceled", - "Warning", JOptionPane.WARNING_MESSAGE); + "Download canceled", + "Warning", JOptionPane.WARNING_MESSAGE); // actionButton.setText(AndroidMode.getTextString("sdk_updater.update_button_label")); - actionButton.setText("Update"); + actionButton.setText("Update"); } } - - + + /** * Registers key events for a Ctrl-W and ESC with an ActionListener * that will take care of disposing the window. @@ -554,11 +551,104 @@ static public void registerWindowCloseKeys(JRootPane root, ActionListener disposer) { KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); root.registerKeyboardAction(disposer, stroke, - JComponent.WHEN_IN_FOCUSED_WINDOW); + JComponent.WHEN_IN_FOCUSED_WINDOW); - int modifiers = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); + int modifiers = java.awt.Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx(); stroke = KeyStroke.getKeyStroke('W', modifiers); root.registerKeyboardAction(disposer, stroke, - JComponent.WHEN_IN_FOCUSED_WINDOW); - } + JComponent.WHEN_IN_FOCUSED_WINDOW); + } + + class CustomProgressIndicatorToMonitor implements com.android.repository.api.ProgressIndicator{ + + int percentage = 0; + String progressTextData = ""; + String progressTextDataDetailed = ""; + + @Override + public void setText(String progressText) { + progressTextData = progressText; + } + + @Override + public boolean isCanceled() { + return false; + } + + @Override + public void cancel() { + + } + + @Override + public void setCancellable(boolean cancellable) { + + } + + @Override + public boolean isCancellable() { + return false; + } + + @Override + public void setIndeterminate(boolean indeterminate) { + + } + + @Override + public boolean isIndeterminate() { + return false; + } + + @Override + public void setFraction(double progress) { + if(progress<=1 && progress>=0) { + percentage = ((int)(progress*100)); + // System.out.println("CustomProgressIndicatorToMonitor:Progress Bar Percentage:"+percentage); + progressBar.setValue(percentage); + status.setText(progressTextData+" "+percentage+" % "); + statusSecondary.setText(progressTextDataDetailed); + } + } + + @Override + public double getFraction() { + return 0; + } + + @Override + public void setSecondaryText(String s) { + progressTextDataDetailed = s; + // System.out.println("CustomProgressIndicatorToMonitor:SecondaryText:"+s); + } + + @Override + public void logWarning(String s) { + progressTextDataDetailed = s; + // System.out.println("CustomProgressIndicatorToMonitor:WarningText:"+s); + } + + @Override + public void logWarning(String s, Throwable e) { + + } + + @Override + public void logError(String s) { + progressTextDataDetailed = s; + // System.out.println("CustomProgressIndicatorToMonitor:ErrorText:"+s); + } + + @Override + public void logError(String s, Throwable e) { + + } + + @Override + public void logInfo(String s) { + progressTextDataDetailed = s; + // System.out.println("CustomProgressIndicatorToMonitor:LogInfoText:"+s); + } + } + } diff --git a/processing/mode/version.properties b/processing/mode/version.properties new file mode 100644 index 000000000..fbf85d18d --- /dev/null +++ b/processing/mode/version.properties @@ -0,0 +1,29 @@ +# Basics +android-platform = 33 +android-platform-wear = 30 +android-platform-wear-arm = 24 +android-toolslib = 30.3.0 +android-gradle-plugin = 7.1.0 +gradle-wrapper = 7.4.2 + +# Minimum SDK versions for each type of project +android-min-app = 17 +android-min-wallpaper = 17 +android-min-vr = 19 +android-min-ar = 24 +android-min-wear = 25 + +# Dependencies. Latest versions could be found at: +# https://mvnrepository.com +# https://repo.gradle.org +# The format below is group%artifact +androidx.appcompat%appcompat = 1.6.0 +androidx.legacy%legacy-support-v4 = 1.0.0 +com.google.android.support%wearable = 2.9.0 +com.google.android.gms%play-services-wearable = 18.0.0 +com.google.vr = 1.180.0 +com.google.ar = 1.37.0 +org.processing = 4.0.0b7 +org.gradle%gradle-tooling-api = 7.2 +org.slf4j = 1.7.30 +org.eclipse.jdt = 3.19.300 diff --git a/scripts/publish-module.gradle b/processing/scripts/publish-module.gradle similarity index 100% rename from scripts/publish-module.gradle rename to processing/scripts/publish-module.gradle diff --git a/scripts/publish-root.gradle b/processing/scripts/publish-root.gradle similarity index 100% rename from scripts/publish-root.gradle rename to processing/scripts/publish-root.gradle diff --git a/processing/settings.gradle b/processing/settings.gradle new file mode 100644 index 000000000..9e3fad4ab --- /dev/null +++ b/processing/settings.gradle @@ -0,0 +1,2 @@ +include ':mode', ':core', ':mode:libraries:vr', ':mode:libraries:ar', 'mode:tools:SDKUpdater' + diff --git a/settings.gradle b/settings.gradle index 9e3fad4ab..193a03378 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1 @@ -include ':mode', ':core', ':mode:libraries:vr', ':mode:libraries:ar', 'mode:tools:SDKUpdater' - +include ':libs:processing-core', 'libs:google-vr',':libs:processing-vr', ':libs:processing-ar', ':apps:simple', ':apps:wallpaper', ':apps:arscene', ':apps:watchface', ':apps:fast2d', ':apps:armarkers' \ No newline at end of file