summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c_fl_event.cpp10
-rw-r--r--src/c_fl_event.h11
-rw-r--r--src/fltk-event.adb26
-rw-r--r--src/fltk-event.ads11
-rw-r--r--src/fltk-widgets.ads5
-rw-r--r--src/fltk.ads7
6 files changed, 65 insertions, 5 deletions
diff --git a/src/c_fl_event.cpp b/src/c_fl_event.cpp
new file mode 100644
index 0000000..526ed44
--- /dev/null
+++ b/src/c_fl_event.cpp
@@ -0,0 +1,10 @@
+
+
+#include <FL/Fl.H>
+#include "c_fl_event.h"
+
+
+int fl_event_key() {
+ return Fl::event_key();
+}
+
diff --git a/src/c_fl_event.h b/src/c_fl_event.h
new file mode 100644
index 0000000..c71618e
--- /dev/null
+++ b/src/c_fl_event.h
@@ -0,0 +1,11 @@
+
+
+#ifndef FL_EVENT_GUARD
+#define FL_EVENT_GUARD
+
+
+extern "C" int fl_event_key();
+
+
+#endif
+
diff --git a/src/fltk-event.adb b/src/fltk-event.adb
new file mode 100644
index 0000000..a62f0ee
--- /dev/null
+++ b/src/fltk-event.adb
@@ -0,0 +1,26 @@
+
+
+with
+
+ Interfaces.C;
+
+
+package body FLTK.Event is
+
+
+ function fl_event_key
+ return Interfaces.C.int;
+ pragma Import (C, fl_event_key, "fl_event_key");
+
+
+
+
+ function Last_Keypress
+ return Shortcut_Key is
+ begin
+ return C_To_Key (Interfaces.C.unsigned_long (fl_event_key));
+ end Last_Keypress;
+
+
+end FLTK.Event;
+
diff --git a/src/fltk-event.ads b/src/fltk-event.ads
new file mode 100644
index 0000000..7a640fe
--- /dev/null
+++ b/src/fltk-event.ads
@@ -0,0 +1,11 @@
+
+
+package FLTK.Event is
+
+
+ function Last_Keypress
+ return Shortcut_Key;
+
+
+end FLTK.Event;
+
diff --git a/src/fltk-widgets.ads b/src/fltk-widgets.ads
index 5205106..3cea435 100644
--- a/src/fltk-widgets.ads
+++ b/src/fltk-widgets.ads
@@ -23,11 +23,6 @@ package FLTK.Widgets is
type Widget_Callback is access procedure
(Item : in out Widget'Class);
- type Font_Size is new Natural;
- Normal_Size : constant Font_Size := 14;
-
- type Event_Outcome is (Not_Handled, Handled);
-
diff --git a/src/fltk.ads b/src/fltk.ads
index d07435e..8a6a933 100644
--- a/src/fltk.ads
+++ b/src/fltk.ads
@@ -144,6 +144,10 @@ package FLTK is
Free_Font);
+ type Font_Size is new Natural;
+ Normal_Size : constant Font_Size := 14;
+
+
type Label_Kind is
(Normal_Label,
No_Label,
@@ -185,6 +189,9 @@ package FLTK is
Fullscreen);
+ type Event_Outcome is (Not_Handled, Handled);
+
+
private