2
* Copyright 2013 Canonical Ltd.
5
* Charles Kerr <charles.kerr@canonical.com>
7
* This program is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU General Public License version 3, as published
9
* by the Free Software Foundation.
11
* This program is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranties of
13
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License along
17
* with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include "backend-dbus.h"
26
struct dbus_world_data
28
GCancellable * cancellable;
29
IndicatorSessionActionsDbus * actions;
30
IndicatorSessionUsersDbus * users;
31
IndicatorSessionGuestDbus * guest;
35
on_proxies_ready (Login1Manager * login1_manager,
36
Login1Seat * login1_seat,
37
DisplayManagerSeat * display_manager_seat,
38
Accounts * account_manager,
39
GCancellable * cancellable,
42
struct dbus_world_data * data = gdata;
44
if (!g_cancellable_is_cancelled (cancellable))
46
if (data->actions != NULL)
47
indicator_session_actions_dbus_set_proxies (data->actions,
50
display_manager_seat);
52
if (data->users != NULL)
53
indicator_session_users_dbus_set_proxies (data->users,
59
if (data->guest != NULL)
60
indicator_session_guest_dbus_set_proxies (data->guest,
63
display_manager_seat);
74
backend_get (GCancellable * cancellable,
75
IndicatorSessionActions ** setme_actions,
76
IndicatorSessionUsers ** setme_users,
77
IndicatorSessionGuest ** setme_guest)
79
struct dbus_world_data * data;
81
data = g_new0 (struct dbus_world_data, 1);
83
if (setme_actions != NULL)
85
IndicatorSessionActions * actions;
86
actions = indicator_session_actions_dbus_new ();
87
data->actions = INDICATOR_SESSION_ACTIONS_DBUS (actions);
89
*setme_actions = actions;
92
if (setme_users != NULL)
94
IndicatorSessionUsers * users;
95
users = indicator_session_users_dbus_new ();
96
data->users = INDICATOR_SESSION_USERS_DBUS (users);
101
if (setme_guest != NULL)
103
IndicatorSessionGuest * guest;
104
guest = indicator_session_guest_dbus_new ();
105
data->guest = INDICATOR_SESSION_GUEST_DBUS (guest);
107
*setme_guest = guest;
110
data->cancellable = g_object_ref (cancellable);
112
indicator_session_util_get_session_proxies (on_proxies_ready,