1. ----------------------------------------------------------------------- 
  2. --              GtkAda - Ada95 binding for Gtk+/Gnome                -- 
  3. --                                                                   -- 
  4. --                Copyright (C) 2001-2013, 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. --  A table is a collection of tags where you can Add, Remove, Lookup 
  31. --  or traverse (Foreach) a tag. 
  32. --  </description> 
  33. --  <c_version>2.8.17</c_version> 
  34. --  <group>Multiline Text Editor</group> 
  35.  
  36. with Gtk.Text_Tag; 
  37.  
  38. package Gtk.Text_Tag_Table is 
  39.  
  40.    type Gtk_Text_Tag_Table_Record is new GObject_Record with private; 
  41.    type Gtk_Text_Tag_Table is access all Gtk_Text_Tag_Table_Record'Class; 
  42.  
  43.    procedure Gtk_New (Table : out Gtk_Text_Tag_Table); 
  44.    --  Create a new Text_Tag_Table. 
  45.  
  46.    procedure Initialize (Table : access Gtk_Text_Tag_Table_Record'Class); 
  47.    --  Internal initialization function. 
  48.    --  See the section "Creating your own widgets" in the documentation. 
  49.  
  50.    function Get_Type return Glib.GType; 
  51.    --  Return the internal value associated with a Gtk_Text_Tag_Table. 
  52.  
  53.    procedure Add 
  54.      (Table : access Gtk_Text_Tag_Table_Record; 
  55.       Tag   : access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class); 
  56.    --  Add a tag to the table. 
  57.    --  The tag is assigned the highest priority in the table. 
  58.    --  You must Unref the Tag on exit 
  59.  
  60.    procedure Remove 
  61.      (Table : access Gtk_Text_Tag_Table_Record; 
  62.       Tag   : access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class); 
  63.    --  Remove a tag from the table. 
  64.    --  This will remove the table's reference to the tag, so be careful - the 
  65.    --  tag will end up destroyed if you don't have a reference to it. 
  66.  
  67.    function Lookup 
  68.      (Table : access Gtk_Text_Tag_Table_Record; 
  69.       Name  : String) return Gtk.Text_Tag.Gtk_Text_Tag; 
  70.    --  Look up a named tag. 
  71.    --  Return the tag or null if none by that name is in the table. 
  72.  
  73.    function Get_Size (Table : access Gtk_Text_Tag_Table_Record) return Gint; 
  74.    --  Return the size of the table (number of tags). 
  75.  
  76.    generic 
  77.       type Data_Type (<>) is private; 
  78.    package Iterator is 
  79.  
  80.       type Data_Type_Access is access all Data_Type; 
  81.  
  82.       type Gtk_Text_Tag_Table_Proc is access 
  83.         procedure (Tag  : access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class; 
  84.                    Data : Data_Type_Access); 
  85.  
  86.       procedure Foreach 
  87.         (Table : access Gtk_Text_Tag_Table_Record; 
  88.          Proc  : Gtk_Text_Tag_Table_Proc; 
  89.          Data  : Data_Type_Access); 
  90.       --  Call Proc on each tag in Table, with user data Data. 
  91.  
  92.    private 
  93.       --  <doc_ignore> 
  94.       type Foreach_Proc_Record is record 
  95.          Proc : Gtk_Text_Tag_Table_Proc; 
  96.          Data : Data_Type_Access; 
  97.       end record; 
  98.  
  99.       type Foreach_Proc_Record_Access is 
  100.         access all Foreach_Proc_Record; 
  101.  
  102.       procedure C_Gtk_Text_Tag_Table_Foreach_Proc 
  103.         (C_Tag  : System.Address; 
  104.          C_Data : Foreach_Proc_Record_Access); 
  105.       pragma Convention (C, C_Gtk_Text_Tag_Table_Foreach_Proc); 
  106.       --  </doc_ignore> 
  107.    end Iterator; 
  108.  
  109.    ------------- 
  110.    -- Signals -- 
  111.    ------------- 
  112.  
  113.    --  <signals> 
  114.    --  The following new signals are defined for this widget: 
  115.    -- 
  116.    --  - "tag_changed" 
  117.    --    procedure Handler 
  118.    --      (Widget       : access Gtk_Text_Tag_Table_Record'Class; 
  119.    --       Tag          : access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class; 
  120.    --       Size_Changed : Boolean); 
  121.    -- 
  122.    --  - "tag_added" 
  123.    --    procedure Handler 
  124.    --      (Widget : access Gtk_Text_Tag_Table_Record'Class; 
  125.    --       Tag    : access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class); 
  126.    -- 
  127.    --  - "tag_removed" 
  128.    --    procedure Handler 
  129.    --      (Widget : access Gtk_Text_Tag_Table_Record'Class; 
  130.    --       Tag    : access Gtk.Text_Tag.Gtk_Text_Tag_Record'Class); 
  131.    -- 
  132.    --  </signals> 
  133.  
  134.    Signal_Tag_Added   : constant Glib.Signal_Name := "tag_added"; 
  135.    Signal_Tag_Changed : constant Glib.Signal_Name := "tag_changed"; 
  136.    Signal_Tag_Removed : constant Glib.Signal_Name := "tag_removed"; 
  137.  
  138. private 
  139.    type Gtk_Text_Tag_Table_Record is new GObject_Record with null record; 
  140.  
  141.    pragma Import (C, Get_Type, "gtk_text_tag_table_get_type"); 
  142. end Gtk.Text_Tag_Table;