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

⟦ca02ca36f⟧ Ada Source

    Length: 16384 (0x4000)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package Window_Io, pragma Module_Name 4 2219, pragma Subsystem Object_Editor, seg_0063c0

Derivation

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

E3 Source Code



with Io_Exceptions;

package Window_Io is

    pragma Subsystem (Object_Editor, Closed);
    pragma Module_Name (4, 2219);

    -- package for providing raw IO facilities to an image

    type File_Type is private;

    type File_Mode is (In_File, Out_File);
    -- the mode of the handle.  Each image can be opened twice - once
    -- for input and once for output.

    -- Create an image for IO.
    -- Normally, a new empty image is created on this call.
    -- If an image is already open for this job with the given name,
    -- and the mode given /= the mode the image is open for, that
    -- image will be opened for the new mode.
    procedure Create (File : in out File_Type;
                      Mode :        File_Mode := Out_File;
                      Name :        String;
                      Form :        String    := "");

    -- Open a previously closed image.  The same rules apply for create
    -- in the case one job opens the same image twice; once for input and
    -- once for output
    procedure Open (File : in out File_Type;
                    Mode :        File_Mode := Out_File;
                    Name :        String;
                    Form :        String    := "");

    -- Terminate operations on this image.
    procedure Close (File : in out File_Type);

    -- Delete the image.  Any other handles on this image are implicitly
    -- closed.
    procedure Delete (File : in out File_Type);

    function Mode (File : File_Type) return File_Mode;
    function Name (File : File_Type) return String;
    function Form (File : File_Type) return String;

    function Is_Open (File : File_Type) return Boolean;


    package Raw is

        -- gain access to the keyboard for "raw" input.
        -- one channel may be opened per job.
        -- no echoing or local editing is performed.


        type Stream_Type is private;

        procedure Open  (Stream : in out StreamType);
        procedure Close (Stream              : in out Stream_Type;
                         Flush_Pending_Input :        Boolean := False);

        procedure Disconnect (Stream : in out Stream_Type);
        -- free users keyboard

        type Key        is new Natural range 0 .. 1023;
        type Key_String is array (Positive range <>) of Key;
        -- a key is the basic bit of input.

        subtype Simple_Key is Key range 0 .. 127;
        -- a simple key represents the ascii characters

        procedure Get (Stream : Stream_Type; Item : out Key);
        procedure Get (Stream : Stream_Type; Item : out Key_String);

        -- converting keys to characters

        -- the ascii characters map directly to the first 128 keys
        function Convert (C : Character)  return Simple_Key;
        function Convert (K : Simple_Key) return Character;


        -- keys are mapped to logical names
        -- these names correspond to the 'image attribute of the
        -- enumerations in machine.editor_data.visible_key_names

        subtype Terminal is String;
        -- supported terminal types are Cit500R, Vt100, Rational

        function Image (For_Key : Key; On_Terminal : Terminal) return String;
        -- image is "", if For_Key is not defined for this terminal type

        procedure Value (For_Key_Name :     String;
                         On_Terminal  :     Terminal;
                         Result       : out Key;
                         Found        : out Boolean);
        -- Found is false => For_Key_Name does not name a key on this terminal

        function Value
                    (For_Key_Name : String; On_Terminal : Terminal) return Key;

        Unknown_Key : exception;
        -- raised by functional form of value

    end Raw;

    subtype Column_Number is Positive;
    subtype Line_Number   is Positive;
    -- a file_type is initialized to column 1, line 1

    subtype Count          is Natural;
    subtype Positive_Count is Count range 1 .. Count'Last;

    -- output
    -- characters are displayed at the current cursor position
    -- control characters are displayed in reverse-video

    type Designation is (Text, Prompt, Protected);

    type Attribute is
        record
            Bold        : Boolean;
            Faint       : Boolean;
            Underscore  : Boolean;
            Inverse     : Boolean;
            Slow_Blink  : Boolean;
            Rapid_Blink : Boolean;
            Unused_0    : Boolean;
            Unused_1    : Boolean;
        end record;

    Vanilla : constant Attribute := (others => False);

    type Character_Set is new Natural range 0 .. 15;

    Plain    : constant Character_Set := 0;
    Graphics : constant Character_Set := 1;

    type Font is
        record
            Kind : Character_Set;
            Look : Attribute;
        end record;

    Normal : constant Font := Font'(Plain, Vanilla);

    function Default_Font (For_Type : Designation) return Font;
    -- the fonts normally used by the environment for these designations
    -- are returned

    procedure Position_Cursor (File   : File_Type;
                               Line   : Line_Number   := Line_Number'First;
                               Column : Column_Number := Column_Number'First;
                               Offset : Natural       := 0);
    -- Position the cursor on the image.
    -- Offset is used to position the cursor relative to the top of the window.
    -- With an offset of 0, the cursor is made visible in the window using
    -- the normal editor defaults.
    -- With a positive offset, the image is scrolled in the window so the
    -- cursor is the offset line in the window.

    procedure Move_Cursor (File          : File_Type;
                           Delta_Lines   : Integer;
                           Delta_Columns : Integer;
                           Offset        : Natural := 0);

    procedure Report_Cursor (File   :     File_Type;
                             Line   : out Line_Number;
                             Column : out Column_Number);

    procedure Overwrite (File  : File_Type;
                         Item  : Character;
                         Image : Font        := Normal;
                         Kind  : Designation := Text);
    -- writes ITEM at the current cursor position and advances column by 1

    procedure Overwrite (File  : File_Type;
                         Item  : String;
                         Image : Font        := Normal;
                         Kind  : Designation := Text);
    -- writes ITEM at the current cursor position and advances column by
    -- ITEM'LENGTH

    procedure Insert (File  : File_Type;
                      Item  : Character;
                      Image : Font        := Normal;
                      Kind  : Designation := Text);
    -- writes ITEM at the current cursor position and advances column by 1

    procedure Insert (File  : File_Type;
                      Item  : String;
                      Image : Font        := Normal;
                      Kind  : Designation := Text);
    -- writes ITEM at the current cursor position and advances column by
    -- ITEM'LENGTH

    procedure New_Line (File : File_Type; Lines : Count := 1);
    -- insert lines after the current line
    -- advances line by Lines, and sets column to 1.

    procedure Delete (File : File_Type; Characters : Count);
    -- deletes Count characters at current position.  Position is unchanged

    procedure Delete_Lines (File : File_Type; Lines : Count := 1);
    -- deletes Lines including the current line. Position is unchanged

    -- input with editing
    -- an input prompt with contents PROMPT will be displayed at the current
    -- cursor position.  Control of the keyboard will be returned to the
    -- core editor for user input at the prompt.

    procedure Get      (File   :     File_Type;
                        Prompt :     String := "[input]";
                        Item   : out Character);
    procedure Get      (File   :     File_Type;
                        Prompt :     String := "[input]";
                        Item   : out String);
    procedure Get_Line (File   :     File_Type;
                        Prompt :     String := "[input]";
                        Item   : out String;
                        Last   : out Natural);
    function  Get_Line
                (File : File_Type; Prompt : String := "[input]") return String;

    -- banner operations

    -- The value will be displayed in the banner for this image
    -- fields are defined from left to right.  The first few fields
    -- are reserved for the editor.  Users may specify field_names
    -- of the form "FIELD_0" .. "FIELD_9". Currently 0 .. 2 are used
    -- for job_number, start_time and blocked indication, but may be
    -- reused by the user.
    -- Calling set_banner with other values will be a noop.

    procedure Set_Banner
                 (File : File_Type; Field_Name : String; Value : String);

    function Read_Banner (File : File_Type; Field_Name : String) return String;

    -- predefined field_names, may be passed to Set_Banner
    function Job_Number return String;
    function Job_Time   return String;


    -- sound the terminal bell
    procedure Bell (File : File_Type);

    -- information about the current image

    function End_Of_Line (File : File_Type) return Boolean;
    function End_Of_File (File : File_Type) return Boolean;

    function Line_Length (File : File_Type) return Count;
    function Line_Image  (File : File_Type) return String;

    function Char_At (File : File_Type) return Character;
    function Font_At (File : File_Type) return Font;

    function Last_Line (File : File_Type) return Line_Number;


    -- information about the current window

    -- the origin is the line and column number of the point of the image
    -- located in the upper right corner of the window
    procedure Report_Origin (File   :     File_Type;
                             Line   : out Line_Number;
                             Column : out Column_Number);

    -- the size of the window in characters
    procedure Report_Size (File    :     File_Type;
                           Lines   : out Positive_Count;
                           Columns : out Positive_Count);

    -- the location of the window on the screen
    -- the upper right corner of the screen is line 1, column 1
    procedure Report_Location (File   :     File_Type;
                               Line   : out Line_Number;
                               Column : out Column_Number);
end Window_Io;

E3 Meta Data

    nblk1=f
    nid=0
    hdr6=1e
        [0x00] rec0=1c rec1=00 rec2=01 rec3=05a
        [0x01] rec0=1e rec1=00 rec2=02 rec3=05e
        [0x02] rec0=00 rec1=00 rec2=0f rec3=002
        [0x03] rec0=19 rec1=00 rec2=03 rec3=064
        [0x04] rec0=00 rec1=00 rec2=0d rec3=010
        [0x05] rec0=1b rec1=00 rec2=04 rec3=020
        [0x06] rec0=22 rec1=00 rec2=0e rec3=032
        [0x07] rec0=02 rec1=00 rec2=05 rec3=00c
        [0x08] rec0=12 rec1=00 rec2=06 rec3=066
        [0x09] rec0=17 rec1=00 rec2=07 rec3=05a
        [0x0a] rec0=17 rec1=00 rec2=08 rec3=000
        [0x0b] rec0=15 rec1=00 rec2=09 rec3=00a
        [0x0c] rec0=01 rec1=00 rec2=0c rec3=00e
        [0x0d] rec0=1f rec1=00 rec2=0a rec3=00c
        [0x0e] rec0=11 rec1=00 rec2=0b rec3=000
    tail 0x21701aa2a81bf8152595f 0x42a00088462065003