summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-07-17 18:34:35 +0200
committerRobin Gareus <robin@gareus.org>2017-07-17 21:06:04 +0200
commit601c317d70a03190257577bd867cefc2c70d3275 (patch)
tree077071290f084431a912414c4e87b6127c586677 /gtk2_ardour
parent1f5ebc54853446a786925941bd014666e75221d2 (diff)
Clean up library inheritance (colors.h, utils.h)
make libwidget independent of libcanvas. Confine basics to pbd and gtkmm2ext.
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/audio_region_view.cc26
-rw-r--r--gtk2_ardour/automation_line.cc2
-rw-r--r--gtk2_ardour/canvas_test.cc2
-rw-r--r--gtk2_ardour/color_theme_manager.cc7
-rw-r--r--gtk2_ardour/editor_canvas.cc4
-rw-r--r--gtk2_ardour/editor_cursors.cc2
-rw-r--r--gtk2_ardour/editor_cursors.h2
-rw-r--r--gtk2_ardour/editor_group_tabs.cc10
-rw-r--r--gtk2_ardour/export_report.cc17
-rw-r--r--gtk2_ardour/ghostregion.h2
-rw-r--r--gtk2_ardour/meter_patterns.cc12
-rw-r--r--gtk2_ardour/midi_region_view.h4
-rw-r--r--gtk2_ardour/mini_timeline.cc20
-rw-r--r--gtk2_ardour/mini_timeline.h2
-rw-r--r--gtk2_ardour/mixer_group_tabs.cc10
-rw-r--r--gtk2_ardour/note_base.cc2
-rw-r--r--gtk2_ardour/panner2d.cc2
-rw-r--r--gtk2_ardour/patch_change.cc4
-rw-r--r--gtk2_ardour/patch_change.h4
-rw-r--r--gtk2_ardour/port_matrix_column_labels.cc6
-rw-r--r--gtk2_ardour/port_matrix_row_labels.cc6
-rw-r--r--gtk2_ardour/processor_box.cc7
-rw-r--r--gtk2_ardour/region_view.cc10
-rw-r--r--gtk2_ardour/route_time_axis.cc2
-rw-r--r--gtk2_ardour/shuttle_control.cc6
-rw-r--r--gtk2_ardour/stereo_panner.cc4
-rw-r--r--gtk2_ardour/time_axis_view.cc10
-rw-r--r--gtk2_ardour/time_axis_view_item.cc14
-rw-r--r--gtk2_ardour/toolbar_test.cc2
-rw-r--r--gtk2_ardour/ui_config.cc22
-rw-r--r--gtk2_ardour/ui_config.h28
-rw-r--r--gtk2_ardour/utils.cc6
-rw-r--r--gtk2_ardour/utils.h2
33 files changed, 126 insertions, 133 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index 0ad6ed778f..e81043588c 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -25,8 +25,6 @@
#include <gtkmm.h>
-#include <gtkmm2ext/gtk_ui.h>
-
#include "ardour/playlist.h"
#include "ardour/audioregion.h"
#include "ardour/audiosource.h"
@@ -38,6 +36,10 @@
#include "evoral/Curve.hpp"
+#include "gtkmm2ext/gtk_ui.h"
+#include "gtkmm2ext/utils.h"
+#include "gtkmm2ext/colors.h"
+
#include "canvas/rectangle.h"
#include "canvas/polygon.h"
#include "canvas/poly_line.h"
@@ -45,8 +47,6 @@
#include "canvas/text.h"
#include "canvas/xfade_curve.h"
#include "canvas/debug.h"
-#include "canvas/utils.h"
-#include "canvas/colors.h"
#include "streamview.h"
#include "audio_region_view.h"
@@ -184,7 +184,7 @@ AudioRegionView::init (bool wfd)
// needs to be created first, RegionView::init() calls set_height()
pending_peak_data = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (pending_peak_data, string_compose ("pending peak rectangle for %1", region()->name()));
- pending_peak_data->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 0.0));
+ pending_peak_data->set_outline_color (Gtkmm2ext::rgba_to_color (0, 0, 0, 0.0));
pending_peak_data->set_pattern (pending_peak_pattern);
pending_peak_data->set_data ("regionview", this);
pending_peak_data->hide ();
@@ -198,28 +198,28 @@ AudioRegionView::init (bool wfd)
if (!_recregion) {
fade_in_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_in_handle, string_compose ("fade in handle for %1", region()->name()));
- fade_in_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
+ fade_in_handle->set_outline_color (Gtkmm2ext::rgba_to_color (0, 0, 0, 1.0));
fade_in_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_in_handle->set_data ("regionview", this);
fade_in_handle->hide ();
fade_out_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_out_handle, string_compose ("fade out handle for %1", region()->name()));
- fade_out_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
+ fade_out_handle->set_outline_color (Gtkmm2ext::rgba_to_color (0, 0, 0, 1.0));
fade_out_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_out_handle->set_data ("regionview", this);
fade_out_handle->hide ();
fade_in_trim_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_in_handle, string_compose ("fade in trim handle for %1", region()->name()));
- fade_in_trim_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
+ fade_in_trim_handle->set_outline_color (Gtkmm2ext::rgba_to_color (0, 0, 0, 1.0));
fade_in_trim_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_in_trim_handle->set_data ("regionview", this);
fade_in_trim_handle->hide ();
fade_out_trim_handle = new ArdourCanvas::Rectangle (group);
CANVAS_DEBUG_NAME (fade_out_handle, string_compose ("fade out trim handle for %1", region()->name()));
- fade_out_trim_handle->set_outline_color (ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
+ fade_out_trim_handle->set_outline_color (Gtkmm2ext::rgba_to_color (0, 0, 0, 1.0));
fade_out_trim_handle->set_fill_color (UIConfiguration::instance().color ("inactive fade handle"));
fade_out_trim_handle->set_data ("regionview", this);
fade_out_trim_handle->hide ();
@@ -1548,10 +1548,10 @@ AudioRegionView::set_waveform_colors ()
void
AudioRegionView::set_some_waveform_colors (vector<ArdourCanvas::WaveView*>& waves_to_color)
{
- ArdourCanvas::Color fill;
- ArdourCanvas::Color outline;
- ArdourCanvas::Color clip = UIConfiguration::instance().color ("clipped waveform");
- ArdourCanvas::Color zero = UIConfiguration::instance().color ("zero line");
+ Gtkmm2ext::Color fill;
+ Gtkmm2ext::Color outline;
+ Gtkmm2ext::Color clip = UIConfiguration::instance().color ("clipped waveform");
+ Gtkmm2ext::Color zero = UIConfiguration::instance().color ("zero line");
if (_selected) {
if (_region->muted()) {
diff --git a/gtk2_ardour/automation_line.cc b/gtk2_ardour/automation_line.cc
index 9c1aa13198..6283ce2bc8 100644
--- a/gtk2_ardour/automation_line.cc
+++ b/gtk2_ardour/automation_line.cc
@@ -250,7 +250,7 @@ AutomationLine::set_line_color (uint32_t color)
_line_color = color;
line->set_outline_color (color);
- ArdourCanvas::SVAModifier mod = UIConfiguration::instance().modifier ("automation line fill");
+ Gtkmm2ext::SVAModifier mod = UIConfiguration::instance().modifier ("automation line fill");
line->set_fill_color ((color & 0xffffff00) + mod.a()*255);
}
diff --git a/gtk2_ardour/canvas_test.cc b/gtk2_ardour/canvas_test.cc
index 6f904a1611..9dc16ba7d4 100644
--- a/gtk2_ardour/canvas_test.cc
+++ b/gtk2_ardour/canvas_test.cc
@@ -22,7 +22,7 @@
#include "canvas/types.h"
#include "canvas/canvas.h"
#include "canvas/container.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "canvas/debug.h"
#include "canvas/grid.h"
#include "canvas/scroll_group.h"
diff --git a/gtk2_ardour/color_theme_manager.cc b/gtk2_ardour/color_theme_manager.cc
index 634db8e1c4..f43d8ff2de 100644
--- a/gtk2_ardour/color_theme_manager.cc
+++ b/gtk2_ardour/color_theme_manager.cc
@@ -53,6 +53,7 @@ using namespace std;
using namespace Gtk;
using namespace PBD;
using namespace ARDOUR;
+using namespace Gtkmm2ext;
using namespace ARDOUR_UI_UTILS;
ColorThemeManager::ColorThemeManager ()
@@ -273,8 +274,8 @@ ColorThemeManager::palette_canvas_allocated (Gtk::Allocation& alloc, ArdourCanva
struct NamedColor {
string name;
- ArdourCanvas::HSV color;
- NamedColor (string s, ArdourCanvas::HSV c) : name (s), color (c) {}
+ Gtkmm2ext::HSV color;
+ NamedColor (string s, Gtkmm2ext::HSV c) : name (s), color (c) {}
};
struct SortByHue {
@@ -378,7 +379,7 @@ ColorThemeManager::edit_palette_color (std::string name)
using namespace ArdourCanvas;
double r,g, b, a;
UIConfiguration* uic (&UIConfiguration::instance());
- ArdourCanvas::Color c = uic->color (name);
+ Gtkmm2ext::Color c = uic->color (name);
Gdk::Color gdkcolor;
color_to_rgba (c, r, g, b, a);
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index fdcbb47fbb..3ff0cf4c4a 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -918,8 +918,8 @@ Editor::set_horizontal_position (double p)
void
Editor::color_handler()
{
- ArdourCanvas::Color base = UIConfiguration::instance().color ("ruler base");
- ArdourCanvas::Color text = UIConfiguration::instance().color ("ruler text");
+ Gtkmm2ext::Color base = UIConfiguration::instance().color ("ruler base");
+ Gtkmm2ext::Color text = UIConfiguration::instance().color ("ruler text");
timecode_ruler->set_fill_color (base);
timecode_ruler->set_outline_color (text);
minsec_ruler->set_fill_color (base);
diff --git a/gtk2_ardour/editor_cursors.cc b/gtk2_ardour/editor_cursors.cc
index 40245778d5..de89274fcc 100644
--- a/gtk2_ardour/editor_cursors.cc
+++ b/gtk2_ardour/editor_cursors.cc
@@ -101,7 +101,7 @@ EditorCursor::hide ()
}
void
-EditorCursor::set_color (ArdourCanvas::Color color)
+EditorCursor::set_color (Gtkmm2ext::Color color)
{
_track_canvas_item->set_color (color);
}
diff --git a/gtk2_ardour/editor_cursors.h b/gtk2_ardour/editor_cursors.h
index 5c1125c801..f6d4997690 100644
--- a/gtk2_ardour/editor_cursors.h
+++ b/gtk2_ardour/editor_cursors.h
@@ -41,7 +41,7 @@ public:
void show ();
void hide ();
- void set_color (ArdourCanvas::Color);
+ void set_color (Gtkmm2ext::Color);
void set_sensitive (bool);
framepos_t current_frame () const {
diff --git a/gtk2_ardour/editor_group_tabs.cc b/gtk2_ardour/editor_group_tabs.cc
index 5ca976b983..44b63bae38 100644
--- a/gtk2_ardour/editor_group_tabs.cc
+++ b/gtk2_ardour/editor_group_tabs.cc
@@ -21,7 +21,7 @@
#include "ardour/route_group.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "editor.h"
#include "editor_group_tabs.h"
@@ -93,9 +93,9 @@ EditorGroupTabs::draw_tab (cairo_t* cr, Tab const & tab)
double r, g, b, a;
if (tab.group && tab.group->is_active()) {
- ArdourCanvas::color_to_rgba (tab.color, r, g, b, a);
+ Gtkmm2ext::color_to_rgba (tab.color, r, g, b, a);
} else {
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("inactive group tab"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("inactive group tab"), r, g, b, a);
}
a = 1.0;
@@ -121,8 +121,8 @@ EditorGroupTabs::draw_tab (cairo_t* cr, Tab const & tab)
cairo_move_to (cr, (get_width() - text_height) * .5, (text_width + tab.to + tab.from) * .5);
- ArdourCanvas::Color c = ArdourCanvas::contrasting_text_color (ArdourCanvas::rgba_to_color (r, g, b, a));
- ArdourCanvas::color_to_rgba (c, r, g, b, a);
+ Gtkmm2ext::Color c = Gtkmm2ext::contrasting_text_color (Gtkmm2ext::rgba_to_color (r, g, b, a));
+ Gtkmm2ext::color_to_rgba (c, r, g, b, a);
cairo_set_source_rgb (cr, r, g, b);
cairo_save (cr);
diff --git a/gtk2_ardour/export_report.cc b/gtk2_ardour/export_report.cc
index 200b2c3340..5840597554 100644
--- a/gtk2_ardour/export_report.cc
+++ b/gtk2_ardour/export_report.cc
@@ -25,10 +25,9 @@
#include "pbd/openuri.h"
#include "pbd/basename.h"
+
#include "gtkmm2ext/utils.h"
-#include "gtkmm2ext/utils.h"
-#include "canvas/utils.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "audiographer/general/analyser.h"
@@ -530,8 +529,8 @@ ExportReport::init (const AnalysisResults & ar, bool with_file)
rint ((g + 59.0) * 10.0 - h * .5), 5,
h + 2, w + 2, 4);
const float pk = (g + 59.0) / 54.0;
- ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, .3 + pk * .4, .6);
- ArdourCanvas::set_source_rgba (cr, c);
+ Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, .3 + pk * .4, .6);
+ Gtkmm2ext::set_source_rgba (cr, c);
cr->fill ();
cr->save ();
@@ -731,8 +730,8 @@ ExportReport::init (const AnalysisResults & ar, bool with_file)
for (size_t x = 0 ; x < width; ++x) {
for (size_t y = 0 ; y < height; ++y) {
const float pk = p->spectrum[x][y];
- ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
- ArdourCanvas::set_source_rgba (cr, c);
+ Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
+ Gtkmm2ext::set_source_rgba (cr, c);
cr->rectangle (m_l + x - .5, y - .5, 1, 1);
cr->fill ();
}
@@ -792,8 +791,8 @@ ExportReport::init (const AnalysisResults & ar, bool with_file)
for (size_t y = 0 ; y < innerheight - 2; ++y) {
const float pk = 1.0 - (float) y / innerheight;
- ArdourCanvas::Color c = ArdourCanvas::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
- ArdourCanvas::set_source_rgba (cr, c);
+ Gtkmm2ext::Color c = Gtkmm2ext::hsva_to_color (252 - 260 * pk, .9, sqrt(pk));
+ Gtkmm2ext::set_source_rgba (cr, c);
cr->rectangle (2, innertop + y + .5, m_r - 4 - anw, 1);
cr->fill ();
}
diff --git a/gtk2_ardour/ghostregion.h b/gtk2_ardour/ghostregion.h
index 1f1189f62a..7192538394 100644
--- a/gtk2_ardour/ghostregion.h
+++ b/gtk2_ardour/ghostregion.h
@@ -122,7 +122,7 @@ public:
private:
ArdourCanvas::Container* _note_group;
- ArdourCanvas::Color _outline;
+ Gtkmm2ext::Color _outline;
ArdourCanvas::Rectangle* _tmp_rect;
ArdourCanvas::Polygon* _tmp_poly;
diff --git a/gtk2_ardour/meter_patterns.cc b/gtk2_ardour/meter_patterns.cc
index 5db4482adc..97b04b9ce5 100644
--- a/gtk2_ardour/meter_patterns.cc
+++ b/gtk2_ardour/meter_patterns.cc
@@ -248,18 +248,18 @@ static void set_bg_color (Gtk::Widget& w, cairo_t* cr, MeterType type) {
double r,g,b,a;
switch(type) {
case MeterVU:
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip vu bg"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("meterstrip vu bg"), r, g, b, a);
break;
case MeterIEC1DIN:
case MeterIEC1NOR:
case MeterIEC2BBC:
case MeterIEC2EBU:
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip ppm bg"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("meterstrip ppm bg"), r, g, b, a);
break;
case MeterK12:
case MeterK14:
case MeterK20:
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip dpm bg"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("meterstrip dpm bg"), r, g, b, a);
break;
default:
{
@@ -277,16 +277,16 @@ static void set_fg_color(Gtk::Widget&, MeterType type, Gdk::Color * c) {
double r,g,b,a;
switch(type) {
case MeterVU:
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip vu fg"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("meterstrip vu fg"), r, g, b, a);
break;
case MeterIEC1DIN:
case MeterIEC1NOR:
case MeterIEC2BBC:
case MeterIEC2EBU:
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip ppm fg"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("meterstrip ppm fg"), r, g, b, a);
break;
default:
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("meterstrip dpm fg"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("meterstrip dpm fg"), r, g, b, a);
break;
}
c->set_rgb_p (r, g, b);
diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h
index 145529317a..20a1ee5b25 100644
--- a/gtk2_ardour/midi_region_view.h
+++ b/gtk2_ardour/midi_region_view.h
@@ -521,8 +521,8 @@ private:
bool _mouse_changed_selection;
- ArdourCanvas::Color _patch_change_outline;
- ArdourCanvas::Color _patch_change_fill;
+ Gtkmm2ext::Color _patch_change_outline;
+ Gtkmm2ext::Color _patch_change_fill;
Evoral::Beats snap_frame_to_grid_underneath (framepos_t p, int32_t divisions, bool shift_snap) const;
diff --git a/gtk2_ardour/mini_timeline.cc b/gtk2_ardour/mini_timeline.cc
index b5259af310..443da0a6f6 100644
--- a/gtk2_ardour/mini_timeline.cc
+++ b/gtk2_ardour/mini_timeline.cc
@@ -20,12 +20,10 @@
#include "ardour/session.h"
#include "ardour/tempo.h"
+#include "gtkmm2ext/colors.h"
#include "gtkmm2ext/gui_thread.h"
#include "gtkmm2ext/keyboard.h"
-#include "canvas/colors.h"
-#include "canvas/utils.h"
-
#include "widgets/tooltips.h"
#include "ardour_ui.h"
@@ -306,14 +304,14 @@ MiniTimeline::format_time (framepos_t when)
}
void
-MiniTimeline::draw_dots (cairo_t* cr, int left, int right, int y, ArdourCanvas::Color color)
+MiniTimeline::draw_dots (cairo_t* cr, int left, int right, int y, Gtkmm2ext::Color color)
{
if (left + 1 >= right) {
return;
}
cairo_move_to (cr, left + .5, y + .5);
cairo_line_to (cr, right - .5, y + .5);
- ArdourCanvas::set_source_rgb_a(cr, color, 0.3);
+ Gtkmm2ext::set_source_rgb_a(cr, color, 0.3);
const double dashes[] = { 0, 1 };
cairo_set_dash (cr, dashes, 2, 1);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
@@ -358,7 +356,7 @@ MiniTimeline::draw_mark (cairo_t* cr, int x0, int x1, const std::string& label,
prelight ? "entered marker" : "location marker");
double r, g, b, a;
- ArdourCanvas::color_to_rgba (color, r, g, b, a);
+ Gtkmm2ext::color_to_rgba (color, r, g, b, a);
if (rw < x0) {
rw = x1;
@@ -445,7 +443,7 @@ MiniTimeline::draw_edge (cairo_t* cr, int x0, int x1, bool left, const std::stri
prelight ? "entered marker" : "location marker");
double r, g, b, a;
- ArdourCanvas::color_to_rgba (color, r, g, b, a);
+ Gtkmm2ext::color_to_rgba (color, r, g, b, a);
if (with_label) {
const int y = PADDING;
@@ -494,8 +492,8 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
{
cairo_t* cr = ctx->cobj();
// TODO cache, set_colors()
- ArdourCanvas::Color base = UIConfiguration::instance().color ("ruler base");
- ArdourCanvas::Color text = UIConfiguration::instance().color ("ruler text");
+ Gtkmm2ext::Color base = UIConfiguration::instance().color ("ruler base");
+ Gtkmm2ext::Color text = UIConfiguration::instance().color ("ruler text");
if (_n_labels == 0) {
return;
@@ -505,7 +503,7 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
const int height = get_height ();
Gtkmm2ext::rounded_rectangle (cr, 0, 0, width, height, 4);
- ArdourCanvas::set_source_rgba(cr, base);
+ Gtkmm2ext::set_source_rgba(cr, base);
cairo_fill (cr);
Gtkmm2ext::rounded_rectangle (cr, PADDING, PADDING, width - PADDING - PADDING, height - PADDING - PADDING, 4);
@@ -537,7 +535,7 @@ MiniTimeline::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_
draw_dots (cr, dot_left, x0, y0 + _time_height * .5, text);
cairo_move_to (cr, x0, y0);
- ArdourCanvas::set_source_rgba(cr, text);
+ Gtkmm2ext::set_source_rgba(cr, text);
pango_cairo_show_layout (cr, _layout->gobj());
dot_left = x0 + lw;
}
diff --git a/gtk2_ardour/mini_timeline.h b/gtk2_ardour/mini_timeline.h
index bfa84edef3..1dd1a527b7 100644
--- a/gtk2_ardour/mini_timeline.h
+++ b/gtk2_ardour/mini_timeline.h
@@ -64,7 +64,7 @@ private:
void calculate_time_width ();
void calculate_time_spacing ();
void update_minitimeline ();
- void draw_dots (cairo_t*, int left, int right, int y, ArdourCanvas::Color);
+ void draw_dots (cairo_t*, int left, int right, int y, Gtkmm2ext::Color);
int draw_mark (cairo_t*, int x0, int x1, const std::string&, bool& prelight);
int draw_edge (cairo_t*, int x0, int x1, bool left, const std::string&, bool& prelight);
diff --git a/gtk2_ardour/mixer_group_tabs.cc b/gtk2_ardour/mixer_group_tabs.cc
index c26a553905..8b5907c7d8 100644
--- a/gtk2_ardour/mixer_group_tabs.cc
+++ b/gtk2_ardour/mixer_group_tabs.cc
@@ -23,7 +23,7 @@
#include "ardour/route_group.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "mixer_group_tabs.h"
#include "mixer_strip.h"
@@ -113,9 +113,9 @@ MixerGroupTabs::draw_tab (cairo_t* cr, Tab const & tab)
double r, g, b, a;
if (tab.group && tab.group->is_active()) {
- ArdourCanvas::color_to_rgba (tab.color, r, g, b, a);
+ Gtkmm2ext::color_to_rgba (tab.color, r, g, b, a);
} else {
- ArdourCanvas::color_to_rgba (UIConfiguration::instance().color ("inactive group tab"), r, g, b, a);
+ Gtkmm2ext::color_to_rgba (UIConfiguration::instance().color ("inactive group tab"), r, g, b, a);
}
a = 1.0;
@@ -140,8 +140,8 @@ MixerGroupTabs::draw_tab (cairo_t* cr, Tab const & tab)
cairo_move_to (cr, tab.from + (tab.to - tab.from - text_width) * .5, (get_height () - text_height) * .5);
- ArdourCanvas::Color c = ArdourCanvas::contrasting_text_color (ArdourCanvas::rgba_to_color (r, g, b, a));
- ArdourCanvas::color_to_rgba (c, r, g, b, a);
+ Gtkmm2ext::Color c = Gtkmm2ext::contrasting_text_color (Gtkmm2ext::rgba_to_color (r, g, b, a));
+ Gtkmm2ext::color_to_rgba (c, r, g, b, a);
cairo_set_source_rgb (cr, r, g, b);
pango_cairo_show_layout (cr, layout->gobj ());
diff --git a/gtk2_ardour/note_base.cc b/gtk2_ardour/note_base.cc
index 5142586715..283910d1c8 100644
--- a/gtk2_ardour/note_base.cc
+++ b/gtk2_ardour/note_base.cc
@@ -142,7 +142,7 @@ NoteBase::on_channel_selection_change(uint16_t selection)
{
// make note change its color if its channel is not marked active
if ( (selection & (1 << _note->channel())) == 0 ) {
- const ArdourCanvas::Color inactive_ch = UIConfiguration::instance().color ("midi note inactive channel");
+ const Gtkmm2ext::Color inactive_ch = UIConfiguration::instance().color ("midi note inactive channel");
set_fill_color(inactive_ch);
set_outline_color(calculate_outline(inactive_ch, _selected));
} else {
diff --git a/gtk2_ardour/panner2d.cc b/gtk2_ardour/panner2d.cc
index eebc53d550..3a8ee3d95a 100644
--- a/gtk2_ardour/panner2d.cc
+++ b/gtk2_ardour/panner2d.cc
@@ -33,7 +33,7 @@
#include "ardour/pannable.h"
#include "ardour/speakers.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "panner2d.h"
#include "keyboard.h"
diff --git a/gtk2_ardour/patch_change.cc b/gtk2_ardour/patch_change.cc
index 3070011380..739cda4702 100644
--- a/gtk2_ardour/patch_change.cc
+++ b/gtk2_ardour/patch_change.cc
@@ -51,8 +51,8 @@ PatchChange::PatchChange(MidiRegionView& region,
double y,
ARDOUR::InstrumentInfo& info,
ARDOUR::MidiModel::PatchChangePtr patch,
- ArdourCanvas::Color outline_color,
- ArdourCanvas::Color fill_color)
+ Gtkmm2ext::Color outline_color,
+ Gtkmm2ext::Color fill_color)
: _region (region)
, _info (info)
, _patch (patch)
diff --git a/gtk2_ardour/patch_change.h b/gtk2_ardour/patch_change.h
index 791252e7ae..e10b2fdda1 100644
--- a/gtk2_ardour/patch_change.h
+++ b/gtk2_ardour/patch_change.h
@@ -41,8 +41,8 @@ public:
double y,
ARDOUR::InstrumentInfo& info,
ARDOUR::MidiModel::PatchChangePtr patch,
- ArdourCanvas::Color outline_color,
- ArdourCanvas::Color fill_color);
+ Gtkmm2ext::Color outline_color,
+ Gtkmm2ext::Color fill_color);
~PatchChange();
diff --git a/gtk2_ardour/port_matrix_column_labels.cc b/gtk2_ardour/port_matrix_column_labels.cc
index 4cf12b58b3..372e6fe7c5 100644
--- a/gtk2_ardour/port_matrix_column_labels.cc
+++ b/gtk2_ardour/port_matrix_column_labels.cc
@@ -20,7 +20,7 @@
#include <iostream>
#include "gtkmm2ext/keyboard.h"
#include "ardour/bundle.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "utils.h"
#include "port_matrix_column_labels.h"
#include "port_matrix.h"
@@ -294,7 +294,7 @@ PortMatrixColumnLabels::render_bundle_name (
cairo_stroke (cr);
Gdk::Color textcolor;
- ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, ArdourCanvas::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
+ ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, Gtkmm2ext::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
set_source_rgb (cr, textcolor);
double const q = ((grid_spacing() * sin (angle())) - _text_height) / 2 + _descender_height;
@@ -348,7 +348,7 @@ PortMatrixColumnLabels::render_channel_name (
cairo_stroke (cr);
Gdk::Color textcolor;
- ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, ArdourCanvas::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
+ ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, Gtkmm2ext::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
set_source_rgb (cr, textcolor);
double const q = ((grid_spacing() * sin (angle())) - _text_height) / 2 + _descender_height;
diff --git a/gtk2_ardour/port_matrix_row_labels.cc b/gtk2_ardour/port_matrix_row_labels.cc
index c6b02eb488..ff7ac6a48a 100644
--- a/gtk2_ardour/port_matrix_row_labels.cc
+++ b/gtk2_ardour/port_matrix_row_labels.cc
@@ -22,7 +22,7 @@
#include <cairo.h>
#include "gtkmm2ext/keyboard.h"
#include "ardour/bundle.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "utils.h"
#include "port_matrix_row_labels.h"
#include "port_matrix.h"
@@ -236,7 +236,7 @@ PortMatrixRowLabels::render_bundle_name (
double const off = (grid_spacing() - ext.height) / 2;
Gdk::Color textcolor;
- ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, ArdourCanvas::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
+ ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, Gtkmm2ext::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
set_source_rgb (cr, textcolor);
cairo_move_to (cr, xoff + x + name_pad(), yoff + name_pad() + off);
cairo_show_text (cr, b->name().c_str());
@@ -264,7 +264,7 @@ PortMatrixRowLabels::render_channel_name (
double const off = (grid_spacing() - ext.height) / 2;
Gdk::Color textcolor;
- ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, ArdourCanvas::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
+ ARDOUR_UI_UTILS::set_color_from_rgba(textcolor, Gtkmm2ext::contrasting_text_color(ARDOUR_UI_UTILS::gdk_color_to_rgba(bg_colour)));
set_source_rgb (cr, textcolor);
cairo_move_to (cr, port_name_x() + xoff + name_pad(), yoff + name_pad() + off);
cairo_show_text (cr, bc.bundle->channel_name(bc.channel).c_str());
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 1f5538c577..fa1b300e7b 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -27,13 +27,12 @@
#include <sigc++/bind.h>
-#include "canvas/utils.h"
-
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>
#include <gtkmm/messagedialog.h>
+#include "gtkmm2ext/colors.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/menu_elems.h"
#include "gtkmm2ext/utils.h"
@@ -1730,12 +1729,12 @@ ProcessorEntry::PluginDisplay::on_expose_event (GdkEventExpose* ev)
bool failed = false;
std::string name = get_name();
- ArdourCanvas::Color fill_color = UIConfiguration::instance().color (string_compose ("%1: fill active", name), &failed);
+ Gtkmm2ext::Color fill_color = UIConfiguration::instance().color (string_compose ("%1: fill active", name), &failed);
Gtkmm2ext::rounded_rectangle (cr, .5, -1.5, width - 1, height + 1, 7);
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_set_line_width(cr, 1.0);
- ArdourCanvas::set_source_rgb_a (cr, fill_color, 1.0);
+ Gtkmm2ext::set_source_rgb_a (cr, fill_color, 1.0);
cairo_stroke (cr);
cairo_destroy(cr);
diff --git a/gtk2_ardour/region_view.cc b/gtk2_ardour/region_view.cc
index 893a973ddd..b5ffc582ce 100644
--- a/gtk2_ardour/region_view.cc
+++ b/gtk2_ardour/region_view.cc
@@ -28,13 +28,13 @@
#include "ardour/profile.h"
#include "ardour/session.h"
+#include "gtkmm2ext/colors.h"
+
#include "canvas/polygon.h"
#include "canvas/debug.h"
#include "canvas/pixbuf.h"
#include "canvas/text.h"
#include "canvas/line.h"
-#include "canvas/utils.h"
-#include "canvas/colors.h"
#include "streamview.h"
#include "region_view.h"
@@ -512,7 +512,7 @@ void
RegionView::set_sync_mark_color ()
{
if (sync_mark) {
- ArdourCanvas::Color c = UIConfiguration::instance().color ("sync mark");
+ Gtkmm2ext::Color c = UIConfiguration::instance().color ("sync mark");
sync_mark->set_fill_color (c);
sync_mark->set_outline_color (c);
sync_line->set_outline_color (c);
@@ -522,7 +522,7 @@ RegionView::set_sync_mark_color ()
uint32_t
RegionView::get_fill_color () const
{
- ArdourCanvas::Color f = TimeAxisViewItem::get_fill_color();
+ Gtkmm2ext::Color f = TimeAxisViewItem::get_fill_color();
char const *modname;
if (_region->opaque() && (!ARDOUR::Profile->get_mixbus() || (!_dragging && !_region->muted ()))) {
@@ -531,7 +531,7 @@ RegionView::get_fill_color () const
modname = "transparent region base";
}
- return HSV(f).mod (UIConfiguration::instance().modifier (modname)).color ();
+ return Gtkmm2ext::HSV(f).mod (UIConfiguration::instance().modifier (modname)).color ();
}
void
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 816365948a..25bc095389 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -965,7 +965,7 @@ RouteTimeAxisView::show_timestretch (framepos_t start, framepos_t end, int layer
if (timestretch_rect == 0) {
timestretch_rect = new ArdourCanvas::Rectangle (canvas_display ());
- timestretch_rect->set_fill_color (ArdourCanvas::HSV (UIConfiguration::instance().color ("time stretch fill")).mod (UIConfiguration::instance().modifier ("time stretch fill")).color());
+ timestretch_rect->set_fill_color (Gtkmm2ext::HSV (UIConfiguration::instance().color ("time stretch fill")).mod (UIConfiguration::instance().modifier ("time stretch fill")).color());
timestretch_rect->set_outline_color (UIConfiguration::instance().color ("time stretch outline"));
}
diff --git a/gtk2_ardour/shuttle_control.cc b/gtk2_ardour/shuttle_control.cc
index 027a432593..ce3ce3c593 100644
--- a/gtk2_ardour/shuttle_control.cc
+++ b/gtk2_ardour/shuttle_control.cc
@@ -27,14 +27,12 @@
#include "ardour/rc_configuration.h"
#include "ardour/session.h"
+#include "gtkmm2ext/colors.h"
#include "gtkmm2ext/keyboard.h"
#include "gtkmm2ext/gui_thread.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/rgb_macros.h"
-#include "canvas/utils.h"
-#include "canvas/colors.h"
-
#include "widgets/tooltips.h"
#include "actions.h"
@@ -611,7 +609,7 @@ ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangl
rounded_rectangle (cr, x + 1, 1, marker_size - 2, get_height() - 2, 3.5);
if (_flat_buttons) {
uint32_t col = UIConfiguration::instance().color ("shuttle");
- ArdourCanvas::set_source_rgba (cr, col);
+ Gtkmm2ext::set_source_rgba (cr, col);
} else {
cairo_set_source (cr, pattern);
}
diff --git a/gtk2_ardour/stereo_panner.cc b/gtk2_ardour/stereo_panner.cc
index b825c01fd1..e5b91d3978 100644
--- a/gtk2_ardour/stereo_panner.cc
+++ b/gtk2_ardour/stereo_panner.cc
@@ -36,7 +36,7 @@
#include "ardour/panner.h"
#include "ardour/panner_shell.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "stereo_panner.h"
#include "stereo_panner_editor.h"
@@ -674,7 +674,7 @@ StereoPanner::set_colors ()
{
colors[Normal].fill = UIConfiguration::instance().color_mod ("stereo panner fill", "panner fill");
// colors[Normal].outline = UIConfiguration::instance().color ("stereo panner outline");
- colors[Normal].outline = ArdourCanvas::HSV (colors[Normal].fill).outline().color ();
+ colors[Normal].outline = Gtkmm2ext::HSV (colors[Normal].fill).outline().color ();
colors[Normal].text = UIConfiguration::instance().color ("stereo panner text");
colors[Normal].background = UIConfiguration::instance().color ("stereo panner bg");
colors[Normal].rule = UIConfiguration::instance().color ("stereo panner rule");
diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc
index 403c5d73ef..dbaaf0268d 100644
--- a/gtk2_ardour/time_axis_view.cc
+++ b/gtk2_ardour/time_axis_view.cc
@@ -32,14 +32,14 @@
#include "ardour/profile.h"
+#include "gtkmm2ext/colors.h"
+#include "gtkmm2ext/doi.h"
+#include "gtkmm2ext/utils.h"
+
#include "canvas/canvas.h"
#include "canvas/rectangle.h"
#include "canvas/debug.h"
#include "canvas/utils.h"
-#include "canvas/colors.h"
-
-#include "gtkmm2ext/doi.h"
-#include "gtkmm2ext/utils.h"
#include "widgets/tooltips.h"
@@ -129,7 +129,7 @@ TimeAxisView::TimeAxisView (ARDOUR::Session* sess, PublicEditor& ed, TimeAxisVie
_canvas_separator = new ArdourCanvas::Line(_canvas_display);
CANVAS_DEBUG_NAME (_canvas_separator, "separator for TAV");
_canvas_separator->set (ArdourCanvas::Duple(0.0, 0.0), ArdourCanvas::Duple(ArdourCanvas::COORD_MAX, 0.0));
- _canvas_separator->set_outline_color(ArdourCanvas::rgba_to_color (0, 0, 0, 1.0));
+ _canvas_separator->set_outline_color(Gtkmm2ext::rgba_to_color (0, 0, 0, 1.0));
_canvas_separator->set_outline_width(1.0);
_canvas_separator->hide();
diff --git a/gtk2_ardour/time_axis_view_item.cc b/gtk2_ardour/time_axis_view_item.cc
index 0587db9e2c..3f1adb9a1c 100644
--- a/gtk2_ardour/time_axis_view_item.cc
+++ b/gtk2_ardour/time_axis_view_item.cc
@@ -32,7 +32,7 @@
#include "canvas/rectangle.h"
#include "canvas/debug.h"
#include "canvas/text.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "ardour/profile.h"
@@ -666,10 +666,10 @@ TimeAxisViewItem::set_name_text_color ()
f = get_fill_color ();
}
- name_text->set_color (ArdourCanvas::contrasting_text_color (f));
+ name_text->set_color (contrasting_text_color (f));
}
-ArdourCanvas::Color
+Gtkmm2ext::Color
TimeAxisViewItem::get_fill_color () const
{
const std::string mod_name = (_dragging ? "dragging region" : fill_color_name);
@@ -714,20 +714,20 @@ TimeAxisViewItem::set_frame_gradient ()
ArdourCanvas::Fill::StopList stops;
double r, g, b, a;
double h, s, v;
- ArdourCanvas::Color f (get_fill_color());
+ Color f (get_fill_color());
/* need to get alpha value */
- ArdourCanvas::color_to_rgba (f, r, g, b, a);
+ color_to_rgba (f, r, g, b, a);
stops.push_back (std::make_pair (0.0, f));
/* now a darker version */
- ArdourCanvas::color_to_hsv (f, h, s, v);
+ color_to_hsv (f, h, s, v);
v = min (1.0, v * (1.0 - UIConfiguration::instance().get_timeline_item_gradient_depth()));
- ArdourCanvas::Color darker = ArdourCanvas::hsva_to_color (h, s, v, a);
+ Color darker = hsva_to_color (h, s, v, a);
stops.push_back (std::make_pair (1.0, darker));
frame->set_gradient (stops, true);
diff --git a/gtk2_ardour/toolbar_test.cc b/gtk2_ardour/toolbar_test.cc
index ab248fde72..338e8f8f2c 100644
--- a/gtk2_ardour/toolbar_test.cc
+++ b/gtk2_ardour/toolbar_test.cc
@@ -26,7 +26,7 @@
#include "canvas/types.h"
#include "canvas/canvas.h"
#include "canvas/container.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "canvas/debug.h"
#include "canvas/grid.h"
#include "canvas/scroll_group.h"
diff --git a/gtk2_ardour/ui_config.cc b/gtk2_ardour/ui_config.cc
index a5f80dc741..b6531e91d6 100644
--- a/gtk2_ardour/ui_config.cc
+++ b/gtk2_ardour/ui_config.cc
@@ -60,7 +60,7 @@
using namespace std;
using namespace PBD;
using namespace ARDOUR;
-using namespace ArdourCanvas;
+using namespace Gtkmm2ext;
static const char* ui_config_file_name = "ui_config";
static const char* default_ui_config_file_name = "default_ui_config";
@@ -143,7 +143,7 @@ UIConfiguration::reset_gtk_theme ()
if (g->first.find ("gtk_") == 0) {
const string gtk_name = g->first.substr (4);
- ArdourCanvas::Color a_color = color (g->second);
+ Gtkmm2ext::Color a_color = color (g->second);
color_scheme_string += gtk_name + ":#" + color_to_hex_string_no_alpha (a_color) + ';';
}
@@ -617,7 +617,7 @@ UIConfiguration::load_colors (XMLNode const & node)
color = child->property (X_("value"));
if (name && color) {
- ArdourCanvas::Color c;
+ Gtkmm2ext::Color c;
c = strtoul (color->value().c_str(), 0, 16);
/* insert or replace color name definition */
colors[name->value()] = c;
@@ -661,7 +661,7 @@ UIConfiguration::set_variables (const XMLNode& node)
#undef CANVAS_FONT_VARIABLE
}
-ArdourCanvas::SVAModifier
+Gtkmm2ext::SVAModifier
UIConfiguration::modifier (string const & name) const
{
Modifiers::const_iterator m = modifiers.find (name);
@@ -671,19 +671,19 @@ UIConfiguration::modifier (string const & name) const
return SVAModifier ();
}
-ArdourCanvas::Color
+Gtkmm2ext::Color
UIConfiguration::color_mod (std::string const & colorname, std::string const & modifiername) const
{
return HSV (color (colorname)).mod (modifier (modifiername)).color ();
}
-ArdourCanvas::Color
-UIConfiguration::color_mod (const ArdourCanvas::Color& color, std::string const & modifiername) const
+Gtkmm2ext::Color
+UIConfiguration::color_mod (const Gtkmm2ext::Color& color, std::string const & modifiername) const
{
return HSV (color).mod (modifier (modifiername)).color ();
}
-ArdourCanvas::Color
+Gtkmm2ext::Color
UIConfiguration::color (const std::string& name, bool* failed) const
{
ColorAliases::const_iterator e = color_aliases.find (name);
@@ -731,7 +731,7 @@ UIConfiguration::quantized (Color c) const
}
void
-UIConfiguration::set_color (string const& name, ArdourCanvas::Color color)
+UIConfiguration::set_color (string const& name, Gtkmm2ext::Color color)
{
Colors::iterator i = colors.find (name);
if (i == colors.end()) {
@@ -791,7 +791,7 @@ UIConfiguration::load_rc_file (bool themechange, bool allow_own)
}
std::string
-UIConfiguration::color_to_hex_string (ArdourCanvas::Color c)
+UIConfiguration::color_to_hex_string (Gtkmm2ext::Color c)
{
char buf[16];
int retval = g_snprintf (buf, sizeof(buf), "%08x", c);
@@ -803,7 +803,7 @@ UIConfiguration::color_to_hex_string (ArdourCanvas::Color c)
}
std::string
-UIConfiguration::color_to_hex_string_no_alpha (ArdourCanvas::Color c)
+UIConfiguration::color_to_hex_string_no_alpha (Gtkmm2ext::Color c)
{
c >>= 8; // shift/remove alpha
char buf[16];
diff --git a/gtk2_ardour/ui_config.h b/gtk2_ardour/ui_config.h
index 159884a14f..4b7de631d6 100644
--- a/gtk2_ardour/ui_config.h
+++ b/gtk2_ardour/ui_config.h
@@ -34,7 +34,7 @@
#include "pbd/xml++.h"
#include "pbd/configuration_variable.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
#include "widgets/ui_config.h"
#include "utils.h"
@@ -64,29 +64,29 @@ public:
std::string color_file_name (bool use_my, bool with_version) const;
- typedef std::map<std::string,ArdourCanvas::Color> Colors;
+ typedef std::map<std::string,Gtkmm2ext::Color> Colors;
typedef std::map<std::string,std::string> ColorAliases;
- typedef std::map<std::string,ArdourCanvas::SVAModifier> Modifiers;
+ typedef std::map<std::string,Gtkmm2ext::SVAModifier> Modifiers;
Colors colors;
ColorAliases color_aliases;
Modifiers modifiers;
void set_alias (std::string const & name, std::string const & alias);
- void set_color (const std::string& name, ArdourCanvas::Color);
- void set_modifier (std::string const &, ArdourCanvas::SVAModifier svam);
+ void set_color (const std::string& name, Gtkmm2ext::Color);
+ void set_modifier (std::string const &, Gtkmm2ext::SVAModifier svam);
- std::string color_as_alias (ArdourCanvas::Color c);
- ArdourCanvas::Color quantized (ArdourCanvas::Color) const;
+ std::string color_as_alias (Gtkmm2ext::Color c);
+ Gtkmm2ext::Color quantized (Gtkmm2ext::Color) const;
- ArdourCanvas::Color color (const std::string&, bool* failed = 0) const;
- ArdourCanvas::Color color_mod (std::string const & color, std::string const & modifier) const;
- ArdourCanvas::Color color_mod (const ArdourCanvas::Color& color, std::string const & modifier) const;
- ArdourCanvas::HSV color_hsv (const std::string&) const;
- ArdourCanvas::SVAModifier modifier (const std::string&) const;
+ Gtkmm2ext::Color color (const std::string&, bool* failed = 0) const;
+ Gtkmm2ext::Color color_mod (std::string const & color, std::string const & modifier) const;
+ Gtkmm2ext::Color color_mod (const Gtkmm2ext::Color& color, std::string const & modifier) const;
+ Gtkmm2ext::HSV color_hsv (const std::string&) const;
+ Gtkmm2ext::SVAModifier modifier (const std::string&) const;
- static std::string color_to_hex_string (ArdourCanvas::Color c);
- static std::string color_to_hex_string_no_alpha (ArdourCanvas::Color c);
+ static std::string color_to_hex_string (Gtkmm2ext::Color c);
+ static std::string color_to_hex_string_no_alpha (Gtkmm2ext::Color c);
void reset_dpi ();
float get_ui_scale ();
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc
index d1331706aa..97c36b7faf 100644
--- a/gtk2_ardour/utils.cc
+++ b/gtk2_ardour/utils.cc
@@ -46,11 +46,11 @@
#include "ardour/filesystem_paths.h"
#include "ardour/search_paths.h"
-#include "canvas/item.h"
-#include "canvas/utils.h"
-
+#include "gtkmm2ext/colors.h"
#include "gtkmm2ext/utils.h"
+#include "canvas/item.h"
+
#include "debug.h"
#include "public_editor.h"
#include "keyboard.h"
diff --git a/gtk2_ardour/utils.h b/gtk2_ardour/utils.h
index c9a52c96cf..6713844ba6 100644
--- a/gtk2_ardour/utils.h
+++ b/gtk2_ardour/utils.h
@@ -69,8 +69,6 @@ uint32_t gdk_color_to_rgba (Gdk::Color const&);
void set_color_from_rgb (Gdk::Color&, uint32_t);
void set_color_from_rgba (Gdk::Color&, uint32_t);
-uint32_t contrasting_text_color (uint32_t c);
-
bool relay_key_press (GdkEventKey* ev, Gtk::Window* win);
bool key_press_focus_accelerator_handler (Gtk::Window& window, GdkEventKey* ev);
bool emulate_key_event (unsigned int);