diff options
author | Leo Ufimtsev | 2018-01-11 15:35:23 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-01-11 16:22:44 +0000 |
commit | 70bc724bdc4e8386426bb111135ed74b336c4fae (patch) | |
tree | 4cd19d8e190833c7a9141131bba373ff7ffe6847 /bundles/org.eclipse.swt/Eclipse SWT PI/gtk | |
parent | 347b260b2e3c486cce58494c342e335efb847edd (diff) | |
download | eclipse.platform.swt-70bc724bdc4e8386426bb111135ed74b336c4fae.tar.gz eclipse.platform.swt-70bc724bdc4e8386426bb111135ed74b336c4fae.tar.xz eclipse.platform.swt-70bc724bdc4e8386426bb111135ed74b336c4fae.zip |
Bug 528414 (swtWaylandLauncher) Part 1 SWT GDBus implementation.
General purpose GDBus interface for converting GDBus calls to SWT
events.
Adding SWT.OpenDocument event handler.
To verify:
1) Open child eclipse.
2) Create files: /tmp/hi and /tmp/hithere
3) Run command:
gdbus call --session --dest org.eclipse.swt --object-path
/org/eclipse/swt --method org.eclipse.swt.FileOpen
"['/tmp/hi','/tmp/there']"
The two files 'hi' and 'hithere' open in the child eclipse.
- If you open two (or more) Eclipse instances, the most recently
opened Eclipse will receive gdbus call.
- If you close the 2nd eclipse, the previous (first) eclipse receives
gdbus calls again.
Future improvement:
The most-recently *focused* eclipse should receive gdbus call.
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=528414
Change-Id: Ib1fbbb09b74de4025611f68813ca53e6c62250b7
Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI/gtk')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 09c5a4a856..3ee5f4dc0b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -108,12 +108,14 @@ public class OS extends C { // Bug 519124 static { - String swt_lib_versions = getEnvironmentalVariable ("SWT_LIB_VERSIONS"); // Note, this is read in multiple places. + String swt_lib_versions = getEnvironmentalVariable (OS.SWT_LIB_VERSIONS); // Note, this is read in multiple places. if (swt_lib_versions != null && swt_lib_versions.equals("1")) { System.out.println("SWT_LIB_Gtk:"+gtk_major_version()+"."+gtk_minor_version()+"."+gtk_micro_version()); } } + public static final String SWT_LIB_VERSIONS = "SWT_LIB_VERSIONS"; + public static String getEnvironmentalVariable (String envVarName) { String envVarValue = null; long /*int*/ ptr = C.getenv(ascii(envVarName)); @@ -573,13 +575,18 @@ public class OS extends C { /** * DBus Data types as defined by: * https://dbus.freedesktop.org/doc/dbus-specification.html#idm423 + * If using these, make sure they're properly handled in all GDBus code. Only some of these are supported by some GDBus classes. * @category gdbus */ public static final String DBUS_TYPE_BYTE = "y"; // 8 bit, unsigned int. /** @category gdbus */ public static final String DBUS_TYPE_BOOLEAN = "b"; /** @category gdbus */ + public static final String DBUS_TYPE_ARRAY = "a"; + /** @category gdbus */ public static final String DBUS_TYPE_STRING = "s"; /** @category gdbus */ + public static final String DBUS_TYPE_STRING_ARRAY = "as"; + /** @category gdbus */ public static final String DBUS_TYPE_DOUBLE = "d"; /** @category gdbus */ public static final String DBUS_TYPE_STRUCT = "r"; // Not used by Dbus, but implemented by GDBus. @@ -597,6 +604,8 @@ public class OS extends C { /** @category gdbus */ public static final byte[] G_VARIANT_TYPE_BOOLEAN = ascii(DBUS_TYPE_BOOLEAN); /** @category gdbus */ + public static final byte[] G_VARIANT_TYPE_STRING_ARRAY = ascii(DBUS_TYPE_STRING_ARRAY); + /** @category gdbus */ public static final byte[] G_VARIANT_TYPE_STRING = ascii(DBUS_TYPE_STRING); /** @category gdbus */ public static final byte[] G_VARIANT_TYPE_DOUBLE = ascii(DBUS_TYPE_DOUBLE); |