typedef struct _Elm_Params_Genlist
{
- const char *horizontal_mode;
+ Elm_Params base;
+ const char *horizontal;
Eina_Bool multi:1;
Eina_Bool multi_exists:1;
Eina_Bool always_select:1;
Eina_Bool always_select_exists:1;
Eina_Bool no_select:1;
Eina_Bool no_select_exists:1;
- Eina_Bool compress:1;
Eina_Bool compress_exists:1;
Eina_Bool homogeneous:1;
Eina_Bool homogeneous_exists:1;
Eina_Bool v_bounce_exists:1;
} Elm_Params_Genlist;
-static const char* list_horizontal_mode_choices[] = {"compress", "scroll", "limit", 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 < ELM_LIST_LAST; 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;
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_mode_set(obj, set);
}
if (p->multi_exists)
elm_genlist_multi_select_set(obj, p->multi);
- if (p->always_select_exists)
- elm_genlist_always_select_mode_set(obj, p->always_select);
if (p->no_select_exists)
- elm_genlist_no_select_mode_set(obj, p->no_select);
- if (p->compress_exists)
- elm_genlist_compress_mode_set(obj, p->compress);
+ {
+ if (p->no_select)
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_NONE);
+ else
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
+ }
+ if (p->always_select_exists)
+ {
+ if (p->always_select)
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ else
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
+ }
if (p->homogeneous_exists)
elm_genlist_homogeneous_set(obj, p->homogeneous);
if ((p->h_bounce_exists) && (p->v_bounce_exists))
{
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_mode_set(obj, set);
return EINA_TRUE;
}
}
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
{
- elm_genlist_always_select_mode_set(obj, param->i);
+ if (param->i)
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_ALWAYS);
+ else
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
return EINA_TRUE;
}
}
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
{
- elm_genlist_no_select_mode_set(obj, param->i);
- return EINA_TRUE;
- }
- }
- else if (!strcmp(param->name, "compress"))
- {
- if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
- {
- elm_genlist_compress_mode_set(obj, param->i);
+ if (param->i)
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_NONE);
+ else
+ elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
return EINA_TRUE;
}
}
{
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_mode_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;
}
}
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
{
- param->i = elm_genlist_always_select_mode_get(obj);
+ if (elm_genlist_select_mode_get (obj) ==
+ ELM_OBJECT_SELECT_MODE_ALWAYS)
+ param->i = EINA_TRUE;
+ else
+ param->i = EINA_FALSE;
return EINA_TRUE;
}
}
{
if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
{
- param->i = elm_genlist_no_select_mode_get(obj);
- return EINA_TRUE;
- }
- }
- else if (!strcmp(param->name, "compress"))
- {
- if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
- {
- param->i = elm_genlist_compress_mode_get(obj);
+ if (elm_genlist_select_mode_get (obj) ==
+ ELM_OBJECT_SELECT_MODE_NONE)
+ param->i = EINA_TRUE;
+ else
+ param->i = EINA_FALSE;
return EINA_TRUE;
}
}
Edje_External_Param *param;
const Eina_List *l;
- mem = calloc(1, sizeof(Elm_Params_Genlist));
+ mem = ELM_NEW(Elm_Params_Genlist);
if (!mem)
return NULL;
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;
mem->no_select = !!param->i;
mem->no_select_exists = EINA_TRUE;
}
- else if (!strcmp(param->name, "compress"))
- {
- mem->compress = !!param->i;
- mem->compress_exists = EINA_TRUE;
- }
else if (!strcmp(param->name, "homogeneous"))
{
mem->homogeneous = !!param->i;
}
static Evas_Object *external_genlist_content_get(void *data __UNUSED__,
- const Evas_Object *obj, const char *content)
+ const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
{
- ERR("so content");
+ ERR("No content.");
return NULL;
}
{
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[] = {
- EDJE_EXTERNAL_PARAM_INFO_CHOICE_FULL("horizontal mode", "scroll", list_horizontal_mode_choices),
+ DEFINE_EXTERNAL_COMMON_PARAMS,
+ 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"),
- EDJE_EXTERNAL_PARAM_INFO_BOOL("compress"),
EDJE_EXTERNAL_PARAM_INFO_BOOL("homogeneous"),
EDJE_EXTERNAL_PARAM_INFO_BOOL("height bounce"),
EDJE_EXTERNAL_PARAM_INFO_BOOL("width bounce"),