5 typedef struct _Elm_Params_Scroller Elm_Params_Scroller;
7 struct _Elm_Params_Scroller {
14 static void external_scroller_state_set(void *data __UNUSED__,
15 Evas_Object *obj, const void *from_params,
16 const void *to_params, float pos __UNUSED__)
18 const Elm_Params_Scroller *p;
20 if (to_params) p = to_params;
21 else if (from_params) p = from_params;
25 elm_scroller_content_set(obj, p->content);
29 static Eina_Bool external_scroller_param_set(void *data __UNUSED__,
30 Evas_Object *obj, const Edje_External_Param *param)
32 if (!strcmp(param->name, "content")
33 && param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
35 Evas_Object *content = external_common_param_edje_object_get(obj, param);
36 if ((strcmp(param->s, "")) && (!content))
38 elm_scroller_content_set(obj, content);
42 ERR("unknown parameter '%s' of type '%s'",
43 param->name, edje_external_param_type_str(param->type));
48 static Eina_Bool external_scroller_param_get(void *data __UNUSED__,
49 const Evas_Object *obj __UNUSED__, Edje_External_Param *param)
51 if (!strcmp(param->name, "content"))
53 /* not easy to get content name back from live object */
57 ERR("unknown parameter '%s' of type '%s'",
58 param->name, edje_external_param_type_str(param->type));
63 static void * external_scroller_params_parse(void *data __UNUSED__, Evas_Object *obj,
64 const Eina_List *params) {
65 Elm_Params_Scroller *mem;
66 Edje_External_Param *param;
69 mem = ELM_NEW(Elm_Params_Scroller);
73 EINA_LIST_FOREACH(params, l, param)
75 if (!strcmp(param->name, "content"))
76 mem->content = external_common_param_edje_object_get(obj, param);
82 static Evas_Object *external_scroller_content_get(void *data __UNUSED__,
83 const Evas_Object *obj, const char *content)
85 if (!strcmp(content, "content"))
86 return elm_scroller_content_get(obj);
88 ERR("unknown content '%s'", content);
92 static void external_scroller_params_free(void *params) {
93 external_common_params_free(params);
96 static Edje_External_Param_Info external_scroller_params[] = {
97 DEFINE_EXTERNAL_COMMON_PARAMS,
98 EDJE_EXTERNAL_PARAM_INFO_STRING("content"),
99 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
102 DEFINE_EXTERNAL_ICON_ADD(scroller, "scroller");
103 DEFINE_EXTERNAL_TYPE_SIMPLE(scroller, "Scroller")