diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-04-20 17:40:25 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-04-20 17:40:25 -0700 |
commit | ec961781d0dd952384d08639b74f4b5a14942259 (patch) | |
tree | e5eb6b0814c5d2c4c511db37e4583e70e1ba0b86 /cpp | |
parent | 12d73ee8db0f6748fabf65f4d0789c79f76c8d1f (diff) | |
download | mu-ec961781d0dd952384d08639b74f4b5a14942259.tar.gz |
1115 - another pass at names: console and display
(Follow-up to 544.)
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/070display (renamed from cpp/070console) | 16 | ||||
-rw-r--r-- | cpp/display.mu (renamed from cpp/console.mu) | 4 |
2 files changed, 12 insertions, 8 deletions
diff --git a/cpp/070console b/cpp/070display index dcb6da96..a64aa550 100644 --- a/cpp/070console +++ b/cpp/070display @@ -1,4 +1,8 @@ //: Text-mode cursor primitives. Currently thin wrappers around ncurses calls. +//: Mu starts out at the 'console' where lines wrap and scrolling is +//: automatic, where keys aren't read until pressing <enter>. +//: This file provides mechanisms for opening a 'display' and taking raw +//: charge of the cursor and keyboard. :(before "End Includes") #include<ncurses.h> @@ -6,21 +10,21 @@ //:: Display management :(before "End Primitive Recipe Declarations") -CURSOR_MODE, +SWITCH_TO_DISPLAY, :(before "End Primitive Recipe Numbers") -Recipe_number["cursor-mode"] = CURSOR_MODE; +Recipe_number["switch-to-display"] = SWITCH_TO_DISPLAY; :(before "End Primitive Recipe Implementations") -case CURSOR_MODE: { +case SWITCH_TO_DISPLAY: { initscr(); break; } :(before "End Primitive Recipe Declarations") -RETRO_MODE, +RETURN_TO_CONSOLE, :(before "End Primitive Recipe Numbers") -Recipe_number["retro-mode"] = RETRO_MODE; +Recipe_number["return-to-console"] = RETURN_TO_CONSOLE; :(before "End Primitive Recipe Implementations") -case RETRO_MODE: { +case RETURN_TO_CONSOLE: { endwin(); break; } diff --git a/cpp/console.mu b/cpp/display.mu index d83619c7..fa5f3b85 100644 --- a/cpp/console.mu +++ b/cpp/display.mu @@ -1,5 +1,5 @@ recipe main [ - cursor-mode 0:literal/screen + switch-to-display print-character-to-display 97:literal 1:integer/raw, 2:integer/raw <- cursor-position-on-display $print 1:integer/raw @@ -15,5 +15,5 @@ recipe main [ move-cursor-on-display 0:literal, 0:literal clear-line-on-display wait-for-key-from-keyboard - retro-mode 0:literal/screen + return-to-console ] |