DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

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 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ T V

⟦6a9bdae3c⟧ TextFile

    Length: 10526 (0x291e)
    Types: TextFile
    Names: »V«

Derivation

└─⟦d10a02448⟧ Bits:30000409 8mm tape, Rational 1000, ENVIRONMENT, D_12_7_3
    └─ ⟦fc9b38f02⟧ »DATA« 
        └─⟦9b46a407a⟧ 
            └─⟦12c68c704⟧ 
                └─⟦this⟧ 
└─⟦5f3412b64⟧ Bits:30000745 8mm tape, Rational 1000, ENVIRONMENT 12_6_5 TOOLS 
    └─ ⟦91c658230⟧ »DATA« 
        └─⟦458657fb6⟧ 
            └─⟦220843204⟧ 
                └─⟦this⟧ 

TextFile

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 Stream_Type);
        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;