* 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
62
examples/glib/dbus-browser.h
Normal file
62
examples/glib/dbus-browser.h
Normal file
|
@ -0,0 +1,62 @@
|
|||
#ifndef __DEMO_DBUS_BROWSER_H
|
||||
#define __DEMO_DBUS_BROWSER_H
|
||||
|
||||
#include <dbus-c++/dbus.h>
|
||||
#include <dbus-c++/glib-integration.h>
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "dbus-glue.h"
|
||||
|
||||
class DBusInspector
|
||||
: public DBus::IntrospectableProxy,
|
||||
public DBus::ObjectProxy
|
||||
{
|
||||
public:
|
||||
|
||||
DBusInspector( DBus::Connection& conn, const char* path, const char* service )
|
||||
: DBus::ObjectProxy(conn, path, service)
|
||||
{}
|
||||
};
|
||||
|
||||
class DBusBrowser
|
||||
: public org::freedesktop::DBus,
|
||||
public DBus::IntrospectableProxy,
|
||||
public DBus::ObjectProxy,
|
||||
public Gtk::Window
|
||||
{
|
||||
public:
|
||||
|
||||
DBusBrowser( ::DBus::Connection& );
|
||||
|
||||
private:
|
||||
|
||||
void NameOwnerChanged( const ::DBus::String&, const ::DBus::String&, const ::DBus::String& );
|
||||
|
||||
void NameLost( const ::DBus::String& );
|
||||
|
||||
void NameAcquired( const ::DBus::String& );
|
||||
|
||||
void on_select_busname();
|
||||
|
||||
void _inspect_append( Gtk::TreeModel::Row*, const std::string&, const std::string& );
|
||||
|
||||
private:
|
||||
|
||||
class InspectRecord : public Gtk::TreeModel::ColumnRecord
|
||||
{
|
||||
public:
|
||||
|
||||
InspectRecord() { add(name); }
|
||||
|
||||
Gtk::TreeModelColumn<Glib::ustring> name;
|
||||
};
|
||||
|
||||
Gtk::VBox _vbox;
|
||||
Gtk::ScrolledWindow _sc_tree;
|
||||
Gtk::ComboBoxText _cb_busnames;
|
||||
Gtk::TreeView _tv_inspect;
|
||||
Glib::RefPtr<Gtk::TreeStore> _tm_inspect;
|
||||
InspectRecord _records;
|
||||
};
|
||||
|
||||
#endif//__DEMO_DBUS_BROWSER_H
|
Loading…
Add table
Add a link
Reference in a new issue