X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkplug.c;h=5bb003afc00a8f57b4319f92e357c4b469ae8794;hb=0a8043da1386ea35a2c0fa5fcf762ef0296520d6;hp=362725d69bccf1be4432df9323dc88cfac7b7e61;hpb=68c38e0ffd3a4075ea5caf008f933ef91ed9d3cc;p=~andy%2Fgtk diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index 362725d69..5bb003afc 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -30,13 +30,10 @@ #include "gtkmain.h" #include "gtkmarshalers.h" #include "gtkplug.h" -#include "gtkextendedlayout.h" #include "gtkintl.h" #include "gtkprivate.h" #include "gtkplugprivate.h" -#include "gtkalias.h" - /** * SECTION:gtkplug * @Short_description: Toplevel for embedding into other processes @@ -708,13 +705,14 @@ gtk_plug_map (GtkWidget *widget) { GtkBin *bin = GTK_BIN (widget); GtkPlug *plug = GTK_PLUG (widget); + GtkWidget *child; gtk_widget_set_mapped (widget, TRUE); - if (bin->child && - gtk_widget_get_visible (bin->child) && - !gtk_widget_get_mapped (bin->child)) - gtk_widget_map (bin->child); + child = gtk_bin_get_child (bin); + if (gtk_widget_get_visible (child) && + !gtk_widget_get_mapped (child)) + gtk_widget_map (child); _gtk_plug_windowing_map_toplevel (plug); @@ -751,8 +749,8 @@ static void gtk_plug_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { - GtkBin *bin = GTK_BIN (widget); - GtkRequisition natural_size; + GtkWidget *child; + if (gtk_widget_is_toplevel (widget)) GTK_WIDGET_CLASS (gtk_plug_parent_class)->size_allocate (widget, allocation); else @@ -766,24 +764,21 @@ gtk_plug_size_allocate (GtkWidget *widget, allocation->x, allocation->y, allocation->width, allocation->height); - if (bin->child && gtk_widget_get_visible (bin->child)) + child = gtk_bin_get_child (bin); + if (gtk_widget_get_visible (child)) { GtkAllocation child_allocation; - child_allocation.x = child_allocation.y = GTK_CONTAINER (widget)->border_width; + child_allocation.x = child_allocation.y = gtk_container_get_border_width (GTK_CONTAINER (widget)); child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2); child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2); - gtk_widget_size_allocate (bin->child, &child_allocation); + gtk_widget_size_allocate (child, &child_allocation); } } - - gtk_extended_layout_get_desired_size (GTK_EXTENDED_LAYOUT (bin->child), - NULL, &natural_size); - _gtk_plug_windowing_publish_natural_size (GTK_PLUG (widget), &natural_size); } static gboolean @@ -956,9 +951,11 @@ gtk_plug_focus (GtkWidget *widget, GtkPlug *plug = GTK_PLUG (widget); GtkWindow *window = GTK_WINDOW (widget); GtkContainer *container = GTK_CONTAINER (widget); - GtkWidget *old_focus_child = container->focus_child; + GtkWidget *child; + GtkWidget *old_focus_child; GtkWidget *parent; - + + old_focus_child = gtk_container_get_focus_child (container); /* We override GtkWindow's behavior, since we don't want wrapping here. */ if (old_focus_child) @@ -982,11 +979,12 @@ gtk_plug_focus (GtkWidget *widget, else { /* Try to focus the first widget in the window */ - if (bin->child && gtk_widget_child_focus (bin->child, direction)) + child = gtk_bin_get_child (bin); + if (child && gtk_widget_child_focus (child, direction)) return TRUE; } - if (!GTK_CONTAINER (window)->focus_child) + if (!gtk_container_get_focus_child (GTK_CONTAINER (window))) _gtk_plug_windowing_focus_to_parent (plug, direction); return FALSE; @@ -1071,6 +1069,3 @@ _gtk_plug_focus_first_last (GtkPlug *plug, gtk_widget_child_focus (GTK_WIDGET (plug), direction); } - -#define __GTK_PLUG_C__ -#include "gtkaliasdef.c"