| 1 | /* |
| 2 | |
| 3 | mui_u8g2.h |
| 4 | |
| 5 | Monochrome minimal user interface: Glue code between mui and u8g2. |
| 6 | |
| 7 | Universal 8bit Graphics Library (https://github.com/olikraus/u8g2/) |
| 8 | |
| 9 | Copyright (c) 2021, olikraus@gmail.com |
| 10 | All rights reserved. |
| 11 | |
| 12 | Redistribution and use in source and binary forms, with or without |
| 13 | modification, are permitted provided that the following conditions are met: |
| 14 | |
| 15 | * Redistributions of source code must retain the above copyright notice, this |
| 16 | list of conditions and the following disclaimer. |
| 17 | |
| 18 | * Redistributions in binary form must reproduce the above copyright notice, |
| 19 | this list of conditions and the following disclaimer in the documentation |
| 20 | and/or other materials provided with the distribution. |
| 21 | |
| 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND |
| 23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, |
| 24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR |
| 27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
| 32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 35 | |
| 36 | Reference Manual: |
| 37 | https://github.com/olikraus/u8g2/wiki/muiref |
| 38 | |
| 39 | MUIF_U8G2_LABEL() |
| 40 | replacement for MUIF_LABEL(mui_u8g2_draw_text), |
| 41 | used by MUI_LABEL(x,y,"text") |
| 42 | Supports UTF8 |
| 43 | |
| 44 | MUIF_U8G2_FONT_STYLE(n, font) |
| 45 | A special u8g2 style function, which replaces MUIF_STYLE, but restricts the |
| 46 | style change to the specific font argument (however, this should be good |
| 47 | enough in most cases). As usual, the style "n" can be activated with |
| 48 | MUI_STYLE(n) in FDS. Example: muif_t muif_list[] MUI_PROGMEM = { |
| 49 | MUIF_U8G2_LABEL(), |
| 50 | MUIF_U8G2_FONT_STYLE(0, u8g2_font_5x8_tr) |
| 51 | }; |
| 52 | fds_t fds[] MUI_PROGMEM = |
| 53 | MUI_FORM(1) |
| 54 | MUI_STYLE(0) |
| 55 | MUI_LABEL(5,12, "5x8 Font") |
| 56 | ; |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | */ |
| 63 | |
| 64 | #ifndef MUI_U8G2_H |
| 65 | #define MUI_U8G2_H |
| 66 | |
| 67 | #include "mui.h" |
| 68 | #include "u8g2.h" |
| 69 | |
| 70 | /*==========================================*/ |
| 71 | /* C++ compatible */ |
| 72 | |
| 73 | #ifdef __cplusplus |
| 74 | extern "C" { |
| 75 | #endif |
| 76 | |
| 77 | #define MUI_U8G2_COMMA , |
| 78 | |
| 79 | typedef const char *(*mui_u8g2_get_list_element_cb)(void *data, uint16_t index); |
| 80 | typedef uint16_t (*mui_u8g2_get_list_count_cb)(void *data); |
| 81 | |
| 82 | struct mui_u8g2_list_struct { |
| 83 | uint16_t *selection; |
| 84 | void *data; |
| 85 | mui_u8g2_get_list_element_cb get_list_element; |
| 86 | mui_u8g2_get_list_count_cb get_list_count; |
| 87 | } MUI_PROGMEM; |
| 88 | |
| 89 | typedef const struct mui_u8g2_list_struct mui_u8g2_list_t; |
| 90 | |
| 91 | #if defined(__GNUC__) && defined(__AVR__) |
| 92 | #define mui_u8g2_list_get_selection_ptr(list) \ |
| 93 | ((uint16_t *)mui_pgm_wread(&((list)->selection))) |
| 94 | #define mui_u8g2_list_get_data_ptr(list) \ |
| 95 | ((void *)mui_pgm_wread(&((list)->data))) |
| 96 | #define mui_u8g2_list_get_element_cb(list) \ |
| 97 | ((mui_u8g2_get_list_element_cb)mui_pgm_wread(&((list)->get_list_element))) |
| 98 | #define mui_u8g2_list_get_count_cb(list) \ |
| 99 | ((mui_u8g2_get_list_count_cb)mui_pgm_wread(&((list)->get_list_count))) |
| 100 | #else |
| 101 | #define mui_u8g2_list_get_selection_ptr(list) ((list)->selection) |
| 102 | #define mui_u8g2_list_get_data_ptr(list) ((list)->data) |
| 103 | #define mui_u8g2_list_get_element_cb(list) ((list)->get_list_element) |
| 104 | #define mui_u8g2_list_get_count_cb(list) ((list)->get_list_count) |
| 105 | #endif |
| 106 | |
| 107 | struct mui_u8g2_u8_min_max_struct { |
| 108 | uint8_t *value; |
| 109 | uint8_t min; |
| 110 | uint8_t max; |
| 111 | } MUI_PROGMEM; |
| 112 | |
| 113 | typedef const struct mui_u8g2_u8_min_max_struct mui_u8g2_u8_min_max_t; |
| 114 | |
| 115 | #if defined(__GNUC__) && defined(__AVR__) |
| 116 | #define mui_u8g2_u8mm_get_min(u8mm) mui_pgm_read(&((u8mm)->min)) |
| 117 | #define mui_u8g2_u8mm_get_max(u8mm) mui_pgm_read(&((u8mm)->max)) |
| 118 | #define mui_u8g2_u8mm_get_valptr(u8mm) \ |
| 119 | ((uint8_t *)mui_pgm_wread(&((u8mm)->value))) |
| 120 | #else |
| 121 | #define mui_u8g2_u8mm_get_min(u8mm) ((u8mm)->min) |
| 122 | #define mui_u8g2_u8mm_get_max(u8mm) ((u8mm)->max) |
| 123 | #define mui_u8g2_u8mm_get_valptr(u8mm) ((u8mm)->value) |
| 124 | #endif |
| 125 | |
| 126 | struct mui_u8g2_s8_min_max_struct { |
| 127 | int8_t *value; |
| 128 | int8_t min; |
| 129 | int8_t max; |
| 130 | } MUI_PROGMEM; |
| 131 | |
| 132 | typedef const struct mui_u8g2_s8_min_max_struct mui_u8g2_s8_min_max_t; |
| 133 | |
| 134 | #if defined(__GNUC__) && defined(__AVR__) |
| 135 | #define mui_u8g2_s8mm_get_min(u8mm) ((int8_t)mui_pgm_read(&((u8mm)->min))) |
| 136 | #define mui_u8g2_s8mm_get_max(u8mm) ((int8_t)mui_pgm_read(&((u8mm)->max))) |
| 137 | #define mui_u8g2_s8mm_get_valptr(u8mm) \ |
| 138 | ((int8_t *)mui_pgm_wread(&((u8mm)->value))) |
| 139 | #else |
| 140 | #define mui_u8g2_s8mm_get_min(u8mm) ((u8mm)->min) |
| 141 | #define mui_u8g2_s8mm_get_max(u8mm) ((u8mm)->max) |
| 142 | #define mui_u8g2_s8mm_get_valptr(u8mm) ((u8mm)->value) |
| 143 | #endif |
| 144 | |
| 145 | struct mui_u8g2_u8_min_max_step_struct { |
| 146 | uint8_t *value; |
| 147 | uint8_t min; |
| 148 | uint8_t max; |
| 149 | uint8_t step; |
| 150 | uint8_t flags; |
| 151 | uint8_t width; // added with issue 2200, might not be used by all bar graph |
| 152 | // functions |
| 153 | } MUI_PROGMEM; |
| 154 | |
| 155 | typedef const struct mui_u8g2_u8_min_max_step_struct mui_u8g2_u8_min_max_step_t; |
| 156 | |
| 157 | /* list of bit values for the "flags" variable */ |
| 158 | #define MUI_MMS_2X_BAR 0x01 |
| 159 | #define MUI_MMS_4X_BAR 0x02 |
| 160 | #define MUI_MMS_SHOW_VALUE 0x04 |
| 161 | #define MUI_MMS_NO_WRAP 0x08 |
| 162 | |
| 163 | #if defined(__GNUC__) && defined(__AVR__) |
| 164 | #define mui_u8g2_u8mms_get_width(u8mm) mui_pgm_read(&((u8mm)->width)) |
| 165 | #define mui_u8g2_u8mms_get_step(u8mm) mui_pgm_read(&((u8mm)->step)) |
| 166 | #define mui_u8g2_u8mms_get_flags(u8mm) mui_pgm_read(&((u8mm)->flags)) |
| 167 | #define mui_u8g2_u8mms_get_min(u8mm) mui_pgm_read(&((u8mm)->min)) |
| 168 | #define mui_u8g2_u8mms_get_max(u8mm) mui_pgm_read(&((u8mm)->max)) |
| 169 | #define mui_u8g2_u8mms_get_valptr(u8mm) \ |
| 170 | ((uint8_t *)mui_pgm_wread(&((u8mm)->value))) |
| 171 | #else |
| 172 | #define mui_u8g2_u8mms_get_width(u8mm) ((u8mm)->width) |
| 173 | #define mui_u8g2_u8mms_get_step(u8mm) ((u8mm)->step) |
| 174 | #define mui_u8g2_u8mms_get_flags(u8mm) ((u8mm)->flags) |
| 175 | #define mui_u8g2_u8mms_get_min(u8mm) ((u8mm)->min) |
| 176 | #define mui_u8g2_u8mms_get_max(u8mm) ((u8mm)->max) |
| 177 | #define mui_u8g2_u8mms_get_valptr(u8mm) ((u8mm)->value) |
| 178 | #endif |
| 179 | |
| 180 | /* helper functions */ |
| 181 | |
| 182 | u8g2_uint_t mui_get_x(mui_t *ui); |
| 183 | u8g2_uint_t mui_get_y(mui_t *ui); |
| 184 | u8g2_uint_t mui_get_arg(mui_t *ui); |
| 185 | char *mui_get_text(mui_t *ui); |
| 186 | u8g2_t *mui_get_U8g2(mui_t *ui); |
| 187 | |
| 188 | void mui_u8g2_draw_button_utf(mui_t *ui, u8g2_uint_t flags, u8g2_uint_t width, |
| 189 | u8g2_uint_t padding_h, u8g2_uint_t padding_v, |
| 190 | const char *text); |
| 191 | u8g2_uint_t mui_u8g2_get_pi_flags(mui_t *ui); |
| 192 | void mui_u8g2_draw_button_pi(mui_t *ui, u8g2_uint_t width, |
| 193 | u8g2_uint_t padding_h, const char *text); |
| 194 | u8g2_uint_t mui_u8g2_get_fi_flags(mui_t *ui); |
| 195 | void mui_u8g2_draw_button_fi(mui_t *ui, u8g2_uint_t width, |
| 196 | u8g2_uint_t padding_h, const char *text); |
| 197 | u8g2_uint_t mui_u8g2_get_pf_flags(mui_t *ui); |
| 198 | void mui_u8g2_draw_button_pf(mui_t *ui, u8g2_uint_t width, |
| 199 | u8g2_uint_t padding_h, const char *text); |
| 200 | u8g2_uint_t mui_u8g2_get_if_flags(mui_t *ui); |
| 201 | void mui_u8g2_draw_button_if(mui_t *ui, u8g2_uint_t width, |
| 202 | u8g2_uint_t padding_h, const char *text); |
| 203 | |
| 204 | /* ready to use field functions */ |
| 205 | |
| 206 | uint8_t mui_hline(mui_t *ui, uint8_t msg); |
| 207 | |
| 208 | uint8_t mui_u8g2_draw_text(mui_t *ui, uint8_t msg); |
| 209 | |
| 210 | uint8_t mui_u8g2_btn_goto_wm_fi(mui_t *ui, uint8_t msg); /* GIF */ |
| 211 | uint8_t mui_u8g2_btn_goto_wm_if(mui_t *ui, uint8_t msg); |
| 212 | uint8_t mui_u8g2_btn_goto_w2_fi(mui_t *ui, uint8_t msg); /* GIF */ |
| 213 | uint8_t mui_u8g2_btn_goto_w2_if(mui_t *ui, uint8_t msg); |
| 214 | uint8_t mui_u8g2_btn_goto_w1_pi(mui_t *ui, uint8_t msg); /* GIF */ |
| 215 | uint8_t mui_u8g2_btn_goto_w1_fi(mui_t *ui, uint8_t msg); /* GIF */ |
| 216 | |
| 217 | uint8_t mui_u8g2_btn_back_wm_fi(mui_t *ui, uint8_t msg); |
| 218 | uint8_t mui_u8g2_btn_back_wm_if(mui_t *ui, uint8_t msg); |
| 219 | uint8_t mui_u8g2_btn_back_w2_fi(mui_t *ui, uint8_t msg); |
| 220 | uint8_t mui_u8g2_btn_back_w2_if(mui_t *ui, uint8_t msg); |
| 221 | uint8_t mui_u8g2_btn_back_w1_pi(mui_t *ui, uint8_t msg); |
| 222 | uint8_t mui_u8g2_btn_back_w1_fi(mui_t *ui, uint8_t msg); |
| 223 | |
| 224 | uint8_t |
| 225 | mui_u8g2_btn_exit_wm_fi(mui_t *ui, |
| 226 | uint8_t msg); /* similar to 'mui_u8g2_btn_goto_wm_fi' |
| 227 | but will exit the menu system */ |
| 228 | |
| 229 | uint8_t mui_u8g2_u8_chkbox_wm_pi(mui_t *ui, |
| 230 | uint8_t msg); /* GIF, MUIF_VARIABLE, MUI_XY */ |
| 231 | uint8_t mui_u8g2_u8_radio_wm_pi(mui_t *ui, |
| 232 | uint8_t msg); /* GIF, MUIF_VARIABLE,MUI_XYAT */ |
| 233 | |
| 234 | uint8_t |
| 235 | mui_u8g2_u8_opt_line_wa_mse_pi(mui_t *ui, |
| 236 | uint8_t msg); /* GIF, MUIF_VARIABLE,MUI_XYAT */ |
| 237 | uint8_t |
| 238 | mui_u8g2_u8_opt_line_wa_mse_pf(mui_t *ui, |
| 239 | uint8_t msg); /* GIF, MUIF_VARIABLE,MUI_XYAT */ |
| 240 | uint8_t |
| 241 | mui_u8g2_u8_opt_line_wa_mud_pi(mui_t *ui, |
| 242 | uint8_t msg); /* GIF, MUIF_VARIABLE,MUI_XYAT */ |
| 243 | uint8_t |
| 244 | mui_u8g2_u8_opt_line_wa_mud_pf(mui_t *ui, |
| 245 | uint8_t msg); /* GIF, MUIF_VARIABLE,MUI_XYAT */ |
| 246 | |
| 247 | /* dropdown list / combo box */ |
| 248 | /* The text part of the parent defines a '|' separated list of elements, which |
| 249 | * can be selected by the child. */ |
| 250 | /* Argument is a form number where the child element is placed multiple times */ |
| 251 | /* The child form does not require the ok button, because the child function |
| 252 | * will return to the parent with the select element */ |
| 253 | uint8_t |
| 254 | mui_u8g2_u8_opt_parent_wm_pi(mui_t *ui, |
| 255 | uint8_t msg); /* GIF, MUIF_VARIABLE, MUI_XYAT */ |
| 256 | uint8_t mui_u8g2_u8_opt_radio_child_wm_pi( |
| 257 | mui_t *ui, uint8_t msg); /* GIF, MUIF_VARIABLE, MUI_XYA */ |
| 258 | uint8_t mui_u8g2_u8_opt_radio_child_w1_pi( |
| 259 | mui_t *ui, uint8_t msg); /* GIF, MUIF_VARIABLE, MUI_XYA */ |
| 260 | uint8_t mui_u8g2_u8_opt_child_wm_pi(mui_t *ui, |
| 261 | uint8_t msg); /* MUIF_VARIABLE, MUI_XYA */ |
| 262 | /* Note: there is no opt_child_goto muif, because this can be done with |
| 263 | * mui_u8g2_goto_form_w1_pi */ |
| 264 | |
| 265 | /* (scrollable) jump menu */ |
| 266 | /* The text part of the parent defines a '|' separated list of elements, which |
| 267 | * can be selected goto_form functions. */ |
| 268 | /* Each '|' separated element must be prefixed with the form number (MUI_x) */ |
| 269 | uint8_t mui_u8g2_goto_data(mui_t *ui, |
| 270 | uint8_t msg); /* REF, MUIF_RO, MUI_DATA (WARNING: |
| 271 | Must appear only once per form!!! */ |
| 272 | uint8_t mui_u8g2_goto_form_w1_pi(mui_t *ui, |
| 273 | uint8_t msg); /* REF, MUIF_BUTTON, MUI_XYA */ |
| 274 | uint8_t mui_u8g2_goto_form_w1_pf(mui_t *ui, |
| 275 | uint8_t msg); /* REF, MUIF_BUTTON, MUI_XYA */ |
| 276 | |
| 277 | /* character input */ |
| 278 | uint8_t mui_u8g2_u8_char_wm_mud_pi( |
| 279 | mui_t *ui, uint8_t msg); /* GIF, MUIF_VARIABLE,MUI_XY, usually requires a |
| 280 | monospaced font line profont12 */ |
| 281 | |
| 282 | /*===== MUIF U8g2 Label =====*/ |
| 283 | |
| 284 | #define MUIF_U8G2_LABEL() MUIF_LABEL(mui_u8g2_draw_text) |
| 285 | |
| 286 | /*===== data = u8g2 font data =====*/ |
| 287 | |
| 288 | // #define MUIF_U8G2_FONT_STYLE(n,font) MUIF("S" #n, 0, (void *)(font), |
| 289 | // mui_u8g2_set_font_style_function) |
| 290 | #define MUIF_U8G2_FONT_STYLE(n, font) \ |
| 291 | {'S', #n[0], 0, 0, (void *)(font), mui_u8g2_set_font_style_function} |
| 292 | |
| 293 | uint8_t mui_u8g2_set_font_style_function(mui_t *ui, uint8_t msg); |
| 294 | |
| 295 | /*===== data = mui_u8g2_u8_min_max_t* =====*/ |
| 296 | |
| 297 | /* gcc note: the macro uses array compound literals to extend the lifetime in |
| 298 | * C++, see last section in |
| 299 | * https://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html */ |
| 300 | #define MUIF_U8G2_U8_MIN_MAX(id, valptr, min, max, muif) \ |
| 301 | MUIF(id, MUIF_CFLAG_IS_CURSOR_SELECTABLE, \ |
| 302 | (void *)((mui_u8g2_u8_min_max_t[]){ \ |
| 303 | {(valptr)MUI_U8G2_COMMA(min) MUI_U8G2_COMMA(max)}}), \ |
| 304 | (muif)) |
| 305 | |
| 306 | uint8_t mui_u8g2_u8_min_max_wm_mse_pi( |
| 307 | mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U8_MIN_MAX, MUI_XY */ |
| 308 | uint8_t mui_u8g2_u8_min_max_wm_mud_pi( |
| 309 | mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U8_MIN_MAX, MUI_XY */ |
| 310 | uint8_t mui_u8g2_u8_min_max_wm_mse_pf( |
| 311 | mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U8_MIN_MAX, MUI_XY */ |
| 312 | uint8_t mui_u8g2_u8_min_max_wm_mud_pf( |
| 313 | mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U8_MIN_MAX, MUI_XY */ |
| 314 | |
| 315 | /* hex format */ |
| 316 | uint8_t mui_u8g2_x8_min_max_wm_mse_pi(mui_t *ui, uint8_t msg); |
| 317 | uint8_t mui_u8g2_x8_min_max_wm_mud_pi(mui_t *ui, uint8_t msg); |
| 318 | uint8_t mui_u8g2_x8_min_max_wm_mse_pf(mui_t *ui, uint8_t msg); |
| 319 | uint8_t mui_u8g2_x8_min_max_wm_mud_pf(mui_t *ui, uint8_t msg); |
| 320 | |
| 321 | #define MUIF_U8G2_S8_MIN_MAX(id, valptr, min, max, muif) \ |
| 322 | MUIF(id, MUIF_CFLAG_IS_CURSOR_SELECTABLE, \ |
| 323 | (void *)((mui_u8g2_s8_min_max_t[]){ \ |
| 324 | {(valptr)MUI_U8G2_COMMA(min) MUI_U8G2_COMMA(max)}}), \ |
| 325 | (muif)) |
| 326 | |
| 327 | uint8_t mui_u8g2_s8_min_max_wm_mse_pi(mui_t *ui, uint8_t msg); |
| 328 | uint8_t mui_u8g2_s8_min_max_wm_mud_pi(mui_t *ui, uint8_t msg); |
| 329 | uint8_t mui_u8g2_s8_min_max_wm_mse_pf(mui_t *ui, uint8_t msg); |
| 330 | uint8_t mui_u8g2_s8_min_max_wm_mud_pf(mui_t *ui, uint8_t msg); |
| 331 | |
| 332 | /*===== data = mui_u8g2_u8_min_max_step_t* =====*/ |
| 333 | |
| 334 | /* gcc note: the macro uses array compound literals to extend the lifetime in |
| 335 | * C++, see last section in |
| 336 | * https://gcc.gnu.org/onlinedocs/gcc/Compound-Literals.html */ |
| 337 | #define MUIF_U8G2_U8_MIN_MAX_STEP(id, valptr, min, max, step, flags, muif) \ |
| 338 | MUIF(id, MUIF_CFLAG_IS_CURSOR_SELECTABLE, \ |
| 339 | (void *)((mui_u8g2_u8_min_max_step_t[]){ \ |
| 340 | {(valptr)MUI_U8G2_COMMA(min) MUI_U8G2_COMMA(max) MUI_U8G2_COMMA( \ |
| 341 | step) MUI_U8G2_COMMA(flags) MUI_U8G2_COMMA(0)}}), \ |
| 342 | (muif)) |
| 343 | |
| 344 | uint8_t mui_u8g2_u8_bar_wm_mse_pi(mui_t *ui, uint8_t msg); |
| 345 | uint8_t mui_u8g2_u8_bar_wm_mud_pi(mui_t *ui, uint8_t msg); |
| 346 | uint8_t mui_u8g2_u8_bar_wm_mse_pf(mui_t *ui, uint8_t msg); |
| 347 | uint8_t mui_u8g2_u8_bar_wm_mud_pf(mui_t *ui, uint8_t msg); |
| 348 | |
| 349 | #define MUIF_U8G2_U8_MIN_MAX_STEP_WIDTH(id, valptr, min, max, step, width, \ |
| 350 | flags, muif) \ |
| 351 | MUIF(id, MUIF_CFLAG_IS_CURSOR_SELECTABLE, \ |
| 352 | (void *)((mui_u8g2_u8_min_max_step_t[]){ \ |
| 353 | {(valptr)MUI_U8G2_COMMA(min) MUI_U8G2_COMMA(max) MUI_U8G2_COMMA( \ |
| 354 | step) MUI_U8G2_COMMA(flags) MUI_U8G2_COMMA(width)}}), \ |
| 355 | (muif)) |
| 356 | |
| 357 | uint8_t mui_u8g2_u8_fixed_width_bar_wm_mse_pi(mui_t *ui, uint8_t msg); |
| 358 | uint8_t mui_u8g2_u8_fixed_width_bar_wm_mud_pi(mui_t *ui, uint8_t msg); |
| 359 | uint8_t mui_u8g2_u8_fixed_width_bar_wm_mse_pf(mui_t *ui, uint8_t msg); |
| 360 | uint8_t mui_u8g2_u8_fixed_width_bar_wm_mud_pf(mui_t *ui, uint8_t msg); |
| 361 | |
| 362 | /*===== data = mui_u8g2_list_t* =====*/ |
| 363 | /* similar to mui_u8g2_u8_opt_line, but u16 and dynamic list */ |
| 364 | |
| 365 | #define MUIF_U8G2_U16_LIST(id, valptr, dataptr, getcb, cntcb, muif) \ |
| 366 | MUIF(id, MUIF_CFLAG_IS_CURSOR_SELECTABLE, \ |
| 367 | (void *)((mui_u8g2_list_t[]){{(valptr)MUI_U8G2_COMMA( \ |
| 368 | dataptr) MUI_U8G2_COMMA(getcb) MUI_U8G2_COMMA(cntcb)}}), \ |
| 369 | (muif)) |
| 370 | |
| 371 | uint8_t mui_u8g2_u16_list_line_wa_mse_pi( |
| 372 | mui_t *ui, |
| 373 | uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=pixel fieldsize */ |
| 374 | uint8_t mui_u8g2_u16_list_line_wa_mud_pi( |
| 375 | mui_t *ui, |
| 376 | uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=pixel fieldsize */ |
| 377 | |
| 378 | /* dropdown list / combo box with 16 size and callback functions for |
| 379 | * MUIF_U8G2_U16_LIST */ |
| 380 | uint8_t mui_u8g2_u16_list_parent_wm_pi( |
| 381 | mui_t *ui, uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=subform */ |
| 382 | uint8_t mui_u8g2_u16_list_child_w1_pi( |
| 383 | mui_t *ui, |
| 384 | uint8_t msg); /* GIF, MUIF_U8G2_U16_LIST, MUI_XYA, arg=sub element number */ |
| 385 | uint8_t mui_u8g2_u16_list_goto_w1_pi( |
| 386 | mui_t *ui, uint8_t msg); /* REF, MUIF_U8G2_U16_LIST first char of the string |
| 387 | denotes the target form */ |
| 388 | |
| 389 | #ifdef __cplusplus |
| 390 | } |
| 391 | #endif |
| 392 | |
| 393 | #endif /* MUI_U8G2_H */ |