summaryrefslogtreecommitdiff
path: root/legacy/elementary
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-29 06:26:16 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-03-29 06:26:16 +0000
commitf009f6667eb649a5ea1e63a8e968f54795494709 (patch)
treee96b9d1171eb3e6657ed79fe6922e5297ebd9bcd /legacy/elementary
parent12489b43df4f93e8fbd4017d3cdc3d8de96753b8 (diff)
elm conform: Revised code. More proper NULL check and aded spacing.
SVN revision: 69717
Diffstat (limited to 'legacy/elementary')
-rw-r--r--legacy/elementary/src/lib/elm_conform.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/legacy/elementary/src/lib/elm_conform.c b/legacy/elementary/src/lib/elm_conform.c
index b88ff3eb3d..913874b02c 100644
--- a/legacy/elementary/src/lib/elm_conform.c
+++ b/legacy/elementary/src/lib/elm_conform.c
@@ -84,6 +84,7 @@ _del_pre_hook(Evas_Object *obj)
84{ 84{
85 Widget_Data *wd = elm_widget_data_get(obj); 85 Widget_Data *wd = elm_widget_data_get(obj);
86 if (!wd) return; 86 if (!wd) return;
87
87#ifdef HAVE_ELEMENTARY_X 88#ifdef HAVE_ELEMENTARY_X
88 if (wd->prop_hdl) ecore_event_handler_del(wd->prop_hdl); 89 if (wd->prop_hdl) ecore_event_handler_del(wd->prop_hdl);
89#endif 90#endif
@@ -93,8 +94,8 @@ static void
93_del_hook(Evas_Object *obj) 94_del_hook(Evas_Object *obj)
94{ 95{
95 Widget_Data *wd = elm_widget_data_get(obj); 96 Widget_Data *wd = elm_widget_data_get(obj);
96
97 if (!wd) return; 97 if (!wd) return;
98
98 if (wd->show_region_job) ecore_job_del(wd->show_region_job); 99 if (wd->show_region_job) ecore_job_del(wd->show_region_job);
99 free(wd); 100 free(wd);
100} 101}
@@ -103,8 +104,8 @@ static void
103_mirrored_set(Evas_Object *obj, Eina_Bool rtl) 104_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
104{ 105{
105 Widget_Data *wd = elm_widget_data_get(obj); 106 Widget_Data *wd = elm_widget_data_get(obj);
106
107 if (!wd) return; 107 if (!wd) return;
108
108 edje_object_mirrored_set(wd->base, rtl); 109 edje_object_mirrored_set(wd->base, rtl);
109} 110}
110 111
@@ -112,8 +113,8 @@ static void
112_theme_hook(Evas_Object *obj) 113_theme_hook(Evas_Object *obj)
113{ 114{
114 Widget_Data *wd = elm_widget_data_get(obj); 115 Widget_Data *wd = elm_widget_data_get(obj);
115
116 if (!wd) return; 116 if (!wd) return;
117
117 _elm_widget_mirrored_reload(obj); 118 _elm_widget_mirrored_reload(obj);
118 _mirrored_set(obj, elm_widget_mirrored_get(obj)); 119 _mirrored_set(obj, elm_widget_mirrored_get(obj));
119 _elm_theme_object_set(obj, wd->base, "conformant", "base", 120 _elm_theme_object_set(obj, wd->base, "conformant", "base",
@@ -169,6 +170,7 @@ _content_unset_hook(Evas_Object *obj, const char *part)
169 if (part && strcmp(part, "default")) return NULL; 170 if (part && strcmp(part, "default")) return NULL;
170 wd = elm_widget_data_get(obj); 171 wd = elm_widget_data_get(obj);
171 if ((!wd) || (!wd->content)) return NULL; 172 if ((!wd) || (!wd->content)) return NULL;
173
172 content = wd->content; 174 content = wd->content;
173 elm_widget_sub_object_del(obj, wd->content); 175 elm_widget_sub_object_del(obj, wd->content);
174 evas_object_event_callback_del_full(content, 176 evas_object_event_callback_del_full(content,
@@ -184,8 +186,8 @@ _sizing_eval(Evas_Object *obj)
184{ 186{
185 Widget_Data *wd = elm_widget_data_get(obj); 187 Widget_Data *wd = elm_widget_data_get(obj);
186 Evas_Coord mw = -1, mh = -1; 188 Evas_Coord mw = -1, mh = -1;
187
188 if (!wd) return; 189 if (!wd) return;
190
189 edje_object_size_min_calc(wd->base, &mw, &mh); 191 edje_object_size_min_calc(wd->base, &mw, &mh);
190 evas_object_size_hint_min_set(obj, mw, mh); 192 evas_object_size_hint_min_set(obj, mw, mh);
191 evas_object_size_hint_max_set(obj, -1, -1); 193 evas_object_size_hint_max_set(obj, -1, -1);
@@ -260,7 +262,6 @@ _conformant_part_sizing_eval(Evas_Object *obj, Conformant_Part_Type part_type)
260 Evas_Object *top; 262 Evas_Object *top;
261 int sx = -1, sy = -1, sw = -1, sh = -1; 263 int sx = -1, sy = -1, sw = -1, sh = -1;
262 Widget_Data *wd = elm_widget_data_get(obj); 264 Widget_Data *wd = elm_widget_data_get(obj);
263
264 if (!wd) return; 265 if (!wd) return;
265 266
266 top = elm_widget_top_get(obj); 267 top = elm_widget_top_get(obj);
@@ -337,6 +338,8 @@ _swallow_conformant_parts(Evas_Object *obj)
337{ 338{
338 Widget_Data *wd = elm_widget_data_get(obj); 339 Widget_Data *wd = elm_widget_data_get(obj);
339 Evas *e = evas_object_evas_get(obj); 340 Evas *e = evas_object_evas_get(obj);
341 if (!wd || !e) return;
342
340 wd->scroller = NULL; 343 wd->scroller = NULL;
341 344
342 //Indicator 345 //Indicator
@@ -399,8 +402,8 @@ _changed_size_hints(void *data, Evas *e __UNUSED__,
399 void *event_info __UNUSED__) 402 void *event_info __UNUSED__)
400{ 403{
401 Widget_Data *wd = elm_widget_data_get(data); 404 Widget_Data *wd = elm_widget_data_get(data);
402
403 if (!wd) return; 405 if (!wd) return;
406
404 _sizing_eval(data); 407 _sizing_eval(data);
405} 408}
406 409
@@ -409,7 +412,8 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
409{ 412{
410 Widget_Data *wd = elm_widget_data_get(obj); 413 Widget_Data *wd = elm_widget_data_get(obj);
411 Evas_Object *sub = event_info; 414 Evas_Object *sub = event_info;
412if (!wd) return; 415 if (!wd) return;
416
413 if (sub == wd->content) 417 if (sub == wd->content)
414 { 418 {
415 evas_object_event_callback_del_full(sub, 419 evas_object_event_callback_del_full(sub,
@@ -478,8 +482,8 @@ _conformant_move_resize_event_cb(void *data __UNUSED__, Evas *e __UNUSED__,
478{ 482{
479 Conformant_Part_Type part_type; 483 Conformant_Part_Type part_type;
480 Widget_Data *wd = elm_widget_data_get(obj); 484 Widget_Data *wd = elm_widget_data_get(obj);
481
482 if (!wd) return; 485 if (!wd) return;
486
483 part_type = (ELM_CONFORM_INDICATOR_PART | 487 part_type = (ELM_CONFORM_INDICATOR_PART |
484 ELM_CONFORM_SOFTKEY_PART | 488 ELM_CONFORM_SOFTKEY_PART |
485 ELM_CONFORM_VIRTUAL_KEYPAD_PART | 489 ELM_CONFORM_VIRTUAL_KEYPAD_PART |
@@ -494,8 +498,8 @@ _content_resize_event_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj
494{ 498{
495 Evas_Object *conformant = (Evas_Object *)data; 499 Evas_Object *conformant = (Evas_Object *)data;
496 Widget_Data *wd = elm_widget_data_get(conformant); 500 Widget_Data *wd = elm_widget_data_get(conformant);
497
498 if (!wd) return; 501 if (!wd) return;
502
499#ifdef HAVE_ELEMENTARY_X 503#ifdef HAVE_ELEMENTARY_X
500 if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return; 504 if (wd->vkb_state == ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF) return;
501#endif 505#endif
@@ -510,7 +514,6 @@ _show_region_job(void *data)
510 Evas_Object *focus_obj; 514 Evas_Object *focus_obj;
511 Evas_Object *conformant = (Evas_Object *)data; 515 Evas_Object *conformant = (Evas_Object *)data;
512 Widget_Data *wd = elm_widget_data_get(conformant); 516 Widget_Data *wd = elm_widget_data_get(conformant);
513
514 if (!wd) return; 517 if (!wd) return;
515 518
516 focus_obj = elm_widget_focused_object_get(conformant); 519 focus_obj = elm_widget_focused_object_get(conformant);
@@ -538,7 +541,6 @@ _update_autoscroll_objs(void *data)
538 Evas_Object *sub, *top_scroller = NULL; 541 Evas_Object *sub, *top_scroller = NULL;
539 Evas_Object *conformant = (Evas_Object *)data; 542 Evas_Object *conformant = (Evas_Object *)data;
540 Widget_Data *wd = elm_widget_data_get(data); 543 Widget_Data *wd = elm_widget_data_get(data);
541
542 if (!wd) return; 544 if (!wd) return;
543 545
544 sub = elm_widget_focused_object_get(conformant); 546 sub = elm_widget_focused_object_get(conformant);