Commit graph

27 commits

Author SHA1 Message Date
Patrick Ohly
4ba42082fa gdbus: avoid name conflict with glib
The previous solution of linking Bluex gdbus statically was not
enough. On Fedora 14, compile errors due to the glib header files
being pulled in indirectly appeared.

This patch does a global search/replace which changes the
"gdbus" (GLib D-Bus) prefix into "bdbus" (Bluez D-Bus). For the
record:
perl -pi 's/g_dbus_/b_dbus_/g; s/GDBus/BDBus/g; s/GDBUS/BDBUS/g' ...
2010-08-09 10:46:03 -04:00
Zhu, Yongsheng
283e6ba46c gdbus: add interface-level callback function
A new function pointer 'callback' is added in the InterfaceData.
The callback function is per-interface. It is set together
with the registration of interface. It provides a mechanism to let
gdbus users do something before the registered methods are called.
It must be called *before* any method of an interface is called if set.
The reason is that the method might un-register the interface so
InterfaceData and its user data might be destroyed.
The user data transferred to the callback function is the 'user_data'
member in the InterfaceData set by users of gdbus.
The main purpose of this callback is that it is wanted to track
whether the dbus server is still in use.
2010-01-26 15:21:05 +08:00
Patrick Ohly
950fa6857e gdbus: allow using private connection
This change was necessary because it turned out that using
g_dbus_setup_bus() and later dbus_g_bus_get() leads to problems
(assertion about watch data on Moblin 2.1, CRITICAL warning
and possibly other issues on Debian Lenny).

It seems that sharing a DBusConnection between different layers on top
of libdbus is either not supported or incorrectly implemented, at
least in glib-dbus.

The problem was found in SyncEvolution when using a libecal/ebook
which call D-Bus under the hood (Moblin Bugzilla #8460). SyncEvolution
has no control over those calls, therefore making the connection used
by the syncevo-dbus-server private was the easier alternative.
2009-12-04 12:47:47 +01:00
Chen Congwu
aaa6fc915d gdbus: fix a compile error
Need to include stdint for uint
2009-11-16 23:09:24 +01:00
Patrick Ohly
92a1dd2f39 gdbus: per-method callback data
The traditional usage of method callbacks is that all callbacks
share the same global data pointer. When composing a D-Bus object
from several independent modules this may be too limited, for
example when using C++.

This patch introduces G_DBUS_METHOD_FLAG_METHOD_DATA and new
fields at the end of GDBusMethodTable. Old code works as before.
New code which sets the flag is passed the new "method_data"
value as its "user_data" pointer.

This implies that the GDBusMethodTable has to be built up dynamically.
It is still owned and managed by the caller of libgdbus. To
simplify this, a new "destroy" callback can be stored inside the
GDBusMethodTable.
2009-10-14 12:28:01 +02:00
Patrick Ohly
d413d1d425 gdbus: add _NONE = 0 enum value for C++
In C++, 0 is not automatically casted into an enum. This patch
adds enum names for the empty bit field, which makes C++ code
using gdbus a bit easier to read.
2009-10-14 12:28:01 +02:00
Marcel Holtmann
55a400b646 Extended GDBusWatchFunction parameter list
libgdbus commit ID:
0ed91c956fb6cf3d94eac17e778c63d5867bcb96
2009-10-07 16:07:49 +02:00
Marcel Holtmann
a8eff07719 Convert all documentation to gtk-doc style
libgdbus commit ID:
a6267460b97efd0ec421e42b88b9ca81a5c9baeb
2009-10-07 16:07:49 +02:00
Marcel Holtmann
8d86a083c2 Add watch helper for receiving signals
libgdbus commit ID:
944ca9edbf23fd8d1b5eef4125f18bf26d7257dd
2009-10-07 16:07:48 +02:00
Marcel Holtmann
cf5698f3e7 Use automatic object registration only
libgdbus commit ID:
b0b19a4da72972887580597aadb0b4c86e64134a
2009-10-07 16:07:48 +02:00
Marcel Holtmann
47809b8836 Use common GDBusWatchFunction prototype
libgdbus commit ID:
6605699e3a1ff8275dcc359da7aa73e9d36996f2
2009-10-07 16:07:48 +02:00
Marcel Holtmann
0031027d25 Remove return parameter from disconnect watch callback
libgdbus commit ID:
3dff292ec3e3f9a614e23c8801bccd76e8a052b3
2009-10-07 16:07:48 +02:00
Marcel Holtmann
bd0305aff4 Add more flexible error handling helpers
libgdbus commit ID:
475a7f3b15bc2446f76383e81ed1621ecd6b47e5
2009-10-07 16:07:48 +02:00
Marcel Holtmann
d860fdbec2 Add support for per interface user data
libgdbus commit ID:
5aa0ef05fd3bedef99e1a95ede14e29593cddcdc
2009-10-07 16:07:48 +02:00
Marcel Holtmann
81a28ef5af Add helper functions for creating errors and replies
libgdbus commit ID:
67e0538719f9509ac14843195515e93202f278fe
2009-10-07 16:07:47 +02:00
Marcel Holtmann
2af84d7bbf Add helper functions for sending errors and replies
libgdbus commit ID:
354a36005f34dfab3c23f6a26270e5e266f92475
2009-10-07 16:07:47 +02:00
Marcel Holtmann
8f16323bfb Update copyright information
libgdbus commit ID:
b0972117a2588631286c677791652b924eaa42ac
2009-10-07 16:07:47 +02:00
Marcel Holtmann
12b610ed5e Add error parameter to setup functions
libgdbus commit ID:
159897795a8ec83a03dd2370e2dd800d89d73ddb
2009-10-07 16:07:46 +02:00
Marcel Holtmann
264d47f595 Add annotation for asynchronous methods
libgdbus commit ID:
7fd09a4ca7a95027ff4b877e82049b6f913c1e78
2009-10-07 16:07:46 +02:00
Marcel Holtmann
11ab7f4e03 Add function for requesting additional bus names
libgdbus commit ID:
bbd311b2e965c5544980c5f27bd6c4174c0df051
2009-10-07 16:07:46 +02:00
Marcel Holtmann
a9041ca056 Fix naming of object flags
libgdbus commit ID:
69b72cb3af989e75476429fd7b158ea974719fb4
2009-10-07 16:07:46 +02:00
Marcel Holtmann
d16b517c64 Add function for connecting to specific bus addresses
libgdbus commit ID:
750826d3f5250109e8d957f90ed12d1e46e6eda4
2009-10-07 16:07:45 +02:00
Marcel Holtmann
fc87c0a3d8 Add documentation groups
libgdbus commit ID:
2a683c3f4ada8ea764b2cfe6a8ef990f09d427ca
2009-10-07 16:07:45 +02:00
Marcel Holtmann
a364154166 Add skeleton for message bus disconnect handling
libgdbus commit ID:
71ce7e87fd6edca83cb71c7cf3a856ca8256b24f
2009-10-07 16:07:45 +02:00
Marcel Holtmann
f9e35a2210 Add functions for client monitoring
libgdbus commit ID:
87bf27429d803f757966e4bc58d47d2d96018362
2009-10-07 16:07:45 +02:00
Marcel Holtmann
8d295519f6 Add functions for object and interface handling
libgdbus commit ID:
476c473f7ff4f058d7958da8e03bf232361e20e0
2009-10-07 16:07:44 +02:00
Marcel Holtmann
44159a2b73 Add functions for mainloop integration
libgdbus commit ID:
aec7a31d878508d5c1c99ada0fb7f32c7ba1a899
2009-10-07 16:07:44 +02:00