5 typedef struct _Elm_Params_Icon
7 Eina_Bool page_count_exists;
8 unsigned int page_count;
9 Eina_Bool page_id_exists;
13 static unsigned int page_count_bk;
16 external_page_control_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
18 const Elm_Params_Icon *p;
20 if (to_params) p = to_params;
21 else if (from_params) p = from_params;
24 if (p->page_count_exists)
26 elm_page_control_page_count_set(obj, p->page_count);
27 page_count_bk = p->page_count;
29 if (p->page_id_exists)
30 elm_page_control_page_id_set(obj, p->page_id-1);
34 external_page_control_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
36 if (!strcmp(param->name, "page count")
37 && param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
39 elm_page_control_page_count_set(obj, param->i);
40 page_count_bk = param->i;
43 else if (!strcmp(param->name, "page id")
44 && param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
46 elm_page_control_page_id_set(obj, param->i-1);
50 ERR("unknown parameter '%s' of type '%s'",
51 param->name, edje_external_param_type_str(param->type));
57 external_page_control_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
59 if (!strcmp(param->name, "page count")
60 && param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
62 param->i = page_count_bk;
65 else if (!strcmp(param->name, "page id")
66 && param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
68 param->i = elm_page_control_page_id_get((Evas_Object *)obj);
72 ERR("unknown parameter '%s' of type '%s'",
73 param->name, edje_external_param_type_str(param->type));
79 external_page_control_params_parse(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const Eina_List *params)
82 Edje_External_Param *param;
85 mem = calloc(1, sizeof(Elm_Params_Icon));
89 EINA_LIST_FOREACH(params, l, param)
91 if (!strcmp(param->name, "page count"))
93 mem->page_count = param->i;
94 mem->page_count_exists = EINA_TRUE;
96 else if (!strcmp(param->name, "page id"))
98 mem->page_id = param->i;
99 mem->page_id_exists = EINA_TRUE;
106 static Evas_Object *external_page_control_content_get(void *data __UNUSED__,
107 const Evas_Object *obj __UNUSED__,
108 const char *content __UNUSED__)
115 external_page_control_params_free(void *params)
117 Elm_Params_Icon *mem = params;
122 static Edje_External_Param_Info external_page_control_params[] = {
123 EDJE_EXTERNAL_PARAM_INFO_INT("page count"),
124 EDJE_EXTERNAL_PARAM_INFO_INT("page id"),
125 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
128 DEFINE_EXTERNAL_ICON_ADD(page_control, "page_control");
129 DEFINE_EXTERNAL_TYPE_SIMPLE(page_control, "Page_control");