1. ------------------------------------------------------------------------------ 
  2. --                  GtkAda - Ada95 binding for Gtk+/Gnome                   -- 
  3. --                                                                          -- 
  4. --      Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet       -- 
  5. --                     Copyright (C) 1998-2014, AdaCore                     -- 
  6. --                                                                          -- 
  7. -- This library is free software;  you can redistribute it and/or modify it -- 
  8. -- under terms of the  GNU General Public License  as published by the Free -- 
  9. -- Software  Foundation;  either version 3,  or (at your  option) any later -- 
  10. -- version. This library is distributed in the hope that it will be useful, -- 
  11. -- but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN- -- 
  12. -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE.                            -- 
  13. --                                                                          -- 
  14. -- As a special exception under Section 7 of GPL version 3, you are granted -- 
  15. -- additional permissions described in the GCC Runtime Library Exception,   -- 
  16. -- version 3.1, as published by the Free Software Foundation.               -- 
  17. --                                                                          -- 
  18. -- You should have received a copy of the GNU General Public License and    -- 
  19. -- a copy of the GCC Runtime Library Exception along with this program;     -- 
  20. -- see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see    -- 
  21. -- <http://www.gnu.org/licenses/>.                                          -- 
  22. --                                                                          -- 
  23. ------------------------------------------------------------------------------ 
  24.  
  25. --  <description> 
  26. --  This package provides a set of generic packages to easily create 
  27. --  some Marshallers. Although this package has been designed to be 
  28. --  easily reusable, its primary aim is to simplify the use of callbacks. 
  29. -- 
  30. --  Note that most users don't need to understand or even look at this 
  31. --  package, since the main functions are also renamed in the Gtk.Handlers 
  32. --  package (They are called To_Marshaller). This package is rather 
  33. --  complex (generic packages inside generic packages), and thus you should 
  34. --  understand correctly how Gtk.Handlers work before looking at this one. 
  35. -- 
  36. --  To understand the paradigm used in this package, some definitions 
  37. --  are necessary: 
  38. -- 
  39. --     A Handler, or Callback, is a subprogram provided by the user. 
  40. --     This handler, when attached to a particular object, will be 
  41. --     called when certain events happen during the life of this 
  42. --     object. All handlers take as a first argument an access to 
  43. --     the object they were attached to. Depending on the signal, this 
  44. --     handler can also have some extra parameters; most of the time, 
  45. --     only one extra parameter will be used. For more information about 
  46. --     Handlers, refer to the package Gtk.Handlers, where this notion is 
  47. --     explained in more details. 
  48. -- 
  49. --     A General_Handler is an access to any Handler. Note that this is 
  50. --     a type used internally, most users should *not* be using it. It is 
  51. --     publicly declared so that users can create new marshallers that 
  52. --     would not be already provided here. 
  53. -- 
  54. --     A Handler_Proxy is a subprogram that calls its associated 
  55. --     handler with the appropriate arguments (from an array of arguments 
  56. --     stored in Glib.Values.GValues) 
  57. -- 
  58. --     A Marshaller is the association of a General_Handler and a 
  59. --     Handler_Proxy. 
  60. -- 
  61. --  This package is divided in four generic packages. Each package has 
  62. --  been designed to cover a certain kind of callback by providing the 
  63. --  associated marshallers. There are two primary factors that describe 
  64. --  a callback, and that decide which marshaller to use: Does the 
  65. --  callback have access to some user data?  Does the callback return 
  66. --  some value? 
  67. -- 
  68. --  Depending on that, the appropriate generic package should be chosen. 
  69. --  For example, if the callback returns a value, but does not expect 
  70. --  user data, then the "Return_Marshallers" package should be used. 
  71. --  More details about the usage of each package is provided individually 
  72. --  below. 
  73. -- 
  74. --  Each of these packages is in turn divided into three generic 
  75. --  sub-packages.  The organization of these subpackages is always the 
  76. --  same : 
  77. --     o The type "Handler" is defined. It describes the profile of the 
  78. --       Handler covered in this generic package. 
  79. --     o a "To_Marshaller" function is provided to build a Marshaller 
  80. --       from any Handler. 
  81. --     o A "Emit_By_Name" procedure is also provided to allow the user 
  82. --       to "emit" a signal. This service is explained in more details in 
  83. --       Gtk.Handlers. 
  84. --     o A private function "Call" is also defined. This is the actual 
  85. --       Handler_Proxy that will be used when creating Marshallers with 
  86. --       the "To_Marshaller" service. 
  87. -- 
  88. --  Once again, selecting the right generic sub-package depends on the 
  89. --  callback. For instance, the first sub-package, always called 
  90. --  "Generic_Marshaller", is to be used when the handler has one extra 
  91. --  argument which is a simple non-tagged type. More details about the 
  92. --  usage of each sub-package is also provided individually. 
  93. -- 
  94. --  Although most of the cases are covered by the packages below, some 
  95. --  unusual cases may appear. This is the case for example when the 
  96. --  callback accepts several extra parameters. In such cases, two options 
  97. --  are available: The first option is to use the "standard" callback 
  98. --  mechanism with one parameter, this parameter being an array of 
  99. --  arguments that you will parse yourself. The second option is to 
  100. --  create a new Marshaller package. This is more interesting if more 
  101. --  than one callback will follow the same pattern. The body of this 
  102. --  package can be used as a good model to build such new marshallers. 
  103. --  See also the example in the GtkAda distribution for how to create your 
  104. --  own marshallers. 
  105. -- 
  106. --  </description> 
  107. --  <group>Signal handling</group> 
  108. --  <c_version>2.8.17</c_version> 
  109.  
  110. with Glib.Object; 
  111. with Gtk.Widget; 
  112. with Glib.Values; 
  113.  
  114. package Gtk.Marshallers is 
  115.  
  116.    --  <doc_ignore>Do not create automatic documentation for this package 
  117.  
  118.    type General_Handler is access procedure; 
  119.  
  120.    -------------------------------------------------------------- 
  121.    --  Return Marshallers: Return a value, don't have user data 
  122.    -------------------------------------------------------------- 
  123.  
  124.    generic 
  125.       type Widget_Type is new Glib.Object.GObject_Record with private; 
  126.       type Return_Type is (<>); 
  127.    package Return_Marshallers is 
  128.  
  129.       type Handler_Proxy is access function 
  130.         (Widget  : access Widget_Type'Class; 
  131.          Params  : Glib.Values.GValues; 
  132.          Cb      : General_Handler) return Return_Type; 
  133.  
  134.       type Marshaller is record 
  135.          Func  : General_Handler;   --  User callback 
  136.          Proxy : Handler_Proxy;     --  Handler_Proxy for this callback 
  137.       end record; 
  138.  
  139.       --  Basic Marshaller 
  140.       generic 
  141.          type Base_Type is private; 
  142.          with function Conversion 
  143.            (Value : Glib.Values.GValue) return Base_Type; 
  144.  
  145.       package Generic_Marshaller is 
  146.          type Handler is access function 
  147.            (Widget : access Widget_Type'Class; 
  148.             Param  : Base_Type) return Return_Type; 
  149.  
  150.          function To_Marshaller (Cb : Handler) return Marshaller; 
  151.  
  152.          function Emit_By_Name 
  153.            (Object : access Widget_Type'Class; 
  154.             Name   : Glib.Signal_Name; 
  155.             Param  : Base_Type) return Return_Type; 
  156.          --  The function above should be used when Base_Type can be passed 
  157.          --  as is to C. 
  158.  
  159.          generic 
  160.             with function Conversion (Param : Base_Type) return System.Address; 
  161.          function Emit_By_Name_Generic 
  162.            (Object : access Widget_Type'Class; 
  163.             Name   : Glib.Signal_Name; 
  164.             Param  : Base_Type) return Return_Type; 
  165.          --  Provide an explicit conversion function for PARAM. 
  166.  
  167.       private 
  168.          function Call 
  169.            (Widget : access Widget_Type'Class; 
  170.             Params : Glib.Values.GValues; 
  171.             Cb     : General_Handler) return Return_Type; 
  172.  
  173.          Call_Access : constant Handler_Proxy := Call'Access; 
  174.       end Generic_Marshaller; 
  175.  
  176.       --  Widget Marshaller 
  177.       generic 
  178.          type Base_Type is new Gtk.Widget.Gtk_Widget_Record with private; 
  179.          type Access_Type is access all Base_Type'Class; 
  180.       package Generic_Widget_Marshaller is 
  181.          type Handler is access function 
  182.            (Widget : access Widget_Type'Class; 
  183.             Param  : access Base_Type'Class) return Return_Type; 
  184.  
  185.          function To_Marshaller (Cb : Handler) return Marshaller; 
  186.  
  187.          function Emit_By_Name 
  188.            (Object : access Widget_Type'Class; 
  189.             Name   : Glib.Signal_Name; 
  190.             Param  : access Base_Type'Class) return Return_Type; 
  191.  
  192.       private 
  193.          function Call 
  194.            (Widget : access Widget_Type'Class; 
  195.             Params : Glib.Values.GValues; 
  196.             Cb     : General_Handler) return Return_Type; 
  197.  
  198.          Call_Access : constant Handler_Proxy := Call'Access; 
  199.       end Generic_Widget_Marshaller; 
  200.  
  201.       --  Void Marshaller 
  202.       package Void_Marshaller is 
  203.          type Handler is access function 
  204.            (Widget : access Widget_Type'Class) return Return_Type; 
  205.  
  206.          function To_Marshaller (Cb : Handler) return Marshaller; 
  207.  
  208.          function Emit_By_Name 
  209.            (Object : access Widget_Type'Class; 
  210.             Name   : Glib.Signal_Name) return Return_Type; 
  211.  
  212.       private 
  213.          function Call 
  214.            (Widget : access Widget_Type'Class; 
  215.             Params : Glib.Values.GValues; 
  216.             Cb     : General_Handler) return Return_Type; 
  217.  
  218.          Call_Access : constant Handler_Proxy := Call'Access; 
  219.       end Void_Marshaller; 
  220.    end Return_Marshallers; 
  221.  
  222.    -------------------------------------------------------------- 
  223.    --  User_Return_Marshallers: Return a value, have a user data 
  224.    -------------------------------------------------------------- 
  225.  
  226.    generic 
  227.       type Widget_Type is new Glib.Object.GObject_Record with private; 
  228.       type Return_Type is (<>); 
  229.       type User_Type (<>) is private; 
  230.    package User_Return_Marshallers is 
  231.  
  232.       type Handler_Proxy is access function 
  233.         (Widget    : access Widget_Type'Class; 
  234.          Params    : Glib.Values.GValues; 
  235.          Cb        : General_Handler; 
  236.          User_Data : User_Type) return Return_Type; 
  237.  
  238.       type Marshaller is record 
  239.          Func  : General_Handler; 
  240.          Proxy : Handler_Proxy; 
  241.       end record; 
  242.  
  243.       --  Basic Marshaller 
  244.       generic 
  245.          type Base_Type is private; 
  246.          with function Conversion 
  247.            (Value : Glib.Values.GValue) return Base_Type; 
  248.  
  249.       package Generic_Marshaller is 
  250.          type Handler is access function 
  251.            (Widget    : access Widget_Type'Class; 
  252.             Param     : Base_Type; 
  253.             User_Data : User_Type) return Return_Type; 
  254.          function To_Marshaller (Cb : Handler) return Marshaller; 
  255.  
  256.          function Emit_By_Name 
  257.            (Object : access Widget_Type'Class; 
  258.             Name   : Glib.Signal_Name; 
  259.             Param  : Base_Type) return Return_Type; 
  260.          --  The function above should be used when BASE_TYPE can be passed 
  261.          --  as is to C. 
  262.  
  263.          generic 
  264.             with function Conversion (Param : Base_Type) return System.Address; 
  265.          function Emit_By_Name_Generic 
  266.            (Object : access Widget_Type'Class; 
  267.             Name   : Glib.Signal_Name; 
  268.             Param  : Base_Type) return Return_Type; 
  269.          --  Provide an explicit conversion function for PARAM. 
  270.       private 
  271.          function Call 
  272.            (Widget    : access Widget_Type'Class; 
  273.             Params    : Glib.Values.GValues; 
  274.             Cb        : General_Handler; 
  275.             User_Data : User_Type) return Return_Type; 
  276.  
  277.          Call_Access : constant Handler_Proxy := Call'Access; 
  278.       end Generic_Marshaller; 
  279.  
  280.       --  Widget Marshaller 
  281.       generic 
  282.          type Base_Type is new Gtk.Widget.Gtk_Widget_Record with private; 
  283.          type Access_Type is access all Base_Type'Class; 
  284.       package Generic_Widget_Marshaller is 
  285.          type Handler is access function 
  286.            (Widget    : access Widget_Type'Class; 
  287.             Param     : access Base_Type'Class; 
  288.             User_Data : User_Type) return Return_Type; 
  289.  
  290.          function To_Marshaller (Cb : Handler) return Marshaller; 
  291.  
  292.          function Emit_By_Name 
  293.            (Object : access Widget_Type'Class; 
  294.             Name   : Glib.Signal_Name; 
  295.             Param  : access Base_Type'Class) return Return_Type; 
  296.  
  297.       private 
  298.          function Call 
  299.            (Widget    : access Widget_Type'Class; 
  300.             Params    : Glib.Values.GValues; 
  301.             Cb        : General_Handler; 
  302.             User_Data : User_Type) return Return_Type; 
  303.  
  304.          Call_Access : constant Handler_Proxy := Call'Access; 
  305.       end Generic_Widget_Marshaller; 
  306.  
  307.       --  Void Marshaller 
  308.       package Void_Marshaller is 
  309.          type Handler is access function 
  310.            (Widget    : access Widget_Type'Class; 
  311.             User_Data : User_Type) return Return_Type; 
  312.  
  313.          function To_Marshaller (Cb : Handler) return Marshaller; 
  314.  
  315.          function Emit_By_Name 
  316.            (Object : access Widget_Type'Class; 
  317.             Name   : Glib.Signal_Name) return Return_Type; 
  318.  
  319.       private 
  320.          function Call 
  321.            (Widget    : access Widget_Type'Class; 
  322.             Params    : Glib.Values.GValues; 
  323.             Cb        : General_Handler; 
  324.             User_Data : User_Type) return Return_Type; 
  325.  
  326.          Call_Access : constant Handler_Proxy := Call'Access; 
  327.       end Void_Marshaller; 
  328.  
  329.    end User_Return_Marshallers; 
  330.  
  331.    ----------------- 
  332.    --  Callback_Marshallers: Do not return a value, no user data 
  333.    ----------------- 
  334.  
  335.    generic 
  336.       type Widget_Type is new Glib.Object.GObject_Record with private; 
  337.    package Void_Marshallers is 
  338.  
  339.       type Handler_Proxy is access procedure 
  340.         (Widget : access Widget_Type'Class; 
  341.          Params : Glib.Values.GValues; 
  342.          Cb     : General_Handler); 
  343.  
  344.       type Marshaller is record 
  345.          Func  : General_Handler; 
  346.          Proxy : Handler_Proxy; 
  347.       end record; 
  348.  
  349.       --  Basic Marshaller 
  350.       generic 
  351.          type Base_Type is private; 
  352.          with function Conversion 
  353.            (Value : Glib.Values.GValue) return Base_Type; 
  354.  
  355.       package Generic_Marshaller is 
  356.          type Handler is access procedure 
  357.            (Widget : access Widget_Type'Class; 
  358.             Param  : Base_Type); 
  359.  
  360.          function To_Marshaller (Cb : Handler) return Marshaller; 
  361.  
  362.          procedure Emit_By_Name 
  363.            (Object : access Widget_Type'Class; 
  364.             Name   : Glib.Signal_Name; 
  365.             Param  : Base_Type); 
  366.          --  The function above should be used when BASE_TYPE can be passed 
  367.          --  as is to C. 
  368.  
  369.          generic 
  370.             with function Conversion (Param : Base_Type) return System.Address; 
  371.          procedure Emit_By_Name_Generic 
  372.            (Object : access Widget_Type'Class; 
  373.             Name   : Glib.Signal_Name; 
  374.             Param  : Base_Type); 
  375.          --  Provide an explicit conversion function for PARAM. 
  376.  
  377.       private 
  378.          procedure Call 
  379.            (Widget : access Widget_Type'Class; 
  380.             Params : Glib.Values.GValues; 
  381.             Cb     : General_Handler); 
  382.  
  383.          Call_Access : constant Handler_Proxy := Call'Access; 
  384.       end Generic_Marshaller; 
  385.  
  386.       generic 
  387.          type Base_Type_1 is private; 
  388.          with function Conversion 
  389.            (Value : Glib.Values.GValue) return Base_Type_1; 
  390.          type Base_Type_2 is private; 
  391.          with function Conversion 
  392.            (Value : Glib.Values.GValue) return Base_Type_2; 
  393.  
  394.       package Generic_Marshaller_2 is 
  395.          type Handler is access procedure 
  396.            (Widget  : access Widget_Type'Class; 
  397.             Param_1 : Base_Type_1; 
  398.             Param_2 : Base_Type_2); 
  399.  
  400.          function To_Marshaller (Cb : Handler) return Marshaller; 
  401.  
  402.          procedure Emit_By_Name 
  403.            (Object  : access Widget_Type'Class; 
  404.             Name    : Glib.Signal_Name; 
  405.             Param_1 : Base_Type_1; 
  406.             Param_2 : Base_Type_2); 
  407.          --  The function above should be used when BASE_TYPE can be passed 
  408.          --  as is to C. 
  409.  
  410.          generic 
  411.             with function Conversion 
  412.                             (Param : Base_Type_1) return System.Address; 
  413.             with function Conversion 
  414.                             (Param : Base_Type_2) return System.Address; 
  415.          procedure Emit_By_Name_Generic 
  416.            (Object  : access Widget_Type'Class; 
  417.             Name    : Glib.Signal_Name; 
  418.             Param_1 : Base_Type_1; 
  419.             Param_2 : Base_Type_2); 
  420.          --  Provide an explicit conversion function for PARAM. 
  421.  
  422.       private 
  423.          procedure Call 
  424.            (Widget : access Widget_Type'Class; 
  425.             Params : Glib.Values.GValues; 
  426.             Cb     : General_Handler); 
  427.  
  428.          Call_Access : constant Handler_Proxy := Call'Access; 
  429.       end Generic_Marshaller_2; 
  430.  
  431.       --  Widget Marshaller 
  432.       generic 
  433.          type Base_Type is new Gtk.Widget.Gtk_Widget_Record with private; 
  434.          type Access_Type is access all Base_Type'Class; 
  435.       package Generic_Widget_Marshaller is 
  436.          type Handler is access procedure 
  437.            (Widget : access Widget_Type'Class; 
  438.             Param  : access Base_Type'Class); 
  439.  
  440.          function To_Marshaller (Cb : Handler) return Marshaller; 
  441.  
  442.          procedure Emit_By_Name 
  443.            (Object : access Widget_Type'Class; 
  444.             Name   : Glib.Signal_Name; 
  445.             Param  : access Base_Type'Class); 
  446.  
  447.       private 
  448.          procedure Call 
  449.            (Widget : access Widget_Type'Class; 
  450.             Params : Glib.Values.GValues; 
  451.             Cb     : General_Handler); 
  452.  
  453.          Call_Access : constant Handler_Proxy := Call'Access; 
  454.       end Generic_Widget_Marshaller; 
  455.  
  456.       --  Void Marshaller 
  457.       package Void_Marshaller is 
  458.          type Handler is access procedure 
  459.             (Widget : access Widget_Type'Class); 
  460.  
  461.          function To_Marshaller (Cb : Handler) return Marshaller; 
  462.  
  463.          procedure Emit_By_Name 
  464.            (Object : access Widget_Type'Class; 
  465.             Name   : Glib.Signal_Name); 
  466.  
  467.       private 
  468.          procedure Call 
  469.            (Widget : access Widget_Type'Class; 
  470.             Params : Glib.Values.GValues; 
  471.             Cb     : General_Handler); 
  472.  
  473.          Call_Access : constant Handler_Proxy := Call'Access; 
  474.       end Void_Marshaller; 
  475.  
  476.    end Void_Marshallers; 
  477.  
  478.    ---------------------------------------------------------------------- 
  479.    --  User_Callback_Marshallers: Do not return a value, have user data 
  480.    ---------------------------------------------------------------------- 
  481.  
  482.    generic 
  483.       type Widget_Type is new Glib.Object.GObject_Record with private; 
  484.       type User_Type (<>) is private; 
  485.    package User_Void_Marshallers is 
  486.       type Handler_Proxy is access procedure 
  487.         (Widget    : access Widget_Type'Class; 
  488.          Params    : Glib.Values.GValues; 
  489.          Cb        : General_Handler; 
  490.          User_Data : User_Type); 
  491.  
  492.       type Marshaller is record 
  493.          Func  : General_Handler; 
  494.          Proxy : Handler_Proxy; 
  495.       end record; 
  496.  
  497.       --  Basic Marshaller 
  498.       generic 
  499.          type Base_Type is private; 
  500.          with function Conversion 
  501.            (Value : Glib.Values.GValue) return Base_Type; 
  502.  
  503.       package Generic_Marshaller is 
  504.          type Handler is access procedure 
  505.            (Widget    : access Widget_Type'Class; 
  506.             Param     : Base_Type; 
  507.             User_Data : User_Type); 
  508.  
  509.          function To_Marshaller (Cb : Handler) return Marshaller; 
  510.  
  511.          procedure Emit_By_Name 
  512.            (Object : access Widget_Type'Class; 
  513.             Name   : Glib.Signal_Name; 
  514.             Param  : Base_Type); 
  515.          --  The function above should be used when BASE_TYPE can be passed 
  516.          --  as is to C. 
  517.  
  518.          generic 
  519.             with function Conversion (Param : Base_Type) return System.Address; 
  520.          procedure Emit_By_Name_Generic 
  521.            (Object : access Widget_Type'Class; 
  522.             Name   : Glib.Signal_Name; 
  523.             Param  : Base_Type); 
  524.          --  Provide an explicit conversion function for PARAM. 
  525.  
  526.       private 
  527.          procedure Call 
  528.            (Widget    : access Widget_Type'Class; 
  529.             Params    : Glib.Values.GValues; 
  530.             Cb        : General_Handler; 
  531.             User_Data : User_Type); 
  532.  
  533.          Call_Access : constant Handler_Proxy := Call'Access; 
  534.       end Generic_Marshaller; 
  535.  
  536.       generic 
  537.          type Base_Type_1 is private; 
  538.          with function Conversion 
  539.            (Value : Glib.Values.GValue) return Base_Type_1; 
  540.          type Base_Type_2 is private; 
  541.          with function Conversion 
  542.            (Value : Glib.Values.GValue) return Base_Type_2; 
  543.  
  544.       package Generic_Marshaller_2 is 
  545.  
  546.          type Handler is access procedure 
  547.            (Widget    : access Widget_Type'Class; 
  548.             Param_1   : Base_Type_1; 
  549.             Param_2   : Base_Type_2; 
  550.             User_Data : User_Type); 
  551.  
  552.          function To_Marshaller (Cb : Handler) return Marshaller; 
  553.  
  554.          procedure Emit_By_Name 
  555.            (Object  : access Widget_Type'Class; 
  556.             Name    : Glib.Signal_Name; 
  557.             Param_1 : Base_Type_1; 
  558.             Param_2 : Base_Type_2); 
  559.          --  The function above should be used when BASE_TYPE can be passed 
  560.          --  as is to C. 
  561.  
  562.          generic 
  563.             with function Conversion 
  564.                             (Param : Base_Type_1) return System.Address; 
  565.             with function Conversion 
  566.                             (Param : Base_Type_2) return System.Address; 
  567.          procedure Emit_By_Name_Generic 
  568.            (Object  : access Widget_Type'Class; 
  569.             Name    : Glib.Signal_Name; 
  570.             Param_1 : Base_Type_1; 
  571.             Param_2 : Base_Type_2); 
  572.          --  Provide an explicit conversion function for PARAM. 
  573.  
  574.       private 
  575.          procedure Call 
  576.            (Widget    : access Widget_Type'Class; 
  577.             Params    : Glib.Values.GValues; 
  578.             Cb        : General_Handler; 
  579.             User_Data : User_Type); 
  580.  
  581.          Call_Access : constant Handler_Proxy := Call'Access; 
  582.       end Generic_Marshaller_2; 
  583.  
  584.       --  Widget Marshaller 
  585.       generic 
  586.          type Base_Type is new Gtk.Widget.Gtk_Widget_Record with private; 
  587.          type Access_Type is access all Base_Type'Class; 
  588.       package Generic_Widget_Marshaller is 
  589.          type Handler is access procedure 
  590.            (Widget    : access Widget_Type'Class; 
  591.             Param     : access Base_Type'Class; 
  592.             User_Data : User_Type); 
  593.  
  594.          function To_Marshaller (Cb : Handler) return Marshaller; 
  595.  
  596.          procedure Emit_By_Name 
  597.            (Object : access Widget_Type'Class; 
  598.             Name   : Glib.Signal_Name; 
  599.             Param  : access Base_Type'Class); 
  600.  
  601.       private 
  602.          procedure Call 
  603.            (Widget    : access Widget_Type'Class; 
  604.             Params    : Glib.Values.GValues; 
  605.             Cb        : General_Handler; 
  606.             User_Data : User_Type); 
  607.  
  608.          Call_Access : constant Handler_Proxy := Call'Access; 
  609.       end Generic_Widget_Marshaller; 
  610.  
  611.       --  Void Marshaller 
  612.       package Void_Marshaller is 
  613.          type Handler is access procedure 
  614.            (Widget    : access Widget_Type'Class; 
  615.             User_Data : User_Type); 
  616.  
  617.          function To_Marshaller (Cb : Handler) return Marshaller; 
  618.  
  619.          procedure Emit_By_Name 
  620.            (Object : access Widget_Type'Class; 
  621.             Name   : Glib.Signal_Name); 
  622.  
  623.       private 
  624.          procedure Call 
  625.            (Widget    : access Widget_Type'Class; 
  626.             Params    : Glib.Values.GValues; 
  627.             Cb        : General_Handler; 
  628.             User_Data : User_Type); 
  629.  
  630.          Call_Access : constant Handler_Proxy := Call'Access; 
  631.       end Void_Marshaller; 
  632.  
  633.    end User_Void_Marshallers; 
  634.  
  635.    --  </doc_ignore> 
  636. end Gtk.Marshallers;