From ca1c9045d7a84a81ef44b464e004608726043c66 Mon Sep 17 00:00:00 2001 From: YoungHun Cho Date: Wed, 14 Dec 2016 19:10:28 +0900 Subject: add moments bar widget Change-Id: Ic04944edb6b28da4eb24ffd4561e0b558e1a263b Signed-off-by: YoungHun Cho --- home/CMakeLists.txt | 7 +- home/include/add-viewer.h | 1 + home/include/animator.h | 32 +++ home/include/apps/apps_animator.h | 32 --- home/include/apps/apps_view_conf.h | 42 +--- home/include/apps/apps_view_edje_conf.h | 2 +- home/include/common_conf.h | 41 +++ home/include/conf.h | 4 +- home/include/main.h | 0 home/include/moments/moments.h | 33 +++ home/include/moments/moments_view.h | 33 +++ home/include/moments/moments_view_conf.h | 32 +++ home/include/moments/moments_view_edje_conf.h | 29 +++ home/include/scroller.h | 3 +- home/res/edje/circle/apps_base_layout_circle.edc | 6 +- home/res/edje/circle/moments_layout.edc | 97 ++++++++ home/src/add-viewer.c | 13 +- home/src/animator.c | 99 ++++++++ home/src/apps/apps_animator.c | 99 -------- home/src/apps/apps_rotary_event_handler.c | 4 +- home/src/apps/apps_view_base.c | 9 +- home/src/apps/apps_view_circle.c | 14 +- home/src/apps/apps_view_circle_animator.c | 14 +- home/src/apps/apps_view_circle_icon_page.c | 6 +- home/src/apps/apps_view_circle_touch_handler.c | 4 +- home/src/apps/apps_view_conf.c | 65 ----- home/src/common_conf.c | 63 +++++ home/src/key.c | 1 - home/src/layout.c | 35 ++- home/src/main.c | 24 +- home/src/moments/moments_manager.c | 112 +++++++++ home/src/moments/moments_view.c | 302 +++++++++++++++++++++++ home/src/moments/moments_view_animator.c | 121 +++++++++ home/src/scroller.c | 5 + home/src/win.c | 89 +------ 35 files changed, 1108 insertions(+), 365 deletions(-) mode change 100644 => 100755 home/include/add-viewer.h create mode 100755 home/include/animator.h delete mode 100755 home/include/apps/apps_animator.h create mode 100755 home/include/common_conf.h mode change 100644 => 100755 home/include/conf.h mode change 100644 => 100755 home/include/main.h create mode 100755 home/include/moments/moments.h create mode 100755 home/include/moments/moments_view.h create mode 100755 home/include/moments/moments_view_conf.h create mode 100755 home/include/moments/moments_view_edje_conf.h mode change 100644 => 100755 home/include/scroller.h create mode 100755 home/res/edje/circle/moments_layout.edc mode change 100644 => 100755 home/src/add-viewer.c create mode 100755 home/src/animator.c delete mode 100755 home/src/apps/apps_animator.c delete mode 100755 home/src/apps/apps_view_conf.c create mode 100755 home/src/common_conf.c mode change 100644 => 100755 home/src/key.c create mode 100755 home/src/moments/moments_manager.c create mode 100755 home/src/moments/moments_view.c create mode 100755 home/src/moments/moments_view_animator.c mode change 100644 => 100755 home/src/win.c diff --git a/home/CMakeLists.txt b/home/CMakeLists.txt index eda93a8..06bd825 100755 --- a/home/CMakeLists.txt +++ b/home/CMakeLists.txt @@ -169,7 +169,8 @@ ADD_EXECUTABLE(${PROJECT_NAME} src/add-viewer_index.c src/wms.c src/screen_reader_handler.c - src/apps/apps_animator.c + src/common_conf.c + src/animator.c src/apps/apps_conf.c src/apps/apps_control_manager.c src/apps/apps_callback_manager.c @@ -184,7 +185,6 @@ ADD_EXECUTABLE(${PROJECT_NAME} src/apps/apps_view_circle_icon.c src/apps/apps_view_circle_icon_page.c src/apps/apps_view_circle_animator.c - src/apps/apps_view_conf.c src/apps/apps_state.c src/apps/apps_state_normal.c src/apps/apps_state_edit.c @@ -206,6 +206,9 @@ ADD_EXECUTABLE(${PROJECT_NAME} src/notification/noti_panel_stack_view.c src/notification/noti_detail_view.c src/notification/noti_action_buttons_view.c + src/moments/moments_manager.c + src/moments/moments_view.c + src/moments/moments_view_animator.c ) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKGS_LDFLAGS} ${EXTRA_LDFLAGS} -lm -Wl,--hash-style=both -Wl,--as-needed -pie ) diff --git a/home/include/add-viewer.h b/home/include/add-viewer.h old mode 100644 new mode 100755 index 893d415..54f6f1d --- a/home/include/add-viewer.h +++ b/home/include/add-viewer.h @@ -25,6 +25,7 @@ #define APPSHORTCUT_WIDGET_ID "com.samsung.app-widget.dbox" #define APPSHORTCUT_WIDGET_PREVIEW RESDIR"/widget_preview/appshortcut/apps_widget_preview.png" #define APPSHORTCUT_WIDGET_LOCALE_PREVIEW RESDIR"/widget_preview/appshortcut/%s/apps_widget_preview.png" +#define MOMENTS_WIDGET_ID "org.tizen.windicator" struct add_viewer_event_info { struct { diff --git a/home/include/animator.h b/home/include/animator.h new file mode 100755 index 0000000..6ad84b2 --- /dev/null +++ b/home/include/animator.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __APPS_ANIMATOR_H__ +#define __APPS_ANIMATOR_H__ + +#include + +typedef enum { + ANIMATION_OPTION_DEFAULT = 0, + ANIMATION_OPTION_PUSING = 1, +} ANIMATOR_OPTION; + +bool animator_is_ongoing(void); +void animator_start(void(*stop_cb)(void)); +void animator_complete(void); +void animator_stop(void); + +#endif diff --git a/home/include/apps/apps_animator.h b/home/include/apps/apps_animator.h deleted file mode 100755 index 30dc5ce..0000000 --- a/home/include/apps/apps_animator.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. - * - * Licensed under the Flora License, Version 1.1 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef __APPS_ANIMATOR_H__ -#define __APPS_ANIMATOR_H__ - -#include - -typedef enum { - ANIMATION_OPTION_DEFAULT = 0, - ANIMATION_OPTION_PUSING = 1, -} ANIMATOR_OPTION; - -bool apps_animator_is_ongoing(void); -void apps_animator_start(void(*stop_cb)(void)); -void apps_animator_complete(void); -void apps_animator_stop(void); - -#endif diff --git a/home/include/apps/apps_view_conf.h b/home/include/apps/apps_view_conf.h index 58d78c4..4bae5d2 100755 --- a/home/include/apps/apps_view_conf.h +++ b/home/include/apps/apps_view_conf.h @@ -17,50 +17,37 @@ #ifndef __APPS_VIEW_CONF_H__ #define __APPS_VIEW_CONF_H__ -#include +#include "common_conf.h" -extern double _get_resolution_scale_h(); -extern double _get_resolution_scale_w(); -extern int _get_window_h(); -extern int _get_window_w(); - -#define WINDOW_H _get_window_h() -#define WINDOW_W _get_window_w() -#define WINDOW_CENTER_X (WINDOW_W/2) -#define WINDOW_CENTER_Y (WINDOW_H/2) - -#define OUTSIDE_X (-(WINDOW_W + WINDOW_W)) -#define OUTSIDE_Y (-(WINDOW_H + WINDOW_H)) - -#define TEXT_SIZE_FOCUS_LABEL (int)((31) * (_get_resolution_scale_h())) +#define TEXT_SIZE_FOCUS_LABEL (int)((31) * (SCALE_H)) #define APPS_INDICATOR_MAX_COUNT 6 -#define APPS_INDICATOR_UNIT_W (int)((19) * (_get_resolution_scale_w())) +#define APPS_INDICATOR_UNIT_W (int)((19) * (SCALE_W)) #define APPS_INDICATOR_UNIT_H APPS_INDICATOR_UNIT_W -#define APPS_INDICATOR_UNIT_RADIUS (int)((167) * (_get_resolution_scale_h())) +#define APPS_INDICATOR_UNIT_RADIUS (int)((167) * (SCALE_H)) #define APPS_INDICATOR_UNIT_ANGLE (6.7) -#define APPS_ICON_W (int)((62) * (_get_resolution_scale_w())) +#define APPS_ICON_W (int)((62) * (SCALE_W)) #define APPS_ICON_H APPS_ICON_W -#define APPS_ICON_RADIUS (int)((139) * (_get_resolution_scale_h())) +#define APPS_ICON_RADIUS (int)((139) * (SCALE_H)) #define APPS_ICON_COUNT_PER_PAGE 10 #define APPS_ICON_BASE_ANGLE 32.7 -#define APPS_ICON_BADGE_W (int)((30) * (_get_resolution_scale_w())) +#define APPS_ICON_BADGE_W (int)((30) * (SCALE_W)) #define APPS_ICON_BADGE_H APPS_ICON_BADGE_W -#define APPS_ICON_EDIT_BTN_W (int)((30) * (_get_resolution_scale_w())) +#define APPS_ICON_EDIT_BTN_W (int)((30) * (SCALE_W)) #define APPS_ICON_EDIT_BTN_H APPS_ICON_EDIT_BTN_W -#define APPS_ICON_PICKED_MOVE_OFFSET_W (int)((19) * (_get_resolution_scale_w())) +#define APPS_ICON_PICKED_MOVE_OFFSET_W (int)((19) * (SCALE_W)) #define APPS_ICON_PICKED_MOVE_OFFSET_H APPS_ICON_PICKED_MOVE_OFFSET_W #define APPS_ICON_FOCUS_ANIMATION_TIME 0.2 -#define APPS_FOCUS_POINT_W (int)((28) * (_get_resolution_scale_w())) +#define APPS_FOCUS_POINT_W (int)((28) * (SCALE_W)) #define APPS_FOCUS_POINT_H APPS_FOCUS_POINT_W -#define APPS_FOCUS_POINT_RADIUS (int)((85) * (_get_resolution_scale_h())) +#define APPS_FOCUS_POINT_RADIUS (int)((85) * (SCALE_H)) -#define APPS_FOCUS_TEXT_RADIUS (int)((77) * (_get_resolution_scale_h())) -#define APPS_EMPTY_AREA_RADIUS (int)((97) * (_get_resolution_scale_h())) +#define APPS_FOCUS_TEXT_RADIUS (int)((77) * (SCALE_H)) +#define APPS_EMPTY_AREA_RADIUS (int)((97) * (SCALE_H)) #define APPS_TOUCH_AREA_COUNT 14 #define APPS_TOUCH_MOVE_MIN_DISTANCE 30 @@ -75,7 +62,4 @@ extern int _get_window_w(); #define APPS_ICON_MOVE_TIME 0.07 #define APPS_ICON_PUSH_TIME 0.2 -void apps_view_conf_set_resolution(int w, int h); -bool apps_view_conf_is_supported_resolution(int w, int h); - #endif diff --git a/home/include/apps/apps_view_edje_conf.h b/home/include/apps/apps_view_edje_conf.h index 023add0..c510925 100755 --- a/home/include/apps/apps_view_edje_conf.h +++ b/home/include/apps/apps_view_edje_conf.h @@ -21,7 +21,7 @@ #define SIZE_SETTER "size_setter" #define BASE_GRID "base_grid" -#define FOCUS_TEXT "focus_text" +#define APPS_FOCUS_TEXT "apps_focus_text" #define APPS_INDICATOR "apps_indicator" #define APPS_INDICATOR_LAYOUT "apps_indicator_layout" #define APPS_INDICATOR_GRID "apps_indicator_grid" diff --git a/home/include/common_conf.h b/home/include/common_conf.h new file mode 100755 index 0000000..147fb8e --- /dev/null +++ b/home/include/common_conf.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __COMMON_CONF_H__ +#define __COMMON_CONF_H__ + +#include + +extern double _get_resolution_scale_h(); +extern double _get_resolution_scale_w(); +extern int _get_window_h(); +extern int _get_window_w(); + +#define WINDOW_H (_get_window_h()) +#define WINDOW_W (_get_window_w()) +#define WINDOW_CENTER_X (WINDOW_W/2) +#define WINDOW_CENTER_Y (WINDOW_H/2) + +#define OUTSIDE_X (-(WINDOW_W + WINDOW_W)) +#define OUTSIDE_Y (-(WINDOW_H + WINDOW_H)) + +#define SCALE_H (_get_resolution_scale_h()) +#define SCALE_W (_get_resolution_scale_w()) + +void conf_set_resolution(int w, int h); +bool conf_is_supported_resolution(int w, int h); + +#endif diff --git a/home/include/conf.h b/home/include/conf.h old mode 100644 new mode 100755 index 0e5dcd0..0a1b5a3 --- a/home/include/conf.h +++ b/home/include/conf.h @@ -1,5 +1,4 @@ /* - * w-home * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. * * Licensed under the Flora License, Version 1.1 (the License); @@ -162,5 +161,4 @@ #define BUTTON_STYLE_POPUP "popup" #endif -#endif // _W_HOME_CONF_H_ -// End of file +#endif diff --git a/home/include/main.h b/home/include/main.h old mode 100644 new mode 100755 diff --git a/home/include/moments/moments.h b/home/include/moments/moments.h new file mode 100755 index 0000000..a0c3ea7 --- /dev/null +++ b/home/include/moments/moments.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MOMENTS_H__ +#define __MOMENTS_H__ + +#include + +bool moments_get_visible(void); + +void moments_init(Evas_Object *win, Evas_Object *bg_scroller); +void moments_fini(void); + +void moments_show(void); +void moments_hide(void); + +void moments_draw(int x, int y); +void moments_put_down(int x, int y); + +#endif diff --git a/home/include/moments/moments_view.h b/home/include/moments/moments_view.h new file mode 100755 index 0000000..7a584ef --- /dev/null +++ b/home/include/moments/moments_view.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MOMENTS_VIEW_H__ +#define __MOMENTS_VIEW_H__ + +#include +#include + +Evas_Object *moments_create_ui(Evas_Object *base_win); +void moments_destroy_ui(void); + +bool moments_view_show(void); +bool moments_view_hide(void); + +void moments_view_draw(int x, int y); +void moments_view_draw_down(int x, int y); +void moments_view_draw_up(int x, int y); + +#endif diff --git a/home/include/moments/moments_view_conf.h b/home/include/moments/moments_view_conf.h new file mode 100755 index 0000000..c6f7664 --- /dev/null +++ b/home/include/moments/moments_view_conf.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MOMENTS_VIEW_CONF_H__ +#define __MOMENTS_VIEW_CONF_H__ + +#include "common_conf.h" + +#define MOMENTS_INIT_H (int)((65) * (SCALE_H)) +#define MOMENT_DRAW_DOWN_LIMIT_Y (int)((90) * (SCALE_H)) +#define MOMENT_DRAW_UP_LIMIT_Y (int)((180) * (SCALE_H)) +#define MOMENT_DRAW_HANDLER_H (int)((50) * (SCALE_H)) +#define MOMENT_DRAW_LIMIT (int)((15) * (SCALE_H)) + +#define MOMENTS_ANIMATION_INTERVAL 0.01 +#define MOMENTS_ANIMATION_SHOW_TIME 0.03 +#define MOMENTS_ANIMATION_DRAW_TIME 0.05 + +#endif diff --git a/home/include/moments/moments_view_edje_conf.h b/home/include/moments/moments_view_edje_conf.h new file mode 100755 index 0000000..000ae12 --- /dev/null +++ b/home/include/moments/moments_view_edje_conf.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MOMENTS_VIEW_EDJE_CONF_H__ +#define __MOMENTS_VIEW_EDJE_CONF_H__ + +#define BASE_LAYOUT "base_layout" +#define SIZE_SETTER "size_setter" +#define MOMENTS_BG "moments_bg" +#define MOMENTS_CONTENT "moments_content" + +#define SIGNAL_SOURCE "signal_source" +#define SIGNAL_MOMENTS_FREEZE_TOUCH "signal_moments_freeze_touch" +#define SIGNAL_MOMENTS_UNFREEZE_TOUCH "signal_moments_unfreeze_touch" + +#endif diff --git a/home/include/scroller.h b/home/include/scroller.h old mode 100644 new mode 100755 index 64835d4..1a4d8a9 --- a/home/include/scroller.h +++ b/home/include/scroller.h @@ -1,5 +1,4 @@ /* - * w-home * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. * * Licensed under the Flora License, Version 1.1 (the License); @@ -18,6 +17,8 @@ #ifndef __W_HOME_SCROLLER_H__ #define __W_HOME_SCROLLER_H__ +#include "scroller_info.h" + /* * FIRST - ... - CENTER_LEFT - CENTER_NEIGHBOR_LEFT - CENTER - CENTER_NEIGHBOR_RIGHT - CENTER_RIGHT - ... - LAST * If there is no center page, diff --git a/home/res/edje/circle/apps_base_layout_circle.edc b/home/res/edje/circle/apps_base_layout_circle.edc index 712f386..d91e9db 100755 --- a/home/res/edje/circle/apps_base_layout_circle.edc +++ b/home/res/edje/circle/apps_base_layout_circle.edc @@ -44,7 +44,7 @@ collections { } } part { - name: FOCUS_TEXT; + name: APPS_FOCUS_TEXT; type: TEXTBLOCK; description { state: "default" 0.0; @@ -72,14 +72,14 @@ collections { signal: SIGNAL_APPS_FOCUS_TEXT_PRESSED; source: SIGNAL_SOURCE; action: STATE_SET "pressed" 0.0; - target: FOCUS_TEXT; + target: APPS_FOCUS_TEXT; } program { name: "focus,text,released"; signal: SIGNAL_APPS_FOCUS_TEXT_RELEASED; source: SIGNAL_SOURCE; action: STATE_SET "default" 0.0; - target: FOCUS_TEXT; + target: APPS_FOCUS_TEXT; } } } diff --git a/home/res/edje/circle/moments_layout.edc b/home/res/edje/circle/moments_layout.edc new file mode 100755 index 0000000..2f6bb99 --- /dev/null +++ b/home/res/edje/circle/moments_layout.edc @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2013 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "../../../include/moments/moments_view_edje_conf.h" + +images { + image: "masking_bg.png" COMP; +} + +collections { + group { BASE_LAYOUT; + parts { + part { + name: SIZE_SETTER; + type: SWALLOW; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + align: 0 0; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + part { + name: MOMENTS_BG; + type: IMAGE; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: SIZE_SETTER; } + rel2 { relative: 1.0 1.0; to: SIZE_SETTER; } + image { normal: "masking_bg.png"; } + color: 0 0 0 255; + } + } + part { + name: MOMENTS_CONTENT; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: SIZE_SETTER; } + rel2 { relative: 1.0 1.0; to: SIZE_SETTER; } + } + } + part { + name: "touch,block"; + type: RECT; + mouse_events: 1; + repeat_events: 0; + description { + state: "default" 0.0; + color: 0 0 0 0; + visible: 1; + rel1{relative: 0.0 0.0; to: SIZE_SETTER;} + rel2{relative: 1.0 1.0; to: SIZE_SETTER;} + } + description { + state: "unblock" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + } + programs { + program { + name: "touch,freeze"; + signal: SIGNAL_MOMENTS_FREEZE_TOUCH; + source: SIGNAL_SOURCE; + action: STATE_SET "default" 0.0; + target: "touch,block"; + } + program { + name: "touch,unfreeze"; + signal: SIGNAL_MOMENTS_UNFREEZE_TOUCH; + source: SIGNAL_SOURCE; + action: STATE_SET "unblock" 0.0; + target: "touch,block"; + } + } + } +} \ No newline at end of file diff --git a/home/src/add-viewer.c b/home/src/add-viewer.c old mode 100644 new mode 100755 index a03da51..c94d622 --- a/home/src/add-viewer.c +++ b/home/src/add-viewer.c @@ -144,6 +144,10 @@ static Eina_Bool normal_loader_cb(struct widget_data *widget_data, void *contain goto out; } } + + if (!strcmp(widget_id, MOMENTS_WIDGET_ID)) { + goto out; + } } int max_instance = add_viewer_package_get_max_instance_count(package); @@ -964,7 +968,6 @@ static Evas_Object *winset_preview_add(struct widget_data *widget_data, Evas_Obj int w; int h; int ret; - int idx; char *filename = NULL; Evas_Object *bg; char buf[512] = {0, }; @@ -1000,12 +1003,10 @@ static Evas_Object *winset_preview_add(struct widget_data *widget_data, Evas_Obj case WIDGET_SIZE_TYPE_1x1: size_str = "preview,1x1"; icon_group = "default,1x1"; - idx = 8; break; case WIDGET_SIZE_TYPE_2x2: size_str = "preview,2x2"; icon_group = "default,2x2"; - idx = 8; break; case WIDGET_SIZE_TYPE_2x1: case WIDGET_SIZE_TYPE_4x1: @@ -1173,11 +1174,6 @@ static Evas_Object *winset_preview_add(struct widget_data *widget_data, Evas_Obj evas_object_event_callback_add(preview, EVAS_CALLBACK_MOUSE_UP, preview_up_cb, click_cbdata); evas_object_event_callback_add(preview, EVAS_CALLBACK_DEL, del_cb, click_cbdata); -#if 0 - winset_access_object_add(parent, preview, size_str + idx, add_viewer_package_list_name(package)); -#endif - -#if 1 page_info_s *page_info = calloc(1, sizeof(page_info_s)); if (!page_info) { DbgPrint("Failed to allocate page info"); @@ -1203,7 +1199,6 @@ static Evas_Object *winset_preview_add(struct widget_data *widget_data, Evas_Obj page_info->access_info = access_info; evas_object_data_set(preview, DATA_KEY_PAGE_INFO, page_info); -#endif } elm_object_signal_emit(preview, "hide,im", "line"); elm_object_signal_emit(preview, add_viewer_package_is_skipped(package) ? "show" : "hide", "duplicated"); diff --git a/home/src/animator.c b/home/src/animator.c new file mode 100755 index 0000000..d600910 --- /dev/null +++ b/home/src/animator.c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "animator.h" +#include "apps/apps_view.h" +#include "apps/apps_conf.h" +#include "apps/apps_view_conf.h" +#include "apps/apps_view_icon.h" +#include "util.h" +#include "log.h" + +#define ANIMATION_STOP_TIME 3.0 + +static struct __animator_s { + bool is_ongoing; + Ecore_Timer *stop_timer; + void(*stop_cb)(void); +} s_info = { + .is_ongoing = false, + .stop_timer = NULL, + .stop_cb = NULL, +}; + +static Eina_Bool __animation_time_over(void *data); +static void __animation_stop(void); + +bool animator_is_ongoing(void) +{ + return s_info.is_ongoing; +} + +void animator_start(void(*stop_cb)(void)) +{ + if (s_info.is_ongoing) { + animator_stop(); + } + + s_info.is_ongoing = true; + s_info.stop_cb = stop_cb; + + + if (s_info.stop_timer != NULL) { + ecore_timer_del(s_info.stop_timer); + s_info.stop_timer = NULL; + } + + s_info.stop_timer = ecore_timer_add(ANIMATION_STOP_TIME, __animation_time_over, NULL); +} + +void animator_complete(void) +{ + ecore_timer_del(s_info.stop_timer); + s_info.stop_timer = NULL; + + s_info.is_ongoing = false; + s_info.stop_cb = NULL; +} + +void animator_stop(void) +{ + ecore_timer_del(s_info.stop_timer); + s_info.stop_timer = NULL; + + __animation_stop(); +} + +static Eina_Bool __animation_time_over(void *data) +{ + _D("animation time over"); + + s_info.stop_timer = NULL; + + __animation_stop(); + + return ECORE_CALLBACK_CANCEL; +} + +static void __animation_stop(void) +{ + if (s_info.stop_cb != NULL) { + (*s_info.stop_cb)(); + } + + s_info.is_ongoing = false; + s_info.stop_cb = NULL; +} diff --git a/home/src/apps/apps_animator.c b/home/src/apps/apps_animator.c deleted file mode 100755 index 28d6997..0000000 --- a/home/src/apps/apps_animator.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. - * - * Licensed under the Flora License, Version 1.1 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "apps/apps_animator.h" -#include "apps/apps_view.h" -#include "apps/apps_conf.h" -#include "apps/apps_view_conf.h" -#include "apps/apps_view_icon.h" -#include "util.h" -#include "log.h" - -#define ANIMATION_STOP_TIME 3.0 - -static struct __animator_s { - bool is_ongoing; - Ecore_Timer *stop_timer; - void(*stop_cb)(void); -} s_info = { - .is_ongoing = false, - .stop_timer = NULL, - .stop_cb = NULL, -}; - -static Eina_Bool __animation_time_over(void *data); -static void __animation_stop(void); - -bool apps_animator_is_ongoing(void) -{ - return s_info.is_ongoing; -} - -void apps_animator_start(void(*stop_cb)(void)) -{ - if (s_info.is_ongoing) { - apps_animator_stop(); - } - - s_info.is_ongoing = true; - s_info.stop_cb = stop_cb; - - - if (s_info.stop_timer != NULL) { - ecore_timer_del(s_info.stop_timer); - s_info.stop_timer = NULL; - } - - s_info.stop_timer = ecore_timer_add(ANIMATION_STOP_TIME, __animation_time_over, NULL); -} - -void apps_animator_complete(void) -{ - ecore_timer_del(s_info.stop_timer); - s_info.stop_timer = NULL; - - s_info.is_ongoing = false; - s_info.stop_cb = NULL; -} - -void apps_animator_stop(void) -{ - ecore_timer_del(s_info.stop_timer); - s_info.stop_timer = NULL; - - __animation_stop(); -} - -static Eina_Bool __animation_time_over(void *data) -{ - _D("animation time over"); - - s_info.stop_timer = NULL; - - __animation_stop(); - - return ECORE_CALLBACK_CANCEL; -} - -static void __animation_stop(void) -{ - if (s_info.stop_cb != NULL) { - (*s_info.stop_cb)(); - } - - s_info.is_ongoing = false; - s_info.stop_cb = NULL; -} diff --git a/home/src/apps/apps_rotary_event_handler.c b/home/src/apps/apps_rotary_event_handler.c index 1735ce6..613011a 100755 --- a/home/src/apps/apps_rotary_event_handler.c +++ b/home/src/apps/apps_rotary_event_handler.c @@ -17,10 +17,10 @@ #include #include "log.h" +#include "animator.h" #include "apps/apps_conf.h" #include "apps/apps_rotary_event_handler.h" #include "apps/apps_callback_manager.h" -#include "apps/apps_animator.h" static struct __key_handler_s { Evas_Object *base_object; @@ -106,7 +106,7 @@ void apps_rotary_event_handler_deregister_ccw_cb(void(*ccw_cb)(void *data)) static Eina_Bool __rotation_cb(void *data, Evas_Object *obj, Eext_Rotary_Event_Info *rotary_info) { - if (apps_animator_is_ongoing()) { + if (animator_is_ongoing()) { _D("rotation event is skipped because animation is ongoing"); return ECORE_CALLBACK_PASS_ON; } diff --git a/home/src/apps/apps_view_base.c b/home/src/apps/apps_view_base.c index cf421b2..a525929 100755 --- a/home/src/apps/apps_view_base.c +++ b/home/src/apps/apps_view_base.c @@ -156,21 +156,16 @@ static Evas_Object* __create_base_window(void) _D("%s", __func__); Evas_Object * win; - int w, h; elm_config_accel_preference_set("3d"); win = elm_win_util_standard_add(APPS, APPS); if (win == NULL) { _E("Failed to add apps window"); goto __fail; } - elm_win_screen_size_get(win, NULL, NULL, &w, &h); - if (!apps_view_conf_is_supported_resolution(w, h)) { - _E("%dx%d is not supported", w, h); - goto __fail; - } - apps_view_conf_set_resolution(w, h); #ifdef __WINDOW_SHOW_ISSUE_WIN_SHOW_TIME + int w, h; + elm_win_screen_size_get(win, NULL, NULL, &w, &h); evas_object_resize(win, w, h); evas_object_hide(win); #else diff --git a/home/src/apps/apps_view_circle.c b/home/src/apps/apps_view_circle.c index 9ebe45a..0868eb5 100755 --- a/home/src/apps/apps_view_circle.c +++ b/home/src/apps/apps_view_circle.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "apps/apps_animator.h" +#include "animator.h" #include "apps/apps_view.h" #include "apps/apps_view_icon.h" #include "apps/apps_view_conf.h" @@ -388,12 +388,12 @@ void __apps_view_circle_get_access_focus_text(Eina_List **list) const char *buf = NULL; char *markup_str = NULL; - buf = elm_object_part_text_get(s_info.base_layout, FOCUS_TEXT); + buf = elm_object_part_text_get(s_info.base_layout, APPS_FOCUS_TEXT); markup_str = buf ? elm_entry_markup_to_utf8(buf) : NULL; access_info_t *info = (access_info_t *) malloc(sizeof(access_info_t)); info->is_access_obj = EINA_FALSE; - info->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), FOCUS_TEXT); + info->target = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), APPS_FOCUS_TEXT); info->parent = s_info.base_layout; info->name = markup_str ? strdup(markup_str) : NULL; info->description = NULL; @@ -457,9 +457,9 @@ static void __set_focus_text(char *label) char text[TEXT_MAX] = { 0, }; snprintf(text, sizeof(text), FONT_DEFAULT, TEXT_SIZE_FOCUS_LABEL, label); - elm_object_part_text_set(s_info.base_layout, FOCUS_TEXT, text); + elm_object_part_text_set(s_info.base_layout, APPS_FOCUS_TEXT, text); - target_obj = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), FOCUS_TEXT); + target_obj = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), APPS_FOCUS_TEXT); if (target_obj) { screen_reader_update_name(target_obj, label); } @@ -557,10 +557,10 @@ static void __read_focus_text(void) const char *buf = NULL; char *markup_str = NULL; - buf = elm_object_part_text_get(s_info.base_layout, FOCUS_TEXT); + buf = elm_object_part_text_get(s_info.base_layout, APPS_FOCUS_TEXT); markup_str = buf ? elm_entry_markup_to_utf8(buf) : NULL; - target_obj = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), FOCUS_TEXT); + target_obj = (Evas_Object *) edje_object_part_object_get(elm_layout_edje_get(s_info.base_layout), APPS_FOCUS_TEXT); if (target_obj) { screen_reader_read(markup_str, EINA_TRUE); } diff --git a/home/src/apps/apps_view_circle_animator.c b/home/src/apps/apps_view_circle_animator.c index b1f6ad5..f25ed3a 100755 --- a/home/src/apps/apps_view_circle_animator.c +++ b/home/src/apps/apps_view_circle_animator.c @@ -14,8 +14,8 @@ * limitations under the License. */ +#include "animator.h" #include "apps/apps_view.h" -#include "apps/apps_animator.h" #include "apps/apps_conf.h" #include "apps/apps_view_conf.h" #include "apps/apps_view_icon.h" @@ -84,7 +84,7 @@ void __apps_view_circle_animator_rotation( int radius, int layout_width, int layout_height, double duration, ANIMATOR_OPTION option, void(*cb)(void)) { __animator_stop(); - apps_animator_start(__animator_stop); + animator_start(__animator_stop); s_info.layout_list = layout_list; s_info.cur_angle_list = cur_angle_list; @@ -132,7 +132,7 @@ static Eina_Bool __rotation_cb(void *data) (*s_info.complete_cb)(); __animator_init(); - apps_animator_complete(); + animator_complete(); return ECORE_CALLBACK_CANCEL; } @@ -145,7 +145,7 @@ void __apps_view_circle_animator_focus_point_bound( int radius, int layout_width, int layout_height, double duration, void(*cb)(void)) { __animator_stop(); - apps_animator_start(__animator_stop); + animator_start(__animator_stop); s_info.layout = layout; s_info.current_angle = cur_angle; @@ -164,7 +164,7 @@ void __apps_view_circle_animator_icon_move_to_blank( Evas_Object *layout, int x, int y, double duration, void(*cb)(void)) { __animator_stop(); - apps_animator_start(__animator_stop); + animator_start(__animator_stop); s_info.layout = layout; s_info.dest_x = x; @@ -204,7 +204,7 @@ static Eina_Bool __focus_point_bound_cb(void *data) if (s_info.current_step >= len) { (*s_info.complete_cb)(); __animator_init(); - apps_animator_complete(); + animator_complete(); return ECORE_CALLBACK_CANCEL; } @@ -234,7 +234,7 @@ static Eina_Bool __icon_move_to_blank_cb(void *data) (*s_info.complete_cb)(); __animator_init(); - apps_animator_complete(); + animator_complete(); return ECORE_CALLBACK_CANCEL; } diff --git a/home/src/apps/apps_view_circle_icon_page.c b/home/src/apps/apps_view_circle_icon_page.c index 6d1f913..81154c9 100755 --- a/home/src/apps/apps_view_circle_icon_page.c +++ b/home/src/apps/apps_view_circle_icon_page.c @@ -16,8 +16,8 @@ #include +#include "animator.h" #include "apps/apps_view_circle_touch_handler.h" -#include "apps/apps_animator.h" #include "apps/apps_view.h" #include "apps/apps_view_icon.h" #include "apps/apps_conf.h" @@ -1041,8 +1041,8 @@ static void __icon_drop(void) Evas_Object *edje_obj = NULL; int blank_pos = INVALID_VALUE; - if (apps_animator_is_ongoing()) { - apps_animator_stop(); + if (animator_is_ongoing()) { + animator_stop(); } edje_obj = elm_layout_edje_get(s_info.picked_icon->layout); diff --git a/home/src/apps/apps_view_circle_touch_handler.c b/home/src/apps/apps_view_circle_touch_handler.c index b59d859..3f2b3be 100755 --- a/home/src/apps/apps_view_circle_touch_handler.c +++ b/home/src/apps/apps_view_circle_touch_handler.c @@ -14,9 +14,9 @@ * limitations under the License. */ +#include "animator.h" #include "apps/apps_view.h" #include "apps/apps_conf.h" -#include "apps/apps_animator.h" #include "apps/apps_view_callback.h" #include "apps/apps_view_conf.h" #include "apps/apps_view_edje_conf.h" @@ -179,7 +179,7 @@ static void __down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { Evas_Event_Mouse_Down *ev = event_info; - if (apps_animator_is_ongoing()) { + if (animator_is_ongoing()) { _D("skip touch down. animation is ongoing."); return ; } diff --git a/home/src/apps/apps_view_conf.c b/home/src/apps/apps_view_conf.c deleted file mode 100755 index 5dfc96a..0000000 --- a/home/src/apps/apps_view_conf.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. - * - * Licensed under the Flora License, Version 1.1 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://floralicense.org/license/ - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an AS IS BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "log.h" -#include "apps/apps_conf.h" - -static int window_width = 360; -static int window_height = 360; -static double resolution_scale_h = 1.0; -static double resolution_scale_w = 1.0; - -static int supported_resolution[10][2] = { {320, 320}, {360, 360}, {360, 480}, {0, 0}, }; - -int _get_window_h(void) -{ - return window_height; -} - -int _get_window_w(void) -{ - return window_width; -} - -double _get_resolution_scale_h() -{ - return resolution_scale_h; -} - -double _get_resolution_scale_w() -{ - return resolution_scale_w; -} - -void apps_view_conf_set_resolution(int w, int h) -{ - window_width = w; - window_height = h; - resolution_scale_w = (double)window_width / 360; - resolution_scale_h = (double)window_height / 360; -} - -bool apps_view_conf_is_supported_resolution(int w, int h) -{ - int idx = 0; - for (idx = 0; supported_resolution[idx][0] > 0; idx++) { - if (w == supported_resolution[idx][0] && h == supported_resolution[idx][1]) - break; - } - return supported_resolution[idx][0] == 0 ? false : true; -} diff --git a/home/src/common_conf.c b/home/src/common_conf.c new file mode 100755 index 0000000..1d0b061 --- /dev/null +++ b/home/src/common_conf.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "log.h" +#include "common_conf.h" + +static int window_width = 360; +static int window_height = 360; +static double resolution_scale_h = 1.0; +static double resolution_scale_w = 1.0; + +static int supported_resolution[10][2] = { {320, 320}, {360, 360}, {360, 480}, {0, 0}, }; + +int _get_window_h(void) +{ + return window_height; +} + +int _get_window_w(void) +{ + return window_width; +} + +double _get_resolution_scale_h() +{ + return resolution_scale_h; +} + +double _get_resolution_scale_w() +{ + return resolution_scale_w; +} + +void conf_set_resolution(int w, int h) +{ + window_width = w; + window_height = h; + resolution_scale_w = (double)window_width / 360; + resolution_scale_h = (double)window_height / 360; +} + +bool conf_is_supported_resolution(int w, int h) +{ + int idx = 0; + for (idx = 0; supported_resolution[idx][0] > 0; idx++) { + if (w == supported_resolution[idx][0] && h == supported_resolution[idx][1]) + break; + } + return supported_resolution[idx][0] == 0 ? false : true; +} diff --git a/home/src/key.c b/home/src/key.c old mode 100644 new mode 100755 index 42527eb..f6b652b --- a/home/src/key.c +++ b/home/src/key.c @@ -87,7 +87,6 @@ HAPI void key_unregister_cb( int type, key_cb_ret_e (*result_cb)(void *)) { - const Eina_List *l; const Eina_List *n; key_cb_s *cb; diff --git a/home/src/layout.c b/home/src/layout.c index 8c6d910..9f02141 100755 --- a/home/src/layout.c +++ b/home/src/layout.c @@ -44,6 +44,8 @@ #include "apps/apps.h" #include "gesture.h" #include "notification/notification.h" +#include "screen_reader_handler.h" +#include "moments/moments.h" #define PRIVATE_DATA_KEY_LAYOUT_DOWN_X "p_l_x" #define PRIVATE_DATA_KEY_LAYOUT_DOWN_Y "p_l_y" @@ -71,6 +73,8 @@ #define LONGPRESS_GRAY_ZONE_W 50 #define LONGPRESS_GRAY_ZONE_H 100 +#define MOMENT_BAR_ZONE(x, y) ((((y) < 70) && ((x) > 100) && ((x) < 260)) ? 1 : 0) + static w_home_error_e _pause_result_cb(void *data) { Evas_Object *layout = data; @@ -250,18 +254,16 @@ static void _down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) evas_object_data_set(layout, PRIVATE_DATA_KEY_LAYOUT_DOWN_X, (void *) x); evas_object_data_set(layout, PRIVATE_DATA_KEY_LAYOUT_DOWN_Y, (void *) y); - double longpress_time = LONGPRESS_TIME; layout_info_s *layout_info = evas_object_data_get(layout, DATA_KEY_LAYOUT_INFO); - if (layout_info != NULL) { - Evas_Object *page = scroller_get_focused_page(layout_info->scroller); - if (page != NULL) { - page_info_s *page_info = evas_object_data_get(page, DATA_KEY_PAGE_INFO); - if (page_info != NULL) { - if (page_info->direction == PAGE_DIRECTION_CENTER) { - longpress_time = 0.4f; - } - } - } + Evas_Object *scroller = layout_info ? layout_info->scroller : NULL; + Evas_Object *page = scroller ? scroller_get_focused_page(layout_info->scroller) : NULL; + page_info_s *page_info = page ? evas_object_data_get(page, DATA_KEY_PAGE_INFO) : NULL; + int page_direction = page_info ? page_info->direction : -1; + double longpress_time = (page_direction == PAGE_DIRECTION_CENTER) ? LONGPRESS_TIME : 0.4f; + + if (scroller && page_direction == PAGE_DIRECTION_CENTER && MOMENT_BAR_ZONE(x, y) && !screen_reader_is_activated()) { + moments_show(); + return ; } if ((x <= LONGPRESS_GRAY_ZONE_W) || (x >= (main_get_info()->root_w - LONGPRESS_GRAY_ZONE_W))) { @@ -292,6 +294,11 @@ static void _move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) int cur_x = ei->cur.output.x; int cur_y = ei->cur.output.y; + if (moments_get_visible()) { + moments_draw(cur_x, cur_y); + return ; + } + if (!evas_object_data_get(layout, PRIVATE_DATA_KEY_LAYOUT_PRESSED)) return; down_x = (int) evas_object_data_get(layout, PRIVATE_DATA_KEY_LAYOUT_DOWN_X); @@ -311,12 +318,18 @@ static void _move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) static void _up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) { + Evas_Event_Mouse_Up *ei = event_info; Evas_Object *layout = obj; Ecore_Timer *timer = NULL; layout_info_s *layout_info = NULL; _D("Mouse is up on the layout"); + if (moments_get_visible()) { + moments_put_down(ei->output.x, ei->output.y); + return ; + } + layout_info = evas_object_data_get(layout, DATA_KEY_LAYOUT_INFO); ret_if(!layout_info); diff --git a/home/src/main.c b/home/src/main.c index 19833af..a26ab4f 100755 --- a/home/src/main.c +++ b/home/src/main.c @@ -58,7 +58,6 @@ #include "power_mode.h" #include "noti_broker.h" #include "wms.h" -#include "apps/apps.h" #include "critical_log.h" #include "db.h" #include "xml.h" @@ -66,12 +65,15 @@ #include "edit.h" #include "popup.h" #include "error_type.h" +#include "apps/apps.h" #include "apps/apps_key_handler.h" #include "notification/noti_event_mgr.h" #include "notification/noti_panel_mgr.h" #include "notification/noti_popup_mgr.h" #include "notification/noti_detail_view.h" #include "notification/noti_time.h" +#include "moments/moments.h" +#include "common_conf.h" #define HOME_SERVICE_KEY "home_op" #define HOME_SERVICE_VALUE_POWERKEY_UNFOCUSED "powerkey_unfocused" @@ -544,6 +546,9 @@ static void _pause_cb(void *data) _home_visibility_vconf_set(EINA_FALSE); + apps_pause(); + moments_hide(); + main_info.state = APP_STATE_PAUSE; _execute_cbs(APP_STATE_PAUSE); @@ -866,6 +871,10 @@ static void _lcd_off_cb(void *user_data, void *event_info) _W("clock/widget paused"); widget_viewer_evas_notify_paused_status_of_viewer(); } + + if (moments_get_visible()) { + moments_hide(); + } } @@ -972,6 +981,11 @@ static bool _create_cb(void *data) */ aul_listen_app_dead_signal(_dead_cb, NULL); + layout_info_s *layout_info = evas_object_data_get(main_info.layout, DATA_KEY_LAYOUT_INFO); + if (layout_info && layout_info->scroller) { + moments_init(main_info.win, layout_info->scroller); + } + if (apps_init() != ERROR_NONE) { _E("Failed to intialize apps"); } @@ -995,6 +1009,7 @@ static void _terminate_cb(void *data) notification_time_fini(); home_dbus_fini(NULL); + moments_fini(); apps_fini(); noti_panel_mgr_fini(); @@ -1137,7 +1152,12 @@ static void _app_control(app_control_h service, void *data) } /* CLOCK */ } else if (focused_page == main_info.clock_focus) { - apps_show(); + if (moments_get_visible()) { + moments_hide(); + } + else { + apps_show(); + } } key_cb_execute(KEY_TYPE_HOME); } else if (!strncmp(service_val, HOME_SERVICE_VALUE_POWERKEY_UNFOCUSED, strlen(HOME_SERVICE_VALUE_POWERKEY_UNFOCUSED))) { diff --git a/home/src/moments/moments_manager.c b/home/src/moments/moments_manager.c new file mode 100755 index 0000000..087d94b --- /dev/null +++ b/home/src/moments/moments_manager.c @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include "log.h" +#include "moments/moments.h" +#include "moments/moments_view.h" +#include "scroller.h" +#include "key.h" + + +#include "common_conf.h" + +static struct __manager_s { + Evas_Object *win; + Evas_Object *bg_scroller; + Evas_Object *layout; + bool visible; +} s_info = { + .win = NULL, + .bg_scroller = NULL, + .layout = NULL, + .visible = false, +}; + +static key_cb_ret_e __back_key_cb(void *data); + +bool moments_get_visible(void) +{ + return s_info.visible; +} + +void moments_init(Evas_Object *win, Evas_Object *bg_scroller) +{ + s_info.win = win; + s_info.bg_scroller = bg_scroller; + + s_info.layout = moments_create_ui(s_info.win); +} + +void moments_fini(void) +{ + moments_destroy_ui(); + + s_info.layout = NULL; + s_info.bg_scroller = NULL; + s_info.win = NULL; +} + +void moments_show(void) +{ + scroller_freeze(s_info.bg_scroller); + + if (!moments_view_show()) { + _E("failed to show moment-bar"); + return ; + } + + s_info.visible = true; + + if (W_HOME_ERROR_NONE != key_register_cb(KEY_TYPE_BACK, __back_key_cb, NULL)) { + _E("Cannot register the key callback"); + } +} + +void moments_hide(void) +{ + if (!s_info.visible || !moments_view_hide()) { + _E("moment-bar is not visible"); + return ; + } + + key_unregister_cb(KEY_TYPE_BACK, __back_key_cb); + + s_info.visible = false; + + scroller_unfreeze(s_info.bg_scroller); +} + +void moments_draw(int x, int y) +{ + moments_view_draw(x, y); +} + +void moments_put_down(int x, int y) +{ + moments_view_draw_down(x, y); +} + +static key_cb_ret_e __back_key_cb(void *data) +{ + if (!s_info.visible) { + return KEY_CB_RET_CONTINUE; + } + + moments_hide(); + + return KEY_CB_RET_STOP; +} diff --git a/home/src/moments/moments_view.c b/home/src/moments/moments_view.c new file mode 100755 index 0000000..2e839a4 --- /dev/null +++ b/home/src/moments/moments_view.c @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include + +#include "log.h" +#include "util.h" +#include "common_conf.h" +#include "moments/moments.h" +#include "moments/moments_view.h" +#include "moments/moments_view_conf.h" +#include "moments/moments_view_edje_conf.h" + +#define BASE_LAYOUT_EDJE EDJE_DIR"/circle/moments_layout.edj" + +static struct __view_s { + Evas_Object *layout; + Evas_Object *size_setter; + Evas_Object *content; + bool is_freeze; + bool is_drawing_up; + int down_y; +} s_info = { + .layout = NULL, + .size_setter = NULL, + .content = NULL, + .is_freeze = true, + .is_drawing_up = false, + .down_y = -1, +}; + +static Evas_Object *__create_base_layout(Evas_Object *parent); +static Evas_Object *__create_base_size_setter(Evas_Object *base_layout); +static Evas_Object *__create_moments_content(Evas_Object *base_layout); +static void __put_down(int cur_y, int limit_y); +static void __freeze_touch_event(void); +static void __unfreeze_touch_event(void); +static void __hide_complete_cb(void); +static void __pull_down_complete_cb(void); +static void __down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void __move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void __up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info); + +extern void moments_view_animator_move(Evas_Object *layout, int sx, int sy, int ex, int ey, double duration, void(*cb)(void)); + +Evas_Object *moments_create_ui(Evas_Object *base_win) +{ + _D("%s", __func__); + + s_info.layout = __create_base_layout(base_win); + if (s_info.layout == NULL) goto __fail; + + s_info.size_setter = __create_base_size_setter(s_info.layout); + if (s_info.size_setter == NULL) goto __fail; + + s_info.content = __create_moments_content(s_info.layout); + if (s_info.content == NULL) goto __fail; + + __freeze_touch_event(); + + return s_info.layout; + +__fail: + moments_destroy_ui(); + return NULL; +} + +void moments_destroy_ui(void) +{ + __freeze_touch_event(); + + if (s_info.content) { + evas_object_del(s_info.content); + } + s_info.content = NULL; + + if (s_info.size_setter) evas_object_del(s_info.size_setter); + s_info.size_setter = NULL; + + if (s_info.layout) evas_object_del(s_info.layout); + s_info.layout = NULL; +} + +bool moments_view_show(void) +{ + if (!s_info.layout) return false; + + evas_object_show(s_info.layout); + moments_view_animator_move(s_info.layout, 0, -WINDOW_H, 0, -WINDOW_H + MOMENTS_INIT_H, MOMENTS_ANIMATION_SHOW_TIME, NULL); + + return true; +} + +bool moments_view_hide(void) +{ + if (!s_info.layout) return false; + + int x, y, w, h; + evas_object_geometry_get(s_info.layout, &x, &y, &w, &h); + moments_view_animator_move(s_info.layout, x, y, 0, -WINDOW_H, MOMENTS_ANIMATION_DRAW_TIME, __hide_complete_cb); + + return true; +} + +void moments_view_draw(int x, int y) +{ + y = y - WINDOW_H + MOMENTS_INIT_H; + evas_object_move(s_info.layout, 0, y > 0 ? 0 : y); +} + +void moments_view_draw_down(int x, int y) +{ + __put_down(y, MOMENT_DRAW_DOWN_LIMIT_Y); +} + +void moments_view_draw_up(int x, int y) +{ + __put_down(y, MOMENT_DRAW_UP_LIMIT_Y); +} + +static Evas_Object *__create_base_layout(Evas_Object *parent) +{ + Evas_Object *layout = NULL; + + layout = elm_layout_add(parent); + if (!layout || !elm_layout_file_set(layout, util_get_res_file_path(BASE_LAYOUT_EDJE), BASE_LAYOUT)) { + _E("Failed to create base layout"); + goto __fail; + } + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_resize(layout, WINDOW_W, WINDOW_H); + evas_object_move(layout, OUTSIDE_X, OUTSIDE_Y); + evas_object_hide(layout); + + return layout; + +__fail: + if (layout) evas_object_del(layout); + return NULL; +} + +static Evas_Object *__create_base_size_setter(Evas_Object *base_layout) +{ + Evas_Object *size_setter = evas_object_rectangle_add(evas_object_evas_get(base_layout)); + if (!size_setter) { + _E("Failed to create size-setter"); + return NULL; + } + + evas_object_size_hint_min_set(size_setter, WINDOW_W, WINDOW_H); + evas_object_size_hint_weight_set(size_setter, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(size_setter, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(size_setter, 0, 0, 0, 0); + elm_object_part_content_set(base_layout, SIZE_SETTER, size_setter); + + return size_setter; +} + +static Evas_Object *__create_moments_content(Evas_Object *base_layout) +{ + Evas_Object *widget = widget_viewer_evas_add_widget(base_layout, "org.tizen.windicator", NULL, 0); + if (!widget) { + _E("Failed to create widget"); + return NULL; + } + + widget_viewer_evas_disable_loading(widget); + evas_object_size_hint_weight_set(widget, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(widget, 0.5, 0.5); + evas_object_resize(widget, WINDOW_W, WINDOW_H); + + evas_object_size_hint_min_set(widget, WINDOW_W, WINDOW_H); + evas_object_show(widget); + + elm_object_part_content_set(base_layout, MOMENTS_CONTENT, widget); + + return widget; +} + +static void __put_down(int cur_y, int limit_y) +{ + if (cur_y < limit_y) { + moments_hide(); + return ; + } + + int gx, gy, gw, gh; + evas_object_geometry_get(s_info.layout, &gx, &gy, &gw, &gh); + moments_view_animator_move(s_info.layout, gx, gy, 0, 0, MOMENTS_ANIMATION_DRAW_TIME, __pull_down_complete_cb); +} + +static void __freeze_touch_event(void) +{ + if (s_info.content == NULL || s_info.layout == NULL || s_info.is_freeze) { + return ; + } + + s_info.is_freeze = true; + + /* It takes a long time for pause widget. + if (widget_viewer_evas_pause_widget(s_info.content) != WIDGET_ERROR_NONE) { + _E("Failed to pause widget"); + } + */ + + evas_object_event_callback_del(s_info.content, EVAS_CALLBACK_MOUSE_UP, __up_cb); + evas_object_event_callback_del(s_info.content, EVAS_CALLBACK_MOUSE_MOVE, __move_cb); + evas_object_event_callback_del(s_info.content, EVAS_CALLBACK_MOUSE_DOWN, __down_cb); + + elm_object_signal_emit(s_info.layout, SIGNAL_MOMENTS_FREEZE_TOUCH, SIGNAL_SOURCE); +} + +static void __unfreeze_touch_event(void) +{ + if (s_info.content == NULL || s_info.layout == NULL || !s_info.is_freeze) { + return ; + } + + s_info.is_freeze = false; + + /* It takes a long time for resume widget. + if (widget_viewer_evas_resume_widget(s_info.content) != WIDGET_ERROR_NONE) { + _E("Failed to resume widget"); + } + */ + + evas_object_event_callback_add(s_info.content, EVAS_CALLBACK_MOUSE_DOWN, __down_cb, NULL); + evas_object_event_callback_add(s_info.content, EVAS_CALLBACK_MOUSE_MOVE, __move_cb, NULL); + evas_object_event_callback_add(s_info.content, EVAS_CALLBACK_MOUSE_UP, __up_cb, NULL); + + elm_object_signal_emit(s_info.layout, SIGNAL_MOMENTS_UNFREEZE_TOUCH, SIGNAL_SOURCE); +} + +static void __hide_complete_cb(void) +{ + __freeze_touch_event(); + + evas_object_hide(s_info.layout); + evas_object_move(s_info.layout, OUTSIDE_X, OUTSIDE_Y); +} + +static void __pull_down_complete_cb(void) +{ + evas_object_move(s_info.layout, 0, 0); + + __unfreeze_touch_event(); +} + +static void __down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ei = event_info; + + s_info.down_y = ei->output.y; +} + +static void __move_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Move *ei = event_info; + int y = ei->cur.output.y; + + if (s_info.is_drawing_up) { + moments_draw(0, y); + return ; + } + + if (s_info.down_y > WINDOW_H - MOMENT_DRAW_HANDLER_H && (s_info.down_y - y) > MOMENT_DRAW_LIMIT) { + s_info.is_drawing_up = true; + + widget_viewer_evas_cancel_click_event(s_info.content); + } +} + +static void __up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Up *ei = event_info; + int y = ei->output.y; + + s_info.down_y = -1; + + if (!s_info.is_drawing_up) { + return ; + } + s_info.is_drawing_up = false; + + moments_view_draw_up(0, y); +} diff --git a/home/src/moments/moments_view_animator.c b/home/src/moments/moments_view_animator.c new file mode 100755 index 0000000..e43c6ef --- /dev/null +++ b/home/src/moments/moments_view_animator.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. + * + * Licensed under the Flora License, Version 1.1 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://floralicense.org/license/ + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "log.h" +#include "common_conf.h" +#include "animator.h" +#include "moments/moments.h" +#include "moments/moments_view.h" +#include "moments/moments_view_conf.h" + +static struct __animator_s { + Evas_Object *layout; + Ecore_Timer *show_timer; + int start_x; + int start_y; + int dest_x; + int dest_y; + double duration; + int current_step; + void(*complete_cb)(void); +} s_info = { + .layout = NULL, + .show_timer = NULL, + .start_x = 0, + .start_y = 0, + .dest_x = 0, + .dest_y = 0, + .duration = 0.0, + .current_step = 0, + .complete_cb = NULL, +}; + +static void __animator_init(void); +static void __animator_stop(void); + +static Eina_Bool __pull_down_cb(void *data); + +void moments_view_animator_move(Evas_Object *layout, int sx, int sy, int ex, int ey, double duration, void(*cb)(void)) +{ + __animator_stop(); + animator_start(__animator_stop); + + s_info.layout = layout; + s_info.start_x = sx; + s_info.start_y = sy; + s_info.dest_x = ex; + s_info.dest_y = ey; + s_info.duration = duration; + + s_info.complete_cb = cb; + + s_info.current_step = 1; + s_info.show_timer = ecore_timer_add(MOMENTS_ANIMATION_INTERVAL, __pull_down_cb, NULL); +} + +static Eina_Bool __pull_down_cb(void *data) +{ + int x = s_info.start_x; + int y = s_info.start_y; + int len = s_info.duration / MOMENTS_ANIMATION_INTERVAL; + + x = s_info.start_x + (s_info.dest_x - s_info.start_x) * ((double)s_info.current_step / len); + y = s_info.start_y + (s_info.dest_y - s_info.start_y) * ((double)s_info.current_step / len); + + evas_object_move(s_info.layout, x, y); + + if (s_info.current_step >= len) { + if (s_info.complete_cb != NULL) { + (*s_info.complete_cb)(); + } + + __animator_init(); + animator_complete(); + return ECORE_CALLBACK_CANCEL; + } + + s_info.current_step += 1; + return ECORE_CALLBACK_RENEW; +} + +static void __animator_init(void) +{ + s_info.layout = NULL; + s_info.start_x = 0; + s_info.start_y = 0; + s_info.dest_x = 0; + s_info.dest_y = 0; + s_info.duration = 0.0; + s_info.complete_cb = NULL; + s_info.current_step = 0; + s_info.show_timer = NULL; +} + +static void __animator_stop(void) +{ + if (s_info.show_timer != NULL) { + ecore_timer_del(s_info.show_timer); + } + + if (s_info.complete_cb != NULL) { + (*s_info.complete_cb)(); + } + + __animator_init(); +} diff --git a/home/src/scroller.c b/home/src/scroller.c index 95ebc63..e524c9d 100755 --- a/home/src/scroller.c +++ b/home/src/scroller.c @@ -45,6 +45,7 @@ #include "db.h" #include "clock_service.h" #include "screen_reader_handler.h" +#include "moments/moments.h" #define BOX_EDJE EDJEDIR"/box_layout.edj" #define BOX_GROUP_NAME "box" @@ -656,6 +657,8 @@ static inline void _rotary_page_bring_in(Evas_Object *scroller, int index, scrol scroller_info = evas_object_data_get(scroller, DATA_KEY_SCROLLER_INFO); ret_if(!scroller_info); + moments_hide(); + cur_freezed = elm_object_scroll_freeze_get(scroller_info->box); if (is_freezed) scroller_unfreeze(scroller); @@ -1794,6 +1797,8 @@ static inline void _page_bring_in(Evas_Object *scroller, int index, scroller_fre scroller_info = evas_object_data_get(scroller, DATA_KEY_SCROLLER_INFO); ret_if(!scroller_info); + moments_hide(); + cur_freezed = elm_object_scroll_freeze_get(scroller_info->box); if (is_freezed) scroller_unfreeze(scroller); diff --git a/home/src/win.c b/home/src/win.c old mode 100644 new mode 100755 index 7d43756..87968e0 --- a/home/src/win.c +++ b/home/src/win.c @@ -1,5 +1,4 @@ /* - * w-home * Copyright (c) 2013 - 2016 Samsung Electronics Co., Ltd. * * Licensed under the Flora License, Version 1.1 (the License); @@ -23,58 +22,7 @@ #include "log.h" #include "util.h" #include "main.h" - - - -#ifdef BOOT_OPTIMIZATION -static w_home_error_e _rotate_cb(main_s *info, int angle) -{ - _D("Enter _rotate, angle is %d", angle); - info->angle = angle; - - switch (angle) { - case 0: - _D("Portrait normal"); - info->is_rotated = 0; - break; - case 90: - _D("Landscape reverse"); - info->is_rotated = 1; - break; - case 180: - _D("Portrait reverse"); - info->is_rotated = 0; - break; - case 270: - _D("Landscape normal"); - info->is_rotated = 1; - break; - default: - _E("Cannot reach here, angle is %d", angle); - } - - /* Rotate all objects */ - - return W_HOME_ERROR_NONE; -} - - - -static void _rotation_changed_cb(void *data, Evas_Object *obj, void *event) -{ - main_s *info = data; - int changed_ang; - - ret_if(!info); - - changed_ang = elm_win_rotation_get(info->win); - if (changed_ang != info->angle) { - _rotate_cb(info, changed_ang); - } -} -#endif - - +#include "common_conf.h" HAPI Evas_Object *win_create(const char *name) { @@ -85,47 +33,34 @@ HAPI Evas_Object *win_create(const char *name) retv_if(!info, NULL); elm_config_accel_preference_set("3d"); - //ecore_x_window_size_get(ecore_x_window_root_first_get(), &info->root_w, &info->root_h); -#if 0 // Doesn't support app_get_preinitialized_window in the wearables - win = (Evas_Object *) app_get_preinitialized_window(name); - if (!win) win = elm_win_add(NULL, name, ELM_WIN_BASIC); -#else win = elm_win_add(NULL, name, ELM_WIN_BASIC); -#endif retv_if(!win, NULL); + int w, h; + elm_win_screen_size_get(win, NULL, NULL, &w, &h); + if (!conf_is_supported_resolution(w, h)) { + _E("%dx%d is not supported", w, h); + return NULL; + } + conf_set_resolution(w, h); + elm_win_screen_size_get(win, NULL, NULL, &info->root_w, &info->root_h); elm_win_title_set(win, name); elm_win_borderless_set(win, EINA_TRUE); elm_win_alpha_set(win, EINA_FALSE); elm_win_indicator_mode_set(win, ELM_WIN_INDICATOR_SHOW); elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_OPAQUE); - elm_win_aux_hint_add(win, "wm.policy.win.gesture.disable", "1"); //Global gesture disable - -#ifdef BOOT_OPTIMIZATION - /* Set available rotations */ - if (elm_win_wm_rotation_supported_get(win)) { - const int rots[4] = {0, 90, 180, 270}; - elm_win_wm_rotation_available_rotations_set(win, (const int *) &rots, 4); - _D("Set available rotations, {0, 90, 180, 270}"); - } - evas_object_smart_callback_add(win, "wm,rotation,changed", _rotation_changed_cb, info); -#endif + elm_win_aux_hint_add(win, "wm.policy.win.gesture.disable", "1"); evas_object_resize(win, info->root_w, info->root_h); evas_object_show(win); info->win = win; info->e = evas_object_evas_get(win); - //xwin = elm_win_xwindow_get(win); - //ecore_x_vsync_animator_tick_source_set(xwin); - return win; } - - HAPI void win_destroy(Evas_Object *win) { main_s *info = NULL; @@ -138,7 +73,3 @@ HAPI void win_destroy(Evas_Object *win) evas_object_del(win); info->win = NULL; } - - - -// End of a file -- cgit v1.2.3 From 4ff2f715e0889d7083ccbd8c903deaf9efc5868d Mon Sep 17 00:00:00 2001 From: Hyerim Kim Date: Fri, 16 Dec 2016 11:33:09 +0900 Subject: Fixed warning issue Change-Id: Ibb9798f7dd5804aff8576e2d68e3c4ba883a1c67 Signed-off-by: Hyerim Kim --- home/src/notification/noti_panel_page_view.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/notification/noti_panel_page_view.c b/home/src/notification/noti_panel_page_view.c index 87ca892..af4fcb3 100644 --- a/home/src/notification/noti_panel_page_view.c +++ b/home/src/notification/noti_panel_page_view.c @@ -164,7 +164,7 @@ void noti_panel_page_view_set_coverview(Evas_Object *page_view, notification_h n snprintf(buf, sizeof(buf), "%d", count); elm_object_part_text_set(cover_view, "more_text", buf); - more_btn = edje_object_part_object_get(elm_layout_edje_get(cover_view), "more_event"); + more_btn = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(cover_view), "more_event"); more_access_obj = elm_access_object_register(more_btn, page_view); elm_atspi_accessible_reading_info_type_set(more_access_obj, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME | ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION); elm_atspi_accessible_name_set(more_access_obj, buf); -- cgit v1.2.3 From 0551caf046debdaa7654c97e8001a8fa514459fe Mon Sep 17 00:00:00 2001 From: junkyu han Date: Fri, 16 Dec 2016 11:44:55 +0900 Subject: Fixed build warning Change-Id: I1cbec67c4a1f1e5b2f3aea34947b324803cff647 --- home/include/screen_reader_handler.h | 2 +- home/src/add-viewer.c | 2 +- home/src/screen_reader_handler.c | 9 +-------- home/src/scroller.c | 1 - 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/home/include/screen_reader_handler.h b/home/include/screen_reader_handler.h index 2459f9f..eb474ef 100755 --- a/home/include/screen_reader_handler.h +++ b/home/include/screen_reader_handler.h @@ -49,7 +49,7 @@ typedef struct { void screen_reader_update(void); void screen_reader_read(char *str, Eina_Bool discardable); void screen_reader_update_name(Evas_Object *target_obj, const char *name); -void screen_reader_update_widget_description(Evas_Object *target_obj, const char *name); +void screen_reader_update_widget_description(Evas_Object *target_obj, char *name); void screen_reader_update_description(Evas_Object *target_obj, const char *description); void screen_reader_set_highlight(Evas_Object *target_obj, Eina_Bool highlight); access_info_t *screen_reader_create_access_info(Evas_Object *target, Evas_Object *parent, char *name, char *description, Elm_Accessible_Reading_Info_Type type); diff --git a/home/src/add-viewer.c b/home/src/add-viewer.c index ca83b92..7911820 100755 --- a/home/src/add-viewer.c +++ b/home/src/add-viewer.c @@ -1195,7 +1195,7 @@ static Evas_Object *winset_preview_add(struct widget_data *widget_data, Evas_Obj if (name) { strncpy(buf, name, sizeof(buf)); - access_info = screen_reader_create_access_info(preview, parent, name, NULL, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); + access_info = screen_reader_create_access_info(preview, parent, buf, NULL, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); } else { access_info = screen_reader_create_access_info(preview, parent, NULL, NULL, ELM_ACCESSIBLE_READING_INFO_TYPE_NAME); } diff --git a/home/src/screen_reader_handler.c b/home/src/screen_reader_handler.c index 1647e32..3f96f06 100755 --- a/home/src/screen_reader_handler.c +++ b/home/src/screen_reader_handler.c @@ -77,7 +77,7 @@ access_info_t *screen_reader_create_access_info(Evas_Object *target, Evas_Object return access_info; } -void screen_reader_update_widget_description(Evas_Object *target_obj, const char *name) +void screen_reader_update_widget_description(Evas_Object *target_obj, char *name) { Evas_Object *access_obj = NULL; @@ -110,13 +110,6 @@ void screen_reader_make_relationship(Evas_Object *prev, Evas_Object *next) _E("next access object is NULL"); return; } - -#if 0 - elm_atspi_accessible_relationship_append(prev_access, ELM_ATSPI_RELATION_FLOWS_TO, next_access); - elm_atspi_accessible_relationship_append(next_access, ELM_ATSPI_RELATION_FLOWS_FROM, prev_access); - elm_atspi_accessible_relationship_append(next_access, ELM_ATSPI_RELATION_FLOWS_TO, next_access); - elm_atspi_accessible_relationship_append(next_access, ELM_ATSPI_RELATION_FLOWS_FROM, next_access); -#endif } void screen_reader_update(void) diff --git a/home/src/scroller.c b/home/src/scroller.c index 295cf37..122d51d 100755 --- a/home/src/scroller.c +++ b/home/src/scroller.c @@ -971,7 +971,6 @@ HAPI void scroller_update_access_widget_description(Evas_Object *scroller) if (page_info->direction == PAGE_DIRECTION_RIGHT) { snprintf(buf, sizeof(buf), _("IDS_AT_BODY_PAGE_P1SD_OF_P2SD_T_TTS"), position, total_count); - screen_reader_update_widget_description(page_info->access_info->target, buf); } } -- cgit v1.2.3 From 00f3736e9802d26f4ce04f32053d5f28d7bc0450 Mon Sep 17 00:00:00 2001 From: YoungHun Cho Date: Fri, 16 Dec 2016 13:34:31 +0900 Subject: Bezel swipe down disable / enable Change-Id: I2a71bab0cf7bfc91763d196887883144c73fe2bc Signed-off-by: YoungHun Cho --- home/src/moments/moments_manager.c | 2 ++ home/src/moments/moments_view.c | 11 +++++++++++ home/src/scroller.c | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/home/src/moments/moments_manager.c b/home/src/moments/moments_manager.c index eded062..c3bbfab 100755 --- a/home/src/moments/moments_manager.c +++ b/home/src/moments/moments_manager.c @@ -15,6 +15,7 @@ */ #include + #include "log.h" #include "moments/moments.h" #include "moments/moments_view.h" @@ -66,6 +67,7 @@ void moments_show(void) _E("failed to show moment-bar"); return ; } + scroller_freeze(s_info.bg_scroller); s_info.visible = true; diff --git a/home/src/moments/moments_view.c b/home/src/moments/moments_view.c index 2e839a4..b4a61d7 100755 --- a/home/src/moments/moments_view.c +++ b/home/src/moments/moments_view.c @@ -30,6 +30,7 @@ #define BASE_LAYOUT_EDJE EDJE_DIR"/circle/moments_layout.edj" static struct __view_s { + Evas_Object *win; Evas_Object *layout; Evas_Object *size_setter; Evas_Object *content; @@ -37,6 +38,7 @@ static struct __view_s { bool is_drawing_up; int down_y; } s_info = { + .win = NULL, .layout = NULL, .size_setter = NULL, .content = NULL, @@ -63,6 +65,7 @@ Evas_Object *moments_create_ui(Evas_Object *base_win) { _D("%s", __func__); + s_info.win = base_win; s_info.layout = __create_base_layout(base_win); if (s_info.layout == NULL) goto __fail; @@ -219,6 +222,10 @@ static void __freeze_touch_event(void) } */ + int id = elm_win_aux_hint_id_get(s_info.win, "wm.policy.win.gesture.disable"); + _D("hint set wm.policy.win.gesture.disable 1 id %d", id); + elm_win_aux_hint_val_set(s_info.win, id, "1"); + evas_object_event_callback_del(s_info.content, EVAS_CALLBACK_MOUSE_UP, __up_cb); evas_object_event_callback_del(s_info.content, EVAS_CALLBACK_MOUSE_MOVE, __move_cb); evas_object_event_callback_del(s_info.content, EVAS_CALLBACK_MOUSE_DOWN, __down_cb); @@ -240,6 +247,10 @@ static void __unfreeze_touch_event(void) } */ + int id = elm_win_aux_hint_id_get(s_info.win, "wm.policy.win.gesture.disable"); + _D("hint set wm.policy.win.gesture.disable 0 id %d", id); + elm_win_aux_hint_val_set(s_info.win, id, "0"); + evas_object_event_callback_add(s_info.content, EVAS_CALLBACK_MOUSE_DOWN, __down_cb, NULL); evas_object_event_callback_add(s_info.content, EVAS_CALLBACK_MOUSE_MOVE, __move_cb, NULL); evas_object_event_callback_add(s_info.content, EVAS_CALLBACK_MOUSE_UP, __up_cb, NULL); diff --git a/home/src/scroller.c b/home/src/scroller.c index 295cf37..7b0a9b0 100755 --- a/home/src/scroller.c +++ b/home/src/scroller.c @@ -519,8 +519,14 @@ static void _anim_stop_cb(void *data, Evas_Object *scroller, void *event_info) } if (page == main_get_info()->clock_focus) { + int id = elm_win_aux_hint_id_get(main_get_info()->win, "wm.policy.win.gesture.disable"); + _D("hint set wm.policy.win.gesture.disable 1 id %d", id); + elm_win_aux_hint_val_set(main_get_info()->win, id, "1"); vconf_set_bool(VCONFKEY_HOMESCREEN_WATCH_FACE_VISIBILITY, EINA_TRUE); } else { + int id = elm_win_aux_hint_id_get(main_get_info()->win, "wm.policy.win.gesture.disable"); + _D("hint set wm.policy.win.gesture.disable 0 id %d", id); + elm_win_aux_hint_val_set(main_get_info()->win, id, "0"); vconf_set_bool(VCONFKEY_HOMESCREEN_WATCH_FACE_VISIBILITY, EINA_FALSE); } } -- cgit v1.2.3