diff --git a/android/todo.txt b/android/todo.txt index ed3d6eb88..e3129e3ec 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -1,4 +1,6 @@ 0201 android +X lots of updates to PGraphics et al, especially on the 3D side +X change export menu/key/toolbar ordering _ if a sketch asks for android mode but it's not available diff --git a/app/src/processing/app/Library.java b/app/src/processing/app/Library.java index 2b2aceaa5..648435082 100644 --- a/app/src/processing/app/Library.java +++ b/app/src/processing/app/Library.java @@ -73,7 +73,8 @@ public class Library extends InstalledContribution { return lc.endsWith(".jar") || lc.endsWith(".zip"); } }; - + + public Library(File folder, String subfolder) { super(folder, Library.propertiesFileName); this.group = subfolder; @@ -122,35 +123,24 @@ public class Library extends InstalledContribution { String platformName32 = platformName + "32"; String platformName64 = platformName + "64"; + // First check for things like 'application.macosx=' or 'application.windows32' in the export.txt file. + // These will override anything in the platform-specific subfolders. String platformAll = exportTable.get("application." + platformName); String[] platformList = platformAll == null ? null : PApplet.splitTokens(platformAll, ", "); - String platform32 = exportTable.get("application." + platformName + "32"); String[] platformList32 = platform32 == null ? null : PApplet.splitTokens(platform32, ", "); - String platform64 = exportTable.get("application." + platformName + "64"); String[] platformList64 = platform64 == null ? null : PApplet.splitTokens(platform64, ", "); + // If nothing specified in the export.txt entries, look for the platform-specific folders. if (platformAll == null) { platformList = listPlatformEntries(libraryFolder, platformName, baseList); -// File folderAll = new File(libraryFolder, platformName); -// if (folderAll.exists()) { -// platformList = PApplet.concat(baseList, folderAll.list(standardFilter)); -// } } if (platform32 == null) { platformList32 = listPlatformEntries(libraryFolder, platformName32, baseList); -// File folder32 = new File(libraryFolder, platformName32); -// if (folder32.exists()) { -// platformList32 = PApplet.concat(baseList, folder32.list(standardFilter)); -// } } if (platform64 == null) { platformList64 = listPlatformEntries(libraryFolder, platformName64, baseList); -// File folder64 = new File(libraryFolder, platformName64); -// if (folder64.exists()) { -// platformList64 = PApplet.concat(baseList, folder64.list(standardFilter)); -// } } if (platformList32 != null || platformList64 != null) { @@ -355,6 +345,15 @@ public class Library extends InstalledContribution { public boolean hasMultipleArch(int platform) { return multipleArch[platform]; } + + + public boolean supportsArch(int platform, int bits) { + // If this is a universal library, or has no natives, then we're good. + if (multipleArch[platform] == false) { + return true; + } + return getApplicationExportList(platform, bits) != null; + } // static boolean hasMultipleArch(String platformName, ArrayList libraries) { diff --git a/app/src/processing/app/Preferences.java b/app/src/processing/app/Preferences.java index 165c0f14d..08aedad12 100644 --- a/app/src/processing/app/Preferences.java +++ b/app/src/processing/app/Preferences.java @@ -119,6 +119,8 @@ public class Preferences { JCheckBox checkUpdatesBox; JTextField fontSizeField; JCheckBox autoAssociateBox; + JRadioButton bitsThirtyTwoButton; + JRadioButton bitsSixtyFourButton; // the calling editor, so updates can be applied @@ -360,7 +362,29 @@ public class Preferences { right = Math.max(right, left + d.width); top += d.height + GUI_BETWEEN; } - + + + // Launch programs as [ ] 32-bit [ ] 64-bit (Mac OS X only) + + if (Base.isMacOS()) { + box = Box.createHorizontalBox(); + label = new JLabel("Launch programs in "); + box.add(label); + bitsThirtyTwoButton = new JRadioButton("32-bit mode "); + box.add(bitsThirtyTwoButton); + bitsSixtyFourButton = new JRadioButton("64-bit mode"); + box.add(bitsSixtyFourButton); + + ButtonGroup bg = new ButtonGroup(); + bg.add(bitsThirtyTwoButton); + bg.add(bitsSixtyFourButton); + + pain.add(box); + d = box.getPreferredSize(); + box.setBounds(left, top, d.width, d.height); + top += d.height + GUI_BETWEEN; + } + // More preferences are in the ... @@ -546,6 +570,10 @@ public class Preferences { } */ + if (Base.isMacOS()) { + set("run.options.bits", bitsThirtyTwoButton.isSelected() ? "32" : "64"); + } + String newSizeText = fontSizeField.getText(); try { int newSize = Integer.parseInt(newSizeText.trim()); @@ -595,6 +623,18 @@ public class Preferences { memoryField. setText(get("run.options.memory.maximum")); + String bits = Preferences.get("run.options.bits"); + if (bits.equals("32")) { + bitsThirtyTwoButton.setSelected(true); + } else if (bits.equals("64")) { + bitsSixtyFourButton.setSelected(true); + } + // in case we go back and support OS X 10.5... + if (System.getProperty("os.version").startsWith("10.5")) { + bitsSixtyFourButton.setSelected(true); + bitsThirtyTwoButton.setEnabled(false); + } + if (autoAssociateBox != null) { autoAssociateBox. setSelected(getBoolean("platform.auto_file_type_associations")); @@ -604,6 +644,22 @@ public class Preferences { } + // Workaround for Apple bullsh*t caused by their not releasing a 32-bit + // version of Java for Mac OS X 10.5. +// static public String checkBits() { +// String bits = Preferences.get("run.options.bits"); +// if (bits == null) { +// if (System.getProperty("os.version").startsWith("10.5")) { +// bits = "64"; +// } else { +// bits = "32"; +// } +// Preferences.set("run.options.bits", bits); +// } +// return bits; +// } + + // ................................................................. diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index caae2b48c..4991a3f61 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -1095,6 +1095,23 @@ public class JavaBuild { private boolean exportApplication(File destFolder, int exportPlatform, int exportBits) throws IOException, SketchException { + // TODO this should probably be a dialog box instead of a warning + // on the terminal. And the message should be written better than this. + // http://code.google.com/p/processing/issues/detail?id=884 + for (Library library : importedLibraries) { + if (!library.supportsArch(exportPlatform, exportBits)) { + String pn = PConstants.platformNames[exportPlatform]; + System.err.println("The application." + pn + exportBits + + " folder will not be created because no " + + exportBits + "-bit version of " + + library.getName() + + " is available for " + pn); + return true; // don't cancel export for this, just move along + } + } + + /// prep the output directory + mode.prepareExportFolder(destFolder); diff --git a/app/src/processing/mode/java/runner/Runner.java b/app/src/processing/mode/java/runner/Runner.java index 21d048c27..3453f3cad 100644 --- a/app/src/processing/mode/java/runner/Runner.java +++ b/app/src/processing/mode/java/runner/Runner.java @@ -280,15 +280,9 @@ public class Runner implements MessageConsumer { commandArgs = "java -Xrunjdwp:transport=dt_shmem,address=" + addr + ",suspend=y "; } else if (Base.isMacOS()) { - if (System.getProperty("os.version").startsWith("10.4")) { - // -d32 not understood by 10.4 (and not needed) - commandArgs = - "java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y "; - } else { - commandArgs = -// "java -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y "; - "java -d32 -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y "; - } + commandArgs = + "java -d" + Preferences.get("run.options.bits") + + " -Xrunjdwp:transport=dt_socket,address=" + addr + ",suspend=y "; } for (int i = 0; i < vmParams.length; i++) { diff --git a/build/shared/lib/preferences.txt b/build/shared/lib/preferences.txt index 95d519f3a..84ba39aa5 100755 --- a/build/shared/lib/preferences.txt +++ b/build/shared/lib/preferences.txt @@ -163,6 +163,12 @@ run.options.memory = false run.options.memory.initial = 64 run.options.memory.maximum = 256 +# By default, Mac OS X 10.6 launches applications in 32-bit mode. +# Changing this doesn't do anything on other platforms. On OS X 10.5, +# only 64-bit is supported, because Apple didn't release a 32-bit +# version of Java 1.6 for OS X 10.5. +run.options.bits.macosx = 32 + # example of increasing the memory size for applets run externally #run.options = -Xms128m -Xmx1024m diff --git a/todo.txt b/todo.txt index d5c8b1c35..d826abcc8 100644 --- a/todo.txt +++ b/todo.txt @@ -8,21 +8,24 @@ X make application the default instead of applet X subfolders of windows32 & friends aren't being included (gsvideo problem) X on Windows, move the exported DLLs et al inside 'lib' X requires change to export/launcher.cpp to include the exe dir -_ this will cause trouble with ... X change Linux script to handle the 'lib' dir as part of the lib path -X changed Mac OS X launchers, also requiring Java 1.6. -X write .bat file for windows64 +X changed Mac OS X launchers to use Java 1.6 ++ Java 1.6 required for the PDE and for exported applications +X write .bat file for windows64 application exports _ document that this is temporary / file a bug X gstreamer has a million DLLs, so it's gross to have them in the main fldr o how would launch4j deal with this? +X print a message in a console when trying to export a lib for unsupported arch +X add a preferences option for whether to run in 32 or 64-bit +X gsvideo sometimes needs to run as 64 instead of 32 +X notes about bit depth +X If no bits specified (libs are all universal, or no native libs) +X then exportBits will be 0, and can be controlled via "Get Info". +X Otherwise, need to specify the bits as a VM option. - // If no bits specified (libs are all universal, or no native libs) - // then exportBits will be 0, and can be controlled via "Get Info". - // Otherwise, need to specify the bits as a VM option. -_ add a preferences option for whether to run in 32 or 64-bit -_ also make note of when library is not available (serial) with error msg -_ gsvideo sometimes needs to run as 64 instead of 32 +_ make note of when library is not available (serial) with error msg +_ i.e. if running in 64-bit mode on OS X, can't do serial _ Commenting via menu or shortcut does not set sketch to "need save" _ http://code.google.com/p/processing/issues/detail?id=860 @@ -1534,6 +1537,8 @@ _ and include an md5hash to see if the file is correct DIST / Windows +_ exe instead of bat to make exported apps run in 64-bit +_ http://code.google.com/p/processing/issues/detail?id=885 _ Update Windows icons for multiple sizes, implement them in the PDE _ http://code.google.com/p/processing/issues/detail?id=632 _ http://code.google.com/p/processing/issues/detail?id=138