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 DISPLAY_SERVER_H_
13 #define DISPLAY_SERVER_H_
14 
15 #include <glib-object.h>
16 
17 typedef struct DisplayServer DisplayServer;
18 
19 #include "logger.h"
20 #include "session.h"
21 
22 G_BEGIN_DECLS
23 
24 #define DISPLAY_SERVER_TYPE (display_server_get_type())
25 #define DISPLAY_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DISPLAY_SERVER_TYPE, DisplayServer))
26 #define DISPLAY_SERVER_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), DISPLAY_SERVER_TYPE, DisplayServerClass))
27 #define DISPLAY_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DISPLAY_SERVER_TYPE, DisplayServerClass))
28 
29 #define DISPLAY_SERVER_SIGNAL_READY   "ready"
30 #define DISPLAY_SERVER_SIGNAL_STOPPED "stopped"
31 
32 struct DisplayServer
33 {
34     GObject parent_instance;
35 };
36 
37 typedef struct
38 {
39     GObjectClass parent_class;
40 
41     void (*ready)(DisplayServer *server);
42     void (*stopped)(DisplayServer *server);
43 
44     DisplayServer *(*get_parent)(DisplayServer *server);
45     const gchar *(*get_session_type)(DisplayServer *server);
46     gboolean (*get_can_share)(DisplayServer *server);
47     gint (*get_vt)(DisplayServer *server);
48     gboolean (*start)(DisplayServer *server);
49     void (*connect_session)(DisplayServer *server, Session *session);
50     void (*disconnect_session)(DisplayServer *server, Session *session);
51     void (*stop)(DisplayServer *server);
52 } DisplayServerClass;
53 
54 GType display_server_get_type (void);
55 
56 const gchar *display_server_get_session_type (DisplayServer *server);
57 
58 DisplayServer *display_server_get_parent (DisplayServer *server);
59 
60 gboolean display_server_get_can_share (DisplayServer *server);
61 
62 gint display_server_get_vt (DisplayServer *server);
63 
64 gboolean display_server_start (DisplayServer *server);
65 
66 gboolean display_server_get_is_ready (DisplayServer *server);
67 
68 void display_server_connect_session (DisplayServer *server, Session *session);
69 
70 void display_server_disconnect_session (DisplayServer *server, Session *session);
71 
72 void display_server_stop (DisplayServer *server);
73 
74 gboolean display_server_get_is_stopping (DisplayServer *server);
75 
76 G_END_DECLS
77 
78 #endif /* DISPLAY_SERVER_H_ */
79