Initial Import
[glAntsMech.git] / glants_mech / linux / src / text.h
blobd260062269602976e6dbe8750225db6e28f64927
1 //
2 // Copyright (C) Dante Treglia II, 2000.
3 //
4 #ifndef _TEXT_H
5 #define _TEXT_H
7 #define MAX_STR 4096
9 #define TEXT_NONE 0x00
10 #define TEXT_DRAW_BOX 0x04
11 #define TEXT_DRAW_SPACES 0x02
12 #define TEXT_WRAP_SPACES 0x08
13 #define TEXT_DRAW_BACKGROUND 0x01
15 typedef struct {unsigned char r, g, b, a;} COLOR;
16 #define MALLOC malloc
18 #define SET_COLOR(c, rIn, gIn, bIn, aIn) \
19 c.r = rIn; \
20 c.g = gIn; \
21 c.b = bIn; \
22 c.a = aIn
24 typedef struct tagTextBox {
26 // Bounding Box
27 int boxL;
28 int boxR;
29 int boxT;
30 int boxB;
32 // Text Buffers
33 char *buffer;
34 char *drawBufferPtr;
36 // Info
37 int pageLineCnt;
38 int scrollCnt;
39 int currX;
40 int currY;
42 COLOR color;
44 unsigned int mode;
46 } TextBox, *TextBoxPtr;
48 void Paginate(TextBoxPtr text);
49 void DrawStr(TextBoxPtr text,
50 int x, int y, int maxFlag, int maxY, char* string);
51 void DrawBoundingBox(TextBoxPtr text);
54 void TextBegin(TextBoxPtr text);
55 void TextEnd(void);
56 void DrawString(TextBoxPtr text, int x, int y, char *str);
58 TextBoxPtr InitTextBox(int inL, int inR, int inT, int inB);
59 void DestroyTextBox(TextBoxPtr text);
60 void SetTextMode(TextBoxPtr text, unsigned int modeIn);
61 void DrawText(TextBoxPtr text);
62 void Printf(TextBoxPtr text,char* fmt, ... );
64 void FormatStrCat(TextBoxPtr text, char *str);
66 void SetTextColor(TextBoxPtr text, unsigned char r,
67 unsigned char g, unsigned char b);
69 void Reset_FontID(void);
71 #endif