/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#pragma once

S_BEGIN_DECLS

/**
 * @file
 * @defgroup Console Console
 * @addtogroup Console
 * @{
 * @brief Set of functions and data structures to deal with console or terminal
 *        related thing.
 */

/**
 * Get the height and width of the console.
 *
 * @param height The output parameter for the height of the console.
 * @param width The output parameter for the width of the console.
 *
 * @code

 * @endcode
 */
S_EXPORTED
void
s_console_get_size (sint * height, sint * width);

/**
 * @defgroup SConsoleBuffer SConsoleBuffer
 * @addtogroup SConsoleBuffer
 * @{
 * @brief Datastructure that makes dealing with writing to the console/terminal
 *        in big chunks easyer.
 *
 * SConsoleBuffer internally uses @c suint for the buffer, this so that when
 * we write to the terminal/console we can draw any charercter... Hopefully.
 */


/**
 * @brief An opaque datastructure that reperesents the console buffer object.
 */
typedef struct _SConsoleBuffer SConsoleBuffer;


typedef enum {
  S_CONSOLE_BUFFER_MODE_NONE = 0,
  S_CONSOLE_BUFFER_MODE_LINE,
  S_CONSOLE_BUFFER_MODE_FULL,
  S_CONSOLE_BUFFER_MODE_UNUSED_0,
  S_CONSOLE_BUFFER_MODE_UNUSED_1,
  S_CONSOLE_BUFFER_MODE_UNUSED_2
} SConsoleBufferMode;


/**
 * @brief Create a new SConsoleBuffer.
 *
 * @param height The height of the buffer 
 * @param width The width of the buffer.
 *
 * @returns a new SConsoleBuffer object.
 */
S_EXPORTED
SConsoleBuffer *
s_console_buffer_new (sint height, sint width, SConsoleBufferMode mode);

/**
 * @brief Free a SConsoleBuffer
 * 
 * @param self The object to be freed.
 */
S_EXPORTED
void
s_console_buffer_free (SConsoleBuffer * self);

/**
 *
 */
S_EXPORTED
void
s_console_buffer_set_char (SConsoleBuffer * self, suchar c, sint x, sint y);

S_EXPORTED
void
s_console_buffer_set_mode (SConsoleBuffer * self, SConsoleBufferMode mode);

S_EXPORTED
void
s_console_buffer_draw (SConsoleBuffer * self);

S_EXPORTED
void
s_console_buffer_resize (SConsoleBuffer * self, sint x, sint y);

/**
 * @}
 * @}
 */

S_END_DECLS