1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
with
Interfaces.C;
use type
Interfaces.C.int;
package body FLTK.Screen is
function fl_screen_x return Interfaces.C.int;
pragma Import (C, fl_screen_x, "fl_screen_x");
function fl_screen_y return Interfaces.C.int;
pragma Import (C, fl_screen_y, "fl_screen_y");
function fl_screen_w return Interfaces.C.int;
pragma Import (C, fl_screen_w, "fl_screen_w");
function fl_screen_h return Interfaces.C.int;
pragma Import (C, fl_screen_h, "fl_screen_h");
function fl_screen_count return Interfaces.C.int;
pragma Import (C, fl_screen_count, "fl_screen_count");
procedure fl_screen_dpi
(H, V : out Interfaces.C.C_float;
N : in Interfaces.C.int);
pragma Import (C, fl_screen_dpi, "fl_screen_dpi");
function Get_X return Integer is
begin
return Integer (fl_screen_x);
end Get_X;
function Get_Y return Integer is
begin
return Integer (fl_screen_y);
end Get_Y;
function Get_W return Integer is
begin
return Integer (fl_screen_w);
end Get_W;
function Get_H return Integer is
begin
return Integer (fl_screen_h);
end Get_H;
function Get_Count return Integer is
begin
return Integer (fl_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
fl_screen_dpi (H, V, Interfaces.C.int (Screen_Number) - 1);
Horizontal := Float (H);
Vertical := Float (V);
end Get_DPI;
end FLTK.Screen;
|