Skip to content

Commit 1972331

Browse files
committed
moving things back off the branch, and into full disaster mode
1 parent a44d538 commit 1972331

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+6010
-3623
lines changed

android/done.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
0192 android (pre)
2+
X compile android-core with java 5 as the target so that it works on OS X 10.5
3+
X A3D should use lower color depth on older devices
4+
X http://code.google.com/p/processing/issues/detail?id=391
5+
X new api for begin/endRecord()
6+
A Finish opengl blending modes in A3D
7+
A http://code.google.com/p/processing/issues/detail?id=290
8+
A Automatic normal calculation in A3D
9+
A http://code.google.com/p/processing/issues/detail?id=345
10+
A Improve texture handling in A3D's PFont
11+
A http://code.google.com/p/processing/issues/detail?id=394
12+
A OpenGL resource release mechanism in A3D is broken
13+
A http://code.google.com/p/processing/issues/detail?id=456
14+
A Multitexturing in A3D
15+
A http://code.google.com/p/processing/issues/detail?id=344
16+
A Problems when loading images asynchronously in A3D.
17+
A http://code.google.com/p/processing/issues/detail?id=465
18+
X make several changes to get android running properly with sdk tools r8
19+
20+
121
0191 android (pre)
222
X won't interpret size() in Android Mode without spaces between arguments
323
X http://code.google.com/p/processing/issues/detail?id=390

android/todo.txt

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
0192 android
2-
X compile android-core with java 5 as the target so that it works on OS X 10.5
3-
X A3D should use lower color depth on older devices
4-
X http://code.google.com/p/processing/issues/detail?id=391
5-
X new api for begin/endRecord()
6-
A Finish opengl blending modes in A3D
7-
A http://code.google.com/p/processing/issues/detail?id=290
8-
A Automatic normal calculation in A3D
9-
A http://code.google.com/p/processing/issues/detail?id=345
10-
A Improve texture handling in A3D's PFont
11-
A http://code.google.com/p/processing/issues/detail?id=394
12-
A OpenGL resource release mechanism in A3D is broken
13-
A http://code.google.com/p/processing/issues/detail?id=456
14-
A Multitexturing in A3D
15-
A http://code.google.com/p/processing/issues/detail?id=344
16-
X make several changes to get android running properly with sdk tools r8
1+
0193 android
2+
3+
4+
_ error in 'create avd' with "Emulator already exists" when it needs an upgrade
5+
_ or cannot be used with the current setup
6+
_ use 'android list avds' on the command line to see the problem in this case
7+
_ when there's a 'create avd' error, things still keep running. yay!
8+
9+
_ need to do this for utf8: "overridable Ant javac properties: java.encoding"
10+
_ new for sdk tools r8, it's using ascii as the default, we're utf-8
1711

1812
_ error in 'create avd' with "Emulator already exists" when it needs an upgrade
1913
_ or cannot be used with the current setup
@@ -31,6 +25,11 @@ _ to create the new sdk object
3125
_ need to do this for utf8: "overridable Ant javac properties: java.encoding"
3226
_ new for sdk tools r8, it's using ascii as the default, we're utf-8
3327

28+
_ just use generic android apis as requirement, not the google apis
29+
_ though it does give us the emulator skin.. maybe another option
30+
31+
_ need to do something to make it easier to do new screen sizes.
32+
3433
_ when returning to android application, sometimes screen stays black
3534
_ http://code.google.com/p/processing/issues/detail?id=237
3635

@@ -47,6 +46,9 @@ _ javac.exe not included with the download
4746

4847
_ verify that processing-core.jar has downloaded properly
4948
_ http://code.google.com/p/processing/issues/detail?id=421
49+
_ this is the download page:
50+
_ http://code.google.com/p/processing/downloads/detail?name=processing-android-core-0191.zip
51+
_ so look for "SHA1 Checksum: 1ed63f9316441fe46949ef5a92a28f58cc7ee226"
5052

5153
_ gui stuff: http://hg.postspectacular.com/cp5magic/wiki/Home
5254

android/tool/src/processing/app/tools/android/AndroidDevice.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
import java.util.Set;
99
import java.util.regex.Matcher;
1010
import java.util.regex.Pattern;
11-
import processing.app.debug.RunnerListener;
11+
12+
import processing.app.RunnerListener;
1213
import processing.app.exec.LineProcessor;
1314
import processing.app.exec.ProcessRegistry;
1415
import processing.app.exec.ProcessResult;

android/tool/src/processing/app/tools/android/AndroidMode.java

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,17 @@
3939
import javax.swing.JMenuItem;
4040

4141
import processing.app.*;
42-
import processing.app.debug.*;
4342

4443
import processing.core.PApplet;
44+
import processing.mode.java.JavaMode;
45+
import processing.mode.java.runner.Runner;
4546

4647
// http://dl.google.com/android/repository/repository.xml
4748
// http://dl.google.com/android/android-sdk_r3-mac.zip
4849
// http://dl.google.com/android/repository/tools_r03-macosx.zip
4950

50-
public class AndroidMode implements DeviceListener {
51+
52+
public class AndroidMode extends JavaMode implements DeviceListener {
5153
private AndroidSDK sdk;
5254
private Editor editor;
5355
private Build build;
@@ -71,6 +73,25 @@ public class AndroidMode implements DeviceListener {
7173

7274
JCheckBoxMenuItem toggleItem;
7375

76+
77+
public AndroidMode(Base base, File folder) {
78+
super(base, folder);
79+
}
80+
81+
82+
@Override
83+
public Editor createEditor(Base base, String path, int[] location) {
84+
// TODO Auto-generated method stub
85+
return null;
86+
}
87+
88+
89+
@Override
90+
public String getTitle() {
91+
return "Android";
92+
}
93+
94+
7495
public void init(final Editor parent, final JMenuBar menubar) {
7596
this.editor = parent;
7697

@@ -107,7 +128,7 @@ public void actionPerformed(ActionEvent e) {
107128
item = new JMenuItem("Sketch Permissions");
108129
item.addActionListener(new ActionListener() {
109130
public void actionPerformed(ActionEvent e) {
110-
new Permissions(editor);
131+
new Permissions(editor.getSketch());
111132
}
112133
});
113134
menu.add(item);
@@ -212,7 +233,7 @@ static protected File checkCoreZipLocation() {
212233
}
213234

214235
// otherwise do the usual
215-
return new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME);
236+
return new File(base.getSketchbookFolder(), ANDROID_CORE_FILENAME);
216237
}
217238

218239

@@ -504,9 +525,9 @@ public void stackTrace(final List<String> trace) {
504525
if (lm.find()) {
505526
final String filename = lm.group(1);
506527
final int lineNumber = Integer.parseInt(lm.group(2)) - 1;
507-
final RunnerException rex = editor.getSketch().placeException(
508-
exceptionLine, filename, lineNumber);
509-
editor.statusError(rex == null ? new RunnerException(exceptionLine,
528+
final SketchException rex =
529+
editor.getSketch().placeException(exceptionLine, filename, lineNumber);
530+
editor.statusError(rex == null ? new SketchException(exceptionLine,
510531
false) : rex);
511532
return;
512533
}
@@ -599,5 +620,4 @@ public void run() {
599620
@SuppressWarnings("serial")
600621
private static class MonitorCanceled extends Exception {
601622
}
602-
603623
}

android/tool/src/processing/app/tools/android/Build.java

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,14 @@
2828

2929
import processing.app.*;
3030
import processing.app.exec.*;
31-
import processing.app.debug.RunnerException;
3231
import processing.core.PApplet;
3332

3433

35-
class Build {
34+
class Build extends processing.mode.java.Build {
3635
static final String basePackage = "processing.android.test";
3736
static final String sdkVersion = "7";
3837

39-
private final Editor editor;
38+
// private final Editor editor;
4039
private final AndroidSDK sdk;
4140

4241
Manifest manifest;
@@ -45,14 +44,15 @@ class Build {
4544
File buildFile;
4645

4746

48-
public Build(final Editor editor, final AndroidSDK sdk) {
49-
this.editor = editor;
47+
public Build(final Sketch sketch, final AndroidSDK sdk) {
48+
super(sketch);
49+
// this.editor = editor;
5050
this.sdk = sdk;
5151
}
5252

5353

5454
public File createProject(String target) {
55-
final Sketch sketch = editor.getSketch();
55+
// final Sketch sketch = editor.getSketch();
5656

5757
try {
5858
tempBuildFolder = createTempBuildFolder(sketch);
@@ -77,9 +77,9 @@ public File createProject(String target) {
7777
editor.statusError("Could not parse the size() command.");
7878
return null;
7979
}
80-
className = sketch.preprocess(srcFolder.getAbsolutePath(),
81-
manifest.getPackageName(),
82-
preproc);
80+
className = preprocess(srcFolder.getAbsolutePath(),
81+
manifest.getPackageName(),
82+
preproc);
8383
if (className != null) {
8484
// final File androidXML = new File(tempBuildFolder, "AndroidManifest.xml");
8585
// writeAndroidManifest(androidXML, sketch.getName(), className);
@@ -113,10 +113,10 @@ public File createProject(String target) {
113113
}
114114
} catch (final IOException e) {
115115
e.printStackTrace();
116-
throw new RunnerException(e.getMessage());
116+
throw new SketchException(e.getMessage());
117117
}
118118
}
119-
} catch (final RunnerException e) {
119+
} catch (final SketchException e) {
120120
editor.statusError(e);
121121
return null;
122122
} catch (final IOException e) {
@@ -149,7 +149,7 @@ private File createTempBuildFolder(final Sketch sketch) throws IOException {
149149

150150

151151
protected File createExportFolder() throws IOException {
152-
Sketch sketch = editor.getSketch();
152+
// Sketch sketch = editor.getSketch();
153153
// Create the 'android' build folder, and move any existing version out.
154154
File androidFolder = new File(sketch.getFolder(), "android");
155155
if (androidFolder.exists()) {
@@ -259,11 +259,11 @@ protected boolean antBuild(final String target) {
259259
final int javacIndex = line.indexOf(javacPrefix);
260260
if (javacIndex != -1) {
261261
// System.out.println("checking: " + line);
262-
final Sketch sketch = editor.getSketch();
262+
// final Sketch sketch = editor.getSketch();
263263
// String sketchPath = sketch.getFolder().getAbsolutePath();
264-
final int offset = javacIndex + javacPrefix.length() + 1;
265-
final String[] pieces = PApplet.match(line.substring(offset),
266-
"^(.+):([0-9]+):\\s+(.+)$");
264+
int offset = javacIndex + javacPrefix.length() + 1;
265+
String[] pieces =
266+
PApplet.match(line.substring(offset), "^(.+):([0-9]+):\\s+(.+)$");
267267
if (pieces != null) {
268268
// PApplet.println(pieces);
269269
String fileName = pieces[1];
@@ -272,7 +272,7 @@ protected boolean antBuild(final String target) {
272272
final int lineNumber = PApplet.parseInt(pieces[2]) - 1;
273273
// PApplet.println("looking for " + fileName + " line " +
274274
// lineNumber);
275-
final RunnerException rex = sketch.placeException(pieces[3],
275+
final SketchException rex = placeException(pieces[3],
276276
fileName, lineNumber);
277277
if (rex != null) {
278278
rex.hideStackTrace();
@@ -368,7 +368,7 @@ private void writeLocalProps(final File file) {
368368
static final String ICON_36 = "icon-36.png";
369369

370370
private void writeRes(File resFolder,
371-
String className) throws RunnerException {
371+
String className) throws SketchException {
372372
File layoutFolder = mkdirs(resFolder, "layout");
373373
File layoutFile = new File(layoutFolder, "main.xml");
374374
writeResLayoutMain(layoutFile);
@@ -434,11 +434,10 @@ private void writeRes(File resFolder,
434434
}
435435

436436

437-
private File mkdirs(final File parent, final String name)
438-
throws RunnerException {
437+
private File mkdirs(final File parent, final String name) throws SketchException {
439438
final File result = new File(parent, name);
440439
if (!(result.exists() || result.mkdirs())) {
441-
throw new RunnerException("Could not create " + result);
440+
throw new SketchException("Could not create " + result);
442441
}
443442
return result;
444443
}
@@ -476,7 +475,7 @@ private void writeLibraries(final File libsFolder,
476475
final File assetsFolder) throws IOException {
477476
// Copy any libraries to the 'libs' folder
478477
final Sketch sketch = editor.getSketch();
479-
for (LibraryFolder library : sketch.getImportedLibraries()) {
478+
for (Library library : sketch.getImportedLibraries()) {
480479
File libraryFolder = new File(library.getPath());
481480
// in the list is a File object that points the
482481
// library sketch's "library" folder

android/tool/src/processing/app/tools/android/Manifest.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class Manifest {
4545
"file. Only the first activity entry will be updated, and you better \n" +
4646
"hope that's the right one, smartypants.";
4747

48-
private Editor editor;
48+
// private Editor editor;
4949
private Sketch sketch;
5050

5151
// entries we care about from the manifest file
@@ -55,15 +55,19 @@ public class Manifest {
5555
private XMLElement xml;
5656

5757

58-
public Manifest(Editor editor) {
59-
this.editor = editor;
60-
this.sketch = editor.getSketch();
58+
// public Manifest(Editor editor) {
59+
// this.editor = editor;
60+
// this.sketch = editor.getSketch();
61+
// load();
62+
// }
63+
public Manifest(Sketch sketch) {
64+
this.sketch = sketch;
6165
load();
6266
}
6367

6468

6569
private String defaultPackageName() {
66-
Sketch sketch = editor.getSketch();
70+
// Sketch sketch = editor.getSketch();
6771
return Build.basePackage + "." + sketch.getName().toLowerCase();
6872
}
6973

android/tool/src/processing/app/tools/android/Permissions.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
import javax.swing.event.*;
3232

3333
import processing.app.Base;
34-
import processing.app.Editor;
3534
import processing.app.Preferences;
35+
import processing.app.Sketch;
3636

3737

3838
public class Permissions extends JFrame {
@@ -47,13 +47,14 @@ public class Permissions extends JFrame {
4747
JLabel descriptionLabel;
4848
// JTextArea descriptionLabel;
4949

50-
Editor editor;
50+
// Editor editor;
51+
Sketch sketch;
5152

5253

53-
public Permissions(Editor editor) {
54+
public Permissions(Sketch sketch) {
5455
//public Permissions(Editor editor) {
5556
super("Android Permissions Selector");
56-
this.editor = editor;
57+
// this.editor = editor;
5758

5859
// XMLElement xml =
5960

@@ -287,7 +288,7 @@ public void actionPerformed(ActionEvent actionEvent) {
287288
setLocation((screen.width - windowSize.width) / 2,
288289
(screen.height - windowSize.height) / 2);
289290

290-
Manifest mf = new Manifest(editor);
291+
Manifest mf = new Manifest(sketch);
291292
setSelections(mf.getPermissions());
292293

293294
// show the window and get to work
@@ -325,7 +326,7 @@ protected String[] getSelections() {
325326

326327
protected void saveSelections() {
327328
String[] sel = getSelections();
328-
Manifest mf = new Manifest(editor);
329+
Manifest mf = new Manifest(sketch);
329330
mf.setPermissions(sel);
330331
}
331332

0 commit comments

Comments
 (0)