OBJECT screen IS

 PASSIVE

pragmas

PRAGMA inside_op
        (operation_name => --|*|--)
PRAGMA line_feed
        (option => 1)
PRAGMA line_feed
        (option => 2)
PRAGMA compiler
        (name => gnat,
         options => --| |--)

DESCRIPTION

PROBLEM

Statement of the Problem (text)

This design provides a Windows 95 / NT implementation for a screen interface.
The interface is the same as the one defined in Michael Feldman's "simple ANSI terminal emulator", The George Washington University, 1995.
The implementation is the one of Jerry van Dijk's"nt_console", 1998.

PROVIDED_INTERFACE

TYPES

Height

type attributes (hood)

ATTRIBUTES NONE

type enumeration (hood)

ENUMERATION NONE

type definition (ada)

subtype Height is nt_console.Y_Pos;

Width

type attributes (hood)

ATTRIBUTES NONE

type enumeration (hood)

ENUMERATION NONE

type definition (ada)

subtype Width is nt_console.X_Pos;

Position

type attributes (hood)

ATTRIBUTES Row : Height, Column : Width

type enumeration (hood)

ENUMERATION NONE

type definition (ada)

type Position is record
        Row : Height := 1;
        Column : Width := 1;
end record;

CONSTANTS

ScreenHeight

constant definition (ada)

ScreenHeight : constant INTEGER := 24;

ScreenWidth

constant definition (ada)

ScreenWidth : constant INTEGER := 80;

OPERATIONS

Beep

operation spec. description (text)

Pre: none
Post: the terminal beeps once

operation declaration (hood)

Beep;

real time attributes (hood)

WCET

ClearScreen

operation spec. description (text)

Pre: none
Post: the terminal screen is cleared

operation declaration (hood)

ClearScreen;

real time attributes (hood)

WCET

MoveCursor

operation spec. description (text)

Pre: To is defined
Post: the terminal cursor is moved to the given position

operation declaration (hood)

MoveCursor(To : in Position);

real time attributes (hood)

WCET

REQUIRED_INTERFACE

OBJECT nt_console;
        TYPES
                Y_Pos; X_Pos;
        CONSTANTS
                NONE
        OPERATION_SETS
                NONE
        OPERATIONS
                Bleep; Clear_Screen; Goto_XY;
        EXCEPTIONS
                NONE
OBJECT standard;
        TYPES
                Integer;
        CONSTANTS
                NONE
        OPERATION_SETS
                NONE
        OPERATIONS
                NONE
        EXCEPTIONS
                NONE
OBJECT TEXT_IO;
        TYPES
                NONE
        CONSTANTS
                INTEGER_IO;
        OPERATION_SETS
                NONE
        OPERATIONS
                NONE
        EXCEPTIONS
                NONE

INTERNALS

DATA

Int_IO

data declaration (ada)

package Int_IO is new Text_IO.Integer_IO(Num => Integer);

data access from pseudo_code

(da) screen.Int_IO IS USED BY NONE

data access from Ada code

(da) screen.Int_IO IS USED BY NONE

data access from C code

(da) screen.Int_IO IS USED BY NONE

data access from C++ code

(da) screen.Int_IO IS USED BY NONE

OPERATION_CONTROL_STRUCTURES

OPERATION Beep IS

used operations

nt_console.Bleep

operation code (ada)

begin
  nt_console.Bleep;

call tree from Ada code

END Beep

OPERATION ClearScreen IS

used operations

nt_console.Clear_Screen

operation code (ada)

begin
  nt_console.Clear_Screen;

call tree from Ada code

END ClearScreen

OPERATION MoveCursor IS

used operations

nt_console.Goto_XY

operation code (ada)

begin
  nt_console.Goto_XY(To.Column, To.Row);

call tree from Ada code

END MoveCursor

END screen