![]() |
![]() |
![]() |
![]() |
The XdpPortal object provides the main context object for the portal operations of libportal.
Typically, an application will create a single XdpPortal
object with xdp_portal_new()
and use it throughout its lifetime.
“location-updated”
signalvoid user_function (XdpPortal *portal, int latitude, int longitude, int altitude, int accuracy, int speed, int heading, gint64 timestamp_s, gint64 timestamp_ms, gpointer user_data)
The ::location-updated signal is emitted when location monitoring is enabled and the location changes.
portal |
the XdpPortal |
|
latitude |
the latitude, in degrees |
|
longitude |
the longitude, in degrees |
|
altitude |
the altitude, in meters |
|
accuracy |
the accuracy, in meters |
|
speed |
the speed, in meters per second |
|
heading |
the heading, in degrees |
|
timestamp_s |
the timestamp seconds since the Unix epoch |
|
timestamp_ms |
the microseconds fraction of the timestamp |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“notification-action-invoked”
signalvoid user_function (XdpPortal *portal, char *id, char *action, GVariant *parameter, gpointer user_data)
The ::notification-action-invoked signal is emitted when a non-exported action is activated on a notification.
portal |
the XdpPortal |
|
id |
the notification ID |
|
action |
the action name |
|
parameter |
the target parameter for the action. |
[nullable] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“session-state-changed”
signalvoid user_function (XdpPortal *portal, gboolean screensaver_active, XdpLoginSessionState session_state, gpointer user_data)
This signal is emitted when session state monitoring is enabled and the state of the login session changes or the screensaver is activated or deactivated.
portal |
the XdpPortal object |
|
screensaver_active |
whether the screensaver is active |
|
session_state |
the current state of the login session |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“spawn-exited”
signalvoid user_function (XdpPortal *portal, guint pid, guint exit_status, gpointer user_data)
This signal is emitted when a process that was spawned
with xdp_portal_spawn()
exits.
portal |
the XdpPortal object |
|
pid |
the pid of the process |
|
exit_status |
the exit status of the process |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“update-available”
signalvoid user_function (XdpPortal *portal, char *running_commit, char *local_commit, char *remote_commit, gpointer user_data)
This signal is emitted when updates monitoring is enabled and a new update is available. It is only sent once with the same information, but it can be sent many times if new updates appear.
portal |
the XdpPortal object |
|
running_commit |
the commit that the sandbox is running with |
|
local_commit |
the commit that is currently deployed. Restarting the app will use this commit |
|
remote_commit |
the commit that is available as an update. Updating the app will deloy this commit |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“update-progress”
signalvoid user_function (XdpPortal *portal, guint n_ops, guint op, guint progress, XdpUpdateStatus status, char *error, char *error_message, gpointer user_data)
This signal gets emitted to indicate progress of an
update installation. It is undefined exactly how often it
is sent, but it will be emitted at least once at the end with
a non-zero status
. For each successful operation in the
update, we're also guaranteed to send exactly one signal
with progress
100.
portal |
the XdpPortal object |
|
n_ops |
the number of operations that the update consists of |
|
op |
the position of the currently active operation |
|
progress |
the progress of the currently active operation, as a number between 0 and 100 |
|
status |
the overall status of the update |
|
error |
the error name if the status is 'failed' |
|
error_message |
the error message if the status is 'failed' |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First