summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-browsers-textline-file.ads
blob: 11093d3a22e7ea2fbf9a710b2ada44112e14bae6 (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


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


with

    FLTK.Filenames;


package FLTK.Widgets.Groups.Browsers.Textline.File is


    type File_Browser is new Textline_Browser with private;

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

    type File_Kind is (Files, Directories);

    type Icon_Size is mod 256;




    package Forge is

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

    end Forge;




    function Load
           (This : in out File_Browser;
            Dir  : in     String;
            Sort : in not null FLTK.Filenames.Compare_Function :=
                FLTK.Filenames.Numeric_Sort'Access)
        return Natural;

    procedure Load
           (This : in out File_Browser;
            Dir  : in     String;
            Sort : in not null FLTK.Filenames.Compare_Function :=
                FLTK.Filenames.Numeric_Sort'Access);




    function Get_File_Kind
           (This : in File_Browser)
        return File_Kind;

    procedure Set_File_Kind
           (This  : in out File_Browser;
            Value : in     File_Kind);

    function Get_Filter
           (This : in File_Browser)
        return String;

    procedure Set_Filter
           (This  : in out File_Browser;
            Value : in     String);

    function Get_Icon_Size
           (This : in File_Browser)
        return Icon_Size;

    procedure Set_Icon_Size
           (This  : in out File_Browser;
            Value : in     Icon_Size);

    function Get_Text_Size
           (This : in File_Browser)
        return Font_Size;

    procedure Set_Text_Size
           (This : in out File_Browser;
            Size : in     Font_Size);


private


    type File_Browser is new Textline_Browser with null record;

    overriding procedure Initialize
           (This : in out File_Browser);

    overriding procedure Finalize
           (This : in out File_Browser);

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

    procedure Extra_Final
           (This : in out File_Browser);


    pragma Inline (Set_File_Kind);
    pragma Inline (Set_Filter);
    pragma Inline (Get_Icon_Size);
    pragma Inline (Set_Icon_Size);
    pragma Inline (Get_Text_Size);
    pragma Inline (Set_Text_Size);


end FLTK.Widgets.Groups.Browsers.Textline.File;