Merge branch 'master' of git://anongit.freedesktop.org/git/dbus/dbus-c++
Merge branch 'master' of git://anongit.freedesktop.org/git/dbus/dbus-c++ Conflicts: include/dbus-c++/connection.h include/dbus-c++/dispatcher.h include/dbus-c++/pendingcall.h src/dispatcher.cpp
This commit is contained in:
commit
c1970e2352
57 changed files with 1642 additions and 1638 deletions
|
@ -9,26 +9,26 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
static const char* DBUS_SERVER_NAME = "org.freedesktop.DBus";
|
||||
static const char* DBUS_SERVER_PATH = "/org/freedesktop/DBus";
|
||||
static const char *DBUS_SERVER_NAME = "org.freedesktop.DBus";
|
||||
static const char *DBUS_SERVER_PATH = "/org/freedesktop/DBus";
|
||||
|
||||
DBusBrowser::DBusBrowser( ::DBus::Connection& conn )
|
||||
DBusBrowser::DBusBrowser(::DBus::Connection &conn)
|
||||
: ::DBus::ObjectProxy(conn, DBUS_SERVER_PATH, DBUS_SERVER_NAME)
|
||||
{
|
||||
set_title("D-Bus Browser");
|
||||
set_border_width(5);
|
||||
set_default_size(400, 500);
|
||||
|
||||
typedef std::vector< ::DBus::String > Names;
|
||||
typedef std::vector< std::string > Names;
|
||||
|
||||
Names names = ListNames();
|
||||
|
||||
for(Names::iterator it = names.begin(); it != names.end(); ++it)
|
||||
for (Names::iterator it = names.begin(); it != names.end(); ++it)
|
||||
{
|
||||
_cb_busnames.append_text(*it);
|
||||
}
|
||||
|
||||
_cb_busnames.signal_changed().connect( sigc::mem_fun(*this, &DBusBrowser::on_select_busname) );
|
||||
_cb_busnames.signal_changed().connect(sigc::mem_fun(*this, &DBusBrowser::on_select_busname));
|
||||
|
||||
_tm_inspect = Gtk::TreeStore::create(_records);
|
||||
_tv_inspect.set_model(_tm_inspect);
|
||||
|
@ -46,17 +46,17 @@ DBusBrowser::DBusBrowser( ::DBus::Connection& conn )
|
|||
}
|
||||
|
||||
void DBusBrowser::NameOwnerChanged(
|
||||
const ::DBus::String& name, const ::DBus::String& old_owner, const ::DBus::String& new_owner )
|
||||
const std::string &name, const std::string &old_owner, const std::string &new_owner)
|
||||
{
|
||||
cout << name << ": " << old_owner << " -> " << new_owner << endl;
|
||||
}
|
||||
|
||||
void DBusBrowser::NameLost( const ::DBus::String& name )
|
||||
void DBusBrowser::NameLost(const std::string &name)
|
||||
{
|
||||
cout << name << " lost" << endl;
|
||||
}
|
||||
|
||||
void DBusBrowser::NameAcquired( const ::DBus::String& name )
|
||||
void DBusBrowser::NameAcquired(const std::string &name)
|
||||
{
|
||||
cout << name << " acquired" << endl;
|
||||
}
|
||||
|
@ -64,24 +64,24 @@ void DBusBrowser::NameAcquired( const ::DBus::String& name )
|
|||
void DBusBrowser::on_select_busname()
|
||||
{
|
||||
Glib::ustring busname = _cb_busnames.get_active_text();
|
||||
if(busname.empty()) return;
|
||||
if (busname.empty()) return;
|
||||
|
||||
_tm_inspect->clear();
|
||||
_inspect_append(NULL, "", busname);
|
||||
}
|
||||
|
||||
void DBusBrowser::_inspect_append( Gtk::TreeModel::Row* row, const std::string& buspath, const std::string& busname )
|
||||
void DBusBrowser::_inspect_append(Gtk::TreeModel::Row *row, const std::string &buspath, const std::string &busname)
|
||||
{
|
||||
DBusInspector inspector(conn(), buspath.empty() ? "/" : buspath.c_str(), busname.c_str());
|
||||
|
||||
::DBus::Xml::Document doc(inspector.Introspect());
|
||||
::DBus::Xml::Node& root = *(doc.root);
|
||||
::DBus::Xml::Node &root = *(doc.root);
|
||||
|
||||
::DBus::Xml::Nodes ifaces = root["interface"];
|
||||
|
||||
for(::DBus::Xml::Nodes::iterator ii = ifaces.begin(); ii != ifaces.end(); ++ii)
|
||||
for (::DBus::Xml::Nodes::iterator ii = ifaces.begin(); ii != ifaces.end(); ++ii)
|
||||
{
|
||||
::DBus::Xml::Node& iface = **ii;
|
||||
::DBus::Xml::Node &iface = **ii;
|
||||
|
||||
Gtk::TreeModel::Row i_row = row
|
||||
? *(_tm_inspect->append(row->children()))
|
||||
|
@ -90,7 +90,7 @@ void DBusBrowser::_inspect_append( Gtk::TreeModel::Row* row, const std::string&
|
|||
|
||||
::DBus::Xml::Nodes methods = iface["method"];
|
||||
|
||||
for(::DBus::Xml::Nodes::iterator im = methods.begin(); im != methods.end(); ++im)
|
||||
for (::DBus::Xml::Nodes::iterator im = methods.begin(); im != methods.end(); ++im)
|
||||
{
|
||||
Gtk::TreeModel::Row m_row = *(_tm_inspect->append(i_row.children()));
|
||||
m_row[_records.name] = "method: " + (*im)->get("name");
|
||||
|
@ -98,7 +98,7 @@ void DBusBrowser::_inspect_append( Gtk::TreeModel::Row* row, const std::string&
|
|||
|
||||
::DBus::Xml::Nodes signals = iface["signal"];
|
||||
|
||||
for(::DBus::Xml::Nodes::iterator is = signals.begin(); is != signals.end(); ++is)
|
||||
for (::DBus::Xml::Nodes::iterator is = signals.begin(); is != signals.end(); ++is)
|
||||
{
|
||||
Gtk::TreeModel::Row s_row = *(_tm_inspect->append(i_row.children()));
|
||||
s_row[_records.name] = "signal: " + (*is)->get("name");
|
||||
|
@ -107,7 +107,7 @@ void DBusBrowser::_inspect_append( Gtk::TreeModel::Row* row, const std::string&
|
|||
|
||||
::DBus::Xml::Nodes nodes = root["node"];
|
||||
|
||||
for(::DBus::Xml::Nodes::iterator in = nodes.begin(); in != nodes.end(); ++in)
|
||||
for (::DBus::Xml::Nodes::iterator in = nodes.begin(); in != nodes.end(); ++in)
|
||||
{
|
||||
std::string name = (*in)->get("name");
|
||||
|
||||
|
@ -122,7 +122,7 @@ void DBusBrowser::_inspect_append( Gtk::TreeModel::Row* row, const std::string&
|
|||
|
||||
DBus::Glib::BusDispatcher dispatcher;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
Gtk::Main kit(argc, argv);
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class DBusInspector
|
|||
{
|
||||
public:
|
||||
|
||||
DBusInspector( DBus::Connection& conn, const char* path, const char* service )
|
||||
DBusInspector(DBus::Connection &conn, const char *path, const char *service)
|
||||
: DBus::ObjectProxy(conn, path, service)
|
||||
{}
|
||||
};
|
||||
|
@ -26,19 +26,19 @@ class DBusBrowser
|
|||
{
|
||||
public:
|
||||
|
||||
DBusBrowser( ::DBus::Connection& );
|
||||
DBusBrowser(::DBus::Connection &);
|
||||
|
||||
private:
|
||||
|
||||
void NameOwnerChanged( const ::DBus::String&, const ::DBus::String&, const ::DBus::String& );
|
||||
void NameOwnerChanged(const std::string &, const std::string &, const std::string &);
|
||||
|
||||
void NameLost( const ::DBus::String& );
|
||||
void NameLost(const std::string &);
|
||||
|
||||
void NameAcquired( const ::DBus::String& );
|
||||
void NameAcquired(const std::string &);
|
||||
|
||||
void on_select_busname();
|
||||
|
||||
void _inspect_append( Gtk::TreeModel::Row*, const std::string&, const std::string& );
|
||||
void _inspect_append(Gtk::TreeModel::Row *, const std::string &, const std::string &);
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue