diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/App.hpp | 11 | ||||
-rw-r--r-- | src/gui/BreadCrumbs.hpp | 6 | ||||
-rw-r--r-- | src/gui/Configuration.cpp | 8 | ||||
-rw-r--r-- | src/gui/Configuration.hpp | 2 | ||||
-rw-r--r-- | src/gui/ControlPanel.hpp | 6 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.cpp | 10 | ||||
-rw-r--r-- | src/gui/LoadPluginWindow.hpp | 10 | ||||
-rw-r--r-- | src/gui/NodeControlWindow.cpp | 3 | ||||
-rw-r--r-- | src/gui/PatchBox.hpp | 11 | ||||
-rw-r--r-- | src/gui/PatchCanvas.cpp | 6 | ||||
-rw-r--r-- | src/gui/PatchCanvas.hpp | 4 | ||||
-rw-r--r-- | src/gui/PatchTreeWindow.hpp | 7 | ||||
-rw-r--r-- | src/gui/PatchView.hpp | 1 | ||||
-rw-r--r-- | src/gui/Port.hpp | 5 | ||||
-rw-r--r-- | src/gui/PortMenu.cpp | 2 | ||||
-rw-r--r-- | src/gui/SubpatchModule.cpp | 4 | ||||
-rw-r--r-- | src/gui/Window.hpp | 8 | ||||
-rw-r--r-- | src/gui/WindowFactory.cpp | 4 | ||||
-rw-r--r-- | src/gui/WindowFactory.hpp | 8 |
19 files changed, 69 insertions, 47 deletions
diff --git a/src/gui/App.hpp b/src/gui/App.hpp index afe812a9..a66a83a8 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -88,8 +88,12 @@ public: bool can_control(const Client::PortModel* port) const; bool signal() const { return _enable_signal; } - bool disable_signals() { bool old = _enable_signal; _enable_signal = false; return old; } void enable_signals(bool b) { _enable_signal = b; } + bool disable_signals() { + bool old = _enable_signal; + _enable_signal = false; + return old; + } uint32_t sample_rate() const; @@ -109,8 +113,6 @@ public: SharedPtr<Serialisation::Serialiser> serialiser(); - static inline App& instance() { assert(_instance); return *_instance; } - static SharedPtr<App> create(Ingen::Shared::World* world); void run(); @@ -133,7 +135,7 @@ protected: LexicalCompare<std::string, int> > Icons; Icons _icons; - App(Ingen::Shared::World* world); + explicit App(Ingen::Shared::World* world); bool animate(); void response(int32_t id, Ingen::Status status); @@ -145,7 +147,6 @@ protected: static void* icon_destroyed(void* data); static Gtk::Main* _main; - static App* _instance; SharedPtr<Client::SigClientInterface> _client; SharedPtr<Client::ClientStore> _store; diff --git a/src/gui/BreadCrumbs.hpp b/src/gui/BreadCrumbs.hpp index 39b7db42..0a0ca55b 100644 --- a/src/gui/BreadCrumbs.hpp +++ b/src/gui/BreadCrumbs.hpp @@ -39,7 +39,7 @@ namespace GUI { class BreadCrumbs : public Gtk::HBox { public: - BreadCrumbs(App& app); + explicit BreadCrumbs(App& app); SharedPtr<PatchView> view(const Raul::Path& path); @@ -64,7 +64,7 @@ private: : _path(path) , _view(view) { - assert( !view || view->patch()->path() == path); + assert(!view || view->patch()->path() == path); set_border_width(0); set_path(path); set_can_focus(false); @@ -72,7 +72,7 @@ private: } void set_view(SharedPtr<PatchView> view) { - assert( !view || view->patch()->path() == _path); + assert(!view || view->patch()->path() == _path); _view = view; } diff --git a/src/gui/Configuration.cpp b/src/gui/Configuration.cpp index 23246719..a6d06487 100644 --- a/src/gui/Configuration.cpp +++ b/src/gui/Configuration.cpp @@ -40,11 +40,11 @@ Configuration::Configuration(App& app) // Colours from the Tango palette with modified V : _app(app) , _name_style(HUMAN) - , _audio_port_color( 0x4A8A0EFF) // Green + , _audio_port_color(0x4A8A0EFF) // Green , _control_port_color(0x244678FF) // Blue - , _event_port_color( 0x960909FF) // Red - , _string_port_color( 0x5C3566FF) // Plum - , _value_port_color( 0xBABDB6FF) // Aluminum + , _event_port_color(0x960909FF) // Red + , _string_port_color(0x5C3566FF) // Plum + , _value_port_color(0xBABDB6FF) // Aluminum { } diff --git a/src/gui/Configuration.hpp b/src/gui/Configuration.hpp index 0b33016b..c3aec5fc 100644 --- a/src/gui/Configuration.hpp +++ b/src/gui/Configuration.hpp @@ -41,7 +41,7 @@ class Port; class Configuration { public: - Configuration(App& app); + explicit Configuration(App& app); ~Configuration(); void load_settings(std::string filename = ""); diff --git a/src/gui/ControlPanel.hpp b/src/gui/ControlPanel.hpp index 2c3551e5..50bdfb26 100644 --- a/src/gui/ControlPanel.hpp +++ b/src/gui/ControlPanel.hpp @@ -60,8 +60,8 @@ public: void enable_port(const Raul::Path& path); void disable_port(const Raul::Path& path); - size_t num_controls() const { return _controls.size(); } - std::pair<int,int> ideal_size() const { return _ideal_size; } + size_t num_controls() const { return _controls.size(); } + std::pair<int, int> ideal_size() const { return _ideal_size; } // Callback for Control void value_changed_atom(SharedPtr<const Client::PortModel> port, @@ -74,7 +74,7 @@ public: private: App* _app; - std::pair<int,int> _ideal_size; + std::pair<int, int> _ideal_size; std::vector<Control*> _controls; Gtk::VBox* _control_box; bool _callback_enabled; diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 067a706e..ccad9a2c 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -81,10 +81,10 @@ LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, row[_criteria_columns._col_label] = "Name contains"; row[_criteria_columns._col_criteria] = CriteriaColumns::NAME; _filter_combo->set_active(iter); - iter = _criteria_liststore->append(); row = *iter; + row = *(iter = _criteria_liststore->append()); row[_criteria_columns._col_label] = "Type contains"; row[_criteria_columns._col_criteria] = CriteriaColumns::TYPE; - iter = _criteria_liststore->append(); row = *iter; + row = *(iter = _criteria_liststore->append()); row[_criteria_columns._col_label] = "URI contains"; row[_criteria_columns._col_criteria] = CriteriaColumns::URI; _filter_combo->pack_start(_criteria_columns._col_label); @@ -406,9 +406,11 @@ LoadPluginWindow::filter_changed() field = name.get_string(); break; case CriteriaColumns::TYPE: - field = plugin->type_uri().str(); break; + field = plugin->type_uri().str(); + break; case CriteriaColumns::URI: - field = plugin->uri().str(); break; + field = plugin->uri().str(); + break; default: throw; } diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp index 86ec5b2a..9d456e4a 100644 --- a/src/gui/LoadPluginWindow.hpp +++ b/src/gui/LoadPluginWindow.hpp @@ -32,7 +32,10 @@ namespace Ingen { -namespace Client { class PatchModel; class PluginModel; } +namespace Client { +class PatchModel; +class PluginModel; +} namespace GUI { @@ -86,7 +89,10 @@ private: public: enum Criteria { NAME, TYPE, URI, }; - CriteriaColumns() { add(_col_label); add(_col_criteria); } + CriteriaColumns() { + add(_col_label); + add(_col_criteria); + } Gtk::TreeModelColumn<Glib::ustring> _col_label; Gtk::TreeModelColumn<Criteria> _col_criteria; diff --git a/src/gui/NodeControlWindow.cpp b/src/gui/NodeControlWindow.cpp index ddc99348..c0b82f89 100644 --- a/src/gui/NodeControlWindow.cpp +++ b/src/gui/NodeControlWindow.cpp @@ -95,7 +95,8 @@ NodeControlWindow::~NodeControlWindow() void NodeControlWindow::resize() { - pair<int,int> controls_size = _control_panel->ideal_size(); + pair<int, int> controls_size = _control_panel->ideal_size(); + int width = controls_size.first; int height = controls_size.second; diff --git a/src/gui/PatchBox.hpp b/src/gui/PatchBox.hpp index c7d4168a..bc5c8c9a 100644 --- a/src/gui/PatchBox.hpp +++ b/src/gui/PatchBox.hpp @@ -23,14 +23,17 @@ #include "Window.hpp" -namespace Raul { class Atom; class Path; } +namespace Raul { +class Atom; +class Path; +} namespace Ingen { namespace Client { - class PatchModel; - class PortModel; - class ObjectModel; +class PatchModel; +class PortModel; +class ObjectModel; } namespace GUI { diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 589f4214..b322f29f 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -359,7 +359,7 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> p) Glib::RefPtr<Gdk::Pixbuf> icon = _app.icon_from_path( PluginModel::get_lv2_icon_path(p->lilv_plugin()), 16); - pair<iterator,iterator> range = _class_menus.equal_range(class_uri_str); + pair<iterator, iterator> range = _class_menus.equal_range(class_uri_str); if (range.first == _class_menus.end() || range.first == range.second || range.first->second.menu == _plugin_menu) { _classless_menu->items().push_back( @@ -534,7 +534,7 @@ PatchCanvas::disconnect(Ganv::Node* src_port, void PatchCanvas::auto_menu_position(int& x, int& y, bool& push_in) { - std::pair<int,int> scroll_offsets; + std::pair<int, int> scroll_offsets; get_scroll_offsets(scroll_offsets.first, scroll_offsets.second); if (_auto_position_count > 0 && scroll_offsets != _auto_position_scroll_offsets) @@ -768,7 +768,7 @@ PatchCanvas::generate_port_name( char num_buf[5]; uint32_t i = 1; for ( ; i < 9999; ++i) { - snprintf(num_buf, 5, "%u", i); + snprintf(num_buf, sizeof(num_buf), "%u", i); symbol = sym_base + "_"; symbol += num_buf; if (!_patch->get_port(symbol)) diff --git a/src/gui/PatchCanvas.hpp b/src/gui/PatchCanvas.hpp index 2b97d650..82827b68 100644 --- a/src/gui/PatchCanvas.hpp +++ b/src/gui/PatchCanvas.hpp @@ -129,8 +129,8 @@ private: typedef std::map<SharedPtr<const Client::ObjectModel>, Ganv::Module*> Views; Views _views; - int _auto_position_count; - std::pair<int,int> _auto_position_scroll_offsets; + int _auto_position_count; + std::pair<int, int> _auto_position_scroll_offsets; int _last_click_x; int _last_click_y; diff --git a/src/gui/PatchTreeWindow.hpp b/src/gui/PatchTreeWindow.hpp index cb266695..d82624b8 100644 --- a/src/gui/PatchTreeWindow.hpp +++ b/src/gui/PatchTreeWindow.hpp @@ -67,8 +67,11 @@ protected: struct PatchTreeModelColumns : public Gtk::TreeModel::ColumnRecord { - PatchTreeModelColumns() - { add(name_col); add(enabled_col); add(patch_model_col); } + PatchTreeModelColumns() { + add(name_col); + add(enabled_col); + add(patch_model_col); + } Gtk::TreeModelColumn<Glib::ustring> name_col; Gtk::TreeModelColumn<bool> enabled_col; diff --git a/src/gui/PatchView.hpp b/src/gui/PatchView.hpp index 39e8bab1..7db0dd85 100644 --- a/src/gui/PatchView.hpp +++ b/src/gui/PatchView.hpp @@ -25,7 +25,6 @@ #include "raul/URI.hpp" namespace Raul { class Atom; } -namespace Ganv { class Port; class Item; } namespace Ingen { diff --git a/src/gui/Port.hpp b/src/gui/Port.hpp index e8801e5f..f0872e39 100644 --- a/src/gui/Port.hpp +++ b/src/gui/Port.hpp @@ -23,7 +23,10 @@ #include "raul/SharedPtr.hpp" #include "raul/WeakPtr.hpp" -namespace Raul { class Atom; class URI; } +namespace Raul { +class Atom; +class URI; +} namespace Ingen { diff --git a/src/gui/PortMenu.cpp b/src/gui/PortMenu.cpp index df256d15..e774dc29 100644 --- a/src/gui/PortMenu.cpp +++ b/src/gui/PortMenu.cpp @@ -60,7 +60,7 @@ PortMenu::init(App& app, SharedPtr<const PortModel> port, bool patch_port) _reset_range_menuitem->signal_activate().connect( sigc::mem_fun(this, &PortMenu::on_menu_reset_range)); - if ( ! PtrCast<PatchModel>(port->parent()) ) { + if (!PtrCast<PatchModel>(port->parent())) { _polyphonic_menuitem->set_sensitive(false); _rename_menuitem->set_sensitive(false); _destroy_menuitem->set_sensitive(false); diff --git a/src/gui/SubpatchModule.cpp b/src/gui/SubpatchModule.cpp index fd3c20bf..b17d2e30 100644 --- a/src/gui/SubpatchModule.cpp +++ b/src/gui/SubpatchModule.cpp @@ -97,9 +97,9 @@ SubpatchModule::browse_to_patch() SharedPtr<PatchModel> parent = PtrCast<PatchModel>(_patch->parent()); - PatchWindow* const preferred = ( (parent) + PatchWindow* const preferred = (parent) ? app().window_factory()->patch_window(parent) - : NULL ); + : NULL; app().window_factory()->present_patch(_patch, preferred); } diff --git a/src/gui/Window.hpp b/src/gui/Window.hpp index 0b2ad045..6ce1a857 100644 --- a/src/gui/Window.hpp +++ b/src/gui/Window.hpp @@ -31,8 +31,8 @@ class App; class Window : public Gtk::Window { public: - Window() : Gtk::Window(), _app(NULL) {} - Window(BaseObjectType* cobject) : Gtk::Window(cobject), _app(NULL) {} + Window() : Gtk::Window(), _app(NULL) {} + explicit Window(BaseObjectType* cobject) : Gtk::Window(cobject), _app(NULL) {} virtual void init_window(App& app) { _app = &app; } @@ -54,8 +54,8 @@ public: class Dialog : public Gtk::Dialog { public: - Dialog() : Gtk::Dialog(), _app(NULL) {} - Dialog(BaseObjectType* cobject) : Gtk::Dialog(cobject), _app(NULL) {} + Dialog() : Gtk::Dialog(), _app(NULL) {} + explicit Dialog(BaseObjectType* cobject) : Gtk::Dialog(cobject), _app(NULL) {} virtual void init_dialog(App& app) { _app = &app; } diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index a8deb459..fe3e2053 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -150,7 +150,7 @@ WindowFactory::present_patch(SharedPtr<const PatchModel> patch, PatchWindow* preferred, SharedPtr<PatchView> view) { - assert( !view || view->patch() == patch); + assert(!view || view->patch() == patch); PatchWindowMap::iterator w = _patch_windows.find(patch->path()); @@ -175,7 +175,7 @@ PatchWindow* WindowFactory::new_patch_window(SharedPtr<const PatchModel> patch, SharedPtr<PatchView> view) { - assert( !view || view->patch() == patch); + assert(!view || view->patch() == patch); PatchWindow* win = NULL; WidgetFactory::get_widget_derived("patch_win", win); diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp index 69e66e72..a962856c 100644 --- a/src/gui/WindowFactory.hpp +++ b/src/gui/WindowFactory.hpp @@ -28,7 +28,11 @@ namespace Raul { class Path; } namespace Ingen { -namespace Client { class PatchModel; class NodeModel; class ObjectModel; } +namespace Client { +class PatchModel; +class NodeModel; +class ObjectModel; +} namespace GUI { @@ -52,7 +56,7 @@ class UploadPatchWindow; */ class WindowFactory { public: - WindowFactory(App& app); + explicit WindowFactory(App& app); ~WindowFactory(); size_t num_open_patch_windows(); |