From 5f4595813d3ab42bad6e86e6509d0cbedc972926 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Tue, 21 Jan 2025 11:21:22 +1300 Subject: Adjusted project files --- fltkada.gpr | 2 -- proj/adjuster_test.gpr | 28 ------------------ proj/compare.gpr | 28 ------------------ proj/dirlist.gpr | 28 ------------------ proj/page_formats.gpr | 28 ------------------ proj/shared.gpr | 13 --------- test/adjuster.adb | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++ test/adjuster_test.adb | 79 -------------------------------------------------- tests.gpr | 32 ++++++++++++++++---- tools.gpr | 4 +-- 10 files changed, 106 insertions(+), 215 deletions(-) delete mode 100644 proj/adjuster_test.gpr delete mode 100644 proj/compare.gpr delete mode 100644 proj/dirlist.gpr delete mode 100644 proj/page_formats.gpr delete mode 100644 proj/shared.gpr create mode 100644 test/adjuster.adb delete mode 100644 test/adjuster_test.adb diff --git a/fltkada.gpr b/fltkada.gpr index ea624f1..7fbd78d 100644 --- a/fltkada.gpr +++ b/fltkada.gpr @@ -5,14 +5,12 @@ library project FLTKAda is for Languages use ("Ada", "C++"); - for Source_Dirs use ("src"); for Object_Dir use "obj"; for Library_Dir use "lib"; for Library_Name use "fltkada"; for Library_Kind use "dynamic"; - package Compiler is for Default_Switches("Ada") use ("-gnaty4aAbcefhiklM100nprt"); for Default_Switches("C++") use ("-Wall","-Wextra","-std=c++11"); diff --git a/proj/adjuster_test.gpr b/proj/adjuster_test.gpr deleted file mode 100644 index 4197dd5..0000000 --- a/proj/adjuster_test.gpr +++ /dev/null @@ -1,28 +0,0 @@ - - -with - - "fltkada", - "shared"; - - -project Adjuster_Test is - - - for Languages use ("Ada"); - - for Source_Dirs use ("../test/**"); - for Object_Dir use "../obj"; - for Exec_Dir use "../bin"; - for Main use ("adjuster_test.adb"); - - package Builder is - for Executable ("adjuster_test.adb") use "adjuster"; - end Builder; - - package Compiler renames Shared.Compiler; - - -end Adjuster_Test; - - diff --git a/proj/compare.gpr b/proj/compare.gpr deleted file mode 100644 index fc46807..0000000 --- a/proj/compare.gpr +++ /dev/null @@ -1,28 +0,0 @@ - - -with - - "fltkada", - "shared"; - - -project Compare is - - - for Languages use ("Ada"); - - for Source_Dirs use ("../test/**"); - for Object_Dir use "../obj"; - for Exec_Dir use "../bin"; - for Main use ("compare.adb"); - - package Builder is - for Executable ("compare.adb") use "compare"; - end Builder; - - package Compiler renames Shared.Compiler; - - -end Compare; - - diff --git a/proj/dirlist.gpr b/proj/dirlist.gpr deleted file mode 100644 index ed096f2..0000000 --- a/proj/dirlist.gpr +++ /dev/null @@ -1,28 +0,0 @@ - - -with - - "fltkada", - "shared"; - - -project Dirlist is - - - for Languages use ("Ada"); - - for Source_Dirs use ("../test/**"); - for Object_Dir use "../obj"; - for Exec_Dir use "../bin"; - for Main use ("dirlist.adb"); - - package Builder is - for Executable ("dirlist.adb") use "dirlist"; - end Builder; - - package Compiler renames Shared.Compiler; - - -end Dirlist; - - diff --git a/proj/page_formats.gpr b/proj/page_formats.gpr deleted file mode 100644 index 0e0ebfe..0000000 --- a/proj/page_formats.gpr +++ /dev/null @@ -1,28 +0,0 @@ - - -with - - "fltkada", - "shared"; - - -project Page_Formats is - - - for Languages use ("Ada"); - - for Source_Dirs use ("../test/**"); - for Object_Dir use "../obj"; - for Exec_Dir use "../bin"; - for Main use ("page_formats.adb"); - - package Builder is - for Executable ("page_formats.adb") use "page_formats"; - end Builder; - - package Compiler renames Shared.Compiler; - - -end Page_Formats; - - diff --git a/proj/shared.gpr b/proj/shared.gpr deleted file mode 100644 index d16fc1a..0000000 --- a/proj/shared.gpr +++ /dev/null @@ -1,13 +0,0 @@ - - -abstract project Shared is - - - package Compiler is - for Default_Switches ("Ada") use ("-gnaty4aAbcefhiklM100nprt"); - end Compiler; - - -end Shared; - - diff --git a/test/adjuster.adb b/test/adjuster.adb new file mode 100644 index 0000000..ef2bdfb --- /dev/null +++ b/test/adjuster.adb @@ -0,0 +1,79 @@ + + +-- Programmed by Jedidiah Barber +-- Released into the public domain + + +-- Adjuster test program functionality duplicated in Ada + + +with + + Ada.Command_Line, + FLTK.Widgets.Boxes, + FLTK.Widgets.Groups.Windows.Double, + FLTK.Widgets.Valuators.Adjusters; + + +function Adjuster + return Integer +is + + + package ACom renames Ada.Command_Line; + package BX renames FLTK.Widgets.Boxes; + package DW renames FLTK.Widgets.Groups.Windows.Double; + package AD renames FLTK.Widgets.Valuators.Adjusters; + + + type My_Adjuster is new AD.Adjuster with record + Rect : access BX.Box; + end record; + + + procedure Adjust_Callback + (This : in out FLTK.Widgets.Widget'Class) + is + Just : My_Adjuster renames My_Adjuster (This); + begin + Just.Rect.Set_Label (Just.Format); + Just.Rect.Redraw; + end Adjust_Callback; + + + The_Window : DW.Double_Window := + DW.Forge.Create (320, 100, ACom.Command_Name); + + Box_One : aliased BX.Box := + BX.Forge.Create (The_Window, FLTK.Down_Box, 20, 30, 80, 25); + Just_One : My_Adjuster := + (AD.Forge.Create (The_Window, 20 + 80, 30, 3 * 25, 25) + with Rect => Box_One'Access); + + Box_Two : aliased BX.Box := + BX.Forge.Create (The_Window, FLTK.Down_Box, 20 + 80 + 4 * 25, 30, 80, 25); + Just_Two : My_Adjuster := + (AD.Forge.Create (The_Window, Box_Two.Get_X + Box_Two.Get_W, 10, 25, 3 * 25) + with Rect => Box_Two'Access); + + +begin + + + Box_One.Set_Background_Color (FLTK.White_Color); + Just_One.Set_Callback (Adjust_Callback'Unrestricted_Access); + Just_One.Do_Callback; + + Box_Two.Set_Background_Color (FLTK.White_Color); + Just_Two.Set_Callback (Adjust_Callback'Unrestricted_Access); + Just_Two.Do_Callback; + + The_Window.Set_Resizable (The_Window); + The_Window.Show_With_Args; + + return FLTK.Run; + + +end Adjuster; + + diff --git a/test/adjuster_test.adb b/test/adjuster_test.adb deleted file mode 100644 index 6b05b96..0000000 --- a/test/adjuster_test.adb +++ /dev/null @@ -1,79 +0,0 @@ - - --- Programmed by Jedidiah Barber --- Released into the public domain - - --- Adjuster test program functionality duplicated in Ada - - -with - - Ada.Command_Line, - FLTK.Widgets.Boxes, - FLTK.Widgets.Groups.Windows.Double, - FLTK.Widgets.Valuators.Adjusters; - - -function Adjuster_Test - return Integer -is - - - package ACom renames Ada.Command_Line; - package BX renames FLTK.Widgets.Boxes; - package DW renames FLTK.Widgets.Groups.Windows.Double; - package AD renames FLTK.Widgets.Valuators.Adjusters; - - - type My_Adjuster is new AD.Adjuster with record - Rect : access BX.Box; - end record; - - - procedure Adjust_Callback - (This : in out FLTK.Widgets.Widget'Class) - is - Just : My_Adjuster renames My_Adjuster (This); - begin - Just.Rect.Set_Label (Just.Format); - Just.Rect.Redraw; - end Adjust_Callback; - - - The_Window : DW.Double_Window := - DW.Forge.Create (320, 100, ACom.Command_Name); - - Box_One : aliased BX.Box := - BX.Forge.Create (The_Window, FLTK.Down_Box, 20, 30, 80, 25); - Just_One : My_Adjuster := - (AD.Forge.Create (The_Window, 20 + 80, 30, 3 * 25, 25) - with Rect => Box_One'Access); - - Box_Two : aliased BX.Box := - BX.Forge.Create (The_Window, FLTK.Down_Box, 20 + 80 + 4 * 25, 30, 80, 25); - Just_Two : My_Adjuster := - (AD.Forge.Create (The_Window, Box_Two.Get_X + Box_Two.Get_W, 10, 25, 3 * 25) - with Rect => Box_Two'Access); - - -begin - - - Box_One.Set_Background_Color (FLTK.White_Color); - Just_One.Set_Callback (Adjust_Callback'Unrestricted_Access); - Just_One.Do_Callback; - - Box_Two.Set_Background_Color (FLTK.White_Color); - Just_Two.Set_Callback (Adjust_Callback'Unrestricted_Access); - Just_Two.Do_Callback; - - The_Window.Set_Resizable (The_Window); - The_Window.Show_With_Args; - - return FLTK.Run; - - -end Adjuster_Test; - - diff --git a/tests.gpr b/tests.gpr index deb6523..4ff8cfc 100644 --- a/tests.gpr +++ b/tests.gpr @@ -1,12 +1,32 @@ -aggregate project Tests is +with + + "fltkada"; + + +project Tests is + + + for Languages use ("Ada"); + + for Source_Dirs use ("test/**"); + for Object_Dir use "obj"; + for Exec_Dir use "bin"; + + for Main use ("adjuster.adb", "compare.adb", "dirlist.adb", "page_formats.adb"); + + package Builder is + for Executable ("adjuster.adb") use "adjuster"; + for Executable ("compare.adb") use "compare"; + for Executable ("dirlist.adb") use "dirlist"; + for Executable ("page_formats.adb") use "page_formats"; + end Builder; + + package Compiler is + for Default_Switches ("Ada") use ("-gnaty4aAbcefhiklM100nprt"); + end Compiler; - for Project_Files use - ("proj/adjuster_test.gpr", - "proj/compare.gpr", - "proj/dirlist.gpr", - "proj/page_formats.gpr"); end Tests; diff --git a/tools.gpr b/tools.gpr index faa4a95..361664b 100644 --- a/tools.gpr +++ b/tools.gpr @@ -5,18 +5,16 @@ project Tools is for Languages use ("Ada"); - for Source_Dirs use ("tool"); for Object_Dir use "obj"; for Exec_Dir use "bin"; - for Main use ("template.adb"); + for Main use ("template.adb"); package Builder is for Executable ("template.adb") use "template"; end Builder; - package Compiler is for Default_Switches("Ada") use ("-gnaty4aAbcefhiklM100nprt"); end Compiler; -- cgit