Interface AppLaunchContext.LaunchedCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
AppLaunchContext
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
LaunchedCallback
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
TheGio.AppLaunchContext::launched
signal is emitted when aAppInfo
is successfully launched.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default void
upcall
(MemorySegment sourceAppLaunchContext, MemorySegment info, MemorySegment platformData) Theupcall
method is called from native code.
-
Method Details
-
run
TheGio.AppLaunchContext::launched
signal is emitted when aAppInfo
is successfully launched.Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one time for each spawned instance.
The
platformData
is an GVariant dictionary mapping strings to variants (iea{sv}
), which contains additional, platform-specific data about this launch. On UNIX, at least thepid
andstartup-notification-id
keys will be present.Since 2.72 the
pid
may be 0 if the process id wasn’t known (for example if the process was launched via D-Bus). Thepid
may not be set at all in subsequent releases.On Windows,
pid
is guaranteed to be valid only for the duration of theGio.AppLaunchContext::launched
signal emission; after the signal is emitted, GLib will callGLib.spawnClosePid(org.gnome.glib.Pid)
. If you need to keep theGLib.Pid
after the signal has been emitted, then you can duplicatepid
usingDuplicateHandle()
. -
upcall
default void upcall(MemorySegment sourceAppLaunchContext, MemorySegment info, MemorySegment platformData) Theupcall
method is called from native code. The parameters are marshaled andrun(org.gnome.gio.AppInfo, org.gnome.glib.Variant)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-