- window = gtk_widget_get_window (widget);
- if (event->window == window)
- {
- cairo_surface_t *surface;
- GtkAllocation child_area;
- cairo_t *cr;
- int start_y = 0;
-
- if (offscreen_box->child1 && gtk_widget_get_visible (offscreen_box->child1))
- {
- surface = gdk_offscreen_window_get_surface (offscreen_box->offscreen_window1);
- gtk_widget_get_allocation (offscreen_box->child1, &child_area);
-
- cr = gdk_cairo_create (window);
-
- cairo_set_source_surface (cr, surface, 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;
-
- surface = gdk_offscreen_window_get_surface (offscreen_box->offscreen_window2);
- gtk_widget_get_allocation (offscreen_box->child2, &child_area);
-
- cr = gdk_cairo_create (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 (offscreen_box->offscreen_window2, &w, &h);
- cairo_rectangle (cr, 0, 0, w, h);
- cairo_clip (cr);
-
- /* paint */
- cairo_set_source_surface (cr, surface, 0, 0);
- cairo_paint (cr);
-
- cairo_destroy (cr);
- }
- }
- else if (event->window == offscreen_box->offscreen_window1)
- {
- gtk_paint_flat_box (gtk_widget_get_style (widget), 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 (gtk_widget_get_style (widget), 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);
- }