]> Pileus Git - ~andy/gtk/commitdiff
API: Remove gtk_container_propagate_expose()
authorBenjamin Otte <otte@redhat.com>
Fri, 10 Sep 2010 19:12:55 +0000 (21:12 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:42 +0000 (15:11 +0200)
Also, move the documentation to its replacement
gtk_widget_propagate_draw().

docs/reference/gtk/gtk3-sections.txt
gtk/gtk.symbols
gtk/gtkcontainer.c

index 5a3d0020b2eec7eadfd79c08f22746e2e3fe83c2..16f3b0288d88f837c8093348c41fe8d0016e60ad 100644 (file)
@@ -868,7 +868,7 @@ gtk_container_child_set_valist
 gtk_container_forall
 gtk_container_get_border_width
 gtk_container_set_border_width
-gtk_container_propagate_expose
+gtk_container_propagate_draw
 gtk_container_get_focus_chain
 gtk_container_set_focus_chain
 gtk_container_unset_focus_chain
index 671cdd4b1f64542431ecd0c9843eeb2b66966134..345e1e429aa4d3bfdcd8da2e8d965882ba21bed4 100644 (file)
@@ -881,7 +881,6 @@ gtk_container_get_focus_vadjustment
 gtk_container_get_resize_mode
 gtk_container_get_type G_GNUC_CONST
 gtk_container_propagate_draw
-gtk_container_propagate_expose
 gtk_container_remove
 gtk_container_resize_children
 gtk_container_set_border_width
index 2a6855e2e9c661543408fe593148fcbcf8278727..7cecb10dd5ec81cedda9d415489bf015496db205 100644 (file)
@@ -2825,6 +2825,30 @@ gtk_container_unmap (GtkWidget *widget)
                          NULL);
 }
 
+/**
+ * gtk_container_propagate_draw:
+ * @container: a #GtkContainer
+ * @child: a child of @container
+ * @cr: Cairo context as passed to the container. If you want to use @cr
+ *   in container's draw function, consider using cairo_save() and 
+ *   cairo_restore() before calling this function.
+ *
+ * When a container receives a call to the draw function, it must send
+ * synthetic #GtkWidget::draw calls to all children that don't have their
+ * own #GdkWindows. This function provides a convenient way of doing this.
+ * A container, when it receives a call to its #GtkWidget::draw function,
+ * calls gtk_container_propagate_draw() once for each child, passing in
+ * the @cr the container received.
+ *
+ * gtk_container_propagate_draw() takes care of translating the origin of @cr,
+ * and deciding whether the draw needs to be sent to the child. It is a
+ * convenient and optimized way of getting the same effect as calling
+ * gtk_widget_draw() on the child directly.
+ * 
+ * In most cases, a container can simply either inherit the
+ * #GtkWidget::draw implementation from #GtkContainer, or do some drawing 
+ * and then chain to the ::draw implementation from #GtkContainer.
+ **/
 void
 gtk_container_propagate_draw (GtkContainer   *container,
                               GtkWidget      *child,
@@ -2894,57 +2918,6 @@ gtk_container_propagate_draw (GtkContainer   *container,
   cairo_restore (cr);
 }
 
-/**
- * gtk_container_propagate_expose:
- * @container: a #GtkContainer
- * @child: a child of @container
- * @event: a expose event sent to container
- *
- * When a container receives an expose event, it must send synthetic
- * expose events to all children that don't have their own #GdkWindows.
- * This function provides a convenient way of doing this. A container,
- * when it receives an expose event, calls gtk_container_propagate_expose() 
- * once for each child, passing in the event the container received.
- *
- * gtk_container_propagate_expose() takes care of deciding whether
- * an expose event needs to be sent to the child, intersecting
- * the event's area with the child area, and sending the event.
- * 
- * In most cases, a container can simply either simply inherit the
- * #GtkWidget::expose implementation from #GtkContainer, or, do some drawing 
- * and then chain to the ::expose implementation from #GtkContainer.
- **/
-void
-gtk_container_propagate_expose (GtkContainer   *container,
-                               GtkWidget      *child,
-                               GdkEventExpose *event)
-{
-  GdkEvent *child_event;
-
-  g_return_if_fail (GTK_IS_CONTAINER (container));
-  g_return_if_fail (GTK_IS_WIDGET (child));
-  g_return_if_fail (event != NULL);
-
-  g_assert (gtk_widget_get_parent (child) == GTK_WIDGET (container));
-
-  if (gtk_widget_is_drawable (child) &&
-      !gtk_widget_get_has_window (child) &&
-      gtk_widget_get_window (child) == event->window)
-    {
-      child_event = gdk_event_new (GDK_EXPOSE);
-      child_event->expose = *event;
-      g_object_ref (child_event->expose.window);
-
-      child_event->expose.region = gtk_widget_region_intersect (child, event->region);
-      if (!cairo_region_is_empty (child_event->expose.region))
-       {
-         cairo_region_get_extents (child_event->expose.region, &child_event->expose.area);
-         gtk_widget_send_expose (child, child_event);
-       }
-      gdk_event_free (child_event);
-    }
-}
-
 gboolean
 _gtk_container_get_need_resize (GtkContainer *container)
 {