diff options
107 files changed, 115 insertions, 81 deletions
diff --git a/gtk2_ardour/about.cc b/gtk2_ardour/about.cc index 309673849e..05226c03ba 100644 --- a/gtk2_ardour/about.cc +++ b/gtk2_ardour/about.cc @@ -30,7 +30,6 @@ #include "ardour/version.h" #include "ardour/filesystem_paths.h" -#include "utils.h" #include "version.h" #include "about.h" diff --git a/gtk2_ardour/actions.cc b/gtk2_ardour/actions.cc index 05d120e227..f208c6c8d3 100644 --- a/gtk2_ardour/actions.cc +++ b/gtk2_ardour/actions.cc @@ -36,7 +36,6 @@ #include "gtkmm2ext/actions.h" -#include "utils.h" #include "actions.h" #include "i18n.h" diff --git a/gtk2_ardour/add_route_dialog.cc b/gtk2_ardour/add_route_dialog.cc index 8837e9f468..94e4369aae 100644 --- a/gtk2_ardour/add_route_dialog.cc +++ b/gtk2_ardour/add_route_dialog.cc @@ -46,6 +46,7 @@ using namespace Gtkmm2ext; using namespace std; using namespace PBD; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; std::vector<std::string> AddRouteDialog::channel_combo_strings; diff --git a/gtk2_ardour/add_video_dialog.cc b/gtk2_ardour/add_video_dialog.cc index 5c58b7abcd..b8ede24ae3 100644 --- a/gtk2_ardour/add_video_dialog.cc +++ b/gtk2_ardour/add_video_dialog.cc @@ -33,7 +33,6 @@ #include "ardour/session.h" #include "ardour_ui.h" -#include "utils.h" #include "add_video_dialog.h" #include "utils_videotl.h" #include "i18n.h" diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index cc36fa483d..b01d093825 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -88,7 +88,7 @@ ArdourButton::ArdourButton (Element e) , _hovering (false) , _focused (false) { - ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler)); + ARDOUR_UI_UTILS::ColorsChanged.connect (sigc::mem_fun (*this, &ArdourButton::color_handler)); } ArdourButton::ArdourButton (const std::string& str, Element e) diff --git a/gtk2_ardour/ardour_dialog.cc b/gtk2_ardour/ardour_dialog.cc index d0d85c5cbe..34027ca0c3 100644 --- a/gtk2_ardour/ardour_dialog.cc +++ b/gtk2_ardour/ardour_dialog.cc @@ -32,6 +32,7 @@ using namespace std; using namespace Gtk; using namespace Gtkmm2ext; +using namespace ARDOUR_UI_UTILS; ArdourDialog::ArdourDialog (string title, bool modal, bool use_seperator) : Dialog (title, modal, use_seperator) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index d9ac37e36f..a8d883422b 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -138,6 +138,7 @@ typedef uint64_t microseconds_t; #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtkmm2ext; using namespace Gtk; diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index e9efb1d03a..f78d096000 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -64,6 +64,7 @@ using namespace PBD; using namespace Gtkmm2ext; using namespace Gtk; using namespace Glib; +using namespace ARDOUR_UI_UTILS; int ARDOUR_UI::setup_windows () diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 454c657e6e..6c69f42793 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -51,7 +51,6 @@ #include "actions.h" #include "mixer_ui.h" #include "startup.h" -#include "utils.h" #include "window_manager.h" #include "global_port_matrix.h" #include "location_ui.h" diff --git a/gtk2_ardour/ardour_window.cc b/gtk2_ardour/ardour_window.cc index b50a83c31f..6b325aca85 100644 --- a/gtk2_ardour/ardour_window.cc +++ b/gtk2_ardour/ardour_window.cc @@ -30,6 +30,7 @@ using namespace std; using namespace Gtk; using namespace Gtkmm2ext; +using namespace ARDOUR_UI_UTILS; ArdourWindow::ArdourWindow (string title) : Window () diff --git a/gtk2_ardour/audio_clock.cc b/gtk2_ardour/audio_clock.cc index 64358eaadf..0c7f41f6eb 100644 --- a/gtk2_ardour/audio_clock.cc +++ b/gtk2_ardour/audio_clock.cc @@ -45,6 +45,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace std; diff --git a/gtk2_ardour/audio_region_editor.cc b/gtk2_ardour/audio_region_editor.cc index 730cd99b37..2041d20335 100644 --- a/gtk2_ardour/audio_region_editor.cc +++ b/gtk2_ardour/audio_region_editor.cc @@ -32,7 +32,6 @@ #include "audio_region_editor.h" #include "audio_region_view.h" #include "ardour_ui.h" -#include "utils.h" #include "gui_thread.h" #include "i18n.h" diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index e15d83125a..72bf08e799 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -57,7 +57,6 @@ #include "control_point.h" #include "ghostregion.h" #include "audio_time_axis.h" -#include "utils.h" #include "rgb_macros.h" #include "gui_thread.h" #include "ardour_ui.h" diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 0520b1846c..bc5052c390 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -46,7 +46,6 @@ #include "ardour_ui.h" #include "rgb_macros.h" #include "gui_thread.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/audio_time_axis.cc b/gtk2_ardour/audio_time_axis.cc index 25e981acba..8c022abdb7 100644 --- a/gtk2_ardour/audio_time_axis.cc +++ b/gtk2_ardour/audio_time_axis.cc @@ -60,6 +60,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Editing; diff --git a/gtk2_ardour/automation_controller.cc b/gtk2_ardour/automation_controller.cc index a80a474232..a75faf747c 100644 --- a/gtk2_ardour/automation_controller.cc +++ b/gtk2_ardour/automation_controller.cc @@ -28,7 +28,6 @@ #include "ardour/session.h" #include "ardour_ui.h" -#include "utils.h" #include "automation_controller.h" #include "gui_thread.h" diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc index 7840712581..1cfd7eeb48 100644 --- a/gtk2_ardour/automation_line.cc +++ b/gtk2_ardour/automation_line.cc @@ -51,7 +51,6 @@ #include "rgb_macros.h" #include "ardour_ui.h" #include "public_editor.h" -#include "utils.h" #include "selection.h" #include "time_axis_view.h" #include "point_selection.h" diff --git a/gtk2_ardour/automation_streamview.cc b/gtk2_ardour/automation_streamview.cc index 797f2741aa..53c643c027 100644 --- a/gtk2_ardour/automation_streamview.cc +++ b/gtk2_ardour/automation_streamview.cc @@ -40,7 +40,6 @@ #include "ardour_ui.h" #include "rgb_macros.h" #include "gui_thread.h" -#include "utils.h" using namespace std; using namespace ARDOUR; diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index c6238e6711..3b00fc69b6 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -51,6 +51,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Gtkmm2ext; diff --git a/gtk2_ardour/axis_view.cc b/gtk2_ardour/axis_view.cc index 7a449843e0..41efbf86ae 100644 --- a/gtk2_ardour/axis_view.cc +++ b/gtk2_ardour/axis_view.cc @@ -43,6 +43,7 @@ using namespace std; using namespace Gtk; using namespace Gtkmm2ext; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; list<Gdk::Color> AxisView::used_colors; diff --git a/gtk2_ardour/big_clock_window.cc b/gtk2_ardour/big_clock_window.cc index c67ae38074..28b7b286ab 100644 --- a/gtk2_ardour/big_clock_window.cc +++ b/gtk2_ardour/big_clock_window.cc @@ -31,6 +31,7 @@ using std::min; using std::string; +using namespace ARDOUR_UI_UTILS; BigClockWindow::BigClockWindow (AudioClock& c) : ArdourWindow (_("Big Clock")) diff --git a/gtk2_ardour/bundle_manager.cc b/gtk2_ardour/bundle_manager.cc index 035046c10b..6dc34d3388 100644 --- a/gtk2_ardour/bundle_manager.cc +++ b/gtk2_ardour/bundle_manager.cc @@ -34,6 +34,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; BundleEditorMatrix::BundleEditorMatrix (Gtk::Window* parent, Session* session, boost::shared_ptr<Bundle> bundle) : PortMatrix (parent, session, DataType::NIL) diff --git a/gtk2_ardour/crossfade_edit.cc b/gtk2_ardour/crossfade_edit.cc index c545a02b46..02d3ceb4bb 100644 --- a/gtk2_ardour/crossfade_edit.cc +++ b/gtk2_ardour/crossfade_edit.cc @@ -49,7 +49,6 @@ #include "crossfade_edit.h" #include "rgb_macros.h" #include "keyboard.h" -#include "utils.h" #include "gui_thread.h" #include "actions.h" diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 3925a528b9..98fdad2ef2 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -126,6 +126,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Glib; diff --git a/gtk2_ardour/editor_actions.cc b/gtk2_ardour/editor_actions.cc index 74e931000f..1d19aca9c4 100644 --- a/gtk2_ardour/editor_actions.cc +++ b/gtk2_ardour/editor_actions.cc @@ -50,6 +50,7 @@ using namespace Gtk; using namespace Glib; using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Editing; diff --git a/gtk2_ardour/editor_audio_import.cc b/gtk2_ardour/editor_audio_import.cc index 6eae37628f..3b9fe20727 100644 --- a/gtk2_ardour/editor_audio_import.cc +++ b/gtk2_ardour/editor_audio_import.cc @@ -52,7 +52,6 @@ #include "audio_time_axis.h" #include "midi_time_axis.h" #include "session_import_dialog.h" -#include "utils.h" #include "gui_thread.h" #include "interthread_progress_window.h" #include "mouse_cursors.h" diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 2f37a877ea..79404c53c7 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -56,6 +56,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Glib; diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc index dd9970c730..12dab1e83d 100644 --- a/gtk2_ardour/editor_cursors.cc +++ b/gtk2_ardour/editor_cursors.cc @@ -24,7 +24,6 @@ #include "canvas/debug.h" #include "canvas/scroll_group.h" -#include "utils.h" #include "editor_cursors.h" #include "editor.h" diff --git a/gtk2_ardour/editor_cursors.h b/gtk2_ardour/editor_cursors.h index 9eab63452b..7915e37205 100644 --- a/gtk2_ardour/editor_cursors.h +++ b/gtk2_ardour/editor_cursors.h @@ -18,6 +18,7 @@ */ #include "pbd/signals.h" +#include "ardour/types.h" #include "canvas/arrow.h" #include "canvas/line.h" diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 4019eb24c2..05e24fa84c 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -50,7 +50,6 @@ #include "ardour_ui.h" #include "gui_thread.h" #include "control_point.h" -#include "utils.h" #include "region_gain_line.h" #include "editor_drag.h" #include "audio_time_axis.h" diff --git a/gtk2_ardour/editor_group_tabs.cc b/gtk2_ardour/editor_group_tabs.cc index f53326636e..fb7081df2c 100644 --- a/gtk2_ardour/editor_group_tabs.cc +++ b/gtk2_ardour/editor_group_tabs.cc @@ -35,6 +35,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; EditorGroupTabs::EditorGroupTabs (Editor* e) : EditorComponent (e) diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 32616417cc..479a3f272e 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -60,7 +60,6 @@ #include "automation_time_axis.h" #include "control_point.h" #include "prompter.h" -#include "utils.h" #include "selection.h" #include "keyboard.h" #include "editing.h" diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc index cb1a4a11e4..54be3c857f 100644 --- a/gtk2_ardour/editor_ops.cc +++ b/gtk2_ardour/editor_ops.cc @@ -89,7 +89,6 @@ #include "strip_silence_dialog.h" #include "time_axis_view.h" #include "transpose_dialog.h" -#include "utils.h" #include "i18n.h" @@ -7043,7 +7042,7 @@ Editor::lock () if (!lock_dialog) { lock_dialog = new Gtk::Dialog (string_compose (_("%1: Locked"), PROGRAM_NAME), true); - Gtk::Image* padlock = manage (new Gtk::Image (::get_icon ("padlock_closed"))); + Gtk::Image* padlock = manage (new Gtk::Image (ARDOUR_UI_UTILS::get_icon ("padlock_closed"))); lock_dialog->get_vbox()->pack_start (*padlock); ArdourButton* b = manage (new ArdourButton); diff --git a/gtk2_ardour/editor_regions.cc b/gtk2_ardour/editor_regions.cc index 54e520d8aa..4113b6d00b 100644 --- a/gtk2_ardour/editor_regions.cc +++ b/gtk2_ardour/editor_regions.cc @@ -53,6 +53,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Glib; diff --git a/gtk2_ardour/editor_route_groups.cc b/gtk2_ardour/editor_route_groups.cc index 5d01ef207f..d74ba50d64 100644 --- a/gtk2_ardour/editor_route_groups.cc +++ b/gtk2_ardour/editor_route_groups.cc @@ -51,6 +51,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using Gtkmm2ext::Keyboard; diff --git a/gtk2_ardour/editor_routes.cc b/gtk2_ardour/editor_routes.cc index 5da4979824..605f90486c 100644 --- a/gtk2_ardour/editor_routes.cc +++ b/gtk2_ardour/editor_routes.cc @@ -53,6 +53,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Gtkmm2ext; diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 908a3ca7cb..d1a002e602 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -51,7 +51,6 @@ #include "time_axis_view.h" #include "editor_drag.h" #include "editor_cursors.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/editor_snapshots.cc b/gtk2_ardour/editor_snapshots.cc index 08b5acddc8..ed49ef35b3 100644 --- a/gtk2_ardour/editor_snapshots.cc +++ b/gtk2_ardour/editor_snapshots.cc @@ -32,6 +32,7 @@ using namespace std; using namespace PBD; using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; EditorSnapshots::EditorSnapshots (Editor* e) : EditorComponent (e) diff --git a/gtk2_ardour/editor_tempodisplay.cc b/gtk2_ardour/editor_tempodisplay.cc index fab99fc0b2..44d0154dd4 100644 --- a/gtk2_ardour/editor_tempodisplay.cc +++ b/gtk2_ardour/editor_tempodisplay.cc @@ -50,7 +50,6 @@ #include "time_axis_view.h" #include "ardour_ui.h" #include "tempo_lines.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/engine_dialog.cc b/gtk2_ardour/engine_dialog.cc index b50a1ffd60..27cf9b7719 100644 --- a/gtk2_ardour/engine_dialog.cc +++ b/gtk2_ardour/engine_dialog.cc @@ -58,6 +58,7 @@ using namespace Gtk; using namespace Gtkmm2ext; using namespace PBD; using namespace Glib; +using namespace ARDOUR_UI_UTILS; static const unsigned int midi_tab = 2; static const unsigned int latency_tab = 1; /* zero-based, page zero is the main setup page */ diff --git a/gtk2_ardour/export_file_notebook.cc b/gtk2_ardour/export_file_notebook.cc index c313038e05..ae924c10e3 100644 --- a/gtk2_ardour/export_file_notebook.cc +++ b/gtk2_ardour/export_file_notebook.cc @@ -27,6 +27,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; ExportFileNotebook::ExportFileNotebook () : diff --git a/gtk2_ardour/export_video_dialog.cc b/gtk2_ardour/export_video_dialog.cc index a9d0f99ad1..e5f1890737 100644 --- a/gtk2_ardour/export_video_dialog.cc +++ b/gtk2_ardour/export_video_dialog.cc @@ -51,7 +51,6 @@ #include "ardour/session_metadata.h" #include "ardour/broadcast_info.h" -#include "utils.h" #include "opts.h" #include "export_video_dialog.h" #include "utils_videotl.h" diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 7e781cafd9..76a7c3540e 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -54,6 +54,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtkmm2ext; using namespace Gtk; diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index e4a31119fc..2ecfcca44f 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -45,7 +45,6 @@ #include "ardour_ui.h" #include "prompter.h" #include "plugin_ui.h" -#include "utils.h" #include "gui_thread.h" #include "automation_controller.h" diff --git a/gtk2_ardour/global_port_matrix.cc b/gtk2_ardour/global_port_matrix.cc index 218cfe7a1c..706b4b6727 100644 --- a/gtk2_ardour/global_port_matrix.cc +++ b/gtk2_ardour/global_port_matrix.cc @@ -32,6 +32,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; GlobalPortMatrix::GlobalPortMatrix (Gtk::Window* p, Session* s, DataType t) : PortMatrix (p, s, t) diff --git a/gtk2_ardour/global_signals.h b/gtk2_ardour/global_signals.h index 3bd6f100a9..f1abb8dbb8 100644 --- a/gtk2_ardour/global_signals.h +++ b/gtk2_ardour/global_signals.h @@ -22,7 +22,9 @@ #include <sigc++/signal.h> +namespace ARDOUR_UI_UTILS { extern sigc::signal<void> ColorsChanged; extern sigc::signal<void> DPIReset; +} // namespace #endif /* __gtk_ardour_global_signals_h__ */ diff --git a/gtk2_ardour/group_tabs.cc b/gtk2_ardour/group_tabs.cc index 9dd9dd51e3..a996cd8dff 100644 --- a/gtk2_ardour/group_tabs.cc +++ b/gtk2_ardour/group_tabs.cc @@ -34,6 +34,7 @@ using namespace std; using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using Gtkmm2ext::Keyboard; list<Gdk::Color> GroupTabs::_used_colors; diff --git a/gtk2_ardour/hit.cc b/gtk2_ardour/hit.cc index c06160f3b2..43dc8ce347 100644 --- a/gtk2_ardour/hit.cc +++ b/gtk2_ardour/hit.cc @@ -24,7 +24,6 @@ #include "midi_region_view.h" #include "public_editor.h" -#include "utils.h" #include "hit.h" using namespace ARDOUR; diff --git a/gtk2_ardour/io_selector.cc b/gtk2_ardour/io_selector.cc index 31f8cfa1cb..270ed8ce32 100644 --- a/gtk2_ardour/io_selector.cc +++ b/gtk2_ardour/io_selector.cc @@ -36,6 +36,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace Gtk; IOSelector::IOSelector (Gtk::Window* p, ARDOUR::Session* session, boost::shared_ptr<ARDOUR::IO> io) diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc index f23e246958..409f89dfaf 100644 --- a/gtk2_ardour/keyeditor.cc +++ b/gtk2_ardour/keyeditor.cc @@ -38,7 +38,6 @@ #include "actions.h" #include "keyboard.h" #include "keyeditor.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/level_meter.cc b/gtk2_ardour/level_meter.cc index 94b8d63d7f..1a6f59f1b0 100644 --- a/gtk2_ardour/level_meter.cc +++ b/gtk2_ardour/level_meter.cc @@ -37,6 +37,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtkmm2ext; using namespace Gtk; diff --git a/gtk2_ardour/location_ui.cc b/gtk2_ardour/location_ui.cc index 169fd49258..f4a9b7ea07 100644 --- a/gtk2_ardour/location_ui.cc +++ b/gtk2_ardour/location_ui.cc @@ -38,6 +38,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Gtkmm2ext; diff --git a/gtk2_ardour/main.cc b/gtk2_ardour/main.cc index 5dd3695dc9..d924d9b30a 100644 --- a/gtk2_ardour/main.cc +++ b/gtk2_ardour/main.cc @@ -49,7 +49,6 @@ #include <gtkmm2ext/utils.h> #include "version.h" -#include "utils.h" #include "ardour_ui.h" #include "opts.h" #include "enums.h" diff --git a/gtk2_ardour/marker.cc b/gtk2_ardour/marker.cc index 1374d96127..af201286a9 100644 --- a/gtk2_ardour/marker.cc +++ b/gtk2_ardour/marker.cc @@ -47,6 +47,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace Gtkmm2ext; PBD::Signal1<void,Marker*> Marker::CatchDeletion; diff --git a/gtk2_ardour/meter_patterns.cc b/gtk2_ardour/meter_patterns.cc index c3b5a914ec..55eb16246a 100644 --- a/gtk2_ardour/meter_patterns.cc +++ b/gtk2_ardour/meter_patterns.cc @@ -31,6 +31,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Gtkmm2ext; diff --git a/gtk2_ardour/meter_strip.cc b/gtk2_ardour/meter_strip.cc index 92f1a0e1c0..ee3ed52c7f 100644 --- a/gtk2_ardour/meter_strip.cc +++ b/gtk2_ardour/meter_strip.cc @@ -48,6 +48,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Gtkmm2ext; diff --git a/gtk2_ardour/meterbridge.cc b/gtk2_ardour/meterbridge.cc index 4d2a0c7b3b..5da4d3fdb5 100644 --- a/gtk2_ardour/meterbridge.cc +++ b/gtk2_ardour/meterbridge.cc @@ -57,6 +57,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Glib; diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 503c1756e9..00cbad7733 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -68,7 +68,6 @@ #include "rgb_macros.h" #include "selection.h" #include "streamview.h" -#include "utils.h" #include "patch_change_dialog.h" #include "verbose_cursor.h" #include "ardour_ui.h" diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 3dd39a5177..97ce7ed939 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -52,6 +52,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Editing; diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 8ced280661..c37916dbf0 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -91,6 +91,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Gtkmm2ext; diff --git a/gtk2_ardour/mixer_group_tabs.cc b/gtk2_ardour/mixer_group_tabs.cc index 964849c515..e7c14ca113 100644 --- a/gtk2_ardour/mixer_group_tabs.cc +++ b/gtk2_ardour/mixer_group_tabs.cc @@ -37,6 +37,7 @@ using namespace std; using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; MixerGroupTabs::MixerGroupTabs (Mixer_UI* m) diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index bf5977c0c9..981b6913c3 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -69,6 +69,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Gtkmm2ext; diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 3ceb44bde7..8534d40d32 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -60,6 +60,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtk; using namespace Glib; diff --git a/gtk2_ardour/monitor_section.cc b/gtk2_ardour/monitor_section.cc index 46d500dac6..a816dd397d 100644 --- a/gtk2_ardour/monitor_section.cc +++ b/gtk2_ardour/monitor_section.cc @@ -40,6 +40,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace Gtk; using namespace Gtkmm2ext; using namespace PBD; diff --git a/gtk2_ardour/mono_panner.cc b/gtk2_ardour/mono_panner.cc index c9f46e12b8..fad2c09b64 100644 --- a/gtk2_ardour/mono_panner.cc +++ b/gtk2_ardour/mono_panner.cc @@ -50,6 +50,7 @@ using namespace std; using namespace Gtk; using namespace Gtkmm2ext; +using namespace ARDOUR_UI_UTILS; static const int pos_box_size = 9; static const int lr_box_size = 15; diff --git a/gtk2_ardour/mouse_cursors.cc b/gtk2_ardour/mouse_cursors.cc index 0aab542347..4ba5c66688 100644 --- a/gtk2_ardour/mouse_cursors.cc +++ b/gtk2_ardour/mouse_cursors.cc @@ -22,6 +22,8 @@ #include "mouse_cursors.h" #include "editor_xpms" +using namespace ARDOUR_UI_UTILS; + MouseCursors::MouseCursors () : cross_hair (0) , trimmer (0) diff --git a/gtk2_ardour/option_editor.cc b/gtk2_ardour/option_editor.cc index 33926d6523..f163ec8f3d 100644 --- a/gtk2_ardour/option_editor.cc +++ b/gtk2_ardour/option_editor.cc @@ -29,7 +29,6 @@ #include "option_editor.h" #include "gui_thread.h" -#include "utils.h" #include "i18n.h" using namespace std; diff --git a/gtk2_ardour/panner2d.cc b/gtk2_ardour/panner2d.cc index 35f573bcf1..abb47a9873 100644 --- a/gtk2_ardour/panner2d.cc +++ b/gtk2_ardour/panner2d.cc @@ -44,6 +44,7 @@ using namespace std; using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using Gtkmm2ext::Keyboard; diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index d15f8efc3a..ec25fad32c 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -31,7 +31,6 @@ #include "ardour_ui.h" #include "panner_ui.h" #include "panner2d.h" -#include "utils.h" #include "gui_thread.h" #include "stereo_panner.h" #include "mono_panner.h" diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 190fd2ad96..440dc80531 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -73,6 +73,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtkmm2ext; using namespace Gtk; diff --git a/gtk2_ardour/port_insert_ui.cc b/gtk2_ardour/port_insert_ui.cc index 2a982eabc1..a742740e5a 100644 --- a/gtk2_ardour/port_insert_ui.cc +++ b/gtk2_ardour/port_insert_ui.cc @@ -28,7 +28,6 @@ #include "ardour/session.h" #include "port_insert_ui.h" -#include "utils.h" #include "gui_thread.h" #include "i18n.h" diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 6bd9d96262..aa1c853ed8 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -43,6 +43,7 @@ using namespace std; using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; /** PortMatrix constructor. * @param session Our session. diff --git a/gtk2_ardour/port_matrix_column_labels.cc b/gtk2_ardour/port_matrix_column_labels.cc index 1f5a21feec..8e18dbea7a 100644 --- a/gtk2_ardour/port_matrix_column_labels.cc +++ b/gtk2_ardour/port_matrix_column_labels.cc @@ -23,7 +23,6 @@ #include "port_matrix_column_labels.h" #include "port_matrix.h" #include "port_matrix_body.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc index de921a6cb7..998a234bf3 100644 --- a/gtk2_ardour/port_matrix_row_labels.cc +++ b/gtk2_ardour/port_matrix_row_labels.cc @@ -26,7 +26,6 @@ #include "port_matrix.h" #include "port_matrix_body.h" #include "i18n.h" -#include "utils.h" using namespace std; diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 56d2d371eb..4122d9687d 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -76,7 +76,6 @@ #include "return_ui.h" #include "route_processor_selection.h" #include "send_ui.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index 35c75e469e..184cb77d52 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -84,6 +84,11 @@ class VerboseCursor; class XMLNode; struct SelectionRect; +namespace ARDOUR_UI_UTILS { +bool relay_key_press (GdkEventKey* ev, Gtk::Window* win); +bool forward_key_press (GdkEventKey* ev); +} + using ARDOUR::framepos_t; using ARDOUR::framecnt_t; @@ -408,8 +413,8 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi static PublicEditor* _instance; - friend bool relay_key_press (GdkEventKey*, Gtk::Window*); - friend bool forward_key_press (GdkEventKey*); + friend bool ARDOUR_UI_UTILS::relay_key_press (GdkEventKey*, Gtk::Window*); + friend bool ARDOUR_UI_UTILS::forward_key_press (GdkEventKey*); PBD::Signal0<void> SnapChanged; PBD::Signal0<void> MouseModeChanged; diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 3e5f3bf080..59b8cdc025 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -61,6 +61,7 @@ using namespace Gtk; using namespace Gtkmm2ext; using namespace PBD; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; class ClickOptions : public OptionEditorBox { diff --git a/gtk2_ardour/region_editor.cc b/gtk2_ardour/region_editor.cc index 564938ad5c..511314dfc5 100644 --- a/gtk2_ardour/region_editor.cc +++ b/gtk2_ardour/region_editor.cc @@ -33,7 +33,6 @@ #include "main_clock.h" #include "gui_thread.h" #include "region_editor.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc index dda81dd059..43cd0e5140 100644 --- a/gtk2_ardour/region_gain_line.cc +++ b/gtk2_ardour/region_gain_line.cc @@ -27,7 +27,6 @@ #include "control_point.h" #include "region_gain_line.h" #include "audio_region_view.h" -#include "utils.h" #include "time_axis_view.h" #include "editor.h" diff --git a/gtk2_ardour/region_layering_order_editor.cc b/gtk2_ardour/region_layering_order_editor.cc index a7d73afc64..7a1a2c2140 100644 --- a/gtk2_ardour/region_layering_order_editor.cc +++ b/gtk2_ardour/region_layering_order_editor.cc @@ -36,6 +36,7 @@ using namespace std; using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; RegionLayeringOrderEditor::RegionLayeringOrderEditor (PublicEditor& pe) : ArdourWindow (_("RegionLayeringOrderEditor")) diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc index 1c08682591..d45164ee42 100644 --- a/gtk2_ardour/region_view.cc +++ b/gtk2_ardour/region_view.cc @@ -54,6 +54,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Editing; using namespace Gtk; diff --git a/gtk2_ardour/return_ui.cc b/gtk2_ardour/return_ui.cc index 9e86abd171..16c4720577 100644 --- a/gtk2_ardour/return_ui.cc +++ b/gtk2_ardour/return_ui.cc @@ -23,7 +23,6 @@ #include "ardour/rc_configuration.h" #include "ardour/return.h" -#include "utils.h" #include "return_ui.h" #include "io_selector.h" #include "ardour_ui.h" diff --git a/gtk2_ardour/rhythm_ferret.cc b/gtk2_ardour/rhythm_ferret.cc index 5a59b5ce5d..ec5ebc93a1 100644 --- a/gtk2_ardour/rhythm_ferret.cc +++ b/gtk2_ardour/rhythm_ferret.cc @@ -31,7 +31,6 @@ #include "rhythm_ferret.h" #include "audio_region_view.h" #include "editor.h" -#include "utils.h" #include "time_axis_view.h" #include "i18n.h" diff --git a/gtk2_ardour/route_group_dialog.cc b/gtk2_ardour/route_group_dialog.cc index 0919a715ae..f659a683d4 100644 --- a/gtk2_ardour/route_group_dialog.cc +++ b/gtk2_ardour/route_group_dialog.cc @@ -34,6 +34,7 @@ using namespace Gtk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace std; using namespace PBD; diff --git a/gtk2_ardour/route_params_ui.cc b/gtk2_ardour/route_params_ui.cc index 7e8cdfcf6f..f1677c4c2a 100644 --- a/gtk2_ardour/route_params_ui.cc +++ b/gtk2_ardour/route_params_ui.cc @@ -46,7 +46,6 @@ #include "return_ui.h" #include "route_params_ui.h" #include "send_ui.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index be761894fc..463d40b784 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -80,6 +80,7 @@ #include "i18n.h" using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Gtkmm2ext; using namespace Gtk; diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc index caf7199930..529842d02d 100644 --- a/gtk2_ardour/route_ui.cc +++ b/gtk2_ardour/route_ui.cc @@ -58,6 +58,7 @@ using namespace Gtk; using namespace Gtkmm2ext; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; uint32_t RouteUI::_max_invert_buttons = 3; diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc index 7e3b0e775a..d571d018b7 100644 --- a/gtk2_ardour/send_ui.cc +++ b/gtk2_ardour/send_ui.cc @@ -24,7 +24,6 @@ #include "ardour/send.h" #include "ardour/rc_configuration.h" -#include "utils.h" #include "send_ui.h" #include "io_selector.h" #include "ardour_ui.h" diff --git a/gtk2_ardour/session_dialog.cc b/gtk2_ardour/session_dialog.cc index aad6cdedba..7b1b212b81 100644 --- a/gtk2_ardour/session_dialog.cc +++ b/gtk2_ardour/session_dialog.cc @@ -55,6 +55,7 @@ using namespace Gdk; using namespace Glib; using namespace PBD; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; static string poor_mans_glob (string path) { diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 72cd75abb1..da29eb75a8 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -64,7 +64,6 @@ #include "prompter.h" #include "sfdb_ui.h" #include "editing.h" -#include "utils.h" #include "gain_meter.h" #include "main_clock.h" #include "public_editor.h" diff --git a/gtk2_ardour/soundcloud_export_selector.cc b/gtk2_ardour/soundcloud_export_selector.cc index 8ecdf5d49b..e9ef5a3060 100644 --- a/gtk2_ardour/soundcloud_export_selector.cc +++ b/gtk2_ardour/soundcloud_export_selector.cc @@ -71,7 +71,7 @@ SoundcloudExportSelector::SoundcloudExportSelector () : sc_table.set_row_spacings (5); sc_frame->add (sc_table); - sc_table.attach ( *(Gtk::manage (new Gtk::Image (get_icon (X_("soundcloud"))))) , 0, 1, 0, 2); + sc_table.attach ( *(Gtk::manage (new Gtk::Image (ARDOUR_UI_UTILS::get_icon (X_("soundcloud"))))) , 0, 1, 0, 2); sc_table.attach (soundcloud_username_label, 0, 1, 1, 2); sc_table.attach (soundcloud_username_entry, 1, 3, 1, 2); diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index 8482a6cb22..38074e932a 100644 --- a/gtk2_ardour/startup.cc +++ b/gtk2_ardour/startup.cc @@ -55,6 +55,7 @@ using namespace Gdk; using namespace Glib; using namespace PBD; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; ArdourStartup* ArdourStartup::the_startup = 0; diff --git a/gtk2_ardour/step_entry.cc b/gtk2_ardour/step_entry.cc index 8a04f4b03b..2039f50a0a 100644 --- a/gtk2_ardour/step_entry.cc +++ b/gtk2_ardour/step_entry.cc @@ -42,6 +42,7 @@ using namespace Glib; using namespace Gtkmm2ext; using namespace PBD; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; static void _note_off_event_handler (GtkWidget* /*widget*/, int note, gpointer arg) diff --git a/gtk2_ardour/stereo_panner.cc b/gtk2_ardour/stereo_panner.cc index 02ee7708f8..ab923a47be 100644 --- a/gtk2_ardour/stereo_panner.cc +++ b/gtk2_ardour/stereo_panner.cc @@ -49,6 +49,7 @@ using namespace std; using namespace Gtk; using namespace Gtkmm2ext; +using namespace ARDOUR_UI_UTILS; static const int pos_box_size = 8; static const int lr_box_size = 15; diff --git a/gtk2_ardour/streamview.cc b/gtk2_ardour/streamview.cc index 970c1616c1..9eecc80dd7 100644 --- a/gtk2_ardour/streamview.cc +++ b/gtk2_ardour/streamview.cc @@ -49,6 +49,7 @@ using namespace std; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Editing; diff --git a/gtk2_ardour/tempo_dialog.cc b/gtk2_ardour/tempo_dialog.cc index b601734bee..7c0e510aff 100644 --- a/gtk2_ardour/tempo_dialog.cc +++ b/gtk2_ardour/tempo_dialog.cc @@ -26,7 +26,6 @@ #include "ardour/rc_configuration.h" #include "tempo_dialog.h" -#include "utils.h" #include "i18n.h" diff --git a/gtk2_ardour/theme_manager.cc b/gtk2_ardour/theme_manager.cc index eec9eb5eee..38f8aac4c9 100644 --- a/gtk2_ardour/theme_manager.cc +++ b/gtk2_ardour/theme_manager.cc @@ -51,9 +51,12 @@ using namespace std; using namespace Gtk; using namespace PBD; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; -sigc::signal<void> ColorsChanged; -sigc::signal<void,uint32_t> ColorChanged; +namespace ARDOUR_UI_UTILS { + sigc::signal<void> ColorsChanged; + sigc::signal<void,uint32_t> ColorChanged; +} ThemeManager::ThemeManager() : ArdourWindow (_("Theme Manager")) diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 044094375b..15a70304f6 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -58,6 +58,7 @@ using namespace std; using namespace Gtk; using namespace Gdk; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace PBD; using namespace Editing; using namespace ArdourCanvas; diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc index ff708c24da..f3fc01bd06 100644 --- a/gtk2_ardour/time_axis_view_item.cc +++ b/gtk2_ardour/time_axis_view_item.cc @@ -56,6 +56,7 @@ using namespace Editing; using namespace Glib; using namespace PBD; using namespace ARDOUR; +using namespace ARDOUR_UI_UTILS; using namespace Gtkmm2ext; Pango::FontDescription TimeAxisViewItem::NAME_FONT; diff --git a/gtk2_ardour/transcode_video_dialog.cc b/gtk2_ardour/transcode_video_dialog.cc index 7917668d1b..16bfc36995 100644 --- a/gtk2_ardour/transcode_video_dialog.cc +++ b/gtk2_ardour/transcode_video_dialog.cc @@ -41,7 +41,6 @@ #include "ardour_ui.h" #include "gui_thread.h" -#include "utils.h" #include "opts.h" #include "transcode_video_dialog.h" #include "utils_videotl.h" diff --git a/gtk2_ardour/ui_config.h b/gtk2_ardour/ui_config.h index a5bba2c87c..0000eb63f5 100644 --- a/gtk2_ardour/ui_config.h +++ b/gtk2_ardour/ui_config.h @@ -116,7 +116,7 @@ class UIConfiguration : public PBD::Stateful std::string get_##var () const { return var.get(); } \ bool set_##var (const std::string& val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; } #define CANVAS_FONT_VARIABLE(var,name) \ - Pango::FontDescription get_##var () const { return sanitized_font (var.get()); } \ + Pango::FontDescription get_##var () const { return ARDOUR_UI_UTILS::sanitized_font (var.get()); } \ bool set_##var (const std::string& val) { bool ret = var.set (val); if (ret) { ParameterChanged (name); } return ret; } #include "canvas_vars.h" #undef CANVAS_VARIABLE diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index d17d28b072..3df4f9ace5 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -64,7 +64,9 @@ using namespace Glib; using namespace PBD; using Gtkmm2ext::Keyboard; -sigc::signal<void> DPIReset; +namespace ARDOUR_UI_UTILS { + sigc::signal<void> DPIReset; +} #ifdef PLATFORM_WINDOWS #define random() rand() @@ -77,7 +79,7 @@ sigc::signal<void> DPIReset; * @param s true to make sensitive, false to make insensitive */ void -add_item_with_sensitivity (Menu_Helpers::MenuList& m, Menu_Helpers::MenuElem e, bool s) +ARDOUR_UI_UTILS::add_item_with_sensitivity (Menu_Helpers::MenuList& m, Menu_Helpers::MenuElem e, bool s) { m.push_back (e); if (!s) { @@ -87,7 +89,7 @@ add_item_with_sensitivity (Menu_Helpers::MenuList& m, Menu_Helpers::MenuElem e, gint -just_hide_it (GdkEventAny */*ev*/, Gtk::Window *win) +ARDOUR_UI_UTILS::just_hide_it (GdkEventAny */*ev*/, Gtk::Window *win) { win->hide (); return 0; @@ -102,7 +104,7 @@ just_hide_it (GdkEventAny */*ev*/, Gtk::Window *win) */ unsigned char* -xpm2rgb (const char** xpm, uint32_t& w, uint32_t& h) +ARDOUR_UI_UTILS::xpm2rgb (const char** xpm, uint32_t& w, uint32_t& h) { static long vals[256], val; uint32_t t, x, y, colors, cpp; @@ -144,7 +146,7 @@ xpm2rgb (const char** xpm, uint32_t& w, uint32_t& h) } unsigned char* -xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h) +ARDOUR_UI_UTILS::xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h) { static long vals[256], val; uint32_t t, x, y, colors, cpp; @@ -221,7 +223,7 @@ xpm2rgba (const char** xpm, uint32_t& w, uint32_t& h) * that we might add here later. */ Pango::FontDescription -sanitized_font (std::string const& name) +ARDOUR_UI_UTILS::sanitized_font (std::string const& name) { Pango::FontDescription fd (name); @@ -233,7 +235,7 @@ sanitized_font (std::string const& name) } Pango::FontDescription -get_font_for_style (string widgetname) +ARDOUR_UI_UTILS::get_font_for_style (string widgetname) { Gtk::Window window (WINDOW_TOPLEVEL); Gtk::Label foobar; @@ -262,7 +264,7 @@ get_font_for_style (string widgetname) } uint32_t -rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, string attr, int state, bool rgba) +ARDOUR_UI_UTILS::rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, string attr, int state, bool rgba) { /* In GTK+2, styles aren't set up correctly if the widget is not attached to a toplevel window that has a screen pointer. @@ -321,7 +323,7 @@ rgba_from_style (string style, uint32_t r, uint32_t g, uint32_t b, uint32_t a, s } bool -rgba_p_from_style (string style, float *r, float *g, float *b, string attr, int state) +ARDOUR_UI_UTILS::rgba_p_from_style (string style, float *r, float *g, float *b, string attr, int state) { static Gtk::Window* window = 0; assert (r && g && b); @@ -368,7 +370,7 @@ rgba_p_from_style (string style, float *r, float *g, float *b, string attr, int } void -set_color_from_rgb (Gdk::Color& c, uint32_t rgb) +ARDOUR_UI_UTILS::set_color_from_rgb (Gdk::Color& c, uint32_t rgb) { /* Gdk::Color color ranges are 16 bit, so scale from 8 bit by multiplying by 256. @@ -377,7 +379,7 @@ set_color_from_rgb (Gdk::Color& c, uint32_t rgb) } void -set_color_from_rgba (Gdk::Color& c, uint32_t rgba) +ARDOUR_UI_UTILS::set_color_from_rgba (Gdk::Color& c, uint32_t rgba) { /* Gdk::Color color ranges are 16 bit, so scale from 8 bit by multiplying by 256. @@ -386,7 +388,7 @@ set_color_from_rgba (Gdk::Color& c, uint32_t rgba) } uint32_t -gdk_color_to_rgba (Gdk::Color const& c) +ARDOUR_UI_UTILS::gdk_color_to_rgba (Gdk::Color const& c) { /* since alpha value is not available from a Gdk::Color, it is hardcoded as 0xff (aka 255 or 1.0) @@ -401,7 +403,7 @@ gdk_color_to_rgba (Gdk::Color const& c) } uint32_t -contrasting_text_color (uint32_t c) +ARDOUR_UI_UTILS::contrasting_text_color (uint32_t c) { double r, g, b, a; ArdourCanvas::color_to_rgba (c, r, g, b, a); @@ -434,7 +436,7 @@ contrasting_text_color (uint32_t c) } bool -relay_key_press (GdkEventKey* ev, Gtk::Window* win) +ARDOUR_UI_UTILS::relay_key_press (GdkEventKey* ev, Gtk::Window* win) { PublicEditor& ed (PublicEditor::instance()); @@ -450,13 +452,13 @@ relay_key_press (GdkEventKey* ev, Gtk::Window* win) } bool -forward_key_press (GdkEventKey* ev) +ARDOUR_UI_UTILS::forward_key_press (GdkEventKey* ev) { - return PublicEditor::instance().on_key_press_event(ev); + return PublicEditor::instance().on_key_press_event(ev); } bool -emulate_key_event (Gtk::Widget* w, unsigned int keyval) +ARDOUR_UI_UTILS::emulate_key_event (Gtk::Widget* w, unsigned int keyval) { GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET(w->gobj())); GdkKeymap *keymap = gdk_keymap_get_for_display (display); @@ -485,7 +487,7 @@ emulate_key_event (Gtk::Widget* w, unsigned int keyval) } bool -key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) +ARDOUR_UI_UTILS::key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) { GtkWindow* win = window.gobj(); GtkWidget* focus = gtk_window_get_focus (win); @@ -656,7 +658,7 @@ key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev) } Glib::RefPtr<Gdk::Pixbuf> -get_xpm (std::string name) +ARDOUR_UI_UTILS::get_xpm (std::string name) { if (!xpm_map[name]) { @@ -681,7 +683,7 @@ get_xpm (std::string name) } vector<string> -get_icon_sets () +ARDOUR_UI_UTILS::get_icon_sets () { Searchpath spath(ARDOUR::ardour_data_search_path()); spath.add_subdirectory_to_paths ("icons"); @@ -706,7 +708,7 @@ get_icon_sets () } std::string -get_icon_path (const char* cname, string icon_set) +ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set) { std::string data_file_path; string name = cname; @@ -742,7 +744,7 @@ get_icon_path (const char* cname, string icon_set) } Glib::RefPtr<Gdk::Pixbuf> -get_icon (const char* cname, string icon_set) +ARDOUR_UI_UTILS::get_icon (const char* cname, string icon_set) { Glib::RefPtr<Gdk::Pixbuf> img; try { @@ -756,6 +758,7 @@ get_icon (const char* cname, string icon_set) return img; } +namespace ARDOUR_UI_UTILS { Glib::RefPtr<Gdk::Pixbuf> get_icon (const char* cname) { @@ -770,9 +773,10 @@ get_icon (const char* cname) return img; } +} string -longest (vector<string>& strings) +ARDOUR_UI_UTILS::longest (vector<string>& strings) { if (strings.empty()) { return string (""); @@ -800,7 +804,7 @@ longest (vector<string>& strings) } bool -key_is_legal_for_numeric_entry (guint keyval) +ARDOUR_UI_UTILS::key_is_legal_for_numeric_entry (guint keyval) { /* we assume that this does not change over the life of the process */ @@ -883,8 +887,9 @@ key_is_legal_for_numeric_entry (guint keyval) return false; } + void -set_pango_fontsize () +ARDOUR_UI_UTILS::set_pango_fontsize () { long val = ARDOUR::Config->get_font_scale(); @@ -900,7 +905,7 @@ set_pango_fontsize () } void -reset_dpi () +ARDOUR_UI_UTILS::reset_dpi () { long val = ARDOUR::Config->get_font_scale(); set_pango_fontsize (); @@ -912,7 +917,7 @@ reset_dpi () } void -resize_window_to_proportion_of_monitor (Gtk::Window* window, int max_width, int max_height) +ARDOUR_UI_UTILS::resize_window_to_proportion_of_monitor (Gtk::Window* window, int max_width, int max_height) { Glib::RefPtr<Gdk::Screen> screen = window->get_screen (); Gdk::Rectangle monitor_rect; @@ -927,7 +932,7 @@ resize_window_to_proportion_of_monitor (Gtk::Window* window, int max_width, int /** Replace _ with __ in a string; for use with menu item text to make underscores displayed correctly */ string -escape_underscores (string const & s) +ARDOUR_UI_UTILS::escape_underscores (string const & s) { string o; string::size_type const N = s.length (); @@ -945,7 +950,7 @@ escape_underscores (string const & s) /** Replace < and > with < and > respectively to make < > display correctly in markup strings */ string -escape_angled_brackets (string const & s) +ARDOUR_UI_UTILS::escape_angled_brackets (string const & s) { string o = s; boost::replace_all (o, "<", "<"); @@ -954,7 +959,7 @@ escape_angled_brackets (string const & s) } Gdk::Color -unique_random_color (list<Gdk::Color>& used_colors) +ARDOUR_UI_UTILS::unique_random_color (list<Gdk::Color>& used_colors) { Gdk::Color newcolor; @@ -995,7 +1000,7 @@ unique_random_color (list<Gdk::Color>& used_colors) } string -rate_as_string (float r) +ARDOUR_UI_UTILS::rate_as_string (float r) { char buf[32]; if (fmod (r, 1000.0f)) { diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h index 4ff563080a..a99246632e 100644 --- a/gtk2_ardour/utils.h +++ b/gtk2_ardour/utils.h @@ -47,6 +47,8 @@ namespace ArdourCanvas { class Item; } +namespace ARDOUR_UI_UTILS { + extern sigc::signal<void> DPIReset; gint just_hide_it (GdkEventAny*, Gtk::Window*); @@ -96,4 +98,5 @@ Gdk::Color unique_random_color (std::list<Gdk::Color> &); std::string rate_as_string (float r); +} // namespace #endif /* __ardour_gtk_utils_h__ */ diff --git a/gtk2_ardour/verbose_cursor.cc b/gtk2_ardour/verbose_cursor.cc index 66071c8e84..e1c37f591b 100644 --- a/gtk2_ardour/verbose_cursor.cc +++ b/gtk2_ardour/verbose_cursor.cc @@ -30,7 +30,6 @@ #include "editor.h" #include "editor_drag.h" #include "main_clock.h" -#include "utils.h" #include "verbose_cursor.h" #include "i18n.h" diff --git a/gtk2_ardour/video_image_frame.cc b/gtk2_ardour/video_image_frame.cc index de2480e8f0..43f12aa9f3 100644 --- a/gtk2_ardour/video_image_frame.cc +++ b/gtk2_ardour/video_image_frame.cc @@ -23,7 +23,6 @@ #include "ardour_ui.h" #include "video_image_frame.h" #include "public_editor.h" -#include "utils.h" #include "canvas/container.h" #include "utils_videotl.h" diff --git a/gtk2_ardour/video_monitor.cc b/gtk2_ardour/video_monitor.cc index b901071296..fe91554158 100644 --- a/gtk2_ardour/video_monitor.cc +++ b/gtk2_ardour/video_monitor.cc @@ -32,6 +32,7 @@ using namespace std; using namespace PBD; +using namespace ARDOUR_UI_UTILS; VideoMonitor::VideoMonitor (PublicEditor *ed, std::string xjadeo_bin_path) : editor (ed) diff --git a/gtk2_ardour/video_timeline.cc b/gtk2_ardour/video_timeline.cc index dff98218ab..815d19b7e7 100644 --- a/gtk2_ardour/video_timeline.cc +++ b/gtk2_ardour/video_timeline.cc @@ -34,7 +34,6 @@ #include "ardour_ui.h" #include "public_editor.h" #include "gui_thread.h" -#include "utils.h" #include "utils_videotl.h" #include "rgb_macros.h" #include "video_timeline.h" |