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