19 #if !defined USE_CAIRO_IMAGE_SURFACE && !defined NDEBUG
20 #define OPTIONAL_CAIRO_IMAGE_SURFACE
38 float r = col.get_red_p ();
39 float g = col.get_green_p ();
40 float b = col.get_blue_p ();
42 cairo_set_source_rgba(cr, r, g, b, a);
50 , _name_proxy (this,
X_(
"name"))
71 #ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
72 Cairo::RefPtr<Cairo::Context> cr;
73 if (getenv(
"ARDOUR_IMAGE_SURFACE")) {
75 image_surface = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, get_width(), get_height());
79 cr = get_window()->create_cairo_context ();
81 #elif defined USE_CAIRO_IMAGE_SURFACE
84 image_surface = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, get_width(), get_height());
87 Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create (
image_surface);
89 Cairo::RefPtr<Cairo::Context> cr = get_window()->create_cairo_context ();
92 cr->rectangle (ev->area.x, ev->area.y, ev->area.width, ev->area.height);
100 cr->set_source_rgb (bg.get_red_p(), bg.get_green_p(), bg.get_blue_p());
103 cairo_rectangle_t expose_area;
104 expose_area.x = ev->area.x;
105 expose_area.y = ev->area.y;
106 expose_area.width = ev->area.width;
107 expose_area.height = ev->area.height;
109 render (cr->cobj(), &expose_area);
111 #ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
112 if (getenv(
"ARDOUR_IMAGE_SURFACE")) {
114 #if defined USE_CAIRO_IMAGE_SURFACE || defined OPTIONAL_CAIRO_IMAGE_SURFACE
118 Cairo::RefPtr<Cairo::Context> cairo_context = get_window()->create_cairo_context ();
120 cairo_context->rectangle (ev->area.x, ev->area.y, ev->area.width, ev->area.height);
121 cairo_context->clip ();
123 cairo_context->set_operator (Cairo::OPERATOR_SOURCE);
124 cairo_context->paint ();
126 #ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
150 Gtk::EventBox::on_size_allocate (alloc);
152 #ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
153 if (getenv(
"ARDOUR_IMAGE_SURFACE")) {
155 #if defined USE_CAIRO_IMAGE_SURFACE || defined OPTIONAL_CAIRO_IMAGE_SURFACE
156 image_surface = Cairo::ImageSurface::create (Cairo::FORMAT_ARGB32, alloc.get_width(), alloc.get_height());
158 #ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
170 parent = get_parent ();
176 Glib::RefPtr<Gtk::Style> style = parent->get_style();
182 return style->get_bg (get_state());
185 if (!parent->get_has_window()) {
186 parent = parent->get_parent();
192 if (parent && parent->get_has_window()) {
198 return parent->get_style ()->get_bg (parent->get_state());
201 return get_style ()->get_bg (get_state());
249 if (get_state() == Gtk::STATE_INSENSITIVE) {
271 w.modify_bg (Gtk::STATE_NORMAL, bg);
272 w.modify_bg (Gtk::STATE_INSENSITIVE, bg);
273 w.modify_bg (Gtk::STATE_ACTIVE, bg);
274 w.modify_bg (Gtk::STATE_SELECTED, bg);
#define ENSURE_GUI_THREAD(obj, method,...)