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. --  A GtkBuilder is an auxiliary object that reads textual descriptions of a 
  26. --  user interface and instantiates the described objects. To pass a 
  27. --  description to a GtkBuilder, call Gtk.Builder.Add_From_File or 
  28. --  Gtk.Builder.Add_From_String. These functions can be called multiple times; 
  29. --  the builder merges the content of all descriptions. 
  30. -- 
  31. --  A GtkBuilder holds a reference to all objects that it has constructed and 
  32. --  drops these references when it is finalized. This finalization can cause 
  33. --  the destruction of non-widget objects or widgets which are not contained in 
  34. --  a toplevel window. For toplevel windows constructed by a builder, it is the 
  35. --  responsibility of the user to call Gtk.Widget.Destroy to get rid of them 
  36. --  and all the widgets they contain. 
  37. -- 
  38. --  The functions Gtk.Builder.Get_Object and Gtk.Builder.Get_Objects can be 
  39. --  used to access the widgets in the interface by the names assigned to them 
  40. --  inside the UI description. Toplevel windows returned by these functions 
  41. --  will stay around until the user explicitly destroys them with 
  42. --  Gtk.Widget.Destroy. Other widgets will either be part of a larger hierarchy 
  43. --  constructed by the builder (in which case you should not have to worry 
  44. --  about their lifecycle), or without a parent, in which case they have to be 
  45. --  added to some container to make use of them. Non-widget objects need to be 
  46. --  reffed with g_object_ref to keep them beyond the lifespan of the builder. 
  47. -- 
  48. --  The function Gtk.Builder.Connect_Signals and variants thereof can be used 
  49. --  to connect handlers to the named signals in the description. 
  50. -- 
  51. --  == GtkBuilder UI Definitions == 
  52. -- 
  53. --  GtkBuilder parses textual descriptions of user interfaces which are 
  54. --  specified in an XML format which can be roughly described by the RELAX NG 
  55. --  schema below. We refer to these descriptions as 'GtkBuilder UI definitions' 
  56. --  or just 'UI definitions' if the context is clear. Do not confuse GtkBuilder 
  57. --  UI Definitions with <link linkend="XML-UI">GtkUIManager UI 
  58. --  Definitions</link>, which are more limited in scope. It is common to use 
  59. --  '.ui' as the filename extension for files containing GtkBuilder UI 
  60. --  definitions. 
  61. -- 
  62. --    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../gtk/gtkbuilder.rnc"> 
  63. --    <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> 
  64. --    </xi:include> 
  65. --  The toplevel element is <interface>. It optionally takes a "domain" 
  66. --  attribute, which will make the builder look for translated strings using 
  67. --  dgettext in the domain specified. This can also be done by calling 
  68. --  Gtk.Builder.Set_Translation_Domain on the builder. Objects are described by 
  69. --  <object> elements, which can contain <property> elements to set properties, 
  70. --  <signal> elements which connect signals to handlers, and <child> elements, 
  71. --  which describe child objects (most often widgets inside a container, but 
  72. --  also e.g. actions in an action group, or columns in a tree model). A 
  73. --  <child> element contains an <object> element which describes the child 
  74. --  object. The target toolkit version(s) are described by <requires> elements, 
  75. --  the "lib" attribute specifies the widget library in question (currently the 
  76. --  only supported value is "gtk+") and the "version" attribute specifies the 
  77. --  target version in the form "<major>.<minor>". The builder will error out if 
  78. --  the version requirements are not met. 
  79. -- 
  80. --  Typically, the specific kind of object represented by an <object> element 
  81. --  is specified by the "class" attribute. If the type has not been loaded yet, 
  82. --  GTK+ tries to find the <function>_get_type</function> from the class name 
  83. --  by applying heuristics. This works in most cases, but if necessary, it is 
  84. --  possible to specify the name of the <function>_get_type</function> 
  85. --  explictly with the "type-func" attribute. As a special case, GtkBuilder 
  86. --  allows to use an object that has been constructed by a 
  87. --  Gtk.UI_Manager.Gtk_UI_Manager in another part of the UI definition by 
  88. --  specifying the id of the Gtk.UI_Manager.Gtk_UI_Manager in the "constructor" 
  89. --  attribute and the name of the object in the "id" attribute. 
  90. -- 
  91. --  Objects must be given a name with the "id" attribute, which allows the 
  92. --  application to retrieve them from the builder with Gtk.Builder.Get_Object. 
  93. --  An id is also necessary to use the object as property value in other parts 
  94. --  of the UI definition. 
  95. -- 
  96. --  Note: 
  97. -- 
  98. --  Prior to 2.20, GtkBuilder was setting the "name" property of constructed 
  99. --  widgets to the "id" attribute. In GTK+ 2.20 or newer, you have to use 
  100. --  Gtk.Buildable.Get_Name instead of Gtk.Widget.Get_Name to obtain the "id", 
  101. --  or set the "name" property in your UI definition. 
  102. -- 
  103. --  Setting properties of objects is pretty straightforward with the 
  104. --  <property> element: the "name" attribute specifies the name of the 
  105. --  property, and the content of the element specifies the value. If the 
  106. --  "translatable" attribute is set to a true value, GTK+ uses gettext (or 
  107. --  dgettext if the builder has a translation domain set) to find a translation 
  108. --  for the value. This happens before the value is parsed, so it can be used 
  109. --  for properties of any type, but it is probably most useful for string 
  110. --  properties. It is also possible to specify a context to disambiguate short 
  111. --  strings, and comments which may help the translators. 
  112. -- 
  113. --  GtkBuilder can parse textual representations for the most common property 
  114. --  types: characters, strings, integers, floating-point numbers, booleans 
  115. --  (strings like "TRUE", "t", "yes", "y", "1" are interpreted as True, strings 
  116. --  like "FALSE, "f", "no", "n", "0" are interpreted as False), enumerations 
  117. --  (can be specified by their name, nick or integer value), flags (can be 
  118. --  specified by their name, nick, integer value, optionally combined with "|", 
  119. --  e.g. "GTK_VISIBLE|GTK_REALIZED") and colors (in a format understood by 
  120. --  gdk_color_parse). Pixbufs can be specified as a filename of an image file 
  121. --  to load. Objects can be referred to by their name and by default refer to 
  122. --  objects declared in the local xml fragment and objects exposed via 
  123. --  Gtk.Builder.Expose_Object. 
  124. -- 
  125. --  In general, GtkBuilder allows forward references to objects &mdash 
  126. --  declared in the local xml; an object doesn't have to be constructed before 
  127. --  it can be referred to. The exception to this rule is that an object has to 
  128. --  be constructed before it can be used as the value of a construct-only 
  129. --  property. 
  130. -- 
  131. --  Signal handlers are set up with the <signal> element. The "name" attribute 
  132. --  specifies the name of the signal, and the "handler" attribute specifies the 
  133. --  function to connect to the signal. By default, GTK+ tries to find the 
  134. --  handler using g_module_symbol, but this can be changed by passing a custom 
  135. --  Gtk_Builder_Connect_Func to Gtk.Builder.Connect_Signals_Full. The remaining 
  136. --  attributes, "after", "swapped" and "object", have the same meaning as the 
  137. --  corresponding parameters of the g_signal_connect_object or 
  138. --  g_signal_connect_data functions. A "last_modification_time" attribute is 
  139. --  also allowed, but it does not have a meaning to the builder. 
  140. -- 
  141. --  Sometimes it is necessary to refer to widgets which have implicitly been 
  142. --  constructed by GTK+ as part of a composite widget, to set properties on 
  143. --  them or to add further children (e.g. the Vbox of a Gtk.Dialog.Gtk_Dialog). 
  144. --  This can be achieved by setting the "internal-child" propery of the <child> 
  145. --  element to a true value. Note that GtkBuilder still requires an <object> 
  146. --  element for the internal child, even if it has already been constructed. 
  147. -- 
  148. --  A number of widgets have different places where a child can be added (e.g. 
  149. --  tabs vs. page content in notebooks). This can be reflected in a UI 
  150. --  definition by specifying the "type" attribute on a <child>. The possible 
  151. --  values for the "type" attribute are described in the sections describing 
  152. --  the widget-specific portions of UI definitions. 
  153. -- 
  154. --  == A GtkBuilder UI Definition == 
  155. -- 
  156. --    <interface> 
  157. --    <object class="GtkDialog" id="dialog1"> 
  158. --    <child internal-child="vbox"> 
  159. --    <object class="GtkVBox" id="vbox1"> 
  160. --    <property name="border-width">10</property> 
  161. --    <child internal-child="action_area"> 
  162. --    <object class="GtkHButtonBox" id="hbuttonbox1"> 
  163. --    <property name="border-width">20</property> 
  164. --    <child> 
  165. --    <object class="GtkButton" id="ok_button"> 
  166. --    <property name="label">gtk-ok</property> 
  167. --    <property name="use-stock">TRUE</property> 
  168. --    <signal name="clicked" handler="ok_button_clicked"/> 
  169. --    </object> 
  170. --    </child> 
  171. --    </object> 
  172. --    </child> 
  173. --    </object> 
  174. --    </child> 
  175. --    </object> 
  176. --    </interface> 
  177. --  Beyond this general structure, several object classes define their own XML 
  178. --  DTD fragments for filling in the ANY placeholders in the DTD above. Note 
  179. --  that a custom element in a <child> element gets parsed by the custom tag 
  180. --  handler of the parent object, while a custom element in an <object> element 
  181. --  gets parsed by the custom tag handler of the object. 
  182. -- 
  183. --  These XML fragments are explained in the documentation of the respective 
  184. --  objects, see <link linkend="GtkWidget-BUILDER-UI">GtkWidget</link>, <link 
  185. --  linkend="GtkLabel-BUILDER-UI">GtkLabel</link>, <link 
  186. --  linkend="GtkWindow-BUILDER-UI">GtkWindow</link>, <link 
  187. --  linkend="GtkContainer-BUILDER-UI">GtkContainer</link>, <link 
  188. --  linkend="GtkDialog-BUILDER-UI">GtkDialog</link>, <link 
  189. --  linkend="GtkCellLayout-BUILDER-UI">GtkCellLayout</link>, <link 
  190. --  linkend="GtkColorSelectionDialog-BUILDER-UI">GtkColorSelectionDialog</link>, 
  191. --  <link 
  192. --  linkend="GtkFontSelectionDialog-BUILDER-UI">GtkFontSelectionDialog</link>, 
  193. --  <link linkend="GtkExpander-BUILDER-UI">GtkExpander</link>, <link 
  194. --  linkend="GtkFrame-BUILDER-UI">GtkFrame</link>, <link 
  195. --  linkend="GtkListStore-BUILDER-UI">GtkListStore</link>, <link 
  196. --  linkend="GtkTreeStore-BUILDER-UI">GtkTreeStore</link>, <link 
  197. --  linkend="GtkNotebook-BUILDER-UI">GtkNotebook</link>, <link 
  198. --  linkend="GtkSizeGroup-BUILDER-UI">GtkSizeGroup</link>, <link 
  199. --  linkend="GtkTreeView-BUILDER-UI">GtkTreeView</link>, <link 
  200. --  linkend="GtkUIManager-BUILDER-UI">GtkUIManager</link>, <link 
  201. --  linkend="GtkActionGroup-BUILDER-UI">GtkActionGroup</link>. <link 
  202. --  linkend="GtkMenuItem-BUILDER-UI">GtkMenuItem</link>, <link 
  203. --  linkend="GtkMenuToolButton-BUILDER-UI">GtkMenuToolButton</link>, <link 
  204. --  linkend="GtkAssistant-BUILDER-UI">GtkAssistant</link>, <link 
  205. --  linkend="GtkScale-BUILDER-UI">GtkScale</link>, <link 
  206. --  linkend="GtkComboBoxText-BUILDER-UI">GtkComboBoxText</link>, <link 
  207. --  linkend="GtkRecentFilter-BUILDER-UI">GtkRecentFilter</link>, <link 
  208. --  linkend="GtkFileFilter-BUILDER-UI">GtkFileFilter</link>, <link 
  209. --  linkend="GtkTextTagTable-BUILDER-UI">GtkTextTagTable</link>. 
  210. -- 
  211. --  == Embedding other XML == 
  212. -- 
  213. --  Apart from the language for UI descriptions that has been explained in the 
  214. --  previous section, GtkBuilder can also parse XML fragments of <link 
  215. --  linkend="gio-GMenu-Markup">GMenu markup</link>. The resulting 
  216. --  Glib.Menu.Gmenu object and its named submenus are available via 
  217. --  Gtk.Builder.Get_Object like other constructed objects. 
  218. -- 
  219. -- 
  220. --  </description> 
  221. pragma Ada_2005; 
  222.  
  223. pragma Warnings (Off, "*is already use-visible*"); 
  224. with GNAT.Strings;    use GNAT.Strings; 
  225. with Glib;            use Glib; 
  226. with Glib.Error;      use Glib.Error; 
  227. with Glib.Object;     use Glib.Object; 
  228. with Glib.Properties; use Glib.Properties; 
  229. with Glib.Values;     use Glib.Values; 
  230.  
  231. package Gtk.Builder is 
  232.  
  233.    type Gtk_Builder_Record is new GObject_Record with null record; 
  234.    type Gtk_Builder is access all Gtk_Builder_Record'Class; 
  235.  
  236.    --------------- 
  237.    -- Callbacks -- 
  238.    --------------- 
  239.  
  240.    type Gtk_Builder_Connect_Func is access procedure 
  241.      (Builder        : not null access Gtk_Builder_Record'Class; 
  242.       Object         : not null access Glib.Object.GObject_Record'Class; 
  243.       Signal_Name    : UTF8_String; 
  244.       Handler_Name   : UTF8_String; 
  245.       Connect_Object : access Glib.Object.GObject_Record'Class; 
  246.       Flags          : Glib.G_Connect_Flags); 
  247.    --  This is the signature of a function used to connect signals. It is used 
  248.    --  by the Gtk.Builder.Connect_Signals and Gtk.Builder.Connect_Signals_Full 
  249.    --  methods. It is mainly intended for interpreted language bindings, but 
  250.    --  could be useful where the programmer wants more control over the signal 
  251.    --  connection process. Note that this function can only be called once, 
  252.    --  subsequent calls will do nothing. 
  253.    --  Since: gtk+ 2.12 
  254.    --  "builder": a Gtk.Builder.Gtk_Builder 
  255.    --  "object": object to connect a signal to 
  256.    --  "signal_name": name of the signal 
  257.    --  "handler_name": name of the handler 
  258.    --  "connect_object": a Glib.Object.GObject, if non-null, use 
  259.    --  g_signal_connect_object 
  260.    --  "flags": Glib.G_Connect_Flags to use 
  261.  
  262.    ------------------ 
  263.    -- Constructors -- 
  264.    ------------------ 
  265.  
  266.    procedure Gtk_New (Builder : out Gtk_Builder); 
  267.    procedure Initialize (Builder : not null access Gtk_Builder_Record'Class); 
  268.    --  Creates a new builder object. 
  269.    --  Since: gtk+ 2.12 
  270.  
  271.    function Gtk_Builder_New return Gtk_Builder; 
  272.    --  Creates a new builder object. 
  273.    --  Since: gtk+ 2.12 
  274.  
  275.    function Get_Type return Glib.GType; 
  276.    pragma Import (C, Get_Type, "gtk_builder_get_type"); 
  277.  
  278.    ------------- 
  279.    -- Methods -- 
  280.    ------------- 
  281.  
  282.    function Add_From_File 
  283.       (Builder  : not null access Gtk_Builder_Record; 
  284.        Filename : UTF8_String; 
  285.        Error    : access Glib.Error.GError) return Guint; 
  286.    --  Parses a file containing a <link linkend="BUILDER-UI">GtkBuilder UI 
  287.    --  definition</link> and merges it with the current contents of Builder. 
  288.    --  Upon errors 0 will be returned and Error will be assigned a 
  289.    --  Gerror.Gerror from the GTK_BUILDER_ERROR, G_MARKUP_ERROR or G_FILE_ERROR 
  290.    --  domain. 
  291.    --  Since: gtk+ 2.12 
  292.    --  "filename": the name of the file to parse 
  293.  
  294.    function Add_From_Resource 
  295.       (Builder       : not null access Gtk_Builder_Record; 
  296.        Resource_Path : UTF8_String; 
  297.        Error         : access Glib.Error.GError) return Guint; 
  298.    --  Parses a resource file containing a <link 
  299.    --  linkend="BUILDER-UI">GtkBuilder UI definition</link> and merges it with 
  300.    --  the current contents of Builder. 
  301.    --  Upon errors 0 will be returned and Error will be assigned a 
  302.    --  Gerror.Gerror from the GTK_BUILDER_ERROR, G_MARKUP_ERROR or 
  303.    --  G_RESOURCE_ERROR domain. 
  304.    --  Since: gtk+ 3.4 
  305.    --  "resource_path": the path of the resource file to parse 
  306.  
  307.    function Add_From_String 
  308.       (Builder : not null access Gtk_Builder_Record; 
  309.        Buffer  : UTF8_String; 
  310.        Error   : access Glib.Error.GError) return Guint; 
  311.    --  Parses a string containing a <link linkend="BUILDER-UI">GtkBuilder UI 
  312.    --  definition</link> and merges it with the current contents of Builder. 
  313.    --  Upon errors 0 will be returned and Error will be assigned a 
  314.    --  Gerror.Gerror from the GTK_BUILDER_ERROR or G_MARKUP_ERROR domain. 
  315.    --  Since: gtk+ 2.12 
  316.    --  "buffer": the string to parse 
  317.  
  318.    function Add_Objects_From_File 
  319.       (Builder    : not null access Gtk_Builder_Record; 
  320.        Filename   : UTF8_String; 
  321.        Object_Ids : GNAT.Strings.String_List; 
  322.        Error      : access Glib.Error.GError) return Guint; 
  323.    --  Parses a file containing a <link linkend="BUILDER-UI">GtkBuilder UI 
  324.    --  definition</link> building only the requested objects and merges them 
  325.    --  with the current contents of Builder. 
  326.    --  Upon errors 0 will be returned and Error will be assigned a 
  327.    --  Gerror.Gerror from the GTK_BUILDER_ERROR, G_MARKUP_ERROR or G_FILE_ERROR 
  328.    --  domain. 
  329.    --  Note: 
  330.    --  If you are adding an object that depends on an object that is not its 
  331.    --  child (for instance a Gtk.Tree_View.Gtk_Tree_View that depends on its 
  332.    --  Gtk.Tree_Model.Gtk_Tree_Model), you have to explicitely list all of them 
  333.    --  in Object_Ids. 
  334.    --  Since: gtk+ 2.14 
  335.    --  "filename": the name of the file to parse 
  336.    --  "object_ids": nul-terminated array of objects to build 
  337.  
  338.    function Add_Objects_From_Resource 
  339.       (Builder       : not null access Gtk_Builder_Record; 
  340.        Resource_Path : UTF8_String; 
  341.        Object_Ids    : GNAT.Strings.String_List; 
  342.        Error         : access Glib.Error.GError) return Guint; 
  343.    --  Parses a resource file containing a <link 
  344.    --  linkend="BUILDER-UI">GtkBuilder UI definition</link> building only the 
  345.    --  requested objects and merges them with the current contents of Builder. 
  346.    --  Upon errors 0 will be returned and Error will be assigned a 
  347.    --  Gerror.Gerror from the GTK_BUILDER_ERROR, G_MARKUP_ERROR or 
  348.    --  G_RESOURCE_ERROR domain. 
  349.    --  Note: 
  350.    --  If you are adding an object that depends on an object that is not its 
  351.    --  child (for instance a Gtk.Tree_View.Gtk_Tree_View that depends on its 
  352.    --  Gtk.Tree_Model.Gtk_Tree_Model), you have to explicitely list all of them 
  353.    --  in Object_Ids. 
  354.    --  Since: gtk+ 3.4 
  355.    --  "resource_path": the path of the resource file to parse 
  356.    --  "object_ids": nul-terminated array of objects to build 
  357.  
  358.    function Add_Objects_From_String 
  359.       (Builder    : not null access Gtk_Builder_Record; 
  360.        Buffer     : UTF8_String; 
  361.        Length     : Gsize; 
  362.        Object_Ids : GNAT.Strings.String_List; 
  363.        Error      : access Glib.Error.GError) return Guint; 
  364.    --  Parses a string containing a <link linkend="BUILDER-UI">GtkBuilder UI 
  365.    --  definition</link> building only the requested objects and merges them 
  366.    --  with the current contents of Builder. 
  367.    --  Upon errors 0 will be returned and Error will be assigned a 
  368.    --  Gerror.Gerror from the GTK_BUILDER_ERROR or G_MARKUP_ERROR domain. 
  369.    --  Note: 
  370.    --  If you are adding an object that depends on an object that is not its 
  371.    --  child (for instance a Gtk.Tree_View.Gtk_Tree_View that depends on its 
  372.    --  Gtk.Tree_Model.Gtk_Tree_Model), you have to explicitely list all of them 
  373.    --  in Object_Ids. 
  374.    --  Since: gtk+ 2.14 
  375.    --  "buffer": the string to parse 
  376.    --  "length": the length of Buffer (may be -1 if Buffer is nul-terminated) 
  377.    --  "object_ids": nul-terminated array of objects to build 
  378.  
  379.    procedure Connect_Signals 
  380.       (Builder   : not null access Gtk_Builder_Record; 
  381.        User_Data : System.Address); 
  382.    --  This method is a simpler variation of Gtk.Builder.Connect_Signals_Full. 
  383.    --  It uses GModule's introspective features (by opening the module null) to 
  384.    --  look at the application's symbol table. From here it tries to match the 
  385.    --  signal handler names given in the interface description with symbols in 
  386.    --  the application and connects the signals. Note that this function can 
  387.    --  only be called once, subsequent calls will do nothing. 
  388.    --  Note that this function will not work correctly if GModule is not 
  389.    --  supported on the platform. 
  390.    --  When compiling applications for Windows, you must declare signal 
  391.    --  callbacks with G_MODULE_EXPORT, or they will not be put in the symbol 
  392.    --  table. On Linux and Unices, this is not necessary; applications should 
  393.    --  instead be compiled with the -Wl,--export-dynamic CFLAGS, and linked 
  394.    --  against gmodule-export-2.0. 
  395.    --  Since: gtk+ 2.12 
  396.    --  "user_data": a pointer to a structure sent in as user data to all 
  397.    --  signals 
  398.  
  399.    procedure Connect_Signals_Full 
  400.       (Builder : not null access Gtk_Builder_Record; 
  401.        Func    : Gtk_Builder_Connect_Func); 
  402.    --  This function can be thought of the interpreted language binding 
  403.    --  version of Gtk.Builder.Connect_Signals, except that it does not require 
  404.    --  GModule to function correctly. 
  405.    --  Since: gtk+ 2.12 
  406.    --  "func": the function used to connect the signals 
  407.  
  408.    generic 
  409.       type User_Data_Type (<>) is private; 
  410.       with procedure Destroy (Data : in out User_Data_Type) is null; 
  411.    package Connect_Signals_Full_User_Data is 
  412.  
  413.       type Gtk_Builder_Connect_Func is access procedure 
  414.         (Builder        : not null access Gtk.Builder.Gtk_Builder_Record'Class; 
  415.          Object         : not null access Glib.Object.GObject_Record'Class; 
  416.          Signal_Name    : UTF8_String; 
  417.          Handler_Name   : UTF8_String; 
  418.          Connect_Object : access Glib.Object.GObject_Record'Class; 
  419.          Flags          : Glib.G_Connect_Flags; 
  420.          User_Data      : User_Data_Type); 
  421.       --  This is the signature of a function used to connect signals. It is used 
  422.       --  by the Gtk.Builder.Connect_Signals and Gtk.Builder.Connect_Signals_Full 
  423.       --  methods. It is mainly intended for interpreted language bindings, but 
  424.       --  could be useful where the programmer wants more control over the signal 
  425.       --  connection process. Note that this function can only be called once, 
  426.       --  subsequent calls will do nothing. 
  427.       --  Since: gtk+ 2.12 
  428.       --  "builder": a Gtk.Builder.Gtk_Builder 
  429.       --  "object": object to connect a signal to 
  430.       --  "signal_name": name of the signal 
  431.       --  "handler_name": name of the handler 
  432.       --  "connect_object": a Glib.Object.GObject, if non-null, use 
  433.       --  g_signal_connect_object 
  434.       --  "flags": Glib.G_Connect_Flags to use 
  435.       --  "user_data": user data 
  436.  
  437.       procedure Connect_Signals_Full 
  438.          (Builder   : not null access Gtk.Builder.Gtk_Builder_Record'Class; 
  439.           Func      : Gtk_Builder_Connect_Func; 
  440.           User_Data : User_Data_Type); 
  441.       --  This function can be thought of the interpreted language binding 
  442.       --  version of Gtk.Builder.Connect_Signals, except that it does not 
  443.       --  require GModule to function correctly. 
  444.       --  Since: gtk+ 2.12 
  445.       --  "func": the function used to connect the signals 
  446.       --  "user_data": arbitrary data that will be passed to the connection 
  447.       --  function 
  448.  
  449.    end Connect_Signals_Full_User_Data; 
  450.  
  451.    procedure Expose_Object 
  452.       (Builder : not null access Gtk_Builder_Record; 
  453.        Name    : UTF8_String; 
  454.        Object  : not null access Glib.Object.GObject_Record'Class); 
  455.    --  Add Object to the Builder object pool so it can be referenced just like 
  456.    --  any other object built by builder. 
  457.    --  Since: gtk+ 3.8 
  458.    --  "name": the name of the object exposed to the builder 
  459.    --  "object": the object to expose 
  460.  
  461.    function Get_Object 
  462.       (Builder : not null access Gtk_Builder_Record; 
  463.        Name    : UTF8_String) return Glib.Object.GObject; 
  464.    --  Gets the object named Name. Note that this function does not increment 
  465.    --  the reference count of the returned object. 
  466.    --  Since: gtk+ 2.12 
  467.    --  "name": name of object to get 
  468.  
  469.    function Get_Objects 
  470.       (Builder : not null access Gtk_Builder_Record) 
  471.        return Glib.Object.Object_List.GSlist; 
  472.    --  Gets all objects that have been constructed by Builder. Note that this 
  473.    --  function does not increment the reference counts of the returned 
  474.    --  objects. 
  475.    --  Since: gtk+ 2.12 
  476.  
  477.    function Get_Translation_Domain 
  478.       (Builder : not null access Gtk_Builder_Record) return UTF8_String; 
  479.    --  Gets the translation domain of Builder. 
  480.    --  Since: gtk+ 2.12 
  481.  
  482.    procedure Set_Translation_Domain 
  483.       (Builder : not null access Gtk_Builder_Record; 
  484.        Domain  : UTF8_String := ""); 
  485.    --  Sets the translation domain of Builder. See 
  486.    --  Gtk.Builder.Gtk_Builder:translation-domain. 
  487.    --  Since: gtk+ 2.12 
  488.    --  "domain": the translation domain or null 
  489.  
  490.    function Get_Type_From_Name 
  491.       (Builder   : not null access Gtk_Builder_Record; 
  492.        Type_Name : UTF8_String) return GType; 
  493.    --  Looks up a type by name, using the virtual function that 
  494.    --  Gtk.Builder.Gtk_Builder has for that purpose. This is mainly used when 
  495.    --  implementing the Gtk.Buildable.Gtk_Buildable interface on a type. 
  496.    --  Since: gtk+ 2.12 
  497.    --  "type_name": type name to lookup 
  498.  
  499.    procedure Value_From_String 
  500.       (Builder : not null access Gtk_Builder_Record; 
  501.        Pspec   : in out Glib.Param_Spec; 
  502.        String  : UTF8_String; 
  503.        Value   : out Glib.Values.GValue; 
  504.        Success : out Boolean); 
  505.    --  This function demarshals a value from a string. This function calls 
  506.    --  g_value_init on the Value argument, so it need not be initialised 
  507.    --  beforehand. 
  508.    --  This function can handle char, uchar, boolean, int, uint, long, ulong, 
  509.    --  enum, flags, float, double, string, Gdk.Color.Gdk_Color, 
  510.    --  Gdk.RGBA.Gdk_RGBA and Gtk.Adjustment.Gtk_Adjustment type values. Support 
  511.    --  for Gtk.Widget.Gtk_Widget type values is still to come. 
  512.    --  Upon errors False will be returned and Error will be assigned a 
  513.    --  Gerror.Gerror from the GTK_BUILDER_ERROR domain. 
  514.    --  Since: gtk+ 2.12 
  515.    --  "pspec": the Glib.Param_Spec for the property 
  516.    --  "string": the string representation of the value 
  517.    --  "value": the Glib.Values.GValue to store the result in 
  518.  
  519.    function Value_From_String_Type 
  520.       (Builder  : not null access Gtk_Builder_Record; 
  521.        The_Type : GType; 
  522.        String   : UTF8_String; 
  523.        Value    : access Glib.Values.GValue) return Boolean; 
  524.    --  Like Gtk.Builder.Value_From_String, this function demarshals a value 
  525.    --  from a string, but takes a GType instead of Glib.Param_Spec. This 
  526.    --  function calls g_value_init on the Value argument, so it need not be 
  527.    --  initialised beforehand. 
  528.    --  Upon errors False will be returned and Error will be assigned a 
  529.    --  Gerror.Gerror from the GTK_BUILDER_ERROR domain. 
  530.    --  Since: gtk+ 2.12 
  531.    --  "type": the GType of the value 
  532.    --  "string": the string representation of the value 
  533.    --  "value": the Glib.Values.GValue to store the result in 
  534.  
  535.    ---------------- 
  536.    -- Properties -- 
  537.    ---------------- 
  538.    --  The following properties are defined for this widget. See 
  539.    --  Glib.Properties for more information on properties) 
  540.  
  541.    Translation_Domain_Property : constant Glib.Properties.Property_String; 
  542.    --  The translation domain used when translating property values that have 
  543.    --  been marked as translatable in interface descriptions. If the 
  544.    --  translation domain is null, Gtk.Builder.Gtk_Builder uses gettext, 
  545.    --  otherwise g_dgettext. 
  546.  
  547. private 
  548.    Translation_Domain_Property : constant Glib.Properties.Property_String := 
  549.      Glib.Properties.Build ("translation-domain"); 
  550. end Gtk.Builder;