Browse Source

Use current attributes when erasing.

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
c1bac56f85
3 changed files with 16 additions and 4 deletions
  1. 3
    3
      src/hci/mucurses/clear.c
  2. 12
    1
      src/hci/mucurses/mucurses.c
  3. 1
    0
      src/hci/mucurses/mucurses.h

+ 3
- 3
src/hci/mucurses/clear.c View File

19
 
19
 
20
 	_store_curs_pos( win, &pos );
20
 	_store_curs_pos( win, &pos );
21
 	do {
21
 	do {
22
-		_wputch( win, (unsigned)' ', WRAP );
22
+		_wputc( win, ' ', WRAP );
23
 	} while ( win->curs_y + win->curs_x );
23
 	} while ( win->curs_y + win->curs_x );
24
 	_restore_curs_pos( win, &pos );
24
 	_restore_curs_pos( win, &pos );
25
 
25
 
37
 
37
 
38
 	_store_curs_pos( win, &pos );
38
 	_store_curs_pos( win, &pos );
39
 	while ( ( win->curs_y - pos.y ) == 0 ) {
39
 	while ( ( win->curs_y - pos.y ) == 0 ) {
40
-		_wputch( win, (unsigned)' ', WRAP );
40
+		_wputc( win, ' ', WRAP );
41
 	}
41
 	}
42
 	_restore_curs_pos( win, &pos );
42
 	_restore_curs_pos( win, &pos );
43
 
43
 
51
  * @ret rc	return status code
51
  * @ret rc	return status code
52
  */
52
  */
53
 int wdelch ( WINDOW *win ) {
53
 int wdelch ( WINDOW *win ) {
54
-	_wputch( win, (unsigned)' ', NOWRAP );
54
+	_wputc( win, ' ', NOWRAP );
55
 	_wcursback( win );
55
 	_wcursback( win );
56
 
56
 
57
 	return OK;
57
 	return OK;

+ 12
- 1
src/hci/mucurses/mucurses.c View File

58
 	}
58
 	}
59
 }
59
 }
60
 
60
 
61
+/**
62
+ * Write a single character to a window
63
+ *
64
+ * @v *win	window in which to write
65
+ * @v c		character rendition to write
66
+ * @v wrap	wrap "switch"
67
+ */
68
+void _wputc ( WINDOW *win, char c, int wrap ) {
69
+	_wputch ( win, ( c | win->attrs ), wrap );
70
+}
71
+
61
 /**
72
 /**
62
  * Retreat the cursor back one position (useful for a whole host of
73
  * Retreat the cursor back one position (useful for a whole host of
63
  * ops)
74
  * ops)
100
  */
111
  */
101
 void _wputstr ( WINDOW *win, const char *str, int wrap, int n ) {
112
 void _wputstr ( WINDOW *win, const char *str, int wrap, int n ) {
102
 	for ( ; *str && n-- ; str++ ) {
113
 	for ( ; *str && n-- ; str++ ) {
103
-		_wputch( win, *str | win->attrs, wrap );
114
+		_wputc ( win, *str, wrap );
104
 	}
115
 	}
105
 }
116
 }
106
 
117
 

+ 1
- 0
src/hci/mucurses/mucurses.h View File

13
 extern SCREEN _ansi_screen;
13
 extern SCREEN _ansi_screen;
14
 
14
 
15
 extern void _wputch ( WINDOW *win, chtype ch, int wrap );
15
 extern void _wputch ( WINDOW *win, chtype ch, int wrap );
16
+extern void _wputc ( WINDOW *win, char c, int wrap );
16
 extern void _wputchstr ( WINDOW *win, const chtype *chstr, int wrap, int n );
17
 extern void _wputchstr ( WINDOW *win, const chtype *chstr, int wrap, int n );
17
 extern void _wputstr ( WINDOW *win, const char *str, int wrap, int n );
18
 extern void _wputstr ( WINDOW *win, const char *str, int wrap, int n );
18
 extern void _wcursback ( WINDOW *win );
19
 extern void _wcursback ( WINDOW *win );

Loading…
Cancel
Save