summaryrefslogtreecommitdiff
path: root/spec/fltk-widgets-groups-windows.ads
blob: dfa51d66c621963b3fc45d431d227d456920c04e (plain)
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
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407


--  Programmed by Jedidiah Barber
--  Released into the public domain


with

    FLTK.Images.RGB;

private with

    Interfaces.C.Strings;


package FLTK.Widgets.Groups.Windows is


    type Window is new Group with private;

    type Window_Reference (Data : not null access Window'Class) is limited null record
        with Implicit_Dereference => Data;

    type Modal_State is (Normal, Non_Modal, Modal);




    package Forge is

        function Create
               (X, Y, W, H : in Integer;
                Text       : in String := "")
            return Window;

        function Create
               (Parent     : in out Group'Class;
                X, Y, W, H : in     Integer;
                Text       : in     String := "")
            return Window;

        function Create
               (W, H : in Integer;
                Text : in String := "")
            return Window;

        function Create
               (Parent : in out Group'Class;
                W, H   : in     Integer;
                Text   : in     String := "")
            return Window;

    end Forge;




    --  Visibility  --

    procedure Show
           (This : in out Window);

    procedure Show_With_Args
           (This : in out Window);

    procedure Hide
           (This : in out Window);

    function Is_Shown
           (This : in Window)
        return Boolean;

    procedure Wait_For_Expose
           (This : in out Window);

    procedure Iconify
           (This : in out Window);

    procedure Make_Current
           (This : in out Window);

    function Last_Made_Current
        return access Window'Class;




    --  Fullscreen  --

    function Is_Fullscreen
           (This : in Window)
        return Boolean;

    procedure Fullscreen_On
           (This : in out Window);

    procedure Fullscreen_Off
           (This : in out Window);

    procedure Fullscreen_Off
           (This       : in out Window;
            X, Y, W, H : in     Integer);

    procedure Fullscreen_Screens
           (This                     : in out Window;
            Top, Bottom, Left, Right : in     Natural);




    --  Icons, Cursors  --

    procedure Set_Icon
           (This : in out Window;
            Pic  : in     FLTK.Images.RGB.RGB_Image'Class);

    procedure Set_Icons
           (This : in out Window;
            Pics : in     FLTK.Images.RGB.RGB_Image_Array);

    procedure Reset_Icons
           (This : in out Window);

    procedure Set_Default_Icon
           (Pic : in FLTK.Images.RGB.RGB_Image'Class);

    procedure Set_Default_Icons
           (Pics : in FLTK.Images.RGB.RGB_Image_Array);

    procedure Reset_Default_Icons;

    function Get_Icon_Label
           (This : in Window)
        return String;

    procedure Set_Icon_Label
           (This : in out Window;
            To   : in     String);

    procedure Set_Cursor
           (This : in out Window;
            To   : in     Mouse_Cursor_Kind);

    procedure Set_Cursor
           (This         : in out Window;
            Pic          : in     FLTK.Images.RGB.RGB_Image'Class;
            Hot_X, Hot_Y : in     Integer);

    procedure Set_Default_Cursor
           (This : in out Window;
            To   : in     Mouse_Cursor_Kind);




    --  Settings  --

    function Has_Border
           (This : in Window)
        return Boolean;

    procedure Set_Border
           (This  : in out Window;
            Value : in     Boolean := True);

    procedure Clear_Border
           (This : in out Window);

    function Is_Override
           (This : in Window)
        return Boolean;

    procedure Set_Override
           (This : in out Window);

    function Is_Modal
           (This : in Window)
        return Boolean;

    function Is_Non_Modal
           (This : in Window)
        return Boolean;

    function Get_Modal_State
           (This : in Window)
        return Modal_State;

    procedure Set_Modal
           (This : in out Window);

    procedure Set_Non_Modal
           (This : in out Window);

    procedure Set_Modal_State
           (This  : in out Window;
            Value : in     Modal_State);

    procedure Clear_Modal_State
           (This : in out Window);




    --  Labels, Hotspot, Shape  --

    function Get_Label
           (This : in Window)
        return String;

    procedure Set_Label
           (This : in out Window;
            Text : in     String);

    procedure Set_Labels
           (This            : in out Window;
            Text, Icon_Text : in     String);

    procedure Hotspot
           (This      : in out Window;
            X, Y      : in     Integer;
            Offscreen : in     Boolean := False);

    procedure Hotspot
           (This      : in out Window;
            Item      : in     Widget'Class;
            Offscreen : in     Boolean := False);

    procedure Shape
           (This : in out Window;
            Pic  : in     FLTK.Images.Image'Class);




    --  Dimensions  --

    procedure Set_Size_Range
           (This                           : in out Window;
            Min_W, Min_H                   : in     Integer;
            Max_W, Max_H, Incre_W, Incre_H : in     Integer := 0;
            Keep_Aspect                    : in     Boolean := False);

    procedure Resize
           (This       : in out Window;
            X, Y, W, H : in     Integer);

    function Is_Position_Forced
           (This : in Window)
        return Boolean;

    procedure Force_Position
           (This  : in out Window;
            State : in     Boolean := True);

    function Get_X_Root
           (This : in Window)
        return Integer;

    function Get_Y_Root
           (This : in Window)
        return Integer;

    function Get_Decorated_W
           (This : in Window)
        return Integer;

    function Get_Decorated_H
           (This : in Window)
        return Integer;




    -- Class Info  --

    function Get_X_Class
           (This : in Window)
        return String;

    procedure Set_X_Class
           (This  : in out Window;
            Value : in     String);

    function Get_Default_X_Class
        return String;

    procedure Set_Default_X_Class
           (Value : in String);

    function Is_Menu_Window
           (This : in Window)
        return Boolean;

    function Is_Tooltip_Window
           (This : in Window)
        return Boolean;




    --  Drawing, Events  --

    procedure Draw
           (This : in out Window);

    procedure Flush
           (This : in out Window);

    function Handle
           (This  : in out Window;
            Event : in     Event_Kind)
        return Event_Outcome;


private


    type Window is new Group with null record;

    overriding procedure Initialize
           (This : in out Window);

    overriding procedure Finalize
           (This : in out Window);

    procedure Extra_Init
           (This       : in out Window;
            X, Y, W, H : in     Integer;
            Text       : in     String)
    with Inline;

    procedure Extra_Final
           (This : in out Window)
    with Inline;


    pragma Inline (Show);
    pragma Inline (Show_With_Args);
    pragma Inline (Hide);
    pragma Inline (Is_Shown);
    pragma Inline (Wait_For_Expose);
    pragma Inline (Iconify);
    pragma Inline (Make_Current);
    pragma Inline (Last_Made_Current);

    pragma Inline (Is_Fullscreen);
    pragma Inline (Fullscreen_On);
    pragma Inline (Fullscreen_Off);
    pragma Inline (Fullscreen_Screens);

    pragma Inline (Set_Icon);
    pragma Inline (Set_Icons);
    pragma Inline (Reset_Icons);
    pragma Inline (Set_Default_Icon);
    pragma Inline (Set_Default_Icons);
    pragma Inline (Reset_Default_Icons);
    pragma Inline (Get_Icon_Label);
    pragma Inline (Set_Icon_Label);
    pragma Inline (Set_Cursor);
    pragma Inline (Set_Default_Cursor);

    pragma Inline (Has_Border);
    pragma Inline (Set_Border);
    pragma Inline (Clear_Border);
    pragma Inline (Is_Override);
    pragma Inline (Set_Override);
    pragma Inline (Is_Modal);
    pragma Inline (Is_Non_Modal);
    pragma Inline (Get_Modal_State);
    pragma Inline (Set_Modal);
    pragma Inline (Set_Non_Modal);
    pragma Inline (Set_Modal_State);
    pragma Inline (Clear_Modal_State);

    pragma Inline (Get_Label);
    pragma Inline (Set_Label);
    pragma Inline (Set_Labels);
    pragma Inline (Hotspot);
    pragma Inline (Shape);

    pragma Inline (Set_Size_Range);
    pragma Inline (Resize);
    pragma Inline (Is_Position_Forced);
    pragma Inline (Force_Position);
    pragma Inline (Get_X_Root);
    pragma Inline (Get_Y_Root);
    pragma Inline (Get_Decorated_W);
    pragma Inline (Get_Decorated_H);

    pragma Inline (Get_X_Class);
    pragma Inline (Set_X_Class);
    pragma Inline (Get_Default_X_Class);
    pragma Inline (Set_Default_X_Class);
    pragma Inline (Is_Menu_Window);
    pragma Inline (Is_Tooltip_Window);

    pragma Inline (Draw);
    pragma Inline (Flush);
    pragma Inline (Handle);


    Last_Current : access Window'Class := null;


end FLTK.Widgets.Groups.Windows;