From 79acce6ded68062851b9e4ab4966c74e9fc7a714 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 Jan 2013 01:11:58 +0000 Subject: Use lowercase namespace names. git-svn-id: http://svn.drobilla.net/lad/trunk/machina@4945 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/EdgeView.cpp | 12 ++++++------ src/gui/EdgeView.hpp | 16 ++++++++-------- src/gui/MachinaCanvas.cpp | 22 +++++++++++----------- src/gui/MachinaCanvas.hpp | 18 +++++++++--------- src/gui/MachinaGUI.cpp | 24 ++++++++++++------------ src/gui/MachinaGUI.hpp | 34 +++++++++++++++++----------------- src/gui/NodePropertiesWindow.cpp | 12 ++++++------ src/gui/NodePropertiesWindow.hpp | 16 ++++++++-------- src/gui/NodeView.cpp | 16 ++++++++-------- src/gui/NodeView.hpp | 24 ++++++++++++------------ src/gui/WidgetFactory.hpp | 8 ++++---- src/gui/main.cpp | 10 +++++----- 12 files changed, 106 insertions(+), 106 deletions(-) (limited to 'src/gui') diff --git a/src/gui/EdgeView.cpp b/src/gui/EdgeView.cpp index dd28a41..ec77a7b 100644 --- a/src/gui/EdgeView.cpp +++ b/src/gui/EdgeView.cpp @@ -25,8 +25,8 @@ #include "MachinaGUI.hpp" #include "NodeView.hpp" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { /* probability colour stuff */ @@ -67,7 +67,7 @@ using namespace Ganv; EdgeView::EdgeView(Canvas& canvas, SPtr src, SPtr dst, - SPtr edge) + SPtr edge) : Ganv::Edge(canvas, src.get(), dst.get(), 0x9FA0A0F4, true, false) , _edge(edge) { @@ -127,12 +127,12 @@ EdgeView::on_event(GdkEvent* ev) } void -EdgeView::on_property(Machina::URIInt key, const Raul::Atom& value) +EdgeView::on_property(machina::URIInt key, const Raul::Atom& value) { if (key == URIs::instance().machina_probability) { set_color(edge_color(value.get_float())); } } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/EdgeView.hpp b/src/gui/EdgeView.hpp index bafcb6b..6d51427 100644 --- a/src/gui/EdgeView.hpp +++ b/src/gui/EdgeView.hpp @@ -24,20 +24,20 @@ #include "machina/types.hpp" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { class NodeView; class EdgeView : public Ganv::Edge - , public Machina::Client::ClientObject::View + , public machina::client::ClientObject::View { public: EdgeView(Ganv::Canvas& canvas, SPtr src, SPtr dst, - SPtr edge); + SPtr edge); void show_label(bool show); @@ -45,14 +45,14 @@ public: private: bool on_event(GdkEvent* ev); - void on_property(Machina::URIInt key, const Raul::Atom& value); + void on_property(machina::URIInt key, const Raul::Atom& value); float probability() const; - SPtr _edge; + SPtr _edge; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_EDGEVIEW_HPP diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp index 95a3f14..7a26ef0 100644 --- a/src/gui/MachinaCanvas.cpp +++ b/src/gui/MachinaCanvas.cpp @@ -33,8 +33,8 @@ using namespace Raul; using namespace Ganv; -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { MachinaCanvas::MachinaCanvas(MachinaGUI* app, int width, int height) : Canvas(width, height) @@ -103,9 +103,9 @@ MachinaCanvas::on_event(GdkEvent* event) } void -MachinaCanvas::on_new_object(SPtr object) +MachinaCanvas::on_new_object(SPtr object) { - const Machina::URIs& uris = URIs::instance(); + const machina::URIs& uris = URIs::instance(); const Raul::Atom& type = object->get(uris.rdf_type); if (!type.is_valid()) { return; @@ -127,9 +127,9 @@ MachinaCanvas::on_new_object(SPtr object) object->set_view(view); } else if (type.get() == uris.machina_Edge) { - SPtr tail = _app->client_model()->find( + SPtr tail = _app->client_model()->find( object->get(uris.machina_tail_id).get_int32()); - SPtr head = _app->client_model()->find( + SPtr head = _app->client_model()->find( object->get(uris.machina_head_id).get_int32()); if (!tail || !head) { @@ -150,13 +150,13 @@ MachinaCanvas::on_new_object(SPtr object) } void -MachinaCanvas::on_erase_object(SPtr object) +MachinaCanvas::on_erase_object(SPtr object) { const Raul::Atom& type = object->get(URIs::instance().rdf_type); if (type.get() == URIs::instance().machina_Node) { // Destruction of the view will remove from the canvas } else if (type.get() == URIs::instance().machina_Edge) { - object->set_view(SPtr()); + object->set_view(SPtr()); } else { std::cerr << "Unknown object type" << std::endl; } @@ -165,7 +165,7 @@ MachinaCanvas::on_erase_object(SPtr object) void MachinaCanvas::action_create_node(double x, double y) { - Machina::Client::ClientObject obj(0); + machina::client::ClientObject obj(0); obj.set(URIs::instance().rdf_type, _app->forge().make_urid(URIs::instance().machina_Node)); obj.set(URIs::instance().machina_canvas_x, _app->forge().make((float)x)); @@ -188,5 +188,5 @@ MachinaCanvas::action_disconnect(SPtr src, _app->controller()->disconnect(src->node()->id(), head->node()->id()); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/MachinaCanvas.hpp b/src/gui/MachinaCanvas.hpp index a9ca5b9..c396931 100644 --- a/src/gui/MachinaCanvas.hpp +++ b/src/gui/MachinaCanvas.hpp @@ -25,11 +25,11 @@ using namespace Ganv; -namespace Machina { +namespace machina { -namespace Client { class ClientObject; } +namespace client { class ClientObject; } -namespace GUI { +namespace gui { class MachinaGUI; class NodeView; @@ -40,11 +40,11 @@ class MachinaCanvas public: MachinaCanvas(MachinaGUI* app, int width, int height); - //void build(SPtr machine, bool show_labels); + //void build(SPtr machine, bool show_labels); //void update_edges(); - void on_new_object(SPtr object); - void on_erase_object(SPtr object); + void on_new_object(SPtr object); + void on_erase_object(SPtr object); MachinaGUI* app() { return _app; } @@ -54,7 +54,7 @@ protected: bool node_clicked(WPtr item, GdkEventButton* ev); private: - //SPtr create_node_view(SPtr node); + //SPtr create_node_view(SPtr node); void action_create_node(double x, double y); @@ -68,7 +68,7 @@ private: WPtr _last_clicked; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_CANVAS_HPP_HPP diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp index f162ebd..376f42e 100644 --- a/src/gui/MachinaGUI.cpp +++ b/src/gui/MachinaGUI.cpp @@ -38,16 +38,16 @@ #include "machina/Evolver.hpp" #endif -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { -MachinaGUI::MachinaGUI(SPtr engine) +MachinaGUI::MachinaGUI(SPtr engine) : _refresh(false) , _evolve(false) , _unit(TimeUnit::BEATS, 19200) , _engine(engine) - , _client_model(new Machina::Client::ClientModel()) - , _controller(new Machina::Controller(_engine, *_client_model.get())) + , _client_model(new machina::client::ClientModel()) + , _controller(new machina::Controller(_engine, *_client_model.get())) , _maid(new Raul::Maid()) { _canvas = SPtr(new MachinaCanvas(this, 1600*2, 1200*2)); @@ -241,7 +241,7 @@ MachinaGUI::idle_callback() static void erase_node(GanvNode* node, void* data) { - Machina::Controller* controller = (Machina::Controller*)data; + machina::Controller* controller = (machina::Controller*)data; NodeView* const view = dynamic_cast( Glib::wrap(GANV_NODE(node))); if (view) { @@ -429,7 +429,7 @@ MachinaGUI::menu_file_open() const int result = dialog.run(); if (result == Gtk::RESPONSE_OK) { - SPtr new_machine = _engine->load_machine(dialog.get_uri()); + SPtr new_machine = _engine->load_machine(dialog.get_uri()); if (new_machine) { _canvas->destroy(); _controller->announce(new_machine); @@ -536,7 +536,7 @@ MachinaGUI::menu_import_midi() const double length_dbl = length_sb->get_value_as_int(); const Raul::TimeStamp length(_unit, length_dbl); - SPtr machine = _engine->load_machine_midi( + SPtr machine = _engine->load_machine_midi( dialog.get_filename(), 0.0, length); if (machine) { @@ -695,16 +695,16 @@ MachinaGUI::play_toggled() } void -MachinaGUI::on_new_object(SPtr object) +MachinaGUI::on_new_object(SPtr object) { _canvas->on_new_object(object); } void -MachinaGUI::on_erase_object(SPtr object) +MachinaGUI::on_erase_object(SPtr object) { _canvas->on_erase_object(object); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp index f9b0857..2636051 100644 --- a/src/gui/MachinaGUI.hpp +++ b/src/gui/MachinaGUI.hpp @@ -29,30 +29,30 @@ using namespace std; -namespace Machina { +namespace machina { class Machine; class Engine; class Evolver; class Controller; -namespace Client { +namespace client { class ClientModel; class ClientObject; } -namespace GUI { +namespace gui { class MachinaCanvas; class MachinaGUI { public: - MachinaGUI(SPtr engine); + MachinaGUI(SPtr engine); ~MachinaGUI(); SPtr canvas() { return _canvas; } - SPtr engine() { return _engine; } + SPtr engine() { return _engine; } Raul::Forge& forge() { return _forge; } @@ -63,14 +63,14 @@ public: void attach(); void quit() { _main_window->hide(); } - SPtr controller() { return _controller; } + SPtr controller() { return _controller; } inline void queue_refresh() { _refresh = true; } - void on_new_object(SPtr object); - void on_erase_object(SPtr object); + void on_new_object(SPtr object); + void on_erase_object(SPtr object); - SPtr client_model() { + SPtr client_model() { return _client_model; } @@ -91,8 +91,8 @@ protected: void arrange(); void load_target_clicked(); - void random_mutation(SPtr machine); - void mutate(SPtr machine, unsigned mutation); + void random_mutation(SPtr machine); + void mutate(SPtr machine, unsigned mutation); void zoom(double z); void update_toolbar(); @@ -120,12 +120,12 @@ protected: Raul::TimeUnit _unit; SPtr _canvas; - SPtr _engine; - SPtr _client_model; - SPtr _controller; + SPtr _engine; + SPtr _client_model; + SPtr _controller; SPtr _maid; - SPtr _evolver; + SPtr _evolver; Raul::Forge _forge; @@ -174,7 +174,7 @@ protected: Gtk::ToolButton* _adjust_edge_button; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_GUI_HPP diff --git a/src/gui/NodePropertiesWindow.cpp b/src/gui/NodePropertiesWindow.cpp index a58d649..bd275f5 100644 --- a/src/gui/NodePropertiesWindow.cpp +++ b/src/gui/NodePropertiesWindow.cpp @@ -21,8 +21,8 @@ using namespace std; -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { NodePropertiesWindow* NodePropertiesWindow::_instance = NULL; @@ -88,7 +88,7 @@ NodePropertiesWindow::ok_clicked() } void -NodePropertiesWindow::set_node(SPtr node) +NodePropertiesWindow::set_node(SPtr node) { _node = node; #if 0 @@ -109,7 +109,7 @@ NodePropertiesWindow::set_node(SPtr node) void NodePropertiesWindow::present(Gtk::Window* parent, - SPtr node) + SPtr node) { if (!_instance) { Glib::RefPtr xml = WidgetFactory::create(); @@ -125,5 +125,5 @@ NodePropertiesWindow::present(Gtk::Window* parent, _instance->show(); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/NodePropertiesWindow.hpp b/src/gui/NodePropertiesWindow.hpp index 78a5285..002f0cd 100644 --- a/src/gui/NodePropertiesWindow.hpp +++ b/src/gui/NodePropertiesWindow.hpp @@ -22,11 +22,11 @@ #include "machina/types.hpp" -namespace Machina { +namespace machina { -namespace Client { class ClientObject; } +namespace client { class ClientObject; } -namespace GUI { +namespace gui { class NodePropertiesWindow : public Gtk::Dialog @@ -38,10 +38,10 @@ public: ~NodePropertiesWindow(); static void present(Gtk::Window* parent, - SPtr node); + SPtr node); private: - void set_node(SPtr node); + void set_node(SPtr node); void apply_clicked(); void cancel_clicked(); @@ -49,7 +49,7 @@ private: static NodePropertiesWindow* _instance; - SPtr _node; + SPtr _node; Gtk::SpinButton* _note_spinbutton; Gtk::SpinButton* _duration_spinbutton; @@ -58,7 +58,7 @@ private: Gtk::Button* _ok_button; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // NODEPROPERTIESWINDOW_HPP diff --git a/src/gui/NodeView.cpp b/src/gui/NodeView.cpp index 79258cd..674531c 100644 --- a/src/gui/NodeView.cpp +++ b/src/gui/NodeView.cpp @@ -28,12 +28,12 @@ using namespace std; -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { NodeView::NodeView(Gtk::Window* window, Ganv::Canvas& canvas, - SPtr node, + SPtr node, double x, double y) : Ganv::Circle(canvas, "", x, y, 20, false) @@ -57,7 +57,7 @@ NodeView::on_double_click(GdkEventButton*) } bool -NodeView::node_is(Raul::Forge& forge, Machina::URIInt key) +NodeView::node_is(Raul::Forge& forge, machina::URIInt key) { const Raul::Atom& value = _node->get(key); return value.type() == forge.Bool && value.get_bool(); @@ -124,7 +124,7 @@ NodeView::show_label(bool show) } void -NodeView::on_property(Machina::URIInt key, const Raul::Atom& value) +NodeView::on_property(machina::URIInt key, const Raul::Atom& value) { static const uint32_t active_color = 0x408040FF; static const uint32_t active_border_color = 0x00FF00FF; @@ -161,7 +161,7 @@ NodeView::on_property(Machina::URIInt key, const Raul::Atom& value) } void -NodeView::on_action_property(Machina::URIInt key, const Raul::Atom& value) +NodeView::on_action_property(machina::URIInt key, const Raul::Atom& value) { if (key == URIs::instance().machina_note_number) { show_label(true); @@ -175,5 +175,5 @@ NodeView::set_default_colors() set_border_color(_default_border_color); } -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/NodeView.hpp b/src/gui/NodeView.hpp index 5507a75..815e9e2 100644 --- a/src/gui/NodeView.hpp +++ b/src/gui/NodeView.hpp @@ -24,21 +24,21 @@ #include "machina/types.hpp" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { class NodeView : public Ganv::Circle - , public Machina::Client::ClientObject::View + , public machina::client::ClientObject::View { public: NodeView(Gtk::Window* window, Canvas& canvas, - SPtr node, + SPtr node, double x, double y); - SPtr node() { return _node; } + SPtr node() { return _node; } void show_label(bool show); @@ -53,23 +53,23 @@ public: private: bool on_event(GdkEvent* ev); bool on_double_click(GdkEventButton* ev); - void on_property(Machina::URIInt key, const Raul::Atom& value); - void on_action_property(Machina::URIInt key, const Raul::Atom& value); + void on_property(machina::URIInt key, const Raul::Atom& value); + void on_action_property(machina::URIInt key, const Raul::Atom& value); - bool node_is(Raul::Forge& forge, Machina::URIInt key); + bool node_is(Raul::Forge& forge, machina::URIInt key); Gtk::Window* _window; - SPtr _node; + SPtr _node; uint32_t _default_border_color; uint32_t _default_fill_color; - SPtr _enter_action; + SPtr _enter_action; sigc::connection _enter_action_connection; sigc::signal _signal_clicked; }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui #endif // MACHINA_NODEVIEW_HPP diff --git a/src/gui/WidgetFactory.hpp b/src/gui/WidgetFactory.hpp index 4f54998..38ed809 100644 --- a/src/gui/WidgetFactory.hpp +++ b/src/gui/WidgetFactory.hpp @@ -23,8 +23,8 @@ #include "machina_config.h" -namespace Machina { -namespace GUI { +namespace machina { +namespace gui { class WidgetFactory { @@ -62,5 +62,5 @@ public: }; -} // namespace Machina -} // namespace GUI +} // namespace machina +} // namespace gui diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 25b1254..c61c7a3 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -27,7 +27,7 @@ #include "MachinaGUI.hpp" using namespace std; -using namespace Machina; +using namespace machina; int main(int argc, char** argv) @@ -38,16 +38,16 @@ main(int argc, char** argv) Sord::World rdf_world; - Machina::URIs::init(); + machina::URIs::init(); - SPtr machine; + SPtr machine; // Load machine, if given #if 0 if (argc >= 2) { const string filename = argv[1]; cout << "Building machine from MIDI file " << filename << endl; - SPtr file_driver(new Machina::SMFDriver()); + SPtr file_driver(new machina::SMFDriver()); if (argc >= 3) { float q = strtof(argv[2], NULL); @@ -83,7 +83,7 @@ main(int argc, char** argv) Gtk::Main app(argc, argv); driver->activate(); - GUI::MachinaGUI gui(engine); + gui::MachinaGUI gui(engine); app.run(*gui.window()); -- cgit v1.2.1