* Included config.h in all headers
* Don't define DBUS_API_SUBJECT_TO_CHANGE unless for old D-Bus versions * Use recursive mutex functions if libdbus supports it * Specify the path when adding match rules, otherwise messages wouldn't be forwarded to the right object under some circumstances * Added integration with the glib main loop (configure with --enable-glib) * Added a gtkmm dbus-browser clone to demonstrate glib integration * Fixed a typo in dbusxx-xml2cpp proxy output * Added python usage instructions for the Echo example git-svn-id: http://dev.openwengo.org/svn/openwengo/wengophone-ng/branches/wengophone-dbus-api/libs/dbus@10948 30a43799-04e7-0310-8b2b-ea0d24f86d0e
This commit is contained in:
parent
771ca71556
commit
48a1be9f2a
37 changed files with 427 additions and 23 deletions
|
@ -1,8 +1,13 @@
|
|||
AM_CPPFLAGS = \
|
||||
$(dbus_CFLAGS) \
|
||||
$(xml_CFLAGS) \
|
||||
-I$(top_srcdir)/include \
|
||||
-DDBUS_API_SUBJECT_TO_CHANGE
|
||||
$(glib_CFLAGS) \
|
||||
-I$(top_srcdir)/include
|
||||
|
||||
if ENABLE_GLIB
|
||||
GLIB_H = $(HEADER_DIR)/glib-integration.h
|
||||
GLIB_CPP = glib-integration.cpp
|
||||
endif
|
||||
|
||||
HEADER_DIR = $(top_srcdir)/include/dbus-c++
|
||||
HEADER_FILES = \
|
||||
|
@ -24,14 +29,15 @@ HEADER_FILES = \
|
|||
$(HEADER_DIR)/util.h \
|
||||
$(HEADER_DIR)/refptr_impl.h \
|
||||
$(HEADER_DIR)/xml.h \
|
||||
$(HEADER_DIR)/introspection.h
|
||||
$(HEADER_DIR)/introspection.h \
|
||||
$(GLIB_H)
|
||||
|
||||
lib_includedir=$(includedir)/dbus-c++-1/dbus-c++/
|
||||
lib_include_HEADERS = $(HEADER_FILES)
|
||||
|
||||
lib_LTLIBRARIES = libdbus-c++-1.la
|
||||
libdbus_c___1_la_SOURCES = $(HEADER_FILES) interface.cpp object.cpp introspection.cpp debug.cpp eventloop.cpp xml.cpp types.cpp connection.cpp connection_p.h property.cpp dispatcher.cpp dispatcher_p.h pendingcall.cpp pendingcall_p.h error.cpp internalerror.h message.cpp message_p.h server.cpp server_p.h
|
||||
libdbus_c___1_la_LIBADD = $(dbus_LIBS) $(xml_LIBS)
|
||||
libdbus_c___1_la_SOURCES = $(HEADER_FILES) interface.cpp object.cpp introspection.cpp debug.cpp eventloop.cpp xml.cpp types.cpp connection.cpp connection_p.h property.cpp dispatcher.cpp dispatcher_p.h pendingcall.cpp pendingcall_p.h error.cpp internalerror.h message.cpp message_p.h server.cpp server_p.h $(GLIB_CPP)
|
||||
libdbus_c___1_la_LIBADD = $(dbus_LIBS) $(xml_LIBS) $(glib_LIBS)
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
Makefile.in
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#ifndef __DBUSXX_CONNECTION_P_H
|
||||
#define __DBUSXX_CONNECTION_P_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <dbus-c++/connection.h>
|
||||
#include <dbus-c++/server.h>
|
||||
#include <dbus-c++/dispatcher.h>
|
||||
|
|
|
@ -181,6 +181,7 @@ void DBus::_init_threading(
|
|||
CondVarWakeAllFn c6
|
||||
)
|
||||
{
|
||||
#ifndef DBUS_HAS_RECURSIVE_MUTEX
|
||||
DBusThreadFunctions functions = {
|
||||
DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK |
|
||||
|
@ -203,5 +204,30 @@ void DBus::_init_threading(
|
|||
(DBusCondVarWakeOneFunction) c5,
|
||||
(DBusCondVarWakeAllFunction) c6
|
||||
};
|
||||
#else
|
||||
DBusThreadFunctions functions = {
|
||||
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK |
|
||||
DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK|
|
||||
DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK,
|
||||
0, 0, 0, 0,
|
||||
(DBusCondVarNewFunction) c1,
|
||||
(DBusCondVarFreeFunction) c2,
|
||||
(DBusCondVarWaitFunction) c3,
|
||||
(DBusCondVarWaitTimeoutFunction) c4,
|
||||
(DBusCondVarWakeOneFunction) c5,
|
||||
(DBusCondVarWakeAllFunction) c6,
|
||||
(DBusRecursiveMutexNewFunction) m1,
|
||||
(DBusRecursiveMutexFreeFunction) m2,
|
||||
(DBusRecursiveMutexLockFunction) m3,
|
||||
(DBusRecursiveMutexUnlockFunction) m4
|
||||
};
|
||||
#endif//DBUS_HAS_RECURSIVE_MUTEX
|
||||
dbus_threads_init(&functions);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#ifndef __DBUSXX_DISPATCHER_P_H
|
||||
#define __DBUSXX_DISPATCHER_P_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <dbus-c++/dispatcher.h>
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#ifndef __DBUSXX_INTERNALERROR_H
|
||||
#define __DBUSXX_INTERNALERROR_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <dbus-c++/error.h>
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#ifndef __DBUSXX_MESSAGE_P_H
|
||||
#define __DBUSXX_MESSAGE_P_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <dbus-c++/message.h>
|
||||
#include <dbus-c++/refptr_impl.h>
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ void ObjectAdaptor::register_obj()
|
|||
InterfaceAdaptorTable::const_iterator ii = _interfaces.begin();
|
||||
while( ii != _interfaces.end() )
|
||||
{
|
||||
std::string im = "type='method_call',interface='"+ii->first+"'";
|
||||
std::string im = "type='method_call',interface='"+ii->first+"',path='"+path()+"'";
|
||||
conn().add_match(im.c_str());
|
||||
++ii;
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ void ObjectAdaptor::unregister_obj()
|
|||
InterfaceAdaptorTable::const_iterator ii = _interfaces.begin();
|
||||
while( ii != _interfaces.end() )
|
||||
{
|
||||
std::string im = "type='method_call',interface='"+ii->first+"'";
|
||||
std::string im = "type='method_call',interface='"+ii->first+"',path='"+path()+"'";
|
||||
conn().remove_match(im.c_str());
|
||||
++ii;
|
||||
}
|
||||
|
@ -290,13 +290,10 @@ void ObjectProxy::register_obj()
|
|||
InterfaceProxyTable::const_iterator ii = _interfaces.begin();
|
||||
while( ii != _interfaces.end() )
|
||||
{
|
||||
std::string im = "type='signal',interface='"+ii->first+"'";
|
||||
std::string im = "type='signal',interface='"+ii->first+"',path='"+path()+"'";
|
||||
conn().add_match(im.c_str());
|
||||
++ii;
|
||||
}
|
||||
|
||||
// conn().add_match("type='signal'");
|
||||
// conn().add_match("type='method_call'");
|
||||
}
|
||||
|
||||
void ObjectProxy::unregister_obj()
|
||||
|
@ -306,13 +303,10 @@ void ObjectProxy::unregister_obj()
|
|||
InterfaceProxyTable::const_iterator ii = _interfaces.begin();
|
||||
while( ii != _interfaces.end() )
|
||||
{
|
||||
std::string im = "type='signal',interface='"+ii->first+"'";
|
||||
std::string im = "type='signal',interface='"+ii->first+"',path='"+path()+"'";
|
||||
conn().remove_match(im.c_str());
|
||||
++ii;
|
||||
}
|
||||
// conn().remove_match("type='method_call'");
|
||||
// conn().remove_match("type='signal'");
|
||||
|
||||
conn().remove_filter(_filtered);
|
||||
}
|
||||
|
||||
|
@ -334,7 +328,8 @@ bool ObjectProxy::handle_message( const Message& msg )
|
|||
const char* interface = smsg.interface();
|
||||
const char* member = smsg.member();
|
||||
|
||||
debug_log("filtered signal %s(in %s) from remote object %s", member, interface, msg.sender());
|
||||
debug_log("filtered signal %s(in %s) from remote object %s",
|
||||
member, interface, msg.sender());
|
||||
|
||||
InterfaceProxy* ii = find_interface(interface);
|
||||
if( ii )
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#ifndef __DBUSXX_PENDING_CALL_P_H
|
||||
#define __DBUSXX_PENDING_CALL_P_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <dbus-c++/pendingcall.h>
|
||||
#include <dbus-c++/refptr_impl.h>
|
||||
|
||||
|
|
|
@ -25,6 +25,10 @@
|
|||
#ifndef __DBUSXX_SERVER_P_H
|
||||
#define __DBUSXX_SERVER_P_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <dbus-c++/server.h>
|
||||
#include <dbus-c++/dispatcher.h>
|
||||
#include <dbus-c++/refptr_impl.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue