<!-- ##### SECTION Title ##### -->
MateClient

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

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

</para>

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

</para>

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


<!-- ##### SECTION Image ##### -->


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

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


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

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

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

@MATE_RESTART_IF_RUNNING: Restart if the client was running when the previous
session exited.
@MATE_RESTART_ANYWAY: Restart even if the client was exited before the user
logged out of the previous session.
@MATE_RESTART_IMMEDIATELY: Restart the client immediately whenever it crashes
or exits.
@MATE_RESTART_NEVER: Do not restart the client.

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

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

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

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

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

@MATE_INTERACT_NONE: The client should never interact with the user.
@MATE_INTERACT_ERRORS: The client should only interact when there are errors.
@MATE_INTERACT_ANY: The client cna interact with the user for any reason.

<!-- ##### USER_FUNCTION MateInteractFunction ##### -->
<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 mate_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 #MateClient instance doing the interaction.
@key: A unique key.
@dialog_type: The #MateDialogType that should be used to do the interaction.
@data: Application specific data that was specified at the time the callback
was set up.


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


<!-- ##### SIGNAL MateClient::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 MateClient::die ##### -->
<para>
Called when the session manager wants the client to shut down.
</para>

@client: the object which received the signal.

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

@client: the object which received the signal.

<!-- ##### SIGNAL MateClient::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 MateClient::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 MateClient::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 MATE_CLIENT_PARAM_SM_CONNECT ##### -->
<para>
Passed as a parameter to the application's mate_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 mate_master_client ##### -->
<para>

</para>

@void: 
@Returns: 


<!-- ##### FUNCTION mate_client_get_config_prefix ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION mate_client_get_global_config_prefix ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION mate_client_module_info_get ##### -->
<para>

</para>

@void: 
@Returns: 


<!-- ##### FUNCTION mate_client_set_global_config_prefix ##### -->
<para>

</para>

@client: 
@prefix: 


<!-- ##### FUNCTION mate_client_get_flags ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION mate_client_set_restart_style ##### -->
<para>

</para>

@client: 
@style: 


<!-- ##### FUNCTION mate_client_set_priority ##### -->
<para>

</para>

@client: 
@priority: 


<!-- ##### FUNCTION mate_client_set_restart_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION mate_client_add_static_arg ##### -->
<para>

</para>

@client: 
@Varargs: 


<!-- ##### FUNCTION mate_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 = mate_client_get_config_prefix (client);
gchar *argv[] = { "rm", "-r", NULL };
argv[2] = mate_config_get_real_path (prefix);
mate_client_set_discard_command (client, 3, argv);
    </programlisting>
  </example>
</para>

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


<!-- ##### FUNCTION mate_client_set_resign_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION mate_client_set_shutdown_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION mate_client_set_current_directory ##### -->
<para>

</para>

@client: 
@dir: 


<!-- ##### FUNCTION mate_client_set_environment ##### -->
<para>

</para>

@client: 
@name: 
@value: 


<!-- ##### FUNCTION mate_client_set_clone_command ##### -->
<para>

</para>

@client: 
@argc: 
@argv: 


<!-- ##### FUNCTION mate_client_set_process_id ##### -->
<para>

</para>

@client: 
@pid: 


<!-- ##### FUNCTION mate_client_set_program ##### -->
<para>

</para>

@client: 
@program: 


<!-- ##### FUNCTION mate_client_set_user_id ##### -->
<para>

</para>

@client: 
@id: 


<!-- ##### FUNCTION mate_client_save_any_dialog ##### -->
<para>

</para>

@client: 
@dialog: 


<!-- ##### FUNCTION mate_client_save_error_dialog ##### -->
<para>

</para>

@client: 
@dialog: 


<!-- ##### FUNCTION mate_client_request_phase_2 ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION mate_client_request_save ##### -->
<para>

</para>

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


<!-- ##### FUNCTION mate_client_flush ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION mate_client_disable_master_connection ##### -->
<para>

</para>

@void: 


<!-- ##### FUNCTION mate_client_new ##### -->
<para>

</para>

@void: 
@Returns: 


<!-- ##### FUNCTION mate_client_new_without_connection ##### -->
<para>

</para>

@void: 
@Returns: 


<!-- ##### FUNCTION mate_client_connect ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION mate_client_disconnect ##### -->
<para>

</para>

@client: 


<!-- ##### FUNCTION mate_client_set_id ##### -->
<para>

</para>

@client: 
@id: 


<!-- ##### FUNCTION mate_client_get_id ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION mate_client_get_previous_id ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION mate_client_get_desktop_id ##### -->
<para>

</para>

@client: 
@Returns: 


<!-- ##### FUNCTION mate_client_request_interaction ##### -->
<para>

</para>

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


<!-- ##### FUNCTION mate_client_request_interaction_interp ##### -->
<para>

</para>

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


<!-- ##### FUNCTION mate_interaction_key_return ##### -->
<para>

</para>

@key: 
@cancel_shutdown: 


