summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-valuators-sliders-scrollbars.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-valuators-sliders-scrollbars.adb
parent3a9028302447ad84363c580b2152f30417186667 (diff)
Used C FFI to make Extra_Init and Extra_Final calls more consistent
Diffstat (limited to 'src/fltk-widgets-valuators-sliders-scrollbars.adb')
-rw-r--r--src/fltk-widgets-valuators-sliders-scrollbars.adb56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/fltk-widgets-valuators-sliders-scrollbars.adb b/src/fltk-widgets-valuators-sliders-scrollbars.adb
index 2afca08..84a0cc6 100644
--- a/src/fltk-widgets-valuators-sliders-scrollbars.adb
+++ b/src/fltk-widgets-valuators-sliders-scrollbars.adb
@@ -12,6 +12,10 @@ with
package body FLTK.Widgets.Valuators.Sliders.Scrollbars is
+ ------------------------
+ -- Functions From C --
+ ------------------------
+
procedure scrollbar_set_draw_hook
(W, D : in Storage.Integer_Address);
pragma Import (C, scrollbar_set_draw_hook, "scrollbar_set_draw_hook");
@@ -88,6 +92,26 @@ package body FLTK.Widgets.Valuators.Sliders.Scrollbars is
+ -------------------
+ -- Destructors --
+ -------------------
+
+ -- End of the line
+ procedure scrollbar_extra_final_hook
+ (Ada_Obj : in Storage.Integer_Address);
+ pragma Export (C, scrollbar_extra_final_hook, "scrollbar_extra_final_hook");
+
+ procedure scrollbar_extra_final_hook
+ (Ada_Obj : in Storage.Integer_Address)
+ is
+ My_Scrollbar : Scrollbar;
+ for My_Scrollbar'Address use Storage.To_Address (Ada_Obj);
+ pragma Import (Ada, My_Scrollbar);
+ begin
+ Extra_Final (My_Scrollbar);
+ end scrollbar_extra_final_hook;
+
+
procedure Extra_Final
(This : in out Scrollbar) is
begin
@@ -108,6 +132,34 @@ package body FLTK.Widgets.Valuators.Sliders.Scrollbars is
+ --------------------
+ -- Constructors --
+ --------------------
+
+ -- Radio signal successfully intercepted
+ procedure scrollbar_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, scrollbar_extra_init_hook, "scrollbar_extra_init_hook");
+
+ procedure scrollbar_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_Scrollbar : Scrollbar;
+ for My_Scrollbar'Address use Storage.To_Address (Ada_Obj);
+ pragma Import (Ada, My_Scrollbar);
+ begin
+ Extra_Init
+ (My_Scrollbar,
+ Integer (X), Integer (Y),
+ Integer (W), Integer (H),
+ Interfaces.C.Strings.Value (C_Str));
+ end scrollbar_extra_init_hook;
+
+
procedure Extra_Init
(This : in out Scrollbar;
X, Y, W, H : in Integer;
@@ -142,6 +194,10 @@ package body FLTK.Widgets.Valuators.Sliders.Scrollbars is
+ -----------------------
+ -- API Subprograms --
+ -----------------------
+
function Get_Line_Size
(This : in Scrollbar)
return Natural is