| 504 |
theseven |
1 |
//
|
|
|
2 |
//
|
|
|
3 |
// Copyright 2011 TheSeven
|
|
|
4 |
//
|
|
|
5 |
//
|
|
|
6 |
// This file is part of emCORE.
|
|
|
7 |
//
|
|
|
8 |
// emCORE is free software: you can redistribute it and/or
|
|
|
9 |
// modify it under the terms of the GNU General Public License as
|
|
|
10 |
// published by the Free Software Foundation, either version 2 of the
|
|
|
11 |
// License, or (at your option) any later version.
|
|
|
12 |
//
|
|
|
13 |
// emCORE is distributed in the hope that it will be useful,
|
|
|
14 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
15 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
16 |
// See the GNU General Public License for more details.
|
|
|
17 |
//
|
|
|
18 |
// You should have received a copy of the GNU General Public License along
|
|
|
19 |
// with emCORE. If not, see <http://www.gnu.org/licenses/>.
|
|
|
20 |
//
|
|
|
21 |
//
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
#ifndef __CHOOSER_RENDERER_LIST_H__
|
|
|
25 |
#define __CHOOSER_RENDERER_LIST_H__
|
|
|
26 |
|
|
|
27 |
#include "emcorelib.h"
|
|
|
28 |
#include "libui.h"
|
|
|
29 |
#include "chooser.h"
|
|
|
30 |
|
|
|
31 |
|
| 820 |
theseven |
32 |
#define CHOOSER_RENDERER_LIST_PARAMS_VERSION 2
|
| 504 |
theseven |
33 |
|
|
|
34 |
struct chooser_renderer_list_params
|
|
|
35 |
{
|
|
|
36 |
int version;
|
|
|
37 |
struct libui_location copy_dest;
|
|
|
38 |
struct libui_surface copy_src;
|
|
|
39 |
struct libui_location bg_dest;
|
|
|
40 |
struct libui_surface bg_src;
|
|
|
41 |
int bg_opacity;
|
|
|
42 |
struct libui_surface fill_dest;
|
|
|
43 |
uint32_t fill_color;
|
|
|
44 |
struct libui_surface viewport;
|
|
|
45 |
struct libui_point blit_dest;
|
|
|
46 |
struct libui_surface blit_src;
|
|
|
47 |
bool (*preblit)(struct chooser_data* data);
|
|
|
48 |
void (*postblit)(struct chooser_data* data);
|
|
|
49 |
};
|
|
|
50 |
|
|
|
51 |
struct chooser_renderer_list_itemdata
|
|
|
52 |
{
|
|
|
53 |
struct libui_point size;
|
|
|
54 |
struct libui_box fill_box;
|
|
|
55 |
uint32_t fill_color;
|
|
|
56 |
uint32_t fill_color_selected;
|
|
|
57 |
struct libui_point icon_pos;
|
|
|
58 |
struct libui_surface icon;
|
|
|
59 |
int icon_opacity;
|
|
|
60 |
struct libui_surface icon_selected;
|
|
|
61 |
int icon_selected_opacity;
|
| 820 |
theseven |
62 |
const char* text;
|
| 504 |
theseven |
63 |
struct libui_point text_pos;
|
|
|
64 |
uint32_t text_color;
|
|
|
65 |
uint32_t text_color_selected;
|
| 820 |
theseven |
66 |
void (*render)(struct chooser_data* data, const struct chooser_item* item,
|
|
|
67 |
bool selected, int x, int y);
|
| 504 |
theseven |
68 |
};
|
|
|
69 |
|
|
|
70 |
struct chooser_renderer_list_data
|
|
|
71 |
{
|
|
|
72 |
const struct chooser_item* top_item;
|
|
|
73 |
const struct chooser_item* bottom_item;
|
|
|
74 |
};
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
extern const struct chooser_renderer chooser_renderer_list;
|
|
|
78 |
|
| 820 |
theseven |
79 |
extern void chooser_renderer_list_render_attached_text(struct chooser_data* data,
|
|
|
80 |
const struct chooser_item* item,
|
|
|
81 |
bool selected, int x, int y,
|
|
|
82 |
const char* text);
|
|
|
83 |
extern void chooser_renderer_list_show_arrow_right(struct chooser_data* data,
|
|
|
84 |
const struct chooser_item* item,
|
|
|
85 |
bool selected, int x, int y);
|
|
|
86 |
extern void chooser_renderer_list_show_arrow_left(struct chooser_data* data,
|
|
|
87 |
const struct chooser_item* item,
|
|
|
88 |
bool selected, int x, int y);
|
| 504 |
theseven |
89 |
|
| 820 |
theseven |
90 |
|
| 504 |
theseven |
91 |
#endif
|