]> Pileus Git - ~andy/gtk/commitdiff
Merge branch 'native-layout-incubator'
authorMatthias Clasen <mclasen@redhat.com>
Fri, 30 Apr 2010 21:56:50 +0000 (17:56 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 30 Apr 2010 21:56:50 +0000 (17:56 -0400)
Conflicts:
configure.in
docs/reference/gtk/tmpl/gtkaction.sgml
docs/reference/gtk/tmpl/gtkbuilder.sgml
gdk/directfb/gdkkeys-directfb.c
gdk/gdk.symbols
gdk/x11/gdkwindow-x11.c
gtk/gtkalignment.c
gtk/gtkbox.c
gtk/gtkbutton.c
gtk/gtkcelleditable.c
gtk/gtkfilechooser.c
gtk/gtkframe.c
gtk/gtkinvisible.c
gtk/gtklabel.c
gtk/gtkscrolledwindow.c
gtk/gtksearchenginetracker.c
gtk/gtktextview.c
gtk/gtktoolbutton.c
gtk/gtktooltip.c
gtk/gtkviewport.c
gtk/gtkwidget.c
gtk/gtkwindow.c
po-properties/ca@valencia.po
po-properties/es.po
po-properties/kn.po
po-properties/mr.po
po/ca.po
po/ca@valencia.po
po/el.po
po/es.po
po/gl.po
po/id.po
po/kn.po
po/lv.po
po/mr.po
po/th.po

14 files changed:
1  2 
gtk/Makefile.am
gtk/gtk.symbols
gtk/gtkalignment.c
gtk/gtkassistant.c
gtk/gtkbin.c
gtk/gtkbox.c
gtk/gtkfilechooser.c
gtk/gtklabel.c
gtk/gtkmain.c
gtk/gtkscrolledwindow.c
gtk/gtkviewport.c
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwindow.c

diff --cc gtk/Makefile.am
Simple merge
diff --cc gtk/gtk.symbols
Simple merge
index ad741751e261a73ad84a97d45fa391e1febbd947,73905f813a273596c4ef96e67c55f5a9ff11db51..5d986e2a7054fc82916cd69bead13ec1782353d5
   * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
   */
  
 +/**
 + * SECTION:gtkalignment
 + * @Short_description: A widget which controls the alignment and size of its child
 + * @Title: GtkAlignment
 + *
 + * The #GtkAlignment widget controls the alignment and size of its child widget.
 + * It has four settings: xscale, yscale, xalign, and yalign.
 + *
 + * The scale settings are used to specify how much the child widget should
 + * expand to fill the space allocated to the #GtkAlignment.
 + * The values can range from 0 (meaning the child doesn't expand at all) to
 + * 1 (meaning the child expands to fill all of the available space).
 + *
 + * The align settings are used to place the child widget within the available
 + * area. The values range from 0 (top or left) to 1 (bottom or right).
 + * Of course, if the scale settings are both set to 1, the alignment settings
 + * have no effect.
 + */
 +
  #include "config.h"
  #include "gtkalignment.h"
+ #include "gtkextendedlayout.h"
  #include "gtkprivate.h"
  #include "gtkintl.h"
  #include "gtkalias.h"
Simple merge
diff --cc gtk/gtkbin.c
index 3d533b2de288e60a7f0eff15bb5892e685cd8389,ed2796a89c3d7cdf5382e3146945ec2f5ea28665..25ccb60661331c1f1562a7c388d777aa6c02a3c3
   * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
   */
  
 +/**
 + * SECTION:gtkbin
 + * @Short_description: A container with just one child
 + * @Title: GtkBin
 + *
 + * The #GtkBin widget is a container with just one child.
 + * It is not very useful itself, but it is useful for deriving subclasses,
 + * since it provides common code needed for handling a single child widget.
 + *
 + * Many GTK+ widgets are subclasses of #GtkBin, including #GtkWindow,
 + * #GtkButton, #GtkFrame, #GtkHandleBox or #GtkScrolledWindow.
 + */
 +
  #include "config.h"
  #include "gtkbin.h"
+ #include "gtkextendedlayout.h"
  #include "gtkintl.h"
  #include "gtkalias.h"
  
diff --cc gtk/gtkbox.c
index d9356f53e7a75d4fc3417615064289a4206c87f5,231a30678bf20ba3dfc783cfc6da79a380217613..35900e8888340e5d377c36351946410b9ce369b6
@@@ -467,94 -372,46 +426,46 @@@ gtk_box_size_allocate (GtkWidget     *w
        {
          child = children->data;
          children = children->next;
 -        
 +
-         if ((child->pack == GTK_PACK_START) && gtk_widget_get_visible (child->widget))
+         if (gtk_widget_get_visible (child->widget))
            {
-             if (box->homogeneous)
-               {
-                 if (nvis_children == 1)
-                     {
-                       child_width = width;
-                       child_height = height;
-                     }
-                 else
-                     {
-                       child_width = extra;
-                       child_height = extra;
-                     }
-                 nvis_children -= 1;
-                 width -= extra;
-                   height -= extra;
-               }
-             else
-               {
-                 GtkRequisition child_requisition;
-                 gtk_widget_get_child_requisition (child->widget, &child_requisition);
-                 child_width = child_requisition.width + child->padding * 2;
-                 child_height = child_requisition.height + child->padding * 2;
-                 if (child->expand)
-                   {
-                     if (nexpand_children == 1)
-                         {
-                           child_width += width;
-                           child_height += height;
-                         }
-                     else
-                         {
-                           child_width += extra;
-                           child_height += extra;
-                         }
-                     nexpand_children -= 1;
-                     width -= extra;
-                       height -= extra;
-                   }
-               }
-             if (child->fill)
-               {
-                   if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
-                     {
-                       child_allocation.width = MAX (1, (gint) child_width - (gint) child->padding * 2);
-                       child_allocation.x = x + child->padding;
-                     }
-                   else
-                     {
-                       child_allocation.height = MAX (1, child_height - (gint)child->padding * 2);
-                       child_allocation.y = y + child->padding;
-                     }
-               }
+             if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
+               gtk_extended_layout_get_width_for_height (GTK_EXTENDED_LAYOUT (child->widget),
+                                                         allocation->height,
+                                                         &sizes[i].minimum_size,
+                                                         &sizes[i].natural_size);
              else
-               {
-                 GtkRequisition child_requisition;
-                 gtk_widget_get_child_requisition (child->widget, &child_requisition);
-                   if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
-                     {
-                       child_allocation.width = child_requisition.width;
-                       child_allocation.x = x + (child_width - child_allocation.width) / 2;
-                     }
-                   else
-                     {
-                       child_allocation.height = child_requisition.height;
-                       child_allocation.y = y + (child_height - child_allocation.height) / 2;
-                     }
-               }
-             if (direction == GTK_TEXT_DIR_RTL &&
-                   private->orientation == GTK_ORIENTATION_HORIZONTAL)
-                 {
-                   child_allocation.x = allocation->x + allocation->width - (child_allocation.x - allocation->x) - child_allocation.width;
-                 }
-             gtk_widget_size_allocate (child->widget, &child_allocation);
-             x += child_width + box->spacing;
-             y += child_height + box->spacing;
+               gtk_extended_layout_get_height_for_width (GTK_EXTENDED_LAYOUT (child->widget),
+                                                         allocation->width,
+                                                         &sizes[i].minimum_size,
+                                                         &sizes[i].natural_size);
+             
+             
+             /* Assert the api is working properly */
+             if (sizes[i].minimum_size < 0)
+               g_error ("GtkBox child %s minimum %s: %d < 0 for %s %d",
+                        gtk_widget_get_name (GTK_WIDGET (child->widget)),
+                        (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "width" : "height",
+                        sizes[i].minimum_size,
+                        (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "height" : "width",
+                        (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? allocation->height : allocation->width);
+             if (sizes[i].natural_size < sizes[i].minimum_size)
+               g_error ("GtkBox child %s natural %s: %d < minimum %d for %s %d",
+                        gtk_widget_get_name (GTK_WIDGET (child->widget)),
+                        (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "width" : "height",
+                        sizes[i].natural_size, 
+                        sizes[i].minimum_size,
+                        (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? "height" : "width",
+                        (private->orientation == GTK_ORIENTATION_HORIZONTAL) ? allocation->height : allocation->width);
+             
+             size -= sizes[i].minimum_size;
+             size -= child->padding * 2;
+             
+             spreading[i].index = i;
+             spreading[i].child = child;
+             
+             i += 1;
            }
        }
  
index 85f972f064bd6d9bd4d70fe7680c6a9c2b63a75d,70ddfda1aaa075e1a7a4300bad3f96aa57c11a97..7341b6397413a7eec98596afc7ac33dce26ef1f7
   *        </listitem>
   *      </varlistentry>
   *      <varlistentry>
++<<<<<<< HEAD
 + *        <term><parameter>bookmark_indes</parameter>&nbsp;:</term>
++=======
+  *        <term><parameter>bookmark_index</parameter>&nbsp;:</term>
++>>>>>>> native-layout-incubator
   *        <listitem>
   *          <simpara>
   *            index of the bookmark to switch to; the indices start at 0.
diff --cc gtk/gtklabel.c
Simple merge
diff --cc gtk/gtkmain.c
Simple merge
index 5a3cd91520357718dc01440741b526848936db05,936335f424138ce316a593fac85a9b1f6a81518e..bf3cda9b1beee567cc0ecf4afdc1d234bc44f2c1
@@@ -380,9 -397,9 +397,15 @@@ gtk_scrolled_window_init (GtkScrolledWi
   * gtk_scrolled_window_new:
   * @hadjustment: (allow-none): horizontal adjustment
   * @vadjustment: (allow-none): vertical adjustment
++<<<<<<< HEAD
+  *
+  * Creates a new scrolled window.
+  *
++=======
 + *
 + * Creates a new scrolled window.
 + *
++>>>>>>> native-layout-incubator
   * The two arguments are the scrolled window's adjustments; these will be
   * shared with the scrollbars and the child widget to keep the bars in sync 
   * with the child. Usually you want to pass %NULL for the adjustments, which 
Simple merge
diff --cc gtk/gtkwidget.c
Simple merge
diff --cc gtk/gtkwidget.h
Simple merge
diff --cc gtk/gtkwindow.c
Simple merge