static const char* has_cairo_widget_background_info = "has_cairo_widget_background_info";
bool CairoWidget::_flat_buttons = false;
+bool CairoWidget::_boxy_buttons = false;
bool CairoWidget::_widget_prelight = true;
sigc::slot<void,Gtk::Widget*> CairoWidget::focus_handler;
assert (!_canvas_widget);
assert (!is_realized());
#ifdef ARDOUR_CANVAS_NSVIEW_TAG // patched gdkquartz.h
-# ifndef __ppc__ // would need to flip RGBA <> RGBA
_nsglview = Gtkmm2ext::nsglview_create (this);
#endif
-#endif
}
int
cr->fill ();
}
- render (cr->cobj(), &expose_area);
+ render (cr, &expose_area);
#ifdef USE_CAIRO_IMAGE_SURFACE_FOR_CAIRO_WIDGET
if(get_visible_window ()) {
expose_area.width = ev->area.width;
expose_area.height = ev->area.height;
- render (cr->cobj(), &expose_area);
+ render (cr, &expose_area);
#ifdef OPTIONAL_CAIRO_IMAGE_SURFACE
if (getenv("ARDOUR_IMAGE_SURFACE")) {
#endif
}
+void
+CairoWidget::on_map ()
+{
+ Gtk::EventBox::on_map();
+#ifdef __APPLE__
+ if (_nsglview) {
+ Gtkmm2ext::nsglview_set_visible (_nsglview, true);
+ Gtk::Allocation a = get_allocation();
+ gint xx, yy;
+ gtk_widget_translate_coordinates(
+ GTK_WIDGET(gobj()),
+ GTK_WIDGET(get_toplevel()->gobj()),
+ 0, 0, &xx, &yy);
+ Gtkmm2ext::nsglview_resize (_nsglview, xx, yy, a.get_width(), a.get_height());
+ }
+#endif
+}
+
+void
+CairoWidget::on_unmap ()
+{
+ Gtk::EventBox::on_unmap();
+#ifdef __APPLE__
+ if (_nsglview) {
+ Gtkmm2ext::nsglview_set_visible (_nsglview, false);
+ }
+#endif
+}
+
void
CairoWidget::on_state_changed (Gtk::StateType)
{
_flat_buttons = yn;
}
+void
+CairoWidget::set_boxy_buttons (bool yn)
+{
+ _boxy_buttons = yn;
+}
+
+
void
CairoWidget::set_widget_prelight (bool yn)
{