1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2013, AdaCore                   -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. --  This widget provides a dialog for selecting a font. See also 
  32. --  Gtk.Font_Selection. 
  33. -- 
  34. --  </description> 
  35. --  <screenshot>gtk-fontsel</screenshot> 
  36. --  <group>Selectors</group> 
  37. --  <testgtk>create_font_selection.adb</testgtk> 
  38.  
  39. pragma Warnings (Off, "*is already use-visible*"); 
  40. with Gdk.Font;      use Gdk.Font; 
  41. with Glib;          use Glib; 
  42. with Glib.Types;    use Glib.Types; 
  43. with Gtk.Buildable; use Gtk.Buildable; 
  44. with Gtk.Dialog;    use Gtk.Dialog; 
  45. with Gtk.Widget;    use Gtk.Widget; 
  46.  
  47. package Gtk.Font_Selection_Dialog is 
  48.  
  49.    type Gtk_Font_Selection_Dialog_Record is new Gtk_Dialog_Record with null record; 
  50.    type Gtk_Font_Selection_Dialog is access all Gtk_Font_Selection_Dialog_Record'Class; 
  51.  
  52.    ------------------ 
  53.    -- Constructors -- 
  54.    ------------------ 
  55.  
  56.    procedure Gtk_New 
  57.       (Dialog : out Gtk_Font_Selection_Dialog; 
  58.        Title  : UTF8_String); 
  59.    procedure Initialize 
  60.       (Dialog : access Gtk_Font_Selection_Dialog_Record'Class; 
  61.        Title  : UTF8_String); 
  62.    --  Creates a new Gtk.Font_Selection_Dialog.Gtk_Font_Selection_Dialog. 
  63.    --  "title": the title of the dialog window 
  64.  
  65.    function Get_Type return Glib.GType; 
  66.    pragma Import (C, Get_Type, "gtk_font_selection_dialog_get_type"); 
  67.  
  68.    ------------- 
  69.    -- Methods -- 
  70.    ------------- 
  71.  
  72.    function Get_Apply_Button 
  73.       (Dialog : access Gtk_Font_Selection_Dialog_Record) 
  74.        return Gtk.Widget.Gtk_Widget; 
  75.    pragma Obsolescent (Get_Apply_Button); 
  76.    --  Obtains a button. The button doesn't have any function. 
  77.    --  Since: gtk+ 2.14 
  78.    --  Deprecated since 2.16, Don't use this function. 
  79.  
  80.    function Get_Cancel_Button 
  81.       (Dialog : access Gtk_Font_Selection_Dialog_Record) 
  82.        return Gtk.Widget.Gtk_Widget; 
  83.    --  Gets the 'Cancel' button. for the 'Cancel' button. 
  84.    --  Since: gtk+ 2.14 
  85.  
  86.    function Get_Font 
  87.       (Dialog : access Gtk_Font_Selection_Dialog_Record) 
  88.        return Gdk.Font.Gdk_Font; 
  89.    pragma Obsolescent (Get_Font); 
  90.    --  Gets the currently-selected font. currently selected font in the 
  91.    --  dialog, or null if no font is selected 
  92.    --  Deprecated since 2.0, Use Gtk.Font_Selection_Dialog.Get_Font_Name 
  93.    --  instead. 
  94.  
  95.    function Get_Font_Name 
  96.       (Dialog : access Gtk_Font_Selection_Dialog_Record) return UTF8_String; 
  97.    function Set_Font_Name 
  98.       (Dialog   : access Gtk_Font_Selection_Dialog_Record; 
  99.        Fontname : UTF8_String) return Boolean; 
  100.    --  Sets the currently selected font. 
  101.    --  "fontname": a font name like "Helvetica 12" or "Times Bold 18" 
  102.  
  103.    function Get_Font_Selection 
  104.       (Dialog : access Gtk_Font_Selection_Dialog_Record) 
  105.        return Gtk.Widget.Gtk_Widget; 
  106.    --  Retrieves the Gtk.Font_Selection.Gtk_Font_Selection widget embedded in 
  107.    --  the dialog. 
  108.    --  Since: gtk+ 2.22 
  109.  
  110.    function Get_Ok_Button 
  111.       (Dialog : access Gtk_Font_Selection_Dialog_Record) 
  112.        return Gtk.Widget.Gtk_Widget; 
  113.    --  Gets the 'OK' button. for the 'OK' button. 
  114.    --  Since: gtk+ 2.14 
  115.  
  116.    function Get_Preview_Text 
  117.       (Dialog : access Gtk_Font_Selection_Dialog_Record) return UTF8_String; 
  118.    procedure Set_Preview_Text 
  119.       (Dialog : access Gtk_Font_Selection_Dialog_Record; 
  120.        Text   : UTF8_String); 
  121.    --  Sets the text displayed in the preview area. 
  122.    --  "text": the text to display in the preview area 
  123.  
  124.    ---------------- 
  125.    -- Interfaces -- 
  126.    ---------------- 
  127.    --  This class implements several interfaces. See Glib.Types 
  128.    -- 
  129.    --  - "Buildable" 
  130.  
  131.    package Implements_Buildable is new Glib.Types.Implements 
  132.      (Gtk.Buildable.Gtk_Buildable, Gtk_Font_Selection_Dialog_Record, Gtk_Font_Selection_Dialog); 
  133.    function "+" 
  134.      (Widget : access Gtk_Font_Selection_Dialog_Record'Class) 
  135.    return Gtk.Buildable.Gtk_Buildable 
  136.    renames Implements_Buildable.To_Interface; 
  137.    function "-" 
  138.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  139.    return Gtk_Font_Selection_Dialog 
  140.    renames Implements_Buildable.To_Object; 
  141.  
  142. end Gtk.Font_Selection_Dialog;