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-screen-saver.h"
24
MockScreenSaver :: handle_lock (GnomeScreenSaver * ss,
25
GDBusMethodInvocation * inv,
28
static_cast<MockScreenSaver*>(gself)->my_last_action = Lock;
29
gnome_screen_saver_complete_lock (ss, inv);
34
MockScreenSaver :: handle_simulate_user_activity (GnomeScreenSaver * ss,
35
GDBusMethodInvocation * inv,
38
static_cast<MockScreenSaver*>(gself)->my_last_action = UserActivity;
39
gnome_screen_saver_complete_simulate_user_activity (ss, inv);
49
const char * const SCREENSAVER_NAME = "org.gnome.ScreenSaver";
50
const char * const SCREENSAVER_PATH = "/org/gnome/ScreenSaver";
54
MockScreenSaver :: MockScreenSaver (GMainLoop * loop,
55
GDBusConnection * bus_connection):
56
MockObject (loop, bus_connection, SCREENSAVER_NAME, SCREENSAVER_PATH),
57
my_skeleton (gnome_screen_saver_skeleton_new ()),
60
g_signal_connect (my_skeleton, "handle-lock",
61
G_CALLBACK(handle_lock), this);
62
g_signal_connect (my_skeleton, "handle-simulate-user-activity",
63
G_CALLBACK(handle_simulate_user_activity), this);
65
set_skeleton (G_DBUS_INTERFACE_SKELETON(my_skeleton));
68
MockScreenSaver :: ~MockScreenSaver ()
70
g_clear_object (&my_skeleton);