![]() |
![]() |
![]() |
Libxfce4ui Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#include <libxfce4ui/libxfce4ui.h> XfceSMClient; enum XfceSMClientPriority; enum XfceSMClientRestartStyle; enum XfceSMClientShutdownHint; GOptionGroup * xfce_sm_client_get_option_group (gint argc
,gchar **argv
); XfceSMClient * xfce_sm_client_get (void
); XfceSMClient * xfce_sm_client_get_with_argv (gint argc
,gchar **argv
,XfceSMClientRestartStyle restart_style
,guchar priority
); XfceSMClient * xfce_sm_client_get_full (XfceSMClientRestartStyle restart_style
,guchar priority
,const gchar *resumed_client_id
,const gchar *current_directory
,const gchar **restart_command
,const gchar *desktop_file
); gboolean xfce_sm_client_connect (XfceSMClient *sm_client
,GError **error
); void xfce_sm_client_disconnect (XfceSMClient *sm_client
); gboolean xfce_sm_client_is_connected (XfceSMClient *sm_client
); gboolean xfce_sm_client_is_resumed (XfceSMClient *sm_client
); void xfce_sm_client_set_desktop_file (XfceSMClient *sm_client
,const gchar *desktop_file
); void xfce_sm_client_request_shutdown (XfceSMClient *sm_client
,XfceSMClientShutdownHint shutdown_hint
); const gchar * xfce_sm_client_get_client_id (XfceSMClient *sm_client
); const gchar * xfce_sm_client_get_state_file (XfceSMClient *sm_client
); const gchar * xfce_sm_client_get_current_directory (XfceSMClient *sm_client
); void xfce_sm_client_set_current_directory (XfceSMClient *sm_client
,const gchar *current_directory
); guint8 xfce_sm_client_get_priority (XfceSMClient *sm_client
); void xfce_sm_client_set_priority (XfceSMClient *sm_client
,guint8 priority
); const gchar * const * xfce_sm_client_get_restart_command (XfceSMClient *sm_client
); void xfce_sm_client_set_restart_command (XfceSMClient *sm_client
,gchar **restart_command
); XfceSMClientRestartStyle xfce_sm_client_get_restart_style (XfceSMClient *sm_client
); void xfce_sm_client_set_restart_style (XfceSMClient *sm_client
,XfceSMClientRestartStyle restart_style
);
GObject +----XfceSMClient
GEnum +----XfceSMClientRestartStyle
GEnum +----XfceSMClientShutdownHint
"argc" gint : Write / Construct Only "argv" GStrv : Write / Construct Only "client-id" gchar* : Read / Write / Construct Only "current-directory" gchar* : Read / Write "desktop-file" gchar* : Read / Write "priority" guchar : Read / Write / Construct "restart-command" GStrv : Read / Write "restart-style" XfceSMClientRestartStyle : Read / Write / Construct "resumed" gboolean : Read
"quit" :Run Last
"quit-cancelled" :Run Last
"quit-requested" :Run Last
"save-state" :Run Last
"save-state-extended" :Run Last
XfceSMClient is a session management client that speaks the X Session Management Protocol (XSMP). It's designed to be easy to use and hide some of the more esoteric feaures of XSMP from the API user.
typedef enum { XFCE_SM_CLIENT_PRIORITY_HIGHEST = 0, XFCE_SM_CLIENT_PRIORITY_WM = 15, XFCE_SM_CLIENT_PRIORITY_CORE = 25, XFCE_SM_CLIENT_PRIORITY_DESKTOP = 35, XFCE_SM_CLIENT_PRIORITY_DEFAULT = 50, XFCE_SM_CLIENT_PRIORITY_LOWEST = 255, } XfceSMClientPriority;
Some sample priority values for use with xfce_sm_client_set_priority()
.
A high priority value. You probably don't want to use this. | |
A priority value for use by the window manager. | |
A priority value for use by applications that place windows on the screen and possibly set window manager struts. | |
A priority value for use by applications that draw on the desktop. | |
A priority value for regular applications. | |
The lowest possible priority value. |
typedef enum { XFCE_SM_CLIENT_RESTART_NORMAL = 0, XFCE_SM_CLIENT_RESTART_IMMEDIATELY, } XfceSMClientRestartStyle;
An enumeration describing how the session manager should restart the application.
typedef enum { XFCE_SM_CLIENT_SHUTDOWN_HINT_ASK = 0, XFCE_SM_CLIENT_SHUTDOWN_HINT_LOGOUT, XFCE_SM_CLIENT_SHUTDOWN_HINT_HALT, XFCE_SM_CLIENT_SHUTDOWN_HINT_REBOOT, } XfceSMClientShutdownHint;
Hints to the session manager what kind of shutdown the session manager should perform.
GOptionGroup * xfce_sm_client_get_option_group (gint argc
,gchar **argv
);
Constructs a GOptionGroup suitable for use with Glib's command-line option parser.
This function is a bit sneaky in that it will make a copy of
the program's argc and argv before GTK+ etc.
has a chance to mess around with it, so XfceSMClient can later
construct an accurate restart command. Instead of calling
gtk_init()
or gtk_init_with_args()
, instead you'd do something
like:
1 2 3 4 5 6 7 |