summaryrefslogtreecommitdiff
path: root/src/edje_externals/elm_panes.c
diff options
context:
space:
mode:
authorMike McCormack <mj.mccormack@samsung.com>2011-10-11 02:39:07 +0000
committerMike McCormack <mikem@ring3k.org>2011-10-11 02:39:07 +0000
commitda90879b7a6d229ef9268f3e59a282706d909013 (patch)
treea3a864dae4001f15e5c45722f92581eb283e1be5 /src/edje_externals/elm_panes.c
parentc5fb9253e1ac8d5dddff55f91d58fc21dffbf75a (diff)
elementary: Heed indentiness corectiness
Signed-off-by: Mike McCormack <mj.mccormack@samsung.com> SVN revision: 63975
Diffstat (limited to 'src/edje_externals/elm_panes.c')
-rw-r--r--src/edje_externals/elm_panes.c313
1 files changed, 158 insertions, 155 deletions
diff --git a/src/edje_externals/elm_panes.c b/src/edje_externals/elm_panes.c
index c27c1bde3..9ff569b2a 100644
--- a/src/edje_externals/elm_panes.c
+++ b/src/edje_externals/elm_panes.c
@@ -5,190 +5,193 @@
5typedef struct _Elm_Params_Panes Elm_Params_Panes; 5typedef struct _Elm_Params_Panes Elm_Params_Panes;
6 6
7struct _Elm_Params_Panes { 7struct _Elm_Params_Panes {
8 Elm_Params base; 8 Elm_Params base;
9 Evas_Object *content_left; 9 Evas_Object *content_left;
10 Evas_Object *content_right; 10 Evas_Object *content_right;
11 Eina_Bool is_horizontal; 11 Eina_Bool is_horizontal;
12 Eina_Bool horizontal; 12 Eina_Bool horizontal;
13 Eina_Bool is_left_size; 13 Eina_Bool is_left_size;
14 double left_size; 14 double left_size;
15 Eina_Bool is_fixed; 15 Eina_Bool is_fixed;
16 Eina_Bool fixed; 16 Eina_Bool fixed;
17}; 17};
18 18
19static void external_panes_state_set(void *data __UNUSED__, 19static void external_panes_state_set(void *data __UNUSED__,
20 Evas_Object *obj, const void *from_params, 20 Evas_Object *obj, const void *from_params,
21 const void *to_params, float pos __UNUSED__) 21 const void *to_params, float pos __UNUSED__)
22{ 22{
23 const Elm_Params_Panes *p; 23 const Elm_Params_Panes *p;
24 24
25 if (to_params) p = to_params; 25 if (to_params) p = to_params;
26 else if (from_params) p = from_params; 26 else if (from_params) p = from_params;
27 else return; 27 else return;
28 28
29 if (p->content_left) 29 if (p->content_left)
30 elm_panes_content_left_set(obj, p->content_left); 30 elm_panes_content_left_set(obj, p->content_left);
31 31
32 if (p->content_right) 32 if (p->content_right)
33 elm_panes_content_right_set(obj, p->content_right); 33 elm_panes_content_right_set(obj, p->content_right);
34 34
35 if(p->is_left_size) 35 if (p->is_left_size)
36 elm_panes_content_left_size_set(obj, p->left_size); 36 elm_panes_content_left_size_set(obj, p->left_size);
37 37
38 if(p->is_horizontal) 38 if (p->is_horizontal)
39 elm_panes_horizontal_set(obj, p->horizontal); 39 elm_panes_horizontal_set(obj, p->horizontal);
40 40
41 if(p->is_fixed) 41 if (p->is_fixed)
42 elm_panes_fixed_set(obj, p->fixed); 42 elm_panes_fixed_set(obj, p->fixed);
43} 43}
44 44
45static Eina_Bool external_panes_param_set(void *data __UNUSED__, 45static Eina_Bool external_panes_param_set(void *data __UNUSED__,
46 Evas_Object *obj, const Edje_External_Param *param) 46 Evas_Object *obj, const Edje_External_Param *param)
47{ 47{
48 if ((!strcmp(param->name, "content left")) 48 if ((!strcmp(param->name, "content left"))
49 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) 49 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
50 { 50 {
51 Evas_Object *content = external_common_param_edje_object_get(obj, param); 51 Evas_Object *content = external_common_param_edje_object_get(obj, param);
52 if ((strcmp(param->s, "")) && (!content)) 52 if ((strcmp(param->s, "")) && (!content))
53 return EINA_FALSE; 53 return EINA_FALSE;
54 elm_panes_content_left_set(obj, content); 54 elm_panes_content_left_set(obj, content);
55 return EINA_TRUE; 55 return EINA_TRUE;
56 } 56 }
57 else if ((!strcmp(param->name, "content right")) 57 else if ((!strcmp(param->name, "content right"))
58 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) 58 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
59 { 59 {
60 Evas_Object *content = external_common_param_edje_object_get(obj, param); 60 Evas_Object *content = external_common_param_edje_object_get(obj, param);
61 if ((strcmp(param->s, "")) && (!content)) 61 if ((strcmp(param->s, "")) && (!content))
62 return EINA_FALSE; 62 return EINA_FALSE;
63 elm_panes_content_right_set(obj, content); 63 elm_panes_content_right_set(obj, content);
64 return EINA_TRUE; 64 return EINA_TRUE;
65 } 65 }
66 else if ((!strcmp(param->name, "horizontal")) 66 else if ((!strcmp(param->name, "horizontal"))
67 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) 67 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL))
68 { 68 {
69 elm_panes_horizontal_set(obj, param->i); 69 elm_panes_horizontal_set(obj, param->i);
70 return EINA_TRUE; 70 return EINA_TRUE;
71 } 71 }
72 else if ((!strcmp(param->name, "left size")) 72 else if ((!strcmp(param->name, "left size"))
73 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) 73 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE))
74 { 74 {
75 elm_panes_content_left_size_set(obj, param->d); 75 elm_panes_content_left_size_set(obj, param->d);
76 return EINA_TRUE; 76 return EINA_TRUE;
77 } 77 }
78 else if ((!strcmp(param->name, "fixed")) 78 else if ((!strcmp(param->name, "fixed"))
79 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) 79 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL))
80 { 80 {
81 elm_panes_fixed_set(obj, param->i); 81 elm_panes_fixed_set(obj, param->i);
82 return EINA_TRUE; 82 return EINA_TRUE;
83 } 83 }
84 84
85 ERR("unknown parameter '%s' of type '%s'", 85 ERR("unknown parameter '%s' of type '%s'",
86 param->name, edje_external_param_type_str(param->type)); 86 param->name, edje_external_param_type_str(param->type));
87 87
88 return EINA_FALSE; 88 return EINA_FALSE;
89} 89}
90 90
91static Eina_Bool external_panes_param_get(void *data __UNUSED__, 91static Eina_Bool
92 const Evas_Object *obj, Edje_External_Param *param) 92external_panes_param_get(void *data __UNUSED__, const Evas_Object *obj,
93 Edje_External_Param *param)
93{ 94{
94 if (!strcmp(param->name, "content left")) 95 if (!strcmp(param->name, "content left"))
95 { 96 {
96 /* not easy to get content name back from live object */ 97 /* not easy to get content name back from live object */
97 return EINA_FALSE; 98 return EINA_FALSE;
98 } 99 }
99 else if (!strcmp(param->name, "content right")) 100 else if (!strcmp(param->name, "content right"))
100 { 101 {
101 /* not easy to get content name back from live object */ 102 /* not easy to get content name back from live object */
102 return EINA_FALSE; 103 return EINA_FALSE;
103 } 104 }
104 else if ((!strcmp(param->name, "horizontal")) 105 else if ((!strcmp(param->name, "horizontal"))
105 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) 106 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL))
106 { 107 {
107 param->i = elm_panes_horizontal_get(obj); 108 param->i = elm_panes_horizontal_get(obj);
108 return EINA_TRUE; 109 return EINA_TRUE;
109 } 110 }
110 else if ((!strcmp(param->name, "left size")) 111 else if ((!strcmp(param->name, "left size"))
111 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE)) 112 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_DOUBLE))
112 { 113 {
113 param->d = elm_panes_content_left_size_get(obj); 114 param->d = elm_panes_content_left_size_get(obj);
114 return EINA_TRUE; 115 return EINA_TRUE;
115 } 116 }
116 else if ((!strcmp(param->name, "fixed")) 117 else if ((!strcmp(param->name, "fixed"))
117 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL)) 118 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_BOOL))
118 { 119 {
119 param->i = elm_panes_fixed_get(obj); 120 param->i = elm_panes_fixed_get(obj);
120 return EINA_TRUE; 121 return EINA_TRUE;
121 } 122 }
122 123
123 ERR("unknown parameter '%s' of type '%s'", 124 ERR("unknown parameter '%s' of type '%s'",
124 param->name, edje_external_param_type_str(param->type)); 125 param->name, edje_external_param_type_str(param->type));
125 126
126 return EINA_FALSE; 127 return EINA_FALSE;
127} 128}
128 129
129static void * external_panes_params_parse(void *data __UNUSED__, Evas_Object *obj, 130static void *
130 const Eina_List *params) { 131external_panes_params_parse(void *data __UNUSED__, Evas_Object *obj,
131 Elm_Params_Panes *mem; 132 const Eina_List *params)
132 Edje_External_Param *param; 133{
133 const Eina_List *l; 134 Elm_Params_Panes *mem;
134 135 Edje_External_Param *param;
135 mem = calloc(1, sizeof(Elm_Params_Panes)); 136 const Eina_List *l;
136 if (!mem) 137
137 return NULL; 138 mem = calloc(1, sizeof(Elm_Params_Panes));
138 139 if (!mem)
139 EINA_LIST_FOREACH(params, l, param) 140 return NULL;
140 { 141
141 if (!strcmp(param->name, "content left")) 142 EINA_LIST_FOREACH(params, l, param)
142 mem->content_left = external_common_param_edje_object_get(obj, param); 143 {
143 else if (!strcmp(param->name, "content right")) 144 if (!strcmp(param->name, "content left"))
144 mem->content_right = external_common_param_edje_object_get(obj, param); 145 mem->content_left = external_common_param_edje_object_get(obj, param);
145 else if (!strcmp(param->name, "horizontal")) 146 else if (!strcmp(param->name, "content right"))
146 { 147 mem->content_right = external_common_param_edje_object_get(obj, param);
147 mem->is_horizontal = EINA_TRUE; 148 else if (!strcmp(param->name, "horizontal"))
148 mem->horizontal = param->i; 149 {
149 } 150 mem->is_horizontal = EINA_TRUE;
150 else if (!strcmp(param->name, "left size")) 151 mem->horizontal = param->i;
151 { 152 }
152 mem->is_left_size = EINA_TRUE; 153 else if (!strcmp(param->name, "left size"))
153 mem->left_size = param->d; 154 {
154 } 155 mem->is_left_size = EINA_TRUE;
155 else if (!strcmp(param->name, "fixed")) 156 mem->left_size = param->d;
156 { 157 }
157 mem->is_fixed = EINA_TRUE; 158 else if (!strcmp(param->name, "fixed"))
158 mem->fixed = param->i; 159 {
159 } 160 mem->is_fixed = EINA_TRUE;
160 161 mem->fixed = param->i;
161 } 162 }
162 163 }
163 return mem; 164
165 return mem;
164} 166}
165 167
166static Evas_Object *external_panes_content_get(void *data __UNUSED__, 168static Evas_Object *
167 const Evas_Object *obj, const char *content) 169external_panes_content_get(void *data __UNUSED__, const Evas_Object *obj,
170 const char *content)
168{ 171{
169 if (!strcmp(content, "left")) 172 if (!strcmp(content, "left"))
170 return elm_panes_content_left_get(obj); 173 return elm_panes_content_left_get(obj);
171 else if (!strcmp(content, "right")) 174 else if (!strcmp(content, "right"))
172 return elm_panes_content_right_get(obj); 175 return elm_panes_content_right_get(obj);
173 176
174 ERR("unknown content '%s'", content); 177 ERR("unknown content '%s'", content);
175 178
176 return NULL; 179 return NULL;
177} 180}
178 181
179 182static void external_panes_params_free(void *params)
180static void external_panes_params_free(void *params) { 183{
181 free(params); 184 free(params);
182} 185}
183 186
184static Edje_External_Param_Info external_panes_params[] = { 187static Edje_External_Param_Info external_panes_params[] = {
185 DEFINE_EXTERNAL_COMMON_PARAMS, 188 DEFINE_EXTERNAL_COMMON_PARAMS,
186 EDJE_EXTERNAL_PARAM_INFO_STRING("content left"), 189 EDJE_EXTERNAL_PARAM_INFO_STRING("content left"),
187 EDJE_EXTERNAL_PARAM_INFO_STRING("content right"), 190 EDJE_EXTERNAL_PARAM_INFO_STRING("content right"),
188 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"), 191 EDJE_EXTERNAL_PARAM_INFO_BOOL("horizontal"),
189 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("left size"), 192 EDJE_EXTERNAL_PARAM_INFO_DOUBLE("left size"),
190 EDJE_EXTERNAL_PARAM_INFO_BOOL("fixed"), 193 EDJE_EXTERNAL_PARAM_INFO_BOOL("fixed"),
191 EDJE_EXTERNAL_PARAM_INFO_SENTINEL 194 EDJE_EXTERNAL_PARAM_INFO_SENTINEL
192}; 195};
193 196
194DEFINE_EXTERNAL_ICON_ADD(panes, "panes"); 197DEFINE_EXTERNAL_ICON_ADD(panes, "panes");