summaryrefslogtreecommitdiff
path: root/legacy/elementary/src/edje_externals/elm_radio.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
commit750cd95d10a930a428fcf93f6687f948fbc31ddf (patch)
tree4aa498827f50be8e41a8a66863d48b6ea2c51e36 /legacy/elementary/src/edje_externals/elm_radio.c
parenta3c5ee407f6ddc60824fe1e6bbc269b2b1c59d7f (diff)
edje_externals: Fixed formatting before working on it.
Diffstat (limited to '')
-rw-r--r--legacy/elementary/src/edje_externals/elm_radio.c135
1 files changed, 70 insertions, 65 deletions
diff --git a/legacy/elementary/src/edje_externals/elm_radio.c b/legacy/elementary/src/edje_externals/elm_radio.c
index e459e71..576e67f 100644
--- a/legacy/elementary/src/edje_externals/elm_radio.c
+++ b/legacy/elementary/src/edje_externals/elm_radio.c
@@ -11,7 +11,9 @@ typedef struct _Elm_Params_Radio
11} Elm_Params_Radio; 11} Elm_Params_Radio;
12 12
13static void 13static void
14external_radio_state_set(void *data EINA_UNUSED, Evas_Object *obj, const void *from_params, const void *to_params, float pos EINA_UNUSED) 14external_radio_state_set(void *data EINA_UNUSED, Evas_Object *obj,
15 const void *from_params, const void *to_params,
16 float pos EINA_UNUSED)
15{ 17{
16 const Elm_Params_Radio *p; 18 const Elm_Params_Radio *p;
17 19
@@ -27,50 +29,51 @@ external_radio_state_set(void *data EINA_UNUSED, Evas_Object *obj, const void *f
27 elm_radio_state_value_set(obj, p->value); 29 elm_radio_state_value_set(obj, p->value);
28 if (p->group_name) 30 if (p->group_name)
29 { 31 {
30 Evas_Object *ed = evas_object_smart_parent_get(obj); 32 Evas_Object *ed = evas_object_smart_parent_get(obj);
31 Evas_Object *group = edje_object_part_swallow_get(ed, p->group_name); 33 Evas_Object *group = edje_object_part_swallow_get(ed, p->group_name);
32 elm_radio_group_add(obj, group); 34 elm_radio_group_add(obj, group);
33 } 35 }
34} 36}
35 37
36static Eina_Bool 38static Eina_Bool
37external_radio_param_set(void *data EINA_UNUSED, Evas_Object *obj, const Edje_External_Param *param) 39external_radio_param_set(void *data EINA_UNUSED, Evas_Object *obj,
40 const Edje_External_Param *param)
38{ 41{
39 if (!strcmp(param->name, "label")) 42 if (!strcmp(param->name, "label"))
40 { 43 {
41 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 44 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
42 { 45 {
43 elm_object_text_set(obj, param->s); 46 elm_object_text_set(obj, param->s);
44 return EINA_TRUE; 47 return EINA_TRUE;
45 } 48 }
46 } 49 }
47 else if (!strcmp(param->name, "icon")) 50 else if (!strcmp(param->name, "icon"))
48 { 51 {
49 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 52 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
50 { 53 {
51 Evas_Object *icon = external_common_param_icon_get(obj, param); 54 Evas_Object *icon = external_common_param_icon_get(obj, param);
52 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE; 55 if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
53 elm_object_part_content_set(obj, "icon", icon); 56 elm_object_part_content_set(obj, "icon", icon);
54 return EINA_TRUE; 57 return EINA_TRUE;
55 } 58 }
56 } 59 }
57 else if (!strcmp(param->name, "value")) 60 else if (!strcmp(param->name, "value"))
58 { 61 {
59 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT) 62 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
60 { 63 {
61 elm_radio_value_set(obj, param->i); 64 elm_radio_value_set(obj, param->i);
62 return EINA_TRUE; 65 return EINA_TRUE;
63 } 66 }
64 } 67 }
65 else if (!strcmp(param->name, "group")) 68 else if (!strcmp(param->name, "group"))
66 { 69 {
67 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 70 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
68 { 71 {
69 Evas_Object *ed = evas_object_smart_parent_get(obj); 72 Evas_Object *ed = evas_object_smart_parent_get(obj);
70 Evas_Object *group = edje_object_part_swallow_get(ed, param->s); 73 Evas_Object *group = edje_object_part_swallow_get(ed, param->s);
71 elm_radio_group_add(obj, group); 74 elm_radio_group_add(obj, group);
72 return EINA_TRUE; 75 return EINA_TRUE;
73 } 76 }
74 } 77 }
75 78
76 ERR("unknown parameter '%s' of type '%s'", 79 ERR("unknown parameter '%s' of type '%s'",
@@ -80,33 +83,34 @@ external_radio_param_set(void *data EINA_UNUSED, Evas_Object *obj, const Edje_Ex
80} 83}
81 84
82static Eina_Bool 85static Eina_Bool
83external_radio_param_get(void *data EINA_UNUSED, const Evas_Object *obj, Edje_External_Param *param) 86external_radio_param_get(void *data EINA_UNUSED, const Evas_Object *obj,
87 Edje_External_Param *param)
84{ 88{
85 if (!strcmp(param->name, "label")) 89 if (!strcmp(param->name, "label"))
86 { 90 {
87 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 91 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
88 { 92 {
89 param->s = elm_object_text_get(obj); 93 param->s = elm_object_text_get(obj);
90 return EINA_TRUE; 94 return EINA_TRUE;
91 } 95 }
92 } 96 }
93 else if (!strcmp(param->name, "icon")) 97 else if (!strcmp(param->name, "icon"))
94 { 98 {
95 /* not easy to get icon name back from live object */ 99 /* not easy to get icon name back from live object */
96 return EINA_FALSE; 100 return EINA_FALSE;
97 } 101 }
98 else if (!strcmp(param->name, "value")) 102 else if (!strcmp(param->name, "value"))
99 { 103 {
100 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT) 104 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_INT)
101 { 105 {
102 param->i = elm_radio_value_get(obj); 106 param->i = elm_radio_value_get(obj);
103 return EINA_TRUE; 107 return EINA_TRUE;
104 } 108 }
105 } 109 }
106 else if (!strcmp(param->name, "group")) 110 else if (!strcmp(param->name, "group"))
107 { 111 {
108 /* not easy to get group name back from live object */ 112 /* not easy to get group name back from live object */
109 return EINA_FALSE; 113 return EINA_FALSE;
110 } 114 }
111 115
112 ERR("unknown parameter '%s' of type '%s'", 116 ERR("unknown parameter '%s' of type '%s'",
@@ -130,25 +134,26 @@ external_radio_params_parse(void *data EINA_UNUSED, Evas_Object *obj, const Eina
130 134
131 EINA_LIST_FOREACH(params, l, param) 135 EINA_LIST_FOREACH(params, l, param)
132 { 136 {
133 if (!strcmp(param->name, "group")) 137 if (!strcmp(param->name, "group"))
134 mem->group_name = eina_stringshare_add(param->s); 138 mem->group_name = eina_stringshare_add(param->s);
135 else if (!strcmp(param->name, "value")) 139 else if (!strcmp(param->name, "value"))
136 { 140 {
137 mem->value = param->i; 141 mem->value = param->i;
138 mem->value_exists = EINA_TRUE; 142 mem->value_exists = EINA_TRUE;
139 } 143 }
140 else if (!strcmp(param->name, "label")) 144 else if (!strcmp(param->name, "label"))
141 mem->label = eina_stringshare_add(param->s); 145 mem->label = eina_stringshare_add(param->s);
142 } 146 }
143 147
144 return mem; 148 return mem;
145} 149}
146 150
147static Evas_Object *external_radio_content_get(void *data EINA_UNUSED, 151static Evas_Object *external_radio_content_get(void *data EINA_UNUSED,
148 const Evas_Object *obj EINA_UNUSED, const char *content EINA_UNUSED) 152 const Evas_Object *obj EINA_UNUSED,
153 const char *content EINA_UNUSED)
149{ 154{
150 ERR("No content."); 155 ERR("No content.");
151 return NULL; 156 return NULL;
152} 157}
153 158
154static void 159static void
@@ -159,18 +164,18 @@ external_radio_params_free(void *params)
159 if (mem->group_name) 164 if (mem->group_name)
160 eina_stringshare_del(mem->group_name); 165 eina_stringshare_del(mem->group_name);
161 if (mem->label) 166 if (mem->label)
162 eina_stringshare_del(mem->label); 167 eina_stringshare_del(mem->label);
163 free(params); 168 free(params);
164} 169}
165 170
166static Edje_External_Param_Info external_radio_params[] = { 171static Edje_External_Param_Info external_radio_params[] = {
167 DEFINE_EXTERNAL_COMMON_PARAMS, 172 DEFINE_EXTERNAL_COMMON_PARAMS,
168 EDJE_EXTERNAL_PARAM_INFO_STRING("label"), 173 EDJE_EXTERNAL_PARAM_INFO_STRING("label"),
169 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"), 174 EDJE_EXTERNAL_PARAM_INFO_STRING("icon"),
170 EDJE_EXTERNAL_PARAM_INFO_STRING("group"), 175 EDJE_EXTERNAL_PARAM_INFO_STRING("group"),
171 EDJE_EXTERNAL_PARAM_INFO_INT("value"), 176 EDJE_EXTERNAL_PARAM_INFO_INT("value"),
172 EDJE_EXTERNAL_PARAM_INFO_SENTINEL 177 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
173}; 178};
174 179
175DEFINE_EXTERNAL_ICON_ADD(radio, "radio") 180DEFINE_EXTERNAL_ICON_ADD(radio, "radio");
176DEFINE_EXTERNAL_TYPE_SIMPLE(radio, "Radio") 181DEFINE_EXTERNAL_TYPE_SIMPLE(radio, "Radio");