1. ------------------------------------------------------------------------------ 
  2. --                                                                          -- 
  3. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  4. --                     Copyright (C) 2000-2014, AdaCore                     -- 
  5. --                                                                          -- 
  6. -- This library is free software;  you can redistribute it and/or modify it -- 
  7. -- under terms of the  GNU General Public License  as published by the Free -- 
  8. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  9. -- version. This library is distributed in the hope that it will be useful, -- 
  10. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  11. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  12. --                                                                          -- 
  13. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  14. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  15. -- version 3.1, as published by the Free Software Foundation.               -- 
  16. --                                                                          -- 
  17. -- You should have received a copy of the GNU General Public License and    -- 
  18. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  19. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  20. -- <http://www.gnu.org/licenses/>.                                          -- 
  21. --                                                                          -- 
  22. ------------------------------------------------------------------------------ 
  23.  
  24. --  <description> 
  25. --  The GtkTreeViewColumn object represents a visible column in a 
  26. --  Gtk.Tree_View.Gtk_Tree_View widget. It allows to set properties of the 
  27. --  column header, and functions as a holding pen for the cell renderers which 
  28. --  determine how the data in the column is displayed. 
  29. -- 
  30. --  Please refer to the <link linkend="TreeWidget">tree widget conceptual 
  31. --  overview</link> for an overview of all the objects and data types related 
  32. --  to the tree widget and how they work together. 
  33. -- 
  34. --  </description> 
  35. pragma Ada_2005; 
  36.  
  37. pragma Warnings (Off, "*is already use-visible*"); 
  38. with Gdk.Rectangle;           use Gdk.Rectangle; 
  39. with Glib;                    use Glib; 
  40. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  41. with Glib.Glist;              use Glib.Glist; 
  42. with Glib.Object;             use Glib.Object; 
  43. with Glib.Properties;         use Glib.Properties; 
  44. with Glib.Types;              use Glib.Types; 
  45. with Gtk.Buildable;           use Gtk.Buildable; 
  46. with Gtk.Cell_Area;           use Gtk.Cell_Area; 
  47. with Gtk.Cell_Layout;         use Gtk.Cell_Layout; 
  48. with Gtk.Cell_Renderer;       use Gtk.Cell_Renderer; 
  49. with Gtk.Enums;               use Gtk.Enums; 
  50. with Gtk.Tree_Model;          use Gtk.Tree_Model; 
  51. with Gtk.Widget;              use Gtk.Widget; 
  52.  
  53. package Gtk.Tree_View_Column is 
  54.  
  55.    type Gtk_Tree_View_Column_Record is new GObject_Record with null record; 
  56.    type Gtk_Tree_View_Column is access all Gtk_Tree_View_Column_Record'Class; 
  57.  
  58.    type Gtk_Tree_View_Column_Sizing is ( 
  59.       Tree_View_Column_Grow_Only, 
  60.       Tree_View_Column_Autosize, 
  61.       Tree_View_Column_Fixed); 
  62.    pragma Convention (C, Gtk_Tree_View_Column_Sizing); 
  63.    --  The sizing method the column uses to determine its width. Please note 
  64.    --  that Gtk_Tree_View_Column_Autosize are inefficient for large views, and 
  65.    --  can make columns appear choppy. 
  66.  
  67.    function Convert (R : Gtk.Tree_View_Column.Gtk_Tree_View_Column) return System.Address; 
  68.    function Convert (R : System.Address) return Gtk.Tree_View_Column.Gtk_Tree_View_Column; 
  69.    package Column_List is new Generic_List (Gtk.Tree_View_Column.Gtk_Tree_View_Column); 
  70.  
  71.    --------------- 
  72.    -- Callbacks -- 
  73.    --------------- 
  74.  
  75.    type Gtk_Cell_Layout_Data_Func is access procedure 
  76.      (Cell_Layout : Gtk.Cell_Layout.Gtk_Cell_Layout; 
  77.       Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  78.       Tree_Model  : Gtk.Tree_Model.Gtk_Tree_Model; 
  79.       Iter        : Gtk.Tree_Model.Gtk_Tree_Iter); 
  80.    --  A function which should set the value of Cell_Layout's cell renderer(s) 
  81.    --  as appropriate. 
  82.    --  "cell_layout": a Gtk.Cell_Layout.Gtk_Cell_Layout 
  83.    --  "cell": the cell renderer whose value is to be set 
  84.    --  "tree_model": the model 
  85.    --  "iter": a Gtk.Tree_Model.Gtk_Tree_Iter indicating the row to set the 
  86.    --  value for 
  87.  
  88.    ---------------------------- 
  89.    -- Enumeration Properties -- 
  90.    ---------------------------- 
  91.  
  92.    package Gtk_Tree_View_Column_Sizing_Properties is 
  93.       new Generic_Internal_Discrete_Property (Gtk_Tree_View_Column_Sizing); 
  94.    type Property_Gtk_Tree_View_Column_Sizing is new Gtk_Tree_View_Column_Sizing_Properties.Property; 
  95.  
  96.    ------------------ 
  97.    -- Constructors -- 
  98.    ------------------ 
  99.  
  100.    procedure Gtk_New (Tree_Column : out Gtk_Tree_View_Column); 
  101.    procedure Initialize 
  102.       (Tree_Column : not null access Gtk_Tree_View_Column_Record'Class); 
  103.    --  Creates a new Gtk.Tree_View_Column.Gtk_Tree_View_Column. 
  104.  
  105.    function Gtk_Tree_View_Column_New return Gtk_Tree_View_Column; 
  106.    --  Creates a new Gtk.Tree_View_Column.Gtk_Tree_View_Column. 
  107.  
  108.    procedure Gtk_New_With_Area 
  109.       (Tree_Column : out Gtk_Tree_View_Column; 
  110.        Area        : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class); 
  111.    procedure Initialize_With_Area 
  112.       (Tree_Column : not null access Gtk_Tree_View_Column_Record'Class; 
  113.        Area        : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class); 
  114.    --  Creates a new Gtk.Tree_View_Column.Gtk_Tree_View_Column using Area to 
  115.    --  render its cells. 
  116.    --  Since: gtk+ 3.0 
  117.    --  "area": the Gtk.Cell_Area.Gtk_Cell_Area that the newly created column 
  118.    --  should use to layout cells. 
  119.  
  120.    function Gtk_Tree_View_Column_New_With_Area 
  121.       (Area : not null access Gtk.Cell_Area.Gtk_Cell_Area_Record'Class) 
  122.        return Gtk_Tree_View_Column; 
  123.    --  Creates a new Gtk.Tree_View_Column.Gtk_Tree_View_Column using Area to 
  124.    --  render its cells. 
  125.    --  Since: gtk+ 3.0 
  126.    --  "area": the Gtk.Cell_Area.Gtk_Cell_Area that the newly created column 
  127.    --  should use to layout cells. 
  128.  
  129.    function Get_Type return Glib.GType; 
  130.    pragma Import (C, Get_Type, "gtk_tree_view_column_get_type"); 
  131.  
  132.    ------------- 
  133.    -- Methods -- 
  134.    ------------- 
  135.  
  136.    procedure Cell_Get_Position 
  137.       (Tree_Column   : not null access Gtk_Tree_View_Column_Record; 
  138.        Cell_Renderer : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  139.        X_Offset      : out Gint; 
  140.        Width         : out Gint; 
  141.        Success       : out Boolean); 
  142.    --  Obtains the horizontal position and size of a cell in a column. If the 
  143.    --  cell is not found in the column, Start_Pos and Width are not changed and 
  144.    --  False is returned. 
  145.    --  "cell_renderer": a Gtk.Cell_Renderer.Gtk_Cell_Renderer 
  146.    --  "x_offset": return location for the horizontal position of Cell within 
  147.    --  Tree_Column, may be null 
  148.    --  "width": return location for the width of Cell, may be null 
  149.  
  150.    procedure Cell_Get_Size 
  151.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  152.        Cell_Area   : Gdk.Rectangle.Gdk_Rectangle; 
  153.        X_Offset    : out Gint; 
  154.        Y_Offset    : out Gint; 
  155.        Width       : out Gint; 
  156.        Height      : out Gint); 
  157.    --  Obtains the width and height needed to render the column. This is used 
  158.    --  primarily by the Gtk.Tree_View.Gtk_Tree_View. 
  159.    --  "cell_area": The area a cell in the column will be allocated, or null 
  160.    --  "x_offset": location to return x offset of a cell relative to 
  161.    --  Cell_Area, or null 
  162.    --  "y_offset": location to return y offset of a cell relative to 
  163.    --  Cell_Area, or null 
  164.    --  "width": location to return width needed to render a cell, or null 
  165.    --  "height": location to return height needed to render a cell, or null 
  166.  
  167.    function Cell_Is_Visible 
  168.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  169.        return Boolean; 
  170.    --  Returns True if any of the cells packed into the Tree_Column are 
  171.    --  visible. For this to be meaningful, you must first initialize the cells 
  172.    --  with Gtk.Tree_View_Column.Cell_Set_Cell_Data 
  173.  
  174.    procedure Cell_Set_Cell_Data 
  175.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  176.        Tree_Model  : Gtk.Tree_Model.Gtk_Tree_Model; 
  177.        Iter        : Gtk.Tree_Model.Gtk_Tree_Iter; 
  178.        Is_Expander : Boolean; 
  179.        Is_Expanded : Boolean); 
  180.    --  Sets the cell renderer based on the Tree_Model and Iter. That is, for 
  181.    --  every attribute mapping in Tree_Column, it will get a value from the set 
  182.    --  column on the Iter, and use that value to set the attribute on the cell 
  183.    --  renderer. This is used primarily by the Gtk.Tree_View.Gtk_Tree_View. 
  184.    --  "tree_model": The Gtk.Tree_Model.Gtk_Tree_Model to to get the cell 
  185.    --  renderers attributes from. 
  186.    --  "iter": The Gtk.Tree_Model.Gtk_Tree_Iter to to get the cell renderer's 
  187.    --  attributes from. 
  188.    --  "is_expander": True, if the row has children 
  189.    --  "is_expanded": True, if the row has visible children 
  190.  
  191.    procedure Clicked 
  192.       (Tree_Column : not null access Gtk_Tree_View_Column_Record); 
  193.    --  Emits the "clicked" signal on the column. This function will only work 
  194.    --  if Tree_Column is clickable. 
  195.  
  196.    procedure Focus_Cell 
  197.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  198.        Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class); 
  199.    --  Sets the current keyboard focus to be at Cell, if the column contains 2 
  200.    --  or more editable and activatable cells. 
  201.    --  Since: gtk+ 2.2 
  202.    --  "cell": A Gtk.Cell_Renderer.Gtk_Cell_Renderer 
  203.  
  204.    function Get_Alignment 
  205.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  206.        return Gfloat; 
  207.    --  Returns the current x alignment of Tree_Column. This value can range 
  208.    --  between 0.0 and 1.0. 
  209.  
  210.    procedure Set_Alignment 
  211.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  212.        Xalign      : Gfloat); 
  213.    --  Sets the alignment of the title or custom widget inside the column 
  214.    --  header. The alignment determines its location inside the button -- 0.0 
  215.    --  for left, 0.5 for center, 1.0 for right. 
  216.    --  "xalign": The alignment, which is between [0.0 and 1.0] inclusive. 
  217.  
  218.    function Get_Button 
  219.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  220.        return Gtk.Widget.Gtk_Widget; 
  221.    --  Returns the button used in the treeview column header 
  222.    --  Since: gtk+ 3.0 
  223.  
  224.    function Get_Clickable 
  225.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  226.        return Boolean; 
  227.    --  Returns True if the user can click on the header for the column. 
  228.  
  229.    procedure Set_Clickable 
  230.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  231.        Clickable   : Boolean); 
  232.    --  Sets the header to be active if Clickable is True. When the header is 
  233.    --  active, then it can take keyboard focus, and can be clicked. 
  234.    --  "clickable": True if the header is active. 
  235.  
  236.    function Get_Expand 
  237.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  238.        return Boolean; 
  239.    --  Returns True if the column expands to fill available space. 
  240.    --  Since: gtk+ 2.4 
  241.  
  242.    procedure Set_Expand 
  243.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  244.        Expand      : Boolean); 
  245.    --  Sets the column to take available extra space. This space is shared 
  246.    --  equally amongst all columns that have the expand set to True. If no 
  247.    --  column has this option set, then the last column gets all extra space. 
  248.    --  By default, every column is created with this False. 
  249.    --  Along with "fixed-width", the "expand" property changes when the column 
  250.    --  is resized by the user. 
  251.    --  Since: gtk+ 2.4 
  252.    --  "expand": True if the column should expand to fill available space. 
  253.  
  254.    function Get_Fixed_Width 
  255.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  256.        return Gint; 
  257.    --  Gets the fixed width of the column. This may not be the actual 
  258.    --  displayed width of the column; for that, use 
  259.    --  Gtk.Tree_View_Column.Get_Width. 
  260.  
  261.    procedure Set_Fixed_Width 
  262.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  263.        Fixed_Width : Gint); 
  264.    --  If Fixed_Width is not -1, sets the fixed width of Tree_Column; 
  265.    --  otherwise unsets it. The effective value of Fixed_Width is clamped 
  266.    --  between the minumum and maximum width of the column; however, the value 
  267.    --  stored in the "fixed-width" property is not clamped. If the column 
  268.    --  sizing is GTK_TREE_VIEW_COLUMN_GROW_ONLY or 
  269.    --  GTK_TREE_VIEW_COLUMN_AUTOSIZE, setting a fixed width overrides the 
  270.    --  automatically calculated width. Note that Fixed_Width is only a hint to 
  271.    --  GTK+; the width actually allocated to the column may be greater or less 
  272.    --  than requested. 
  273.    --  Along with "expand", the "fixed-width" property changes when the column 
  274.    --  is resized by the user. 
  275.    --  "fixed_width": The new fixed width, in pixels, or -1. 
  276.  
  277.    function Get_Max_Width 
  278.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  279.        return Gint; 
  280.    --  Returns the maximum width in pixels of the Tree_Column, or -1 if no 
  281.    --  maximum width is set. 
  282.  
  283.    procedure Set_Max_Width 
  284.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  285.        Max_Width   : Gint); 
  286.    --  Sets the maximum width of the Tree_Column. If Max_Width is -1, then the 
  287.    --  maximum width is unset. Note, the column can actually be wider than max 
  288.    --  width if it's the last column in a view. In this case, the column 
  289.    --  expands to fill any extra space. 
  290.    --  "max_width": The maximum width of the column in pixels, or -1. 
  291.  
  292.    function Get_Min_Width 
  293.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  294.        return Gint; 
  295.    --  Returns the minimum width in pixels of the Tree_Column, or -1 if no 
  296.    --  minimum width is set. 
  297.  
  298.    procedure Set_Min_Width 
  299.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  300.        Min_Width   : Gint); 
  301.    --  Sets the minimum width of the Tree_Column. If Min_Width is -1, then the 
  302.    --  minimum width is unset. 
  303.    --  "min_width": The minimum width of the column in pixels, or -1. 
  304.  
  305.    function Get_Reorderable 
  306.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  307.        return Boolean; 
  308.    --  Returns True if the Tree_Column can be reordered by the user. 
  309.  
  310.    procedure Set_Reorderable 
  311.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  312.        Reorderable : Boolean); 
  313.    --  If Reorderable is True, then the column can be reordered by the end 
  314.    --  user dragging the header. 
  315.    --  "reorderable": True, if the column can be reordered. 
  316.  
  317.    function Get_Resizable 
  318.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  319.        return Boolean; 
  320.    --  Returns True if the Tree_Column can be resized by the end user. 
  321.  
  322.    procedure Set_Resizable 
  323.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  324.        Resizable   : Boolean); 
  325.    --  If Resizable is True, then the user can explicitly resize the column by 
  326.    --  grabbing the outer edge of the column button. If resizable is True and 
  327.    --  sizing mode of the column is GTK_TREE_VIEW_COLUMN_AUTOSIZE, then the 
  328.    --  sizing mode is changed to GTK_TREE_VIEW_COLUMN_GROW_ONLY. 
  329.    --  "resizable": True, if the column can be resized 
  330.  
  331.    function Get_Sizing 
  332.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  333.        return Gtk_Tree_View_Column_Sizing; 
  334.    --  Returns the current type of Tree_Column. 
  335.  
  336.    procedure Set_Sizing 
  337.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  338.        The_Type    : Gtk_Tree_View_Column_Sizing); 
  339.    --  Sets the growth behavior of Tree_Column to Type. 
  340.    --  "type": The Gtk.Tree_View_Column.Gtk_Tree_View_Column_Sizing. 
  341.  
  342.    function Get_Sort_Column_Id 
  343.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  344.        return Gint; 
  345.    --  Gets the logical Sort_Column_Id that the model sorts on when this 
  346.    --  column is selected for sorting. See 
  347.    --  Gtk.Tree_View_Column.Set_Sort_Column_Id. 
  348.  
  349.    procedure Set_Sort_Column_Id 
  350.       (Tree_Column    : not null access Gtk_Tree_View_Column_Record; 
  351.        Sort_Column_Id : Gint); 
  352.    --  Sets the logical Sort_Column_Id that this column sorts on when this 
  353.    --  column is selected for sorting. Doing so makes the column header 
  354.    --  clickable. 
  355.    --  "sort_column_id": The Sort_Column_Id of the model to sort on. 
  356.  
  357.    function Get_Sort_Indicator 
  358.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  359.        return Boolean; 
  360.    --  Gets the value set by Gtk.Tree_View_Column.Set_Sort_Indicator. 
  361.  
  362.    procedure Set_Sort_Indicator 
  363.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  364.        Setting     : Boolean); 
  365.    --  Call this function with a Setting of True to display an arrow in the 
  366.    --  header button indicating the column is sorted. Call 
  367.    --  Gtk.Tree_View_Column.Set_Sort_Order to change the direction of the 
  368.    --  arrow. 
  369.    --  "setting": True to display an indicator that the column is sorted 
  370.  
  371.    function Get_Sort_Order 
  372.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  373.        return Gtk.Enums.Gtk_Sort_Type; 
  374.    --  Gets the value set by Gtk.Tree_View_Column.Set_Sort_Order. 
  375.  
  376.    procedure Set_Sort_Order 
  377.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  378.        Order       : Gtk.Enums.Gtk_Sort_Type); 
  379.    --  Changes the appearance of the sort indicator. 
  380.    --  This *does not* actually sort the model. Use 
  381.    --  Gtk.Tree_View_Column.Set_Sort_Column_Id if you want automatic sorting 
  382.    --  support. This function is primarily for custom sorting behavior, and 
  383.    --  should be used in conjunction with Gtk.Tree_Sortable.Set_Sort_Column_Id 
  384.    --  to do that. For custom models, the mechanism will vary. 
  385.    --  The sort indicator changes direction to indicate normal sort or reverse 
  386.    --  sort. Note that you must have the sort indicator enabled to see anything 
  387.    --  when calling this function; see Gtk.Tree_View_Column.Set_Sort_Indicator. 
  388.    --  "order": sort order that the sort indicator should indicate 
  389.  
  390.    function Get_Spacing 
  391.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  392.        return Gint; 
  393.    --  Returns the spacing of Tree_Column. 
  394.  
  395.    procedure Set_Spacing 
  396.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  397.        Spacing     : Gint); 
  398.    --  Sets the spacing field of Tree_Column, which is the number of pixels to 
  399.    --  place between cell renderers packed into it. 
  400.    --  "spacing": distance between cell renderers in pixels. 
  401.  
  402.    function Get_Title 
  403.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  404.        return UTF8_String; 
  405.    --  Returns the title of the widget. 
  406.  
  407.    procedure Set_Title 
  408.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  409.        Title       : UTF8_String); 
  410.    --  Sets the title of the Tree_Column. If a custom widget has been set, 
  411.    --  then this value is ignored. 
  412.    --  "title": The title of the Tree_Column. 
  413.  
  414.    function Get_Tree_View 
  415.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  416.        return Gtk.Widget.Gtk_Widget; 
  417.    --  Returns the Gtk.Tree_View.Gtk_Tree_View wherein Tree_Column has been 
  418.    --  inserted. If Column is currently not inserted in any tree view, null is 
  419.    --  returned. 
  420.    --  Since: gtk+ 2.12 
  421.  
  422.    function Get_Visible 
  423.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  424.        return Boolean; 
  425.    --  Returns True if Tree_Column is visible. 
  426.  
  427.    procedure Set_Visible 
  428.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  429.        Visible     : Boolean); 
  430.    --  Sets the visibility of Tree_Column. 
  431.    --  "visible": True if the Tree_Column is visible. 
  432.  
  433.    function Get_Widget 
  434.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  435.        return Gtk.Widget.Gtk_Widget; 
  436.    --  Returns the Gtk.Widget.Gtk_Widget in the button on the column header. 
  437.    --  If a custom widget has not been set then null is returned. 
  438.  
  439.    procedure Set_Widget 
  440.       (Tree_Column : not null access Gtk_Tree_View_Column_Record; 
  441.        Widget      : access Gtk.Widget.Gtk_Widget_Record'Class); 
  442.    --  Sets the widget in the header to be Widget. If widget is null, then the 
  443.    --  header button is set with a Gtk.Label.Gtk_Label set to the title of 
  444.    --  Tree_Column. 
  445.    --  "widget": A child Gtk.Widget.Gtk_Widget, or null. 
  446.  
  447.    function Get_Width 
  448.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  449.        return Gint; 
  450.    --  Returns the current size of Tree_Column in pixels. 
  451.  
  452.    function Get_X_Offset 
  453.       (Tree_Column : not null access Gtk_Tree_View_Column_Record) 
  454.        return Gint; 
  455.    --  Returns the current X offset of Tree_Column in pixels. 
  456.    --  Since: gtk+ 3.2 
  457.  
  458.    procedure Queue_Resize 
  459.       (Tree_Column : not null access Gtk_Tree_View_Column_Record); 
  460.    --  Flags the column, and the cell renderers added to this column, to have 
  461.    --  their sizes renegotiated. 
  462.    --  Since: gtk+ 2.8 
  463.  
  464.    procedure Set_Cell_Data_Func 
  465.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record; 
  466.        Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  467.        Func        : Gtk_Cell_Layout_Data_Func); 
  468.    --  Sets the Gtk_Cell_Layout_Data_Func to use for Cell_Layout. 
  469.    --  This function is used instead of the standard attributes mapping for 
  470.    --  setting the column value, and should set the value of Cell_Layout's cell 
  471.    --  renderer(s) as appropriate. 
  472.    --  Func may be null to remove a previously set function. 
  473.    --  Since: gtk+ 2.4 
  474.    --  "cell": a Gtk.Cell_Renderer.Gtk_Cell_Renderer 
  475.    --  "func": the Gtk_Cell_Layout_Data_Func to use, or null 
  476.  
  477.    generic 
  478.       type User_Data_Type (<>) is private; 
  479.       with procedure Destroy (Data : in out User_Data_Type) is null; 
  480.    package Set_Cell_Data_Func_User_Data is 
  481.  
  482.       type Gtk_Cell_Layout_Data_Func is access procedure 
  483.         (Cell_Layout : Gtk.Cell_Layout.Gtk_Cell_Layout; 
  484.          Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  485.          Tree_Model  : Gtk.Tree_Model.Gtk_Tree_Model; 
  486.          Iter        : Gtk.Tree_Model.Gtk_Tree_Iter; 
  487.          Data        : User_Data_Type); 
  488.       --  A function which should set the value of Cell_Layout's cell renderer(s) 
  489.       --  as appropriate. 
  490.       --  "cell_layout": a Gtk.Cell_Layout.Gtk_Cell_Layout 
  491.       --  "cell": the cell renderer whose value is to be set 
  492.       --  "tree_model": the model 
  493.       --  "iter": a Gtk.Tree_Model.Gtk_Tree_Iter indicating the row to set the 
  494.       --  value for 
  495.       --  "data": user data passed to Gtk.Cell_Layout.Set_Cell_Data_Func 
  496.  
  497.       procedure Set_Cell_Data_Func 
  498.          (Cell_Layout : not null access Gtk.Tree_View_Column.Gtk_Tree_View_Column_Record'Class; 
  499.           Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  500.           Func        : Gtk_Cell_Layout_Data_Func; 
  501.           Func_Data   : User_Data_Type); 
  502.       --  Sets the Gtk_Cell_Layout_Data_Func to use for Cell_Layout. 
  503.       --  This function is used instead of the standard attributes mapping for 
  504.       --  setting the column value, and should set the value of Cell_Layout's 
  505.       --  cell renderer(s) as appropriate. 
  506.       --  Func may be null to remove a previously set function. 
  507.       --  Since: gtk+ 2.4 
  508.       --  "cell": a Gtk.Cell_Renderer.Gtk_Cell_Renderer 
  509.       --  "func": the Gtk_Cell_Layout_Data_Func to use, or null 
  510.       --  "func_data": user data for Func 
  511.  
  512.    end Set_Cell_Data_Func_User_Data; 
  513.  
  514.    --------------------------------------------- 
  515.    -- Inherited subprograms (from interfaces) -- 
  516.    --------------------------------------------- 
  517.    --  Methods inherited from the Buildable interface are not duplicated here 
  518.    --  since they are meant to be used by tools, mostly. If you need to call 
  519.    --  them, use an explicit cast through the "-" operator below. 
  520.  
  521.    procedure Add_Attribute 
  522.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record; 
  523.        Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  524.        Attribute   : UTF8_String; 
  525.        Column      : Gint); 
  526.  
  527.    procedure Clear 
  528.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record); 
  529.  
  530.    procedure Clear_Attributes 
  531.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record; 
  532.        Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class); 
  533.  
  534.    function Get_Cells 
  535.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record) 
  536.        return Glib.Object.Object_Simple_List.Glist; 
  537.  
  538.    procedure Pack_End 
  539.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record; 
  540.        Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  541.        Expand      : Boolean); 
  542.  
  543.    procedure Pack_Start 
  544.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record; 
  545.        Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  546.        Expand      : Boolean); 
  547.  
  548.    procedure Reorder 
  549.       (Cell_Layout : not null access Gtk_Tree_View_Column_Record; 
  550.        Cell        : not null access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class; 
  551.        Position    : Gint); 
  552.  
  553.    ---------------- 
  554.    -- Properties -- 
  555.    ---------------- 
  556.    --  The following properties are defined for this widget. See 
  557.    --  Glib.Properties for more information on properties) 
  558.  
  559.    Alignment_Property : constant Glib.Properties.Property_Float; 
  560.  
  561.    Cell_Area_Property : constant Glib.Properties.Property_Object; 
  562.    --  Type: Gtk.Cell_Area.Gtk_Cell_Area 
  563.    --  The Gtk.Cell_Area.Gtk_Cell_Area used to layout cell renderers for this 
  564.    --  column. 
  565.    -- 
  566.    --  If no area is specified when creating the tree view column with 
  567.    --  Gtk.Tree_View_Column.Gtk_New_With_Area a horizontally oriented 
  568.    --  Gtk.Cell_Area_Box.Gtk_Cell_Area_Box will be used. 
  569.  
  570.    Clickable_Property : constant Glib.Properties.Property_Boolean; 
  571.  
  572.    Expand_Property : constant Glib.Properties.Property_Boolean; 
  573.  
  574.    Fixed_Width_Property : constant Glib.Properties.Property_Int; 
  575.  
  576.    Max_Width_Property : constant Glib.Properties.Property_Int; 
  577.  
  578.    Min_Width_Property : constant Glib.Properties.Property_Int; 
  579.  
  580.    Reorderable_Property : constant Glib.Properties.Property_Boolean; 
  581.  
  582.    Resizable_Property : constant Glib.Properties.Property_Boolean; 
  583.  
  584.    Sizing_Property : constant Gtk.Tree_View_Column.Property_Gtk_Tree_View_Column_Sizing; 
  585.    --  Type: Gtk_Tree_View_Column_Sizing 
  586.  
  587.    Sort_Column_Id_Property : constant Glib.Properties.Property_Int; 
  588.    --  Logical sort column ID this column sorts on when selected for sorting. 
  589.    --  Setting the sort column ID makes the column header clickable. Set to -1 
  590.    --  to make the column unsortable. 
  591.  
  592.    Sort_Indicator_Property : constant Glib.Properties.Property_Boolean; 
  593.  
  594.    Sort_Order_Property : constant Gtk.Enums.Property_Gtk_Sort_Type; 
  595.  
  596.    Spacing_Property : constant Glib.Properties.Property_Int; 
  597.  
  598.    Title_Property : constant Glib.Properties.Property_String; 
  599.  
  600.    Visible_Property : constant Glib.Properties.Property_Boolean; 
  601.  
  602.    Widget_Property : constant Glib.Properties.Property_Object; 
  603.    --  Type: Gtk.Widget.Gtk_Widget 
  604.  
  605.    Width_Property : constant Glib.Properties.Property_Int; 
  606.  
  607.    X_Offset_Property : constant Glib.Properties.Property_Int; 
  608.  
  609.    ------------- 
  610.    -- Signals -- 
  611.    ------------- 
  612.  
  613.    type Cb_Gtk_Tree_View_Column_Void is not null access procedure 
  614.      (Self : access Gtk_Tree_View_Column_Record'Class); 
  615.  
  616.    type Cb_GObject_Void is not null access procedure 
  617.      (Self : access Glib.Object.GObject_Record'Class); 
  618.  
  619.    Signal_Clicked : constant Glib.Signal_Name := "clicked"; 
  620.    procedure On_Clicked 
  621.       (Self  : not null access Gtk_Tree_View_Column_Record; 
  622.        Call  : Cb_Gtk_Tree_View_Column_Void; 
  623.        After : Boolean := False); 
  624.    procedure On_Clicked 
  625.       (Self  : not null access Gtk_Tree_View_Column_Record; 
  626.        Call  : Cb_GObject_Void; 
  627.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  628.        After : Boolean := False); 
  629.  
  630.    ---------------- 
  631.    -- Interfaces -- 
  632.    ---------------- 
  633.    --  This class implements several interfaces. See Glib.Types 
  634.    -- 
  635.    --  - "Buildable" 
  636.    -- 
  637.    --  - "CellLayout" 
  638.  
  639.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  640.      (Gtk.Buildable.Gtk_Buildable, Gtk_Tree_View_Column_Record, Gtk_Tree_View_Column); 
  641.    function "+" 
  642.      (Widget : access Gtk_Tree_View_Column_Record'Class) 
  643.    return Gtk.Buildable.Gtk_Buildable 
  644.    renames Implements_Gtk_Buildable.To_Interface; 
  645.    function "-" 
  646.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  647.    return Gtk_Tree_View_Column 
  648.    renames Implements_Gtk_Buildable.To_Object; 
  649.  
  650.    package Implements_Gtk_Cell_Layout is new Glib.Types.Implements 
  651.      (Gtk.Cell_Layout.Gtk_Cell_Layout, Gtk_Tree_View_Column_Record, Gtk_Tree_View_Column); 
  652.    function "+" 
  653.      (Widget : access Gtk_Tree_View_Column_Record'Class) 
  654.    return Gtk.Cell_Layout.Gtk_Cell_Layout 
  655.    renames Implements_Gtk_Cell_Layout.To_Interface; 
  656.    function "-" 
  657.      (Interf : Gtk.Cell_Layout.Gtk_Cell_Layout) 
  658.    return Gtk_Tree_View_Column 
  659.    renames Implements_Gtk_Cell_Layout.To_Object; 
  660.  
  661. private 
  662.    X_Offset_Property : constant Glib.Properties.Property_Int := 
  663.      Glib.Properties.Build ("x-offset"); 
  664.    Width_Property : constant Glib.Properties.Property_Int := 
  665.      Glib.Properties.Build ("width"); 
  666.    Widget_Property : constant Glib.Properties.Property_Object := 
  667.      Glib.Properties.Build ("widget"); 
  668.    Visible_Property : constant Glib.Properties.Property_Boolean := 
  669.      Glib.Properties.Build ("visible"); 
  670.    Title_Property : constant Glib.Properties.Property_String := 
  671.      Glib.Properties.Build ("title"); 
  672.    Spacing_Property : constant Glib.Properties.Property_Int := 
  673.      Glib.Properties.Build ("spacing"); 
  674.    Sort_Order_Property : constant Gtk.Enums.Property_Gtk_Sort_Type := 
  675.      Gtk.Enums.Build ("sort-order"); 
  676.    Sort_Indicator_Property : constant Glib.Properties.Property_Boolean := 
  677.      Glib.Properties.Build ("sort-indicator"); 
  678.    Sort_Column_Id_Property : constant Glib.Properties.Property_Int := 
  679.      Glib.Properties.Build ("sort-column-id"); 
  680.    Sizing_Property : constant Gtk.Tree_View_Column.Property_Gtk_Tree_View_Column_Sizing := 
  681.      Gtk.Tree_View_Column.Build ("sizing"); 
  682.    Resizable_Property : constant Glib.Properties.Property_Boolean := 
  683.      Glib.Properties.Build ("resizable"); 
  684.    Reorderable_Property : constant Glib.Properties.Property_Boolean := 
  685.      Glib.Properties.Build ("reorderable"); 
  686.    Min_Width_Property : constant Glib.Properties.Property_Int := 
  687.      Glib.Properties.Build ("min-width"); 
  688.    Max_Width_Property : constant Glib.Properties.Property_Int := 
  689.      Glib.Properties.Build ("max-width"); 
  690.    Fixed_Width_Property : constant Glib.Properties.Property_Int := 
  691.      Glib.Properties.Build ("fixed-width"); 
  692.    Expand_Property : constant Glib.Properties.Property_Boolean := 
  693.      Glib.Properties.Build ("expand"); 
  694.    Clickable_Property : constant Glib.Properties.Property_Boolean := 
  695.      Glib.Properties.Build ("clickable"); 
  696.    Cell_Area_Property : constant Glib.Properties.Property_Object := 
  697.      Glib.Properties.Build ("cell-area"); 
  698.    Alignment_Property : constant Glib.Properties.Property_Float := 
  699.      Glib.Properties.Build ("alignment"); 
  700. end Gtk.Tree_View_Column;