This package is meant for internal use in GtkAda application. It provides a convenient wrapper around user-provided data, to be passed to callbacks.
function Build
(Func : System.Address; Data : User_Data_Type)
return System.Address
Allocate a new user data. It returns an access to Internal_Data_Access, but in a form easier to pass to a C function.
function Convert is new Ada.Unchecked_Conversion
(System.Address, Internal_Data_Access);
type Data_Access is access all User_Data_Type;
procedure Destroy (Data : in out User_Data_Type)
This package is meant for internal use in GtkAda application. It provides a convenient wrapper around user-provided data, to be passed to callbacks.
procedure Free_Data (Data : System.Address)
Callback suitable for calling from C, to free user data
type Internal_Data is record
Func : System.Address;
Data : Data_Access;
end record;
The actual user callback
type Internal_Data_Access is access all Internal_Data;
type User_Data_Type (<>) is private;