2009-08-01 19:51:07 +03:00
|
|
|
/* -*- Mode: C ; c-basic-offset: 2 -*- */
|
2008-09-07 01:48:05 +03:00
|
|
|
/*
|
2009-08-01 19:51:07 +03:00
|
|
|
* LADI Session Handler (ladish)
|
2008-09-07 01:48:05 +03:00
|
|
|
*
|
2010-03-07 13:42:44 +02:00
|
|
|
* Copyright (C) 2008, 2009, 2010 Nedko Arnaudov <nedko@arnaudov.name>
|
2009-08-01 19:51:07 +03:00
|
|
|
* Copyright (C) 2008 Juuso Alasuutari <juuso.alasuutari@gmail.com>
|
2008-09-07 01:48:05 +03:00
|
|
|
*
|
2009-08-01 19:51:07 +03:00
|
|
|
**************************************************************************
|
|
|
|
* This file contains interface to D-Bus signal helpers
|
|
|
|
**************************************************************************
|
2008-09-07 01:48:05 +03:00
|
|
|
*
|
2009-09-05 00:11:33 +03:00
|
|
|
* Licensed under the Academic Free License version 2.1
|
|
|
|
*
|
2009-08-01 19:51:07 +03:00
|
|
|
* LADI Session Handler is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
2008-09-07 01:48:05 +03:00
|
|
|
*
|
2009-08-01 19:51:07 +03:00
|
|
|
* LADI Session Handler is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with LADI Session Handler. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
* or write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
2008-09-07 01:48:05 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LASH_DBUS_SIGNAL_H__
|
|
|
|
#define __LASH_DBUS_SIGNAL_H__
|
|
|
|
|
2009-09-05 18:18:07 +03:00
|
|
|
struct dbus_signal_arg_descriptor
|
2008-09-07 01:48:05 +03:00
|
|
|
{
|
2009-09-05 18:18:07 +03:00
|
|
|
const char * name;
|
|
|
|
const char * type;
|
2008-09-07 01:48:05 +03:00
|
|
|
};
|
|
|
|
|
2009-09-05 18:18:07 +03:00
|
|
|
struct dbus_signal_descriptor
|
2008-09-07 01:48:05 +03:00
|
|
|
{
|
2009-09-05 18:18:07 +03:00
|
|
|
const char * name;
|
|
|
|
const struct dbus_signal_arg_descriptor * args;
|
2008-09-07 01:48:05 +03:00
|
|
|
};
|
|
|
|
|
2010-03-07 13:42:44 +02:00
|
|
|
void dbus_signal_send(DBusConnection * connection_ptr, DBusMessage * message_ptr);
|
|
|
|
|
2008-09-07 01:48:05 +03:00
|
|
|
void
|
2009-09-05 19:12:53 +03:00
|
|
|
dbus_signal_emit(
|
2009-08-01 19:24:00 +03:00
|
|
|
DBusConnection * connection_ptr,
|
|
|
|
const char * path,
|
|
|
|
const char * interface,
|
|
|
|
const char * name,
|
2009-09-05 19:12:53 +03:00
|
|
|
const char * signature,
|
2009-08-01 19:24:00 +03:00
|
|
|
...);
|
2008-09-07 01:48:05 +03:00
|
|
|
|
2009-09-05 18:18:07 +03:00
|
|
|
#define SIGNAL_ARGS_BEGIN(signal_name, descr) \
|
|
|
|
static const struct dbus_signal_arg_descriptor signal_name ## _args_dtor[] = \
|
2008-09-07 01:48:05 +03:00
|
|
|
{
|
|
|
|
|
2009-08-09 19:23:04 +03:00
|
|
|
#define SIGNAL_ARG_DESCRIBE(arg_name, arg_type, descr) \
|
2008-09-07 01:48:05 +03:00
|
|
|
{ \
|
|
|
|
.name = arg_name, \
|
|
|
|
.type = arg_type \
|
|
|
|
},
|
|
|
|
|
|
|
|
#define SIGNAL_ARGS_END \
|
|
|
|
{ \
|
|
|
|
.name = NULL, \
|
|
|
|
.type = NULL \
|
|
|
|
} \
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SIGNALS_BEGIN \
|
2009-09-05 18:18:07 +03:00
|
|
|
static const struct dbus_signal_descriptor signals_dtor[] = \
|
2008-09-07 01:48:05 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
#define SIGNAL_DESCRIBE(signal_name) \
|
|
|
|
{ \
|
|
|
|
.name = # signal_name, \
|
|
|
|
.args = signal_name ## _args_dtor \
|
|
|
|
},
|
|
|
|
|
|
|
|
#define SIGNALS_END \
|
|
|
|
{ \
|
|
|
|
.name = NULL, \
|
|
|
|
.args = NULL \
|
|
|
|
} \
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __LASH_DBUS_SIGNAL_H__ */
|