]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - tests/src/x-server.h
5f5b4728218c511583cc7bc43676166bfce1d4e7
[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 typedef struct XClientPrivate XClientPrivate;
10
11 typedef struct
12 {
13    GObject         parent_instance;
14    XClientPrivate *priv;
15 } XClient;
16
17 typedef struct
18 {
19    GObjectClass parent_class;
20    void (*disconnected)(XClient *client);
21 } XClientClass;
22
23 typedef struct XServerPrivate XServerPrivate;
24
25 typedef struct
26 {
27    GObject         parent_instance;
28    XServerPrivate *priv;
29 } XServer;
30
31 typedef struct
32 {
33    GObjectClass parent_class;
34    void (*client_connected)(XServer *server, XClient *client);
35    void (*client_disconnected)(XServer *server, XClient *client);
36 } XServerClass;
37
38 GType x_server_get_type (void);
39
40 XServer *x_server_new (gint display_number);
41
42 gboolean x_server_start (XServer *server);
43
44 gsize x_server_get_n_clients (XServer *server);
45
46 GType x_client_get_type (void);
47
48 void x_client_send_failed (XClient *client, const gchar *reason);
49
50 void x_client_send_success (XClient *client);
51
52 void x_client_send_error (XClient *client, int type, int major, int minor);
53
54 void x_client_disconnect (XClient *client);
55
56 G_END_DECLS
57
58 #endif /* X_SERVER_H_ */