implement view switching from world tree
[ladish.git] / dbus / helpers.h
blobf99fb51b32b8371369cadd531b546ec878486963
1 /* -*- Mode: C ; c-basic-offset: 2 -*- */
2 /*
3 * LADI Session Handler (ladish)
5 * Copyright (C) 2008, 2009 Nedko Arnaudov <nedko@arnaudov.name>
6 * Copyright (C) 2008 Juuso Alasuutari <juuso.alasuutari@gmail.com>
8 **************************************************************************
9 * This file contains interface to the D-Bus helpers code
10 **************************************************************************
12 * LADI Session Handler is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * LADI Session Handler is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
24 * or write to the Free Software Foundation, Inc.,
25 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
28 #ifndef HELPERS_H__6C2107A6_A5E3_4806_869B_4BE609535BA2__INCLUDED
29 #define HELPERS_H__6C2107A6_A5E3_4806_869B_4BE609535BA2__INCLUDED
31 #include <dbus/dbus.h>
33 extern DBusConnection * g_dbus_connection;
34 extern DBusError g_dbus_error;
36 bool dbus_maybe_add_dict_entry_string(DBusMessageIter *dict_iter_ptr, const char * key, const char * value);
37 bool dbus_add_dict_entry_uint32(DBusMessageIter * dict_iter_ptr, const char * key, dbus_uint32_t value);
38 bool dbus_add_dict_entry_bool(DBusMessageIter * dict_iter_ptr, const char * key, dbus_bool_t value);
40 bool dbus_call_simple(const char * service, const char * object, const char * iface, const char * method, char * input_signature, ...);
42 bool
43 dbus_register_object_signal_handler(
44 DBusConnection * connection,
45 const char * service,
46 const char * object,
47 const char * iface,
48 const char * const * signals,
49 DBusHandleMessageFunction handler,
50 void * handler_data);
52 bool
53 dbus_unregister_object_signal_handler(
54 DBusConnection * connection,
55 const char * service,
56 const char * object,
57 const char * iface,
58 const char * const * signals,
59 DBusHandleMessageFunction handler,
60 void * handler_data);
62 #define DBUS_CALL_DEFAULT_TIMEOUT 1000 // in milliseconds
64 #endif /* #ifndef HELPERS_H__6C2107A6_A5E3_4806_869B_4BE609535BA2__INCLUDED */