diff options
author | Jed Barber <jjbarber@y7mail.com> | 2017-05-14 13:33:27 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2017-05-14 13:33:27 +1000 |
commit | f3638a598d55629bf130c648416ca75f5edae1f1 (patch) | |
tree | bef111db3ab51c3233b60380ecc3ab6d25441eae /src/fltk-widgets-groups-text_displays.adb | |
parent | 371cccdf78fa9aaf49158ea57e598abcd5ff56f0 (diff) |
Cleaned up Draw/Handle code on Ada side
Diffstat (limited to 'src/fltk-widgets-groups-text_displays.adb')
-rw-r--r-- | src/fltk-widgets-groups-text_displays.adb | 76 |
1 files changed, 30 insertions, 46 deletions
diff --git a/src/fltk-widgets-groups-text_displays.adb b/src/fltk-widgets-groups-text_displays.adb index e805ff5..27324c2 100644 --- a/src/fltk-widgets-groups-text_displays.adb +++ b/src/fltk-widgets-groups-text_displays.adb @@ -17,15 +17,6 @@ package body FLTK.Widgets.Groups.Text_Displays is (W, H : in System.Address); pragma Import (C, text_display_set_handle_hook, "text_display_set_handle_hook"); - procedure fl_text_display_draw - (W : in System.Address); - pragma Import (C, fl_text_display_draw, "fl_text_display_draw"); - - function fl_text_display_handle - (W : in System.Address; - E : in Interfaces.C.int) - return Interfaces.C.int; - pragma Import (C, fl_text_display_handle, "fl_text_display_handle"); function new_fl_text_display (X, Y, W, H : in Interfaces.C.int; @@ -37,6 +28,7 @@ package body FLTK.Widgets.Groups.Text_Displays is (TD : in System.Address); pragma Import (C, free_fl_text_display, "free_fl_text_display"); + function fl_text_display_get_buffer (TD : in System.Address) return System.Address; @@ -120,44 +112,15 @@ package body FLTK.Widgets.Groups.Text_Displays is W : in Interfaces.C.int); pragma Import (C, fl_text_display_linenumber_width, "fl_text_display_linenumber_width"); + procedure fl_text_display_draw + (W : in System.Address); + pragma Import (C, fl_text_display_draw, "fl_text_display_draw"); - - - procedure Draw_Hook (U : in System.Address); - pragma Convention (C, Draw_Hook); - - procedure Draw_Hook - (U : in System.Address) - is - package Text_Display_Convert is new - System.Address_To_Access_Conversions (Text_Display'Class); - - Ada_Text_Display : access Text_Display'Class := - Text_Display_Convert.To_Pointer (U); - begin - Ada_Text_Display.Draw; - end Draw_Hook; - - - - - procedure Draw - (This : in out Text_Display) is - begin - fl_text_display_draw (This.Void_Ptr); - end Draw; - - - - - function Handle - (This : in out Text_Display; - Event : in Event_Kind) - return Event_Outcome is - begin - return Event_Outcome'Val - (fl_text_display_handle (This.Void_Ptr, Event_Kind'Pos (Event))); - end Handle; + function fl_text_display_handle + (W : in System.Address; + E : in Interfaces.C.int) + return Interfaces.C.int; + pragma Import (C, fl_text_display_handle, "fl_text_display_handle"); @@ -384,5 +347,26 @@ package body FLTK.Widgets.Groups.Text_Displays is end Set_Linenumber_Width; + + + procedure Draw + (This : in out Text_Display) is + begin + fl_text_display_draw (This.Void_Ptr); + end Draw; + + + + + function Handle + (This : in out Text_Display; + Event : in Event_Kind) + return Event_Outcome is + begin + return Event_Outcome'Val + (fl_text_display_handle (This.Void_Ptr, Event_Kind'Pos (Event))); + end Handle; + + end FLTK.Widgets.Groups.Text_Displays; |