]> git.vomp.tv Git - vompclient-marten.git/blob - box.h
New gui code
[vompclient-marten.git] / box.h
1 /*
2     Copyright 2004-2005 Chris Tallon
3
4     This file is part of VOMP.
5
6     VOMP is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     VOMP is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with VOMP; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 */
20
21 #ifndef BOX_H
22 #define BOX_H
23
24 #include <stdio.h>
25
26 #include "log.h"
27 #include "colour.h"
28 #include "surface.h"
29
30 // Abstract ???????
31 class Box
32 {
33   public:
34     Box();
35     virtual ~Box();
36
37     void setScreenPos(int x, int y);
38     void setSurfaceOffset(UINT x, UINT y);
39
40     void show(int noBufferToScreen = 0);
41
42     virtual void draw();
43
44     // Drawing functions level 1
45     void fillColour(Colour& colour);
46     void drawPara(char* text, int x, int y, Colour& colour);
47
48     // Drawing functions level 0
49     void rectangle(int x1, int y1, int x2, int y2, Colour& colour);
50     void drawText(char* text, int x, int y, Colour& colour);
51     void drawTextRJ(char* text, int x, int y, Colour& colour);
52     void drawPixel(UINT x, UINT y, Colour& colour);
53
54     int getScreenX();
55     int getScreenY();
56     int getWidth();
57     int getHeight();
58
59   private:
60
61   protected:
62     Surface* surface;
63     UINT width;
64     UINT height;
65
66     int screenX;
67     int screenY;
68
69     UINT offsetX;
70     UINT offsetY;
71
72     static char numBoxes;
73
74     static const int paraMargin = 10;
75
76 };
77
78 #endif