-
- /* please look at the text in wxWindow::DoSetSize() on why the
- test GTK_WIDGET_REALIZED() has to be here */
- if (GTK_WIDGET_VISIBLE (child->widget))
- {
-/* if (GTK_IS_NOTEBOOK(child->widget) && !GTK_WIDGET_REALIZED(child->widget))
- {
- gtk_widget_queue_resize( child->widget );
- }
- else */
- {
- child_allocation.x = child->x;
- child_allocation.y = child->y;
- child_allocation.width = MAX( child->width, 1 );
- child_allocation.height = MAX( child->height, 1 );
-
- /* work around for GTK bug when moving widgets outside
- the X window -> do NOT move them entirely outside */
- if (child_allocation.y + child_allocation.height < 0)
- child_allocation.y = -child_allocation.height;
- if (child_allocation.x + child_allocation.width < 0)
- child_allocation.x = -child_allocation.width;
-
- gtk_widget_size_allocate (child->widget, &child_allocation);
- }
+
+ gtk_pizza_position_child (pizza, child);
+ gtk_pizza_allocate_child (pizza, child);
+ }
+}
+
+static void
+gtk_pizza_draw (GtkWidget *widget,
+ GdkRectangle *area)
+{
+ GtkPizza *pizza;
+ GtkPizzaChild *child;
+ GdkRectangle child_area;
+ GList *children;
+
+ g_return_if_fail (widget != NULL);
+ g_return_if_fail (GTK_IS_PIZZA (widget));
+
+ pizza = GTK_PIZZA (widget);
+
+ /* Sometimes, We handle all expose events in window.cpp now. */
+ if (pizza->external_expose)
+ return;
+
+ children = pizza->children;
+ if ( !(GTK_WIDGET_APP_PAINTABLE (widget)) &&
+ (pizza->clear_on_draw))
+ {
+ gdk_window_clear_area( pizza->bin_window,
+ area->x, area->y, area->width, area->height);
+ }
+
+ while (children)
+ {
+ child = children->data;
+ children = children->next;
+
+ if (gtk_widget_intersect (child->widget, area, &child_area))
+ gtk_widget_draw (child->widget, &child_area);
+ }
+}
+
+static gint
+gtk_pizza_expose (GtkWidget *widget,
+ GdkEventExpose *event)
+{
+ GtkPizza *pizza;
+ GtkPizzaChild *child;
+ GdkEventExpose child_event;
+ GList *children;
+
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (GTK_IS_PIZZA (widget), FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+
+ pizza = GTK_PIZZA (widget);
+
+ if (event->window != pizza->bin_window)
+ return FALSE;
+
+ /* We handle all expose events in window.cpp now. */
+ if (pizza->external_expose)
+ return FALSE;
+
+ children = pizza->children;
+ while (children)
+ {
+ child = children->data;
+ children = children->next;
+
+ child_event = *event;
+
+ if (GTK_WIDGET_NO_WINDOW (child->widget) &&
+ GTK_WIDGET_DRAWABLE (child->widget) &&
+ gtk_widget_intersect (child->widget, &event->area, &child_event.area))
+ {
+ gtk_widget_event (child->widget, (GdkEvent*) &child_event);