2
* Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd.
5
* Kobe Lee kobe24_lixiang@126.com
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#ifndef __LISTEN_DBUS_H__
21
#define __LISTEN_DBUS_H__
23
#include <glib-object.h>
25
#include <dbus/dbus-glib.h>
26
#include <dbus/dbus-glib-lowlevel.h>
37
#define LISTEN_DBUS_NAME "com.jd.test"
38
#define LISTEN_DBUS_PATH "/com/jd/test"
39
#define LISTEN_DBUS_INTERFACE "com.jd.monitor.test"
40
#define LISTEN_DBUS_ACTION_ID "com.jd.monitor.authentication"
41
#define LISTEN_TYPE_DBUS (monitor_dbus_get_type())
43
#define LISTEN_DBUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), LISTEN_TYPE_DBUS, MonitorDbus))
44
#define LISTEN_DBUS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), LISTEN_TYPE_DBUS, MonitorDbusClass))
45
#define LISTEN_IS_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), LISTEN_TYPE_DBUS))
46
#define LISTEN_IS_DBUS_CLASS(k) (G_TYPE_CHECK_CLASS_TPYE((k), LISTEN_TYPE_DBUS))
47
#define LISTEN_DBUS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), LISTEN_TYPE_DBUS, MonitorClass))
49
typedef struct _MonitorDbusPrivate MonitorDbusPrivate;
50
typedef struct _MonitorDbus MonitorDbus;
51
typedef struct _MonitorDbusClass MonitorDbusClass;
52
typedef struct _MonitorWarnDbusClass MonitorWarnDbusClass;
56
MonitorDbusPrivate *priv;
59
struct _MonitorDbusClass {
60
GObjectClass parent_class;
61
void (*event)(MonitorDbus* dbus, guint type, GValue * value);
65
struct _MonitorWarnDbusClass {
66
GObjectClass parent_class;
67
void (*event)(MonitorDbus* dbus, guint tag ,guint type, guint subtype);
71
GType monitor_dbus_get_type(void);
72
MonitorDbus * monitor_dbus_new(void);
73
gint monitor_dbus_call_monitor_method(MonitorDbus * dbus,GValueArray * method_value ,DBusGMethodInvocation * ret_value);
74
gint monitor_dbus_intropect(MonitorDbus * dbus,const char* devicename,DBusGMethodInvocation * ret_value);
75
#define DBUS_STRUCT_INT_INT_STRING (dbus_g_type_get_struct("GValueArray", G_TYPE_INT, G_TYPE_INT, G_TYPE_STRING))
82
void signal_handler();