]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - tests/src/x-server.h
Refactored code to replace hardcoded signal identification strings by constants.
[sojka/lightdm.git] / tests / src / x-server.h
1 #ifndef X_SERVER_H_
2 #define X_SERVER_H_
3
4 #include <glib-object.h>
5 #include <gio/gio.h>
6
7 G_BEGIN_DECLS
8
9 #define X_CLIENT_SIGNAL_DISCONNECTED "disconnected"
10
11 #define X_SERVER_SIGNAL_CLIENT_CONNECTED    "client-connected"
12 #define X_SERVER_SIGNAL_CLIENT_DISCONNECTED "client-disconnected"
13
14 typedef struct XClientPrivate XClientPrivate;
15
16 typedef struct
17 {
18    GObject         parent_instance;
19    XClientPrivate *priv;
20 } XClient;
21
22 typedef struct
23 {
24    GObjectClass parent_class;
25    void (*disconnected)(XClient *client);
26 } XClientClass;
27
28 typedef struct XServerPrivate XServerPrivate;
29
30 typedef struct
31 {
32    GObject         parent_instance;
33    XServerPrivate *priv;
34 } XServer;
35
36 typedef struct
37 {
38    GObjectClass parent_class;
39    void (*client_connected)(XServer *server, XClient *client);
40    void (*client_disconnected)(XServer *server, XClient *client);
41 } XServerClass;
42
43 GType x_server_get_type (void);
44
45 XServer *x_server_new (gint display_number);
46
47 gboolean x_server_start (XServer *server);
48
49 gsize x_server_get_n_clients (XServer *server);
50
51 GType x_client_get_type (void);
52
53 void x_client_send_failed (XClient *client, const gchar *reason);
54
55 void x_client_send_success (XClient *client);
56
57 void x_client_send_error (XClient *client, int type, int major, int minor);
58
59 void x_client_disconnect (XClient *client);
60
61 G_END_DECLS
62
63 #endif /* X_SERVER_H_ */