diff options
Diffstat (limited to 'examples/ecore')
-rw-r--r-- | examples/ecore/dbus_ecore.cpp | 46 | ||||
-rw-r--r-- | examples/ecore/dbus_ecore.h | 10 |
2 files changed, 28 insertions, 28 deletions
diff --git a/examples/ecore/dbus_ecore.cpp b/examples/ecore/dbus_ecore.cpp index f0686dc..c97e22c 100644 --- a/examples/ecore/dbus_ecore.cpp +++ b/examples/ecore/dbus_ecore.cpp @@ -10,62 +10,62 @@ 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"; typedef vector <string> Names; -DBusBrowser::DBusBrowser( ::DBus::Connection& conn ) -: ::DBus::ObjectProxy(conn, DBUS_SERVER_PATH, DBUS_SERVER_NAME) +DBusBrowser::DBusBrowser(::DBus::Connection &conn) + : ::DBus::ObjectProxy(conn, DBUS_SERVER_PATH, DBUS_SERVER_NAME) { typedef std::vector< std::string > Names; - Names names = ListNames(); + Names names = ListNames(); - for(Names::iterator it = names.begin(); it != names.end(); ++it) - { + for (Names::iterator it = names.begin(); it != names.end(); ++it) + { cout << *it << endl; - } + } } void DBusBrowser::NameOwnerChanged( - const std::string& name, const std::string& old_owner, const std::string& new_owner ) + const std::string &name, const std::string &old_owner, const std::string &new_owner) { - cout << name << ": " << old_owner << " -> " << new_owner << endl; + cout << name << ": " << old_owner << " -> " << new_owner << endl; } -void DBusBrowser::NameLost( const std::string& name ) +void DBusBrowser::NameLost(const std::string &name) { - cout << name << " lost" << endl; + cout << name << " lost" << endl; } -void DBusBrowser::NameAcquired( const std::string& name ) +void DBusBrowser::NameAcquired(const std::string &name) { - cout << name << " acquired" << endl; + cout << name << " acquired" << endl; } DBus::Ecore::BusDispatcher dispatcher; -void niam( int sig ) +void niam(int sig) { - ecore_main_loop_quit(); + ecore_main_loop_quit(); } -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { signal(SIGTERM, niam); signal(SIGINT, niam); - - ecore_init(); - DBus::default_dispatcher = &dispatcher; + ecore_init(); - DBus::Connection conn = DBus::Connection::SessionBus(); + DBus::default_dispatcher = &dispatcher; - DBusBrowser browser(conn); + DBus::Connection conn = DBus::Connection::SessionBus(); + + DBusBrowser browser(conn); ecore_main_loop_begin(); ecore_shutdown(); - return 0; + return 0; } diff --git a/examples/ecore/dbus_ecore.h b/examples/ecore/dbus_ecore.h index d00d6ea..130091d 100644 --- a/examples/ecore/dbus_ecore.h +++ b/examples/ecore/dbus_ecore.h @@ -8,21 +8,21 @@ #include "dbus_ecore-glue.h" class DBusBrowser -: public org::freedesktop::DBus_proxy, + : public org::freedesktop::DBus_proxy, public DBus::IntrospectableProxy, public DBus::ObjectProxy { public: - DBusBrowser( ::DBus::Connection& conn ); + DBusBrowser(::DBus::Connection &conn); private: - void NameOwnerChanged( const std::string&, const std::string&, const std::string& ); + void NameOwnerChanged(const std::string &, const std::string &, const std::string &); - void NameLost( const std::string& ); + void NameLost(const std::string &); - void NameAcquired( const std::string& ); + void NameAcquired(const std::string &); private: |