summaryrefslogtreecommitdiff
path: root/legacy/edbus/src/lib/EDBus.h
blob: 46d065434b7d99420c075ec7391823f708a31d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
/**
 * @mainpage EDBus
 *
 * @section edbus_intro_sec Introduction
 *
 * EDBus is a wrapper around the
 * <a href="http://www.freedesktop.org/wiki/Software/dbus">dbus</a>
 * library, which is a message bus system. It also implements a set of
 * specifications using dbus as interprocess communication.
 *
 * @section edbus_modules_sec Modules
 *
 * <ul>
 * <li> @ref EDBus_Core
 * <li> @ref EDBus_Conneciton
 * <li> @ref EDBus_Object_Mapper
 * <li> @ref EDBus_Proxy
 * <li> @ref EDBus_Message
 *      <ul>
 *              <li>@ref EDBus_Message_Iter
 *              <li>@ref EDBus_Message_Helpers
 *              <li>@ref Eina_Value
 *      </ul>
 * <li> @ref EDBus_Signal_Handler
 * <li> @ref EDBus_Pending
 * <li> @ref EDBus_Service
 * <li> @ref EDBus_Basic
 * </ul>
 *
 * @section edbus_examples_sec Examples
 *
 * Here some EDBus examples:
 *
 * @li @ref banshee
 * @li @ref simple_dbus_client
 * @li @ref simple_dbus_server
 * @li @ref complex_types
 * @li @ref complex_types_server
 * @li @ref eina_value
 * @li @ref signal_emmiter
 * @li @ref connman
 * @li @ref ofono
 *
 * @author Gustavo Sverzut Barbieri <barbieri@profusion.mobi>
 * @author José Roberto de Souza <zehortigoza@profusion.mobi>
 * @author Leandro Pereira <leandro@profusion.mobi>
 * @author Lucas De Marchi <lucas.demarchi@profusion.mobi>
 */
#ifndef EDBUS_H
#define EDBUS_H

#include <Eina.h>
#include <stdarg.h>

#ifdef EAPI
# undef EAPI
#endif

#ifdef _WIN32
# ifdef EFL_EDBUS_BUILD
#  ifdef DLL_EXPORT
#   define EAPI __declspec(dllexport)
#  else
#   define EAPI
#  endif /* ! DLL_EXPORT */
# else
#  define EAPI __declspec(dllimport)
# endif /* ! EFL_EDBUS_BUILD */
#else
# ifdef __GNUC__
#  if __GNUC__ >= 4
#   define EAPI __attribute__ ((visibility("default")))
#  else
#   define EAPI
#  endif
# else
#  define EAPI
# endif
#endif

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @defgroup EDBus_Core Core
 *
 * @{
 */
#define EDBUS_VERSION_MAJOR 1
#define EDBUS_VERSION_MINOR 6

#define EDBUS_FDO_BUS "org.freedesktop.DBus"
#define EDBUS_FDO_PATH "/org/freedesktop/DBus"
#define EDBUS_FDO_INTERFACE EDBUS_FDO_BUS
#define EDBUS_FDO_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
#define EDBUS_FDO_INTERFACE_OBJECT_MANAGER "org.freedesktop.DBus.ObjectManager"
#define EDBUS_FDO_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
#define EDBUS_FDO_INTEFACE_PEER "org.freedesktop.DBus.Peer"

typedef struct _EDBus_Version
{
   int major;
   int minor;
   int micro;
   int revision;
} EDBus_Version;

EAPI extern const EDBus_Version * edbus_version;

/**
 * @brief Initialize edbus.
 *
 * @return 1 or greater on success, 0 otherwise
 */
EAPI int edbus_init(void);
/**
 * @brief Shutdown edbus.
 *
 * @return 0 if e_dbus shuts down, greater than 0 otherwise.
 */
EAPI int edbus_shutdown(void);

typedef void                       (*EDBus_Free_Cb)(void *data, const void *deadptr);

/**
 * @typedef EDBus_Connection
 *
 * Represents a connection of one the type of connection with the DBus daemon.
 */
typedef struct _EDBus_Connection     EDBus_Connection;
/**
 * @typedef EDBus_Object
 *
 * Represents an object path already attached with bus name or unique id.
 */
typedef struct _EDBus_Object         EDBus_Object;
/**
 * @typedef EDBus_Proxy
 *
 * Represents an interface of an object path.
 */
typedef struct _EDBus_Proxy          EDBus_Proxy;
/**
 * @typedef EDBus_Message
 *
 * Represents the way data is sent and received in DBus.
 */
typedef struct _EDBus_Message        EDBus_Message;
/**
 * @typedef EDBus_Message_Iter
 *
 * Represents an iterator over a complex message type (array, dict, struct,
 * or variant). Its life is bound to the message that contains
 * it. The same applies to the returned data.
 */
typedef struct _EDBus_Message_Iter EDBus_Message_Iter;
/**
 * @typedef EDBus_Pending
 *
 * Represents a message that has been sent but has not yet reached its
 * destination.
 */
typedef struct _EDBus_Pending        EDBus_Pending;

/**
 * @typedef EDBus_Signal_Handler
 *
 * Represents a listener that will listen for signals emitted by other
 * applications.
 */
typedef struct _EDBus_Signal_Handler EDBus_Signal_Handler;

typedef void (*EDBus_Message_Cb)(void *data, const EDBus_Message *msg, EDBus_Pending *pending);
typedef void (*EDBus_Signal_Cb)(void *data, const EDBus_Message *msg);
/**
 * @}
 */

#include "edbus_connection.h"
#include "edbus_message.h"
#include "edbus_signal_handler.h"
#include "edbus_pending.h"
#include "edbus_object.h"
#include "edbus_proxy.h"
#include "edbus_freedesktop.h"
#include "edbus_service.h"

#ifdef __cplusplus
}
#endif

#endif