소스 검색

Change movetoyx(), putc() and getc() to methods of the screen.

tags/v0.9.3
Michael Brown 18 년 전
부모
커밋
6b514393d3
1개의 변경된 파일23개의 추가작업 그리고 26개의 파일을 삭제
  1. 23
    26
      src/include/curses.h

+ 23
- 26
src/include/curses.h 파일 보기

@@ -28,6 +28,29 @@ typedef chtype attr_t;
28 28
 
29 29
 /** Curses SCREEN object */
30 30
 typedef struct _curses_screen {
31
+	/**
32
+	 * Move cursor to position specified by x,y coords
33
+	 *
34
+	 * @v scr	screen on which to operate
35
+	 * @v y		Y position
36
+	 * @v x		X position
37
+	 */
38
+	void ( * movetoyx ) ( struct _curses_screen *scr,
39
+			      unsigned int y, unsigned int x );
40
+	/**
41
+	 * Write character to current cursor position
42
+	 *
43
+	 * @v scr	screen on which to operate
44
+	 * @v c		character to be written
45
+	 */
46
+	void ( * putc ) ( struct _curses_screen *scr, chtype c );
47
+	/**
48
+	 * Read a character
49
+	 *
50
+	 * @v scr	screen on which to operate
51
+	 * @ret c	character
52
+	 */
53
+	int ( * getc ) ( struct _curses_screen *scr );
31 54
 } SCREEN;
32 55
 
33 56
 /** Curses Window struct */
@@ -812,32 +835,6 @@ static inline int waddstr ( WINDOW *win, const char *str ) {
812 835
 /*
813 836
  * Primitives
814 837
  */
815
-/**
816
- * Move cursor to position specified by x,y coords
817
- *
818
- * @v *scr	screen on which to operate
819
- * @v y		Y position
820
- * @v x		X position
821
- * @ret rc	void function
822
- */
823
-void _movetoyx ( struct _curses_screen *scr, unsigned int y, unsigned int x );
824
-/**
825
- * Write character (c) to current cursor position
826
- *
827
- * @v *scr	screen on which to operate
828
- * @v c		character to be written
829
- * @ret rc	void function
830
- */
831
-void _putc ( struct _curses_screen *scr, unsigned int c );
832
-/**
833
- * Retrieve a character from current cursor position and store
834
- * it in c
835
- *
836
- * @v *scr	screen on which to operate
837
- * @v *c	char ptr where retrieved character is to be stored
838
- * @ret rc	void function
839
- */
840
-void _getc ( struct _curses_screen *scr, unsigned int *c );
841 838
 /**
842 839
  * Advance cursor (wrap text)
843 840
  *

Loading…
취소
저장