summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-inputs-text.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-09 14:58:19 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-09 14:58:19 +1300
commit17473af7e8ed13e0a9399a69442f9839e5d83aef (patch)
tree6cd9adf8cde65847f34fbd1cf0ac61c3ad5936ea /src/fltk-widgets-inputs-text.adb
parent3a9028302447ad84363c580b2152f30417186667 (diff)
Used C FFI to make Extra_Init and Extra_Final calls more consistent
Diffstat (limited to 'src/fltk-widgets-inputs-text.adb')
-rw-r--r--src/fltk-widgets-inputs-text.adb40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/fltk-widgets-inputs-text.adb b/src/fltk-widgets-inputs-text.adb
index 64e2e0f..e9b9545 100644
--- a/src/fltk-widgets-inputs-text.adb
+++ b/src/fltk-widgets-inputs-text.adb
@@ -50,6 +50,22 @@ package body FLTK.Widgets.Inputs.Text is
-- Destructors --
-------------------
+ -- Message received, every zig will take off
+ procedure text_input_extra_final_hook
+ (Ada_Obj : in Storage.Integer_Address);
+ pragma Export (C, text_input_extra_final_hook, "text_input_extra_final_hook");
+
+ procedure text_input_extra_final_hook
+ (Ada_Obj : in Storage.Integer_Address)
+ is
+ My_Text_Input : Text_Input;
+ for My_Text_Input'Address use Storage.To_Address (Ada_Obj);
+ pragma Import (Ada, My_Text_Input);
+ begin
+ Extra_Final (My_Text_Input);
+ end text_input_extra_final_hook;
+
+
procedure Extra_Final
(This : in out Text_Input) is
begin
@@ -74,6 +90,30 @@ package body FLTK.Widgets.Inputs.Text is
-- Constructors --
--------------------
+ -- Last stop, everyone out!
+ procedure text_input_extra_init_hook
+ (Ada_Obj : in Storage.Integer_Address;
+ X, Y, W, H : in Interfaces.C.int;
+ C_Str : in Interfaces.C.Strings.chars_ptr);
+ pragma Export (C, text_input_extra_init_hook, "text_input_extra_init_hook");
+
+ procedure text_input_extra_init_hook
+ (Ada_Obj : in Storage.Integer_Address;
+ X, Y, W, H : in Interfaces.C.int;
+ C_Str : in Interfaces.C.Strings.chars_ptr)
+ is
+ My_Text_Input : Text_Input;
+ for My_Text_Input'Address use Storage.To_Address (Ada_Obj);
+ pragma Import (Ada, My_Text_Input);
+ begin
+ Extra_Init
+ (My_Text_Input,
+ Integer (X), Integer (Y),
+ Integer (W), Integer (H),
+ Interfaces.C.Strings.Value (C_Str));
+ end text_input_extra_init_hook;
+
+
procedure Extra_Init
(This : in out Text_Input;
X, Y, W, H : in Integer;