- if (event->window == widget->window)
- {
- GdkPixmap *pixmap;
- GtkAllocation child_area;
- cairo_t *cr;
- int start_y = 0;
-
- if (offscreen_box->child1 && gtk_widget_get_visible (offscreen_box->child1))
- {
- pixmap = gdk_offscreen_window_get_pixmap (offscreen_box->offscreen_window1);
- child_area = offscreen_box->child1->allocation;
-
- cr = gdk_cairo_create (widget->window);
-
- gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
- cairo_paint (cr);
-
- cairo_destroy (cr);
-
- start_y += child_area.height;
- }
-
- if (offscreen_box->child2 && gtk_widget_get_visible (offscreen_box->child2))
- {
- gint w, h;
-
- pixmap = gdk_offscreen_window_get_pixmap (offscreen_box->offscreen_window2);
- child_area = offscreen_box->child2->allocation;
-
- cr = gdk_cairo_create (widget->window);
-
- /* transform */
- cairo_translate (cr, 0, start_y);
- cairo_translate (cr, child_area.width / 2, child_area.height / 2);
- cairo_rotate (cr, offscreen_box->angle);
- cairo_translate (cr, -child_area.width / 2, -child_area.height / 2);
-
- /* clip */
- gdk_drawable_get_size (pixmap, &w, &h);
- cairo_rectangle (cr, 0, 0, w, h);
- cairo_clip (cr);
-
- /* paint */
- gdk_cairo_set_source_pixmap (cr, pixmap, 0, 0);
- cairo_paint (cr);
-
- cairo_destroy (cr);
- }
- }
- else if (event->window == offscreen_box->offscreen_window1)
- {
- gtk_paint_flat_box (widget->style, event->window,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- &event->area, widget, "blah",
- 0, 0, -1, -1);
-
- if (offscreen_box->child1)
- gtk_container_propagate_expose (GTK_CONTAINER (widget),
- offscreen_box->child1,
- event);
- }
- else if (event->window == offscreen_box->offscreen_window2)
- {
- gtk_paint_flat_box (widget->style, event->window,
- GTK_STATE_NORMAL, GTK_SHADOW_NONE,
- &event->area, widget, "blah",
- 0, 0, -1, -1);
-
- if (offscreen_box->child2)
- gtk_container_propagate_expose (GTK_CONTAINER (widget),
- offscreen_box->child2,
- event);
- }