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_bubble_label_set(obj, p->label);
22 if (p->icon) elm_bubble_icon_set(obj, p->icon);
23 if (p->info) elm_bubble_info_set(obj, p->info);
24 if (p->content) elm_bubble_content_set(obj, p->content);
28 external_bubble_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_External_Param *param)
30 if (!strcmp(param->name, "label"))
32 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
34 elm_bubble_label_set(obj, param->s);
38 else if (!strcmp(param->name, "icon"))
40 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
42 Evas_Object *icon = external_common_param_icon_get(obj, param);
43 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
44 elm_bubble_icon_set(obj, icon);
48 else if (!strcmp(param->name, "info"))
50 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
52 elm_bubble_info_set(obj, param->s);
56 else if (!strcmp(param->name, "content"))
58 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
60 Evas_Object *content = \
61 external_common_param_edje_object_get(obj, param);
62 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
63 elm_bubble_content_set(obj, content);
68 ERR("unknown parameter '%s' of type '%s'",
69 param->name, edje_external_param_type_str(param->type));
75 external_bubble_param_get(void *data __UNUSED__, const Evas_Object *obj, Edje_External_Param *param)
77 if (!strcmp(param->name, "label"))
79 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
81 param->s = elm_bubble_label_get(obj);
85 else if (!strcmp(param->name, "icon"))
87 /* not easy to get icon name back from live object */
90 else if (!strcmp(param->name, "info"))
92 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
94 param->s = elm_bubble_info_get(obj);
98 else if (!strcmp(param->name, "content"))
100 /* not easy to get content name back from live object */
104 ERR("unknown parameter '%s' of type '%s'",
105 param->name, edje_external_param_type_str(param->type));
111 external_bubble_params_parse(void *data __UNUSED__, Evas_Object *obj, const Eina_List *params)
113 Elm_Params_Bubble *mem;
114 Edje_External_Param *param;
117 mem = calloc(1, sizeof(Elm_Params_Bubble));
121 external_common_icon_param_parse(&mem->icon, obj, params);
123 EINA_LIST_FOREACH(params, l, param)
125 if (!strcmp(param->name, "info"))
126 mem->info = eina_stringshare_add(param->s);
127 else if (!strcmp(param->name, "content"))
128 mem->content = external_common_param_edje_object_get(obj, param);
129 else if (!strcmp(param->name, "label"))
130 mem->label = eina_stringshare_add(param->s);
136 static Evas_Object *external_bubble_content_get(void *data __UNUSED__,
137 const Evas_Object *obj __UNUSED__, const char *content __UNUSED__)
144 external_bubble_params_free(void *params)
146 Elm_Params_Bubble *mem = params;
149 eina_stringshare_del(mem->info);
151 eina_stringshare_del(mem->label);
155 static Edje_External_Param_Info external_bubble_params[] = {
156 DEFINE_EXTERNAL_COMMON_PARAMS,
157 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
158 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
159 EDJE_EXTERNAL_PARAM_INFO_STRING("info"),
160 EDJE_EXTERNAL_PARAM_INFO_STRING("content"),
161 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
164 DEFINE_EXTERNAL_ICON_ADD(bubble, "bubble");
165 DEFINE_EXTERNAL_TYPE_SIMPLE(bubble, "Bubble");