~mimose/kydevmonit/test

« back to all changes in this revision

Viewing changes to dbuslayer/monitor_dbus.h

  • Committer: guoyalong
  • Date: 2017-09-05 05:53:02 UTC
  • Revision ID: guoyalong@kylinos.cn-20170905055302-guv8kqgq8hvscbdb
Modified the direction structure; Remove the segment fault caused by xmlFree API.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd.
3
 
 *
4
 
 * Authors:
5
 
 *  Kobe Lee   kobe24_lixiang@126.com
6
 
 *
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.
10
 
 *
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.
15
 
 *
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/>.
18
 
 */
19
 
 
20
 
#ifndef __LISTEN_DBUS_H__
21
 
#define __LISTEN_DBUS_H__
22
 
 
23
 
#include <glib-object.h>
24
 
#include <glib.h>
25
 
#include <dbus/dbus-glib.h>
26
 
#include <dbus/dbus-glib-lowlevel.h>
27
 
#include <gio/gio.h>
28
 
 
29
 
G_BEGIN_DECLS
30
 
 
31
 
 
32
 
enum {
33
 
    SIG_DATA_ALERT,
34
 
    SIG_LAST_SIGNAL,
35
 
};
36
 
 
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())
42
 
 
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))
48
 
 
49
 
typedef struct _MonitorDbusPrivate MonitorDbusPrivate;
50
 
typedef struct _MonitorDbus MonitorDbus;
51
 
typedef struct _MonitorDbusClass MonitorDbusClass;
52
 
typedef struct _MonitorWarnDbusClass MonitorWarnDbusClass;
53
 
 
54
 
struct _MonitorDbus {
55
 
    GObject parent;
56
 
    MonitorDbusPrivate *priv;
57
 
};
58
 
 
59
 
struct _MonitorDbusClass {
60
 
    GObjectClass parent_class;
61
 
    void (*event)(MonitorDbus* dbus, guint type, GValue * value);
62
 
 
63
 
};
64
 
 
65
 
struct _MonitorWarnDbusClass {
66
 
    GObjectClass parent_class;
67
 
    void (*event)(MonitorDbus* dbus, guint tag ,guint type, guint subtype);
68
 
 
69
 
};
70
 
 
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))
76
 
 
77
 
G_END_DECLS
78
 
 
79
 
int dbus_init(void);
80
 
 
81
 
 
82
 
void signal_handler();
83
 
#endif
84