summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-07-30 18:47:37 +1000
committerJed Barber <jjbarber@y7mail.com>2017-07-30 18:47:37 +1000
commit229b6b74e7c9cc09ce5c49023afb0eb745ac9db1 (patch)
tree80b79da37c30d65cdea00bb575c417a284c1547a /src
parentdc8e0bf275d2b0cc044022b13e5139d1cbc6fd86 (diff)
Forgot to add the c++ side of the screen functions...
Diffstat (limited to 'src')
-rw-r--r--src/c_fl_screen.cpp33
-rw-r--r--src/c_fl_screen.h18
-rw-r--r--src/fltk-screen.adb36
3 files changed, 69 insertions, 18 deletions
diff --git a/src/c_fl_screen.cpp b/src/c_fl_screen.cpp
new file mode 100644
index 0000000..4b13602
--- /dev/null
+++ b/src/c_fl_screen.cpp
@@ -0,0 +1,33 @@
+
+
+#include <FL/Fl.H>
+#include "c_fl_screen.h"
+
+
+int fl_screen_x() {
+ return Fl::x();
+}
+
+int fl_screen_y() {
+ return Fl::y();
+}
+
+int fl_screen_w() {
+ return Fl::w();
+}
+
+int fl_screen_h() {
+ return Fl::h();
+}
+
+
+
+
+int fl_screen_count() {
+ return Fl::screen_count();
+}
+
+void fl_screen_dpi(float &h, float &v, int n) {
+ Fl::screen_dpi(h, v, n);
+}
+
diff --git a/src/c_fl_screen.h b/src/c_fl_screen.h
new file mode 100644
index 0000000..287f170
--- /dev/null
+++ b/src/c_fl_screen.h
@@ -0,0 +1,18 @@
+
+
+#ifndef FL_SCREEN_GUARD
+#define FL_SCREEN_GUARD
+
+
+extern "C" int fl_screen_x();
+extern "C" int fl_screen_y();
+extern "C" int fl_screen_w();
+extern "C" int fl_screen_h();
+
+
+extern "C" int fl_screen_count();
+extern "C" void fl_screen_dpi(float &h, float &v, int n);
+
+
+#endif
+
diff --git a/src/fltk-screen.adb b/src/fltk-screen.adb
index 042cbfd..c85be21 100644
--- a/src/fltk-screen.adb
+++ b/src/fltk-screen.adb
@@ -12,53 +12,53 @@ use type
package body FLTK.Screen is
- function screen_x return Interfaces.C.int;
- pragma Import (C, screen_x, "screen_x");
+ function fl_screen_x return Interfaces.C.int;
+ pragma Import (C, fl_screen_x, "fl_screen_x");
- function screen_y return Interfaces.C.int;
- pragma Import (C, screen_y, "screen_y");
+ function fl_screen_y return Interfaces.C.int;
+ pragma Import (C, fl_screen_y, "fl_screen_y");
- function screen_w return Interfaces.C.int;
- pragma Import (C, screen_w, "screen_w");
+ function fl_screen_w return Interfaces.C.int;
+ pragma Import (C, fl_screen_w, "fl_screen_w");
- function screen_h return Interfaces.C.int;
- pragma Import (C, screen_h, "screen_h");
+ function fl_screen_h return Interfaces.C.int;
+ pragma Import (C, fl_screen_h, "fl_screen_h");
- function screen_count return Interfaces.C.int;
- pragma Import (C, screen_count, "screen_count");
+ function fl_screen_count return Interfaces.C.int;
+ pragma Import (C, fl_screen_count, "fl_screen_count");
- procedure screen_dpi
+ procedure fl_screen_dpi
(H, V : out Interfaces.C.C_float;
N : in Interfaces.C.int);
- pragma Import (C, screen_dpi, "screen_dpi");
+ pragma Import (C, fl_screen_dpi, "fl_screen_dpi");
function Get_X return Integer is
begin
- return Integer (screen_x);
+ return Integer (fl_screen_x);
end Get_X;
function Get_Y return Integer is
begin
- return Integer (screen_y);
+ return Integer (fl_screen_y);
end Get_Y;
function Get_W return Integer is
begin
- return Integer (screen_w);
+ return Integer (fl_screen_w);
end Get_W;
function Get_H return Integer is
begin
- return Integer (screen_h);
+ return Integer (fl_screen_h);
end Get_H;
@@ -66,7 +66,7 @@ package body FLTK.Screen is
function Get_Count return Integer is
begin
- return Integer (screen_count);
+ return Integer (fl_screen_count);
end Get_Count;
@@ -77,7 +77,7 @@ package body FLTK.Screen is
is
H, V : Interfaces.C.C_float;
begin
- screen_dpi (H, V, Interfaces.C.int (Screen_Number) - 1);
+ fl_screen_dpi (H, V, Interfaces.C.int (Screen_Number) - 1);
Horizontal := Float (H);
Vertical := Float (V);
end Get_DPI;