From: Prince Kr Dubey Date: Tue, 7 Dec 2010 02:02:27 +0000 (+0900) Subject: [elm_searchbar & elm_tickernoti] Indentation correction. X-Git-Tag: REL_I9200_20110603-1~599^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=87883e53b00720d2371e0909149062b0abf03ed7;p=framework%2Fuifw%2Felementary.git [elm_searchbar & elm_tickernoti] Indentation correction. --- diff --git a/src/lib/elm_searchbar.c b/src/lib/elm_searchbar.c index 8e3a75d..96225c6 100644 --- a/src/lib/elm_searchbar.c +++ b/src/lib/elm_searchbar.c @@ -75,12 +75,10 @@ static void _clicked(void *data, Evas_Object *obj, void *event_info) elm_entry_cursor_end_set(elm_editfield_entry_get(wd->eb)); if (wd->cancel_btn_show_mode) - { - if (wd->cancel_btn_ani_flag) - edje_object_signal_emit(wd->base, "CANCELIN", "PROG"); - else - edje_object_signal_emit(wd->base, "CANCELSHOW", "PROG"); - } + { + if (wd->cancel_btn_ani_flag) edje_object_signal_emit(wd->base, "CANCELIN", "PROG"); + else edje_object_signal_emit(wd->base, "CANCELSHOW", "PROG"); + } evas_object_smart_callback_call(data, "clicked", NULL); } @@ -101,17 +99,14 @@ static void _cancel_clicked(void *data, Evas_Object *obj, void *event_info) if (!wd) return; if (wd->cancel_btn_show_mode) - { - if (wd->cancel_btn_ani_flag) - edje_object_signal_emit(wd->base, "CANCELOUT", "PROG"); - else - edje_object_signal_emit(wd->base, "CANCELHIDE", "PROG"); - } + { + if (wd->cancel_btn_ani_flag) edje_object_signal_emit(wd->base, "CANCELOUT", "PROG"); + else edje_object_signal_emit(wd->base, "CANCELHIDE", "PROG"); + } const char* text; text = elm_entry_entry_get(elm_editfield_entry_get(wd->eb)); - if (text != NULL && strlen(text) > 0) - elm_entry_entry_set(elm_editfield_entry_get(wd->eb), NULL); + if (text != NULL && strlen(text) > 0) elm_entry_entry_set(elm_editfield_entry_get(wd->eb), NULL); evas_object_smart_callback_call(data, "cancel,clicked", NULL); } @@ -277,12 +272,12 @@ EAPI void elm_searchbar_cancel_button_set(Evas_Object *obj, Eina_Bool visible) else wd->cancel_btn_show_mode = visible; if (!visible) - { - if (wd->cancel_btn_ani_flag) - edje_object_signal_emit(wd->base, "CANCELOUT", "PROG"); - else - edje_object_signal_emit(wd->base, "CANCELHIDE", "PROG"); - } + { + if (wd->cancel_btn_ani_flag) + edje_object_signal_emit(wd->base, "CANCELOUT", "PROG"); + else + edje_object_signal_emit(wd->base, "CANCELHIDE", "PROG"); + } _sizing_eval(obj); } @@ -300,13 +295,12 @@ EAPI void elm_searchbar_clear(Evas_Object *obj) if (!wd) return; if (wd->cancel_btn_show_mode) - { - if (wd->cancel_btn_ani_flag) - edje_object_signal_emit(wd->base, "CANCELOUT", "PROG"); - else - edje_object_signal_emit(wd->base, "CANCELHIDE", "PROG"); - } - + { + if (wd->cancel_btn_ani_flag) + edje_object_signal_emit(wd->base, "CANCELOUT", "PROG"); + else + edje_object_signal_emit(wd->base, "CANCELHIDE", "PROG"); + } // elm_entry_entry_set(elm_editfield_entry_get(wd->eb), NULL); } @@ -328,13 +322,12 @@ EAPI void elm_searchbar_boundary_rect_set(Evas_Object *obj, Eina_Bool boundary) else wd->boundary_mode = boundary; if (wd->boundary_mode) - { - edje_object_signal_emit(wd->base, "BDSHOW", "PROG"); - } + { + edje_object_signal_emit(wd->base, "BDSHOW", "PROG"); + } else - { - edje_object_signal_emit(wd->base, "BDHIDE", "PROG"); - } - + { + edje_object_signal_emit(wd->base, "BDHIDE", "PROG"); + } _sizing_eval(obj); } diff --git a/src/lib/elm_tickernoti.c b/src/lib/elm_tickernoti.c index 1310895..547700c 100644 --- a/src/lib/elm_tickernoti.c +++ b/src/lib/elm_tickernoti.c @@ -11,19 +11,19 @@ typedef struct _Widget_Data Widget_Data; struct _Widget_Data { - Evas_Object *win_indi, - *win_detail, - *edje_indi, - *edje_detail, - *icon_indi, - *icon_detail, - *button_detail; + Evas_Object *win_indi; + Evas_Object *win_detail; + Evas_Object *edje_indi; + Evas_Object *edje_detail; + Evas_Object *icon_indi; + Evas_Object *icon_detail; + Evas_Object *button_detail; - const char *label_indi, - *label_detail; + const char *label_indi; + const char *label_detail; - int indicator_height, - angle; + int indicator_height; + int angle; Elm_Tickernoti_Mode mode; }; @@ -36,8 +36,8 @@ static void _sizing_eval(Evas_Object *obj); static void _del_job(void *data) { - Evas_Object *obj = data; - evas_object_del(obj); + Evas_Object *obj = data; + evas_object_del(obj); } static void @@ -47,10 +47,8 @@ _del_hook(Evas_Object *obj) if (!wd) return; Evas_Object *p = elm_widget_parent_get(obj); - if (p == wd->win_indi) { - ecore_job_add (_del_job, p); - } - + if (p == wd->win_indi) ecore_job_add (_del_job, p); + evas_object_del (wd->edje_indi); wd->edje_indi = NULL; evas_object_del (wd->edje_detail); @@ -94,40 +92,38 @@ _sizing_eval(Evas_Object *obj) static void _make_notification_window (Evas_Object *obj) { - Ecore_X_Window xwin; - - /* elm_win_xwindow_get() must call after elm_win_alpha_set() */ - xwin = elm_win_xwindow_get (obj); - ecore_x_netwm_window_type_set (xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); + Ecore_X_Window xwin; +/* elm_win_xwindow_get() must call after elm_win_alpha_set() */ + xwin = elm_win_xwindow_get (obj); + ecore_x_netwm_window_type_set (xwin, ECORE_X_WINDOW_TYPE_NOTIFICATION); } static void _detail_show_cb (void *data, Evas_Object *obj, const char *emission, const char *source) { - evas_object_smart_callback_call ((Evas_Object *)data, "detail,show", NULL); + evas_object_smart_callback_call ((Evas_Object *)data, "detail,show", NULL); } static void _detail_hide_cb (void *data, Evas_Object *obj, const char *emission, const char *source) { - evas_object_smart_callback_call ((Evas_Object *)data, "detail,hide", NULL); + evas_object_smart_callback_call ((Evas_Object *)data, "detail,hide", NULL); } static Evas_Object *_create_window (Evas_Object *parent, const char *name) { - Evas_Object *win; - - win = elm_win_add (parent, name, ELM_WIN_BASIC); - - /* Property */ - elm_win_title_set (win, name); - elm_win_borderless_set (win, EINA_TRUE); - elm_win_autodel_set (win, EINA_TRUE); - elm_win_alpha_set (win, EINA_TRUE); - - /* set top window */ - _make_notification_window (win); - - return win; + Evas_Object *win; + + win = elm_win_add (parent, name, ELM_WIN_BASIC); +/* Property */ + elm_win_title_set (win, name); + elm_win_borderless_set (win, EINA_TRUE); + elm_win_autodel_set (win, EINA_TRUE); + elm_win_alpha_set (win, EINA_TRUE); + +/* set top window */ + _make_notification_window (win); + + return win; } static void @@ -154,7 +150,7 @@ _create_tickernoti_indi (Evas_Object *obj) /* tickernoti indicator height set */ data_win_height = (char *)edje_object_data_get (wd->edje_indi, "height"); if (data_win_height != NULL && elm_scale_get() > 0.0) - wd->indicator_height = (int)(elm_scale_get() * atoi(data_win_height)); + wd->indicator_height = (int)(elm_scale_get() * atoi(data_win_height)); evas_object_resize (wd->win_indi, w, wd->indicator_height); @@ -192,18 +188,20 @@ _show(void *data, Evas *e, Evas_Object *obj, void *event_info) Widget_Data *wd = elm_widget_data_get(obj); if (!wd) return; - if (wd->mode == ELM_TICKERNOTI_DEFAULT) { - evas_object_hide (wd->win_detail); - _make_notification_window (wd->win_indi); - evas_object_show (wd->win_indi); - edje_object_signal_emit (wd->edje_indi, "effect,show", "bg_1line"); - } - else if (wd->mode == ELM_TICKERNOTI_DETAILVIEW) { - evas_object_hide (wd->win_indi); - _make_notification_window (wd->win_detail); - evas_object_show (wd->win_detail); - edje_object_signal_emit (wd->edje_detail, "effect,show", "bg_2line"); - } + if (wd->mode == ELM_TICKERNOTI_DEFAULT) + { + evas_object_hide (wd->win_detail); + _make_notification_window (wd->win_indi); + evas_object_show (wd->win_indi); + edje_object_signal_emit (wd->edje_indi, "effect,show", "bg_1line"); + } + else if (wd->mode == ELM_TICKERNOTI_DETAILVIEW) + { + evas_object_hide (wd->win_indi); + _make_notification_window (wd->win_detail); + evas_object_show (wd->win_detail); + edje_object_signal_emit (wd->edje_detail, "effect,show", "bg_2line"); + } } static void @@ -237,8 +235,7 @@ elm_tickernoti_add(Evas_Object *parent) wd->win_indi = _create_window (parent, "indi"); wd->win_detail = _create_window (parent, "detail"); - if (!parent) - parent = wd->win_indi; + if (!parent) parent = wd->win_indi; e = evas_object_evas_get(parent); obj = elm_widget_add(e); @@ -482,57 +479,56 @@ elm_tickernoti_rotation_set (const Evas_Object *obj, int angle) Evas_Coord root_w, root_h; /* - * manual calculate win_tickernoti_indi window position & size - * - win_indi is not full size window (480 x 27) - */ + * manual calculate win_tickernoti_indi window position & size + * - win_indi is not full size window (480 x 27) + */ ecore_x_window_size_get (ecore_x_window_root_first_get(), &root_w, &root_h); evas_object_geometry_get (wd->win_indi, &x, &y, &w, &h); /* rotate win */ - switch (angle) { - case 90: - w = root_h; - h = wd->indicator_height; - x = 0; - y = 0; - break; - - case -90: - w = root_h; - h = wd->indicator_height; - x = root_w-h; - y = 0; - break; - - case 180: - w = root_w; - h = wd->indicator_height; - x = 0; - y = root_h-h; - break; - - default: - case 0: - w = root_w; - h = wd->indicator_height; - x = 0; - y = 0; - break; - } - - /* indicator */ - elm_win_rotation_with_resize_set (wd->win_indi, angle); - evas_object_move (wd->win_indi, x, y); - evas_object_resize (wd->win_indi, w, h); - if (evas_object_visible_get (wd->win_indi)) { - _make_notification_window (wd->win_indi); - } - - /* detail */ - elm_win_rotation_with_resize_set (wd->win_detail, angle); - if (evas_object_visible_get (wd->win_detail)) { - _make_notification_window (wd->win_detail); - } + switch (angle) + { + case 90: + w = root_h; + h = wd->indicator_height; + x = 0; + y = 0; + break; + case -90: + w = root_h; + h = wd->indicator_height; + x = root_w-h; + y = 0; + break; + case 180: + w = root_w; + h = wd->indicator_height; + x = 0; + y = root_h-h; + break; + default: + case 0: + w = root_w; + h = wd->indicator_height; + x = 0; + y = 0; + break; + } + +/* indicator */ + elm_win_rotation_with_resize_set (wd->win_indi, angle); + evas_object_move (wd->win_indi, x, y); + evas_object_resize (wd->win_indi, w, h); + if (evas_object_visible_get (wd->win_indi)) + { + _make_notification_window (wd->win_indi); + } +/* detail */ + elm_win_rotation_with_resize_set (wd->win_detail, angle); + if (evas_object_visible_get (wd->win_detail)) + { + _make_notification_window (wd->win_detail); + } } /**