[gtk+: 630/630] Merge branch 'native-layout-incubator'



commit db76c77b819b1b31e19609bb1b30c85f22b5b482
Merge: 6ea712f 3833ef5
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Apr 30 17:56:50 2010 -0400

    Merge branch 'native-layout-incubator'
    
    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

 docs/reference/gtk/tmpl/gtkcontainer.sgml |  295 +++++----
 docs/reference/gtk/tmpl/gtklabel.sgml     |   20 +-
 gtk/Makefile.am                           |    2 +
 gtk/gtk.h                                 |    1 +
 gtk/gtk.symbols                           |   11 +
 gtk/gtkalignment.c                        |  152 ++++--
 gtk/gtkassistant.c                        |   15 +-
 gtk/gtkbin.c                              |  121 ++++-
 gtk/gtkbox.c                              | 1010 ++++++++++++++++++++---------
 gtk/gtkbutton.c                           |  150 +++--
 gtk/gtkcontainer.c                        |    3 +
 gtk/gtkdebug.h                            |   25 +-
 gtk/gtkextendedlayout.c                   |  527 +++++++++++++++
 gtk/gtkextendedlayout.h                   |   89 +++
 gtk/gtkfilechooser.c                      |    6 +-
 gtk/gtkframe.c                            |  156 ++++--
 gtk/gtklabel.c                            |  727 +++++++++++++++++-----
 gtk/gtkmain.c                             |    3 +-
 gtk/gtkpathbar.c                          |   29 +-
 gtk/gtkprivate.h                          |   59 +-
 gtk/gtkscrolledwindow.c                   |  311 ++++++---
 gtk/gtksizegroup.c                        |  212 +++----
 gtk/gtksizegroup.h                        |   11 +-
 gtk/gtkviewport.c                         |  120 +++-
 gtk/gtkwidget.c                           |  101 +++-
 gtk/gtkwidget.h                           |    2 +
 gtk/gtkwindow.c                           |   98 ++-
 tests/Makefile.am                         |    3 +
 tests/extendedlayoutexample.c             |  614 ++++++++++++++++++
 tests/testellipsise.c                     |  121 ++++-
 30 files changed, 3914 insertions(+), 1080 deletions(-)
---
diff --cc gtk/gtkalignment.c
index ad74175,73905f8..5d986e2
--- a/gtk/gtkalignment.c
+++ b/gtk/gtkalignment.c
@@@ -24,27 -24,9 +24,28 @@@
   * 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"
diff --cc gtk/gtkbin.c
index 3d533b2,ed2796a89..25ccb60
--- a/gtk/gtkbin.c
+++ b/gtk/gtkbin.c
@@@ -24,21 -24,9 +24,22 @@@
   * 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 d9356f5,231a306..35900e8
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@@ -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;
  	    }
  	}
  
diff --cc gtk/gtkfilechooser.c
index 85f972f,70ddfda..7341b63
--- a/gtk/gtkfilechooser.c
+++ b/gtk/gtkfilechooser.c
@@@ -504,7 -504,7 +504,11 @@@
   * 	    </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/gtkscrolledwindow.c
index 5a3cd91,936335f..bf3cda9
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@@ -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 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]