pub trait AppLaunchContextExt: IsA<AppLaunchContext> + 'static {
// Provided methods
fn display(
&self,
info: &impl IsA<AppInfo>,
files: &[File],
) -> Option<GString> { ... }
fn environment(&self) -> Vec<OsString> { ... }
fn startup_notify_id(
&self,
info: Option<&impl IsA<AppInfo>>,
files: &[File],
) -> Option<GString> { ... }
fn launch_failed(&self, startup_notify_id: &str) { ... }
fn setenv(&self, variable: impl AsRef<OsStr>, value: impl AsRef<OsStr>) { ... }
fn unsetenv(&self, variable: impl AsRef<OsStr>) { ... }
fn connect_launch_failed<F: Fn(&Self, &str) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_launch_started<F: Fn(&Self, &AppInfo, Option<&Variant>) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_launched<F: Fn(&Self, &AppInfo, &Variant) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Expand description
Provided Methods§
Sourcefn environment(&self) -> Vec<OsString>
fn environment(&self) -> Vec<OsString>
Gets the complete environment variable list to be passed to
the child process when @self is used to launch an application.
This is a NULL-terminated array of strings, where each string has
the form KEY=VALUE.
§Returns
s environment
Sourcefn startup_notify_id(
&self,
info: Option<&impl IsA<AppInfo>>,
files: &[File],
) -> Option<GString>
fn startup_notify_id( &self, info: Option<&impl IsA<AppInfo>>, files: &[File], ) -> Option<GString>
Sourcefn launch_failed(&self, startup_notify_id: &str)
fn launch_failed(&self, startup_notify_id: &str)
Called when an application has failed to launch, so that it can cancel
the application startup notification started in
startup_notify_id().
§startup_notify_id
the startup notification id that was returned by
startup_notify_id().
Sourcefn unsetenv(&self, variable: impl AsRef<OsStr>)
fn unsetenv(&self, variable: impl AsRef<OsStr>)
s environment when @self is used to launch an application.
§variable
the environment variable to remove
Sourcefn connect_launch_failed<F: Fn(&Self, &str) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_launch_failed<F: Fn(&Self, &str) + 'static>( &self, f: F, ) -> SignalHandlerId
The launch-failed signal is emitted when a
AppInfo launch fails. The startup notification id is provided,
so that the launcher can cancel the startup notification.
Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one for each spawned instance.
§startup_notify_id
the startup notification id for the failed launch
Sourcefn connect_launch_started<F: Fn(&Self, &AppInfo, Option<&Variant>) + 'static>(
&self,
f: F,
) -> SignalHandlerId
Available on crate feature v2_72 only.
fn connect_launch_started<F: Fn(&Self, &AppInfo, Option<&Variant>) + 'static>( &self, f: F, ) -> SignalHandlerId
v2_72 only.The launch-started signal is emitted when a
AppInfo is about to be launched. If non-null the
@platform_data is an GVariant dictionary mapping strings to variants
(ie a{sv}), which contains additional, platform-specific data about this
launch. On UNIX, at least the startup-notification-id keys will be
present.
The value of the startup-notification-id key (type s) is a startup
notification ID corresponding to the format from the startup-notification
specification.
It allows tracking the progress of the launchee through startup.
It is guaranteed that this signal is followed by either a
launched or
launch-failed signal.
Because a launch operation may involve spawning multiple instances of the target application, you should expect this signal to be emitted multiple times, one for each spawned instance.
§info
the AppInfo that is about to be launched
§platform_data
additional platform-specific data for this launch
Sourcefn connect_launched<F: Fn(&Self, &AppInfo, &Variant) + 'static>(
&self,
f: F,
) -> SignalHandlerId
fn connect_launched<F: Fn(&Self, &AppInfo, &Variant) + 'static>( &self, f: F, ) -> SignalHandlerId
t known (for
example if the process was launched via D-Bus). The pid may not be
set at all in subsequent releases.
On Windows, pid is guaranteed to be valid only for the duration of the
launched signal emission; after the signal
is emitted, GLib will call spawn_close_pid(). If you need to
keep the alias::GLib.Pid after the signal has been emitted, then you can
duplicate pid using DuplicateHandle().
§info
the AppInfo that was just launched
§platform_data
additional platform-specific data for this launch
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".