From 05a08605dab4caa7ae36474a28227061bab5205f Mon Sep 17 00:00:00 2001 From: Nedko Arnaudov Date: Thu, 30 Jul 2009 01:53:36 +0300 Subject: [PATCH] remove use of implicit namespaces --- gui/Patchage.cpp | 46 ++++++++++---------- gui/PatchageCanvas.hpp | 10 ++--- gui/StateManager.cpp | 37 ++++++++-------- gui/a2j_proxy.cpp | 24 +++++------ gui/a2j_proxy.hpp | 4 +- gui/common.h | 4 -- gui/jack_proxy.cpp | 20 ++++----- gui/lash_client.cpp | 16 +++---- gui/lash_client.hpp | 14 +++---- gui/lash_proxy.cpp | 102 ++++++++++++++++++++++----------------------- gui/lash_proxy.hpp | 16 +++---- gui/project.cpp | 42 +++++++++---------- gui/project.hpp | 38 ++++++++--------- gui/project_list.cpp | 62 +++++++++++++-------------- gui/project_properties.cpp | 8 ++-- gui/project_properties.hpp | 2 +- gui/session.cpp | 56 ++++++++++++------------- gui/session.hpp | 16 +++---- 18 files changed, 251 insertions(+), 266 deletions(-) diff --git a/gui/Patchage.cpp b/gui/Patchage.cpp index af76b192..b2f8339a 100644 --- a/gui/Patchage.cpp +++ b/gui/Patchage.cpp @@ -54,8 +54,6 @@ Patchage * g_app; #define LOG_TO_STD //#define LOG_TO_STATUS -using namespace std; - /* Gtk helpers (resize combo boxes) */ static void @@ -127,7 +125,7 @@ Patchage::Patchage(int argc, char** argv) while (argc > 0) { if (!strcmp(*argv, "--help")) { - cout << "Usage: patchage [OPTIONS]\nOptions: --no-alsa" << endl; + std::cout << "Usage: patchage [OPTIONS]\nOptions: --no-alsa" << std::endl; exit(0); } @@ -288,7 +286,7 @@ Patchage::update_load() char tmp_buf[8]; snprintf(tmp_buf, 8, "%zd", _jack->xruns()); - _main_xrun_progress->set_text(string(tmp_buf) + " Dropouts"); + _main_xrun_progress->set_text(std::string(tmp_buf) + " Dropouts"); float load = _jack->get_dsp_load(); @@ -361,7 +359,7 @@ Patchage::error_msg(const std::string& msg) status_msg(msg); #endif #if defined(LOG_TO_STD) - cerr << msg << endl; + std::cerr << msg << std::endl; #endif } @@ -373,13 +371,13 @@ Patchage::info_msg(const std::string& msg) status_msg(msg); #endif #if defined(LOG_TO_STD) - cerr << msg << endl; + std::cerr << msg << std::endl; #endif } void -Patchage::status_msg(const string& msg) +Patchage::status_msg(const std::string& msg) { } @@ -478,7 +476,7 @@ Patchage::on_view_toolbar() bool Patchage::on_scroll(GdkEventScroll* ev) { - cout << "ON SCROLL" << endl; + std::cout << "ON SCROLL" << std::endl; return false; } @@ -608,8 +606,8 @@ Patchage::on_port_added( { #if 0 bool is_a2j_mapped; - string canvas_client_name; - string canvas_port_name; + std::string canvas_client_name; + std::string canvas_port_name; uint32_t alsa_client_id; boost::shared_ptr module; @@ -721,13 +719,13 @@ Patchage::on_ports_connected( #if 0 boost::shared_ptr port1 = lookup_port(jack_client1_name, jack_port1_name); if (!port1) { - error_msg((string)"Unable to connect unknown port '" + jack_port1_name + "' of client '" + jack_client1_name + "'"); + error_msg((std::string)"Unable to connect unknown port '" + jack_port1_name + "' of client '" + jack_client1_name + "'"); return; } boost::shared_ptr port2 = lookup_port(jack_client2_name, jack_port2_name); if (!port2) { - error_msg((string)"Unable to connect unknown port '" + jack_port2_name + "' of client '" + jack_client2_name + "'"); + error_msg((std::string)"Unable to connect unknown port '" + jack_port2_name + "' of client '" + jack_client2_name + "'"); return; } @@ -745,13 +743,13 @@ Patchage::on_ports_disconnected( #if 0 boost::shared_ptr port1 = lookup_port(jack_client1_name, jack_port1_name); if (!port1) { - error_msg((string)"Unable to disconnect unknown port '" + jack_port1_name + "' of client '" + jack_client1_name + "'"); + error_msg((std::string)"Unable to disconnect unknown port '" + jack_port1_name + "' of client '" + jack_client1_name + "'"); return; } boost::shared_ptr port2 = lookup_port(jack_client2_name, jack_port2_name); if (!port2) { - error_msg((string)"Unable to disconnect unknown port '" + jack_port2_name + "' of client '" + jack_client2_name + "'"); + error_msg((std::string)"Unable to disconnect unknown port '" + jack_port2_name + "' of client '" + jack_client2_name + "'"); return; } @@ -773,8 +771,8 @@ port_type_match( void Patchage::get_port_jack_names( boost::shared_ptr port, - string& jack_client_name, - string& jack_port_name) + std::string& jack_client_name, + std::string& jack_port_name) { #if 0 if (port->is_a2j_mapped) @@ -796,10 +794,10 @@ Patchage::connect( boost::shared_ptr port2) { #if 0 - string jack_client1_name; - string jack_port1_name; - string jack_client2_name; - string jack_port2_name; + std::string jack_client1_name; + std::string jack_port1_name; + std::string jack_client2_name; + std::string jack_port2_name; if (port_type_match(port1, port2)) { @@ -825,10 +823,10 @@ Patchage::disconnect( boost::shared_ptr port2) { #if 0 - string jack_client1_name; - string jack_port1_name; - string jack_client2_name; - string jack_port2_name; + std::string jack_client1_name; + std::string jack_port1_name; + std::string jack_client2_name; + std::string jack_port2_name; if (port_type_match(port1, port2)) { diff --git a/gui/PatchageCanvas.hpp b/gui/PatchageCanvas.hpp index a48bb8d1..f8708a73 100644 --- a/gui/PatchageCanvas.hpp +++ b/gui/PatchageCanvas.hpp @@ -34,24 +34,22 @@ class Patchage; class PatchageModule; class PatchagePort; -using std::string; - class PatchageCanvas { public: PatchageCanvas(Patchage* _app, int width, int height); - boost::shared_ptr find_module(const string& name, ModuleType type); + boost::shared_ptr find_module(const std::string& name, ModuleType type); void connect(boost::shared_ptr port1, boost::shared_ptr port2); void disconnect(boost::shared_ptr port1, boost::shared_ptr port2); - void status_message(const string& msg); + void status_message(const std::string& msg); boost::shared_ptr get_port( - const string& module_name, - const string& port_name); + const std::string& module_name, + const std::string& port_name); boost::shared_ptr lookup_port_by_a2j_jack_port_name( diff --git a/gui/StateManager.cpp b/gui/StateManager.cpp index 62a525df..8c9d7cff 100644 --- a/gui/StateManager.cpp +++ b/gui/StateManager.cpp @@ -31,9 +31,6 @@ #include "StateManager.hpp" #include "Patchage.hpp" -using namespace std; - - StateManager::StateManager() : _window_location(0, 0) , _window_size(640, 480) @@ -43,9 +40,9 @@ StateManager::StateManager() bool -StateManager::get_module_location(const string& name, ModuleType type, Coord& loc) +StateManager::get_module_location(const std::string& name, ModuleType type, Coord& loc) { - map::const_iterator i = _module_settings.find(name); + std::map::const_iterator i = _module_settings.find(name); if (i == _module_settings.end()) return false; @@ -79,10 +76,10 @@ StateManager::get_module_location(const string& name, ModuleType type, Coord& lo void -StateManager::set_module_location(const string& name, ModuleType type, Coord loc) +StateManager::set_module_location(const std::string& name, ModuleType type, Coord loc) { retry: - map::iterator i = _module_settings.find(name); + std::map::iterator i = _module_settings.find(name); if (i == _module_settings.end()) { // no mapping exists, insert new element and set its split type, then retry to retrieve reference to it _module_settings[name].split = type != InputOutput; @@ -113,9 +110,9 @@ retry: * to allow driver's to request terminal ports get split by default). */ bool -StateManager::get_module_split(const string& name, bool default_val) const +StateManager::get_module_split(const std::string& name, bool default_val) const { - map::const_iterator i = _module_settings.find(name); + std::map::const_iterator i = _module_settings.find(name); if (i == _module_settings.end()) return default_val; @@ -124,28 +121,28 @@ StateManager::get_module_split(const string& name, bool default_val) const void -StateManager::set_module_split(const string& name, bool split) +StateManager::set_module_split(const std::string& name, bool split) { _module_settings[name].split = split; } void -StateManager::load(const string& filename) +StateManager::load(const std::string& filename) { _module_settings.clear(); - cerr << "Loading configuration file " << filename << endl; + std::cerr << "Loading configuration file " << filename << std::endl; std::ifstream is; is.open(filename.c_str(), std::ios::in); if ( ! is.good()) { - std::cerr << "Unable to load file " << filename << "!" << endl; + std::cerr << "Unable to load file " << filename << "!" << std::endl; return; } - string s; + std::string s; is >> s; if (s == "window_location") { @@ -175,7 +172,7 @@ StateManager::load(const string& filename) Coord loc; ModuleType type; - string name; + std::string name; while (1) { is >> s; @@ -218,7 +215,7 @@ StateManager::load(const string& filename) static inline void write_module_settings_entry( std::ofstream& os, - const string& name, + const std::string& name, const char * type, const Coord& loc) { @@ -226,7 +223,7 @@ write_module_settings_entry( } void -StateManager::save(const string& filename) +StateManager::save(const std::string& filename) { std::ofstream os; os.open(filename.c_str(), std::ios::out); @@ -236,9 +233,9 @@ StateManager::save(const string& filename) os << "zoom_level " << _zoom << std::endl; - for (map::iterator i = _module_settings.begin(); i != _module_settings.end(); ++i) { + for (std::map::iterator i = _module_settings.begin(); i != _module_settings.end(); ++i) { const ModuleSettings& settings = (*i).second; - const string& name = (*i).first; + const std::string& name = (*i).first; if (settings.split) { write_module_settings_entry(os, name, "input", *settings.input_location); @@ -250,7 +247,7 @@ StateManager::save(const string& filename) os.close(); - cerr << "Saved configuration file " << filename << endl; + std::cerr << "Saved configuration file " << filename << std::endl; } diff --git a/gui/a2j_proxy.cpp b/gui/a2j_proxy.cpp index 957ffdf4..25f16a8d 100644 --- a/gui/a2j_proxy.cpp +++ b/gui/a2j_proxy.cpp @@ -40,17 +40,17 @@ static void error_msg( - const string& msg) + const std::string& msg) { - g_app->error_msg((string)"[A2J] " + msg); + g_app->error_msg((std::string)"[A2J] " + msg); } static void info_msg( - const string& msg) + const std::string& msg) { - g_app->info_msg((string)"[A2J] " + msg); + g_app->info_msg((std::string)"[A2J] " + msg); } struct a2j_proxy_impl @@ -76,13 +76,13 @@ struct a2j_proxy_impl bool get_jack_client_name( - string& jack_client_name_ref); + std::string& jack_client_name_ref); bool is_started(); bool _server_responding; - string _jack_client_name; + std::string _jack_client_name; }; a2j_proxy::a2j_proxy() @@ -170,19 +170,19 @@ a2j_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - if ((string)object_name != A2J_SERVICE) + if ((std::string)object_name != A2J_SERVICE) { return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } if (old_owner[0] == '\0') { - info_msg((string)"A2J activated."); + info_msg((std::string)"A2J activated."); g_app->set_a2j_status(A2J_STATUS_BRIDGE_STOPPED); } else if (new_owner[0] == '\0') { - info_msg((string)"A2J deactivated."); + info_msg((std::string)"A2J deactivated."); g_app->set_a2j_status(A2J_STATUS_NO_RESPONSE); } @@ -238,7 +238,7 @@ a2j_proxy_impl::call( bool a2j_proxy_impl::get_jack_client_name( - string& jack_client_name_ref) + std::string& jack_client_name_ref) { DBusMessage * reply_ptr; const char * jack_client_name; @@ -266,8 +266,8 @@ a2j_proxy_impl::get_jack_client_name( bool a2j_proxy::map_jack_port( const char * jack_port_name, - string& alsa_client_name_ref, - string& alsa_port_name_ref, + std::string& alsa_client_name_ref, + std::string& alsa_port_name_ref, uint32_t& alsa_client_id_ref) { DBusMessage * reply_ptr; diff --git a/gui/a2j_proxy.hpp b/gui/a2j_proxy.hpp index 60a15d08..5e5d1071 100644 --- a/gui/a2j_proxy.hpp +++ b/gui/a2j_proxy.hpp @@ -45,8 +45,8 @@ public: bool map_jack_port( const char * jack_port_name, - string& alsa_client_name, - string& alsa_port_name, + std::string& alsa_client_name, + std::string& alsa_port_name, uint32_t& alsa_client_id); void diff --git a/gui/common.h b/gui/common.h index 0895fb49..120fb5da 100644 --- a/gui/common.h +++ b/gui/common.h @@ -39,10 +39,6 @@ #include #include -using namespace boost; -using namespace std; -using namespace sigc; - #include "canvas.h" #endif /* #ifndef COMMON_H__15E63B7A_8350_4ABD_B04C_592158354949__INCLUDED */ diff --git a/gui/jack_proxy.cpp b/gui/jack_proxy.cpp index 7f326270..e63fb6e5 100644 --- a/gui/jack_proxy.cpp +++ b/gui/jack_proxy.cpp @@ -40,8 +40,6 @@ #include "jack_proxy.hpp" #include "dbus_helpers.h" -using namespace std; - #define JACKDBUS_SERVICE "org.jackaudio.service" #define JACKDBUS_OBJECT "/org/jackaudio/Controller" #define JACKDBUS_IFACE_CONTROL "org.jackaudio.JackControl" @@ -184,7 +182,7 @@ jack_proxy::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - if ((string)object_name != JACKDBUS_SERVICE) + if ((std::string)object_name != JACKDBUS_SERVICE) { return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } @@ -567,13 +565,13 @@ jack_proxy::refresh_internal(bool force) reply_signature = dbus_message_get_signature(reply_ptr); if (strcmp(reply_signature, "ta(tsa(tsuu))a(tstststst)") != 0) { - error_msg((string )"GetGraph() reply signature mismatch. " + reply_signature); + error_msg((std::string )"GetGraph() reply signature mismatch. " + reply_signature); goto unref; } dbus_message_iter_init(reply_ptr, &iter); - //info_msg((string)"version " + (char)dbus_message_iter_get_arg_type(&iter)); + //info_msg((std::string)"version " + (char)dbus_message_iter_get_arg_type(&iter)); dbus_message_iter_get_basic(&iter, &version); dbus_message_iter_next(&iter); @@ -586,12 +584,12 @@ jack_proxy::refresh_internal(bool force) //info_msg(str(boost::format("got new graph version %llu") % version)); _graph_version = version; - //info_msg((string)"clients " + (char)dbus_message_iter_get_arg_type(&iter)); + //info_msg((std::string)"clients " + (char)dbus_message_iter_get_arg_type(&iter)); for (dbus_message_iter_recurse(&iter, &clients_array_iter); dbus_message_iter_get_arg_type(&clients_array_iter) != DBUS_TYPE_INVALID; dbus_message_iter_next(&clients_array_iter)) { - //info_msg((string)"a client " + (char)dbus_message_iter_get_arg_type(&clients_array_iter)); + //info_msg((std::string)"a client " + (char)dbus_message_iter_get_arg_type(&clients_array_iter)); dbus_message_iter_recurse(&clients_array_iter, &client_struct_iter); dbus_message_iter_get_basic(&client_struct_iter, &client_id); @@ -600,12 +598,12 @@ jack_proxy::refresh_internal(bool force) dbus_message_iter_get_basic(&client_struct_iter, &client_name); dbus_message_iter_next(&client_struct_iter); - //info_msg((string)"client '" + client_name + "'"); + //info_msg((std::string)"client '" + client_name + "'"); for (dbus_message_iter_recurse(&client_struct_iter, &ports_array_iter); dbus_message_iter_get_arg_type(&ports_array_iter) != DBUS_TYPE_INVALID; dbus_message_iter_next(&ports_array_iter)) { - //info_msg((string)"a port " + (char)dbus_message_iter_get_arg_type(&ports_array_iter)); + //info_msg((std::string)"a port " + (char)dbus_message_iter_get_arg_type(&ports_array_iter)); dbus_message_iter_recurse(&ports_array_iter, &port_struct_iter); dbus_message_iter_get_basic(&port_struct_iter, &port_id); @@ -620,7 +618,7 @@ jack_proxy::refresh_internal(bool force) dbus_message_iter_get_basic(&port_struct_iter, &port_type); dbus_message_iter_next(&port_struct_iter); - //info_msg((string)"port: " + port_name); + //info_msg((std::string)"port: " + port_name); on_port_added(client_id, client_name, port_id, port_name, port_flags, port_type); } @@ -633,7 +631,7 @@ jack_proxy::refresh_internal(bool force) for (dbus_message_iter_recurse(&iter, &connections_array_iter); dbus_message_iter_get_arg_type(&connections_array_iter) != DBUS_TYPE_INVALID; dbus_message_iter_next(&connections_array_iter)) { - //info_msg((string)"a connection " + (char)dbus_message_iter_get_arg_type(&connections_array_iter)); + //info_msg((std::string)"a connection " + (char)dbus_message_iter_get_arg_type(&connections_array_iter)); dbus_message_iter_recurse(&connections_array_iter, &connection_struct_iter); dbus_message_iter_get_basic(&connection_struct_iter, &client_id); diff --git a/gui/lash_client.cpp b/gui/lash_client.cpp index 228e8fe7..48f3ccfd 100644 --- a/gui/lash_client.cpp +++ b/gui/lash_client.cpp @@ -33,15 +33,15 @@ struct lash_client_impl { lash_proxy * lash_ptr; project * project_ptr; - string id; - string name; + std::string id; + std::string name; }; lash_client::lash_client( lash_proxy * lash_ptr, project * project_ptr, - const string& id, - const string& name) + const std::string& id, + const std::string& name) { _impl_ptr = new lash_client_impl; _impl_ptr->lash_ptr = lash_ptr; @@ -66,21 +66,21 @@ lash_client::get_project() void lash_client::get_id( - string& id) + std::string& id) { id = _impl_ptr->id; } void lash_client::get_name( - string& name) + std::string& name) { name = _impl_ptr->name; } void lash_client::do_rename( - const string& name) + const std::string& name) { if (_impl_ptr->name != name) { @@ -90,7 +90,7 @@ lash_client::do_rename( void lash_client::on_name_changed( - const string& name) + const std::string& name) { _impl_ptr->name = name; _signal_renamed.emit(); diff --git a/gui/lash_client.hpp b/gui/lash_client.hpp index 2cf50995..e2872e23 100644 --- a/gui/lash_client.hpp +++ b/gui/lash_client.hpp @@ -38,8 +38,8 @@ public: lash_client( lash_proxy * lash_ptr, project * project_ptr, - const string& id, - const string& name); + const std::string& id, + const std::string& name); ~lash_client(); @@ -48,24 +48,24 @@ public: void get_id( - string& id); + std::string& id); void get_name( - string& name); + std::string& name); void do_rename( - const string& name); + const std::string& name); - signal0 _signal_renamed; + sigc::signal0 _signal_renamed; private: friend class lash_proxy_impl; void on_name_changed( - const string& name); + const std::string& name); lash_client_impl * _impl_ptr; }; diff --git a/gui/lash_proxy.cpp b/gui/lash_proxy.cpp index 02cc4ad9..497768c6 100644 --- a/gui/lash_proxy.cpp +++ b/gui/lash_proxy.cpp @@ -40,14 +40,12 @@ #define LASH_OBJECT "/" #define LASH_IFACE_CONTROL DBUS_NAME_BASE ".Control" -using namespace std; - struct lash_proxy_impl { void init(); void fetch_loaded_projects(); - void fetch_project_clients(shared_ptr project_ptr); + void fetch_project_clients(boost::shared_ptr project_ptr); static void error_msg(const std::string& msg); static void info_msg(const std::string& msg); @@ -68,15 +66,15 @@ struct lash_proxy_impl int in_type, ...); - shared_ptr + boost::shared_ptr on_project_added( - string name); + std::string name); - shared_ptr + boost::shared_ptr on_client_added( - shared_ptr project_ptr, - string id, - string name); + boost::shared_ptr project_ptr, + std::string id, + std::string name); void exit(); @@ -135,7 +133,7 @@ lash_proxy::is_active() void lash_proxy::try_activate() { - list projects; + std::list projects; get_available_projects(projects); } @@ -172,8 +170,8 @@ lash_proxy_impl::dbus_message_hook( const char * client_id; const char * client_name; dbus_bool_t modified_status; - shared_ptr project_ptr; - shared_ptr client_ptr; + boost::shared_ptr project_ptr; + boost::shared_ptr client_ptr; assert(proxy); lash_proxy_impl * me = reinterpret_cast(proxy); @@ -196,18 +194,18 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - if ((string)object_name != LASH_SERVICE) + if ((std::string)object_name != LASH_SERVICE) { return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; } if (old_owner[0] == '\0') { - info_msg((string)"LASH activated."); + info_msg((std::string)"LASH activated."); } else if (new_owner[0] == '\0') { - info_msg((string)"LASH deactivated."); + info_msg((std::string)"LASH deactivated."); g_app->set_studio_availability(false); me->_server_responding = false; } @@ -217,7 +215,7 @@ lash_proxy_impl::dbus_message_hook( if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "StudioAppeared")) { - info_msg((string)"Studio appeared."); + info_msg((std::string)"Studio appeared."); g_app->set_studio_availability(true); return DBUS_HANDLER_RESULT_HANDLED; @@ -225,7 +223,7 @@ lash_proxy_impl::dbus_message_hook( if (dbus_message_is_signal(message, LASH_IFACE_CONTROL, "StudioDisappeared")) { - info_msg((string)"Studio disappeared."); + info_msg((std::string)"Studio disappeared."); g_app->set_studio_availability(false); return DBUS_HANDLER_RESULT_HANDLED; @@ -242,7 +240,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Project '" + project_name + "' appeared."); + info_msg((std::string)"Project '" + project_name + "' appeared."); me->on_project_added(project_name); return DBUS_HANDLER_RESULT_HANDLED; @@ -260,7 +258,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Project '" + project_name + "' disappeared."); + info_msg((std::string)"Project '" + project_name + "' disappeared."); me->_session_ptr->project_close(project_name); return DBUS_HANDLER_RESULT_HANDLED; @@ -280,7 +278,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Project '" + project_name + "' renamed to '" + new_project_name + "'."); + info_msg((std::string)"Project '" + project_name + "' renamed to '" + new_project_name + "'."); project_ptr = me->_session_ptr->find_project_by_name(project_name); if (project_ptr) @@ -304,7 +302,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Project '" + project_name + "' modified status changed to '" + (modified_status ? "true" : "false") + "'."); + info_msg((std::string)"Project '" + project_name + "' modified status changed to '" + (modified_status ? "true" : "false") + "'."); project_ptr = me->_session_ptr->find_project_by_name(project_name); if (project_ptr) @@ -328,7 +326,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Project '" + project_name + "' description changed."); + info_msg((std::string)"Project '" + project_name + "' description changed."); project_ptr = me->_session_ptr->find_project_by_name(project_name); if (project_ptr) @@ -352,7 +350,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Project '" + project_name + "' notes changed."); + info_msg((std::string)"Project '" + project_name + "' notes changed."); project_ptr = me->_session_ptr->find_project_by_name(project_name); if (project_ptr) @@ -377,7 +375,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Client '" + client_id + "':'" + client_name + "' appeared in project '" + project_name + "'."); + info_msg((std::string)"Client '" + client_id + "':'" + client_name + "' appeared in project '" + project_name + "'."); project_ptr = me->_session_ptr->find_project_by_name(project_name); if (project_ptr) @@ -401,7 +399,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Client '" + client_id + "' of project '" + project_name + "' disappeared."); + info_msg((std::string)"Client '" + client_id + "' of project '" + project_name + "' disappeared."); client_ptr = me->_session_ptr->find_client_by_id(client_id); if (client_ptr) @@ -426,7 +424,7 @@ lash_proxy_impl::dbus_message_hook( return DBUS_HANDLER_RESULT_HANDLED; } - info_msg((string)"Client '" + client_id + "' name changed to '" + client_name + "'."); + info_msg((std::string)"Client '" + client_id + "' name changed to '" + client_name + "'."); client_ptr = me->_session_ptr->find_client_by_id(client_id); if (client_ptr) @@ -476,7 +474,7 @@ lash_proxy_impl::fetch_loaded_projects() DBusMessageIter iter; DBusMessageIter array_iter; const char * project_name; - shared_ptr project_ptr; + boost::shared_ptr project_ptr; if (!call(true, LASH_IFACE_CONTROL, "ProjectsGet", &reply_ptr, DBUS_TYPE_INVALID)) { return; @@ -486,7 +484,7 @@ lash_proxy_impl::fetch_loaded_projects() if (strcmp(reply_signature, "as") != 0) { - error_msg((string)"ProjectsGet() reply signature mismatch. " + reply_signature); + error_msg((std::string)"ProjectsGet() reply signature mismatch. " + reply_signature); goto unref; } @@ -507,7 +505,7 @@ unref: void lash_proxy_impl::fetch_project_clients( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { DBusMessage* reply_ptr; const char * reply_signature; @@ -516,7 +514,7 @@ lash_proxy_impl::fetch_project_clients( DBusMessageIter struct_iter; const char * client_id; const char * client_name; - string project_name; + std::string project_name; const char * project_name_cstr; project_ptr->get_name(project_name); @@ -537,7 +535,7 @@ lash_proxy_impl::fetch_project_clients( if (strcmp(reply_signature, "a(ss)") != 0) { - error_msg((string)"ProjectGetClients() reply signature mismatch. " + reply_signature); + error_msg((std::string)"ProjectGetClients() reply signature mismatch. " + reply_signature); goto unref; } @@ -561,24 +559,24 @@ unref: dbus_message_unref(reply_ptr); } -shared_ptr +boost::shared_ptr lash_proxy_impl::on_project_added( - string name) + std::string name) { - shared_ptr project_ptr(new project(_interface_ptr, name)); + boost::shared_ptr project_ptr(new project(_interface_ptr, name)); _session_ptr->project_add(project_ptr); return project_ptr; } -shared_ptr +boost::shared_ptr lash_proxy_impl::on_client_added( - shared_ptr project_ptr, - string id, - string name) + boost::shared_ptr project_ptr, + std::string id, + std::string name) { - shared_ptr client_ptr( + boost::shared_ptr client_ptr( new lash_client( _interface_ptr, project_ptr.get(), @@ -593,7 +591,7 @@ lash_proxy_impl::on_client_added( void lash_proxy::get_available_projects( - list& projects) + std::list& projects) { DBusMessage * reply_ptr; const char * reply_signature; @@ -619,7 +617,7 @@ lash_proxy::get_available_projects( if (strcmp(reply_signature, "a(sa{sv})") != 0) { - lash_proxy_impl::error_msg((string)"ProjectsGetAvailable() reply signature mismatch. " + reply_signature); + lash_proxy_impl::error_msg((std::string)"ProjectsGetAvailable() reply signature mismatch. " + reply_signature); goto unref; } @@ -679,7 +677,7 @@ unref: void lash_proxy::load_project( - const string& project_name) + const std::string& project_name) { DBusMessage * reply_ptr; const char * project_name_cstr; @@ -709,7 +707,7 @@ lash_proxy::save_all_projects() void lash_proxy::save_project( - const string& project_name) + const std::string& project_name) { DBusMessage * reply_ptr; const char * project_name_cstr; @@ -726,7 +724,7 @@ lash_proxy::save_project( void lash_proxy::close_project( - const string& project_name) + const std::string& project_name) { DBusMessage * reply_ptr; const char * project_name_cstr; @@ -756,8 +754,8 @@ lash_proxy::close_all_projects() void lash_proxy::project_rename( - const string& old_name, - const string& new_name) + const std::string& old_name, + const std::string& new_name) { DBusMessage * reply_ptr; const char * old_name_cstr; @@ -783,7 +781,7 @@ lash_proxy::project_rename( void lash_proxy::get_loaded_project_properties( - const string& name, + const std::string& name, lash_loaded_project_properties& properties) { DBusMessage * reply_ptr; @@ -815,7 +813,7 @@ lash_proxy::get_loaded_project_properties( if (strcmp(reply_signature, "a{sv}") != 0) { - lash_proxy_impl::error_msg((string)"ProjectGetProperties() reply signature mismatch. " + reply_signature); + lash_proxy_impl::error_msg((std::string)"ProjectGetProperties() reply signature mismatch. " + reply_signature); goto unref; } @@ -863,8 +861,8 @@ unref: void lash_proxy::project_set_description( - const string& project_name, - const string& description) + const std::string& project_name, + const std::string& description) { DBusMessage * reply_ptr; const char * project_name_cstr; @@ -890,8 +888,8 @@ lash_proxy::project_set_description( void lash_proxy::project_set_notes( - const string& project_name, - const string& notes) + const std::string& project_name, + const std::string& notes) { DBusMessage * reply_ptr; const char * project_name_cstr; diff --git a/gui/lash_proxy.hpp b/gui/lash_proxy.hpp index fcfce7ee..686fa4be 100644 --- a/gui/lash_proxy.hpp +++ b/gui/lash_proxy.hpp @@ -31,16 +31,16 @@ struct lash_project_info { - string name; + std::string name; time_t modification_time; - string description; + std::string description; }; struct lash_loaded_project_properties { bool modified_status; - string description; - string notes; + std::string description; + std::string notes; }; class session; @@ -62,10 +62,10 @@ public: void save_project(const std::string& project_name); void close_project(const std::string& project_name); void close_all_projects(); - void project_rename(const string& old_name, const string& new_name); - void get_loaded_project_properties(const string& name, lash_loaded_project_properties& properties); - void project_set_description(const string& project_name, const string& description); - void project_set_notes(const string& project_name, const string& notes); + void project_rename(const std::string& old_name, const std::string& new_name); + void get_loaded_project_properties(const std::string& name, lash_loaded_project_properties& properties); + void project_set_description(const std::string& project_name, const std::string& description); + void project_set_notes(const std::string& project_name, const std::string& notes); private: lash_proxy_impl * _impl_ptr; diff --git a/gui/project.cpp b/gui/project.cpp index e7a030ee..21223ee6 100644 --- a/gui/project.cpp +++ b/gui/project.cpp @@ -33,16 +33,16 @@ struct project_impl { lash_proxy * lash_ptr; - string name; - string description; - string notes; + std::string name; + std::string description; + std::string notes; bool modified_status; - list > clients; + std::list > clients; }; project::project( lash_proxy * lash_ptr, - const string& name) + const std::string& name) { lash_loaded_project_properties properties; @@ -68,7 +68,7 @@ project::~project() void project::clear() { - shared_ptr client_ptr; + boost::shared_ptr client_ptr; while (!_impl_ptr->clients.empty()) { @@ -80,14 +80,14 @@ project::clear() void project::get_name( - string& name) + std::string& name) { name = _impl_ptr->name; } void project::on_name_changed( - const string& name) + const std::string& name) { _impl_ptr->name = name; _signal_renamed.emit(); @@ -95,14 +95,14 @@ project::on_name_changed( void project::get_description( - string& description) + std::string& description) { description = _impl_ptr->description; } void project::get_notes( - string& notes) + std::string& notes) { notes = _impl_ptr->notes; } @@ -115,14 +115,14 @@ project::get_modified_status() void project::get_clients( - list >& clients) + std::list >& clients) { clients = _impl_ptr->clients; } void project::on_client_added( - shared_ptr client_ptr) + boost::shared_ptr client_ptr) { _impl_ptr->clients.push_back(client_ptr); _signal_client_added.emit(client_ptr); @@ -130,12 +130,12 @@ project::on_client_added( void project::on_client_removed( - const string& id) + const std::string& id) { - shared_ptr client_ptr; - string temp_id; + boost::shared_ptr client_ptr; + std::string temp_id; - for (list >::iterator iter = _impl_ptr->clients.begin(); iter != _impl_ptr->clients.end(); iter++) + for (std::list >::iterator iter = _impl_ptr->clients.begin(); iter != _impl_ptr->clients.end(); iter++) { client_ptr = *iter; client_ptr->get_id(temp_id); @@ -159,7 +159,7 @@ project::on_modified_status_changed( void project::on_description_changed( - const string& description) + const std::string& description) { _impl_ptr->description = description; _signal_description_changed.emit(); @@ -167,7 +167,7 @@ project::on_description_changed( void project::on_notes_changed( - const string& notes) + const std::string& notes) { _impl_ptr->notes = notes; _signal_notes_changed.emit(); @@ -175,7 +175,7 @@ project::on_notes_changed( void project::do_rename( - const string& name) + const std::string& name) { if (_impl_ptr->name != name) { @@ -185,7 +185,7 @@ project::do_rename( void project::do_change_description( - const string& description) + const std::string& description) { if (_impl_ptr->description != description) { @@ -195,7 +195,7 @@ project::do_change_description( void project::do_change_notes( - const string& notes) + const std::string& notes) { if (_impl_ptr->notes != notes) { diff --git a/gui/project.hpp b/gui/project.hpp index 323a997d..353b7f56 100644 --- a/gui/project.hpp +++ b/gui/project.hpp @@ -37,7 +37,7 @@ class project public: project( lash_proxy * lash_ptr, - const string& name); + const std::string& name); ~project(); @@ -46,48 +46,48 @@ public: void get_name( - string& name); + std::string& name); void get_description( - string& description); + std::string& description); void get_notes( - string& notes); + std::string& notes); bool get_modified_status(); void get_clients( - list >& clients); + std::list >& clients); void do_rename( - const string& name); + const std::string& name); void do_change_description( - const string& description); + const std::string& description); void do_change_notes( - const string& notes); + const std::string& notes); - signal0 _signal_renamed; - signal0 _signal_modified_status_changed; - signal0 _signal_description_changed; - signal0 _signal_notes_changed; - signal1 > _signal_client_added; - signal1 > _signal_client_removed; + sigc::signal0 _signal_renamed; + sigc::signal0 _signal_modified_status_changed; + sigc::signal0 _signal_description_changed; + sigc::signal0 _signal_notes_changed; + sigc::signal1 > _signal_client_added; + sigc::signal1 > _signal_client_removed; private: friend class lash_proxy_impl; void on_name_changed( - const string& name); + const std::string& name); void on_modified_status_changed( @@ -95,19 +95,19 @@ private: void on_description_changed( - const string& description); + const std::string& description); void on_notes_changed( - const string& notes); + const std::string& notes); void on_client_added( - shared_ptr client_ptr); + boost::shared_ptr client_ptr); void on_client_removed( - const string& id); + const std::string& id); project_impl * _impl_ptr; }; diff --git a/gui/project_list.cpp b/gui/project_list.cpp index 64c5ed93..1814257a 100644 --- a/gui/project_list.cpp +++ b/gui/project_list.cpp @@ -42,8 +42,8 @@ struct project_list_column_record : public Gtk::TreeModel::ColumnRecord { Gtk::TreeModelColumn name; - Gtk::TreeModelColumn > project_ptr; - Gtk::TreeModelColumn > client_ptr; + Gtk::TreeModelColumn > project_ptr; + Gtk::TreeModelColumn > client_ptr; }; struct project_list_impl : public sigc::trackable @@ -58,20 +58,20 @@ struct project_list_impl : public sigc::trackable Glib::RefPtr xml, Patchage * app); - void project_added(shared_ptr project_ptr); - void project_closed(shared_ptr project_ptr); + void project_added(boost::shared_ptr project_ptr); + void project_closed(boost::shared_ptr project_ptr); void project_renamed(Gtk::TreeModel::iterator iter); - void client_added(shared_ptr client_ptr, Gtk::TreeModel::iterator iter); - void client_removed(shared_ptr client_ptr, Gtk::TreeModel::iterator iter); + void client_added(boost::shared_ptr client_ptr, Gtk::TreeModel::iterator iter); + void client_removed(boost::shared_ptr client_ptr, Gtk::TreeModel::iterator iter); void client_renamed(Gtk::TreeModel::iterator iter); bool on_button_press_event(GdkEventButton * event); void on_menu_popup_load_project(); void on_menu_popup_save_all_projects(); - void on_menu_popup_save_project(shared_ptr project_ptr); - void on_menu_popup_close_project(shared_ptr project_ptr); - void on_menu_popup_project_properties(shared_ptr project_ptr); + void on_menu_popup_save_project(boost::shared_ptr project_ptr); + void on_menu_popup_close_project(boost::shared_ptr project_ptr); + void on_menu_popup_project_properties(boost::shared_ptr project_ptr); void on_menu_popup_close_all_projects(); }; @@ -138,8 +138,8 @@ project_list_impl::on_button_press_event(GdkEventButton * event_ptr) selection->select(path); Gtk::TreeIter iter = selection->get_selected(); - shared_ptr project_ptr = (*iter)[_columns.project_ptr]; - string name; + boost::shared_ptr project_ptr = (*iter)[_columns.project_ptr]; + std::string name; if (project_ptr) { @@ -147,7 +147,7 @@ project_list_impl::on_button_press_event(GdkEventButton * event_ptr) menulist.push_back( Gtk::Menu_Helpers::MenuElem( - (string)"_Save project '" + name + "'", + (std::string)"_Save project '" + name + "'", sigc::bind( sigc::mem_fun( *this, @@ -155,7 +155,7 @@ project_list_impl::on_button_press_event(GdkEventButton * event_ptr) project_ptr))); menulist.push_back( Gtk::Menu_Helpers::MenuElem( - (string)"_Close project '" + name + "'", + (std::string)"_Close project '" + name + "'", sigc::bind( sigc::mem_fun( *this, @@ -164,7 +164,7 @@ project_list_impl::on_button_press_event(GdkEventButton * event_ptr) menulist.push_back( Gtk::Menu_Helpers::MenuElem( - (string)"_Project '" + name + "' properties", + (std::string)"_Project '" + name + "' properties", sigc::bind( sigc::mem_fun( *this, @@ -202,9 +202,9 @@ project_list_impl::on_menu_popup_save_all_projects() void project_list_impl::on_menu_popup_save_project( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { - string name; + std::string name; project_ptr->get_name(name); _app->save_project(name); @@ -212,9 +212,9 @@ project_list_impl::on_menu_popup_save_project( void project_list_impl::on_menu_popup_close_project( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { - string name; + std::string name; project_ptr->get_name(name); _app->close_project(name); @@ -222,7 +222,7 @@ project_list_impl::on_menu_popup_close_project( void project_list_impl::on_menu_popup_project_properties( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { project_properties_dialog dialog; @@ -237,12 +237,12 @@ project_list_impl::on_menu_popup_close_all_projects() void project_list_impl::project_added( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { Gtk::TreeModel::iterator iter; Gtk::TreeModel::iterator child_iter; Gtk::TreeModel::Row row; - string project_name; + std::string project_name; project_ptr->get_name(project_name); @@ -264,9 +264,9 @@ project_list_impl::project_added( void project_list_impl::project_closed( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { - shared_ptr temp_project_ptr; + boost::shared_ptr temp_project_ptr; Gtk::TreeModel::Children children = _model->children(); Gtk::TreeModel::Children::iterator iter = children.begin(); @@ -290,8 +290,8 @@ void project_list_impl::project_renamed( Gtk::TreeModel::iterator iter) { - shared_ptr project_ptr; - string project_name; + boost::shared_ptr project_ptr; + std::string project_name; Gtk::TreeModel::Row row = *iter; @@ -308,10 +308,10 @@ project_list_impl::project_renamed( void project_list_impl::client_added( - shared_ptr client_ptr, + boost::shared_ptr client_ptr, Gtk::TreeModel::iterator iter) { - string name; + std::string name; Gtk::TreeModel::Path path = _model->get_path(iter); Gtk::TreeModel::Row row = *iter; @@ -331,8 +331,8 @@ void project_list_impl::client_renamed( Gtk::TreeModel::iterator iter) { - shared_ptr client_ptr; - string client_name; + boost::shared_ptr client_ptr; + std::string client_name; Gtk::TreeModel::Row row = *iter; @@ -344,10 +344,10 @@ project_list_impl::client_renamed( void project_list_impl::client_removed( - shared_ptr client_ptr, + boost::shared_ptr client_ptr, Gtk::TreeModel::iterator iter) { - string name; + std::string name; Gtk::TreeModel::Path path = _model->get_path(iter); Gtk::TreeModel::Row row = *iter; diff --git a/gui/project_properties.cpp b/gui/project_properties.cpp index d9b2063b..35889ca2 100644 --- a/gui/project_properties.cpp +++ b/gui/project_properties.cpp @@ -57,11 +57,11 @@ project_properties_dialog::~project_properties_dialog() void project_properties_dialog::run( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { - string name; - string description; - string notes; + std::string name; + std::string description; + std::string notes; Glib::RefPtr buffer; int result; diff --git a/gui/project_properties.hpp b/gui/project_properties.hpp index 54c82164..d025084a 100644 --- a/gui/project_properties.hpp +++ b/gui/project_properties.hpp @@ -35,7 +35,7 @@ public: project_properties_dialog(); ~project_properties_dialog(); - void run(shared_ptr project_ptr); + void run(boost::shared_ptr project_ptr); private: project_properties_dialog_impl * _impl_ptr; diff --git a/gui/session.cpp b/gui/session.cpp index 1dbbe977..41bcc9d1 100644 --- a/gui/session.cpp +++ b/gui/session.cpp @@ -31,8 +31,8 @@ struct session_impl { - list > projects; - list > clients; + std::list > projects; + std::list > clients; }; session::session() @@ -48,7 +48,7 @@ session::~session() void session::clear() { - shared_ptr project_ptr; + boost::shared_ptr project_ptr; _impl_ptr->clients.clear(); @@ -63,21 +63,21 @@ session::clear() void session::project_add( - shared_ptr project_ptr) + boost::shared_ptr project_ptr) { _impl_ptr->projects.push_back(project_ptr); _signal_project_added.emit(project_ptr); } -shared_ptr +boost::shared_ptr session::find_project_by_name( - const string& name) + const std::string& name) { - shared_ptr project_ptr; - string temp_name; + boost::shared_ptr project_ptr; + std::string temp_name; - for (list >::iterator iter = _impl_ptr->projects.begin(); iter != _impl_ptr->projects.end(); iter++) + for (std::list >::iterator iter = _impl_ptr->projects.begin(); iter != _impl_ptr->projects.end(); iter++) { project_ptr = *iter; project_ptr->get_name(temp_name); @@ -88,18 +88,18 @@ session::find_project_by_name( } } - return shared_ptr(); + return boost::shared_ptr(); } void session::project_close( - const string& project_name) + const std::string& project_name) { - shared_ptr project_ptr; - string temp_name; - list > clients; + boost::shared_ptr project_ptr; + std::string temp_name; + std::list > clients; - for (list >::iterator iter = _impl_ptr->projects.begin(); iter != _impl_ptr->projects.end(); iter++) + for (std::list >::iterator iter = _impl_ptr->projects.begin(); iter != _impl_ptr->projects.end(); iter++) { project_ptr = *iter; project_ptr->get_name(temp_name); @@ -111,9 +111,9 @@ session::project_close( // remove clients from session, if not removed already project_ptr->get_clients(clients); - for (list >::iterator iter = clients.begin(); iter != clients.end(); iter++) + for (std::list >::iterator iter = clients.begin(); iter != clients.end(); iter++) { - string id; + std::string id; (*iter)->get_id(id); @@ -127,19 +127,19 @@ session::project_close( void session::client_add( - shared_ptr client_ptr) + boost::shared_ptr client_ptr) { _impl_ptr->clients.push_back(client_ptr); } void session::client_remove( - const string& id) + const std::string& id) { - shared_ptr client_ptr; - string temp_id; + boost::shared_ptr client_ptr; + std::string temp_id; - for (list >::iterator iter = _impl_ptr->clients.begin(); iter != _impl_ptr->clients.end(); iter++) + for (std::list >::iterator iter = _impl_ptr->clients.begin(); iter != _impl_ptr->clients.end(); iter++) { client_ptr = *iter; client_ptr->get_id(temp_id); @@ -152,13 +152,13 @@ session::client_remove( } } -shared_ptr -session::find_client_by_id(const string& id) +boost::shared_ptr +session::find_client_by_id(const std::string& id) { - shared_ptr client_ptr; - string temp_id; + boost::shared_ptr client_ptr; + std::string temp_id; - for (list >::iterator iter = _impl_ptr->clients.begin(); iter != _impl_ptr->clients.end(); iter++) + for (std::list >::iterator iter = _impl_ptr->clients.begin(); iter != _impl_ptr->clients.end(); iter++) { client_ptr = *iter; client_ptr->get_id(temp_id); @@ -169,5 +169,5 @@ session::find_client_by_id(const string& id) } } - return shared_ptr(); + return boost::shared_ptr(); } diff --git a/gui/session.hpp b/gui/session.hpp index 40e7d75b..ace7df69 100644 --- a/gui/session.hpp +++ b/gui/session.hpp @@ -42,26 +42,26 @@ public: void project_add( - shared_ptr project_ptr); + boost::shared_ptr project_ptr); void project_close( - const string& project_name); + const std::string& project_name); - shared_ptr find_project_by_name(const string& name); + boost::shared_ptr find_project_by_name(const std::string& name); void client_add( - shared_ptr client_ptr); + boost::shared_ptr client_ptr); void client_remove( - const string& id); + const std::string& id); - shared_ptr find_client_by_id(const string& id); + boost::shared_ptr find_client_by_id(const std::string& id); - sigc::signal1 > _signal_project_added; - sigc::signal1 > _signal_project_closed; + sigc::signal1 > _signal_project_added; + sigc::signal1 > _signal_project_closed; private: session_impl * _impl_ptr; -- 2.11.4.GIT