1 /*
2  * Copyright (C) 2010-2011 Robert Ancell.
3  * Author: Robert Ancell <robert.ancell@canonical.com>
4  *
5  * This program is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU General Public License as published by the Free Software
7  * Foundation, either version 3 of the License, or (at your option) any later
8  * version. See http://www.gnu.org/copyleft/gpl.html the full text of the
9  * license.
10  */
11 
12 #ifndef X_SERVER_H_
13 #define X_SERVER_H_
14 
15 #include <glib-object.h>
16 #include "display-server.h"
17 #include "x-authority.h"
18 
19 G_BEGIN_DECLS
20 
21 #define X_SERVER_TYPE (x_server_get_type())
22 #define X_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), X_SERVER_TYPE, XServer))
23 #define X_SERVER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), X_SERVER_TYPE, XServerClass))
24 #define X_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), X_SERVER_TYPE, XServerClass))
25 #define IS_X_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), X_SERVER_TYPE))
26 
27 typedef struct
28 {
29     DisplayServer parent_instance;
30 } XServer;
31 
32 typedef struct
33 {
34     DisplayServerClass parent_class;
35     guint (*get_display_number) (XServer *server);
36 } XServerClass;
37 
38 G_DEFINE_AUTOPTR_CLEANUP_FUNC (XServer, g_object_unref)
39 
40 GType x_server_get_type (void);
41 
42 void x_server_set_hostname (XServer *server, const gchar *hostname);
43 
44 gchar *x_server_get_hostname (XServer *server);
45 
46 guint x_server_get_display_number (XServer *server);
47 
48 const gchar *x_server_get_address (XServer *server);
49 
50 const gchar *x_server_get_authentication_name (XServer *server);
51 
52 const guint8 *x_server_get_authentication_data (XServer *server);
53 
54 gsize x_server_get_authentication_data_length (XServer *server);
55 
56 void x_server_set_authority (XServer *server, XAuthority *authority);
57 
58 XAuthority *x_server_get_authority (XServer *server);
59 
60 G_END_DECLS
61 
62 #endif /* X_SERVER_H_ */
63