summaryrefslogtreecommitdiff
path: root/body/fltk-widget_callback_conversions.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2025-01-21 21:04:54 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2025-01-21 21:04:54 +1300
commitb4438b2fbe895694be98e6e8426103deefc51448 (patch)
tree760d86cd7c06420a91dad102cc9546aee73146fc /body/fltk-widget_callback_conversions.adb
parenta4703a65b015140cd4a7a985db66264875ade734 (diff)
Split public API and private implementation files into different directories
Diffstat (limited to 'body/fltk-widget_callback_conversions.adb')
-rw-r--r--body/fltk-widget_callback_conversions.adb52
1 files changed, 52 insertions, 0 deletions
diff --git a/body/fltk-widget_callback_conversions.adb b/body/fltk-widget_callback_conversions.adb
new file mode 100644
index 0000000..29f920e
--- /dev/null
+++ b/body/fltk-widget_callback_conversions.adb
@@ -0,0 +1,52 @@
+
+
+-- Programmed by Jedidiah Barber
+-- Released into the public domain
+
+
+with
+
+ Ada.Unchecked_Conversion,
+ FLTK.Widgets;
+
+use type
+
+ FLTK.Widgets.Widget_Callback;
+
+
+package body FLTK.Widget_Callback_Conversions is
+
+
+ function To_Access
+ (Addy : in Storage.Integer_Address)
+ return FLTK.Widgets.Widget_Callback
+ is
+ function Raw is new Ada.Unchecked_Conversion
+ (Storage.Integer_Address, FLTK.Widgets.Widget_Callback);
+ begin
+ if Addy = Null_Pointer then
+ return null;
+ else
+ return Raw (Addy);
+ end if;
+ end To_Access;
+
+
+ function To_Address
+ (Call : in FLTK.Widgets.Widget_Callback)
+ return Storage.Integer_Address
+ is
+ function Raw is new Ada.Unchecked_Conversion
+ (FLTK.Widgets.Widget_Callback, Storage.Integer_Address);
+ begin
+ if Call = null then
+ return Null_Pointer;
+ else
+ return Raw (Call);
+ end if;
+ end To_Address;
+
+
+end FLTK.Widget_Callback_Conversions;
+
+