Refactor keygroup into library/
[lsnes.git] / include / platform / sdl / paint.hpp
blobd557da0959f95f88b9f08e33df2b52aca6c1c85b
1 #ifndef _plat_sdl__paint__hpp__included__
2 #define _plat_sdl__paint__hpp__included__
4 #include <cstdint>
5 #include <string>
7 #include <SDL.h>
9 struct sdlw_display_parameters
11 //Fill this structure.
12 sdlw_display_parameters();
13 sdlw_display_parameters(uint32_t rscrw, uint32_t rscrh, bool cactive);
14 //Real width of screen buffer.
15 uint32_t real_screen_w;
16 //Real height of screen buffer.
17 uint32_t real_screen_h;
18 //Fullscreen console active flag.
19 bool fullscreen_console;
20 //Virtual width of screen area.
21 uint32_t virtual_screen_w;
22 //Virtual height of screen area.
23 uint32_t virtual_screen_h;
24 //Display width.
25 uint32_t display_w;
26 //Display height.
27 uint32_t display_h;
28 //Screen area left edge x.
29 uint32_t screenarea_x;
30 //Screen area top edge y.
31 uint32_t screenarea_y;
32 //Screen area width.
33 uint32_t screenarea_w;
34 //Screen area height.
35 uint32_t screenarea_h;
36 //Status area left edge x.
37 uint32_t statusarea_x;
38 //Status area top edge y.
39 uint32_t statusarea_y;
40 //Status area width.
41 uint32_t statusarea_w;
42 //Status area height.
43 uint32_t statusarea_h;
44 //Status area lines.
45 uint32_t statusarea_lines;
46 //Message area left edge x.
47 uint32_t messagearea_x;
48 //Message area top edge y.
49 uint32_t messagearea_y;
50 //Message area width.
51 uint32_t messagearea_w;
52 //Message area height.
53 uint32_t messagearea_h;
54 //Message area lines.
55 uint32_t messagearea_lines;
56 //Message area trailing blank top edge y.
57 uint32_t messagearea_trailing_y;
58 //Message area trailing blank height.
59 uint32_t messagearea_trailing_h;
60 //Command line left edge x.
61 uint32_t cmdline_x;
62 //Command line top edge y.
63 uint32_t cmdline_y;
64 //Command line width
65 uint32_t cmdline_w;
68 struct command_status
70 bool active;
71 bool overwrite;
72 uint32_t rawpos;
73 std::string encoded;
76 //Query status of command line.
77 struct command_status get_current_command();
79 //Draw outline box. The surface must be locked.
80 void draw_box(SDL_Surface* surf, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint32_t color);
81 //Draw main screen. The surface must be locked.
82 bool paint_screen(SDL_Surface* surf, const sdlw_display_parameters& p, bool full);
83 //Draw status area. The surface must be locked.
84 bool paint_status(SDL_Surface* surf, const sdlw_display_parameters& p, bool full);
85 //Draw messages. The surface must be locked.
86 bool paint_messages(SDL_Surface* surf, const sdlw_display_parameters& p, bool full);
87 //Draw command. The surface must be locked.
88 bool paint_command(SDL_Surface* surf, const sdlw_display_parameters& p, bool full);
89 //Draw a modal dialog. The surface must be locked.
90 void paint_modal_dialog(SDL_Surface* surf, const std::string& text, bool confirm);
92 void sdlw_paint_modal_dialog(const std::string& text, bool confirm);
93 void sdlw_clear_modal_dialog();
94 void sdlw_screen_paintable();
95 void sdlw_command_updated();
96 void sdlw_fullscreen_console(bool enable);
97 void sdlw_force_paint();
98 std::string sdlw_decode_string(std::string e);
100 #endif