summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-inputs-file.adb
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-05-14 13:33:27 +1000
committerJed Barber <jjbarber@y7mail.com>2017-05-14 13:33:27 +1000
commitf3638a598d55629bf130c648416ca75f5edae1f1 (patch)
treebef111db3ab51c3233b60380ecc3ab6d25441eae /src/fltk-widgets-inputs-file.adb
parent371cccdf78fa9aaf49158ea57e598abcd5ff56f0 (diff)
Cleaned up Draw/Handle code on Ada side
Diffstat (limited to 'src/fltk-widgets-inputs-file.adb')
-rw-r--r--src/fltk-widgets-inputs-file.adb74
1 files changed, 29 insertions, 45 deletions
diff --git a/src/fltk-widgets-inputs-file.adb b/src/fltk-widgets-inputs-file.adb
index cecc74e..187ec8d 100644
--- a/src/fltk-widgets-inputs-file.adb
+++ b/src/fltk-widgets-inputs-file.adb
@@ -16,15 +16,6 @@ package body FLTK.Widgets.Inputs.File is
(W, H : in System.Address);
pragma Import (C, file_input_set_handle_hook, "file_input_set_handle_hook");
- procedure fl_file_input_draw
- (W : in System.Address);
- pragma Import (C, fl_file_input_draw, "fl_file_input_draw");
-
- function fl_file_input_handle
- (W : in System.Address;
- E : in Interfaces.C.int)
- return Interfaces.C.int;
- pragma Import (C, fl_file_input_handle, "fl_file_input_handle");
function new_fl_file_input
(X, Y, W, H : in Interfaces.C.int;
@@ -37,43 +28,15 @@ package body FLTK.Widgets.Inputs.File is
pragma Import (C, free_fl_file_input, "free_fl_file_input");
+ procedure fl_file_input_draw
+ (W : in System.Address);
+ pragma Import (C, fl_file_input_draw, "fl_file_input_draw");
-
- procedure Draw_Hook (U : in System.Address);
- pragma Convention (C, Draw_Hook);
-
- procedure Draw_Hook
- (U : in System.Address)
- is
- package File_Input_Convert is new
- System.Address_To_Access_Conversions (File_Input'Class);
-
- Ada_Input : access File_Input'Class :=
- File_Input_Convert.To_Pointer (U);
- begin
- Ada_Input.Draw;
- end Draw_Hook;
-
-
-
-
- procedure Draw
- (This : in out File_Input) is
- begin
- fl_file_input_draw (This.Void_Ptr);
- end Draw;
-
-
-
-
- function Handle
- (This : in out File_Input;
- Event : in Event_Kind)
- return Event_Outcome is
- begin
- return Event_Outcome'Val
- (fl_file_input_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
- end Handle;
+ function fl_file_input_handle
+ (W : in System.Address;
+ E : in Interfaces.C.int)
+ return Interfaces.C.int;
+ pragma Import (C, fl_file_input_handle, "fl_file_input_handle");
@@ -114,5 +77,26 @@ package body FLTK.Widgets.Inputs.File is
end Create;
+
+
+ procedure Draw
+ (This : in out File_Input) is
+ begin
+ fl_file_input_draw (This.Void_Ptr);
+ end Draw;
+
+
+
+
+ function Handle
+ (This : in out File_Input;
+ Event : in Event_Kind)
+ return Event_Outcome is
+ begin
+ return Event_Outcome'Val
+ (fl_file_input_handle (This.Void_Ptr, Event_Kind'Pos (Event)));
+ end Handle;
+
+
end FLTK.Widgets.Inputs.File;