]> rtime.felk.cvut.cz Git - sojka/lightdm.git/blob - src/seat.h
Merge with trunk
[sojka/lightdm.git] / src / seat.h
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 SEAT_H_
13 #define SEAT_H_
14
15 #include <glib-object.h>
16 #include "display.h"
17 #include "process.h"
18
19 G_BEGIN_DECLS
20
21 #define SEAT_TYPE           (seat_get_type())
22 #define SEAT(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAT_TYPE, Seat))
23 #define SEAT_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), SEAT_TYPE, SeatClass))
24 #define SEAT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAT_TYPE, SeatClass))
25
26 typedef struct SeatPrivate SeatPrivate;
27
28 typedef struct
29 {
30     GObject         parent_instance;
31     SeatPrivate *priv;
32 } Seat;
33
34 typedef struct
35 {
36     GObjectClass parent_class;
37
38     void (*setup)(Seat *seat);    
39     gboolean (*start)(Seat *seat);
40     DisplayServer *(*create_display_server) (Seat *seat);
41     Session *(*create_session) (Seat *seat, Display *display);
42     void (*set_active_display)(Seat *seat, Display *display);
43     Display *(*get_active_display)(Seat *seat);
44     void (*run_script)(Seat *seat, Display *display, Process *script);
45     void (*stop)(Seat *seat);
46
47     void (*display_added)(Seat *seat, Display *display);
48     void (*display_removed)(Seat *seat, Display *display);
49     void (*stopped)(Seat *seat);
50 } SeatClass;
51
52 GType seat_get_type (void);
53
54 void seat_register_module (const gchar *name, GType type);
55
56 Seat *seat_new (const gchar *module_name);
57
58 void seat_set_property (Seat *seat, const gchar *name, const gchar *value);
59
60 gboolean seat_has_property (Seat *seat, const gchar *name);
61
62 const gchar *seat_get_string_property (Seat *seat, const gchar *name);
63
64 gboolean seat_get_boolean_property (Seat *seat, const gchar *name);
65
66 gint seat_get_integer_property (Seat *seat, const gchar *name);
67
68 void seat_set_can_switch (Seat *seat, gboolean can_switch);
69
70 void seat_set_share_display_server (Seat *seat, gboolean share_display_server);
71
72 gboolean seat_start (Seat *seat);
73
74 GList *seat_get_displays (Seat *seat);
75
76 void seat_set_active_display (Seat *seat, Display *display);
77
78 Display *seat_get_active_display (Seat *seat);
79
80 gboolean seat_get_can_switch (Seat *seat);
81
82 gboolean seat_get_allow_guest (Seat *seat);
83
84 gboolean seat_get_greeter_allow_guest (Seat *seat);
85
86 gboolean seat_switch_to_greeter (Seat *seat);
87
88 gboolean seat_switch_to_user (Seat *seat, const gchar *username, const gchar *session_name);
89
90 gboolean seat_switch_to_guest (Seat *seat, const gchar *session_name);
91
92 gboolean seat_lock (Seat *seat, const gchar *username);
93
94 void seat_stop (Seat *seat);
95
96 gboolean seat_get_is_stopping (Seat *seat);
97
98 G_END_DECLS
99
100 #endif /* SEAT_H_ */