Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[710805]: o.h Maximize Restore History

Download this file

o.h    72 lines (56 with data), 2.6 kB

 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
/* STALLioN - Cross-platform terminal input-output library
Copyright (C) 2012 Daniel Mansfield <daniel.mansfield99@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef O_H
#define O_H
/* Structure for storing formatted characters */
typedef struct
{
/* The foreground and background colours of the character */
int foreCol, backCol;
/* The ASCII character itself */
char ch;
} iocharacter;
/* Structure storing all of the information required for a single display
buffer */
typedef struct
{
/* This will be wrote to the screen when the buffer is flushed. Everything
which changes the content of a display should change the values in this
buffer */
iocharacter *buffer;
/* Secondary buffer which stores what was previously wrote to the screen.
Enables a perfromance boost by only printing the sections of the buffer
which have been altered since the last flush */
iocharacter *oldBuffer;
/* Vertical length and horizontal width of the buffer, in lines and
characters respectively. */
int bufferLength, bufferWidth;
/* When no colour information is supplied with a function, these default
values are used instead */
int defaultForeCol, defaultBackCol;
/* Cursor visibility period, measured in flushes. The cursor is flashed on
and off at this speed; a value of 10 means it is shown for 10 flushes
then hidden for 10 flushes */
int cursorPeriod;
/* Number of flushes since the last toggle of the cursor. See above for its
use. */
int cursorLastChangeTime;
/* The state and position of the cursor in the buffer. CursorVisible is
a boolean value; 1 = visible, 0 = invisible. */
int cursorPos, cursorVisible;
/* The colours the character underneath the character changes to. */
int cursorFore, cursorBack;
} iodisplay;
iodisplay *ioCurrentDisplay;
#endif /* O_H */