3 typedef struct _Elm_Params_Frame
7 Evas_Object *content; /* part name whose obj is to be set as content */
11 external_frame_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
13 const Elm_Params_Frame *p;
15 if (to_params) p = to_params;
16 else if (from_params) p = from_params;
19 if (p->label) elm_object_text_set(obj, p->label);
20 if (p->content) elm_object_content_set(obj, p->content);
24 external_frame_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
26 if (!strcmp(param->name, "label"))
28 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
30 elm_object_text_set(obj, param->s);
34 else if (!strcmp(param->name, "content"))
36 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
38 Evas_Object *content =
39 external_common_param_edje_object_get(obj,param);
40 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
41 elm_object_content_set(obj, content);
46 ERR("unknown parameter '%s' of type '%s'",
47 param->name, edje_external_param_type_str(param->type));
53 external_frame_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
55 if (!strcmp(param->name, "label"))
57 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
59 param->s = elm_object_text_get(obj);
63 else if (!strcmp(param->name, "content"))
65 /* not easy to get content name back from live object */
69 ERR("unknown parameter '%s' of type '%s'",
70 param->name, edje_external_param_type_str(param->type));
76 external_frame_params_parse(void *data __UNUSED__, Evas_Object *obj, const Eina_List *params)
78 Elm_Params_Frame *mem;
79 Edje_External_Param *param;
82 mem = calloc(1, sizeof(Elm_Params_Frame));
86 EINA_LIST_FOREACH(params, l, param)
88 if (!strcmp(param->name, "content"))
89 mem->content = external_common_param_edje_object_get(obj, param);
90 else if (!strcmp(param->name, "label"))
91 mem->label = eina_stringshare_add(param->s);
97 static Evas_Object *external_frame_content_get(void *data __UNUSED__,
98 const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
100 if (!strcmp(content, "content"))
101 return elm_object_content_get(obj);
103 ERR("unknown content '%s'", content);
108 external_frame_params_free(void *params)
110 Elm_Params_Frame *mem = params;
113 eina_stringshare_del(mem->label);
117 static Edje_External_Param_Info external_frame_params[] = {
118 DEFINE_EXTERNAL_COMMON_PARAMS,
119 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
120 EDJE_EXTERNAL_PARAM_INFO_STRING("content"),
121 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
124 DEFINE_EXTERNAL_ICON_ADD(frame, "frame");
125 DEFINE_EXTERNAL_TYPE_SIMPLE(frame, "Frame");