summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libgui.h
blob: db0146fa596356a406fe2d7b149da604118f545a (plain) (blame)
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
/*
 *  File:       libgui.cc
 *  Summary:    Functions for x11
 *  Written by: M.Itakura (?)
 */

// TODO enne - slowly morph this into tilesdl.h

#ifndef LIBGUI_H
#define LIBGUI_H
#ifdef USE_TILE

#include <stdio.h>

#include "defines.h"

typedef unsigned int screen_buffer_t;

void set_mouse_enabled(bool enabled);

struct coord_def;
struct crawl_view_geometry;

void gui_init_view_params(crawl_view_geometry &geom);

// If mouse on dungeon map, returns true and sets gc.
// Otherwise, it just returns false.
bool gui_get_mouse_grid_pos(coord_def &gc);

/* text display */
void textcolor(int color);
int wherex();
int wherey();
int cprintf(const char *format,...);
void clear_to_end_of_line(void);
void clear_to_end_of_screen(void);
int get_number_of_lines(void);
int get_number_of_cols(void);
void get_input_line_gui(char *const buff, int len);
void _setcursortype(int curstype);
void textbackground(int bg);
void textcolor(int col);
int putch(unsigned char chr);
int putwch(unsigned chr);
void put_colour_ch(int colour, unsigned ch);
void writeWChar(unsigned char *ch);

#define textattr(x) textcolor(x)
void set_cursor_enabled(bool enabled);
bool is_cursor_enabled();
inline void enable_smart_cursor(bool) { }
inline bool is_smart_cursor_enabled() { return false; }


int window(int x1, int y1, int x2, int y2);

extern "C" int getch();
int getch_ck();
int clrscr();
void message_out(int *which_line, int colour, const char *s, int firstcol = 0);
void cgotoxy(int x, int y, GotoRegion region = GOTO_CRT);
GotoRegion get_cursor_region();
void clear_message_window();
void delay(int ms);
void update_screen();
int kbhit();

#ifdef UNIX
extern "C" char *strlwr(char *str);
int itoa(int value, char *strptr, int radix);
#endif

#endif // USE_TILE
#endif // LIBGUI_H