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
|
/*
* File: tilereg_text.h
* Created by: ennewalker on Sat Jan 5 01:33:53 2008 UTC
*/
#ifdef USE_TILE
#ifndef TILEREG_TEXT_H
#define TILEREG_TEXT_H
#include "tilereg.h"
class TextRegion : public Region
{
public:
TextRegion(FontWrapper *font);
virtual ~TextRegion();
virtual void render();
virtual void clear();
// STATIC -
// TODO enne - move these to TilesFramework?
// where now printing? what color?
static int print_x;
static int print_y;
static int text_col;
// which region now printing?
static class TextRegion *text_mode;
// display cursor? where is the cursor now?
static int cursor_flag;
static class TextRegion *cursor_region;
static int cursor_x;
static int cursor_y;
// class methods
static void cgotoxy(int x, int y);
static int wherex();
static int wherey();
//static int get_number_of_lines(void);
static void _setcursortype(int curstype);
static void textbackground(int bg);
static void textcolor(int col);
// Object's method
void clear_to_end_of_line(void);
void putch(unsigned char chr);
void writeWChar(unsigned char *ch);
unsigned char *cbuf; //text backup
unsigned char *abuf; //textcolor backup
int cx_ofs; //cursor x offset
int cy_ofs; //cursor y offset
void addstr(char *buffer);
void addstr_aux(char *buffer, int len);
void adjust_region(int *x1, int *x2, int y);
void scroll();
protected:
virtual void on_resize();
FontWrapper *m_font;
};
#endif
#endif
|