1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-07 00:04:36 +03:00

Merge pull request #3194 from ffissore/windows-jna

Got rid on JNA
This commit is contained in:
Federico Fissore
2015-05-21 10:25:54 +02:00
31 changed files with 109 additions and 1199 deletions

View File

@@ -4,7 +4,6 @@
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lib/antlr.jar"/>
<classpathentry kind="lib" path="lib/jna.jar"/>
<classpathentry kind="lib" path="lib/ecj.jar"/>
<classpathentry kind="lib" path="lib/apple.jar"/>
<classpathentry kind="lib" path="lib/bcpg-jdk15on-152.jar"/>

View File

@@ -14,7 +14,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/serial"/>
<classpathentry combineaccessrules="false" kind="src" path="/video"/>
<classpathentry kind="lib" path="lib/antlr.jar"/>
<classpathentry kind="lib" path="lib/jna.jar"/>
<classpathentry kind="lib" path="lib/ecj.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="processing/app/tools/format/|processing/app/macosx/" kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/core"/>
<classpathentry combineaccessrules="false" kind="src" path="/dxf"/>
<classpathentry combineaccessrules="false" kind="src" path="/net"/>
<classpathentry combineaccessrules="false" kind="src" path="/opengl">
<attributes>
<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="opengl/library"/>
</attributes>
</classpathentry>
<classpathentry combineaccessrules="false" kind="src" path="/pdf"/>
<classpathentry combineaccessrules="false" kind="src" path="/serial"/>
<classpathentry combineaccessrules="false" kind="src" path="/video"/>
<classpathentry kind="lib" path="lib/antlr.jar"/>
<classpathentry kind="lib" path="lib/jna.jar"/>
<classpathentry kind="lib" path="lib/ecj.jar"/>
<classpathentry kind="lib" path="C:/Users/fry/processing/build/windows/work/java/lib/tools.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -1 +0,0 @@
https://github.com/twall/jna/blob/master/LICENSE

Binary file not shown.

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/processing/src/processing/app/Base.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/java-6-openjdk-amd64&quot; javaProject=&quot;processing&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/ecj.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/jna.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/processing/lib/jssc-2.6.0.jar&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry path=&quot;3&quot; projectName=&quot;processing-core&quot; type=&quot;1&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;processing&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="processing.app.Base"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="processing"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.library.path=lib/"/>
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:processing}/../build/linux/work"/>
</launchConfiguration>

View File

@@ -617,13 +617,6 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="autoAssociateBox">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="_(&quot;Automatically associate .ino files with Arduino&quot;)" type="code"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="saveVerifyUploadBox">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">

View File

@@ -34,7 +34,6 @@ import processing.app.Editor;
import processing.app.I18n;
import processing.app.PreferencesData;
import processing.app.helpers.FileUtils;
import processing.app.helpers.OSUtils;
import processing.app.legacy.PApplet;
import javax.swing.*;
@@ -198,11 +197,6 @@ public class Preferences extends javax.swing.JDialog {
}
});
if (!OSUtils.isWindows() || base.getPortableFolder() != null) {
autoAssociateBox.setEnabled(false);
autoAssociateBox.getParent().remove(autoAssociateBox);
}
showPrerefencesData();
}
@@ -256,7 +250,6 @@ public class Preferences extends javax.swing.JDialog {
externalEditorBox = new javax.swing.JCheckBox();
checkUpdatesBox = new javax.swing.JCheckBox();
updateExtensionBox = new javax.swing.JCheckBox();
autoAssociateBox = new javax.swing.JCheckBox();
saveVerifyUploadBox = new javax.swing.JCheckBox();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@@ -445,9 +438,6 @@ public class Preferences extends javax.swing.JDialog {
updateExtensionBox.setText(_("Update sketch files to new extension on save (.pde -> .ino)"));
checkboxesContainer.add(updateExtensionBox);
autoAssociateBox.setText(_("Automatically associate .ino files with Arduino"));
checkboxesContainer.add(autoAssociateBox);
saveVerifyUploadBox.setText(_("Save when verifying or uploading"));
checkboxesContainer.add(saveVerifyUploadBox);
@@ -610,7 +600,6 @@ public class Preferences extends javax.swing.JDialog {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JTextField additionalBoardsManagerField;
private javax.swing.JCheckBox autoAssociateBox;
private javax.swing.JCheckBox checkUpdatesBox;
private javax.swing.JComboBox comboLanguage;
private javax.swing.JComboBox comboWarnings;
@@ -683,10 +672,6 @@ public class Preferences extends javax.swing.JDialog {
PreferencesData.setBoolean("editor.update_extension", updateExtensionBox.isSelected());
if (autoAssociateBox != null) {
PreferencesData.setBoolean("platform.auto_file_type_associations", autoAssociateBox.isSelected());
}
PreferencesData.setBoolean("editor.save_on_verify", saveVerifyUploadBox.isSelected());
PreferencesData.set("proxy.http.server", proxyHTTPServer.getText());
@@ -744,10 +729,6 @@ public class Preferences extends javax.swing.JDialog {
updateExtensionBox.setSelected(PreferencesData.get("editor.update_extension") == null || PreferencesData.getBoolean("editor.update_extension"));
if (autoAssociateBox != null) {
autoAssociateBox.setSelected(PreferencesData.getBoolean("platform.auto_file_type_associations"));
}
saveVerifyUploadBox.setSelected(PreferencesData.getBoolean("editor.save_on_verify"));
proxyHTTPServer.setText(PreferencesData.get("proxy.http.server"));

View File

@@ -146,6 +146,8 @@ public class Base {
initPlatform();
getPlatform().init();
BaseNoGui.initPortableFolder();
BaseNoGui.initParameters(args);
@@ -284,8 +286,6 @@ public class Base {
}
public Base(String[] args) throws Exception {
getPlatform().init();
String sketchbookPath = BaseNoGui.getSketchbookPath();
// If no path is set, get the default sketchbook folder for this platform

View File

@@ -0,0 +1,29 @@
package processing.app.windows;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class RegQueryParserTest {
@Test
public void testRegQueryParser() throws Exception {
String output = "! REG.EXE VERSION 3.0\n" +
"\n" +
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\n" +
"\n" +
" Local AppData REG_SZ C:\\Documents and Settings\\username\\My Documents";
String folderPath = new RegQueryParser(output).getValueOfKey();
assertEquals("C:\\Documents and Settings\\username\\My Documents", folderPath);
}
@Test
public void testRegQueryParser2() throws Exception {
String output = "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders\n" +
" Local AppData REG_SZ C:\\Users\\username\\AppData\\Local";
String folderPath = new RegQueryParser(output).getValueOfKey();
assertEquals("C:\\Users\\username\\AppData\\Local", folderPath);
}
}