summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm.c
diff options
context:
space:
mode:
authorTiago Rezende Campos Falcao <developer@tiagofalcao.com>2009-12-06 01:22:54 +0000
committerTiago Rezende Campos Falcao <developer@tiagofalcao.com>2009-12-06 01:22:54 +0000
commitabebd98c52c4bdba993f2d61559a202696c8b732 (patch)
tree480ab91ab764073bee3ea447257e0c55af64ef3d /src/edje_externals/elm.c
parent4f2d186d2af5b82646032f79a752c51319687c71 (diff)
Elementary edje external modules
Widgets: Button, Check, Radio, Slider, Toggle SVN revision: 44207
Diffstat (limited to '')
-rw-r--r--src/edje_externals/elm.c87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/edje_externals/elm.c b/src/edje_externals/elm.c
new file mode 100644
index 000000000..2f39675b3
--- /dev/null
+++ b/src/edje_externals/elm.c
@@ -0,0 +1,87 @@
1#include <Elementary.h>
2#include "private.h"
3
4void
5external_signal(void *data, Evas_Object *obj, const char *signal, const char *source)
6{
7 printf("External Signal received: '%s' '%s'\n", signal, source);
8}
9
10void *
11external_common_params_parse_internal(size_t params_size, void *data, Evas_Object *obj, const Eina_List *params)
12{
13 Elm_Params *p;
14 const Eina_List *l;
15 Edje_External_Param *param;
16
17 if (params_size < sizeof(Elm_Params))
18 return NULL;
19
20 p = calloc(1, params_size);
21 if (!p)
22 return NULL;
23
24 EINA_LIST_FOREACH(params, l, param)
25 {
26 if (!strcmp(param->name, "label"))
27 p->label = param->s;
28 if(!strcmp(param->name, "state"))
29 p->state = param->i;
30 }
31 return p;
32}
33
34void
35external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj, const Eina_List *params)
36{
37 Edje_External_Param *p;
38
39 p = edje_external_param_find(params, "icon");
40 if (p)
41 {
42 Evas_Object *parent = evas_object_smart_parent_get(obj);
43 const char *file;
44 edje_object_file_get(parent, &file, NULL);
45 *icon = elm_icon_add(parent);
46
47 if (!elm_icon_file_set(*icon, file, p->s))
48 elm_icon_standard_set(*icon, p->s);
49 }
50}
51
52void
53external_common_params_free(void *params)
54{
55 Elm_Params *p = params;
56 free(p);
57};
58
59#define DEFINE_TYPE(type_name) \
60 extern const Edje_External_Type external_##type_name##_type;
61#include "modules.inc"
62#undef DEFINE_TYPE
63
64static Edje_External_Type_Info elm_external_types[] =
65{
66#define DEFINE_TYPE(type_name) \
67 {"elm/"#type_name, &external_##type_name##_type},
68#include "modules.inc"
69#undef DEFINE_TYPE
70 {NULL, NULL}
71};
72
73static Eina_Bool
74elm_mod_init(void)
75{
76 edje_external_type_array_register(elm_external_types);
77 return EINA_TRUE;
78}
79
80static void
81elm_mod_shutdown(void)
82{
83 edje_external_type_array_unregister(elm_external_types);
84}
85
86EINA_MODULE_INIT(elm_mod_init);
87EINA_MODULE_SHUTDOWN(elm_mod_shutdown);