summaryrefslogtreecommitdiff
path: root/src/edje_external
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2016-03-23 12:56:14 -0700
committerCedric BAIL <cedric@osg.samsung.com>2016-03-23 13:24:41 -0700
commitc2a1c49ab2042f559b28e840e54feb8494888e0e (patch)
treec6eb110b7c479499854eede9d0c3ab0a80c9a11a /src/edje_external
parent9340855597e7e465435c69b6278650346688da14 (diff)
elementary: move all legacy files to their expected new location.
Diffstat (limited to 'src/edje_external')
-rw-r--r--src/edje_external/elementary/Makefile.am59
-rw-r--r--src/edje_external/elementary/elm.c342
-rw-r--r--src/edje_external/elementary/elm_actionslider.c106
-rw-r--r--src/edje_external/elementary/elm_bg.c159
-rw-r--r--src/edje_external/elementary/elm_bubble.c175
-rw-r--r--src/edje_external/elementary/elm_button.c207
-rw-r--r--src/edje_external/elementary/elm_calendar.c200
-rw-r--r--src/edje_external/elementary/elm_check.c154
-rw-r--r--src/edje_external/elementary/elm_clock.c245
-rw-r--r--src/edje_external/elementary/elm_entry.c380
-rw-r--r--src/edje_external/elementary/elm_fileselector.c188
-rw-r--r--src/edje_external/elementary/elm_fileselector_button.c261
-rw-r--r--src/edje_external/elementary/elm_fileselector_entry.c261
-rw-r--r--src/edje_external/elementary/elm_frame.c131
-rw-r--r--src/edje_external/elementary/elm_gengrid.c475
-rw-r--r--src/edje_external/elementary/elm_genlist.c344
-rw-r--r--src/edje_external/elementary/elm_hoversel.c154
-rw-r--r--src/edje_external/elementary/elm_icon.c338
-rw-r--r--src/edje_external/elementary/elm_index.c109
-rw-r--r--src/edje_external/elementary/elm_label.c106
-rw-r--r--src/edje_external/elementary/elm_list.c325
-rw-r--r--src/edje_external/elementary/elm_map.c191
-rw-r--r--src/edje_external/elementary/elm_multibuttonentry.c134
-rw-r--r--src/edje_external/elementary/elm_naviframe.c135
-rw-r--r--src/edje_external/elementary/elm_notify.c295
-rw-r--r--src/edje_external/elementary/elm_panes.c197
-rw-r--r--src/edje_external/elementary/elm_photocam.c215
-rw-r--r--src/edje_external/elementary/elm_progressbar.c284
-rw-r--r--src/edje_external/elementary/elm_radio.c181
-rw-r--r--src/edje_external/elementary/elm_scroller.c109
-rw-r--r--src/edje_external/elementary/elm_segment_control.c82
-rw-r--r--src/edje_external/elementary/elm_slider.c345
-rw-r--r--src/edje_external/elementary/elm_slideshow.c187
-rw-r--r--src/edje_external/elementary/elm_spinner.c251
-rw-r--r--src/edje_external/elementary/elm_thumb.c154
-rw-r--r--src/edje_external/elementary/elm_toolbar.c320
-rw-r--r--src/edje_external/elementary/elm_video.c276
-rw-r--r--src/edje_external/elementary/elm_web.c217
-rw-r--r--src/edje_external/elementary/modules.inc36
-rw-r--r--src/edje_external/elementary/private.h135
40 files changed, 8463 insertions, 0 deletions
diff --git a/src/edje_external/elementary/Makefile.am b/src/edje_external/elementary/Makefile.am
new file mode 100644
index 0000000..c1645b6
--- /dev/null
+++ b/src/edje_external/elementary/Makefile.am
@@ -0,0 +1,59 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-DELM_INTERNAL_API_ARGESFSDFEFC=1 \
5-I. \
6-I$(top_builddir) \
7-I$(top_srcdir) \
8-I$(top_srcdir)/src/lib \
9-I$(top_builddir)/src/lib \
10-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
11-DPACKAGE_LIB_DIR=\"$(libdir)\" \
12-DELEMENTARY_BUILD \
13@ELEMENTARY_CFLAGS@
14
15pkgdir = $(libdir)/edje/modules/elm/$(MODULE_EDJE)
16pkg_LTLIBRARIES = module.la
17
18module_la_SOURCES = private.h \
19modules.inc \
20elm.c \
21elm_actionslider.c \
22elm_bg.c \
23elm_bubble.c \
24elm_button.c \
25elm_calendar.c \
26elm_check.c \
27elm_clock.c \
28elm_entry.c \
29elm_fileselector.c \
30elm_fileselector_button.c \
31elm_fileselector_entry.c \
32elm_frame.c \
33elm_gengrid.c \
34elm_genlist.c \
35elm_hoversel.c \
36elm_icon.c \
37elm_index.c \
38elm_label.c \
39elm_list.c \
40elm_map.c \
41elm_multibuttonentry.c \
42elm_naviframe.c \
43elm_notify.c \
44elm_panes.c \
45elm_photocam.c \
46elm_progressbar.c \
47elm_radio.c \
48elm_scroller.c \
49elm_segment_control.c \
50elm_slider.c \
51elm_slideshow.c \
52elm_spinner.c \
53elm_thumb.c \
54elm_toolbar.c \
55elm_video.c \
56elm_web.c
57
58module_la_LIBADD = @ELEMENTARY_LIBS@ $(top_builddir)/src/lib/libelementary.la
59module_la_LDFLAGS = -no-undefined -module -avoid-version -shared -fPIC
diff --git a/src/edje_external/elementary/elm.c b/src/edje_external/elementary/elm.c
new file mode 100644
index 0000000..744d289
--- /dev/null
+++ b/src/edje_external/elementary/elm.c
@@ -0,0 +1,342 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include "Elementary.h"
6#include "private.h"
7
8int _elm_ext_log_dom = -1;
9
10static int init_count = 0;
11
12void
13external_elm_init(void)
14{
15 int argc = 0;
16 char **argv = NULL;
17
18 init_count++;
19 DBG("elm_real_init\n");
20 if (init_count > 1) return;
21 ecore_app_args_get(&argc, &argv);
22 elm_init(argc, argv);
23}
24
25static void
26external_elm_shutdown(void)
27{
28 init_count--;
29 DBG("elm_real_shutdown\n");
30 if (init_count > 0) return;
31 elm_shutdown();
32}
33
34void
35external_signal(void *data EINA_UNUSED, Evas_Object *obj, const char *sig,
36 const char *source)
37{
38 char *_signal = strdup(sig);
39 char *p = _signal;
40 Evas_Object *content;
41 Edje_External_Type *type;
42
43 if (!p) goto on_error;
44
45 while ((*p!='\0') && (*p!=']'))
46 p++;
47
48
49 if ((*p=='\0') || (*(p+1)!=':'))
50 {
51 ERR("Invalid External Signal received: '%s' '%s'", sig, source);
52 goto on_error;
53 }
54
55 *p = '\0';
56 p+=2; //jump ']' and ':'
57
58 type = evas_object_data_get(obj, "Edje_External_Type");
59 if (!type)
60 {
61 ERR("no external type for object %p", obj);
62 goto on_error;
63 }
64 if (!type->content_get)
65 {
66 ERR("external type '%s' from module '%s' does not provide content_get()",
67 type->module_name, type->module);
68 goto on_error;
69 }
70
71 content = type->content_get(type->data, obj, _signal);
72 if (content)
73 edje_object_signal_emit(content, sig + (p - _signal), source);
74
75on_error:
76 free(_signal);
77 return;
78}
79
80const char *
81external_translate(void *data EINA_UNUSED, const char *orig)
82{
83 // in future, mark all params as translatable and use dgettext()
84 // with "elementary" text domain here.
85 return orig;
86}
87
88typedef struct {
89 const char *emission;
90 const char *source;
91 Evas_Object *edje;
92} Elm_External_Signals_Proxy_Context;
93
94static void
95_external_signal_proxy_free_cb(void *data, Evas *e EINA_UNUSED,
96 Evas_Object *obj EINA_UNUSED,
97 void *event_info EINA_UNUSED)
98{
99 Elm_External_Signals_Proxy_Context *ctxt = data;
100 external_elm_shutdown();
101 free(ctxt);
102}
103
104static void
105_external_signal_proxy_cb(void *data, Evas_Object *obj EINA_UNUSED,
106 void *event_info EINA_UNUSED)
107{
108 Elm_External_Signals_Proxy_Context *ctxt = data;
109 // TODO: Is it worth to check Evas_Smart_Cb_Description and do something
110 // TODO: with event_info given its description?
111 edje_object_signal_emit(ctxt->edje, ctxt->emission, ctxt->source);
112}
113
114Eina_Bool
115external_common_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
116 Edje_External_Param *param)
117{
118 if (!strcmp(param->name, "style"))
119 {
120 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
121 {
122 param->s = elm_object_style_get(obj);
123 return EINA_TRUE;
124 }
125 }
126 else if (!strcmp(param->name, "disabled"))
127 {
128 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
129 {
130 param->i = elm_object_disabled_get(obj);
131 return EINA_TRUE;
132 }
133 }
134 return EINA_FALSE;
135}
136
137Eina_Bool
138external_common_param_set(void *data EINA_UNUSED, Evas_Object *obj,
139 const Edje_External_Param *param)
140{
141 if (!strcmp(param->name, "style"))
142 {
143 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
144 {
145 elm_object_style_set(obj, param->s);
146 return EINA_TRUE;
147 }
148 }
149 else if (!strcmp(param->name, "disabled"))
150 {
151 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
152 {
153 elm_object_disabled_set(obj, param->i);
154 return EINA_TRUE;
155 }
156 }
157 return EINA_FALSE;
158}
159
160void
161external_signals_proxy(Evas_Object *obj, Evas_Object *edje, const char *part_name)
162{
163 const Evas_Smart_Cb_Description **cls_descs, **inst_descs;
164 unsigned int cls_count, inst_count, total;
165 Elm_External_Signals_Proxy_Context *ctxt;
166
167 evas_object_smart_callbacks_descriptions_get
168 (obj, &cls_descs, &cls_count, &inst_descs, &inst_count);
169
170 total = cls_count + inst_count;
171 if (!total) return;
172 ctxt = malloc(sizeof(Elm_External_Signals_Proxy_Context) * total);
173 if (!ctxt) return;
174 evas_object_event_callback_add
175 (obj, EVAS_CALLBACK_FREE, _external_signal_proxy_free_cb, ctxt);
176
177 for (; cls_count > 0; cls_count--, cls_descs++, ctxt++)
178 {
179 const Evas_Smart_Cb_Description *d = *cls_descs;
180 ctxt->emission = d->name;
181 ctxt->source = part_name;
182 ctxt->edje = edje;
183 evas_object_smart_callback_add
184 (obj, d->name, _external_signal_proxy_cb, ctxt);
185 }
186
187 for (; inst_count > 0; inst_count--, inst_descs++, ctxt++)
188 {
189 const Evas_Smart_Cb_Description *d = *inst_descs;
190 ctxt->emission = d->name;
191 ctxt->source = part_name;
192 ctxt->edje = edje;
193 evas_object_smart_callback_add
194 (obj, d->name, _external_signal_proxy_cb, ctxt);
195 }
196}
197
198void
199external_common_params_parse(void *mem, void *data EINA_UNUSED,
200 Evas_Object *obj EINA_UNUSED,
201 const Eina_List *params)
202{
203 Elm_Params *p;
204 const Eina_List *l;
205 Edje_External_Param *param;
206
207 p = mem;
208 EINA_LIST_FOREACH(params, l, param)
209 {
210 if (!strcmp(param->name, "style"))
211 p->style = eina_stringshare_add(param->s);
212 else if (!strcmp(param->name, "disabled"))
213 {
214 p->disabled = param->i;
215 p->disabled_exists = EINA_TRUE;
216 }
217 }
218}
219
220void
221external_common_state_set(void *data EINA_UNUSED, Evas_Object *obj,
222 const void *from_params, const void *to_params,
223 float pos EINA_UNUSED)
224{
225 const Elm_Params *p;
226 if (to_params) p = to_params;
227 else if (from_params) p = from_params;
228 else return;
229
230 if (p->style)
231 elm_object_style_set(obj, p->style);
232 if (p->disabled_exists)
233 elm_object_disabled_set(obj, p->disabled);
234}
235
236Evas_Object *
237external_common_param_icon_get(Evas_Object *obj, const Edje_External_Param *p)
238{
239 Evas_Object *edje, *parent_widget, *icon;
240 const char *file;
241
242 if ((!p) || (!p->s) || (p->type != EDJE_EXTERNAL_PARAM_TYPE_STRING))
243 return NULL;
244
245 edje = evas_object_smart_parent_get(obj);
246 edje_object_file_get(edje, &file, NULL);
247
248 parent_widget = elm_widget_parent_widget_get(obj);
249 if (!parent_widget)
250 parent_widget = edje;
251 icon = elm_icon_add(parent_widget);
252
253 if ((edje_file_group_exists(file, p->s)) &&
254 (elm_image_file_set(icon, file, p->s)))
255 return icon;
256 if (elm_icon_standard_set(icon, p->s))
257 return icon;
258
259 ERR("Failed to set icon: '%s'", p->s);
260 evas_object_del(icon);
261 return NULL;
262}
263
264void
265external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj,
266 const Eina_List *params)
267{
268 Edje_External_Param *p = edje_external_param_find(params, "icon");
269 *icon = external_common_param_icon_get(obj, p);
270}
271
272Evas_Object *
273external_common_param_elm_layout_get(Evas_Object *obj,
274 const Edje_External_Param *p)
275{
276 Evas_Object *edje, *parent_widget, *ret;
277 const char *file;
278
279 if ((!p) || (!p->s) || (p->type != EDJE_EXTERNAL_PARAM_TYPE_STRING))
280 return NULL;
281
282 edje = evas_object_smart_parent_get(obj);
283 edje_object_file_get(edje, &file, NULL);
284
285 parent_widget = elm_widget_parent_widget_get(obj);
286 if (parent_widget)
287 {
288 ret = elm_layout_add(parent_widget);
289 if (elm_layout_file_set(ret, file, p->s))
290 return ret;
291 }
292 else
293 {
294 ret = edje_object_add(evas_object_evas_get(edje));
295 if (edje_object_file_set(ret, file, p->s))
296 return ret;
297 }
298 evas_object_del(ret);
299 return NULL;
300}
301
302void
303external_common_params_free(void *params)
304{
305 Elm_Params *p = params;
306 if (p->style)
307 eina_stringshare_del(p->style);
308}
309
310#define DEFINE_TYPE(type_name) \
311 extern const Edje_External_Type external_##type_name##_type;
312#include "modules.inc"
313#undef DEFINE_TYPE
314
315static Edje_External_Type_Info elm_external_types[] =
316{
317#define DEFINE_TYPE(type_name) \
318 { "elm/"#type_name, &external_##type_name##_type },
319#include "modules.inc"
320#undef DEFINE_TYPE
321 { NULL, NULL }
322};
323
324static Eina_Bool
325elm_mod_init(void)
326{
327 _elm_ext_log_dom = eina_log_domain_register("elm-externals",
328 EINA_COLOR_LIGHTBLUE);
329 edje_external_type_array_register(elm_external_types);
330 return EINA_TRUE;
331}
332
333static void
334elm_mod_shutdown(void)
335{
336 edje_external_type_array_unregister(elm_external_types);
337 if (_elm_ext_log_dom >= 0) eina_log_domain_unregister(_elm_ext_log_dom);
338 _elm_ext_log_dom = -1;
339}
340
341EINA_MODULE_INIT(elm_mod_init);
342EINA_MODULE_SHUTDOWN(elm_mod_shutdown);
diff --git a/src/edje_external/elementary/elm_actionslider.c b/src/edje_external/elementary/elm_actionslider.c
new file mode 100644
index 0000000..166707b
--- /dev/null
+++ b/src/edje_external/elementary/elm_actionslider.c
@@ -0,0 +1,106 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Actionslider
4{
5 Elm_Params base;
6 const char *label;
7} Elm_Params_Actionslider;
8
9static void
10external_actionslider_state_set(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
11 const void *from_params, const void *to_params,
12 float pos EINA_UNUSED)
13{
14 const Elm_Params_Actionslider *p;
15
16 if (to_params) p = to_params;
17 else if (from_params) p = from_params;
18 else return;
19
20 if (p->label)
21 elm_object_text_set(obj, p->label);
22}
23
24static Eina_Bool
25external_actionslider_param_set(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
26 const Edje_External_Param *param)
27{
28 if ((param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
29 && (!strcmp(param->name, "label")))
30 {
31 elm_object_text_set(obj, param->s);
32 return EINA_TRUE;
33 }
34
35 ERR("unknown parameter '%s' of type '%s'",
36 param->name, edje_external_param_type_str(param->type));
37
38 return EINA_FALSE;
39}
40
41static Eina_Bool
42external_actionslider_param_get(void *data EINA_UNUSED, const Evas_Object *obj EINA_UNUSED,
43 Edje_External_Param *param)
44{
45 if ((param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
46 && (!strcmp(param->name, "label")))
47 {
48 param->s = elm_object_text_get(obj);
49 return EINA_TRUE;
50 }
51
52 ERR("unknown parameter '%s' of type '%s'",
53 param->name, edje_external_param_type_str(param->type));
54
55 return EINA_FALSE;
56}
57
58static void *
59external_actionslider_params_parse(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
60 const Eina_List *params)
61{
62 Elm_Params_Actionslider *mem;
63 Edje_External_Param *param;
64 const Eina_List *l;
65
66 mem = ELM_NEW(Elm_Params_Actionslider);
67 if (!mem)
68 return NULL;
69
70 EINA_LIST_FOREACH(params, l, param)
71 {
72 if (!strcmp(param->name, "label"))
73 {
74 mem->label = eina_stringshare_add(param->s);
75 break;
76 }
77 }
78
79 return mem;
80}
81
82static Evas_Object *external_actionslider_content_get(void *data EINA_UNUSED,
83 const Evas_Object *obj EINA_UNUSED, const char *content EINA_UNUSED)
84{
85 ERR("No content.");
86 return NULL;
87}
88
89static void
90external_actionslider_params_free(void *params)
91{
92 Elm_Params_Actionslider *mem = params;
93 if (mem->label)
94 eina_stringshare_del(mem->label);
95 free(mem);
96}
97
98static Edje_External_Param_Info external_actionslider_params[] =
99{
100 DEFINE_EXTERNAL_COMMON_PARAMS,
101 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
102 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
103};
104
105DEFINE_EXTERNAL_ICON_ADD(actionslider, "actionslider");
106DEFINE_EXTERNAL_TYPE_SIMPLE(actionslider, "Actionslider");
diff --git a/src/edje_external/elementary/elm_bg.c b/src/edje_external/elementary/elm_bg.c
new file mode 100644
index 0000000..3945b99
--- /dev/null
+++ b/src/edje_external/elementary/elm_bg.c
@@ -0,0 +1,159 @@
1#include <assert.h>
2#include "private.h"
3
4typedef struct _Elm_Params_Bg
5{
6 Elm_Params base;
7 const char *file;
8 const char *option;
9} Elm_Params_Bg;
10
11#define OPTION_GET(CHOICES, STR) \
12 unsigned int i; \
13 for (i = 0; i < (sizeof(CHOICES) / sizeof(CHOICES[0])); ++i) \
14 if (!strcmp(STR, CHOICES[i])) \
15 return i;
16
17static const char *_bg_options[] =
18{
19 "center", "scale", "stretch", "tile", NULL
20};
21
22static Elm_Bg_Option
23_bg_option_get(const char *option)
24{
25 assert(sizeof(_bg_options) / sizeof(_bg_options[0])
26 == ELM_BG_OPTION_TILE + 2);
27 OPTION_GET(_bg_options, option);
28 return -1;
29}
30
31static void
32external_bg_state_set(void *data EINA_UNUSED, Evas_Object *obj,
33 const void *from_params, const void *to_params,
34 float pos EINA_UNUSED)
35{
36 const Elm_Params_Bg *p;
37 Elm_Bg_Option option;
38
39 if (to_params) p = to_params;
40 else if (from_params) p = from_params;
41 else return;
42
43 if (p->option)
44 {
45 option = _bg_option_get(p->option);
46 elm_bg_option_set(obj, option);
47 }
48 if (p->file)
49 {
50 elm_bg_file_set(obj, p->file, NULL);
51 }
52}
53
54static Eina_Bool
55external_bg_param_set(void *data EINA_UNUSED, Evas_Object *obj,
56 const Edje_External_Param *param)
57{
58 if ((!strcmp(param->name, "file"))
59 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
60 {
61 return elm_bg_file_set(obj, param->s, NULL);
62 }
63 else if ((!strcmp(param->name, "select_mode"))
64 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
65 {
66 Elm_Bg_Option option;
67 option = _bg_option_get(param->s);
68 elm_bg_option_set(obj, option);
69 return EINA_TRUE;
70 }
71
72 ERR("unknown parameter '%s' of type '%s'",
73 param->name, edje_external_param_type_str(param->type));
74
75 return EINA_FALSE;
76}
77
78static Eina_Bool
79external_bg_param_get(void *data EINA_UNUSED,
80 const Evas_Object *obj EINA_UNUSED,
81 Edje_External_Param *param)
82{
83 if ((!strcmp(param->name, "file"))
84 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
85 {
86 elm_bg_file_get(obj, &(param->s), NULL);
87 return EINA_TRUE;
88 }
89 else if ((!strcmp(param->name, "option"))
90 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
91 {
92 Elm_Bg_Option option;
93 option = elm_bg_option_get(obj);
94 param->s = _bg_options[option];
95 return EINA_TRUE;
96 }
97
98 ERR("unknown parameter '%s' of type '%s'",
99 param->name, edje_external_param_type_str(param->type));
100
101 return EINA_FALSE;
102}
103
104static void *
105external_bg_params_parse(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
106 const Eina_List *params)
107{
108 Elm_Params_Bg *mem;
109 Edje_External_Param *param;
110 const Eina_List *l;
111
112 mem = calloc(1, sizeof(Elm_Params_Bg));
113 if (!mem)
114 return NULL;
115
116 EINA_LIST_FOREACH(params, l, param)
117 {
118 if (!strcmp(param->name, "file"))
119 mem->file = eina_stringshare_add(param->s);
120 else if (!strcmp(param->name, "option"))
121 mem->option = eina_stringshare_add(param->s);
122 }
123
124 return mem;
125}
126
127static Evas_Object *
128external_bg_content_get(void *data EINA_UNUSED,
129 const Evas_Object *obj EINA_UNUSED,
130 const char *content EINA_UNUSED)
131{
132 ERR("no content");
133 return NULL;
134}
135
136static void
137external_bg_params_free(void *params)
138{
139 Elm_Params_Bg *mem = params;
140
141 if (mem->file)
142 eina_stringshare_del(mem->file);
143
144 if (mem->option)
145 eina_stringshare_del(mem->option);
146
147 free(mem);
148}
149
150static Edje_External_Param_Info external_bg_params[] =
151{
152 DEFINE_EXTERNAL_COMMON_PARAMS,
153 EDJE_EXTERNAL_PARAM_INFO_STRING("file"),
154 EDJE_EXTERNAL_PARAM_INFO_STRING("option"),
155 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
156};
157
158DEFINE_EXTERNAL_ICON_ADD(bg, "bg");
159DEFINE_EXTERNAL_TYPE_SIMPLE(bg, "Bg");
diff --git a/src/edje_external/elementary/elm_bubble.c b/src/edje_external/elementary/elm_bubble.c
new file mode 100644
index 0000000..686dea3
--- /dev/null
+++ b/src/edje_external/elementary/elm_bubble.c
@@ -0,0 +1,175 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Bubble
4{
5 Elm_Params base;
6 const char *label;
7 Evas_Object *icon;
8 const char *info;
9 Evas_Object *content; /* part name whose obj is to be set as content */
10} Elm_Params_Bubble;
11
12static void
13external_bubble_state_set(void *data EINA_UNUSED, Evas_Object *obj,
14 const void *from_params, const void *to_params,
15 float pos EINA_UNUSED)
16{
17 const Elm_Params_Bubble *p;
18
19 if (to_params) p = to_params;
20 else if (from_params) p = from_params;
21 else return;
22
23 if (p->label) elm_object_text_set(obj, p->label);
24 if (p->icon)
25 elm_object_part_content_set(obj, "icon", p->icon);
26 if (p->info) elm_object_part_text_set(obj, "info", p->info);
27 if (p->content) elm_object_content_set(obj, p->content);
28}
29
30static Eina_Bool
31external_bubble_param_set(void *data EINA_UNUSED, Evas_Object *obj,
32 const Edje_External_Param *param)
33{
34 if (!strcmp(param->name, "label"))
35 {
36 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
37 {
38 elm_object_text_set(obj, param->s);
39 return EINA_TRUE;
40 }
41 }
42 else if (!strcmp(param->name, "icon"))
43 {
44 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
45 {
46 Evas_Object *icon = external_common_param_icon_get(obj, param);
47 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
48 elm_object_part_content_set(obj, "icon", icon);
49 return EINA_TRUE;
50 }
51 }
52 else if (!strcmp(param->name, "info"))
53 {
54 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
55 {
56 elm_object_part_text_set(obj, "info", param->s);
57 return EINA_TRUE;
58 }
59 }
60 else if (!strcmp(param->name, "content"))
61 {
62 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
63 {
64 Evas_Object *content = \
65 external_common_param_elm_layout_get(obj, param);
66 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
67 elm_object_content_set(obj, content);
68 return EINA_TRUE;
69 }
70 }
71
72 ERR("unknown parameter '%s' of type '%s'",
73 param->name, edje_external_param_type_str(param->type));
74
75 return EINA_FALSE;
76}
77
78static Eina_Bool
79external_bubble_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
80 Edje_External_Param *param)
81{
82 if (!strcmp(param->name, "label"))
83 {
84 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
85 {
86 param->s = elm_object_text_get(obj);
87 return EINA_TRUE;
88 }
89 }
90 else if (!strcmp(param->name, "icon"))
91 {
92 /* not easy to get icon name back from live object */
93 return EINA_FALSE;
94 }
95 else if (!strcmp(param->name, "info"))
96 {
97 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
98 {
99 param->s = elm_object_part_text_get(obj, "info");
100 return EINA_TRUE;
101 }
102 }
103 else if (!strcmp(param->name, "content"))
104 {
105 /* not easy to get content name back from live object */
106 return EINA_FALSE;
107 }
108
109 ERR("unknown parameter '%s' of type '%s'",
110 param->name, edje_external_param_type_str(param->type));
111
112 return EINA_FALSE;
113}
114
115static void *
116external_bubble_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
117 const Eina_List *params)
118{
119 Elm_Params_Bubble *mem;
120 Edje_External_Param *param;
121 const Eina_List *l;
122
123 mem = calloc(1, sizeof(Elm_Params_Bubble));
124 if (!mem)
125 return NULL;
126
127 external_common_icon_param_parse(&mem->icon, obj, params);
128
129 EINA_LIST_FOREACH(params, l, param)
130 {
131 if (!strcmp(param->name, "info"))
132 mem->info = eina_stringshare_add(param->s);
133 else if (!strcmp(param->name, "content"))
134 mem->content = external_common_param_elm_layout_get(obj, param);
135 else if (!strcmp(param->name, "label"))
136 mem->label = eina_stringshare_add(param->s);
137 }
138
139 return mem;
140}
141
142static Evas_Object *external_bubble_content_get(void *data EINA_UNUSED,
143 const Evas_Object *obj EINA_UNUSED,
144 const char *content EINA_UNUSED)
145{
146 if (!strcmp(content, "content"))
147 return elm_object_content_get(obj);
148 ERR("unknown content '%s'", content);
149 return NULL;
150}
151
152static void
153external_bubble_params_free(void *params)
154{
155 Elm_Params_Bubble *mem = params;
156
157 if (mem->info)
158 eina_stringshare_del(mem->info);
159 if (mem->label)
160 eina_stringshare_del(mem->label);
161 free(params);
162}
163
164static Edje_External_Param_Info external_bubble_params[] =
165{
166 DEFINE_EXTERNAL_COMMON_PARAMS,
167 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
168 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
169 EDJE_EXTERNAL_PARAM_INFO_STRING("info"),
170 EDJE_EXTERNAL_PARAM_INFO_STRING("content"),
171 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
172};
173
174DEFINE_EXTERNAL_ICON_ADD(bubble, "bubble");
175DEFINE_EXTERNAL_TYPE_SIMPLE(bubble, "Bubble");
diff --git a/src/edje_external/elementary/elm_button.c b/src/edje_external/elementary/elm_button.c
new file mode 100644
index 0000000..bca4f6b
--- /dev/null
+++ b/src/edje_external/elementary/elm_button.c
@@ -0,0 +1,207 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Button
4{
5 Elm_Params base;
6 const char *label;
7 Evas_Object *icon;
8 double autorepeat_initial;
9 double autorepeat_gap;
10 Eina_Bool autorepeat:1;
11 Eina_Bool autorepeat_exists:1;
12 Eina_Bool autorepeat_gap_exists:1;
13 Eina_Bool autorepeat_initial_exists:1;
14} Elm_Params_Button;
15
16static void
17external_button_state_set(void *data EINA_UNUSED, Evas_Object *obj,
18 const void *from_params, const void *to_params,
19 float pos EINA_UNUSED)
20{
21 const Elm_Params_Button *p;
22
23 if (to_params) p = to_params;
24 else if (from_params) p = from_params;
25 else return;
26
27 if (p->label)
28 elm_object_text_set(obj, p->label);
29 if (p->icon)
30 elm_object_part_content_set(obj, "icon", p->icon);
31 if (p->autorepeat_gap_exists)
32 elm_button_autorepeat_gap_timeout_set(obj, p->autorepeat_gap);
33 if (p->autorepeat_initial_exists)
34 elm_button_autorepeat_initial_timeout_set(obj, p->autorepeat_initial);
35 if (p->autorepeat_exists)
36 elm_button_autorepeat_set(obj, p->autorepeat);
37}
38
39static Eina_Bool
40external_button_param_set(void *data EINA_UNUSED, Evas_Object *obj,
41 const Edje_External_Param *param)
42{
43 if (!strcmp(param->name, "label"))
44 {
45 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
46 {
47 elm_object_text_set(obj, param->s);
48 return EINA_TRUE;
49 }
50 }
51 else if (!strcmp(param->name, "icon"))
52 {
53 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
54 {
55 Evas_Object *icon = external_common_param_icon_get(obj, param);
56 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
57 elm_object_part_content_set(obj, "icon", icon);
58 return EINA_TRUE;
59 }
60 }
61 else if (!strcmp(param->name, "autorepeat_initial"))
62 {
63 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
64 {
65 elm_button_autorepeat_initial_timeout_set(obj, param->d);
66 return EINA_TRUE;
67 }
68 }
69 else if (!strcmp(param->name, "autorepeat_gap"))
70 {
71 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
72 {
73 elm_button_autorepeat_gap_timeout_set(obj, param->d);
74 return EINA_TRUE;
75 }
76 }
77 else if (!strcmp(param->name, "autorepeat"))
78 {
79 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
80 {
81 elm_button_autorepeat_set(obj, param->i);
82 return EINA_TRUE;
83 }
84 }
85
86 ERR("unknown parameter '%s' of type '%s'",
87 param->name, edje_external_param_type_str(param->type));
88
89 return EINA_FALSE;
90}
91
92static Eina_Bool
93external_button_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
94 Edje_External_Param *param)
95{
96 if (!strcmp(param->name, "label"))
97 {
98 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
99 {
100 param->s = elm_object_text_get(obj);
101 return EINA_TRUE;
102 }
103 }
104 else if (!strcmp(param->name, "icon"))
105 {
106 /* not easy to get icon name back from live object */
107 return EINA_FALSE;
108 }
109 else if (!strcmp(param->name, "autorepeat_initial"))
110 {
111 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
112 {
113 param->d = elm_button_autorepeat_initial_timeout_get(obj);
114 return EINA_TRUE;
115 }
116 }
117 else if (!strcmp(param->name, "autorepeat_gap"))
118 {
119 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
120 {
121 param->d = elm_button_autorepeat_gap_timeout_get(obj);
122 return EINA_TRUE;
123 }
124 }
125 else if (!strcmp(param->name, "autorepeat"))
126 {
127 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
128 {
129 param->i = elm_button_autorepeat_get(obj);
130 return EINA_TRUE;
131 }
132 }
133
134 ERR("unknown parameter '%s' of type '%s'",
135 param->name, edje_external_param_type_str(param->type));
136
137 return EINA_FALSE;
138}
139
140static void *
141external_button_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
142 const Eina_List *params)
143{
144 Elm_Params_Button *mem;
145 Edje_External_Param *param;
146 const Eina_List *l;
147
148 mem = ELM_NEW(Elm_Params_Button);
149 if (!mem)
150 return NULL;
151
152 external_common_icon_param_parse(&mem->icon, obj, params);
153
154 EINA_LIST_FOREACH(params, l, param)
155 {
156 if (!strcmp(param->name, "autorepeat_initial"))
157 {
158 mem->autorepeat_initial = param->d;
159 mem->autorepeat_initial_exists = EINA_TRUE;
160 }
161 else if (!strcmp(param->name, "autorepeat_gap"))
162 {
163 mem->autorepeat_gap = param->d;
164 mem->autorepeat_gap_exists = EINA_TRUE;
165 }
166 else if (!strcmp(param->name, "autorepeat"))
167 {
168 mem->autorepeat = !!param->i;
169 mem->autorepeat_exists = EINA_TRUE;
170 }
171 else if (!strcmp(param->name, "label"))
172 mem->label = eina_stringshare_add(param->s);
173 }
174
175 return mem;
176}
177
178static Evas_Object *external_button_content_get(void *data EINA_UNUSED,
179 const Evas_Object *obj EINA_UNUSED,
180 const char *content EINA_UNUSED)
181{
182 ERR("No content.");
183 return NULL;
184}
185
186static void
187external_button_params_free(void *params)
188{
189 Elm_Params_Button *mem = params;
190 if (mem->label)
191 eina_stringshare_del(mem->label);
192 free(params);
193}
194
195static Edje_External_Param_Info external_button_params[] =
196{
197 DEFINE_EXTERNAL_COMMON_PARAMS,
198 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
199 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
200 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("autorepeat_initial"),
201 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("autorepeat_gap"),
202 EDJE_EXTERNAL_PARAM_INFO_BOOL("autorepeat"),
203 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
204};
205
206DEFINE_EXTERNAL_ICON_ADD(button, "button");
207DEFINE_EXTERNAL_TYPE_SIMPLE(button, "Button");
diff --git a/src/edje_external/elementary/elm_calendar.c b/src/edje_external/elementary/elm_calendar.c
new file mode 100644
index 0000000..b946b0e
--- /dev/null
+++ b/src/edje_external/elementary/elm_calendar.c
@@ -0,0 +1,200 @@
1#include <assert.h>
2#include "private.h"
3
4typedef struct _Elm_Params_Calendar
5{
6 Elm_Params base;
7 int year_min;
8 int year_max;
9 const char *select_mode;
10
11} Elm_Params_Calendar;
12
13#define SELECT_MODE_GET(CHOICES, STR) \
14 unsigned int i; \
15 for (i = 0; i < (sizeof(CHOICES) / sizeof(CHOICES[0])); ++i) \
16 if (!strcmp(STR, CHOICES[i])) \
17 return i;
18
19static const char *_calendar_select_modes[] =
20{
21 "default", "always", "none", "ondemand", NULL
22};
23
24static Elm_Calendar_Select_Mode
25_calendar_select_mode_get(const char *select_mode)
26{
27 assert(sizeof(_calendar_select_modes) /
28 sizeof(_calendar_select_modes[0])
29 == ELM_CALENDAR_SELECT_MODE_ONDEMAND + 2);
30 SELECT_MODE_GET(_calendar_select_modes, select_mode);
31 return -1;
32}
33
34static void
35external_calendar_state_set(void *data EINA_UNUSED, Evas_Object *obj,
36 const void *from_params, const void *to_params,
37 float pos EINA_UNUSED)
38{
39 const Elm_Params_Calendar *p;
40 Elm_Calendar_Select_Mode select_mode;
41 int min,max;
42
43 if (to_params) p = to_params;
44 else if (from_params) p = from_params;
45 else return;
46
47 if (p->year_min)
48 {
49 elm_calendar_min_max_year_get(obj, NULL, &max);
50 elm_calendar_min_max_year_set(obj, p->year_min, max);
51 }
52 if (p->year_max)
53 {
54 elm_calendar_min_max_year_get(obj, &min, NULL);
55 elm_calendar_min_max_year_set(obj, min, p->year_max);
56 }
57 if (p->select_mode)
58 {
59 select_mode = _calendar_select_mode_get(p->select_mode);
60 elm_calendar_select_mode_set(obj, select_mode);
61 }
62}
63
64static Eina_Bool
65external_calendar_param_set(void *data EINA_UNUSED, Evas_Object *obj,
66 const Edje_External_Param *param)
67{
68 int min,max;
69
70 if (!strcmp(param->name, "year_min"))
71 {
72 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
73 {
74 elm_calendar_min_max_year_get(obj, NULL, &max);
75 elm_calendar_min_max_year_set(obj, param->i, max);
76 return EINA_TRUE;
77 }
78 }
79 else if (!strcmp(param->name, "year_max"))
80 {
81 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
82 {
83 elm_calendar_min_max_year_get(obj, &min, NULL);
84 elm_calendar_min_max_year_set(obj, min,param->i);
85 return EINA_TRUE;
86 }
87 }
88 else if (!strcmp(param->name, "select_mode"))
89 {
90 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
91 {
92 Elm_Calendar_Select_Mode select_mode;
93 select_mode = _calendar_select_mode_get(param->s);
94 elm_calendar_select_mode_set(obj, select_mode);
95 return EINA_TRUE;
96 }
97 }
98
99 ERR("unknown parameter '%s' of type '%s'",
100 param->name, edje_external_param_type_str(param->type));
101
102 return EINA_FALSE;
103}
104
105static Eina_Bool
106external_calendar_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
107 Edje_External_Param *param)
108{
109 int min, max;
110
111 if (!strcmp(param->name, "year_min"))
112 {
113 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
114 {
115 elm_calendar_min_max_year_get(obj, &(param->i) ,&max);
116 return EINA_TRUE;
117 }
118 }
119 else if (!strcmp(param->name, "year_max"))
120 {
121 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
122 {
123 elm_calendar_min_max_year_get(obj, &min,&(param->i));
124 return EINA_TRUE;
125 }
126 }
127 else if (!strcmp(param->name, "select_mode"))
128 {
129 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
130 {
131 Elm_Calendar_Select_Mode mode;
132 mode = elm_calendar_select_mode_get(obj);
133 param->s = _calendar_select_modes[mode];
134 return EINA_TRUE;
135 }
136 }
137
138
139 ERR("unknown parameter '%s' of type '%s'",
140 param->name, edje_external_param_type_str(param->type));
141
142 return EINA_FALSE;
143}
144
145static void *
146external_calendar_params_parse(void *data EINA_UNUSED,
147 Evas_Object *obj EINA_UNUSED,
148 const Eina_List *params)
149{
150 Elm_Params_Calendar *mem;
151 Edje_External_Param *param;
152 const Eina_List *l;
153
154 mem = calloc(1, sizeof(Elm_Params_Calendar));
155 if (!mem)
156 return NULL;
157
158 EINA_LIST_FOREACH(params, l, param)
159 {
160 if (!strcmp(param->name, "year_min"))
161 mem->year_min = param->i;
162
163 else if (!strcmp(param->name, "year_max"))
164 mem->year_max = param->i;
165
166 else if (!strcmp(param->name, "select_mode"))
167 mem->select_mode = eina_stringshare_add(param->s);
168 }
169
170 return mem;
171}
172
173static Evas_Object *
174external_calendar_content_get(void *data EINA_UNUSED,
175 const Evas_Object *obj EINA_UNUSED,
176 const char *content EINA_UNUSED)
177{
178 ERR("No content.");
179 return NULL;
180}
181
182static void
183external_calendar_params_free(void *params)
184{
185 Elm_Params_Calendar *mem = params;
186 if (mem->select_mode)
187 eina_stringshare_del(mem->select_mode);
188 free(params);
189}
190
191static Edje_External_Param_Info external_calendar_params[] = {
192 DEFINE_EXTERNAL_COMMON_PARAMS,
193 EDJE_EXTERNAL_PARAM_INFO_INT("year_min"),
194 EDJE_EXTERNAL_PARAM_INFO_INT("year_max"),
195 EDJE_EXTERNAL_PARAM_INFO_STRING("select_mode"),
196 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
197};
198
199DEFINE_EXTERNAL_ICON_ADD(calendar, "calendar");
200DEFINE_EXTERNAL_TYPE_SIMPLE(calendar, "Calendar");
diff --git a/src/edje_external/elementary/elm_check.c b/src/edje_external/elementary/elm_check.c
new file mode 100644
index 0000000..e989594
--- /dev/null
+++ b/src/edje_external/elementary/elm_check.c
@@ -0,0 +1,154 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Check
4{
5 Elm_Params base;
6 const char *label;
7 Evas_Object *icon;
8 Eina_Bool state:1;
9 Eina_Bool state_exists:1;
10} Elm_Params_Check;
11
12static void
13external_check_state_set(void *data EINA_UNUSED, Evas_Object *obj,
14 const void *from_params, const void *to_params,
15 float pos EINA_UNUSED)
16{
17 const Elm_Params_Check *p;
18
19 if (to_params) p = to_params;
20 else if (from_params) p = from_params;
21 else return;
22
23 if (p->label)
24 elm_object_text_set(obj, p->label);
25 if (p->icon)
26 elm_object_part_content_set(obj, "icon", p->icon);
27 if (p->state_exists)
28 elm_check_state_set(obj, p->state);
29}
30
31static Eina_Bool
32external_check_param_set(void *data EINA_UNUSED, Evas_Object *obj,
33 const Edje_External_Param *param)
34{
35 if (!strcmp(param->name, "label"))
36 {
37 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
38 {
39 elm_object_text_set(obj, param->s);
40 return EINA_TRUE;
41 }
42 }
43 else if (!strcmp(param->name, "icon"))
44 {
45 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
46 {
47 Evas_Object *icon = external_common_param_icon_get(obj, param);
48 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
49 elm_object_part_content_set(obj, "icon", icon);
50 return EINA_TRUE;
51 }
52 }
53 else if (!strcmp(param->name, "state"))
54 {
55 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
56 {
57 elm_check_state_set(obj, param->i);
58 return EINA_TRUE;
59 }
60 }
61
62 ERR("unknown parameter '%s' of type '%s'",
63 param->name, edje_external_param_type_str(param->type));
64
65 return EINA_FALSE;
66}
67
68static Eina_Bool
69external_check_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
70 Edje_External_Param *param)
71{
72 if (!strcmp(param->name, "label"))
73 {
74 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
75 {
76 param->s = elm_object_text_get(obj);
77 return EINA_TRUE;
78 }
79 }
80 else if (!strcmp(param->name, "icon"))
81 {
82 /* not easy to get icon name back from live object */
83 return EINA_FALSE;
84 }
85 else if (!strcmp(param->name, "state"))
86 {
87 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
88 {
89 param->i = elm_check_state_get(obj);
90 return EINA_TRUE;
91 }
92 }
93
94 ERR("unknown parameter '%s' of type '%s'",
95 param->name, edje_external_param_type_str(param->type));
96
97 return EINA_FALSE;
98}
99
100static void *
101external_check_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
102 const Eina_List *params)
103{
104 Elm_Params_Check *mem;
105 Edje_External_Param *param;
106 const Eina_List *l;
107
108 mem = calloc(1, sizeof(Elm_Params_Check));
109 if (!mem)
110 return NULL;
111
112 external_common_icon_param_parse(&mem->icon, obj, params);
113
114 EINA_LIST_FOREACH(params, l, param)
115 {
116 if (!strcmp(param->name, "state"))
117 {
118 mem->state = !!param->i;
119 mem->state_exists = EINA_TRUE;
120 }
121 else if (!strcmp(param->name, "label"))
122 mem->label = eina_stringshare_add(param->s);
123 }
124
125 return mem;
126}
127
128static Evas_Object *external_check_content_get(void *data EINA_UNUSED,
129 const Evas_Object *obj EINA_UNUSED,
130 const char *content EINA_UNUSED)
131{
132 ERR("No content.");
133 return NULL;
134}
135
136static void
137external_check_params_free(void *params)
138{
139 Elm_Params_Check *mem = params;
140 if (mem->label)
141 eina_stringshare_del(mem->label);
142 free(params);
143}
144
145static Edje_External_Param_Info external_check_params[] = {
146 DEFINE_EXTERNAL_COMMON_PARAMS,
147 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
148 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
149 EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL("state", 0, "unchecked", "checked"),
150 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
151};
152
153DEFINE_EXTERNAL_ICON_ADD(check, "check");
154DEFINE_EXTERNAL_TYPE_SIMPLE(check, "Check");
diff --git a/src/edje_external/elementary/elm_clock.c b/src/edje_external/elementary/elm_clock.c
new file mode 100644
index 0000000..2e95899
--- /dev/null
+++ b/src/edje_external/elementary/elm_clock.c
@@ -0,0 +1,245 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Clock
4{
5 Elm_Params base;
6 int hrs, min, sec;
7 Eina_Bool hrs_exists:1;
8 Eina_Bool min_exists:1;
9 Eina_Bool sec_exists:1;
10 Eina_Bool edit:1;
11 Eina_Bool ampm:1;
12 Eina_Bool seconds:1;
13} Elm_Params_Clock;
14
15static void
16external_clock_state_set(void *data EINA_UNUSED, Evas_Object *obj,
17 const void *from_params, const void *to_params,
18 float pos EINA_UNUSED)
19{
20 const Elm_Params_Clock *p;
21
22 if (to_params) p = to_params;
23 else if (from_params) p = from_params;
24 else return;
25
26 if ((p->hrs_exists) && (p->min_exists) && (p->sec_exists))
27 elm_clock_time_set(obj, p->hrs, p->min, p->sec);
28 else if ((p->hrs_exists) || (p->min_exists) || (p->sec_exists))
29 {
30 int hrs, min, sec;
31 elm_clock_time_get(obj, &hrs, &min, &sec);
32 if (p->hrs_exists)
33 hrs = p->hrs;
34 if (p->min_exists)
35 min = p->min;
36 if (p->sec_exists)
37 sec = p->sec;
38 elm_clock_time_set(obj, hrs, min, sec);
39 }
40 if (p->edit)
41 elm_clock_edit_set(obj, p->edit);
42 if (p->ampm)
43 elm_clock_show_am_pm_set(obj, p->ampm);
44 if (p->seconds)
45 elm_clock_show_seconds_set(obj, p->seconds);
46}
47
48static Eina_Bool
49external_clock_param_set(void *data EINA_UNUSED, Evas_Object *obj,
50 const Edje_External_Param *param)
51{
52 if (!strcmp(param->name, "hours"))
53 {
54 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
55 {
56 int hrs, min, sec;
57 elm_clock_time_get(obj, &hrs, &min, &sec);
58 elm_clock_time_set(obj, param->i, min, sec);
59 return EINA_TRUE;
60 }
61 }
62 else if (!strcmp(param->name, "minutes"))
63 {
64 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
65 {
66 int hrs, min, sec;
67 elm_clock_time_get(obj, &hrs, &min, &sec);
68 elm_clock_time_set(obj, hrs, param->i, sec);
69 return EINA_TRUE;
70 }
71 }
72 else if (!strcmp(param->name, "seconds"))
73 {
74 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
75 {
76 int hrs, min, sec;
77 elm_clock_time_get(obj, &hrs, &min, &sec);
78 elm_clock_time_set(obj, hrs, min, param->i);
79 return EINA_TRUE;
80 }
81 }
82 else if (!strcmp(param->name, "editable"))
83 {
84 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
85 {
86 elm_clock_edit_set(obj, param->i);
87 return EINA_TRUE;
88 }
89 }
90 else if (!strcmp(param->name, "am/pm"))
91 {
92 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
93 {
94 elm_clock_show_am_pm_set(obj, param->i);
95 return EINA_TRUE;
96 }
97 }
98 else if (!strcmp(param->name, "show seconds"))
99 {
100 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
101 {
102 elm_clock_show_seconds_set(obj, param->i);
103 return EINA_TRUE;
104 }
105 }
106
107 ERR("unknown parameter '%s' of type '%s'",
108 param->name, edje_external_param_type_str(param->type));
109
110 return EINA_FALSE;
111}
112
113static Eina_Bool
114external_clock_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
115 Edje_External_Param *param)
116{
117 if (!strcmp(param->name, "hours"))
118 {
119 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
120 {
121 int hrs, min, sec;
122 elm_clock_time_get(obj, &hrs, &min, &sec);
123 param->i = hrs;
124 return EINA_TRUE;
125 }
126 }
127 else if (!strcmp(param->name, "minutes"))
128 {
129 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
130 {
131 int hrs, min, sec;
132 elm_clock_time_get(obj, &hrs, &min, &sec);
133 param->i = min;
134 return EINA_TRUE;
135 }
136 }
137 else if (!strcmp(param->name, "seconds"))
138 {
139 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
140 {
141 int hrs, min, sec;
142 elm_clock_time_get(obj, &hrs, &min, &sec);
143 param->i = sec;
144 return EINA_TRUE;
145 }
146 }
147 else if (!strcmp(param->name, "editable"))
148 {
149 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
150 {
151 param->i = elm_clock_edit_get(obj);
152 return EINA_TRUE;
153 }
154 }
155 else if (!strcmp(param->name, "am/pm"))
156 {
157 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
158 {
159 param->i = elm_clock_show_am_pm_get(obj);
160 return EINA_TRUE;
161 }
162 }
163 else if (!strcmp(param->name, "show seconds"))
164 {
165 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
166 {
167 param->i = elm_clock_show_seconds_get(obj);
168 return EINA_TRUE;
169 }
170 }
171
172 ERR("unknown parameter '%s' of type '%s'",
173 param->name, edje_external_param_type_str(param->type));
174
175 return EINA_FALSE;
176}
177
178static void *
179external_clock_params_parse(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
180 const Eina_List *params)
181{
182 Elm_Params_Clock *mem;
183 Edje_External_Param *param;
184 const Eina_List *l;
185
186 mem = calloc(1, sizeof(Elm_Params_Clock));
187 if (!mem)
188 return NULL;
189
190 EINA_LIST_FOREACH(params, l, param)
191 {
192 if (!strcmp(param->name, "hours"))
193 {
194 mem->hrs = param->i;
195 mem->hrs_exists = EINA_TRUE;
196 }
197 else if (!strcmp(param->name, "minutes"))
198 {
199 mem->min = param->i;
200 mem->min_exists = EINA_TRUE;
201 }
202 else if (!strcmp(param->name, "seconds"))
203 {
204 mem->sec = param->i;
205 mem->sec_exists = EINA_TRUE;
206 }
207 else if (!strcmp(param->name, "editable"))
208 mem->edit = !!param->i;
209 else if (!strcmp(param->name, "am/pm"))
210 mem->ampm = !!param->i;
211 else if (!strcmp(param->name, "show seconds"))
212 mem->seconds = !!param->i;
213 }
214
215 return mem;
216}
217
218static Evas_Object *external_clock_content_get(void *data EINA_UNUSED,
219 const Evas_Object *obj EINA_UNUSED, const char *content EINA_UNUSED)
220{
221 ERR("No content.");
222 return NULL;
223}
224
225static void
226external_clock_params_free(void *params)
227{
228 Elm_Params_Clock *mem = params;
229
230 free(mem);
231}
232
233static Edje_External_Param_Info external_clock_params[] = {
234 DEFINE_EXTERNAL_COMMON_PARAMS,
235 EDJE_EXTERNAL_PARAM_INFO_INT("hours"),
236 EDJE_EXTERNAL_PARAM_INFO_INT("minutes"),
237 EDJE_EXTERNAL_PARAM_INFO_INT("seconds"),
238 EDJE_EXTERNAL_PARAM_INFO_BOOL("editable"),
239 EDJE_EXTERNAL_PARAM_INFO_BOOL("am/pm"),
240 EDJE_EXTERNAL_PARAM_INFO_BOOL("show seconds"),
241 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
242};
243
244DEFINE_EXTERNAL_ICON_ADD(clock, "clock");
245DEFINE_EXTERNAL_TYPE_SIMPLE(clock, "Clock");
diff --git a/src/edje_external/elementary/elm_entry.c b/src/edje_external/elementary/elm_entry.c
new file mode 100644
index 0000000..51f3c08
--- /dev/null
+++ b/src/edje_external/elementary/elm_entry.c
@@ -0,0 +1,380 @@
1#include <assert.h>
2#include "private.h"
3
4typedef struct _Elm_Params_Entry
5{
6 Elm_Params base;
7 const char *label;
8 const char *entry;
9 Evas_Object *icon;
10 Eina_Bool scrollable:1;
11 Eina_Bool scrollable_exists:1;
12 Eina_Bool single_line:1;
13 Eina_Bool single_line_exists:1;
14 Eina_Bool password:1;
15 Eina_Bool password_exists:1;
16 Eina_Bool horizontal_bounce:1;
17 Eina_Bool horizontal_bounce_exists:1;
18 Eina_Bool vertical_bounce:1;
19 Eina_Bool vertical_bounce_exists:1;
20 Eina_Bool editable:1;
21 Eina_Bool editable_exists:1;
22 const char *line_wrap;
23} Elm_Params_Entry;
24
25#define CHOICE_GET(CHOICES, STR) \
26 unsigned int i; \
27 for (i = 0; i < sizeof(CHOICES)/sizeof (CHOICES)[0]; i++) \
28 if (strcmp((STR), (CHOICES)[i]) == 0) \
29 return i
30
31static const char *entry_line_wrap_choices[] =
32{
33 "none", "char", "word", "mixed", NULL
34};
35
36static Elm_Wrap_Type
37_entry_line_wrap_choices_setting_get(const char *line_wrap_str)
38{
39 assert(sizeof(entry_line_wrap_choices)/
40 sizeof(entry_line_wrap_choices[0]) == ELM_WRAP_LAST + 1);
41 CHOICE_GET(entry_line_wrap_choices, line_wrap_str);
42 return ELM_WRAP_LAST;
43}
44
45static void
46external_entry_state_set(void *data EINA_UNUSED, Evas_Object *obj,
47 const void *from_params, const void *to_params,
48 float pos EINA_UNUSED)
49{
50 const Elm_Params_Entry *p;
51 Eina_Bool hbounce, vbounce;
52 Elm_Wrap_Type line_wrap;
53
54 if (to_params) p = to_params;
55 else if (from_params) p = from_params;
56 else return;
57
58 if (p->label)
59 elm_object_text_set(obj, p->label);
60 if (p->entry)
61 elm_object_text_set(obj, p->entry);
62 if (p->scrollable_exists)
63 elm_entry_scrollable_set(obj, p->scrollable);
64 if (p->single_line_exists)
65 elm_entry_single_line_set(obj, p->single_line);
66 if (p->password_exists)
67 elm_entry_password_set(obj, p->password);
68 if (p->horizontal_bounce_exists && p->vertical_bounce_exists)
69 elm_scroller_bounce_set(obj, p->horizontal_bounce, p->vertical_bounce);
70 else if (p->horizontal_bounce_exists || p->vertical_bounce_exists)
71 {
72 elm_scroller_bounce_get(obj, &hbounce, &vbounce);
73 if (p->horizontal_bounce_exists)
74 elm_scroller_bounce_set(obj, p->horizontal_bounce, vbounce);
75 else
76 elm_scroller_bounce_set(obj, hbounce, p->vertical_bounce);
77 }
78 if (p->editable_exists)
79 elm_entry_editable_set(obj, p->editable);
80 if (p->line_wrap)
81 {
82 line_wrap = _entry_line_wrap_choices_setting_get(p->line_wrap);
83 elm_entry_line_wrap_set(obj, line_wrap);
84 }
85 if (p->icon)
86 elm_object_part_content_set(obj, "icon", p->icon);
87}
88
89static Eina_Bool
90external_entry_param_set(void *data EINA_UNUSED, Evas_Object *obj,
91 const Edje_External_Param *param)
92{
93 if (!strcmp(param->name, "label"))
94 {
95 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
96 {
97 elm_object_text_set(obj, param->s);
98 return EINA_TRUE;
99 }
100 }
101 else if (!strcmp(param->name, "icon"))
102 {
103 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
104 {
105 Evas_Object *icon = external_common_param_icon_get(obj, param);
106 elm_object_part_content_set(obj, "icon", icon);
107 return EINA_TRUE;
108 }
109 }
110 else if (!strcmp(param->name, "entry"))
111 {
112 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
113 {
114 elm_object_text_set(obj, param->s);
115 return EINA_TRUE;
116 }
117 }
118 else if (!strcmp(param->name, "scrollable"))
119 {
120 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
121 {
122 elm_entry_scrollable_set(obj, param->i);
123 return EINA_TRUE;
124 }
125 }
126 else if (!strcmp(param->name, "single line"))
127 {
128 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
129 {
130 elm_entry_single_line_set(obj, param->i);
131 return EINA_TRUE;
132 }
133 }
134 else if (!strcmp(param->name, "password"))
135 {
136 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
137 {
138 elm_entry_password_set(obj, param->i);
139 return EINA_TRUE;
140 }
141 }
142 else if (!strcmp(param->name, "horizontal bounce"))
143 {
144 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
145 {
146 Eina_Bool hbounce, vbounce;
147 elm_scroller_bounce_get(obj, NULL, &vbounce);
148 hbounce = !!param->i;
149 elm_scroller_bounce_set(obj, hbounce, vbounce);
150 return EINA_TRUE;
151 }
152 }
153 else if (!strcmp(param->name, "vertical bounce"))
154 {
155 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
156 {
157 Eina_Bool hbounce, vbounce;
158 elm_scroller_bounce_get(obj, &hbounce, NULL);
159 vbounce = !!param->i;
160 elm_scroller_bounce_set(obj, hbounce, vbounce);
161 return EINA_TRUE;
162 }
163 }
164 else if (!strcmp(param->name, "editable"))
165 {
166 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
167 {
168 elm_entry_editable_set(obj, param->i);
169 return EINA_TRUE;
170 }
171 }
172 else if (!strcmp(param->name, "line wrap"))
173 {
174 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
175 {
176 Elm_Wrap_Type line_wrap;
177 line_wrap = _entry_line_wrap_choices_setting_get(param->s);
178 if (line_wrap == ELM_WRAP_LAST) return EINA_FALSE;
179 elm_entry_line_wrap_set(obj, line_wrap);
180 return EINA_TRUE;
181 }
182 }
183
184 ERR("unknown parameter '%s' of type '%s'",
185 param->name, edje_external_param_type_str(param->type));
186
187 return EINA_FALSE;
188}
189
190static Eina_Bool
191external_entry_param_get(void *data EINA_UNUSED, const Evas_Object *obj, Edje_External_Param *param)
192{
193 if (!strcmp(param->name, "label"))
194 {
195 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
196 {
197 param->s = elm_object_text_get(obj);
198 return EINA_TRUE;
199 }
200 }
201 else if (!strcmp(param->name, "icon"))
202 {
203 /* not easy to get icon name back from live object */
204 return EINA_FALSE;
205 }
206 else if (!strcmp(param->name, "entry"))
207 {
208 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
209 {
210 param->s = elm_object_text_get(obj);
211 return EINA_TRUE;
212 }
213 }
214 else if (!strcmp(param->name, "scrollable"))
215 {
216 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
217 {
218 param->i = elm_entry_scrollable_get(obj);
219 return EINA_TRUE;
220 }
221 }
222 else if (!strcmp(param->name, "single line"))
223 {
224 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
225 {
226 param->i = elm_entry_single_line_get(obj);
227 return EINA_TRUE;
228 }
229 }
230 else if (!strcmp(param->name, "password"))
231 {
232 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
233 {
234 param->i = elm_entry_password_get(obj);
235 return EINA_TRUE;
236 }
237 }
238 else if (!strcmp(param->name, "horizontal bounce"))
239 {
240 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
241 {
242 Eina_Bool hbounce;
243 elm_scroller_bounce_get(obj, &hbounce, NULL);
244 param->i = hbounce;
245 return EINA_TRUE;
246 }
247 }
248 else if (!strcmp(param->name, "vertical bounce"))
249 {
250 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
251 {
252 Eina_Bool vbounce;
253 elm_scroller_bounce_get(obj, NULL, &vbounce);
254 param->i = vbounce;
255 return EINA_TRUE;
256 }
257 }
258 else if (!strcmp(param->name, "editable"))
259 {
260 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
261 {
262 param->i = elm_entry_editable_get(obj);
263 return EINA_TRUE;
264 }
265 }
266 else if (!strcmp(param->name, "line wrap"))
267 {
268 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
269 {
270 Elm_Wrap_Type line_wrap;
271 line_wrap = elm_entry_line_wrap_get(obj);
272 param->s = entry_line_wrap_choices[line_wrap];
273 return EINA_TRUE;
274 }
275 }
276
277 ERR("unknown parameter '%s' of type '%s'",
278 param->name, edje_external_param_type_str(param->type));
279
280 return EINA_FALSE;
281}
282
283static void *
284external_entry_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
285 const Eina_List *params)
286{
287 Elm_Params_Entry *mem;
288 Edje_External_Param *param;
289 const Eina_List *l;
290
291 mem = ELM_NEW(Elm_Params_Entry);
292 if (!mem)
293 return NULL;
294
295 external_common_icon_param_parse(&mem->icon, obj, params);
296
297 EINA_LIST_FOREACH(params, l, param)
298 {
299 if (!strcmp(param->name, "label"))
300 {
301 mem->label = eina_stringshare_add(param->s);
302 }
303 else if (!strcmp(param->name, "entry"))
304 {
305 mem->entry = eina_stringshare_add(param->s);
306 }
307 else if (!strcmp(param->name, "scrollable"))
308 {
309 mem->scrollable = !!param->i;
310 mem->scrollable_exists = EINA_TRUE;
311 }
312 else if (!strcmp(param->name, "single line"))
313 {
314 mem->single_line = !!param->i;
315 mem->single_line_exists = EINA_TRUE;
316 }
317 else if (!strcmp(param->name, "password"))
318 {
319 mem->password = !!param->i;
320 mem->password_exists = EINA_TRUE;
321 }
322 else if (!strcmp(param->name, "horizontal bounce"))
323 {
324 mem->horizontal_bounce = !!param->i;
325 mem->horizontal_bounce_exists = EINA_TRUE;
326 }
327 else if (!strcmp(param->name, "vertical bounce"))
328 {
329 mem->vertical_bounce = !!param->i;
330 mem->vertical_bounce_exists = EINA_TRUE;
331 }
332 else if (!strcmp(param->name, "editable"))
333 {
334 mem->editable = !!param->i;
335 mem->editable_exists = EINA_TRUE;
336 }
337 else if (!strcmp(param->name, "line wrap"))
338 mem->line_wrap = eina_stringshare_add(param->s);
339 }
340
341 return mem;
342}
343
344static Evas_Object *external_entry_content_get(void *data EINA_UNUSED,
345 const Evas_Object *obj EINA_UNUSED, const char *content EINA_UNUSED)
346{
347 ERR("No content.");
348 return NULL;
349}
350
351static void
352external_entry_params_free(void *params)
353{
354 Elm_Params_Entry *mem = params;
355 if (mem->label)
356 eina_stringshare_del(mem->label);
357 if (mem->entry)
358 eina_stringshare_del(mem->entry);
359 if (mem->line_wrap)
360 eina_stringshare_del(mem->line_wrap);
361 free(params);
362}
363
364static Edje_External_Param_Info external_entry_params[] = {
365 DEFINE_EXTERNAL_COMMON_PARAMS,
366 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
367 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
368 EDJE_EXTERNAL_PARAM_INFO_STRING("entry"),
369 EDJE_EXTERNAL_PARAM_INFO_BOOL("scrollable"),
370 EDJE_EXTERNAL_PARAM_INFO_BOOL("single line"),
371 EDJE_EXTERNAL_PARAM_INFO_BOOL("password"),
372 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal bounce"),
373 EDJE_EXTERNAL_PARAM_INFO_BOOL("vertical bounce"),
374 EDJE_EXTERNAL_PARAM_INFO_BOOL("editable"),
375 EDJE_EXTERNAL_PARAM_INFO_STRING("line_wrap"),
376 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
377};
378
379DEFINE_EXTERNAL_ICON_ADD(entry, "entry");
380DEFINE_EXTERNAL_TYPE_SIMPLE(entry, "Entry");
diff --git a/src/edje_external/elementary/elm_fileselector.c b/src/edje_external/elementary/elm_fileselector.c
new file mode 100644
index 0000000..6884fd1
--- /dev/null
+++ b/src/edje_external/elementary/elm_fileselector.c
@@ -0,0 +1,188 @@
1#include <assert.h>
2#include "private.h"
3
4typedef struct _Elm_Params_Fileselector
5{
6 Elm_Params base;
7 Eina_Bool is_save:1;
8 Eina_Bool is_save_set:1;
9 Eina_Bool folder_only:1;
10 Eina_Bool folder_only_set:1;
11 Eina_Bool show_buttons:1;
12 Eina_Bool show_buttons_set:1;
13 Eina_Bool expandable:1;
14 Eina_Bool expandable_set:1;
15} Elm_Params_Fileselector;
16
17static void
18external_fileselector_state_set(void *data EINA_UNUSED, Evas_Object *obj,
19 const void *from_params, const void *to_params,
20 float pos EINA_UNUSED)
21{
22 const Elm_Params_Fileselector *p;
23
24 if (to_params) p = to_params;
25 else if (from_params) p = from_params;
26 else return;
27
28 if ((p->is_save_set) && (p->is_save))
29 elm_fileselector_is_save_set(obj, p->is_save);
30 if (p->folder_only_set)
31 elm_fileselector_folder_only_set(obj, p->folder_only);
32 if (p->show_buttons_set)
33 elm_fileselector_buttons_ok_cancel_set(obj, p->show_buttons);
34 if (p->expandable_set)
35 elm_fileselector_expandable_set(obj, p->expandable);
36}
37
38static Eina_Bool
39external_fileselector_param_set(void *data EINA_UNUSED, Evas_Object *obj,
40 const Edje_External_Param *param)
41{
42 if (!strcmp(param->name, "save"))
43 {
44 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
45 {
46 elm_fileselector_is_save_set(obj, param->i);
47 return EINA_TRUE;
48 }
49 }
50 else if (!strcmp(param->name, "folder only"))
51 {
52 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
53 {
54 elm_fileselector_folder_only_set(obj, param->i);
55 return EINA_TRUE;
56 }
57 }
58 else if (!strcmp(param->name, "show buttons"))
59 {
60 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
61 {
62 elm_fileselector_buttons_ok_cancel_set(obj, param->i);
63 return EINA_TRUE;
64 }
65 }
66 else if (!strcmp(param->name, "expandable"))
67 {
68 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
69 {
70 elm_fileselector_expandable_set(obj, param->i);
71 return EINA_TRUE;
72 }
73 }
74
75 ERR("unknown parameter '%s' of type '%s'",
76 param->name, edje_external_param_type_str(param->type));
77
78 return EINA_FALSE;
79}
80
81static Eina_Bool
82external_fileselector_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
83 Edje_External_Param *param)
84{
85 if (!strcmp(param->name, "save"))
86 {
87 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
88 {
89 param->i = elm_fileselector_is_save_get(obj);
90 return EINA_TRUE;
91 }
92 }
93 else if (!strcmp(param->name, "folder only"))
94 {
95 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
96 {
97 param->i = elm_fileselector_folder_only_get(obj);
98 return EINA_TRUE;
99 }
100 }
101 else if (!strcmp(param->name, "show buttons"))
102 {
103 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
104 {
105 param->i = elm_fileselector_buttons_ok_cancel_get(obj);
106 return EINA_TRUE;
107 }
108 }
109 else if (!strcmp(param->name, "expandable"))
110 {
111 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
112 {
113 param->i = elm_fileselector_expandable_get(obj);
114 return EINA_TRUE;
115 }
116 }
117
118 ERR("unknown parameter '%s' of type '%s'",
119 param->name, edje_external_param_type_str(param->type));
120
121 return EINA_FALSE;
122}
123
124static void *
125external_fileselector_params_parse(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const Eina_List *params)
126{
127 Elm_Params_Fileselector *mem;
128 Edje_External_Param *param;
129 const Eina_List *l;
130
131 mem = calloc(1, sizeof(Elm_Params_Fileselector));
132 if (!mem)
133 return NULL;
134
135 EINA_LIST_FOREACH(params, l, param)
136 {
137 if (!strcmp(param->name, "save"))
138 {
139 mem->is_save = !!param->i;
140 mem->is_save_set = EINA_TRUE;
141 }
142 else if (!strcmp(param->name, "folder only"))
143 {
144 mem->folder_only = !!param->i;
145 mem->folder_only_set = EINA_TRUE;
146 }
147 else if (!strcmp(param->name, "show buttons"))
148 {
149 mem->show_buttons = !!param->i;
150 mem->show_buttons_set = EINA_TRUE;
151 }
152 else if (!strcmp(param->name, "expandable"))
153 {
154 mem->expandable = !!param->i;
155 mem->expandable_set = EINA_TRUE;
156 }
157 }
158
159 return mem;
160}
161
162static Evas_Object *external_fileselector_content_get(void *data EINA_UNUSED,
163 const Evas_Object *obj EINA_UNUSED,
164 const char *content EINA_UNUSED)
165{
166 ERR("No content.");
167 return NULL;
168}
169
170static void
171external_fileselector_params_free(void *params)
172{
173 Elm_Params_Fileselector *mem = params;
174 free(mem);
175}
176
177static Edje_External_Param_Info external_fileselector_params[] =
178{
179 DEFINE_EXTERNAL_COMMON_PARAMS,
180 EDJE_EXTERNAL_PARAM_INFO_BOOL("save"),
181 EDJE_EXTERNAL_PARAM_INFO_BOOL("folder only"),
182 EDJE_EXTERNAL_PARAM_INFO_BOOL("show buttons"),
183 EDJE_EXTERNAL_PARAM_INFO_BOOL("expandable"),
184 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
185};
186
187DEFINE_EXTERNAL_ICON_ADD(fileselector, "fileselector");
188DEFINE_EXTERNAL_TYPE_SIMPLE(fileselector, "Fileselector");
diff --git a/src/edje_external/elementary/elm_fileselector_button.c b/src/edje_external/elementary/elm_fileselector_button.c
new file mode 100644
index 0000000..4826ebb
--- /dev/null
+++ b/src/edje_external/elementary/elm_fileselector_button.c
@@ -0,0 +1,261 @@
1#include "private.h"
2
3typedef struct _Elm_Params_fileselector_button
4{
5 Elm_Params base;
6 const char *label;
7 Evas_Object *icon;
8
9 struct {
10 const char *path;
11 Eina_Bool is_save:1;
12 Eina_Bool is_save_set:1;
13 Eina_Bool folder_only:1;
14 Eina_Bool folder_only_set:1;
15 Eina_Bool expandable:1;
16 Eina_Bool expandable_set:1;
17 Eina_Bool inwin_mode:1;
18 Eina_Bool inwin_mode_set:1;
19 } fs;
20} Elm_Params_fileselector_button;
21
22static void
23external_fileselector_button_state_set(void *data EINA_UNUSED, Evas_Object *obj,
24 const void *from_params,
25 const void *to_params,
26 float pos EINA_UNUSED)
27{
28 const Elm_Params_fileselector_button *p;
29
30 if (to_params) p = to_params;
31 else if (from_params) p = from_params;
32 else return;
33
34 if (p->label)
35 elm_object_text_set(obj, p->label);
36 if (p->icon) elm_object_part_content_set(obj, "icon", p->icon);
37 if (p->fs.path) elm_fileselector_path_set(obj, p->fs.path);
38 if (p->fs.is_save_set)
39 elm_fileselector_is_save_set(obj, p->fs.is_save);
40 if (p->fs.folder_only_set)
41 elm_fileselector_folder_only_set(obj, p->fs.folder_only);
42 if (p->fs.expandable_set)
43 elm_fileselector_expandable_set(obj, p->fs.expandable);
44 if (p->fs.inwin_mode_set)
45 elm_fileselector_button_inwin_mode_set(obj, p->fs.inwin_mode);
46}
47
48static Eina_Bool
49external_fileselector_button_param_set(void *data EINA_UNUSED, Evas_Object *obj,
50 const Edje_External_Param *param)
51{
52 if (!strcmp(param->name, "label"))
53 {
54 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
55 {
56 elm_object_text_set(obj, param->s);
57 return EINA_TRUE;
58 }
59 }
60 else if (!strcmp(param->name, "icon"))
61 {
62 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
63 {
64 Evas_Object *icon = external_common_param_icon_get(obj, param);
65 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
66 elm_object_part_content_set(obj, "icon", icon);
67 return EINA_TRUE;
68 }
69 }
70 else if (!strcmp(param->name, "path"))
71 {
72 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
73 {
74 elm_fileselector_path_set(obj, param->s);
75 return EINA_TRUE;
76 }
77 }
78 else if (!strcmp(param->name, "save"))
79 {
80 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
81 {
82 elm_fileselector_is_save_set(obj, param->i);
83 return EINA_TRUE;
84 }
85 }
86 else if (!strcmp(param->name, "folder only"))
87 {
88 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
89 {
90 elm_fileselector_folder_only_set(obj, param->i);
91 return EINA_TRUE;
92 }
93 }
94 else if (!strcmp(param->name, "expandable"))
95 {
96 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
97 {
98 elm_fileselector_expandable_set(obj, param->i);
99 return EINA_TRUE;
100 }
101 }
102 else if (!strcmp(param->name, "inwin mode"))
103 {
104 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
105 {
106 elm_fileselector_button_inwin_mode_set(obj, param->i);
107 return EINA_TRUE;
108 }
109 }
110
111 ERR("unknown parameter '%s' of type '%s'",
112 param->name, edje_external_param_type_str(param->type));
113
114 return EINA_FALSE;
115}
116
117static Eina_Bool
118external_fileselector_button_param_get(void *data EINA_UNUSED,
119 const Evas_Object *obj,
120 Edje_External_Param *param)
121{
122 if (!strcmp(param->name, "label"))
123 {
124 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
125 {
126 param->s = elm_object_text_get(obj);
127 return EINA_TRUE;
128 }
129 }
130 else if (!strcmp(param->name, "icon"))
131 {
132 /* not easy to get icon name back from live object */
133 return EINA_FALSE;
134 }
135 else if (!strcmp(param->name, "path"))
136 {
137 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
138 {
139 param->s = elm_fileselector_path_get(obj);
140 return EINA_TRUE;
141 }
142 }
143 else if (!strcmp(param->name, "save"))
144 {
145 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
146 {
147 param->i = elm_fileselector_is_save_get(obj);
148 return EINA_TRUE;
149 }
150 }
151 else if (!strcmp(param->name, "folder only"))
152 {
153 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
154 {
155 param->i = elm_fileselector_folder_only_get(obj);
156 return EINA_TRUE;
157 }
158 }
159 else if (!strcmp(param->name, "expandable"))
160 {
161 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
162 {
163 param->i = elm_fileselector_expandable_get(obj);
164 return EINA_TRUE;
165 }
166 }
167 else if (!strcmp(param->name, "inwin mode"))
168 {
169 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
170 {
171 param->i = elm_fileselector_button_inwin_mode_get(obj);
172 return EINA_TRUE;
173 }
174 }
175
176 ERR("unknown parameter '%s' of type '%s'",
177 param->name, edje_external_param_type_str(param->type));
178
179 return EINA_FALSE;
180}
181
182static void *
183external_fileselector_button_params_parse(void *data EINA_UNUSED,
184 Evas_Object *obj,
185 const Eina_List *params)
186{
187 Elm_Params_fileselector_button *mem;
188 Edje_External_Param *param;
189 const Eina_List *l;
190
191 mem = calloc(1, sizeof(Elm_Params_fileselector_button));
192 if (!mem)
193 return NULL;
194
195 external_common_icon_param_parse(&mem->icon, obj, params);
196
197 EINA_LIST_FOREACH(params, l, param)
198 {
199 if (!strcmp(param->name, "path"))
200 mem->fs.path = eina_stringshare_add(param->s);
201 else if (!strcmp(param->name, "save"))
202 {
203 mem->fs.is_save = !!param->i;
204 mem->fs.is_save_set = EINA_TRUE;
205 }
206 else if (!strcmp(param->name, "folder only"))
207 {
208 mem->fs.folder_only = !!param->i;
209 mem->fs.folder_only_set = EINA_TRUE;
210 }
211 else if (!strcmp(param->name, "expandable"))
212 {
213 mem->fs.expandable = !!param->i;
214 mem->fs.expandable_set = EINA_TRUE;
215 }
216 else if (!strcmp(param->name, "inwin mode"))
217 {
218 mem->fs.inwin_mode = !!param->i;
219 mem->fs.inwin_mode_set = EINA_TRUE;
220 }
221 else if (!strcmp(param->name, "label"))
222 mem->label = eina_stringshare_add(param->s);
223 }
224
225 return mem;
226}
227
228static Evas_Object *external_fileselector_button_content_get(void *data EINA_UNUSED,
229 const Evas_Object *obj EINA_UNUSED,
230 const char *content EINA_UNUSED)
231{
232 ERR("No content.");
233 return NULL;
234}
235
236 static void
237external_fileselector_button_params_free(void *params)
238{
239 Elm_Params_fileselector_button *mem = params;
240
241 if (mem->fs.path)
242 eina_stringshare_del(mem->fs.path);
243 if (mem->label)
244 eina_stringshare_del(mem->label);
245 free(params);
246}
247
248static Edje_External_Param_Info external_fileselector_button_params[] = {
249 DEFINE_EXTERNAL_COMMON_PARAMS,
250 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
251 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
252 EDJE_EXTERNAL_PARAM_INFO_STRING("path"),
253 EDJE_EXTERNAL_PARAM_INFO_BOOL("save"),
254 EDJE_EXTERNAL_PARAM_INFO_BOOL("folder only"),
255 EDJE_EXTERNAL_PARAM_INFO_BOOL("expandable"),
256 EDJE_EXTERNAL_PARAM_INFO_BOOL("inwin mode"),
257 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
258};
259
260DEFINE_EXTERNAL_ICON_ADD(fileselector_button, "fileselector_button");
261DEFINE_EXTERNAL_TYPE_SIMPLE(fileselector_button, "File Selector Button");
diff --git a/src/edje_external/elementary/elm_fileselector_entry.c b/src/edje_external/elementary/elm_fileselector_entry.c
new file mode 100644
index 0000000..2f36fe6
--- /dev/null
+++ b/src/edje_external/elementary/elm_fileselector_entry.c
@@ -0,0 +1,261 @@
1#include "private.h"
2
3typedef struct _Elm_Params_fileselector_entry
4{
5 Elm_Params base;
6 const char *label;
7 Evas_Object *icon;
8
9 struct {
10 const char *path;
11 Eina_Bool is_save:1;
12 Eina_Bool is_save_set:1;
13 Eina_Bool folder_only:1;
14 Eina_Bool folder_only_set:1;
15 Eina_Bool expandable:1;
16 Eina_Bool expandable_set:1;
17 Eina_Bool inwin_mode:1;
18 Eina_Bool inwin_mode_set:1;
19 } fs;
20} Elm_Params_fileselector_entry;
21
22static void
23external_fileselector_entry_state_set(void *data EINA_UNUSED, Evas_Object *obj,
24 const void *from_params,
25 const void *to_params,
26 float pos EINA_UNUSED)
27{
28 const Elm_Params_fileselector_entry *p;
29
30 if (to_params) p = to_params;
31 else if (from_params) p = from_params;
32 else return;
33
34 if (p->label)
35 elm_object_text_set(obj, p->label);
36 if (p->icon) elm_object_part_content_set(obj, "button icon", p->icon);
37 if (p->fs.path) elm_fileselector_selected_set(obj, p->fs.path);
38 if (p->fs.is_save_set)
39 elm_fileselector_is_save_set(obj, p->fs.is_save);
40 if (p->fs.folder_only_set)
41 elm_fileselector_folder_only_set(obj, p->fs.folder_only);
42 if (p->fs.expandable_set)
43 elm_fileselector_expandable_set(obj, p->fs.expandable);
44 if (p->fs.inwin_mode_set)
45 elm_fileselector_entry_inwin_mode_set(obj, p->fs.inwin_mode);
46}
47
48static Eina_Bool
49external_fileselector_entry_param_set(void *data EINA_UNUSED, Evas_Object *obj,
50 const Edje_External_Param *param)
51{
52 if (!strcmp(param->name, "label"))
53 {
54 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
55 {
56 elm_object_text_set(obj, param->s);
57 return EINA_TRUE;
58 }
59 }
60 else if (!strcmp(param->name, "icon"))
61 {
62 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
63 {
64 Evas_Object *icon = external_common_param_icon_get(obj, param);
65 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
66 elm_object_part_content_set(obj, "button icon", icon);
67 return EINA_TRUE;
68 }
69 }
70 else if (!strcmp(param->name, "path"))
71 {
72 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
73 {
74 elm_fileselector_selected_set(obj, param->s);
75 return EINA_TRUE;
76 }
77 }
78 else if (!strcmp(param->name, "save"))
79 {
80 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
81 {
82 elm_fileselector_is_save_set(obj, param->i);
83 return EINA_TRUE;
84 }
85 }
86 else if (!strcmp(param->name, "folder only"))
87 {
88 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
89 {
90 elm_fileselector_folder_only_set(obj, param->i);
91 return EINA_TRUE;
92 }
93 }
94 else if (!strcmp(param->name, "expandable"))
95 {
96 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
97 {
98 elm_fileselector_expandable_set(obj, param->i);
99 return EINA_TRUE;
100 }
101 }
102 else if (!strcmp(param->name, "inwin mode"))
103 {
104 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
105 {
106 elm_fileselector_entry_inwin_mode_set(obj, param->i);
107 return EINA_TRUE;
108 }
109 }
110
111 ERR("unknown parameter '%s' of type '%s'",
112 param->name, edje_external_param_type_str(param->type));
113
114 return EINA_FALSE;
115}
116
117static Eina_Bool
118external_fileselector_entry_param_get(void *data EINA_UNUSED,
119 const Evas_Object *obj,
120 Edje_External_Param *param)
121{
122 if (!strcmp(param->name, "label"))
123 {
124 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
125 {
126 param->s = elm_object_text_get(obj);
127 return EINA_TRUE;
128 }
129 }
130 else if (!strcmp(param->name, "icon"))
131 {
132 /* not easy to get icon name back from live object */
133 return EINA_FALSE;
134 }
135 else if (!strcmp(param->name, "path"))
136 {
137 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
138 {
139 param->s = elm_fileselector_selected_get(obj);
140 return EINA_TRUE;
141 }
142 }
143 else if (!strcmp(param->name, "save"))
144 {
145 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
146 {
147 param->i = elm_fileselector_is_save_get(obj);
148 return EINA_TRUE;
149 }
150 }
151 else if (!strcmp(param->name, "folder only"))
152 {
153 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
154 {
155 param->i = elm_fileselector_folder_only_get(obj);
156 return EINA_TRUE;
157 }
158 }
159 else if (!strcmp(param->name, "expandable"))
160 {
161 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
162 {
163 param->i = elm_fileselector_expandable_get(obj);
164 return EINA_TRUE;
165 }
166 }
167 else if (!strcmp(param->name, "inwin mode"))
168 {
169 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
170 {
171 param->i = elm_fileselector_entry_inwin_mode_get(obj);
172 return EINA_TRUE;
173 }
174 }
175
176 ERR("unknown parameter '%s' of type '%s'",
177 param->name, edje_external_param_type_str(param->type));
178
179 return EINA_FALSE;
180}
181
182static void *
183external_fileselector_entry_params_parse(void *data EINA_UNUSED,
184 Evas_Object *obj,
185 const Eina_List *params)
186{
187 Elm_Params_fileselector_entry *mem;
188 Edje_External_Param *param;
189 const Eina_List *l;
190
191 mem = calloc(1, sizeof(Elm_Params_fileselector_entry));
192 if (!mem)
193 return NULL;
194
195 external_common_icon_param_parse(&mem->icon, obj, params);
196
197 EINA_LIST_FOREACH(params, l, param)
198 {
199 if (!strcmp(param->name, "path"))
200 mem->fs.path = eina_stringshare_add(param->s);
201 else if (!strcmp(param->name, "save"))
202 {
203 mem->fs.is_save = !!param->i;
204 mem->fs.is_save_set = EINA_TRUE;
205 }
206 else if (!strcmp(param->name, "folder only"))
207 {
208 mem->fs.folder_only = !!param->i;
209 mem->fs.folder_only_set = EINA_TRUE;
210 }
211 else if (!strcmp(param->name, "expandable"))
212 {
213 mem->fs.expandable = !!param->i;
214 mem->fs.expandable_set = EINA_TRUE;
215 }
216 else if (!strcmp(param->name, "inwin mode"))
217 {
218 mem->fs.inwin_mode = !!param->i;
219 mem->fs.inwin_mode_set = EINA_TRUE;
220 }
221 else if (!strcmp(param->name, "label"))
222 mem->label = eina_stringshare_add(param->s);
223 }
224
225 return mem;
226}
227
228static Evas_Object *external_fileselector_entry_content_get(void *data EINA_UNUSED,
229 const Evas_Object *obj EINA_UNUSED,
230 const char *content EINA_UNUSED)
231{
232 ERR("No content.");
233 return NULL;
234}
235
236static void
237external_fileselector_entry_params_free(void *params)
238{
239 Elm_Params_fileselector_entry *mem = params;
240
241 if (mem->fs.path)
242 eina_stringshare_del(mem->fs.path);
243 if (mem->label)
244 eina_stringshare_del(mem->label);
245 free(params);
246}
247
248static Edje_External_Param_Info external_fileselector_entry_params[] = {
249 DEFINE_EXTERNAL_COMMON_PARAMS,
250 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
251 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
252 EDJE_EXTERNAL_PARAM_INFO_STRING("path"),
253 EDJE_EXTERNAL_PARAM_INFO_BOOL("save"),
254 EDJE_EXTERNAL_PARAM_INFO_BOOL("folder only"),
255 EDJE_EXTERNAL_PARAM_INFO_BOOL("expandable"),
256 EDJE_EXTERNAL_PARAM_INFO_BOOL("inwin mode"),
257 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
258};
259
260DEFINE_EXTERNAL_ICON_ADD(fileselector_entry, "fileselector_entry");
261DEFINE_EXTERNAL_TYPE_SIMPLE(fileselector_entry, "File Selector Entry");
diff --git a/src/edje_external/elementary/elm_frame.c b/src/edje_external/elementary/elm_frame.c
new file mode 100644
index 0000000..a59bfae
--- /dev/null
+++ b/src/edje_external/elementary/elm_frame.c
@@ -0,0 +1,131 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Frame
4{
5 Elm_Params base;
6 const char *label;
7 Evas_Object *content; /* part name whose obj is to be set as content */
8} Elm_Params_Frame;
9
10static void
11external_frame_state_set(void *data EINA_UNUSED, Evas_Object *obj,
12 const void *from_params, const void *to_params,
13 float pos EINA_UNUSED)
14{
15 const Elm_Params_Frame *p;
16
17 if (to_params) p = to_params;
18 else if (from_params) p = from_params;
19 else return;
20
21 if (p->label) elm_object_text_set(obj, p->label);
22 if (p->content) elm_object_content_set(obj, p->content);
23}
24
25static Eina_Bool
26external_frame_param_set(void *data EINA_UNUSED, Evas_Object *obj,
27 const Edje_External_Param *param)
28{
29 if (!strcmp(param->name, "label"))
30 {
31 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
32 {
33 elm_object_text_set(obj, param->s);
34 return EINA_TRUE;
35 }
36 }
37 else if (!strcmp(param->name, "content"))
38 {
39 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
40 {
41 Evas_Object *content =
42 external_common_param_elm_layout_get(obj,param);
43 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
44 elm_object_content_set(obj, content);
45 return EINA_TRUE;
46 }
47 }
48
49 ERR("unknown parameter '%s' of type '%s'",
50 param->name, edje_external_param_type_str(param->type));
51
52 return EINA_FALSE;
53}
54
55static Eina_Bool
56external_frame_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
57 Edje_External_Param *param)
58{
59 if (!strcmp(param->name, "label"))
60 {
61 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
62 {
63 param->s = elm_object_text_get(obj);
64 return EINA_TRUE;
65 }
66 }
67 else if (!strcmp(param->name, "content"))
68 {
69 /* not easy to get content name back from live object */
70 return EINA_FALSE;
71 }
72
73 ERR("unknown parameter '%s' of type '%s'",
74 param->name, edje_external_param_type_str(param->type));
75
76 return EINA_FALSE;
77}
78
79static void *
80external_frame_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
81 const Eina_List *params)
82{
83 Elm_Params_Frame *mem;
84 Edje_External_Param *param;
85 const Eina_List *l;
86
87 mem = calloc(1, sizeof(Elm_Params_Frame));
88 if (!mem)
89 return NULL;
90
91 EINA_LIST_FOREACH(params, l, param)
92 {
93 if (!strcmp(param->name, "content"))
94 mem->content = external_common_param_elm_layout_get(obj, param);
95 else if (!strcmp(param->name, "label"))
96 mem->label = eina_stringshare_add(param->s);
97 }
98
99 return mem;
100}
101
102static Evas_Object *external_frame_content_get(void *data EINA_UNUSED,
103 const Evas_Object *obj EINA_UNUSED,
104 const char *content EINA_UNUSED)
105{
106 if (!strcmp(content, "content"))
107 return elm_object_content_get(obj);
108
109 ERR("unknown content '%s'", content);
110 return NULL;
111}
112
113static void
114external_frame_params_free(void *params)
115{
116 Elm_Params_Frame *mem = params;
117
118 if (mem->label)
119 eina_stringshare_del(mem->label);
120 free(params);
121}
122
123static Edje_External_Param_Info external_frame_params[] = {
124 DEFINE_EXTERNAL_COMMON_PARAMS,
125 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
126 EDJE_EXTERNAL_PARAM_INFO_STRING("content"),
127 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
128};
129
130DEFINE_EXTERNAL_ICON_ADD(frame, "frame");
131DEFINE_EXTERNAL_TYPE_SIMPLE(frame, "Frame");
diff --git a/src/edje_external/elementary/elm_gengrid.c b/src/edje_external/elementary/elm_gengrid.c
new file mode 100644
index 0000000..7373942
--- /dev/null
+++ b/src/edje_external/elementary/elm_gengrid.c
@@ -0,0 +1,475 @@
1#include <assert.h>
2#include "private.h"
3
4typedef struct _Elm_Params_Gengrid
5{
6 Elm_Params base;
7 Eina_Bool multi : 1;
8 Eina_Bool multi_exists : 1;
9 Eina_Bool no_select : 1;
10 Eina_Bool no_select_exists : 1;
11 Eina_Bool always_select : 1;
12 Eina_Bool always_select_exists : 1;
13 Eina_Bool h_bounce:1;
14 Eina_Bool h_bounce_exists:1;
15 Eina_Bool v_bounce:1;
16 Eina_Bool v_bounce_exists:1;
17 double h_pagerel;
18 Eina_Bool h_pagerel_exists : 1;
19 double v_pagerel;
20 Eina_Bool v_pagerel_exists : 1;
21 int h_itemsize;
22 Eina_Bool h_itemsize_exists : 1;
23 int v_itemsize;
24 Eina_Bool v_itemsize_exists : 1;
25 Eina_Bool horizontal : 1;
26 Eina_Bool horizontal_exists : 1;
27 Eina_Bool align_x_exists;
28 double align_x;
29 Eina_Bool align_y_exists;
30 double align_y;
31} Elm_Params_Gengrid;
32
33static void
34external_gengrid_state_set(void *data EINA_UNUSED, Evas_Object *obj,
35 const void *from_params, const void *to_params,
36 float pos EINA_UNUSED)
37{
38 const Elm_Params_Gengrid *p;
39
40 if (to_params) p = to_params;
41 else if (from_params) p = from_params;
42 else return;
43
44 if (p->multi_exists)
45 elm_gengrid_multi_select_set(obj, p->multi);
46 if (p->no_select_exists)
47 {
48 if (p->no_select)
49 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_NONE);
50 else
51 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
52 }
53 if (p->always_select_exists)
54 {
55 if (p->always_select)
56 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_ALWAYS);
57 else
58 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
59 }
60 if (p->h_bounce_exists)
61 {
62 Eina_Bool h_bounce, v_bounce;
63 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
64 elm_scroller_bounce_set(obj, p->h_bounce, v_bounce);
65 }
66 if (p->v_bounce_exists)
67 {
68 Eina_Bool h_bounce, v_bounce;
69 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
70 elm_scroller_bounce_set(obj, h_bounce, p->v_bounce);
71 }
72 if (p->h_pagerel_exists)
73 {
74 double h_pagerel, v_pagerel;
75 elm_scroller_page_relative_get(obj, &h_pagerel, &v_pagerel);
76 elm_scroller_page_relative_set(obj, h_pagerel, p->v_pagerel);
77 }
78 if (p->v_pagerel_exists)
79 {
80 double h_pagerel, v_pagerel;
81 elm_scroller_page_relative_get(obj, &h_pagerel, &v_pagerel);
82 elm_scroller_page_relative_set(obj, p->h_pagerel, v_pagerel);
83 }
84 if (p->h_itemsize_exists)
85 {
86 int h_itemsize, v_itemsize;
87 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
88 elm_gengrid_item_size_set(obj, h_itemsize, p->v_itemsize);
89 }
90 if (p->v_itemsize_exists)
91 {
92 int h_itemsize, v_itemsize;
93 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
94 elm_gengrid_item_size_set(obj, p->h_itemsize, v_itemsize);
95 }
96 else if (p->align_x_exists || p->align_y_exists)
97 {
98 double x, y;
99 elm_gengrid_align_get(obj, &x, &y);
100 if (p->align_x_exists)
101 elm_gengrid_align_set(obj, p->align_x, y);
102 else
103 elm_gengrid_align_set(obj, x, p->align_y);
104 }
105 if (p->horizontal_exists)
106 {
107 elm_gengrid_horizontal_set(obj, p->horizontal);
108 }
109}
110
111static Eina_Bool
112external_gengrid_param_set(void *data EINA_UNUSED, Evas_Object *obj,
113 const Edje_External_Param *param)
114{
115 if (!strcmp(param->name, "multi select"))
116 {
117 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
118 {
119 elm_gengrid_multi_select_set(obj, param->i);
120 return EINA_TRUE;
121 }
122 }
123 else if (!strcmp(param->name, "no selected"))
124 {
125 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
126 {
127 if (param->i)
128 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_NONE);
129 else
130 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
131 return EINA_TRUE;
132 }
133 }
134 else if (!strcmp(param->name, "always select"))
135 {
136 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
137 {
138 if (param->i)
139 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_ALWAYS);
140 else
141 elm_gengrid_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
142 return EINA_TRUE;
143 }
144 }
145 else if (!strcmp(param->name, "height bounce"))
146 {
147 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
148 {
149 Eina_Bool h_bounce, v_bounce;
150 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
151 elm_scroller_bounce_set(obj, param->i, v_bounce);
152 return EINA_TRUE;
153 }
154 }
155 else if (!strcmp(param->name, "width bounce"))
156 {
157 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
158 {
159 Eina_Bool h_bounce, v_bounce;
160 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
161 elm_scroller_bounce_set(obj, h_bounce, param->i);
162 return EINA_TRUE;
163 }
164 }
165 else if (!strcmp(param->name, "horizontal page relative"))
166 {
167 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
168 {
169 double h_pagerel, v_pagerel;
170 elm_scroller_page_relative_get(obj, &h_pagerel, &v_pagerel);
171 elm_scroller_page_relative_set(obj, param->d, v_pagerel);
172 return EINA_TRUE;
173 }
174 }
175 else if (!strcmp(param->name, "vertical page relative"))
176 {
177 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
178 {
179 double h_pagerel, v_pagerel;
180 elm_scroller_page_relative_get(obj, &h_pagerel, &v_pagerel);
181 elm_scroller_page_relative_set(obj, h_pagerel, param->d);
182 return EINA_TRUE;
183 }
184 }
185 else if (!strcmp(param->name, "horizontal item size"))
186 {
187 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
188 {
189 int h_itemsize, v_itemsize;
190 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
191 elm_gengrid_item_size_set(obj, param->i, v_itemsize);
192 return EINA_TRUE;
193 }
194 }
195 else if (!strcmp(param->name, "vertical item size"))
196 {
197 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
198 {
199 int h_itemsize, v_itemsize;
200 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
201 elm_gengrid_item_size_set(obj, h_itemsize, param->i);
202 return EINA_TRUE;
203 }
204 }
205 else if (!strcmp(param->name, "horizontal"))
206 {
207 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
208 {
209 elm_gengrid_horizontal_set(obj, param->i);
210 return EINA_TRUE;
211 }
212 }
213 else if (!strcmp(param->name, "align x")
214 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
215 {
216 double x, y;
217 elm_gengrid_align_get(obj, &x, &y);
218 elm_gengrid_align_set(obj, param->d, y);
219 return EINA_TRUE;
220 }
221 else if (!strcmp(param->name, "align y")
222 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
223 {
224 double x, y;
225 elm_gengrid_align_get(obj, &x, &y);
226 elm_gengrid_align_set(obj, x, param->d);
227 return EINA_TRUE;
228 }
229 ERR("unknown parameter '%s' of type '%s'",
230 param->name, edje_external_param_type_str(param->type));
231
232 return EINA_FALSE;
233}
234
235static Eina_Bool
236external_gengrid_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
237 Edje_External_Param *param)
238{
239 if (!strcmp(param->name, "multi select"))
240 {
241 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
242 {
243 param->i = elm_gengrid_multi_select_get(obj);
244 return EINA_TRUE;
245 }
246 }
247 else if (!strcmp(param->name, "no selected"))
248 {
249 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
250 {
251 if (elm_gengrid_select_mode_get (obj) ==
252 ELM_OBJECT_SELECT_MODE_NONE)
253 param->i = EINA_TRUE;
254 else
255 param->i = EINA_FALSE;
256 return EINA_TRUE;
257 }
258 }
259 else if (!strcmp(param->name, "always select"))
260 {
261 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
262 {
263 if (elm_gengrid_select_mode_get (obj) ==
264 ELM_OBJECT_SELECT_MODE_ALWAYS)
265 param->i = EINA_TRUE;
266 else
267 param->i = EINA_FALSE;
268 return EINA_TRUE;
269 }
270 }
271 else if (!strcmp(param->name, "height bounce"))
272 {
273 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
274 {
275 Eina_Bool h_bounce, v_bounce;
276 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
277 param->i = h_bounce;
278 return EINA_TRUE;
279 }
280 }
281 else if (!strcmp(param->name, "width bounce"))
282 {
283 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
284 {
285 Eina_Bool h_bounce, v_bounce;
286 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
287 param->i = v_bounce;
288 return EINA_TRUE;
289 }
290 }
291 else if (!strcmp(param->name, "horizontal page relative"))
292 {
293 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
294 {
295 double h_pagerel, v_pagerel;
296 elm_scroller_page_relative_get(obj, &h_pagerel, &v_pagerel);
297 param->d = h_pagerel;
298 return EINA_TRUE;
299 }
300 }
301 else if (!strcmp(param->name, "vertical page relative"))
302 {
303 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
304 {
305 double h_pagerel, v_pagerel;
306 elm_scroller_page_relative_get(obj, &h_pagerel, &v_pagerel);
307 param->d = v_pagerel;
308 return EINA_TRUE;
309 }
310 }
311 else if (!strcmp(param->name, "horizontal item size"))
312 {
313 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
314 {
315 int h_itemsize, v_itemsize;
316 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
317 param->i = h_itemsize;
318 return EINA_TRUE;
319 }
320 }
321 else if (!strcmp(param->name, "vertical item size"))
322 {
323 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
324 {
325 int h_itemsize, v_itemsize;
326 elm_gengrid_item_size_get(obj, &h_itemsize, &v_itemsize);
327 param->i = v_itemsize;
328 return EINA_TRUE;
329 }
330 }
331 else if (!strcmp(param->name, "horizontal"))
332 {
333 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
334 {
335 param->i = elm_gengrid_horizontal_get(obj);
336 return EINA_TRUE;
337 }
338 }
339 else if (!strcmp(param->name, "align x")
340 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
341 {
342 double x, y;
343 elm_gengrid_align_get(obj, &x, &y);
344 param->d = x;
345 return EINA_TRUE;
346 }
347 else if (!strcmp(param->name, "align y")
348 && param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)
349 {
350 double x, y;
351 elm_gengrid_align_get(obj, &x, &y);
352 param->d = y;
353 return EINA_TRUE;
354 }
355 ERR("unknown parameter '%s' of type '%s'",
356 param->name, edje_external_param_type_str(param->type));
357
358 return EINA_FALSE;
359}
360
361static void *
362external_gengrid_params_parse(void *data EINA_UNUSED,
363 Evas_Object *obj EINA_UNUSED,
364 const Eina_List *params)
365{
366 Elm_Params_Gengrid *mem;
367 Edje_External_Param *param;
368 const Eina_List *l;
369
370 mem = ELM_NEW(Elm_Params_Gengrid);
371 if (!mem)
372 return NULL;
373
374 EINA_LIST_FOREACH(params, l, param)
375 {
376 if (!strcmp(param->name, "multi select"))
377 {
378 mem->multi = !!param->i;
379 mem->multi_exists = EINA_TRUE;
380 }
381 else if (!strcmp(param->name, "no selected"))
382 {
383 mem->no_select = !!param->i;
384 mem->no_select_exists = EINA_TRUE;
385 }
386 else if (!strcmp(param->name, "always select"))
387 {
388 mem->always_select = !!param->i;
389 mem->always_select_exists = EINA_TRUE;
390 }
391 else if (!strcmp(param->name, "height bounce"))
392 {
393 mem->h_bounce = !!param->i;
394 mem->h_bounce_exists = EINA_TRUE;
395 }
396 else if (!strcmp(param->name, "width bounce"))
397 {
398 mem->v_bounce = !!param->i;
399 mem->v_bounce_exists = EINA_TRUE;
400 }
401 else if (!strcmp(param->name, "horizontal page relative"))
402 {
403 mem->h_pagerel = param->d;
404 mem->h_pagerel_exists = EINA_TRUE;
405 }
406 else if (!strcmp(param->name, "vertical page relative"))
407 {
408 mem->v_pagerel = param->d;
409 mem->v_pagerel_exists = EINA_TRUE;
410 }
411 else if (!strcmp(param->name, "horizontal item size"))
412 {
413 mem->h_itemsize = param->i;
414 mem->h_itemsize_exists = EINA_TRUE;
415 }
416 else if (!strcmp(param->name, "vertical item size"))
417 {
418 mem->v_itemsize = param->i;
419 mem->v_itemsize_exists = EINA_TRUE;
420 }
421 else if (!strcmp(param->name, "horizontal"))
422 {
423 mem->horizontal = !!param->i;
424 mem->horizontal_exists = EINA_TRUE;
425 }
426 else if (!strcmp(param->name, "align x"))
427 {
428 mem->align_x = param->d;
429 mem->align_x_exists = EINA_TRUE;
430 }
431 else if (!strcmp(param->name, "align y"))
432 {
433 mem->align_y = param->d;
434 mem->align_y_exists = EINA_TRUE;
435 }
436 }
437
438 return mem;
439}
440
441static Evas_Object *
442external_gengrid_content_get(void *data EINA_UNUSED,
443 const Evas_Object *obj EINA_UNUSED,
444 const char *content EINA_UNUSED)
445{
446 ERR("No content.");
447 return NULL;
448}
449
450static void
451external_gengrid_params_free(void *params)
452{
453 Elm_Params_Gengrid *mem = params;
454 free(mem);
455}
456
457static Edje_External_Param_Info external_gengrid_params[] = {
458 DEFINE_EXTERNAL_COMMON_PARAMS,
459 EDJE_EXTERNAL_PARAM_INFO_BOOL("multi select"),
460 EDJE_EXTERNAL_PARAM_INFO_BOOL("no select"),
461 EDJE_EXTERNAL_PARAM_INFO_BOOL("always select"),
462 EDJE_EXTERNAL_PARAM_INFO_BOOL("height bounce"),
463 EDJE_EXTERNAL_PARAM_INFO_BOOL("width bounce"),
464 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("horizontal page relative"),
465 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("vertical page relative"),
466 EDJE_EXTERNAL_PARAM_INFO_INT("horizontal item size"),
467 EDJE_EXTERNAL_PARAM_INFO_INT("vertical item size"),
468 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"),
469 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("align x"),
470 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("align y"),
471 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
472};
473
474DEFINE_EXTERNAL_ICON_ADD(gengrid, "gengrid");
475DEFINE_EXTERNAL_TYPE_SIMPLE(gengrid, "Generic Grid");
diff --git a/src/edje_external/elementary/elm_genlist.c b/src/edje_external/elementary/elm_genlist.c
new file mode 100644
index 0000000..8ea6f6f
--- /dev/null
+++ b/src/edje_external/elementary/elm_genlist.c
@@ -0,0 +1,344 @@
1#include <assert.h>
2#include "private.h"
3
4typedef struct _Elm_Params_Genlist
5{
6 Elm_Params base;
7 const char *horizontal;
8 Eina_Bool multi:1;
9 Eina_Bool multi_exists:1;
10 Eina_Bool always_select:1;
11 Eina_Bool always_select_exists:1;
12 Eina_Bool no_select:1;
13 Eina_Bool no_select_exists:1;
14 Eina_Bool compress_exists:1;
15 Eina_Bool homogeneous:1;
16 Eina_Bool homogeneous_exists:1;
17 Eina_Bool h_bounce:1;
18 Eina_Bool h_bounce_exists:1;
19 Eina_Bool v_bounce:1;
20 Eina_Bool v_bounce_exists:1;
21} Elm_Params_Genlist;
22
23static const char* list_horizontal_choices[] =
24{
25 "compress", "scroll", "limit", "expand",
26 NULL
27};
28
29static Elm_List_Mode
30_list_horizontal_setting_get(const char *horizontal_str)
31{
32 unsigned int i;
33
34 assert(sizeof(list_horizontal_choices) / sizeof(list_horizontal_choices[0])
35 == ELM_LIST_LAST + 1);
36
37 for (i = 0; i < ELM_LIST_LAST; i++)
38 {
39 if (!strcmp(horizontal_str, list_horizontal_choices[i]))
40 return i;
41 }
42 return ELM_LIST_LAST;
43}
44
45static void
46external_genlist_state_set(void *data EINA_UNUSED, Evas_Object *obj,
47 const void *from_params, const void *to_params,
48 float pos EINA_UNUSED)
49{
50 const Elm_Params_Genlist *p;
51
52 if (to_params) p = to_params;
53 else if (from_params) p = from_params;
54 else return;
55
56 if (p->horizontal)
57 {
58 Elm_List_Mode set = _list_horizontal_setting_get(p->horizontal);
59
60 if (set != ELM_LIST_LAST)
61 elm_genlist_mode_set(obj, set);
62 }
63 if (p->multi_exists)
64 elm_genlist_multi_select_set(obj, p->multi);
65 if (p->no_select_exists)
66 {
67 if (p->no_select)
68 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_NONE);
69 else
70 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
71 }
72 if (p->always_select_exists)
73 {
74 if (p->always_select)
75 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_ALWAYS);
76 else
77 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
78 }
79 if (p->homogeneous_exists)
80 elm_genlist_homogeneous_set(obj, p->homogeneous);
81 if ((p->h_bounce_exists) && (p->v_bounce_exists))
82 elm_scroller_bounce_set(obj, p->h_bounce, p->v_bounce);
83 else if ((p->h_bounce_exists) || (p->v_bounce_exists))
84 {
85 Eina_Bool h_bounce, v_bounce;
86
87 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
88 if (p->h_bounce_exists)
89 elm_scroller_bounce_set(obj, p->h_bounce, v_bounce);
90 else
91 elm_scroller_bounce_set(obj, h_bounce, p->v_bounce);
92 }
93}
94
95static Eina_Bool
96external_genlist_param_set(void *data EINA_UNUSED, Evas_Object *obj,
97 const Edje_External_Param *param)
98{
99 if (!strcmp(param->name, "horizontal mode"))
100 {
101 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)
102 {
103 Elm_List_Mode set = _list_horizontal_setting_get(param->s);
104
105 if (set == ELM_LIST_LAST) return EINA_FALSE;
106 elm_genlist_mode_set(obj, set);
107 return EINA_TRUE;
108 }
109 }
110 else if (!strcmp(param->name, "multi select"))
111 {
112 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
113 {
114 elm_genlist_multi_select_set(obj, param->i);
115 return EINA_TRUE;
116 }
117 }
118 else if (!strcmp(param->name, "always select"))
119 {
120 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
121 {
122 if (param->i)
123 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_ALWAYS);
124 else
125 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
126 return EINA_TRUE;
127 }
128 }
129 else if (!strcmp(param->name, "no select"))
130 {
131 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
132 {
133 if (param->i)
134 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_NONE);
135 else
136 elm_genlist_select_mode_set (obj, ELM_OBJECT_SELECT_MODE_DEFAULT);
137 return EINA_TRUE;
138 }
139 }
140 else if (!strcmp(param->name, "homogeneous"))
141 {
142 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
143 {
144 elm_genlist_homogeneous_set(obj, param->i);
145 return EINA_TRUE;
146 }
147 }
148 else if (!strcmp(param->name, "height bounce"))
149 {
150 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
151 {
152 Eina_Bool h_bounce, v_bounce;
153 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
154 elm_scroller_bounce_set(obj, param->i, v_bounce);
155 return EINA_TRUE;
156 }
157 }
158 else if (!strcmp(param->name, "width bounce"))
159 {
160 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
161 {
162 Eina_Bool h_bounce, v_bounce;
163 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
164 elm_scroller_bounce_set(obj, h_bounce, param->i);
165 return EINA_TRUE;
166 }
167 }
168
169 ERR("unknown parameter '%s' of type '%s'",
170 param->name, edje_external_param_type_str(param->type));
171
172 return EINA_FALSE;
173}
174
175static Eina_Bool
176external_genlist_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
177 Edje_External_Param *param)
178{
179 if (!strcmp(param->name, "horizontal mode"))
180 {
181 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_CHOICE)
182 {
183 Elm_List_Mode list_horizontal_set = elm_genlist_mode_get(obj);
184
185 if (list_horizontal_set == ELM_LIST_LAST)
186 return EINA_FALSE;
187
188 param->s = list_horizontal_choices[list_horizontal_set];
189 return EINA_TRUE;
190 }
191 }
192 else if (!strcmp(param->name, "multi select"))
193 {
194 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
195 {
196 param->i = elm_genlist_multi_select_get(obj);
197 return EINA_TRUE;
198 }
199 }
200 else if (!strcmp(param->name, "always select"))
201 {
202 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
203 {
204 if (elm_genlist_select_mode_get (obj) ==
205 ELM_OBJECT_SELECT_MODE_ALWAYS)
206 param->i = EINA_TRUE;
207 else
208 param->i = EINA_FALSE;
209 return EINA_TRUE;
210 }
211 }
212 else if (!strcmp(param->name, "no select"))
213 {
214 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
215 {
216 if (elm_genlist_select_mode_get (obj) ==
217 ELM_OBJECT_SELECT_MODE_NONE)
218 param->i = EINA_TRUE;
219 else
220 param->i = EINA_FALSE;
221 return EINA_TRUE;
222 }
223 }
224 else if (!strcmp(param->name, "homogeneous"))
225 {
226 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
227 {
228 param->i = elm_genlist_homogeneous_get(obj);
229 return EINA_TRUE;
230 }
231 }
232 else if (!strcmp(param->name, "height bounce"))
233 {
234 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
235 {
236 Eina_Bool h_bounce, v_bounce;
237 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
238 param->i = h_bounce;
239 return EINA_TRUE;
240 }
241 }
242 else if (!strcmp(param->name, "width bounce"))
243 {
244 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
245 {
246 Eina_Bool h_bounce, v_bounce;
247 elm_scroller_bounce_get(obj, &h_bounce, &v_bounce);
248 param->i = v_bounce;
249 return EINA_TRUE;
250 }
251 }
252
253 ERR("unknown parameter '%s' of type '%s'",
254 param->name, edje_external_param_type_str(param->type));
255
256 return EINA_FALSE;
257}
258
259static void *
260external_genlist_params_parse(void *data EINA_UNUSED,
261 Evas_Object *obj EINA_UNUSED,
262 const Eina_List *params)
263{
264 Elm_Params_Genlist *mem;