1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2006-2010 AdaCore                    -- 
  5. --                                                                   -- 
  6. -- This library is free software; you can redistribute it and/or     -- 
  7. -- modify it under the terms of the GNU General Public               -- 
  8. -- License as published by the Free Software Foundation; either      -- 
  9. -- version 2 of the License, or (at your option) any later version.  -- 
  10. --                                                                   -- 
  11. -- This library is distributed in the hope that it will be useful,   -- 
  12. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  13. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  14. -- General Public License for more details.                          -- 
  15. --                                                                   -- 
  16. -- You should have received a copy of the GNU General Public         -- 
  17. -- License along with this library; if not, write to the             -- 
  18. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  19. -- Boston, MA 02111-1307, USA.                                       -- 
  20. --                                                                   -- 
  21. -- -- -- -- -- -- -- -- -- -- -- --
  22. ----------------------------------------------------------------------- 
  23.  
  24. --  <description> 
  25. --  Gtk_Icon_View provides an alternative view on a list model. It displays the 
  26. --  model as a grid of icons with labels. Like Gtk_Tree_View, it allows to 
  27. --  select one or multiple items (depending on the selection mode, see 
  28. --  Set_Selection_Mode). In addition to selection with the arrow keys, 
  29. --  Gtk_Icon_View supports rubberband selection, which is controlled by 
  30. --  dragging the pointer. 
  31. --  </description> 
  32. --  <c_version>2.16.6</c_version> 
  33. --  <group>Trees and Lists</group> 
  34. --  <screenshot>icon-view</screenshot> 
  35. --  <testgtk>create_icon_view.adb</testgtk> 
  36.  
  37. with Glib.Types; 
  38. with Gdk.Color; 
  39. with Gdk.Dnd; 
  40. with Gdk.Types; 
  41. with Glib.Properties; 
  42. with Gtk.Cell_Layout; 
  43. with Gtk.Cell_Renderer; 
  44. with Gtk.Container; 
  45. with Gtk.Enums; 
  46. with Gtk.Selection; 
  47. with Gtk.Tooltip; 
  48. with Gtk.Tree_Model; 
  49.  
  50. package Gtk.Icon_View is 
  51.  
  52.    type Gtk_Icon_View_Record is new Gtk.Container.Gtk_Container_Record with 
  53.      null record; 
  54.    type Gtk_Icon_View is access all Gtk_Icon_View_Record'Class; 
  55.  
  56.    type Gtk_Icon_View_Drop_Position is 
  57.      (No_Drop, 
  58.       Drop_Into, 
  59.       Drop_Left, 
  60.       Drop_Right, 
  61.       Drop_Above, 
  62.       Drop_Below); 
  63.    --  An enum for determining where a dropped item goes. 
  64.    --  If Drop_Into, then the drop item replaces the item. 
  65.  
  66.    procedure Gtk_New    (Icon_View : out Gtk_Icon_View); 
  67.    procedure Initialize (Icon_View : access Gtk_Icon_View_Record'Class); 
  68.    --  Creates a new Gtk_Icon_View widget 
  69.  
  70.    procedure Gtk_New_With_Model 
  71.      (Icon_View : out Gtk_Icon_View; 
  72.       Model     : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class); 
  73.    procedure Initialize_With_Model 
  74.      (Icon_View : access Gtk_Icon_View_Record'Class; 
  75.       Model     : access Gtk.Tree_Model.Gtk_Tree_Model_Record'Class); 
  76.    --  Creates a new Gtk_Icon_View widget with the model Model. 
  77.  
  78.    function Get_Type return GType; 
  79.    --  Return the internal type used for a Gtk_Icon_View. 
  80.  
  81.    procedure Set_Column_Spacing 
  82.      (Icon_View      : access Gtk_Icon_View_Record; 
  83.       Column_Spacing : Glib.Gint); 
  84.    function Get_Column_Spacing 
  85.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  86.    --  Sets the ::column-spacing property which specifies the space 
  87.    --  which is inserted between the columns of the icon view. 
  88.  
  89.    procedure Set_Columns 
  90.      (Icon_View : access Gtk_Icon_View_Record; 
  91.       Columns   : Glib.Gint); 
  92.    function Get_Columns 
  93.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  94.    --  Sets the ::columns property which determines in how many columns the 
  95.    --  icons are arranged. If Columns is -1, the number of columns will be 
  96.    --  chosen automatically to fill the available area. 
  97.  
  98.    procedure Set_Cursor 
  99.      (Icon_View     : access Gtk_Icon_View_Record; 
  100.       Path          : Gtk.Tree_Model.Gtk_Tree_Path; 
  101.       Cell          : Gtk.Cell_Renderer.Gtk_Cell_Renderer := null; 
  102.       Start_Editing : Boolean := False); 
  103.    --  Sets the current keyboard focus to be at Path, and selects it. This is 
  104.    --  useful when you want to focus the user's attention on a particular item. 
  105.    --   If Cell is not null, then focus is given to the cell specified by it. 
  106.    --  Additionally, if Start_Editing is True, then editing should be started 
  107.    --  in the specified cell. 
  108.    -- 
  109.    --  This function is often followed by Grab_Focus in order to give keyboard 
  110.    --  focus to the widget.  Please note that editing can only happen when the 
  111.    --  widget is realized. 
  112.  
  113.    procedure Get_Cursor 
  114.      (Icon_View     : access Gtk_Icon_View_Record; 
  115.       Path          : out Gtk.Tree_Model.Gtk_Tree_Path; 
  116.       Cell          : out Gtk.Cell_Renderer.Gtk_Cell_Renderer; 
  117.       Cursor_Is_Set : out Boolean); 
  118.    --  Fills in Path and Cell with the current cursor path and cell. 
  119.    --  If the cursor isn't currently set, then Ppath will be null. 
  120.    --  If no cell currently has focus, then Cell will be null. 
  121.    --  The returned Path must be freed with Gtk.Tree_Model.Path_Free. 
  122.    --  Cursor_Is_Set is set to True if the cursor is set. 
  123.  
  124.    procedure Set_Item_Width 
  125.      (Icon_View  : access Gtk_Icon_View_Record; 
  126.       Item_Width : Glib.Gint); 
  127.    function Get_Item_Width 
  128.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  129.    --  Sets the ::item-width property which specifies the width to use for each 
  130.    --  item. If it is set to -1, the icon view will automatically determine a 
  131.    --  suitable item size. 
  132.  
  133.    procedure Set_Margin 
  134.      (Icon_View : access Gtk_Icon_View_Record; 
  135.       Margin    : Glib.Gint); 
  136.    function Get_Margin 
  137.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  138.    --  Sets the ::margin property which specifies the space which is inserted 
  139.    --  at the top, bottom, left and right of the icon view. 
  140.  
  141.    procedure Set_Orientation 
  142.      (Icon_View   : access Gtk_Icon_View_Record; 
  143.       Orientation : Gtk.Enums.Gtk_Orientation); 
  144.    function Get_Orientation 
  145.      (Icon_View : access Gtk_Icon_View_Record) 
  146.       return Gtk.Enums.Gtk_Orientation; 
  147.    --  Sets the ::orientation property which determines whether the labels 
  148.    --  are drawn beside the icons instead of below. 
  149.  
  150.    procedure Set_Reorderable 
  151.      (Icon_View   : access Gtk_Icon_View_Record; 
  152.       Reorderable : Boolean); 
  153.    function Get_Reorderable 
  154.      (Icon_View : access Gtk_Icon_View_Record) return Boolean; 
  155.    --  This function is a convenience function to allow you to reorder models 
  156.    --  that support the Gtk_Tree_Drag_Source interface and the 
  157.    --  Gtk_Tree_Drag_Dest interface. Both Gtk_Tree_Store and Gtk_List_Store 
  158.    --  support these. If Reorderable is True, then the user can reorder the 
  159.    --  model by dragging and dropping rows. The developer can listen to these 
  160.    --  changes by connecting to the model's row_inserted and row_deleted 
  161.    --  signals. 
  162.    -- 
  163.    --  This function does not give you any degree of control over the order -- 
  164.    --  any reordering is allowed. If more control is needed, you should 
  165.    --  probably handle drag and drop manually. 
  166.  
  167.    procedure Set_Row_Spacing 
  168.      (Icon_View   : access Gtk_Icon_View_Record; 
  169.       Row_Spacing : Glib.Gint); 
  170.    function Get_Row_Spacing 
  171.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  172.    --  Sets the ::row-spacing property which specifies the space 
  173.    --  which is inserted between the rows of the icon view. 
  174.  
  175.    procedure Set_Spacing 
  176.      (Icon_View : access Gtk_Icon_View_Record; 
  177.       Spacing   : Glib.Gint); 
  178.    function Get_Spacing 
  179.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  180.    --  Sets the ::spacing property which specifies the space 
  181.    --  which is inserted between the cells (i.e. the icon and 
  182.    --  the text) of an item. 
  183.  
  184.    procedure Item_Activated 
  185.      (Icon_View : access Gtk_Icon_View_Record; 
  186.       Path      : Gtk.Tree_Model.Gtk_Tree_Path); 
  187.    --  Activates the item determined by Path. 
  188.  
  189.    --------------- 
  190.    -- Scrolling -- 
  191.    --------------- 
  192.  
  193.    procedure Get_Visible_Range 
  194.      (Icon_View : access Gtk_Icon_View_Record; 
  195.       Start_Path : out Gtk.Tree_Model.Gtk_Tree_Path; 
  196.       End_Path   : out Gtk.Tree_Model.Gtk_Tree_Path); 
  197.    --  Sets Start_Path and End_Path to be the first and last visible path. 
  198.    --  Note that there may be invisible paths in between. 
  199.    --  Both paths should be freed with Path_Free after use. 
  200.  
  201.    procedure Scroll_To_Path 
  202.      (Icon_View : access Gtk_Icon_View_Record; 
  203.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  204.       Use_Align : Boolean := True; 
  205.       Row_Align : Glib.Gfloat := 0.5; 
  206.       Col_Align : Glib.Gfloat := 0.0); 
  207.    --  Moves the alignments of Icon_View to the position specified by Path. 
  208.    --  Row_Align determines where the row is placed, and Col_Align determines 
  209.    --  where column is placed. Both are expected to be between 0.0 and 1.0. 
  210.    --  0.0 means left/top alignment, 1.0 means right/bottom alignment, 0.5 
  211.    --  means center. 
  212.    -- 
  213.    --  If Use_Align is False, then the alignment arguments are ignored, and the 
  214.    --  tree does the minimum amount of work to scroll the item onto the screen. 
  215.    --  This means that the item will be scrolled to the edge closest to its 
  216.    --  current position. If the item is currently visible on the screen, 
  217.    --  nothing is done. 
  218.    -- 
  219.    --  This function only works if the model is set, and Path is a valid row on 
  220.    --  the model. If the model changes before the Icon_View is realized, the 
  221.    --  centered path will be modified to reflect this change. 
  222.  
  223.    -------------- 
  224.    -- Tooltips -- 
  225.    -------------- 
  226.  
  227.    procedure Set_Tooltip_Column 
  228.      (Icon_View : access Gtk_Icon_View_Record; 
  229.       Column    : Gint); 
  230.    function Get_Tooltip_Column 
  231.      (Icon_View : access Gtk_Icon_View_Record) return Gint; 
  232.    --  If you only plan to have simple (text-only) tooltips on full items, you 
  233.    --  can use Set_Tooltip_Column to have Gtk_Icon_View handle these 
  234.    --  automatically for you. Column should be set to the column in 
  235.    --  Icon_View's model containing the tooltip texts, or -1 to disable this 
  236.    --  feature. 
  237.    -- 
  238.    --  When enabled, #GtkWidget::has-tooltip will be set to True and 
  239.    --  Icon_View will connect a #GtkWidget::query-tooltip signal handler. 
  240.    -- 
  241.    --  Get_Tooltip_Column returns the index of the tooltip column that is 
  242.    --  currently being used, or -1 if this is disabled. 
  243.  
  244.    procedure Get_Tooltip_Context 
  245.      (Icon_View    : access Gtk_Icon_View_Record; 
  246.       X            : in out Gint; 
  247.       Y            : in out Gint; 
  248.       Keyboard_Tip : Boolean; 
  249.       Model        : out Gtk.Tree_Model.Gtk_Tree_Model; 
  250.       Path         : out Gtk.Tree_Model.Gtk_Tree_Path; 
  251.       Iter         : out Gtk.Tree_Model.Gtk_Tree_Iter; 
  252.       Success      : out Boolean); 
  253.    --  Icon_View: a Gtk_Icon_View 
  254.    --  X: the x coordinate (relative to widget coordinates) 
  255.    --  Y: the y coordinate (relative to widget coordinates) 
  256.    --  Keyboard_Tip: whether or not this is a keyboard tooltip 
  257.    --  Model: a Gtk_Tree_Model 
  258.    --  Path: a Gtk_Tree_Path 
  259.    --  Iter: a Gtk_Tree_Iter 
  260.    -- 
  261.    --  This subprogram is supposed to be used in a #GtkWidget::query-tooltip 
  262.    --  signal handler for Gtk_Icon_View.  The X, Y and Keyboard_Tip values 
  263.    --  which are received in the signal handler should be passed to this 
  264.    --  subprogram without modification. 
  265.    -- 
  266.    --  The Success value indicates whether there is an icon view item at the 
  267.    --  given coordinates (True) or not (False) for mouse tooltips. For keyboard 
  268.    --  tooltips the item returned will be the cursor item. When True, then any 
  269.    --  of Model, Path and Iter which have been provided will be set to point to 
  270.    --  that row and the corresponding model. X and Y will always be converted 
  271.    --  to be relative to Icon_View's bin_window if Keyboard_Tip is False. 
  272.  
  273.    procedure Set_Tooltip_Cell 
  274.      (Icon_View : access Gtk_Icon_View_Record; 
  275.       Tooltip   : access Gtk.Tooltip.Gtk_Tooltip_Record'Class; 
  276.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  277.       Cell      : access Gtk.Cell_Renderer.Gtk_Cell_Renderer_Record'Class); 
  278.    --  Sets the tip area of Tooltip to the area which Cell occupies in 
  279.    --  the item pointed to by Path. See also Gtk.Tooltip.Set_Tip_Area. 
  280.    -- 
  281.    --  See also Set_Tooltip_Column for a simpler alternative. 
  282.  
  283.    procedure Set_Tooltip_Item 
  284.      (Icon_View : access Gtk_Icon_View_Record; 
  285.       Tooltip   : access Gtk.Tooltip.Gtk_Tooltip_Record'Class; 
  286.       Path      : Gtk.Tree_Model.Gtk_Tree_Path); 
  287.    --  Sets the tip area of Tooltip to be the area covered by the item at Path. 
  288.    -- 
  289.    --  See also Set_Tooltip_Column for a simpler alternative. 
  290.    --  See also Gtk.Tooltip.Set_Tip_Area. 
  291.  
  292.    ---------------- 
  293.    -- Tree Model -- 
  294.    ---------------- 
  295.  
  296.    procedure Set_Model 
  297.      (Icon_View : access Gtk_Icon_View_Record; 
  298.       Model     : Gtk.Tree_Model.Gtk_Tree_Model := null); 
  299.    function Get_Model 
  300.      (Icon_View : access Gtk_Icon_View_Record) 
  301.       return Gtk.Tree_Model.Gtk_Tree_Model; 
  302.    --  Sets the model for a Gtk_Icon_View.  If the Icon_View already has a 
  303.    --  model set, it will remove it before setting the new model. If Model is 
  304.    --  null, then it will unset the old model. 
  305.  
  306.    procedure Set_Text_Column 
  307.      (Icon_View : access Gtk_Icon_View_Record; 
  308.       Column    : Glib.Gint); 
  309.    function Get_Text_Column 
  310.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  311.    --  Sets the column with text for Icon_View to be Column. The text 
  312.    --  column must be of type GType_String. 
  313.  
  314.    procedure Set_Pixbuf_Column 
  315.      (Icon_View : access Gtk_Icon_View_Record; Column    : Glib.Gint); 
  316.    function Get_Pixbuf_Column 
  317.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  318.    --  Sets the column with pixbufs for Icon_View to be Column. The pixbuf 
  319.    --  column must be of type Gdk.Pixbuf.Get_Type 
  320.  
  321.    procedure Set_Markup_Column 
  322.      (Icon_View : access Gtk_Icon_View_Record; 
  323.       Column    : Glib.Gint); 
  324.    function Get_Markup_Column 
  325.      (Icon_View : access Gtk_Icon_View_Record) return Glib.Gint; 
  326.    --  Sets the column with markup information for Icon_View to be 
  327.    --  Column. The markup column must be of type GType_String. 
  328.    --  If the markup column is set to something, it overrides 
  329.    --  the text column set by Set_Text_Column. 
  330.  
  331.    function Get_Path_At_Pos 
  332.      (Icon_View : access Gtk_Icon_View_Record; 
  333.       X         : Glib.Gint; 
  334.       Y         : Glib.Gint) return Gtk.Tree_Model.Gtk_Tree_Path; 
  335.    --  Finds the path at the point (X, Y), relative to widget coordinates. See 
  336.    --  Get_Item_At_Pos, if you are also interested in the cell at the specified 
  337.    --  position. 
  338.  
  339.    procedure Get_Item_At_Pos 
  340.      (Icon_View : access Gtk_Icon_View_Record; 
  341.       X         : Gint; 
  342.       Y         : Gint; 
  343.       Path      : out Gtk.Tree_Model.Gtk_Tree_Path; 
  344.       Cell      : out Gtk.Cell_Renderer.Gtk_Cell_Renderer; 
  345.       Has_Item  : out Boolean); 
  346.    --  Finds the path at the point (X, Y), relative to widget coordinates. 
  347.    --  In contrast to Get_Path_At_Pos, this function also 
  348.    --  obtains the cell at the specified position. The returned path should 
  349.    --  be freed with Path_Free. 
  350.    --  Has_Item is set to True if an item exists at the specified position. 
  351.  
  352.    procedure Convert_Widget_To_Bin_Window_Coords 
  353.      (Icon_View : access Gtk_Icon_View_Record; 
  354.       Wx        : Gint; 
  355.       Wy        : Gint; 
  356.       Bx        : out Gint; 
  357.       By        : out Gint); 
  358.    --  Icon_View: a Gtk_Icon_View 
  359.    --  Wx: X coordinate relative to the widget 
  360.    --  Wy: Y coordinate relative to the widget 
  361.    --  Bx: bin_window X coordinate 
  362.    --  By: bin_window Y coordinate 
  363.    -- 
  364.    --  Converts widget coordinates to coordinates for the bin_window, 
  365.    --  as expected by e.g. Get_Path_At_Pos. 
  366.  
  367.    --------------- 
  368.    -- Selection -- 
  369.    --------------- 
  370.  
  371.    procedure Set_Selection_Mode 
  372.      (Icon_View : access Gtk_Icon_View_Record; 
  373.       Mode      : Gtk.Enums.Gtk_Selection_Mode); 
  374.    function Get_Selection_Mode 
  375.      (Icon_View : access Gtk_Icon_View_Record) 
  376.       return Gtk.Enums.Gtk_Selection_Mode; 
  377.    --  Sets the selection mode of the Icon_View. 
  378.  
  379.    procedure Select_All   (Icon_View : access Gtk_Icon_View_Record); 
  380.    procedure Unselect_All (Icon_View : access Gtk_Icon_View_Record); 
  381.    --  Selects all the icons. Icon_View must has its selection mode set 
  382.    --  to Selection_Multiple 
  383.  
  384.    procedure Select_Path 
  385.      (Icon_View : access Gtk_Icon_View_Record; 
  386.       Path      : Gtk.Tree_Model.Gtk_Tree_Path); 
  387.    procedure Unselect_Path 
  388.      (Icon_View : access Gtk_Icon_View_Record; 
  389.       Path      : Gtk.Tree_Model.Gtk_Tree_Path); 
  390.    --  Selects the row at Path. 
  391.  
  392.    function Get_Selected_Items 
  393.      (Icon_View : access Gtk_Icon_View_Record) 
  394.       return Gtk.Tree_Model.Gtk_Tree_Path_List.Glist; 
  395.    --  Creates a list of paths of all selected items. Additionally, if you are 
  396.    --  planning on modifying the model after calling this function, you may 
  397.    --  want to convert the returned list into a list of Gtk_Tree_Row_Reference. 
  398.    --  To free the returend value, use: 
  399.    --      Foreach (List, Gtk.Tree_Model.Path_Free, Null); 
  400.    --      Free (List); 
  401.  
  402.    function Path_Is_Selected 
  403.      (Icon_View : access Gtk_Icon_View_Record; 
  404.       Path      : Gtk.Tree_Model.Gtk_Tree_Path) return Boolean; 
  405.    --  Returns True if the icon pointed to by Path is currently 
  406.    --  selected. If Path does not point to a valid location, False is returned. 
  407.  
  408.    ------------------- 
  409.    -- Drag and drop -- 
  410.    ------------------- 
  411.  
  412.    function Create_Drag_Icon 
  413.      (Icon_View : access Gtk_Icon_View_Record; 
  414.       Path      : Gtk.Tree_Model.Gtk_Tree_Path) return Gdk.Gdk_Pixmap; 
  415.    --  Creates a Gdk_Pixmap representation of the item at Path. 
  416.    --  This image is used for a drag icon. 
  417.    --  The returned value must be Unref'd by the caller. 
  418.  
  419.    procedure Enable_Model_Drag_Dest 
  420.      (Icon_View : access Gtk_Icon_View_Record; 
  421.       Targets   : Gtk.Selection.Target_Entry_Array; 
  422.       Actions   : Gdk.Dnd.Drag_Action); 
  423.    procedure Unset_Model_Drag_Dest 
  424.      (Icon_View : access Gtk_Icon_View_Record); 
  425.    --  Turns Icon_view into a drop destination for automatic DND. 
  426.    --  Targets is the list of targets that the drag will support. 
  427.  
  428.    procedure Enable_Model_Drag_Source 
  429.      (Icon_View         : access Gtk_Icon_View_Record; 
  430.       Start_Button_Mask : Gdk.Types.Gdk_Modifier_Type; 
  431.       Targets           : Gtk.Selection.Target_Entry_Array; 
  432.       Actions           : Gdk.Dnd.Drag_Action); 
  433.    procedure Unset_Model_Drag_Source 
  434.      (Icon_View : access Gtk_Icon_View_Record); 
  435.    --  Turns Icon_view into a drag source for automatic DND. 
  436.    --  Start_Button_Mask is the allowed buttons to start drag. 
  437.  
  438.    procedure Get_Dest_Item_At_Pos 
  439.      (Icon_View : access Gtk_Icon_View_Record; 
  440.       Drag_X    : Glib.Gint; 
  441.       Drag_Y    : Glib.Gint; 
  442.       Path      : out Gtk.Tree_Model.Gtk_Tree_Path; 
  443.       Pos       : out Gtk_Icon_View_Drop_Position; 
  444.       Has_Item  : out Boolean); 
  445.    --  Determines the destination item for a given position. 
  446.    --  Return value: whether there is an item at the given position. 
  447.  
  448.    procedure Set_Drag_Dest_Item 
  449.      (Icon_View : access Gtk_Icon_View_Record; 
  450.       Path      : Gtk.Tree_Model.Gtk_Tree_Path; 
  451.       Pos       : Gtk_Icon_View_Drop_Position); 
  452.    procedure Get_Drag_Dest_Item 
  453.      (Icon_View : access Gtk_Icon_View_Record; 
  454.       Path      : out Gtk.Tree_Model.Gtk_Tree_Path; 
  455.       Pos       : out Gtk_Icon_View_Drop_Position); 
  456.    --  Sets the item that is highlighted for feedback. 
  457.  
  458.    ---------------- 
  459.    -- Interfaces -- 
  460.    ---------------- 
  461.    --  This class implements several interfaces. See Glib.Types 
  462.    -- 
  463.    --  - "Gtk_Cell_Layout" 
  464.  
  465.    package Implements_Cell_Layout is new Glib.Types.Implements 
  466.      (Gtk.Cell_Layout.Gtk_Cell_Layout, Gtk_Icon_View_Record, Gtk_Icon_View); 
  467.    function "+" 
  468.      (Widget : access Gtk_Icon_View_Record'Class) 
  469.       return Gtk.Cell_Layout.Gtk_Cell_Layout 
  470.       renames Implements_Cell_Layout.To_Interface; 
  471.    function "-" 
  472.      (Interf : Gtk.Cell_Layout.Gtk_Cell_Layout) 
  473.       return Gtk_Icon_View 
  474.       renames Implements_Cell_Layout.To_Object; 
  475.    --  Converts to and from the Gtk_Cell_Layout interface 
  476.  
  477.    ---------------- 
  478.    -- Properties -- 
  479.    ---------------- 
  480.  
  481.    --  <properties> 
  482.    --  The following properties are defined for this widget. See 
  483.    --  Glib.Properties for more information on properties. 
  484.    -- 
  485.    --  Name:  Column_Spacing_Property 
  486.    --  Type:  Int 
  487.    --  Descr: Space which is inserted between grid column 
  488.    -- 
  489.    --  Name:  Columns_Property 
  490.    --  Type:  Int 
  491.    --  Descr: Number of columns to display 
  492.    -- 
  493.    --  Name:  Item_Width_Property 
  494.    --  Type:  Int 
  495.    --  Descr: The width used for each item 
  496.    -- 
  497.    --  Name:  Margin_Property 
  498.    --  Type:  Int 
  499.    --  Descr: Space which is inserted at the edges of the icon view 
  500.    -- 
  501.    --  Name:  Markup_Column_Property 
  502.    --  Type:  Int 
  503.    --  Descr: Model column used to retrieve the text if using Pango markup 
  504.    -- 
  505.    --  Name:  Model_Property 
  506.    --  Type:  Object 
  507.    --  Descr: The model for the icon view 
  508.    -- 
  509.    --  Name:  Orientation_Property 
  510.    --  Type:  Enum 
  511.    --  Descr: How the text and icon of each item are positioned relative to 
  512.    --         each other 
  513.    -- 
  514.    --  Name:  Pixbuf_Column_Property 
  515.    --  Type:  Int 
  516.    --  Descr: Model column used to retrieve the icon pixbuf from 
  517.    -- 
  518.    --  Name:  Reorderable_Property 
  519.    --  Type:  Boolean 
  520.    --  Descr: View is reorderable 
  521.    -- 
  522.    --  Name:  Row_Spacing_Property 
  523.    --  Type:  Int 
  524.    --  Descr: Space which is inserted between grid rows 
  525.    -- 
  526.    --  Name:  Selection_Mode_Property 
  527.    --  Type:  Enum 
  528.    --  Descr: The selection mode 
  529.    -- 
  530.    --  Name:  Spacing_Property 
  531.    --  Type:  Int 
  532.    --  Descr: Space which is inserted between cells of an item 
  533.    -- 
  534.    --  Name:  Text_Column_Property 
  535.    --  Type:  Int 
  536.    --  Descr: Model column used to retrieve the text from 
  537.    -- 
  538.    --  Name:  Tooltip_Column_Property 
  539.    --  Type:  Int 
  540.    --  Descr: The column in the model containing the tooltip texts for 
  541.    --         the items 
  542.    -- 
  543.    --  </properties> 
  544.  
  545.    Column_Spacing_Property : constant Glib.Properties.Property_Int; 
  546.    Columns_Property        : constant Glib.Properties.Property_Int; 
  547.    Item_Width_Property     : constant Glib.Properties.Property_Int; 
  548.    Margin_Property         : constant Glib.Properties.Property_Int; 
  549.    Markup_Column_Property  : constant Glib.Properties.Property_Int; 
  550.    Model_Property          : constant Glib.Properties.Property_Object; 
  551.    Orientation_Property    : constant Gtk.Enums.Property_Gtk_Orientation; 
  552.    Pixbuf_Column_Property  : constant Glib.Properties.Property_Int; 
  553.    Reorderable_Property    : constant Glib.Properties.Property_Boolean; 
  554.    Row_Spacing_Property    : constant Glib.Properties.Property_Int; 
  555.    --  Selection_Mode_Property : constant Glib.Properties.Property_Enum; 
  556.    Spacing_Property        : constant Glib.Properties.Property_Int; 
  557.    Text_Column_Property    : constant Glib.Properties.Property_Int; 
  558.    Tooltip_Column_Property : constant Glib.Properties.Property_Int; 
  559.  
  560.    ---------------------- 
  561.    -- Style Properties -- 
  562.    ---------------------- 
  563.    --  The following properties can be changed through the gtk theme and 
  564.    --  configuration files, and retrieved through Gtk.Widget.Style_Get_Property 
  565.    -- 
  566.    --  <style_properties> 
  567.    --  Name:  Selection_Box_Alpha_Property 
  568.    --  Type:  Uchar 
  569.    --  Descr: Opacity of the selection box 
  570.    -- 
  571.    --  Name:  Selection_Box_Color_Property 
  572.    --  Type:  Boxed 
  573.    --  Descr: Color of the selection box 
  574.    -- 
  575.  
  576.    Selection_Box_Alpha_Property : constant Glib.Properties.Property_Uchar; 
  577.    Selection_Box_Color_Property : constant Gdk.Color.Property_Gdk_Color; 
  578.  
  579.    ------------- 
  580.    -- Signals -- 
  581.    ------------- 
  582.  
  583.    --  <signals> 
  584.    --  The following new signals are defined for this widget: 
  585.    -- 
  586.    --  - "activate_cursor_item" 
  587.    --  - "item_activated" 
  588.    --  - "move_cursor" 
  589.    --  - "select_all" 
  590.    --  - "select_cursor_item" 
  591.    --  - "selection_changed" 
  592.    --  - "set_scroll_adjustments" 
  593.    --  - "toggle_cursor_item" 
  594.    --  - "unselect_all" 
  595.    --  </signals> 
  596.  
  597.    Signal_Activate_Cursor_Item   : constant Glib.Signal_Name := 
  598.                                      "activate_cursor_item"; 
  599.    Signal_Item_Activated         : constant Glib.Signal_Name := 
  600.                                      "item_activated"; 
  601.    Signal_Move_Cursor            : constant Glib.Signal_Name := 
  602.                                      "move_cursor"; 
  603.    Signal_Select_All             : constant Glib.Signal_Name := 
  604.                                      "select_all"; 
  605.    Signal_Select_Cursor_Item     : constant Glib.Signal_Name := 
  606.                                      "select_cursor_item"; 
  607.    Signal_Selection_Changed      : constant Glib.Signal_Name := 
  608.                                      "selection_changed"; 
  609.    Signal_Set_Scroll_Adjustments : constant Glib.Signal_Name := 
  610.                                      "set_scroll_adjustments"; 
  611.    Signal_Toggle_Cursor_Item     : constant Glib.Signal_Name := 
  612.                                      "toggle_cursor_item"; 
  613.    Signal_Unselect_All           : constant Glib.Signal_Name := 
  614.                                      "unselect_all"; 
  615.  
  616. private 
  617.  
  618.    Selection_Box_Alpha_Property : constant Glib.Properties.Property_Uchar := 
  619.      Glib.Properties.Build ("selection-box-alpha"); 
  620.    Selection_Box_Color_Property : constant Gdk.Color.Property_Gdk_Color := 
  621.      Gdk.Color.Property_Gdk_Color (Glib.Build ("selection-box-color")); 
  622.  
  623.    Column_Spacing_Property : constant Glib.Properties.Property_Int := 
  624.      Glib.Properties.Build ("column-spacing"); 
  625.    Columns_Property : constant Glib.Properties.Property_Int := 
  626.      Glib.Properties.Build ("columns"); 
  627.    Item_Width_Property : constant Glib.Properties.Property_Int := 
  628.      Glib.Properties.Build ("item-width"); 
  629.    Margin_Property : constant Glib.Properties.Property_Int := 
  630.      Glib.Properties.Build ("margin"); 
  631.    Markup_Column_Property : constant Glib.Properties.Property_Int := 
  632.      Glib.Properties.Build ("markup-column"); 
  633.    Model_Property : constant Glib.Properties.Property_Object := 
  634.      Glib.Properties.Build ("model"); 
  635.    Orientation_Property    : constant Gtk.Enums.Property_Gtk_Orientation := 
  636.      Gtk.Enums.Property_Gtk_Orientation (Glib.Build ("orientation")); 
  637.    Pixbuf_Column_Property : constant Glib.Properties.Property_Int := 
  638.      Glib.Properties.Build ("pixbuf-column"); 
  639.    Reorderable_Property : constant Glib.Properties.Property_Boolean := 
  640.      Glib.Properties.Build ("reorderable"); 
  641.    Row_Spacing_Property : constant Glib.Properties.Property_Int := 
  642.      Glib.Properties.Build ("row-spacing"); 
  643. --     Selection_Mode_Property : constant Glib.Properties.Property_Enum := 
  644. --     Glib.Properties.Build ("selection-mode"); 
  645.    Spacing_Property : constant Glib.Properties.Property_Int := 
  646.      Glib.Properties.Build ("spacing"); 
  647.    Text_Column_Property : constant Glib.Properties.Property_Int := 
  648.      Glib.Properties.Build ("text-column"); 
  649.    Tooltip_Column_Property : constant Glib.Properties.Property_Int := 
  650.      Glib.Properties.Build ("tooltip-column"); 
  651.  
  652.    pragma Import (C, Get_Type, "gtk_icon_view_get_type"); 
  653.  
  654. end Gtk.Icon_View; 
  655.  
  656. --  binding might be useful later: 
  657. --  No binding: gtk_icon_view_selected_foreach