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. --  Gtk.Application.Gtk_Application is a class that handles many important 
  26. --  aspects of a GTK+ application in a convenient fashion, without enforcing a 
  27. --  one-size-fits-all application model. 
  28. -- 
  29. --  Currently, GtkApplication handles GTK+ initialization, application 
  30. --  uniqueness, session management, provides some basic scriptability and 
  31. --  desktop shell integration by exporting actions and menus and manages a list 
  32. --  of toplevel windows whose life-cycle is automatically tied to the 
  33. --  life-cycle of your application. 
  34. -- 
  35. --  While GtkApplication works fine with plain Gtk_Windows, it is recommended 
  36. --  to use it together with Gtk.Application_Window.Gtk_Application_Window. 
  37. -- 
  38. --  When GDK threads are enabled, GtkApplication will acquire the GDK lock 
  39. --  when invoking actions that arrive from other processes. The GDK lock is not 
  40. --  touched for local action invocations. In order to have actions invoked in a 
  41. --  predictable context it is therefore recommended that the GDK lock be held 
  42. --  while invoking actions locally with Glib.Action_Group.Activate_Action. The 
  43. --  same applies to actions associated with 
  44. --  Gtk.Application_Window.Gtk_Application_Window and to the 'activate' and 
  45. --  'open' Glib.Application.Gapplication methods. 
  46. -- 
  47. --  To set an application menu for a GtkApplication, use 
  48. --  Gtk.Application.Set_App_Menu. The Glib.Menu_Model.Gmenu_Model that this 
  49. --  function expects is usually constructed using Gtk.Builder.Gtk_Builder, as 
  50. --  seen in the following example. To specify a menubar that will be shown by 
  51. --  Gtk_Application_Windows, use Gtk.Application.Set_Menubar. Use the base 
  52. --  Glib.Action_Map.Gaction_Map interface to add actions, to respond to the 
  53. --  user selecting these menu items. 
  54. -- 
  55. --  GTK+ displays these menus as expected, depending on the platform the 
  56. --  application is running on. 
  57. -- 
  58. --  <figure label="Menu integration in OS X"> <graphic 
  59. --  fileref="bloatpad-osx.png" format="PNG"/> </figure> 
  60. --  <figure label="Menu integration in GNOME"> <graphic 
  61. --  fileref="bloatpad-gnome.png" format="PNG"/> </figure> 
  62. --  <figure label="Menu integration in Xfce"> <graphic 
  63. --  fileref="bloatpad-xfce.png" format="PNG"/> </figure> 
  64. --  <example id="gtkapplication"> 
  65. --  == A simple application == 
  66. -- 
  67. --    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../examples/bloatpad.c"> 
  68. --    <xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback> 
  69. --    </xi:include> 
  70. --  GtkApplication optionally registers with a session manager of the users 
  71. --  session (if you set the Gtk.Application.Gtk_Application:register-session 
  72. --  property) and offers various functionality related to the session 
  73. --  life-cycle. 
  74. -- 
  75. --  An application can block various ways to end the session with the 
  76. --  Gtk.Application.Inhibit function. Typical use cases for this kind of 
  77. --  inhibiting are long-running, uninterruptible operations, such as burning a 
  78. --  CD or performing a disk backup. The session manager may not honor the 
  79. --  inhibitor, but it can be expected to inform the user about the negative 
  80. --  consequences of ending the session while inhibitors are present. 
  81. -- 
  82. --  </description> 
  83. pragma Ada_2005; 
  84.  
  85. pragma Warnings (Off, "*is already use-visible*"); 
  86. with GNAT.Strings;            use GNAT.Strings; 
  87. with Glib;                    use Glib; 
  88. with Glib.Action;             use Glib.Action; 
  89. with Glib.Action_Group;       use Glib.Action_Group; 
  90. with Glib.Action_Map;         use Glib.Action_Map; 
  91. with Glib.Application;        use Glib.Application; 
  92. with Glib.Generic_Properties; use Glib.Generic_Properties; 
  93. with Glib.Menu_Model;         use Glib.Menu_Model; 
  94. with Glib.Object;             use Glib.Object; 
  95. with Glib.Properties;         use Glib.Properties; 
  96. with Glib.Types;              use Glib.Types; 
  97. with Glib.Variant;            use Glib.Variant; 
  98. with Gtk.Widget;              use Gtk.Widget; 
  99. with Gtk.Window;              use Gtk.Window; 
  100.  
  101. package Gtk.Application is 
  102.  
  103.    type Gtk_Application_Record is new Gapplication_Record with null record; 
  104.    type Gtk_Application is access all Gtk_Application_Record'Class; 
  105.  
  106.    type Gtk_Application_Inhibit_Flags is mod 2 ** Integer'Size; 
  107.    pragma Convention (C, Gtk_Application_Inhibit_Flags); 
  108.    --  Types of user actions that may be blocked by Gtk.Application.Inhibit. 
  109.  
  110.    Application_Inhibit_Logout : constant Gtk_Application_Inhibit_Flags := 1; 
  111.    Application_Inhibit_Switch : constant Gtk_Application_Inhibit_Flags := 2; 
  112.    Application_Inhibit_Suspend : constant Gtk_Application_Inhibit_Flags := 4; 
  113.    Application_Inhibit_Idle : constant Gtk_Application_Inhibit_Flags := 8; 
  114.  
  115.    ---------------------------- 
  116.    -- Enumeration Properties -- 
  117.    ---------------------------- 
  118.  
  119.    package Gtk_Application_Inhibit_Flags_Properties is 
  120.       new Generic_Internal_Discrete_Property (Gtk_Application_Inhibit_Flags); 
  121.    type Property_Gtk_Application_Inhibit_Flags is new Gtk_Application_Inhibit_Flags_Properties.Property; 
  122.  
  123.    ------------------ 
  124.    -- Constructors -- 
  125.    ------------------ 
  126.  
  127.    procedure Gtk_New 
  128.       (Self           : out Gtk_Application; 
  129.        Application_Id : UTF8_String := ""; 
  130.        Flags          : Glib.Application.GApplication_Flags); 
  131.    procedure Initialize 
  132.       (Self           : not null access Gtk_Application_Record'Class; 
  133.        Application_Id : UTF8_String := ""; 
  134.        Flags          : Glib.Application.GApplication_Flags); 
  135.    --  Creates a new Gtk.Application.Gtk_Application instance. 
  136.    --  When using Gtk.Application.Gtk_Application, it is not necessary to call 
  137.    --  gtk_init manually. It is called as soon as the application gets 
  138.    --  registered as the primary instance. 
  139.    --  Concretely, gtk_init is called in the default handler for the 
  140.    --  Glib.Application.Gapplication::startup signal. Therefore, 
  141.    --  Gtk.Application.Gtk_Application subclasses should chain up in their 
  142.    --  Glib.Application.Gapplication:startup handler before using any GTK+ API. 
  143.    --  Note that commandline arguments are not passed to gtk_init. All GTK+ 
  144.    --  functionality that is available via commandline arguments can also be 
  145.    --  achieved by setting suitable environment variables such as 
  146.    --  <envar>G_DEBUG</envar>, so this should not be a big problem. If you 
  147.    --  absolutely must support GTK+ commandline arguments, you can explicitly 
  148.    --  call gtk_init before creating the application instance. 
  149.    --  If non-null, the application ID must be valid. See 
  150.    --  Glib.Application.Id_Is_Valid. 
  151.    --  If no application ID is given then some features (most notably 
  152.    --  application uniqueness) will be disabled. A null application ID is only 
  153.    --  allowed with GTK+ 3.6 or later. 
  154.    --  Since: gtk+ 3.0 
  155.    --  "application_id": The application ID. 
  156.    --  "flags": the application flags 
  157.  
  158.    function Gtk_Application_New 
  159.       (Application_Id : UTF8_String := ""; 
  160.        Flags          : Glib.Application.GApplication_Flags) 
  161.        return Gtk_Application; 
  162.    --  Creates a new Gtk.Application.Gtk_Application instance. 
  163.    --  When using Gtk.Application.Gtk_Application, it is not necessary to call 
  164.    --  gtk_init manually. It is called as soon as the application gets 
  165.    --  registered as the primary instance. 
  166.    --  Concretely, gtk_init is called in the default handler for the 
  167.    --  Glib.Application.Gapplication::startup signal. Therefore, 
  168.    --  Gtk.Application.Gtk_Application subclasses should chain up in their 
  169.    --  Glib.Application.Gapplication:startup handler before using any GTK+ API. 
  170.    --  Note that commandline arguments are not passed to gtk_init. All GTK+ 
  171.    --  functionality that is available via commandline arguments can also be 
  172.    --  achieved by setting suitable environment variables such as 
  173.    --  <envar>G_DEBUG</envar>, so this should not be a big problem. If you 
  174.    --  absolutely must support GTK+ commandline arguments, you can explicitly 
  175.    --  call gtk_init before creating the application instance. 
  176.    --  If non-null, the application ID must be valid. See 
  177.    --  Glib.Application.Id_Is_Valid. 
  178.    --  If no application ID is given then some features (most notably 
  179.    --  application uniqueness) will be disabled. A null application ID is only 
  180.    --  allowed with GTK+ 3.6 or later. 
  181.    --  Since: gtk+ 3.0 
  182.    --  "application_id": The application ID. 
  183.    --  "flags": the application flags 
  184.  
  185.    function Get_Type return Glib.GType; 
  186.    pragma Import (C, Get_Type, "gtk_application_get_type"); 
  187.  
  188.    ------------- 
  189.    -- Methods -- 
  190.    ------------- 
  191.  
  192.    procedure Add_Accelerator 
  193.       (Self        : not null access Gtk_Application_Record; 
  194.        Accelerator : UTF8_String; 
  195.        Action_Name : UTF8_String; 
  196.        Parameter   : Glib.Variant.Gvariant); 
  197.    --  Installs an accelerator that will cause the named action to be 
  198.    --  activated when the key combination specificed by Accelerator is pressed. 
  199.    --  Accelerator must be a string that can be parsed by 
  200.    --  Gtk.Accel_Group.Accelerator_Parse, e.g. "<Primary>q" or 
  201.    --  "<Control><Alt>p". 
  202.    --  Action_Name must be the name of an action as it would be used in the 
  203.    --  app menu, i.e. actions that have been added to the application are 
  204.    --  referred to with an "app." prefix, and window-specific actions with a 
  205.    --  "win." prefix. 
  206.    --  GtkApplication also extracts accelerators out of 'accel' attributes in 
  207.    --  the GMenu_Models passed to Gtk.Application.Set_App_Menu and 
  208.    --  Gtk.Application.Set_Menubar, which is usually more convenient than 
  209.    --  calling this function for each accelerator. 
  210.    --  Since: gtk+ 3.4 
  211.    --  "accelerator": accelerator string 
  212.    --  "action_name": the name of the action to activate 
  213.    --  "parameter": parameter to pass when activating the action, or null if 
  214.    --  the action does not accept an activation parameter 
  215.  
  216.    procedure Add_Window 
  217.       (Self   : not null access Gtk_Application_Record; 
  218.        Window : not null access Gtk.Window.Gtk_Window_Record'Class); 
  219.    --  Adds a window to Application. 
  220.    --  This call is equivalent to setting the 
  221.    --  Gtk.Window.Gtk_Window:application property of Window to Application. 
  222.    --  Normally, the connection between the application and the window will 
  223.    --  remain until the window is destroyed, but you can explicitly remove it 
  224.    --  with Gtk.Application.Remove_Window. 
  225.    --  GTK+ will keep the application running as long as it has any windows. 
  226.    --  Since: gtk+ 3.0 
  227.    --  "window": a Gtk.Window.Gtk_Window 
  228.  
  229.    function Get_Active_Window 
  230.       (Self : not null access Gtk_Application_Record) 
  231.        return Gtk.Window.Gtk_Window; 
  232.    --  Gets the "active" window for the application. 
  233.    --  The active window is the one that was most recently focused (within the 
  234.    --  application). This window may not have the focus at the moment if 
  235.    --  another application has it -- this is just the most recently-focused 
  236.    --  window within this application. 
  237.    --  Since: gtk+ 3.6 
  238.  
  239.    function Get_App_Menu 
  240.       (Self : not null access Gtk_Application_Record) 
  241.        return Glib.Menu_Model.Gmenu_Model; 
  242.    --  Returns the menu model that has been set with 
  243.    --  Gtk.Application.Set_App_Menu. 
  244.    --  Since: gtk+ 3.4 
  245.  
  246.    procedure Set_App_Menu 
  247.       (Self     : not null access Gtk_Application_Record; 
  248.        App_Menu : access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  249.    --  Sets or unsets the application menu for Application. 
  250.    --  This can only be done in the primary instance of the application, after 
  251.    --  it has been registered. Glib.Application.Gapplication:startup is a good 
  252.    --  place to call this. 
  253.    --  The application menu is a single menu containing items that typically 
  254.    --  impact the application as a whole, rather than acting on a specific 
  255.    --  window or document. For example, you would expect to see "Preferences" 
  256.    --  or "Quit" in an application menu, but not "Save" or "Print". 
  257.    --  If supported, the application menu will be rendered by the desktop 
  258.    --  environment. 
  259.    --  Use the base Glib.Action_Map.Gaction_Map interface to add actions, to 
  260.    --  respond to the user selecting these menu items. 
  261.    --  Since: gtk+ 3.4 
  262.    --  "app_menu": a Glib.Menu_Model.Gmenu_Model, or null 
  263.  
  264.    function Get_Menubar 
  265.       (Self : not null access Gtk_Application_Record) 
  266.        return Glib.Menu_Model.Gmenu_Model; 
  267.    --  Returns the menu model that has been set with 
  268.    --  Gtk.Application.Set_Menubar. 
  269.    --  Since: gtk+ 3.4 
  270.  
  271.    procedure Set_Menubar 
  272.       (Self    : not null access Gtk_Application_Record; 
  273.        Menubar : access Glib.Menu_Model.Gmenu_Model_Record'Class); 
  274.    --  Sets or unsets the menubar for windows of Application. 
  275.    --  This is a menubar in the traditional sense. 
  276.    --  This can only be done in the primary instance of the application, after 
  277.    --  it has been registered. Glib.Application.Gapplication:startup is a good 
  278.    --  place to call this. 
  279.    --  Depending on the desktop environment, this may appear at the top of 
  280.    --  each window, or at the top of the screen. In some environments, if both 
  281.    --  the application menu and the menubar are set, the application menu will 
  282.    --  be presented as if it were the first item of the menubar. Other 
  283.    --  environments treat the two as completely separate -- for example, the 
  284.    --  application menu may be rendered by the desktop shell while the menubar 
  285.    --  (if set) remains in each individual window. 
  286.    --  Use the base Glib.Action_Map.Gaction_Map interface to add actions, to 
  287.    --  respond to the user selecting these menu items. 
  288.    --  Since: gtk+ 3.4 
  289.    --  "menubar": a Glib.Menu_Model.Gmenu_Model, or null 
  290.  
  291.    function Get_Window_By_Id 
  292.       (Self : not null access Gtk_Application_Record; 
  293.        Id   : Guint) return Gtk.Window.Gtk_Window; 
  294.    --  Returns the Gtk.Application_Window.Gtk_Application_Window with the 
  295.    --  given ID. 
  296.    --  Since: gtk+ 3.6 
  297.    --  "id": an identifier number 
  298.  
  299.    function Get_Windows 
  300.       (Self : not null access Gtk_Application_Record) 
  301.        return Gtk.Widget.Widget_List.Glist; 
  302.    --  Gets a list of the Gtk_Windows associated with Application. 
  303.    --  The list is sorted by most recently focused window, such that the first 
  304.    --  element is the currently focused window. (Useful for choosing a parent 
  305.    --  for a transient window.) 
  306.    --  The list that is returned should not be modified in any way. It will 
  307.    --  only remain valid until the next focus change or window creation or 
  308.    --  deletion. 
  309.    --  Since: gtk+ 3.0 
  310.  
  311.    function Inhibit 
  312.       (Self   : not null access Gtk_Application_Record; 
  313.        Window : access Gtk.Window.Gtk_Window_Record'Class; 
  314.        Flags  : Gtk_Application_Inhibit_Flags; 
  315.        Reason : UTF8_String := "") return Guint; 
  316.    --  Inform the session manager that certain types of actions should be 
  317.    --  inhibited. This is not guaranteed to work on all platforms and for all 
  318.    --  types of actions. 
  319.    --  Applications should invoke this method when they begin an operation 
  320.    --  that should not be interrupted, such as creating a CD or DVD. The types 
  321.    --  of actions that may be blocked are specified by the Flags parameter. 
  322.    --  When the application completes the operation it should call 
  323.    --  Gtk.Application.Uninhibit to remove the inhibitor. Note that an 
  324.    --  application can have multiple inhibitors, and all of the must be 
  325.    --  individually removed. Inhibitors are also cleared when the application 
  326.    --  exits. 
  327.    --  Applications should not expect that they will always be able to block 
  328.    --  the action. In most cases, users will be given the option to force the 
  329.    --  action to take place. 
  330.    --  Reasons should be short and to the point. 
  331.    --  If Window is given, the session manager may point the user to this 
  332.    --  window to find out more about why the action is inhibited. 
  333.    --  Since: gtk+ 3.4 
  334.    --  "window": a Gtk.Window.Gtk_Window, or null 
  335.    --  "flags": what types of actions should be inhibited 
  336.    --  "reason": a short, human-readable string that explains why these 
  337.    --  operations are inhibited 
  338.  
  339.    function Is_Inhibited 
  340.       (Self  : not null access Gtk_Application_Record; 
  341.        Flags : Gtk_Application_Inhibit_Flags) return Boolean; 
  342.    --  Determines if any of the actions specified in Flags are currently 
  343.    --  inhibited (possibly by another application). 
  344.    --  Since: gtk+ 3.4 
  345.    --  "flags": what types of actions should be queried 
  346.  
  347.    procedure Remove_Accelerator 
  348.       (Self        : not null access Gtk_Application_Record; 
  349.        Action_Name : UTF8_String; 
  350.        Parameter   : Glib.Variant.Gvariant); 
  351.    --  Removes an accelerator that has been previously added with 
  352.    --  Gtk.Application.Add_Accelerator. 
  353.    --  Since: gtk+ 3.4 
  354.    --  "action_name": the name of the action to activate 
  355.    --  "parameter": parameter to pass when activating the action, or null if 
  356.    --  the action does not accept an activation parameter 
  357.  
  358.    procedure Remove_Window 
  359.       (Self   : not null access Gtk_Application_Record; 
  360.        Window : not null access Gtk.Window.Gtk_Window_Record'Class); 
  361.    --  Remove a window from Application. 
  362.    --  If Window belongs to Application then this call is equivalent to 
  363.    --  setting the Gtk.Window.Gtk_Window:application property of Window to 
  364.    --  null. 
  365.    --  The application may stop running as a result of a call to this 
  366.    --  function. 
  367.    --  Since: gtk+ 3.0 
  368.    --  "window": a Gtk.Window.Gtk_Window 
  369.  
  370.    procedure Uninhibit 
  371.       (Self   : not null access Gtk_Application_Record; 
  372.        Cookie : Guint); 
  373.    --  Removes an inhibitor that has been established with 
  374.    --  Gtk.Application.Inhibit. Inhibitors are also cleared when the 
  375.    --  application exits. 
  376.    --  Since: gtk+ 3.4 
  377.    --  "cookie": a cookie that was returned by Gtk.Application.Inhibit 
  378.  
  379.    --------------------------------------------- 
  380.    -- Inherited subprograms (from interfaces) -- 
  381.    --------------------------------------------- 
  382.  
  383.    procedure Action_Added 
  384.       (Self        : not null access Gtk_Application_Record; 
  385.        Action_Name : UTF8_String); 
  386.  
  387.    procedure Action_Enabled_Changed 
  388.       (Self        : not null access Gtk_Application_Record; 
  389.        Action_Name : UTF8_String; 
  390.        Enabled     : Boolean); 
  391.  
  392.    procedure Action_Removed 
  393.       (Self        : not null access Gtk_Application_Record; 
  394.        Action_Name : UTF8_String); 
  395.  
  396.    procedure Action_State_Changed 
  397.       (Self        : not null access Gtk_Application_Record; 
  398.        Action_Name : UTF8_String; 
  399.        State       : Glib.Variant.Gvariant); 
  400.  
  401.    procedure Activate_Action 
  402.       (Self        : not null access Gtk_Application_Record; 
  403.        Action_Name : UTF8_String; 
  404.        Parameter   : Glib.Variant.Gvariant); 
  405.  
  406.    procedure Change_Action_State 
  407.       (Self        : not null access Gtk_Application_Record; 
  408.        Action_Name : UTF8_String; 
  409.        Value       : Glib.Variant.Gvariant); 
  410.  
  411.    function Get_Action_Enabled 
  412.       (Self        : not null access Gtk_Application_Record; 
  413.        Action_Name : UTF8_String) return Boolean; 
  414.  
  415.    function Get_Action_Parameter_Type 
  416.       (Self        : not null access Gtk_Application_Record; 
  417.        Action_Name : UTF8_String) return Glib.Variant.Gvariant_Type; 
  418.  
  419.    function Get_Action_State 
  420.       (Self        : not null access Gtk_Application_Record; 
  421.        Action_Name : UTF8_String) return Glib.Variant.Gvariant; 
  422.  
  423.    function Get_Action_State_Hint 
  424.       (Self        : not null access Gtk_Application_Record; 
  425.        Action_Name : UTF8_String) return Glib.Variant.Gvariant; 
  426.  
  427.    function Get_Action_State_Type 
  428.       (Self        : not null access Gtk_Application_Record; 
  429.        Action_Name : UTF8_String) return Glib.Variant.Gvariant_Type; 
  430.  
  431.    function Has_Action 
  432.       (Self        : not null access Gtk_Application_Record; 
  433.        Action_Name : UTF8_String) return Boolean; 
  434.  
  435.    function List_Actions 
  436.       (Self : not null access Gtk_Application_Record) 
  437.        return GNAT.Strings.String_List; 
  438.  
  439.    function Query_Action 
  440.       (Self           : not null access Gtk_Application_Record; 
  441.        Action_Name    : UTF8_String; 
  442.        Enabled        : access Boolean; 
  443.        Parameter_Type : access Glib.Variant.Gvariant_Type; 
  444.        State_Type     : access Glib.Variant.Gvariant_Type; 
  445.        State_Hint     : access Glib.Variant.Gvariant; 
  446.        State          : access Glib.Variant.Gvariant) return Boolean; 
  447.  
  448.    procedure Add_Action 
  449.       (Self   : not null access Gtk_Application_Record; 
  450.        Action : Glib.Action.Gaction); 
  451.  
  452.    procedure Add_Action_Entries 
  453.       (Self      : not null access Gtk_Application_Record; 
  454.        Entries   : GAction_Entry_Array; 
  455.        User_Data : System.Address := System.Null_Address); 
  456.  
  457.    function Lookup_Action 
  458.       (Self        : not null access Gtk_Application_Record; 
  459.        Action_Name : UTF8_String) return Glib.Action.Gaction; 
  460.  
  461.    procedure Remove_Action 
  462.       (Self        : not null access Gtk_Application_Record; 
  463.        Action_Name : UTF8_String); 
  464.  
  465.    ---------------- 
  466.    -- Properties -- 
  467.    ---------------- 
  468.    --  The following properties are defined for this widget. See 
  469.    --  Glib.Properties for more information on properties) 
  470.  
  471.    Active_Window_Property : constant Glib.Properties.Property_Object; 
  472.    --  Type: Gtk.Window.Gtk_Window 
  473.  
  474.    App_Menu_Property : constant Glib.Properties.Property_Boxed; 
  475.    --  Type: Gio.Menu_Model 
  476.  
  477.    Menubar_Property : constant Glib.Properties.Property_Boxed; 
  478.    --  Type: Gio.Menu_Model 
  479.  
  480.    Register_Session_Property : constant Glib.Properties.Property_Boolean; 
  481.    --  Set this property to True to register with the session manager. 
  482.  
  483.    ------------- 
  484.    -- Signals -- 
  485.    ------------- 
  486.  
  487.    type Cb_Gtk_Application_Gtk_Window_Void is not null access procedure 
  488.      (Self   : access Gtk_Application_Record'Class; 
  489.       Window : not null access Gtk.Window.Gtk_Window_Record'Class); 
  490.  
  491.    type Cb_GObject_Gtk_Window_Void is not null access procedure 
  492.      (Self   : access Glib.Object.GObject_Record'Class; 
  493.       Window : not null access Gtk.Window.Gtk_Window_Record'Class); 
  494.  
  495.    Signal_Window_Added : constant Glib.Signal_Name := "window-added"; 
  496.    procedure On_Window_Added 
  497.       (Self  : not null access Gtk_Application_Record; 
  498.        Call  : Cb_Gtk_Application_Gtk_Window_Void; 
  499.        After : Boolean := False); 
  500.    procedure On_Window_Added 
  501.       (Self  : not null access Gtk_Application_Record; 
  502.        Call  : Cb_GObject_Gtk_Window_Void; 
  503.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  504.        After : Boolean := False); 
  505.    --  Emitted when a Gtk.Window.Gtk_Window is added to Application through 
  506.    --  Gtk.Application.Add_Window. 
  507.  
  508.    Signal_Window_Removed : constant Glib.Signal_Name := "window-removed"; 
  509.    procedure On_Window_Removed 
  510.       (Self  : not null access Gtk_Application_Record; 
  511.        Call  : Cb_Gtk_Application_Gtk_Window_Void; 
  512.        After : Boolean := False); 
  513.    procedure On_Window_Removed 
  514.       (Self  : not null access Gtk_Application_Record; 
  515.        Call  : Cb_GObject_Gtk_Window_Void; 
  516.        Slot  : not null access Glib.Object.GObject_Record'Class; 
  517.        After : Boolean := False); 
  518.    --  Emitted when a Gtk.Window.Gtk_Window is removed from Application, 
  519.    --  either as a side-effect of being destroyed or explicitly through 
  520.    --  Gtk.Application.Remove_Window. 
  521.  
  522.    ---------------- 
  523.    -- Interfaces -- 
  524.    ---------------- 
  525.    --  This class implements several interfaces. See Glib.Types 
  526.    -- 
  527.    --  - "Gio.ActionGroup" 
  528.    -- 
  529.    --  - "Gio.ActionMap" 
  530.  
  531.    package Implements_Gaction_Group is new Glib.Types.Implements 
  532.      (Glib.Action_Group.Gaction_Group, Gtk_Application_Record, Gtk_Application); 
  533.    function "+" 
  534.      (Widget : access Gtk_Application_Record'Class) 
  535.    return Glib.Action_Group.Gaction_Group 
  536.    renames Implements_Gaction_Group.To_Interface; 
  537.    function "-" 
  538.      (Interf : Glib.Action_Group.Gaction_Group) 
  539.    return Gtk_Application 
  540.    renames Implements_Gaction_Group.To_Object; 
  541.  
  542.    package Implements_Gaction_Map is new Glib.Types.Implements 
  543.      (Glib.Action_Map.Gaction_Map, Gtk_Application_Record, Gtk_Application); 
  544.    function "+" 
  545.      (Widget : access Gtk_Application_Record'Class) 
  546.    return Glib.Action_Map.Gaction_Map 
  547.    renames Implements_Gaction_Map.To_Interface; 
  548.    function "-" 
  549.      (Interf : Glib.Action_Map.Gaction_Map) 
  550.    return Gtk_Application 
  551.    renames Implements_Gaction_Map.To_Object; 
  552.  
  553. private 
  554.    Register_Session_Property : constant Glib.Properties.Property_Boolean := 
  555.      Glib.Properties.Build ("register-session"); 
  556.    Menubar_Property : constant Glib.Properties.Property_Boxed := 
  557.      Glib.Properties.Build ("menubar"); 
  558.    App_Menu_Property : constant Glib.Properties.Property_Boxed := 
  559.      Glib.Properties.Build ("app-menu"); 
  560.    Active_Window_Property : constant Glib.Properties.Property_Object := 
  561.      Glib.Properties.Build ("active-window"); 
  562. end Gtk.Application;