+void
+CairoWidget::set_canvas_widget ()
+{
+ assert (!_canvas_widget);
+ ensure_style ();
+ gtk_widget_set_realized (GTK_WIDGET(gobj()), true);
+ _canvas_widget = true;
+}
+
+int
+CairoWidget::get_width () const
+{
+ if (_canvas_widget) {
+ return _allocation.get_width ();
+ }
+ return Gtk::EventBox::get_width ();
+}
+
+int
+CairoWidget::get_height () const
+{
+ if (_canvas_widget) {
+ return _allocation.get_height ();
+ }
+ return Gtk::EventBox::get_height ();
+}
+
+void
+CairoWidget::size_allocate (Gtk::Allocation& alloc)
+{
+ if (_canvas_widget) {
+ memcpy (&_allocation, &alloc, sizeof(Gtk::Allocation));
+ return;
+ }
+ Gtk::EventBox::size_allocate (alloc);
+}
+
+