summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm_check.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-23 20:08:10 +0900
committerDaniel Juyung Seo <seojuyung2@gmail.com>2014-01-23 22:36:41 +0900
commit46c51ecec7d886cf079e197840b158a396a20e83 (patch)
treefe1f59c37c8c197b8ca80821e0b34fd58671ee29 /src/edje_externals/elm_check.c
parentfd5a62d31d50bf9ba60f2b4c55c05f7117c6622d (diff)
edje_externals: Fixed formatting before working on it.
Diffstat (limited to 'src/edje_externals/elm_check.c')
-rw-r--r--src/edje_externals/elm_check.c96
1 files changed, 51 insertions, 45 deletions
diff --git a/src/edje_externals/elm_check.c b/src/edje_externals/elm_check.c
index 5293a53df..e989594ec 100644
--- a/src/edje_externals/elm_check.c
+++ b/src/edje_externals/elm_check.c
@@ -10,7 +10,9 @@ typedef struct _Elm_Params_Check
10} Elm_Params_Check; 10} Elm_Params_Check;
11 11
12static void 12static void
13external_check_state_set(void *data EINA_UNUSED, Evas_Object *obj, const void *from_params, const void *to_params, float pos EINA_UNUSED) 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)
14{ 16{
15 const Elm_Params_Check *p; 17 const Elm_Params_Check *p;
16 18
@@ -27,33 +29,34 @@ external_check_state_set(void *data EINA_UNUSED, Evas_Object *obj, const void *f
27} 29}
28 30
29static Eina_Bool 31static Eina_Bool
30external_check_param_set(void *data EINA_UNUSED, Evas_Object *obj, const Edje_External_Param *param) 32external_check_param_set(void *data EINA_UNUSED, Evas_Object *obj,
33 const Edje_External_Param *param)
31{ 34{
32 if (!strcmp(param->name, "label")) 35 if (!strcmp(param->name, "label"))
33 { 36 {
34 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 37 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
35 { 38 {
36 elm_object_text_set(obj, param->s); 39 elm_object_text_set(obj, param->s);
37 return EINA_TRUE; 40 return EINA_TRUE;
38 } 41 }
39 } 42 }
40 else if (!strcmp(param->name, "icon")) 43 else if (!strcmp(param->name, "icon"))
41 { 44 {
42 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 45 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
43 { 46 {
44 Evas_Object *icon = external_common_param_icon_get(obj, param); 47 Evas_Object *icon = external_common_param_icon_get(obj, param);
45 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; 48 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
46 elm_object_part_content_set(obj, "icon", icon); 49 elm_object_part_content_set(obj, "icon", icon);
47 return EINA_TRUE; 50 return EINA_TRUE;
48 } 51 }
49 } 52 }
50 else if (!strcmp(param->name, "state")) 53 else if (!strcmp(param->name, "state"))
51 { 54 {
52 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) 55 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
53 { 56 {
54 elm_check_state_set(obj, param->i); 57 elm_check_state_set(obj, param->i);
55 return EINA_TRUE; 58 return EINA_TRUE;
56 } 59 }
57 } 60 }
58 61
59 ERR("unknown parameter '%s' of type '%s'", 62 ERR("unknown parameter '%s' of type '%s'",
@@ -63,28 +66,29 @@ external_check_param_set(void *data EINA_UNUSED, Evas_Object *obj, const Edje_Ex
63} 66}
64 67
65static Eina_Bool 68static Eina_Bool
66external_check_param_get(void *data EINA_UNUSED, const Evas_Object *obj, Edje_External_Param *param) 69external_check_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
70 Edje_External_Param *param)
67{ 71{
68 if (!strcmp(param->name, "label")) 72 if (!strcmp(param->name, "label"))
69 { 73 {
70 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 74 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
71 { 75 {
72 param->s = elm_object_text_get(obj); 76 param->s = elm_object_text_get(obj);
73 return EINA_TRUE; 77 return EINA_TRUE;
74 } 78 }
75 } 79 }
76 else if (!strcmp(param->name, "icon")) 80 else if (!strcmp(param->name, "icon"))
77 { 81 {
78 /* not easy to get icon name back from live object */ 82 /* not easy to get icon name back from live object */
79 return EINA_FALSE; 83 return EINA_FALSE;
80 } 84 }
81 else if (!strcmp(param->name, "state")) 85 else if (!strcmp(param->name, "state"))
82 { 86 {
83 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL) 87 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)
84 { 88 {
85 param->i = elm_check_state_get(obj); 89 param->i = elm_check_state_get(obj);
86 return EINA_TRUE; 90 return EINA_TRUE;
87 } 91 }
88 } 92 }
89 93
90 ERR("unknown parameter '%s' of type '%s'", 94 ERR("unknown parameter '%s' of type '%s'",
@@ -94,7 +98,8 @@ external_check_param_get(void *data EINA_UNUSED, const Evas_Object *obj, Edje_Ex
94} 98}
95 99
96static void * 100static void *
97external_check_params_parse(void *data EINA_UNUSED, Evas_Object *obj, const Eina_List *params) 101external_check_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
102 const Eina_List *params)
98{ 103{
99 Elm_Params_Check *mem; 104 Elm_Params_Check *mem;
100 Edje_External_Param *param; 105 Edje_External_Param *param;
@@ -114,17 +119,18 @@ external_check_params_parse(void *data EINA_UNUSED, Evas_Object *obj, const Eina
114 mem->state_exists = EINA_TRUE; 119 mem->state_exists = EINA_TRUE;
115 } 120 }
116 else if (!strcmp(param->name, "label")) 121 else if (!strcmp(param->name, "label"))
117 mem->label = eina_stringshare_add(param->s); 122 mem->label = eina_stringshare_add(param->s);
118 } 123 }
119 124
120 return mem; 125 return mem;
121} 126}
122 127
123static Evas_Object *external_check_content_get(void *data EINA_UNUSED, 128static Evas_Object *external_check_content_get(void *data EINA_UNUSED,
124 const Evas_Object *obj EINA_UNUSED, const char *content EINA_UNUSED) 129 const Evas_Object *obj EINA_UNUSED,
130 const char *content EINA_UNUSED)
125{ 131{
126 ERR("No content."); 132 ERR("No content.");
127 return NULL; 133 return NULL;
128} 134}
129 135
130static void 136static void
@@ -132,17 +138,17 @@ external_check_params_free(void *params)
132{ 138{
133 Elm_Params_Check *mem = params; 139 Elm_Params_Check *mem = params;
134 if (mem->label) 140 if (mem->label)
135 eina_stringshare_del(mem->label); 141 eina_stringshare_del(mem->label);
136 free(params); 142 free(params);
137} 143}
138 144
139static Edje_External_Param_Info external_check_params[] = { 145static Edje_External_Param_Info external_check_params[] = {
140 DEFINE_EXTERNAL_COMMON_PARAMS, 146 DEFINE_EXTERNAL_COMMON_PARAMS,
141 EDJE_EXTERNAL_PARAM_INFO_STRING("label"), 147 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
142 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"), 148 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
143 EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL("state", 0, "unchecked", "checked"), 149 EDJE_EXTERNAL_PARAM_INFO_BOOL_FULL("state", 0, "unchecked", "checked"),
144 EDJE_EXTERNAL_PARAM_INFO_SENTINEL 150 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
145}; 151};
146 152
147DEFINE_EXTERNAL_ICON_ADD(check, "check") 153DEFINE_EXTERNAL_ICON_ADD(check, "check");
148DEFINE_EXTERNAL_TYPE_SIMPLE(check, "Check") 154DEFINE_EXTERNAL_TYPE_SIMPLE(check, "Check");