ni_nitdoc: display VT in class sidebar
[nit.git] / lib / curses / curses.nit.c
1 /*
2 Extern implementation of Nit module curses
3 File initially created by nits to customize type of extern classes
4 */
5
6 #include "curses.nit.h"
7
8 /*
9 C implementation of curses::Window::init
10 */
11 Window new_Window___impl( )
12 {
13 WINDOW *res;
14 res = initscr();
15 if (res == NULL) {
16 fprintf(stderr, "Error initialising ncurses.\n");
17 exit(EXIT_FAILURE);
18 }
19 raw();
20 keypad(res, TRUE);
21 noecho();
22 }
23
24 /*
25 C implementation of curses::Window::mvaddstr
26
27 Imported methods signatures:
28 char * String_to_cstring( String recv ) for string::String::to_cstring
29 */
30 void Window_mvaddstr___impl( Window recv, bigint y, bigint x, String str )
31 {
32 char *c_string = String_to_cstring( str );
33 mvaddstr(y, x, c_string);
34 }
35
36 /*
37 C implementation of curses::Window::refresh
38 */
39 void Window_refresh___impl( Window recv )
40 {
41 refresh();
42 }
43
44 /*
45 C implementation of curses::Window::wclear
46 */
47 void Window_wclear___impl( Window recv ) {
48 wclear(recv);
49 }
50
51 /*
52 C implementation of curses::Window::delwin
53 */
54 void Window_delwin___impl( Window recv )
55 {
56 delwin(recv);
57 }
58
59 /*
60 C implementation of curses::Window::endwin
61 */
62 void Window_endwin___impl( Window recv )
63 {
64 endwin();
65 }