mmenu; in list view, properly handle icon on demand loading
[pandora-libraries.git] / minimenu / mmui_context.h
1 #ifndef h_mmui_context_h
2 #define h_mmui_context_h
3
4 /* this header is just an extension to mmui.h really, but rather than clutter that one up thought I'd best
5  * split it off.
6  */
7
8 /* most of this context never changed (or shouldn't change anyway) over the lifetime of the session.
9  * Some few values may change however, as noted below, if the detail pane is toggled. (Or possible
10  * other theme changes if we add any over time. The rapidity of development is starting to show :)
11  */
12 typedef struct {
13
14   // context that generally doesn't change over a session
15   //
16   unsigned int screen_width;
17
18   unsigned int font_rgba_r;
19   unsigned int font_rgba_g;
20   unsigned int font_rgba_b;
21   unsigned int font_rgba_a;
22
23   unsigned int grid_offset_x;
24   unsigned int grid_offset_y;
25
26   unsigned int icon_offset_x;
27   unsigned int icon_offset_y;
28   unsigned int icon_max_width;
29   unsigned int icon_max_height;
30   unsigned int sel_icon_offset_x;
31   unsigned int sel_icon_offset_y;
32
33   unsigned int text_width;
34   unsigned int text_height; // grid text's height of an 'M'
35   unsigned int text_clip_x;
36   unsigned int text_offset_x;
37   unsigned int text_offset_y;
38   unsigned int text_hilite_offset_y;
39
40   unsigned int arrow_bar_x;
41   unsigned int arrow_bar_y;
42   unsigned int arrow_bar_clip_w;
43   unsigned int arrow_bar_clip_h;
44   unsigned int arrow_up_x;
45   unsigned int arrow_up_y;
46   unsigned int arrow_down_x;
47   unsigned int arrow_down_y;
48
49   // calculated
50   SDL_Color fontcolor; // calculated; used for default font colour by various widgets
51
52   // context that may well change over the session
53   //
54   unsigned char row_max;
55   unsigned char col_max;
56
57   unsigned int cell_width;
58   unsigned int cell_height;
59
60 } ui_context_t;
61
62 void ui_recache_context ( ui_context_t *c );
63
64 #endif