+
Point of view
All features
class NCURSES
Summary
The NCURSES library gives the user a terminal-independent method of updating character screens with reasonable optimization.
NCURSES supports: overall screen, window and pad manipulation; output to windows and pads; reading terminal input; control over terminal and curses input and output options; environment query routines; color manipulation; use of soft label keys; terminfo capabilities; and access to low-level terminal-manipulation routines.
Direct parents
Insert list: DISPOSABLE, NCURSES_KEYS, NCURSES_TOOLS, SINGLETON
Class invariant
Overview
Creation features
{ANY}
Features
{}
Events related routines
{ANY}
To switch the is_enabled flag:
{ANY}
{}
Adding jobs to the loop stack:
{ANY}
Useful if the ncurses framework must be integrated in another framework such as ui`
{NCURSES_HANDLER}
{ANY}
{ANY}
{NCURSES_WIDGET}
{ANY}
{}
{ANY}
{ANY}
{}
{ANY}
  • is_equal (other: NCURSES): BOOLEAN
    Is other attached to an object considered equal to current object?
{}
make
effective procedure
{}
key_pressed_signal: SIGNAL_1[INTEGER_32]
writable attribute
{}
resized_signal: SIGNAL_0
writable attribute
{}
idle_signal: SIGNAL_0
writable attribute
{}
depth: INTEGER_32
writable attribute
{}
when_key_pressed (p: PROCEDURE[TUPLE 1[INTEGER_32]])
effective procedure
{ANY}
when_resized (p: PROCEDURE[TUPLE])
effective procedure
{ANY}
when_idle (p: PROCEDURE[TUPLE])
effective procedure
{ANY}
is_enabled: BOOLEAN
effective function
{ANY}
Is ncurses ready to be used?
This also means that we not in the normal terminal mode.
See also enable, disable.
enable
effective procedure
{ANY}
To switch from normal terminal mode to ncurses mode.
See also disable, is_enabled.
ensure
start
effective procedure
{ANY}
require
disable
effective procedure
{ANY}
This procedure must be called when returning to normal terminal mode.
See also enable, is_enabled.
require
do_disable
effective procedure
{}
require
add_job (a_job: JOB)
effective procedure
{ANY}
require
set_loop_stack (a_stack: LOOP_STACK)
effective procedure
require ensure
loop_stack: LOOP_STACK
writable attribute
set_event_catcher (a_catcher: JOB)
effective procedure
require ensure
event_catcher: JOB
writable attribute
set_poll_timeout (a_timeout: INTEGER_32)
effective procedure
require
  • a_timeout >= 0
ensure
poll_timeout: INTEGER_32
writable attribute
handle_events: BOOLEAN
effective function
The core method that handles ncurses events
require
get_root_window: NCURSES_WINDOW
once function
{ANY}
Returns the root NCURSES_WINDOW.
require
register_recovery_agent (register: PROCEDURE[TUPLE])
effective procedure
{ANY}
unregister_recovery_agent (unregister: PROCEDURE[TUPLE])
effective procedure
{ANY}
get_color_pair (foreground: INTEGER_32, background: INTEGER_32): INTEGER_32
effective function
{ANY}
Defines new color-pair.
require
buffering_policy: BOOLEAN
writable attribute
{ANY}
Is line buffering enabled?
set_buffering_policy (enable_buffering: BOOLEAN)
effective procedure
{ANY}
Enables/disables line buffering_policy.
require ensure
echoing_policy: BOOLEAN
writable attribute
{ANY}
Is there some echo on the screen when fetching keystrokes.
See also set_echoing_policy.
set_echoing_policy (enable_echoing: BOOLEAN)
effective procedure
{ANY}
Enables/disables echoing_policy.
require ensure
automatic_kill_policy: BOOLEAN
writable attribute
{ANY}
?????
set_automatic_kill_policy (enable_kill_policy: BOOLEAN)
effective procedure
{ANY}
Enables/disables automatic_kill_policy.
require ensure
push_back_keypress (ch: INTEGER_32)
effective procedure
{ANY}
Pushes back the next (fake) keypress.
require
refresh_pending
effective procedure
{ANY}
Refreshes all windows which have called refresh_later.
require
a_attributes: INTEGER_32
{ANY}
a_chartext: INTEGER_32
{ANY}
a_color: INTEGER_32
{ANY}
a_normal: INTEGER_32
{ANY}
a_standout: INTEGER_32
{ANY}
a_underline: INTEGER_32
{ANY}
a_reverse: INTEGER_32
{ANY}
a_blink: INTEGER_32
{ANY}
a_dim: INTEGER_32
{ANY}
a_bold: INTEGER_32
{ANY}
a_altcharset: INTEGER_32
{ANY}
a_invis: INTEGER_32
{ANY}
a_protect: INTEGER_32
{ANY}
a_horizontal: INTEGER_32
{ANY}
a_left: INTEGER_32
{ANY}
a_low: INTEGER_32
{ANY}
a_right: INTEGER_32
{ANY}
a_top: INTEGER_32
{ANY}
a_vertical: INTEGER_32
{ANY}
cursor_visibility: INTEGER_32
writable attribute
{ANY}
See available cursor mode constants in NUMBER_TOOLS.
set_cursor_visibility (visibility: INTEGER_32)
effective procedure
{ANY}
See available cursor mode constants in NUMBER_TOOLS.
require ensure
check_for_error (noerror: BOOLEAN)
effective procedure
Used to check correct ncurses return codes.
disable_and_exit
effective procedure
{ANY}
writable attribute
{}
color_pair_counter: INTEGER_32
writable attribute
{}
recovery_agents: FAST_ARRAY[PROCEDURE[TUPLE]]
once function
{}
We can safely use once here because NCURSES_WRAPPER is a singleton
dispose
effective procedure
{}
Action to be executed just before garbage collection reclaims an object.
initscr
{}
stdscr: POINTER
{}
endwin
{}
start_color
{}
init_pair (pair: INTEGER_32, f: INTEGER_32, b: INTEGER_32): INTEGER_32
{}
color_pair (index: INTEGER_32): INTEGER_32
{}
Returns defined color-pair.
require
cbreak: INTEGER_32
{}
nocbreak: INTEGER_32
{}
echo: INTEGER_32
{}
noecho: INTEGER_32
{}
ungetch (ch: INTEGER_32): INTEGER_32
{}
doupdate: INTEGER_32
{}
refresh: INTEGER_32
{}
curs_set (v: INTEGER_32): INTEGER_32
{}
terminal_width: INTEGER_32
{}
terminal_height: INTEGER_32
{}
trace_actions
{}
ncurses: NCURSES
once function
{ANY}
Access to the ncurses singleton.
invisible_cursor_mode: INTEGER_32
is 0
constant attribute
{ANY}
In this mode the cursor is invisible.
default_visible_cursor_mode: INTEGER_32
is 1
constant attribute
{ANY}
The default visible cursor mode.
special_visible_cursor_mode: INTEGER_32
is 2
constant attribute
{ANY}
In this mode cursor may blink in a more special or in a more visible way.
valid_cursor_visibility (code: INTEGER_32): BOOLEAN
effective function
{ANY}
ensure
key_escape: INTEGER_32
is 27
constant attribute
{}
key_return: INTEGER_32
is 10
constant attribute
{}
Below are integer equivalent for special "function" keys.
Is it necessary to keep all of them ?
key_min: INTEGER_32
{}
key_break: INTEGER_32
{}
key_sreset: INTEGER_32
{}
key_reset: INTEGER_32
{}
key_down: INTEGER_32
{}
The Down arrow of the keyboard.
key_up: INTEGER_32
{}
The Up arrow of the keyboard.
key_left: INTEGER_32
{}
The Left arrow of the keyboard.
key_right: INTEGER_32
{}
The Right arrow of the keyboard.
key_home: INTEGER_32
{}
key_backspace: INTEGER_32
{}
key_dl: INTEGER_32
{}
key_il: INTEGER_32
{}
key_dc: INTEGER_32
{}
key_ic: INTEGER_32
{}
key_eic: INTEGER_32
{}
key_clear: INTEGER_32
{}
key_eos: INTEGER_32
{}
key_eol: INTEGER_32
{}
key_sf: INTEGER_32
{}
key_sr: INTEGER_32
{}
key_next_page: INTEGER_32
{}
Also labeled "Page Down" on some keyboards.
key_previous_page: INTEGER_32
{}
Also labeled "Page Up" on some keyboards.
key_stab: INTEGER_32
{}
key_ctab: INTEGER_32
{}
key_catab: INTEGER_32
{}
key_enter: INTEGER_32
{}
key_print: INTEGER_32
{}
key_ll: INTEGER_32
{}
key_a1: INTEGER_32
{}
key_a3: INTEGER_32
{}
key_b2: INTEGER_32
{}
key_c1: INTEGER_32
{}
key_c3: INTEGER_32
{}
key_btab: INTEGER_32
{}
key_beg: INTEGER_32
{}
key_cancel: INTEGER_32
{}
key_close: INTEGER_32
{}
key_command: INTEGER_32
{}
key_copy: INTEGER_32
{}
key_create: INTEGER_32
{}
key_end: INTEGER_32
{}
key_exit: INTEGER_32
{}
key_find: INTEGER_32
{}
key_help: INTEGER_32
{}
key_mark: INTEGER_32
{}
key_message: INTEGER_32
{}
key_move: INTEGER_32
{}
key_next: INTEGER_32
{}
key_open: INTEGER_32
{}
key_options: INTEGER_32
{}
key_previous: INTEGER_32
{}
key_redo: INTEGER_32
{}
key_reference: INTEGER_32
{}
key_refresh: INTEGER_32
{}
key_replace: INTEGER_32
{}
key_restart: INTEGER_32
{}
key_resume: INTEGER_32
{}
key_save: INTEGER_32
{}
key_sbeg: INTEGER_32
{}
key_scancel: INTEGER_32
{}
key_scommand: INTEGER_32
{}
key_scopy: INTEGER_32
{}
key_screate: INTEGER_32
{}
key_sdc: INTEGER_32
{}
key_sdl: INTEGER_32
{}
key_select: INTEGER_32
{}
key_send: INTEGER_32
{}
key_seol: INTEGER_32
{}
key_sexit: INTEGER_32
{}
key_sfind: INTEGER_32
{}
key_shelp: INTEGER_32
{}
key_shome: INTEGER_32
{}
key_sic: INTEGER_32
{}
key_sleft: INTEGER_32
{}
key_smessage: INTEGER_32
{}
key_smove: INTEGER_32
{}
key_snext: INTEGER_32
{}
key_soptions: INTEGER_32
{}
key_sprevious: INTEGER_32
{}
key_sprint: INTEGER_32
{}
key_sredo: INTEGER_32
{}
key_sreplace: INTEGER_32
{}
key_sright: INTEGER_32
{}
key_srsume: INTEGER_32
{}
key_ssave: INTEGER_32
{}
key_ssuspend: INTEGER_32
{}
key_sundo: INTEGER_32
{}
key_suspend: INTEGER_32
{}
key_undo: INTEGER_32
{}
key_mouse: INTEGER_32
{}
key_resize: INTEGER_32
{}
key_event: INTEGER_32
{}
key_max: INTEGER_32
{}
key_f0: INTEGER_32
{}
key_f1: INTEGER_32
{}
key_f2: INTEGER_32
{}
key_f3: INTEGER_32
{}
key_f4: INTEGER_32
{}
key_f5: INTEGER_32
{}
key_f6: INTEGER_32
{}
key_f7: INTEGER_32
{}
key_f8: INTEGER_32
{}
key_f9: INTEGER_32
{}
key_f10: INTEGER_32
{}
key_f11: INTEGER_32
{}
key_f12: INTEGER_32
{}
key_function (num: INTEGER_32): INTEGER_32
{}
is_equal (other: NCURSES): BOOLEAN
effective function
{ANY}
Is other attached to an object considered equal to current object?
require
  • other /= Void
ensure
  • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)
is_real_singleton: BOOLEAN
effective function
{}
ensure
  • assertion_check_only: Result
singleton_memory_pool: HASHED_DICTIONARY[POINTER, STRING]
once function
{}
This pool is unique in the whole system.
A memory is kept for each singleton type (type, not class) in the system.
current_is_not_an_expanded_type: BOOLEAN
effective function
{}
Check that the dynamic type of the SINGLETON is not an expanded type.