OSDN Git Service

Changed the implementation with lib.
[kozos-expbrd/kozos_expbrd.git] / firm / sample / simple_mp3_player / target / os / ntshell / vtsend.h
1 /**
2  * @file vtsend.h
3  * @author Shinichiro Nakamura
4  * @brief VT100 Senderの定義。
5  */
6
7 /*
8  * ===============================================================
9  *  Natural Tiny Shell (NT-Shell)
10  *  Version 0.0.8
11  * ===============================================================
12  * Copyright (c) 2010-2011 Shinichiro Nakamura
13  *
14  * Permission is hereby granted, free of charge, to any person
15  * obtaining a copy of this software and associated documentation
16  * files (the "Software"), to deal in the Software without
17  * restriction, including without limitation the rights to use,
18  * copy, modify, merge, publish, distribute, sublicense, and/or
19  * sell copies of the Software, and to permit persons to whom the
20  * Software is furnished to do so, subject to the following
21  * conditions:
22  *
23  * The above copyright notice and this permission notice shall be
24  * included in all copies or substantial portions of the Software.
25  *
26  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
27  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
28  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
29  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
30  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
31  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
32  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
33  * OTHER DEALINGS IN THE SOFTWARE.
34  * ===============================================================
35  */
36
37 #ifndef VTSEND_H
38 #define VTSEND_H
39
40 #define VTSEND_COLOR_BLACK      (0)
41 #define VTSEND_COLOR_RED        (1)
42 #define VTSEND_COLOR_GREEN      (2)
43 #define VTSEND_COLOR_YELLOW     (3)
44 #define VTSEND_COLOR_BLUE       (4)
45 #define VTSEND_COLOR_MAGENTA    (5)
46 #define VTSEND_COLOR_CYAN       (6)
47 #define VTSEND_COLOR_WHITE      (7)
48
49 #define VTSEND_ATTR_OFF             (0)
50 #define VTSEND_ATTR_BOLD_ON         (1)
51 #define VTSEND_ATTR_UNDERSCORE      (4)
52 #define VTSEND_ATTR_BLINK_ON        (5)
53 #define VTSEND_ATTR_REVERSE         (7)
54 #define VTSEND_ATTR_CONCEALED_ON    (8)
55
56 typedef struct {
57     int (*uart_write)(const char *buf, const int siz);
58 } vtsend_t;
59
60 int vtsend_init(
61         vtsend_t *p, int (*uart_write)(const char *buf, const int siz));
62 int vtsend_cursor_position(vtsend_t *p, const int column, const int line);
63 int vtsend_cursor_up(vtsend_t *p, const int n);
64 int vtsend_cursor_down(vtsend_t *p, const int n);
65 int vtsend_cursor_forward(vtsend_t *p, const int n);
66 int vtsend_cursor_backward(vtsend_t *p, const int n);
67 int vtsend_cursor_position_save(vtsend_t *p);
68 int vtsend_cursor_position_restore(vtsend_t *p);
69 int vtsend_erase_display(vtsend_t *p);
70 int vtsend_erase_line(vtsend_t *p);
71 int vtsend_set_color_foreground(vtsend_t *p, const int color);
72 int vtsend_set_color_background(vtsend_t *p, const int color);
73 int vtsend_set_attribute(vtsend_t *p, const int attr);
74 int vtsend_set_scroll_region(vtsend_t *p, const int top, const int bottom);
75 int vtsend_set_cursor(vtsend_t *p, const int visible);
76 int vtsend_reset(vtsend_t *p);
77
78 int vtsend_draw_box(
79         vtsend_t *p,
80         const int x1, const int y1, const int x2, const int y2);
81 int vtsend_fill_box(
82         vtsend_t *p,
83         const int x1, const int y1, const int x2, const int y2);
84
85 #endif
86