datpath: Avoid reporting half updated statistics.
[sliver-openvswitch.git] / extras / ezio / ezio.h
1 /* Copyright (c) 2008, 2009 Nicira Networks, Inc.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15
16 #ifndef EZIO_H
17 #define EZIO_H 1
18
19 #include <stdbool.h>
20 #include <stdint.h>
21
22 /* Constants for visual representation of a row in an EZIO icon. */
23 #define e_____ 0x00
24 #define e____X 0x01
25 #define e___X_ 0x02
26 #define e___XX 0x03
27 #define e__X__ 0x04
28 #define e__X_X 0x05
29 #define e__XX_ 0x06
30 #define e__XXX 0x07
31 #define e_X___ 0x08
32 #define e_X__X 0x09
33 #define e_X_X_ 0x0a
34 #define e_X_XX 0x0b
35 #define e_XX__ 0x0c
36 #define e_XX_X 0x0d
37 #define e_XXX_ 0x0e
38 #define e_XXXX 0x0f
39 #define eX____ 0x10
40 #define eX___X 0x11
41 #define eX__X_ 0x12
42 #define eX__XX 0x13
43 #define eX_X__ 0x14
44 #define eX_X_X 0x15
45 #define eX_XX_ 0x16
46 #define eX_XXX 0x17
47 #define eXX___ 0x18
48 #define eXX__X 0x19
49 #define eXX_X_ 0x1a
50 #define eXX_XX 0x1b
51 #define eXXX__ 0x1c
52 #define eXXX_X 0x1d
53 #define eXXXX_ 0x1e
54 #define eXXXXX 0x1f
55
56 struct ezio {
57     uint8_t icons[8][8];
58     uint8_t chars[2][40];
59     int x, y, x_ofs;
60     bool show_cursor;
61     bool blink_cursor;
62 };
63
64 void ezio_init(struct ezio *);
65 void ezio_set_icon(struct ezio *, int idx,
66                    int row0, int row1, int row2, int row3,
67                    int row4, int row5, int row6, int row7);
68 void ezio_set_default_icon(struct ezio *, int idx);
69 void ezio_clear(struct ezio *);
70 void ezio_put_char(struct ezio *, int x, int y, uint8_t c);
71 void ezio_line_feed(struct ezio *);
72 void ezio_newline(struct ezio *);
73 void ezio_delete_char(struct ezio *, int x, int y, int n);
74 void ezio_delete_line(struct ezio *, int y, int n);
75 void ezio_insert_char(struct ezio *, int x, int y, int n);
76 void ezio_insert_line(struct ezio *, int y, int n);
77 void ezio_scroll_left(struct ezio *, int n);
78 void ezio_scroll_right(struct ezio *, int n);
79 void ezio_scroll_up(struct ezio *, int n);
80 void ezio_scroll_down(struct ezio *, int n);
81 bool ezio_chars_differ(const struct ezio *, const struct ezio *,
82                        int x0, int x1, int *xp, int *yp);
83
84 #endif /* ezio.h */