mudgangster

Tiny, scriptable MUD client
Log | Files | Refs | README

ui.h (1366B)


      1 #pragma once
      2 
      3 #include "common.h"
      4 
      5 // TODO: probably don't need most of these
      6 enum Colour {
      7 	BLACK,
      8 	RED,
      9 	GREEN,
     10 	YELLOW,
     11 	BLUE,
     12 	MAGENTA,
     13 	CYAN,
     14 	WHITE,
     15 	SYSTEM,
     16 
     17 	NUM_COLOURS,
     18 
     19 	COLOUR_BG,
     20 	COLOUR_STATUSBG,
     21 	COLOUR_CURSOR,
     22 };
     23 
     24 void ui_draw_status();
     25 void ui_clear_status();
     26 void ui_statusAdd( char c, Colour fg, bool bold );
     27 
     28 void ui_main_newline();
     29 void ui_main_print( const char * str, size_t len, Colour fg, Colour bg, bool bold );
     30 void ui_chat_newline();
     31 void ui_chat_print( const char * str, size_t len, Colour fg, Colour bg, bool bold );
     32 
     33 void ui_fill_rect( int left, int top, int width, int height, Colour colour, bool bold );
     34 void ui_draw_char( int left, int top, char c, Colour colour, bool bold, bool force_bold_font = false );
     35 
     36 void ui_redraw_dirty();
     37 void ui_redraw_everything();
     38 
     39 void ui_update_layout();
     40 void ui_resize( int width, int height );
     41 
     42 void ui_scroll( int offset );
     43 void ui_page_down();
     44 void ui_page_up();
     45 
     46 void ui_mouse_down( int x, int y );
     47 void ui_mouse_move( int x, int y );
     48 void ui_mouse_up( int x, int y );
     49 
     50 void ui_get_font_size( int * fw, int * fh );
     51 
     52 void ui_urgent();
     53 
     54 void ui_init();
     55 void ui_term();
     56 
     57 void * platform_connect( const char ** err, const char * host, int port );
     58 void platform_send( void * sock, const char * data, size_t len );
     59 void platform_close( void * sock );
     60 
     61 bool ui_set_font( const char * name, int size );