From 1d986e13df0468d4d90cdc0d3fd770b2dcf083d1 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 3 Apr 2019 15:47:36 +0200 Subject: [PATCH] lv_btnm, lv_kb: replace 'const char ** x' with const char * x[] --- src/lv_objx/lv_btnm.c | 2 +- src/lv_objx/lv_btnm.h | 2 +- src/lv_objx/lv_kb.h | 15 ++++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/lv_objx/lv_btnm.c b/src/lv_objx/lv_btnm.c index 82796811b..b39f741ba 100644 --- a/src/lv_objx/lv_btnm.c +++ b/src/lv_objx/lv_btnm.c @@ -141,7 +141,7 @@ lv_obj_t * lv_btnm_create(lv_obj_t * par, const lv_obj_t * copy) * @param btnm pointer to a button matrix object * @param map pointer a string array. The last string has to be: "". Use "\n" to make a line break. */ -void lv_btnm_set_map(const lv_obj_t * btnm, const char ** map) +void lv_btnm_set_map(const lv_obj_t * btnm, const char * map[]) { if(map == NULL) return; diff --git a/src/lv_objx/lv_btnm.h b/src/lv_objx/lv_btnm.h index edadc03c7..a49a7f240 100644 --- a/src/lv_objx/lv_btnm.h +++ b/src/lv_objx/lv_btnm.h @@ -96,7 +96,7 @@ lv_obj_t * lv_btnm_create(lv_obj_t * par, const lv_obj_t * copy); * @param btnm pointer to a button matrix object * @param map pointer a string array. The last string has to be: "". Use "\n" to make a line break. */ -void lv_btnm_set_map(const lv_obj_t * btnm, const char ** map); +void lv_btnm_set_map(const lv_obj_t * btnm, const char * map[]); /** * Set the button control map (hidden, disabled etc.) for a button matrix. The diff --git a/src/lv_objx/lv_kb.h b/src/lv_objx/lv_kb.h index 63e497149..1d4c93f79 100644 --- a/src/lv_objx/lv_kb.h +++ b/src/lv_objx/lv_kb.h @@ -110,11 +110,24 @@ void lv_kb_set_cursor_manage(lv_obj_t * kb, bool en); * @param map pointer to a string array to describe the map. * See 'lv_btnm_set_map()' for more info. */ -static inline void lv_kb_set_map(lv_obj_t *kb, const char ** map) +static inline void lv_kb_set_map(lv_obj_t *kb, const char * map[]) { lv_btnm_set_map(kb, map); } +/** + * Set the button control map (hidden, disabled etc.) for the keyboard. The + * control map array will be copied and so may be deallocated after this + * function returns. + * @param kb pointer to a keyboard object + * @param ctrl_map pointer to an array of `lv_btn_ctrl_t` control bytes. + * See: `lv_btnm_set_ctrl_map` for more details. + */ +static inline void lv_kb_set_ctrl_map(lv_obj_t *kb, const lv_btnm_ctrl_t * ctrl_map) +{ + lv_btnm_set_ctrl_map(kb, ctrl_map); +} + /** * Set a style of a keyboard * @param kb pointer to a keyboard object