summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2017-07-30 12:51:47 +1000
committerJed Barber <jjbarber@y7mail.com>2017-07-30 12:51:47 +1000
commitdc8e0bf275d2b0cc044022b13e5139d1cbc6fd86 (patch)
tree4e5c1709a9bbca41acfddf63c3991282e6b9ec7b /src
parent88e5c98995d1b330abe2982b27c472d4ae52fad6 (diff)
Added some FLTK global screen functions
Diffstat (limited to 'src')
-rw-r--r--src/fltk-screen.adb87
-rw-r--r--src/fltk-screen.ads33
-rw-r--r--src/fltk.ads4
3 files changed, 122 insertions, 2 deletions
diff --git a/src/fltk-screen.adb b/src/fltk-screen.adb
new file mode 100644
index 0000000..042cbfd
--- /dev/null
+++ b/src/fltk-screen.adb
@@ -0,0 +1,87 @@
+
+
+with
+
+ Interfaces.C;
+
+use type
+
+ Interfaces.C.int;
+
+
+package body FLTK.Screen is
+
+
+ function screen_x return Interfaces.C.int;
+ pragma Import (C, screen_x, "screen_x");
+
+ function screen_y return Interfaces.C.int;
+ pragma Import (C, screen_y, "screen_y");
+
+ function screen_w return Interfaces.C.int;
+ pragma Import (C, screen_w, "screen_w");
+
+ function screen_h return Interfaces.C.int;
+ pragma Import (C, screen_h, "screen_h");
+
+
+
+
+ function screen_count return Interfaces.C.int;
+ pragma Import (C, screen_count, "screen_count");
+
+ procedure screen_dpi
+ (H, V : out Interfaces.C.C_float;
+ N : in Interfaces.C.int);
+ pragma Import (C, screen_dpi, "screen_dpi");
+
+
+
+
+ function Get_X return Integer is
+ begin
+ return Integer (screen_x);
+ end Get_X;
+
+
+ function Get_Y return Integer is
+ begin
+ return Integer (screen_y);
+ end Get_Y;
+
+
+ function Get_W return Integer is
+ begin
+ return Integer (screen_w);
+ end Get_W;
+
+
+ function Get_H return Integer is
+ begin
+ return Integer (screen_h);
+ end Get_H;
+
+
+
+
+ function Get_Count return Integer is
+ begin
+ return Integer (screen_count);
+ end Get_Count;
+
+
+ -- Screen numbers in the range 1 .. Get_Count
+ procedure Get_DPI
+ (Horizontal, Vertical : out Float;
+ Screen_Number : in Integer := 1)
+ is
+ H, V : Interfaces.C.C_float;
+ begin
+ screen_dpi (H, V, Interfaces.C.int (Screen_Number) - 1);
+ Horizontal := Float (H);
+ Vertical := Float (V);
+ end Get_DPI;
+
+
+end FLTK.Screen;
+
diff --git a/src/fltk-screen.ads b/src/fltk-screen.ads
new file mode 100644
index 0000000..10060d4
--- /dev/null
+++ b/src/fltk-screen.ads
@@ -0,0 +1,33 @@
+
+
+package FLTK.Screen is
+
+
+ function Get_X return Integer;
+ function Get_Y return Integer;
+ function Get_W return Integer;
+ function Get_H return Integer;
+
+
+ function Get_Count return Integer;
+
+
+ -- Screen numbers in the range 1 .. Get_Count
+ procedure Get_DPI
+ (Horizontal, Vertical : out Float;
+ Screen_Number : in Integer := 1);
+
+
+private
+
+
+ pragma Inline (Get_X);
+ pragma Inline (Get_Y);
+ pragma Inline (Get_W);
+ pragma Inline (Get_H);
+ pragma Inline (Get_Count);
+ pragma Inline (Get_DPI);
+
+
+end FLTK.Screen;
+
diff --git a/src/fltk.ads b/src/fltk.ads
index 203ee5e..d07435e 100644
--- a/src/fltk.ads
+++ b/src/fltk.ads
@@ -138,8 +138,8 @@ package FLTK is
Times_Italic,
Times_Bold_Italic,
Symbol,
- Screen,
- Screen_Bold,
+ Monospace,
+ Monospace_Bold,
Zapf_Dingbats,
Free_Font);