bzr branch
http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
140
by Gustav Hartvigsson
* Added Better comments to SRingBuffer |
1 |
#pragma once
|
2 |
||
3 |
S_BEGIN_DECLS
|
|
4 |
||
5 |
/**
|
|
6 |
* @file
|
|
7 |
* @defgroup Console Console
|
|
8 |
* @addtogroup Console
|
|
9 |
* @{
|
|
10 |
* @brief Set of functions and data structures to deal with console or terminal
|
|
11 |
* related thing.
|
|
12 |
*/
|
|
13 |
||
14 |
/**
|
|
15 |
* Get the height and width of the console.
|
|
16 |
*
|
|
17 |
* @param height The output parameter for the height of the console.
|
|
18 |
* @param width The output parameter for the width of the console.
|
|
19 |
*
|
|
20 |
* @code
|
|
21 |
||
22 |
* @endcode
|
|
23 |
*/
|
|
24 |
S_EXPORTED
|
|
25 |
void
|
|
26 |
s_console_get_size (sint * height, sint * width); |
|
27 |
||
28 |
/**
|
|
29 |
* @defgroup SConsoleBuffer SConsoleBuffer
|
|
30 |
* @addtogroup SConsoleBuffer
|
|
31 |
* @{
|
|
32 |
* @brief Datastructure that makes dealing with writing to the console/terminal
|
|
33 |
* in big chunks easyer.
|
|
34 |
*
|
|
35 |
* SConsoleBuffer internally uses @c suint for the buffer, this so that when
|
|
36 |
* we write to the terminal/console we can draw any charercter... Hopefully.
|
|
37 |
*/
|
|
38 |
||
39 |
||
40 |
/**
|
|
41 |
* @brief An opaque datastructure that reperesents the console buffer object.
|
|
42 |
*/
|
|
43 |
typedef struct _SConsoleBuffer SConsoleBuffer; |
|
44 |
||
45 |
||
46 |
typedef enum { |
|
47 |
S_CONSOLE_BUFFER_MODE_NONE = 0, |
|
48 |
S_CONSOLE_BUFFER_MODE_LINE, |
|
49 |
S_CONSOLE_BUFFER_MODE_FULL, |
|
50 |
S_CONSOLE_BUFFER_MODE_UNUSED_0, |
|
51 |
S_CONSOLE_BUFFER_MODE_UNUSED_1, |
|
52 |
S_CONSOLE_BUFFER_MODE_UNUSED_2 |
|
53 |
} SConsoleBufferMode; |
|
54 |
||
55 |
||
56 |
/**
|
|
57 |
* @brief Create a new SConsoleBuffer.
|
|
58 |
*
|
|
59 |
* @param height The height of the buffer
|
|
60 |
* @param width The width of the buffer.
|
|
61 |
*
|
|
62 |
* @returns a new SConsoleBuffer object.
|
|
63 |
*/
|
|
64 |
S_EXPORTED
|
|
65 |
SConsoleBuffer * |
|
66 |
s_console_buffer_new (sint height, sint width, SConsoleBufferMode mode); |
|
67 |
||
68 |
/**
|
|
69 |
* @brief Free a SConsoleBuffer
|
|
70 |
*
|
|
71 |
* @param self The object to be freed.
|
|
72 |
*/
|
|
73 |
S_EXPORTED
|
|
74 |
void
|
|
75 |
s_console_buffer_free (SConsoleBuffer * self); |
|
76 |
||
77 |
/**
|
|
78 |
*
|
|
79 |
*/
|
|
80 |
S_EXPORTED
|
|
81 |
void
|
|
82 |
s_console_buffer_set_char (SConsoleBuffer * self, suchar c, sint x, sint y); |
|
83 |
||
84 |
S_EXPORTED
|
|
85 |
void
|
|
86 |
s_console_buffer_set_mode (SConsoleBuffer * self, SConsoleBufferMode mode); |
|
87 |
||
88 |
S_EXPORTED
|
|
89 |
void
|
|
90 |
s_console_buffer_draw (SConsoleBuffer * self); |
|
91 |
||
92 |
S_EXPORTED
|
|
93 |
void
|
|
94 |
s_console_buffer_resize (SConsoleBuffer * self, sint x, sint y); |
|
95 |
||
96 |
/**
|
|
97 |
* @}
|
|
98 |
* @}
|
|
99 |
*/
|
|
100 |
||
101 |
S_END_DECLS
|