jruby/docs BETA
org.eclipse.swt.internal 27
I AsyncReadyCallback
C BidiUtil
C C
C Callback
C Compatibility
C Converter
C DPIUtil
C DefaultExceptionHandler
C ExceptionStash
C GAsyncReadyCallbackHelper
C GDBus
C GTK4GlibFuture
C ImageList
C LONG
C Library
C NativeImageLoader
C Platform
I SWTEventListener
C SWTFontProvider
I SWTFontRegistry
C SWTGeometry
C SessionManagerDBus
C StrictChecks
C SyncDialogUtil
C TransparencyColorImageGcDrawer
C WidgetSpy
C Win32DPIUtils
GDBus — members 4
C new()
M convert_g_variant_to_java(g_variant) Object[]
M convert_java_to_g_variant(java_object) long
C init(methods, app_name)

org.eclipse.swt.internal.GDBus

class 4 members

General purpose DBus interface for SWT to interact with the operating system and vice versa. (See also WebkitGDBus for the webkit specific gdbus interface). This implementation uses GDBus (Gnome DBus) to implement the DBus interface. It can be reached via: gdbus call --session --dest org.eclipse.swt --object-path /org/eclipse/swt --method org.eclipse.swt.YOUR_METHOD YOUR_ARGS where YOUR_ARGS can be something like "MyString" or "['/tmp/myFile', '/tmp/myFile2']" etc.. For hygiene purposes, GVariant/GDBus native types/values should *never* leave this class. Convert on the way in/out. Technical notes: - Concurrent gdbus names can co-exist. (i.e, multiple session names in single proc). Meaning if you don't like org.eclipse.swt, you can add more session names. - This implementation is only a small subset of GDBus. E.g not all types are translated and not functionality implemented. Add them as you need them. - At time of writing (v 1.4), only handles incoming gdbus calls. But could be easily extended to handle outgoing gdbus calls.

Constructors

new

new ( )
Java: <init>()

Class Methods

convert_g_variant_to_java

Object[] convert_g_variant_to_java ( long g_variant )
Java: convertGVariantToJava(long gVariant)

Converts the given GVariant(s) to Java Object(s). If GVariant is not an array, this returns an Object[] array with one element. Only subset of types is currently supported, add type(s) as/when you need them. For inspiration, see WebkitGDBus.java:convert..()

nametypedescription
g_variantlonga pointer to the native GVariant

convert_java_to_g_variant

long convert_java_to_g_variant ( Object java_object )
Java: convertJavaToGVariant(Object javaObject)

Converts the given Java Object to a GVariant * representation. (Only subset of types is currently supported). We assume that input Object may contain invalid types.

Returns: pointer GVariant *

init

init ( GDBus.GDBusMethod[] methods, String app_name )
Java: init(org.eclipse.swt.internal.GDBus.GDBusMethod[] methods, String appName)

Instantiate GDBus for use by SWT. Note, a new SWT instance that runs this "Steals" the session bus, but upon termination it returns the session back to the previous owner. To make this more flexible we append appName (derived from the application executable but can be set with the command-line argument -name) to the session name.

nametypedescription
methodsorg.eclipse.swt.internal.GDBus.GDBusMethod[]GDBus methods that we should handle.
app_nameStringappName to append to GDBus object name if not null