diff options
Diffstat (limited to 'apps/gui/option_select.h')
-rw-r--r-- | apps/gui/option_select.h | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/apps/gui/option_select.h b/apps/gui/option_select.h index 6adbe1e720..e2ae31a848 100644 --- a/apps/gui/option_select.h +++ b/apps/gui/option_select.h | |||
@@ -21,44 +21,16 @@ | |||
21 | #define _GUI_OPTION_SELECT_H_ | 21 | #define _GUI_OPTION_SELECT_H_ |
22 | #include "settings.h" | 22 | #include "settings.h" |
23 | 23 | ||
24 | typedef void option_formatter(char* dest, int dest_length, | ||
25 | int variable, const char* unit); | ||
26 | |||
27 | struct option_select | 24 | struct option_select |
28 | { | 25 | { |
29 | const char * title; | 26 | const char * title; |
30 | int min_value; | 27 | int min_value; |
31 | int max_value; | 28 | int max_value; |
32 | int step; | ||
33 | int option; | 29 | int option; |
34 | const char * extra_string; | ||
35 | /* In the case the option is a number */ | ||
36 | option_formatter *formatter; | ||
37 | const struct opt_items * items; | 30 | const struct opt_items * items; |
38 | bool limit_loop; | ||
39 | }; | 31 | }; |
40 | 32 | ||
41 | /* | 33 | /* |
42 | * Initializes an option containing a numeric values | ||
43 | * - title : the title of the option | ||
44 | * - init_value : the initial value the number will be | ||
45 | * - min_value, max_value : bounds to the value | ||
46 | * - step : the ammount you want to add / withdraw to the initial number | ||
47 | * each time a key is pressed | ||
48 | * - unit : the unit in which the value is (ex "s", "bytes", ...) | ||
49 | * - formatter : a callback function that generates a string | ||
50 | * from the number it gets | ||
51 | */ | ||
52 | extern void option_select_init_numeric(struct option_select * opt, | ||
53 | const char * title, | ||
54 | int init_value, | ||
55 | int min_value, | ||
56 | int max_value, | ||
57 | int step, | ||
58 | const char * unit, | ||
59 | option_formatter *formatter); | ||
60 | |||
61 | /* | ||
62 | * Initializes an option containing a list of choices | 34 | * Initializes an option containing a list of choices |
63 | * - title : the title of the option | 35 | * - title : the title of the option |
64 | * - selected : the initially selected item | 36 | * - selected : the initially selected item |
@@ -74,12 +46,9 @@ extern void option_select_init_items(struct option_select * opt, | |||
74 | /* | 46 | /* |
75 | * Gets the selected option | 47 | * Gets the selected option |
76 | * - opt : the option struct | 48 | * - opt : the option struct |
77 | * - buffer : a buffer to eventually format the option | ||
78 | * Returns the selected option | 49 | * Returns the selected option |
79 | */ | 50 | */ |
80 | extern const char * option_select_get_text(struct option_select * opt, | 51 | extern const char * option_select_get_text(struct option_select * opt); |
81 | char * buffer, | ||
82 | int buffersize); | ||
83 | 52 | ||
84 | /* | 53 | /* |
85 | * Selects the next value | 54 | * Selects the next value |