00001 /* 00002 * File: libgui.cc 00003 * Summary: Functions for x11 00004 * Written by: M.Itakura (?) 00005 */ 00006 00007 // TODO enne - slowly morph this into tilesdl.h 00008 00009 #ifndef LIBGUI_H 00010 #define LIBGUI_H 00011 #ifdef USE_TILE 00012 00013 #include <stdio.h> 00014 00015 #include "defines.h" 00016 00017 typedef unsigned int screen_buffer_t; 00018 00019 void set_mouse_enabled(bool enabled); 00020 00021 struct coord_def; 00022 struct crawl_view_geometry; 00023 00024 void gui_init_view_params(crawl_view_geometry &geom); 00025 00026 // If mouse on dungeon map, returns true and sets gc. 00027 // Otherwise, it just returns false. 00028 bool gui_get_mouse_grid_pos(coord_def &gc); 00029 00030 /* text display */ 00031 void textcolor(int color); 00032 int wherex(); 00033 int wherey(); 00034 int cprintf(const char *format,...); 00035 void clear_to_end_of_line(void); 00036 void clear_to_end_of_screen(void); 00037 int get_number_of_lines(void); 00038 int get_number_of_cols(void); 00039 void _setcursortype(int curstype); 00040 void textbackground(int bg); 00041 void textcolor(int col); 00042 int putch(unsigned char chr); 00043 int putwch(unsigned chr); 00044 void put_colour_ch(int colour, unsigned ch); 00045 void writeWChar(unsigned char *ch); 00046 00047 #define textattr(x) textcolor(x) 00048 void set_cursor_enabled(bool enabled); 00049 bool is_cursor_enabled(); 00050 inline void enable_smart_cursor(bool) { } 00051 inline bool is_smart_cursor_enabled() { return false; } 00052 00053 00054 int window(int x1, int y1, int x2, int y2); 00055 00056 extern "C" int getch(); 00057 int getch_ck(); 00058 int clrscr(); 00059 void cgotoxy(int x, int y, GotoRegion region = GOTO_CRT); 00060 coord_def cgetpos(GotoRegion region = GOTO_CRT); 00061 GotoRegion get_cursor_region(); 00062 void delay(int ms); 00063 void update_screen(); 00064 int kbhit(); 00065 00066 #ifdef UNIX 00067 extern "C" char *strlwr(char *str); 00068 int itoa(int value, char *strptr, int radix); 00069 #endif 00070 00071 #endif // USE_TILE 00072 #endif // LIBGUI_H