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