aboutsummaryrefslogtreecommitdiff
path: root/src/images.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/images.adb')
-rw-r--r--src/images.adb44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/images.adb b/src/images.adb
new file mode 100644
index 0000000..07897d1
--- /dev/null
+++ b/src/images.adb
@@ -0,0 +1,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;
+
+