]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/guimisc.h
Creating Qt/Experimental branch of trunk.
[virtualjaguar] / src / gui / guimisc.h
1 //
2 // Miscellaneous GUI utility functions
3 //
4 // by James L. Hammons
5 //
6
7 #ifndef __GUIMISC_H__
8 #define __GUIMISC_H__
9
10 #include <string>
11 #include "types.h"
12
13 int stringCmpi(const std::string &, const std::string &);
14 //void DrawTransparentBitmap(uint32 * screen, uint32 x, uint32 y, uint32 * bitmap, uint8 * alpha = NULL);
15 void DrawTransparentBitmapDeprecated(uint32 * screen, uint32 x, uint32 y, uint32 * bitmap);
16 void DrawTransparentBitmap(uint32 * screen, uint32 x, uint32 y, const void * bitmap);
17 void DrawBitmap(uint32 * screen, uint32 x, uint32 y, const void * bitmap);
18 //Should call this FillScreenRectangle with a number representing the RGBA value to fill. !!! FIX !!!
19 //void ClearScreenRectangle(uint32 * screen, uint32 x, uint32 y, uint32 w, uint32 h);
20 void FillScreenRectangle(uint32 * screen, uint32 x, uint32 y, uint32 w, uint32 h, uint32 color);
21 void DrawStringTrans(uint32 * screen, uint32 x, uint32 y, uint32 color, uint8 opacity, const char * text, ...);
22 void DrawStringOpaque(uint32 * screen, uint32 x, uint32 y, uint32 color1, uint32 color2, const char * text, ...);
23 void DrawString(uint32 * screen, uint32 x, uint32 y, bool invert, const char * text, ...);
24 void DrawString2(uint32 * screen, uint32 x, uint32 y, uint32 color, uint8 transparency, const char * text, ...);
25
26 // Useful enumerations
27
28 enum { WINDOW_CLOSE, MENU_ITEM_CHOSEN };
29
30 // This is for font2 (crappy--fix!!!)
31
32 #define FONT_WIDTH              8
33 #define FONT_HEIGHT             16
34
35 // And this is for the various closeBox stuff--crappy--fix!!!
36
37 #define CLOSEBOX_WIDTH          15
38 #define CLOSEBOX_HEIGHT         15
39
40 // Okay, this is ugly but works and I can't think of any better way to handle this. So what
41 // we do when we pass the GIMP bitmaps into a function is pass them as a (void *) and then
42 // cast them as type (Bitmap *) in order to use them. Yes, it's ugly. Come up with something
43 // better!
44
45 struct Bitmap {
46         unsigned int width;
47         unsigned int height;
48         unsigned int bytesPerPixel;                                     // 3:RGB, 4:RGBA
49         unsigned char pixelData[];
50 };
51
52 // GUI bitmaps/fonts (exported)
53
54 extern char font1[];
55 extern char font2[];
56
57 extern uint32 mousePic[];
58 extern uint32 upArrowBox[];
59 extern uint32 downArrowBox[];
60 extern uint32 pushButtonUp[];
61 extern uint8 pbuAlpha[];
62 extern uint32 pushButtonDown[];
63 extern uint8 pbdAlpha[];
64 extern uint32 slideSwitchUp[];
65 extern uint32 slideSwitchDown[];
66 extern uint32 closeBox[];
67 extern uint32 closeBoxHover[];
68 extern uint32 closeBoxDown[];
69
70 extern uint8 pbUp[];
71 extern uint8 pbDown[];
72 extern uint8 vj_title_small[];
73
74 #endif  // __GUIMISC_H__