ifndef CHOICEBOX_H define CHOICEBOX_H include stdbool include Evas typ

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef CHOICEBOX_H
#define CHOICEBOX_H
#include <stdbool.h>
#include <Evas.h>
typedef void (*choicebox_handler_t)(Evas_Object* choicebox,
int item_num,
bool is_alt,
void* param);
typedef void (*choicebox_draw_handler_t)(Evas_Object* choicebox,
Evas_Object* item,
int item_num,
int page_position,
void* param);
typedef void (*choicebox_footer_draw_handler_t)(Evas_Object* choicebox,
Evas_Object* footer,
int cur_page,
int total_pages,
void* param);
/*
* Choicebox uses two groups in theme file, called $group_prefix/item and
* $group_prefix/footer.
*
* Both groups should have data item called 'min_height'. As soon as edje can
* read the min size from the group, this requirement will be lifted.
*
* Items will be sent the following signals:
* - select, for setting selected state
* - deselect, for unsetting selected state
* - set_even, for setting "even" variant of state, if necessary
* - set_odd, for setting "odd" variant of state, if necessary
* - empty, for setting "empty" variant of state, for items beyond the end of list
*
* Choicebox does not manipulate content of the items, providing callbacks for
* this.
*/
Evas_Object* choicebox_new(Evas* evas,
const char* theme_file, /* It sucks, do you know better way? */
const char* group_prefix,
choicebox_handler_t handler,
choicebox_draw_handler_t draw_handler,
choicebox_footer_draw_handler_t footer_draw_handler,
void* param);
void choicebox_set_size(Evas_Object* e, int size);
void choicebox_invalidate_item(Evas_Object* e, int item_num);
/* This is mostly for keyboard handling */
void choicebox_up(Evas_Object* e);
void choicebox_down(Evas_Object* e);
void choicebox_pgup(Evas_Object* e);
void choicebox_pgdown(Evas_Object* e);
void choicebox_activate_nth_visible(Evas_Object* e, int nth, bool is_alt);
void choicebox_activate_current(Evas_Object* e, bool is_alt);
#endif