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. --  This widget provides a dialog for selecting a font. See also 
  26. --  Gtk.Font_Selection. 
  27. -- 
  28. --  </description> 
  29. --  <screenshot>gtk-fontsel</screenshot> 
  30. --  <group>Selectors</group> 
  31. --  <testgtk>create_font_selection.adb</testgtk> 
  32. pragma Ada_2005; 
  33.  
  34. pragma Warnings (Off, "*is already use-visible*"); 
  35. with Glib;          use Glib; 
  36. with Glib.Types;    use Glib.Types; 
  37. with Gtk.Buildable; use Gtk.Buildable; 
  38. with Gtk.Dialog;    use Gtk.Dialog; 
  39. with Gtk.Widget;    use Gtk.Widget; 
  40.  
  41. package Gtk.Font_Selection_Dialog is 
  42.  
  43.    type Gtk_Font_Selection_Dialog_Record is new Gtk_Dialog_Record with null record; 
  44.    type Gtk_Font_Selection_Dialog is access all Gtk_Font_Selection_Dialog_Record'Class; 
  45.  
  46.    ------------------ 
  47.    -- Constructors -- 
  48.    ------------------ 
  49.  
  50.    procedure Gtk_New 
  51.       (Dialog : out Gtk_Font_Selection_Dialog; 
  52.        Title  : UTF8_String); 
  53.    procedure Initialize 
  54.       (Dialog : not null access Gtk_Font_Selection_Dialog_Record'Class; 
  55.        Title  : UTF8_String); 
  56.    --  Creates a new Gtk.Font_Selection_Dialog.Gtk_Font_Selection_Dialog. 
  57.    --  "title": the title of the dialog window 
  58.  
  59.    function Gtk_Font_Selection_Dialog_New 
  60.       (Title : UTF8_String) return Gtk_Font_Selection_Dialog; 
  61.    --  Creates a new Gtk.Font_Selection_Dialog.Gtk_Font_Selection_Dialog. 
  62.    --  "title": the title of the dialog window 
  63.  
  64.    function Get_Type return Glib.GType; 
  65.    pragma Import (C, Get_Type, "gtk_font_selection_dialog_get_type"); 
  66.  
  67.    ------------- 
  68.    -- Methods -- 
  69.    ------------- 
  70.  
  71.    function Get_Cancel_Button 
  72.       (Dialog : not null access Gtk_Font_Selection_Dialog_Record) 
  73.        return Gtk.Widget.Gtk_Widget; 
  74.    pragma Obsolescent (Get_Cancel_Button); 
  75.    --  Gets the 'Cancel' button. 
  76.    --  Since: gtk+ 2.14 
  77.    --  Deprecated since 3.2, Use 
  78.    --  Gtk.Font_Chooser_Dialog.Gtk_Font_Chooser_Dialog 
  79.  
  80.    function Get_Font_Name 
  81.       (Dialog : not null access Gtk_Font_Selection_Dialog_Record) 
  82.        return UTF8_String; 
  83.    pragma Obsolescent (Get_Font_Name); 
  84.    --  Gets the currently-selected font name. 
  85.    --  Note that this can be a different string than what you set with 
  86.    --  Gtk.Font_Selection_Dialog.Set_Font_Name, as the font selection widget 
  87.    --  may normalize font names and thus return a string with a different 
  88.    --  structure. For example, "Helvetica Italic Bold 12" could be normalized 
  89.    --  to "Helvetica Bold Italic 12". Use Pango.Font.Equal if you want to 
  90.    --  compare two font descriptions. 
  91.    --  Deprecated since 3.2, Use 
  92.    --  Gtk.Font_Chooser_Dialog.Gtk_Font_Chooser_Dialog 
  93.  
  94.    function Set_Font_Name 
  95.       (Dialog   : not null access Gtk_Font_Selection_Dialog_Record; 
  96.        Fontname : UTF8_String) return Boolean; 
  97.    pragma Obsolescent (Set_Font_Name); 
  98.    --  Sets the currently selected font. 
  99.    --  Deprecated since 3.2, Use 
  100.    --  Gtk.Font_Chooser_Dialog.Gtk_Font_Chooser_Dialog 
  101.    --  "fontname": a font name like "Helvetica 12" or "Times Bold 18" 
  102.  
  103.    function Get_Font_Selection 
  104.       (Dialog : not null access Gtk_Font_Selection_Dialog_Record) 
  105.        return Gtk.Widget.Gtk_Widget; 
  106.    pragma Obsolescent (Get_Font_Selection); 
  107.    --  Retrieves the Gtk.Font_Selection.Gtk_Font_Selection widget embedded in 
  108.    --  the dialog. 
  109.    --  Since: gtk+ 2.22 
  110.    --  Deprecated since 3.2, Use 
  111.    --  Gtk.Font_Chooser_Dialog.Gtk_Font_Chooser_Dialog 
  112.  
  113.    function Get_Ok_Button 
  114.       (Dialog : not null access Gtk_Font_Selection_Dialog_Record) 
  115.        return Gtk.Widget.Gtk_Widget; 
  116.    pragma Obsolescent (Get_Ok_Button); 
  117.    --  Gets the 'OK' button. 
  118.    --  Since: gtk+ 2.14 
  119.    --  Deprecated since 3.2, Use 
  120.    --  Gtk.Font_Chooser_Dialog.Gtk_Font_Chooser_Dialog 
  121.  
  122.    function Get_Preview_Text 
  123.       (Dialog : not null access Gtk_Font_Selection_Dialog_Record) 
  124.        return UTF8_String; 
  125.    pragma Obsolescent (Get_Preview_Text); 
  126.    --  Gets the text displayed in the preview area. 
  127.    --  Deprecated since 3.2, Use 
  128.    --  Gtk.Font_Chooser_Dialog.Gtk_Font_Chooser_Dialog 
  129.  
  130.    procedure Set_Preview_Text 
  131.       (Dialog : not null access Gtk_Font_Selection_Dialog_Record; 
  132.        Text   : UTF8_String); 
  133.    pragma Obsolescent (Set_Preview_Text); 
  134.    --  Sets the text displayed in the preview area. 
  135.    --  Deprecated since 3.2, Use 
  136.    --  Gtk.Font_Chooser_Dialog.Gtk_Font_Chooser_Dialog 
  137.    --  "text": the text to display in the preview area 
  138.  
  139.    ---------------- 
  140.    -- Interfaces -- 
  141.    ---------------- 
  142.    --  This class implements several interfaces. See Glib.Types 
  143.    -- 
  144.    --  - "Buildable" 
  145.  
  146.    package Implements_Gtk_Buildable is new Glib.Types.Implements 
  147.      (Gtk.Buildable.Gtk_Buildable, Gtk_Font_Selection_Dialog_Record, Gtk_Font_Selection_Dialog); 
  148.    function "+" 
  149.      (Widget : access Gtk_Font_Selection_Dialog_Record'Class) 
  150.    return Gtk.Buildable.Gtk_Buildable 
  151.    renames Implements_Gtk_Buildable.To_Interface; 
  152.    function "-" 
  153.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  154.    return Gtk_Font_Selection_Dialog 
  155.    renames Implements_Gtk_Buildable.To_Object; 
  156.  
  157. end Gtk.Font_Selection_Dialog;