DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦c5596ea6e⟧ Ada Source

    Length: 13312 (0x3400)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package body Split_Window, seg_004701

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦5a81ac88f⟧ »Space Info Vol 1« 
        └─⟦this⟧ 

E3 Source Code



with Window_Io;
package body Split_Window is

    task body Window_Manager is
        Window : Window_Io.File_Type;

        Top_Line    : Natural;
        Top_Col     : Natural;
        Bottom_Line : Natural;
        Bottom_Col  : Natural;

        Next_Top_Line    : Positive;
        Next_Bottom_Line : Positive;

        Middle_Line : Window_Io.Line_Number;
        Last_Line   : Window_Io.Line_Number;

        Lines, Cols : Positive;
        Dashes      : constant String (1 .. 78) := (others => '-');
    begin
        loop
            select
                accept Create do
                    Window_Io.Create
                       (Window, Window_Io.Out_File, "PHONE WINDOW");
                    Window_Io.Report_Size (Window, Lines, Cols);
                    Middle_Line := Lines / 2;
                    Last_Line   := Lines;

                    Top_Line      := 1;
                    Top_Col       := 1;
                    Next_Top_Line := 2;

                    Bottom_Line      := Middle_Line + 1;
                    Bottom_Col       := 1;
                    Next_Bottom_Line := Bottom_Line + 1;

                    Window_Io.Position_Cursor (Window, Middle_Line, 1);
                    Window_Io.Overwrite (Window, Dashes);

                end Create;
            or
                accept Delete;
                exit;
            or
                accept Write_To_Top (Message : String) do

                    Top_Col := 1;

                    Window_Io.Position_Cursor (Window, Next_Top_Line, 1);
                    Window_Io.Delete (Window, Window_Io.Line_Length (Window));

                    Window_Io.Position_Cursor (Window, Top_Line, 1);
                    Window_Io.Overwrite (Window, Message);

                    if Top_Line = Middle_Line - 2 then
                        Top_Line      := Top_Line + 1;
                        Next_Top_Line := 1;
                    elsif Top_Line = Middle_Line - 1 then
                        Top_Line      := 1;
                        Next_Top_Line := 2;
                    else
                        Top_Line      := Top_Line + 1;
                        Next_Top_Line := Top_Line + 1;
                    end if;

                end Write_To_Top;
            or
                accept Write_To_Top (Message : Character) do
                    if Message = Ascii.Cr then

                        Top_Col := 1;

                        Window_Io.Position_Cursor
                           (Window, Next_Top_Line, Top_Col);
                        Window_Io.Delete (Window,
                                          Window_Io.Line_Length (Window));

                        if Top_Line = Middle_Line - 2 then
                            Top_Line      := Top_Line + 1;
                            Next_Top_Line := 1;
                        elsif Top_Line = Middle_Line - 1 then
                            Top_Line      := 1;
                            Next_Top_Line := 2;
                        else
                            Top_Line      := Top_Line + 1;
                            Next_Top_Line := Top_Line + 1;
                        end if;

                    else
                        Window_Io.Position_Cursor (Window, Top_Line, Top_Col);
                        Window_Io.Overwrite (Window, Message);
                        Top_Col := Top_Col + 1;
                    end if;
                end Write_To_Top;
            or
                accept Write_To_Bottom (Message : String) do
                    Bottom_Col := 1;

                    Window_Io.Position_Cursor (Window, Next_Bottom_Line, 1);
                    Window_Io.Delete (Window, Window_Io.Line_Length (Window));

                    Window_Io.Position_Cursor (Window, Bottom_Line, 1);
                    Window_Io.Overwrite (Window, Message);

                    if Bottom_Line = Last_Line - 1 then
                        Bottom_Line      := Bottom_Line + 1;
                        Next_Bottom_Line := Middle_Line + 1;
                    elsif Bottom_Line = Last_Line then
                        Bottom_Line      := Middle_Line + 1;
                        Next_Bottom_Line := Bottom_Line + 1;
                    else
                        Bottom_Line      := Bottom_Line + 1;
                        Next_Bottom_Line := Bottom_Line + 1;
                    end if;

                end Write_To_Bottom;
            or
                accept Write_To_Bottom (Message : Character) do
                    if Message = Ascii.Cr then

                        Bottom_Col := 1;

                        Window_Io.Position_Cursor
                           (Window, Next_Bottom_Line, Bottom_Col);
                        Window_Io.Delete (Window,
                                          Window_Io.Line_Length (Window));

                        if Bottom_Line = Last_Line - 1 then
                            Bottom_Line      := Bottom_Line + 1;
                            Next_Bottom_Line := Middle_Line + 1;
                        elsif Bottom_Line = Last_Line then
                            Bottom_Line      := Middle_Line + 1;
                            Next_Bottom_Line := Bottom_Line + 1;
                        else
                            Bottom_Line      := Bottom_Line + 1;
                            Next_Bottom_Line := Bottom_Line + 1;
                        end if;

                    else
                        Window_Io.Position_Cursor
                           (Window, Bottom_Line, Bottom_Col);
                        Window_Io.Overwrite (Window, Message);
                        Bottom_Col := Bottom_Col + 1;
                    end if;

                end Write_To_Bottom;
            or
                accept Delete_Char_Top do
                    if Top_Col /= 1 then
                        Window_Io.Position_Cursor
                           (Window, Top_Line, Top_Col - 1);
                        Window_Io.Overwrite (Window, ' ');
                        Top_Col := Top_Col - 1;
                    else
                        Window_Io.Bell (Window);
                    end if;
                end Delete_Char_Top;
            or
                accept Delete_Char_Bottom do
                    if Bottom_Col /= 1 then
                        Window_Io.Position_Cursor
                           (Window, Bottom_Line, Bottom_Col - 1);
                        Window_Io.Overwrite (Window, ' ');
                        Bottom_Col := Bottom_Col - 1;
                    else
                        Window_Io.Bell (Window);
                    end if;

                end Delete_Char_Bottom;
            end select;
        end loop;
    end Window_Manager;

end Split_Window;

E3 Meta Data

    nblk1=c
    nid=0
    hdr6=18
        [0x00] rec0=21 rec1=00 rec2=01 rec3=03a
        [0x01] rec0=02 rec1=00 rec2=0c rec3=01e
        [0x02] rec0=19 rec1=00 rec2=02 rec3=066
        [0x03] rec0=01 rec1=00 rec2=0b rec3=00e
        [0x04] rec0=18 rec1=00 rec2=03 rec3=01c
        [0x05] rec0=00 rec1=00 rec2=0a rec3=028
        [0x06] rec0=17 rec1=00 rec2=04 rec3=052
        [0x07] rec0=00 rec1=00 rec2=09 rec3=014
        [0x08] rec0=17 rec1=00 rec2=05 rec3=04c
        [0x09] rec0=00 rec1=00 rec2=08 rec3=01e
        [0x0a] rec0=16 rec1=00 rec2=06 rec3=05e
        [0x0b] rec0=18 rec1=00 rec2=07 rec3=000
    tail 0x215004f18815c67810171 0x42a00088462061e03