<!-- ##### SECTION Title ##### -->
GnomeClient

<!-- ##### SECTION Short_Description ##### -->
Interactions with the session manager.

<!-- ##### SECTION Long_Description ##### -->
<para>

</para>

<!-- ##### SECTION See_Also ##### -->
<para>

</para>

<!-- ##### SECTION Stability_Level ##### -->


<!-- ##### MACRO GNOME_CLIENT_CONNECTED ##### -->
<para>
Determine if the #GnomeClient instance has connected to the session manager
already.
</para>

@obj: A #GnomeClient instance.
@Returns: %TRUE if already connected to the session manager, %FALSE otherwise.


<!-- ##### ENUM GnomeDialogType ##### -->
<para>
The dialogs used by the session manager to handler user interactions.
</para>

@GNOME_DIALOG_ERROR: Used when an error has occurred.
@GNOME_DIALOG_NORMAL: Used for all other (non-error) interactions.

<!-- ##### ENUM GnomeRestartStyle ##### -->
<para>
The various ways in which the session manager can restart a client. Set by
calling gnome_client_set_restart_style().
</para>

@GNOME_RESTART_IF_RUNNING: Restart if the client was running when the previous
session exited.
@GNOME_RESTART_ANYWAY: Restart even if the client was exited before the user
logged out of the previous session.
@GNOME_RESTART_IMMEDIATELY: Restart the client immediately whenever it crashes
or exits.
@GNOME_RESTART_NEVER: Do not restart the client.

<!-- ##### ENUM GnomeClientFlags ##### -->
<para>
Flags indicating the status of a client (as seen by the session manager). Used
as return values by gnome_client_get_flags().
</para>

@GNOME_CLIENT_IS_CONNECTED: The client is connected to the session manager.
@GNOME_CLIENT_RESTARTED: The client has been restarted (i.e. it has been
running with the same client id previously).
@GNOME_CLIENT_RESTORED: There may be a configuration file from which the
client's state should be restored (applies only to the master client).

<!-- ##### ENUM GnomeSaveStyle ##### -->
<para>
Which pieces of data a client should save when receiving a "SaveYourself" call
from the session manager.
</para>

@GNOME_SAVE_GLOBAL: Save data (to somewhere persistent) that affects and is
visible to all users of this application.
@GNOME_SAVE_LOCAL: Save data that only applies to this instance of the
application.
@GNOME_SAVE_BOTH: Save both global and local data.

<!-- ##### ENUM GnomeInteractStyle ##### -->
<para>
Indicates how a "SaveYourself" command should interact with the user.
</para>

@GNOME_INTERACT_NONE: The client should never interact with the user.
@GNOME_INTERACT_ERRORS: The client should only interact when there are errors.
@GNOME_INTERACT_ANY: The client cna interact with the user for any reason.

<!-- ##### USER_FUNCTION GnomeInteractFunction ##### -->
<para>
A function called when the client wishes to interact with the user a the
session manager's convenience (usually during shutdown and restarts). All other
clients are blocked from interacting with the user until the @key is released
via a call to gnome_interaction_key_return().
</para>
<para>
Although the function is not obliged to respect the passed in @dialog_type, it
is bad form not to do so.
</para>

@client: The #GnomeClient instance doing the interaction.
@key: A unique key.
@dialog_type: The #GnomeDialogType that should be used to do the interaction.
@data: Application specific data that was specified at the time the callback
was set up.


<!-- ##### STRUCT GnomeClient ##### -->
<para>
A widget representing a client and containing information about the client's
interaction with the session manager.
</para>


<!-- ##### SIGNAL GnomeClient::connect ##### -->
<para>
Called once the client has been connected to the signal manager.
</para>

@client: the object which received the signal.
@arg1: %TRUE if the application has been restarted.

<!-- ##### SIGNAL GnomeClient::die ##### -->
<para>
Called when the session manager wants the client to shut down.
</para>

@client: the object which received the signal.

<!-- ##### SIGNAL GnomeClient::disconnect ##### -->
<para>
Called when the client is disconnected from the session manager.
</para>

@client: the object which received the signal.

<!-- ##### SIGNAL GnomeClient::save-complete ##### -->
<para>
Called when the session manager has finished checkpointing all of the clients.
Clients are then free to change their state.
</para>

@client: the object which received the signal.

<!-- ##### SIGNAL GnomeClient::save-yourself ##### -->
<para>
Called when either a "SaveYourself" or a "SaveYourselfPhase2" call is made by
the session manager.
</para>

@client: the object which received the signal.
@arg1: The phase of the "SaveYourself" command ('1' or '2').
@arg2: The data which should be saved by the client (local, global or both).
@arg3: %TRUE if the session manager is shutting down.
@arg4: How the client is allowed to interact with the user while saving.
@arg5: %TRUE if this is to be a "fast" shutdown (saving minimal data).
@Returns: %TRUE if the "SaveYourself" was completed succesfully, %FALSE
otherwise.

<!-- ##### SIGNAL GnomeClient::shutdown-cancelled ##### -->
<para>
Called if the session manager had sent a "SaveYourself" to all clients in
preparation for shutting down and the shutdown was then cancelled. A client can
then continue running and change its state.
</para>

@client: the object which received the signal.

<!-- ##### MACRO GNOME_CLIENT_PARAM_SM_CONNECT ##### -->
<para>
Passed as a parameter to the application's gnome_program_init() call (with a
value of %TRUE or %FALSE) to indicate whether the application should attempt to
connect to the session manager or not. Can be overridden by the user passing
<literal>--sm-disable</literal> on the command line and defaults to %TRUE.
</para>



<!-- ##### FUNCTION gnome_master_client ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION gnome_client_get_config_prefix ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION gnome_client_get_global_config_prefix ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION gnome_client_module_info_get ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION gnome_client_set_global_config_prefix ##### -->
<para>

</para>

@client: 
@prefix: 


<!-- ##### FUNCTION gnome_client_get_flags ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION gnome_client_set_restart_style ##### -->
<para>

</para>

@client: 
@style: 


<!-- ##### FUNCTION gnome_client_set_priority ##### -->
<para>

</para>

@client: 
@priority: 


<!-- ##### FUNCTION gnome_client_set_restart_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION gnome_client_add_static_arg ##### -->
<para>

</para>

@client: 
@Varargs: 


<!-- ##### FUNCTION gnome_client_set_discard_command ##### -->
<para>
Provides a command to run when a client is removed from the session. It might
delete session-specific config files for example.  Executing the discard
command on the local host should delete the information saved as part of the
session save that was in progress when the discard command was set. For
example:

  <example>
    <title>Setting up a client's discard command</title>
    <programlisting>
gchar *prefix = gnome_client_get_config_prefix (client);
gchar *argv[] = { "rm", "-r", NULL };
argv[2] = gnome_config_get_real_path (prefix);
gnome_client_set_discard_command (client, 3, argv);
    </programlisting>
  </example>
</para>

@client: The #GnomeClient of interest.
@argc: Number of strings in @argv.
@argv: Vector of strings such as those passed to exev().


<!-- ##### FUNCTION gnome_client_set_resign_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION gnome_client_set_shutdown_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION gnome_client_set_current_directory ##### -->
<para>

</para>

@client: 
@dir: 


<!-- ##### FUNCTION gnome_client_set_environment ##### -->
<para>

</para>

@client: 
@name: 
@value: 


<!-- ##### FUNCTION gnome_client_set_clone_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION gnome_client_set_process_id ##### -->
<para>

</para>

@client: 
@pid: 


<!-- ##### FUNCTION gnome_client_set_program ##### -->
<para>

</para>

@client: 
@program: 


<!-- ##### FUNCTION gnome_client_set_user_id ##### -->
<para>

</para>

@client: 
@id: 


<!-- ##### FUNCTION gnome_client_save_any_dialog ##### -->
<para>

</para>

@client: 
@dialog: 


<!-- ##### FUNCTION gnome_client_save_error_dialog ##### -->
<para>

</para>

@client: 
@dialog: 


<!-- ##### FUNCTION gnome_client_request_phase_2 ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION gnome_client_request_save ##### -->
<para>

</para>

@client: 
@save_style: 
@shutdown: 
@interact_style: 
@fast: 
@global: 


<!-- ##### FUNCTION gnome_client_flush ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION gnome_client_disable_master_connection ##### -->
<para>

</para>



<!-- ##### FUNCTION gnome_client_new ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION gnome_client_new_without_connection ##### -->
<para>

</para>

@Returns: 


<!-- ##### FUNCTION gnome_client_connect ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION gnome_client_disconnect ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION gnome_client_set_id ##### -->
<para>

</para>

@client: 
@id: 


<!-- ##### FUNCTION gnome_client_get_id ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION gnome_client_get_previous_id ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION gnome_client_get_desktop_id ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION gnome_client_request_interaction ##### -->
<para>

</para>

@client: 
@dialog_type: 
@function: 
@data: 


<!-- ##### FUNCTION gnome_client_request_interaction_interp ##### -->
<para>

</para>

@client: 
@dialog_type: 
@function: 
@data: 
@destroy: 


<!-- ##### FUNCTION gnome_interaction_key_return ##### -->
<para>

</para>

@key: 
@cancel_shutdown: 


