From 2fa2649bc140de4f87424df73d447e4dd3837b19 Mon Sep 17 00:00:00 2001 From: codeanticode Date: Wed, 15 Mar 2023 19:22:14 -0400 Subject: [PATCH 1/7] released version 4.5.0b5 --- .github/FUNDING.yml | 2 - .gitignore | 28 - README.md | 15 +- build.gradle | 173 - buildSrc/build.gradle | 15 - .../processing/android/ImportAar.groovy | 125 - .../META-INF/gradle-plugins/aar.properties | 1 - core/build.gradle | 96 - core/src/assets/shaders/ColorFrag.glsl | 32 - core/src/assets/shaders/ColorVert.glsl | 34 - core/src/assets/shaders/LightFrag.glsl | 33 - core/src/assets/shaders/LightVert.glsl | 151 - core/src/assets/shaders/LineFrag.glsl | 32 - core/src/assets/shaders/LineVert.glsl | 99 - core/src/assets/shaders/MaskFrag.glsl | 40 - core/src/assets/shaders/P2DFrag.glsl | 14 - core/src/assets/shaders/P2DVert.glsl | 23 - core/src/assets/shaders/PointFrag.glsl | 32 - core/src/assets/shaders/PointVert.glsl | 56 - core/src/assets/shaders/TexFrag.glsl | 37 - core/src/assets/shaders/TexLightFrag.glsl | 37 - core/src/assets/shaders/TexLightVert.glsl | 157 - core/src/assets/shaders/TexVert.glsl | 38 - .../processing/a2d/PGraphicsAndroid2D.java | 2390 --- core/src/processing/a2d/PShapeAndroid2D.java | 132 - .../src/processing/a2d/PSurfaceAndroid2D.java | 159 - core/src/processing/android/ActivityAPI.java | 65 - core/src/processing/android/AppComponent.java | 52 - core/src/processing/android/CompatUtils.java | 112 - core/src/processing/android/PFragment.java | 261 - core/src/processing/android/PWallpaper.java | 302 - .../processing/android/PWatchFaceCanvas.java | 368 - .../processing/android/PWatchFaceGLES.java | 393 - .../android/PermissionRequestor.java | 59 - .../src/processing/android/ServiceEngine.java | 50 - core/src/processing/core/PApplet.java | 12682 ------------ core/src/processing/core/PConstants.java | 465 - core/src/processing/core/PFont.java | 907 - core/src/processing/core/PGraphics.java | 6135 ------ core/src/processing/core/PImage.java | 2881 --- core/src/processing/core/PMatrix.java | 170 - core/src/processing/core/PMatrix2D.java | 467 - core/src/processing/core/PMatrix3D.java | 806 - core/src/processing/core/PShape.java | 3569 ---- core/src/processing/core/PShapeOBJ.java | 468 - core/src/processing/core/PShapeSVG.java | 2031 -- core/src/processing/core/PStyle.java | 64 - core/src/processing/core/PSurface.java | 108 - core/src/processing/core/PSurfaceNone.java | 594 - core/src/processing/core/PVector.java | 1062 - core/src/processing/data/DoubleDict.java | 850 - core/src/processing/data/DoubleList.java | 928 - core/src/processing/data/FloatDict.java | 847 - core/src/processing/data/FloatList.java | 936 - core/src/processing/data/IntDict.java | 807 - core/src/processing/data/IntList.java | 936 - core/src/processing/data/JSONArray.java | 1260 -- core/src/processing/data/JSONObject.java | 2282 --- core/src/processing/data/JSONTokener.java | 435 - core/src/processing/data/LongDict.java | 802 - core/src/processing/data/LongList.java | 937 - core/src/processing/data/Sort.java | 46 - core/src/processing/data/StringDict.java | 613 - core/src/processing/data/StringList.java | 798 - core/src/processing/data/Table.java | 4935 ----- core/src/processing/data/TableRow.java | 198 - core/src/processing/data/XML.java | 1156 -- core/src/processing/event/Event.java | 125 - core/src/processing/event/KeyEvent.java | 69 - core/src/processing/event/MouseEvent.java | 105 - core/src/processing/event/TouchEvent.java | 142 - core/src/processing/opengl/FontTexture.java | 379 - core/src/processing/opengl/FrameBuffer.java | 503 - core/src/processing/opengl/LinePath.java | 623 - core/src/processing/opengl/LineStroker.java | 685 - core/src/processing/opengl/PGL.java | 3363 ---- core/src/processing/opengl/PGLES.java | 1609 -- core/src/processing/opengl/PGraphics2D.java | 629 - core/src/processing/opengl/PGraphics2DX.java | 2055 -- core/src/processing/opengl/PGraphics3D.java | 281 - .../processing/opengl/PGraphicsOpenGL.java | 14280 ------------- core/src/processing/opengl/PShader.java | 1478 -- core/src/processing/opengl/PShapeOpenGL.java | 5254 ----- core/src/processing/opengl/PSurfaceGLES.java | 604 - core/src/processing/opengl/Texture.java | 1670 -- core/src/processing/opengl/VertexBuffer.java | 88 - .../processing/opengl/tess/ActiveRegion.java | 70 - .../processing/opengl/tess/CachedVertex.java | 60 - core/src/processing/opengl/tess/Dict.java | 142 - core/src/processing/opengl/tess/DictNode.java | 61 - core/src/processing/opengl/tess/GLUface.java | 66 - .../processing/opengl/tess/GLUhalfEdge.java | 72 - core/src/processing/opengl/tess/GLUmesh.java | 63 - .../opengl/tess/GLUtessellatorImpl.java | 645 - .../src/processing/opengl/tess/GLUvertex.java | 67 - core/src/processing/opengl/tess/Geom.java | 340 - core/src/processing/opengl/tess/Mesh.java | 736 - core/src/processing/opengl/tess/Normal.java | 288 - core/src/processing/opengl/tess/PGLU.java | 158 - .../opengl/tess/PGLUtessellator.java | 70 - .../opengl/tess/PGLUtessellatorCallback.java | 359 - .../tess/PGLUtessellatorCallbackAdapter.java | 87 - .../src/processing/opengl/tess/PriorityQ.java | 102 - .../processing/opengl/tess/PriorityQHeap.java | 271 - .../processing/opengl/tess/PriorityQSort.java | 288 - core/src/processing/opengl/tess/Render.java | 558 - core/src/processing/opengl/tess/Sweep.java | 1354 -- core/src/processing/opengl/tess/TessMono.java | 243 - .../src/processing/opengl/tess/TessState.java | 61 - debug/apps/arscene/build.gradle | 34 - debug/apps/arscene/gradle.properties | 2 - .../apps/arscene/src/main/AndroidManifest.xml | 27 - .../src/main/java/arscene/MainActivity.java | 105 - .../arscene/src/main/java/arscene/Sketch.java | 103 - .../apps/arscene/src/main/res/layout/main.xml | 7 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10486 -> 0 bytes .../arscene/src/main/res/values/strings.xml | 3 - .../arscene/src/main/res/values/styles.xml | 9 - debug/apps/fast2d/build.gradle | 32 - debug/apps/fast2d/gradle.properties | 2 - .../apps/fast2d/src/main/AndroidManifest.xml | 20 - debug/apps/fast2d/src/main/assets/blur.glsl | 42 - debug/apps/fast2d/src/main/assets/bot1.svg | 160 - debug/apps/fast2d/src/main/assets/edges.glsl | 36 - debug/apps/fast2d/src/main/assets/frag.glsl | 10 - debug/apps/fast2d/src/main/assets/img.png | Bin 904 -> 0 bytes debug/apps/fast2d/src/main/assets/leaves.jpg | Bin 43231 -> 0 bytes debug/apps/fast2d/src/main/assets/vert.glsl | 16 - .../src/main/java/fast2d/MainActivity.java | 104 - .../fast2d/src/main/java/fast2d/Sketch.java | 560 - .../src/main/java/fast2d/SketchArcTest.java | 52 - .../src/main/java/fast2d/SketchBasicPoly.java | 48 - .../src/main/java/fast2d/SketchCurveTest.java | 62 - .../main/java/fast2d/SketchCustomShader.java | 36 - .../main/java/fast2d/SketchDisplayText.java | 27 - .../java/fast2d/SketchDuplicatedVert.java | 32 - .../main/java/fast2d/SketchFilterTest.java | 27 - .../java/fast2d/SketchLoadDisplaySVG.java | 22 - .../src/main/java/fast2d/SketchMousePoly.java | 52 - .../java/fast2d/SketchPrimitiveTypes.java | 182 - .../main/java/fast2d/SketchShaderNoTex.java | 24 - .../java/fast2d/SketchShapeBenchmark.java | 70 - .../main/java/fast2d/SketchTexturedPoly.java | 47 - .../fast2d/SketchUserDefinedContours.java | 41 - .../src/main/res/layout/activity_main.xml | 12 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10486 -> 0 bytes .../src/main/res/values-w820dp/dimens.xml | 6 - .../fast2d/src/main/res/values/colors.xml | 6 - .../fast2d/src/main/res/values/dimens.xml | 5 - .../fast2d/src/main/res/values/strings.xml | 3 - .../fast2d/src/main/res/values/styles.xml | 11 - debug/apps/simple/build.gradle | 32 - debug/apps/simple/gradle.properties | 2 - .../apps/simple/src/main/AndroidManifest.xml | 20 - debug/apps/simple/src/main/assets/leaf.png | Bin 279726 -> 0 bytes .../src/main/java/simple/MainActivity.java | 60 - .../simple/src/main/java/simple/Sketch.java | 23 - .../src/main/res/layout/activity_main.xml | 12 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10486 -> 0 bytes .../src/main/res/values-w820dp/dimens.xml | 6 - .../simple/src/main/res/values/colors.xml | 6 - .../simple/src/main/res/values/dimens.xml | 5 - .../simple/src/main/res/values/strings.xml | 3 - .../simple/src/main/res/values/styles.xml | 11 - debug/apps/vrcube/build.gradle | 34 - debug/apps/vrcube/gradle.properties | 2 - .../apps/vrcube/src/main/AndroidManifest.xml | 26 - .../src/main/java/vrcube/MainActivity.java | 15 - .../vrcube/src/main/java/vrcube/Sketch.java | 181 - .../apps/vrcube/src/main/res/layout/main.xml | 7 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10486 -> 0 bytes .../vrcube/src/main/res/values/strings.xml | 3 - .../vrcube/src/main/res/values/styles.xml | 9 - debug/apps/wallpaper/build.gradle | 32 - debug/apps/wallpaper/gradle.properties | 2 - .../wallpaper/src/main/AndroidManifest.xml | 23 - .../wallpaper/DebuggerEntryPointActivity.java | 12 - .../src/main/java/wallpaper/MainService.java | 14 - .../src/main/java/wallpaper/Sketch.java | 41 - .../wallpaper/src/main/res/layout/main.xml | 7 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 10486 -> 0 bytes .../src/main/res/values-w820dp/dimens.xml | 6 - .../wallpaper/src/main/res/values/strings.xml | 3 - .../wallpaper/src/main/res/xml/wallpaper.xml | 3 - debug/apps/watchface/build.gradle | 35 - debug/apps/watchface/gradle.properties | 2 - .../watchface/src/main/AndroidManifest.xml | 23 - .../src/main/java/watchface/MainService.java | 15 - .../src/main/java/watchface/Sketch.java | 25 - .../src/main/res/drawable-nodpi/bg.png | Bin 3099 -> 0 bytes .../res/drawable-nodpi/preview_analog.png | Bin 4607 -> 0 bytes .../watchface/src/main/res/layout/main.xml | 7 - .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes .../watchface/src/main/res/values/strings.xml | 5 - .../watchface/src/main/res/xml/watch_face.xml | 2 - debug/build.gradle | 44 - debug/gradle.properties | 21 - debug/gradle/wrapper/gradle-wrapper.jar | Bin 59821 -> 0 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 - debug/libs/google-vr/build.gradle | 10 - .../google-vr/protobuf-javanano-3.1.0.jar | Bin 50197 -> 0 bytes debug/libs/google-vr/sdk-audio-1.180.0.aar | Bin 1272909 -> 0 bytes debug/libs/google-vr/sdk-base-1.180.0.aar | Bin 2946947 -> 0 bytes debug/libs/google-vr/sdk-common-1.180.0.aar | Bin 519380 -> 0 bytes debug/libs/processing-ar/AndroidManifest.xml | 5 - debug/libs/processing-ar/build.gradle | 27 - debug/libs/processing-ar/gradle.properties | 5 - debug/libs/processing-ar/project.properties | 15 - .../libs/processing-core/AndroidManifest.xml | 5 - debug/libs/processing-core/build.gradle | 28 - debug/libs/processing-core/gradle.properties | 5 - debug/libs/processing-core/project.properties | 15 - debug/libs/processing-vr/AndroidManifest.xml | 5 - debug/libs/processing-vr/build.gradle | 26 - debug/libs/processing-vr/gradle.properties | 5 - debug/libs/processing-vr/project.properties | 15 - debug/settings.gradle | 1 - gradle.properties | 2 - gradle/wrapper/gradle-wrapper.jar | Bin 59821 -> 0 bytes gradle/wrapper/gradle-wrapper.properties | 5 - gradlew | 234 - gradlew.bat | 89 - mode/.classpath | 24 - mode/.project | 34 - .../org.eclipse.buildship.core.prefs | 2 - mode/.settings/org.eclipse.jdt.core.prefs | 15 - mode/build.gradle | 106 - mode/examples/Basics/Arrays/Array/Array.pde | 35 - .../Basics/Arrays/Array2D/Array2D.pde | 32 - .../Arrays/ArrayObjects/ArrayObjects.pde | 39 - .../Basics/Arrays/ArrayObjects/Module.pde | 38 - .../Basics/Camera/MoveEye/MoveEye.pde | 29 - .../Basics/Camera/Perspective/Perspective.pde | 42 - .../Basics/Color/Brightness/Brightness.pde | 29 - .../Basics/Color/ColorWheel/ColorWheel.pde | 88 - .../Basics/Color/Creating/Creating.pde | 26 - mode/examples/Basics/Color/Hue/Hue.pde | 31 - .../Color/LinearGradient/LinearGradient.pde | 73 - .../Color/RadialGradient/RadialGradient.pde | 58 - .../Color/RadialGradient2/RadialGradient2.pde | 43 - .../examples/Basics/Color/Reading/Reading.pde | 46 - .../Basics/Color/Reading/data/cait.jpg | Bin 7920 -> 0 bytes .../Basics/Color/Relativity/Relativity.pde | 42 - .../Basics/Color/Saturation/Saturation.pde | 29 - .../Color/WaveGradient/WaveGradient.pde | 39 - .../Control/Conditionals1/Conditionals1.pde | 26 - .../Control/Conditionals2/Conditionals2.pde | 26 - .../EmbeddedIteration/EmbeddedIteration.pde | 27 - .../Basics/Control/Iteration/Iteration.pde | 45 - .../LogicalOperators/LogicalOperators.pde | 45 - .../CharactersStrings/CharactersStrings.pde | 82 - .../Data/CharactersStrings/data/Eureka-90.vlw | Bin 433385 -> 0 bytes .../CharactersStrings/data/rathausFrog.jpg | Bin 8342 -> 0 bytes .../DatatypeConversion/DatatypeConversion.pde | 28 - .../Data/IntegersFloats/IntegersFloats.pde | 36 - .../Basics/Data/TrueFalse/TrueFalse.pde | 34 - .../Data/VariableScope/VariableScope.pde | 61 - .../Basics/Data/Variables/Variables.pde | 23 - mode/examples/Basics/Form/Bezier/Bezier.pde | 18 - .../Form/BezierEllipse/BezierEllipse.pde | 103 - .../Basics/Form/PieChart/PieChart.pde | 23 - .../Basics/Form/PointsLines/PointsLines.pde | 32 - .../Basics/Form/Primitives3D/Primitives3D.pde | 31 - .../Form/ShapePrimitives/ShapePrimitives.pde | 21 - .../Basics/Form/SimpleCurves/SimpleCurves.pde | 81 - .../Form/TriangleStrip/TriangleStrip.pde | 36 - .../Basics/Form/Vertices/Vertices.pde | 47 - .../Basics/Image/Alphamask/Alphamask.pde | 24 - .../Basics/Image/Alphamask/data/mask.jpg | Bin 2825 -> 0 bytes .../Basics/Image/Alphamask/data/test.jpg | Bin 2792 -> 0 bytes .../Image/BackgroundImage/BackgroundImage.pde | 30 - .../BackgroundImage/data/milan_rubbish.jpg | Bin 19754 -> 0 bytes .../Basics/Image/CreateImage/CreateImage.pde | 25 - .../Basics/Image/CreateImage/data/mask.jpg | Bin 2825 -> 0 bytes .../Basics/Image/CreateImage/data/test.jpg | Bin 2792 -> 0 bytes .../LoadDisplayImage/LoadDisplayImage.pde | 23 - .../Image/LoadDisplayImage/data/jelly.jpg | Bin 28211 -> 0 bytes .../Basics/Image/Pointillism/Pointillism.pde | 38 - .../Basics/Image/Pointillism/data/eames.jpg | Bin 44496 -> 0 bytes .../Image/Pointillism/data/sunflower.jpg | Bin 36656 -> 0 bytes .../Image/RequestImage/RequestImage.pde | 91 - mode/examples/Basics/Image/Sprite/Sprite.pde | 38 - .../Basics/Image/Sprite/data/teddy.gif | Bin 746 -> 0 bytes .../examples/Basics/Image/Sprite2/Sprite2.pde | 45 - .../Basics/Image/Sprite2/data/sky.jpg | Bin 13169 -> 0 bytes .../Basics/Image/Sprite2/data/teddy.gif | Bin 746 -> 0 bytes .../Image/Transparency/Transparency.pde | 29 - .../Image/Transparency/data/construct.jpg | Bin 34699 -> 0 bytes .../Basics/Image/Transparency/data/wash.jpg | Bin 34685 -> 0 bytes mode/examples/Basics/Input/Clock/Clock.pde | 64 - .../Basics/Input/Constrain/Constrain.pde | 41 - mode/examples/Basics/Input/Easing/Easing.pde | 41 - .../Basics/Input/Keyboard/Keyboard.pde | 39 - .../KeyboardFunctions/KeyboardFunctions.pde | 89 - .../Input/KeyboardFunctions/data/brugges.jpg | Bin 34371 -> 0 bytes .../Input/Milliseconds/Milliseconds.pde | 26 - .../examples/Basics/Input/Mouse1D/Mouse1D.pde | 47 - .../examples/Basics/Input/Mouse2D/Mouse2D.pde | 24 - .../Input/MouseFunctions/MouseFunctions.pde | 68 - .../Basics/Input/MousePress/MousePress.pde | 23 - .../Input/MouseSignals/MouseSignals.pde | 54 - .../Input/StoringInput/StoringInput.pde | 38 - .../Basics/Lights/Directional/Directional.pde | 29 - .../Basics/Lights/Mixture/Mixture.pde | 35 - .../Basics/Lights/MixtureGrid/MixtureGrid.pde | 43 - mode/examples/Basics/Lights/OnOff/OnOff.pde | 37 - .../Basics/Lights/Reflection/Reflection.pde | 26 - mode/examples/Basics/Lights/Spot/Spot.pde | 35 - .../Basics/Math/AdditiveWave/AdditiveWave.pde | 69 - .../Basics/Math/Arctangent/Arctangent.pde | 67 - .../Basics/Math/Distance1D/Distance1D.pde | 51 - .../Basics/Math/Distance2D/Distance2D.pde | 29 - .../Basics/Math/DoubleRandom/DoubleRandom.pde | 20 - .../Graphing2DEquation/Graphing2DEquation.pde | 40 - .../IncrementDecrement/IncrementDecrement.pde | 46 - mode/examples/Basics/Math/Modulo/Modulo.pde | 31 - mode/examples/Basics/Math/Noise1D/Noise1D.pde | 37 - mode/examples/Basics/Math/Noise2D/Noise2D.pde | 47 - mode/examples/Basics/Math/Noise3D/Noise3D.pde | 54 - .../Basics/Math/NoiseWave/NoiseWave.pde | 60 - .../OperatorPrecedence/OperatorPrecedence.pde | 58 - .../PolarToCartesian/PolarToCartesian.pde | 52 - mode/examples/Basics/Math/Random/Random.pde | 19 - mode/examples/Basics/Math/Sine/Sine.pde | 46 - .../Basics/Math/SineCosine/SineCosine.pde | 59 - .../Basics/Math/SineWave/SineWave.pde | 55 - .../CompositeObjects/CompositeObjects.pde | 24 - .../Basics/Objects/CompositeObjects/Egg.pde | 36 - .../Objects/CompositeObjects/EggRing.pde | 19 - .../Basics/Objects/CompositeObjects/Ring.pde | 27 - .../Objects/Inheritance/Inheritance.pde | 78 - .../MultipleConstructors.pde | 47 - .../Objects/Neighborhood/Neighborhood.pde | 303 - .../Basics/Objects/Objects/Objects.pde | 71 - .../Shape/DisableStyle/DisableStyle.pde | 34 - .../Basics/Shape/DisableStyle/data/bot1.svg | 160 - .../Basics/Shape/GetChild/GetChild.pde | 45 - .../Shape/GetChild/data/usa-wikipedia.svg | 452 - .../Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde | 31 - .../Shape/LoadDisplayOBJ/data/rocket.mtl | 8 - .../Shape/LoadDisplayOBJ/data/rocket.obj | 1688 -- .../Shape/LoadDisplayOBJ/data/rocket.png | Bin 21635 -> 0 bytes .../Shape/LoadDisplaySVG/LoadDisplaySVG.pde | 26 - .../Basics/Shape/LoadDisplaySVG/data/bot1.svg | 160 - .../Basics/Shape/ScaleShape/ScaleShape.pde | 26 - .../Basics/Shape/ScaleShape/data/bot1.svg | 160 - .../Structure/Coordinates/Coordinates.pde | 41 - .../CreateGraphics/CreateGraphics.pde | 33 - .../Structure/CreateGraphics/data/mask.jpg | Bin 2825 -> 0 bytes .../Structure/CreateGraphics/data/test.jpg | Bin 2792 -> 0 bytes .../Basics/Structure/Functions/Functions.pde | 33 - mode/examples/Basics/Structure/Loop/Loop.pde | 40 - .../Basics/Structure/NoLoop/NoLoop.pde | 33 - .../Basics/Structure/Recursion/Recursion.pde | 32 - .../Structure/Recursion2/Recursion2.pde | 32 - .../Basics/Structure/Redraw/Redraw.pde | 37 - .../Basics/Structure/SetupDraw/SetupDraw.pde | 30 - .../StatementsComments/StatementsComments.pde | 20 - .../Structure/WidthHeight/WidthHeight.pde | 16 - mode/examples/Basics/Transform/Arm/Arm.pde | 39 - .../Basics/Transform/Rotate/Rotate.pde | 36 - .../Transform/RotatePushPop/RotatePushPop.pde | 43 - .../Basics/Transform/RotateXY/RotateXY.pde | 41 - .../examples/Basics/Transform/Scale/Scale.pde | 38 - .../Basics/Transform/Translate/Translate.pde | 41 - .../TriangleFlower/TriangleFlower.pde | 47 - .../Basics/Typography/Letters/Letters.pde | 72 - .../Typography/Letters/data/CourierNew36.vlw | Bin 114920 -> 0 bytes .../Basics/Typography/Words/Words.pde | 39 - .../Words/data/Ziggurat-HTF-Black-32.vlw | Bin 118799 -> 0 bytes .../Web/EmbeddedLinks/EmbeddedLinks.pde | 67 - .../Web/LoadingImages/LoadingImages.pde | 13 - .../Demos/Graphics/Particles/Particle.pde | 59 - .../Graphics/Particles/ParticleSystem.pde | 36 - .../Demos/Graphics/Particles/Particles.pde | 30 - .../Demos/Graphics/Particles/data/sprite.png | Bin 2664 -> 0 bytes mode/examples/Demos/Graphics/Patch/Patch.pde | 162 - .../Demos/Graphics/Planets/Perlin.pde | 261 - .../Demos/Graphics/Planets/Planets.pde | 123 - .../Demos/Graphics/Planets/data/mercury.jpg | Bin 285975 -> 0 bytes .../Demos/Graphics/Planets/data/planet.jpg | Bin 22167 -> 0 bytes .../Demos/Graphics/Planets/data/starfield.jpg | Bin 83323 -> 0 bytes .../Demos/Graphics/Planets/data/sun.jpg | Bin 121897 -> 0 bytes .../Demos/Graphics/Ribbons/ArcBall.pde | 190 - .../Demos/Graphics/Ribbons/BSpline.pde | 307 - .../Demos/Graphics/Ribbons/Geometry.pde | 497 - mode/examples/Demos/Graphics/Ribbons/PDB.pde | 115 - .../Demos/Graphics/Ribbons/Ribbons.pde | 52 - .../Demos/Graphics/Ribbons/data/1CBS.pdb | 1573 -- .../Demos/Graphics/Ribbons/data/2POR.pdb | 3257 --- .../Demos/Graphics/Ribbons/data/4HHB.pdb | 5991 ------ .../Graphics/RotatingArcs/RotatingArcs.pde | 162 - .../Demos/Graphics/Trefoil/Surface.pde | 105 - .../Demos/Graphics/Trefoil/Trefoil.pde | 43 - .../Demos/Graphics/Trefoil/data/particle.png | Bin 2664 -> 0 bytes .../Demos/Graphics/Wiggling/Wiggling.pde | 289 - .../Demos/Graphics/Yellowtail/Gesture.pde | 255 - .../Demos/Graphics/Yellowtail/Polygon.pde | 12 - .../Demos/Graphics/Yellowtail/Vec3f.pde | 19 - .../Demos/Graphics/Yellowtail/Yellowtail.pde | 186 - .../CubicGridImmediate/CubicGridImmediate.pde | 66 - .../CubicGridRetained/CubicGridRetained.pde | 63 - .../DynamicParticlesImmediate.pde | 119 - .../DynamicParticlesImmediate/data/sprite.png | Bin 2664 -> 0 bytes .../DynamicParticlesRetained.pde | 112 - .../DynamicParticlesRetained/data/sprite.png | Bin 2664 -> 0 bytes .../Demos/Performance/Esfera/Esfera.pde | 89 - .../LineRendering/LineRendering.pde | 26 - .../Demos/Performance/P2DXDemo/P2DXDemo.pde | 60 - .../QuadRendering/QuadRendering.pde | 19 - .../StaticParticlesImmediate.pde | 66 - .../StaticParticlesImmediate/data/sprite.png | Bin 2664 -> 0 bytes .../StaticParticlesRetained.pde | 61 - .../StaticParticlesRetained/data/sprite.png | Bin 2664 -> 0 bytes .../TextRendering/TextRendering.pde | 17 - .../NoBackgroundTest/NoBackgroundTest.pde | 10 - .../Tests/OffscreenTest/OffscreenTest.pde | 19 - .../Demos/Tests/RedrawTest/RedrawTest.pde | 15 - .../Sensors/Accelerometer/Accelerometer.pde | 49 - .../Accelerometer/AccelerometerManager.java | 244 - mode/examples/Sensors/Compass/Compass.pde | 39 - .../Sensors/Compass/CompassManager.java | 141 - .../ArrayListClass/ArrayListClass.pde | 52 - .../Advanced Data/ArrayListClass/Ball.pde | 50 - .../DirectoryList/DirectoryList.pde | 105 - .../HashMapClass/HashMapClass.pde | 89 - .../Advanced Data/HashMapClass/Word.pde | 15 - .../HashMapClass/data/dracula.txt | 16624 ---------------- .../HashMapClass/data/hamlet.txt | 6771 ------- .../AnimatedSprite/AnimatedSprite.pde | 39 - .../Animation/AnimatedSprite/Animation.pde | 27 - .../AnimatedSprite/data/PT_Shifty_0000.gif | Bin 314 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0001.gif | Bin 314 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0002.gif | Bin 318 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0003.gif | Bin 328 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0004.gif | Bin 343 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0005.gif | Bin 379 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0006.gif | Bin 420 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0007.gif | Bin 501 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0008.gif | Bin 615 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0009.gif | Bin 733 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0010.gif | Bin 806 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0011.gif | Bin 842 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0012.gif | Bin 877 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0013.gif | Bin 877 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0014.gif | Bin 951 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0015.gif | Bin 934 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0016.gif | Bin 917 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0017.gif | Bin 907 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0018.gif | Bin 907 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0019.gif | Bin 892 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0020.gif | Bin 854 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0021.gif | Bin 841 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0022.gif | Bin 886 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0023.gif | Bin 805 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0024.gif | Bin 733 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0025.gif | Bin 667 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0026.gif | Bin 596 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0027.gif | Bin 539 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0028.gif | Bin 503 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0029.gif | Bin 451 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0030.gif | Bin 392 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0031.gif | Bin 351 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0032.gif | Bin 333 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0033.gif | Bin 323 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0034.gif | Bin 316 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0035.gif | Bin 316 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0036.gif | Bin 315 -> 0 bytes .../AnimatedSprite/data/PT_Shifty_0037.gif | Bin 312 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0000.gif | Bin 305 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0001.gif | Bin 309 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0002.gif | Bin 310 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0003.gif | Bin 310 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0004.gif | Bin 315 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0005.gif | Bin 329 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0006.gif | Bin 339 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0007.gif | Bin 354 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0008.gif | Bin 390 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0009.gif | Bin 415 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0010.gif | Bin 451 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0011.gif | Bin 482 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0012.gif | Bin 546 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0013.gif | Bin 566 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0014.gif | Bin 607 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0015.gif | Bin 692 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0016.gif | Bin 778 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0017.gif | Bin 853 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0018.gif | Bin 914 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0019.gif | Bin 936 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0020.gif | Bin 968 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0021.gif | Bin 971 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0022.gif | Bin 987 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0023.gif | Bin 1013 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0024.gif | Bin 1014 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0025.gif | Bin 1002 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0026.gif | Bin 976 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0027.gif | Bin 984 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0028.gif | Bin 936 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0029.gif | Bin 891 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0030.gif | Bin 826 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0031.gif | Bin 717 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0032.gif | Bin 625 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0033.gif | Bin 543 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0034.gif | Bin 486 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0035.gif | Bin 468 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0036.gif | Bin 453 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0037.gif | Bin 440 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0038.gif | Bin 428 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0039.gif | Bin 410 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0040.gif | Bin 387 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0041.gif | Bin 351 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0042.gif | Bin 329 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0043.gif | Bin 322 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0044.gif | Bin 318 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0045.gif | Bin 315 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0046.gif | Bin 310 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0047.gif | Bin 311 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0048.gif | Bin 311 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0049.gif | Bin 312 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0050.gif | Bin 312 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0051.gif | Bin 311 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0052.gif | Bin 308 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0053.gif | Bin 306 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0054.gif | Bin 303 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0055.gif | Bin 303 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0056.gif | Bin 306 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0057.gif | Bin 308 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0058.gif | Bin 306 -> 0 bytes .../AnimatedSprite/data/PT_Teddy_0059.gif | Bin 306 -> 0 bytes .../Animation/Sequential/Sequential.pde | 46 - .../Animation/Sequential/data/PT_anim0000.gif | Bin 3840 -> 0 bytes .../Animation/Sequential/data/PT_anim0001.gif | Bin 3819 -> 0 bytes .../Animation/Sequential/data/PT_anim0002.gif | Bin 3910 -> 0 bytes .../Animation/Sequential/data/PT_anim0003.gif | Bin 3750 -> 0 bytes .../Animation/Sequential/data/PT_anim0004.gif | Bin 3681 -> 0 bytes .../Animation/Sequential/data/PT_anim0005.gif | Bin 3657 -> 0 bytes .../Animation/Sequential/data/PT_anim0006.gif | Bin 3437 -> 0 bytes .../Animation/Sequential/data/PT_anim0007.gif | Bin 3547 -> 0 bytes .../Animation/Sequential/data/PT_anim0008.gif | Bin 3631 -> 0 bytes .../Animation/Sequential/data/PT_anim0009.gif | Bin 3651 -> 0 bytes .../Animation/Sequential/data/PT_anim0010.gif | Bin 3695 -> 0 bytes .../Animation/Sequential/data/PT_anim0011.gif | Bin 3827 -> 0 bytes .../Cellular Automata/Conway/Conway.pde | 80 - .../Cellular Automata/Spore1/Spore1.pde | 133 - .../Cellular Automata/Spore2/Spore2.pde | 174 - .../Topics/Cellular Automata/Wolfram/CA.pde | 94 - .../Cellular Automata/Wolfram/Wolfram.pde | 38 - .../BeginEndContour/BeginEndContour.pde | 45 - .../Create Shapes/GroupPShape/GroupPShape.pde | 68 - .../ParticleSystemPShape/Particle.pde | 82 - .../ParticleSystemPShape/ParticleSystem.pde | 43 - .../ParticleSystemPShape.pde | 42 - .../ParticleSystemPShape/data/sprite.png | Bin 2664 -> 0 bytes .../Create Shapes/PathPShape/PathPShape.pde | 38 - .../PolygonPShape/PolygonPShape.pde | 42 - .../PolygonPShapeOOP/PolygonPShapeOOP.pde | 30 - .../Create Shapes/PolygonPShapeOOP/Star.pde | 52 - .../PolygonPShapeOOP2/Polygon.pde | 34 - .../PolygonPShapeOOP2/PolygonPShapeOOP2.pde | 53 - .../PolygonPShapeOOP3/Polygon.pde | 34 - .../PolygonPShapeOOP3/PolygonPShapeOOP3.pde | 63 - .../PrimitivePShape/PrimitivePShape.pde | 29 - .../WigglePShape/WigglePShape.pde | 23 - .../Create Shapes/WigglePShape/Wiggler.pde | 67 - .../Topics/Drawing/Animator/Animator.pde | 49 - .../ContinuousLines/ContinuousLines.pde | 17 - .../Topics/Drawing/CustomTool/CustomTool.pde | 84 - .../Topics/Drawing/CustomTool/data/milan.jpg | Bin 8729 -> 0 bytes .../Topics/Drawing/CustomTool/data/paris.jpg | Bin 67866 -> 0 bytes .../Topics/Drawing/Pattern/Pattern.pde | 34 - .../examples/Topics/Drawing/Pulses/Pulses.pde | 33 - .../ScribblePlotter/ScribblePlotter.pde | 91 - .../Topics/Effects/FireCube/FireCube.pde | 113 - mode/examples/Topics/Effects/Lens/Lens.pde | 104 - .../Topics/Effects/Lens/data/red_smoke.jpg | Bin 48987 -> 0 bytes .../Topics/Effects/Metaball/Metaball.pde | 76 - .../examples/Topics/Effects/Plasma/Plasma.pde | 60 - .../examples/Topics/Effects/Tunnel/Tunnel.pde | 114 - .../Topics/Effects/Tunnel/data/red_smoke.jpg | Bin 48987 -> 0 bytes .../UnlimitedSprites/UnlimitedSprites.pde | 60 - .../UnlimitedSprites/data/Aqua-Ball-48x48.png | Bin 3343 -> 0 bytes .../Topics/Effects/Wormhole/Wormhole.pde | 70 - .../Topics/Effects/Wormhole/data/texture.gif | Bin 95 -> 0 bytes .../Topics/Effects/Wormhole/data/wormhole.png | Bin 27132 -> 0 bytes .../Topics/File IO/LoadFile1/LoadFile1.pde | 30 - .../File IO/LoadFile1/data/positions.txt | 206 - .../Topics/File IO/LoadFile2/LoadFile2.pde | 55 - .../Topics/File IO/LoadFile2/Record.pde | 23 - .../LoadFile2/data/TheSans-Plain-12.vlw | Bin 18476 -> 0 bytes .../Topics/File IO/LoadFile2/data/cars2.tsv | 406 - .../Topics/File IO/SaveFile1/SaveFile1.pde | 49 - .../Topics/File IO/SaveFile2/SaveFile2.pde | 34 - .../File IO/SaveManyImages/SaveManyImages.pde | 28 - .../File IO/SaveOneImage/SaveOneImage.pde | 25 - .../Topics/File IO/TileImages/TileImages.pde | 37 - .../Fractals and L-Systems/Koch/Koch.pde | 176 - .../Mandelbrot/Mandelbrot.pde | 75 - .../PenroseSnowflake/LSystem.pde | 76 - .../PenroseSnowflake/PenroseSnowflake.pde | 24 - .../PenroseSnowflakeLSystem.pde | 100 - .../PenroseTile/LSystem.pde | 74 - .../PenroseTile/PenroseLSystem.pde | 128 - .../PenroseTile/PenroseTile.pde | 28 - .../Pentigree/LSystem.pde | 76 - .../Pentigree/Pentigree.pde | 23 - .../Pentigree/PentigreeLSystem.pde | 71 - .../Fractals and L-Systems/Tree/Tree.pde | 61 - mode/examples/Topics/GUI/Button/Button.pde | 100 - mode/examples/Topics/GUI/Buttons/Buttons.pde | 220 - mode/examples/Topics/GUI/Handles/Handles.pde | 139 - .../Topics/GUI/ImageButton/ImageButton.pde | 108 - .../Topics/GUI/ImageButton/data/base.gif | Bin 774 -> 0 bytes .../Topics/GUI/ImageButton/data/down.gif | Bin 656 -> 0 bytes .../Topics/GUI/ImageButton/data/roll.gif | Bin 774 -> 0 bytes .../examples/Topics/GUI/Rollover/Rollover.pde | 88 - .../Topics/GUI/Scrollbar/Scrollbar.pde | 122 - .../Topics/GUI/Scrollbar/data/seedBottom.jpg | Bin 13319 -> 0 bytes .../Topics/GUI/Scrollbar/data/seedTop.jpg | Bin 15044 -> 0 bytes .../Geometry/Icosahedra/Dimension3D.pde | 10 - .../Topics/Geometry/Icosahedra/Icosahedra.pde | 53 - .../Geometry/Icosahedra/Icosahedron.pde | 159 - .../Topics/Geometry/Icosahedra/Shape3D.pde | 82 - .../Geometry/NoiseSphere/NoiseSphere.pde | 83 - .../Topics/Geometry/RGBCube/RGBCube.pde | 75 - .../ShapeTransform/ShapeTransform.pde | 112 - .../Topics/Geometry/SpaceJunk/Cube.pde | 67 - .../Topics/Geometry/SpaceJunk/SpaceJunk.pde | 61 - .../Topics/Geometry/Toroid/Toroid.pde | 183 - .../Topics/Geometry/Vertices/Vertices.pde | 68 - .../Topics/Image Processing/Blur/Blur.pde | 44 - .../Image Processing/Blur/data/trees.jpg | Bin 34820 -> 0 bytes .../Brightness/Brightness.pde | 49 - .../Brightness/data/wires.jpg | Bin 12813 -> 0 bytes .../Convolution/Convolution.pde | 75 - .../Image Processing/Convolution/data/end.jpg | Bin 36399 -> 0 bytes .../Convolution/data/sunflower.jpg | Bin 36656 -> 0 bytes .../EdgeDetection/EdgeDetection.pde | 39 - .../EdgeDetection/data/house.jpg | Bin 26723 -> 0 bytes .../Image Processing/Histogram/Histogram.pde | 42 - .../Histogram/data/cdi01_g.jpg | Bin 26047 -> 0 bytes .../Histogram/data/ystone08.jpg | Bin 56999 -> 0 bytes .../LinearImage/LinearImage.pde | 43 - .../LinearImage/data/florence03.jpg | Bin 58018 -> 0 bytes .../PixelArray/PixelArray.pde | 48 - .../PixelArray/data/ystone08.jpg | Bin 56999 -> 0 bytes .../Topics/Interaction/Follow1/Follow1.pde | 39 - .../Topics/Interaction/Follow2/Follow2.pde | 42 - .../Topics/Interaction/Follow3/Follow3.pde | 44 - .../Interaction/Multitouch/Multitouch.pde | 33 - .../Topics/Interaction/Reach1/Reach1.pde | 49 - .../Topics/Interaction/Reach2/Reach2.pde | 60 - .../Topics/Interaction/Reach3/Reach3.pde | 77 - .../Topics/Interaction/Tickle/Tickle.pde | 37 - .../Tickle/data/AmericanTypewriter-24.vlw | Bin 58300 -> 0 bytes mode/examples/Topics/Motion/Bounce/Bounce.pde | 47 - .../Motion/BouncyBubbles/BouncyBubbles.pde | 97 - .../Topics/Motion/Brownian/Brownian.pde | 48 - .../Topics/Motion/CircleCollision/Ball.pde | 16 - .../CircleCollision/CircleCollision.pde | 136 - .../Topics/Motion/Collision/Collision.pde | 85 - mode/examples/Topics/Motion/Linear/Linear.pde | 26 - .../Motion/MovingOnCurves/MovingOnCurves.pde | 50 - mode/examples/Topics/Motion/Puff/Puff.pde | 91 - .../Topics/Motion/Reflection1/Reflection1.pde | 129 - .../Topics/Motion/Reflection2/Ground.pde | 20 - .../Topics/Motion/Reflection2/Orb.pde | 14 - .../Topics/Motion/Reflection2/Reflection2.pde | 128 - .../Topics/Shaders/BlurFilter/BlurFilter.pde | 26 - .../Topics/Shaders/BlurFilter/data/blur.glsl | 42 - .../Topics/Shaders/EdgeDetect/EdgeDetect.pde | 32 - .../Topics/Shaders/EdgeDetect/data/edges.glsl | 40 - .../Topics/Shaders/EdgeDetect/data/leaves.jpg | Bin 43231 -> 0 bytes .../Topics/Shaders/EdgeFilter/EdgeFilter.pde | 43 - .../Topics/Shaders/EdgeFilter/data/edges.glsl | 40 - .../Topics/Shaders/LowLevelGL/LowLevelGL.pde | 104 - .../Topics/Shaders/LowLevelGL/data/frag.glsl | 30 - .../Topics/Shaders/LowLevelGL/data/vert.glsl | 33 - .../Shaders/ToonShading/ToonShading.pde | 44 - .../Shaders/ToonShading/data/ToonFrag.glsl | 25 - .../Shaders/ToonShading/data/ToonVert.glsl | 31 - mode/examples/Topics/Simulate/Chain/Chain.pde | 68 - .../Topics/Simulate/Flocking/Boid.pde | 196 - .../Topics/Simulate/Flocking/Flock.pde | 22 - .../Topics/Simulate/Flocking/Flocking.pde | 32 - .../ForcesWithVectors/ForcesWithVectors.pde | 77 - .../Simulate/ForcesWithVectors/Liquid.pde | 60 - .../Simulate/ForcesWithVectors/Mover.pde | 64 - .../GravitationalAttraction3D.pde | 71 - .../GravitationalAttraction3D/Planet.pde | 45 - .../GravitationalAttraction3D/Sun.pde | 39 - .../MultipleParticleSystems/CrazyParticle.pde | 47 - .../MultipleParticleSystems.pde | 50 - .../MultipleParticleSystems/Particle.pde | 57 - .../ParticleSystem.pde | 51 - .../SimpleParticleSystem/Particle.pde | 67 - .../SimpleParticleSystem/ParticleSystem.pde | 50 - .../SimpleParticleSystem.pde | 27 - .../Simulate/SmokeParticleSystem/Particle.pde | 59 - .../SmokeParticleSystem/ParticleSystem.pde | 42 - .../SmokeParticleSystem.pde | 50 - .../SmokeParticleSystem/data/texture.gif | Bin 1829 -> 0 bytes .../SmokeParticleSystem/data/texture.png | Bin 3554 -> 0 bytes .../Topics/Simulate/SoftBody/SoftBody.pde | 99 - .../Topics/Simulate/Spring/Spring.pde | 97 - .../Topics/Simulate/Springs/Springs.pde | 162 - .../Textures/TextureCube/TextureCube.pde | 92 - .../Textures/TextureCube/data/berlin-1.jpg | Bin 81834 -> 0 bytes .../Textures/TextureCube/data/uvtex.jpg | Bin 55910 -> 0 bytes .../TextureCylinder/TextureCylinder.pde | 49 - .../TextureCylinder/data/berlin-1.jpg | Bin 81834 -> 0 bytes .../Textures/TextureQuad/TextureQuad.pde | 32 - .../Textures/TextureQuad/data/berlin-1.jpg | Bin 81834 -> 0 bytes .../Textures/TextureSphere/TextureSphere.pde | 175 - .../Textures/TextureSphere/data/world32k.jpg | Bin 258508 -> 0 bytes .../TextureTriangle/TextureTriangle.pde | 29 - .../TextureTriangle/data/berlin-1.jpg | Bin 81834 -> 0 bytes .../AccelerationWithVectors.pde | 30 - .../Vectors/AccelerationWithVectors/Mover.pde | 53 - .../Vectors/BouncingBall/BouncingBall.pde | 49 - .../Topics/Vectors/Normalize/Normalize.pde | 37 - .../Topics/Vectors/VectorMath/VectorMath.pde | 37 - .../Topics/Wallpapers/Circles/Circles.pde | 17 - .../Wallpapers/Circles/code/sketch.properties | 1 - .../Topics/Watchfaces/WatchFace/WatchFace.pde | 28 - .../WatchFace/code/sketch.properties | 1 - mode/icons/launcher_144.png | Bin 10681 -> 0 bytes mode/icons/launcher_192.png | Bin 15256 -> 0 bytes mode/icons/launcher_36.png | Bin 2597 -> 0 bytes mode/icons/launcher_48.png | Bin 3614 -> 0 bytes mode/icons/launcher_72.png | Bin 5262 -> 0 bytes mode/icons/launcher_96.png | Bin 7298 -> 0 bytes mode/icons/preview_circular.png | Bin 34488 -> 0 bytes mode/icons/preview_rectangular.png | Bin 22748 -> 0 bytes mode/keywords.txt | 50 - mode/languages/mode.properties | 328 - mode/languages/mode_ko.properties | 31 - mode/libraries/ar/README.md | 21 - mode/libraries/ar/build.gradle | 97 - mode/libraries/ar/examples/Cubes/Cubes.pde | 93 - .../ar/examples/Cubes/code/sketch.properties | 1 - .../ar/examples/ImportObj/ImportObj.pde | 31 - .../examples/ImportObj/code/sketch.properties | 1 - .../ar/examples/ImportObj/data/grey.png | Bin 480 -> 0 bytes .../ar/examples/ImportObj/data/materials.mtl | 12 - .../ar/examples/ImportObj/data/model.obj | 949 - .../libraries/ar/examples/Spheres/Spheres.pde | 62 - .../examples/Spheres/code/sketch.properties | 3 - mode/libraries/ar/library.properties | 10 - .../ar/src/assets/shaders/ARLightFrag.glsl | 49 - .../ar/src/assets/shaders/ARLightVert.glsl | 156 - .../ar/src/assets/shaders/ARTexLightFrag.glsl | 56 - .../ar/src/assets/shaders/ARTexLightVert.glsl | 162 - .../ar/src/assets/shaders/BackgroundFrag.glsl | 9 - .../ar/src/assets/shaders/BackgroundVert.glsl | 9 - .../ar/src/processing/ar/ARAnchor.java | 87 - .../ar/src/processing/ar/ARGraphics.java | 538 - .../ar/src/processing/ar/ARSurface.java | 332 - .../ar/src/processing/ar/ARTrackable.java | 127 - .../ar/src/processing/ar/ARTracker.java | 149 - .../src/processing/ar/BackgroundRenderer.java | 152 - .../ar/src/processing/ar/RotationHandler.java | 62 - .../ar/src/processing/ar/ShaderUtils.java | 60 - mode/libraries/vr/README.md | 4 - mode/libraries/vr/build.gradle | 103 - mode/libraries/vr/examples/Cube/Cube.pde | 14 - .../vr/examples/Cube/code/sketch.properties | 3 - .../vr/examples/GenerateRay/GenerateRay.pde | 59 - .../GenerateRay/code/sketch.properties | 3 - .../examples/IntersectsBox/IntersectsBox.pde | 27 - .../IntersectsBox/code/sketch.properties | 3 - .../IntersectsPlane/IntersectsPlane.pde | 39 - .../IntersectsPlane/code/sketch.properties | 3 - .../IntersectsSphere/IntersectsSphere.pde | 42 - .../IntersectsSphere/code/sketch.properties | 3 - mode/libraries/vr/examples/Mono/Mono.pde | 14 - .../vr/examples/Mono/code/sketch.properties | 3 - .../vr/examples/Stereoscopy/Stereoscopy.pde | 88 - .../Stereoscopy/code/sketch.properties | 3 - .../examples/drawAim/code/sketch.properties | 3 - .../libraries/vr/examples/drawAim/drawAim.pde | 68 - mode/libraries/vr/library.properties | 10 - mode/libraries/vr/libs/sdk-audio-1.180.0.aar | Bin 1272909 -> 0 bytes mode/libraries/vr/libs/sdk-base-1.180.0.aar | Bin 2946947 -> 0 bytes mode/libraries/vr/libs/sdk-common-1.180.0.aar | Bin 519380 -> 0 bytes .../vr/src/processing/vr/VRActivity.java | 195 - .../vr/src/processing/vr/VRCamera.java | 67 - .../vr/src/processing/vr/VRGraphics.java | 264 - .../vr/src/processing/vr/VRGraphicsMono.java | 35 - .../src/processing/vr/VRGraphicsStereo.java | 35 - .../vr/src/processing/vr/VRSurface.java | 338 - mode/mode.properties | 11 - mode/mode/JavaMode.jar | Bin 600037 -> 0 bytes mode/mode/core.jar | Bin 1013916 -> 0 bytes mode/mode/gradlew.zip | Bin 5611 -> 0 bytes mode/mode/istack-commons-runtime.jar | Bin 26458 -> 0 bytes mode/mode/javax.activation-api.jar | Bin 56674 -> 0 bytes mode/mode/jaxb-api.jar | Bin 128076 -> 0 bytes mode/mode/jaxb-jxc.jar | Bin 132058 -> 0 bytes mode/mode/jaxb-runtime.jar | Bin 1093432 -> 0 bytes mode/mode/jaxb-xjc.jar | Bin 986956 -> 0 bytes mode/mode/jdi.jar | Bin 74716 -> 0 bytes mode/mode/jdimodel.jar | Bin 946581 -> 0 bytes mode/mode/org.eclipse.core.contenttype.jar | Bin 99045 -> 0 bytes mode/mode/org.eclipse.core.jobs.jar | Bin 106979 -> 0 bytes mode/mode/org.eclipse.core.resources.jar | Bin 884203 -> 0 bytes mode/mode/org.eclipse.core.runtime.jar | Bin 78761 -> 0 bytes mode/mode/org.eclipse.equinox.common.jar | Bin 111495 -> 0 bytes mode/mode/org.eclipse.equinox.preferences.jar | Bin 128409 -> 0 bytes mode/mode/org.eclipse.jdt.core.jar | Bin 5640136 -> 0 bytes mode/mode/org.eclipse.osgi.jar | Bin 1305726 -> 0 bytes mode/mode/org.eclipse.text.jar | Bin 253040 -> 0 bytes mode/mode/pde.jar | Bin 624723 -> 0 bytes .../device-art-resources/device-art.xml | 154 - .../device-art-resources/pixel_3/layout | 38 - .../pixel_3/port_back.webp | Bin 1142086 -> 0 bytes .../pixel_3/round_corners.webp | Bin 1822 -> 0 bytes .../device-art-resources/pixel_6/back.webp | Bin 189888 -> 0 bytes .../device-art-resources/pixel_6/layout | 36 - .../device-art-resources/pixel_6/mask.webp | Bin 6562 -> 0 bytes .../pixel_c/land_back.webp | Bin 38850 -> 0 bytes .../pixel_c/land_fore.webp | Bin 20928 -> 0 bytes .../pixel_c/land_shadow.webp | Bin 17104 -> 0 bytes .../device-art-resources/pixel_c/layout | 59 - .../pixel_c/port_back.webp | Bin 34566 -> 0 bytes .../pixel_c/port_fore.webp | Bin 19534 -> 0 bytes .../pixel_c/port_shadow.webp | Bin 15866 -> 0 bytes .../wearos_small_round/device_bezel.png | Bin 31612 -> 0 bytes .../wearos_small_round/hardware.ini | 3 - .../wearos_small_round/layout | 46 - .../wearos_square/device_bezel.png | Bin 14982 -> 0 bytes .../wearos_square/hardware.ini | 3 - .../device-art-resources/wearos_square/layout | 46 - mode/scripts/permissions.py | 84 - mode/scripts/requirements.txt | 1 - mode/src/processing/mode/android/AVD.java | 484 - .../processing/mode/android/AndroidBuild.java | 1115 -- .../mode/android/AndroidDebugger.java | 411 - .../mode/android/AndroidEditor.java | 828 - .../mode/android/AndroidKeyStore.java | 120 - .../mode/android/AndroidLineBreakpoint.java | 59 - .../processing/mode/android/AndroidMode.java | 441 - .../mode/android/AndroidRunner.java | 298 - .../processing/mode/android/AndroidSDK.java | 883 - .../processing/mode/android/AndroidTool.java | 138 - .../mode/android/AndroidToolbar.java | 218 - .../processing/mode/android/AndroidUtil.java | 347 - .../processing/mode/android/Commander.java | 360 - mode/src/processing/mode/android/Device.java | 488 - .../mode/android/DeviceListener.java | 30 - mode/src/processing/mode/android/Devices.java | 399 - .../mode/android/EmulatorController.java | 209 - .../mode/android/KeyStoreManager.java | 343 - mode/src/processing/mode/android/Keys.java | 38 - .../src/processing/mode/android/LogEntry.java | 80 - .../src/processing/mode/android/Manifest.java | 446 - mode/src/processing/mode/android/Pair.java | 75 - .../processing/mode/android/Permissions.java | 566 - .../mode/android/RedirectStreamHandler.java | 34 - .../mode/android/SDKDownloader.java | 689 - .../mode/android/SysImageDownloader.java | 568 - mode/templates/ARActivity.java.tmpl | 102 - mode/templates/ARBuild.gradle.tmpl | 54 - mode/templates/ARBuildECJ.gradle.tmpl | 100 - mode/templates/ARManifest.xml.tmpl | 30 - mode/templates/AppActivity.java.tmpl | 57 - mode/templates/AppBuild.gradle.tmpl | 59 - mode/templates/AppBuildECJ.gradle.tmpl | 104 - mode/templates/AppManifest.xml.tmpl | 17 - mode/templates/ExpProperties.gradle.tmpl | 3 - mode/templates/LayoutActivity.xml.tmpl | 7 - mode/templates/Properties.gradle.tmpl | 12 - mode/templates/Properties.local.tmpl | 1 - mode/templates/Settings.gradle.tmpl | 1 - mode/templates/StringsWallpaper.xml.tmpl | 3 - mode/templates/StylesAR.xml.tmpl | 9 - mode/templates/StylesFragment.xml.tmpl | 8 - mode/templates/StylesVR.xml.tmpl | 9 - mode/templates/TopBuild.gradle.tmpl | 29 - mode/templates/VRActivity.java.tmpl | 16 - mode/templates/VRBuild.gradle.tmpl | 59 - mode/templates/VRBuildECJ.gradle.tmpl | 105 - mode/templates/VRManifest.xml.tmpl | 29 - mode/templates/WallpaperManifest.xml.tmpl | 21 - mode/templates/WallpaperService.java.tmpl | 13 - mode/templates/WatchFaceManifest.xml.tmpl | 32 - mode/templates/WatchFaceService.java.tmpl | 13 - mode/templates/WearBuild.gradle.tmpl | 51 - mode/templates/WearBuildECJ.gradle.tmpl | 104 - mode/templates/XMLWallpaper.xml.tmpl | 3 - mode/templates/XMLWatchFace.xml.tmpl | 1 - mode/theme/completion/class_obj-1x.png | Bin 1215 -> 0 bytes mode/theme/completion/class_obj-2x.png | Bin 1417 -> 0 bytes .../theme/completion/field_default_obj-1x.png | Bin 1139 -> 0 bytes .../theme/completion/field_default_obj-2x.png | Bin 1247 -> 0 bytes .../completion/field_protected_obj-1x.png | Bin 1134 -> 0 bytes .../completion/field_protected_obj-2x.png | Bin 1217 -> 0 bytes mode/theme/completion/methpub_obj-1x.png | Bin 1199 -> 0 bytes mode/theme/completion/methpub_obj-2x.png | Bin 1415 -> 0 bytes mode/theme/debug/breakpoint-enabled-1x.png | Bin 202 -> 0 bytes mode/theme/debug/breakpoint-enabled-2x.png | Bin 400 -> 0 bytes mode/theme/debug/continue-enabled-1x.png | Bin 157 -> 0 bytes mode/theme/debug/continue-enabled-2x.png | Bin 263 -> 0 bytes mode/theme/debug/step-enabled-1x.png | Bin 204 -> 0 bytes mode/theme/debug/step-enabled-2x.png | Bin 344 -> 0 bytes mode/theme/variables-1x.png | Bin 2408 -> 0 bytes mode/theme/variables-2x.png | Bin 4751 -> 0 bytes mode/tools/SDKUpdater/.classpath | 21 - mode/tools/SDKUpdater/.gitignore | 3 - mode/tools/SDKUpdater/.project | 34 - .../org.eclipse.buildship.core.prefs | 2 - .../.settings/org.eclipse.jdt.core.prefs | 12 - mode/tools/SDKUpdater/build.gradle | 62 - .../mode/android/tools/SDKUpdater.java | 654 - mode/version.properties | 27 - .../4.5.0b5/processing-core-4.5.0b5.jar | Bin 0 -> 810547 bytes .../4.5.0b5/processing-core-4.5.0b5.jar.md5 | 1 + .../4.5.0b5/processing-core-4.5.0b5.jar.sha1 | 1 + .../4.5.0b5/processing-core-4.5.0b5.pom | 9 + .../4.5.0b5/processing-core-4.5.0b5.pom.md5 | 1 + .../4.5.0b5/processing-core-4.5.0b5.pom.sha1 | 1 + .../processing-core/maven-metadata-local.xml | 12 + .../maven-metadata-local.xml.md5 | 1 + .../maven-metadata-local.xml.sha1 | 1 + release.sh | 3 + scripts/publish-module.gradle | 55 - scripts/publish-root.gradle | 36 - settings.gradle | 2 - 950 files changed, 42 insertions(+), 173974 deletions(-) delete mode 100644 .github/FUNDING.yml delete mode 100644 build.gradle delete mode 100644 buildSrc/build.gradle delete mode 100644 buildSrc/src/main/groovy/processing/android/ImportAar.groovy delete mode 100644 buildSrc/src/main/resources/META-INF/gradle-plugins/aar.properties delete mode 100644 core/build.gradle delete mode 100644 core/src/assets/shaders/ColorFrag.glsl delete mode 100644 core/src/assets/shaders/ColorVert.glsl delete mode 100644 core/src/assets/shaders/LightFrag.glsl delete mode 100644 core/src/assets/shaders/LightVert.glsl delete mode 100644 core/src/assets/shaders/LineFrag.glsl delete mode 100644 core/src/assets/shaders/LineVert.glsl delete mode 100644 core/src/assets/shaders/MaskFrag.glsl delete mode 100644 core/src/assets/shaders/P2DFrag.glsl delete mode 100644 core/src/assets/shaders/P2DVert.glsl delete mode 100644 core/src/assets/shaders/PointFrag.glsl delete mode 100644 core/src/assets/shaders/PointVert.glsl delete mode 100644 core/src/assets/shaders/TexFrag.glsl delete mode 100644 core/src/assets/shaders/TexLightFrag.glsl delete mode 100644 core/src/assets/shaders/TexLightVert.glsl delete mode 100644 core/src/assets/shaders/TexVert.glsl delete mode 100644 core/src/processing/a2d/PGraphicsAndroid2D.java delete mode 100644 core/src/processing/a2d/PShapeAndroid2D.java delete mode 100644 core/src/processing/a2d/PSurfaceAndroid2D.java delete mode 100644 core/src/processing/android/ActivityAPI.java delete mode 100644 core/src/processing/android/AppComponent.java delete mode 100644 core/src/processing/android/CompatUtils.java delete mode 100644 core/src/processing/android/PFragment.java delete mode 100644 core/src/processing/android/PWallpaper.java delete mode 100644 core/src/processing/android/PWatchFaceCanvas.java delete mode 100644 core/src/processing/android/PWatchFaceGLES.java delete mode 100644 core/src/processing/android/PermissionRequestor.java delete mode 100644 core/src/processing/android/ServiceEngine.java delete mode 100644 core/src/processing/core/PApplet.java delete mode 100644 core/src/processing/core/PConstants.java delete mode 100644 core/src/processing/core/PFont.java delete mode 100644 core/src/processing/core/PGraphics.java delete mode 100644 core/src/processing/core/PImage.java delete mode 100644 core/src/processing/core/PMatrix.java delete mode 100644 core/src/processing/core/PMatrix2D.java delete mode 100644 core/src/processing/core/PMatrix3D.java delete mode 100644 core/src/processing/core/PShape.java delete mode 100644 core/src/processing/core/PShapeOBJ.java delete mode 100644 core/src/processing/core/PShapeSVG.java delete mode 100644 core/src/processing/core/PStyle.java delete mode 100644 core/src/processing/core/PSurface.java delete mode 100644 core/src/processing/core/PSurfaceNone.java delete mode 100644 core/src/processing/core/PVector.java delete mode 100644 core/src/processing/data/DoubleDict.java delete mode 100644 core/src/processing/data/DoubleList.java delete mode 100644 core/src/processing/data/FloatDict.java delete mode 100644 core/src/processing/data/FloatList.java delete mode 100644 core/src/processing/data/IntDict.java delete mode 100644 core/src/processing/data/IntList.java delete mode 100644 core/src/processing/data/JSONArray.java delete mode 100644 core/src/processing/data/JSONObject.java delete mode 100644 core/src/processing/data/JSONTokener.java delete mode 100644 core/src/processing/data/LongDict.java delete mode 100644 core/src/processing/data/LongList.java delete mode 100644 core/src/processing/data/Sort.java delete mode 100644 core/src/processing/data/StringDict.java delete mode 100644 core/src/processing/data/StringList.java delete mode 100644 core/src/processing/data/Table.java delete mode 100644 core/src/processing/data/TableRow.java delete mode 100644 core/src/processing/data/XML.java delete mode 100644 core/src/processing/event/Event.java delete mode 100644 core/src/processing/event/KeyEvent.java delete mode 100644 core/src/processing/event/MouseEvent.java delete mode 100644 core/src/processing/event/TouchEvent.java delete mode 100644 core/src/processing/opengl/FontTexture.java delete mode 100644 core/src/processing/opengl/FrameBuffer.java delete mode 100644 core/src/processing/opengl/LinePath.java delete mode 100644 core/src/processing/opengl/LineStroker.java delete mode 100644 core/src/processing/opengl/PGL.java delete mode 100644 core/src/processing/opengl/PGLES.java delete mode 100644 core/src/processing/opengl/PGraphics2D.java delete mode 100755 core/src/processing/opengl/PGraphics2DX.java delete mode 100644 core/src/processing/opengl/PGraphics3D.java delete mode 100644 core/src/processing/opengl/PGraphicsOpenGL.java delete mode 100644 core/src/processing/opengl/PShader.java delete mode 100644 core/src/processing/opengl/PShapeOpenGL.java delete mode 100644 core/src/processing/opengl/PSurfaceGLES.java delete mode 100644 core/src/processing/opengl/Texture.java delete mode 100644 core/src/processing/opengl/VertexBuffer.java delete mode 100644 core/src/processing/opengl/tess/ActiveRegion.java delete mode 100644 core/src/processing/opengl/tess/CachedVertex.java delete mode 100644 core/src/processing/opengl/tess/Dict.java delete mode 100644 core/src/processing/opengl/tess/DictNode.java delete mode 100644 core/src/processing/opengl/tess/GLUface.java delete mode 100644 core/src/processing/opengl/tess/GLUhalfEdge.java delete mode 100644 core/src/processing/opengl/tess/GLUmesh.java delete mode 100644 core/src/processing/opengl/tess/GLUtessellatorImpl.java delete mode 100644 core/src/processing/opengl/tess/GLUvertex.java delete mode 100644 core/src/processing/opengl/tess/Geom.java delete mode 100644 core/src/processing/opengl/tess/Mesh.java delete mode 100644 core/src/processing/opengl/tess/Normal.java delete mode 100644 core/src/processing/opengl/tess/PGLU.java delete mode 100644 core/src/processing/opengl/tess/PGLUtessellator.java delete mode 100644 core/src/processing/opengl/tess/PGLUtessellatorCallback.java delete mode 100644 core/src/processing/opengl/tess/PGLUtessellatorCallbackAdapter.java delete mode 100644 core/src/processing/opengl/tess/PriorityQ.java delete mode 100644 core/src/processing/opengl/tess/PriorityQHeap.java delete mode 100644 core/src/processing/opengl/tess/PriorityQSort.java delete mode 100644 core/src/processing/opengl/tess/Render.java delete mode 100644 core/src/processing/opengl/tess/Sweep.java delete mode 100644 core/src/processing/opengl/tess/TessMono.java delete mode 100644 core/src/processing/opengl/tess/TessState.java delete mode 100644 debug/apps/arscene/build.gradle delete mode 100644 debug/apps/arscene/gradle.properties delete mode 100644 debug/apps/arscene/src/main/AndroidManifest.xml delete mode 100644 debug/apps/arscene/src/main/java/arscene/MainActivity.java delete mode 100644 debug/apps/arscene/src/main/java/arscene/Sketch.java delete mode 100644 debug/apps/arscene/src/main/res/layout/main.xml delete mode 100644 debug/apps/arscene/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 debug/apps/arscene/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 debug/apps/arscene/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 debug/apps/arscene/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 debug/apps/arscene/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 debug/apps/arscene/src/main/res/values/strings.xml delete mode 100644 debug/apps/arscene/src/main/res/values/styles.xml delete mode 100644 debug/apps/fast2d/build.gradle delete mode 100644 debug/apps/fast2d/gradle.properties delete mode 100644 debug/apps/fast2d/src/main/AndroidManifest.xml delete mode 100644 debug/apps/fast2d/src/main/assets/blur.glsl delete mode 100644 debug/apps/fast2d/src/main/assets/bot1.svg delete mode 100644 debug/apps/fast2d/src/main/assets/edges.glsl delete mode 100644 debug/apps/fast2d/src/main/assets/frag.glsl delete mode 100644 debug/apps/fast2d/src/main/assets/img.png delete mode 100644 debug/apps/fast2d/src/main/assets/leaves.jpg delete mode 100644 debug/apps/fast2d/src/main/assets/vert.glsl delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/MainActivity.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/Sketch.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchArcTest.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchBasicPoly.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchCurveTest.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchCustomShader.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchDisplayText.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchDuplicatedVert.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchFilterTest.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchLoadDisplaySVG.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchMousePoly.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchPrimitiveTypes.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchShaderNoTex.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchShapeBenchmark.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchTexturedPoly.java delete mode 100644 debug/apps/fast2d/src/main/java/fast2d/SketchUserDefinedContours.java delete mode 100644 debug/apps/fast2d/src/main/res/layout/activity_main.xml delete mode 100644 debug/apps/fast2d/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 debug/apps/fast2d/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 debug/apps/fast2d/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 debug/apps/fast2d/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 debug/apps/fast2d/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 debug/apps/fast2d/src/main/res/values-w820dp/dimens.xml delete mode 100644 debug/apps/fast2d/src/main/res/values/colors.xml delete mode 100644 debug/apps/fast2d/src/main/res/values/dimens.xml delete mode 100644 debug/apps/fast2d/src/main/res/values/strings.xml delete mode 100644 debug/apps/fast2d/src/main/res/values/styles.xml delete mode 100644 debug/apps/simple/build.gradle delete mode 100644 debug/apps/simple/gradle.properties delete mode 100644 debug/apps/simple/src/main/AndroidManifest.xml delete mode 100644 debug/apps/simple/src/main/assets/leaf.png delete mode 100644 debug/apps/simple/src/main/java/simple/MainActivity.java delete mode 100644 debug/apps/simple/src/main/java/simple/Sketch.java delete mode 100644 debug/apps/simple/src/main/res/layout/activity_main.xml delete mode 100644 debug/apps/simple/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 debug/apps/simple/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 debug/apps/simple/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 debug/apps/simple/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 debug/apps/simple/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 debug/apps/simple/src/main/res/values-w820dp/dimens.xml delete mode 100644 debug/apps/simple/src/main/res/values/colors.xml delete mode 100644 debug/apps/simple/src/main/res/values/dimens.xml delete mode 100644 debug/apps/simple/src/main/res/values/strings.xml delete mode 100644 debug/apps/simple/src/main/res/values/styles.xml delete mode 100644 debug/apps/vrcube/build.gradle delete mode 100644 debug/apps/vrcube/gradle.properties delete mode 100644 debug/apps/vrcube/src/main/AndroidManifest.xml delete mode 100644 debug/apps/vrcube/src/main/java/vrcube/MainActivity.java delete mode 100644 debug/apps/vrcube/src/main/java/vrcube/Sketch.java delete mode 100644 debug/apps/vrcube/src/main/res/layout/main.xml delete mode 100644 debug/apps/vrcube/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 debug/apps/vrcube/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 debug/apps/vrcube/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 debug/apps/vrcube/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 debug/apps/vrcube/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 debug/apps/vrcube/src/main/res/values/strings.xml delete mode 100644 debug/apps/vrcube/src/main/res/values/styles.xml delete mode 100644 debug/apps/wallpaper/build.gradle delete mode 100644 debug/apps/wallpaper/gradle.properties delete mode 100644 debug/apps/wallpaper/src/main/AndroidManifest.xml delete mode 100644 debug/apps/wallpaper/src/main/java/wallpaper/DebuggerEntryPointActivity.java delete mode 100644 debug/apps/wallpaper/src/main/java/wallpaper/MainService.java delete mode 100644 debug/apps/wallpaper/src/main/java/wallpaper/Sketch.java delete mode 100644 debug/apps/wallpaper/src/main/res/layout/main.xml delete mode 100644 debug/apps/wallpaper/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 debug/apps/wallpaper/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 debug/apps/wallpaper/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 debug/apps/wallpaper/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 debug/apps/wallpaper/src/main/res/mipmap-xxxhdpi/ic_launcher.png delete mode 100644 debug/apps/wallpaper/src/main/res/values-w820dp/dimens.xml delete mode 100644 debug/apps/wallpaper/src/main/res/values/strings.xml delete mode 100644 debug/apps/wallpaper/src/main/res/xml/wallpaper.xml delete mode 100644 debug/apps/watchface/build.gradle delete mode 100644 debug/apps/watchface/gradle.properties delete mode 100644 debug/apps/watchface/src/main/AndroidManifest.xml delete mode 100644 debug/apps/watchface/src/main/java/watchface/MainService.java delete mode 100644 debug/apps/watchface/src/main/java/watchface/Sketch.java delete mode 100644 debug/apps/watchface/src/main/res/drawable-nodpi/bg.png delete mode 100644 debug/apps/watchface/src/main/res/drawable-nodpi/preview_analog.png delete mode 100644 debug/apps/watchface/src/main/res/layout/main.xml delete mode 100644 debug/apps/watchface/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 debug/apps/watchface/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 debug/apps/watchface/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 debug/apps/watchface/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 debug/apps/watchface/src/main/res/values/strings.xml delete mode 100644 debug/apps/watchface/src/main/res/xml/watch_face.xml delete mode 100644 debug/build.gradle delete mode 100644 debug/gradle.properties delete mode 100644 debug/gradle/wrapper/gradle-wrapper.jar delete mode 100644 debug/gradle/wrapper/gradle-wrapper.properties delete mode 100644 debug/libs/google-vr/build.gradle delete mode 100644 debug/libs/google-vr/protobuf-javanano-3.1.0.jar delete mode 100644 debug/libs/google-vr/sdk-audio-1.180.0.aar delete mode 100644 debug/libs/google-vr/sdk-base-1.180.0.aar delete mode 100644 debug/libs/google-vr/sdk-common-1.180.0.aar delete mode 100755 debug/libs/processing-ar/AndroidManifest.xml delete mode 100755 debug/libs/processing-ar/build.gradle delete mode 100755 debug/libs/processing-ar/gradle.properties delete mode 100755 debug/libs/processing-ar/project.properties delete mode 100755 debug/libs/processing-core/AndroidManifest.xml delete mode 100644 debug/libs/processing-core/build.gradle delete mode 100755 debug/libs/processing-core/gradle.properties delete mode 100755 debug/libs/processing-core/project.properties delete mode 100755 debug/libs/processing-vr/AndroidManifest.xml delete mode 100644 debug/libs/processing-vr/build.gradle delete mode 100755 debug/libs/processing-vr/gradle.properties delete mode 100755 debug/libs/processing-vr/project.properties delete mode 100644 debug/settings.gradle delete mode 100644 gradle.properties delete mode 100644 gradle/wrapper/gradle-wrapper.jar delete mode 100644 gradle/wrapper/gradle-wrapper.properties delete mode 100755 gradlew delete mode 100644 gradlew.bat delete mode 100644 mode/.classpath delete mode 100644 mode/.project delete mode 100644 mode/.settings/org.eclipse.buildship.core.prefs delete mode 100644 mode/.settings/org.eclipse.jdt.core.prefs delete mode 100644 mode/build.gradle delete mode 100644 mode/examples/Basics/Arrays/Array/Array.pde delete mode 100644 mode/examples/Basics/Arrays/Array2D/Array2D.pde delete mode 100644 mode/examples/Basics/Arrays/ArrayObjects/ArrayObjects.pde delete mode 100644 mode/examples/Basics/Arrays/ArrayObjects/Module.pde delete mode 100644 mode/examples/Basics/Camera/MoveEye/MoveEye.pde delete mode 100644 mode/examples/Basics/Camera/Perspective/Perspective.pde delete mode 100644 mode/examples/Basics/Color/Brightness/Brightness.pde delete mode 100644 mode/examples/Basics/Color/ColorWheel/ColorWheel.pde delete mode 100644 mode/examples/Basics/Color/Creating/Creating.pde delete mode 100644 mode/examples/Basics/Color/Hue/Hue.pde delete mode 100644 mode/examples/Basics/Color/LinearGradient/LinearGradient.pde delete mode 100644 mode/examples/Basics/Color/RadialGradient/RadialGradient.pde delete mode 100644 mode/examples/Basics/Color/RadialGradient2/RadialGradient2.pde delete mode 100644 mode/examples/Basics/Color/Reading/Reading.pde delete mode 100644 mode/examples/Basics/Color/Reading/data/cait.jpg delete mode 100644 mode/examples/Basics/Color/Relativity/Relativity.pde delete mode 100644 mode/examples/Basics/Color/Saturation/Saturation.pde delete mode 100644 mode/examples/Basics/Color/WaveGradient/WaveGradient.pde delete mode 100644 mode/examples/Basics/Control/Conditionals1/Conditionals1.pde delete mode 100644 mode/examples/Basics/Control/Conditionals2/Conditionals2.pde delete mode 100644 mode/examples/Basics/Control/EmbeddedIteration/EmbeddedIteration.pde delete mode 100644 mode/examples/Basics/Control/Iteration/Iteration.pde delete mode 100644 mode/examples/Basics/Control/LogicalOperators/LogicalOperators.pde delete mode 100644 mode/examples/Basics/Data/CharactersStrings/CharactersStrings.pde delete mode 100644 mode/examples/Basics/Data/CharactersStrings/data/Eureka-90.vlw delete mode 100644 mode/examples/Basics/Data/CharactersStrings/data/rathausFrog.jpg delete mode 100644 mode/examples/Basics/Data/DatatypeConversion/DatatypeConversion.pde delete mode 100644 mode/examples/Basics/Data/IntegersFloats/IntegersFloats.pde delete mode 100644 mode/examples/Basics/Data/TrueFalse/TrueFalse.pde delete mode 100644 mode/examples/Basics/Data/VariableScope/VariableScope.pde delete mode 100644 mode/examples/Basics/Data/Variables/Variables.pde delete mode 100644 mode/examples/Basics/Form/Bezier/Bezier.pde delete mode 100644 mode/examples/Basics/Form/BezierEllipse/BezierEllipse.pde delete mode 100644 mode/examples/Basics/Form/PieChart/PieChart.pde delete mode 100644 mode/examples/Basics/Form/PointsLines/PointsLines.pde delete mode 100644 mode/examples/Basics/Form/Primitives3D/Primitives3D.pde delete mode 100644 mode/examples/Basics/Form/ShapePrimitives/ShapePrimitives.pde delete mode 100644 mode/examples/Basics/Form/SimpleCurves/SimpleCurves.pde delete mode 100644 mode/examples/Basics/Form/TriangleStrip/TriangleStrip.pde delete mode 100644 mode/examples/Basics/Form/Vertices/Vertices.pde delete mode 100644 mode/examples/Basics/Image/Alphamask/Alphamask.pde delete mode 100644 mode/examples/Basics/Image/Alphamask/data/mask.jpg delete mode 100644 mode/examples/Basics/Image/Alphamask/data/test.jpg delete mode 100644 mode/examples/Basics/Image/BackgroundImage/BackgroundImage.pde delete mode 100644 mode/examples/Basics/Image/BackgroundImage/data/milan_rubbish.jpg delete mode 100644 mode/examples/Basics/Image/CreateImage/CreateImage.pde delete mode 100644 mode/examples/Basics/Image/CreateImage/data/mask.jpg delete mode 100644 mode/examples/Basics/Image/CreateImage/data/test.jpg delete mode 100644 mode/examples/Basics/Image/LoadDisplayImage/LoadDisplayImage.pde delete mode 100644 mode/examples/Basics/Image/LoadDisplayImage/data/jelly.jpg delete mode 100644 mode/examples/Basics/Image/Pointillism/Pointillism.pde delete mode 100644 mode/examples/Basics/Image/Pointillism/data/eames.jpg delete mode 100644 mode/examples/Basics/Image/Pointillism/data/sunflower.jpg delete mode 100644 mode/examples/Basics/Image/RequestImage/RequestImage.pde delete mode 100644 mode/examples/Basics/Image/Sprite/Sprite.pde delete mode 100644 mode/examples/Basics/Image/Sprite/data/teddy.gif delete mode 100644 mode/examples/Basics/Image/Sprite2/Sprite2.pde delete mode 100644 mode/examples/Basics/Image/Sprite2/data/sky.jpg delete mode 100644 mode/examples/Basics/Image/Sprite2/data/teddy.gif delete mode 100644 mode/examples/Basics/Image/Transparency/Transparency.pde delete mode 100644 mode/examples/Basics/Image/Transparency/data/construct.jpg delete mode 100644 mode/examples/Basics/Image/Transparency/data/wash.jpg delete mode 100644 mode/examples/Basics/Input/Clock/Clock.pde delete mode 100644 mode/examples/Basics/Input/Constrain/Constrain.pde delete mode 100644 mode/examples/Basics/Input/Easing/Easing.pde delete mode 100644 mode/examples/Basics/Input/Keyboard/Keyboard.pde delete mode 100644 mode/examples/Basics/Input/KeyboardFunctions/KeyboardFunctions.pde delete mode 100644 mode/examples/Basics/Input/KeyboardFunctions/data/brugges.jpg delete mode 100644 mode/examples/Basics/Input/Milliseconds/Milliseconds.pde delete mode 100644 mode/examples/Basics/Input/Mouse1D/Mouse1D.pde delete mode 100644 mode/examples/Basics/Input/Mouse2D/Mouse2D.pde delete mode 100644 mode/examples/Basics/Input/MouseFunctions/MouseFunctions.pde delete mode 100644 mode/examples/Basics/Input/MousePress/MousePress.pde delete mode 100644 mode/examples/Basics/Input/MouseSignals/MouseSignals.pde delete mode 100644 mode/examples/Basics/Input/StoringInput/StoringInput.pde delete mode 100644 mode/examples/Basics/Lights/Directional/Directional.pde delete mode 100644 mode/examples/Basics/Lights/Mixture/Mixture.pde delete mode 100644 mode/examples/Basics/Lights/MixtureGrid/MixtureGrid.pde delete mode 100644 mode/examples/Basics/Lights/OnOff/OnOff.pde delete mode 100644 mode/examples/Basics/Lights/Reflection/Reflection.pde delete mode 100644 mode/examples/Basics/Lights/Spot/Spot.pde delete mode 100644 mode/examples/Basics/Math/AdditiveWave/AdditiveWave.pde delete mode 100644 mode/examples/Basics/Math/Arctangent/Arctangent.pde delete mode 100644 mode/examples/Basics/Math/Distance1D/Distance1D.pde delete mode 100644 mode/examples/Basics/Math/Distance2D/Distance2D.pde delete mode 100644 mode/examples/Basics/Math/DoubleRandom/DoubleRandom.pde delete mode 100644 mode/examples/Basics/Math/Graphing2DEquation/Graphing2DEquation.pde delete mode 100644 mode/examples/Basics/Math/IncrementDecrement/IncrementDecrement.pde delete mode 100644 mode/examples/Basics/Math/Modulo/Modulo.pde delete mode 100644 mode/examples/Basics/Math/Noise1D/Noise1D.pde delete mode 100644 mode/examples/Basics/Math/Noise2D/Noise2D.pde delete mode 100644 mode/examples/Basics/Math/Noise3D/Noise3D.pde delete mode 100644 mode/examples/Basics/Math/NoiseWave/NoiseWave.pde delete mode 100644 mode/examples/Basics/Math/OperatorPrecedence/OperatorPrecedence.pde delete mode 100644 mode/examples/Basics/Math/PolarToCartesian/PolarToCartesian.pde delete mode 100644 mode/examples/Basics/Math/Random/Random.pde delete mode 100644 mode/examples/Basics/Math/Sine/Sine.pde delete mode 100644 mode/examples/Basics/Math/SineCosine/SineCosine.pde delete mode 100644 mode/examples/Basics/Math/SineWave/SineWave.pde delete mode 100644 mode/examples/Basics/Objects/CompositeObjects/CompositeObjects.pde delete mode 100644 mode/examples/Basics/Objects/CompositeObjects/Egg.pde delete mode 100644 mode/examples/Basics/Objects/CompositeObjects/EggRing.pde delete mode 100644 mode/examples/Basics/Objects/CompositeObjects/Ring.pde delete mode 100644 mode/examples/Basics/Objects/Inheritance/Inheritance.pde delete mode 100644 mode/examples/Basics/Objects/MultipleConstructors/MultipleConstructors.pde delete mode 100644 mode/examples/Basics/Objects/Neighborhood/Neighborhood.pde delete mode 100644 mode/examples/Basics/Objects/Objects/Objects.pde delete mode 100644 mode/examples/Basics/Shape/DisableStyle/DisableStyle.pde delete mode 100644 mode/examples/Basics/Shape/DisableStyle/data/bot1.svg delete mode 100644 mode/examples/Basics/Shape/GetChild/GetChild.pde delete mode 100644 mode/examples/Basics/Shape/GetChild/data/usa-wikipedia.svg delete mode 100644 mode/examples/Basics/Shape/LoadDisplayOBJ/LoadDisplayOBJ.pde delete mode 100644 mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.mtl delete mode 100644 mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.obj delete mode 100644 mode/examples/Basics/Shape/LoadDisplayOBJ/data/rocket.png delete mode 100644 mode/examples/Basics/Shape/LoadDisplaySVG/LoadDisplaySVG.pde delete mode 100644 mode/examples/Basics/Shape/LoadDisplaySVG/data/bot1.svg delete mode 100644 mode/examples/Basics/Shape/ScaleShape/ScaleShape.pde delete mode 100644 mode/examples/Basics/Shape/ScaleShape/data/bot1.svg delete mode 100644 mode/examples/Basics/Structure/Coordinates/Coordinates.pde delete mode 100644 mode/examples/Basics/Structure/CreateGraphics/CreateGraphics.pde delete mode 100644 mode/examples/Basics/Structure/CreateGraphics/data/mask.jpg delete mode 100644 mode/examples/Basics/Structure/CreateGraphics/data/test.jpg delete mode 100644 mode/examples/Basics/Structure/Functions/Functions.pde delete mode 100644 mode/examples/Basics/Structure/Loop/Loop.pde delete mode 100644 mode/examples/Basics/Structure/NoLoop/NoLoop.pde delete mode 100644 mode/examples/Basics/Structure/Recursion/Recursion.pde delete mode 100644 mode/examples/Basics/Structure/Recursion2/Recursion2.pde delete mode 100644 mode/examples/Basics/Structure/Redraw/Redraw.pde delete mode 100644 mode/examples/Basics/Structure/SetupDraw/SetupDraw.pde delete mode 100644 mode/examples/Basics/Structure/StatementsComments/StatementsComments.pde delete mode 100644 mode/examples/Basics/Structure/WidthHeight/WidthHeight.pde delete mode 100644 mode/examples/Basics/Transform/Arm/Arm.pde delete mode 100644 mode/examples/Basics/Transform/Rotate/Rotate.pde delete mode 100644 mode/examples/Basics/Transform/RotatePushPop/RotatePushPop.pde delete mode 100644 mode/examples/Basics/Transform/RotateXY/RotateXY.pde delete mode 100644 mode/examples/Basics/Transform/Scale/Scale.pde delete mode 100644 mode/examples/Basics/Transform/Translate/Translate.pde delete mode 100644 mode/examples/Basics/Transform/TriangleFlower/TriangleFlower.pde delete mode 100644 mode/examples/Basics/Typography/Letters/Letters.pde delete mode 100644 mode/examples/Basics/Typography/Letters/data/CourierNew36.vlw delete mode 100644 mode/examples/Basics/Typography/Words/Words.pde delete mode 100644 mode/examples/Basics/Typography/Words/data/Ziggurat-HTF-Black-32.vlw delete mode 100644 mode/examples/Basics/Web/EmbeddedLinks/EmbeddedLinks.pde delete mode 100644 mode/examples/Basics/Web/LoadingImages/LoadingImages.pde delete mode 100644 mode/examples/Demos/Graphics/Particles/Particle.pde delete mode 100644 mode/examples/Demos/Graphics/Particles/ParticleSystem.pde delete mode 100644 mode/examples/Demos/Graphics/Particles/Particles.pde delete mode 100644 mode/examples/Demos/Graphics/Particles/data/sprite.png delete mode 100644 mode/examples/Demos/Graphics/Patch/Patch.pde delete mode 100644 mode/examples/Demos/Graphics/Planets/Perlin.pde delete mode 100644 mode/examples/Demos/Graphics/Planets/Planets.pde delete mode 100644 mode/examples/Demos/Graphics/Planets/data/mercury.jpg delete mode 100644 mode/examples/Demos/Graphics/Planets/data/planet.jpg delete mode 100644 mode/examples/Demos/Graphics/Planets/data/starfield.jpg delete mode 100644 mode/examples/Demos/Graphics/Planets/data/sun.jpg delete mode 100644 mode/examples/Demos/Graphics/Ribbons/ArcBall.pde delete mode 100644 mode/examples/Demos/Graphics/Ribbons/BSpline.pde delete mode 100644 mode/examples/Demos/Graphics/Ribbons/Geometry.pde delete mode 100644 mode/examples/Demos/Graphics/Ribbons/PDB.pde delete mode 100644 mode/examples/Demos/Graphics/Ribbons/Ribbons.pde delete mode 100644 mode/examples/Demos/Graphics/Ribbons/data/1CBS.pdb delete mode 100644 mode/examples/Demos/Graphics/Ribbons/data/2POR.pdb delete mode 100644 mode/examples/Demos/Graphics/Ribbons/data/4HHB.pdb delete mode 100644 mode/examples/Demos/Graphics/RotatingArcs/RotatingArcs.pde delete mode 100644 mode/examples/Demos/Graphics/Trefoil/Surface.pde delete mode 100644 mode/examples/Demos/Graphics/Trefoil/Trefoil.pde delete mode 100644 mode/examples/Demos/Graphics/Trefoil/data/particle.png delete mode 100644 mode/examples/Demos/Graphics/Wiggling/Wiggling.pde delete mode 100644 mode/examples/Demos/Graphics/Yellowtail/Gesture.pde delete mode 100644 mode/examples/Demos/Graphics/Yellowtail/Polygon.pde delete mode 100644 mode/examples/Demos/Graphics/Yellowtail/Vec3f.pde delete mode 100644 mode/examples/Demos/Graphics/Yellowtail/Yellowtail.pde delete mode 100644 mode/examples/Demos/Performance/CubicGridImmediate/CubicGridImmediate.pde delete mode 100644 mode/examples/Demos/Performance/CubicGridRetained/CubicGridRetained.pde delete mode 100644 mode/examples/Demos/Performance/DynamicParticlesImmediate/DynamicParticlesImmediate.pde delete mode 100644 mode/examples/Demos/Performance/DynamicParticlesImmediate/data/sprite.png delete mode 100644 mode/examples/Demos/Performance/DynamicParticlesRetained/DynamicParticlesRetained.pde delete mode 100644 mode/examples/Demos/Performance/DynamicParticlesRetained/data/sprite.png delete mode 100644 mode/examples/Demos/Performance/Esfera/Esfera.pde delete mode 100644 mode/examples/Demos/Performance/LineRendering/LineRendering.pde delete mode 100644 mode/examples/Demos/Performance/P2DXDemo/P2DXDemo.pde delete mode 100644 mode/examples/Demos/Performance/QuadRendering/QuadRendering.pde delete mode 100644 mode/examples/Demos/Performance/StaticParticlesImmediate/StaticParticlesImmediate.pde delete mode 100644 mode/examples/Demos/Performance/StaticParticlesImmediate/data/sprite.png delete mode 100644 mode/examples/Demos/Performance/StaticParticlesRetained/StaticParticlesRetained.pde delete mode 100644 mode/examples/Demos/Performance/StaticParticlesRetained/data/sprite.png delete mode 100644 mode/examples/Demos/Performance/TextRendering/TextRendering.pde delete mode 100644 mode/examples/Demos/Tests/NoBackgroundTest/NoBackgroundTest.pde delete mode 100644 mode/examples/Demos/Tests/OffscreenTest/OffscreenTest.pde delete mode 100644 mode/examples/Demos/Tests/RedrawTest/RedrawTest.pde delete mode 100644 mode/examples/Sensors/Accelerometer/Accelerometer.pde delete mode 100644 mode/examples/Sensors/Accelerometer/AccelerometerManager.java delete mode 100644 mode/examples/Sensors/Compass/Compass.pde delete mode 100644 mode/examples/Sensors/Compass/CompassManager.java delete mode 100644 mode/examples/Topics/Advanced Data/ArrayListClass/ArrayListClass.pde delete mode 100644 mode/examples/Topics/Advanced Data/ArrayListClass/Ball.pde delete mode 100644 mode/examples/Topics/Advanced Data/DirectoryList/DirectoryList.pde delete mode 100644 mode/examples/Topics/Advanced Data/HashMapClass/HashMapClass.pde delete mode 100644 mode/examples/Topics/Advanced Data/HashMapClass/Word.pde delete mode 100644 mode/examples/Topics/Advanced Data/HashMapClass/data/dracula.txt delete mode 100644 mode/examples/Topics/Advanced Data/HashMapClass/data/hamlet.txt delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/AnimatedSprite.pde delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/Animation.pde delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0000.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0001.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0002.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0003.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0004.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0005.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0006.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0007.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0008.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0009.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0010.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0011.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0012.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0013.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0014.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0015.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0016.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0017.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0018.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0019.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0020.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0021.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0022.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0023.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0024.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0025.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0026.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0027.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0028.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0029.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0030.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0031.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0032.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0033.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0034.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0035.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0036.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Shifty_0037.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0000.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0001.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0002.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0003.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0004.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0005.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0006.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0007.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0008.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0009.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0010.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0011.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0012.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0013.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0014.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0015.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0016.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0017.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0018.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0019.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0020.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0021.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0022.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0023.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0024.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0025.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0026.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0027.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0028.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0029.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0030.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0031.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0032.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0033.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0034.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0035.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0036.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0037.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0038.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0039.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0040.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0041.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0042.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0043.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0044.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0045.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0046.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0047.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0048.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0049.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0050.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0051.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0052.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0053.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0054.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0055.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0056.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0057.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0058.gif delete mode 100644 mode/examples/Topics/Animation/AnimatedSprite/data/PT_Teddy_0059.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/Sequential.pde delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0000.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0001.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0002.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0003.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0004.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0005.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0006.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0007.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0008.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0009.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0010.gif delete mode 100644 mode/examples/Topics/Animation/Sequential/data/PT_anim0011.gif delete mode 100644 mode/examples/Topics/Cellular Automata/Conway/Conway.pde delete mode 100644 mode/examples/Topics/Cellular Automata/Spore1/Spore1.pde delete mode 100644 mode/examples/Topics/Cellular Automata/Spore2/Spore2.pde delete mode 100644 mode/examples/Topics/Cellular Automata/Wolfram/CA.pde delete mode 100644 mode/examples/Topics/Cellular Automata/Wolfram/Wolfram.pde delete mode 100644 mode/examples/Topics/Create Shapes/BeginEndContour/BeginEndContour.pde delete mode 100644 mode/examples/Topics/Create Shapes/GroupPShape/GroupPShape.pde delete mode 100644 mode/examples/Topics/Create Shapes/ParticleSystemPShape/Particle.pde delete mode 100644 mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystem.pde delete mode 100644 mode/examples/Topics/Create Shapes/ParticleSystemPShape/ParticleSystemPShape.pde delete mode 100644 mode/examples/Topics/Create Shapes/ParticleSystemPShape/data/sprite.png delete mode 100644 mode/examples/Topics/Create Shapes/PathPShape/PathPShape.pde delete mode 100644 mode/examples/Topics/Create Shapes/PolygonPShape/PolygonPShape.pde delete mode 100644 mode/examples/Topics/Create Shapes/PolygonPShapeOOP/PolygonPShapeOOP.pde delete mode 100644 mode/examples/Topics/Create Shapes/PolygonPShapeOOP/Star.pde delete mode 100644 mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/Polygon.pde delete mode 100644 mode/examples/Topics/Create Shapes/PolygonPShapeOOP2/PolygonPShapeOOP2.pde delete mode 100644 mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/Polygon.pde delete mode 100644 mode/examples/Topics/Create Shapes/PolygonPShapeOOP3/PolygonPShapeOOP3.pde delete mode 100644 mode/examples/Topics/Create Shapes/PrimitivePShape/PrimitivePShape.pde delete mode 100644 mode/examples/Topics/Create Shapes/WigglePShape/WigglePShape.pde delete mode 100644 mode/examples/Topics/Create Shapes/WigglePShape/Wiggler.pde delete mode 100644 mode/examples/Topics/Drawing/Animator/Animator.pde delete mode 100644 mode/examples/Topics/Drawing/ContinuousLines/ContinuousLines.pde delete mode 100644 mode/examples/Topics/Drawing/CustomTool/CustomTool.pde delete mode 100644 mode/examples/Topics/Drawing/CustomTool/data/milan.jpg delete mode 100644 mode/examples/Topics/Drawing/CustomTool/data/paris.jpg delete mode 100644 mode/examples/Topics/Drawing/Pattern/Pattern.pde delete mode 100644 mode/examples/Topics/Drawing/Pulses/Pulses.pde delete mode 100644 mode/examples/Topics/Drawing/ScribblePlotter/ScribblePlotter.pde delete mode 100644 mode/examples/Topics/Effects/FireCube/FireCube.pde delete mode 100644 mode/examples/Topics/Effects/Lens/Lens.pde delete mode 100644 mode/examples/Topics/Effects/Lens/data/red_smoke.jpg delete mode 100644 mode/examples/Topics/Effects/Metaball/Metaball.pde delete mode 100644 mode/examples/Topics/Effects/Plasma/Plasma.pde delete mode 100644 mode/examples/Topics/Effects/Tunnel/Tunnel.pde delete mode 100644 mode/examples/Topics/Effects/Tunnel/data/red_smoke.jpg delete mode 100644 mode/examples/Topics/Effects/UnlimitedSprites/UnlimitedSprites.pde delete mode 100644 mode/examples/Topics/Effects/UnlimitedSprites/data/Aqua-Ball-48x48.png delete mode 100644 mode/examples/Topics/Effects/Wormhole/Wormhole.pde delete mode 100644 mode/examples/Topics/Effects/Wormhole/data/texture.gif delete mode 100644 mode/examples/Topics/Effects/Wormhole/data/wormhole.png delete mode 100644 mode/examples/Topics/File IO/LoadFile1/LoadFile1.pde delete mode 100644 mode/examples/Topics/File IO/LoadFile1/data/positions.txt delete mode 100644 mode/examples/Topics/File IO/LoadFile2/LoadFile2.pde delete mode 100644 mode/examples/Topics/File IO/LoadFile2/Record.pde delete mode 100644 mode/examples/Topics/File IO/LoadFile2/data/TheSans-Plain-12.vlw delete mode 100644 mode/examples/Topics/File IO/LoadFile2/data/cars2.tsv delete mode 100644 mode/examples/Topics/File IO/SaveFile1/SaveFile1.pde delete mode 100644 mode/examples/Topics/File IO/SaveFile2/SaveFile2.pde delete mode 100644 mode/examples/Topics/File IO/SaveManyImages/SaveManyImages.pde delete mode 100644 mode/examples/Topics/File IO/SaveOneImage/SaveOneImage.pde delete mode 100644 mode/examples/Topics/File IO/TileImages/TileImages.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/Koch/Koch.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/Mandelbrot/Mandelbrot.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/LSystem.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflake.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/PenroseSnowflake/PenroseSnowflakeLSystem.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/PenroseTile/LSystem.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseLSystem.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/PenroseTile/PenroseTile.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/Pentigree/LSystem.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/Pentigree/Pentigree.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/Pentigree/PentigreeLSystem.pde delete mode 100644 mode/examples/Topics/Fractals and L-Systems/Tree/Tree.pde delete mode 100644 mode/examples/Topics/GUI/Button/Button.pde delete mode 100644 mode/examples/Topics/GUI/Buttons/Buttons.pde delete mode 100644 mode/examples/Topics/GUI/Handles/Handles.pde delete mode 100644 mode/examples/Topics/GUI/ImageButton/ImageButton.pde delete mode 100644 mode/examples/Topics/GUI/ImageButton/data/base.gif delete mode 100644 mode/examples/Topics/GUI/ImageButton/data/down.gif delete mode 100644 mode/examples/Topics/GUI/ImageButton/data/roll.gif delete mode 100644 mode/examples/Topics/GUI/Rollover/Rollover.pde delete mode 100644 mode/examples/Topics/GUI/Scrollbar/Scrollbar.pde delete mode 100644 mode/examples/Topics/GUI/Scrollbar/data/seedBottom.jpg delete mode 100644 mode/examples/Topics/GUI/Scrollbar/data/seedTop.jpg delete mode 100644 mode/examples/Topics/Geometry/Icosahedra/Dimension3D.pde delete mode 100644 mode/examples/Topics/Geometry/Icosahedra/Icosahedra.pde delete mode 100644 mode/examples/Topics/Geometry/Icosahedra/Icosahedron.pde delete mode 100644 mode/examples/Topics/Geometry/Icosahedra/Shape3D.pde delete mode 100644 mode/examples/Topics/Geometry/NoiseSphere/NoiseSphere.pde delete mode 100644 mode/examples/Topics/Geometry/RGBCube/RGBCube.pde delete mode 100644 mode/examples/Topics/Geometry/ShapeTransform/ShapeTransform.pde delete mode 100644 mode/examples/Topics/Geometry/SpaceJunk/Cube.pde delete mode 100644 mode/examples/Topics/Geometry/SpaceJunk/SpaceJunk.pde delete mode 100644 mode/examples/Topics/Geometry/Toroid/Toroid.pde delete mode 100644 mode/examples/Topics/Geometry/Vertices/Vertices.pde delete mode 100644 mode/examples/Topics/Image Processing/Blur/Blur.pde delete mode 100644 mode/examples/Topics/Image Processing/Blur/data/trees.jpg delete mode 100644 mode/examples/Topics/Image Processing/Brightness/Brightness.pde delete mode 100644 mode/examples/Topics/Image Processing/Brightness/data/wires.jpg delete mode 100644 mode/examples/Topics/Image Processing/Convolution/Convolution.pde delete mode 100644 mode/examples/Topics/Image Processing/Convolution/data/end.jpg delete mode 100644 mode/examples/Topics/Image Processing/Convolution/data/sunflower.jpg delete mode 100644 mode/examples/Topics/Image Processing/EdgeDetection/EdgeDetection.pde delete mode 100644 mode/examples/Topics/Image Processing/EdgeDetection/data/house.jpg delete mode 100644 mode/examples/Topics/Image Processing/Histogram/Histogram.pde delete mode 100644 mode/examples/Topics/Image Processing/Histogram/data/cdi01_g.jpg delete mode 100644 mode/examples/Topics/Image Processing/Histogram/data/ystone08.jpg delete mode 100644 mode/examples/Topics/Image Processing/LinearImage/LinearImage.pde delete mode 100644 mode/examples/Topics/Image Processing/LinearImage/data/florence03.jpg delete mode 100644 mode/examples/Topics/Image Processing/PixelArray/PixelArray.pde delete mode 100644 mode/examples/Topics/Image Processing/PixelArray/data/ystone08.jpg delete mode 100644 mode/examples/Topics/Interaction/Follow1/Follow1.pde delete mode 100644 mode/examples/Topics/Interaction/Follow2/Follow2.pde delete mode 100644 mode/examples/Topics/Interaction/Follow3/Follow3.pde delete mode 100644 mode/examples/Topics/Interaction/Multitouch/Multitouch.pde delete mode 100644 mode/examples/Topics/Interaction/Reach1/Reach1.pde delete mode 100644 mode/examples/Topics/Interaction/Reach2/Reach2.pde delete mode 100644 mode/examples/Topics/Interaction/Reach3/Reach3.pde delete mode 100644 mode/examples/Topics/Interaction/Tickle/Tickle.pde delete mode 100644 mode/examples/Topics/Interaction/Tickle/data/AmericanTypewriter-24.vlw delete mode 100644 mode/examples/Topics/Motion/Bounce/Bounce.pde delete mode 100644 mode/examples/Topics/Motion/BouncyBubbles/BouncyBubbles.pde delete mode 100644 mode/examples/Topics/Motion/Brownian/Brownian.pde delete mode 100644 mode/examples/Topics/Motion/CircleCollision/Ball.pde delete mode 100644 mode/examples/Topics/Motion/CircleCollision/CircleCollision.pde delete mode 100644 mode/examples/Topics/Motion/Collision/Collision.pde delete mode 100644 mode/examples/Topics/Motion/Linear/Linear.pde delete mode 100644 mode/examples/Topics/Motion/MovingOnCurves/MovingOnCurves.pde delete mode 100644 mode/examples/Topics/Motion/Puff/Puff.pde delete mode 100644 mode/examples/Topics/Motion/Reflection1/Reflection1.pde delete mode 100644 mode/examples/Topics/Motion/Reflection2/Ground.pde delete mode 100644 mode/examples/Topics/Motion/Reflection2/Orb.pde delete mode 100644 mode/examples/Topics/Motion/Reflection2/Reflection2.pde delete mode 100644 mode/examples/Topics/Shaders/BlurFilter/BlurFilter.pde delete mode 100644 mode/examples/Topics/Shaders/BlurFilter/data/blur.glsl delete mode 100644 mode/examples/Topics/Shaders/EdgeDetect/EdgeDetect.pde delete mode 100644 mode/examples/Topics/Shaders/EdgeDetect/data/edges.glsl delete mode 100644 mode/examples/Topics/Shaders/EdgeDetect/data/leaves.jpg delete mode 100644 mode/examples/Topics/Shaders/EdgeFilter/EdgeFilter.pde delete mode 100644 mode/examples/Topics/Shaders/EdgeFilter/data/edges.glsl delete mode 100644 mode/examples/Topics/Shaders/LowLevelGL/LowLevelGL.pde delete mode 100644 mode/examples/Topics/Shaders/LowLevelGL/data/frag.glsl delete mode 100644 mode/examples/Topics/Shaders/LowLevelGL/data/vert.glsl delete mode 100644 mode/examples/Topics/Shaders/ToonShading/ToonShading.pde delete mode 100644 mode/examples/Topics/Shaders/ToonShading/data/ToonFrag.glsl delete mode 100644 mode/examples/Topics/Shaders/ToonShading/data/ToonVert.glsl delete mode 100644 mode/examples/Topics/Simulate/Chain/Chain.pde delete mode 100644 mode/examples/Topics/Simulate/Flocking/Boid.pde delete mode 100644 mode/examples/Topics/Simulate/Flocking/Flock.pde delete mode 100644 mode/examples/Topics/Simulate/Flocking/Flocking.pde delete mode 100644 mode/examples/Topics/Simulate/ForcesWithVectors/ForcesWithVectors.pde delete mode 100644 mode/examples/Topics/Simulate/ForcesWithVectors/Liquid.pde delete mode 100644 mode/examples/Topics/Simulate/ForcesWithVectors/Mover.pde delete mode 100644 mode/examples/Topics/Simulate/GravitationalAttraction3D/GravitationalAttraction3D.pde delete mode 100644 mode/examples/Topics/Simulate/GravitationalAttraction3D/Planet.pde delete mode 100644 mode/examples/Topics/Simulate/GravitationalAttraction3D/Sun.pde delete mode 100644 mode/examples/Topics/Simulate/MultipleParticleSystems/CrazyParticle.pde delete mode 100644 mode/examples/Topics/Simulate/MultipleParticleSystems/MultipleParticleSystems.pde delete mode 100644 mode/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde delete mode 100644 mode/examples/Topics/Simulate/MultipleParticleSystems/ParticleSystem.pde delete mode 100644 mode/examples/Topics/Simulate/SimpleParticleSystem/Particle.pde delete mode 100644 mode/examples/Topics/Simulate/SimpleParticleSystem/ParticleSystem.pde delete mode 100644 mode/examples/Topics/Simulate/SimpleParticleSystem/SimpleParticleSystem.pde delete mode 100644 mode/examples/Topics/Simulate/SmokeParticleSystem/Particle.pde delete mode 100644 mode/examples/Topics/Simulate/SmokeParticleSystem/ParticleSystem.pde delete mode 100644 mode/examples/Topics/Simulate/SmokeParticleSystem/SmokeParticleSystem.pde delete mode 100644 mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.gif delete mode 100644 mode/examples/Topics/Simulate/SmokeParticleSystem/data/texture.png delete mode 100644 mode/examples/Topics/Simulate/SoftBody/SoftBody.pde delete mode 100644 mode/examples/Topics/Simulate/Spring/Spring.pde delete mode 100644 mode/examples/Topics/Simulate/Springs/Springs.pde delete mode 100644 mode/examples/Topics/Textures/TextureCube/TextureCube.pde delete mode 100644 mode/examples/Topics/Textures/TextureCube/data/berlin-1.jpg delete mode 100644 mode/examples/Topics/Textures/TextureCube/data/uvtex.jpg delete mode 100644 mode/examples/Topics/Textures/TextureCylinder/TextureCylinder.pde delete mode 100644 mode/examples/Topics/Textures/TextureCylinder/data/berlin-1.jpg delete mode 100644 mode/examples/Topics/Textures/TextureQuad/TextureQuad.pde delete mode 100644 mode/examples/Topics/Textures/TextureQuad/data/berlin-1.jpg delete mode 100644 mode/examples/Topics/Textures/TextureSphere/TextureSphere.pde delete mode 100644 mode/examples/Topics/Textures/TextureSphere/data/world32k.jpg delete mode 100644 mode/examples/Topics/Textures/TextureTriangle/TextureTriangle.pde delete mode 100644 mode/examples/Topics/Textures/TextureTriangle/data/berlin-1.jpg delete mode 100644 mode/examples/Topics/Vectors/AccelerationWithVectors/AccelerationWithVectors.pde delete mode 100644 mode/examples/Topics/Vectors/AccelerationWithVectors/Mover.pde delete mode 100644 mode/examples/Topics/Vectors/BouncingBall/BouncingBall.pde delete mode 100644 mode/examples/Topics/Vectors/Normalize/Normalize.pde delete mode 100644 mode/examples/Topics/Vectors/VectorMath/VectorMath.pde delete mode 100644 mode/examples/Topics/Wallpapers/Circles/Circles.pde delete mode 100644 mode/examples/Topics/Wallpapers/Circles/code/sketch.properties delete mode 100644 mode/examples/Topics/Watchfaces/WatchFace/WatchFace.pde delete mode 100644 mode/examples/Topics/Watchfaces/WatchFace/code/sketch.properties delete mode 100644 mode/icons/launcher_144.png delete mode 100644 mode/icons/launcher_192.png delete mode 100644 mode/icons/launcher_36.png delete mode 100644 mode/icons/launcher_48.png delete mode 100644 mode/icons/launcher_72.png delete mode 100644 mode/icons/launcher_96.png delete mode 100644 mode/icons/preview_circular.png delete mode 100644 mode/icons/preview_rectangular.png delete mode 100644 mode/keywords.txt delete mode 100644 mode/languages/mode.properties delete mode 100644 mode/languages/mode_ko.properties delete mode 100644 mode/libraries/ar/README.md delete mode 100644 mode/libraries/ar/build.gradle delete mode 100644 mode/libraries/ar/examples/Cubes/Cubes.pde delete mode 100644 mode/libraries/ar/examples/Cubes/code/sketch.properties delete mode 100644 mode/libraries/ar/examples/ImportObj/ImportObj.pde delete mode 100644 mode/libraries/ar/examples/ImportObj/code/sketch.properties delete mode 100644 mode/libraries/ar/examples/ImportObj/data/grey.png delete mode 100755 mode/libraries/ar/examples/ImportObj/data/materials.mtl delete mode 100755 mode/libraries/ar/examples/ImportObj/data/model.obj delete mode 100644 mode/libraries/ar/examples/Spheres/Spheres.pde delete mode 100644 mode/libraries/ar/examples/Spheres/code/sketch.properties delete mode 100644 mode/libraries/ar/library.properties delete mode 100644 mode/libraries/ar/src/assets/shaders/ARLightFrag.glsl delete mode 100644 mode/libraries/ar/src/assets/shaders/ARLightVert.glsl delete mode 100644 mode/libraries/ar/src/assets/shaders/ARTexLightFrag.glsl delete mode 100644 mode/libraries/ar/src/assets/shaders/ARTexLightVert.glsl delete mode 100644 mode/libraries/ar/src/assets/shaders/BackgroundFrag.glsl delete mode 100644 mode/libraries/ar/src/assets/shaders/BackgroundVert.glsl delete mode 100644 mode/libraries/ar/src/processing/ar/ARAnchor.java delete mode 100644 mode/libraries/ar/src/processing/ar/ARGraphics.java delete mode 100644 mode/libraries/ar/src/processing/ar/ARSurface.java delete mode 100644 mode/libraries/ar/src/processing/ar/ARTrackable.java delete mode 100644 mode/libraries/ar/src/processing/ar/ARTracker.java delete mode 100644 mode/libraries/ar/src/processing/ar/BackgroundRenderer.java delete mode 100644 mode/libraries/ar/src/processing/ar/RotationHandler.java delete mode 100644 mode/libraries/ar/src/processing/ar/ShaderUtils.java delete mode 100644 mode/libraries/vr/README.md delete mode 100644 mode/libraries/vr/build.gradle delete mode 100644 mode/libraries/vr/examples/Cube/Cube.pde delete mode 100644 mode/libraries/vr/examples/Cube/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/GenerateRay/GenerateRay.pde delete mode 100644 mode/libraries/vr/examples/GenerateRay/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/IntersectsBox/IntersectsBox.pde delete mode 100644 mode/libraries/vr/examples/IntersectsBox/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/IntersectsPlane/IntersectsPlane.pde delete mode 100644 mode/libraries/vr/examples/IntersectsPlane/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/IntersectsSphere/IntersectsSphere.pde delete mode 100644 mode/libraries/vr/examples/IntersectsSphere/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/Mono/Mono.pde delete mode 100644 mode/libraries/vr/examples/Mono/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/Stereoscopy/Stereoscopy.pde delete mode 100644 mode/libraries/vr/examples/Stereoscopy/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/drawAim/code/sketch.properties delete mode 100644 mode/libraries/vr/examples/drawAim/drawAim.pde delete mode 100644 mode/libraries/vr/library.properties delete mode 100644 mode/libraries/vr/libs/sdk-audio-1.180.0.aar delete mode 100644 mode/libraries/vr/libs/sdk-base-1.180.0.aar delete mode 100644 mode/libraries/vr/libs/sdk-common-1.180.0.aar delete mode 100644 mode/libraries/vr/src/processing/vr/VRActivity.java delete mode 100644 mode/libraries/vr/src/processing/vr/VRCamera.java delete mode 100644 mode/libraries/vr/src/processing/vr/VRGraphics.java delete mode 100644 mode/libraries/vr/src/processing/vr/VRGraphicsMono.java delete mode 100644 mode/libraries/vr/src/processing/vr/VRGraphicsStereo.java delete mode 100644 mode/libraries/vr/src/processing/vr/VRSurface.java delete mode 100644 mode/mode.properties delete mode 100644 mode/mode/JavaMode.jar delete mode 100644 mode/mode/core.jar delete mode 100644 mode/mode/gradlew.zip delete mode 100644 mode/mode/istack-commons-runtime.jar delete mode 100644 mode/mode/javax.activation-api.jar delete mode 100644 mode/mode/jaxb-api.jar delete mode 100644 mode/mode/jaxb-jxc.jar delete mode 100644 mode/mode/jaxb-runtime.jar delete mode 100644 mode/mode/jaxb-xjc.jar delete mode 100644 mode/mode/jdi.jar delete mode 100644 mode/mode/jdimodel.jar delete mode 100644 mode/mode/org.eclipse.core.contenttype.jar delete mode 100644 mode/mode/org.eclipse.core.jobs.jar delete mode 100644 mode/mode/org.eclipse.core.resources.jar delete mode 100644 mode/mode/org.eclipse.core.runtime.jar delete mode 100644 mode/mode/org.eclipse.equinox.common.jar delete mode 100644 mode/mode/org.eclipse.equinox.preferences.jar delete mode 100644 mode/mode/org.eclipse.jdt.core.jar delete mode 100644 mode/mode/org.eclipse.osgi.jar delete mode 100644 mode/mode/org.eclipse.text.jar delete mode 100644 mode/mode/pde.jar delete mode 100644 mode/resources/device-art-resources/device-art.xml delete mode 100644 mode/resources/device-art-resources/pixel_3/layout delete mode 100644 mode/resources/device-art-resources/pixel_3/port_back.webp delete mode 100644 mode/resources/device-art-resources/pixel_3/round_corners.webp delete mode 100644 mode/resources/device-art-resources/pixel_6/back.webp delete mode 100644 mode/resources/device-art-resources/pixel_6/layout delete mode 100644 mode/resources/device-art-resources/pixel_6/mask.webp delete mode 100644 mode/resources/device-art-resources/pixel_c/land_back.webp delete mode 100644 mode/resources/device-art-resources/pixel_c/land_fore.webp delete mode 100644 mode/resources/device-art-resources/pixel_c/land_shadow.webp delete mode 100644 mode/resources/device-art-resources/pixel_c/layout delete mode 100644 mode/resources/device-art-resources/pixel_c/port_back.webp delete mode 100644 mode/resources/device-art-resources/pixel_c/port_fore.webp delete mode 100644 mode/resources/device-art-resources/pixel_c/port_shadow.webp delete mode 100644 mode/resources/device-art-resources/wearos_small_round/device_bezel.png delete mode 100644 mode/resources/device-art-resources/wearos_small_round/hardware.ini delete mode 100644 mode/resources/device-art-resources/wearos_small_round/layout delete mode 100644 mode/resources/device-art-resources/wearos_square/device_bezel.png delete mode 100644 mode/resources/device-art-resources/wearos_square/hardware.ini delete mode 100644 mode/resources/device-art-resources/wearos_square/layout delete mode 100644 mode/scripts/permissions.py delete mode 100644 mode/scripts/requirements.txt delete mode 100644 mode/src/processing/mode/android/AVD.java delete mode 100644 mode/src/processing/mode/android/AndroidBuild.java delete mode 100644 mode/src/processing/mode/android/AndroidDebugger.java delete mode 100644 mode/src/processing/mode/android/AndroidEditor.java delete mode 100644 mode/src/processing/mode/android/AndroidKeyStore.java delete mode 100644 mode/src/processing/mode/android/AndroidLineBreakpoint.java delete mode 100644 mode/src/processing/mode/android/AndroidMode.java delete mode 100644 mode/src/processing/mode/android/AndroidRunner.java delete mode 100644 mode/src/processing/mode/android/AndroidSDK.java delete mode 100644 mode/src/processing/mode/android/AndroidTool.java delete mode 100644 mode/src/processing/mode/android/AndroidToolbar.java delete mode 100644 mode/src/processing/mode/android/AndroidUtil.java delete mode 100644 mode/src/processing/mode/android/Commander.java delete mode 100644 mode/src/processing/mode/android/Device.java delete mode 100644 mode/src/processing/mode/android/DeviceListener.java delete mode 100644 mode/src/processing/mode/android/Devices.java delete mode 100644 mode/src/processing/mode/android/EmulatorController.java delete mode 100644 mode/src/processing/mode/android/KeyStoreManager.java delete mode 100644 mode/src/processing/mode/android/Keys.java delete mode 100644 mode/src/processing/mode/android/LogEntry.java delete mode 100644 mode/src/processing/mode/android/Manifest.java delete mode 100644 mode/src/processing/mode/android/Pair.java delete mode 100644 mode/src/processing/mode/android/Permissions.java delete mode 100644 mode/src/processing/mode/android/RedirectStreamHandler.java delete mode 100644 mode/src/processing/mode/android/SDKDownloader.java delete mode 100644 mode/src/processing/mode/android/SysImageDownloader.java delete mode 100644 mode/templates/ARActivity.java.tmpl delete mode 100644 mode/templates/ARBuild.gradle.tmpl delete mode 100644 mode/templates/ARBuildECJ.gradle.tmpl delete mode 100644 mode/templates/ARManifest.xml.tmpl delete mode 100644 mode/templates/AppActivity.java.tmpl delete mode 100644 mode/templates/AppBuild.gradle.tmpl delete mode 100644 mode/templates/AppBuildECJ.gradle.tmpl delete mode 100644 mode/templates/AppManifest.xml.tmpl delete mode 100644 mode/templates/ExpProperties.gradle.tmpl delete mode 100644 mode/templates/LayoutActivity.xml.tmpl delete mode 100644 mode/templates/Properties.gradle.tmpl delete mode 100644 mode/templates/Properties.local.tmpl delete mode 100644 mode/templates/Settings.gradle.tmpl delete mode 100644 mode/templates/StringsWallpaper.xml.tmpl delete mode 100644 mode/templates/StylesAR.xml.tmpl delete mode 100644 mode/templates/StylesFragment.xml.tmpl delete mode 100644 mode/templates/StylesVR.xml.tmpl delete mode 100644 mode/templates/TopBuild.gradle.tmpl delete mode 100644 mode/templates/VRActivity.java.tmpl delete mode 100644 mode/templates/VRBuild.gradle.tmpl delete mode 100644 mode/templates/VRBuildECJ.gradle.tmpl delete mode 100644 mode/templates/VRManifest.xml.tmpl delete mode 100644 mode/templates/WallpaperManifest.xml.tmpl delete mode 100644 mode/templates/WallpaperService.java.tmpl delete mode 100644 mode/templates/WatchFaceManifest.xml.tmpl delete mode 100644 mode/templates/WatchFaceService.java.tmpl delete mode 100644 mode/templates/WearBuild.gradle.tmpl delete mode 100644 mode/templates/WearBuildECJ.gradle.tmpl delete mode 100644 mode/templates/XMLWallpaper.xml.tmpl delete mode 100644 mode/templates/XMLWatchFace.xml.tmpl delete mode 100644 mode/theme/completion/class_obj-1x.png delete mode 100644 mode/theme/completion/class_obj-2x.png delete mode 100644 mode/theme/completion/field_default_obj-1x.png delete mode 100644 mode/theme/completion/field_default_obj-2x.png delete mode 100644 mode/theme/completion/field_protected_obj-1x.png delete mode 100644 mode/theme/completion/field_protected_obj-2x.png delete mode 100644 mode/theme/completion/methpub_obj-1x.png delete mode 100644 mode/theme/completion/methpub_obj-2x.png delete mode 100644 mode/theme/debug/breakpoint-enabled-1x.png delete mode 100644 mode/theme/debug/breakpoint-enabled-2x.png delete mode 100644 mode/theme/debug/continue-enabled-1x.png delete mode 100644 mode/theme/debug/continue-enabled-2x.png delete mode 100644 mode/theme/debug/step-enabled-1x.png delete mode 100644 mode/theme/debug/step-enabled-2x.png delete mode 100644 mode/theme/variables-1x.png delete mode 100644 mode/theme/variables-2x.png delete mode 100644 mode/tools/SDKUpdater/.classpath delete mode 100644 mode/tools/SDKUpdater/.gitignore delete mode 100644 mode/tools/SDKUpdater/.project delete mode 100644 mode/tools/SDKUpdater/.settings/org.eclipse.buildship.core.prefs delete mode 100644 mode/tools/SDKUpdater/.settings/org.eclipse.jdt.core.prefs delete mode 100644 mode/tools/SDKUpdater/build.gradle delete mode 100644 mode/tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java delete mode 100644 mode/version.properties create mode 100644 org/processing/android/processing-core/4.5.0b5/processing-core-4.5.0b5.jar create mode 100644 org/processing/android/processing-core/4.5.0b5/processing-core-4.5.0b5.jar.md5 create mode 100644 org/processing/android/processing-core/4.5.0b5/processing-core-4.5.0b5.jar.sha1 create mode 100644 org/processing/android/processing-core/4.5.0b5/processing-core-4.5.0b5.pom create mode 100644 org/processing/android/processing-core/4.5.0b5/processing-core-4.5.0b5.pom.md5 create mode 100644 org/processing/android/processing-core/4.5.0b5/processing-core-4.5.0b5.pom.sha1 create mode 100644 org/processing/android/processing-core/maven-metadata-local.xml create mode 100644 org/processing/android/processing-core/maven-metadata-local.xml.md5 create mode 100644 org/processing/android/processing-core/maven-metadata-local.xml.sha1 create mode 100755 release.sh delete mode 100644 scripts/publish-module.gradle delete mode 100644 scripts/publish-root.gradle delete mode 100644 settings.gradle diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml deleted file mode 100644 index 93c4b27b4..000000000 --- a/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: processing -custom: https://processingfoundation.org/ diff --git a/.gitignore b/.gitignore index 0dae35b4d..87f2a6943 100644 --- a/.gitignore +++ b/.gitignore @@ -1,30 +1,2 @@ -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 - -**/examples/**/AndroidManifest.xml - -**/*.iml **/.DS_Store -**/build -**/bin -**/dist - -**/local.properties -.gradle -.java-version diff --git a/README.md b/README.md index 743c8422c..8873a21bc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,15 @@ -Processing for Android -====================== +# Processing Android Maven Repository -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. +This is a Maven repository that can be accessed publicly from Gradle, etc. +Made following the instructions in this gist: +https://gist.github.com/fernandezpablo85/03cf8b0cd2e7d8527063 + +One caveat, use mvn version 3.8.7 because of this [bug](https://issues.apache.org/jira/browse/MNG-7679) or provide a pom.xml file instead having mvn auto-generating it. + +Place the processing-core-x.y.z.jar from building the core library into ../pkgs and then run: + +``` +./release.sh x.y.z +``` \ No newline at end of file diff --git a/build.gradle b/build.gradle deleted file mode 100644 index a957961c0..000000000 --- a/build.gradle +++ /dev/null @@ -1,173 +0,0 @@ -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:4.1.3' - classpath group: 'commons-io', name: 'commons-io', version: '2.8.0' - classpath group: 'org.zeroturnaround', name: 'zt-zip', version: '1.14' - } -} - -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/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) - } -} diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index a95a3cb68..000000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -// apply plugin: 'groovy' -plugins { - id 'groovy' -} - -repositories { - google() - mavenCentral() -} - -dependencies { - implementation gradleApi() - implementation localGroovy() - implementation 'com.android.tools.build:gradle:4.1.1' -} \ 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 4aadfdd44..000000000 --- a/core/build.gradle +++ /dev/null @@ -1,96 +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 { - - // 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/core/src/assets/shaders/ColorFrag.glsl b/core/src/assets/shaders/ColorFrag.glsl deleted file mode 100644 index 5f86d92b4..000000000 --- a/core/src/assets/shaders/ColorFrag.glsl +++ /dev/null @@ -1,32 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -varying vec4 vertColor; - -void main() { - gl_FragColor = vertColor; -} \ No newline at end of file diff --git a/core/src/assets/shaders/ColorVert.glsl b/core/src/assets/shaders/ColorVert.glsl deleted file mode 100644 index 65fd55716..000000000 --- a/core/src/assets/shaders/ColorVert.glsl +++ /dev/null @@ -1,34 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -uniform mat4 transformMatrix; - -attribute vec4 position; -attribute vec4 color; - -varying vec4 vertColor; - -void main() { - gl_Position = transformMatrix * position; - - vertColor = color; -} \ No newline at end of file diff --git a/core/src/assets/shaders/LightFrag.glsl b/core/src/assets/shaders/LightFrag.glsl deleted file mode 100644 index 6b60d4039..000000000 --- a/core/src/assets/shaders/LightFrag.glsl +++ /dev/null @@ -1,33 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -varying vec4 vertColor; -varying vec4 backVertColor; - -void main() { - gl_FragColor = gl_FrontFacing ? vertColor : backVertColor; -} \ No newline at end of file diff --git a/core/src/assets/shaders/LightVert.glsl b/core/src/assets/shaders/LightVert.glsl deleted file mode 100644 index adc4bf9ad..000000000 --- a/core/src/assets/shaders/LightVert.glsl +++ /dev/null @@ -1,151 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -uniform mat4 modelviewMatrix; -uniform mat4 transformMatrix; -uniform mat3 normalMatrix; - -uniform int lightCount; -uniform vec4 lightPosition[8]; -uniform vec3 lightNormal[8]; -uniform vec3 lightAmbient[8]; -uniform vec3 lightDiffuse[8]; -uniform vec3 lightSpecular[8]; -uniform vec3 lightFalloff[8]; -uniform vec2 lightSpot[8]; - -attribute vec4 position; -attribute vec4 color; -attribute vec3 normal; - -attribute vec4 ambient; -attribute vec4 specular; -attribute vec4 emissive; -attribute float shininess; - -varying vec4 vertColor; -varying vec4 backVertColor; - -const float zero_float = 0.0; -const float one_float = 1.0; -const vec3 zero_vec3 = vec3(0); - -float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) { - vec3 lpv = lightPos - vertPos; - vec3 dist = vec3(one_float); - dist.z = dot(lpv, lpv); - dist.y = sqrt(dist.z); - return one_float / dot(dist, coeff); -} - -float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) { - vec3 lpv = normalize(lightPos - vertPos); - vec3 nln = -one_float * lightNorm; - float spotCos = dot(nln, lpv); - return spotCos <= minCos ? zero_float : pow(spotCos, spotExp); -} - -float lambertFactor(vec3 lightDir, vec3 vecNormal) { - return max(zero_float, dot(lightDir, vecNormal)); -} - -float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) { - vec3 np = normalize(vertPos); - vec3 ldp = normalize(lightDir - np); - return pow(max(zero_float, dot(ldp, vecNormal)), shine); -} - -void main() { - // Vertex in clip coordinates - gl_Position = transformMatrix * position; - - // Vertex in eye coordinates - vec3 ecVertex = vec3(modelviewMatrix * position); - - // Normal vector in eye coordinates - vec3 ecNormal = normalize(normalMatrix * normal); - vec3 ecNormalInv = ecNormal * -one_float; - - // Light calculations - vec3 totalAmbient = vec3(0, 0, 0); - - vec3 totalFrontDiffuse = vec3(0, 0, 0); - vec3 totalFrontSpecular = vec3(0, 0, 0); - - vec3 totalBackDiffuse = vec3(0, 0, 0); - vec3 totalBackSpecular = vec3(0, 0, 0); - - for (int i = 0; i < 8; i++) { - if (lightCount == i) break; - - vec3 lightPos = lightPosition[i].xyz; - bool isDir = lightPosition[i].w < one_float; - float spotCos = lightSpot[i].x; - float spotExp = lightSpot[i].y; - - vec3 lightDir; - float falloff; - float spotf; - - if (isDir) { - falloff = one_float; - lightDir = -one_float * lightNormal[i]; - } else { - falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]); - lightDir = normalize(lightPos - ecVertex); - } - - spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i], - spotCos, spotExp) - : one_float; - - if (any(greaterThan(lightAmbient[i], zero_vec3))) { - totalAmbient += lightAmbient[i] * falloff; - } - - if (any(greaterThan(lightDiffuse[i], zero_vec3))) { - totalFrontDiffuse += lightDiffuse[i] * falloff * spotf * - lambertFactor(lightDir, ecNormal); - totalBackDiffuse += lightDiffuse[i] * falloff * spotf * - lambertFactor(lightDir, ecNormalInv); - } - - if (any(greaterThan(lightSpecular[i], zero_vec3))) { - totalFrontSpecular += lightSpecular[i] * falloff * spotf * - blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess); - totalBackSpecular += lightSpecular[i] * falloff * spotf * - blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess); - } - } - - // Calculating final color as result of all lights (plus emissive term). - // Transparency is determined exclusively by the diffuse component. - vertColor = vec4(totalAmbient, 0) * ambient + - vec4(totalFrontDiffuse, 1) * color + - vec4(totalFrontSpecular, 0) * specular + - vec4(emissive.rgb, 0); - - backVertColor = vec4(totalAmbient, 0) * ambient + - vec4(totalBackDiffuse, 1) * color + - vec4(totalBackSpecular, 0) * specular + - vec4(emissive.rgb, 0); -} \ No newline at end of file diff --git a/core/src/assets/shaders/LineFrag.glsl b/core/src/assets/shaders/LineFrag.glsl deleted file mode 100644 index 9046e17e9..000000000 --- a/core/src/assets/shaders/LineFrag.glsl +++ /dev/null @@ -1,32 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -varying vec4 vertColor; - -void main() { - gl_FragColor = vertColor; -} \ No newline at end of file diff --git a/core/src/assets/shaders/LineVert.glsl b/core/src/assets/shaders/LineVert.glsl deleted file mode 100644 index 15e7bf951..000000000 --- a/core/src/assets/shaders/LineVert.glsl +++ /dev/null @@ -1,99 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-17 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -#define PROCESSING_LINE_SHADER - -uniform mat4 modelviewMatrix; -uniform mat4 projectionMatrix; - -uniform vec4 viewport; -uniform int perspective; -uniform vec3 scale; - -attribute vec4 position; -attribute vec4 color; -attribute vec4 direction; - -varying vec4 vertColor; - -void main() { - vec4 posp = modelviewMatrix * position; - vec4 posq = modelviewMatrix * (position + vec4(direction.xyz, 0)); - - // Moving vertices slightly toward the camera - // to avoid depth-fighting with the fill triangles. - // Discussed here: - // http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=252848 - posp.xyz = posp.xyz * scale; - posq.xyz = posq.xyz * scale; - - vec4 p = projectionMatrix * posp; - vec4 q = projectionMatrix * posq; - - // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height]) - // screen_p = (p.xy/p.w + <1,1>) * 0.5 * viewport.zw - - // prevent division by W by transforming the tangent formula (div by 0 causes - // the line to disappear, see https://github.com/processing/processing/issues/5183) - // t = screen_q - screen_p - // - // tangent is normalized and we don't care which direction it points to (+-) - // t = +- normalize( screen_q - screen_p ) - // t = +- normalize( (q.xy/q.w+<1,1>)*0.5*viewport.zw - (p.xy/p.w+<1,1>)*0.5*viewport.zw ) - // - // extract common factor, <1,1> - <1,1> cancels out - // t = +- normalize( (q.xy/q.w - p.xy/p.w) * 0.5 * viewport.zw ) - // - // convert to common divisor - // t = +- normalize( ((q.xy*p.w - p.xy*q.w) / (p.w*q.w)) * 0.5 * viewport.zw ) - // - // remove the common scalar divisor/factor, not needed due to normalize and +- - // (keep viewport - can't remove because it has different components for x and y - // and corrects for aspect ratio, see https://github.com/processing/processing/issues/5181) - // t = +- normalize( (q.xy*p.w - p.xy*q.w) * viewport.zw ) - - vec2 tangent = (q.xy*p.w - p.xy*q.w) * viewport.zw; - // don't normalize zero vector (line join triangles and lines perpendicular to the eye plane) - tangent = length(tangent) == 0.0 ? vec2(0.0, 0.0) : normalize(tangent); - - // flip tangent to normal (it's already normalized) - vec2 normal = vec2(-tangent.y, tangent.x); - - float thickness = direction.w; - vec2 offset = normal * thickness; - - // Perspective --- - // convert from world to clip by multiplying with projection scaling factor - // to get the right thickness (see https://github.com/processing/processing/issues/5182) - // invert Y, projections in Processing invert Y - vec2 perspScale = (projectionMatrix * vec4(1, -1, 0, 0)).xy; - - // No Perspective --- - // multiply by W (to cancel out division by W later in the pipeline) and - // convert from screen to clip (derived from clip to screen above) - vec2 noPerspScale = p.w / (0.5 * viewport.zw); - - gl_Position.xy = p.xy + offset.xy * mix(noPerspScale, perspScale, float(perspective > 0)); - gl_Position.zw = p.zw; - - vertColor = color; -} diff --git a/core/src/assets/shaders/MaskFrag.glsl b/core/src/assets/shaders/MaskFrag.glsl deleted file mode 100644 index 3d7e7dbf1..000000000 --- a/core/src/assets/shaders/MaskFrag.glsl +++ /dev/null @@ -1,40 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -#define PROCESSING_TEXTURE_SHADER - -uniform sampler2D texture; -uniform sampler2D mask; - -varying vec4 vertTexCoord; - -void main() { - vec3 texColor = texture2D(texture, vertTexCoord.st).rgb; - vec3 maskColor = texture2D(mask, vertTexCoord.st).rgb; - float luminance = dot(maskColor, vec3(0.2126, 0.7152, 0.0722)); - gl_FragColor = vec4(texColor, luminance); -} \ No newline at end of file diff --git a/core/src/assets/shaders/P2DFrag.glsl b/core/src/assets/shaders/P2DFrag.glsl deleted file mode 100644 index ce3a3fb27..000000000 --- a/core/src/assets/shaders/P2DFrag.glsl +++ /dev/null @@ -1,14 +0,0 @@ -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -varying vec4 vertColor; -varying vec2 vertTexCoord; -varying float vertTexFactor; - -uniform sampler2D texture; - -void main() { - gl_FragColor = mix(vertColor, vertColor * texture2D(texture, vertTexCoord), vertTexFactor); -} diff --git a/core/src/assets/shaders/P2DVert.glsl b/core/src/assets/shaders/P2DVert.glsl deleted file mode 100644 index 4e9a1f7e1..000000000 --- a/core/src/assets/shaders/P2DVert.glsl +++ /dev/null @@ -1,23 +0,0 @@ -attribute vec3 position; -attribute vec4 color; -attribute vec2 texCoord; -attribute float texFactor; - -varying vec4 vertColor; -varying vec2 vertTexCoord; -varying float vertTexFactor; - -uniform mat4 transform; -uniform vec2 texScale; - -void main() { - gl_Position = transform * vec4(position, 1); - - //we avoid affecting the Z component by the transform - //because it would mess up our depth testing - gl_Position.z = position.z; - - vertColor = color.zyxw; - vertTexCoord = texCoord * texScale; - vertTexFactor = texFactor; -} diff --git a/core/src/assets/shaders/PointFrag.glsl b/core/src/assets/shaders/PointFrag.glsl deleted file mode 100644 index 5f86d92b4..000000000 --- a/core/src/assets/shaders/PointFrag.glsl +++ /dev/null @@ -1,32 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -varying vec4 vertColor; - -void main() { - gl_FragColor = vertColor; -} \ No newline at end of file diff --git a/core/src/assets/shaders/PointVert.glsl b/core/src/assets/shaders/PointVert.glsl deleted file mode 100644 index 292674615..000000000 --- a/core/src/assets/shaders/PointVert.glsl +++ /dev/null @@ -1,56 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-17 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -uniform mat4 projectionMatrix; -uniform mat4 modelviewMatrix; - -uniform vec4 viewport; -uniform int perspective; - -attribute vec4 position; -attribute vec4 color; -attribute vec2 offset; - -varying vec4 vertColor; - -void main() { - vec4 pos = modelviewMatrix * position; - vec4 clip = projectionMatrix * pos; - - // Perspective --- - // convert from world to clip by multiplying with projection scaling factor - // invert Y, projections in Processing invert Y - vec2 perspScale = (projectionMatrix * vec4(1, -1, 0, 0)).xy; - - // formula to convert from clip space (range -1..1) to screen space (range 0..[width or height]) - // screen_p = (p.xy/p.w + <1,1>) * 0.5 * viewport.zw - - // No Perspective --- - // multiply by W (to cancel out division by W later in the pipeline) and - // convert from screen to clip (derived from clip to screen above) - vec2 noPerspScale = clip.w / (0.5 * viewport.zw); - - gl_Position.xy = clip.xy + offset.xy * mix(noPerspScale, perspScale, float(perspective > 0)); - gl_Position.zw = clip.zw; - - vertColor = color; -} \ No newline at end of file diff --git a/core/src/assets/shaders/TexFrag.glsl b/core/src/assets/shaders/TexFrag.glsl deleted file mode 100644 index c8e183d49..000000000 --- a/core/src/assets/shaders/TexFrag.glsl +++ /dev/null @@ -1,37 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -uniform sampler2D texture; - -uniform vec2 texOffset; - -varying vec4 vertColor; -varying vec4 vertTexCoord; - -void main() { - gl_FragColor = texture2D(texture, vertTexCoord.st) * vertColor; -} \ No newline at end of file diff --git a/core/src/assets/shaders/TexLightFrag.glsl b/core/src/assets/shaders/TexLightFrag.glsl deleted file mode 100644 index fd9b61576..000000000 --- a/core/src/assets/shaders/TexLightFrag.glsl +++ /dev/null @@ -1,37 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ -#ifdef GL_ES -precision mediump float; -precision mediump int; -#endif - -uniform sampler2D texture; - -uniform vec2 texOffset; - -varying vec4 vertColor; -varying vec4 backVertColor; -varying vec4 vertTexCoord; - -void main() { - gl_FragColor = texture2D(texture, vertTexCoord.st) * (gl_FrontFacing ? vertColor : backVertColor); -} \ No newline at end of file diff --git a/core/src/assets/shaders/TexLightVert.glsl b/core/src/assets/shaders/TexLightVert.glsl deleted file mode 100644 index 57551edce..000000000 --- a/core/src/assets/shaders/TexLightVert.glsl +++ /dev/null @@ -1,157 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -uniform mat4 modelviewMatrix; -uniform mat4 transformMatrix; -uniform mat3 normalMatrix; -uniform mat4 texMatrix; - -uniform int lightCount; -uniform vec4 lightPosition[8]; -uniform vec3 lightNormal[8]; -uniform vec3 lightAmbient[8]; -uniform vec3 lightDiffuse[8]; -uniform vec3 lightSpecular[8]; -uniform vec3 lightFalloff[8]; -uniform vec2 lightSpot[8]; - -attribute vec4 position; -attribute vec4 color; -attribute vec3 normal; -attribute vec2 texCoord; - -attribute vec4 ambient; -attribute vec4 specular; -attribute vec4 emissive; -attribute float shininess; - -varying vec4 vertColor; -varying vec4 backVertColor; -varying vec4 vertTexCoord; - -const float zero_float = 0.0; -const float one_float = 1.0; -const vec3 zero_vec3 = vec3(0); - -float falloffFactor(vec3 lightPos, vec3 vertPos, vec3 coeff) { - vec3 lpv = lightPos - vertPos; - vec3 dist = vec3(one_float); - dist.z = dot(lpv, lpv); - dist.y = sqrt(dist.z); - return one_float / dot(dist, coeff); -} - -float spotFactor(vec3 lightPos, vec3 vertPos, vec3 lightNorm, float minCos, float spotExp) { - vec3 lpv = normalize(lightPos - vertPos); - vec3 nln = -one_float * lightNorm; - float spotCos = dot(nln, lpv); - return spotCos <= minCos ? zero_float : pow(spotCos, spotExp); -} - -float lambertFactor(vec3 lightDir, vec3 vecNormal) { - return max(zero_float, dot(lightDir, vecNormal)); -} - -float blinnPhongFactor(vec3 lightDir, vec3 vertPos, vec3 vecNormal, float shine) { - vec3 np = normalize(vertPos); - vec3 ldp = normalize(lightDir - np); - return pow(max(zero_float, dot(ldp, vecNormal)), shine); -} - -void main() { - // Vertex in clip coordinates - gl_Position = transformMatrix * position; - - // Vertex in eye coordinates - vec3 ecVertex = vec3(modelviewMatrix * position); - - // Normal vector in eye coordinates - vec3 ecNormal = normalize(normalMatrix * normal); - vec3 ecNormalInv = ecNormal * -one_float; - - // Light calculations - vec3 totalAmbient = vec3(0, 0, 0); - - vec3 totalFrontDiffuse = vec3(0, 0, 0); - vec3 totalFrontSpecular = vec3(0, 0, 0); - - vec3 totalBackDiffuse = vec3(0, 0, 0); - vec3 totalBackSpecular = vec3(0, 0, 0); - - for (int i = 0; i < 8; i++) { - if (lightCount == i) break; - - vec3 lightPos = lightPosition[i].xyz; - bool isDir = lightPosition[i].w < one_float; - float spotCos = lightSpot[i].x; - float spotExp = lightSpot[i].y; - - vec3 lightDir; - float falloff; - float spotf; - - if (isDir) { - falloff = one_float; - lightDir = -one_float * lightNormal[i]; - } else { - falloff = falloffFactor(lightPos, ecVertex, lightFalloff[i]); - lightDir = normalize(lightPos - ecVertex); - } - - spotf = spotExp > zero_float ? spotFactor(lightPos, ecVertex, lightNormal[i], - spotCos, spotExp) - : one_float; - - if (any(greaterThan(lightAmbient[i], zero_vec3))) { - totalAmbient += lightAmbient[i] * falloff; - } - - if (any(greaterThan(lightDiffuse[i], zero_vec3))) { - totalFrontDiffuse += lightDiffuse[i] * falloff * spotf * - lambertFactor(lightDir, ecNormal); - totalBackDiffuse += lightDiffuse[i] * falloff * spotf * - lambertFactor(lightDir, ecNormalInv); - } - - if (any(greaterThan(lightSpecular[i], zero_vec3))) { - totalFrontSpecular += lightSpecular[i] * falloff * spotf * - blinnPhongFactor(lightDir, ecVertex, ecNormal, shininess); - totalBackSpecular += lightSpecular[i] * falloff * spotf * - blinnPhongFactor(lightDir, ecVertex, ecNormalInv, shininess); - } - } - - // Calculating final color as result of all lights (plus emissive term). - // Transparency is determined exclusively by the diffuse component. - vertColor = vec4(totalAmbient, 0) * ambient + - vec4(totalFrontDiffuse, 1) * color + - vec4(totalFrontSpecular, 0) * specular + - vec4(emissive.rgb, 0); - - backVertColor = vec4(totalAmbient, 0) * ambient + - vec4(totalBackDiffuse, 1) * color + - vec4(totalBackSpecular, 0) * specular + - vec4(emissive.rgb, 0); - - // Calculating texture coordinates, with r and q set both to one - vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0); -} diff --git a/core/src/assets/shaders/TexVert.glsl b/core/src/assets/shaders/TexVert.glsl deleted file mode 100644 index c07dc30d7..000000000 --- a/core/src/assets/shaders/TexVert.glsl +++ /dev/null @@ -1,38 +0,0 @@ -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2012-16 The Processing Foundation - Copyright (c) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation, version 2.1. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -uniform mat4 transformMatrix; -uniform mat4 texMatrix; - -attribute vec4 position; -attribute vec4 color; -attribute vec2 texCoord; - -varying vec4 vertColor; -varying vec4 vertTexCoord; - -void main() { - gl_Position = transformMatrix * position; - - vertColor = color; - vertTexCoord = texMatrix * vec4(texCoord, 1.0, 1.0); -} \ No newline at end of file diff --git a/core/src/processing/a2d/PGraphicsAndroid2D.java b/core/src/processing/a2d/PGraphicsAndroid2D.java deleted file mode 100644 index b82ced644..000000000 --- a/core/src/processing/a2d/PGraphicsAndroid2D.java +++ /dev/null @@ -1,2390 +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) 2005-12 Ben Fry and Casey Reas - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.a2d; - -import android.annotation.SuppressLint; -import android.app.Activity; -import android.app.ActivityManager; -import android.app.ActivityManager.MemoryInfo; -import android.content.Context; -import android.graphics.*; -import android.graphics.Bitmap.Config; -import android.graphics.Paint.Style; -import android.os.Build; -import android.os.Environment; -import android.view.SurfaceHolder; -import static android.os.Environment.isExternalStorageRemovable; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.nio.ByteBuffer; -import java.io.InputStream; -import java.util.zip.GZIPInputStream; - -import processing.android.AppComponent; -import processing.core.PApplet; -import processing.core.PFont; -import processing.core.PGraphics; -import processing.core.PImage; -import processing.core.PMatrix; -import processing.core.PMatrix2D; -import processing.core.PMatrix3D; -import processing.core.PShape; -import processing.core.PShapeSVG; -import processing.core.PSurface; -import processing.data.XML; - -/** - * Subclass for PGraphics that implements the graphics API using - * the Android 2D graphics model. Similar tradeoffs to JAVA2D mode - * with the original (desktop) version of Processing. - */ -public class PGraphicsAndroid2D extends PGraphics { - static public boolean useBitmap = true; - - public Canvas canvas; // like g2 for PGraphicsJava2D - - /// break the shape at the next vertex (next vertex() call is a moveto()) - boolean breakShape; - - /// coordinates for internal curve calculation - float[] curveCoordX; - float[] curveCoordY; - float[] curveDrawX; - float[] curveDrawY; - - static protected final int MATRIX_STACK_DEPTH = 32; - protected float[][] transformStack; - public PMatrix2D transform; - protected Matrix transformMatrix; - protected float[] transformArray; - int transformCount; - -// Line2D.Float line = new Line2D.Float(); -// Ellipse2D.Float ellipse = new Ellipse2D.Float(); -// Rectangle2D.Float rect = new Rectangle2D.Float(); -// Arc2D.Float arc = new Arc2D.Float(); - /** - * The temporary path object that does most of the drawing work. If there are - * any points in the path (meaning that moveto has been called), then - * vertexCount will be 1 (or more). In the POLYGON case, vertexCount is only - * set to 1 after the first point is drawn (to indicate a moveto) and not - * incremented after, since the variable isn't used for POLYGON paths. - */ - Path path; - - /** Temporary rectangle object. */ - RectF rect; - -// protected Color tintColorObject; - -// protected Color fillColorObject; -// public boolean fillGradient; -// public Paint fillGradientObject; - -// protected Color strokeColorObject; -// public boolean strokeGradient; -// public Paint strokeGradientObject; - - Paint fillPaint; - Paint strokePaint; - Paint tintPaint; - - - /** - * Marks when changes to the size have occurred, so that the backing bitmap - * can be recreated. - */ - protected boolean sized; - - /** - * Marks when some changes have occurred, to the surface view. - */ - protected boolean changed; - - ////////////////////////////////////////////////////////////// - - // INTERNAL - - - public PGraphicsAndroid2D() { - transformStack = new float[MATRIX_STACK_DEPTH][6]; - transform = new PMatrix2D(); - transformMatrix = new Matrix(); - transformArray = new float[9]; - - path = new Path(); - rect = new RectF(); - - fillPaint = new Paint(); - fillPaint.setStyle(Style.FILL); - strokePaint = new Paint(); - strokePaint.setStyle(Style.STROKE); - tintPaint = new Paint(Paint.FILTER_BITMAP_FLAG); - } - - - //public void setParent(PApplet parent) - - - //public void setPrimary(boolean primary) - - - //public void setPath(String path) - - @Override - public void surfaceChanged() { - changed = true; - } - - - @Override - public void setSize(int iwidth, int iheight) { - sized = iwidth != width || iheight != height; - super.setSize(iwidth, iheight); - } - - - @Override - public void dispose() { - if (bitmap != null) bitmap.recycle(); - } - - - @Override - public PSurface createSurface(AppComponent component, SurfaceHolder holder, boolean reset) { // ignore - return new PSurfaceAndroid2D(this, component, holder); - } - - - ////////////////////////////////////////////////////////////// - - // FRAME - - @SuppressLint("NewApi") - protected Canvas checkCanvas() { - if ((canvas == null || sized) && (useBitmap || !primaryGraphics)) { - if (bitmap == null || bitmap.getWidth() * bitmap.getHeight() < width * height || - Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { - if (bitmap != null) bitmap.recycle(); - bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); - } else { - // reconfigure is only available in API level 19 or higher. - bitmap.reconfigure(width, height, bitmap.getConfig()); - } - canvas = new Canvas(bitmap); - sized = false; - } - restoreSurface(); - return canvas; - } - - - @Override - public void beginDraw() { - canvas = checkCanvas(); - - checkSettings(); - - resetMatrix(); // reset model matrix - - // reset vertices - vertexCount = 0; - } - - - @Override - public void endDraw() { - if (bitmap == null) return; - - if (primaryGraphics) { - SurfaceHolder holder = parent.getSurface().getSurfaceHolder(); - if (holder != null) { - Canvas screen = null; - try { - screen = holder.lockCanvas(null); - if (screen != null) { - screen.drawBitmap(bitmap, new Matrix(), null); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - if (screen != null) { - try { - holder.unlockCanvasAndPost(screen); - } catch (IllegalStateException ex) { - } catch (IllegalArgumentException ex) { - } - } - } - } - } else { - // TODO this is probably overkill for most tasks... - loadPixels(); - } - - // Marking as modified, and then calling updatePixels() in - // the super class, which just sets the mx1, my1, mx2, my2 - // coordinates of the modified area. This avoids doing the - // full copy of the pixels to the surface in this.updatePixels(). - setModified(); - super.updatePixels(); - } - - - - ////////////////////////////////////////////////////////////// - - // SETTINGS - - - //protected void checkSettings() - - - //protected void defaultSettings() - - - //protected void reapplySettings() - - - - ////////////////////////////////////////////////////////////// - - // HINT - - - //public void hint(int which) - - - - ////////////////////////////////////////////////////////////// - - // SHAPES - - - //public void beginShape(int kind) - - - @Override - public void beginShape(int kind) { - //super.beginShape(kind); - shape = kind; - vertexCount = 0; - curveVertexCount = 0; - - // reset the path, because when mixing curves and straight - // lines, vertexCount will be set back to zero, so vertexCount == 1 - // is no longer a good indicator of whether the shape is new. - // this way, just check to see if gpath is null, and if it isn't - // then just use it to continue the shape. - //path = null; -// path.reset(); -// pathReset = true; - } - - - //public boolean edge(boolean e) - - - //public void normal(float nx, float ny, float nz) { - - - //public void textureMode(int mode) - - - @Override - public void texture(PImage image) { - showMethodWarning("texture"); - } - - - @Override - public void vertex(float x, float y) { - // POLYGON and POINTS are broken out for efficiency - if (shape == POLYGON) { -// if (path == null) { -// path = new Path(); -// path.moveTo(x, y); - //if (pathReset) { - if (vertexCount == 0) { - path.reset(); - path.moveTo(x, y); - vertexCount = 1; -// pathReset = false; - } else if (breakShape) { - path.moveTo(x, y); - breakShape = false; - } else { - path.lineTo(x, y); - } - - // this is way too slow, otherwise what's the point of using beginShape() -// } else if (shape == POINTS) { -// point(x, y); - - } else { - curveVertexCount = 0; - - if (vertexCount == vertices.length) { - float temp[][] = new float[vertexCount<<1][VERTEX_FIELD_COUNT]; - System.arraycopy(vertices, 0, temp, 0, vertexCount); - vertices = temp; - } - // not everyone needs this, but just easier to store rather - // than adding another moving part to the code... - vertices[vertexCount][X] = x; - vertices[vertexCount][Y] = y; - vertexCount++; - - switch (shape) { - - case POINTS: - // store them for later - break; - - case LINES: - if ((vertexCount % 2) == 0) { - line(vertices[vertexCount-2][X], - vertices[vertexCount-2][Y], x, y); - vertexCount = 0; - } - break; - - case LINE_STRIP: - case LINE_LOOP: - if (vertexCount >= 2) { - line(vertices[vertexCount-2][X], - vertices[vertexCount-2][Y], x, y); - } - break; - - case TRIANGLES: - if ((vertexCount % 3) == 0) { - triangle(vertices[vertexCount - 3][X], - vertices[vertexCount - 3][Y], - vertices[vertexCount - 2][X], - vertices[vertexCount - 2][Y], - x, y); - vertexCount = 0; - } - break; - - case TRIANGLE_STRIP: - if (vertexCount >= 3) { - triangle(vertices[vertexCount - 2][X], - vertices[vertexCount - 2][Y], - x, //vertices[vertexCount - 1][X], - y, //vertices[vertexCount - 1][Y], - vertices[vertexCount - 3][X], - vertices[vertexCount - 3][Y]); - } - break; - - case TRIANGLE_FAN: - if (vertexCount >= 3) { - triangle(vertices[0][X], - vertices[0][Y], - vertices[vertexCount - 2][X], - vertices[vertexCount - 2][Y], - x, y); - } - break; - - case QUAD: - case QUADS: - if ((vertexCount % 4) == 0) { - quad(vertices[vertexCount - 4][X], - vertices[vertexCount - 4][Y], - vertices[vertexCount - 3][X], - vertices[vertexCount - 3][Y], - vertices[vertexCount - 2][X], - vertices[vertexCount - 2][Y], - x, y); - vertexCount = 0; - } - break; - - case QUAD_STRIP: - // 0---2---4 - // | | | - // 1---3---5 - if ((vertexCount >= 4) && ((vertexCount % 2) == 0)) { - quad(vertices[vertexCount - 4][X], - vertices[vertexCount - 4][Y], - vertices[vertexCount - 2][X], - vertices[vertexCount - 2][Y], - x, y, - vertices[vertexCount - 3][X], - vertices[vertexCount - 3][Y]); - } - break; - } - } - } - - - @Override - public void vertex(float x, float y, float z) { - showDepthWarningXYZ("vertex"); - } - - - @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)"); - } - - - @Override - public void vertex(float x, float y, float z, float u, float v) { - showDepthWarningXYZ("vertex"); - } - - - @Override - public void breakShape() { - breakShape = true; - } - - - @Override - public void endShape(int mode) { - if (shape == POINTS && stroke && vertexCount > 0) { - Matrix m = getMatrixImp(); - if (strokeWeight == 1 && m.isIdentity()) { - if (screenPoint == null) { - screenPoint = new float[2]; - } - for (int i = 0; i < vertexCount; i++) { - screenPoint[0] = vertices[i][X]; - screenPoint[1] = vertices[i][Y]; - m.mapPoints(screenPoint); - set(PApplet.round(screenPoint[0]), PApplet.round(screenPoint[1]), strokeColor); - float x = vertices[i][X]; - float y = vertices[i][Y]; - set(PApplet.round(screenX(x, y)), PApplet.round(screenY(x, y)), strokeColor); - } - } else { - float sw = strokeWeight / 2; - // temporarily use the stroke Paint as a fill - strokePaint.setStyle(Style.FILL); - for (int i = 0; i < vertexCount; i++) { - float x = vertices[i][X]; - float y = vertices[i][Y]; - rect.set(x - sw, y - sw, x + sw, y + sw); - canvas.drawOval(rect, strokePaint); - } - strokePaint.setStyle(Style.STROKE); - } - } else if (shape == POLYGON) { - if (!path.isEmpty()) { - if (mode == CLOSE) { - path.close(); - } - drawPath(); - } - } else if (shape == LINE_LOOP && vertexCount >= 2) { - line(vertices[vertexCount-1][X], - vertices[vertexCount-1][Y], - vertices[0][X], - vertices[0][Y]); - } - shape = 0; - } - - - ////////////////////////////////////////////////////////////// - - // CLIPPING - - - @Override - protected void clipImpl(float x1, float y1, float x2, float y2) { - canvas.clipRect(x1, y1, x2, y2); - } - - - @Override - public void noClip() { - canvas.clipRect(0, 0, width, height, Region.Op.REPLACE); - } - - - ////////////////////////////////////////////////////////////// - - // BEZIER VERTICES - - - @Override - public void bezierVertex(float x1, float y1, - float x2, float y2, - float x3, float y3) { - // will check to make sure that vertexCount > 0 - bezierVertexCheck(); - path.cubicTo(x1, y1, x2, y2, x3, y3); - } - - - @Override - public void bezierVertex(float x2, float y2, float z2, - float x3, float y3, float z3, - float x4, float y4, float z4) { - showDepthWarningXYZ("bezierVertex"); - } - - - - ////////////////////////////////////////////////////////////// - - // QUADRATIC BEZIER VERTICES - - - @Override - public void quadraticVertex(float ctrlX, float ctrlY, - float endX, float endY) { - bezierVertexCheck(); - path.quadTo(ctrlX, ctrlY, endX, endY); - } - - - @Override - public void quadraticVertex(float x2, float y2, float z2, - float x4, float y4, float z4) { - showDepthWarningXYZ("quadVertex"); - } - - - - ////////////////////////////////////////////////////////////// - - // CURVE VERTICES - - - @Override - protected void curveVertexCheck() { - super.curveVertexCheck(); - - if (curveCoordX == null) { - curveCoordX = new float[4]; - curveCoordY = new float[4]; - curveDrawX = new float[4]; - curveDrawY = new float[4]; - } - } - - - @Override - protected void curveVertexSegment(float x1, float y1, - float x2, float y2, - float x3, float y3, - float x4, float y4) { - curveCoordX[0] = x1; - curveCoordY[0] = y1; - - curveCoordX[1] = x2; - curveCoordY[1] = y2; - - curveCoordX[2] = x3; - curveCoordY[2] = y3; - - curveCoordX[3] = x4; - curveCoordY[3] = y4; - - curveToBezierMatrix.mult(curveCoordX, curveDrawX); - curveToBezierMatrix.mult(curveCoordY, curveDrawY); - - // since the paths are continuous, - // only the first point needs the actual moveto - if (vertexCount == 0) { -// if (path == null) { -// path = new Path(); - path.moveTo(curveDrawX[0], curveDrawY[0]); - vertexCount = 1; - } - - path.cubicTo(curveDrawX[1], curveDrawY[1], - curveDrawX[2], curveDrawY[2], - curveDrawX[3], curveDrawY[3]); - } - - - @Override - public void curveVertex(float x, float y, float z) { - showDepthWarningXYZ("curveVertex"); - } - - - - ////////////////////////////////////////////////////////////// - - // RENDERER - - - //public void flush() - - - - ////////////////////////////////////////////////////////////// - - // POINT, LINE, TRIANGLE, QUAD - - - @Override - public void point(float x, float y) { - // this is a slow function to call on its own anyway. - // most people will use set(). - beginShape(POINTS); - vertex(x, y); - endShape(); -// if (strokeWeight > 1) { -// //line(x, y, x + EPSILON, y + EPSILON); -// float sw = strokeWeight / 2; -// rect.set(x - sw, y - sw, x + sw, y + sw); -// strokePaint.setStyle(Style.FILL); -// canvas.drawOval(rect, strokePaint); -// strokePaint.setStyle(Style.STROKE); -// } else { -// // TODO this isn't accurate, really we need to -// set(PApplet.round(screenX(x, y)), PApplet.round(screenY(x, y)), strokeColor); -// } - } - - - @Override - public void line(float x1, float y1, float x2, float y2) { -// line.setLine(x1, y1, x2, y2); -// strokeShape(line); - if (stroke) { - canvas.drawLine(x1, y1, x2, y2, strokePaint); - } - } - - - @Override - public void triangle(float x1, float y1, float x2, float y2, - float x3, float y3) { - path.reset(); - path.moveTo(x1, y1); - path.lineTo(x2, y2); - path.lineTo(x3, y3); - path.close(); - drawPath(); - } - - - @Override - public void quad(float x1, float y1, float x2, float y2, - float x3, float y3, float x4, float y4) { - path.reset(); - path.moveTo(x1, y1); - path.lineTo(x2, y2); - path.lineTo(x3, y3); - path.lineTo(x4, y4); - path.close(); - drawPath(); - } - - - - ////////////////////////////////////////////////////////////// - - // RECT - - - //public void rectMode(int mode) - - - //public void rect(float a, float b, float c, float d) - - - @Override - protected void rectImpl(float x1, float y1, float x2, float y2) { -// rect.setFrame(x1, y1, x2-x1, y2-y1); -// drawShape(rect); - //rect.set(x1, y1, x2, y2); - if (fill) { - canvas.drawRect(x1, y1, x2, y2, fillPaint); - } - if (stroke) { - canvas.drawRect(x1, y1, x2, y2, strokePaint); - } - } - - - - ////////////////////////////////////////////////////////////// - - // ELLIPSE - - - //public void ellipseMode(int mode) - - - //public void ellipse(float a, float b, float c, float d) - - - @Override - protected void ellipseImpl(float x, float y, float w, float h) { -// ellipse.setFrame(x, y, w, h); -// drawShape(ellipse); - rect.set(x, y, x+w, y+h); - if (fill) { - canvas.drawOval(rect, fillPaint); - } - if (stroke) { - canvas.drawOval(rect, strokePaint); - } - } - - - - ////////////////////////////////////////////////////////////// - - // ARC - - - //public void arc(float a, float b, float c, float d, - // float start, float stop) - - - @Override - protected void arcImpl(float x, float y, float w, float h, - float start, float stop, int mode) { - // 0 to 90 in java would be 0 to -90 for p5 renderer - // but that won't work, so -90 to 0? - - if (stop - start >= TWO_PI) { - ellipseImpl(x, y, w, h); - - } else { - // Android agrees with us, so don't set start/stop negative like Java 2D - start = start * RAD_TO_DEG; - stop = stop * RAD_TO_DEG; - - // ok to do this because already checked for NaN - while (start < 0) { - start += 360; - stop += 360; - } - if (start > stop) { - float temp = start; - start = stop; - stop = temp; - } - - float sweep = stop - start; - rect.set(x, y, x+w, y+h); - - if (mode == 0) { - if (fill) { - canvas.drawArc(rect, start, sweep, true, fillPaint); - } - if (stroke) { - canvas.drawArc(rect, start, sweep, false, strokePaint); - } - } else if (mode == OPEN) { - if (fill) { - // Android does not support stroke and fill with different color - // after drawing the arc,draw the arc with Paint.Style.Stroke style - // again - canvas.drawArc(rect, start, sweep, false, fillPaint); - canvas.drawArc(rect, start, sweep, false, strokePaint); - } - if (stroke) { - canvas.drawArc(rect, start, sweep, false, strokePaint); - } - } else if (mode == CHORD) { - // Draw an extra line between start angle point and end point to - // achieve the chord - float endAngle = start + sweep; - float halfRectWidth = rect.width()/2; - float halfRectHeight = rect.height()/2; - float centerX = rect.centerX(); - float centerY = rect.centerY(); - - float startX = (float) (halfRectWidth* Math.cos(Math.toRadians(start))) + centerX; - float startY = (float) (halfRectHeight * Math.sin(Math.toRadians(start))) + centerY; - float endX = (float) (halfRectWidth * Math.cos(Math.toRadians(endAngle))) + centerX; - float endY = (float) (halfRectHeight * Math.sin(Math.toRadians(endAngle))) + centerY; - - if (fill) { - // draw the fill arc - canvas.drawArc(rect,start,sweep,false,fillPaint); - // draw the arc round border - canvas.drawArc(rect,start,sweep,false,strokePaint); - // draw the straight border - canvas.drawLine(startX,startY,endX,endY,strokePaint); - } - if (stroke) { - // draw the arc - canvas.drawArc(rect,start,sweep,false,strokePaint); - // draw the straight border - canvas.drawLine(startX,startY,endX,endY,strokePaint); - } - } else if (mode == PIE) { - if (fill) { - canvas.drawArc(rect, start, sweep, true, fillPaint); - } - if (stroke) { - canvas.drawArc(rect, start, sweep, true, strokePaint); - } - } - } - } - - - - ////////////////////////////////////////////////////////////// - - // JAVA2D SHAPE/PATH HANDLING - - -// protected void fillShape(Shape s) { -// if (fillGradient) { -// canvas.setPaint(fillGradientObject); -// canvas.fill(s); -// } else if (fill) { -// canvas.setColor(fillColorObject); -// canvas.fill(s); -// } -// } - - -// protected void strokeShape(Shape s) { -// if (strokeGradient) { -// canvas.setPaint(strokeGradientObject); -// canvas.draw(s); -// } else if (stroke) { -// canvas.setColor(strokeColorObject); -// canvas.draw(s); -// } -// } - - -// protected void drawShape(Shape s) { -// if (fillGradient) { -// canvas.setPaint(fillGradientObject); -// canvas.fill(s); -// } else if (fill) { -// canvas.setColor(fillColorObject); -// canvas.fill(s); -// } -// if (strokeGradient) { -// canvas.setPaint(strokeGradientObject); -// canvas.draw(s); -// } else if (stroke) { -// canvas.setColor(strokeColorObject); -// canvas.draw(s); -// } -// } - - - protected void drawPath() { - if (fill) { - canvas.drawPath(path, fillPaint); - } - if (stroke) { - canvas.drawPath(path, strokePaint); - } - } - - - - ////////////////////////////////////////////////////////////// - - // BOX - - - //public void box(float size) - - - @Override - public void box(float w, float h, float d) { - showMethodWarning("box"); - } - - - - ////////////////////////////////////////////////////////////// - - // SPHERE - - - //public void sphereDetail(int res) - - - //public void sphereDetail(int ures, int vres) - - - @Override - public void sphere(float r) { - showMethodWarning("sphere"); - } - - - - ////////////////////////////////////////////////////////////// - - // BEZIER - - - //public float bezierPoint(float a, float b, float c, float d, float t) - - - //public float bezierTangent(float a, float b, float c, float d, float t) - - - //protected void bezierInitCheck() - - - //protected void bezierInit() - - - /** Ignored (not needed) in Java 2D. */ - @Override - public void bezierDetail(int detail) { - } - - - //public void bezier(float x1, float y1, - // float x2, float y2, - // float x3, float y3, - // float x4, float y4) - - - //public void bezier(float x1, float y1, float z1, - // float x2, float y2, float z2, - // float x3, float y3, float z3, - // float x4, float y4, float z4) - - - - ////////////////////////////////////////////////////////////// - - // CURVE - - - //public float curvePoint(float a, float b, float c, float d, float t) - - - //public float curveTangent(float a, float b, float c, float d, float t) - - - /** Ignored (not needed) in Java 2D. */ - @Override - public void curveDetail(int detail) { - } - - //public void curveTightness(float tightness) - - - //protected void curveInitCheck() - - - //protected void curveInit() - - - //public void curve(float x1, float y1, - // float x2, float y2, - // float x3, float y3, - // float x4, float y4) - - - //public void curve(float x1, float y1, float z1, - // float x2, float y2, float z2, - // float x3, float y3, float z3, - // float x4, float y4, float z4) - - - - ////////////////////////////////////////////////////////////// - - // SMOOTH - - - @Override - public void smooth(int quality) { // ignore - super.smooth(quality); -// smooth = true; -// canvas.setRenderingHint(RenderingHints.KEY_ANTIALIASING, -// RenderingHints.VALUE_ANTIALIAS_ON); -// canvas.setRenderingHint(RenderingHints.KEY_INTERPOLATION, -// RenderingHints.VALUE_INTERPOLATION_BICUBIC); - strokePaint.setAntiAlias(true); - fillPaint.setAntiAlias(true); - } - - - @Override - public void noSmooth() { - super.noSmooth(); -// smooth = false; -// canvas.setRenderingHint(RenderingHints.KEY_ANTIALIASING, -// RenderingHints.VALUE_ANTIALIAS_OFF); -// canvas.setRenderingHint(RenderingHints.KEY_INTERPOLATION, -// RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); - strokePaint.setAntiAlias(false); - fillPaint.setAntiAlias(false); - } - - - - ////////////////////////////////////////////////////////////// - - // IMAGE - - - //public void imageMode(int mode) - - - //public void image(PImage image, float x, float y) - - - //public void image(PImage image, float x, float y, float c, float d) - - - //public void image(PImage image, - // float a, float b, float c, float d, - // int u1, int v1, int u2, int v2) - - - Rect imageImplSrcRect; - RectF imageImplDstRect; - //android.widget.ImageView imv; - - /** - * Handle renderer-specific image drawing. - */ - @Override - protected void imageImpl(PImage src, - float x1, float y1, float x2, float y2, - int u1, int v1, int u2, int v2) { - Bitmap bitmap = (Bitmap)src.getNative(); - - if (bitmap != null && bitmap.isRecycled()) { - // Let's make sure it is recreated - bitmap = null; - } - - if (bitmap == null && src.format == ALPHA) { - // create an alpha bitmap for this feller - bitmap = Bitmap.createBitmap(src.width, src.height, Config.ARGB_8888); - int[] px = new int[src.pixels.length]; - for (int i = 0; i < px.length; i++) { - px[i] = src.pixels[i] << 24 | 0xFFFFFF; - } - bitmap.setPixels(px, 0, src.width, 0, 0, src.width, src.height); - modified = false; - src.setNative(bitmap); - } - - // this version's not usable because it doesn't allow you to set output w/h -// if (src.bitmap == null) { // format is ARGB or RGB -// int offset = v1*src.width + u1; -// canvas.drawBitmap(src.pixels, offset, src.width, -// x1, y1, u2-u1, v2-v1, -// src.format == ARGB, tint ? tintPaint : null); -// } else { - - if (bitmap == null || - src.width != bitmap.getWidth() || - src.height != bitmap.getHeight()) { - if (bitmap != null) bitmap.recycle(); - bitmap = Bitmap.createBitmap(src.width, src.height, Config.ARGB_8888); - modified = true; - src.setNative(bitmap); - } - - if (src.isModified()) { - //System.out.println("mutable, recycled = " + who.bitmap.isMutable() + ", " + who.bitmap.isRecycled()); - if (!bitmap.isMutable()) { - bitmap.recycle(); - bitmap = Bitmap.createBitmap(src.width, src.height, Config.ARGB_8888); - src.setNative(bitmap); - } - if (src.pixels != null) { - bitmap.setPixels(src.pixels, 0, src.width, 0, 0, src.width, src.height); - } - src.setModified(false); - } - - if (imageImplSrcRect == null) { - imageImplSrcRect = new Rect(u1, v1, u2, v2); - imageImplDstRect = new RectF(x1, y1, x2, y2); - } else { - imageImplSrcRect.set(u1, v1, u2, v2); - imageImplDstRect.set(x1, y1, x2, y2); - } - //canvas.drawBitmap(who.bitmap, imageImplSrcRect, imageImplDstRect, tint ? tintPaint : null); - //System.out.println(PApplet.hex(fillPaint.getColor())); - //canvas.drawBitmap(who.bitmap, imageImplSrcRect, imageImplDstRect, fillPaint); - // System.out.println("drawing lower, tint = " + tint + " " + PApplet.hex(tintPaint.getColor())); - canvas.drawBitmap(bitmap, imageImplSrcRect, imageImplDstRect, tint ? tintPaint : null); - - // If the OS things the memory is low, then recycles bitmaps automatically... - // but I don't think it is particularly efficient, as the bitmaps are stored - // in native heap for Android 10 and older. - MemoryInfo mi = new MemoryInfo(); - Activity activity = parent.getSurface().getActivity(); - if (activity == null) return; - ActivityManager activityManager = (ActivityManager) activity.getSystemService(android.content.Context.ACTIVITY_SERVICE); - activityManager.getMemoryInfo(mi); - if (mi.lowMemory) { - bitmap.recycle(); - src.setNative(null); - } - } - - - - ////////////////////////////////////////////////////////////// - - // SHAPE - - - //public void shapeMode(int mode) - - - //public void shape(PShape shape) - - - //public void shape(PShape shape, float x, float y) - - - //public void shape(PShape shape, float x, float y, float c, float d) - - - ////////////////////////////////////////////////////////////// - - // SHAPE I/O - - - @Override - public PShape loadShape(String filename) { - String extension = PApplet.getExtension(filename); - - PShapeSVG svg = null; - - if (extension.equals("svg")) { - svg = new PShapeSVG(parent.loadXML(filename)); - - } else if (extension.equals("svgz")) { - try { - InputStream input = new GZIPInputStream(parent.createInput(filename)); - XML xml = new XML(input); - svg = new PShapeSVG(xml); - } catch (Exception e) { - e.printStackTrace(); - } - } else { - PGraphics.showWarning("Unsupported format"); - } - - return svg; - } - - - ////////////////////////////////////////////////////////////// - - // TEXT ATTRIBTUES - - - //public void textAlign(int align) - - - //public void textAlign(int alignX, int alignY) - - -// public float textAscent() { -// if (textFont == null) { -// defaultFontOrDeath("textAscent"); -// } -//// Font font = textFont.getFont(); -// Typeface font = textFont.getTypeface(); -// if (font == null) { -// return super.textAscent(); -// } -// return fillPaint.ascent(); -// } - - -// public float textDescent() { -// if (textFont == null) { -// defaultFontOrDeath("textDescent"); -// } -//// Font font = textFont.getFont(); -// Typeface font = textFont.getTypeface(); -// if (font == null) { -// return super.textDescent(); -// } -// return fillPaint.descent(); -// } - - - @Override - public void textFont(PFont which) { - super.textFont(which); - fillPaint.setTypeface((Typeface) which.getNative()); - fillPaint.setTextSize(which.getDefaultSize()); - } - - - @Override - public void textFont(PFont which, float size) { - super.textFont(which, size); - fillPaint.setTypeface((Typeface) which.getNative()); - fillPaint.setTextSize(size); - } - - - //public void textLeading(float leading) - - - //public void textMode(int mode) - - - @Override - protected boolean textModeCheck(int mode) { - return mode == MODEL; - } - - - /** - * Same as parent, but override for native version of the font. - *

- * Also gets called by textFont, so the metrics - * will get recorded properly. - */ - @Override - public void textSize(float size) { - if (textFont == null) { - defaultFontOrDeath("textSize", size); - } - - Typeface font = (Typeface) textFont.getNative(); - if (font != null) { - fillPaint.setTextSize(size); - } - - handleTextSize(size); - } - - - protected void beginTextScreenMode() { - loadPixels(); - } - - protected void endTextScreenMode() { - updatePixels(); - } - - //public float textWidth(char c) - - - //public float textWidth(String str) - - - @Override - protected float textWidthImpl(char buffer[], int start, int stop) { -// Font font = textFont.getFont(); - Typeface font = (Typeface) textFont.getNative(); - if (font == null) { - return super.textWidthImpl(buffer, start, stop); - } - // maybe should use one of the newer/fancier functions for this? - int length = stop - start; -// FontMetrics metrics = canvas.getFontMetrics(font); -// return metrics.charsWidth(buffer, start, length); - return fillPaint.measureText(buffer, start, length); - } - - - - ////////////////////////////////////////////////////////////// - - // TEXT - - // None of the variations of text() are overridden from PGraphics. - - - - ////////////////////////////////////////////////////////////// - - // TEXT IMPL - - - //protected void textLineAlignImpl(char buffer[], int start, int stop, - // float x, float y) - - - @Override - protected void textLineImpl(char buffer[], int start, int stop, - float x, float y) { - Typeface font = (Typeface) textFont.getNative(); - if (font == null) { - showWarning("Inefficient font rendering: use createFont() with a TTF/OTF instead of loadFont()."); - //new Exception().printStackTrace(System.out); - super.textLineImpl(buffer, start, stop, x, y); - return; - } - - /* - // save the current setting for text smoothing. note that this is - // different from the smooth() function, because the font smoothing - // is controlled when the font is created, not now as it's drawn. - // fixed a bug in 0116 that handled this incorrectly. - Object textAntialias = - g2.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING); - - // override the current text smoothing setting based on the font - // (don't change the global smoothing settings) - g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, - textFont.smooth ? - RenderingHints.VALUE_ANTIALIAS_ON : - RenderingHints.VALUE_ANTIALIAS_OFF); - */ - -// Object antialias = -// canvas.getRenderingHint(RenderingHints.KEY_ANTIALIASING); -// if (antialias == null) { -// // if smooth() and noSmooth() not called, this will be null (0120) -// antialias = RenderingHints.VALUE_ANTIALIAS_DEFAULT; -// } - - // override the current smoothing setting based on the font - // also changes global setting for antialiasing, but this is because it's - // not possible to enable/disable them independently in some situations. -// canvas.setRenderingHint(RenderingHints.KEY_ANTIALIASING, -// textFont.smooth ? -// RenderingHints.VALUE_ANTIALIAS_ON : -// RenderingHints.VALUE_ANTIALIAS_OFF); - fillPaint.setAntiAlias(textFont.isSmooth()); - - //System.out.println("setting frac metrics"); - //g2.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, - // RenderingHints.VALUE_FRACTIONALMETRICS_ON); - -// canvas.setColor(fillColorObject); - int length = stop - start; -// canvas.drawChars(buffer, start, length, (int) (x + 0.5f), (int) (y + 0.5f)); - canvas.drawText(buffer, start, length, x, y, fillPaint); - - // return to previous smoothing state if it was changed -// canvas.setRenderingHint(RenderingHints.KEY_ANTIALIASING, antialias); - fillPaint.setAntiAlias(0 < smooth); - -// textX = x + textWidthImpl(buffer, start, stop); -// textY = y; -// textZ = 0; // this will get set by the caller if non-zero - } - - - - ////////////////////////////////////////////////////////////// - - // MATRIX STACK - - - @Override - public void pushMatrix() { - if (transformCount == transformStack.length) { - throw new RuntimeException("pushMatrix() cannot use push more than " + - transformStack.length + " times"); - } - transform.get(transformStack[transformCount]); - transformCount++; - -// canvas.save(); - } - - - @Override - public void popMatrix() { - if (transformCount == 0) { - throw new RuntimeException("missing a popMatrix() " + - "to go with that pushMatrix()"); - } - transformCount--; - transform.set(transformStack[transformCount]); - updateTransformMatrix(); - - // Using canvas.restore() here and canvas.save() in popMatrix() and should achieve - // the same effect as setting copying transform into transformMatrix with updateTransformMatrix() - // and setting it below, although it has been reported that with the later approach, a push/pop - // would not result in the initial matrix state: - // https://github.com/processing/processing-android/issues/445 - // However, cannot find - canvas.setMatrix(transformMatrix); -// canvas.restore(); - } - - - ////////////////////////////////////////////////////////////// - - // MATRIX TRANSFORMS - - - @Override - public void translate(float tx, float ty) { - transform.translate(tx, ty); - canvas.translate(tx, ty); - } - - - @Override - public void rotate(float angle) { - transform.rotate(angle); - canvas.rotate(angle * RAD_TO_DEG); - } - - - @Override - public void rotateX(float angle) { - showDepthWarning("rotateX"); - } - - - @Override - public void rotateY(float angle) { - showDepthWarning("rotateY"); - } - - - @Override - public void rotateZ(float angle) { - showDepthWarning("rotateZ"); - } - - - @Override - public void rotate(float angle, float vx, float vy, float vz) { - showVariationWarning("rotate"); - } - - - @Override - public void scale(float s) { - transform.scale(s, s); - canvas.scale(s, s); - } - - - @Override - public void scale(float sx, float sy) { - transform.scale(sx, sy); - canvas.scale(sx, sy); - } - - - @Override - public void scale(float sx, float sy, float sz) { - showDepthWarningXYZ("scale"); - } - - - @Override - public void shearX(float angle) { - float t = (float) Math.tan(angle); - transform.apply(1, t, 0, 0, 1, 0); - canvas.skew(t, 0); - } - - - @Override - public void shearY(float angle) { - float t = (float) Math.tan(angle); - transform.apply(1, 0, 0, t, 1, 0); - canvas.skew(0, t); - } - - - ////////////////////////////////////////////////////////////// - - // MATRIX MORE - - - @Override - public void resetMatrix() { - transform.reset(); - canvas.setMatrix(null); - } - - - //public void applyMatrix(PMatrix2D source) - - - @Override - public void applyMatrix(float n00, float n01, float n02, - float n10, float n11, float n12) { - transform.apply(n00, n01, n02, n10, n11, n12); - updateTransformMatrix(); - canvas.concat(transformMatrix); - } - - - //public void applyMatrix(PMatrix3D source) - - - @Override - public void applyMatrix(float n00, float n01, float n02, float n03, - float n10, float n11, float n12, float n13, - float n20, float n21, float n22, float n23, - float n30, float n31, float n32, float n33) { - showVariationWarning("applyMatrix"); - } - - - - ////////////////////////////////////////////////////////////// - - // MATRIX GET/SET - - - @Override - public PMatrix getMatrix() { - return getMatrix((PMatrix2D) null); - } - - - @Override - public PMatrix2D getMatrix(PMatrix2D target) { - if (target == null) { - target = new PMatrix2D(); - } - target.set(transform); - return target; - } - - - @Override - public PMatrix3D getMatrix(PMatrix3D target) { - showVariationWarning("getMatrix"); - return target; - } - - - //public void setMatrix(PMatrix source) - - - @Override - public void setMatrix(PMatrix2D source) { - transform.set(source); - updateTransformMatrix(); - canvas.setMatrix(transformMatrix); - } - - - @Override - public void setMatrix(PMatrix3D source) { - showVariationWarning("setMatrix"); - } - - - @Override - public void printMatrix() { - getMatrix((PMatrix2D) null).print(); - } - - - protected Matrix getMatrixImp() { - Matrix m = new Matrix(); - updateTransformMatrix(); - m.set(transformMatrix); - return m; -// return canvas.getMatrix(); - } - - - public void updateTransformMatrix() { - transformArray[0] = transform.m00; - transformArray[1] = transform.m01; - transformArray[2] = transform.m02; - transformArray[3] = transform.m10; - transformArray[4] = transform.m11; - transformArray[5] = transform.m12; - transformArray[6] = 0; - transformArray[7] = 0; - transformArray[8] = 1; - transformMatrix.setValues(transformArray); - } - - - ////////////////////////////////////////////////////////////// - - // CAMERA and PROJECTION - - // Inherit the plaintive warnings from PGraphics - - - //public void beginCamera() - //public void endCamera() - //public void camera() - //public void camera(float eyeX, float eyeY, float eyeZ, - // float centerX, float centerY, float centerZ, - // float upX, float upY, float upZ) - //public void printCamera() - - //public void ortho() - //public void ortho(float left, float right, - // float bottom, float top, - // float near, float far) - //public void perspective() - //public void perspective(float fov, float aspect, float near, float far) - //public void frustum(float left, float right, - // float bottom, float top, - // float near, float far) - //public void printProjection() - - - - ////////////////////////////////////////////////////////////// - - // SCREEN and MODEL transforms - - float[] screenPoint; - - @Override - public float screenX(float x, float y) { - if (screenPoint == null) { - screenPoint = new float[2]; - } - screenPoint[0] = x; - screenPoint[1] = y; - getMatrixImp().mapPoints(screenPoint); - return screenPoint[0]; - } - - - @Override - public float screenY(float x, float y) { - if (screenPoint == null) { - screenPoint = new float[2]; - } - screenPoint[0] = x; - screenPoint[1] = y; - getMatrixImp().mapPoints(screenPoint); - return screenPoint[1]; - } - - - @Override - public float screenX(float x, float y, float z) { - showDepthWarningXYZ("screenX"); - return 0; - } - - - @Override - public float screenY(float x, float y, float z) { - showDepthWarningXYZ("screenY"); - return 0; - } - - - @Override - public float screenZ(float x, float y, float z) { - showDepthWarningXYZ("screenZ"); - return 0; - } - - - //public float modelX(float x, float y, float z) - - - //public float modelY(float x, float y, float z) - - - //public float modelZ(float x, float y, float z) - - - - ////////////////////////////////////////////////////////////// - - // STYLE - - // pushStyle(), popStyle(), style() and getStyle() inherited. - - - - ////////////////////////////////////////////////////////////// - - // STROKE CAP/JOIN/WEIGHT - - - @Override - public void strokeCap(int cap) { - super.strokeCap(cap); - - if (strokeCap == ROUND) { - strokePaint.setStrokeCap(Paint.Cap.ROUND); - } else if (strokeCap == PROJECT) { - strokePaint.setStrokeCap(Paint.Cap.SQUARE); - } else { - strokePaint.setStrokeCap(Paint.Cap.BUTT); - } - } - - - @Override - public void strokeJoin(int join) { - super.strokeJoin(join); - - if (strokeJoin == MITER) { - strokePaint.setStrokeJoin(Paint.Join.MITER); - } else if (strokeJoin == ROUND) { - strokePaint.setStrokeJoin(Paint.Join.ROUND); - } else { - strokePaint.setStrokeJoin(Paint.Join.BEVEL); - } - } - - - @Override - public void strokeWeight(float weight) { - super.strokeWeight(weight); - strokePaint.setStrokeWidth(weight); - } - - - - ////////////////////////////////////////////////////////////// - - // STROKE - - // noStroke() and stroke() inherited from PGraphics. - - - @Override - protected void strokeFromCalc() { - super.strokeFromCalc(); -// strokeColorObject = new Color(strokeColor, true); - strokePaint.setColor(strokeColor); -// strokeGradient = false; - strokePaint.setShader(null); - } - - - - ////////////////////////////////////////////////////////////// - - // TINT - - // noTint() and tint() inherited from PGraphics. - - - @Override - protected void tintFromCalc() { - super.tintFromCalc(); - tintPaint.setColorFilter(new PorterDuffColorFilter(tintColor, PorterDuff.Mode.MULTIPLY)); - } - - - - ////////////////////////////////////////////////////////////// - - // FILL - - // noFill() and fill() inherited from PGraphics. - - - @Override - protected void fillFromCalc() { - super.fillFromCalc(); -// fillColorObject = new Color(fillColor, true); - fillPaint.setColor(fillColor); -// fillGradient = false; - fillPaint.setShader(null); - } - - - - ////////////////////////////////////////////////////////////// - - // MATERIAL PROPERTIES - - - //public void ambient(int rgb) - //public void ambient(float gray) - //public void ambient(float x, float y, float z) - //protected void ambientFromCalc() - //public void specular(int rgb) - //public void specular(float gray) - //public void specular(float x, float y, float z) - //protected void specularFromCalc() - //public void shininess(float shine) - //public void emissive(int rgb) - //public void emissive(float gray) - //public void emissive(float x, float y, float z ) - //protected void emissiveFromCalc() - - - - ////////////////////////////////////////////////////////////// - - // LIGHTS - - - //public void lights() - //public void noLights() - //public void ambientLight(float red, float green, float blue) - //public void ambientLight(float red, float green, float blue, - // float x, float y, float z) - //public void directionalLight(float red, float green, float blue, - // float nx, float ny, float nz) - //public void pointLight(float red, float green, float blue, - // float x, float y, float z) - //public void spotLight(float red, float green, float blue, - // float x, float y, float z, - // float nx, float ny, float nz, - // float angle, float concentration) - //public void lightFalloff(float constant, float linear, float quadratic) - //public void lightSpecular(float x, float y, float z) - //protected void lightPosition(int num, float x, float y, float z) - //protected void lightDirection(int num, float x, float y, float z) - - - - ////////////////////////////////////////////////////////////// - - // BACKGROUND - - // background() methods inherited from PGraphics, along with the - // PImage version of backgroundImpl(), since it just calls set(). - - - //public void backgroundImpl(PImage image) - - -// int[] clearPixels; - - @Override - public void backgroundImpl() { - canvas.drawColor(backgroundColor); - -// if (backgroundAlpha) { -// WritableRaster raster = ((BufferedImage) image).getRaster(); -// if ((clearPixels == null) || (clearPixels.length < width)) { -// clearPixels = new int[width]; -// } -// java.util.Arrays.fill(clearPixels, backgroundColor); -// for (int i = 0; i < height; i++) { -// raster.setDataElements(0, i, width, 1, clearPixels); -// } -// } else { -// //new Exception().printStackTrace(System.out); -// // in case people do transformations before background(), -// // need to handle this with a push/reset/pop -// pushMatrix(); -// resetMatrix(); -// canvas.setColor(new Color(backgroundColor)); //, backgroundAlpha)); -// canvas.fillRect(0, 0, width, height); -// popMatrix(); -// } - } - - - - ////////////////////////////////////////////////////////////// - - // COLOR MODE - - // All colorMode() variations are inherited from PGraphics. - - - - ////////////////////////////////////////////////////////////// - - // COLOR CALC - - // colorCalc() and colorCalcARGB() inherited from PGraphics. - - - - ////////////////////////////////////////////////////////////// - - // COLOR DATATYPE STUFFING - - // final color() variations inherited. - - - - ////////////////////////////////////////////////////////////// - - // COLOR DATATYPE EXTRACTION - - // final methods alpha, red, green, blue, - // hue, saturation, and brightness all inherited. - - - - ////////////////////////////////////////////////////////////// - - // COLOR DATATYPE INTERPOLATION - - // both lerpColor variants inherited. - - - - ////////////////////////////////////////////////////////////// - - // BEGIN/END RAW - - - @Override - public void beginRaw(PGraphics recorderRaw) { - showMethodWarning("beginRaw"); - } - - - @Override - public void endRaw() { - showMethodWarning("endRaw"); - } - - - - ////////////////////////////////////////////////////////////// - - // WARNINGS and EXCEPTIONS - - // showWarning and showException inherited. - - - - ////////////////////////////////////////////////////////////// - - // RENDERER SUPPORT QUERIES - - - //public boolean displayable() // true - - - //public boolean is2D() // true - - - //public boolean is3D() // false - - - - ////////////////////////////////////////////////////////////// - - // PIMAGE METHODS - - - // getImage, setCache, getCache, removeCache, isModified, setModified - - - @Override - public void loadPixels() { - if (bitmap == null) { - throw new RuntimeException("The pixels array is not available in this " + - "renderer withouth a backing bitmap"); - } - - if ((pixels == null) || (pixels.length != width * height)) { - pixels = new int[width * height]; - } -// WritableRaster raster = ((BufferedImage) image).getRaster(); -// raster.getDataElements(0, 0, width, height, pixels); - bitmap.getPixels(pixels, 0, width, 0, 0, width, height); - } - - - /** - * Update the pixels[] buffer to the PGraphics image. - *

- * Unlike in PImage, where updatePixels() only requests that the - * update happens, in PGraphicsJava2D, this will happen immediately. - */ - @Override - public void updatePixels() { - if (bitmap == null) { - throw new RuntimeException("The pixels array is not available in this " + - "renderer withouth a backing bitmap"); - } - -// WritableRaster raster = ((BufferedImage) image).getRaster(); -// raster.setDataElements(0, 0, width, height, pixels); - bitmap.setPixels(pixels, 0, width, 0, 0, width, height); - } - - - /** - * Update the pixels[] buffer to the PGraphics image. - *

- * Unlike in PImage, where updatePixels() only requests that the - * update happens, in PGraphicsJava2D, this will happen immediately. - */ - @Override - public void updatePixels(int x, int y, int c, int d) { - //if ((x == 0) && (y == 0) && (c == width) && (d == height)) { - if ((x != 0) || (y != 0) || (c != width) || (d != height)) { - // Show a warning message, but continue anyway. - showVariationWarning("updatePixels(x, y, w, h)"); - } - updatePixels(); - } - - - @Override - public void resize(int wide, int high) { - showMethodWarning("resize"); - } - - - @Override - protected void clearState() { - super.clearState(); - if (restoreFilename != null) { - File cacheFile = new File(restoreFilename); - cacheFile.delete(); - } - } - - - @Override - protected void saveState() { - super.saveState(); - - Context context = parent.getContext(); - if (context == null || bitmap == null || parent.getSurface().getComponent().isService()) return; - try { - // Saving current width and height to avoid restoring the screen after a screen rotation - restoreWidth = pixelWidth; - restoreHeight = pixelHeight; - - int size = bitmap.getHeight() * bitmap.getRowBytes(); - ByteBuffer restoreBitmap = ByteBuffer.allocate(size); - bitmap.copyPixelsToBuffer(restoreBitmap); - - // Tries to use external but if not mounted, falls back on internal storage, as shown in - // https://developer.android.com/topic/performance/graphics/cache-bitmap#java - File cacheDir = Environment.MEDIA_MOUNTED == Environment.getExternalStorageState() || !isExternalStorageRemovable() ? - context.getExternalCacheDir() : context.getCacheDir(); - File cacheFile = new File(cacheDir + File.separator + "restore_pixels"); - restoreFilename = cacheFile.getAbsolutePath(); - - FileOutputStream stream = new FileOutputStream(cacheFile); - ObjectOutputStream dout = new ObjectOutputStream(stream); - byte[] array = new byte[size]; - restoreBitmap.rewind(); - restoreBitmap.get(array); - dout.writeObject(array); - dout.flush(); - stream.getFD().sync(); - stream.close(); - } catch (Exception ex) { - PGraphics.showWarning("Could not save screen contents to cache"); - ex.printStackTrace(); - } - } - - - @Override - protected void restoreSurface() { - if (changed) { - changed = false; - if (restoreFilename != null && restoreWidth == pixelWidth && restoreHeight == pixelHeight) { - // Set the counter to 1 so the restore bitmap is drawn in the next frame. - restoreCount = 1; - } - } else if (restoreCount > 0) { - restoreCount--; - if (restoreCount == 0) { - Context context = parent.getContext(); - if (context == null) return; - try { - // Load cached bitmap and draw - File cacheFile = new File(restoreFilename); - FileInputStream inStream = new FileInputStream(cacheFile); - ObjectInputStream din = new ObjectInputStream(inStream); - byte[] array = (byte[]) din.readObject(); - ByteBuffer restoreBitmap = ByteBuffer.wrap(array); - if (restoreBitmap.capacity() == bitmap.getHeight() * bitmap.getRowBytes()) { - restoreBitmap.rewind(); - bitmap.copyPixelsFromBuffer(restoreBitmap); - } - inStream.close(); - cacheFile.delete(); - } catch (Exception ex) { - PGraphics.showWarning("Could not restore screen contents from cache"); - ex.printStackTrace(); - } finally { - restoreFilename = null; - restoreWidth = -1; - restoreHeight = -1; - restoredSurface = true; - } - } - } - super.restoreSurface(); - } - - - ////////////////////////////////////////////////////////////// - - // GET/SET - - - static int getset[] = new int[1]; - - - @Override - public int get(int x, int y) { - if ((bitmap == null) || (x < 0) || (y < 0) || (x >= width) || (y >= height)) return 0; -// WritableRaster raster = ((BufferedImage) image).getRaster(); -// raster.getDataElements(x, y, getset); -// return getset[0]; - return bitmap.getPixel(x, y); - } - - - //public PImage get(int x, int y, int w, int h) - - -// @Override -// public PImage getImpl(int x, int y, int w, int h) { -// PImage output = new PImage(); -// output.width = w; -// output.height = h; -// output.parent = parent; -// -// Bitmap bitsy = Bitmap.createBitmap(bitmap, x, y, w, h); -// // guessing it's more efficient to use Bitmap instead of pixels[] -// //bitsy.getPixels(output.pixels, 0, w, 0, 0, w, h); -// output.bitmap = bitsy; -// -// return output; -// } - - - @Override - public PImage get() { - return get(0, 0, width, height); - } - - - @Override - public void set(int x, int y, int argb) { - if ((bitmap == null) || (x < 0) || (y < 0) || (x >= width) || (y >= height)) return; -// getset[0] = argb; -// WritableRaster raster = ((BufferedImage) image).getRaster(); -// raster.setDataElements(x, y, getset); - bitmap.setPixel(x, y, argb); - } - - - @Override - public void set(int x, int y, PImage src) { - if (src.format == ALPHA) { - // set() doesn't really make sense for an ALPHA image, since it - // directly replaces pixels and does no blending. - throw new RuntimeException("set() not available for ALPHA images"); - } - - Bitmap bitmap = (Bitmap)src.getNative(); - if (bitmap == null) { - bitmap = Bitmap.createBitmap(src.width, src.height, Config.ARGB_8888); - src.setNative(bitmap); - src.setModified(); - } - if (src.width != bitmap.getWidth() || - src.height != bitmap.getHeight()) { - bitmap.recycle(); - bitmap = Bitmap.createBitmap(src.width, src.height, Config.ARGB_8888); - src.setNative(bitmap); - src.setModified(); - } - if (src.isModified()) { - if (!bitmap.isMutable()) { - bitmap.recycle(); - bitmap = Bitmap.createBitmap(src.width, src.height, Config.ARGB_8888); - setNative(bitmap); - } - bitmap.setPixels(src.pixels, 0, src.width, 0, 0, src.width, src.height); - src.setModified(false); - } - // set() happens in screen coordinates, so need to clear the ctm - pushMatrix(); - canvas.setMatrix(null); // set to identity - canvas.drawBitmap(bitmap, x, y, null); - popMatrix(); - } - - - // elaborate but silly version, since android will happily do this work -// private Rect setImplSrcRect; -// private Rect setImplDstRect; -// -// protected void setImpl(int dx, int dy, int sx, int sy, int sw, int sh, -// PImage src) { -// if (setImplSrcRect == null) { -// setImplSrcRect = new Rect(sx, sy, sx+sw, sy+sh); -// setImplDstRect = new Rect(dx, dy, dx+sw, dy+sh); -// } else { -// setImplSrcRect.set(sx, sy, sx+sw, sy+sh); -// setImplDstRect.set(dx, dy, dx+sw, dy+sh); -// } -// // set() happens in screen coordinates, so need to nuke the ctm -// canvas.save(Canvas.MATRIX_SAVE_FLAG); -// canvas.setMatrix(null); // set to identity -// canvas.drawBitmap(src.image, setImplSrcRect, setImplDstRect, null); -// canvas.restore(); -// } - - // PImage version -// int srcOffset = sy * src.width + sx; -// int dstOffset = dy * width + dx; -// -// for (int y = sy; y < sy + sh; y++) { -// System.arraycopy(src.pixels, srcOffset, pixels, dstOffset, sw); -// srcOffset += src.width; -// dstOffset += width; -// } -// updatePixelsImpl(sx, sy, sx+sw, sy+sh); - - // PGraphicsJava2D version -// WritableRaster raster = ((BufferedImage) image).getRaster(); -// if ((sx == 0) && (sy == 0) && (sw == src.width) && (sh == src.height)) { -// raster.setDataElements(dx, dy, src.width, src.height, src.pixels); -// } else { -// // TODO Optimize, incredibly inefficient to reallocate this much memory -// PImage temp = src.get(sx, sy, sw, sh); -// raster.setDataElements(dx, dy, temp.width, temp.height, temp.pixels); -// } - - - - ////////////////////////////////////////////////////////////// - - // MASK - - - @Override - public void mask(int alpha[]) { - showMethodWarning("mask"); - } - - - @Override - public void mask(PImage alpha) { - showMethodWarning("mask"); - } - - - - ////////////////////////////////////////////////////////////// - - // FILTER - - // Because the PImage versions call loadPixels() and - // updatePixels(), no need to override anything here. - - - //public void filter(int kind) - - - //public void filter(int kind, float param) - - - - ////////////////////////////////////////////////////////////// - - // COPY - - - @Override - public void copy(int sx, int sy, int sw, int sh, - int dx, int dy, int dw, int dh) { - if (bitmap == null) { - throw new RuntimeException("The pixels array is not available in this " + - "renderer withouth a backing bitmap"); - } - -// Bitmap bitsy = Bitmap.createBitmap(image, sx, sy, sw, sh); -// rect.set(dx, dy, dx + dw, dy + dh); -// canvas.drawBitmap(bitsy, - rect.set(dx, dy, dx+dw, dy+dh); - Rect src = new Rect(sx, sy, sx+sw, sy+sh); - canvas.drawBitmap(bitmap, src, rect, null); - -// if ((sw != dw) || (sh != dh)) { -// // use slow version if changing size -// copy(this, sx, sy, sw, sh, dx, dy, dw, dh); -// -// } else { -// dx = dx - sx; // java2d's "dx" is the delta, not dest -// dy = dy - sy; -// canvas.copyArea(sx, sy, sw, sh, dx, dy); -// } - } - - -// public void copy(PImage src, -// int sx1, int sy1, int sx2, int sy2, -// int dx1, int dy1, int dx2, int dy2) { -// loadPixels(); -// super.copy(src, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2); -// updatePixels(); -// } - - - - ////////////////////////////////////////////////////////////// - - // BLEND - - -// static public int blendColor(int c1, int c2, int mode) - - -// public void blend(int sx, int sy, int sw, int sh, -// int dx, int dy, int dw, int dh, int mode) - - -// public void blend(PImage src, -// int sx, int sy, int sw, int sh, -// int dx, int dy, int dw, int dh, int mode) - - - - ////////////////////////////////////////////////////////////// - - // SAVE - - -// public void save(String filename) { -// loadPixels(); -// super.save(filename); -// } -} \ No newline at end of file diff --git a/core/src/processing/a2d/PShapeAndroid2D.java b/core/src/processing/a2d/PShapeAndroid2D.java deleted file mode 100644 index b9bb2c019..000000000 --- a/core/src/processing/a2d/PShapeAndroid2D.java +++ /dev/null @@ -1,132 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.a2d; - -import android.graphics.Shader; - -import processing.core.PGraphics; -import processing.core.PShapeSVG; -import processing.data.XML; - -public class PShapeAndroid2D extends PShapeSVG { - protected Shader strokeGradientPaint; - protected Shader fillGradientPaint; - - - public PShapeAndroid2D(XML svg) { - super(svg); - } - - - public PShapeAndroid2D(PShapeSVG parent, XML properties, boolean parseKids) { - super(parent, properties, parseKids); - } - - - @Override - protected void setParent(PShapeSVG parent) { - super.setParent(parent); - - if (parent instanceof PShapeAndroid2D) { - PShapeAndroid2D pj = (PShapeAndroid2D) parent; - fillGradientPaint = pj.fillGradientPaint; - strokeGradientPaint = pj.strokeGradientPaint; - - } else { // parent is null or not Android2D - fillGradientPaint = null; - strokeGradientPaint = null; - } - } - - - /** Factory method for subclasses. */ - @Override - protected PShapeSVG createShape(PShapeSVG parent, XML properties, boolean parseKids) { - return new PShapeAndroid2D(parent, properties, parseKids); - } - - - // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - - protected Shader calcGradientPaint(Gradient gradient) { - // TODO just do this with the other parsing - int[] colors = new int[gradient.count]; - int opacityMask = ((int) (opacity * 255)) << 24; - for (int i = 0; i < gradient.count; i++) { - colors[i] = opacityMask | (gradient.color[i] & 0xFFFFFF); - } - - if (gradient instanceof LinearGradient) { - LinearGradient grad = (LinearGradient) gradient; -// return new LinearGradientPaint(grad.x1, grad.y1, grad.x2, grad.y2, -// grad.offset, grad.color, grad.count, -// opacity); - return new android.graphics.LinearGradient(grad.x1, grad.y1, - grad.x2, grad.y2, - colors, grad.offset, - Shader.TileMode.CLAMP ); - - } else if (gradient instanceof RadialGradient) { - RadialGradient grad = (RadialGradient) gradient; -// return new RadialGradientPaint(grad.cx, grad.cy, grad.r, -// grad.offset, grad.color, grad.count, -// opacity); - return new android.graphics.RadialGradient(grad.cx, grad.cy, grad.r, - colors, grad.offset, - Shader.TileMode.CLAMP); - } - return null; - } - - - // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - - @Override - protected void styles(PGraphics g) { - super.styles(g); - - if (g instanceof PGraphicsAndroid2D) { - PGraphicsAndroid2D gg = (PGraphicsAndroid2D) g; - - if (strokeGradient != null) { -// gg.strokeGradient = true; - if (strokeGradientPaint == null) { - strokeGradientPaint = calcGradientPaint(strokeGradient); - } - gg.strokePaint.setShader(strokeGradientPaint); - } - if (fillGradient != null) { -// gg.fillGradient = true; - if (fillGradientPaint == null) { - fillGradientPaint = calcGradientPaint(fillGradient); - } - gg.fillPaint.setShader(fillGradientPaint); - } else { - // need to shut off, in case parent object has a gradient applied - //gg.fillGradient = false; - } - } - } -} diff --git a/core/src/processing/a2d/PSurfaceAndroid2D.java b/core/src/processing/a2d/PSurfaceAndroid2D.java deleted file mode 100644 index eb7635b87..000000000 --- a/core/src/processing/a2d/PSurfaceAndroid2D.java +++ /dev/null @@ -1,159 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.a2d; - -import android.content.Context; -import android.graphics.Color; -import android.graphics.PixelFormat; -import android.service.wallpaper.WallpaperService; -import android.support.wearable.watchface.CanvasWatchFaceService; -import android.view.MotionEvent; -import android.view.SurfaceHolder; -import android.view.SurfaceView; - -import processing.android.AppComponent; -import processing.android.PFragment; -import processing.core.PApplet; -import processing.core.PGraphics; -import processing.core.PSurfaceNone; - -public class PSurfaceAndroid2D extends PSurfaceNone { - - public PSurfaceAndroid2D() { } - - public PSurfaceAndroid2D(PGraphics graphics, AppComponent component, SurfaceHolder holder) { - this.sketch = graphics.parent; - this.graphics = graphics; - this.component = component; - if (component.getKind() == AppComponent.FRAGMENT) { - PFragment frag = (PFragment)component; - activity = frag.getActivity(); - surfaceView = new SurfaceViewAndroid2D(activity, null); - } else if (component.getKind() == AppComponent.WALLPAPER) { - wallpaper = (WallpaperService)component; - surfaceView = new SurfaceViewAndroid2D(wallpaper, holder); - } else if (component.getKind() == AppComponent.WATCHFACE) { - watchface = (CanvasWatchFaceService)component; - surfaceView = null; - // Set as ready here, as watch faces don't have a surface view with a - // surfaceCreate() event to do it. - surfaceReady = true; - } - } - - /////////////////////////////////////////////////////////// - - // SurfaceView - - public class SurfaceViewAndroid2D extends SurfaceView implements SurfaceHolder.Callback { - SurfaceHolder holder; - - public SurfaceViewAndroid2D(Context context, SurfaceHolder holder) { - super(context); - this.holder = holder; - -// println("surface holder"); - // Install a SurfaceHolder.Callback so we get notified when the - // underlying surface is created and destroyed - SurfaceHolder h = getHolder(); - h.addCallback(this); -// surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU); // no longer needed. - -// println("setting focusable, requesting focus"); - setFocusable(true); - setFocusableInTouchMode(true); - requestFocus(); -// println("done making surface view"); - - surfaceReady = false; // Will be ready when the surfaceCreated() event is called - - // Solves screen flickering: - // https://github.com/processing/processing-android/issues/570 - setBackgroundColor(Color.argb(0, 0, 0, 0)); - getHolder().setFormat(PixelFormat.TRANSPARENT); - } - - @Override - public SurfaceHolder getHolder() { - if (holder == null) { - return super.getHolder(); - } else { - return holder; - } - } - - // part of SurfaceHolder.Callback - public void surfaceCreated(SurfaceHolder holder) { - surfaceReady = true; - if (requestedThreadStart) { - // Only start the thread once the surface has been created, otherwise it will not be able to draw - startThread(); - } - if (PApplet.DEBUG) { - System.out.println("surfaceCreated()"); - } - } - - - // part of SurfaceHolder.Callback - public void surfaceDestroyed(SurfaceHolder holder) { - if (PApplet.DEBUG) { - System.out.println("surfaceDestroyed()"); - } - } - - - // part of SurfaceHolder.Callback - public void surfaceChanged(SurfaceHolder holder, int format, int iwidth, int iheight) { - if (PApplet.DEBUG) { - System.out.println("SketchSurfaceView.surfaceChanged() " + iwidth + " " + iheight); - } - - sketch.surfaceChanged(); - sketch.setSize(iwidth, iheight); - } - - @Override - public void onWindowFocusChanged(boolean hasFocus) { - super.onWindowFocusChanged(hasFocus); - sketch.surfaceWindowFocusChanged(hasFocus); - } - - @Override - public boolean onTouchEvent(MotionEvent event) { - return sketch.surfaceTouchEvent(event); - } - - @Override - public boolean onKeyDown(int code, android.view.KeyEvent event) { - sketch.surfaceKeyDown(code, event); - return super.onKeyDown(code, event); - } - - @Override - public boolean onKeyUp(int code, android.view.KeyEvent event) { - sketch.surfaceKeyUp(code, event); - return super.onKeyUp(code, event); - } - } -} diff --git a/core/src/processing/android/ActivityAPI.java b/core/src/processing/android/ActivityAPI.java deleted file mode 100644 index 751ec2048..000000000 --- a/core/src/processing/android/ActivityAPI.java +++ /dev/null @@ -1,65 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.content.Intent; -import android.os.Bundle; -import android.view.ContextMenu; -import android.view.ContextMenu.ContextMenuInfo; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.Window; -import android.app.FragmentManager; - - -// Methods that should be implemented in PApplet to maintain backward -// compatibility with (some) functionality available from Activity/Fragment -public interface ActivityAPI { - // Lifecycle events - public void onCreate(Bundle savedInstanceState); - public void onDestroy(); - public void onStart(); - public void onStop(); - public void onPause(); - public void onResume(); - - // Activity and intent events - public void onActivityResult(int requestCode, int resultCode, Intent data); - public void onNewIntent(Intent intent); - - // Menu API - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater); - public boolean onOptionsItemSelected(MenuItem item); - public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo); - public boolean onContextItemSelected(MenuItem item); - public void setHasOptionsMenu(boolean hasMenu); - - // IO events - public void onBackPressed(); - - // Activity management - public FragmentManager getFragmentManager(); - public Window getWindow(); -} diff --git a/core/src/processing/android/AppComponent.java b/core/src/processing/android/AppComponent.java deleted file mode 100644 index 396e01126..000000000 --- a/core/src/processing/android/AppComponent.java +++ /dev/null @@ -1,52 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.content.Intent; - -import processing.core.PApplet; -import processing.core.PConstants; - -abstract public interface AppComponent extends PConstants { - static public final int FRAGMENT = 0; - static public final int WALLPAPER = 1; - static public final int WATCHFACE = 2; - - public void initDimensions(); - public int getDisplayWidth(); - public int getDisplayHeight(); - public float getDisplayDensity(); - public int getKind(); - public void setSketch(PApplet sketch); - public PApplet getSketch(); - - public boolean isService(); - public ServiceEngine getEngine(); - - public void startActivity(Intent intent); - - public void requestDraw(); - public boolean canDraw(); - - public void dispose(); -} diff --git a/core/src/processing/android/CompatUtils.java b/core/src/processing/android/CompatUtils.java deleted file mode 100644 index e218e860b..000000000 --- a/core/src/processing/android/CompatUtils.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2017-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.annotation.SuppressLint; -import android.os.Build; -import android.util.DisplayMetrics; -import android.view.Display; -import android.view.View; -import android.graphics.Point; - -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.concurrent.atomic.AtomicInteger; - -/** - * Compatibility utilities that work across versions of Android. Even though - * the mode sets API level 17 (Android 4.2) as the minimum target, because the - * core library could be used from another IDE and lower targets, then this - * compatibility methods are still needed. - */ -public class CompatUtils { - // Start at 15,000,000, taking into account the comment from Singed - // http://stackoverflow.com/a/39307421 - private static final AtomicInteger nextId = new AtomicInteger(15000000); - - - /** - * This method retrieves the "real" display metrics and size, without - * subtracting any window decor or applying any compatibility scale factors. - * @param display the Display object - * @param metrics the metrics to retrieve - * @param size the size to retrieve - */ - static public void getDisplayParams(Display display, - DisplayMetrics metrics, Point size) { - if (Build.VERSION_CODES.JELLY_BEAN_MR1 <= Build.VERSION.SDK_INT) { - display.getRealMetrics(metrics); - display.getRealSize(size); - } if (Build.VERSION_CODES.ICE_CREAM_SANDWICH <= Build.VERSION.SDK_INT) { - display.getMetrics(metrics); - // Use undocumented methods getRawWidth, getRawHeight - try { - size.x = (Integer) Display.class.getMethod("getRawWidth").invoke(display); - size.y = (Integer) Display.class.getMethod("getRawHeight").invoke(display); - } catch (Exception e) { - display.getSize(size); - } - } else { - display.getMetrics(metrics); - display.getSize(size); - } - } - - - /** - * This method generates a unique View ID's. Handles the lack of - * View.generateViewId() in Android versions lower than 17, using a technique - * based on fantouch's code at http://stackoverflow.com/a/21000252 - * @return view ID - */ - @SuppressLint("NewApi") - static public int getUniqueViewId() { - if (Build.VERSION_CODES.JELLY_BEAN_MR1 <= Build.VERSION.SDK_INT) { - return View.generateViewId(); - } else { - for (;;) { - final int result = nextId.get(); - // aapt-generated IDs have the high byte nonzero; clamp to the range under that. - int newValue = result + 1; - if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0. - if (nextId.compareAndSet(result, newValue)) { - return result; - } - } - } - } - - - /** - * This method returns the UTF-8 charset - * @return UTF-8 charset - */ - @SuppressLint("NewApi") - static public Charset getCharsetUTF8() { - if (Build.VERSION_CODES.KITKAT <= Build.VERSION.SDK_INT) { - return StandardCharsets.UTF_8; - } else { - return Charset.forName("UTF-8"); - } - } -} diff --git a/core/src/processing/android/PFragment.java b/core/src/processing/android/PFragment.java deleted file mode 100644 index 8fe80d72c..000000000 --- a/core/src/processing/android/PFragment.java +++ /dev/null @@ -1,261 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.util.DisplayMetrics; -import android.content.Intent; -import android.content.pm.ActivityInfo; -import android.content.res.Configuration; -import android.graphics.Point; -import android.os.Bundle; -import android.view.ContextMenu; -import android.view.Display; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; -import android.view.WindowManager; -import android.view.ContextMenu.ContextMenuInfo; - -import androidx.annotation.IdRes; -import androidx.annotation.LayoutRes; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentActivity; -import androidx.fragment.app.FragmentManager; -import androidx.fragment.app.FragmentTransaction; - -import processing.core.PApplet; - -public class PFragment extends Fragment implements AppComponent { - private DisplayMetrics metrics; - private Point size; - private PApplet sketch; - private @LayoutRes int layout = -1; - - - public PFragment() { - super(); - } - - - public PFragment(PApplet sketch) { - super(); - setSketch(sketch); - } - - - public void initDimensions() { - metrics = new DisplayMetrics(); - size = new Point(); - WindowManager wm = getActivity().getWindowManager(); - Display display = wm.getDefaultDisplay(); - CompatUtils.getDisplayParams(display, metrics, size); - } - - - public int getDisplayWidth() { - return size.x; - } - - - public int getDisplayHeight() { - return size.y; - } - - - public float getDisplayDensity() { - return metrics.density; - } - - - public int getKind() { - return FRAGMENT; - } - - - public void setSketch(PApplet sketch) { - this.sketch = sketch; - if (layout != -1) { - sketch.parentLayout = layout; - } - } - - - public PApplet getSketch() { - return sketch; - } - - - public void setLayout(@LayoutRes int layout, @IdRes int id, FragmentActivity activity) { - this.layout = layout; - if (sketch != null) { - sketch.parentLayout = layout; - } - FragmentManager manager = activity.getSupportFragmentManager(); - FragmentTransaction transaction = manager.beginTransaction(); - transaction.add(id, this); - transaction.commit(); - } - - - public void setView(View view, FragmentActivity activity) { - FragmentManager manager = activity.getSupportFragmentManager(); - FragmentTransaction transaction = manager.beginTransaction(); - transaction.add(view.getId(), this); - transaction.commit(); - } - - - public boolean isService() { - return false; - } - - - public ServiceEngine getEngine() { - return null; - } - - - public void dispose() { - } - - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - if (sketch != null) { - sketch.initSurface(inflater, container, savedInstanceState, this, null); - - // For compatibility with older sketches that run some hardware initialization - // inside onCreate(), don't call from Fragment.onCreate() because the surface - // will not be yet ready, and so the reference to the activity and other - // system variables will be null. In any case, onCreateView() is called - // immediately after onCreate(): - // https://developer.android.com/reference/android/app/Fragment.html#Lifecycle - sketch.onCreate(savedInstanceState); - - return sketch.getSurface().getRootView(); - } else { - return null; - } - } - - - @Override - public void onStart() { - super.onStart(); - if (sketch != null) { - sketch.onStart(); - } - } - - - @Override - public void onResume() { - super.onResume(); - if (sketch != null) { - sketch.onResume(); - } - } - - - @Override - public void onPause() { - super.onPause(); - if (sketch != null) { - sketch.onPause(); - } - } - - - @Override - public void onStop() { - super.onStop(); - if (sketch != null) { - sketch.onStop(); - } - } - - - @Override - public void onDestroy() { - super.onDestroy(); - if (sketch != null) { - sketch.onDestroy(); - } - } - - - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { - if (sketch != null) sketch.onActivityResult(requestCode, resultCode, data); - } - - @Override - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { - if (sketch != null) sketch.onCreateOptionsMenu(menu, inflater); - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if (sketch != null) return sketch.onOptionsItemSelected(item); - return super.onOptionsItemSelected(item); - } - - @Override - public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { - if (sketch != null) sketch.onCreateContextMenu(menu, v, menuInfo); - } - - @Override - public boolean onContextItemSelected(MenuItem item) { - if (sketch != null) return sketch.onContextItemSelected(item); - return super.onContextItemSelected(item); - } - - @Override - public void onConfigurationChanged(Configuration newConfig) { - if (PApplet.DEBUG) System.out.println("configuration changed: " + newConfig); - super.onConfigurationChanged(newConfig); - } - - - public void setOrientation(int which) { - if (which == PORTRAIT) { - getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - } else if (which == LANDSCAPE) { - getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); - } - } - - - public void requestDraw() { - } - - - public boolean canDraw() { - return sketch != null && sketch.isLooping(); - } -} diff --git a/core/src/processing/android/PWallpaper.java b/core/src/processing/android/PWallpaper.java deleted file mode 100644 index 850339100..000000000 --- a/core/src/processing/android/PWallpaper.java +++ /dev/null @@ -1,302 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.service.wallpaper.WallpaperService; -import android.view.MotionEvent; -import android.view.SurfaceHolder; -import android.view.WindowManager; -import android.util.DisplayMetrics; -import android.view.Display; -import android.graphics.Point; -import android.graphics.Rect; - -import processing.core.PApplet; - -public class PWallpaper extends WallpaperService implements AppComponent { - private Point size; - private DisplayMetrics metrics; - private WallpaperEngine engine; - - - public void initDimensions() { - metrics = new DisplayMetrics(); - size = new Point(); - WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE); - Display display = wm.getDefaultDisplay(); - CompatUtils.getDisplayParams(display, metrics, size); - } - - - public int getDisplayWidth() { - return size.x; - } - - - public int getDisplayHeight() { - return size.y; - } - - - public float getDisplayDensity() { - return metrics.density; - } - - - public int getKind() { - return WALLPAPER; - } - - - public PApplet createSketch() { - return new PApplet(); - } - - - public void setSketch(PApplet sketch) { - engine.sketch = sketch; - } - - - public PApplet getSketch() { - return engine.sketch; - } - - - public boolean isService() { - return true; - } - - - public ServiceEngine getEngine() { - return engine; - } - - - public void requestDraw() { - } - - - public boolean canDraw() { - return true; - } - - - public void dispose() { - } - - - public void requestPermissions() { - } - - - @Override - public Engine onCreateEngine() { - engine = new WallpaperEngine(); - return engine; - } - - - @Override - public void onDestroy() { - super.onDestroy(); - - if (engine != null){ - //engine.sketch = null; - engine.onDestroy(); - } - } - - - public class WallpaperEngine extends Engine implements ServiceEngine { - PApplet sketch; - private float xOffset, xOffsetStep; - private float yOffset, yOffsetStep; - private int xPixelOffset, yPixelOffset; - - - @Override - public void onCreate(SurfaceHolder surfaceHolder) { - super.onCreate(surfaceHolder); - sketch = createSketch(); - sketch.initSurface(PWallpaper.this, getSurfaceHolder()); - if (isPreview()) requestPermissions(); - setTouchEventsEnabled(true); - } - - - @Override - public void onSurfaceCreated(SurfaceHolder surfaceHolder) { - super.onSurfaceCreated(surfaceHolder); - } - - - @Override - public void onSurfaceChanged(final SurfaceHolder holder, final int format, - final int width, final int height) { - // When the surface of a live wallpaper changes (eg: after a screen rotation) the same sketch - // continues to run (unlike the case of regular apps, where its re-created) so we need to - // force a reset of the renderer so the backing FBOs (in the case of the OpenGL renderers) - // get reinitalized with the correct size. - sketch.g.reset(); - super.onSurfaceChanged(holder, format, width, height); - } - - - @Override - public void onVisibilityChanged(boolean visible) { - if (sketch != null) { - if (visible) { - sketch.onResume(); - } else { - sketch.onPause(); - } - } - super.onVisibilityChanged(visible); - } - - - /* - * Store the position of the touch event so we can use it for drawing - * later - */ - @Override - public void onTouchEvent(MotionEvent event) { - super.onTouchEvent(event); - if (sketch != null) { - sketch.surfaceTouchEvent(event); - } - } - - - @Override - public void onOffsetsChanged(float xOffset, float yOffset, - float xOffsetStep, float yOffsetStep, - int xPixelOffset, int yPixelOffset) { - - if (sketch != null) { - this.xOffset = xOffset; - this.yOffset = yOffset; - this.xOffsetStep = xOffsetStep; - this.yOffsetStep = yOffsetStep; - this.xPixelOffset = xPixelOffset; - this.yPixelOffset = yPixelOffset; - } - } - - - @Override - public void onSurfaceDestroyed(SurfaceHolder holder) { - // This is called immediately before a surface is being destroyed. - // After returning from this call, you should no longer try to access this - // surface. If you have a rendering thread that directly accesses the - // surface, you must ensure that thread is no longer touching the Surface - // before returning from this function. - super.onSurfaceDestroyed(holder); - } - - - @Override - public void onDestroy() { - super.onDestroy(); - if (sketch != null) { - sketch.onDestroy(); - } - } - - - @Override - public float getXOffset() { - return xOffset; - } - - - @Override - public float getYOffset() { - return yOffset; - } - - - @Override - public float getXOffsetStep() { - return xOffsetStep; - } - - - @Override - public float getYOffsetStep() { - return yOffsetStep; - } - - - @Override - public int getXPixelOffset() { - return xPixelOffset; - } - - - @Override - public int getYPixelOffset() { - return yPixelOffset; - } - - - @Override - public boolean isInAmbientMode() { - return false; - } - - - @Override - public boolean isRound() { - return false; - } - - - @Override - public Rect getInsets() { - return null; - } - - - @Override - public boolean useLowBitAmbient() { - return false; - } - - - @Override - public boolean requireBurnInProtection() { - return false; - } - - @Override - public void onRequestPermissionsResult(int requestCode, - String permissions[], - int[] grantResults) { - if (sketch != null) { - sketch.onRequestPermissionsResult(requestCode, permissions, grantResults); - } - } - } -} diff --git a/core/src/processing/android/PWatchFaceCanvas.java b/core/src/processing/android/PWatchFaceCanvas.java deleted file mode 100644 index ee4222dfc..000000000 --- a/core/src/processing/android/PWatchFaceCanvas.java +++ /dev/null @@ -1,368 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import java.lang.reflect.Method; - -import android.annotation.TargetApi; -import android.graphics.Canvas; -import android.graphics.Point; -import android.os.Bundle; -import android.graphics.Rect; -import android.support.wearable.complications.ComplicationData; -import android.support.wearable.watchface.CanvasWatchFaceService; -import android.support.wearable.watchface.WatchFaceStyle; -import android.util.DisplayMetrics; -import android.view.Display; -import android.view.MotionEvent; -import android.view.SurfaceHolder; -import android.view.WindowInsets; -import android.view.WindowManager; - -import processing.a2d.PGraphicsAndroid2D; -import processing.core.PApplet; - -@TargetApi(21) -public class PWatchFaceCanvas extends CanvasWatchFaceService implements AppComponent { - private Point size; - private DisplayMetrics metrics; - private CanvasEngine engine; - - public void initDimensions() { - metrics = new DisplayMetrics(); - size = new Point(); - WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE); - Display display = wm.getDefaultDisplay(); - CompatUtils.getDisplayParams(display, metrics, size); - } - - - public int getDisplayWidth() { - return size.x; - } - - - public int getDisplayHeight() { - return size.y; - } - - - public float getDisplayDensity() { - return metrics.density; - } - - - public int getKind() { - return WATCHFACE; - } - - - public PApplet createSketch() { - return new PApplet(); - } - - - public void setSketch(PApplet sketch) { - engine.sketch = sketch; - } - - - public PApplet getSketch() { - return engine.sketch; - } - - - public boolean isService() { - return true; - } - - - public ServiceEngine getEngine() { - return engine; - } - - - public void requestDraw() { - if (engine != null) engine.invalidateIfNecessary(); - } - - - public boolean canDraw() { - // The rendering loop should never call handleDraw() directly, - // it only needs to invalidate the screen - return false; - } - - - public void dispose() { - } - - - public void requestPermissions() { - } - - - @Override - public Engine onCreateEngine() { - engine = new CanvasEngine(); - return engine; - } - - - @Override - public void onDestroy() { - super.onDestroy(); - if (engine != null) engine.onDestroy(); - } - - - private class CanvasEngine extends CanvasWatchFaceService.Engine implements ServiceEngine { - private PApplet sketch; - private Method compUpdatedMethod; - private Method tapCommandMethod; - private boolean isRound = false; - private Rect insets = new Rect(); - private boolean lowBitAmbient = false; - private boolean burnInProtection = false; - - @Override - public void onCreate(SurfaceHolder surfaceHolder) { - super.onCreate(surfaceHolder); - setWatchFaceStyle(new WatchFaceStyle.Builder(PWatchFaceCanvas.this) - .setAcceptsTapEvents(true) - .build()); - sketch = createSketch(); - PGraphicsAndroid2D.useBitmap = false; - sketch.initSurface(PWatchFaceCanvas.this, null); - initTapEvents(); - initComplications(); - requestPermissions(); - } - - - private void initTapEvents() { - try { - tapCommandMethod = sketch.getClass().getMethod("onTapCommand", - new Class[] {int.class, int.class, int.class, long.class}); - } catch (Exception e) { - tapCommandMethod = null; - } - } - - - private void initComplications() { - try { - compUpdatedMethod = sketch.getClass().getMethod("onComplicationDataUpdate", - new Class[] {int.class, ComplicationData.class}); - } catch (Exception e) { - compUpdatedMethod = null; - } - } - - - private void invalidateIfNecessary() { - if (isVisible() && !isInAmbientMode()) { - invalidate(); - } - } - - - @Override - public void onAmbientModeChanged(boolean inAmbientMode) { - super.onAmbientModeChanged(inAmbientMode); - invalidateIfNecessary(); - // call new event handlers in sketch (?) - } - - - @Override - public void onPropertiesChanged(Bundle properties) { - super.onPropertiesChanged(properties); - lowBitAmbient = properties.getBoolean(PROPERTY_LOW_BIT_AMBIENT, false); - burnInProtection = properties.getBoolean(PROPERTY_BURN_IN_PROTECTION, false); - } - - - @Override - public void onApplyWindowInsets(WindowInsets insets) { - super.onApplyWindowInsets(insets); - isRound = insets.isRound(); - this.insets.set(insets.getSystemWindowInsetLeft(), - insets.getSystemWindowInsetTop(), - insets.getSystemWindowInsetRight(), - insets.getSystemWindowInsetBottom()); - } - - - @Override - public void onVisibilityChanged(boolean visible) { - super.onVisibilityChanged(visible); - if (sketch != null) { - if (visible) { - sketch.onResume(); - } else { - sketch.onPause(); - } - } - } - - - @Override - public void onSurfaceChanged(SurfaceHolder holder, int format, int width, int height) { - super.onSurfaceChanged(holder, format, width, height); - if (sketch != null) { - sketch.surfaceChanged(); - sketch.setSize(width, height); - } - } - - - @Override - public void onPeekCardPositionUpdate(Rect rect) { } - - - @Override - public void onTimeTick() { - invalidate(); - } - - - @Override - public void onDraw(Canvas canvas, Rect bounds) { - super.onDraw(canvas, bounds); - if (sketch != null) { - PGraphicsAndroid2D g2 = (PGraphicsAndroid2D)sketch.g; - g2.canvas = canvas; - sketch.handleDraw(); - } - } - - - @Override - public void onTouchEvent(MotionEvent event) { - super.onTouchEvent(event); - if (sketch != null) sketch.surfaceTouchEvent(event); - } - - - @Override - public void onTapCommand(@TapType int tapType, int x, int y, long eventTime) { - if (tapCommandMethod != null) { - try { - tapCommandMethod.invoke(tapType, x, y, eventTime); - } catch (Exception e) { } - invalidate(); - } - } - - - @Override - public void onComplicationDataUpdate(int complicationId, - ComplicationData complicationData) { - if (compUpdatedMethod != null) { - try { - compUpdatedMethod.invoke(complicationId, complicationData); - } catch (Exception e) { } - invalidate(); - } - } - - - @Override - public void onDestroy() { - super.onDestroy(); - if (sketch != null) { - sketch.onDestroy(); - } - } - - - @Override - public float getXOffset() { - return 0; - } - - - @Override - public float getYOffset() { - return 0; - } - - - @Override - public float getXOffsetStep() { - return 0; - } - - - @Override - public float getYOffsetStep() { - return 0; - } - - - @Override - public int getXPixelOffset() { - return 0; - } - - - @Override - public int getYPixelOffset() { - return 0; - } - - - @Override - public boolean isRound() { - return isRound; - } - - - @Override - public Rect getInsets() { - return insets; - } - - - @Override - public boolean useLowBitAmbient() { - return lowBitAmbient; - } - - - @Override - public boolean requireBurnInProtection() { - return burnInProtection; - } - - @Override - public void onRequestPermissionsResult(int requestCode, - String permissions[], - int[] grantResults) { - if (sketch != null) { - sketch.onRequestPermissionsResult(requestCode, permissions, grantResults); - } - } - } -} diff --git a/core/src/processing/android/PWatchFaceGLES.java b/core/src/processing/android/PWatchFaceGLES.java deleted file mode 100644 index e62ab7eb4..000000000 --- a/core/src/processing/android/PWatchFaceGLES.java +++ /dev/null @@ -1,393 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2016-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.annotation.TargetApi; -import android.graphics.Point; -import android.opengl.EGL14; -import android.opengl.EGLConfig; -import android.opengl.EGLDisplay; -import android.os.Bundle; -import android.view.Display; -import android.view.WindowInsets; -import android.support.wearable.complications.ComplicationData; -import android.support.wearable.watchface.Gles2WatchFaceService; -import android.support.wearable.watchface.WatchFaceStyle; -import android.util.DisplayMetrics; -import android.view.MotionEvent; -import android.view.SurfaceHolder; -import android.view.WindowManager; -import android.graphics.Rect; - -import java.lang.reflect.Method; - -import processing.core.PApplet; - -@TargetApi(21) -public class PWatchFaceGLES extends Gles2WatchFaceService implements AppComponent { - private static final int[] CONFIG_ATTRIB_LIST = new int[]{ - EGL14.EGL_RENDERABLE_TYPE, 4, - EGL14.EGL_RED_SIZE, 8, - EGL14.EGL_GREEN_SIZE, 8, - EGL14.EGL_BLUE_SIZE, 8, - EGL14.EGL_ALPHA_SIZE, 8, - EGL14.EGL_DEPTH_SIZE, 16, // this was missing - EGL14.EGL_NONE}; - - private Point size; - private DisplayMetrics metrics; - private GLES2Engine engine; - - - public void initDimensions() { - metrics = new DisplayMetrics(); - size = new Point(); - WindowManager wm = (WindowManager) getSystemService(WINDOW_SERVICE); - Display display = wm.getDefaultDisplay(); - CompatUtils.getDisplayParams(display, metrics, size); - } - - - public int getDisplayWidth() { - return size.x; - } - - - public int getDisplayHeight() { - return size.y; - } - - - public float getDisplayDensity() { - return metrics.density; - } - - - public int getKind() { - return WATCHFACE; - } - - - public PApplet createSketch() { - return new PApplet(); - } - - - public void setSketch(PApplet sketch) { - engine.sketch = sketch; - } - - - public PApplet getSketch() { - return engine.sketch; - } - - - public boolean isService() { - return true; - } - - - public ServiceEngine getEngine() { - return engine; - } - - - public void requestDraw() { - if (engine != null) engine.invalidateIfNecessary(); - } - - - public boolean canDraw() { - // The rendering loop should never call handleDraw() directly, it only needs to invalidate the - // screen - return false; - } - - - public void dispose() { - } - - - public void requestPermissions() { - } - - - @Override - public Engine onCreateEngine() { - engine = new GLES2Engine(); - return engine; - } - - - @Override - public void onDestroy() { - super.onDestroy(); - if (engine != null) engine.onDestroy(); - } - - - private class GLES2Engine extends Gles2WatchFaceService.Engine implements ServiceEngine { - private PApplet sketch; - private Method compUpdatedMethod; - private Method tapCommandMethod; - private boolean isRound = false; - private Rect insets = new Rect(); - private boolean lowBitAmbient = false; - private boolean burnInProtection = false; - - @Override - public void onCreate(SurfaceHolder surfaceHolder) { - super.onCreate(surfaceHolder); - setWatchFaceStyle(new WatchFaceStyle.Builder(PWatchFaceGLES.this) - .setAcceptsTapEvents(true) - .build()); - sketch = createSketch(); - sketch.initSurface(PWatchFaceGLES.this, null); - initTapEvents(); - initComplications(); - requestPermissions(); - } - - - 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)) { - throw new RuntimeException("eglChooseConfig failed"); - } else if (numEglConfigs[0] == 0) { - throw new RuntimeException("no matching EGL configs"); - } else { - return eglConfigs[0]; - } - } - - @Override - public void onGlContextCreated() { - super.onGlContextCreated(); - } - - - @Override - public void onGlSurfaceCreated(int width, int height) { - super.onGlSurfaceCreated(width, height); - if (sketch != null) { - sketch.surfaceChanged(); - sketch.setSize(width, height); - } - } - - - private void initTapEvents() { - try { - tapCommandMethod = sketch.getClass().getMethod("onTapCommand", - new Class[] {int.class, int.class, int.class, long.class}); - } catch (Exception e) { - tapCommandMethod = null; - } - } - - - private void initComplications() { - try { - compUpdatedMethod = sketch.getClass().getMethod("onComplicationDataUpdate", - new Class[] {int.class, ComplicationData.class}); - } catch (Exception e) { - compUpdatedMethod = null; - } - } - - - private void invalidateIfNecessary() { - if (isVisible() && !isInAmbientMode()) { - invalidate(); - } - } - - - @Override - public void onAmbientModeChanged(boolean inAmbientMode) { - super.onAmbientModeChanged(inAmbientMode); - invalidateIfNecessary(); - // call new event handlers in sketch (?) - } - - - @Override - public void onPropertiesChanged(Bundle properties) { - super.onPropertiesChanged(properties); - lowBitAmbient = properties.getBoolean(PROPERTY_LOW_BIT_AMBIENT, false); - burnInProtection = properties.getBoolean(PROPERTY_BURN_IN_PROTECTION, false); - } - - - @Override - public void onApplyWindowInsets(WindowInsets insets) { - super.onApplyWindowInsets(insets); - this.insets.set(insets.getSystemWindowInsetLeft(), - insets.getSystemWindowInsetTop(), - insets.getSystemWindowInsetRight(), - insets.getSystemWindowInsetBottom()); - } - - - @Override - public void onVisibilityChanged(boolean visible) { - super.onVisibilityChanged(visible); - if (sketch != null) { - if (visible) { - sketch.onResume(); - } else { - sketch.onPause(); - } - } - } - - - @Override - public void onPeekCardPositionUpdate(Rect rect) { } - - - @Override - public void onTimeTick() { - invalidate(); - } - - - @Override - public void onDraw() { - super.onDraw(); - if (sketch != null) sketch.handleDraw(); - } - - - @Override - public void onTouchEvent(MotionEvent event) { - super.onTouchEvent(event); - if (sketch != null) sketch.surfaceTouchEvent(event); - } - - - @Override - public void onTapCommand(@TapType int tapType, int x, int y, long eventTime) { - if (tapCommandMethod != null) { - try { - tapCommandMethod.invoke(tapType, x, y, eventTime); - } catch (Exception e) { } - invalidate(); - } - } - - - @Override - public void onComplicationDataUpdate(int complicationId, - ComplicationData complicationData) { - if (compUpdatedMethod != null) { - try { - compUpdatedMethod.invoke(complicationId, complicationData); - } catch (Exception e) { - } - invalidate(); - } - } - - - @Override - public void onDestroy() { - super.onDestroy(); - if (sketch != null) { - sketch.onDestroy(); - } - } - - - @Override - public float getXOffset() { - return 0; - } - - - @Override - public float getYOffset() { - return 0; - } - - - @Override - public float getXOffsetStep() { - return 0; - } - - - @Override - public float getYOffsetStep() { - return 0; - } - - - @Override - public int getXPixelOffset() { - return 0; - } - - - @Override - public int getYPixelOffset() { - return 0; - } - - - @Override - public boolean isRound() { - return isRound; - } - - - @Override - public Rect getInsets() { - return insets; - } - - - @Override - public boolean useLowBitAmbient() { - return lowBitAmbient; - } - - - @Override - public boolean requireBurnInProtection() { - return burnInProtection; - } - - - @Override - public void onRequestPermissionsResult(int requestCode, - String permissions[], - int[] grantResults) { - if (sketch != null) { - sketch.onRequestPermissionsResult(requestCode, permissions, grantResults); - } - } - } -} diff --git a/core/src/processing/android/PermissionRequestor.java b/core/src/processing/android/PermissionRequestor.java deleted file mode 100644 index 0754badc3..000000000 --- a/core/src/processing/android/PermissionRequestor.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2017-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.app.Activity; -import android.os.Bundle; - -import android.support.v4.os.ResultReceiver; -import androidx.core.app.ActivityCompat; - -// A simple utility activity to request permissions in a service. -public class PermissionRequestor extends Activity { - public static final String KEY_RESULT_RECEIVER = "resultReceiver"; - public static final String KEY_PERMISSIONS = "permissions"; - public static final String KEY_GRANT_RESULTS = "grantResults"; - public static final String KEY_REQUEST_CODE = "requestCode"; - - ResultReceiver resultReceiver; - String[] permissions; - int requestCode; - - @Override - protected void onStart() { - super.onStart(); - resultReceiver = this.getIntent().getParcelableExtra(KEY_RESULT_RECEIVER); - permissions = this.getIntent().getStringArrayExtra(KEY_PERMISSIONS); - requestCode = this.getIntent().getIntExtra(KEY_REQUEST_CODE, 0); - ActivityCompat.requestPermissions(this, permissions, requestCode); - } - - @Override - public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) { - Bundle resultData = new Bundle(); - resultData.putStringArray(KEY_PERMISSIONS, permissions); - resultData.putIntArray(KEY_GRANT_RESULTS, grantResults); - resultReceiver.send(requestCode, resultData); - finish(); - } -} \ No newline at end of file diff --git a/core/src/processing/android/ServiceEngine.java b/core/src/processing/android/ServiceEngine.java deleted file mode 100644 index 11b1164f0..000000000 --- a/core/src/processing/android/ServiceEngine.java +++ /dev/null @@ -1,50 +0,0 @@ -/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Processing project - http://processing.org - - Copyright (c) 2017-21 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 - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.android; - -import android.graphics.Rect; - -import processing.core.PConstants; - -public interface ServiceEngine extends PConstants { - // wallpapers - public boolean isPreview(); - public float getXOffset(); - public float getYOffset(); - public float getXOffsetStep(); - public float getYOffsetStep(); - public int getXPixelOffset(); - public int getYPixelOffset(); - - // wear - public boolean isInAmbientMode(); - public boolean isRound(); - public Rect getInsets(); - public boolean useLowBitAmbient(); - public boolean requireBurnInProtection(); - - // Service permissions - public void onRequestPermissionsResult(int requestCode, - String permissions[], - int[] grantResults); -} diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java deleted file mode 100644 index 2b55cf67c..000000000 --- a/core/src/processing/core/PApplet.java +++ /dev/null @@ -1,12682 +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) 2004-12 Ben Fry and Casey Reas - Copyright (c) 2001-04 Massachusetts Institute of Technology - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License version 2.1 as published by the Free Software Foundation. - - This library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA -*/ - -package processing.core; - -import android.app.Activity; -import android.app.FragmentManager; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.content.res.AssetManager; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Rect; -import android.graphics.Typeface; -import android.net.Uri; -import android.os.Build; -import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import android.view.ContextMenu; -import android.view.ContextMenu.ContextMenuInfo; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuInflater; -import android.view.MenuItem; -import android.view.MotionEvent; -import android.view.SurfaceHolder; -import android.view.View; -import android.view.ViewGroup; -import android.view.Window; -import android.view.inputmethod.InputMethodManager; - -import androidx.annotation.LayoutRes; - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PrintWriter; -import java.io.StringReader; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.*; -import java.net.HttpURLConnection; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLDecoder; -import java.net.URLEncoder; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Random; -import java.util.StringTokenizer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.zip.GZIPInputStream; -import java.util.zip.GZIPOutputStream; - -import processing.a2d.PGraphicsAndroid2D; -import processing.android.ActivityAPI; -import processing.android.AppComponent; -import processing.android.CompatUtils; -import processing.data.JSONArray; -import processing.data.JSONObject; -import processing.data.StringList; -import processing.data.Table; -import processing.data.XML; -import processing.event.Event; -import processing.event.KeyEvent; -import processing.event.MouseEvent; -import processing.event.TouchEvent; -import processing.opengl.PGL; -import processing.opengl.PGraphics2D; -import processing.opengl.PGraphics3D; -import processing.opengl.PShader; - -public class PApplet extends Object implements ActivityAPI, PConstants { - - static final public boolean DEBUG = false; -// static final public boolean DEBUG = true; - - // Convenience public constant holding the SDK version, akin to platform in Java mode - static final public int SDK = Build.VERSION.SDK_INT; - - //static final public int SDK = Build.VERSION_CODES.ICE_CREAM_SANDWICH; // Forcing older SDK for testing - - /** - * The surface this sketch draws to. - */ - protected PSurface surface; - - /** - * The view group containing the surface view of the PApplet. - */ - public @LayoutRes int parentLayout = -1; - - /** The PGraphics renderer associated with this PApplet */ - public PGraphics g; - - /** - * The screen size when the sketch was started. This is initialized inside - * onCreate(). - *

- * Note that this won't update if you change the resolution - * of your screen once the the applet is running. - *

- * This variable is not static because in the desktop version of Processing, - * not all instances of PApplet will necessarily be started on a screen of - * the same size. - */ - public int displayWidth, displayHeight; - - /** - * Command line options passed in from main(). - *

- * This does not include the arguments passed in to PApplet itself. - */ -// public String[] args; - - /** - * Path to where sketch can read/write files (read-only). - * Android: This is the writable area for the Activity, which is correct - * for purposes of how sketchPath is used in practice from a sketch, - * even though it's technically different than the desktop version. - */ - public String sketchPath; //folder; - - /** When debugging headaches */ -// static final boolean THREAD_DEBUG = false; - - /** Default width and height for applet when not specified */ - static public final int DEFAULT_WIDTH = -1; - static public final int DEFAULT_HEIGHT = -1; - - /** - * Set true when the surface dimensions have changed, so that the PGraphics - * object can be resized on the next trip through handleDraw(). - */ - protected boolean surfaceChanged; - - /** - * Pixel buffer from this applet's PGraphics. - *

- * When used with OpenGL or Java2D, this value will - * be null until loadPixels() has been called. - */ - public int[] pixels; - - /** width of this applet's associated PGraphics */ - public int width = DEFAULT_WIDTH; - - /** height of this applet's associated PGraphics */ - public int height = DEFAULT_HEIGHT; - - /** The logical density of the display from getDisplayMetrics().density - * According to Android's documentation: - * This is a scaling factor for the Density Independent Pixel unit, - * where one DIP is one pixel on an approximately 160 dpi screen - * (for example a 240x320, 1.5"x2" screen), providing the baseline of the - * system's display. Thus on a 160dpi screen this density value will be 1; - * on a 120 dpi screen it would be .75; etc. - */ - public float displayDensity = 1; - - // For future use - public int pixelDensity = 1; - public int pixelWidth; - public int pixelHeight; - - /////////////////////////////////////////////////////////////// - // Mouse events - - /** absolute x position of input on screen */ - public int mouseX; - - /** absolute x position of input on screen */ - public int mouseY; - - - /** - * Previous x/y position of the mouse. This will be a different value - * when inside a mouse handler (like the mouseMoved() method) versus - * when inside draw(). Inside draw(), pmouseX is updated once each - * frame, but inside mousePressed() and friends, it's updated each time - * an event comes through. Be sure to use only one or the other type of - * means for tracking pmouseX and pmouseY within your sketch, otherwise - * you're gonna run into trouble. - */ - public int pmouseX, pmouseY; - - public int mouseButton; - - public boolean mousePressed; - - - public boolean touchIsStarted; - - - public TouchEvent.Pointer[] touches = new TouchEvent.Pointer[0]; - - - /** - * previous mouseX/Y for the draw loop, separated out because this is - * separate from the pmouseX/Y when inside the mouse event handlers. - */ - protected int dmouseX, dmouseY; - - - /** - * pmotionX/Y for the event handlers (motionPressed(), motionDragged() etc) - * these are different because motion events are queued to the end of - * draw, so the previous position has to be updated on each event, - * as opposed to the pmotionX/Y that's used inside draw, which is expected - * to be updated once per trip through draw(). - */ - protected int emouseX, emouseY; - - - /** - * ID of the pointer tracked for mouse events. - */ - protected int mousePointerId; - - - /** - * ID of the most recently touch pointer gone up or down. - */ - protected int touchPointerId; - - /////////////////////////////////////////////////////////////// - // Key events - - /** - * Last key pressed. - *

- * If it's a coded key, i.e. UP/DOWN/CTRL/SHIFT/ALT, - * this will be set to CODED (0xffff or 65535). - */ - public char key; - - /** - * When "key" is set to CODED, this will contain a Java key code. - *

- * For the arrow keys, keyCode will be one of UP, DOWN, LEFT and RIGHT. - * Also available are ALT, CONTROL and SHIFT. A full set of constants - * can be obtained from java.awt.event.KeyEvent, from the VK_XXXX variables. - */ - public int keyCode; - - /** - * true if the mouse is currently pressed. - */ - public boolean keyPressed; - - /** - * the last KeyEvent object passed into a mouse function. - */ -// public KeyEvent keyEvent; - - /** - * Gets set to true/false as the applet gains/loses focus. - */ - public boolean focused = false; - - /** - * Keeps track of ENABLE_KEY_REPEAT hint - */ - protected boolean keyRepeatEnabled = false; - - /** - * Set to open when openKeyboard() is called, and used to close the keyboard when the sketch is - * paused, otherwise it remains visible. - */ - boolean keyboardIsOpen = false; - - /** - * Flag to determine if the back key was pressed. - */ - private boolean requestedBackPress = false; - - /** - * Flag to determine if the user handled the back press. - */ - public boolean handledBackPressed = true; - - /////////////////////////////////////////////////////////////// - // Permission handling - - /** - * Callback methods to handle permission requests - */ - protected HashMap permissionMethods = new HashMap(); - - - /** - * Permissions requested during one frame - */ - protected ArrayList reqPermissions = new ArrayList(); - - - /////////////////////////////////////////////////////////////// - // Rendering/timing - - /** - * Time in milliseconds when the applet was started. - *

- * Used by the millis() function. - */ - long millisOffset = System.currentTimeMillis(); - - protected boolean insideDraw; - - /** Last time in nanoseconds that frameRate was checked */ - protected long frameRateLastNanos = 0; - - /** - * The current value of frames per second. - *

- * The initial value will be 10 fps, and will be updated with each - * frame thereafter. The value is not instantaneous (since that - * wouldn't be very useful since it would jump around so much), - * but is instead averaged (integrated) over several frames. - * As such, this value won't be valid until after 5-10 frames. - */ - public float frameRate = 10; - - protected boolean looping; - - /** flag set to true when a redraw is asked for by the user */ - protected boolean redraw; - - /** - * How many frames have been displayed since the applet started. - *

- * This value is read-only do not attempt to set it, - * otherwise bad things will happen. - *

- * Inside setup(), frameCount is 0. - * For the first iteration of draw(), frameCount will equal 1. - */ - public int frameCount; - - /** - * true if this applet has had it. - */ - public boolean finished; - - /** - * true if exit() has been called so that things shut down - * once the main thread kicks off. - */ - protected boolean exitCalled; - - boolean insideSettings; - - String renderer = JAVA2D; - - int smooth = 1; // default smoothing (whatever that means for the renderer) - - boolean fullScreen = false; - - int display = -1; // use default - - // Background default needs to be different from the default value in - // PGraphics.backgroundColor, otherwise size(100, 100) bg spills over. - // https://github.com/processing/processing/issues/2297 - int windowColor = 0xffDDDDDD; - - /////////////////////////////////////////////////////////////// - // Error messages - - static final String ERROR_MIN_MAX = - "Cannot use min() or max() on an empty array."; - - /////////////////////////////////////////////////////////////// - // Command line options - - /** - * Position of the upper-lefthand corner of the editor window - * that launched this applet. - */ - static public final String ARGS_EDITOR_LOCATION = "--editor-location"; - - /** - * Location for where to position the applet window on screen. - *

- * This is used by the editor to when saving the previous applet - * location, or could be used by other classes to launch at a - * specific position on-screen. - */ - static public final String ARGS_EXTERNAL = "--external"; - - static public final String ARGS_LOCATION = "--location"; - - static public final String ARGS_DISPLAY = "--display"; - - static public final String ARGS_BGCOLOR = "--bgcolor"; - - static public final String ARGS_PRESENT = "--present"; - - static public final String ARGS_EXCLUSIVE = "--exclusive"; - - static public final String ARGS_STOP_COLOR = "--stop-color"; - - static public final String ARGS_HIDE_STOP = "--hide-stop"; - - /** - * Allows the user or PdeEditor to set a specific sketch folder path. - *

- * Used by PdeEditor to pass in the location where saveFrame() - * and all that stuff should write things. - */ - static public final String ARGS_SKETCH_FOLDER = "--sketch-path"; - - /** - * When run externally to a PdeEditor, - * this is sent by the applet when it quits. - */ - //static public final String EXTERNAL_QUIT = "__QUIT__"; - static public final String EXTERNAL_STOP = "__STOP__"; - - /** - * When run externally to a PDE Editor, this is sent by the applet - * whenever the window is moved. - *

- * This is used so that the editor can re-open the sketch window - * in the same position as the user last left it. - */ - static public final String EXTERNAL_MOVE = "__MOVE__"; - - /** true if this sketch is being run by the PDE */ - boolean external = false; - - - ////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////// - - /** - * Required empty constructor. - */ - public PApplet() { - - } - - - public PSurface getSurface() { - return surface; - } - - - public Context getContext() { - return surface.getContext(); - } - - - public Activity getActivity() { - return surface.getActivity(); - } - - - public void initSurface(AppComponent component, SurfaceHolder holder) { - parentLayout = -1; - initSurface(null, null, null, component, holder); - } - - - public void initSurface(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState, - AppComponent component, SurfaceHolder holder) { - if (DEBUG) println("initSurface() happening here: " + Thread.currentThread().getName()); - - component.initDimensions(); - displayWidth = component.getDisplayWidth(); - displayHeight = component.getDisplayHeight(); - displayDensity = component.getDisplayDensity(); - - handleSettings(); - - boolean parentSize = false; - if (parentLayout == -1) { - if (fullScreen || width == -1 || height == -1) { - // Either sketch explicitly set to full-screen mode, or not - // size/fullScreen provided, so sketch uses the entire display - width = displayWidth; - height = displayHeight; - } - } else { - if (fullScreen || width == -1 || height == -1) { - // Dummy weight and height to initialize the PGraphics, will be resized - // when the view associated to the parent layout is created - width = 100; - height = 100; - parentSize = true; - } - } - - pixelWidth = width * pixelDensity; - pixelHeight = height * pixelDensity; - - String rendererName = sketchRenderer(); - if (DEBUG) println("Renderer " + rendererName); - g = makeGraphics(width, height, rendererName, true); - if (DEBUG) println("Created renderer"); - surface = g.createSurface(component, holder, false); - if (DEBUG) println("Created surface"); - - if (parentLayout == -1) { - setFullScreenVisibility(); - surface.initView(width, height); - } else { - surface.initView(width, height, parentSize, - inflater, container, savedInstanceState); - } - - finished = false; // just for clarity - // this will be cleared by draw() if it is not overridden - looping = true; - redraw = true; // draw this guy once - - sketchPath = surface.getFilesDir().getAbsolutePath(); - - surface.startThread(); - - if (DEBUG) println("Done with init surface"); - } - - - private void setFullScreenVisibility() { - if (fullScreen) { - runOnUiThread(new Runnable() { - @Override - public void run() { - int visibility; - if (SDK < 19) { - // Pre-4.4 - visibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; - } else { - // 4.4 and higher. Integer instead of constants defined in View so it can - // build with SDK < 4.4 - visibility = 256 | // View.SYSTEM_UI_FLAG_LAYOUT_STABLE - 512 | // View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - 1024 | // View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | - 4 | // View.SYSTEM_UI_FLAG_FULLSCREEN - 4096; // View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY - // However, this visibility does not fix a bug where the navigation area - // turns black after resuming the app: - // https://code.google.com/p/android/issues/detail?id=170752 - } - surface.setSystemUiVisibility(visibility); - } - }); - } - } - - - public void onResume() { - if (DEBUG) System.out.println("PApplet.onResume() called"); - if (parentLayout == -1) { - setFullScreenVisibility(); - } - - handleMethods("resume"); - - // Don't call resume() when the app is starting and setup() has not been called yet: - // https://github.com/processing/processing-android/issues/274 - // Also, there is no need to call resume() from anywhere else (for example, from - // onStart) since onResume() is always called in the activity lifecyle: - // https://developer.android.com/guide/components/activities/activity-lifecycle.html - if (0 < frameCount) { - resume(); - } - - // Set the handledBackPressed to true to handle the situation where a fragment is popping - // right back after pressing the back button (the sketch does not exit). - handledBackPressed = true; - - if (g != null) { - g.restoreState(); - } - - surface.resumeThread(); - } - - - public void onPause() { - surface.pauseThread(); - - // Make sure that the keyboard is not left open after leaving the app - closeKeyboard(); - - if (g != null) { - g.saveState(); - } - - handleMethods("pause"); - - pause(); // handler for others to write - } - - - public void onStart() { - start(); - } - - - public void onStop() { - stop(); - } - - - public void onCreate(Bundle savedInstanceState) { - create(); - } - - - public void onDestroy() { - handleMethods("onDestroy"); - - surface.stopThread(); - - dispose(); - } - - - public void onActivityResult(int requestCode, int resultCode, Intent data) { - handleMethods("onActivityResult", new Object[] { requestCode, resultCode, data }); - } - - - public void onNewIntent(Intent intent) { - handleMethods("onNewIntent", new Object[] { intent }); - } - - - public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){ - - } - - - public boolean onOptionsItemSelected(MenuItem item) { - return false; - } - - - public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { - - } - - - public boolean onContextItemSelected(MenuItem item) { - return false; - } - - - public void setHasOptionsMenu(boolean hasMenu) { - surface.setHasOptionsMenu(hasMenu); - } - - - synchronized public void onBackPressed() { - requestedBackPress = true; - } - - - public FragmentManager getFragmentManager() { - if (getActivity() != null) { - return getActivity().getFragmentManager(); - } - return null; - } - - - public Window getWindow(){ - if (getActivity() != null) { - return getActivity().getWindow(); - } - return null; - } - - - public void startActivity(Intent intent) { - surface.startActivity(intent); - } - - - public void runOnUiThread(Runnable action) { - surface.runOnUiThread(action); - } - - - public boolean hasPermission(String permission) { - return surface.hasPermission(permission); - } - - - public void requestPermission(String permission) { - if (!hasPermission(permission)) { - reqPermissions.add(permission); - } - } - - - public void requestPermission(String permission, String callback) { - requestPermission(permission, callback, this); - } - - - public void requestPermission(String permission, String callback, Object target) { - registerWithArgs(callback, target, new Class[] { boolean.class }); - if (hasPermission(permission)) { - // If the app already has permission, still call the handle method as it - // may be doing some initialization - handleMethods(callback, new Object[] { true }); - } else { - permissionMethods.put(permission, callback); - // Accumulating permissions so they requested all at once at the end - // of draw. - reqPermissions.add(permission); - } - } - - - public void onRequestPermissionsResult(int requestCode, - String permissions[], - int[] grantResults) { - if (requestCode == PSurface.REQUEST_PERMISSIONS) { - for (int i = 0; i < grantResults.length; i++) { - boolean granted = grantResults[i] == PackageManager.PERMISSION_GRANTED; - handlePermissionsResult(permissions[i], granted); - } - } - } - - - private void handlePermissionsResult(String permission, final boolean granted) { - String methodName = permissionMethods.get(permission); - final RegisteredMethods meth = registerMap.get(methodName); - if (meth != null) { - Handler handler = new Handler(Looper.getMainLooper()); - handler.post(new Runnable() { - @Override - public void run() { - meth.handle(new Object[] { granted }); - } - }); - } - } - - - private void handlePermissions() { - if (0 < reqPermissions.size()) { - String[] req = reqPermissions.toArray(new String[reqPermissions.size()]); - surface.requestPermissions(req); - reqPermissions.clear(); - } - } - - synchronized private void handleBackPressed() { - if (requestedBackPress) { - requestedBackPress = false; - backPressed(); - if (!handledBackPressed) { - if (getActivity() != null) { - // Services don't have an activity associated to them, but back press could not be triggered for those anyways - getActivity().finish(); - } - handledBackPressed = false; - } - } - } - - /** - * @param method "size" or "fullScreen" - * @param args parameters passed to the function so we can show the user - * @return true if safely inside the settings() method - */ - boolean insideSettings(String method, Object... args) { - if (insideSettings) { - return true; - } - final String url = "https://processing.org/reference/" + method + "_.html"; - if (!external) { // post a warning for users of Eclipse and other IDEs - StringList argList = new StringList(args); - System.err.println("When not using the PDE, " + method + "() can only be used inside settings()."); - System.err.println("Remove the " + method + "() method from setup(), and add the following:"); - System.err.println("public void settings() {"); - System.err.println(" " + method + "(" + argList.join(", ") + ");"); - System.err.println("}"); - } - throw new IllegalStateException(method + "() cannot be used here, see " + url); - } - - - void handleSettings() { - insideSettings = true; - //Do stuff - settings(); - insideSettings = false; - } - - - public void settings() { - //It'll be empty. Will be overridden by user's sketch class. - } - - - final public int sketchWidth() { - return width; - } - - - final public int sketchHeight() { - return height; - } - - - final public String sketchRenderer() { - return renderer; - } - - - public int sketchSmooth() { - return smooth; - } - - - final public boolean sketchFullScreen() { - return fullScreen; - } - - - final public int sketchDisplay() { - return display; - } - - - final public String sketchOutputPath() { - return null; - } - - - final public OutputStream sketchOutputStream() { - return null; - } - - - final public int sketchWindowColor() { - return windowColor; - } - - - final public int sketchPixelDensity() { - return pixelDensity; - } - - - // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - - public void surfaceChanged() { - surfaceChanged = true; - g.surfaceChanged(); - } - - - // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - - /** - * Called by the sketch surface view, thought it could conceivably be called - * by Android as well. - */ - public void surfaceWindowFocusChanged(boolean hasFocus) { - focused = hasFocus; - if (focused) { - focusGained(); - } else { - focusLost(); - } - } - - - /** - * If you override this function without calling super.surfaceTouchEvent(), - * then motionX, motionY, motionPressed, and motionEvent will not be set. - */ - public boolean surfaceTouchEvent(MotionEvent event) { - nativeMotionEvent(event); - return true; - } - - - public void surfaceKeyDown(int code, android.view.KeyEvent event) { - nativeKeyEvent(event); - } - - - public void surfaceKeyUp(int code, android.view.KeyEvent event) { - nativeKeyEvent(event); - } - - - // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . - - - /** - * Called by the browser or applet viewer to inform this applet that it - * should start its execution. It is called after the init method and - * each time the applet is revisited in a Web page. - *

- * Called explicitly via the first call to PApplet.paint(), because - * PAppletGL needs to have a usable screen before getting things rolling. - */ - public void start() { - } - - - /** - * Called by the browser or applet viewer to inform - * this applet that it should stop its execution. - *

- * Unfortunately, there are no guarantees from the Java spec - * when or if stop() will be called (i.e. on browser quit, - * or when moving between web pages), and it's not always called. - */ - public void stop() { - } - - - /** - * Developers can override here to save state. The 'paused' variable will be - * set before this function is called. - */ - public void pause() { - } - - - /** - * Developers can override here to restore state. The 'paused' variable - * will be cleared before this function is called. - */ - public void resume() { - } - - - public void backPressed() { - handledBackPressed = false; - } - - ////////////////////////////////////////////////////////////// - - - /** Map of registered methods, stored by name. */ - HashMap registerMap = - new HashMap(); - - - class RegisteredMethods { - int count; - Object[] objects; - // Because the Method comes from the class being called, - // it will be unique for most, if not all, objects. - Method[] methods; - Object[] emptyArgs = new Object[] { }; - - - void handle() { - handle(emptyArgs); - } - - - void handle(Object[] args) { - for (int i = 0; i < count; i++) { - try { - methods[i].invoke(objects[i], args); - } catch (Exception e) { - // check for wrapped exception, get root exception - Throwable t; - if (e instanceof InvocationTargetException) { - InvocationTargetException ite = (InvocationTargetException) e; - t = ite.getCause(); - } else { - t = e; - } - // check for RuntimeException, and allow to bubble up - if (t instanceof RuntimeException) { - // re-throw exception - throw (RuntimeException) t; - } else { - // trap and print as usual - t.printStackTrace(); - } - } - } - } - - - void add(Object object, Method method) { - if (findIndex(object) == -1) { - if (objects == null) { - objects = new Object[5]; - methods = new Method[5]; - - } else if (count == objects.length) { - objects = (Object[]) PApplet.expand(objects); - methods = (Method[]) PApplet.expand(methods); - } - objects[count] = object; - methods[count] = method; - count++; - } else { - die(method.getName() + "() already added for this instance of " + - object.getClass().getName()); - } - } - - - /** - * Removes first object/method pair matched (and only the first, - * must be called multiple times if object is registered multiple times). - * Does not shrink array afterwards, silently returns if method not found. - */ -// public void remove(Object object, Method method) { -// int index = findIndex(object, method); - public void remove(Object object) { - int index = findIndex(object); - if (index != -1) { - // shift remaining methods by one to preserve ordering - count--; - for (int i = index; i < count; i++) { - objects[i] = objects[i+1]; - methods[i] = methods[i+1]; - } - // clean things out for the gc's sake - objects[count] = null; - methods[count] = null; - } - } - - -// protected int findIndex(Object object, Method method) { - protected int findIndex(Object object) { - for (int i = 0; i < count; i++) { - if (objects[i] == object) { -// if (objects[i] == object && methods[i].equals(method)) { - //objects[i].equals() might be overridden, so use == for safety - // since here we do care about actual object identity - //methods[i]==method is never true even for same method, so must use - // equals(), this should be safe because of object identity - return i; - } - } - return -1; - } - } - - - /** - * Register a built-in event so that it can be fired for libraries, etc. - * Supported events include: - *