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-2011, 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. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. --  A Gtk_Label is a light widget associated with some text you want to 
  27. --  display on the screen. You can change the text dynamically if needed. 
  28. -- 
  29. --  The text can be on multiple lines if you separate each line with the 
  30. --  ASCII.LF character. However, this is not the recommended way to display 
  31. --  long texts (see the Gtk_Text widget instead). 
  32. -- 
  33. --  == Mnemonics == 
  34. -- 
  35. --  Labels may contain mnemonics. Mnemonics are underlined characters in the 
  36. --  label, used for keyboard navigation. Mnemonics are created by providing 
  37. --  string with an underscore before the mnemonic character, such as "_File", 
  38. --  to the functions gtk_new_with_mnemonic or set_text_with_mnemonic(). 
  39. -- 
  40. --  Mnemonics automatically activate any activatable widget the label is 
  41. --  inside, such as a Gtk_Button; if the label is not inside the mnemonic's 
  42. --  target widget, you have to tell the label about the target using 
  43. --  set_mnemonic_widget(). For instance: declare Button : Gtk_Button; Label : 
  44. --  Gtk_Label; begin Gtk_New (Button); Gtk_New_With_Mnemonic (Label, "_File"); 
  45. --  Add (Button, Label); end; However, there exists a convenience function in 
  46. --  Gtk.Button to create such a button already. 
  47. -- 
  48. --  == Markup == 
  49. -- 
  50. --  To make it easy to format text in a label (changing colors, fonts, etc.), 
  51. --  label text can be provided in a simple markup format. Here's how to create 
  52. --  a label with a small font: Gtk_New (Label, "<small>hello</small>"); 
  53. -- 
  54. --  The markup must be valid, and <>& characters must be escaped with &lt; 
  55. --  &gt; and &amp; 
  56. -- 
  57. --  Markup strings are just a convenient way to set the Pango_Attr_List on 
  58. --  label; Set_Attributes() may be a simpler way to set attributes in some 
  59. --  cases. Be careful though; Pango_Attr_List tends to cause 
  60. --  internationalization problems, unless you're applying attributes to the 
  61. --  entire string (i.e. unless you set the range of each attribute to [0, 
  62. --  G_MAXINT)). The reason is that specifying the start_index and end_index for 
  63. --  a Pango_Attribute requires knowledge of the exact string being displayed, 
  64. --  so translations will cause problems. 
  65. -- 
  66. --  == Selectable labels == 
  67. -- 
  68. --  Labels can be made selectable with Set_Selectable. Selectable labels allow 
  69. --  the user to copy the label contents to the clipboard. Only should be made 
  70. --  selectable. 
  71. -- 
  72. --  </description> 
  73. --  <screenshot>gtk-label</screenshot> 
  74. --  <group>Display widgets</group> 
  75. --  <testgtk>create_label.adb</testgtk> 
  76.  
  77. pragma Warnings (Off, "*is already use-visible*"); 
  78. with Glib;             use Glib; 
  79. with Glib.Properties;  use Glib.Properties; 
  80. with Glib.Types;       use Glib.Types; 
  81. with Gtk.Buildable;    use Gtk.Buildable; 
  82. with Gtk.Enums;        use Gtk.Enums; 
  83. with Gtk.Misc;         use Gtk.Misc; 
  84. with Gtk.Widget;       use Gtk.Widget; 
  85. with Pango.Attributes; use Pango.Attributes; 
  86. with Pango.Layout;     use Pango.Layout; 
  87.  
  88. package Gtk.Label is 
  89.  
  90.    type Gtk_Label_Record is new Gtk_Misc_Record with null record; 
  91.    type Gtk_Label is access all Gtk_Label_Record'Class; 
  92.  
  93.    ------------------ 
  94.    -- Constructors -- 
  95.    ------------------ 
  96.  
  97.    procedure Gtk_New (Label : out Gtk_Label; Str : UTF8_String := ""); 
  98.    procedure Initialize 
  99.       (Label : access Gtk_Label_Record'Class; 
  100.        Str   : UTF8_String := ""); 
  101.    --  Creates a new label with the given text inside it. You can pass null to 
  102.    --  get an empty label widget. 
  103.    --  "str": The text of the label 
  104.  
  105.    procedure Gtk_New_With_Mnemonic 
  106.       (Label : out Gtk_Label; 
  107.        Str   : UTF8_String); 
  108.    procedure Initialize_With_Mnemonic 
  109.       (Label : access Gtk_Label_Record'Class; 
  110.        Str   : UTF8_String); 
  111.    --  Creates a new Gtk.Label.Gtk_Label, containing the text in Str. If 
  112.    --  characters in Str are preceded by an underscore, they are underlined. If 
  113.    --  you need a literal underscore character in a label, use '__' (two 
  114.    --  underscores). The first underlined character represents a keyboard 
  115.    --  accelerator called a mnemonic. The mnemonic key can be used to activate 
  116.    --  another widget, chosen automatically, or explicitly using 
  117.    --  Gtk.Label.Set_Mnemonic_Widget. If Gtk.Label.Set_Mnemonic_Widget is not 
  118.    --  called, then the first activatable ancestor of the Gtk.Label.Gtk_Label 
  119.    --  will be chosen as the mnemonic widget. For instance, if the label is 
  120.    --  inside a button or menu item, the button or menu item will automatically 
  121.    --  become the mnemonic widget and be activated by the mnemonic. 
  122.    --  "str": The text of the label, with an underscore in front of the 
  123.    --  mnemonic character 
  124.  
  125.    function Get_Type return Glib.GType; 
  126.    pragma Import (C, Get_Type, "gtk_label_get_type"); 
  127.  
  128.    ------------- 
  129.    -- Methods -- 
  130.    ------------- 
  131.  
  132.    function Get_Angle (Label : access Gtk_Label_Record) return Gdouble; 
  133.    procedure Set_Angle (Label : access Gtk_Label_Record; Angle : Gdouble); 
  134.    --  Sets the angle of rotation for the label. An angle of 90 reads from 
  135.    --  from bottom to top, an angle of 270, from top to bottom. The angle 
  136.    --  setting for the label is ignored if the label is selectable, wrapped, or 
  137.    --  ellipsized. 
  138.    --  Since: gtk+ 2.6 
  139.    --  "angle": the angle that the baseline of the label makes with the 
  140.    --  horizontal, in degrees, measured counterclockwise 
  141.  
  142.    function Get_Attributes 
  143.       (Label : access Gtk_Label_Record) 
  144.        return Pango.Attributes.Pango_Attr_List; 
  145.    procedure Set_Attributes 
  146.       (Label : access Gtk_Label_Record; 
  147.        Attrs : out Pango.Attributes.Pango_Attr_List); 
  148.    --  Sets a Pango.Attributes.Pango_Attr_List; the attributes in the list are 
  149.    --  applied to the label text. 
  150.    --  Note: The attributes set with this function will be applied and merged 
  151.    --  with any other attributes previously effected by way of the 
  152.    --  Gtk.Label.Gtk_Label:use-underline or Gtk.Label.Gtk_Label:use-markup 
  153.    --  properties. While it is not recommended to mix markup strings with 
  154.    --  manually set attributes, if you must; know that the attributes will be 
  155.    --  applied to the label after the markup string is parsed. 
  156.    --  "attrs": a Pango.Attributes.Pango_Attr_List 
  157.  
  158.    function Get_Current_Uri 
  159.       (Label : access Gtk_Label_Record) return UTF8_String; 
  160.    --  Returns the URI for the currently active link in the label. The active 
  161.    --  link is the one under the mouse pointer or, in a selectable label, the 
  162.    --  link in which the text cursor is currently positioned. This function is 
  163.    --  intended for use in a Gtk.Label.Gtk_Label::activate-link handler or for 
  164.    --  use in a Gtk.Widget.Gtk_Widget::query-tooltip handler. not be freed or 
  165.    --  modified. 
  166.    --  Since: gtk+ 2.18 
  167.    --  Returns the currently active URI. The string is owned by GTK+ and must 
  168.  
  169.    function Get_Ellipsize 
  170.       (Label : access Gtk_Label_Record) 
  171.        return Pango.Layout.Pango_Ellipsize_Mode; 
  172.    procedure Set_Ellipsize 
  173.       (Label : access Gtk_Label_Record; 
  174.        Mode  : Pango.Layout.Pango_Ellipsize_Mode); 
  175.    --  if there is not enough space to render the entire string. 
  176.    --  Since: gtk+ 2.6 
  177.    --  "mode": a Pango.Layout.Pango_Ellipsize_Mode 
  178.  
  179.    function Get_Justify 
  180.       (Label : access Gtk_Label_Record) return Gtk.Enums.Gtk_Justification; 
  181.    procedure Set_Justify 
  182.       (Label : access Gtk_Label_Record; 
  183.        Jtype : Gtk.Enums.Gtk_Justification); 
  184.    --  Sets the alignment of the lines in the text of the label relative to 
  185.    --  each other. %GTK_JUSTIFY_LEFT is the default value when the widget is 
  186.    --  first created with Gtk.Label.Gtk_New. If you instead want to set the 
  187.    --  alignment of the label as a whole, use Gtk.Misc.Set_Alignment instead. 
  188.    --  Gtk.Label.Set_Justify has no effect on labels containing only a single 
  189.    --  line. 
  190.    --  "jtype": a Gtk.Enums.Gtk_Justification 
  191.  
  192.    function Get_Label (Label : access Gtk_Label_Record) return UTF8_String; 
  193.    procedure Set_Label (Label : access Gtk_Label_Record; Str : UTF8_String); 
  194.    --  Sets the text of the label. The label is interpreted as including 
  195.    --  embedded underlines and/or Pango markup depending on the values of the 
  196.    --  Gtk.Label.Gtk_Label:use-underline" and Gtk.Label.Gtk_Label:use-markup 
  197.    --  properties. 
  198.    --  "str": the new text to set for the label 
  199.  
  200.    function Get_Layout 
  201.       (Label : access Gtk_Label_Record) return Pango.Layout.Pango_Layout; 
  202.    --  Gets the Pango.Layout.Pango_Layout used to display the label. The 
  203.    --  layout is useful to e.g. convert text positions to pixel positions, in 
  204.    --  combination with Gtk.Label.Get_Layout_Offsets. The returned layout is 
  205.    --  owned by the label so need not be freed by the caller. 
  206.    --  Returns the Pango.Layout.Pango_Layout for this label 
  207.  
  208.    procedure Get_Layout_Offsets 
  209.       (Label : access Gtk_Label_Record; 
  210.        X     : out Gint; 
  211.        Y     : out Gint); 
  212.    --  Obtains the coordinates where the label will draw the 
  213.    --  Pango.Layout.Pango_Layout representing the text in the label; useful to 
  214.    --  convert mouse events into coordinates inside the 
  215.    --  Pango.Layout.Pango_Layout, e.g. to take some action if some part of the 
  216.    --  label is clicked. Of course you will need to create a 
  217.    --  Gtk.Event_Box.Gtk_Event_Box to receive the events, and pack the label 
  218.    --  inside it, since labels are a GTK_NO_WINDOW widget. Remember when using 
  219.    --  the Pango.Layout.Pango_Layout functions you need to convert to and from 
  220.    --  pixels using PANGO_PIXELS or PANGO_SCALE. 
  221.    --  "x": location to store X offset of layout, or null 
  222.    --  "y": location to store Y offset of layout, or null 
  223.  
  224.    function Get_Line_Wrap (Label : access Gtk_Label_Record) return Boolean; 
  225.    procedure Set_Line_Wrap (Label : access Gtk_Label_Record; Wrap : Boolean); 
  226.    --  Toggles line wrapping within the Gtk.Label.Gtk_Label widget. True makes 
  227.    --  it break lines if text exceeds the widget's size. False lets the text 
  228.    --  get cut off by the edge of the widget if it exceeds the widget size. 
  229.    --  Note that setting line wrapping to True does not make the label wrap at 
  230.    --  its parent container's width, because GTK+ widgets conceptually can't 
  231.    --  make their requisition depend on the parent container's size. For a 
  232.    --  label that wraps at a specific position, set the label's width using 
  233.    --  Gtk.Widget.Set_Size_Request. 
  234.    --  "wrap": the setting 
  235.  
  236.    function Get_Line_Wrap_Mode 
  237.       (Label : access Gtk_Label_Record) return Pango.Layout.Pango_Wrap_Mode; 
  238.    procedure Set_Line_Wrap_Mode 
  239.       (Label     : access Gtk_Label_Record; 
  240.        Wrap_Mode : Pango.Layout.Pango_Wrap_Mode); 
  241.    --  If line wrapping is on (see Gtk.Label.Set_Line_Wrap) this controls how 
  242.    --  the line wrapping is done. The default is %PANGO_WRAP_WORD which means 
  243.    --  wrap on word boundaries. 
  244.    --  Since: gtk+ 2.10 
  245.    --  "wrap_mode": the line wrapping mode 
  246.  
  247.    function Get_Max_Width_Chars 
  248.       (Label : access Gtk_Label_Record) return Gint; 
  249.    procedure Set_Max_Width_Chars 
  250.       (Label   : access Gtk_Label_Record; 
  251.        N_Chars : Gint); 
  252.    --  Sets the desired maximum width in characters of Label to N_Chars. 
  253.    --  Since: gtk+ 2.6 
  254.    --  "n_chars": the new desired maximum width, in characters. 
  255.  
  256.    function Get_Mnemonic_Keyval 
  257.       (Label : access Gtk_Label_Record) return Guint; 
  258.    --  If the label has been set so that it has an mnemonic key this function 
  259.    --  returns the keyval used for the mnemonic accelerator. If there is no 
  260.    --  mnemonic set up it returns GDK_VoidSymbol. 
  261.    --  Returns GDK keyval usable for accelerators, or GDK_VoidSymbol 
  262.  
  263.    function Get_Mnemonic_Widget 
  264.       (Label : access Gtk_Label_Record) return Gtk.Widget.Gtk_Widget; 
  265.    procedure Set_Mnemonic_Widget 
  266.       (Label  : access Gtk_Label_Record; 
  267.        Widget : access Gtk.Widget.Gtk_Widget_Record'Class); 
  268.    --  If the label has been set so that it has an mnemonic key (using i.e. 
  269.    --  Gtk.Label.Set_Markup_With_Mnemonic, Gtk.Label.Set_Text_With_Mnemonic, 
  270.    --  Gtk.Label.Gtk_New_With_Mnemonic or the "use_underline" property) the 
  271.    --  label can be associated with a widget that is the target of the 
  272.    --  mnemonic. When the label is inside a widget (like a 
  273.    --  Gtk.Button.Gtk_Button or a Gtk.Notebook.Gtk_Notebook tab) it is 
  274.    --  automatically associated with the correct widget, but sometimes (i.e. 
  275.    --  when the target is a Gtk.GEntry.Gtk_Entry next to the label) you need to 
  276.    --  set it explicitly using this function. The target widget will be 
  277.    --  accelerated by emitting the GtkWidget::mnemonic-activate signal on it. 
  278.    --  The default handler for this signal will activate the widget if there 
  279.    --  are no mnemonic collisions and toggle focus between the colliding 
  280.    --  widgets otherwise. 
  281.    --  "widget": the target Gtk.Widget.Gtk_Widget 
  282.  
  283.    function Get_Selectable (Label : access Gtk_Label_Record) return Boolean; 
  284.    procedure Set_Selectable 
  285.       (Label   : access Gtk_Label_Record; 
  286.        Setting : Boolean); 
  287.    --  Selectable labels allow the user to select text from the label, for 
  288.    --  copy-and-paste. 
  289.    --  "setting": True to allow selecting text in the label 
  290.  
  291.    procedure Get_Selection_Bounds 
  292.       (Label         : access Gtk_Label_Record; 
  293.        Start         : out Gint; 
  294.        The_End       : out Gint; 
  295.        Has_Selection : out Boolean); 
  296.    --  Gets the selected range of characters in the label, returning True if 
  297.    --  there's a selection. 
  298.    --  Returns True if selection is non-empty 
  299.    --  "start": return location for start of selection, as a character offset 
  300.    --  "end": return location for end of selection, as a character offset 
  301.  
  302.    function Get_Single_Line_Mode 
  303.       (Label : access Gtk_Label_Record) return Boolean; 
  304.    procedure Set_Single_Line_Mode 
  305.       (Label            : access Gtk_Label_Record; 
  306.        Single_Line_Mode : Boolean); 
  307.    --  Sets whether the label is in single line mode. 
  308.    --  Since: gtk+ 2.6 
  309.    --  "single_line_mode": True if the label should be in single line mode 
  310.  
  311.    function Get_Text (Label : access Gtk_Label_Record) return UTF8_String; 
  312.    procedure Set_Text (Label : access Gtk_Label_Record; Str : UTF8_String); 
  313.    --  Sets the text within the Gtk.Label.Gtk_Label widget. It overwrites any 
  314.    --  text that was there before. This will also clear any previously set 
  315.    --  mnemonic accelerators. 
  316.    --  "str": The text you want to set 
  317.  
  318.    function Get_Track_Visited_Links 
  319.       (Label : access Gtk_Label_Record) return Boolean; 
  320.    procedure Set_Track_Visited_Links 
  321.       (Label       : access Gtk_Label_Record; 
  322.        Track_Links : Boolean); 
  323.    --  Sets whether the label should keep track of clicked links (and use a 
  324.    --  different color for them). 
  325.    --  Since: gtk+ 2.18 
  326.    --  "track_links": True to track visited links 
  327.  
  328.    function Get_Use_Markup (Label : access Gtk_Label_Record) return Boolean; 
  329.    procedure Set_Use_Markup 
  330.       (Label   : access Gtk_Label_Record; 
  331.        Setting : Boolean); 
  332.    --  Sets whether the text of the label contains markup in <link 
  333.    --  linkend="PangoMarkupFormat">Pango's text markup language</link>. See 
  334.    --  Gtk.Label.Set_Markup. 
  335.    --  "setting": True if the label's text should be parsed for markup. 
  336.  
  337.    function Get_Use_Underline 
  338.       (Label : access Gtk_Label_Record) return Boolean; 
  339.    procedure Set_Use_Underline 
  340.       (Label   : access Gtk_Label_Record; 
  341.        Setting : Boolean); 
  342.    --  If true, an underline in the text indicates the next character should 
  343.    --  be used for the mnemonic accelerator key. 
  344.    --  "setting": True if underlines in the text indicate mnemonics 
  345.  
  346.    function Get_Width_Chars (Label : access Gtk_Label_Record) return Gint; 
  347.    procedure Set_Width_Chars 
  348.       (Label   : access Gtk_Label_Record; 
  349.        N_Chars : Gint); 
  350.    --  Sets the desired width in characters of Label to N_Chars. 
  351.    --  Since: gtk+ 2.6 
  352.    --  "n_chars": the new desired width, in characters. 
  353.  
  354.    function Parse_Uline 
  355.       (Label  : access Gtk_Label_Record; 
  356.        String : UTF8_String) return Guint; 
  357.  
  358.    procedure Select_Region 
  359.       (Label        : access Gtk_Label_Record; 
  360.        Start_Offset : Gint := -1; 
  361.        End_Offset   : Gint := -1); 
  362.    --  Selects a range of characters in the label, if the label is selectable. 
  363.    --  See Gtk.Label.Set_Selectable. If the label is not selectable, this 
  364.    --  function has no effect. If Start_Offset or 
  365.    --  "start_offset": start offset (in characters not bytes) 
  366.    --  "end_offset": end offset (in characters not bytes) 
  367.  
  368.    procedure Set_Markup (Label : access Gtk_Label_Record; Str : UTF8_String); 
  369.    --  Parses Str which is marked up with the <link 
  370.    --  linkend="PangoMarkupFormat">Pango text markup language</link>, setting 
  371.    --  the label's text and attribute list based on the parse results. If the 
  372.    --  Str is external data, you may need to escape it with 
  373.    --  g_markup_escape_text or g_markup_printf_escaped<!-- -->: |[ char 
  374.    --  *markup; markup = g_markup_printf_escaped ("&lt;span 
  375.    --  style=\"italic\"&gt;&percnt;s&lt;/span&gt;", str); gtk_label_set_markup 
  376.    --  (GTK_LABEL (label), markup); g_free (markup); ]| 
  377.    --  "str": a markup string (see <link linkend="PangoMarkupFormat">Pango 
  378.    --  markup format</link>) 
  379.  
  380.    procedure Set_Markup_With_Mnemonic 
  381.       (Label : access Gtk_Label_Record; 
  382.        Str   : UTF8_String); 
  383.    --  Parses Str which is marked up with the <link 
  384.    --  linkend="PangoMarkupFormat">Pango text markup language</link>, setting 
  385.    --  the label's text and attribute list based on the parse results. If 
  386.    --  characters in Str are preceded by an underscore, they are underlined 
  387.    --  indicating that they represent a keyboard accelerator called a mnemonic. 
  388.    --  The mnemonic key can be used to activate another widget, chosen 
  389.    --  automatically, or explicitly using Gtk.Label.Set_Mnemonic_Widget. 
  390.    --  "str": a markup string (see <link linkend="PangoMarkupFormat">Pango 
  391.    --  markup format</link>) 
  392.  
  393.    procedure Set_Pattern 
  394.       (Label   : access Gtk_Label_Record; 
  395.        Pattern : UTF8_String); 
  396.    --  Change the underlines pattern. 
  397.    --  Pattern is a simple string made of underscore and space characters, 
  398.    --  matching the ones in the string. GtkAda will underline every letter that 
  399.    --  matches an underscore. 
  400.    --  An empty string disables the underlines. 
  401.    --  example: If the text is FooBarBaz and the Pattern is "___ ___" then 
  402.    --  both "Foo" and "Baz" will be underlined, but not "Bar". 
  403.  
  404.    procedure Set_Text_With_Mnemonic 
  405.       (Label : access Gtk_Label_Record; 
  406.        Str   : UTF8_String); 
  407.    --  Sets the label's text from the string Str. If characters in Str are 
  408.    --  preceded by an underscore, they are underlined indicating that they 
  409.    --  represent a keyboard accelerator called a mnemonic. The mnemonic key can 
  410.    --  be used to activate another widget, chosen automatically, or explicitly 
  411.    --  using Gtk.Label.Set_Mnemonic_Widget. 
  412.    --  "str": a string 
  413.  
  414.    ---------------- 
  415.    -- Interfaces -- 
  416.    ---------------- 
  417.    --  This class implements several interfaces. See Glib.Types 
  418.    -- 
  419.    --  - "Buildable" 
  420.  
  421.    package Implements_Buildable is new Glib.Types.Implements 
  422.      (Gtk.Buildable.Gtk_Buildable, Gtk_Label_Record, Gtk_Label); 
  423.    function "+" 
  424.      (Widget : access Gtk_Label_Record'Class) 
  425.    return Gtk.Buildable.Gtk_Buildable 
  426.    renames Implements_Buildable.To_Interface; 
  427.    function "-" 
  428.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  429.    return Gtk_Label 
  430.    renames Implements_Buildable.To_Object; 
  431.  
  432.    ---------------- 
  433.    -- Properties -- 
  434.    ---------------- 
  435.    --  The following properties are defined for this widget. See 
  436.    --  Glib.Properties for more information on properties) 
  437.    -- 
  438.    --  Name: Angle_Property 
  439.    --  Type: Gdouble 
  440.    --  Flags: read-write 
  441.    --  The angle that the baseline of the label makes with the horizontal, in 
  442.    --  degrees, measured counterclockwise. An angle of 90 reads from from 
  443.    --  bottom to top, an angle of 270, from top to bottom. Ignored if the label 
  444.    --  is selectable, wrapped, or ellipsized. 
  445.    -- 
  446.    --  Name: Cursor_Position_Property 
  447.    --  Type: Gint 
  448.    --  Flags: read-write 
  449.    -- 
  450.    --  Name: Justify_Property 
  451.    --  Type: Gtk.Enums.Gtk_Justification 
  452.    --  Flags: read-write 
  453.    -- 
  454.    --  Name: Label_Property 
  455.    --  Type: UTF8_String 
  456.    --  Flags: read-write 
  457.    -- 
  458.    --  Name: Max_Width_Chars_Property 
  459.    --  Type: Gint 
  460.    --  Flags: read-write 
  461.    --  The desired maximum width of the label, in characters. If this property 
  462.    --  is set to -1, the width will be calculated automatically, otherwise the 
  463.    --  label will request space for no more than the requested number of 
  464.    --  characters. If the Gtk.Label.Gtk_Label:width-chars property is set to a 
  465.    --  positive value, then the "max-width-chars" property is ignored. 
  466.    -- 
  467.    --  Name: Mnemonic_Keyval_Property 
  468.    --  Type: Guint 
  469.    --  Flags: read-write 
  470.    -- 
  471.    --  Name: Mnemonic_Widget_Property 
  472.    --  Type: Gtk.Widget.Gtk_Widget 
  473.    --  Flags: read-write 
  474.    -- 
  475.    --  Name: Pattern_Property 
  476.    --  Type: UTF8_String 
  477.    --  Flags: write 
  478.    -- 
  479.    --  Name: Selectable_Property 
  480.    --  Type: Boolean 
  481.    --  Flags: read-write 
  482.    -- 
  483.    --  Name: Selection_Bound_Property 
  484.    --  Type: Gint 
  485.    --  Flags: read-write 
  486.    -- 
  487.    --  Name: Single_Line_Mode_Property 
  488.    --  Type: Boolean 
  489.    --  Flags: read-write 
  490.    --  Whether the label is in single line mode. In single line mode, the 
  491.    --  height of the label does not depend on the actual text, it is always set 
  492.    --  to ascent + descent of the font. This can be an advantage in situations 
  493.    --  where resizing the label because of text changes would be distracting, 
  494.    --  e.g. in a statusbar. 
  495.    -- 
  496.    --  Name: Track_Visited_Links_Property 
  497.    --  Type: Boolean 
  498.    --  Flags: read-write 
  499.    --  Set this property to True to make the label track which links have been 
  500.    --  clicked. It will then apply the ::visited-link-color color, instead of 
  501.    --  ::link-color. 
  502.    -- 
  503.    --  Name: Use_Markup_Property 
  504.    --  Type: Boolean 
  505.    --  Flags: read-write 
  506.    -- 
  507.    --  Name: Use_Underline_Property 
  508.    --  Type: Boolean 
  509.    --  Flags: read-write 
  510.    -- 
  511.    --  Name: Width_Chars_Property 
  512.    --  Type: Gint 
  513.    --  Flags: read-write 
  514.    --  The desired width of the label, in characters. If this property is set 
  515.    --  to -1, the width will be calculated automatically, otherwise the label 
  516.    --  will request either 3 characters or the property value, whichever is 
  517.    --  greater. If the "width-chars" property is set to a positive value, then 
  518.    --  the Gtk.Label.Gtk_Label:max-width-chars property is ignored. 
  519.    -- 
  520.    --  Name: Wrap_Property 
  521.    --  Type: Boolean 
  522.    --  Flags: read-write 
  523.  
  524.    Angle_Property : constant Glib.Properties.Property_Double; 
  525.    Cursor_Position_Property : constant Glib.Properties.Property_Int; 
  526.    Justify_Property : constant Gtk.Enums.Property_Gtk_Justification; 
  527.    Label_Property : constant Glib.Properties.Property_String; 
  528.    Max_Width_Chars_Property : constant Glib.Properties.Property_Int; 
  529.    Mnemonic_Keyval_Property : constant Glib.Properties.Property_Uint; 
  530.    Mnemonic_Widget_Property : constant Glib.Properties.Property_Object; 
  531.    Pattern_Property : constant Glib.Properties.Property_String; 
  532.    Selectable_Property : constant Glib.Properties.Property_Boolean; 
  533.    Selection_Bound_Property : constant Glib.Properties.Property_Int; 
  534.    Single_Line_Mode_Property : constant Glib.Properties.Property_Boolean; 
  535.    Track_Visited_Links_Property : constant Glib.Properties.Property_Boolean; 
  536.    Use_Markup_Property : constant Glib.Properties.Property_Boolean; 
  537.    Use_Underline_Property : constant Glib.Properties.Property_Boolean; 
  538.    Width_Chars_Property : constant Glib.Properties.Property_Int; 
  539.    Wrap_Property : constant Glib.Properties.Property_Boolean; 
  540.  
  541.    ------------- 
  542.    -- Signals -- 
  543.    ------------- 
  544.    --  The following new signals are defined for this widget: 
  545.    -- 
  546.    --  "activate-current-link" 
  547.    --     procedure Handler (Self : access Gtk_Label_Record'Class); 
  548.    --  A <link linkend="keybinding-signals">keybinding signal</link> which 
  549.    --  gets emitted when the user activates a link in the label. Applications 
  550.    --  may also emit the signal with g_signal_emit_by_name if they need to 
  551.    --  control activation of URIs programmatically. The default bindings for 
  552.    --  this signal are all forms of the Enter key. 
  553.    -- 
  554.    --  "activate-link" 
  555.    --     function Handler 
  556.    --       (Self : access Gtk_Label_Record'Class; 
  557.    --        Uri  : UTF8_String) return Boolean; 
  558.    --    --  "uri": the URI that is activated 
  559.    --  The signal which gets emitted to activate a URI. Applications may 
  560.    --  connect to it to override the default behaviour, which is to call 
  561.    --  gtk_show_uri(). 
  562.    --  Returns True if the link has been activated 
  563.    -- 
  564.    --  "copy-clipboard" 
  565.    --     procedure Handler (Self : access Gtk_Label_Record'Class); 
  566.    --  The ::copy-clipboard signal is a <link 
  567.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  568.    --  to copy the selection to the clipboard. The default binding for this 
  569.    --  signal is Ctrl-c. 
  570.    -- 
  571.    --  "move-cursor" 
  572.    --     procedure Handler 
  573.    --       (Self             : access Gtk_Label_Record'Class; 
  574.    --        Step             : MovementStep; 
  575.    --        Count            : Gint; 
  576.    --        Extend_Selection : Boolean); 
  577.    --    --  "step": the granularity of the move, as a GtkMovementStep 
  578.    --    --  "count": the number of Step units to move 
  579.    --    --  "extend_selection": True if the move should extend the selection 
  580.    --  The ::move-cursor signal is a <link 
  581.    --  linkend="keybinding-signals">keybinding signal</link> which gets emitted 
  582.    --  when the user initiates a cursor movement. If the cursor is not visible 
  583.    --  in Entry, this signal causes the viewport to be moved instead. 
  584.    --  Applications should not connect to it, but may emit it with 
  585.    --  g_signal_emit_by_name if they need to control the cursor 
  586.    --  programmatically. The default bindings for this signal come in two 
  587.    --  variants, the variant with the Shift modifier extends the selection, the 
  588.    --  variant without the Shift modifer does not. There are too many key 
  589.    --  combinations to list them all here. <itemizedlist> <listitem>Arrow keys 
  590.    --  move by individual characters/lines</listitem> <listitem>Ctrl-arrow key 
  591.    --  combinations move by words/paragraphs</listitem> <listitem>Home/End keys 
  592.    --  move to the ends of the buffer</listitem> </itemizedlist> 
  593.    -- 
  594.    --  "populate-popup" 
  595.    --     procedure Handler 
  596.    --       (Self : access Gtk_Label_Record'Class; 
  597.    --        Menu : Gtk.Menu.Gtk_Menu); 
  598.    --    --  "menu": the menu that is being populated 
  599.    --  The ::populate-popup signal gets emitted before showing the context 
  600.    --  menu of the label. Note that only selectable labels have context menus. 
  601.    --  If you need to add items to the context menu, connect to this signal and 
  602.    --  append your menuitems to the Menu. 
  603.  
  604.    Signal_Activate_Current_Link : constant Glib.Signal_Name := "activate-current-link"; 
  605.    Signal_Activate_Link : constant Glib.Signal_Name := "activate-link"; 
  606.    Signal_Copy_Clipboard : constant Glib.Signal_Name := "copy-clipboard"; 
  607.    Signal_Move_Cursor : constant Glib.Signal_Name := "move-cursor"; 
  608.    Signal_Populate_Popup : constant Glib.Signal_Name := "populate-popup"; 
  609.  
  610. private 
  611.    Angle_Property : constant Glib.Properties.Property_Double := 
  612.      Glib.Properties.Build ("angle"); 
  613.    Cursor_Position_Property : constant Glib.Properties.Property_Int := 
  614.      Glib.Properties.Build ("cursor-position"); 
  615.    Justify_Property : constant Gtk.Enums.Property_Gtk_Justification := 
  616.      Gtk.Enums.Build ("justify"); 
  617.    Label_Property : constant Glib.Properties.Property_String := 
  618.      Glib.Properties.Build ("label"); 
  619.    Max_Width_Chars_Property : constant Glib.Properties.Property_Int := 
  620.      Glib.Properties.Build ("max-width-chars"); 
  621.    Mnemonic_Keyval_Property : constant Glib.Properties.Property_Uint := 
  622.      Glib.Properties.Build ("mnemonic-keyval"); 
  623.    Mnemonic_Widget_Property : constant Glib.Properties.Property_Object := 
  624.      Glib.Properties.Build ("mnemonic-widget"); 
  625.    Pattern_Property : constant Glib.Properties.Property_String := 
  626.      Glib.Properties.Build ("pattern"); 
  627.    Selectable_Property : constant Glib.Properties.Property_Boolean := 
  628.      Glib.Properties.Build ("selectable"); 
  629.    Selection_Bound_Property : constant Glib.Properties.Property_Int := 
  630.      Glib.Properties.Build ("selection-bound"); 
  631.    Single_Line_Mode_Property : constant Glib.Properties.Property_Boolean := 
  632.      Glib.Properties.Build ("single-line-mode"); 
  633.    Track_Visited_Links_Property : constant Glib.Properties.Property_Boolean := 
  634.      Glib.Properties.Build ("track-visited-links"); 
  635.    Use_Markup_Property : constant Glib.Properties.Property_Boolean := 
  636.      Glib.Properties.Build ("use-markup"); 
  637.    Use_Underline_Property : constant Glib.Properties.Property_Boolean := 
  638.      Glib.Properties.Build ("use-underline"); 
  639.    Width_Chars_Property : constant Glib.Properties.Property_Int := 
  640.      Glib.Properties.Build ("width-chars"); 
  641.    Wrap_Property : constant Glib.Properties.Property_Boolean := 
  642.      Glib.Properties.Build ("wrap"); 
  643. end Gtk.Label;