summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/adapad.adb46
-rw-r--r--src/adapad.ads4
-rw-r--r--src/change_vectors.adb16
-rw-r--r--src/change_vectors.ads15
-rw-r--r--src/main.adb21
-rw-r--r--src/windows-about.adb8
-rw-r--r--src/windows-about.ads11
-rw-r--r--src/windows-editor.adb12
-rw-r--r--src/windows-editor.ads19
-rw-r--r--src/windows-find.adb10
-rw-r--r--src/windows-find.ads13
-rw-r--r--src/windows-jump.adb8
-rw-r--r--src/windows-jump.ads11
-rw-r--r--src/windows-replace.adb10
-rw-r--r--src/windows-replace.ads13
-rw-r--r--src/windows.adb9
-rw-r--r--src/windows.ads6
17 files changed, 148 insertions, 84 deletions
diff --git a/src/adapad.adb b/src/adapad.adb
index 6a725c3..84ada4e 100644
--- a/src/adapad.adb
+++ b/src/adapad.adb
@@ -1,22 +1,28 @@
-with FLTK.Widgets.Menus;
-with FLTK.Widgets.Groups.Windows;
-with FLTK.Text_Buffers;
-with FLTK.Dialogs;
-with Windows.Editor;
-with Windows.About;
-with Windows.Find;
-with Windows.Replace;
-with Windows.Jump;
-with Change_Vectors;
-with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
+with
+
+ FLTK.Widgets.Menus,
+ FLTK.Widgets.Groups.Windows,
+ FLTK.Text_Buffers,
+ FLTK.Dialogs,
+ Windows.Editor,
+ Windows.About,
+ Windows.Find,
+ Windows.Replace,
+ Windows.Jump,
+ Change_Vectors,
+ Ada.Strings.Unbounded;
+
+use
+
+ Ada.Strings.Unbounded;
package body Adapad is
- -- forward declarations of helper functions
+ -- Forward declarations of helper functions.
procedure Set_Title;
function Safe_To_Discard return Boolean;
@@ -29,7 +35,7 @@ package body Adapad is
- -- global state of the text editor
+ -- Global state of the text editor.
Editor : Windows.Editor.Editor_Window := Windows.Editor.Create (800, 500);
Buffer : FLTK.Text_Buffers.Text_Buffer := FLTK.Text_Buffers.Create;
@@ -45,7 +51,7 @@ package body Adapad is
- -- main program interface
+ -- Main program interface.
procedure Set_Logo
(Pic : in out FLTK.Images.RGB.PNG.PNG_Image) is
@@ -80,7 +86,7 @@ package body Adapad is
- -- callbacks for the menu
+ -- Callbacks for the menu.
procedure New_CB
(Item : in out FLTK.Widgets.Widget'Class) is
@@ -341,7 +347,7 @@ package body Adapad is
(Item : in out FLTK.Widgets.Widget'Class) is
begin
if FLTK.Widgets.Menus.Menu (Item).Chosen.Value then
- -- 50 pixels should be enough for 5 digit line numbers
+ -- 50 pixels should be enough for 5 digit line numbers.
Editor.Set_Linenumber_Width (50);
else
Editor.Set_Linenumber_Width (0);
@@ -361,7 +367,7 @@ package body Adapad is
- -- callbacks for the text buffer
+ -- Callbacks for the text buffer.
procedure Mod_CB
(Action : in FLTK.Text_Buffers.Modification;
@@ -416,7 +422,7 @@ package body Adapad is
- -- callbacks for the extra dialog windows
+ -- Callbacks for the extra dialog windows.
procedure Do_Find_CB
(Item : in String;
@@ -430,7 +436,7 @@ package body Adapad is
begin
Find.Hide;
- -- is it possible to improve this abomination with a modulo type?
+ -- Is it possible to improve this abomination with a modulo type?
if Buffer.Get_Selection (Select_Start, Select_End) then
if Facing = Windows.Find.Forward then
Current_Position := Select_End;
@@ -523,7 +529,7 @@ package body Adapad is
- -- helper functions
+ -- Helper functions.
procedure Set_Title is
Title : Unbounded_String := To_Unbounded_String (0);
diff --git a/src/adapad.ads b/src/adapad.ads
index 850b760..a9e317f 100644
--- a/src/adapad.ads
+++ b/src/adapad.ads
@@ -1,6 +1,8 @@
-with FLTK.Images.RGB.PNG;
+with
+
+ FLTK.Images.RGB.PNG;
package Adapad is
diff --git a/src/change_vectors.adb b/src/change_vectors.adb
index 79456c7..13be51f 100644
--- a/src/change_vectors.adb
+++ b/src/change_vectors.adb
@@ -1,12 +1,18 @@
-with FLTK.Text_Buffers;
-with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
-use type FLTK.Text_Buffers.Modification;
-use type FLTK.Text_Buffers.Position;
+with
+ FLTK.Text_Buffers,
+ Ada.Strings.Unbounded;
-with Ada.Text_IO;
+use
+
+ Ada.Strings.Unbounded;
+
+use type
+
+ FLTK.Text_Buffers.Modification,
+ FLTK.Text_Buffers.Position;
package body Change_Vectors is
diff --git a/src/change_vectors.ads b/src/change_vectors.ads
index b2b74b7..e325821 100644
--- a/src/change_vectors.ads
+++ b/src/change_vectors.ads
@@ -1,8 +1,17 @@
-with FLTK.Text_Buffers;
-with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
-private with Ada.Containers.Vectors;
+with
+
+ FLTK.Text_Buffers,
+ Ada.Strings.Unbounded;
+
+use
+
+ Ada.Strings.Unbounded;
+
+private with
+
+ Ada.Containers.Vectors;
package Change_Vectors is
diff --git a/src/main.adb b/src/main.adb
index f917081..266beb7 100644
--- a/src/main.adb
+++ b/src/main.adb
@@ -1,18 +1,21 @@
-with FLTK.Images.RGB.PNG;
-with Adapad;
-with Ada.Command_Line;
-with Ada.Directories;
+with
+ FLTK.Images.RGB.PNG,
+ Adapad,
+ Ada.Command_Line,
+ Ada.Directories;
-function Main return Integer
+
+function Main
+ return Integer
is
- Containing_Dir : String :=
- Ada.Directories.Containing_Directory
- (Ada.Directories.Full_Name (Ada.Command_Line.Command_Name));
+ Origin : String := Ada.Directories.Containing_Directory
+ (Ada.Directories.Full_Name (Ada.Command_Line.Command_Name));
+
Logo : FLTK.Images.RGB.PNG.PNG_Image :=
- FLTK.Images.RGB.PNG.Create (Containing_Dir & "/../share/adapad/logo.png");
+ FLTK.Images.RGB.PNG.Create (Origin & "/../share/adapad/logo.png");
begin
Adapad.Set_Logo (Logo);
Adapad.Show;
diff --git a/src/windows-about.adb b/src/windows-about.adb
index 12f9c17..6a3dda6 100644
--- a/src/windows-about.adb
+++ b/src/windows-about.adb
@@ -1,8 +1,10 @@
-with FLTK.Widgets.Groups.Windows.Double;
-with FLTK.Widgets.Boxes;
-with FLTK.Widgets.Buttons.Enter;
+with
+
+ FLTK.Widgets.Groups.Windows.Double,
+ FLTK.Widgets.Boxes,
+ FLTK.Widgets.Buttons.Enter;
package body Windows.About is
diff --git a/src/windows-about.ads b/src/windows-about.ads
index f27ad26..e15c38c 100644
--- a/src/windows-about.ads
+++ b/src/windows-about.ads
@@ -1,8 +1,13 @@
-with FLTK.Widgets.Groups.Windows.Double;
-private with FLTK.Widgets.Boxes;
-private with FLTK.Widgets.Buttons.Enter;
+with
+
+ FLTK.Widgets.Groups.Windows.Double;
+
+private with
+
+ FLTK.Widgets.Boxes,
+ FLTK.Widgets.Buttons.Enter;
package Windows.About is
diff --git a/src/windows-editor.adb b/src/windows-editor.adb
index f8f15eb..9696174 100644
--- a/src/windows-editor.adb
+++ b/src/windows-editor.adb
@@ -1,10 +1,12 @@
-with FLTK.Widgets.Groups.Windows.Double;
-with FLTK.Widgets.Groups.Text_Displays.Text_Editors;
-with FLTK.Widgets.Menus.Menu_Bars;
-with FLTK.Widgets.Menus.Menu_Buttons;
-with FLTK.Text_Buffers;
+with
+
+ FLTK.Widgets.Groups.Windows.Double,
+ FLTK.Widgets.Groups.Text_Displays.Text_Editors,
+ FLTK.Widgets.Menus.Menu_Bars,
+ FLTK.Widgets.Menus.Menu_Buttons,
+ FLTK.Text_Buffers;
package body Windows.Editor is
diff --git a/src/windows-editor.ads b/src/windows-editor.ads
index 079638c..58c13c2 100644
--- a/src/windows-editor.ads
+++ b/src/windows-editor.ads
@@ -1,12 +1,17 @@
-with FLTK.Widgets.Groups.Windows.Double;
-with FLTK.Widgets.Menus;
-with FLTK.Text_Buffers;
-with FLTK.Widgets.Groups.Text_Displays;
-private with FLTK.Widgets.Groups.Text_Displays.Text_Editors;
-private with FLTK.Widgets.Menus.Menu_Bars;
-private with FLTK.Widgets.Menus.Menu_Buttons;
+with
+
+ FLTK.Widgets.Groups.Windows.Double,
+ FLTK.Widgets.Menus,
+ FLTK.Text_Buffers,
+ FLTK.Widgets.Groups.Text_Displays,
+
+private with
+
+ FLTK.Widgets.Groups.Text_Displays.Text_Editors,
+ FLTK.Widgets.Menus.Menu_Bars,
+ FLTK.Widgets.Menus.Menu_Buttons;
package Windows.Editor is
diff --git a/src/windows-find.adb b/src/windows-find.adb
index 87acd04..8ae6685 100644
--- a/src/windows-find.adb
+++ b/src/windows-find.adb
@@ -1,9 +1,11 @@
-with FLTK.Widgets.Groups.Windows.Double;
-with FLTK.Widgets.Inputs;
-with FLTK.Widgets.Buttons.Enter;
-with FLTK.Widgets.Buttons.Light.Check;
+with
+
+ FLTK.Widgets.Groups.Windows.Double,
+ FLTK.Widgets.Inputs,
+ FLTK.Widgets.Buttons.Enter,
+ FLTK.Widgets.Buttons.Light.Check;
package body Windows.Find is
diff --git a/src/windows-find.ads b/src/windows-find.ads
index adcb9c8..32d653e 100644
--- a/src/windows-find.ads
+++ b/src/windows-find.ads
@@ -1,9 +1,14 @@
-with FLTK.Widgets.Groups.Windows.Double;
-private with FLTK.Widgets.Inputs;
-private with FLTK.Widgets.Buttons.Enter;
-private with FLTK.Widgets.Buttons.Light.Check;
+with
+
+ FLTK.Widgets.Groups.Windows.Double;
+
+private with
+
+ FLTK.Widgets.Inputs,
+ FLTK.Widgets.Buttons.Enter,
+ FLTK.Widgets.Buttons.Light.Check;
package Windows.Find is
diff --git a/src/windows-jump.adb b/src/windows-jump.adb
index bed3669..5d263ba 100644
--- a/src/windows-jump.adb
+++ b/src/windows-jump.adb
@@ -1,8 +1,10 @@
-with FLTK.Widgets.Groups.Windows.Double;
-with FLTK.Widgets.Buttons.Enter;
-with FLTK.Widgets.Inputs.Integer;
+with
+
+ FLTK.Widgets.Groups.Windows.Double,
+ FLTK.Widgets.Buttons.Enter,
+ FLTK.Widgets.Inputs.Integer;
package body Windows.Jump is
diff --git a/src/windows-jump.ads b/src/windows-jump.ads
index d458a8d..e9c0be5 100644
--- a/src/windows-jump.ads
+++ b/src/windows-jump.ads
@@ -1,8 +1,13 @@
-with FLTK.Widgets.Groups.Windows.Double;
-private with FLTK.Widgets.Buttons.Enter;
-private with FLTK.Widgets.Inputs.Integer;
+with
+
+ FLTK.Widgets.Groups.Windows.Double;
+
+private with
+
+ FLTK.Widgets.Buttons.Enter,
+ FLTK.Widgets.Inputs.Integer;
package Windows.Jump is
diff --git a/src/windows-replace.adb b/src/windows-replace.adb
index 8a48e0e..758dfff 100644
--- a/src/windows-replace.adb
+++ b/src/windows-replace.adb
@@ -1,9 +1,11 @@
-with FLTK.Widgets.Groups.Windows.Double;
-with FLTK.Widgets.Inputs;
-with FLTK.Widgets.Buttons.Enter;
-with FLTK.Widgets.Buttons.Light.Check;
+with
+
+ FLTK.Widgets.Groups.Windows.Double,
+ FLTK.Widgets.Inputs,
+ FLTK.Widgets.Buttons.Enter,
+ FLTK.Widgets.Buttons.Light.Check;
package body Windows.Replace is
diff --git a/src/windows-replace.ads b/src/windows-replace.ads
index 48c3a73..522ec18 100644
--- a/src/windows-replace.ads
+++ b/src/windows-replace.ads
@@ -1,9 +1,14 @@
-with FLTK.Widgets.Groups.Windows.Double;
-private with FLTK.Widgets.Inputs;
-private with FLTK.Widgets.Buttons.Enter;
-private with FLTK.Widgets.Buttons.Light.Check;
+with
+
+ FLTK.Widgets.Groups.Windows.Double;
+
+private with
+
+ FLTK.Widgets.Inputs,
+ FLTK.Widgets.Buttons.Enter,
+ FLTK.Widgets.Buttons.Light.Check;
package Windows.Replace is
diff --git a/src/windows.adb b/src/windows.adb
index eff387d..d637905 100644
--- a/src/windows.adb
+++ b/src/windows.adb
@@ -1,7 +1,8 @@
-with FLTK.Widgets.Groups;
-with FLTK.Widgets.Groups.Windows;
+with
+
+ FLTK.Widgets.Groups.Windows;
package body Windows is
@@ -22,8 +23,8 @@ package body Windows is
- -- used to hide about/find/replace/etc windows instead
- -- of constantly creating and destroying them
+ -- Used to hide about/find/replace/etc windows instead
+ -- of constantly creating and destroying them.
procedure Hide_CB
(Item : in out FLTK.Widgets.Widget'Class)
diff --git a/src/windows.ads b/src/windows.ads
index 64a8823..dbe9cda 100644
--- a/src/windows.ads
+++ b/src/windows.ads
@@ -1,7 +1,9 @@
-with FLTK.Widgets.Groups.Windows.Double;
-with FLTK.Images.RGB.PNG;
+with
+
+ FLTK.Widgets.Groups.Windows.Double,
+ FLTK.Images.RGB.PNG;
package Windows is