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-2009, 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. --  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 (Widget : access Widget_Type'Class); 
  459.  
  460.          function To_Marshaller (Cb : Handler) return Marshaller; 
  461.  
  462.          procedure Emit_By_Name 
  463.            (Object : access Widget_Type'Class; 
  464.             Name   : Glib.Signal_Name); 
  465.  
  466.       private 
  467.          procedure Call 
  468.            (Widget : access Widget_Type'Class; 
  469.             Params : Glib.Values.GValues; 
  470.             Cb     : General_Handler); 
  471.  
  472.          Call_Access : constant Handler_Proxy := Call'Access; 
  473.       end Void_Marshaller; 
  474.  
  475.    end Void_Marshallers; 
  476.  
  477.    ---------------------------------------------------------------------- 
  478.    --  User_Callback_Marshallers: Do not return a value, have user data 
  479.    ---------------------------------------------------------------------- 
  480.  
  481.    generic 
  482.       type Widget_Type is new Glib.Object.GObject_Record with private; 
  483.       type User_Type (<>) is private; 
  484.    package User_Void_Marshallers is 
  485.       type Handler_Proxy is access procedure 
  486.         (Widget    : access Widget_Type'Class; 
  487.          Params    : Glib.Values.GValues; 
  488.          Cb        : General_Handler; 
  489.          User_Data : User_Type); 
  490.  
  491.       type Marshaller is record 
  492.          Func  : General_Handler; 
  493.          Proxy : Handler_Proxy; 
  494.       end record; 
  495.  
  496.       --  Basic Marshaller 
  497.       generic 
  498.          type Base_Type is private; 
  499.          with function Conversion 
  500.            (Value : Glib.Values.GValue) return Base_Type; 
  501.  
  502.       package Generic_Marshaller is 
  503.          type Handler is access procedure 
  504.            (Widget    : access Widget_Type'Class; 
  505.             Param     : Base_Type; 
  506.             User_Data : User_Type); 
  507.  
  508.          function To_Marshaller (Cb : Handler) return Marshaller; 
  509.  
  510.          procedure Emit_By_Name 
  511.            (Object : access Widget_Type'Class; 
  512.             Name   : Glib.Signal_Name; 
  513.             Param  : Base_Type); 
  514.          --  The function above should be used when BASE_TYPE can be passed 
  515.          --  as is to C. 
  516.  
  517.          generic 
  518.             with function Conversion (Param : Base_Type) return System.Address; 
  519.          procedure Emit_By_Name_Generic 
  520.            (Object : access Widget_Type'Class; 
  521.             Name   : Glib.Signal_Name; 
  522.             Param  : Base_Type); 
  523.          --  Provide an explicit conversion function for PARAM. 
  524.  
  525.       private 
  526.          procedure Call 
  527.            (Widget    : access Widget_Type'Class; 
  528.             Params    : Glib.Values.GValues; 
  529.             Cb        : General_Handler; 
  530.             User_Data : User_Type); 
  531.  
  532.          Call_Access : constant Handler_Proxy := Call'Access; 
  533.       end Generic_Marshaller; 
  534.  
  535.       generic 
  536.          type Base_Type_1 is private; 
  537.          with function Conversion 
  538.            (Value : Glib.Values.GValue) return Base_Type_1; 
  539.          type Base_Type_2 is private; 
  540.          with function Conversion 
  541.            (Value : Glib.Values.GValue) return Base_Type_2; 
  542.  
  543.       package Generic_Marshaller_2 is 
  544.  
  545.          type Handler is access procedure 
  546.            (Widget    : access Widget_Type'Class; 
  547.             Param_1   : Base_Type_1; 
  548.             Param_2   : Base_Type_2; 
  549.             User_Data : User_Type); 
  550.  
  551.          function To_Marshaller (Cb : Handler) return Marshaller; 
  552.  
  553.          procedure Emit_By_Name 
  554.            (Object  : access Widget_Type'Class; 
  555.             Name    : Glib.Signal_Name; 
  556.             Param_1 : Base_Type_1; 
  557.             Param_2 : Base_Type_2); 
  558.          --  The function above should be used when BASE_TYPE can be passed 
  559.          --  as is to C. 
  560.  
  561.          generic 
  562.             with function Conversion 
  563.                             (Param : Base_Type_1) return System.Address; 
  564.             with function Conversion 
  565.                             (Param : Base_Type_2) return System.Address; 
  566.          procedure Emit_By_Name_Generic 
  567.            (Object  : access Widget_Type'Class; 
  568.             Name    : Glib.Signal_Name; 
  569.             Param_1 : Base_Type_1; 
  570.             Param_2 : Base_Type_2); 
  571.          --  Provide an explicit conversion function for PARAM. 
  572.  
  573.       private 
  574.          procedure Call 
  575.            (Widget    : access Widget_Type'Class; 
  576.             Params    : Glib.Values.GValues; 
  577.             Cb        : General_Handler; 
  578.             User_Data : User_Type); 
  579.  
  580.          Call_Access : constant Handler_Proxy := Call'Access; 
  581.       end Generic_Marshaller_2; 
  582.  
  583.       --  Widget Marshaller 
  584.       generic 
  585.          type Base_Type is new Gtk.Widget.Gtk_Widget_Record with private; 
  586.          type Access_Type is access all Base_Type'Class; 
  587.       package Generic_Widget_Marshaller is 
  588.          type Handler is access procedure 
  589.            (Widget    : access Widget_Type'Class; 
  590.             Param     : access Base_Type'Class; 
  591.             User_Data : User_Type); 
  592.  
  593.          function To_Marshaller (Cb : Handler) return Marshaller; 
  594.  
  595.          procedure Emit_By_Name 
  596.            (Object : access Widget_Type'Class; 
  597.             Name   : Glib.Signal_Name; 
  598.             Param  : access Base_Type'Class); 
  599.  
  600.       private 
  601.          procedure Call 
  602.            (Widget    : access Widget_Type'Class; 
  603.             Params    : Glib.Values.GValues; 
  604.             Cb        : General_Handler; 
  605.             User_Data : User_Type); 
  606.  
  607.          Call_Access : constant Handler_Proxy := Call'Access; 
  608.       end Generic_Widget_Marshaller; 
  609.  
  610.       --  Void Marshaller 
  611.       package Void_Marshaller is 
  612.          type Handler is access procedure 
  613.            (Widget    : access Widget_Type'Class; 
  614.             User_Data : User_Type); 
  615.  
  616.          function To_Marshaller (Cb : Handler) return Marshaller; 
  617.  
  618.          procedure Emit_By_Name 
  619.            (Object : access Widget_Type'Class; 
  620.             Name   : Glib.Signal_Name); 
  621.  
  622.       private 
  623.          procedure Call 
  624.            (Widget    : access Widget_Type'Class; 
  625.             Params    : Glib.Values.GValues; 
  626.             Cb        : General_Handler; 
  627.             User_Data : User_Type); 
  628.  
  629.          Call_Access : constant Handler_Proxy := Call'Access; 
  630.       end Void_Marshaller; 
  631.  
  632.    end User_Void_Marshallers; 
  633.  
  634.    --  </doc_ignore> 
  635. end Gtk.Marshallers;