]> Shamusworld >> Repos - apple2/blob - src/gui/guimisc.h
Set eol-style to native to keep things sane.
[apple2] / src / gui / guimisc.h
1 //
2 // GUIMISC.H
3 //
4 // Graphical User Interface support functions
5 //
6
7 #ifndef __GUIMISC_H__
8 #define __GUIMISC_H__
9
10 #include <SDL.h>
11 #include <stdarg.h>
12 #include "types.h"
13
14 // Useful structs
15
16 struct Font
17 {
18         Font(uint8 * d = NULL, uint32 w = 0, uint32 h = 0): data(d), width(w), height(h) {}
19
20         uint8 * data;
21         uint32 width, height;
22 };
23
24 // Okay, this is ugly but works and I can't think of any better way to handle this. So what
25 // we do when we pass the GIMP bitmaps into a function is pass them as a (void *) and then
26 // cast them as type (Bitmap *) in order to use them. Yes, it's ugly. Come up with something
27 // better!
28
29 /*struct Bitmap {
30         unsigned int width;
31         unsigned int height;
32         unsigned int bytesPerPixel;                                     // 3:RGB, 4:RGBA
33         unsigned char pixelData[];
34 };*/
35
36 // A better way is just to use the following format:
37 // bytes 0-1: width (HI/LO)
38 // bytes 2-3: height (HI/LO)
39 // bytes 4-n: pixel data in RGBA format
40
41 // Global functions
42
43 //void SetFont(uint8 *, uint32, uint32);
44 void SetNewFont(Font);
45 void RestoreOldFont(void);
46 uint32 GetFontWidth(void);
47 uint32 GetFontHeight(void);
48 void DrawStringTrans(SDL_Surface * screen, uint32 x, uint32 y, uint32 color, const char * text, ...);
49 void DrawStringOpaque(SDL_Surface * screen, uint32 x, uint32 y, uint32 fg, uint32 bg, const char * text, ...);
50
51 void DrawStringOpaqueSmall(SDL_Surface * screen, uint32 x, uint32 y, uint32 fg, uint32 bg, const char * text, ...);
52
53 // GUI bitmaps (exported)
54
55 extern uint8 closeBox[];
56 extern uint8 closeBoxDown[];
57 extern uint8 closeBoxHover[];
58 extern uint8 floppyDiskImg[];
59
60 #endif  // __GUIMISC_H__