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/>.
20
#include "mock-session-manager.h"
23
MockSessionManager :: handle_logout (GnomeSessionManager * gsm,
24
GDBusMethodInvocation * inv,
30
case 0: action = LogoutNormal; break;
31
case 1: action = LogoutQuiet; break;
32
case 2: action = LogoutForce; break;
33
default: action = None; break;
35
static_cast<MockSessionManager*>(gself)->my_last_action = action;
36
gnome_session_manager_complete_logout (gsm, inv);
46
const char * const SESSION_MANAGER_NAME = "org.gnome.SessionManager";
47
const char * const SESSION_MANAGER_PATH = "/org/gnome/SessionManager";
51
MockSessionManager :: MockSessionManager (GMainLoop * loop,
52
GDBusConnection * bus_connection):
53
MockObject (loop, bus_connection, SESSION_MANAGER_NAME, SESSION_MANAGER_PATH),
54
my_skeleton (gnome_session_manager_skeleton_new ()),
57
g_signal_connect (my_skeleton, "handle-logout",
58
G_CALLBACK(handle_logout), this);
60
set_skeleton (G_DBUS_INTERFACE_SKELETON(my_skeleton));
63
MockSessionManager :: ~MockSessionManager ()
65
g_clear_object (&my_skeleton);