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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
|
-- Programmed by Jedidiah Barber
-- Released into the public domain
with
Interfaces.C;
package body FLTK.Widgets.Groups.Scrolls is
------------------------
-- Functions From C --
------------------------
function new_fl_scroll
(X, Y, W, H : in Interfaces.C.int;
Text : in Interfaces.C.char_array)
return Storage.Integer_Address;
pragma Import (C, new_fl_scroll, "new_fl_scroll");
pragma Inline (new_fl_scroll);
procedure free_fl_scroll
(S : in Storage.Integer_Address);
pragma Import (C, free_fl_scroll, "free_fl_scroll");
pragma Inline (free_fl_scroll);
procedure fl_scroll_clear
(S : in Storage.Integer_Address);
pragma Import (C, fl_scroll_clear, "fl_scroll_clear");
pragma Inline (fl_scroll_clear);
procedure fl_scroll_to
(S : in Storage.Integer_Address;
X, Y : in Interfaces.C.int);
pragma Import (C, fl_scroll_to, "fl_scroll_to");
pragma Inline (fl_scroll_to);
procedure fl_scroll_set_type
(S : in Storage.Integer_Address;
T : in Interfaces.C.int);
pragma Import (C, fl_scroll_set_type, "fl_scroll_set_type");
pragma Inline (fl_scroll_set_type);
function fl_scroll_get_size
(S : in Storage.Integer_Address)
return Interfaces.C.int;
pragma Import (C, fl_scroll_get_size, "fl_scroll_get_size");
pragma Inline (fl_scroll_get_size);
procedure fl_scroll_set_size
(S : in Storage.Integer_Address;
T : in Interfaces.C.int);
pragma Import (C, fl_scroll_set_size, "fl_scroll_set_size");
pragma Inline (fl_scroll_set_size);
function fl_scroll_xposition
(S : in Storage.Integer_Address)
return Interfaces.C.int;
pragma Import (C, fl_scroll_xposition, "fl_scroll_xposition");
pragma Inline (fl_scroll_xposition);
function fl_scroll_yposition
(S : in Storage.Integer_Address)
return Interfaces.C.int;
pragma Import (C, fl_scroll_yposition, "fl_scroll_yposition");
pragma Inline (fl_scroll_yposition);
procedure fl_scroll_draw
(S : in Storage.Integer_Address);
pragma Import (C, fl_scroll_draw, "fl_scroll_draw");
pragma Inline (fl_scroll_draw);
function fl_scroll_handle
(S : in Storage.Integer_Address;
E : in Interfaces.C.int)
return Interfaces.C.int;
pragma Import (C, fl_scroll_handle, "fl_scroll_handle");
pragma Inline (fl_scroll_handle);
-------------------
-- Destructors --
-------------------
procedure Extra_Final
(This : in out Scroll) is
begin
Extra_Final (Group (This));
end Extra_Final;
procedure Finalize
(This : in out Scroll) is
begin
Extra_Final (This);
if This.Void_Ptr /= Null_Pointer and This.Needs_Dealloc then
free_fl_scroll (This.Void_Ptr);
This.Void_Ptr := Null_Pointer;
end if;
end Finalize;
--------------------
-- Constructors --
--------------------
procedure Extra_Init
(This : in out Scroll;
X, Y, W, H : in Integer;
Text : in String) is
begin
Extra_Init (Group (This), X, Y, W, H, Text);
end Extra_Init;
procedure Initialize
(This : in out Scroll) is
begin
This.Draw_Ptr := fl_scroll_draw'Address;
This.Handle_Ptr := fl_scroll_handle'Address;
end Initialize;
package body Forge is
function Create
(X, Y, W, H : in Integer;
Text : in String := "")
return Scroll is
begin
return This : Scroll do
This.Void_Ptr := new_fl_scroll
(Interfaces.C.int (X),
Interfaces.C.int (Y),
Interfaces.C.int (W),
Interfaces.C.int (H),
Interfaces.C.To_C (Text));
Extra_Init (This, X, Y, W, H, Text);
end return;
end Create;
end Forge;
-----------------------
-- API Subprograms --
-----------------------
procedure Clear
(This : in out Scroll) is
begin
fl_scroll_clear (This.Void_Ptr);
end Clear;
procedure Scroll_To
(This : in out Scroll;
X, Y : in Integer) is
begin
fl_scroll_to (This.Void_Ptr, Interfaces.C.int (X), Interfaces.C.int (Y));
end Scroll_To;
procedure Set_Type
(This : in out Scroll;
Mode : in Scroll_Kind) is
begin
fl_scroll_set_type (This.Void_Ptr, Scroll_Kind'Pos (Mode));
end Set_Type;
function Get_Scrollbar_Size
(This : in Scroll)
return Integer is
begin
return Integer (fl_scroll_get_size (This.Void_Ptr));
end Get_Scrollbar_Size;
procedure Set_Scrollbar_Size
(This : in out Scroll;
To : in Integer) is
begin
fl_scroll_set_size (This.Void_Ptr, Interfaces.C.int (To));
end Set_Scrollbar_Size;
function Get_Scroll_X
(This : in Scroll)
return Integer is
begin
return Integer (fl_scroll_xposition (This.Void_Ptr));
end Get_Scroll_X;
function Get_Scroll_Y
(This : in Scroll)
return Integer is
begin
return Integer (fl_scroll_yposition (This.Void_Ptr));
end Get_Scroll_Y;
procedure Draw
(This : in out Scroll) is
begin
Group (This).Draw;
end Draw;
function Handle
(This : in out Scroll;
Event : in Event_Kind)
return Event_Outcome is
begin
return Group (This).Handle (Event);
end Handle;
end FLTK.Widgets.Groups.Scrolls;
|