This repository has been archived by the owner on Oct 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconsole.h
79 lines (58 loc) · 2.05 KB
/
console.h
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
/*
* Copyright (C) 2010-2013 Skrilax_CZ
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CONSOLE_H_
#define CONSOLE_H_
#define CONSOLE_FORCE_QUIT -55
#define CONSOLE_FAILED_START -56
#include "ui.h"
extern color console_header_color;
extern color console_background_color;
extern color console_front_color;
extern color console_term_colors[16];
//runs the console in the current thread
int run_console();
//shows the console
void ui_console_begin();
//ends the console
void ui_console_end();
//returns the number of rows on the console
int ui_console_get_num_rows();
//returns the number of columns on the console
int ui_console_get_num_columns();
//returns console width in pixels
int ui_console_get_width();
//returns console height in pixels
int ui_console_get_height();
//scrolls up in the console
void ui_console_scroll_up(int num_rows);
//scrolls down in the console
void ui_console_scroll_down(int num_rows);
enum {
CONSOLE_HEADER_COLOR,
CONSOLE_DEFAULT_BACKGROUND_COLOR,
CONSOLE_DEFAULT_FRONT_COLOR
};
//get system console color
void ui_console_get_system_front_color(int which, unsigned char* r, unsigned char* g, unsigned char* b);
//set system console color
void ui_console_set_system_front_color(int which);
//gets the current console color
void ui_console_get_front_color(unsigned char* r, unsigned char* g, unsigned char* b);
//sets the current console color
void ui_console_set_front_color(unsigned char r, unsigned char g, unsigned char b);
//prints to console
void ui_console_print(const char *text);
#endif //!CONSOLE_H_