summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/c_fl_event.cpp23
-rw-r--r--src/c_fl_event.h7
-rw-r--r--src/fltk-event.adb64
-rw-r--r--src/fltk-event.ads18
4 files changed, 112 insertions, 0 deletions
diff --git a/src/c_fl_event.cpp b/src/c_fl_event.cpp
index 526ed44..17f3ee8 100644
--- a/src/c_fl_event.cpp
+++ b/src/c_fl_event.cpp
@@ -8,3 +8,26 @@ int fl_event_key() {
return Fl::event_key();
}
+
+
+
+int fl_event_x() {
+ return Fl::event_x();
+}
+
+int fl_event_x_root() {
+ return Fl::event_x_root();
+}
+
+int fl_event_y() {
+ return Fl::event_y();
+}
+
+int fl_event_y_root() {
+ return Fl::event_y_root();
+}
+
+int fl_event_is_click() {
+ return Fl::event_is_click();
+}
+
diff --git a/src/c_fl_event.h b/src/c_fl_event.h
index c71618e..6889eed 100644
--- a/src/c_fl_event.h
+++ b/src/c_fl_event.h
@@ -7,5 +7,12 @@
extern "C" int fl_event_key();
+extern "C" int fl_event_x();
+extern "C" int fl_event_x_root();
+extern "C" int fl_event_y();
+extern "C" int fl_event_y_root();
+extern "C" int fl_event_is_click();
+
+
#endif
diff --git a/src/fltk-event.adb b/src/fltk-event.adb
index a62f0ee..398021d 100644
--- a/src/fltk-event.adb
+++ b/src/fltk-event.adb
@@ -4,6 +4,10 @@ with
Interfaces.C;
+use type
+
+ Interfaces.C.int;
+
package body FLTK.Event is
@@ -15,6 +19,29 @@ package body FLTK.Event is
+ function fl_event_x
+ return Interfaces.C.int;
+ pragma Import (C, fl_event_x, "fl_event_x");
+
+ function fl_event_x_root
+ return Interfaces.C.int;
+ pragma Import (C, fl_event_x_root, "fl_event_x_root");
+
+ function fl_event_y
+ return Interfaces.C.int;
+ pragma Import (C, fl_event_y, "fl_event_y");
+
+ function fl_event_y_root
+ return Interfaces.C.int;
+ pragma Import (C, fl_event_y_root, "fl_event_y_root");
+
+ function fl_event_is_click
+ return Interfaces.C.int;
+ pragma Import (C, fl_event_is_click, "fl_event_is_click");
+
+
+
+
function Last_Keypress
return Shortcut_Key is
begin
@@ -22,5 +49,42 @@ package body FLTK.Event is
end Last_Keypress;
+
+
+ function Mouse_X
+ return Integer is
+ begin
+ return Integer (fl_event_x);
+ end Mouse_X;
+
+
+ function Mouse_X_Root
+ return Integer is
+ begin
+ return Integer (fl_event_x_root);
+ end Mouse_X_Root;
+
+
+ function Mouse_Y
+ return Integer is
+ begin
+ return Integer (fl_event_y);
+ end Mouse_Y;
+
+
+ function Mouse_Y_Root
+ return Integer is
+ begin
+ return Integer (fl_event_y_root);
+ end Mouse_Y_Root;
+
+
+ function Is_Click
+ return Boolean is
+ begin
+ return fl_event_is_click /= 0;
+ end Is_Click;
+
+
end FLTK.Event;
diff --git a/src/fltk-event.ads b/src/fltk-event.ads
index 7a640fe..fc6fafb 100644
--- a/src/fltk-event.ads
+++ b/src/fltk-event.ads
@@ -7,5 +7,23 @@ package FLTK.Event is
return Shortcut_Key;
+
+
+ function Mouse_X
+ return Integer;
+
+ function Mouse_X_Root
+ return Integer;
+
+ function Mouse_Y
+ return Integer;
+
+ function Mouse_Y_Root
+ return Integer;
+
+ function Is_Click
+ return Boolean;
+
+
end FLTK.Event;