~ubuntu-branches/ubuntu/karmic/xfce4-session/karmic

« back to all changes in this revision

Viewing changes to xfce4-session/client.h

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2005-11-06 22:01:12 UTC
  • mto: (4.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20051106220112-5rusox237ymjghsp
Tags: upstream-4.2.3
ImportĀ upstreamĀ versionĀ 4.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (c) 2003 Benedikt Meurer <benedikt.meurer@unix-ag.uni-siegen.de>
3
 
 * All rights reserved.
4
 
 *
5
 
 * Redistribution and use in source and binary forms, with or without
6
 
 * modification, are permitted provided that the following conditions
7
 
 * are met:
8
 
 *
9
 
 * 1. Redistributions of source code must retain the above copyright
10
 
 *    notice, this list of conditions and the following disclaimer.
11
 
 * 2. Redistributions in binary form must reproduce the above copyright
12
 
 *    notice, this list of conditions and the following disclaimer in the
13
 
 *    documentation and/or other materials provided with the distribution.
14
 
 *
15
 
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16
 
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17
 
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
 
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19
 
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20
 
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
 
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
 
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
 
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 
 */
26
 
 
27
 
#ifndef __XFSM_CLIENT_H__
28
 
#define __XFSM_CLIENT_H__
29
 
 
30
 
#include <stdio.h>
31
 
 
32
 
#include <X11/ICE/ICElib.h>
33
 
#include <X11/SM/SMlib.h>
34
 
 
35
 
#include <glib.h>
36
 
 
37
 
/* client states */
38
 
enum
39
 
{
40
 
        CLIENT_IDLE = 0,
41
 
        CLIENT_INTERACTING,
42
 
        CLIENT_SAVEDONE,
43
 
        CLIENT_SAVING,
44
 
        CLIENT_SAVINGLOCAL,
45
 
        CLIENT_WAITFORINTERACT,
46
 
        CLIENT_WAITFORPHASE2,
47
 
        CLIENT_DISCONNECTED,
48
 
};
49
 
 
50
 
typedef struct _Client  Client;
51
 
struct _Client
52
 
{
53
 
        /* identification */
54
 
        char            *id;
55
 
 
56
 
        /* clients host machine */
57
 
        char            *hostname;
58
 
 
59
 
        /* connection handles */
60
 
        IceConn         iceConn;
61
 
        SmsConn         smsConn;
62
 
 
63
 
        /* session properties */
64
 
        int             nProps;
65
 
        SmProp          **props;
66
 
 
67
 
        /* client state */
68
 
        int             state;
69
 
};
70
 
 
71
 
#define CLIENT(obj)             ((Client *)(obj))
72
 
 
73
 
/* prototypes */
74
 
extern Client   *client_new(SmsConn);
75
 
extern void     client_free(Client *);
76
 
extern gboolean client_save(const Client *, FILE *fp);
77
 
extern Client   *client_load(FILE *fp);
78
 
extern gchar    *client_get_current_directory(const Client *);
79
 
extern gchar    *client_get_program(const Client *);
80
 
extern gchar    *client_get_userid(const Client *);
81
 
extern gchar    **client_get_restart_command(const Client *);
82
 
extern gint     client_get_priority(const Client *);
83
 
extern gint     client_get_restart_style_hint(const Client *);
84
 
extern gint     client_compare_priority(const Client *, const Client *);
85
 
extern gchar    **client_get_command(const Client *, const gchar *);
86
 
extern gboolean client_run_command(const Client *, const gchar *, GError **);
87
 
 
88
 
extern void     client_kill(const Client *);
89
 
 
90
 
#define client_get_id(client)           (g_strdup(CLIENT((client))->id))
91
 
#define client_get_hostname(client)     (g_strdup(CLIENT((client))->hostname))
92
 
 
93
 
#define client_state(client)            (CLIENT((client))->state)
94
 
 
95
 
#endif  /* !__XFSM_CLIENT_H__ */