3 typedef struct _Elm_Params_Bubble
9 Evas_Object *content; /* part name whose obj is to be set as content */
13 external_bubble_state_set(void *data __UNUSED__, Evas_Object *obj, const void *from_params, const void *to_params, float pos __UNUSED__)
15 const Elm_Params_Bubble *p;
17 if (to_params) p = to_params;
18 else if (from_params) p = from_params;
21 if (p->label) elm_object_text_set(obj, p->label);
23 elm_object_part_content_set(obj, "icon", p->icon);
24 if (p->info) elm_object_part_text_set(obj, "info", p->info);
25 if (p->content) elm_object_content_set(obj, p->content);
29 external_bubble_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
31 if (!strcmp(param->name, "label"))
33 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
35 elm_object_text_set(obj, param->s);
39 else if (!strcmp(param->name, "icon"))
41 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
43 Evas_Object *icon = external_common_param_icon_get(obj, param);
44 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
45 elm_object_part_content_set(obj, "icon", icon);
49 else if (!strcmp(param->name, "info"))
51 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
53 elm_object_part_text_set(obj, "info", param->s);
57 else if (!strcmp(param->name, "content"))
59 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
61 Evas_Object *content = \
62 external_common_param_edje_object_get(obj, param);
63 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
64 elm_bubble_content_set(obj, content);
69 ERR("unknown parameter '%s' of type '%s'",
70 param->name, edje_external_param_type_str(param->type));
76 external_bubble_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
78 if (!strcmp(param->name, "label"))
80 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
82 param->s = elm_object_text_get(obj);
86 else if (!strcmp(param->name, "icon"))
88 /* not easy to get icon name back from live object */
91 else if (!strcmp(param->name, "info"))
93 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
95 param->s = elm_object_part_text_get(obj, "info");
99 else if (!strcmp(param->name, "content"))
101 /* not easy to get content name back from live object */
105 ERR("unknown parameter '%s' of type '%s'",
106 param->name, edje_external_param_type_str(param->type));
112 external_bubble_params_parse(void *data __UNUSED__, Evas_Object *obj, const Eina_List *params)
114 Elm_Params_Bubble *mem;
115 Edje_External_Param *param;
118 mem = calloc(1, sizeof(Elm_Params_Bubble));
122 external_common_icon_param_parse(&mem->icon, obj, params);
124 EINA_LIST_FOREACH(params, l, param)
126 if (!strcmp(param->name, "info"))
127 mem->info = eina_stringshare_add(param->s);
128 else if (!strcmp(param->name, "content"))
129 mem->content = external_common_param_edje_object_get(obj, param);
130 else if (!strcmp(param->name, "label"))
131 mem->label = eina_stringshare_add(param->s);
137 static Evas_Object *external_bubble_content_get(void *data __UNUSED__,
138 const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
145 external_bubble_params_free(void *params)
147 Elm_Params_Bubble *mem = params;
150 eina_stringshare_del(mem->info);
152 eina_stringshare_del(mem->label);
156 static Edje_External_Param_Info external_bubble_params[] = {
157 DEFINE_EXTERNAL_COMMON_PARAMS,
158 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
159 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
160 EDJE_EXTERNAL_PARAM_INFO_STRING("info"),
161 EDJE_EXTERNAL_PARAM_INFO_STRING("content"),
162 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
165 DEFINE_EXTERNAL_ICON_ADD(bubble, "bubble");
166 DEFINE_EXTERNAL_TYPE_SIMPLE(bubble, "Bubble");