summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Client.cpp (renamed from src/LashClient.cpp)24
-rw-r--r--src/Client.hpp (renamed from src/LashClient.hpp)10
-rw-r--r--src/LashProxy.cpp66
-rw-r--r--src/Project.cpp21
-rw-r--r--src/Project.hpp11
-rw-r--r--src/ProjectList.cpp10
-rw-r--r--src/Session.cpp24
-rw-r--r--src/Session.hpp6
-rw-r--r--wscript2
9 files changed, 84 insertions, 90 deletions
diff --git a/src/LashClient.cpp b/src/Client.cpp
index a7dd4ae..3baf3c0 100644
--- a/src/LashClient.cpp
+++ b/src/Client.cpp
@@ -16,53 +16,53 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "LashClient.hpp"
+#include "Client.hpp"
#include "Patchage.hpp"
using namespace std;
-struct LashClientImpl {
- Project* project;
- string id;
- string name;
+struct ClientImpl {
+ Project* project;
+ string id;
+ string name;
};
-LashClient::LashClient(
+Client::Client(
Project* project,
const string& id,
const string& name)
{
- _impl = new LashClientImpl();
+ _impl = new ClientImpl();
_impl->project = project;
_impl->id = id;
_impl->name = name;
}
-LashClient::~LashClient()
+Client::~Client()
{
delete _impl;
}
Project*
-LashClient::get_project()
+Client::get_project()
{
return _impl->project;
}
const string&
-LashClient::get_id() const
+Client::get_id() const
{
return _impl->id;
}
const string&
-LashClient::get_name() const
+Client::get_name() const
{
return _impl->name;
}
void
-LashClient::set_name(const string& name)
+Client::set_name(const string& name)
{
if (_impl->name != name) {
_impl->name = name;
diff --git a/src/LashClient.hpp b/src/Client.hpp
index bd18d6c..a97508b 100644
--- a/src/LashClient.hpp
+++ b/src/Client.hpp
@@ -22,18 +22,18 @@
#include <string>
#include <sigc++/signal.h>
-class LashClientImpl;
+class ClientImpl;
class Project;
-class LashClient
+class Client
{
public:
- LashClient(
+ Client(
Project* project,
const std::string& id,
const std::string& name);
- ~LashClient();
+ ~Client();
Project* get_project();
@@ -45,7 +45,7 @@ public:
sigc::signal<void> _signal_renamed;
private:
- LashClientImpl* _impl;
+ ClientImpl* _impl;
};
#endif // PATCHAGE_LASH_CLIENT_HPP
diff --git a/src/LashProxy.cpp b/src/LashProxy.cpp
index 02fd311..7bd9ec5 100644
--- a/src/LashProxy.cpp
+++ b/src/LashProxy.cpp
@@ -1,4 +1,3 @@
-// -*- Mode: C++ ; indent-tabs-mode: t -*-
/* This file is part of Patchage.
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
*
@@ -23,7 +22,7 @@
#include "LashProxy.hpp"
#include "Session.hpp"
#include "Project.hpp"
-#include "LashClient.hpp"
+#include "Client.hpp"
#include "DBus.hpp"
#define LASH_SERVICE "org.nongnu.LASH"
@@ -42,35 +41,30 @@ struct LashProxyImpl {
void error_msg(const std::string& msg);
void info_msg(const std::string& msg);
- static
- DBusHandlerResult
- dbus_message_hook(
+ static DBusHandlerResult dbus_message_hook(
DBusConnection* connection,
- DBusMessage* message,
- void* proxy);
-
- bool
- call(
- bool response_expected,
- const char* iface,
- const char* method,
+ DBusMessage* message,
+ void* proxy);
+
+ bool call(
+ bool response_expected,
+ const char* iface,
+ const char* method,
DBusMessage** reply_ptr,
- int in_type,
+ int in_type,
...);
- shared_ptr<Project>
- on_project_added(const string& name);
+ shared_ptr<Project> on_project_added(const string& name);
- shared_ptr<LashClient>
- on_client_added(
+ shared_ptr<Client> on_client_added(
shared_ptr<Project> project,
- string id,
- string name);
+ string id,
+ string name);
- bool _server_responding;
- Session* _session;
- LashProxy* _interface;
- Patchage* _app;
+ bool _server_responding;
+ Session* _session;
+ LashProxy* _interface;
+ Patchage* _app;
};
LashProxy::LashProxy(Patchage* app, Session* session)
@@ -131,17 +125,17 @@ LashProxyImpl::dbus_message_hook(
DBusMessage* message,
void* proxy)
{
- const char* project_name;
- const char* new_project_name;
- const char* object_name;
- const char* old_owner;
- const char* new_owner;
- const char* value_string;
- const char* client_id;
- const char* client_name;
- dbus_bool_t modified_status;
+ const char* project_name;
+ const char* new_project_name;
+ const char* object_name;
+ const char* old_owner;
+ const char* new_owner;
+ const char* value_string;
+ const char* client_id;
+ const char* client_name;
+ dbus_bool_t modified_status;
shared_ptr<Project> project;
- shared_ptr<LashClient> client;
+ shared_ptr<Client> client;
assert(proxy);
LashProxyImpl* me = reinterpret_cast<LashProxyImpl*>(proxy);
@@ -485,13 +479,13 @@ LashProxyImpl::on_project_added(const string& name)
return project;
}
-shared_ptr<LashClient>
+shared_ptr<Client>
LashProxyImpl::on_client_added(
shared_ptr<Project> project,
string id,
string name)
{
- shared_ptr<LashClient> client(new LashClient(project.get(), id, name));
+ shared_ptr<Client> client(new Client(project.get(), id, name));
project->on_client_added(client);
_session->client_add(client);
diff --git a/src/Project.cpp b/src/Project.cpp
index a6e657b..0c19b8e 100644
--- a/src/Project.cpp
+++ b/src/Project.cpp
@@ -1,6 +1,5 @@
-// -*- Mode: C++ ; indent-tabs-mode: t -*-
/* This file is part of Patchage.
- * Copyright (C) 2008-2009 David Robillard <http://drobilla.net>
+ * Copyright (C) 2008-2010 David Robillard <http://drobilla.net>
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
*
* Patchage is free software; you can redistribute it and/or modify it under the
@@ -19,7 +18,7 @@
#include "Project.hpp"
#include "LashProxy.hpp"
-#include "LashClient.hpp"
+#include "Client.hpp"
using namespace std;
using boost::shared_ptr;
@@ -30,7 +29,7 @@ struct ProjectImpl {
string description;
string notes;
bool modified_status;
- list< shared_ptr<LashClient> > clients;
+ list< shared_ptr<Client> > clients;
};
Project::Project(LashProxy* proxy, const string& name)
@@ -39,27 +38,24 @@ Project::Project(LashProxy* proxy, const string& name)
proxy->get_loaded_project_properties(name, properties);
- _impl = new ProjectImpl;
+ _impl = new ProjectImpl();
_impl->proxy = proxy;
_impl->name = name;
_impl->description = properties.description;
_impl->notes = properties.notes;
_impl->modified_status = properties.modified_status;
-
- //g_app->info_msg("project created");
}
Project::~Project()
{
delete _impl;
- //g_app->info_msg("project destroyed");
}
void
Project::clear()
{
- shared_ptr<LashClient> client;
+ shared_ptr<Client> client;
while (!_impl->clients.empty()) {
client = _impl->clients.front();
@@ -106,7 +102,7 @@ Project::get_clients() const
}
void
-Project::on_client_added(shared_ptr<LashClient> client)
+Project::on_client_added(shared_ptr<Client> client)
{
_impl->clients.push_back(client);
_signal_client_added.emit(client);
@@ -115,9 +111,10 @@ Project::on_client_added(shared_ptr<LashClient> client)
void
Project::on_client_removed(const string& id)
{
- shared_ptr<LashClient> client;
+ shared_ptr<Client> client;
- for (list< shared_ptr<LashClient> >::iterator iter = _impl->clients.begin(); iter != _impl->clients.end(); iter++) {
+ for (list< shared_ptr<Client> >::iterator iter = _impl->clients.begin();
+ iter != _impl->clients.end(); iter++) {
client = *iter;
if (client->get_id() == id) {
diff --git a/src/Project.hpp b/src/Project.hpp
index 0509bf6..b31efa3 100644
--- a/src/Project.hpp
+++ b/src/Project.hpp
@@ -1,4 +1,3 @@
-// -*- Mode: C++ ; indent-tabs-mode: t -*-
/* This file is part of Patchage.
* Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
*
@@ -28,7 +27,7 @@
struct ProjectImpl;
class LashProxy;
class LashProxyImpl;
-class LashClient;
+class Client;
class Project {
public:
@@ -38,7 +37,7 @@ public:
void clear();
- typedef std::list< boost::shared_ptr<LashClient> > Clients;
+ typedef std::list< boost::shared_ptr<Client> > Clients;
const std::string& get_name() const;
const std::string& get_description() const;
@@ -55,8 +54,8 @@ public:
sigc::signal<void> _signal_description_changed;
sigc::signal<void> _signal_notes_changed;
- sigc::signal< void, boost::shared_ptr<LashClient> > _signal_client_added;
- sigc::signal< void, boost::shared_ptr<LashClient> > _signal_client_removed;
+ sigc::signal< void, boost::shared_ptr<Client> > _signal_client_added;
+ sigc::signal< void, boost::shared_ptr<Client> > _signal_client_removed;
private:
friend class LashProxyImpl;
@@ -65,7 +64,7 @@ private:
void on_modified_status_changed(bool modified_status);
void on_description_changed(const std::string& description);
void on_notes_changed(const std::string& notes);
- void on_client_added(boost::shared_ptr<LashClient> client);
+ void on_client_added(boost::shared_ptr<Client> client);
void on_client_removed(const std::string& id);
ProjectImpl* _impl;
diff --git a/src/ProjectList.cpp b/src/ProjectList.cpp
index 155a878..c209ff7 100644
--- a/src/ProjectList.cpp
+++ b/src/ProjectList.cpp
@@ -19,7 +19,7 @@
#include <gtkmm.h>
#include <libglademm/xml.h>
-#include "LashClient.hpp"
+#include "Client.hpp"
#include "LashProxy.hpp"
#include "Project.hpp"
#include "ProjectList.hpp"
@@ -43,8 +43,8 @@ struct ProjectListImpl : public sigc::trackable {
void project_added(shared_ptr<Project> project);
void project_closed(shared_ptr<Project> project);
void project_renamed(Gtk::TreeModel::iterator iter);
- void client_added(shared_ptr<LashClient> client, Gtk::TreeModel::iterator iter);
- void client_removed(shared_ptr<LashClient> client, Gtk::TreeModel::iterator iter);
+ void client_added(shared_ptr<Client> client, Gtk::TreeModel::iterator iter);
+ void client_removed(shared_ptr<Client> client, Gtk::TreeModel::iterator iter);
bool on_button_press_event(GdkEventButton * event);
@@ -264,7 +264,7 @@ ProjectListImpl::project_renamed(
void
ProjectListImpl::client_added(
- shared_ptr<LashClient> client,
+ shared_ptr<Client> client,
Gtk::TreeModel::iterator iter)
{
Gtk::TreeModel::Path path = _model->get_path(iter);
@@ -279,7 +279,7 @@ ProjectListImpl::client_added(
void
ProjectListImpl::client_removed(
- shared_ptr<LashClient> client,
+ shared_ptr<Client> client,
Gtk::TreeModel::iterator iter)
{
if (!iter)
diff --git a/src/Session.cpp b/src/Session.cpp
index 85d9a58..a2f0850 100644
--- a/src/Session.cpp
+++ b/src/Session.cpp
@@ -16,7 +16,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include "LashClient.hpp"
+#include "Client.hpp"
#include "Project.hpp"
#include "Session.hpp"
@@ -24,8 +24,8 @@ using namespace std;
using boost::shared_ptr;
struct SessionImpl {
- list< shared_ptr<Project> > projects;
- list< shared_ptr<LashClient> > clients;
+ list< shared_ptr<Project> > projects;
+ list< shared_ptr<Client> > clients;
};
Session::Session()
@@ -65,7 +65,8 @@ shared_ptr<Project>
Session::find_project_by_name(const string& name)
{
shared_ptr<Project> project;
- for (list< shared_ptr<Project> >::iterator i = _impl->projects.begin(); i != _impl->projects.end(); i++)
+ for (list< shared_ptr<Project> >::iterator i = _impl->projects.begin();
+ i != _impl->projects.end(); i++)
if ((*i)->get_name() == name)
return (*i);
@@ -78,7 +79,8 @@ Session::project_close(const string& project_name)
shared_ptr<Project> project;
Project::Clients clients;
- for (list<shared_ptr<Project> >::iterator iter = _impl->projects.begin(); iter != _impl->projects.end(); iter++) {
+ for (list<shared_ptr<Project> >::iterator iter = _impl->projects.begin();
+ iter != _impl->projects.end(); iter++) {
project = *iter;
if (project->get_name() == project_name) {
@@ -96,7 +98,7 @@ Session::project_close(const string& project_name)
}
void
-Session::client_add(shared_ptr<LashClient> client)
+Session::client_add(shared_ptr<Client> client)
{
_impl->clients.push_back(client);
}
@@ -104,7 +106,8 @@ Session::client_add(shared_ptr<LashClient> client)
void
Session::client_remove(const string& id)
{
- for (list<shared_ptr<LashClient> >::iterator i = _impl->clients.begin(); i != _impl->clients.end(); i++) {
+ for (list< shared_ptr<Client> >::iterator i = _impl->clients.begin();
+ i != _impl->clients.end(); i++) {
if ((*i)->get_id() == id) {
_impl->clients.erase(i);
return;
@@ -112,13 +115,14 @@ Session::client_remove(const string& id)
}
}
-shared_ptr<LashClient>
+shared_ptr<Client>
Session::find_client_by_id(const string& id)
{
- for (list<shared_ptr<LashClient> >::iterator i = _impl->clients.begin(); i != _impl->clients.end(); i++)
+ for (list< shared_ptr<Client> >::iterator i = _impl->clients.begin();
+ i != _impl->clients.end(); i++)
if ((*i)->get_id() == id)
return *i;
- return shared_ptr<LashClient>();
+ return shared_ptr<Client>();
}
diff --git a/src/Session.hpp b/src/Session.hpp
index 0342794..a2cf381 100644
--- a/src/Session.hpp
+++ b/src/Session.hpp
@@ -23,7 +23,7 @@
struct SessionImpl;
class Project;
-class LashClient;
+class Client;
class Session
{
@@ -38,10 +38,10 @@ public:
boost::shared_ptr<Project> find_project_by_name(const std::string& name);
- void client_add(boost::shared_ptr<LashClient> client);
+ void client_add(boost::shared_ptr<Client> client);
void client_remove(const std::string& id);
- boost::shared_ptr<LashClient> find_client_by_id(const std::string& id);
+ boost::shared_ptr<Client> find_client_by_id(const std::string& id);
sigc::signal< void, boost::shared_ptr<Project> > _signal_project_added;
sigc::signal< void, boost::shared_ptr<Project> > _signal_project_closed;
diff --git a/wscript b/wscript
index baee0e6..cb6ceb2 100644
--- a/wscript
+++ b/wscript
@@ -107,7 +107,7 @@ def build(bld):
prog.install_path = '${BINDIR}'
autowaf.use_lib(bld, prog, 'DBUS FLOWCANVAS GLADEMM DBUS_GLIB GNOMECANVASMM GTHREAD RAUL')
prog.source = '''
- src/LashClient.cpp
+ src/Client.cpp
src/Patchage.cpp
src/PatchageCanvas.cpp
src/PatchageEvent.cpp