diff --git a/examples/ecore/dbus_ecore.cpp b/examples/ecore/dbus_ecore.cpp index 8cc827f..e24b178 100644 --- a/examples/ecore/dbus_ecore.cpp +++ b/examples/ecore/dbus_ecore.cpp @@ -20,27 +20,9 @@ DBusBrowser::DBusBrowser( ::DBus::Connection& conn ) Names names = ListNames(); for(Names::iterator it = names.begin(); it != names.end(); ++it) - { - //_cb_busnames.append_text(*it); - + { cout << *it << endl; } - - /*_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); - _tv_inspect.append_column("Node", _records.name); - - _sc_tree.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - _sc_tree.add(_tv_inspect); - - _vbox.pack_start(_cb_busnames, Gtk::PACK_SHRINK); - _vbox.pack_start(_sc_tree); - - add(_vbox); - - show_all_children();*/ } void DBusBrowser::NameOwnerChanged( @@ -59,65 +41,6 @@ void DBusBrowser::NameAcquired( const ::DBus::String& name ) cout << name << " acquired" << endl; } -/*void DBusBrowser::on_select_busname() -{ - Glib::ustring busname = _cb_busnames.get_active_text(); - 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 ) -{ - 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::Nodes ifaces = root["interface"]; - - for(::DBus::Xml::Nodes::iterator ii = ifaces.begin(); ii != ifaces.end(); ++ii) - { - ::DBus::Xml::Node& iface = **ii; - - Gtk::TreeModel::Row i_row = row - ? *(_tm_inspect->append(row->children())) - : *(_tm_inspect->append()); - i_row[_records.name] = "interface: " + iface.get("name"); - - ::DBus::Xml::Nodes methods = iface["method"]; - - 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"); - } - - ::DBus::Xml::Nodes signals = iface["signal"]; - - 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"); - } - } - - ::DBus::Xml::Nodes nodes = root["node"]; - - for(::DBus::Xml::Nodes::iterator in = nodes.begin(); in != nodes.end(); ++in) - { - std::string name = (*in)->get("name"); - - Gtk::TreeModel::Row n_row = row - ? *(_tm_inspect->append(row->children())) - : *(_tm_inspect->append()); - n_row[_records.name] = name; - - _inspect_append(&n_row, buspath + "/" + name, busname); - } -}*/ - DBus::Ecore::BusDispatcher dispatcher; void niam( int sig ) diff --git a/examples/ecore/dbus_ecore.h b/examples/ecore/dbus_ecore.h index ccd4b99..e5190e9 100644 --- a/examples/ecore/dbus_ecore.h +++ b/examples/ecore/dbus_ecore.h @@ -7,17 +7,6 @@ #include "dbus_ecore-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, @@ -35,27 +24,8 @@ private: 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 name; - }; - - Gtk::VBox _vbox; - Gtk::ScrolledWindow _sc_tree; - Gtk::ComboBoxText _cb_busnames; - Gtk::TreeView _tv_inspect; - Glib::RefPtr _tm_inspect;*/ - //InspectRecord _records; }; #endif//__DEMO_DBUS_BROWSER_H