about summary refs log tree commit diff stats
path: root/cpp/070console
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-04-20 12:35:47 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-04-20 12:36:05 -0700
commit54d48b25a08b5b238371b2d1bd0f594dad8dbeb9 (patch)
tree150507eb0c81dfbb26e7d79b16d71ff672b5369c /cpp/070console
parent07efdfd7072d84209b419e66e5a2b48a0c78b2ac (diff)
downloadmu-54d48b25a08b5b238371b2d1bd0f594dad8dbeb9.tar.gz
1111 - start adding ncurses primitives
Diffstat (limited to 'cpp/070console')
-rw-r--r--cpp/070console34
1 files changed, 34 insertions, 0 deletions
diff --git a/cpp/070console b/cpp/070console
new file mode 100644
index 00000000..18faffb6
--- /dev/null
+++ b/cpp/070console
@@ -0,0 +1,34 @@
+//: Text-mode cursor primitives. Currently thin wrappers around ncurses calls.
+
+:(before "End Includes")
+#include<ncurses.h>
+
+:(before "End Primitive Recipe Declarations")
+CONSOLE_MODE,
+:(before "End Primitive Recipe Numbers")
+Recipe_number["console-mode"] = CONSOLE_MODE;
+:(before "End Primitive Recipe Implementations")
+case CONSOLE_MODE: {
+  initscr();
+  break;
+}
+
+:(before "End Primitive Recipe Declarations")
+RETRO_MODE,
+:(before "End Primitive Recipe Numbers")
+Recipe_number["retro-mode"] = RETRO_MODE;
+:(before "End Primitive Recipe Implementations")
+case RETRO_MODE: {
+  endwin();
+  break;
+}
+
+:(before "End Primitive Recipe Declarations")
+WAIT_FOR_KEY,
+:(before "End Primitive Recipe Numbers")
+Recipe_number["wait-for-key"] = WAIT_FOR_KEY;
+:(before "End Primitive Recipe Implementations")
+case WAIT_FOR_KEY: {
+  getch();
+  break;
+}
p;id=37142b5d78d2eace9fef79d20793b0d42965dae5'>37142b5 ^
df1d1ef ^
824556a ^
df1d1ef ^


824556a ^

79c5696 ^



c896e6b ^
df1d1ef ^
55c8ffa ^
824556a ^


df1d1ef ^
df1d1ef ^
824556a ^


df1d1ef ^
37142b5 ^
824556a ^
79c5696 ^
824556a ^
df1d1ef ^
824556a ^






df1d1ef ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86