Clean up library inheritance (colors.h, utils.h)

make libwidget independent of libcanvas.
Confine basics to pbd and gtkmm2ext.
This commit is contained in:
Robin Gareus 2017-07-17 18:34:35 +02:00
parent 1f5ebc5485
commit 601c317d70
86 changed files with 442 additions and 472 deletions

View file

@ -27,50 +27,6 @@
using namespace std;
using namespace ArdourCanvas;
void
ArdourCanvas::set_source_rgba (Cairo::RefPtr<Cairo::Context> context, Color color)
{
context->set_source_rgba (
((color >> 24) & 0xff) / 255.0,
((color >> 16) & 0xff) / 255.0,
((color >> 8) & 0xff) / 255.0,
((color >> 0) & 0xff) / 255.0
);
}
void
ArdourCanvas::set_source_rgb_a (Cairo::RefPtr<Cairo::Context> context, Color color, float alpha)
{
context->set_source_rgba (
((color >> 24) & 0xff) / 255.0,
((color >> 16) & 0xff) / 255.0,
((color >> 8) & 0xff) / 255.0,
alpha
);
}
void
ArdourCanvas::set_source_rgba (cairo_t *cr, Color color)
{
cairo_set_source_rgba ( cr,
((color >> 24) & 0xff) / 255.0,
((color >> 16) & 0xff) / 255.0,
((color >> 8) & 0xff) / 255.0,
((color >> 0) & 0xff) / 255.0
);
}
void
ArdourCanvas::set_source_rgb_a (cairo_t *cr, Color color, float alpha)
{
cairo_set_source_rgba ( cr,
((color >> 24) & 0xff) / 255.0,
((color >> 16) & 0xff) / 255.0,
((color >> 8) & 0xff) / 255.0,
alpha
);
}
ArdourCanvas::Distance
ArdourCanvas::distance_to_segment_squared (Duple const & p, Duple const & p1, Duple const & p2, double& t, Duple& at)
{
@ -136,4 +92,3 @@ ArdourCanvas::distance_to_segment_squared (Duple const & p, Duple const & p1, Du
return ((dpqx * dpqx) + (dpqy * dpqy));
}