aboutsummaryrefslogtreecommitdiff
path: root/src/images.adb
blob: 07897d15784fd44cb0aea52a8fbc5ffcb2a67f84 (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


with

    Ada.Command_Line,
    Ada.Directories,
    FLTK.Images.RGB.PNG,
    Here_I_Am;


package body Images is


    package ACom renames Ada.Command_Line;
    package ADir renames Ada.Directories;


    Dummy : constant FLTK.Color_Component_Array := (1 .. 0 => 0);




    function Load_Logo
        return FLTK.Images.RGB.RGB_Image'Class is
    begin
        declare
            Base_Path : String := ADir.Containing_Directory (Here_I_Am.Executable);
            Logo_Path : String :=
                ADir.Compose
               (ADir.Compose  --  No matter how many times I write this, still looks weird...
               (ADir.Compose
               (ADir.Compose (Base_Path, ".."), "share"), "adapad"), "logo.png");
        begin
            return FLTK.Images.RGB.PNG.Forge.Create (Logo_Path);
        end;
    exception
    when others =>
        return FLTK.Images.RGB.Forge.Create (Dummy, 0, 0);
    end Load_Logo;


end Images;