summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm_check.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_check.c
parent4f2d186d2af5b82646032f79a752c51319687c71 (diff)
Elementary edje external modules
Widgets: Button, Check, Radio, Slider, Toggle SVN revision: 44207
Diffstat (limited to 'src/edje_externals/elm_check.c')
-rw-r--r--src/edje_externals/elm_check.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/edje_externals/elm_check.c b/src/edje_externals/elm_check.c
new file mode 100644
index 000000000..6449b3b84
--- /dev/null
+++ b/src/edje_externals/elm_check.c
@@ -0,0 +1,61 @@
1#include "private.h"
2
3typedef struct _Elm_Params_Check
4{
5 Elm_Params base;
6 Evas_Object *icon;
7} Elm_Params_Check;
8
9static void
10external_check_state_set(void *data, Evas_Object *obj, const void *from_params, const void *to_params, float pos)
11{
12 const Elm_Params_Check *p1 = from_params, *p2 = to_params;
13
14 p1 = from_params;
15 p2 = to_params;
16
17 if (!p2)
18 {
19 elm_check_label_set(obj, p1->base.label);
20 elm_check_icon_set(obj, p1->icon);
21 elm_check_state_set(obj, p1->base.state);
22 return;
23 }
24
25 elm_check_label_set(obj, p2->base.label);
26 elm_check_icon_set(obj, p2->icon);
27 elm_check_state_set(obj, p2->base.state);
28}
29
30static void *
31external_check_params_parse(void *data, Evas_Object *obj, const Eina_List *params)
32{
33 Elm_Params_Check *mem;
34 Edje_External_Param *param;
35
36 mem = external_common_params_parse(Elm_Params_Check, data, obj, params);
37 if (!mem)
38 return NULL;
39
40 external_common_icon_param_parse(&mem->icon, obj, params);
41
42 return mem;
43}
44
45static void
46external_check_params_free(void *params)
47{
48 Elm_Params_Check *mem = params;
49
50 if (mem->icon)
51 evas_object_del(mem->icon);
52 external_common_params_free(params);
53}
54
55static Edje_External_Param_Info external_check_params[] = {
56 DEFINE_EXTERNAL_COMMON_PARAMS,
57 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
58 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
59};
60
61DEFINE_EXTERNAL_TYPE_SIMPLE(check, "Check")