forked from enlightenment/efl
elm genlist: Added elm_genlist_horizontal_set/get() APIs. Deprecated
elm_genlist_horizontal_mode_set/get() for API name consistency. Use new APIs. SVN revision: 62117
This commit is contained in:
parent
688f367dcf
commit
1d6ee07488
|
@ -5,7 +5,7 @@
|
|||
typedef struct _Elm_Params_Genlist
|
||||
{
|
||||
Elm_Params base;
|
||||
const char *horizontal_mode;
|
||||
const char *horizontal;
|
||||
Eina_Bool multi:1;
|
||||
Eina_Bool multi_exists:1;
|
||||
Eina_Bool always_select:1;
|
||||
|
@ -22,18 +22,18 @@ typedef struct _Elm_Params_Genlist
|
|||
Eina_Bool v_bounce_exists:1;
|
||||
} Elm_Params_Genlist;
|
||||
|
||||
static const char* list_horizontal_mode_choices[] = {"compress", "scroll", "limit", "expand", NULL};
|
||||
static const char* list_horizontal_choices[] = {"compress", "scroll", "limit", "expand", NULL};
|
||||
|
||||
static Elm_List_Mode
|
||||
_list_horizontal_mode_setting_get(const char *horizontal_mode_str)
|
||||
_list_horizontal_setting_get(const char *horizontal_str)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
assert(sizeof(list_horizontal_mode_choices)/sizeof(list_horizontal_mode_choices[0]) == ELM_LIST_LAST + 1);
|
||||
assert(sizeof(list_horizontal_choices)/sizeof(list_horizontal_choices[0]) == ELM_LIST_LAST + 1);
|
||||
|
||||
for (i = 0; i < sizeof(list_horizontal_mode_choices); i++)
|
||||
for (i = 0; i < sizeof(list_horizontal_choices); i++)
|
||||
{
|
||||
if (!strcmp(horizontal_mode_str, list_horizontal_mode_choices[i]))
|
||||
if (!strcmp(horizontal_str, list_horizontal_choices[i]))
|
||||
return i;
|
||||
}
|
||||
return ELM_LIST_LAST;
|
||||
|
@ -48,12 +48,12 @@ external_genlist_state_set(void *data __UNUSED__, Evas_Object *obj, const void *
|
|||
else if (from_params) p = from_params;
|
||||
else return;
|
||||
|
||||
if (p->horizontal_mode)
|
||||
if (p->horizontal)
|
||||
{
|
||||
Elm_List_Mode set = _list_horizontal_mode_setting_get(p->horizontal_mode);
|
||||
Elm_List_Mode set = _list_horizontal_setting_get(p->horizontal);
|
||||
|
||||
if (set != ELM_LIST_LAST)
|
||||
elm_genlist_horizontal_mode_set(obj, set);
|
||||
elm_genlist_horizontal_set(obj, set);
|
||||
}
|
||||
if (p->multi_exists)
|
||||
elm_genlist_multi_select_set(obj, p->multi);
|
||||
|
@ -86,10 +86,10 @@ external_genlist_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)
|
||||
{
|
||||
Elm_List_Mode set = _list_horizontal_mode_setting_get(param->s);
|
||||
Elm_List_Mode set = _list_horizontal_setting_get(param->s);
|
||||
|
||||
if (set == ELM_LIST_LAST) return EINA_FALSE;
|
||||
elm_genlist_horizontal_mode_set(obj, set);
|
||||
elm_genlist_horizontal_set(obj, set);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -167,12 +167,12 @@ external_genlist_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_E
|
|||
{
|
||||
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)
|
||||
{
|
||||
Elm_List_Mode list_horizontal_mode_set = elm_genlist_horizontal_mode_get(obj);
|
||||
Elm_List_Mode list_horizontal_set = elm_genlist_horizontal_get(obj);
|
||||
|
||||
if (list_horizontal_mode_set == ELM_LIST_LAST)
|
||||
if (list_horizontal_set == ELM_LIST_LAST)
|
||||
return EINA_FALSE;
|
||||
|
||||
param->s = list_horizontal_mode_choices[list_horizontal_mode_set];
|
||||
param->s = list_horizontal_choices[list_horizontal_set];
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ external_genlist_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__
|
|||
EINA_LIST_FOREACH(params, l, param)
|
||||
{
|
||||
if (!strcmp(param->name, "horizontal mode"))
|
||||
mem->horizontal_mode = eina_stringshare_add(param->s);
|
||||
mem->horizontal = eina_stringshare_add(param->s);
|
||||
else if (!strcmp(param->name, "multi select"))
|
||||
{
|
||||
mem->multi = !!param->i;
|
||||
|
@ -310,15 +310,15 @@ external_genlist_params_free(void *params)
|
|||
{
|
||||
Elm_Params_Genlist *mem = params;
|
||||
|
||||
if (mem->horizontal_mode)
|
||||
eina_stringshare_del(mem->horizontal_mode);
|
||||
if (mem->horizontal)
|
||||
eina_stringshare_del(mem->horizontal);
|
||||
|
||||
free(mem);
|
||||
}
|
||||
|
||||
static Edje_External_Param_Info external_genlist_params[] = {
|
||||
DEFINE_EXTERNAL_COMMON_PARAMS,
|
||||
EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL("horizontal mode", "scroll", list_horizontal_mode_choices),
|
||||
EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL("horizontal mode", "scroll", list_horizontal_choices),
|
||||
EDJE_EXTERNAL_PARAM_INFO_BOOL("multi select"),
|
||||
EDJE_EXTERNAL_PARAM_INFO_BOOL("always select"),
|
||||
EDJE_EXTERNAL_PARAM_INFO_BOOL("no select"),
|
||||
|
|
|
@ -14293,7 +14293,7 @@ extern "C" {
|
|||
* elm_genlist_item_disabled_get() to get the disabled state.
|
||||
*
|
||||
* In general to indicate how the genlist should expand items horizontally to
|
||||
* fill the list area, use elm_genlist_horizontal_mode_set(). Valid modes are
|
||||
* fill the list area, use elm_genlist_horizontal_set(). Valid modes are
|
||||
* ELM_LIST_LIMIT and ELM_LIST_SCROLL . The default is ELM_LIST_SCROLL. This
|
||||
* mode means that if items are too wide to fit, the scroller will scroll
|
||||
* horizontally. Otherwise items are expanded to fill the width of the
|
||||
|
@ -14552,11 +14552,12 @@ extern "C" {
|
|||
* ELM_LIST_LIMIT, items will be expanded to the viewport width and
|
||||
* limited to that size.
|
||||
*
|
||||
* @see elm_genlist_horizontal_mode_get()
|
||||
* @see elm_genlist_horizontal_get()
|
||||
*
|
||||
* @ingroup Genlist
|
||||
*/
|
||||
EAPI void elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_genlist_horizontal_set(Evas_Object *obj, Elm_List_Mode mode) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void elm_genlist_horizontal_mode_set(Evas_Object *obj, Elm_List_Mode mode) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* Gets the horizontal stretching mode.
|
||||
*
|
||||
|
@ -14564,11 +14565,12 @@ extern "C" {
|
|||
* @return The mode to use
|
||||
* (#ELM_LIST_LIMIT, #ELM_LIST_SCROLL)
|
||||
*
|
||||
* @see elm_genlist_horizontal_mode_set()
|
||||
* @see elm_genlist_horizontal_set()
|
||||
*
|
||||
* @ingroup Genlist
|
||||
*/
|
||||
EAPI Elm_List_Mode elm_genlist_horizontal_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI Elm_List_Mode elm_genlist_horizontal_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Elm_List_Mode elm_genlist_horizontal_mode_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* Set the always select mode.
|
||||
*
|
||||
|
@ -14636,7 +14638,7 @@ extern "C" {
|
|||
* This will enable the compress mode where items are "compressed"
|
||||
* horizontally to fit the genlist scrollable viewport width. This is
|
||||
* special for genlist. Do not rely on
|
||||
* elm_genlist_horizontal_mode_set() being set to @c ELM_LIST_COMPRESS to
|
||||
* elm_genlist_horizontal_set() being set to @c ELM_LIST_COMPRESS to
|
||||
* work as genlist needs to handle it specially.
|
||||
*
|
||||
* @see elm_genlist_compress_mode_get()
|
||||
|
|
|
@ -4494,7 +4494,7 @@ elm_genlist_item_cursor_engine_only_get(const Elm_Genlist_Item *item)
|
|||
}
|
||||
|
||||
EAPI void
|
||||
elm_genlist_horizontal_mode_set(Evas_Object *obj,
|
||||
elm_genlist_horizontal_set(Evas_Object *obj,
|
||||
Elm_List_Mode mode)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
|
@ -4505,8 +4505,15 @@ elm_genlist_horizontal_mode_set(Evas_Object *obj,
|
|||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_genlist_horizontal_mode_set(Evas_Object *obj,
|
||||
Elm_List_Mode mode)
|
||||
{
|
||||
elm_genlist_horizontal_set(obj, mode);
|
||||
}
|
||||
|
||||
EAPI Elm_List_Mode
|
||||
elm_genlist_horizontal_mode_get(const Evas_Object *obj)
|
||||
elm_genlist_horizontal_get(const Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) ELM_LIST_LAST;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
|
@ -4514,6 +4521,12 @@ elm_genlist_horizontal_mode_get(const Evas_Object *obj)
|
|||
return wd->mode;
|
||||
}
|
||||
|
||||
EAPI Elm_List_Mode
|
||||
elm_genlist_horizontal_mode_get(const Evas_Object *obj)
|
||||
{
|
||||
return elm_genlist_horizontal_get(obj);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_genlist_always_select_mode_set(Evas_Object *obj,
|
||||
Eina_Bool always_select)
|
||||
|
|
Loading…
Reference in New Issue