From 7bfb7ca0449f43361ad1fc4aea0a06573f7666f0 Mon Sep 17 00:00:00 2001 From: Sehong Na Date: Sat, 31 May 2014 13:02:06 +0900 Subject: [PATCH 1/1] Initialize Tizen 2.3 --- CMakeLists.txt | 62 + LICENSE.Flora | 206 ++ NOTICE | 3 + common/CMakeLists.txt | 62 + common/include/debug.h | 269 ++ common/include/ivug-callback.h | 45 + common/include/ivug-config.h | 63 + common/include/ivug-db.h | 101 + common/include/ivug-debug.h | 304 ++ common/include/ivug-dir.h | 47 + common/include/ivug-drm-common.h | 92 + common/include/ivug-exif.h | 36 + common/include/ivug-file-info.h | 67 + common/include/ivug-message.h | 44 + common/include/ivug-mouse-event.h | 58 + common/include/ivug-util.h | 102 + common/include/ivug-uuid.h | 47 + common/include/statistics.h | 40 + common/src/debug.c | 400 +++ common/src/ivug-callback.c | 50 + common/src/ivug-config.c | 250 ++ common/src/ivug-db.c | 783 +++++ common/src/ivug-dir.cpp | 100 + common/src/ivug-drm-common.c | 387 +++ common/src/ivug-exif.c | 1749 ++++++++++ common/src/ivug-file-info.c | 1046 ++++++ common/src/ivug-message.c | 549 ++++ common/src/ivug-mouse-event.c | 610 ++++ common/src/ivug-util.c | 649 ++++ common/src/ivug-uuid.c | 96 + common/src/statistics.c | 471 +++ feature/CMakeLists.txt | 47 + feature/include/ivug-ext-ug.h | 59 + feature/src/ivug-ext-ug.c | 1100 +++++++ include/ivug-datatypes.h | 62 + include/ivug-define.h | 56 + main/CMakeLists.txt | 143 + main/layout/gengrid/00_winset_thumbs_bg.png | Bin 0 -> 3233 bytes main/layout/gengrid/00_winset_thumbs_focus_bg.png | Bin 0 -> 3145 bytes main/layout/genlist/genlist_group_index.edc | 421 +++ main/layout/genlist/genlist_macro.edc | 2818 ++++++++++++++++ main/layout/genlist/genlist_size.edc | 135 + main/layout/genlist/genlist_styles.edc | 173 + main/layout/genlist/genlist_textblock_styles.edc | 124 + main/layout/genlist/ivug-genlist.edc | 29 + main/layout/icons/T01_Facebook.png | Bin 0 -> 3094 bytes main/layout/icons/T01_btn_paused.png | Bin 0 -> 5941 bytes main/layout/icons/T01_btn_play.png | Bin 0 -> 6920 bytes main/layout/images/00_zoom_in.png | Bin 0 -> 4520 bytes main/layout/images/00_zoom_in_press.png | Bin 0 -> 4930 bytes main/layout/images/00_zoom_out.png | Bin 0 -> 4183 bytes main/layout/images/00_zoom_out_press.png | Bin 0 -> 4750 bytes .../theme/blue/00_winset_control_toolbar_bg.png | Bin 0 -> 2798 bytes .../theme/blue/00_winset_control_top_arrow.png | Bin 0 -> 3055 bytes .../images/theme/blue/00_winset_control_top_bg.png | Bin 0 -> 2807 bytes .../images/theme/blue/00_winset_title_bg.png | Bin 0 -> 2799 bytes .../images/theme/blue/00_winset_title_line.png | Bin 0 -> 2813 bytes .../images/theme/blue/T01_Edit Field_clear.png | Bin 0 -> 3268 bytes main/layout/images/theme/blue/T01_title_btn.png | Bin 0 -> 3129 bytes .../images/theme/blue/T01_title_btn_press.png | Bin 0 -> 3126 bytes .../theme/white/00_winset_control_toolbar_bg.png | Bin 0 -> 2879 bytes .../theme/white/00_winset_control_top_arrow.png | Bin 0 -> 3190 bytes .../theme/white/00_winset_control_top_bg.png | Bin 0 -> 2844 bytes .../images/theme/white/00_winset_divider_line.png | Bin 0 -> 2812 bytes .../images/theme/white/00_winset_title_bg.png | Bin 0 -> 2872 bytes .../images/theme/white/T01_Edit Field_clear.png | Bin 0 -> 3268 bytes main/layout/images/theme/white/T01_title_btn.png | Bin 0 -> 3129 bytes .../images/theme/white/T01_title_btn_press.png | Bin 0 -> 3126 bytes main/layout/ivug-base.edc | 64 + main/layout/ivug-crop-view.edc | 201 ++ main/layout/ivug-details.edc | 56 + main/layout/ivug-effect.edc | 146 + main/layout/ivug-gengrid.edc | 211 ++ main/layout/ivug-icons.edc | 56 + main/layout/ivug-main.edc | 603 ++++ main/layout/ivug-name-view.edc | 96 + main/layout/ivug-naviframe.edc | 1591 +++++++++ main/layout/ivug-popup.edc | 172 + main/layout/ivug-selectioninfo.edc | 375 +++ main/layout/ivug-setas.edc | 212 ++ main/layout/ivug-slider.edc | 196 ++ main/layout/ivug-slideshow-view.edc | 34 + main/layout/ivug-theme.edc | 225 ++ main/res/images/image_drm_no_rights.jpg | Bin 0 -> 9588 bytes main/src/control/ivug-buddy-ug.cpp | 149 + main/src/control/ivug-buddy-ug.h | 51 + main/src/control/ivug-context.c | 398 +++ main/src/control/ivug-context.h | 81 + main/src/control/ivug-crop-ug.cpp | 448 +++ main/src/control/ivug-crop-ug.h | 55 + main/src/control/ivug-detail-info.c | 723 ++++ main/src/control/ivug-detail-info.h | 93 + main/src/control/ivug-parameter.c | 819 +++++ main/src/control/ivug-parameter.h | 115 + main/src/control/ivug-popup.c | 600 ++++ main/src/control/ivug-popup.h | 82 + main/src/control/ivug-selectioninfo.c | 196 ++ main/src/control/ivug-selectioninfo.h | 42 + main/src/control/ivug-setas.cpp | 323 ++ main/src/control/ivug-setas.h | 42 + main/src/control/ivug-widget.c | 276 ++ main/src/control/ivug-widget.h | 67 + main/src/include/ivug-common.h | 94 + main/src/include/ivug-crop-view.h | 102 + main/src/include/ivug-details-view.h | 82 + main/src/include/ivug-main-view.h | 145 + main/src/include/ivug-name-view.h | 83 + main/src/include/ivug-setas-view.h | 95 + main/src/include/ivug-slider-item.h | 181 ++ main/src/include/ivug-slider.h | 166 + main/src/include/ivug-slideshow-view.h | 84 + main/src/slider/ivug-slider-item.cpp | 1223 +++++++ main/src/slider/ivug-slider-mouse.cpp | 928 ++++++ main/src/slider/ivug-slider-priv.h | 195 ++ main/src/slider/ivug-slider.cpp | 1397 ++++++++ main/src/ug-image-viewer.cpp | 1058 ++++++ main/src/view/ivug-crop-view.cpp | 676 ++++ main/src/view/ivug-details-view.c | 485 +++ main/src/view/ivug-main-view-menu.cpp | 1977 +++++++++++ main/src/view/ivug-main-view-menu.h | 52 + main/src/view/ivug-main-view-priv.h | 127 + main/src/view/ivug-main-view-toolbar.cpp | 198 ++ main/src/view/ivug-main-view-toolbar.h | 36 + main/src/view/ivug-main-view.cpp | 1715 ++++++++++ main/src/view/ivug-name-view.c | 588 ++++ main/src/view/ivug-setas-view-callerid.cpp | 637 ++++ main/src/view/ivug-setas-view-callerid.h | 54 + main/src/view/ivug-setas-view-wallpaper.cpp | 310 ++ main/src/view/ivug-setas-view-wallpaper.h | 46 + main/src/view/ivug-setas-view.c | 786 +++++ main/src/view/ivug-slideshow-view.cpp | 490 +++ medialist/CMakeLists.txt | 47 + medialist/include/ivug-filter.h | 89 + medialist/include/ivug-media.h | 79 + medialist/include/ivug-medialist.h | 84 + medialist/src/ivug-data-list.c | 494 +++ medialist/src/ivug-data-list.h | 54 + medialist/src/ivug-filter.c | 136 + medialist/src/ivug-mediadata.c | 464 +++ medialist/src/ivug-mediadata.h | 58 + medialist/src/ivug-medialist.c | 884 +++++ packaging/changelog | 3437 ++++++++++++++++++++ packaging/ug-image-viewer-efl.changes | 134 + packaging/ug-image-viewer-efl.spec | 99 + res/CMakeLists.txt | 5 + res/appicon/ug-image-viewer-efl.png | Bin 0 -> 24024 bytes res/images/T01_Nocontents_broken.png | Bin 0 -> 4880 bytes res/include/ivug-string.h | 220 ++ res/po/CMakeLists.txt | 28 + res/po/ar.po | 288 ++ res/po/az.po | 288 ++ res/po/bg.po | 288 ++ res/po/ca.po | 288 ++ res/po/cs.po | 288 ++ res/po/csv2po_v2 | Bin 0 -> 7586 bytes res/po/da.po | 288 ++ res/po/de_DE.po | 288 ++ res/po/el_GR.po | 288 ++ res/po/en.po | 288 ++ res/po/en_PH.po | 288 ++ res/po/en_US.po | 288 ++ res/po/es_ES.po | 288 ++ res/po/es_MX.po | 288 ++ res/po/et.po | 288 ++ res/po/eu.po | 288 ++ res/po/fi.po | 288 ++ res/po/fr_CA.po | 288 ++ res/po/fr_FR.po | 288 ++ res/po/ga.po | 288 ++ res/po/gl.po | 288 ++ res/po/hi.po | 288 ++ res/po/hr.po | 288 ++ res/po/hu.po | 288 ++ res/po/hy.po | 288 ++ res/po/is.po | 288 ++ res/po/it_IT.po | 288 ++ res/po/ja_JP.po | 288 ++ res/po/ka.po | 288 ++ res/po/kk.po | 288 ++ res/po/ko_KR.po | 288 ++ res/po/lt.po | 288 ++ res/po/lv.po | 288 ++ res/po/mk.po | 288 ++ res/po/nb.po | 288 ++ res/po/nl_NL.po | 288 ++ res/po/pl.po | 288 ++ res/po/pt_BR.po | 288 ++ res/po/pt_PT.po | 288 ++ res/po/ro.po | 288 ++ res/po/ru_RU.po | 288 ++ res/po/sk.po | 288 ++ res/po/sl.po | 288 ++ res/po/sr.po | 288 ++ res/po/sv.po | 288 ++ res/po/tr_TR.po | 288 ++ res/po/uk.po | 288 ++ res/po/uz.po | 288 ++ res/po/zh_CN.po | 288 ++ res/po/zh_HK.po | 288 ++ res/po/zh_SG.po | 288 ++ res/po/zh_TW.po | 288 ++ slideshow/CMakeLists.txt | 81 + slideshow/include/ivug-slideshow.h | 86 + slideshow/res/images/T01_Noise.png | Bin 0 -> 7937 bytes slideshow/res/layout/icons/T01_btn_play.png | Bin 0 -> 6920 bytes slideshow/res/layout/ivug-ss-ly.edc | 146 + slideshow/src/control/ivug-slideshow.cpp | 998 ++++++ slideshow/src/effect/include/ivug-anim.h | 64 + slideshow/src/effect/include/ivug-effect.h | 98 + slideshow/src/effect/ivug-anim.c | 176 + slideshow/src/effect/ivug-blind.c | 313 ++ slideshow/src/effect/ivug-dissolve.c | 367 +++ slideshow/src/effect/ivug-effect.c | 232 ++ slideshow/src/effect/ivug-fade.c | 160 + slideshow/src/effect/ivug-iris.c | 185 ++ slideshow/src/effect/ivug-slide.c | 148 + slideshow/src/effect/ivug-xcapture.c | 338 ++ slideshow/src/effect/ivug-xcapture.h | 30 + slideshow/src/effect/template.c | 82 + slideshow/src/include/ivug-slideshow-priv.h | 86 + ug-image-viewer-efl.manifest | 13 + ug-image-viewer-efl.xml | 26 + widget/CMakeLists.txt | 88 + widget/include/Animation.h | 113 + widget/include/ECoreAnimator.h | 122 + widget/include/EFLUtil.h | 67 + widget/include/EvasSmartObj.h | 185 ++ widget/include/Exception.h | 33 + widget/include/Object.h | 33 + widget/include/Primitives.h | 276 ++ widget/include/Transit.h | 187 ++ widget/include/ivug-image.h | 122 + widget/include/ivug-listpopup.h | 71 + widget/include/ivug-scissorbox.h | 54 + widget/res/images/crop/T06_selection.png | Bin 0 -> 198 bytes widget/res/images/crop/T06_selection_Delete.png | Bin 0 -> 5446 bytes .../res/images/crop/T06_selection_Resizing_V.png | Bin 0 -> 5852 bytes .../res/images/crop/T06_selection_Resizing_h.png | Bin 0 -> 6714 bytes widget/res/images/crop/T06_selection_Rotate.png | Bin 0 -> 7466 bytes widget/res/images/scissorbox/T01_CallerID_hold.png | Bin 0 -> 2881 bytes .../res/images/scissorbox/T01_CallerID_line_W.png | Bin 0 -> 2802 bytes .../scissorbox/T01_CallerID_line_W_press.png | Bin 0 -> 2808 bytes .../res/images/scissorbox/T01_CallerID_line_h.png | Bin 0 -> 2807 bytes .../scissorbox/T01_CallerID_line_h_press.png | Bin 0 -> 2807 bytes .../res/images/scissorbox/T01_CallerID_normal.png | Bin 0 -> 2879 bytes .../res/images/scissorbox/T01_CallerID_press.png | Bin 0 -> 2845 bytes widget/res/images/scroller/transparent_bg.png | Bin 0 -> 189 bytes widget/res/layout/ivug-scroller.edc | 324 ++ widget/src/common/BufferCanvas.h | 54 + widget/src/common/Primitives.cpp | 61 + widget/src/image/ivug-image.cpp | 500 +++ widget/src/scissorbox/ScissorBox.cpp | 1734 ++++++++++ widget/src/scissorbox/ScissorBox.h | 124 + widget/src/scissorbox/ivug-scissorbox.cpp | 127 + widget/src/util/EFLUtil.cpp | 524 +++ widget/src/util/ivug-listpopup.c | 489 +++ 256 files changed, 66680 insertions(+) create mode 100644 CMakeLists.txt create mode 100755 LICENSE.Flora create mode 100755 NOTICE create mode 100755 common/CMakeLists.txt create mode 100755 common/include/debug.h create mode 100755 common/include/ivug-callback.h create mode 100755 common/include/ivug-config.h create mode 100755 common/include/ivug-db.h create mode 100755 common/include/ivug-debug.h create mode 100755 common/include/ivug-dir.h create mode 100755 common/include/ivug-drm-common.h create mode 100755 common/include/ivug-exif.h create mode 100755 common/include/ivug-file-info.h create mode 100755 common/include/ivug-message.h create mode 100755 common/include/ivug-mouse-event.h create mode 100755 common/include/ivug-util.h create mode 100755 common/include/ivug-uuid.h create mode 100755 common/include/statistics.h create mode 100755 common/src/debug.c create mode 100755 common/src/ivug-callback.c create mode 100755 common/src/ivug-config.c create mode 100755 common/src/ivug-db.c create mode 100755 common/src/ivug-dir.cpp create mode 100755 common/src/ivug-drm-common.c create mode 100755 common/src/ivug-exif.c create mode 100755 common/src/ivug-file-info.c create mode 100755 common/src/ivug-message.c create mode 100755 common/src/ivug-mouse-event.c create mode 100755 common/src/ivug-util.c create mode 100755 common/src/ivug-uuid.c create mode 100755 common/src/statistics.c create mode 100755 feature/CMakeLists.txt create mode 100755 feature/include/ivug-ext-ug.h create mode 100755 feature/src/ivug-ext-ug.c create mode 100755 include/ivug-datatypes.h create mode 100755 include/ivug-define.h create mode 100755 main/CMakeLists.txt create mode 100644 main/layout/gengrid/00_winset_thumbs_bg.png create mode 100644 main/layout/gengrid/00_winset_thumbs_focus_bg.png create mode 100755 main/layout/genlist/genlist_group_index.edc create mode 100755 main/layout/genlist/genlist_macro.edc create mode 100755 main/layout/genlist/genlist_size.edc create mode 100755 main/layout/genlist/genlist_styles.edc create mode 100755 main/layout/genlist/genlist_textblock_styles.edc create mode 100755 main/layout/genlist/ivug-genlist.edc create mode 100644 main/layout/icons/T01_Facebook.png create mode 100644 main/layout/icons/T01_btn_paused.png create mode 100644 main/layout/icons/T01_btn_play.png create mode 100755 main/layout/images/00_zoom_in.png create mode 100755 main/layout/images/00_zoom_in_press.png create mode 100755 main/layout/images/00_zoom_out.png create mode 100755 main/layout/images/00_zoom_out_press.png create mode 100644 main/layout/images/theme/blue/00_winset_control_toolbar_bg.png create mode 100644 main/layout/images/theme/blue/00_winset_control_top_arrow.png create mode 100644 main/layout/images/theme/blue/00_winset_control_top_bg.png create mode 100644 main/layout/images/theme/blue/00_winset_title_bg.png create mode 100644 main/layout/images/theme/blue/00_winset_title_line.png create mode 100644 main/layout/images/theme/blue/T01_Edit Field_clear.png create mode 100644 main/layout/images/theme/blue/T01_title_btn.png create mode 100644 main/layout/images/theme/blue/T01_title_btn_press.png create mode 100644 main/layout/images/theme/white/00_winset_control_toolbar_bg.png create mode 100644 main/layout/images/theme/white/00_winset_control_top_arrow.png create mode 100644 main/layout/images/theme/white/00_winset_control_top_bg.png create mode 100644 main/layout/images/theme/white/00_winset_divider_line.png create mode 100644 main/layout/images/theme/white/00_winset_title_bg.png create mode 100644 main/layout/images/theme/white/T01_Edit Field_clear.png create mode 100644 main/layout/images/theme/white/T01_title_btn.png create mode 100644 main/layout/images/theme/white/T01_title_btn_press.png create mode 100755 main/layout/ivug-base.edc create mode 100755 main/layout/ivug-crop-view.edc create mode 100755 main/layout/ivug-details.edc create mode 100755 main/layout/ivug-effect.edc create mode 100755 main/layout/ivug-gengrid.edc create mode 100755 main/layout/ivug-icons.edc create mode 100755 main/layout/ivug-main.edc create mode 100755 main/layout/ivug-name-view.edc create mode 100755 main/layout/ivug-naviframe.edc create mode 100755 main/layout/ivug-popup.edc create mode 100755 main/layout/ivug-selectioninfo.edc create mode 100755 main/layout/ivug-setas.edc create mode 100755 main/layout/ivug-slider.edc create mode 100755 main/layout/ivug-slideshow-view.edc create mode 100755 main/layout/ivug-theme.edc create mode 100644 main/res/images/image_drm_no_rights.jpg create mode 100755 main/src/control/ivug-buddy-ug.cpp create mode 100755 main/src/control/ivug-buddy-ug.h create mode 100755 main/src/control/ivug-context.c create mode 100755 main/src/control/ivug-context.h create mode 100755 main/src/control/ivug-crop-ug.cpp create mode 100755 main/src/control/ivug-crop-ug.h create mode 100755 main/src/control/ivug-detail-info.c create mode 100755 main/src/control/ivug-detail-info.h create mode 100755 main/src/control/ivug-parameter.c create mode 100755 main/src/control/ivug-parameter.h create mode 100755 main/src/control/ivug-popup.c create mode 100755 main/src/control/ivug-popup.h create mode 100755 main/src/control/ivug-selectioninfo.c create mode 100755 main/src/control/ivug-selectioninfo.h create mode 100755 main/src/control/ivug-setas.cpp create mode 100755 main/src/control/ivug-setas.h create mode 100755 main/src/control/ivug-widget.c create mode 100755 main/src/control/ivug-widget.h create mode 100755 main/src/include/ivug-common.h create mode 100755 main/src/include/ivug-crop-view.h create mode 100755 main/src/include/ivug-details-view.h create mode 100755 main/src/include/ivug-main-view.h create mode 100755 main/src/include/ivug-name-view.h create mode 100755 main/src/include/ivug-setas-view.h create mode 100755 main/src/include/ivug-slider-item.h create mode 100755 main/src/include/ivug-slider.h create mode 100755 main/src/include/ivug-slideshow-view.h create mode 100755 main/src/slider/ivug-slider-item.cpp create mode 100755 main/src/slider/ivug-slider-mouse.cpp create mode 100755 main/src/slider/ivug-slider-priv.h create mode 100755 main/src/slider/ivug-slider.cpp create mode 100755 main/src/ug-image-viewer.cpp create mode 100755 main/src/view/ivug-crop-view.cpp create mode 100755 main/src/view/ivug-details-view.c create mode 100755 main/src/view/ivug-main-view-menu.cpp create mode 100755 main/src/view/ivug-main-view-menu.h create mode 100755 main/src/view/ivug-main-view-priv.h create mode 100755 main/src/view/ivug-main-view-toolbar.cpp create mode 100755 main/src/view/ivug-main-view-toolbar.h create mode 100755 main/src/view/ivug-main-view.cpp create mode 100755 main/src/view/ivug-name-view.c create mode 100755 main/src/view/ivug-setas-view-callerid.cpp create mode 100755 main/src/view/ivug-setas-view-callerid.h create mode 100755 main/src/view/ivug-setas-view-wallpaper.cpp create mode 100755 main/src/view/ivug-setas-view-wallpaper.h create mode 100755 main/src/view/ivug-setas-view.c create mode 100755 main/src/view/ivug-slideshow-view.cpp create mode 100755 medialist/CMakeLists.txt create mode 100755 medialist/include/ivug-filter.h create mode 100755 medialist/include/ivug-media.h create mode 100755 medialist/include/ivug-medialist.h create mode 100755 medialist/src/ivug-data-list.c create mode 100755 medialist/src/ivug-data-list.h create mode 100755 medialist/src/ivug-filter.c create mode 100755 medialist/src/ivug-mediadata.c create mode 100755 medialist/src/ivug-mediadata.h create mode 100755 medialist/src/ivug-medialist.c create mode 100644 packaging/changelog create mode 100644 packaging/ug-image-viewer-efl.changes create mode 100755 packaging/ug-image-viewer-efl.spec create mode 100644 res/CMakeLists.txt create mode 100755 res/appicon/ug-image-viewer-efl.png create mode 100644 res/images/T01_Nocontents_broken.png create mode 100755 res/include/ivug-string.h create mode 100644 res/po/CMakeLists.txt create mode 100755 res/po/ar.po create mode 100755 res/po/az.po create mode 100755 res/po/bg.po create mode 100755 res/po/ca.po create mode 100755 res/po/cs.po create mode 100644 res/po/csv2po_v2 create mode 100755 res/po/da.po create mode 100755 res/po/de_DE.po create mode 100755 res/po/el_GR.po create mode 100755 res/po/en.po create mode 100755 res/po/en_PH.po create mode 100755 res/po/en_US.po create mode 100755 res/po/es_ES.po create mode 100755 res/po/es_MX.po create mode 100755 res/po/et.po create mode 100755 res/po/eu.po create mode 100755 res/po/fi.po create mode 100755 res/po/fr_CA.po create mode 100755 res/po/fr_FR.po create mode 100755 res/po/ga.po create mode 100755 res/po/gl.po create mode 100755 res/po/hi.po create mode 100755 res/po/hr.po create mode 100755 res/po/hu.po create mode 100755 res/po/hy.po create mode 100755 res/po/is.po create mode 100755 res/po/it_IT.po create mode 100755 res/po/ja_JP.po create mode 100755 res/po/ka.po create mode 100755 res/po/kk.po create mode 100755 res/po/ko_KR.po create mode 100755 res/po/lt.po create mode 100755 res/po/lv.po create mode 100755 res/po/mk.po create mode 100755 res/po/nb.po create mode 100755 res/po/nl_NL.po create mode 100755 res/po/pl.po create mode 100755 res/po/pt_BR.po create mode 100755 res/po/pt_PT.po create mode 100755 res/po/ro.po create mode 100755 res/po/ru_RU.po create mode 100755 res/po/sk.po create mode 100755 res/po/sl.po create mode 100755 res/po/sr.po create mode 100755 res/po/sv.po create mode 100755 res/po/tr_TR.po create mode 100755 res/po/uk.po create mode 100755 res/po/uz.po create mode 100755 res/po/zh_CN.po create mode 100755 res/po/zh_HK.po create mode 100755 res/po/zh_SG.po create mode 100755 res/po/zh_TW.po create mode 100755 slideshow/CMakeLists.txt create mode 100755 slideshow/include/ivug-slideshow.h create mode 100644 slideshow/res/images/T01_Noise.png create mode 100644 slideshow/res/layout/icons/T01_btn_play.png create mode 100755 slideshow/res/layout/ivug-ss-ly.edc create mode 100755 slideshow/src/control/ivug-slideshow.cpp create mode 100755 slideshow/src/effect/include/ivug-anim.h create mode 100755 slideshow/src/effect/include/ivug-effect.h create mode 100755 slideshow/src/effect/ivug-anim.c create mode 100755 slideshow/src/effect/ivug-blind.c create mode 100755 slideshow/src/effect/ivug-dissolve.c create mode 100755 slideshow/src/effect/ivug-effect.c create mode 100755 slideshow/src/effect/ivug-fade.c create mode 100755 slideshow/src/effect/ivug-iris.c create mode 100755 slideshow/src/effect/ivug-slide.c create mode 100755 slideshow/src/effect/ivug-xcapture.c create mode 100755 slideshow/src/effect/ivug-xcapture.h create mode 100755 slideshow/src/effect/template.c create mode 100755 slideshow/src/include/ivug-slideshow-priv.h create mode 100644 ug-image-viewer-efl.manifest create mode 100644 ug-image-viewer-efl.xml create mode 100755 widget/CMakeLists.txt create mode 100755 widget/include/Animation.h create mode 100755 widget/include/ECoreAnimator.h create mode 100755 widget/include/EFLUtil.h create mode 100755 widget/include/EvasSmartObj.h create mode 100755 widget/include/Exception.h create mode 100755 widget/include/Object.h create mode 100755 widget/include/Primitives.h create mode 100755 widget/include/Transit.h create mode 100755 widget/include/ivug-image.h create mode 100755 widget/include/ivug-listpopup.h create mode 100755 widget/include/ivug-scissorbox.h create mode 100644 widget/res/images/crop/T06_selection.png create mode 100644 widget/res/images/crop/T06_selection_Delete.png create mode 100644 widget/res/images/crop/T06_selection_Resizing_V.png create mode 100644 widget/res/images/crop/T06_selection_Resizing_h.png create mode 100644 widget/res/images/crop/T06_selection_Rotate.png create mode 100644 widget/res/images/scissorbox/T01_CallerID_hold.png create mode 100644 widget/res/images/scissorbox/T01_CallerID_line_W.png create mode 100644 widget/res/images/scissorbox/T01_CallerID_line_W_press.png create mode 100644 widget/res/images/scissorbox/T01_CallerID_line_h.png create mode 100644 widget/res/images/scissorbox/T01_CallerID_line_h_press.png create mode 100644 widget/res/images/scissorbox/T01_CallerID_normal.png create mode 100644 widget/res/images/scissorbox/T01_CallerID_press.png create mode 100644 widget/res/images/scroller/transparent_bg.png create mode 100755 widget/res/layout/ivug-scroller.edc create mode 100755 widget/src/common/BufferCanvas.h create mode 100755 widget/src/common/Primitives.cpp create mode 100755 widget/src/image/ivug-image.cpp create mode 100755 widget/src/scissorbox/ScissorBox.cpp create mode 100755 widget/src/scissorbox/ScissorBox.h create mode 100755 widget/src/scissorbox/ivug-scissorbox.cpp create mode 100755 widget/src/util/EFLUtil.cpp create mode 100755 widget/src/util/ivug-listpopup.c diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..549031c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,62 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(IVUG_PACKAGE_NAME "ug-image-viewer-efl") + +# BUILD_TC can have TRUE or FALSE +#SET(BUILD_TC TRUE) + +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") +ENDIF("${ARCH}" STREQUAL "arm") + +ADD_DEFINITIONS("-DDATADIR=\"${CMAKE_DATA_DIR}\"") +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DPACKAGE=\"${IVUG_PACKAGE_NAME}\"") +ADD_DEFINITIONS("-DIVAPI=") + +SET(IVUG_SOURCE_COMMON_DIR "${CMAKE_SOURCE_DIR}/common") +SET(IVUG_SOURCE_WIDGET_DIR "${CMAKE_SOURCE_DIR}/widget") +SET(IVUG_SOURCE_MAIN_DIR "${CMAKE_SOURCE_DIR}/main") +SET(IVUG_SOURCE_MEDIA_DIR "${CMAKE_SOURCE_DIR}/medialist") +SET(IVUG_SOURCE_SLIDESHOW_DIR "${CMAKE_SOURCE_DIR}/slideshow") +SET(IVUG_SOURCE_FEATURE_DIR "${CMAKE_SOURCE_DIR}/feature") +SET(IVUG_SOURCE_RESOURCE_DIR "${CMAKE_SOURCE_DIR}/res") + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}") + +message("CFLAGS="${CMAKE_C_FLAGS}) +message("CXXFLAGS="${CMAKE_CXX_FLAGS}) +message("LDFLAGS="${LDFLAGS}) + +FUNCTION (BUILD_EDJ _in _out _base _dir) + ADD_CUSTOM_TARGET(${_out} + COMMAND + edje_cc -id ${_base}/${_dir} + ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_in} + ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_out} + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_in} + ) + ADD_DEPENDENCIES(${PROJECT_NAME} ${_out}) + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_out} DESTINATION ${CMAKE_INSTALL_PREFIX}/res/edje/${IVUG_PACKAGE_NAME}) +ENDFUNCTION (BUILD_EDJ) + +ADD_SUBDIRECTORY(main) +ADD_SUBDIRECTORY(common) +ADD_SUBDIRECTORY(medialist) +ADD_SUBDIRECTORY(widget) +ADD_SUBDIRECTORY(slideshow) +ADD_SUBDIRECTORY(feature) +ADD_SUBDIRECTORY(res) + +# Install manifest +INSTALL(FILES ${IVUG_PACKAGE_NAME}.xml DESTINATION /usr/share/packages) + +INSTALL(FILES LICENSE.Flora DESTINATION /usr/share/license RENAME ${IVUG_PACKAGE_NAME}) + +IF (BUILD_TC) + ADD_SUBDIRECTORY(TC) +ENDIF() + diff --git a/LICENSE.Flora b/LICENSE.Flora new file mode 100755 index 0000000..571fe79 --- /dev/null +++ b/LICENSE.Flora @@ -0,0 +1,206 @@ +Flora License + +Version 1.1, April, 2013 + +http://floralicense.org/license/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and +all other entities that control, are controlled by, or are +under common control with that entity. For the purposes of +this definition, "control" means (i) the power, direct or indirect, +to cause the direction or management of such entity, +whether by contract or otherwise, or (ii) ownership of fifty percent (50%) +or more of the outstanding shares, or (iii) beneficial ownership of +such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice +that is included in or attached to the work (an example is provided +in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, +that is based on (or derived from) the Work and for which the editorial +revisions, annotations, elaborations, or other modifications represent, +as a whole, an original work of authorship. For the purposes of this License, +Derivative Works shall not include works that remain separable from, +or merely link (or bind by name) to the interfaces of, the Work and +Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor +for inclusion in the Work by the copyright owner or by an individual or +Legal Entity authorized to submit on behalf of the copyright owner. +For the purposes of this definition, "submitted" means any form of +electronic, verbal, or written communication sent to the Licensor or +its representatives, including but not limited to communication on +electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor +for the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated +in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +"Tizen Certified Platform" shall mean a software platform that complies +with the standards set forth in the Tizen Compliance Specification +and passes the Tizen Compliance Tests as defined from time to time +by the Tizen Technical Steering Group and certified by the Tizen +Association or its designated agent. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work +solely as incorporated into a Tizen Certified Platform, where such +license applies only to those patent claims licensable by such +Contributor that are necessarily infringed by their Contribution(s) +alone or by combination of their Contribution(s) with the Work solely +as incorporated into a Tizen Certified Platform to which such +Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim +in a lawsuit) alleging that the Work or a Contribution incorporated +within the Work constitutes direct or contributory patent infringement, +then any patent licenses granted to You under this License for that +Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof pursuant to the copyright license +above, in any medium, with or without modifications, and in Source or +Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works + a copy of this License; and + 2. You must cause any modified files to carry prominent notices stating + that You changed the files; and + 3. You must retain, in the Source form of any Derivative Works that + You distribute, all copyright, patent, trademark, and attribution + notices from the Source form of the Work, excluding those notices + that do not pertain to any part of the Derivative Works; and + 4. If the Work includes a "NOTICE" text file as part of its distribution, + then any Derivative Works that You distribute must include a readable + copy of the attribution notices contained within such NOTICE file, + excluding those notices that do not pertain to any part of + the Derivative Works, in at least one of the following places: + within a NOTICE text file distributed as part of the Derivative Works; + within the Source form or documentation, if provided along with the + Derivative Works; or, within a display generated by the Derivative Works, + if and wherever such third-party notices normally appear. + The contents of the NOTICE file are for informational purposes only + and do not modify the License. You may add Your own attribution notices + within Derivative Works that You distribute, alongside or as an addendum + to the NOTICE text from the Work, provided that such additional attribution + notices cannot be construed as modifying the License. You may add Your own + copyright statement to Your modifications and may provide additional or + different license terms and conditions for use, reproduction, or + distribution of Your modifications, or for any such Derivative Works + as a whole, provided Your use, reproduction, and distribution of + the Work otherwise complies with the conditions stated in this License + and your own copyright statement or terms and conditions do not conflict + the conditions stated in the License including section 3. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Flora License to your work + +To apply the Flora License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "[]" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + diff --git a/NOTICE b/NOTICE new file mode 100755 index 0000000..94d56df --- /dev/null +++ b/NOTICE @@ -0,0 +1,3 @@ +Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved. +Except as noted, this software is licensed under Flora License, Version 1.1 +Please, see the LICENSE.Flora file for Flora License, Version 1.1 terms and conditions. diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt new file mode 100755 index 0000000..dcda72b --- /dev/null +++ b/common/CMakeLists.txt @@ -0,0 +1,62 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(ivug_common C CXX) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(VERSION 0.1.0) + +SET(SRCS + src/ivug-mouse-event.c + src/debug.c + src/statistics.c + src/ivug-uuid.c + src/ivug-util.c + src/ivug-drm-common.c + src/ivug-file-info.c + src/ivug-callback.c + src/ivug-config.c + src/ivug-message.c + src/ivug-exif.c + src/ivug-db.c + src/ivug-dir.cpp +) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/include + include + src +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(${PROJECT_NAME}_pkgs REQUIRED + elementary + evas + ecore-evas + ecore-file + efreet-mime + dlog + drm-client + libexif + vconf + icu-i18n + capi-system-power + capi-media-metadata-extractor + capi-content-mime-type + capi-content-media-content + capi-system-system-settings + capi-system-runtime-info +) + +FOREACH(flag ${${PROJECT_NAME}_pkgs_CFLAGS}) + SET(EXTRA_FLAGS "${EXTRA_FLAGS} ${flag}") +ENDFOREACH(flag) + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") + +ADD_LIBRARY(${PROJECT_NAME} STATIC ${SRCS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION} ) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${EXTRA_FLAGS}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS}) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib) + diff --git a/common/include/debug.h b/common/include/debug.h new file mode 100755 index 0000000..1a0c7ac --- /dev/null +++ b/common/include/debug.h @@ -0,0 +1,269 @@ +/* + * Copyright 2012 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 __ELM_MYPHOTOCAM_DEBUG_H__ +#define __ELM_MYPHOTOCAM_DEBUG_H__ + +#include + + +/* + Category : + FATAL + ERROR + WARN + HIGH + MED + LOW + DEBUG +*/ + + +enum +{ + DBG_MSG_LOW = 0, + DBG_MSG_MED = 1, + DBG_MSG_HIGH = 2, + + DBG_MSG_WARN = 3, + DBG_MSG_ERROR = 4, + DBG_MSG_FATAL = 5, + + DBG_MSG_CUST5 = 6, + DBG_MSG_CUST6 = 7, + DBG_MSG_CUST7 = 8, + DBG_MSG_CUST8 = 9, + DBG_MSG_CUST9 = 10, + DBG_MSG_CUST10 = 11, + DBG_MSG_CUST11 = 12, + DBG_MSG_CUST12 = 13, + DBG_MSG_CUST13 = 14, +}; + + +// level +enum +{ + DBG_MSG_BIT_LOW = (1< +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#undef DISABLE_LOG + +// Time analyzer +#define DEFINE_PERFORM_TIME(aa) long aa = 0; struct timeval tv + +#define BEGIN_PERFORM_TIME(aa) \ + { \ + gettimeofday(&tv, NULL); \ + aa = tv.tv_sec * 1000 + tv.tv_usec / 1000; \ + } while(0) + +#define END_PERFORM_TIME(aa) \ + { \ + gettimeofday(&tv, NULL); \ + aa = ( tv.tv_sec * 1000 + tv.tv_usec / 1000 ) - aa; \ + } while(0) + +typedef struct { + const char *fname; + int nline; + const char *szcategory; + int msg_level; + const char *szlevel; + unsigned long time; +} debug_msg_type; + +void __custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); + +#ifdef DISABLE_LOG + +#define __MSG_FATAL(level, szCat, ...) +#define __MSG_ERROR(level, szCat, ...) +#define __MSG_WARN(level, szCat, ...) +#define __MSG_HIGH(level, szCat, ...) +#define __MSG_MED(level, szCat, ...) +#define __MSG_LOW(level, szCat, ...) +#define __MSG_DEBUG(level, szCat, ...) + +#else // DISABLE_LOG + +/* coverity[+kill] */ +#define __MSG_FATAL(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_FATAL) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_FATAL, \ + "FATAL", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + +#define __MSG_ERROR(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_ERROR) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_ERROR, \ + "ERROR", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + + +#define __MSG_WARN(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_WARN) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_WARN, \ + "WARN", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + +#define __MSG_HIGH(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_HIGH) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_HIGH, \ + "HIGH", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + +#define __MSG_MED(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_MED) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_MED, \ + "MED", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + + +#define __MSG_LOW(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_LOW) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_LOW, \ + "LOW", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + +#define __MSG_DBG(level, szCat, ...) \ + do { \ + if ((level) & DBG_MSG_BIT_CUST13) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + DBG_MSG_BIT_CUST13, \ + "DBG", \ + }; \ + __custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + + +#endif // DISABLE_LOG + +#define ASSERT(level, szCat, expr) \ + do { \ + if( !(expr) ) \ + { \ + __MSG_FATAL(level, szCat, "[%s] ASSERT : " #expr , __func__ ); \ + } \ + } while(0) + +#define NEVER_GET_HERE(level, szCat) \ + do { \ + __MSG_FATAL(level, szCat, "NeverGetHere : %s(%d)", __func__, __LINE__); \ + } while(0) + +#ifdef __cplusplus +} +#endif + + +#endif // __ELM_MYPHOTOCAM_DEBUG_H__ + diff --git a/common/include/ivug-callback.h b/common/include/ivug-callback.h new file mode 100755 index 0000000..ce89068 --- /dev/null +++ b/common/include/ivug-callback.h @@ -0,0 +1,45 @@ +/* + * Copyright 2012 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 __IVUG_CALLBACK_H__ +#define __IVUG_CALLBACK_H__ + +typedef void (*callback_func_t) (void *data1, void *data2, void *data3, void *user_data); + +typedef struct { + callback_func_t CBFunc; + void *data; +}callback_handle_t; + +#ifdef __cplusplus +extern "C" { +#endif + +callback_handle_t * ivug_callback_register(void); + +void ivug_callback_set_callback(callback_handle_t *handle, callback_func_t callback, void *data); + +void ivug_callback_call(callback_handle_t *handle, void *data1, void *data2, void *data3); + +void ivug_callback_unregister(callback_handle_t *handle); + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_CALLBACK_H__ +//! End of a file diff --git a/common/include/ivug-config.h b/common/include/ivug-config.h new file mode 100755 index 0000000..ca965b2 --- /dev/null +++ b/common/include/ivug-config.h @@ -0,0 +1,63 @@ +/* + * Copyright 2012 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 __IVUG_CONFIG_H__ +#define __IVUG_CONFIG_H__ + +#include + +#include "ivug-define.h" + +typedef enum { + SLIDE_SHOW_MODE_NORMAL = 0x00, + SLIDE_SHOW_MODE_REPEAT = 0x01, + SLIDE_SHOW_MODE_SHUFFLE = 0x02, + SLIDE_SHOW_MODE_SHUFFLE_REPEAT = 0x03, +} slide_show_mode; + +typedef enum { + IVUG_EFFECT_TYPE_UNKNOWN = -1, + + IVUG_EFFECT_TYPE_IRIS= 0x00, + IVUG_EFFECT_TYPE_DISSOLVE, + IVUG_EFFECT_TYPE_SLIDE, + IVUG_EFFECT_TYPE_DISSOLVE_FADE, + IVUG_EFFECT_TYPE_SPLIT, + IVUG_EFFECT_TYPE_MAX, +} ivug_effect_type; + +typedef void (*_vconf_state_changed_cb)(keynode_t* node, void *data); + +#ifdef __cplusplus +extern "C" { +#endif + +bool ivug_config_set_lockscreen_image(const char* filepath); + +bool ivug_config_set_homescreen_image(const char* filepath); + +void ivug_config_get_slideshow_setting(slide_show_mode * /* OUT */ mode, + double * /* OUT */ interval_time, + ivug_effect_type * /* OUT */ effect_type); + +bool ivug_config_get_can_rotate(void); + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_CONFIG_H__ diff --git a/common/include/ivug-db.h b/common/include/ivug-db.h new file mode 100755 index 0000000..db11767 --- /dev/null +++ b/common/include/ivug-db.h @@ -0,0 +1,101 @@ +/* + * Copyright 2012 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 __IVUG_DB_H__ +#define __IVUG_DB_H__ + +#include + +#include "ivug-datatypes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *filter_handle; +typedef void *media_handle; +typedef void *tag_handle; + +typedef bool (*ivug_db_cb)(media_handle media, void *user_data); +typedef void (*ivug_db_path_cb)(media_handle media, const char *path, void *user_data); + +#define IVUG_MAX_CONDITION_LEN (1024) + +typedef struct _Ivug_DB_h +{ + ivug_db_path_cb callback; + media_handle *m_handle; + void *data; + int key; +}Ivug_DB_h; + +bool ivug_db_create(void); +bool ivug_db_destroy(void); + +bool ivug_db_update(media_handle media); +bool ivug_db_refresh(const char *media_id); +bool ivug_db_rename(media_handle m_handle, const char *dest); + +bool ivug_db_create_filter(filter_handle *filter); +bool ivug_db_destroy_filter(filter_handle filter); +bool ivug_db_set_filter(filter_handle filter, ivug_view_by view_by, ivug_media_type media_type, char *condition); +bool ivug_db_set_filter_offset(filter_handle filter, int stp, int endp); + +media_handle ivug_db_insert_file_to_DB(const char* filepath); + +media_handle ivug_db_get_file_handle(const char* filepath); +media_handle ivug_db_get_file_handle_from_media_id(const char* media_id); +media_handle ivug_db_get_folder_handle(const char* folderpath); +tag_handle ivug_db_get_tag_handle(const char* tagname); + +bool ivug_db_destroy_file_handle(media_handle m_handle); +bool ivug_db_destroy_folder_handle(media_handle m_handle); + +bool ivug_db_get_all_folder_list(ivug_db_cb callback, void *data); +bool ivug_db_get_all_tag_list(ivug_db_cb callback, void *data); + +bool ivug_db_create_tag(tag_handle *tag_h, const char *tag_name); +bool ivug_db_destroy_tag(tag_handle tag_h); +bool ivug_db_set_tag(media_handle m_handle, tag_handle t_handle); + +bool ivug_db_set_favorite(media_handle media, bool set); + +int ivug_db_get_tag_id(tag_handle media); + +/* + below functions returned values should be freed by user +*/ +char *ivug_db_get_file_path(media_handle media); +char *ivug_db_get_file_id(media_handle media); +char *ivug_db_get_thumbnail_path(media_handle media); +char *ivug_db_get_folder_name(media_handle media); +char *ivug_db_get_folder_id(media_handle media); +char *ivug_db_get_folder_path(media_handle media); +char *ivug_db_get_tag_name(tag_handle media); + +bool ivug_db_get_file_size(media_handle media, unsigned long long *size); + + +Ivug_DB_h * ivug_db_create_thumbnail(media_handle media, ivug_db_path_cb callback, void *data); +bool ivug_db_cancel_thumbnail(Ivug_DB_h *db_h); + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_DB_H__ + diff --git a/common/include/ivug-debug.h b/common/include/ivug-debug.h new file mode 100755 index 0000000..984e91d --- /dev/null +++ b/common/include/ivug-debug.h @@ -0,0 +1,304 @@ +/* + * Copyright 2012 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 _IVUG_DEBUG_H_ +#define _IVUG_DEBUG_H_ + +#include +#include "statistics.h" + +#define IVUG_LOG_OUTPUT_DLOG + +#define PERF_TIME + +#define LVL0 (0) +#define LVL1 (1) +#define LVL2 (2) +#define LVL3 (3) +#define LVL4 (4) +#define LVL5 (5) +#define LVL6 (6) +#define LVL7 (7) + +#ifdef PERF_TIME + +// accum item handling +#define PERF_CHECK_BEGIN(lvl, name) iv_ta_accum_item_begin(lvl, name,false,__FILE__,__LINE__) +#define PERF_CHECK_END(lvl, name) iv_ta_accum_item_end(lvl, name,false,__FILE__,__LINE__) + +// Print out +#define PERF_SHOW_RESULT(fp) iv_ta_accum_show_result_fp(fp) + +#else + +#define PERF_CHECK_BEGIN(lvl, name) +#define PERF_CHECK_END(lvl, name) + +// Print out +#define PERF_SHOW_RESULT(fp) + +#endif // PERF_TIME + +enum { + IVUG_MSG_COLOR_DEFAULT = 0, + IVUG_MSG_COLOR_BLACK = 30, + IVUG_MSG_COLOR_RED = 31, + IVUG_MSG_COLOR_GREEN = 32, + IVUG_MSG_COLOR_YELLOW = 33, + IVUG_MSG_COLOR_BLUE = 34, + IVUG_MSG_COLOR_MAGENTA = 35, + IVUG_MSG_COLOR_CYAN = 36, + IVUG_MSG_COLOR_WHITE = 37, +}; + + +#ifdef IVUG_LOG_OUTPUT_DLOG + +#undef LOG_TAG +#define LOG_TAG "IV-COMMON" + +#define IVUG_DEBUG_MSG(fmt, arg...) LOGD("[%s : %05d]" fmt "\n", __func__, __LINE__, ##arg) +#define IVUG_DEBUG_WARNING(fmt, arg...) LOGW("[%s : %05d]" fmt "\n", __func__, __LINE__, ##arg) +#define IVUG_DEBUG_ERROR(fmt, arg...) LOGE("[%s : %05d]" fmt "\n", __func__, __LINE__ , ##arg) +#define IVUG_DEBUG_CRITICAL(fmt, arg...) LOGE("[%s : %05d]" fmt "\n", __func__, __LINE__ , ##arg) + +#else //USE_DLOG +#define IVUG_DEBUG_MSG(fmt, arg...) fprintf(stdout, "[D: %s : %05d]" fmt "\n", __func__, __LINE__, ##arg) +#define IVUG_DEBUG_WARNING(fmt, arg...) fprintf(stdout, "[W: %s : %05d]" fmt "\n", __func__, __LINE__, ##arg) +#define IVUG_DEBUG_ERROR(fmt, arg...) fprintf(stdout, "[E: %s : %05d]" fmt "\n", __func__, __LINE__ , ##arg) +#define IVUG_DEBUG_CRITICAL(fmt, arg...) fprintf(stdout, "[E: %s : %05d]" fmt "\n", __func__, __LINE__ , ##arg) +#define IVUG_DEBUG_PRINT(fmt,arg...) fprintf(stdout, "[%s : %05d] >>> leave \n", __func__, __LINE__ , ##arg) + +#endif //IVUG_LOG_OUTPUT_DLOG + +#define MSG_MOUSE_SZCAT "IV-MOUSE" +#define LVL_MOUSE DBG_MSG_LVL_WARN + +#define MSG_MOUSE_FATAL(...) __MSG_FATAL(LVL_MOUSE, MSG_MOUSE_SZCAT, ##__VA_ARGS__) +#define MSG_MOUSE_ERROR(...) __MSG_ERROR(LVL_MOUSE, MSG_MOUSE_SZCAT, ##__VA_ARGS__) +#define MSG_MOUSE_WARN(...) __MSG_WARN(LVL_MOUSE, MSG_MOUSE_SZCAT, ##__VA_ARGS__) +#define MSG_MOUSE_HIGH(...) __MSG_HIGH(LVL_MOUSE, MSG_MOUSE_SZCAT, ##__VA_ARGS__) +#define MSG_MOUSE_MED(...) __MSG_MED(LVL_MOUSE, MSG_MOUSE_SZCAT, ##__VA_ARGS__) +#define MSG_MOUSE_LOW(...) __MSG_LOW(LVL_MOUSE, MSG_MOUSE_SZCAT, ##__VA_ARGS__) + + +#define SLIDER_ITEM_SZ "IV-SITEM" +#define LVL_SLIDER_ITEM DBG_MSG_LVL_HIGH + + +#define MSG_SITEM_FATAL(...) __MSG_FATAL(LVL_SLIDER_ITEM, SLIDER_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SITEM_ERROR(...) __MSG_ERROR(LVL_SLIDER_ITEM, SLIDER_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SITEM_WARN(...) __MSG_WARN(LVL_SLIDER_ITEM, SLIDER_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SITEM_HIGH(...) __MSG_HIGH(LVL_SLIDER_ITEM, SLIDER_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SITEM_MED(...) __MSG_MED(LVL_SLIDER_ITEM, SLIDER_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SITEM_LOW(...) __MSG_LOW(LVL_SLIDER_ITEM, SLIDER_ITEM_SZ, ##__VA_ARGS__) + + +#define SLIDER_SZ "IV-SLIDER" +#define LVL_SLIDER DBG_MSG_LVL_HIGH + +#define MSG_SLIDER_FATAL(...) __MSG_FATAL(LVL_SLIDER, SLIDER_SZ, ##__VA_ARGS__) +#define MSG_SLIDER_ERROR(...) __MSG_ERROR(LVL_SLIDER, SLIDER_SZ, ##__VA_ARGS__) +#define MSG_SLIDER_WARN(...) __MSG_WARN(LVL_SLIDER, SLIDER_SZ, ##__VA_ARGS__) +#define MSG_SLIDER_HIGH(...) __MSG_HIGH(LVL_SLIDER, SLIDER_SZ, ##__VA_ARGS__) +#define MSG_SLIDER_MED(...) __MSG_MED(LVL_SLIDER, SLIDER_SZ, ##__VA_ARGS__) +#define MSG_SLIDER_LOW(...) __MSG_LOW(LVL_SLIDER, SLIDER_SZ, ##__VA_ARGS__) + +#define SETAS_SZ "IV-SETAS" +#define LVL_SETAS DBG_MSG_LVL_HIGH + +#define MSG_SETAS_FATAL(...) __MSG_FATAL(LVL_SETAS, SETAS_SZ, ##__VA_ARGS__) +#define MSG_SETAS_ERROR(...) __MSG_ERROR(LVL_SETAS, SETAS_SZ, ##__VA_ARGS__) +#define MSG_SETAS_WARN(...) __MSG_WARN(LVL_SETAS, SETAS_SZ, ##__VA_ARGS__) +#define MSG_SETAS_HIGH(...) __MSG_HIGH(LVL_SETAS, SETAS_SZ, ##__VA_ARGS__) +#define MSG_SETAS_MED(...) __MSG_MED(LVL_SETAS, SETAS_SZ, ##__VA_ARGS__) +#define MSG_SETAS_LOW(...) __MSG_LOW(LVL_SETAS, SETAS_SZ, ##__VA_ARGS__) + +#define DETAIL_SZ "IV-DETAIL" +#define LVL_DETAIL DBG_MSG_LVL_WARN + +#define MSG_DETAIL_FATAL(...) __MSG_FATAL(LVL_DETAIL, DETAIL_SZ, ##__VA_ARGS__) +#define MSG_DETAIL_ERROR(...) __MSG_ERROR(LVL_DETAIL, DETAIL_SZ, ##__VA_ARGS__) +#define MSG_DETAIL_WARN(...) __MSG_WARN(LVL_DETAIL, DETAIL_SZ, ##__VA_ARGS__) +#define MSG_DETAIL_HIGH(...) __MSG_HIGH(LVL_DETAIL, DETAIL_SZ, ##__VA_ARGS__) +#define MSG_DETAIL_MED(...) __MSG_MED(LVL_DETAIL, DETAIL_SZ, ##__VA_ARGS__) +#define MSG_DETAIL_LOW(...) __MSG_LOW(LVL_DETAIL, DETAIL_SZ, ##__VA_ARGS__) + +#define BEST_SZ "IV-BEST" +#define LVL_BEST DBG_MSG_LVL_HIGH + +#define MSG_BEST_FATAL(...) __MSG_FATAL(LVL_BEST, BEST_SZ, ##__VA_ARGS__) +#define MSG_BEST_ERROR(...) __MSG_ERROR(LVL_BEST, BEST_SZ, ##__VA_ARGS__) +#define MSG_BEST_WARN(...) __MSG_WARN(LVL_BEST, BEST_SZ, ##__VA_ARGS__) +#define MSG_BEST_HIGH(...) __MSG_HIGH(LVL_BEST, BEST_SZ, ##__VA_ARGS__) +#define MSG_BEST_MED(...) __MSG_MED(LVL_BEST, BEST_SZ, ##__VA_ARGS__) +#define MSG_BEST_LOW(...) __MSG_LOW(LVL_BEST, BEST_SZ, ##__VA_ARGS__) + + +#define SDATA_SZ "IV-SDATA" +#define LVL_SDATA DBG_MSG_LVL_HIGH + +#define MSG_SDATA_FATAL(...) __MSG_FATAL(LVL_SDATA, SDATA_SZ, ##__VA_ARGS__) +#define MSG_SDATA_ERROR(...) __MSG_ERROR(LVL_SDATA, SDATA_SZ, ##__VA_ARGS__) +#define MSG_SDATA_WARN(...) __MSG_WARN(LVL_SDATA, SDATA_SZ, ##__VA_ARGS__) +#define MSG_SDATA_HIGH(...) __MSG_HIGH(LVL_SDATA, SDATA_SZ, ##__VA_ARGS__) +#define MSG_SDATA_MED(...) __MSG_MED(LVL_SDATA, SDATA_SZ, ##__VA_ARGS__) +#define MSG_SDATA_LOW(...) __MSG_LOW(LVL_SDATA, SDATA_SZ, ##__VA_ARGS__) + + +#define IVCOMMON_SZ "IV-COMMON" +#define LVL_IVCOMMON DBG_MSG_LVL_HIGH + +#define MSG_IMAGEVIEW_FATAL(...) __MSG_FATAL(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IMAGEVIEW_ERROR(...) __MSG_ERROR(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IMAGEVIEW_WARN(...) __MSG_WARN(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IMAGEVIEW_HIGH(...) __MSG_HIGH(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IMAGEVIEW_MED(...) __MSG_MED(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IMAGEVIEW_LOW(...) __MSG_LOW(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) + +#define MSG_IVUG_FATAL(...) __MSG_FATAL(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IVUG_ERROR(...) __MSG_ERROR(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IVUG_WARN(...) __MSG_WARN(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IVUG_HIGH(...) __MSG_HIGH(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IVUG_MED(...) __MSG_MED(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) +#define MSG_IVUG_LOW(...) __MSG_LOW(LVL_IVCOMMON, IVCOMMON_SZ, ##__VA_ARGS__) + + + +#define MAINVIEW_SZ "IV-MAIN" +#define LVL_MAINVIEW DBG_MSG_LVL_HIGH + +#define MSG_MAIN_FATAL(...) __MSG_FATAL(LVL_MAINVIEW, MAINVIEW_SZ, ##__VA_ARGS__) +#define MSG_MAIN_ERROR(...) __MSG_ERROR(LVL_MAINVIEW, MAINVIEW_SZ, ##__VA_ARGS__) +#define MSG_MAIN_WARN(...) __MSG_WARN(LVL_MAINVIEW, MAINVIEW_SZ, ##__VA_ARGS__) +#define MSG_MAIN_HIGH(...) __MSG_HIGH(LVL_MAINVIEW, MAINVIEW_SZ, ##__VA_ARGS__) +#define MSG_MAIN_MED(...) __MSG_MED(LVL_MAINVIEW, MAINVIEW_SZ, ##__VA_ARGS__) +#define MSG_MAIN_LOW(...) __MSG_LOW(LVL_MAINVIEW, MAINVIEW_SZ, ##__VA_ARGS__) + +#define UTIL_SZ "IV-UTIL" +#define LVL_UTIL DBG_MSG_LVL_WARN + +#define MSG_UTIL_FATAL(...) __MSG_FATAL(LVL_UTIL, UTIL_SZ, ##__VA_ARGS__) +#define MSG_UTIL_ERROR(...) __MSG_ERROR(LVL_UTIL, UTIL_SZ, ##__VA_ARGS__) +#define MSG_UTIL_WARN(...) __MSG_WARN(LVL_UTIL, UTIL_SZ, ##__VA_ARGS__) +#define MSG_UTIL_HIGH(...) __MSG_HIGH(LVL_UTIL, UTIL_SZ, ##__VA_ARGS__) +#define MSG_UTIL_MED(...) __MSG_MED(LVL_UTIL, UTIL_SZ, ##__VA_ARGS__) +#define MSG_UTIL_LOW(...) __MSG_LOW(LVL_UTIL, UTIL_SZ, ##__VA_ARGS__) + +#define NOTI_SZ "IV-NOTI" +#define LVL_NOTI DBG_MSG_LVL_WARN + +#define MSG_NOTI_FATAL(...) __MSG_FATAL(LVL_NOTI, NOTI_SZ, ##__VA_ARGS__) +#define MSG_NOTI_ERROR(...) __MSG_ERROR(LVL_NOTI, NOTI_SZ, ##__VA_ARGS__) +#define MSG_NOTI_WARN(...) __MSG_WARN(LVL_NOTI, NOTI_SZ, ##__VA_ARGS__) +#define MSG_NOTI_HIGH(...) __MSG_HIGH(LVL_NOTI, NOTI_SZ, ##__VA_ARGS__) +#define MSG_NOTI_MED(...) __MSG_MED(LVL_NOTI, NOTI_SZ, ##__VA_ARGS__) +#define MSG_NOTI_LOW(...) __MSG_LOW(LVL_NOTI, NOTI_SZ, ##__VA_ARGS__) + +#define EFFECT_SZ "IV-EFFECT" +#define LVL_EFFECT DBG_MSG_LVL_WARN + +#define MSG_EFFECT_FATAL(...) __MSG_FATAL(LVL_EFFECT, EFFECT_SZ, ##__VA_ARGS__) +#define MSG_EFFECT_ERROR(...) __MSG_ERROR(LVL_EFFECT, EFFECT_SZ, ##__VA_ARGS__) +#define MSG_EFFECT_WARN(...) __MSG_WARN(LVL_EFFECT, EFFECT_SZ, ##__VA_ARGS__) +#define MSG_EFFECT_HIGH(...) __MSG_HIGH(LVL_EFFECT, EFFECT_SZ, ##__VA_ARGS__) +#define MSG_EFFECT_MED(...) __MSG_MED(LVL_EFFECT, EFFECT_SZ, ##__VA_ARGS__) +#define MSG_EFFECT_LOW(...) __MSG_LOW(LVL_EFFECT, EFFECT_SZ, ##__VA_ARGS__) + +#define SLIST_ITEM_SZ "IV-SLIST" +#define LVL_SLIST_ITEM DBG_MSG_LVL_WARN + +#define MSG_SLIST_FATAL(...) __MSG_FATAL(LVL_SLIST_ITEM, SLIST_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SLIST_ERROR(...) __MSG_ERROR(LVL_SLIST_ITEM, SLIST_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SLIST_WARN(...) __MSG_WARN(LVL_SLIST_ITEM, SLIST_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SLIST_HIGH(...) __MSG_HIGH(LVL_SLIST_ITEM, SLIST_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SLIST_MED(...) __MSG_MED(LVL_SLIST_ITEM, SLIST_ITEM_SZ, ##__VA_ARGS__) +#define MSG_SLIST_LOW(...) __MSG_LOW(LVL_SLIST_ITEM, SLIST_ITEM_SZ, ##__VA_ARGS__) + +#define IV_ASSERT(expr) ASSERT(DBG_MSG_LVL_ALL, "IV-COMMON", expr) + +#define MSG_ASSERT(expr) ASSERT(DBG_MSG_LVL_ALL, LOG_CAT, expr) + +#define MSG_FATAL(...) __MSG_FATAL(LOG_LVL, LOG_CAT, ##__VA_ARGS__) +#define MSG_ERROR(...) __MSG_ERROR(LOG_LVL, LOG_CAT, ##__VA_ARGS__) +#define MSG_WARN(...) __MSG_WARN(LOG_LVL, LOG_CAT, ##__VA_ARGS__) +#define MSG_HIGH(...) __MSG_HIGH(LOG_LVL, LOG_CAT, ##__VA_ARGS__) +#define MSG_MED(...) __MSG_MED(LOG_LVL, LOG_CAT, ##__VA_ARGS__) +#define MSG_LOW(...) __MSG_LOW(LOG_LVL, LOG_CAT, ##__VA_ARGS__) +#define MSG_DEBUG(...) __MSG_DBG(LOG_LVL, LOG_CAT, ##__VA_ARGS__) + +//expr check statements. +// Will deprecated + +#define IVUG_FUNC_ENTER() MSG_IVUG_HIGH("ENTER %s(L%d)", __func__, __LINE__) +#define IVUG_FUNC_LEAVE() MSG_IVUG_HIGH("LEAVE %s(L%d)", __func__, __LINE__) + + +#define ivug_ret_if(expr) \ + do { \ + if(expr) { \ + MSG_IVUG_ERROR("[%s] Return", #expr );\ + return; \ + } \ + } while (0) + +#define ivug_retv_if(expr, val) \ + do { \ + if(expr) { \ + MSG_IVUG_ERROR("[%s] Return value %d", #expr, val );\ + return (val); \ + } \ + } while (0) + +#define ivug_retm_if(expr, fmt, args...) \ + do { \ + if(expr) { \ + MSG_IVUG_ERROR("[%s] Return, message "fmt, #expr, ##args );\ + return; \ + } \ + } while (0) + +#define ivug_retvm_if(expr, val, fmt, args...) \ + do { \ + if(expr) { \ + MSG_IVUG_ERROR("[%s] Return value, message "fmt, #expr, ##args );\ + return (val); \ + } \ + } while (0) + + +// Use this instead of ivug_ret_if + +#define IV_RET_IF(expr, fmt, args...) \ + do { \ + if(expr) { \ + MSG_IVUG_FATAL("[%s] Return, message "fmt, #expr, ##args );\ + return; \ + } \ + } while (0) + +#define IV_RETV_IF(expr, val, fmt, args...) \ + do { \ + if(expr) { \ + MSG_IVUG_FATAL("[%s] Return value, message "fmt, #expr, ##args );\ + return (val); \ + } \ + } while (0) + +#include "debug.h" + + +#endif //_IVUG_DEBUG_H_ diff --git a/common/include/ivug-dir.h b/common/include/ivug-dir.h new file mode 100755 index 0000000..d35be7e --- /dev/null +++ b/common/include/ivug-dir.h @@ -0,0 +1,47 @@ +/* + * Copyright 2012 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 __IVUG_DIR_H__ +#define __IVUG_DIR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*EnumFilesCB)(const char *fname, void *data); + + +/* + Enumerate file name in @dir & call user callback function indicated by @pFunc.. + + Synchrounous function. +*/ +bool EnumFilesInDir(const char *dir, EnumFilesCB pFunc, void *data); + +/* + Retrieve file count in @dir. + return -1 when error occured. +*/ +int GetFilesCountInDir(const char *dir); + + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_DIR_H__ + diff --git a/common/include/ivug-drm-common.h b/common/include/ivug-drm-common.h new file mode 100755 index 0000000..1c99b8c --- /dev/null +++ b/common/include/ivug-drm-common.h @@ -0,0 +1,92 @@ +/* + * Copyright 2012 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 __IVUG_DRM_H__ +#define __IVUG_DRM_H__ + +#include + +typedef enum IVUG_DRM_SETAS_TYPE +{ + IVUG_DRM_SETAS_NONE = -1, + IVUG_DRM_SETAS_WALLPAPER, + IVUG_DRM_SETAS_CALLERID, +}_ivug_drm_setas_type; + +typedef enum +{ + IVUG_DRM_RESULT_LIMITED = -1, + IVUG_DRM_RESULT_UNLIMITED, + IVUG_DRM_RESULT_COUNT, + IVUG_DRM_RESULT_DATETIME, + IVUG_DRM_RESULT_INTERVAL_DAYS, + IVUG_DRM_RESULT_TIMED_COUNT, + IVUG_DRM_RESULT_ACCUMULATED, + IVUG_DRM_RESULT_INDIVIDUAL, + IVUG_DRM_RESULT_SYSTEM, +}drm_constraints; + +typedef struct +{ + drm_constraints constraints; + int data; +}drm_data_t; + +typedef void *drm_handle_t; + +#ifdef __cplusplus +extern "C" { +#endif + +/* + Check whether @param file_path is DRM or not. +*/ +bool ivug_drm_is_drm_file(const char* file_path); + +/* + Check RO is valid. + FL case : Always return true(valid RO). +*/ +bool ivug_drm_has_valid_ro(const char *path); + +/* + Retrieving infomation from file +*/ +char* ivug_drm_get_drm_vendor_info(const char *path); +bool ivug_drm_get_forwarding_info(const char *path); + +bool ivug_drm_is_possible_to_setas(const char* path, _ivug_drm_setas_type type); + +/* + Decrypt DRM file and allocated in memory. + + CAUTION : this functionn read entire file and allocate memory with size of entire file. +*/ +drm_data_t * ivug_drm_check_constraint(const char* path); + +/* return value must be freed */ +char * ivug_drm_get_right_url(const char *path); +char * ivug_drm_get_mime(const char *path); + + + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_DRM_H__ + diff --git a/common/include/ivug-exif.h b/common/include/ivug-exif.h new file mode 100755 index 0000000..d442965 --- /dev/null +++ b/common/include/ivug-exif.h @@ -0,0 +1,36 @@ +/* + * Copyright 2012 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 __IVUG_EXIF_H__ +#define __IVUG_EXIF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + +int ivug_exif_set_rotate(const char *file, int degree); + +int ivug_exif_get_rotate(const char *file, int *degree); + + +#ifdef __cplusplus +} +#endif + +#endif //__IVUG_EXIF_H__ + + diff --git a/common/include/ivug-file-info.h b/common/include/ivug-file-info.h new file mode 100755 index 0000000..9846df8 --- /dev/null +++ b/common/include/ivug-file-info.h @@ -0,0 +1,67 @@ +/* + * Copyright 2012 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 __IVUG_FILE_INFO_H__ +#define __IVUG_FILE_INFO_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + ivug_fileinfo_*() returns false when error. otherwise return true and fill proper value in [out] param +*/ +bool ivug_fileinfo_get_image_gps_info(const char* filepath, double * /* OUT */ latitude, double * /* OUT */ longitude); +bool ivug_fileinfo_get_video_gps_info(const char *filepath, double * /* OUT */ latitude, double * /* OUT */ longitude); + +bool ivug_fileinfo_get_video_resolution(const char *filepath, int * /* OUT */ pWidth, int * /* OUT */pHeight); +bool ivug_fileinfo_get_image_resolution(const char *filepath, int * /* OUT */ pWidth, int * /* OUT */pHeight); + + +/* + return file extension string. if file is DRM file, decrypted file extension is returned. + + CAUTION : user should free returned string. +*/ +char *ivug_fileinfo_get_file_extension(const char *filepath); + + +/* + return mine type from drm or non-drm file. + + CAUTION : user should free returned string. +*/ +char *ivug_fileinfo_get_mime_type(const char *filepath); +char *ivug_fileinfo_get_focal_length(const char *path); +char *ivug_fileinfo_get_model_name(const char *path); +char *ivug_fileinfo_get_maker_name(const char *path); +char *ivug_fileinfo_get_aperture(const char *path); +char *ivug_fileinfo_get_exposure_time(const char *path); +char *ivug_fileinfo_get_iso(const char *path); + +int ivug_fileinfo_get_flash_status(const char *path); +int ivug_fileinfo_get_orientation(const char *path); +int ivug_fileinfo_get_white_balance(const char *path); + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_FILE_INFO_H__ + diff --git a/common/include/ivug-message.h b/common/include/ivug-message.h new file mode 100755 index 0000000..f470963 --- /dev/null +++ b/common/include/ivug-message.h @@ -0,0 +1,44 @@ +/* + * Copyright 2012 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 __MESSAGE_H__ +#define __ MESSAGE_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void * MessageHandle; +typedef void (*FnMessage)( int param1, int param2, int param3, void *param4, void *client_data); + + +bool remove_message_handle(MessageHandle handle); + +MessageHandle create_message_handle(); + +bool register_message(MessageHandle handle, const char *command, FnMessage cb, void *data ); +bool unregister_message(MessageHandle handle, const char *command, FnMessage cb); + +bool send_message(MessageHandle handle, const char *command, int param1, int param2, int param3, void *param4); + +#ifdef __cplusplus +} +#endif + +#endif // __FMRADIO_MESSAGE_H__ + diff --git a/common/include/ivug-mouse-event.h b/common/include/ivug-mouse-event.h new file mode 100755 index 0000000..a8a6158 --- /dev/null +++ b/common/include/ivug-mouse-event.h @@ -0,0 +1,58 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +typedef struct { + int x, y; + + unsigned int timestamp; + + int button_flags; + + int event_flags; + int device; +} MouseEvent; + + +typedef struct { + void (*onMouseDown)(Evas_Object *obj, MouseEvent *down, void *data); + void (*onMouseDlbClick)(Evas_Object *obj, MouseEvent *click, void *data); + void (*onMouseUp)(Evas_Object *obj, MouseEvent *up, void *data); + void (*onMouseMove)(Evas_Object *obj, MouseEvent *prev, MouseEvent *cur, void *data); + + void (*onPinchStart)(Evas_Object *obj, MouseEvent *center, int dist, void *data); + void (*onPinchMove)(Evas_Object *obj, MouseEvent *center, int dist, void *data); + void (*onPinchEnd)(Evas_Object *obj, MouseEvent *end, void *data); // Is it really needed???? + +} mouse_callback_t; + +typedef void *Ivug_Event_Handle; + +#ifdef __cplusplus +extern "C" { +#endif + +Ivug_Event_Handle +ivug_mouse_event_add(Evas_Object *obj, mouse_callback_t *pCallback, void *client_data, const char *alias /* for debugging*/); + +void ivug_mouse_event_del(Ivug_Event_Handle handle); + +#ifdef __cplusplus +} +#endif + + diff --git a/common/include/ivug-util.h b/common/include/ivug-util.h new file mode 100755 index 0000000..5cfe62b --- /dev/null +++ b/common/include/ivug-util.h @@ -0,0 +1,102 @@ +/* + * Copyright 2012 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 __IVUG_UTIL_H__ +#define __IVUG_UTIL_H__ + +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + +*/ +bool ivug_is_web_uri(const char* uri); + +bool ivug_remove_file(const char *filepath); + +bool ivug_is_file_exist(const char* filepath); + +bool ivug_rename_file(const char *src, const char *dst); + +bool ivug_copy_file(const char *filename, const char *dest); + +char *ivug_get_filename(const char *filepath); + +char *ivug_get_directory(const char *filepath); + +unsigned int get_distance(int prevX, int prevY, int X, int Y); + +/* + Generate temporary file name with given path and extension. + returned value should free() by user. +*/ +char *ivug_mktemp(char* filepath, char*ext); + + +/* + LCD sleep control. +*/ +bool ivug_prohibit_lcd_off(void); +bool ivug_allow_lcd_off(void); + + +/* + Get mime type from file path. Can be used either DRM and non DRM. + should free returned after use. +*/ + +bool ivug_is_editable_video_file(char *filepath); + + +/* + returned values should be freed by user +*/ +int ivug_atoi(const char *number); + +double ivug_atod(const char *number); + +long int ivug_atox(const char *number); + +char * ivug_generate_file_name(const char *filepath, const char *extension, const char *dest_dir); + +/* + Removes leading and trailing whitespace from string + This function doesn't allocate or reallocate any memory +*/ +char * ivug_strip_string(char* name); + +bool ivug_is_bestpic(const char *file); + +/* + returned values should be freed by user +*/ +char * ivug_get_icu_date(time_t mtime); + +bool ivug_validate_file_name(const char *fname); + +#ifdef __cplusplus +} +#endif + + + +#endif //__IVUG_UTIL_H__ + diff --git a/common/include/ivug-uuid.h b/common/include/ivug-uuid.h new file mode 100755 index 0000000..012c852 --- /dev/null +++ b/common/include/ivug-uuid.h @@ -0,0 +1,47 @@ +/* + * Copyright 2012 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 __IVUG_UUID_H__ +#define __IVUG_UUID_H__ + +#include "ivug-datatypes.h" +#include + + + +#ifdef __cplusplus +extern "C" { +#endif + +UUID uuid_assign(UUID id); + +void uuid_free(UUID id); + +int uuid_compare(UUID id1, UUID id2); + +const char *uuid_getchar(UUID id); + +UUID uuid_getuuid(const char *szID); + +bool uuid_is_valid(UUID id); + + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_UUID_H__ + diff --git a/common/include/statistics.h b/common/include/statistics.h new file mode 100755 index 0000000..03950f0 --- /dev/null +++ b/common/include/statistics.h @@ -0,0 +1,40 @@ +/* + * Copyright 2012 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 __STATISTICS_H__ +#define __STATISTICS_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +int iv_ta_accum_item_begin(int lvl, const char* name, bool show, const char* filename, int line); +int iv_ta_accum_item_end(int lvl, const char* name, bool show, const char* filename, int line); +void iv_ta_accum_show_result_fp(FILE *fp); + +int IV_PERF_INIT(); +int IV_PERF_DEINIT(); + + +#ifdef __cplusplus +} +#endif + +#endif /* __STATISTICS_H__ */ + diff --git a/common/src/debug.c b/common/src/debug.c new file mode 100755 index 0000000..3d032da --- /dev/null +++ b/common/src/debug.c @@ -0,0 +1,400 @@ +/* + * Copyright 2012 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 +#include // localtime_r +#include // gettimeofday +#include +#include // strrchr + +#undef PRINT_TID + +#ifdef PRINT_TID +#include +#endif + +#ifndef __G_LIB_H__ + #define G_UNLIKELY(x) x +#endif + + +#include "debug.h" + +enum { + _DEBUG_OUTPUT_DIRECTION_CONSOLE = (1 << 0), + _DEBUG_OUTPUT_DIRECTION_SYSLOG = (1 << 1), + _DEBUG_OUTPUT_DIRECTION_FILE = (1 << 2), + _DEBUG_OUTPUT_DIRECTION_DLOG = (1 << 3), +}; + +// Configuration for output +// console message slower than dlog about 30~40 ms +#define _DEBUG_OUTPUT_DIRECTION (_DEBUG_OUTPUT_DIRECTION_DLOG) + +#include + +#ifndef INI_PATH +#define INI_PATH "/var/log" +#endif + +#ifndef _DEBUG_MODULE +#define _DEBUG_MODULE "IVUG" +#endif + +#define _DEBUG_ERR_TRACE_FILE_NAME INI_PATH"/"_DEBUG_MODULE"_FATAL.txt" +#define _DEBUG_PREFIX "["_DEBUG_MODULE"]" + +static bool bInit = false; + +static char *get_time_string(unsigned long dwmSec) +{ + static char buffer[30]; + + unsigned long msec=0; + unsigned long sec=0; + unsigned long min=0; + unsigned long hour=0; + +// Don't forget turn on compiler optimization options. + sec = ( dwmSec / 1000 ); + msec = ( dwmSec % 1000 ); + + min = (sec / 60 ); + sec = (sec % 60 ); + + hour = (min / 60 ); + min = (min % 60 ); + + snprintf(buffer, (size_t)sizeof(buffer), "%1d:%02d:%02d.%03d", (int)hour,(int)min,(int)sec,(int)msec); + + return buffer; +} + + +/*Retrieves the number of milliseconds that have elapsed since the system was started*/ +static unsigned long get_sys_elapsed_time(void) +{ + static struct timeval init_time = { 0 , 0 }; + static bool bFirst = false; + struct timeval current_time; + + if ( bFirst == false ) + { + bFirst = true; + gettimeofday(&init_time, NULL); + } + + gettimeofday(¤t_time, NULL); + + // return (current_time.tv_sec - init_time.tv_sec) * 1000UL + (UINT32)((current_time.tv_usec - init_time.tv_usec) / 1000.0) ; + return ((current_time.tv_sec * 1E3 + current_time.tv_usec / 1E3) - (init_time.tv_sec * 1E3 + init_time.tv_usec / 1E3)); +} + +void _custom_debug_init() +{ + get_sys_elapsed_time(); +} + +void _custom_debug_deinit() +{ + +} + +void +_custom_err_trace_write( const char *func_name, int line_num, const char *fmt, ... ) +{ + FILE *f = NULL; + va_list ap = {0}; + char buf[128]; + + time_t current_time; + struct tm new_time; + + current_time = time( NULL ); + localtime_r( ¤t_time, &new_time ); + + f = fopen( _DEBUG_ERR_TRACE_FILE_NAME, "a" ); + if( f == NULL ) + { + printf( "Failed to open file.[%s]\n", _DEBUG_ERR_TRACE_FILE_NAME ); + return; + } + + fprintf( f, "[%.19s][%05d][%s]", asctime_r( &new_time, buf ), line_num, func_name ); + + va_start( ap, fmt ); + vfprintf( f, fmt, ap ); + va_end( ap ); + + fprintf( f, "\n" ); + + fclose( f ); +} + +void +_custom_err_trace_fvprintf( const char *func_name, int line_num, const char *fmt, va_list ap ) +{ + FILE *f = NULL; + + time_t current_time; + struct tm new_time; + char buf[128]; + + current_time = time( NULL ); + localtime_r( ¤t_time, &new_time ); + + f = fopen( _DEBUG_ERR_TRACE_FILE_NAME, "a" ); + if( f == NULL ) + { + printf( "Failed to open file.[%s]\n", _DEBUG_ERR_TRACE_FILE_NAME ); + return; + } + + fprintf( f, "[%.19s][[F:%-16.16s L:%5d] ", asctime_r( &new_time, buf ), func_name, line_num ); + vfprintf( f, fmt, ap ); + fprintf( f, "\n" ); + + fclose( f ); +} + +/* +typedef enum log_priority { + DLOG_UNKNOWN = 0, + DLOG_DEFAULT, + DLOG_VERBOSE, + DLOG_DEBUG, + DLOG_INFO, + DLOG_WARN, + DLOG_ERROR, + DLOG_FATAL, + DLOG_SILENT, +} log_priority; + +#define LOG(priority, tag, ...) \ +#define LOG_VA(priority, tag, fmt, args) \ +*/ + +inline log_priority convert_to_dlog_priority(int msg_level) +{ +/* +DBG_MSG_LOW = 0, +DBG_MSG_MED = 1, +DBG_MSG_HIGH = 2, + +DBG_MSG_WARN = 3, +DBG_MSG_ERROR = 4, +DBG_MSG_FATAL = 5, + +DBG_MSG_CUST5 = 6, +DBG_MSG_CUST6 = 7, +DBG_MSG_CUST7 = 8, +DBG_MSG_CUST8 = 9, +DBG_MSG_CUST9 = 10, +DBG_MSG_CUST10 = 11, +DBG_MSG_CUST11 = 12, +DBG_MSG_CUST12 = 13, +DBG_MSG_CUST13 = 14, +*/ + + static log_priority priority[] = { + DLOG_VERBOSE, + DLOG_VERBOSE, + DLOG_WARN, // MSG HIGH + DLOG_WARN, + DLOG_ERROR, + DLOG_FATAL, // 5 + }; + + if ( msg_level <= DBG_MSG_FATAL) + return priority[msg_level]; + + return DLOG_DEBUG; + +} + + + +void __custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...) +{ + va_list va; + + static const char *level ; + + if ( G_UNLIKELY(bInit == false) ) + { + _custom_debug_init(); + bInit = true; + } + +#define DIRECORY_SPLITTER '/' + const char*pFileName = NULL; + + debug_msg->time = get_sys_elapsed_time(); + + pFileName = strrchr(debug_msg->fname, DIRECORY_SPLITTER); + pFileName = (NULL == pFileName)?debug_msg->fname:(pFileName+1); + + level = debug_msg->szlevel; + + // File + char *time_string = get_time_string(debug_msg->time); + + va_start(va, msg); + + if ( _DEBUG_OUTPUT_DIRECTION & _DEBUG_OUTPUT_DIRECTION_CONSOLE ) + { + + printf(_DEBUG_PREFIX"%s[F:%-16.16s L:%5d][%s:%s] ", time_string , pFileName, debug_msg->nline , debug_msg->szcategory, level ); + vprintf(msg, va); + printf("\n"); + } + + if ( _DEBUG_OUTPUT_DIRECTION & _DEBUG_OUTPUT_DIRECTION_DLOG ) + { + static char buf[2048]; + + int i ; +#ifdef PRINT_TID + i = snprintf(buf, 2048, "%s[F:%-16.16s L:%5d][%08x][%s] ",time_string , pFileName, debug_msg->nline , pthread_self(), level); +#else + i = snprintf(buf, 2048, "%s[F:%-16.16s L:%5d][%s] ",time_string , pFileName, debug_msg->nline , level); +#endif + vsnprintf( buf + i, 2048 - i, msg, va); + +// Prevent Format string attack + print_log(convert_to_dlog_priority(debug_msg->msg_level), debug_msg->szcategory, "%s", buf); +// print_log(prio, _DEBUG_MODULE, "%s[F:%-16.16s L:%5d][%s:%s] ",time_string , pFileName, debug_msg->nline , szCategory[debug_msg->category], level ); +// vprint_log(prio,_DEBUG_MODULE, msg, va); + } + +#if 0 + if ( _DEBUG_OUTPUT_DIRECTION & _DEBUG_OUTPUT_DIRECTION_FILE ) + { + fprintf(_DEBUG_PREFIX"%s[F:%-16.16s L:%5d][%s:%s] ",time_string , pFileName, debug_msg->nline , szCategory[debug_msg->category], level ); + vprintf(msg, va); + fprintf("\n"); + } +#endif + va_end(va); + + if ( G_UNLIKELY(debug_msg->msg_level == DBG_MSG_FATAL) ) + { + fflush (stdout); + va_start(va, msg); + _custom_err_trace_fvprintf(pFileName, debug_msg->nline, msg, va); // Save to file. + va_end(va); + assert(0); + } + +} + + +#ifdef FMRADIO_FEATURE_ENABLE_GSTREAMER_LOGGING + +enum { + DEBUG_COLOR_DEFAULT = 0, + DEBUG_COLOR_BLACK = 30, + DEBUG_COLOR_RED = 31, + DEBUG_COLOR_GREEN = 32, + DEBUG_COLOR_YELLOW = 33, + DEBUG_COLOR_BLUE = 34, + DEBUG_COLOR_MAGENTA = 35, + DEBUG_COLOR_CYAN = 36, + DEBUG_COLOR_WHITE = 37, +}; + +static gchar *custom_print_object(GObject *object) +{ + if (object == NULL) + { + return g_strdup("Unknown"); + } +/* + if (*(GType *) ptr == GST_TYPE_CAPS) + { + return gst_caps_to_string((GstCaps *) ptr); + } + + if (*(GType *) ptr == GST_TYPE_STRUCTURE) + { + return gst_structure_to_string((GstStructure *) ptr); + } +*/ + if (GST_IS_PAD(object)) + { + return g_strdup_printf("%s:%s", GST_STR_NULL( GST_OBJECT_NAME( GST_PAD_PARENT(object))) , GST_STR_NULL( GST_PAD_NAME(object) )); + } + + if (GST_IS_ELEMENT(object)) + { + return g_strdup_printf("%s", GST_STR_NULL(GST_ELEMENT_NAME(object))); + } + + if (G_IS_OBJECT(object)) + { + return g_strdup_printf("%s(0x%0x)", G_OBJECT_TYPE_NAME(object), object); + } + + return g_strdup_printf("0x%08x", object); +} + +void custom_log_func(GstDebugCategory *category, GstDebugLevel level, + const gchar *file, const gchar *function, gint line, + GObject *object, GstDebugMessage *message, gpointer unused) +{ + static const char *szLevel[] = {"LOW", "MED", "HIGH", "WARN", "ERROR", "FATAL"}; + + static const gint levelcolor[] = { + DEBUG_COLOR_DEFAULT, /* GST_LEVEL_NONE */ + DEBUG_COLOR_RED, /* GST_LEVEL_ERROR */ + DEBUG_COLOR_YELLOW, /* GST_LEVEL_WARNING */ + DEBUG_COLOR_GREEN, /* GST_LEVEL_INFO */ + DEBUG_COLOR_CYAN, /* GST_LEVEL_DEBUG */ + DEBUG_COLOR_WHITE, /* GST_LEVEL_LOG */ + }; + + if (level > gst_debug_category_get_threshold(category)) + return; + + gchar *obj = custom_print_object(object); + +#define DIRECORY_SPLITTER '/' + + const char*pFileName = NULL; + + pFileName = strrchr(file, DIRECORY_SPLITTER); + pFileName = (NULL == pFileName) ? file:(pFileName+1); + +// File + char *time_string = get_time_string(get_sys_elapsed_time()); + + log_print_rel(LOG_CAMCORDER,LOG_CLASS_ERR, + _DEBUG_PREFIX "%s[F:%-16.16s L:%5d][%s][%s][%s] %s\n", time_string, pFileName, line, + gst_debug_category_get_name(category), gst_debug_level_get_name(level),obj, + gst_debug_message_get(message)); + + g_free(obj); +} + + +#endif // FMRADIO_FEATURE_ENABLE_GSTREAMER_LOGGING + + + diff --git a/common/src/ivug-callback.c b/common/src/ivug-callback.c new file mode 100755 index 0000000..4df3abd --- /dev/null +++ b/common/src/ivug-callback.c @@ -0,0 +1,50 @@ +/* + * Copyright 2012 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 "ivug-debug.h" +#include "ivug-callback.h" + +#include +//callback_func_t g_callback; + +callback_handle_t * ivug_callback_register() +{ + callback_handle_t *callback_handle = calloc(1, sizeof(callback_handle_t)); + return callback_handle; +} + +void ivug_callback_set_callback(callback_handle_t *handle, callback_func_t callback, void *data) +{ + IV_ASSERT(handle != NULL); + handle->CBFunc = callback; + handle->data = data; +} + +void ivug_callback_call(callback_handle_t *handle, void *data1, void *data2, void *data3) +{ + IV_ASSERT(handle != NULL); + if(handle->CBFunc) + { + (handle->CBFunc)(data1, data2, data3, handle->data); + } +} + +void ivug_callback_unregister(callback_handle_t *handle) +{ + IV_ASSERT(handle != NULL); + free(handle); +} + diff --git a/common/src/ivug-config.c b/common/src/ivug-config.c new file mode 100755 index 0000000..845c9e0 --- /dev/null +++ b/common/src/ivug-config.c @@ -0,0 +1,250 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-define.h" +#include "ivug-datatypes.h" +#include "ivug-uuid.h" + +#include +#include +#include + +#include "statistics.h" +#include "ivug-debug.h" + +#include "ivug-config.h" + +#include +#include + +#define VCONFKEY_GALLERY_INTERVAL_TIME "db/gallery/setting/interval_time" //double +#define VCONFKEY_GALLERY_REPEAT_STATE "db/gallery/setting/repeat_state" //boolean +#define VCONFKEY_GALLERY_SHUFFLE_STATE "db/gallery/setting/shuffle_state" //boolean +#define VCONFKEY_GALLERY_TRANSITION_EFFECT "db/gallery/setting/ss_effect" //char + +enum { STATE_FALSE = 0, STATE_TRUE = 1, }; + +/* + Set lock screen with given image. + + CAUTION : does not check filepath integrity +*/ +bool ivug_config_set_lockscreen_image(const char* filepath) +{ + if(filepath == NULL) + { + MSG_IMAGEVIEW_ERROR("Lock screen path is NULL"); + return FALSE; + } + + if(system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_LOCK_SCREEN, filepath) != SYSTEM_SETTINGS_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("Lockscreen set Error : %s", filepath); + return FALSE; + } + + /*if(vconf_set_str( VCONFKEY_IDLE_LOCK_BGSET, filepath ) < 0) + { + MSG_IMAGEVIEW_ERROR("Lockscreen set Error : %s", filepath); + return FALSE; + }*/ + + MSG_IMAGEVIEW_HIGH("Set Lockscreen filepath = %s", filepath); + + return TRUE; +} + +/* + Set home screen with given image + + CAUTION : does not check filepath integrity +*/ +bool ivug_config_set_homescreen_image( const char* filepath ) +{ + if(filepath == NULL) + { + MSG_IMAGEVIEW_ERROR("Home screen path is NULL"); + return FALSE; + } + + if(system_settings_set_value_string(SYSTEM_SETTINGS_KEY_WALLPAPER_HOME_SCREEN, filepath) != SYSTEM_SETTINGS_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("Homescreen set Error : %s", filepath); + return FALSE; + } + + /*if(vconf_set_str(VCONFKEY_BGSET, filepath) < 0) + { + MSG_IMAGEVIEW_ERROR("Homescreen set Error"); + return FALSE; + }*/ + + MSG_IMAGEVIEW_HIGH("Set Homescreen filepath = %s", filepath); + return TRUE; +} + + +static bool +_ivug_config_get_slideshow_repeat_state(void) +{ + int repeat_state = STATE_FALSE; + + if(vconf_get_bool(VCONFKEY_GALLERY_REPEAT_STATE, &repeat_state) < 0) + { + MSG_IMAGEVIEW_ERROR("vconf_get_bool failed, set as repeat state as default: false"); + return false; + } + + MSG_IMAGEVIEW_HIGH("repeat state is: %d", repeat_state); + + return (repeat_state == STATE_TRUE ? true : false); +} + +static bool +_ivug_config_get_slideshow_shuffle_state(void) +{ + int shuffle_state = STATE_FALSE; + + if(vconf_get_bool(VCONFKEY_GALLERY_SHUFFLE_STATE, &shuffle_state) < 0) + { + MSG_IMAGEVIEW_ERROR("vconf_get_bool failed, set as shuffle state as default: false"); + return false; + } + + MSG_IMAGEVIEW_HIGH("shuffle state is: %d", shuffle_state); + + return (shuffle_state == STATE_TRUE ? true : false); +} + +static double +_ivug_config_get_slideshow_interval_time(void) +{ + double interval_time = 0.0; + + if(vconf_get_dbl(VCONFKEY_GALLERY_INTERVAL_TIME, &interval_time) < 0) + { + MSG_IMAGEVIEW_ERROR("vconf_get_dbl failed, set as interval time as -1"); + + interval_time = -1.0; + } + + MSG_IMAGEVIEW_HIGH("interval time is: %f", interval_time); + return interval_time; +} + +static char * +_ivug_config_get_slideshow_effect_type(void) +{ + char *effect_str = NULL; + effect_str = vconf_get_str(VCONFKEY_GALLERY_TRANSITION_EFFECT); + + if(!effect_str) + { + MSG_IMAGEVIEW_ERROR("vconf_get_str failed, set as effect type as default"); + + effect_str = NULL; + } + + MSG_IMAGEVIEW_HIGH("effect is: %s", effect_str); + + return effect_str; +} + +static ivug_effect_type +_ivug_config_get_effect_type_by_string(char *effect_str) +{ + IV_ASSERT(effect_str != NULL); + + ivug_effect_type type = IVUG_EFFECT_TYPE_SLIDE; + + if(!strncmp(effect_str, "Slide", strlen(effect_str))) + { + type = IVUG_EFFECT_TYPE_SLIDE; + } + else if(!strncmp(effect_str, "Iris", strlen(effect_str))) + { + type = IVUG_EFFECT_TYPE_IRIS; + } + else if(!strncmp(effect_str, "Dissolve", strlen(effect_str))) + { + type = IVUG_EFFECT_TYPE_DISSOLVE; + } + else if(!strncmp(effect_str, "DissolveFade", strlen(effect_str))) + { + type = IVUG_EFFECT_TYPE_DISSOLVE_FADE; + } + else if(!strncmp(effect_str, "Split", strlen(effect_str))) + { + type = IVUG_EFFECT_TYPE_SPLIT; + } + else //Set all other cases as default NONE + { + MSG_SLIDER_WARN("Invalid type : %s", effect_str); + type = IVUG_EFFECT_TYPE_UNKNOWN; + } + + MSG_IMAGEVIEW_HIGH("effect_str = %s, type = %d", effect_str, type); + + return type; +} + +void +ivug_config_get_slideshow_setting(slide_show_mode *mode, + double *interval_time, + ivug_effect_type *effect_type) +{ + *mode = SLIDE_SHOW_MODE_NORMAL; + + bool state; + + state = _ivug_config_get_slideshow_repeat_state(); + if(state == true) + { + *mode |= SLIDE_SHOW_MODE_REPEAT; + } + + state = _ivug_config_get_slideshow_shuffle_state(); + if(state == true) + { + *mode |= SLIDE_SHOW_MODE_SHUFFLE; + } + + *interval_time = _ivug_config_get_slideshow_interval_time(); + + /* EFFECT_NONE, EFFECT_DISSOLVE_FADE, EFFECT_DISSOLVE_FADE, EFFECT_IRIS */ + char *effect = _ivug_config_get_slideshow_effect_type(); + *effect_type = _ivug_config_get_effect_type_by_string(effect); + if (effect) { + free(effect); + effect = NULL; + } +} + +bool ivug_config_get_can_rotate(void) +{ + int state = STATE_FALSE; + if(vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &state) < 0) + { + MSG_IMAGEVIEW_ERROR("vconf_get_bool failed, set as default: false"); + return false; + } + + MSG_IMAGEVIEW_HIGH("rotate state is: %d", state); + return (state == STATE_TRUE ? true : false); +} + + diff --git a/common/src/ivug-db.c b/common/src/ivug-db.c new file mode 100755 index 0000000..68b4ffe --- /dev/null +++ b/common/src/ivug-db.c @@ -0,0 +1,783 @@ +/* + * Copyright 2012 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 "ivug-define.h" +#include "ivug-debug.h" +#include "ivug-util.h" +#include "ivug-db.h" + +#include +#include + +#define LOG_LVL DBG_MSG_LVL_HIGH +#define LOG_CAT "IV-DB" + +#define DB_KEY (0x12341234) + +typedef struct _Ivug_DB +{ + ivug_db_cb callback; + media_handle *m_handle; + tag_handle *t_handle; + void *data; +}Ivug_DB; + +static char *_strerror_db(int error) +{ + switch(error) + { + case MEDIA_CONTENT_ERROR_INVALID_PARAMETER: + return "Invalid parameter"; + case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY : + return "Out of memory"; + case MEDIA_CONTENT_ERROR_DB_FAILED : + return "DB operation failed"; + default: + { + static char buf[40]; + sprintf(buf, "Error Code=%d", error); + return buf; + } + + } +} + +static void _ivug_thumb_cb(media_content_error_e error, + const char *path, void *data) +{ + Ivug_DB_h *db_h = (Ivug_DB_h *)data; + + MSG_HIGH("_ivug_thumb_cb, path =%s", path); + + if(db_h->callback == NULL || db_h->key != DB_KEY) + { + MSG_WARN("handle was freed"); + return; + } + + if(path == NULL) + { + MSG_ERROR("thumbnail path is NULL"); + db_h->callback(db_h->m_handle, NULL, db_h->data); + return; + } + + db_h->callback(db_h->m_handle, path, db_h->data); +} + +bool ivug_db_create(void) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_content_connect(); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_content_connect is failed, err:%s", _strerror_db(ret)); + return false; + } + + MSG_HIGH("ivug_db_create success"); + return true; +} + +bool ivug_db_destroy(void) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_content_disconnect(); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_content_disconnect is failed, err:%s", _strerror_db(ret)); + return false; + } + + MSG_HIGH("ivug_db_destroy success"); + return true; +} + +bool ivug_db_rename(media_handle m_handle, const char *dest) +{ + media_info_h minfo = (media_info_h)m_handle; + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_info_move_to_db(minfo, dest); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_move_to_db is failed, err = %s dest=%s", _strerror_db(ret), dest); + return false; + } + + return true; +} + +bool ivug_db_destroy_file_handle(media_handle m_handle) +{ + media_info_h minfo = (media_info_h)m_handle; + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_info_destroy(minfo); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_destroy is failed, err = %s", _strerror_db(ret)); + return false; + } + + return true; +} + +bool ivug_db_destroy_folder_handle(media_handle m_handle) +{ + media_folder_h minfo = (media_folder_h)m_handle; + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_folder_destroy(minfo); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_folder_destroy is failed, err = %s", _strerror_db(ret)); + return false; + } + + return true; +} + +bool ivug_db_create_filter(filter_handle *filter) +{ + filter_h *media_filter = (filter_h *)filter; + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_filter_create(media_filter); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_filter_create is failed, err = %s", _strerror_db(ret)); + return false; + } + MSG_MED("ivug_db_create_filter success"); + return true; +} + +bool ivug_db_destroy_filter(filter_handle filter) +{ + filter_h media_filter = (filter_h)filter; + + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_filter_destroy(media_filter); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_filter_destroy is failed, err = %s", _strerror_db(ret)); + return false; + } + MSG_MED("ivug_db_destroy_filter success"); + return true; +} + +bool ivug_db_set_filter_condition(filter_handle media_filter, const char *condition) +{ + IV_ASSERT(condition != NULL); + + MSG_HIGH("Set DB Filter : %s", condition); + int ret = media_filter_set_condition(media_filter, condition, MEDIA_CONTENT_COLLATE_DEFAULT); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_filter_set_condition is failed, err = %s", _strerror_db(ret)); + return false; + } + return true; +} + +bool ivug_db_set_filter(filter_handle filter, ivug_view_by view_by, ivug_media_type media_type, char *condition) +{ + filter_h media_filter = (filter_h)filter; + + int ret = MEDIA_CONTENT_ERROR_NONE; + + if(condition == NULL) + { + condition = calloc(1, sizeof(char)*IVUG_MAX_CONDITION_LEN); + } + else + { + strcat(condition," AND "); + } + + /*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music*/ + switch(media_type) + { + case IVUG_MEDIA_TYPE_IMAGE: + strcat(condition, "(MEDIA_TYPE=0)"); + break; + case IVUG_MEDIA_TYPE_VIDEO: + strcat(condition,"(MEDIA_TYPE=1)"); + break; + case IVUG_MEDIA_TYPE_ALL: + strcat(condition, "(MEDIA_TYPE=0 OR MEDIA_TYPE=1)"); + break; + default: + MSG_FATAL("Invalid media type : %d", media_type); + break; + } + + if(view_by == IVUG_VIEW_BY_FAVORITES) + { + strcat(condition, " AND MEDIA_FAVORITE=1"); + } + + if(condition) + { + if(ivug_db_set_filter_condition(media_filter, condition) == false) + { + goto SET_FILTER_ERROR; + } + } + + if(view_by == IVUG_VIEW_BY_TAG) + { + ret = media_filter_set_order(media_filter, MEDIA_CONTENT_ORDER_ASC, MEDIA_DISPLAY_NAME, MEDIA_CONTENT_COLLATE_NOCASE); + } + else + { + ret = media_filter_set_order(media_filter, MEDIA_CONTENT_ORDER_DESC, MEDIA_MODIFIED_TIME, MEDIA_CONTENT_COLLATE_NOCASE); + } + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_filter_set_order is failed, err = %s", _strerror_db(ret)); + goto SET_FILTER_ERROR; + } + + if(condition) + free(condition); + + MSG_MED("ivug_db_set_filter success, view_by:%d, media_type:%d", view_by, media_type); + return true; + +SET_FILTER_ERROR: + if(condition) + free(condition); + return false; +} + +bool ivug_db_set_filter_offset(filter_handle filter, int stp, int endp) +{ + filter_h media_filter = (filter_h)filter; + + int ret = MEDIA_CONTENT_ERROR_NONE; + + ret = media_filter_set_offset(media_filter, stp, endp-stp+1); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_filter_set_offset is failed, err = %s", _strerror_db(ret)); + return false; + } + + return true; +} + +media_handle ivug_db_insert_file_to_DB(const char* filepath) +{ + IV_ASSERT(filepath != NULL); + + int ret = MEDIA_CONTENT_ERROR_NONE; + + if (ivug_is_web_uri(filepath) == true) + return NULL; + + media_handle m_handle = NULL; + + ret = media_info_insert_to_db(filepath, (media_info_h *)&m_handle); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_insert_to_db is failed, err = %s", _strerror_db(ret)); + return NULL; + } + + return m_handle; +} + +bool _media_item_cb(media_info_h item, void *user_data) +{ + media_handle *m_handle = (media_handle *)user_data; + + media_info_clone((media_info_h *)m_handle, item); + + return false; //only 1 item +} + +media_handle ivug_db_get_file_handle(const char* filepath) +{ + IV_ASSERT(filepath != NULL); + + int ret = MEDIA_CONTENT_ERROR_NONE; + filter_handle media_filter = NULL; + + if (ivug_is_web_uri(filepath) == true) + return NULL; + + char buf[1024] = {0,}; + snprintf(buf, sizeof(buf), "MEDIA_PATH=\"%s\"", filepath); + + media_handle m_handle = NULL; + + ivug_db_create_filter(&media_filter); + ivug_db_set_filter_condition(media_filter, buf); + ret = media_info_foreach_media_from_db(media_filter, _media_item_cb, &m_handle); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_ITEM_ERROR; + } + ivug_db_destroy_filter(media_filter); + + return m_handle; + +GET_ITEM_ERROR: + if(media_filter) + ivug_db_destroy_filter(media_filter); + + return NULL; +} + +media_handle ivug_db_get_file_handle_from_media_id(const char* media_id) +{ + IV_ASSERT(media_id != NULL); + + media_handle m_handle = NULL; + + int ret = media_info_get_media_from_db(media_id, (media_info_h*)&m_handle); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_get_media_from_db is failed, err = %s", _strerror_db(ret)); + return NULL; + } + + return m_handle; +} + +static bool _media_folder_item_cb(media_folder_h item, void *user_data) +{ + media_handle *t_handle = (media_handle *)user_data; + + media_folder_clone((media_folder_h *)t_handle, item); + + return false; //only 1 item +} + +media_handle ivug_db_get_folder_handle(const char* folderpath) +{ + IV_ASSERT(folderpath != NULL); + + int ret = MEDIA_CONTENT_ERROR_NONE; + filter_handle media_filter = NULL; + + char buf[1024] = {0,}; + snprintf(buf, sizeof(buf), "FOLDER_PATH=\"%s\"", folderpath); + + media_handle m_handle = NULL; + + ivug_db_create_filter(&media_filter); + ivug_db_set_filter_condition(media_filter, buf); + ret = media_folder_foreach_folder_from_db(media_filter, _media_folder_item_cb, &m_handle); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_folder_foreach_folder_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_ITEM_ERROR; + } + ivug_db_destroy_filter(media_filter); + + return m_handle; + +GET_ITEM_ERROR: + if(media_filter) + ivug_db_destroy_filter(media_filter); + + return NULL; +} + +static bool _media_folder_list_cb(media_folder_h item, void *user_data) +{ + Ivug_DB *iv_db = (Ivug_DB *)user_data; + + if(iv_db->callback) + { + iv_db->callback((media_handle)item, iv_db->data); + } + + return true; +} + +bool ivug_db_get_all_folder_list(ivug_db_cb callback, void *data) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + filter_handle media_filter = NULL; + + Ivug_DB *iv_db = calloc(1, sizeof(Ivug_DB)); + iv_db->callback = callback; + iv_db->data = data; + + ivug_db_create_filter(&media_filter); + ret = media_folder_foreach_folder_from_db(media_filter, _media_folder_list_cb, iv_db); + + free(iv_db); + + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_folder_foreach_folder_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_ITEM_ERROR; + } + ivug_db_destroy_filter(media_filter); + + return true; + +GET_ITEM_ERROR: + if(media_filter) + ivug_db_destroy_filter(media_filter); + + return false; +} + +char *ivug_db_get_file_path(media_handle media) +{ + media_info_h file_item = (media_info_h)media; + char *name = NULL; + + media_info_get_file_path(file_item, &name); + + return name; +} + +char *ivug_db_get_file_id(media_handle media) +{ + media_info_h file_item = (media_info_h)media; + char *id = NULL; + + media_info_get_media_id(file_item, &id); + + return id; +} + +char *ivug_db_get_thumbnail_path(media_handle media) +{ + media_info_h file_item = (media_info_h)media; + char *name = NULL; + + media_info_get_thumbnail_path(file_item, &name); + + return name; +} + +char *ivug_db_get_folder_name(media_handle media) +{ + media_folder_h folder_item = (media_folder_h)media; + char *name = NULL; + + media_folder_get_name(folder_item, &name); + + return name; +} + +char *ivug_db_get_folder_id(media_handle media) +{ + media_folder_h folder_item = (media_folder_h)media; + char *id = NULL; + + media_folder_get_folder_id(folder_item, &id); + + return id; +} + +char *ivug_db_get_folder_path(media_handle media) +{ + media_folder_h folder_item = (media_folder_h)media; + char *path = NULL; + + media_folder_get_path(folder_item, &path); + + return path; +} + +static bool _media_tag_list_cb(media_tag_h item, void *user_data) +{ + Ivug_DB *iv_db = (Ivug_DB *)user_data; + + if(iv_db->callback) + { + iv_db->callback((media_handle)item, iv_db->data); + } + + return true; +} + +bool ivug_db_get_all_tag_list(ivug_db_cb callback, void *data) +{ + int ret = MEDIA_CONTENT_ERROR_NONE; + filter_handle media_filter = NULL; + + Ivug_DB *iv_db = calloc(1, sizeof(Ivug_DB)); + iv_db->callback = callback; + iv_db->data = data; + + ivug_db_create_filter(&media_filter); + ret = media_tag_foreach_tag_from_db(media_filter, _media_tag_list_cb, iv_db); + + free(iv_db); + + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_tag_foreach_tag_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_ITEM_ERROR; + } + ivug_db_destroy_filter(media_filter); + + return true; + +GET_ITEM_ERROR: + if(media_filter) + ivug_db_destroy_filter(media_filter); + + return false; +} + +char *ivug_db_get_tag_name(tag_handle media) +{ + media_tag_h tag_item = (media_tag_h)media; + char *name = NULL; + + media_tag_get_name(tag_item, &name); + + return name; +} + +int ivug_db_get_tag_id(tag_handle media) +{ + media_tag_h tag_item = (media_tag_h)media; + int id = 0; + + media_tag_get_tag_id(tag_item, &id); + + return id; +} + +bool ivug_db_create_tag(tag_handle *tag_h, const char *tag_name) +{ + media_tag_h *tag = (media_tag_h *)tag_h; + + int ret = media_tag_insert_to_db(tag_name, tag); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_tag_insert_to_db, err = %s", _strerror_db(ret)); + return false; + } + + ret = media_tag_update_to_db(*tag); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_tag_update_to_db, err = %s", _strerror_db(ret)); + return false; + } + + return true; +} + +bool ivug_db_destroy_tag(tag_handle tag_h) +{ + media_tag_h tag = (media_tag_h )tag_h; + + int ret = media_tag_destroy(tag); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_tag_destroy, err = %s", _strerror_db(ret)); + return false; + } + + return true; +} + +bool ivug_db_set_tag(media_handle m_handle, tag_handle t_handle) +{ + media_tag_h tag = (media_tag_h)t_handle; + + char *media_id = NULL; + + int ret = media_info_get_media_id(m_handle, &media_id); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_get_media_id, err = %s", _strerror_db(ret)); + return false; + } + if(media_id == NULL) + { + MSG_ERROR("media_info_get_media_id, media_id = NULL"); + return false; + } + + ret = media_tag_add_media(tag, (const char *)media_id); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_tag_add_media, err = %s", _strerror_db(ret)); + return false; + } + + ret = media_tag_update_to_db(tag); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_tag_update_to_db, err = %s", _strerror_db(ret)); + MSG_ERROR("or media tag already inserted"); + } + + return true; +} + +bool ivug_db_update(media_handle media) +{ + media_info_h file_item = (media_info_h)media; + + int ret = media_info_update_to_db (file_item); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_update_to_db, err = %s", _strerror_db(ret)); + return false; + } + return true; +} + +bool ivug_db_refresh(const char *media_id) +{ + int ret = media_info_refresh_metadata_to_db(media_id); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_refresh_metadata_to_db, err = %s", _strerror_db(ret)); + return false; + } + return true; +} + +static bool _media_tag_item_cb(media_tag_h item, void *user_data) +{ + tag_handle *t_handle = (tag_handle *)user_data; + + media_tag_clone((media_tag_h *)t_handle, item); + + return false; //only 1 item +} + +tag_handle ivug_db_get_tag_handle(const char* tagname) +{ + IV_ASSERT(tagname != NULL); + + int ret = MEDIA_CONTENT_ERROR_NONE; + filter_handle media_filter = NULL; + + char buf[1024] = {0,}; + snprintf(buf, sizeof(buf), "TAG_NAME=\"%s\"", tagname); + + tag_handle t_handle = NULL; + + ivug_db_create_filter(&media_filter); + ivug_db_set_filter_condition(media_filter, buf); + ret = media_tag_foreach_tag_from_db(media_filter, _media_tag_item_cb, &t_handle); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_tag_foreach_tag_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_ITEM_ERROR; + } + ivug_db_destroy_filter(media_filter); + + return t_handle; + +GET_ITEM_ERROR: + if(media_filter) + ivug_db_destroy_filter(media_filter); + + return NULL; +} + +bool ivug_db_set_favorite(media_handle media, bool set) +{ + media_info_h item = (media_info_h)media; + + int ret = media_info_set_favorite(item, set); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_set_favorite, err = %s", _strerror_db(ret)); + return false; + } + + ret = media_info_update_to_db(item); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_update_to_db, err = %s", _strerror_db(ret)); + return false; + } + + return true; +} + +bool ivug_db_get_file_size(media_handle media, unsigned long long *size) +{ + media_info_h item = (media_info_h)media; + + int ret = media_info_get_size(item, size); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_get_size, err = %s", _strerror_db(ret)); + return false; + } + + return true; +} + +Ivug_DB_h * ivug_db_create_thumbnail(media_handle media, ivug_db_path_cb callback, void *data) +{ + media_info_h item = (media_info_h)media; + + Ivug_DB_h *db_h = (Ivug_DB_h *)calloc(1, sizeof(Ivug_DB_h)); + db_h->m_handle = media; + db_h->callback = callback; + db_h->data = data; + db_h->key = DB_KEY; + + int ret = media_info_create_thumbnail(item, _ivug_thumb_cb, db_h); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_get_size, err = %s", _strerror_db(ret)); + free(db_h); + return NULL; + } + + return db_h; +} + +bool ivug_db_cancel_thumbnail(Ivug_DB_h *db_h) +{ + media_info_h item = (media_info_h)db_h->m_handle; + + int ret = media_info_cancel_thumbnail(item); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_ERROR("media_info_cancel_thumbnail, err = %s", _strerror_db(ret)); + return false; + } + + db_h->m_handle = NULL; + db_h->callback = NULL; + db_h->data = NULL; + db_h->key = 0; + + free(db_h); + + return true; +} + + diff --git a/common/src/ivug-dir.cpp b/common/src/ivug-dir.cpp new file mode 100755 index 0000000..c949973 --- /dev/null +++ b/common/src/ivug-dir.cpp @@ -0,0 +1,100 @@ +/* + * Copyright 2012 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 "ivug-dir.h" + +#include +#include +#include + +#include + +bool EnumFilesInDir(const char *dir, EnumFilesCB pFunc, void *data) +{ + struct dirent *dptr; + + DIR *dirp; + + if((dirp=opendir(dir))==NULL) + { + printf("Cannot open dir : %s", dir); + return false; + } + + static char fullpath[PATH_MAX]; + + while( (dptr = readdir(dirp)) != NULL ) + { + if ( dptr->d_type == DT_REG ) // Only for gegular file + { + if ( pFunc ) + { + sprintf(fullpath, "%s/%s", dir, dptr->d_name); + + pFunc(fullpath, data); + } + } + } + + closedir(dirp); + + return true; +} + + +int GetFilesCountInDir(const char *dir) +{ + + struct dirent *dptr; + DIR *dirp; + + if( (dirp=opendir(dir)) == NULL) + { + printf("Cannot open dir : %s", dir); + return -1; + } + + int nCount = 0; + + while( (dptr = readdir(dirp)) != NULL ) + { + if ( dptr->d_type == DT_REG ) // Only for gegular file + { + nCount++; + } + } + + closedir(dirp); + + return nCount; +} + + +#if 0 +void _MyCB(const char *fname, void *data) +{ + printf("%s\n", fname); +} + + +int main(int argc, char *argv[]) +{ + EnumFilesInDir("/home/rookie/slp2.0", _MyCB, NULL); +} +#endif + + + diff --git a/common/src/ivug-drm-common.c b/common/src/ivug-drm-common.c new file mode 100755 index 0000000..ee7b658 --- /dev/null +++ b/common/src/ivug-drm-common.c @@ -0,0 +1,387 @@ +/* + * Copyright 2012 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 // for g_strlcpy + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "ivug-define.h" +#include "ivug-debug.h" +#include "ivug-file-info.h" +#include "ivug-util.h" + +#include "ivug-drm-common.h" + + +#include //ecore_file_dir_is_empty + +#define IVUG_DRM_TEMP_DIR DATADIR"/ug-image-viewer-efl/.tmp" + +#define MOUNTH_COUNT 12 //used for drm file info, +#define DAY_COUNT 30 +#define HOUR_COUNT 24 + + +char* +ivug_drm_get_drm_vendor_info(const char *path) +{ + IV_ASSERT(path != NULL); + + drm_result_e ret = DRM_RETURN_INTERNAL_ERROR; + drm_content_info_s content_info; + memset(&content_info, 0x0, sizeof(drm_content_info_s)); + + ret = drm_get_content_info(path, &content_info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_content_info Error. %s, ret = %d", path, ret); + return NULL; + } + + if(strlen(content_info.author) > 0) + { + return strdup(content_info.author); + } + + return NULL; +} + +bool +ivug_drm_get_forwarding_info(const char *path) +{ + IV_ASSERT(path != NULL); + + drm_bool_type_e is_allowed = DRM_UNKNOWN; + drm_action_type_e action = DRM_IS_FORWARDING_ALLOWED; + drm_action_allowed_data_s action_data; + int ret = -1; + + memset(&action_data, 0x00, sizeof(drm_action_allowed_data_s)); + + g_strlcpy(action_data.file_path, path, sizeof(action_data.file_path)); + + ret = drm_is_action_allowed(action, &action_data, &is_allowed); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_is_action_allowed failed: %d", ret); + return false; + } + + if(is_allowed == DRM_TRUE) + { + MSG_IVUG_ERROR("Possible to forwarding. file=%s", path); + return true; + } + else + { + MSG_IVUG_ERROR("Impossible to forwarding. file=%s", path); + return false; + } +} + +char * +ivug_drm_get_right_url(const char *path) +{ + drm_content_info_s content_info; + memset(&content_info,0x0,sizeof(drm_content_info_s)); + int ret = -1; + + ret = drm_get_content_info(path, &content_info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_content_info Error. %s, ret = %d", path, ret); + return NULL; + } + + if('\0' == content_info.rights_url[0]) + { + MSG_IVUG_ERROR("rights_url is NULL. %s", path); + return NULL; + } + MSG_IVUG_HIGH("rights_url = %s", content_info.rights_url); + + return strdup(content_info.rights_url); +} + +char * +ivug_drm_get_mime(const char *path) +{ + drm_content_info_s content_info; + memset(&content_info,0x0,sizeof(drm_content_info_s)); + int ret = -1; + + ret = drm_get_content_info(path, &content_info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_content_info Error. %s, ret = %d", path, ret); + return NULL; + } + + if('\0' == content_info.mime_type[0]) + { + MSG_IVUG_ERROR("mime_type is NULL. %s", path); + return NULL; + } + MSG_IVUG_HIGH("mime_type = %s", content_info.mime_type); + + return strdup(content_info.mime_type); +} + + +bool +ivug_drm_has_valid_ro(const char *path) +{ + IV_ASSERT(path != NULL); + + drm_result_e ret; + + drm_license_status_e status = DRM_LICENSE_STATUS_UNDEFINED; + + ret = drm_get_license_status(path, DRM_PERMISSION_TYPE_DISPLAY, &status); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_license_status Error. %s, ret = %d", path, ret); + return false; + } + + if(status != DRM_LICENSE_STATUS_VALID) + { + MSG_IVUG_ERROR("No valid right. %s, status = %d", path, status); + return false; + } + + return true; +} + +bool +ivug_drm_is_drm_file(const char* file_path) +{ + IV_ASSERT(file_path != NULL); + + drm_bool_type_e isDRM = DRM_FALSE; + + if(drm_is_drm_file(file_path, &isDRM) == DRM_RETURN_SUCCESS) + { + if(isDRM == DRM_TRUE) + { + MSG_IVUG_MED("DRM file. path=%s", file_path); + return true; + } + return false; + } + + return false; +} + +bool ivug_drm_is_possible_to_setas(const char* path, _ivug_drm_setas_type type) +{ + ivug_retvm_if(!path, false, "path is NULL"); + + drm_bool_type_e is_allowed = DRM_UNKNOWN; + drm_action_type_e action = DRM_HAS_VALID_SETAS_STATUS; + drm_action_allowed_data_s action_data; + int ret = -1; + + memset(&action_data, 0x00, sizeof(drm_action_allowed_data_s)); + + ret = drm_is_action_allowed(action, &action_data, &is_allowed); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_is_action_allowed failed: %d", ret); + return false; + } + + if(is_allowed == DRM_TRUE) + { + MSG_IVUG_ERROR("Possible to setas. file=%s", path); + return true; + } + else + { + MSG_IVUG_ERROR("Impossible to setas. file=%s", path); + return false; + } +} + + +drm_data_t * ivug_drm_check_constraint(const char* file_path) +{ + + drm_file_info_s info; + drm_constraint_info_s constraint_info; + drm_permission_type_e perm_type = DRM_PERMISSION_TYPE_DISPLAY; + drm_data_t *result = NULL; + int ret = -1; + + memset(&info, 0x0, sizeof(drm_file_info_s)); + + ret = drm_get_file_info(file_path, &info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_file_info Failed!!, ret=0x%x", ret); + return NULL; + } + + if (info.oma_info.method == DRM_METHOD_TYPE_FORWARD_LOCK) + { + MSG_IVUG_HIGH("DRM_METHOD_TYPE_FORWARD_LOCK"); + result = calloc(1, sizeof(drm_data_t)); + result->constraints = IVUG_DRM_RESULT_UNLIMITED; + result->data = -1; + return result; + } + + memset(&constraint_info, 0x0, sizeof(drm_constraint_info_s)); + + ret = drm_get_constraint_info(file_path, perm_type, &constraint_info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_constraint_info Failed!!, ret=0x%x", ret); + return NULL; + } + + result = calloc(1, sizeof(drm_data_t)); + + if(constraint_info.const_type.is_unlimited) + { + MSG_IVUG_HIGH("Unlimited:for permission=%d", perm_type); + + result->constraints = IVUG_DRM_RESULT_UNLIMITED; + result->data = -1; + return result; + } + + if(constraint_info.const_type.is_accumulated){ + MSG_IVUG_HIGH("Accumulated Constraint is present"); + MSG_IVUG_HIGH("accumulated_original_seconds=%d", + constraint_info.accumulated_original_seconds); + MSG_IVUG_HIGH("accumulated_remaining_seconds=%d", + constraint_info.accumulated_remaining_seconds); + + result->constraints = IVUG_DRM_RESULT_ACCUMULATED; + result->data = -1; + return result; + } + + if(constraint_info.const_type.is_count){ + MSG_IVUG_HIGH("Count Constraint is present"); + MSG_IVUG_HIGH("original_count=%d", + constraint_info.original_count); + MSG_IVUG_HIGH("remaining_count=%d", + constraint_info.remaining_count); + + result->constraints = IVUG_DRM_RESULT_COUNT; + result->data = constraint_info.remaining_count; + return result; + } + + if(constraint_info.const_type.is_datetime){ + MSG_IVUG_HIGH("DATETIME Constraint is present"); + MSG_IVUG_HIGH("start_time:" + "Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d", + constraint_info.start_time.tm_year, + constraint_info.start_time.tm_mon, + constraint_info.start_time.tm_mday, + constraint_info.start_time.tm_hour, + constraint_info.start_time.tm_min, + constraint_info.start_time.tm_sec); + + MSG_IVUG_HIGH("end_time:" + "Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d", + constraint_info.end_time.tm_year, + constraint_info.end_time.tm_mon, + constraint_info.end_time.tm_mday, + constraint_info.end_time.tm_hour, + constraint_info.end_time.tm_min, + constraint_info.end_time.tm_sec); + + result->constraints = IVUG_DRM_RESULT_DATETIME; + //result->data = constraint.curCount; + result->data = -1; + return result; + } + + if(constraint_info.const_type.is_individual){ + MSG_IVUG_HIGH("INDIVIDUAL Constraint is present"); + MSG_IVUG_HIGH("individual_identity_type=%d " + "individual_id=%s", + constraint_info.individual_identity_type, + constraint_info.individual_id); + + result->constraints = IVUG_DRM_RESULT_INDIVIDUAL; + result->data = -1; + return result; + } + + if(constraint_info.const_type.is_interval){ + MSG_IVUG_HIGH("INTERVAL Constraint is present"); + MSG_IVUG_HIGH("interval_time:" + "Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d", + constraint_info.interval_time.tm_year, + constraint_info.interval_time.tm_mon, + constraint_info.interval_time.tm_mday, + constraint_info.interval_time.tm_hour, + constraint_info.interval_time.tm_min, + constraint_info.interval_time.tm_sec); + + result->constraints = IVUG_DRM_RESULT_INTERVAL_DAYS; + result->data = ((constraint_info.interval_time.tm_year*MOUNTH_COUNT+constraint_info.interval_time.tm_mon)* + DAY_COUNT+constraint_info.interval_time.tm_mday); + return result; + } + + if(constraint_info.const_type.is_system){ + MSG_IVUG_HIGH("SYSTEM Constraint is present"); + MSG_IVUG_HIGH("system_identity_type=%d " + "system_id=%s", + constraint_info.system_identity_type, + constraint_info.system_id); + + result->constraints = IVUG_DRM_RESULT_SYSTEM; + result->data = -1; + return result; + } + + if(constraint_info.const_type.is_timedcount){ + MSG_IVUG_HIGH("TIMED-COUNT Constraint is present"); + MSG_IVUG_HIGH("timed_original_count=%d", + constraint_info.timed_original_count); + + MSG_IVUG_HIGH("timed_remaining_count=%d", + constraint_info.timed_remaining_count); + + MSG_IVUG_HIGH("timed_count_timer=%d", + constraint_info.timed_count_timer); + + result->constraints = IVUG_DRM_RESULT_TIMED_COUNT; + result->data = -1; + return result; + } + + MSG_IVUG_WARN("Undefined constraints"); + free(result); + + return NULL; +} + diff --git a/common/src/ivug-exif.c b/common/src/ivug-exif.c new file mode 100755 index 0000000..484b10b --- /dev/null +++ b/common/src/ivug-exif.c @@ -0,0 +1,1749 @@ +/* + * Copyright 2012 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. + * + */ + + +/** + * The Exif specification defines an Orientation Tag to indicate the orientation of the + * camera relative to the captured scene. This can be used by the camera either to + * indicate the orientation automatically by an orientation sensor, + * or to allow the user to indicate the orientation manually by a menu switch, + * without actually transforming the image data itself. + * Here is an explanation given by TsuruZoh Tachibanaya in + * his description of the Exif file format: + * + * The orientation of the camera relative to the scene, when the image was captured. + * The relation of the '0th row' and '0th column' to visual position is shown as below. + * + * Value 0th Row 0th Column + * 1 top left side + * 2 top right side + * 3 bottom right side + * 4 bottom left side + * 5 left side top + * 6 right side top + * 7 right side bottom + * 8 left side bottom + * + * Read this table as follows (thanks to Peter Nielsen for clarifying this - see also below): + * Entry #6 in the table says that the 0th row in the stored image is the right side of + * the captured scene, and the 0th column in the stored image is the top side of + * the captured scene. + * + * Here is another description given by Adam M. Costello: + * + * For convenience, here is what the letter F would look like if it were tagged correctly + * and displayed by a program that ignores the orientation tag + * (thus showing the stored image): + * + * 1 2 3 4 5 6 7 8 + * + * 888888 888888 88 88 8888888888 88 88 8888888888 + * 88 88 88 88 88 88 88 88 88 88 88 88 + * 8888 8888 8888 8888 88 8888888888 8888888888 88 + * 88 88 88 88 + * 88 88 888888 888888 +*/ + +#include "ivug-debug.h" +#include "ivug-exif.h" + +#undef LOG_LVL +#define LOG_LVL (DBG_MSG_LVL_HIGH | DBG_MSG_LVL_DEBUG) + +#undef LOG_CAT +#define LOG_CAT "IV-EXIF" + +#define gl_dbgE MSG_ERROR +#define gl_dbgW MSG_WARN + +#define gl_dbg MSG_MED + +#define GL_CHECK_VAL(expr, val) \ + do { \ + if(!expr) { \ + MSG_ERROR("[%s] Return value %d", #expr, val );\ + return (val); \ + } \ + } while (0) + + +#include +#include +#include +#include + +#define GL_EXIF_BUF_LEN_MAX 65536L +#define GL_EXIF_BUF_TIME_LEN_MAX 20 +#define GL_EXIF_DEFAULT_YEAR 1900 + +#define GL_EXIF_SOI 0xD8 +#define GL_EXIF_TAG 0xFF +#define GL_EXIF_APP0 0xE0 +#define GL_EXIF_APP1 0xE1 +#define GL_EXIF_JFIF_00 0x00 +#define GL_EXIF_JFIF_01 0x01 +#define GL_EXIF_JFIF_02 0x02 + +#define GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_BYTE 1 +#define GL_EXIF_IFD_DATA_FORMAT_ASCII_STRINGS 1 +#define GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_SHORT 2 +#define GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_LONG 4 +#define GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_RATIONAL 8 +#define GL_EXIF_IFD_DATA_FORMAT_SIGNED_BYTE 1 +#define GL_EXIF_IFD_DATA_FORMAT_UNDEFINED 1 +#define GL_EXIF_IFD_DATA_FORMAT_SIGNED_SHORT 2 +#define GL_EXIF_IFD_DATA_FORMAT_SIGNED_LONG 4 +#define GL_EXIF_IFD_DATA_FORMAT_SIGNED_RATIONAL 8 +#define GL_EXIF_IFD_DATA_FORMAT_SIGNED_FLOAT 4 +#define GL_EXIF_IFD_DATA_FORMAT_DOUBLE_FLOAT 8 + +#define GL_EXI_TMP_JPEG_FILE "/opt/usr/media/.gallery_tmp_write_exif.jpg" + +/* Write one byte, testing for EOF */ +static int __gl_exif_write_1_byte(FILE *fd, int c) +{ + if (fputc(c, fd) < 0) { + gl_dbgE("fputc failed!"); + return -1; + } + + return 0; +} + +/* Read one byte, testing for EOF */ +static int __gl_exif_read_1_byte(FILE *fd) +{ + int c = 0; + + /* Return next input byte, or EOF if no more */ + c = getc(fd); + if (c == EOF) { + gl_dbgE("Premature EOF in JPEG file!"); + return -1; + } + + return c; +} + +/* Read 2 bytes, convert to unsigned int */ +/* All 2-byte quantities in JPEG markers are MSB first */ +static int __gl_exif_read_2_bytes(FILE *fd, unsigned int *len) +{ + int c1 = 0; + int c2 = 0; + + /* Return next input byte, or EOF if no more */ + c1 = getc(fd); + if (c1 == EOF) { + gl_dbgE("Premature EOF in JPEG file!"); + return -1; + } + + /* Return next input byte, or EOF if no more */ + c2 = getc(fd); + if (c2 == EOF) { + gl_dbgE("Premature EOF in JPEG file!"); + return -1; + } + + if (len) + *len = (((unsigned int)c1) << 8) + ((unsigned int)c2); + + return 0; +} + +/* Add raw exif tag and data */ +static int __gl_exif_add_header(FILE *fd, unsigned int *orientation) +{ + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(fd, -1); + int i = 0; + int ret = -1; + char *time_buf = NULL; + unsigned int offset = 0; + + /* raw EXIF header data */ + const unsigned char exif1[] = { + GL_EXIF_TAG, GL_EXIF_SOI, GL_EXIF_TAG, GL_EXIF_APP1 + }; + /* Write File head, check for JPEG SOI + Exif APP1 */ + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif1[i]) < 0) + goto GL_EXIF_FAILED; + } + /* SET the marker parameter length count */ + /* Length includes itself, so must be at least 2 + Following Exif data length must be at least 6; 30+36 bytes*/ + const unsigned char exif2[] = { 0x00, 0x42 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif2[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Write Exif head -- "Exif" */ + const unsigned char exif3[] = { 0x45, 0x78, 0x69, 0x66, 0x00, 0x00 }; + for (i = 0; i < 6; i++) { + if (__gl_exif_write_1_byte(fd, exif3[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Set byte order and Tag Mark , "II(0x4949)" */ + const unsigned char exif4[] = { 0x49, 0x49, 0x2A, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif4[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 4; + + /* Set first IFD offset (offset to IFD0) , II-08000000 */ + const unsigned char exif5[] = { 0x08, 0x00, 0x00, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif5[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 4; + + /* IFD: Image File Directory */ + /* Set the number of directory entries contained in this IFD, - EEEE ; + * 2 entry: orientation, data time */ + const unsigned char exif6[] = { 0x02, 0x00 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif6[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + /* Add Orientation Tag in IFD0; 0x0112 */ + const unsigned char exif7[] = { 0x12, 0x01 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif7[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + gl_dbg("Write: %d", *orientation); + const unsigned char exif8[] = { 0x03, 0x00, 0x01, 0x00, 0x00, 0x00 }; + for (i = 0; i < 6; i++) { + if (__gl_exif_write_1_byte(fd, exif8[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 6; + + /* Set the Orientation value */ + if (__gl_exif_write_1_byte(fd, (unsigned char)(*orientation)) < 0) + goto GL_EXIF_FAILED; + + const unsigned char exif9[] = { 0x00, 0x00, 0x00 }; + for (i = 0; i < 3; i++) { + if (__gl_exif_write_1_byte(fd, exif9[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 4; + + /* Add Data Time Tag in IFD0; 0x0132 */ + const unsigned char exif10[] = { 0x32, 0x01 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif10[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + /* Type: strings */ + const unsigned char exif11[] = { 0x02, 0x00 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif11[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + /* Data lengh, byte count */ + const unsigned char exif12[] = { 0x14, 0x00, 0x00, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif12[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 8; + + /* 20 bytes larger than 4 bytes, + * so next 4 bytes is data offset start from "II"(0x4949)*/ + + gl_dbg("offset: %2X", offset + 8); + /* Too add data offset, plus 4 bytes self and plus 4 bytes IFD terminator */ + if (__gl_exif_write_1_byte(fd, (unsigned char)(offset + 4)) < 0) + goto GL_EXIF_FAILED; + + const unsigned char exif13[] = { 0x00, 0x00, 0x00 }; + for (i = 0; i < 3; i++) { + if (__gl_exif_write_1_byte(fd, exif13[i]) < 0) + goto GL_EXIF_FAILED; + } + + /*After last directory entry, there is a 4bytes of data('LLLLLLLL' at the chart), + * it means an offset to next IFD. If its value is '0x00000000', + * it means this is the last IFD and there is no linked IFD */ + const unsigned char exif14[] = { 0x00, 0x00, 0x00, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif14[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Date Time of image was last modified. + * Data format is "YYYY:MM:DD HH:MM:SS"+0x00, total 20bytes + */ + time_t t; + struct tm tms; + struct tm *tm; + + t = time (NULL); + tm = localtime_r(&t, &tms); + + time_buf = (char *)calloc(1, GL_EXIF_BUF_TIME_LEN_MAX); + if (time_buf == NULL) { + gl_dbgE("Faild to allocate memory!"); + goto GL_EXIF_FAILED; + } + snprintf(time_buf, GL_EXIF_BUF_TIME_LEN_MAX, + "%04i:%02i:%02i %02i:%02i:%02i", + tm->tm_year + GL_EXIF_DEFAULT_YEAR, tm->tm_mon + 1, + tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); + + gl_dbg("time_buf: %s", time_buf); + if (fwrite(time_buf, 1, GL_EXIF_BUF_TIME_LEN_MAX, fd) != GL_EXIF_BUF_TIME_LEN_MAX) { + gl_dbgW("Write size are diff!"); + goto GL_EXIF_FAILED; + } + + ret = 0; + + GL_EXIF_FAILED: + + gl_dbg("All done"); + if (time_buf) + free(time_buf); + return ret; +} + +/* Add exif to jfif , don't have exif */ +static int __gl_exif_add_exif_to_jfif(const char *file_path, unsigned int *orientation) +{ + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(file_path, -1); + unsigned char tmp[GL_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + + if ((fd = fopen(file_path, "rb+")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + + char *tmp_file = GL_EXI_TMP_JPEG_FILE; + FILE *tmp_fd = NULL; + if ((tmp_fd = fopen(tmp_file, "wb+")) == NULL) { + gl_dbgE("Can't open %s!", tmp_file); + goto GL_EXIF_FAILED; + } + + /* Add raw EXIF header data */ + if (__gl_exif_add_header(tmp_fd, orientation) < 0) + goto GL_EXIF_FAILED; + + size_t r_size = 0; + /* Remove start of JPEG image data section, 20 bytes */ + r_size = fread(tmp, sizeof(char), 20, fd); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write JPEG image data to tmp file after EXIF header */ + while ((r_size = fread(tmp, 1, sizeof(tmp), fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, tmp_fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + fclose(fd); + fd = fopen(file_path, "wb"); + if (!fd) { + gl_dbgE("Error creating file %s!", file_path); + goto GL_EXIF_FAILED; + } + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write back tmp file after to JPEG image */ + fseek(tmp_fd, 0, SEEK_SET); + while ((r_size = fread(tmp, 1, sizeof(tmp), tmp_fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + ret = 0; + + GL_EXIF_FAILED: + + if (fd) + fclose(fd); + if (tmp_fd) + fclose(tmp_fd); + + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + gl_dbgE("Delete file failed"); + + gl_dbg("All done"); + return ret; + } + +#if 0 +/* Add exif to jfif 1.00, to add exif for some cases */ +static int __gl_exif_rw_jfif_1dot00(char *file_path, unsigned int *orientation) +{ + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(file_path, -1); + unsigned char tmp[GL_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + int tmp_exif = -1; + + if ((fd = fopen(file_path, "rb+")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + + char *tmp_file = GL_EXI_TMP_JPEG_FILE; + FILE *tmp_fd = NULL; + if ((tmp_fd = fopen(tmp_file, "wb+")) == NULL) { + gl_dbgE("Can't open %s!", tmp_file); + goto GL_EXIF_FAILED; + } + + /* Add raw EXIF header data */ + if (__gl_exif_add_header(tmp_fd, orientation) < 0) + goto GL_EXIF_FAILED; + + size_t r_size = 0; + /* Remove start of JPEG image data section, 20 bytes */ + r_size = fread(tmp, sizeof(char), 20, fd); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write JPEG image data from first 0xFF to tmp file after EXIF header */ + while ((r_size = fread(tmp, 1, sizeof(tmp), fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, tmp_fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + fclose(fd); + fd = fopen(file_path, "wb"); + if (!fd) { + gl_dbgE("Error creating file %s!", file_path); + goto GL_EXIF_FAILED; + } + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write back tmp file after to JPEG image */ + fseek(tmp_fd, 0, SEEK_SET); + while ((r_size = fread(tmp, 1, sizeof(tmp), tmp_fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + ret = 0; + + GL_EXIF_FAILED: + + if (fd) + fclose(fd); + if (tmp_fd) + fclose(tmp_fd); + + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + gl_dbgE("Delete file failed"); + + gl_dbg("All done"); + return ret; +} + +/* Add exif to jfif 1.01, older version, don't have exif */ +static int __gl_exif_rw_jfif_1dot01(char *file_path, unsigned int *orientation) +{ + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(file_path, -1); + unsigned char tmp[GL_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + + if ((fd = fopen(file_path, "rb+")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + + char *tmp_file = GL_EXI_TMP_JPEG_FILE; + FILE *tmp_fd = NULL; + if ((tmp_fd = fopen(tmp_file, "wb+")) == NULL) { + gl_dbgE("Can't open %s!", tmp_file); + goto GL_EXIF_FAILED; + } + + /* Add raw EXIF header data */ + if (__gl_exif_add_header(tmp_fd, orientation) < 0) + goto GL_EXIF_FAILED; + + size_t r_size = 0; + /* Remove start of JPEG image data section, 20 bytes */ + r_size = fread(tmp, sizeof(char), 20, fd); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write JPEG image data to tmp file after EXIF header */ + while ((r_size = fread(tmp, 1, sizeof(tmp), fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, tmp_fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + fclose(fd); + fd = fopen(file_path, "wb"); + if (!fd) { + gl_dbgE("Error creating file %s!", file_path); + goto GL_EXIF_FAILED; + } + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write back tmp file after to JPEG image */ + fseek(tmp_fd, 0, SEEK_SET); + while ((r_size = fread(tmp, 1, sizeof(tmp), tmp_fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + ret = 0; + + GL_EXIF_FAILED: + + if (fd) + fclose(fd); + if (tmp_fd) + fclose(tmp_fd); + + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + gl_dbgE("Delete file failed"); + + gl_dbg("All done"); + return ret; +} + +/* Add exif to jfif 1.02, to add exif for some cases */ +static int __gl_exif_rw_jfif_1dot02(char *file_path, unsigned int *orientation) +{ + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(file_path, -1); + unsigned char tmp[GL_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + int tmp_exif = -1; + + if ((fd = fopen(file_path, "rb+")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + + char *tmp_file = GL_EXI_TMP_JPEG_FILE; + FILE *tmp_fd = NULL; + if ((tmp_fd = fopen(tmp_file, "wb+")) == NULL) { + gl_dbgE("Can't open %s!", tmp_file); + goto GL_EXIF_FAILED; + } + + /* Add raw EXIF header data */ + if (__gl_exif_add_header(tmp_fd, orientation) < 0) + goto GL_EXIF_FAILED; + + size_t r_size = 0; + /* Remove start of JPEG image data section, 20 bytes */ + r_size = fread(tmp, sizeof(char), 20, fd); + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write JPEG image data from first 0xFF to tmp file after EXIF header */ + while ((r_size = fread(tmp, 1, sizeof(tmp), fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, tmp_fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + fclose(fd); + fd = fopen(file_path, "wb"); + if (!fd) { + gl_dbgE("Error creating file %s!", file_path); + goto GL_EXIF_FAILED; + } + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write back tmp file after to JPEG image */ + fseek(tmp_fd, 0, SEEK_SET); + while ((r_size = fread(tmp, 1, sizeof(tmp), tmp_fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + ret = 0; + + GL_EXIF_FAILED: + + if (fd) + fclose(fd); + if (tmp_fd) + fclose(tmp_fd); + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + gl_dbgE("Delete file failed"); + + gl_dbg("All done"); + return ret; +} +#endif + +/* Add orientation tag to jpegs which have exif tag but do not have orientation tag: include jfif and exif*/ +static int __gl_exif_add_orientation_tag(const char *file_path, + unsigned int *orientation){ + + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(file_path, -1); + unsigned char tmp[GL_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + int tmp_exif = -1; + int i = 0; + unsigned int length = 0; + bool is_motorola = false; /* Flag for byte order */ + unsigned int offset = 0; + size_t r_size = 0; + const unsigned char ifd_data_format[13] = { + /*add 0 to ifd_data_format[0] ,for easy to use*/ + 0, + GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_BYTE, + GL_EXIF_IFD_DATA_FORMAT_ASCII_STRINGS, + GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_SHORT, + GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_LONG, + GL_EXIF_IFD_DATA_FORMAT_UNSIGNED_RATIONAL, + GL_EXIF_IFD_DATA_FORMAT_SIGNED_BYTE, + GL_EXIF_IFD_DATA_FORMAT_UNDEFINED, + GL_EXIF_IFD_DATA_FORMAT_SIGNED_SHORT, + GL_EXIF_IFD_DATA_FORMAT_SIGNED_LONG, + GL_EXIF_IFD_DATA_FORMAT_SIGNED_RATIONAL, + GL_EXIF_IFD_DATA_FORMAT_SIGNED_FLOAT, + GL_EXIF_IFD_DATA_FORMAT_DOUBLE_FLOAT + + }; + + if ((fd = fopen(file_path, "rb+")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + + char *tmp_file = GL_EXI_TMP_JPEG_FILE; + FILE *tmp_fd = NULL; + if ((tmp_fd = fopen(tmp_file, "wb+")) == NULL) { + gl_dbgE("Can't open %s!", tmp_file); + goto GL_EXIF_FAILED; + } + /* Find APP1 */ + bool b_tag_ff = false; + while(1) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + /*copy data from jpeg to tmp_fd (from "FF D8" to " FF E1",because those data we needn't modify)*/ + if (__gl_exif_write_1_byte(tmp_fd, tmp_exif) < 0) + goto GL_EXIF_FAILED; + + tmp[0] = (unsigned char)tmp_exif; + + gl_dbg("- %02X", tmp[0]); + if (!b_tag_ff) { + /* Get first tag */ + if (tmp[0] == GL_EXIF_TAG) { + gl_dbgW("0xFF!"); + b_tag_ff = true; + } + continue; + } + + /* Get APP1 */ + if (tmp[0] == GL_EXIF_APP1) { + gl_dbgW("Exif in APP1!"); + break; + } else { + gl_dbgW("0x%02X!",tmp[0]); + b_tag_ff = false; + } + } + + /* Get the marker parameter length count */ + if (__gl_exif_read_2_bytes(fd, &length) < 0) + goto GL_EXIF_FAILED; + gl_dbg("length: %d", length); + /* Length includes itself, so must be at least 2 + Following Exif data length must be at least 6 */ + if (length < 8) { + gl_dbgE("length < 8"); + goto GL_EXIF_FAILED; + } + /*modify the marker parameter length, orientation tag is 12*/ + length += 12; + gl_dbgW("modified length: %d", length); + tmp[0] =( length >> 8 )& 0xff ; + tmp[1] = length & 0xff ; + for(i = 0; i < 2; i++){ + if (__gl_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GL_EXIF_FAILED; + } + + for (i = 0; i < 6; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + gl_dbg("- %02X", tmp[i]); + if (__gl_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GL_EXIF_FAILED; + } + if (tmp[0] == 0x45 && tmp[1] == 0x78 && tmp[2] == 0x69 && tmp[3] == 0x66 && + tmp[4] == 0x00 && tmp[5] == 0x00) { + gl_dbgW("Met Exif!"); + } else { + gl_dbgW("Not met Exif!"); + goto GL_EXIF_FAILED; + } + /* Read Exif body */ + for (i = 0; i < 4; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + tmp[i] = (unsigned char)tmp_exif; + if (__gl_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Check byte order and Tag Mark , "II(0x4949)" or "MM(0x4d4d)" */ + if (tmp[0] == 0x49 && tmp[1] == 0x49 && tmp[2] == 0x2A && + tmp[3] == 0x00) { + gl_dbg("Intel"); + is_motorola = false; + } else if (tmp[0] == 0x4D && tmp[1] == 0x4D && tmp[2] == 0x00 && + tmp[3] == 0x2A) { + gl_dbg("Motorola"); + is_motorola = true; + } else { + goto GL_EXIF_FAILED; + } + + for (i = 0; i < 4; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + gl_dbg("- %02X", tmp[i]); + if (__gl_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Get first IFD offset (offset to IFD0) , MM-08000000, II-00000008 */ + if (is_motorola) { + if (tmp[0] != 0 && tmp[1] != 0) + goto GL_EXIF_FAILED; + offset = tmp[2]; + offset <<= 8; + offset += tmp[3]; + } else { + if (tmp[3] != 0 && tmp[2] != 0) + goto GL_EXIF_FAILED; + offset = tmp[1]; + offset <<= 8; + offset += tmp[0]; + } + gl_dbg("offset: %d", offset); + /*if offset >8, copy data from there to IFD start position*/ + if(offset > 8){ + for (i = 0; i < (offset - 8); i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + gl_dbg("- %02X", tmp[i]); + if (__gl_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GL_EXIF_FAILED; + } + } + + /* IFD: Image File Directory */ + /* Get the number of directory entries contained in this IFD, - 2 bytes, EE */ + unsigned int tags_cnt = 0; + for (i = 0; i < 2; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + } + if (is_motorola) { + tags_cnt = tmp[0]; + tags_cnt <<= 8; + tags_cnt += tmp[1]; + } else { + tags_cnt = tmp[1]; + tags_cnt <<= 8; + tags_cnt += tmp[0]; + } + gl_dbg("tags_cnt: %d", tags_cnt); + /*modify tags num,add orientation tag */ + tags_cnt += 1; + gl_dbg("modified tags_cnt: %d", tags_cnt); + if (is_motorola) { + tmp[0] = (tags_cnt >> 8) & 0xff; + tmp[1] = tags_cnt & 0xff; + } else { + tmp[0] = tags_cnt & 0xff; + tmp[1] = (tags_cnt >> 8) & 0xff; + } + for (i = 0; i < 2; i++) { + gl_dbg("modified- %02X", tmp[i]); + if (__gl_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GL_EXIF_FAILED; + + } + /* Add Orientation Tag in IFD0 */ + unsigned int tag_num = 0; + unsigned char orientation_tag[12] = { 0, }; + bool b_found_position = false; + int j = 0; + unsigned int data_type = 0; + unsigned int unit_num = 0; + unsigned int data_length = 0; + unsigned int offset_value = 0; + /*initialize orientation_tag value*/ + if (is_motorola) { + orientation_tag[0] = 0x01; + orientation_tag[1] = 0x12; + + orientation_tag[2] = 0x00; + orientation_tag[3] = 0x03; + + orientation_tag[4] = 0x00; + orientation_tag[5] = 0x00; + orientation_tag[6] = 0x00; + orientation_tag[7] = 0x01; + + orientation_tag[8] = 0x00; + orientation_tag[9] = (unsigned char)(*orientation); + orientation_tag[10] = 0x00; + orientation_tag[11] = 0x00; + + } else { + orientation_tag[0] = 0x12; + orientation_tag[1] = 0x01; + orientation_tag[2] = 0x03; + orientation_tag[3] = 0x00; + orientation_tag[4] = 0x01; + orientation_tag[5] = 0x00; + orientation_tag[6] = 0x00; + orientation_tag[7] = 0x00; + orientation_tag[8] = (unsigned char)(*orientation); + orientation_tag[9] = 0x00; + orientation_tag[10] = 0x00; + orientation_tag[11] = 0x00; + } + /*if there is no other tag, then only insert orientation_tag,don't go to the while(1)*/ + if(tags_cnt == 1) { + for(j = 0; j < 12 ;j++) { + gl_dbg("orientation_tag- %02X", orientation_tag[j]); + if (__gl_exif_write_1_byte(tmp_fd, orientation_tag[j]) < 0) + goto GL_EXIF_FAILED; + } + } + while(1){ + if (--tags_cnt == 0) { + break; + } + + /* Every directory entry size is 12 */ + for (i = 0; i < 12; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + } + /* Get Tag number */ + if (is_motorola) { + tag_num = tmp[0]; + tag_num <<= 8; + tag_num += tmp[1]; + } else { + tag_num = tmp[1]; + tag_num <<= 8; + tag_num += tmp[0]; + } + gl_dbgW("tag num %02X!" , tag_num); + /* to find Orientation Tag position */ + if (tag_num < 0x0112) { + + } else if (tag_num > 0x0112){ + if(!b_found_position){ + for(j = 0; j < 12 ;j++){ + gl_dbg("orientation_tag- %02X", orientation_tag[j]); + if (__gl_exif_write_1_byte(tmp_fd, orientation_tag[j]) < 0) + goto GL_EXIF_FAILED; + } + b_found_position = true; + } + if (is_motorola) { + data_type = tmp[2]; + data_type <<= 8; + data_type += tmp[3]; + + unit_num = tmp[4]; + unit_num <<= 8; + unit_num += tmp[5]; + unit_num <<= 8; + unit_num += tmp[6]; + unit_num <<= 8; + unit_num += tmp[7]; + } else { + data_type = tmp[3]; + data_type <<= 8; + data_type += tmp[2]; + + unit_num = tmp[7]; + unit_num <<= 8; + unit_num += tmp[6]; + unit_num <<= 8; + unit_num += tmp[5]; + unit_num <<= 8; + unit_num += tmp[4]; + } + gl_dbgW("data_type %02X!" , data_type); + gl_dbgW("unit_num %02X!" , unit_num); + if((data_type < 1) ||(data_type > 12)){ + gl_dbgE("Wrong data type!"); + goto GL_EXIF_FAILED; + } + + data_length = ifd_data_format[data_type] * unit_num; + gl_dbgW("data_length %02X!" , data_length); + /*data_length >4 ,next 4 bytes store the offset, so need to modify the offset*/ + if(data_length > 4){ + if (is_motorola) { + offset_value = tmp[8]; + offset_value <<= 8; + offset_value += tmp[9]; + offset_value <<= 8; + offset_value += tmp[10]; + offset_value <<= 8; + offset_value += tmp[11]; + gl_dbgW("offset_value %02X!" , offset_value); + /*add orientation offset*/ + offset_value += 12; + gl_dbgW("changed offset_value %02X!" , offset_value); + tmp[8] = (offset_value >> 24) & 0xff; + tmp[9] = (offset_value >> 16) & 0xff; + tmp[10] = (offset_value >> 8) & 0xff; + tmp[11] = offset_value & 0xff; + gl_dbg("tmp[8] %02X!" , tmp[8]); + gl_dbg("tmp[9] %02X!" , tmp[9]); + gl_dbg("tmp[10] %02X!" , tmp[10]); + gl_dbg("tmp[11] %02X!" , tmp[11]); + } else { + offset_value = tmp[11]; + offset_value <<= 8; + offset_value += tmp[10]; + offset_value <<= 8; + offset_value += tmp[9]; + offset_value <<= 8; + offset_value += tmp[8]; + gl_dbgW("offset_value %02X!" , offset_value); + /*add orientation offset*/ + offset_value += 12; + gl_dbgW("changed offset_value %02X!" , offset_value); + + tmp[11] = (offset_value >> 24) & 0xff; + tmp[10] = (offset_value >> 16) & 0xff; + tmp[9] = (offset_value >> 8) & 0xff; + tmp[8] = offset_value & 0xff; + gl_dbg("tmp[8] %02X!" , tmp[8]); + gl_dbg("tmp[9] %02X!" , tmp[9]); + gl_dbg("tmp[10] %02X!" , tmp[10]); + gl_dbg("tmp[11] %02X!" , tmp[11]); + + } + + } + + } + for(i = 0; i < 12 ;i++){ + gl_dbg("- %02X", tmp[i]); + if (__gl_exif_write_1_byte(tmp_fd,tmp[i]) < 0) + goto GL_EXIF_FAILED; + + } + memset(tmp, 0x00, 12); + + } + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write JPEG image data to tmp file after EXIF header */ + while ((r_size = fread(tmp, 1, sizeof(tmp), fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, tmp_fd) != r_size) + gl_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + fclose(fd); + fd = NULL; + fd = fopen(file_path, "wb"); + if (!fd) { + gl_dbgE("Error creating file %s!", file_path); + goto GL_EXIF_FAILED; + } + + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + /* Write back tmp file after to JPEG image */ + fseek(tmp_fd, 0, SEEK_SET); + while ((r_size = fread(tmp, 1, sizeof(tmp), tmp_fd)) > 0) { + gl_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, fd) != r_size) + gl_dbgW("Write and read size are diff!"); + memset(tmp, 0x00, GL_EXIF_BUF_LEN_MAX); + } + + ret = 0; + + GL_EXIF_FAILED: + + if (fd){ + fclose(fd); + fd = NULL; + } + + if (tmp_fd){ + fclose(tmp_fd); + tmp_fd = NULL; + } + + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + gl_dbgE("Delete file failed"); + + gl_dbg("All done"); + return ret; +} + +static int __gl_exif_rw_jfif(FILE *fd, const char *file_path, + unsigned int *orientation, bool b_write) +{ + GL_CHECK_VAL(fd, -1); + GL_CHECK_VAL(file_path, -1); + GL_CHECK_VAL(orientation, -1); + unsigned char tmp[GL_EXIF_BUF_LEN_MAX] = { 0, }; + int i = 0; + unsigned int length = 0; + int tmp_exif = -1; + bool is_motorola = false; /* Flag for byte order */ + unsigned int offset = 0; + int ret = -1; + /*unsigned char version = 0x00; */ + + if (__gl_exif_read_2_bytes(fd, &length) < 0) + goto GL_EXIF_FAILED; + gl_dbg("length: %d", length); + + for (i = 0; i < 5; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + tmp[i] = (unsigned char)tmp_exif; + } + + /* JFIF0 */ + if (tmp[0] != 0x4A || tmp[1] != 0x46 || tmp[2] != 0x49 || + tmp[3] != 0x46 || tmp[4] != 0x00) { + gl_dbgE("Not met Jfif!"); + goto GL_EXIF_FAILED; + } + + for (i = 0; i < 2; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + tmp[i] = (unsigned char)tmp_exif; + } + + /* Check JFIF version */ + if (tmp[0] == 0x01 && tmp[1] == GL_EXIF_JFIF_00) { + gl_dbg("Jfif 1.00"); + } else if (tmp[0] == 0x01 && tmp[1] == GL_EXIF_JFIF_01) { + gl_dbg("Jfif 1.01"); + } else if (tmp[0] == 0x01 && tmp[1] == GL_EXIF_JFIF_02) { + gl_dbg("Jfif 1.02"); + } else { + gl_dbgE("Unknow Jfif version[%d.%d]!", tmp[0], tmp[1]); + goto GL_EXIF_FAILED; + } + + /* Save version */ + /*version = tmp[1]; */ + + /* Find APP1 */ + bool b_tag_ff = false; + while(1) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[0] = (unsigned char)tmp_exif; + + gl_dbg("- %02X", tmp[0]); + if (!b_tag_ff) { + /* Get first tag */ + if (tmp[0] == GL_EXIF_TAG) { + gl_dbgW("0xFF!"); + b_tag_ff = true; + } + continue; + } + + /* Get APP1 */ + if (tmp[0] == GL_EXIF_APP1) { + gl_dbgW("Exif in APP1!"); + break; + } + + gl_dbgW("No Exif in APP1!"); + + /* Close file */ + fclose(fd); + if (!b_write) { + /* Normal orientation = 0degree = 1 */ + *orientation = 1; + return -1; + } + return __gl_exif_add_exif_to_jfif(file_path, orientation); +#if 0 + if (version == GL_EXIF_JFIF_00) { + return __gl_exif_rw_jfif_1dot00(file_path, orientation); + } else if (version == GL_EXIF_JFIF_01) { + return __gl_exif_rw_jfif_1dot01(file_path, orientation); + } else { + return __gl_exif_rw_jfif_1dot02(file_path, orientation); + } +#endif + } + + /* Find Exif */ + while(1) { + for (i = 0; i < 6; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) { + gl_dbgW("Not met Exif!"); + goto GL_EXIF_FAILED; + } + + tmp[i] = (unsigned char)tmp_exif; + gl_dbg("- %02X", tmp[i]); + } + if (tmp[0] == 0x45 && tmp[1] == 0x78 && tmp[2] == 0x69 && tmp[3] == 0x66 && + tmp[4] == 0x00 && tmp[5] == 0x00) { + gl_dbgW("Met Exif!"); + break; + } else { + gl_dbg("Not met Exif!"); + fseek(fd, -5, SEEK_CUR); + continue; + } + } + + /* Read Exif body */ + for (i = 0; i < 4; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + tmp[i] = (unsigned char)tmp_exif; + } + + /* Check byte order and Tag Mark , "II(0x4949)" or "MM(0x4d4d)" */ + if (tmp[0] == 0x49 && tmp[1] == 0x49 && tmp[2] == 0x2A && + tmp[3] == 0x00) { + gl_dbg("Intel"); + is_motorola = false; + } else if (tmp[0] == 0x4D && tmp[1] == 0x4D && tmp[2] == 0x00 && + tmp[3] == 0x2A) { + gl_dbg("Motorola"); + is_motorola = true; + } else { + goto GL_EXIF_FAILED; + } + + for (i = 0; i < 4; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + gl_dbg("- %02X", tmp[i]); + } + + /* Get first IFD offset (offset to IFD0) , MM-08000000, II-00000008 */ + if (is_motorola) { + if (tmp[0] != 0 && tmp[1] != 0) + goto GL_EXIF_FAILED; + offset = tmp[2]; + offset <<= 8; + offset += tmp[3]; + } else { + if (tmp[3] != 0 && tmp[2] != 0) + goto GL_EXIF_FAILED; + offset = tmp[1]; + offset <<= 8; + offset += tmp[0]; + } + gl_dbg("offset: %d", offset); + + /* IFD: Image File Directory */ + /* Get the number of directory entries contained in this IFD, - 2 bytes, EE */ + unsigned int tags_cnt = 0; + for (i = 0; i < 2; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + } + if (is_motorola) { + tags_cnt = tmp[0]; + tags_cnt <<= 8; + tags_cnt += tmp[1]; + } else { + tags_cnt = tmp[1]; + tags_cnt <<= 8; + tags_cnt += tmp[0]; + } + gl_dbg("tags_cnt: %d", tags_cnt); + if (tags_cnt == 0) { + gl_dbgE("tags_cnt == 0,no found orientation tag!"); + if (b_write) { + gl_dbgW("to add an orientation tag!"); + fclose(fd); + fd = NULL; + return __gl_exif_add_orientation_tag(file_path, orientation); + + } else{ + /* Normal orientation = 0degree = 1 */ + *orientation = 1; + ret = -1; + } + goto GL_EXIF_FAILED; + } + + /* Search for Orientation Tag in IFD0 */ + unsigned int tag_num = 0; + while (1) { + /* Every directory entry size is 12 */ + for (i = 0; i < 12; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + } + /* Get Tag number */ + if (is_motorola) { + tag_num = tmp[0]; + tag_num <<= 8; + tag_num += tmp[1]; + } else { + tag_num = tmp[1]; + tag_num <<= 8; + tag_num += tmp[0]; + } + /* found Orientation Tag */ + if (tag_num == 0x0112) { + gl_dbgW("Found orientation tag!"); + break; + } + if (--tags_cnt == 0) { + gl_dbgW("tags_cnt == 0, no found orientation tag!"); + if (b_write) { + gl_dbgW("to add an orientation tag!"); + fclose(fd); + fd = NULL; + return __gl_exif_add_orientation_tag(file_path, orientation); + + } else{ + /* Normal orientation = 0degree = 1 */ + *orientation = 1; + ret = -1; + } + goto GL_EXIF_FAILED; + } + } + + /* |TT|ff|NNNN|DDDD| --- TT - 2 bytes, tag NO. ;ff - 2 bytes, data format + NNNN - 4 bytes, entry count; DDDD - 4 bytes Data value */ + if (b_write) { + gl_dbg("Write: %d", *orientation); + /* Set the Orientation value */ + if (is_motorola) + tmp[9] = (unsigned char)(*orientation); + else + tmp[8] = (unsigned char)(*orientation); + + /* Move pointer back to the entry start point */ + if (fseek(fd, -12, SEEK_CUR) < 0) { + gl_dbgE("fseek failed!"); + goto GL_EXIF_FAILED; + } + fwrite(tmp, 1, 10, fd); + } else { + /* Get the Orientation value */ + if (is_motorola) { + if (tmp[8] != 0) { + gl_dbgE("tmp[8] != 0"); + goto GL_EXIF_FAILED; + } + *orientation = (unsigned int)tmp[9]; + } else { + if (tmp[9] != 0) { + gl_dbgE("tmp[9] != 0"); + goto GL_EXIF_FAILED; + } + *orientation = (unsigned int)tmp[8]; + } + if (*orientation > 8) { + gl_dbgE("*orient > 8"); + goto GL_EXIF_FAILED; + } + gl_dbg("Read: %d", *orientation); + } + + ret = 0; + + GL_EXIF_FAILED: + + fclose(fd); + gl_dbg("All done"); + return ret; +} +bool _gl_exif_check_img_type(char *file_path) +{ + GL_CHECK_VAL(file_path, -1); + int tmp_exif = -1; + unsigned int i = 0; + unsigned char exif_data[4] = { 0, }; + FILE *fd = NULL; + bool ret = false; + + if ((fd = fopen(file_path, "rb")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + + + /* Read File head, check for JPEG SOI + Exif APP1 */ + for (i = 0; i < 4; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + exif_data[i] = (unsigned char)tmp_exif; + } + + if (exif_data[0] == GL_EXIF_TAG && exif_data[1] == GL_EXIF_SOI) { + gl_dbg("JPEG file"); + } else { + gl_dbgE("Not a JPEG file!"); + goto GL_EXIF_FAILED; + } + + if (exif_data[2] == GL_EXIF_TAG && exif_data[3] == GL_EXIF_APP1) { + gl_dbgW("Exif in APP1!"); + ret = true; + } else if (exif_data[2] == GL_EXIF_TAG && + exif_data[3] == GL_EXIF_APP0) { + gl_dbgW("Jfif in APP0!"); + ret = true; + } else { + gl_dbgE("Not a Exif in APP1 or Jiff in APP2[%d]!", exif_data[3]); + ret = false; + } + GL_EXIF_FAILED: + + fclose(fd); + gl_dbg(""); + return ret; +} + +static int __gl_exif_rw_orient(const char *file_path, unsigned int *orient, bool b_write) +{ + GL_CHECK_VAL(file_path, -1); + gl_dbg("b_write: %d", b_write); + unsigned int length = 0; + unsigned int i = 0; + bool is_motorola = false; /* Flag for byte order */ + unsigned int offset = 0; + unsigned int jfif_offset = 0; + unsigned int tags_cnt = 0; + unsigned int tag_num = 0; + int tmp_exif = -1; + unsigned char exif_data[GL_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + + if (b_write) { + if ((fd = fopen(file_path, "rb+")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + } else { + if ((fd = fopen(file_path, "rb")) == NULL) { + gl_dbgE("Can't open %s!", file_path); + return -1; + } + } + + /* Read File head, check for JPEG SOI + Exif APP1 */ + for (i = 0; i < 4; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + exif_data[i] = (unsigned char)tmp_exif; + } + + if (exif_data[0] == GL_EXIF_TAG && exif_data[1] == GL_EXIF_SOI) { + gl_dbg("JPEG file"); + } else { + gl_dbgE("Not a JPEG file!"); + goto GL_EXIF_FAILED; + } + + if (exif_data[2] == GL_EXIF_TAG && exif_data[3] == GL_EXIF_APP1) { + gl_dbgW("Exif in APP1!"); + } else if (exif_data[2] == GL_EXIF_TAG && + exif_data[3] == GL_EXIF_APP0) { + gl_dbgW("Jfif in APP0!"); + int ret = __gl_exif_rw_jfif(fd, file_path, orient, b_write); + return ret; + } else { + gl_dbgE("Not a Exif in APP1 or Jiff in APP2[%d]!", exif_data[3]); + goto GL_EXIF_FAILED; + } + + /* Get the marker parameter length count */ + if (__gl_exif_read_2_bytes(fd, &length) < 0) + goto GL_EXIF_FAILED; + gl_dbg("length: %d", length); + /* Length includes itself, so must be at least 2 + Following Exif data length must be at least 6 */ + if (length < 8) { + gl_dbgE("length < 8"); + goto GL_EXIF_FAILED; + } + length -= 8; + + /* Length of an IFD entry */ + if (length < 12) { + gl_dbgE("length < 12"); + goto GL_EXIF_FAILED; + } + + /* Read Exif head, check for "Exif" */ + for (i = 0; i < 6; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + exif_data[i] = (unsigned char)tmp_exif; + gl_dbg("- %02X", exif_data[i]); + } + + if (exif_data[0] != 0x45 || exif_data[1] != 0x78 || + exif_data[2] != 0x69 || exif_data[3] != 0x66 || + exif_data[4] != 0x00 || exif_data[5] != 0x00) { + gl_dbgE("Not met Exif!"); + goto GL_EXIF_FAILED; + } + + /* Read Exif body */ + for (i = 0; i < length; i++) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + exif_data[i] = (unsigned char)tmp_exif; + } + + /* Check byte order and Tag Mark , "II(0x4949)" or "MM(0x4d4d)" */ + if (exif_data[0] == 0x49 && exif_data[1] == 0x49 && + exif_data[2] == 0x2A && exif_data[3] == 0x00) { + gl_dbg("Intel"); + is_motorola = false; + } else if (exif_data[0] == 0x4D && exif_data[1] == 0x4D && + exif_data[2] == 0x00 && exif_data[3] == 0x2A) { + gl_dbg("Motorola"); + is_motorola = true; + } else { + goto GL_EXIF_FAILED; + } + + /* Get first IFD offset (offset to IFD0) , MM-00000008, II-08000000 */ + if (is_motorola) { + if (exif_data[4] != 0 && exif_data[5] != 0) + goto GL_EXIF_FAILED; + offset = exif_data[6]; + offset <<= 8; + offset += exif_data[7]; + } else { + if (exif_data[7] != 0 && exif_data[6] != 0) + goto GL_EXIF_FAILED; + offset = exif_data[5]; + offset <<= 8; + offset += exif_data[4]; + } + /* check end of data segment */ + if (offset > length - 2) { + gl_dbgE("offset > length - 2"); + goto GL_EXIF_FAILED; + } + + /* IFD: Image File Directory */ + /* Get the number of directory entries contained in this IFD, - EEEE */ + if (is_motorola) { + tags_cnt = exif_data[offset]; + tags_cnt <<= 8; + tags_cnt += exif_data[offset+1]; + } else { + tags_cnt = exif_data[offset+1]; + tags_cnt <<= 8; + tags_cnt += exif_data[offset]; + } + if (tags_cnt == 0) { + gl_dbgE("tags_cnt == 0 - 2"); + goto GL_EXIF_FAILED; + } + offset += 2; + + /* check end of data segment */ + if (offset > length - 12) { + gl_dbgE("offset > length - 12"); + goto GL_EXIF_FAILED; + } + + /* Search for Orientation Tag in IFD0 */ + while (1) { + /* Get Tag number */ + if (is_motorola) { + tag_num = exif_data[offset]; + tag_num <<= 8; + tag_num += exif_data[offset+1]; + } else { + tag_num = exif_data[offset+1]; + tag_num <<= 8; + tag_num += exif_data[offset]; + } + /* found Orientation Tag */ + if (tag_num == 0x0112) { + gl_dbgW("Found orientation tag!"); + break; + } + if (--tags_cnt == 0) { + gl_dbgW("tags_cnt == 0, no found orientation tag!"); + if (b_write) { + gl_dbgW("to add an orientation tag!"); + fclose(fd); + fd = NULL; + return __gl_exif_add_orientation_tag(file_path, orient); + + } else{ + /* Normal orientation = 0degree = 1 */ + *orient = 1; + ret = -1; + } + goto GL_EXIF_FAILED; + } + + /* Every directory entry size is 12 */ + offset += 12; + } + + if (b_write) { + gl_dbg("Write: %d", *orient); + /* Set the Orientation value */ + if (is_motorola) + exif_data[offset+9] = (unsigned char)(*orient); + else + exif_data[offset+8] = (unsigned char)(*orient); + + if (fseek(fd, jfif_offset + (4 + 2 + 6 + 2) + offset, SEEK_SET) < 0) { + gl_dbgE("fseek failed!"); + goto GL_EXIF_FAILED; + } + fwrite(exif_data + 2 + offset, 1, 10, fd); + } else { + /* Get the Orientation value */ + if (is_motorola) { + if (exif_data[offset+8] != 0) { + gl_dbgE("exif_data[offset+8] != 0"); + goto GL_EXIF_FAILED; + } + *orient = (unsigned int)exif_data[offset+9]; + } else { + if (exif_data[offset+9] != 0) { + gl_dbgE("exif_data[offset+9] != 0"); + goto GL_EXIF_FAILED; + } + *orient = (unsigned int)exif_data[offset+8]; + } + if (*orient > 8) { + gl_dbgE("*orient > 8"); + goto GL_EXIF_FAILED; + } + gl_dbg("Read: %d", *orient); + } + + ret = 0; + + GL_EXIF_FAILED: + + fclose(fd); + gl_dbg("All done"); + return ret; +} + + + +/* 1 : top left + 2 : top right + 3 : bottom right + 4 : bottom left + 5 : left top + 6 : right top + 7 : right bottom + 8 : left bottom */ + +#define IVUG_EXIF_ROTATE_0 (1) +#define IVUG_EXIF_ROTATE_90 (6) +#define IVUG_EXIF_ROTATE_180 (3) +#define IVUG_EXIF_ROTATE_270 (8) + + +int ivug_exif_get_rotate(const char *file, int *degree) +{ + MSG_ASSERT(file != NULL); + + unsigned int orientation = 0; + + int ret = __gl_exif_rw_orient(file, &orientation, false); + if (-1 != ret && 0 != orientation) + { + switch (orientation) + { + case IVUG_EXIF_ROTATE_0: + *degree = 0; + break; + case IVUG_EXIF_ROTATE_90: + *degree = 90; + break; + case IVUG_EXIF_ROTATE_180: + *degree = 180; + break; + case IVUG_EXIF_ROTATE_270: + *degree = 270; + break; + default: + *degree = 0; + gl_dbgE("Invalid Orientation : %d", orientation); + break; + } + + gl_dbg("Get Degree: %d' %s", *degree, file); + return 0; + + } + + gl_dbgE("Unknown Degree: %s", file); + return -1; +} + + + +int ivug_exif_set_rotate(const char *file, int degree) +{ + MSG_ASSERT(file != NULL); + + gl_dbg("Set Degree: %d' %s", degree, file); + + unsigned int orientation; + + switch (degree){ + case 0: + case 360: + orientation = IVUG_EXIF_ROTATE_0; + break; + case 90: + case -270: + orientation = IVUG_EXIF_ROTATE_90; + break; + case 180: + case -180: + orientation = IVUG_EXIF_ROTATE_180; + break; + case 270: + case -90: + orientation = IVUG_EXIF_ROTATE_270; + break; + default: + orientation = IVUG_EXIF_ROTATE_0;; + gl_dbgE("Invalid Degree : %d", degree); + break; + } + + int ret = __gl_exif_rw_orient(file, &orientation, true); + + return ret; +} + diff --git a/common/src/ivug-file-info.c b/common/src/ivug-file-info.c new file mode 100755 index 0000000..f83b52a --- /dev/null +++ b/common/src/ivug-file-info.c @@ -0,0 +1,1046 @@ +/* + * Copyright 2012 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 "ivug-define.h" + +#include "ivug-file-info.h" +#include "ivug-debug.h" +#include "ivug-drm-common.h" +#include "ivug-util.h" + +#include //for exif +#include +#include +#include +#include +#include +#include + +#include + +#define BUF_LEN (255) + +static const char *_conver_error(int err) +{ + switch(err) + { + case METADATA_EXTRACTOR_ERROR_NONE: + return "Successful"; + case METADATA_EXTRACTOR_ERROR_INVALID_PARAMETER: + return "Invalid parameter"; + case METADATA_EXTRACTOR_ERROR_OUT_OF_MEMORY: + return "Out of memory"; + case METADATA_EXTRACTOR_ERROR_FILE_EXISTS: + return "File already exists"; + case METADATA_EXTRACTOR_ERROR_OPERATION_FAILED: + return "Operation failed"; + default: + { + static char error[128]; + sprintf(error, "Unknow Error : %d(0x%08x)", err, err); + return error; + } + } + return NULL; +} + +static bool _get_exif_string(ExifData *ed, ExifTag tag, const char *buf, int buf_len) +{ + ExifEntry *entry = NULL; + /** get exifentry*/ + entry = exif_data_get_entry(ed, tag); + if (!entry) + { + return false; + } + + /** get value of the entry*/ + if(exif_entry_get_value(entry, (char *)buf, buf_len) == NULL) + { + return false; + } + return true; +} + +static bool _get_exif_short(ExifData *ed, ExifTag tag, int *value) +{ + ExifEntry *entry = NULL; + /** get exifentry*/ + entry = exif_data_get_entry(ed, tag); + if (!entry) + { + return false; + } + + /** get value of the entry*/ + *value = exif_get_short(entry->data, exif_data_get_byte_order(entry->parent->parent)); + + return true; +} + + +bool _get_video_gps_info(const char *filepath, double *latitude, double *longitude) +{ + IV_ASSERT(filepath != NULL); + IV_ASSERT(latitude != NULL); + IV_ASSERT(longitude != NULL); + + int ret = METADATA_EXTRACTOR_ERROR_NONE; + metadata_extractor_h metadata; + + char *latitude_str; + char *longitude_str; + + *latitude = 0.0; + *longitude = 0.0; + + ret = metadata_extractor_create(&metadata); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_create [%s]", _conver_error(ret)); + return false; + } + + ret = metadata_extractor_set_path(metadata, filepath); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_set_path [%s]", _conver_error(ret)); + ret = metadata_extractor_destroy(metadata); + MSG_UTIL_HIGH("metadata_extractor_destroy [%s]", _conver_error(ret)); + return false; + } + + ret = metadata_extractor_get_metadata(metadata, METADATA_LATITUDE, &latitude_str); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_get_metadata [%s]", _conver_error(ret)); + ret = metadata_extractor_destroy(metadata); + MSG_UTIL_HIGH("metadata_extractor_destroy [%s]", _conver_error(ret)); + return false; + } + + ret = metadata_extractor_get_metadata(metadata, METADATA_LONGITUDE, &longitude_str); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_get_metadata [%s]", _conver_error(ret)); + ret = metadata_extractor_destroy(metadata); + MSG_UTIL_HIGH("metadata_extractor_destroy [%s]", _conver_error(ret)); + return false; + } + + MSG_UTIL_LOW("lat = %s, longi = %s", latitude_str, longitude_str); + *latitude = ivug_atod(latitude_str); + *longitude = ivug_atod(longitude_str); + + ret = metadata_extractor_destroy(metadata); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_destroy [%s]", _conver_error(ret)); + } + + return true; +} + +/* LATITUDE : -90 ~ +90, LONGITUDE : -180 ~ +180) */ +bool _get_gps_info_from_exifdata(ExifData *ed, double *latitude, double *longitude) +{ + IV_ASSERT(ed != NULL); + IV_ASSERT(latitude != NULL); + IV_ASSERT(longitude != NULL); + + ExifIfd ifd; + ExifTag tag; + + char buf[BUF_LEN+1] = {'\0',}; + + double multiplier = 1.0; + + ifd = EXIF_IFD_GPS; + tag = EXIF_TAG_GPS_LATITUDE_REF; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + + if(buf[0] == 'S') /* SOUTH */ + { + multiplier = -1.0; + } + + tag = EXIF_TAG_GPS_LATITUDE; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + + { + buf[strlen(buf)] = '\0'; + double tmp_arr[3] = { 0.0, 0.0, 0.0 }; + int count = 0; + char* p = strtok(buf, ", "); + /** split the buf by , */ + while(p != NULL) + { + tmp_arr[count] = ivug_atod(p); + count++; + p=strtok(NULL, ", "); + } + + if( count != 3 ) + { + MSG_UTIL_ERROR("Cannot get latitude info : %s", p); + return false; + } + *latitude = multiplier*(tmp_arr[0] + tmp_arr[1]/60 + tmp_arr[2]/3600); + } + + multiplier = 1.0; + tag = EXIF_TAG_GPS_LONGITUDE_REF; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + + if(buf[0] == 'W') /* WEST */ + { + multiplier = -1.0; + } + + tag = EXIF_TAG_GPS_LONGITUDE; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + + { + buf[strlen(buf)] = '\0'; + double tmp_arr[3] = { 0.0, 0.0, 0.0 }; + int count = 0; + char* p = strtok(buf, ", "); + /** split the buf by , */ + while(p != NULL) + { + tmp_arr[count] = ivug_atod(p); + count++; + p=strtok(NULL, ", "); + } + + if( count != 3 ) + { + MSG_UTIL_ERROR("Cannot get Longitude info : %s", p); + return false; + } + + *longitude = multiplier*(tmp_arr[0] + tmp_arr[1]/60 + tmp_arr[2]/3600); + } + + return true; +} + +bool _get_image_gps_info(const char* filepath, double *latitude, double *longitude) +{ + IV_ASSERT(filepath != NULL); + IV_ASSERT(latitude != NULL); + IV_ASSERT(longitude != NULL); + + ExifData *ed = NULL; + + /** get exifdata*/ + ed = exif_data_new_from_file(filepath); + if (!ed) + { + return false; + } + + if(_get_gps_info_from_exifdata(ed, latitude, longitude) == false) + { + exif_data_unref(ed); + return false; + } + + exif_data_unref(ed); + + return true; +} + +bool _get_orientation_from_exifdata(ExifData *ed, /*OUT*/int *orient) +{ + MSG_DETAIL_HIGH("_get_orientation_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_ORIENTATION; + + if(_get_exif_short(ed, tag, orient) == false) + { + return false; + } + + MSG_DETAIL_HIGH("orientation = %d", *orient); + /* 1 : top left + 2 : top right + 3 : bottom right + 4 : bottom left + 5 : left top + 6 : right top + 7 : right bottom + 8 : left bottom */ + return true; +} + +/* out value must be freed */ +static bool _get_maker_from_exifdata(ExifData *ed, /*OUT*/char **maker) +{ + MSG_DETAIL_HIGH("_get_maker_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + char buf[BUF_LEN+1] = {'\0',}; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_MAKE; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + MSG_DETAIL_HIGH("Maker = %s", buf); + + *maker = strdup(buf); + return true; +} + +/* out value must be freed */ +static bool _get_model_from_exifdata(ExifData *ed, /*OUT*/char **model) +{ + MSG_DETAIL_HIGH("_get_model_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + char buf[BUF_LEN+1] = {'\0',}; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_MODEL; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + MSG_DETAIL_HIGH("Model = %s", buf); + + *model = strdup(buf); + return true; +} + +bool _get_flash_from_exifdata(ExifData *ed, /*OUT*/int *status) +{ + MSG_DETAIL_HIGH("_get_flash_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_FLASH; + + if(_get_exif_short(ed, tag, status) == false) + { + return false; + } + + MSG_DETAIL_HIGH("Flash status = %d", *status); + /* LSB + 0b : Flash did not fire + 1b : Flash fired */ + return true; +} + +/* out value must be freed */ +static bool _get_focal_length_from_exifdata(ExifData *ed, /*OUT*/char **length) +{ + MSG_DETAIL_HIGH("_get_focal_length_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + char buf[BUF_LEN+1] = {'\0',}; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_FOCAL_LENGTH; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + MSG_DETAIL_HIGH("Focal length = %s", buf); + + *length = strdup(buf); + return true; +} + +bool _get_white_balance_from_exifdata(ExifData *ed, int *white_balance) +{ + MSG_DETAIL_HIGH("_get_white_balance_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_WHITE_BALANCE; + + if(_get_exif_short(ed, tag, white_balance) == false) + { + return false; + } + + MSG_DETAIL_HIGH("White balance = %d", *white_balance); + /* 0 : auto white balance + 1 : menual white balance */ + return true; +} + +bool _get_aperture_from_exifdata(ExifData *ed, /*OUT*/char **aperture) +{ + MSG_DETAIL_HIGH("_get_aperture_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + char buf[BUF_LEN+1] = {'\0',}; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_APERTURE_VALUE; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + MSG_DETAIL_HIGH("Aperture = %s", buf); + + *aperture = strdup(buf); + return true; +} + +bool _get_exposure_time_from_exifdata(ExifData *ed, /*OUT*/char **exposure) +{ + MSG_DETAIL_HIGH("_get_exposure_time_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + char buf[BUF_LEN+1] = {'\0',}; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_EXPOSURE_TIME; + + if(_get_exif_string(ed, tag, buf, BUF_LEN) == false) + { + return false; + } + MSG_DETAIL_HIGH("Exposure time = %s", buf); + + *exposure = strdup(buf); + return true; +} + +bool _get_iso_from_exifdata(ExifData *ed, /*OUT*/int *iso) +{ + MSG_DETAIL_HIGH("_get_iso_from_exifdata"); + ExifIfd ifd; + ExifTag tag; + + ifd = EXIF_IFD_EXIF; + tag = EXIF_TAG_ISO_SPEED_RATINGS; + + if(_get_exif_short(ed, tag, iso) == false) + { + return false; + } + MSG_DETAIL_HIGH("ISO = %d", *iso); + + return true; +} + + +static bool _get_image_resolution(const char *path, int * /* OUT */ pWidth, int * /* OUT */pHeight) +{ + IV_ASSERT(path != NULL); + + int width = 0; + int height = 0; + + Evas *canvas; + Ecore_Evas *ee; + + ee = ecore_evas_buffer_new(1, 1); + if (!ee) + { + MSG_DETAIL_ERROR("Cannot get EVAS"); + return false; + } + + canvas = ecore_evas_get(ee); + + Evas_Object *img = evas_object_image_add(canvas); + + evas_object_image_file_set(img, NULL, NULL); + evas_object_image_load_scale_down_set(img, 0); + + evas_object_image_file_set(img, path, NULL); + Evas_Load_Error error = evas_object_image_load_error_get(img); + if ( error != EVAS_LOAD_ERROR_NONE) + { + MSG_DETAIL_ERROR("Decoding Error(%d) : %s", error, path); + evas_object_del(img); + ecore_evas_free(ee); + return false; + } + + evas_object_image_size_get(img, &width, &height); + + evas_object_image_file_set(img, NULL, NULL); + evas_object_del(img); + + ecore_evas_free(ee); + + *pWidth = width; + *pHeight = height; + + MSG_DETAIL_HIGH("widht & height is [%d, %d]", width, height); + + return true; +} + +static bool +_get_video_resolution(const char *path, int * /* OUT */ pWidth, int * /* OUT */pHeight) +{ + IV_ASSERT(path != NULL); + + int ret = METADATA_EXTRACTOR_ERROR_NONE; + metadata_extractor_h metadata; + + char *width_str; + char *height_str; + + ret = metadata_extractor_create(&metadata); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_create [%s]", _conver_error(ret)); + return false; + } + + ret = metadata_extractor_set_path(metadata, path); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_set_path [%s]", _conver_error(ret)); + ret = metadata_extractor_destroy(metadata); + MSG_UTIL_HIGH("metadata_extractor_destroy [%s]", _conver_error(ret)); + return false; + } + + ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_WIDTH, &width_str); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_get_metadata [%s]", _conver_error(ret)); + ret = metadata_extractor_destroy(metadata); + MSG_UTIL_HIGH("metadata_extractor_destroy [%s]", _conver_error(ret)); + return false; + } + + ret = metadata_extractor_get_metadata(metadata, METADATA_VIDEO_HEIGHT, &height_str); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_get_metadata [%s]", _conver_error(ret)); + ret = metadata_extractor_destroy(metadata); + MSG_UTIL_HIGH("metadata_extractor_destroy [%s]", _conver_error(ret)); + return false; + } + + MSG_UTIL_LOW("w = %s, h = %s", width_str, height_str); + *pWidth = ivug_atoi(width_str); + *pHeight = ivug_atoi(height_str); + + ret = metadata_extractor_destroy(metadata); + if(ret != METADATA_EXTRACTOR_ERROR_NONE) + { + MSG_UTIL_ERROR("Fail metadata_extractor_destroy [%s]", _conver_error(ret)); + } + + return true; +} + + + +static char* +_get_drm_get_extension(const char* path) +{ +#define EXT_SIZE 128 +#define EXT_SPLITTER '.' + + IV_ASSERT(path != NULL ); + + char *mime_type = ivug_drm_get_mime(path); + MSG_IVUG_HIGH("mime_type: %s", mime_type); + + char **ext = NULL; + int length = -1; + int ret = -1; + char *result_ext = NULL; + + ret = mime_type_get_file_extension(mime_type, &ext, &length); + free(mime_type); + + if(ret != MIME_TYPE_ERROR_NONE) + { + MSG_IVUG_ERROR("mime_type_get_file_extension failed: %d", ret); + return NULL; + } + if(length <= 0) + { + MSG_IVUG_ERROR("mime_type_get_file_extension length is invalid: %d", length); + if(ext) + free(ext); + return NULL; + } + + int i; + for(i=0; i // gettid() +#include + +#include +#include + +#undef UNIT_TEST + +#ifdef UNIT_TEST +/* + Build gcc fmradio_message.c `pkg-config --cflags --libs eina dlog ecore ecore-input` +*/ +#include + +#include +#include + +#undef LOG_TAG +#define LOG_TAG "UTT_MESSAGE" + +#define MSG_ASSERT(expr) do { if( !(expr) ) { LOG(LOG_INFO, LOG_TAG, "[%s] ASSERT : " #expr, __func__ ); assert(0); } }while(0) + +#define MSG_FATAL(...) do { LOG(LOG_INFO, LOG_TAG, ##__VA_ARGS__); assert(0); } while(0) +#define MSG_WARN(...) LOG(LOG_INFO, LOG_TAG, ##__VA_ARGS__) +#define MSG_ERROR(...) LOG(LOG_INFO, LOG_TAG, ##__VA_ARGS__) +#define MSG_HIGH(...) LOG(LOG_INFO, LOG_TAG, ##__VA_ARGS__) +#define MSG_MED(...) LOG(LOG_INFO, LOG_TAG, ##__VA_ARGS__) +#else + +#include "ivug-debug.h" + +#define LOG_LVL DBG_MSG_LVL_HIGH +#define LOG_CAT "IV-MESSAGE" + +#endif + +#define MAX_COMMAND_LENGTH (30) // Max length of each command + +typedef struct { + int param1; + int param2; + int param3; + void *param4; + + char command[MAX_COMMAND_LENGTH]; +} MyData; + +typedef struct { + FnMessage callback; + void *client_data; + + bool delete_me; +} RegisteredCallback; + +typedef struct { + EINA_INLIST; + + char command[MAX_COMMAND_LENGTH]; + Eina_List/**/ *cblist; +} CommandList; + +typedef struct { + Ecore_Pipe *pipe; + + Eina_Inlist *command_list; + int registered_count; + + pthread_mutex_t pipe_mutex; + +} _MessageHandle, *_PMessageHandle; + +#define PRINT_ERRNO(errno, fmt, arg...) \ + do { \ + char szError[256]; \ + int perr; \ + perr = strerror_r(errno, szError, sizeof(szError)); \ + \ + if ( perr ) { \ + MSG_ERROR(fmt " %s", ##arg, szError); \ + } \ + else { \ + MSG_ERROR(fmt " Errno=%d", ##arg, errno); \ + } \ + } while(0) + + +RegisteredCallback *_find_callback(Eina_List *cb_list, FnMessage cb) +{ + Eina_List *l; + RegisteredCallback *pCallback; + + EINA_LIST_FOREACH(cb_list,l, pCallback) + { + if (( pCallback->callback == cb)) + { + return pCallback; + } + } + +// Not found!. + return NULL; +} + + +CommandList *_find_command(Eina_Inlist *command_list, const char *command) +{ + CommandList *l; + + EINA_INLIST_FOREACH(command_list, l) + { + if ( strncmp(l->command, command, MAX_COMMAND_LENGTH ) == 0 ) + { + return l; + } + } + + return NULL; +} + + +static void _cleanup(_PMessageHandle pmessage) +{ + CommandList *pData = NULL; + Eina_Inlist *l2; + + EINA_INLIST_FOREACH_SAFE(pmessage->command_list, l2, pData) + { + RegisteredCallback *pCallback = NULL; + Eina_List *l, *l_next; + + EINA_LIST_FOREACH_SAFE(pData->cblist, l, l_next, pCallback) + { + if ( pCallback->delete_me == true ) + { + pData->cblist = eina_list_remove_list(pData->cblist, l); + pCallback->delete_me = false; + free(pCallback); + pmessage->registered_count--; + } + } + + if ( eina_list_count(pData->cblist) == 0 ) + { + pmessage->command_list = eina_inlist_remove(pmessage->command_list, EINA_INLIST_GET(pData)); + + MSG_HIGH("Remve cmd slot for %s", pData->command); + free(pData); + pData = NULL; + } + } + +} + + +void pipe_cb(void *data, void *buffer, unsigned int nbyte) +{ + _PMessageHandle pmessage = (_PMessageHandle)data; + MyData *mydata = buffer; + + if ( nbyte != sizeof(MyData) ) + { + MSG_ERROR("Invalid command!!. pipe=0x%08x nByte=%d", pmessage->pipe, nbyte); + return ; + } + + MSG_MED("Read from pipe. Pipe=0x%08x nByte=%d Cmd=%s Param1=%d", pmessage->pipe, nbyte , mydata->command, mydata->param1 ); + +// dump_message(pmessage); + + CommandList *pData; + + pData = _find_command(pmessage->command_list, mydata->command); + +// Clean up deleted callback + if ( pData != NULL ) // Add new command + { + RegisteredCallback *pCallback = NULL; + Eina_List *l; + + EINA_LIST_FOREACH(pData->cblist, l, pCallback) + { + if ( pCallback->delete_me == false ) + { + pCallback->callback(mydata->param1, mydata->param2, mydata->param3, mydata->param4, pCallback->client_data); // Call user function + } + } + + _cleanup(pmessage); + return; + } + + MSG_ERROR("Unknown command. pipe=0x%08x nByte=%d [%s:%d]", pmessage->pipe, nbyte, mydata->command, mydata->param1); +} + + +MessageHandle create_message_handle() +{ + _PMessageHandle pmessage = (_PMessageHandle) malloc( sizeof(_MessageHandle) ); + + if ( pmessage == NULL ) + { + MSG_FATAL("Cannot allocate memory. Size=%d", sizeof(_MessageHandle)); + return NULL; + } + + memset(pmessage, 0x00, sizeof(_MessageHandle) ); + + if ( pthread_mutex_init(&pmessage->pipe_mutex, NULL) != 0 ) // if falied, + { + PRINT_ERRNO(errno, "Mutex init error" ); + + free(pmessage); + return NULL; + } + + pmessage->pipe = ecore_pipe_add(pipe_cb, pmessage); + + if (pmessage->pipe == NULL ) + { + MSG_ERROR("Failed to creating ecore pipe"); + if ( pthread_mutex_destroy(&pmessage->pipe_mutex) != 0 ) + { + PRINT_ERRNO(errno, "Mutex destroy error" ); + // Go through + } + + free(pmessage); + return NULL; + } + + return (MessageHandle)pmessage; +} + +bool remove_message_handle(MessageHandle handle) +{ + _PMessageHandle pmessage = (_PMessageHandle)handle; + + // this function can be called in signal handler. so assert() cannot be used in this function + if (pmessage == NULL ) + { + MSG_WARN("Message handle is NULL"); + return true; + } + + MSG_HIGH("Remove message handle. Handle=0x%08x", handle); + if (pmessage->pipe != NULL ) + { + ecore_pipe_del(pmessage->pipe); + pmessage->pipe = NULL; + } + + if ( pthread_mutex_destroy(&pmessage->pipe_mutex) != 0 ) + { + PRINT_ERRNO(errno, "Mutex destroy error" ); + + // Go through + } + + CommandList *pData; + + EINA_INLIST_FOREACH(pmessage->command_list, pData) + { + RegisteredCallback *pCallback = NULL; + EINA_LIST_FREE(pData->cblist, pCallback) + { + free(pCallback); + pmessage->registered_count--; + } + } + + while (pmessage->command_list) + { + Eina_Inlist *aux = pmessage->command_list; + pmessage->command_list = eina_inlist_remove(pmessage->command_list, pmessage->command_list); + free(aux); + } + + MSG_HIGH("Registered Count=%d", pmessage->registered_count); + + free(pmessage); + + return true; +} + +bool send_message(MessageHandle handle, const char *command, int param1, int param2, int param3, void *param4) +{ + _PMessageHandle pmessage = (_PMessageHandle)handle; + + if ( pthread_mutex_lock(&pmessage->pipe_mutex) != 0 ) + { + PRINT_ERRNO(errno, "Mutex lock error" ); + + return false; + } + + MyData data = {0,}; + + data.param1 = param1; + data.param2 = param2; + data.param3 = param3; + data.param4 = param4; + + strncpy(data.command, command, MAX_COMMAND_LENGTH-1); + + MSG_MED("Write to pipe. tID=0x%08x Pipe=0x%08x Cmd=%s Param1=%d", pthread_self(), pmessage->pipe, data.command, data.param1); + + MSG_ASSERT(pmessage->pipe != NULL); + + if ( ecore_pipe_write(pmessage->pipe, &data, sizeof(MyData)) == EINA_FALSE) + { + MSG_ERROR("Writing to pipe is failed. pipe=0x%08x size=%d", pmessage->pipe, sizeof(MyData)); + + if ( pthread_mutex_unlock(&pmessage->pipe_mutex) != 0 ) + { + PRINT_ERRNO(errno, "Mutex unlock error" ); + + // Go through + } + + return false; + } + + if ( pthread_mutex_unlock(&pmessage->pipe_mutex) != 0 ) + { + PRINT_ERRNO(errno, "Mutex unlock error" ); + + // Go through + } + + return true; +} + +bool register_message(MessageHandle handle, const char *command, FnMessage cb, void *data) +{ + + MSG_ASSERT(handle != NULL); + MSG_ASSERT(command != NULL); + MSG_ASSERT(cb != NULL); + + _PMessageHandle pmessage = (_PMessageHandle)handle; + + CommandList *pData; + + pData = _find_command(pmessage->command_list, command); + + if ( pData == NULL ) // Add new command + { + pData = (CommandList *)calloc(1, sizeof(CommandList)); + + strncpy(pData->command, command, MAX_COMMAND_LENGTH - 1); + + pmessage->command_list = eina_inlist_append(pmessage->command_list, EINA_INLIST_GET(pData)); + + MSG_MED("Add new cmd slot for %s", command); + } + +// Find callback list. + RegisteredCallback *pCallback; + + pCallback = _find_callback(pData->cblist, cb); + + if ( pCallback == NULL ) + { + pCallback = (RegisteredCallback *)calloc(1, sizeof(RegisteredCallback)); + + pCallback->callback = cb; + pCallback->client_data = data; + pCallback->delete_me = false; + + pData->cblist = eina_list_append(pData->cblist, pCallback); + } + else + { + pCallback->delete_me = false; // Reuse slot. + + if ( pCallback->client_data != data ) + { + MSG_WARN("Already registered. CB is different. Old=0x%08x New=0x%08x", pCallback->client_data,data ); + pCallback->client_data = data; // Overwirte callback data. + + return true; + } + + MSG_ERROR("Already registered."); + return false; + } + + pmessage->registered_count++; + + MSG_MED("Registered command : %s cb=0x%08x", command, cb); + + return true; +} + +bool unregister_message(MessageHandle handle, const char *command, FnMessage cb) +{ + MSG_ASSERT(handle != NULL); + MSG_ASSERT(command != NULL); + + _PMessageHandle pmessage = (_PMessageHandle)handle; + + CommandList *pData; + + pData = _find_command(pmessage->command_list, command); + + if ( pData == NULL ) + { + MSG_ERROR("Unknown command : %s cb=0x%08x", command, cb); + return false; + } + + RegisteredCallback *pCallback; + + pCallback = _find_callback(pData->cblist, cb); + + if ( pCallback != NULL ) + { + pCallback->callback = (FnMessage)0xDEADDEAD; + pCallback->client_data = (void *)0xDEADBEAF; + pCallback->delete_me = true; + + return true; + } + + MSG_ERROR("Unknown command : %s cb=0x%08x", command, cb); + + return false; +} + + +void dump_message(MessageHandle handle) +{ + _PMessageHandle pmessage = (_PMessageHandle)handle; + CommandList *pData; + + MSG_HIGH("*****************************"); + MSG_HIGH(" Total : %d CommandList=0x%08x", pmessage->registered_count, pmessage->command_list); + + EINA_INLIST_FOREACH(pmessage->command_list, pData) + { + MSG_HIGH(" Command : \"%s\" 0x%08x", pData->command, pData ); + + RegisteredCallback *pCallback = NULL; + Eina_List *l; + + EINA_LIST_FOREACH(pData->cblist, l, pCallback) + { + MSG_HIGH(" Callback=0x%08x, Data=0x%08x", pCallback->callback, pCallback->client_data); + + } + } + + MSG_HIGH("*****************************"); + +} + + +#ifdef UNIT_TEST + +void mycmd1(int param1, int param2, int param3, void *param4, void *client_data) +{ + printf("Received MyCmd1\n"); + + printf("param1 = %s, param2 = %s, param3 = %s, param4 = %s\n", + (char *)param1, (char *)param2, (char *)param3, (char *)param4); +} + +void mycmd2(int param1, int param2, int param3, void *param4, void *client_data) +{ + printf("Received MyCmd2\n"); +} + +void mycmd3(int param1, int param2, int param3, void *param4, void *client_data) +{ + printf("Received MyCmd3\n"); +} + + +Eina_Bool on_timer1(void *data) +{ + MessageHandle hMessage = data; + + send_message(hMessage, "mycmd1", (int)"My", (int)"Name", (int)"Is", NULL); + + //send_message(hMessage, "mycmd2", 0, 0, 0, NULL); +} + +static Eina_Bool _keydown_event(void *data, int type, void *event) +{ + Ecore_Event_Key *ev = event; + + printf("Key event : %s", ev->keyname); + + return true; +} + +int main(void) +{ + ecore_init(); + ecore_event_init(); + eina_init(); + + MessageHandle hMessage = create_message_handle(); + + register_message(hMessage, "mycmd1", mycmd1, NULL); + register_message(hMessage, "mycmd2", mycmd2, NULL); + register_message(hMessage, "mycmd3", mycmd3, NULL); + + dump_message(hMessage); + + unregister_message(hMessage, "mycmd3", mycmd3); + + dump_message(hMessage); + + ecore_timer_add(0.5, on_timer1, hMessage); + + ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _keydown_event, NULL); + + ecore_main_loop_begin(); + + remove_message_handle(hMessage); + + ecore_event_shutdown(); + ecore_shutdown(); + eina_shutdown(); + + return 0; +} + +#endif + diff --git a/common/src/ivug-mouse-event.c b/common/src/ivug-mouse-event.c new file mode 100755 index 0000000..94c2172 --- /dev/null +++ b/common/src/ivug-mouse-event.c @@ -0,0 +1,610 @@ +/* + * Copyright 2012 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 "ivug-debug.h" +#include "ivug-mouse-event.h" + + +// Click condition. +// Down Up duration under 300ms & Down pos, Up pos under 3 pixel + + +// Long pressed condition +// Down Up duration upper 1s & Down pos, Up pos under 5 pixel + +typedef enum { + MOUSE_DOWN_UNKNWON, + MOUSE_DOWN_NONE, + MOUSE_DOWN_1, + MOUSE_DOWN_2, + MOUSE_DOWN_3, + MOUSE_DOWN_4, // Invalid state. +} MouseState; + + + +#define INVALID_DEVICE_ID (-1) +#define MULTI_INDEX (9) +#define NUM_MAX_BUTTON (3) + +typedef struct _mouse_data_t{ + void *pClientData; + Evas_Object *obj; + + mouse_callback_t cb; + + MouseState m_state; + + bool bDown[NUM_MAX_BUTTON]; // For Mose down check before mouse move + bool bHold[NUM_MAX_BUTTON]; + + MouseEvent event[NUM_MAX_BUTTON]; + MouseEvent down[NUM_MAX_BUTTON]; + MouseEvent prve_up[NUM_MAX_BUTTON]; + + unsigned int prev_dist; + + int multi_min_idx; // multi min index is different in each target. Temp solution + + bool bSendPinchStart; + + MouseEvent center; + int pinch_dist; +// For debugging purpose, later will be removed. + char alias[100]; // +} mouse_data_t; + + +#ifndef __UNUSED__ +#define __UNUSED__ __attribute__((unused)) +#endif + +static unsigned int _get_distance(int prevX, int prevY, int X, int Y) +{ +#include + int dx = prevX - X; + int dy = prevY - Y; + + return sqrt(dx*dx + dy*dy); +} + +static void _on_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + if ( data == NULL ) + { + MSG_MOUSE_ERROR("Debug me!!!!"); + return; + } + + mouse_data_t *pData = (mouse_data_t *)data; + MouseEvent *ev = event_info; + + if ( ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) + { + MSG_MOUSE_HIGH("[%s] %s On Hold. Dev=%d", pData->alias, __func__, ev->device); + } + + int pressed = ev->device; + + if(pressed >= NUM_MAX_BUTTON) + { + MSG_MOUSE_FATAL("Invalid Pressed(%d)", pressed); + return; + } + + if ( pData->m_state == MOUSE_DOWN_UNKNWON ) + { + MSG_MOUSE_ERROR("[%s] Something wrong", pData->alias); + } + + if ( pData->bDown[pressed] == true ) + { + MSG_MOUSE_WARN("Mouse down is detected. but already pressed button. ignore"); + return; + } + + pData->m_state++; + pData->bDown[pressed] = true; + + if ( pData->m_state == MOUSE_DOWN_1 ) + { + MSG_MOUSE_HIGH("[%s] Callback Mouse Down : Dev=%d (%d,%d)", pData->alias, ev->device, ev->x, ev->y); + + if ( pData->cb.onMouseDown ) + { + (pData->cb.onMouseDown)(pData->obj, ev, pData->pClientData); + } + + MSG_MOUSE_MED("Func:%s Device=%d XY(%d,%d)", "_on_mouse_down", pressed, ev->x , ev->y ); + } + else if ( pData->m_state == MOUSE_DOWN_2 ) + { + MouseEvent *other = NULL; + + if ( pData->bDown[ (pressed + 1) % NUM_MAX_BUTTON] == true ) + { + other = &pData->event[(pressed + 1) % NUM_MAX_BUTTON]; + } + + if ( pData->bDown[(pressed + 2) % NUM_MAX_BUTTON] == true ) + { + if ( other != NULL ) + { + MSG_MOUSE_ERROR("Error!!!"); + } + other = &pData->event[(pressed + 2) % NUM_MAX_BUTTON]; + } + + if ( other == NULL ) + { + MSG_MOUSE_ERROR("[%s] Error! Pressed(%d,%d,%d)", pData->alias, + pData->bDown[0], + pData->bDown[1], + pData->bDown[2]); + + return ; // Fix for B/S + } + + int centerX = ( other->x + ev->x ) / 2; + int centerY = ( other->y + ev->y ) / 2; + + int dist = _get_distance(other->x, other->y, ev->x, ev->y); + + MSG_MOUSE_HIGH("[%s] Callback PinchStart : Dev=%d OtherDev=%d Center(%d,%d) Dist=%d", pData->alias, ev->device, other->device, centerX, centerY, dist); + + if ( pData->cb.onPinchStart ) + { + pData->center.x = centerX; + pData->center.y = centerY; + pData->center.timestamp = ev->timestamp; + pData->pinch_dist = dist; + + (pData->cb.onPinchStart)(pData->obj, &pData->center, dist, pData->pClientData); + } + + pData->prev_dist = dist; + + MSG_MOUSE_HIGH("[%s] Two fingure is clicked. Distance=%d", pData->alias, pData->prev_dist); + } + else + { + MSG_MOUSE_WARN("[%s] Ignore third finger! State=%d Dev=%d bPressed(%d,%d,%d)", pData->alias, pData->m_state, ev->device, + pData->bDown[0], + pData->bDown[1], + pData->bDown[2]); + + return ; + } + + pData->event[pressed] = *ev; + pData->down[pressed] = *ev; + + return ; +} + + +static void _on_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + + if ( data == NULL ) + { + MSG_MOUSE_ERROR("Debug me!!!!"); + return; + } + + mouse_data_t *pData = (mouse_data_t *)data; + MouseEvent *ev = event_info; + + int pressed = ev->device; + + if(pressed >= NUM_MAX_BUTTON) + { + MSG_MOUSE_FATAL("Invalid Pressed(%d)", pressed); + return; + } + + if ( pData->m_state == MOUSE_DOWN_UNKNWON ) + { + MSG_MOUSE_ERROR("[%s] Something wrong. Dev=%d", pData->alias, ev->device); + MSG_MOUSE_ERROR("[%s] Error! State=%d Dev=%d bPressed(%d,%d,%d)", pData->alias, pData->m_state, ev->device, + pData->bDown[0], + pData->bDown[1], + pData->bDown[2]); + + } + + if ( pData->m_state == MOUSE_DOWN_NONE ) + { + MSG_MOUSE_WARN("[%s] Mouse up is detected. but state is NONE.", pData->alias); + pData->bDown[0] = pData->bDown[1] = pData->bDown[2] = 0; + return; + } + + pData->m_state--; + + if ( pData->bDown[pressed] == false ) + { + MSG_MOUSE_ERROR("[%s] Something wrong", pData->alias); + MSG_MOUSE_ERROR("[%s] Error! State=%d Dev=%d bPressed(%d,%d,%d)", pData->alias, pData->m_state, ev->device, + pData->bDown[0], + pData->bDown[1], + pData->bDown[2]); + } + + if ( ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) + { + MSG_MOUSE_HIGH("[%s] %s On Hold. Dev=%d", pData->alias, __func__, ev->device); + pData->bHold[pressed] = true; + } + + pData->bDown[pressed] = false; + + if ( pData->m_state == MOUSE_DOWN_1 ) + { + MSG_MOUSE_HIGH("[%s] Callback Pinch End", pData->alias); + + if ( pData->cb.onPinchEnd ) + { + pData->bSendPinchStart = false; + (pData->cb.onPinchEnd)(pData->obj, ev, pData->pClientData); + } + } + else if ( pData->m_state == MOUSE_DOWN_NONE ) + { + MSG_MOUSE_HIGH("[%s] Callback Mouse Up : Dev=%d (%d,%d)", pData->alias, ev->device, ev->x, ev->y); + + if ( ev->button_flags & EVAS_BUTTON_DOUBLE_CLICK) + { + if ( pData->cb.onMouseDlbClick ) + { + (pData->cb.onMouseDlbClick)(pData->obj, ev, pData->pClientData); + } + MSG_MOUSE_HIGH("[%s] %s Double click detected. Dev=%d (%d,%d)", pData->alias, __func__, ev->device, ev->x, ev->y); + } + if ( pData->cb.onMouseUp ) + { + (pData->cb.onMouseUp)(pData->obj, ev, pData->pClientData); + } + + pData->prve_up[pressed] = *ev; + + MSG_MOUSE_MED("Func:%s State=%d Device=%d XY(%d,%d)", "_on_mouse_up", pData->m_state, pressed, ev->x , ev->y); + } + + return ; + +} + +static void _on_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + if ( data == NULL ) + { + MSG_MOUSE_ERROR("Debug me!!!!"); + return; + } + + mouse_data_t *pData = (mouse_data_t *)data; + MouseEvent *ev = event_info; + + int pressed = ev->device; + + if ( ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) + { + MSG_MOUSE_HIGH("[%s] %s On Hold. Dev=%d", pData->alias, __func__, ev->device); + } + + if(pressed >= NUM_MAX_BUTTON) + { + MSG_MOUSE_FATAL("Invalid Pressed(%d)", pressed); + return; + } + + if ( pData->bDown[pressed] == false) + { + // Move event prior down should be ignored + MSG_MOUSE_MED("Ignore move event before click"); + return ; + } + + switch ( pData->m_state ) + { + case MOUSE_DOWN_3: + // Ignore Mouse Event when all 3 buttons is pressed. + return ; + case MOUSE_DOWN_2: + { + MouseEvent *other = NULL; + + if ( pData->bDown[ (pressed + 1) % NUM_MAX_BUTTON] == true ) + { + other = &pData->event[(pressed + 1) % NUM_MAX_BUTTON]; + } + + if ( pData->bDown[(pressed + 2) % NUM_MAX_BUTTON] == true ) + { + if ( other != NULL ) + { + MSG_MOUSE_ERROR("Debug me!!!"); + } + other = &pData->event[(pressed + 2) % NUM_MAX_BUTTON]; + } + + if ( other == NULL ) + { + MSG_MOUSE_ERROR("[%s] Error! Pressed(%d,%d,%d)", pData->alias, + pData->bDown[0], + pData->bDown[1], + pData->bDown[2]); + + return; + } + + int centerX = ( other->x + ev->x ) / 2; + int centerY = ( other->y + ev->y ) / 2; + + int dist = _get_distance(other->x, other->y, ev->x, ev->y); + + if ( pData->cb.onPinchMove ) + { + MSG_MOUSE_MED("Callback Pinch : (%d,%d) dDistance=%d", centerX, centerY, dist - pData->prev_dist); + + pData->center.x = centerX; + pData->center.y = centerY; + pData->center.timestamp = ev->timestamp; + pData->pinch_dist = dist; + + (pData->cb.onPinchMove)(pData->obj, &pData->center, pData->pinch_dist , pData->pClientData); + } + + pData->prev_dist = dist; + + MSG_MOUSE_LOW("Pinch zoom. Pos1(%d,%d) Pos2(%d,%d) Delta=%d", other->x, other->y, ev->x, ev->y, pData->prev_dist); + + pData->event[pressed] = *ev; + + return ; + } + break; + case MOUSE_DOWN_1: + { + MSG_MOUSE_MED("Func:%s. Device=%d Old(%d,%d) Cur(%d,%d)", __FUNCTION__, pressed, + pData->event[pressed].x, pData->event[pressed].y, + ev->x , ev->y); + + if ( pData->cb.onMouseMove ) + { + MSG_MOUSE_MED("[%s] Callback Mouse Move : (%d,%d)", pData->alias, ev->x, ev->y); + (pData->cb.onMouseMove)(pData->obj, &pData->event[pressed], ev, pData->pClientData); + } + + pData->event[pressed] = *ev; + + break; + } + default: + MSG_MOUSE_ERROR("[%s] Something wrong. state=%d", pData->alias, pData->m_state); + break; + + } + + return ; +} + + + +static void _proxy_on_mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev = event_info; + + MouseEvent event; + + event.device = 0; + event.timestamp = ev->timestamp; + event.x = ev->canvas.x; + event.y = ev->canvas.y; + event.button_flags = ev->flags; + event.event_flags = ev->event_flags; + + MSG_MOUSE_MED("%s Dev=%d Button=%d Flags=%d Event=%d", __func__, (int)ev->dev, ev->button, ev->flags, ev->event_flags); + + _on_mouse_down(data, NULL, obj, (void *)&event); +} + +static void _proxy_on_mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Up *ev = event_info; + + MouseEvent event; + + event.device = 0; + event.timestamp = ev->timestamp; + event.x = ev->canvas.x; + event.y = ev->canvas.y; + event.button_flags = ev->flags; + event.event_flags = ev->event_flags; + + + MSG_MOUSE_MED("%s Dev=%d Button=%d Flags=%d Event=%d", __func__, (int)ev->dev, ev->button, ev->flags, ev->event_flags); + + + _on_mouse_up(data, NULL, obj, (void *)&event); +} + +static void _proxy_on_mouse_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Move *ev = event_info; + + MouseEvent event; + + event.device = 0; + event.timestamp = ev->timestamp; + event.x = ev->cur.canvas.x; + event.y = ev->cur.canvas.y; + event.button_flags = 0; + event.event_flags = ev->event_flags; + + MSG_MOUSE_MED("%s Dev=%d Button=%d Event=%d Prev(%d,%d) Cur(%d,%d)", __func__, (int)ev->dev, ev->buttons, ev->event_flags, + ev->prev.canvas.x, ev->prev.canvas.y, ev->cur.canvas.x, ev->cur.canvas.y); + + _on_mouse_move(data, NULL, obj, (void *)&event); + +} + +static void _proxy_on_mouse_multi_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + Evas_Event_Multi_Down *ev = event_info; + mouse_data_t *pData = data; + + MouseEvent event; + + if ( pData->multi_min_idx == INVALID_DEVICE_ID) + { + MSG_MOUSE_HIGH("[%s] Min Device Index=%d", pData->alias, ev->device); + pData->multi_min_idx = ev->device -1; // Index start from 0. so -1 is needed + } + + event.device = ev->device - pData->multi_min_idx; // ev->device is 10(for second), 11(3rd), 12(4th) finger + event.timestamp = ev->timestamp; + event.x = ev->canvas.x; + event.y = ev->canvas.y; + event.button_flags = 0; + event.event_flags = ev->event_flags; + + + if(event.device >= NUM_MAX_BUTTON) + { + MSG_MOUSE_FATAL("[%s] Invalid Device. Dev=%d Min=%d", pData->alias, event.device, pData->multi_min_idx); + return; + } + + MSG_MOUSE_MED("%s Dev=%d", __func__, ev->device); + + _on_mouse_down(data, NULL, obj, (void *)&event); +} + +static void _proxy_on_mouse_multi_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + Evas_Event_Multi_Up *ev = event_info; + mouse_data_t *pData = data; + + MouseEvent event; + + if ( pData->multi_min_idx == INVALID_DEVICE_ID) + { + // Sometimes Multi up came ealry + MSG_MOUSE_HIGH("[%s] Min Device Index=%d", pData->alias, ev->device); + pData->multi_min_idx = ev->device -1; // Index start from 0. so -1 is needed + } + + event.device = ev->device - pData->multi_min_idx; + event.timestamp = ev->timestamp; + event.x = ev->canvas.x; + event.y = ev->canvas.y; + event.button_flags = 0; + event.event_flags = ev->event_flags; + + if(event.device >= NUM_MAX_BUTTON) + { + MSG_MOUSE_FATAL("[%s] Invalid Device. Dev=%d Min=%d", pData->alias, event.device, pData->multi_min_idx); + return; + } + + MSG_MOUSE_MED("%s Dev=%d", __func__, ev->device); + + _on_mouse_up(data, NULL, obj, (void *)&event); + +} + +static void _proxy_on_mouse_multi_move(void *data, Evas *evas __UNUSED__, Evas_Object *obj, void *event_info) +{ + Evas_Event_Multi_Move *ev = event_info; + mouse_data_t *pData = data; + + MouseEvent event; + + if ( pData->multi_min_idx == INVALID_DEVICE_ID) + { + // Mouse Move come faster than Mouse down + MSG_MOUSE_HIGH("[%s] Min Device Index=%d", pData->alias, ev->device); + pData->multi_min_idx = ev->device -1; + } + + event.device = ev->device - pData->multi_min_idx; + event.timestamp = ev->timestamp; + event.x = ev->cur.canvas.x; + event.y = ev->cur.canvas.y; + event.button_flags = 0; + event.event_flags = ev->event_flags; + + if(event.device >= NUM_MAX_BUTTON) + { + MSG_MOUSE_FATAL("[%s] Invalid Device. Dev=%d Min=%d", pData->alias, event.device, pData->multi_min_idx); + return; + } + + MSG_MOUSE_MED("%s Dev=%d", __func__, ev->device); + + _on_mouse_move(data, NULL, obj, (void *)&event); +} + +Ivug_Event_Handle +ivug_mouse_event_add(Evas_Object *obj, mouse_callback_t *pCallback, void *client_data, const char *alias) +{ + mouse_data_t *pData = NULL; + + pData = calloc(1, sizeof(mouse_data_t)); + + pData->obj = obj; + pData->pClientData = client_data; + pData->m_state = MOUSE_DOWN_NONE; + pData->multi_min_idx = INVALID_DEVICE_ID; + strncpy(pData->alias, alias, sizeof(pData->alias) -1); + + memcpy(&pData->cb, pCallback, sizeof(mouse_callback_t)); + + evas_object_event_callback_add(pData->obj, EVAS_CALLBACK_MOUSE_DOWN, _proxy_on_mouse_down, pData); + evas_object_event_callback_add(pData->obj, EVAS_CALLBACK_MOUSE_UP, _proxy_on_mouse_up, pData); + evas_object_event_callback_add(pData->obj, EVAS_CALLBACK_MOUSE_MOVE, _proxy_on_mouse_move, pData); + evas_object_event_callback_add(pData->obj, EVAS_CALLBACK_MULTI_DOWN, _proxy_on_mouse_multi_down, pData); + evas_object_event_callback_add(pData->obj, EVAS_CALLBACK_MULTI_UP, _proxy_on_mouse_multi_up, pData); + evas_object_event_callback_add(pData->obj, EVAS_CALLBACK_MULTI_MOVE, _proxy_on_mouse_multi_move, pData); + + MSG_MOUSE_HIGH("Mouse Event Handler Add : Alias(%s) 0x%08x for Object(0x%08x)", alias, pData, obj); + + return (Ivug_Event_Handle *)pData; +} + + +void ivug_mouse_event_del(Ivug_Event_Handle handle) +{ + mouse_data_t *pData = handle; + + evas_object_event_callback_del(pData->obj, EVAS_CALLBACK_MOUSE_DOWN, _proxy_on_mouse_down); + evas_object_event_callback_del(pData->obj, EVAS_CALLBACK_MOUSE_UP, _proxy_on_mouse_up); + evas_object_event_callback_del(pData->obj, EVAS_CALLBACK_MOUSE_MOVE, _proxy_on_mouse_move); + evas_object_event_callback_del(pData->obj, EVAS_CALLBACK_MULTI_DOWN, _proxy_on_mouse_multi_down); + evas_object_event_callback_del(pData->obj, EVAS_CALLBACK_MULTI_UP, _proxy_on_mouse_multi_up); + evas_object_event_callback_del(pData->obj, EVAS_CALLBACK_MULTI_MOVE, _proxy_on_mouse_multi_move); + + MSG_MOUSE_HIGH("Mouse Event Handler Remove : 0x%08x", pData); + + free(handle); +} + + + diff --git a/common/src/ivug-util.c b/common/src/ivug-util.c new file mode 100755 index 0000000..ed78bbf --- /dev/null +++ b/common/src/ivug-util.c @@ -0,0 +1,649 @@ +/* + * Copyright 2012 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 "ivug-define.h" +#include "ivug-uuid.h" + +#include "ivug-util.h" +#include "ivug-debug.h" +#include "ivug-file-info.h" + +#include "ivug-db.h" + +#include +#include + +#include + +#include +#include + +#include // mkdir +#include // mkdir + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +/* + If filepath is web url, return TRUE. + +*/ +bool ivug_is_web_uri(const char* uri) +{ +//check file url type. local , http, ftp. + IV_ASSERT(uri != NULL); + + static const char* web_protocal_name[] = + { + "http://", + "https://", + "ftp://", + NULL, + }; + + int i = 0; + while (web_protocal_name[i] != NULL) + { + if ( strlen(uri) > strlen(web_protocal_name[i]) ) + { + if (strncmp(uri, web_protocal_name[i], strlen(web_protocal_name[i])) == 0) + { + return true; + } + } + + i++; + } + + MSG_UTIL_MED("Not web uri. %s", uri); + + return false; +} + + +unsigned int get_distance(int prevX, int prevY, int X, int Y) +{ + int dx = prevX - X; + int dy = prevY - Y; + + return sqrt(dx*dx + dy*dy); +} + + + +#define USE_ECORE_FILE + +#include + +/* + Remove fname file. + Returns true fname is not exist or removed sucessfully +*/ +bool ivug_remove_file(const char *filepath) +{ + char error_msg[256]; + if (ecore_file_exists(filepath) == EINA_FALSE) + { + MSG_UTIL_ERROR("Already removed.%s", filepath); + return true; + } + +#ifdef USE_ECORE_FILE + if ( ecore_file_unlink(filepath) == EINA_FALSE) + { + MSG_UTIL_ERROR("Cannot remove file : %s %s", filepath, strerror_r(errno, error_msg, sizeof(error_msg)) ); + return false; + } + + return true; +#else + if ( unlink(filepath) != 0 ) + { + MSG_UTIL_ERROR("Cannot remove file : %s %s", filepath, strerror_r(errno, error_msg, sizeof(error_msg)) ); + return false; + } + + return true; +#endif +} + +bool ivug_rename_file(const char *src, const char *dst) +{ + if (ecore_file_exists(src) == EINA_FALSE) + { + MSG_UTIL_ERROR("Source file is not exist : %s", src); + return false; + } + + if (ecore_file_exists(dst) == EINA_TRUE) + { + MSG_UTIL_ERROR("Destination file is exist : %s", dst); + return false; + } + + if (dst == NULL) + { + MSG_UTIL_ERROR("Destination file is NULL"); + return false; + } + + char error_msg[256]; + + if ( rename(src, dst) < 0) + { + MSG_UTIL_ERROR("Cannot rename from %s to %s : %s", src, dst, strerror_r(errno, error_msg, sizeof(error_msg)) ); + return false; + } + + return true; +} + +bool ivug_copy_file(const char *filename, const char *dest) +{ +#define DIR_MASK_DEFAULT 0775 + if ( filename == NULL) + { + MSG_MAIN_ERROR("File does not existfilepath=%s", filename); + return false; + } + + if(ecore_file_cp(filename, dest) == EINA_FALSE) + { + MSG_MAIN_ERROR("ecore_file_cp failed. From %s To %s", filename, dest); + return false; + } + + return true; +} + + +char * +ivug_mktemp(char* filepath, char*ext) +{ + ivug_retv_if(!filepath || !ext, NULL); + + MSG_IVUG_HIGH("filepath %s, ext %s", filepath, ext); + + char tempname[IVUG_MAX_FILE_PATH_LEN+1] = {0}; + snprintf(tempname, sizeof(tempname), "%s_0.%s",filepath, ext); + int i = 1; + + while(ecore_file_exists(tempname) == EINA_TRUE ) + { + snprintf(tempname, sizeof(tempname),"%s_%d.%s", filepath, i, ext); + i++; + } + + MSG_IVUG_HIGH( " tempname %s, i %d", tempname, i); + + return strdup(tempname); +} + + +/* + Check whether given filepath file exists + + CAUTION : filepath cannot be NULL. +*/ +bool ivug_is_file_exist(const char* filepath) +{ + IV_ASSERT(filepath != NULL); + + if ( ecore_file_exists(filepath) == EINA_TRUE) + { + return true; + } + + return false; +} + + +/* + USer should freed returned value! +*/ +char *ivug_get_directory(const char *filepath) +{ + if ( filepath == NULL ) + { + MSG_UTIL_WARN("File path is NULL"); + return "NULL"; + } + +#ifdef USE_ECORE_FILE + return ecore_file_dir_get(filepath); +#else + #error "Not implemented yet." +#endif +} + + +/* + Returns start pointer of filename within filepath. + No memory allocated in this function. so user do not free returned pointer. + + CAUTION : filepath cannot be NULL. +*/ +char * ivug_get_filename(const char *filepath) +{ + if ( filepath == NULL ) + { + MSG_UTIL_WARN("File path is NULL"); + return "NULL"; + } + +#ifdef USE_ECORE_FILE + return ecore_file_file_get(filepath); +#else + +#define DIRECORY_SPLITTER '/' + const char*pFileName = NULL; + + pFileName = strrchr(filepath, DIRECORY_SPLITTER); + + if ( pFileName == NULL) // If not found + { + return filepath; + } + + return (pFileName+1); +#endif + +} + +bool ivug_prohibit_lcd_off(void) +{ + MSG_UTIL_MED("START : Sleep disabled"); + return (power_lock_state(POWER_STATE_NORMAL, 0)==0 ? true : false); +} + +bool ivug_allow_lcd_off(void) +{ + MSG_UTIL_MED("END : Sleep disabled"); + return (power_unlock_state(POWER_STATE_NORMAL)==0 ? true : false); +} + +long int ivug_atox(const char *number) +{ + char *endptr = NULL; + long long int val = 0; + + errno = 0; + + val = strtoll(number, &endptr, 16); + + if((errno == ERANGE && (val == LLONG_MAX || val == LLONG_MIN)) || (errno != 0 && val == 0)) + { + MSG_UTIL_ERROR("ERANGE = %d, LONG_MAX = %d, LONG_MIN = %d", ERANGE, LLONG_MAX, LLONG_MIN); + MSG_UTIL_ERROR("strtol, val = %d, 0x%x, errno = %d, ", val, val, errno); + return -1L; + } + + if(endptr == number) + { + MSG_UTIL_ERROR("No digits were found, number = %s", number); + return -1L; + } + + return (long int)val; +} + +int ivug_atoi(const char *number) +{ + char *endptr = NULL; + long val = 0; + + errno = 0; + + val = strtol(number, &endptr, 10); + + if((errno == ERANGE && (val == LONG_MAX || val == LONG_MIN)) || (errno != 0 && val == 0)) + { + MSG_UTIL_ERROR("strtol, val = %d", val); + return -1; + } + + if(endptr == number) + { + MSG_UTIL_ERROR("No digits were found, number = %s", number); + return -1; + } + + return (int)val; +} + +double ivug_atod(const char *number) +{ + char *endptr = NULL; + double val = 0; + + errno = 0; + + val = strtod(number, &endptr); + + if((errno == ERANGE && (val == -HUGE_VAL || val == HUGE_VAL)) || (errno != 0 && val == 0)) + { + MSG_UTIL_ERROR("strtod, val = %d", val); + return -1; + } + + if(endptr == number) + { + MSG_UTIL_ERROR("No digits were found, number = %s", number); + return -1; + } + + return val; +} + +char * ivug_generate_file_name(const char *filepath, const char *extension, const char *dest_dir) +{ + IV_ASSERT(filepath != NULL); + + MSG_SETAS_HIGH("filepath %s", filepath); + + char tempname[IVUG_MAX_FILE_PATH_LEN+1] = {0,}; + char *ext = NULL; + char *filename = ecore_file_strip_ext(ecore_file_file_get(filepath)); + char *dir = NULL; + + if(extension) + { + ext = strdup(extension); + } + else + { + ext = ivug_fileinfo_get_file_extension(filepath); + } + + if(dest_dir) + { + dir = strdup(dest_dir); + } + else + { + dir = ecore_file_dir_get(filepath); + } + + int i = 0; + + for(i=1; i // for NULL +#include // free +#include // strdup + +UUID uuid_assign(UUID id) +{ +#ifdef _USE_MEDIAINFO_STRINGID_ + if ( id == NULL ) + return NULL; + + return strdup(id); +#else + return id; +#endif +} + + +void uuid_free(UUID id) +{ +#ifdef _USE_MEDIAINFO_STRINGID_ + if ( id != NULL ) + free((void *)id); +#endif +} + + +int uuid_compare(UUID id1, UUID id2) +{ +#ifdef _USE_MEDIAINFO_STRINGID_ + return strcmp(id1, id2); +#else + return id1 - id2; +#endif +} + +const char *uuid_getchar(UUID id) +{ +#ifdef _USE_MEDIAINFO_STRINGID_ + if ( id == NULL ) + { + return "NULL"; + } + + return id; +#else + { + static char buffer[255]; + + sprintf(buffer, "%d", id); + + return buffer; + } +#endif + +} + + +UUID uuid_getuuid(const char *szID) +{ + if ( szID == NULL ) + { + return INVALID_UUID; + } + +#ifdef _USE_MEDIAINFO_STRINGID_ + return strdup(szID); +#else + return ivug_atoi(szID); +#endif + +} + +bool uuid_is_valid(UUID id) +{ + return (id != INVALID_UUID) ? true : false; +} + + + diff --git a/common/src/statistics.c b/common/src/statistics.c new file mode 100755 index 0000000..3ea152a --- /dev/null +++ b/common/src/statistics.c @@ -0,0 +1,471 @@ +/* + * Copyright 2012 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 // gettimeofday + +#include +#include +#include +#include +#include + +#include "statistics.h" +#include "debug.h" + + +#ifdef STANDALONE +#define EXPORT_API +#endif + +#include +#include +#include +#include + +#include +#include "statistics.h" + +#define MAX_UINT32 (0xFFFFFFFFL) +#define MAX_UINT64 (0xFFFFFFFFFFFFFFFFLL) + +// defs. +#define MM_TA_MAX_ACCUM 100 + + +typedef struct _iv_ta_accum_item +{ + unsigned long long elapsed_accum; + unsigned long num_calls; + unsigned long long elapsed_min; + unsigned long long elapsed_max; + unsigned long long first_start; + unsigned long long last_end; + + char* name; + int lvl; + + unsigned long long timestamp; + int on_estimate; + int num_unpair; +} iv_ta_accum_item; + + +static void PrintLog(const char *file, int line, const char *msg, ...) +{ + va_list va; + + va_start(va, msg); + fprintf(stderr ,"[STAT] %s:%d:",file, line); + vfprintf(stderr ,msg, va); + fprintf(stderr, "\n"); + va_end(va); +} + +#define MyPrintf(...) PrintLog(__FILE__, __LINE__, ##__VA_ARGS__ ) + + +// internal func. +static void __free_accums(void); +static int __get_accum_index(int lvl, const char* name); + + +// global var. +static iv_ta_accum_item ** g_accums = NULL; +static int g_accum_index = 0; +static int g_accum_longest_name = 0; +static unsigned long long g_accum_first_time = MAX_UINT64; // jmlee + + +int IV_PERF_INIT(void) +{ + if (g_accums) + { + return 0; + } + + g_accums = (iv_ta_accum_item **) malloc ( MM_TA_MAX_ACCUM * sizeof(iv_ta_accum_item *) ); + if(!g_accums) + { + assert(0); + return -1; + } + + g_accum_first_time = MAX_UINT64; + g_accum_index = 0; + g_accum_longest_name = 0; + + return 0; +} + +int IV_PERF_DEINIT(void) +{ + if ( ! g_accums ) + { + return 0; + } + + __free_accums(); + + g_accum_first_time = MAX_UINT64; + + return 0; +} + + +static int __get_accum_index(int lvl, const char* name) +{ + int i; + + assert(name); + + // find index + for ( i = 0; i < g_accum_index; i++ ) + { + if ( (lvl == g_accums[i]->lvl) && (strcmp( name, g_accums[i]->name ) == 0) ) + return i; + } + + return -1; +} + +static void __free_accums(void) +{ + int i = 0; + + if ( ! g_accums ) + return; + + for ( i = 0; i < g_accum_index; i++ ) + { + if ( g_accums[i] ) + { + if ( g_accums[i]->name ) + free ( g_accums[i]->name ); + + free ( g_accums[i] ); + + g_accums[i] = NULL; + } + } + + g_accum_index = 0; + g_accum_longest_name = 0; + + free ( g_accums ); + g_accums = NULL; +} + + + +int iv_ta_accum_item_begin(int lvl, const char* name, bool show, const char* filename, int line) +{ + iv_ta_accum_item * accum = NULL; + int index = 0; + int name_len = 0; + struct timeval t; + + if (!g_accums) + return 0; + + if ( g_accum_index == MM_TA_MAX_ACCUM ) + return -1; + + if ( !name ) + return -1; + + name_len = strlen(name) + (lvl * 2); + if( name_len == 0 ) + return -1; + + // if 'name' is new one. create new item. + if ( (index = __get_accum_index(lvl, name)) == -1 ) + { + accum = ( iv_ta_accum_item * ) malloc( sizeof( iv_ta_accum_item ) ); + if ( !accum ) + { + assert(0); + return -1; + } + + // clear first. + memset( accum, 0, sizeof (iv_ta_accum_item) ); + accum->elapsed_min = MAX_UINT64; + + accum->name = strdup(name); + accum->lvl = lvl; + // add it to list. + g_accums[g_accum_index] = accum; + g_accum_index++; + + if ( g_accum_longest_name < name_len ) + g_accum_longest_name = name_len; + + } + else + { + accum = g_accums[index]; + } + + // verify pairs of begin, end. + if (accum->on_estimate) + { + MyPrintf("[%s] is not 'end'ed!\n", accum->name); + accum->num_unpair ++; + return -1; + } + + accum->on_estimate = 1; + + // get timestamp + gettimeofday( &t, NULL ); + accum->timestamp = t.tv_sec * 1000000UL + t.tv_usec; + + if ( accum->first_start == 0 ) + { // assum that timestamp never could be zero. + accum->first_start = accum->timestamp; + + if ( g_accum_first_time > accum->first_start ) + { + g_accum_first_time = accum->first_start ; + } + } + + if ( show ) + MyPrintf("[ACCUM BEGIN] %s : %ld ---(%s:%d)\n", name, accum->timestamp, filename, line ); + + accum->num_calls++; + + return 0; +} + +int iv_ta_accum_item_end(int lvl, const char* name, bool show, const char* filename, int line) +{ + iv_ta_accum_item * accum = NULL; + unsigned long long tval = 0LL; + int index = 0; + struct timeval t; + + if (!g_accums) + return 0; + + if ( g_accum_index == MM_TA_MAX_ACCUM ) + return -1; + + if ( !name ) + return -1; + + if( strlen ( name ) == 0 ) + return -1; + + // varify the 'name' is already exist. + if ( (index = __get_accum_index(lvl, name)) == -1 ) + { + MyPrintf("[%s] is not added before!\n", name); + return -1; + } + + accum = g_accums[index]; + + // verify pairs of begin, end. + if (!accum->on_estimate) + { + MyPrintf("[%s] is not 'begin' yet!\n", accum->name); + accum->num_unpair ++; + return -1; + } + + // get time first for more accuracy. + gettimeofday( &t, NULL ); + tval = t.tv_sec*1000000UL + t.tv_usec; + + // update last_end + accum->last_end = tval; + +#if 0 + if ( accum->first_start > accum->last_end ) + { + MyPrintf("Invalied timestamp:%s. Start:%lu End=%lu\n", accum->name, accum->first_start , accum->last_end); + } +#endif + + // make get elapsed time. + tval = tval - accum->timestamp; + + // update min/max + accum->elapsed_max = tval > accum->elapsed_max ? tval : accum->elapsed_max; + accum->elapsed_min = tval < accum->elapsed_min ? tval : accum->elapsed_min; + + if ( show ) + MyPrintf("[ACCUM END] %s : %llu + %llu ---(%s:%d)\n", name, accum->elapsed_accum, tval, filename, line ); + + // add elapsed time + accum->elapsed_accum = accum->elapsed_accum + tval; + accum->on_estimate = 0; + + return 0; +} + +void __print_some_info(FILE* fp) +{ + // General infomation + { + time_t t_val; + char hostname[256] = {'\0',}; +#ifdef LINUX + struct utsname uts; + struct rusage r_usage; +#endif + fprintf(fp, "\n[[ General info ]]\n"); + + // time and date + time(&t_val); + fprintf(fp, "Date : %s", ctime(&t_val) ); + + // system + if ( gethostname(hostname, 255) == 0 ) + { + fprintf(fp, "Hostname : %s\n", hostname); + } +#ifdef LINUX + if ( uname(&uts) >= 0 ) + { + fprintf(fp, "System : %s\n", uts.sysname); + fprintf(fp, "Machine : %s\n", uts.machine); + fprintf(fp, "Nodename : %s\n", uts.nodename); + fprintf(fp, "Release : %s \n", uts.release); + fprintf(fp, "Version : %s \n", uts.version); + } + + // process info. + fprintf(fp, "Process priority : %d\n", getpriority(PRIO_PROCESS, getpid()) ); + + getrusage(RUSAGE_SELF, &r_usage); + fprintf(fp, "CPU usage : User = %ld.%06ld, System = %ld.%06ld\n", + r_usage.ru_utime.tv_sec, r_usage.ru_utime.tv_usec, + r_usage.ru_stime.tv_sec, r_usage.ru_stime.tv_usec ); +#endif + + } + + // host environment variables + { + extern char** environ; + char** env = environ; + + fprintf(fp, "\n[[ Host environment variables ]]\n"); + while(*env) + { + fprintf(fp, "%s\n", *env); + env++; + } + } + + fprintf(fp, "g_accum_first_time = %llu", g_accum_first_time); + + fprintf(fp, "\n\n"); + +} + + +void iv_ta_accum_show_result_fp(FILE *fp) +{ + int i = 0; + char format[256]; + + __print_some_info(fp); + + fprintf(fp, "\n\n"); + + fprintf(fp, "============================ BEGIN RESULT ACCUM (usec) ====================\n"); + + snprintf(format, (size_t)sizeof(format), "[Idx] [Lvl] %%-%ds %%10s %%10s %%6s %%10s %%10s %%4s \n", g_accum_longest_name); + + fprintf(fp, format, "Name", "avg", "total", "hit", "min", "max", "pair"); + + snprintf(format, (size_t)sizeof(format), "[%%3d] [%%3d] %%-%ds %%10llu %%10llu %%6lu %%10llu %%10llu %%4s \n", g_accum_longest_name); + + for ( i = 0; i < g_accum_index; i++ ) + { + // prevent 'devide by zero' error + if (g_accums[i]->num_calls == 0) + g_accums[i]->num_calls = 1; + + static char space[256]; + + int j; + for ( j = 0; j < g_accums[i]->lvl * 2; j++) + { + space[j] = '_'; + } + space[g_accums[i]->lvl*2] = '\0'; + + fprintf(fp, + format, + i, + g_accums[i]->lvl, + strcat(space, g_accums[i]->name), + (g_accums[i]->elapsed_accum == 0)?0:(g_accums[i]->elapsed_accum / g_accums[i]->num_calls), // Fix it! : devide by zero. + g_accums[i]->elapsed_accum, + g_accums[i]->num_calls, + g_accums[i]->elapsed_min, + g_accums[i]->elapsed_max, + g_accums[i]->num_unpair == 1 ? "F" : "T" ); + } + + fprintf(fp, "============================ END RESULT ACCUM ============================\n"); + +} + +#if 0 +#define _CONSTRUCTOR __attribute__ ((constructor)) +#define _DESTRUCTOR __attribute__ ((destructor)) + +static void _CONSTRUCTOR _DLLInit(void) +{ + IV_PERF_INIT(); +} + +static void _DESTRUCTOR _DLLExit(void) +{ + IV_PERF_DEINIT(); + +} +#endif + + +#ifdef STANDALONE +int main(int argc, char* argv[]) +{ + int a = 0, b = 0; + + + PERF_CHECK_BEGIN(LVL1, "Test 1"); + + for ( a = 0 ; a < 10; a++) + { + printf("AAA=%d\n", a); + usleep(1*10E6); + } + + PERF_CHECK_END(LVL1, "Test 1"); + + printf("Test 111\n"); + return 0; +} +#endif + + + diff --git a/feature/CMakeLists.txt b/feature/CMakeLists.txt new file mode 100755 index 0000000..92b6dc0 --- /dev/null +++ b/feature/CMakeLists.txt @@ -0,0 +1,47 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(ivug_feature C CXX) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(VERSION 0.1.0) + +SET(SRCS + src/ivug-ext-ug.c +) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/include + ${IVUG_SOURCE_COMMON_DIR}/include + include +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(${PROJECT_NAME}_pkgs REQUIRED + evas + ecore + ecore-x + elementary + dlog + ui-gadget-1 # Motion + capi-system-sensor +) + +FOREACH(flag ${${PROJECT_NAME}_pkgs_CFLAGS}) + SET(EXTRA_FLAGS "${EXTRA_FLAGS} ${flag}") +ENDFOREACH(flag) + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DLOG_LVL=DBG_MSG_LVL_HIGH") +ADD_DEFINITIONS("-DLOG_CAT=\"IV-FEATURE\"") + +ADD_LIBRARY(${PROJECT_NAME} STATIC ${SRCS}) + +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION} ) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${EXTRA_FLAGS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} + ivug_common +) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib) + diff --git a/feature/include/ivug-ext-ug.h b/feature/include/ivug-ext-ug.h new file mode 100755 index 0000000..86cb243 --- /dev/null +++ b/feature/include/ivug-ext-ug.h @@ -0,0 +1,59 @@ +/* + * Copyright 2012 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 __IVUG_EXT_UG_H__ +#define __IVUG_EXT_UG_H__ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void (*ug_destroy_cb)(ui_gadget_h ug, void *data); +typedef void (*ug_result_cb)(ui_gadget_h ug, service_h service, void *data); + +#define OPERATION_NAME_CALL "http://tizen.org/appcontrol/operation/call" + +/* + Launch extern module. +*/ +bool ivug_ext_launch_videoplayer_simple(const char *filepath); +bool ivug_ext_launch_videoplayer(const char *uri); + +ui_gadget_h ivug_ext_launch_wifi_file_transfer(const char *uri, ug_destroy_cb func, void *data); +ui_gadget_h ivug_ext_launch_bluetooth_print(const char *uri, ug_destroy_cb func, void *data); +ui_gadget_h ivug_ext_launch_bluetooth_send(const char *uri, ug_destroy_cb func, void *data); + +ui_gadget_h ivug_ext_launch_contact(const char *uri, ug_destroy_cb func, void *data); +ui_gadget_h ivug_ext_launch_message(const char *uri, ug_destroy_cb func, void *data); + +ui_gadget_h ivug_ext_launch_select_contact(ug_result_cb result_func, ug_destroy_cb destroy_func, void *data); + +bool ivug_ext_launch_browser(const char *uri); +bool ivug_ext_launch_email(const char *uri); +bool ivug_ext_launch_print(const char *uri); + +bool ivug_ext_launch_default(const char *uri, const char *operation, const char *pkg, void *data); +bool ivug_ext_launch_to_send(const char *uri, const char *pkg, ug_destroy_cb func, void *data, ui_gadget_h ug); + +#ifdef __cplusplus +} +#endif + +#endif //__IVUG_EXT_UG_H__ + diff --git a/feature/src/ivug-ext-ug.c b/feature/src/ivug-ext-ug.c new file mode 100755 index 0000000..8f24655 --- /dev/null +++ b/feature/src/ivug-ext-ug.c @@ -0,0 +1,1100 @@ +/* + * Copyright 2012 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 "ivug-ext-ug.h" +#include "ivug-util.h" +#include "ivug-debug.h" + + +//definition +#define MESSAGE_UG_NAME "msg-composer-efl" +#define EMAIL_UG_NAME "email-composer-efl" +#define CONTACT_UG_NAME "contacts-list-efl" +#define MYFILE_DETAIL_UG_NAME "myfile-detail-efl" +#define BLUETOOTH_UG_NAME "ug-bluetooth-efl" +#define MYFILE_UG_NAME "myfile-efl" + +#define CONTACT_SELECT_UG_NAME "contacts-tabui-efl" +#define BLUETOOTH_SETTING_NAME "setting-bluetooth-efl" + +#define VIDEOPLAYER_PKG_NAME "org.tizen.video-player" +#define BLUETOOTH_PKG_NAME "org.tizen.bluetooth" +#define BROWSER_PKG_NAME "org.tizen.browser" +#define MESSAGE_PKG_NAME "org.tizen.message" +#define EMAIL_PKG_NAME "org.tizen.email" + +#define WIFI_FILE_TRANSFER_UG_NAME "fileshare-efl" + +#define PRINT_PKG_NAME "org.tizen.mobileprint" + +#define OPERATION_NAME_PRINT "http://tizen.org/appcontrol/operation/PRINT" + +#define SERVICE_PRINT_FILES_TYPE "service_print_files_type" + +#define MIME_TYPE_LEN 255 + +typedef struct { + ug_destroy_cb destroy_func; + ug_result_cb result_func; + void *cb_data; +}ext_ug_t; +#if 0 +static void +_bundle_print(const char *key, const char *val, void *data) +{ + MSG_IVUG_HIGH(" %s:%s", key, val); +} +#endif + +static bool _data_print(service_h service, const char *key, void *user_data) +{ + char *value; + + char **value_array; + int array_len = 1; + int i; + bool array = false; + + service_is_extra_data_array(service, key, &array); + if(array == false) + { + service_get_extra_data(service, key, &value); + MSG_IVUG_HIGH(" %s : %s", key, value); + free(value); + } + else + { + service_get_extra_data_array(service, key, &value_array, &array_len); + MSG_IVUG_HIGH(" %s :", key); + for(i=0; iresult_func) + ug_struct->result_func(ug, result, ug_struct->cb_data); +} + + +static void +_ivug_ext_ug_destroy_cb(ui_gadget_h ug, void *priv) +{ + if (!ug ) return; + + ext_ug_t *ug_struct = (ext_ug_t *)priv; + + MSG_IMAGEVIEW_HIGH("Destroy ug"); + ug_destroy(ug); + + ug_struct->destroy_func(ug, ug_struct->cb_data); + + free(ug_struct); +} + +ui_gadget_h _ivug_ext_launch_ug(const char *pkgname, service_h service, ug_destroy_cb func, void *data) +{ + ui_gadget_h ug = NULL; + struct ug_cbs cbs = {0, }; + + ext_ug_t *ug_struct = calloc(1, sizeof(ext_ug_t)); + ug_struct->result_func = NULL; + ug_struct->destroy_func = func; + ug_struct->cb_data = data; + + cbs.layout_cb = _ivug_ext_ug_layout_cb; + cbs.result_cb = _ivug_ext_ug_result_cb; + cbs.destroy_cb = _ivug_ext_ug_destroy_cb; + cbs.priv = ug_struct; + + ug = ug_create( NULL, pkgname, UG_MODE_FULLVIEW, service, &cbs ); + + return ug; +} + +ui_gadget_h _ivug_ext_launch_ug_with_result(const char *pkgname, + service_h service, ug_result_cb result_func, ug_destroy_cb destroy_func, void *data) +{ + ui_gadget_h ug = NULL; + struct ug_cbs cbs = {0, }; + + ext_ug_t *ug_struct = calloc(1, sizeof(ext_ug_t)); + ug_struct->result_func = result_func; + ug_struct->destroy_func = destroy_func; + ug_struct->cb_data = data; + + cbs.layout_cb = _ivug_ext_ug_layout_cb; + cbs.result_cb = _ivug_ext_ug_result_cb; + cbs.destroy_cb = _ivug_ext_ug_destroy_cb; + cbs.priv = ug_struct; + + ug = ug_create( NULL, pkgname, UG_MODE_FULLVIEW, service, &cbs ); + + return ug; +} + + +void ivug_ext_service_reply_cb(service_h request, service_h reply, service_result_e result, void *user_data) +{ + MSG_IMAGEVIEW_HIGH("ivug_ext_service_reply_cb"); + switch(result) + { + case SERVICE_RESULT_SUCCEEDED: + MSG_IMAGEVIEW_HIGH("SERVICE_RESULT_SUCCEEDED"); + break; + case SERVICE_RESULT_FAILED: + MSG_IMAGEVIEW_HIGH("SERVICE_RESULT_FAILED"); + break; + case SERVICE_RESULT_CANCELED: + MSG_IMAGEVIEW_HIGH("SERVICE_RESULT_CANCELED"); + break; + default: + MSG_IMAGEVIEW_ERROR("unhandled value %d", result); + break; + } +} + +ui_gadget_h ivug_ext_launch_wifi_file_transfer(const char *uri, ug_destroy_cb func, void *data) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + ui_gadget_h ug = NULL; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return NULL; + } + + /*ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto WIFI_TRANSFER_END; + }*/ + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto WIFI_TRANSFER_END; + } + + ret = service_add_extra_data(handle, "filecount", "1"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto WIFI_TRANSFER_END; + } + + ret = service_add_extra_data(handle, "files", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto WIFI_TRANSFER_END; + } + + /*const char *pkgname = WIFI_FILE_TRANSFER_UG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto WIFI_TRANSFER_END; + }*/ + + ug = _ivug_ext_launch_ug(WIFI_FILE_TRANSFER_UG_NAME, handle, func, data); + +WIFI_TRANSFER_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return NULL; + } + + return (ret == SERVICE_ERROR_NONE ? ug : NULL); +} + +ui_gadget_h ivug_ext_launch_message(const char *uri, ug_destroy_cb func, void *data) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + ui_gadget_h ug = NULL; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return NULL; + } + + /*ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto MESSAGE_END; + }*/ + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto MESSAGE_END; + } + + if (ivug_is_web_uri(uri) == true) + { + ret = service_add_extra_data(handle, "BODY", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto MESSAGE_END; + } + } + else + { + ret = service_add_extra_data(handle, "ATTACHFILE", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto MESSAGE_END; + } + } + + /*const char *pkgname = MESSAGE_UG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto MESSAGE_END; + }*/ + + ug = _ivug_ext_launch_ug(MESSAGE_UG_NAME, handle, func, data); + +MESSAGE_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return NULL; + } + return (ret == SERVICE_ERROR_NONE ? ug : NULL); +} + +bool ivug_ext_launch_email(const char *uri) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return false; + } + + ret = service_set_operation(handle, SERVICE_OPERATION_SEND); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto EMAIL_END; + } + + ret = service_set_uri(handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto EMAIL_END; + } + + Ecore_X_Window win_id = elm_win_xwindow_get(ug_get_window()); + ret = service_set_window(handle, win_id); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto EMAIL_END; + } + + ret = service_add_extra_data(handle, "RUN_TYPE", "5"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto EMAIL_END; + } + + if (ivug_is_web_uri(uri) == true) + { + ret = service_add_extra_data(handle, "BODY", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto EMAIL_END; + } + } + else + { + ret = service_add_extra_data(handle, "ATTACHMENT", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto EMAIL_END; + } + } + + const char *pkgname = EMAIL_UG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_package failed, %d", ret); + goto EMAIL_END; + } + + ret = service_send_launch_request(handle, ivug_ext_service_reply_cb, NULL); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_send_launch_request failed, %d", ret); + goto EMAIL_END; + } + +EMAIL_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return false; + } + + return (ret == SERVICE_ERROR_NONE ? true : false); +} + +ui_gadget_h ivug_ext_launch_contact(const char *uri, ug_destroy_cb func, void *data) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + ui_gadget_h ug = NULL; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return NULL; + } + + /*ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto MESSAGE_END; + }*/ + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto CONTACT_END; + } + + ret = service_add_extra_data(handle, "type", "41"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto CONTACT_END; + } + + ret = service_add_extra_data(handle, "ct_path", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto CONTACT_END; + } + + /*const char *pkgname = CONTACT_UG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto CONTACT_END; + }*/ + + ug = _ivug_ext_launch_ug(CONTACT_UG_NAME, handle, func, data); + +CONTACT_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return NULL; + } + + return (ret == SERVICE_ERROR_NONE ? ug : NULL); +} + +ui_gadget_h ivug_ext_launch_bluetooth_send(const char *uri, ug_destroy_cb func, void *data) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + ui_gadget_h ug = NULL; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return NULL; + } + + /*ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto BT_END; + }*/ + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto BT_END; + } + + ret = service_add_extra_data(handle, "launch-type", "send"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto BT_END; + } + + ret = service_add_extra_data(handle, "filecount", "1"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto BT_END; + } + + ret = service_add_extra_data(handle, "files", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto BT_END; + } + + /*const char *pkgname = BLUETOOTH_UG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto BT_END; + }*/ + + ug = _ivug_ext_launch_ug(BLUETOOTH_SETTING_NAME, handle, func, data); + +BT_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return NULL; + } + + return (ret == SERVICE_ERROR_NONE ? ug : NULL); +} + +ui_gadget_h ivug_ext_launch_bluetooth_print(const char *uri, ug_destroy_cb func, void *data) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + ui_gadget_h ug = NULL; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return NULL; + } + + /*ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto BT_END; + }*/ + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto BT_PRINT_END; + } + + ret = service_add_extra_data(handle, "launch-type", "print"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto BT_PRINT_END; + } + + ret = service_add_extra_data(handle, "filecount", "1"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto BT_PRINT_END; + } + + ret = service_add_extra_data(handle, "files", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto BT_PRINT_END; + } + + /*const char *pkgname = BLUETOOTH_UG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto BT_PRINT_END; + }*/ + + ug = _ivug_ext_launch_ug(BLUETOOTH_UG_NAME, handle, func, data); + +BT_PRINT_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return NULL; + } + + return (ret == SERVICE_ERROR_NONE ? ug : NULL); +} + + +bool ivug_ext_launch_videoplayer(const char *uri) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return false; + } + + ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto VIDEO_PLAYER_END; + } + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto VIDEO_PLAYER_END; + } + + ret = service_add_extra_data(handle, "path", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto VIDEO_PLAYER_END; + } + + ret = service_add_extra_data(handle, "launching_application", "image_viewer"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto VIDEO_PLAYER_END; + } + + const char *pkgname = VIDEOPLAYER_PKG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto VIDEO_PLAYER_END; + } + + ret = service_send_launch_request(handle, ivug_ext_service_reply_cb, NULL); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_send_launch_request failed, %d", ret); + goto VIDEO_PLAYER_END; + } + +VIDEO_PLAYER_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return false; + } + + return (ret == SERVICE_ERROR_NONE ? true : false); +} + +bool ivug_ext_launch_videoplayer_simple(const char *uri) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return false; + } + + ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto VIDEO_PLAYER_SIMPLE_END; + } + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto VIDEO_PLAYER_SIMPLE_END; + } + + ret = service_add_extra_data(handle, "path", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto VIDEO_PLAYER_SIMPLE_END; + } + + // Camera -> Image Viewer -> Video player, In this case, launching_application bundle's value should be "light_play_view" + ret = service_add_extra_data(handle, "launching_application", "light_play_view"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto VIDEO_PLAYER_SIMPLE_END; + } + + const char *pkgname = VIDEOPLAYER_PKG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto VIDEO_PLAYER_SIMPLE_END; + } + + ret = service_send_launch_request(handle, ivug_ext_service_reply_cb, NULL); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_send_launch_request failed, %d", ret); + goto VIDEO_PLAYER_SIMPLE_END; + } + +VIDEO_PLAYER_SIMPLE_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return false; + } + + return (ret == SERVICE_ERROR_NONE ? true : false); +} + +bool ivug_ext_launch_browser(const char *uri) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return false; + } + + ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto BROWSER_END; + } + + ret = service_add_extra_data(handle, "url", uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto BROWSER_END; + } + + const char *pkgname = BROWSER_PKG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto BROWSER_END; + } + + ret = service_send_launch_request(handle, ivug_ext_service_reply_cb, NULL); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_send_launch_request failed, %d", ret); + goto BROWSER_END; + } + +BROWSER_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return false; + } + + return (ret == SERVICE_ERROR_NONE ? true : false); +} + +ui_gadget_h ivug_ext_launch_select_contact(ug_result_cb result_func, ug_destroy_cb destroy_func, void *data) +{ + MSG_IMAGEVIEW_HIGH("%s", __func__); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + ui_gadget_h ug = NULL; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return NULL; + } + + /*ret = service_set_operation(handle, SERVICE_OPERATION_VIEW); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto SELECT_CONTACT_END; + }*/ + + ret = service_add_extra_data(handle, "type", "11"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto SELECT_CONTACT_END; + } + + /*const char *pkgname = CONTACT_SELECT_UG_NAME; + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto SELECT_CONTACT_END; + }*/ + + char xwin_id_str[12] = {0,}; + Ecore_X_Window xwin_id = elm_win_xwindow_get(ug_get_window()); + eina_convert_itoa(xwin_id, xwin_id_str); + ret = service_add_extra_data(handle, "XWINDOW_ID", xwin_id_str); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto SELECT_CONTACT_END; + } + + ug = _ivug_ext_launch_ug_with_result(CONTACT_SELECT_UG_NAME, handle, result_func, destroy_func, data); + +SELECT_CONTACT_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return NULL; + } + + return (ret == SERVICE_ERROR_NONE ? ug : NULL); +} + +bool ivug_ext_launch_default(const char *uri, const char *operation, const char *pkg, void *data) +{ + MSG_IMAGEVIEW_HIGH("%s.", __func__); + + int ret = -1; + int destroy_ret = -1; + + service_h handle; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return false; + } + + ret = service_set_operation(handle, operation); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation %s failed, %d", operation, ret); + goto LAUNCH_END; + } + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri %s failed, %d", uri, ret); + goto LAUNCH_END; + } + + if(pkg) + { + ret = service_set_package(handle, pkg); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_package %s failed, %d", pkg, ret); + goto LAUNCH_END; + } + } + + ret = service_send_launch_request(handle, ivug_ext_service_reply_cb, NULL); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_send_launch_request failed, %d", ret); + goto LAUNCH_END; + } + +LAUNCH_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return false; + } + + return (ret == SERVICE_ERROR_NONE ? true : false); +} + +bool ivug_ext_launch_to_send(const char *uri, const char *pkg, ug_destroy_cb func, void *data, ui_gadget_h ug) +{ + MSG_IMAGEVIEW_HIGH("%s: %s %s", __func__, uri, pkg); + + bool ret = false; + ug = NULL; + + if (!strcmp(pkg, MESSAGE_UG_NAME)) + { + ug = ivug_ext_launch_message(uri, func, data); + ret = ug ? true : false; + } + else if (!strcmp(pkg, EMAIL_UG_NAME)) + { + ret = ivug_ext_launch_email(uri); + } + else if (!strcmp(pkg, BLUETOOTH_PKG_NAME) || !strcmp(pkg, BLUETOOTH_UG_NAME)) + { + ug = ivug_ext_launch_bluetooth_send(uri, func, data); + ret = ug ? true : false; + } + else + { + /* Use default launch for other execs but bluetooth, that always requires settings */ + ret = ivug_ext_launch_default(uri, SERVICE_OPERATION_SEND, pkg, data); + } + + return ret; +} + +bool ivug_ext_launch_print(const char *uri) +{ + MSG_IMAGEVIEW_HIGH("%s. URI=%s", __func__, uri); + + int ret = -1; + int destroy_ret = -1; + const char *pkgname = PRINT_PKG_NAME; + + if(uri == NULL) + { + MSG_IMAGEVIEW_ERROR("URI is NULL"); + return false; + } + + service_h handle; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_create failed, %d", ret); + return false; + } + + ret = service_set_operation(handle, OPERATION_NAME_PRINT); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_operation failed, %d", ret); + goto PRINT_END; + } + + ret = service_set_package(handle, pkgname); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_package failed, %d", ret); + goto PRINT_END; + } + + ret = service_set_uri (handle, uri); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_set_uri failed, %d", ret); + goto PRINT_END; + } + + ret = service_add_extra_data(handle, SERVICE_PRINT_FILES_TYPE, "IMG"); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_add_extra_data failed, %d", ret); + goto PRINT_END; + } + + ret = service_send_launch_request(handle, ivug_ext_service_reply_cb, NULL); + if(ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_send_launch_request failed, %d", ret); + goto PRINT_END; + } + +PRINT_END: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) + { + MSG_IMAGEVIEW_ERROR("service_destroy failed, %d", destroy_ret); + return false; + } + + return (ret == SERVICE_ERROR_NONE ? true : false); +} + diff --git a/include/ivug-datatypes.h b/include/ivug-datatypes.h new file mode 100755 index 0000000..49f4349 --- /dev/null +++ b/include/ivug-datatypes.h @@ -0,0 +1,62 @@ +/* + * Copyright 2012 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 __IVUG_DATATYPES_H__ +#define __IVUG_DATATYPES_H__ + +#include "ivug-define.h" +#include + +#ifdef _USE_MEDIAINFO_STRINGID_ + typedef const char *UUID; + + #define INVALID_UUID ((UUID)NULL) +#else + typedef int UUID; + + #define INVALID_UUID ((UUID)-1) +#endif + +typedef enum { + IVUG_VIEW_BY_INVAILD = 0x00, + IVUG_VIEW_BY_FILE, + IVUG_VIEW_BY_ALL, + IVUG_VIEW_BY_FAVORITES, + IVUG_VIEW_BY_TAG, + IVUG_VIEW_BY_FOLDER, // Same as DB Album. will be renamed to BY_ALBUM + IVUG_VIEW_BY_PLACES, + IVUG_VIEW_BY_DIRECTORY, +} ivug_view_by; + +typedef enum { + IVUG_MEDIA_TYPE_ALL = 0x00, //default value + IVUG_MEDIA_TYPE_IMAGE, + IVUG_MEDIA_TYPE_VIDEO, + IVUG_MEDIA_TYPE_MAX, +} ivug_media_type; + + +typedef enum { + IVUG_MEDIA_SORT_NONE = 0x00, /**< No sort */ + IVUG_MEDIA_ASC_BY_NAME, /**< Ascending sort as file name */ + IVUG_MEDIA_DESC_BY_NAME, /**< Descending sort as file name */ + IVUG_MEDIA_ASC_BY_DATE, /**< Ascending sort as created date */ + IVUG_MEDIA_DESC_BY_DATE, /**< Descending sort as created date */ +} ivug_sort_type; + + +#endif // __IVUG_DATATYPES_H__ + diff --git a/include/ivug-define.h b/include/ivug-define.h new file mode 100755 index 0000000..4f9e317 --- /dev/null +++ b/include/ivug-define.h @@ -0,0 +1,56 @@ +/* + * Copyright 2012 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. + */ + +/* + ONLY system widely used definition. +*/ + +#pragma once + +/* +# use string UUID +ADD_DEFINITIONS("-D_USE_MEDIAINFO_STRINGID_") +*/ +#define _USE_MEDIAINFO_STRINGID_ + +#define USE_RESCAN_FILE_PATH_AT_LIST + +#define IVUG_MAX_FILE_PATH_LEN (4096) + +#define DIR_MASK_DEFAULT 0775 + +#define USE_CUSTOM_STYLE + +#define IVUG_INVALID_INDEX (0) // index was not set + +#define MAX_BYTE_LEN 254 + +/* + Time analysis data will be stored as file +*/ +#define TA_SAVETO_FILE + +// Temp. will be removed. +#ifdef TARGET // i386 does not support face function +#define ENABLE_FACE_MENU +#endif + +#define USE_NEW_DB_API + +#define ZOOM_LEVEL_STEP (0.7) +#define ZOOM_LEVEL_MAX (4) + +#define USE_DEFAULT_APP_SERVICE diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt new file mode 100755 index 0000000..d0c71af --- /dev/null +++ b/main/CMakeLists.txt @@ -0,0 +1,143 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +SET(VERSION_MAJOR 0) +SET(VERSION "${VERSION_MAJOR}.1.0") + +PROJECT(ug-image-viewer-efl C CXX) + +EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_VERSION) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) + +SET(SRCS +# Entry point + src/ug-image-viewer.cpp + +# View related + src/view/ivug-main-view.cpp + src/view/ivug-main-view-toolbar.cpp + src/view/ivug-main-view-menu.cpp + + src/view/ivug-slideshow-view.cpp + + src/view/ivug-name-view.c + src/view/ivug-details-view.c + src/view/ivug-crop-view.cpp + +# SetAs View + src/view/ivug-setas-view.c + src/view/ivug-setas-view-wallpaper.cpp + src/view/ivug-setas-view-callerid.cpp + +# Slider + src/slider/ivug-slider.cpp + src/slider/ivug-slider-item.cpp + src/slider/ivug-slider-mouse.cpp + +# Control related + src/control/ivug-parameter.c + src/control/ivug-context.c + src/control/ivug-detail-info.c + src/control/ivug-setas.cpp + src/control/ivug-crop-ug.cpp + src/control/ivug-widget.c + src/control/ivug-selectioninfo.c + src/control/ivug-popup.c +) + +# message("System = ${CMAKE_SYSTEM_VERSION}") + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/include + ${IVUG_SOURCE_WIDGET_DIR}/include + ${IVUG_SOURCE_COMMON_DIR}/include + ${IVUG_SOURCE_MEDIA_DIR}/include + ${IVUG_SOURCE_RESOURCE_DIR}/include + src + src/include + src/control + ${IVUG_SOURCE_FEATURE_DIR}/include + ${IVUG_SOURCE_SLIDESHOW_DIR}/include + +# Below include directory should be removed for make module more indepentatly +# ${IVUG_SOURCE_SLIDESHOW_DIR}/src/effect/include +# ${IVUG_SOURCE_SLIDESHOW_DIR}/src/dali_effect/include +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + elementary + edje + evas + eina + dlog + ecore + ecore-file + ecore-imf + ecore-x + ecore-input + ecore-evas + utilX + ui-gadget-1 + libmedia-utils + media-thumbnail + drm-client + glib-2.0 + vconf + capi-appfw-application + capi-appfw-app-manager +) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_FLAGS "${EXTRA_FLAGS} ${flag}") +ENDFOREACH(flag) + +ADD_DEFINITIONS("-DUG_MODULE_API=__attribute__ \(\(visibility\(\"default\"\)\)\)") +ADD_DEFINITIONS("-DPACKAGE=\"${PROJECT_NAME}\"") + +#ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) +ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${EXTRA_FLAGS}) + +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} + ${pkgs_LDFLAGS} ${armpkgs_LDFLAGS} + "-ldl" + ivug_common ivug_widget ivug_medialist ivug_slideshow +) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + +SET(THEME_FOLDER images/theme) +SET(THEME white) + +# Build edc files +BUILD_EDJ(ivug-base.edc ivug-base.edj layout images) +BUILD_EDJ(ivug-main.edc ivug-main.edj layout images) +BUILD_EDJ(ivug-effect.edc ivug-effect.edj layout images) +BUILD_EDJ(ivug-details.edc ivug-details.edj layout images) +BUILD_EDJ(ivug-selectioninfo.edc ivug-selectioninfo.edj layout images) +BUILD_EDJ(ivug-popup.edc ivug-popup.edj layout images) +BUILD_EDJ(ivug-crop-view.edc ivug-crop-view.edj layout crop-view) +BUILD_EDJ(ivug-icons.edc ivug-icons.edj layout icons) +BUILD_EDJ(ivug-slider.edc ivug-slider.edj layout icons) +BUILD_EDJ(ivug-gengrid.edc ivug-gengrid.edj layout gengrid) + +BUILD_EDJ(ivug-setas.edc ivug-setas.edj layout ${THEME_FOLDER}/${THEME}) +BUILD_EDJ(ivug-naviframe.edc ivug-naviframe.edj layout ${THEME_FOLDER}/${THEME}) +BUILD_EDJ(ivug-name-view.edc ivug-name-view.edj layout ${THEME_FOLDER}/${THEME}) +BUILD_EDJ(ivug-slideshow-view.edc ivug-slideshow-view.edj layout ${THEME_FOLDER}/${THEME}) +BUILD_EDJ(ivug-genlist.edc ivug-genlist.edj layout/genlist ../${THEME_FOLDER}/${THEME}) + + +# Install image files. +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${CMAKE_INSTALL_PREFIX}/res/images/${PROJECT_NAME}) + +# +INSTALL(DIRECTORY DESTINATION ${CMAKE_DATA_DIR}/${PROJECT_NAME}) + + + diff --git a/main/layout/gengrid/00_winset_thumbs_bg.png b/main/layout/gengrid/00_winset_thumbs_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..6226c9041b06731979e43e5548083dc96603c5aa GIT binary patch literal 3233 zcmbW3={pqq8^*s58T*zc>oN8wj9qqS>}wbqwAe>UmXs~B8|e_TH=?qQB~haZHI|TN zY+1*WJ%p1b$}&IaANXC@IWO+#b3N~#`@Y{i$(O86SeXQv0069JriON>e158z4D_dy zyK?UzFb0@9-2s64>_4Ib`A^RQz+`g+iM({l$3NKr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PJzFKcwjjNU%ZLDrA<18auXIfVlj$+zse-J(sDjN7}m&WNSH3UCG zq#MSa57Y3erfoB`IWzKo}1r>q36DT^iJ5ewL-+J6jcHgS3gkyj>B8d%)8j ztH){^N<#4aZd-i1KXrqiE$A+2tIsISI9=~mCpC06^w_ld7hX@8MLrOxdQ!uwgP<&0 zk_JPY9AgmU^2gyp_4c;N$3(r<04!QyP%%d}WN-?3XV&nyVYcB+0Y=eA{k_V2y$*SAr`{1X4sCYJLP$d%R-<uNw) zF}Za&p^Udeo=a9UTi+6EeeucP1{|<*-ba$#XG0`YnZjCyTQOqrLA62bIPwZi#CqEl zW)+_CJ-taaOyZMriR=YWW(TIFgvj-&v5l)XXt>ktTeshdI6+;Wv#Lv-={fnv?e)MO4i}hX1@Lj1h+4MC5Ph z8yDE;AG)}^ytnDq9UNVo2|qHS{K@`QMcXONd>%}a)&EkF02QpNjU$6J<2g(jJ`7<-AbhNoUM;^*@ zl+%Ax)Wg)y3V?7)0HWgn_(eVCDgbvC09bPcKrB;{Z|IcF- zG9>)(`&3WZIQGb<8b9RRXkKR>Bxf!4#$p@opfxx*#)9z7ezlCu81u-T_k_Vae|`|T r5SihSkuaf9jLe91Xnt^7I+aQbtg0366~C-OpRT~n$l9<5;TrotedWWh literal 0 HcmV?d00001 diff --git a/main/layout/gengrid/00_winset_thumbs_focus_bg.png b/main/layout/gengrid/00_winset_thumbs_focus_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..3f0e9c41c76249bae6a77ea3cc9fff2505f8d8e6 GIT binary patch literal 3145 zcma);Rag|-8ip5wbcr;=rX)sSXry6=PJzK0z@P_2Bt$8}89Lk`BJCikbV%sn5K4o@ zARsw}w1D7|5R{mM`<&y|dG@m}{`FnFf2{voH!J>O|;#jqGj%z;O0gP=M?w+yKy9dcxtCE_wI__}upJ@f9?N!v%f)ecU~7x&aV0 ziL*f?Y*sln_hxorrg50Zrasmjw1U>KL=1b17(|GU)g(?Re}coR<&3^Q6<>E=9A#1x z<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eJ?rGHfU&-XUM0*i;@>JHjr#xq literal 0 HcmV?d00001 diff --git a/main/layout/genlist/genlist_group_index.edc b/main/layout/genlist/genlist_group_index.edc new file mode 100755 index 0000000..5f42a9b --- /dev/null +++ b/main/layout/genlist/genlist_group_index.edc @@ -0,0 +1,421 @@ +/* + * Copyright 2012 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. + */ + + // 2.1.1 + group { name: "elm/genlist/item/groupindex/default"; + alias: "elm/genlist/item_odd/groupindex/default"; + alias: "elm/genlist/item_compress/groupindex/default"; + alias: "elm/genlist/item_compress_odd/groupindex/default"; + alias: "elm/genlist/item/grouptitle/default"; + alias: "elm/genlist/item_odd/grouptitle/default"; + alias: "elm/genlist/item_compress/grouptitle/default"; + alias: "elm/genlist/item_compress_odd/grouptitle/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + + GENLIST_IMAGE_GROUPINDEX + parts { + GENLIST_PART_BASE + GENLIST_PART_INDEX_BG_IMAGE + GENLIST_PART_PADDING_LEFT_SIZE(24) + GENLIST_PART_PADDING_RIGHT_SIZE(24) + GENLIST_PART_PADDING_TOP_SIZE(20) + GENLIST_PART_PADDING_BOTTOM_SIZE(14) + GENLIST_PART_TEXT("elm.text", + GENLIST_DESCRIPTION_LRT("elm.padding.left", "elm.padding.right", "elm.padding.top", + GENLIST_PARAM_INDEX_LIST + min: 0 38; fixed: 1 1;) + GENLIST_DESCRIPTION_INDEX_LIST + ) + GENLIST_PART_INDEX_LINE("elm.padding.left", "elm.padding.right", "elm.text", "elm.padding.bottom") + } + programs { + GENLIST_PROGRAM_DISABLED( target: "elm.text"; target: "index_line"; ) + GENLIST_PROGRAM_SELECT( target: "elm.text"; target: "index_line"; ) + } + } + + //2.1.3 + group { name: "elm/genlist/item/groupindex.icon/default"; + alias: "elm/genlist/item_odd/groupindex.icon/default"; + alias: "elm/genlist/item_compress/groupindex.icon/default"; + alias: "elm/genlist/item_compress_odd/groupindex.icon/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + data.item: "texts" "elm.text"; + data.item: "contents" "elm.icon"; + + GENLIST_IMAGE_GROUPINDEX + parts { + GENLIST_PART_INDEX_BG_IMAGE + GENLIST_PART_BASE + GENLIST_PART_PADDING_LEFT_SIZE(24) + GENLIST_PART_PADDING_RIGHT_SIZE(24) + GENLIST_PART_PADDING_TOP_SIZE(6) + GENLIST_PART_PADDING_BOTTOM_SIZE(6) + GENLIST_PART_ICON("elm.icon", + GENLIST_DESCRIPTION_L("elm.padding.left", + min: 64 64; max: 64 64; ) + ) + GENLIST_PART_PADDING_L_SIZE("elm.padding.icon.right", "elm.icon", 16) + GENLIST_PART_TEXT("elm.text", + GENLIST_DESCRIPTION_LRT("elm.padding.icon.right", "elm.padding.right", "elm.padding.top", + GENLIST_PARAM_INDEX_LIST + min: 0 36; fixed: 0 1;) + GENLIST_DESCRIPTION_INDEX_LIST + ) + GENLIST_PART_INDEX_LINE("elm.padding.icon.right", "elm.padding.right", "elm.text", "elm.padding.bottom") + } + programs { + GENLIST_PROGRAM_DISABLED( target: "elm.text"; target: "index_line"; ) + GENLIST_PROGRAM_SELECT( target: "elm.text"; target: "index_line"; ) + } + } +#if 0 + //2.1.4 + group { name: "elm/genlist/tree/groupindex.expandable/default"; + alias: "elm/genlist/tree_odd/groupindex.expandable/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + images { + image: "00_index list_bg.png" COMP; + image: "00_indexlist_icon_closed.png" COMP; + image: "00_indexlist_icon_opened.png" COMP; + image: "00_indexlist_icon_line.png" COMP; + } + parts { + GENLIST_PART_DISCLIP + GENLIST_PART_BG_IMAGE + GENLIST_PART_BASE + GENLIST_PART_BOTTOM_LINE + GENLIST_PART_PADDING_LEFT + GENLIST_PART_PADDING_RIGHT_SIZE_EDIT( 23 ) + //GENLIST_PART_TEXT_INDEX_LIST("elm.text", "elm.padding.left", "elm.divider") + part { name: "elm.divider"; + scale: 1; + GENLIST_DESCRIPTION_R("elm.padding.arrow.left", + min: 2 68; + max: 2 68; + fixed: 1 1; + image.normal: "00_indexlist_icon_line.png"; + ) + } + GENLIST_PART_PADDING_R_SIZE("elm.padding.arrow.left", "arrow", 23) + part { name: "arrow"; + ignore_flags: ON_HOLD; + mouse_events: 0; + scale: 1; + GENLIST_DESCRIPTION_R("elm.padding.right", + min: 42 42; + max: 42 42; + fixed: 1 1; + image.normal: "00_indexlist_icon_opened.png"; + ) + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "00_indexlist_icon_closed.png"; + } + } + } + programs { + GENLIST_PROGRAM_DISABLED_BOTTOMLINE( target: "elm.text"; ) + GENLIST_PROGRAM_SELECT_BOTTOMLINE( target: "elm.text";) + GENLIST_PROOGRAM_EXPAND("arrow", target: "arrow"; ) + } + } + + //2.1.5 + group { name: "elm/genlist/tree/groupindex.expandable.icon/default"; + alias: "elm/genlist/tree_odd/groupindex.expandable.icon/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + data.item: "contents" "elm.icon"; + images { + image: "00_indexlist_icon_closed.png" COMP; + image: "00_indexlist_icon_opened.png" COMP; + image: "00_indexlist_icon_line.png" COMP; + image: "00_index list_bg.png" COMP; + } + parts { + GENLIST_PART_DISCLIP + GENLIST_PART_BG_IMAGE + GENLIST_PART_BASE + GENLIST_PART_BOTTOM_LINE + GENLIST_PART_PADDING_LEFT + GENLIST_PART_PADDING_RIGHT_SIZE_EDIT( 23 ) + GENLIST_PART_ICON("elm.icon", GENLIST_DESCRIPTION_L("elm.padding.left", )) + GENLIST_PART_PADDING_L_SIZE("elm.padding.icon.right", "elm.icon", GENLIST_PADDING_SIZE_DEFAULT) + //GENLIST_PART_TEXT_INDEX_LIST("elm.text", "elm.padding.icon.right", "elm.divider") + part { name: "elm.divider"; + scale: 1; + GENLIST_DESCRIPTION_R("elm.padding.arrow.left", + min: 2 68; + max: 2 68; + fixed: 1 1; + image.normal: "00_indexlist_icon_line.png"; + ) + } + GENLIST_PART_PADDING_R_SIZE("elm.padding.arrow.left", "arrow", 23) + part { name: "arrow"; + ignore_flags: ON_HOLD; + mouse_events: 0; + scale: 1; + GENLIST_DESCRIPTION_R("elm.padding.right", + min: 42 42; + max: 42 42; + fixed: 1 1; + image.normal: "00_indexlist_icon_opened.png"; + ) + description { state: "active" 0.0; + inherit: "default" 0.0; + image.normal: "00_indexlist_icon_closed.png"; + } + } + } + programs { + GENLIST_PROGRAM_DISABLED_BOTTOMLINE( target: "elm.text"; ) + GENLIST_PROGRAM_SELECT_BOTTOMLINE( target: "elm.text";) + GENLIST_PROOGRAM_EXPAND("arrow", target: "arrow"; ) + } + } + + // FIXME: it seems that belows are not used anymore. + group { name : "elm/genlist/item/groupindex.readmessage/default"; + alias: "elm/genlist/item_odd/groupindex.readmessage/default"; + alias: "elm/genlist/item_compress/groupindex.readmessage/default"; + alias: "elm/genlist/item_compress_odd/groupindex.readmessage/default"; + alias : "elm/genlist/item/grouptitle.readmessage/default"; + alias: "elm/genlist/item_odd/grouptitle.readmessage/default"; + alias: "elm/genlist/item_compress/grouptitle.readmessage/default"; + alias: "elm/genlist/item_compress_odd/grouptitle.readmessage/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + + parts { + part { name: "base"; + type: RECT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + min: 0 GENLIST_HEIGHT_62_INC; + color: GENLIST_LIST_BG_COLOR; + } + } + GENLIST_PART_PADDING_LEFT_SIZE( GENLIST_PADDING_24_INC ) + GENLIST_PART_PADDING_RIGHT_SIZE_EDIT( GENLIST_PADDING_24_INC ) + part { name: "text_base"; + type: RECT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + color: GENLIST_PART_BUBBLE_DATE_BG_COLOR_INC; + rel2.relative: 1.0 0.62; + } + } + part { name: "elm.text"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.left"; + to_y: "text_base"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + to_y: "text_base"; + } + color: GENLIST_TEXT_COLOR_BUBBLE_READ_MESSAGE; + text { + font: "Tizen:style=Regular"; + size: GENLIST_FONT_28_INC; + min: 0 1; + align: 0.0 0.5; + text_class: "list_item"; + } + } + } + } + programs { + } + } + group { name : "elm/genlist/item/groupindex.sentmessage/default"; + alias: "elm/genlist/item_odd/groupindex.sentmessage/default"; + alias: "elm/genlist/item_compress/groupindex.sentmessage/default"; + alias: "elm/genlist/item_compress_odd/groupindex.sentmessage/default"; + alias : "elm/genlist/item/grouptitle.sentmessage/default"; + alias: "elm/genlist/item_odd/grouptitle.sentmessage/default"; + alias: "elm/genlist/item_compress/grouptitle.sentmessage/default"; + alias: "elm/genlist/item_compress_odd/grouptitle.sentmessage/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + + parts { + part { name: "base"; + type: RECT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + min: 0 GENLIST_HEIGHT_62_INC; + color: GENLIST_LIST_BG_COLOR; + } + } + GENLIST_PART_PADDING_LEFT_SIZE( GENLIST_PADDING_24_INC ) + GENLIST_PART_PADDING_RIGHT_SIZE_EDIT( GENLIST_PADDING_24_INC ) + part { name: "text_base"; + type: RECT; + repeat_events: 1; + scale: 1; + description { state: "default" 0.0; + color: GENLIST_PART_BUBBLE_DATE_BG_COLOR_INC; + rel2.relative: 1.0 0.62; + } + } + part { name: "elm.text"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.left"; + to_y: "text_base"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + to_y: "text_base"; + } + color: GENLIST_TEXT_COLOR_BUBBLE_READ_MESSAGE; + text { + font: "Tizen:style=Regular"; + size: GENLIST_FONT_28_INC; + min: 0 1; + align: 1.0 0.5; + text_class: "list_item"; + } + } + } + } + programs { + } + } + + /////////// will be removed //////// + group { name : "elm/genlist/item/groupindex.dialogue/default"; + alias: "elm/genlist/item_odd/groupindex.dialogue/default"; + alias: "elm/genlist/item_compress/groupindex.dialogue/default"; + alias: "elm/genlist/item_compress_odd/groupindex.dialogue/default"; + alias : "elm/genlist/item/grouptitle.dialogue/default"; + alias: "elm/genlist/item_odd/grouptitle.dialogue/default"; + alias: "elm/genlist/item_compress/grouptitle.dialogue/default"; + alias: "elm/genlist/item_compress_odd/grouptitle.dialogue/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + + parts { + GENLIST_PART_BASE__( GENLIST_HEIGHT_65_INC ) + GENLIST_PART_PADDING_LEFT + GENLIST_PART_PADDING_RIGHT_EDIT + + part { name: "elm.text"; + type: TEXT; + scale: 1; + description { state: "default" 0.0; + rel1 { + relative: 1.0 0.5; + to_x: "elm.padding.left"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + } + color: GENLIST_DIALOGUE_GROUP_TITLE_COLOR; + text { + font: "Tizen:style=Medium"; + size: GENLIST_FONT_28_INC; + min: 0 1; + align: 0.0 0.0; + text_class: "list_item"; + } + } + } + part { name: "bottom_line"; + type: RECT; + description { state: "default" 0.0; + min: 0 1; + fixed: 0 1; + color: GENLIST_LIST_LINE1_COLOR; + rel1 { + relative: 0.0 1.0; + offset: 0 -1; + } + } + } + GENLIST_PART_DISCLIP + } + } + group { name : "elm/genlist/item/groupindex.dialogue.seperator/default"; + alias: "elm/genlist/item_odd/groupindex.dialogue.seperator/default"; + alias: "elm/genlist/item_compress/groupindex.dialogue.seperator/default"; + alias: "elm/genlist/item_compress_odd/groupindex.dialogue.seperator/default"; + alias : "elm/genlist/item/grouptitle.dialogue.seperator/default"; + alias: "elm/genlist/item_odd/grouptitle.dialogue.seperator/default"; + alias: "elm/genlist/item_compress/grouptitle.dialogue.seperator/default"; + alias: "elm/genlist/item_compress_odd/grouptitle.dialogue.seperator/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "treesize" "GENLIST_TREESIZE_DEFAULT"; + + parts { + GENLIST_PART_BASE__( GENLIST_HEIGHT_33_INC ) + part { name: "bottom_line"; + type: RECT; + description { state: "default" 0.0; + min: 0 1; + fixed: 0 1; + color: GENLIST_LIST_LINE1_COLOR; + rel1 { + relative: 0.0 1.0; + offset: 0 -1; + } + } + } + GENLIST_PART_DISCLIP + } + } + ///////////////////////////////////////////////// +#endif + diff --git a/main/layout/genlist/genlist_macro.edc b/main/layout/genlist/genlist_macro.edc new file mode 100755 index 0000000..fb19c74 --- /dev/null +++ b/main/layout/genlist/genlist_macro.edc @@ -0,0 +1,2818 @@ +/* + * Copyright 2012 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. + */ + +//****************************************************************************// +// ******************************* Default size macro **********************// +//**************************************************************************// +// if size is different for each theme, split it into each theme inc. + +#define GENLIST_HEIGHT_1LINE 112 +#define GENLIST_HEIGHT_2LINE_MAIN 54 +#define GENLIST_HEIGHT_2LINE_SUB 42 +#define GENLIST_HEIGHT_3LINE_MAIN 54 +#define GENLIST_HEIGHT_3LINE_SUB1 42 +#define GENLIST_HEIGHT_3LINE_SUB2 38 +#define GENLIST_HEIGHT_MULTILINE_SUB 38 +#define GENLIST_PART_LIST_LINE_HEIGHT 1 +#define GENLIST_HEIGHT_GROUPTITLE 46 + +#define GENLIST_PADDING_SIZE_DEFAULT 16 +#define GENLIST_PADDING_SIZE_LEFT 26 +#define GENLIST_PADDING_SIZE_RIGHT 26 +#define GENLIST_PADDING_SIZE_TOP_2LINE 22 +#define GENLIST_PADDING_SIZE_BOTTOM_2LINE 22 +#define GENLIST_PADDING_SIZE_TOP_3LINE 17 +#define GENLIST_PADDING_SIZE_BOTTOM_3LINE 17 +#define GENLIST_PADDING_SIZE_NDEPTH 26 + +#define DIALOGUE_PADDING_SCROLLER 16 +#define DIALOGUE_PADDING_SIZE_LEFT 16+20 +#define DIALOGUE_PADDING_SIZE_RIGHT 16+20 + +#define GENLIST_ICON_BIG_SIZE 74 +#define GENLIST_ICON_SMALL_SIZE 38 +#define GENLIST_ICON_STAR_SIZE 38 +#define GENLIST_ICON_THUMBNAIL1_SIZE 104 +#define GENLIST_BTN_01_HEIGHT 74 +#define GENLIST_BTN_02_SIZE 74 +#define GENLIST_ICON_ONOFF_WIDTH 132 +#define GENLIST_ICON_ONOFF_HEIGHT 70 +#define GENLIST_ICON_CHECK_RADIO_SIZE 64 +#define GENLIST_ICON_COLORBAR_SIZE 7 +#define GENLIST_ICON_PASSWORD_SIZE 82 + +#define GENLIST_TREESIZE_DEFAULT 26 + +//#define GENLIST_DIALOGUE_SEPARATOR_DEFAULT_HEIGHT 40 + +//****************************************************************************// +// ***************** EDJE description have 24 patterns **********************// + //**************************************************************************// +// ------------------ +// | PART == HERE | +// ------------------ + #define GENLIST_DESCRIPTION_ENVELOP( PART, PARAM ) \ + description { state: "default" 0.0;\ + rel1 { \ + relative: 0 0; \ + to: PART; \ + }\ + rel2 {\ + relative: 1 1;\ + to: PART; \ + }\ + PARAM\ + } + +// | top | +// --------------------- +// left | HERE | right +// --------------------- +// | bottom | +#define GENLIST_DESCRIPTION( left, right, top, bottom, param ) \ + description { state: "default" 0.0;\ + rel1 { \ + relative: 1 1; \ + to_x: left; \ + to_y: top; \ + }\ + rel2 {\ + relative: 0 0;\ + to_x: right;\ + to_y: bottom;\ + }\ + param\ + } + +// --------------------- +// left |--> HERE +// --------------------- +#define GENLIST_DESCRIPTION_L( left, param ) \ + description { state: "default" 0.0;\ + align: 0 0.5; \ + fixed: 1 0; \ + rel1 { \ + relative: 1 0; \ + to_x: left; \ + to_y: "base"; \ + }\ + rel2 { \ + relative: 1 1;\ + to_x: left; \ + to_y: "base"; \ + }\ + param\ + } + +// --------------------- +// HERE <--| right +// --------------------- +#define GENLIST_DESCRIPTION_R( right, param ) \ + description { state: "default" 0.0;\ + align: 1 0.5; \ + fixed: 1 0; \ + rel1 { \ + relative: 0 0; \ + to_x: right; \ + to_y: "base"; \ + }\ + rel2 {\ + relative: 0 1;\ + to_x: right; \ + to_y: "base"; \ + }\ + param\ + } + +// -------------------------- +// left |--> HERE <--| right +// -------------------------- +#define GENLIST_DESCRIPTION_LR( left, right, param ) \ + description { state: "default" 0.0;\ + rel1 { \ + relative: 1 0; \ + to_x: left; \ + to_y: "base"; \ + }\ + rel2 {\ + relative: 0 1;\ + to_x: right;\ + to_y: "base"; \ + }\ + param\ + } + +// | top | +// ----------------- +// | HERE <--| right +// ----------------- +// | bottom | +#define GENLIST_DESCRIPTION_RTB( right, top, bottom, param ) \ + description { state: "default" 0.0;\ + align: 1 0.5;\ + rel1 { \ + relative: 0 1; \ + to_x: right; \ + to_y: top; \ + }\ + rel2 {\ + relative: 0 0;\ + to_x: right;\ + to_y: bottom;\ + }\ + param\ + } + +// left | HERE | right +// --------------------- +// | bottom | +#define GENLIST_DESCRIPTION_LRB( left, right, bottom, param ) \ + description { state: "default" 0.0;\ + align: 0.5 1;\ + rel1 { \ + relative: 1 0; \ + to_x: left; \ + to_y: bottom; \ + }\ + rel2 {\ + relative: 0 0;\ + to_x: right;\ + to_y: bottom;\ + }\ + param\ + } + +// | top | +// --------------------- +// left | HERE | right +#define GENLIST_DESCRIPTION_LRT( left, right, top, param ) \ + description { state: "default" 0.0;\ + align: 0.5 0;\ + rel1 { \ + relative: 1 1; \ + to_x: left; \ + to_y: top; \ + }\ + rel2 {\ + relative: 0 1;\ + to_x: right;\ + to_y: top;\ + }\ + param\ + } + +// | top | +// --------------------- +// left | --> HERE | +#define GENLIST_DESCRIPTION_LT( left, top, param ) \ + description { state: "default" 0.0;\ + align: 0 0;\ + rel1 { \ + relative: 1 1; \ + to_x: left; \ + to_y: top; \ + }\ + rel2 {\ + relative: 1 1;\ + to_x: left;\ + to_y: top;\ + }\ + param\ + } + +// left | --> HERE | +// --------------------- +// | bottom | +#define GENLIST_DESCRIPTION_LB( left, bottom, param ) \ + description { state: "default" 0.0;\ + align: 0 1;\ + rel1 { \ + relative: 1 0; \ + to_x: left; \ + to_y: bottom; \ + }\ + rel2 {\ + relative: 1 0;\ + to_x: left;\ + to_y: bottom;\ + }\ + param\ + } + +// | top | +// --------------------- +// left |--> HERE | +// --------------------- +// | bottom | +#define GENLIST_DESCRIPTION_LTB( left, top, bottom, param ) \ + description { state: "default" 0.0;\ + align: 0 0.5;\ + rel1 { \ + relative: 1 1; \ + to_x: left; \ + to_y: top; \ + }\ + rel2 {\ + relative: 1 0;\ + to_x: left;\ + to_y: bottom;\ + }\ + param\ + } + +// | top | +// --------------------- +// | HERE <--| right +#define GENLIST_DESCRIPTION_RT( right, top, param ) \ + description { state: "default" 0.0;\ + align: 1 0;\ + rel1 { \ + relative: 0 1; \ + to_x: right; \ + to_y: top; \ + }\ + rel2 {\ + relative: 0 1;\ + to_x: right;\ + to_y: top;\ + }\ + param\ + } + +// | HERE <-- | right +// --------------------- +// | bottom | +#define GENLIST_DESCRIPTION_RB( right, bottom, param ) \ + description { state: "default" 0.0;\ + align: 1 1;\ + rel1 { \ + relative: 0 0; \ + to_x: right; \ + to_y: bottom; \ + }\ + rel2 {\ + relative: 0 0;\ + to_x: right;\ + to_y: bottom;\ + }\ + param\ + } + +// | top | +// ---------- +// | HERE | +// ---------- +// | bottom | +#define GENLIST_DESCRIPTION_TB( top, bottom, param ) \ + description { state: "default" 0.0;\ + align: 0.5 0.5;\ + rel1 { \ + relative: 0 1; \ + to_y: top; \ + }\ + rel2 {\ + relative: 1 0;\ + to_y: bottom;\ + }\ + param\ + } + +#define GENLIST_DATA_ITEM_NORMAL \ + data.item: "stacking" "above"; \ + data.item: "selectraise" "on"; \ + data.item: "flips" "elm.flip.icon elm.flip.content"; \ + data.item: "treesize" GENLIST_TREESIZE_DEFAULT; + +/*****************************************************************************/ +/******************************* Dialogue group ******************************/ +/*****************************************************************************/ +#define GENLIST_DIALOGUE_INHERIT_BODY( _PARTS ) \ + data.item: "treesize" 0; \ + GENLIST_IMAGES_DIALOGUE_BG_IMAGE \ + parts { \ + GENLIST_PART_BG_IMAGE_DIALOGUE \ + GENLIST_PART_BOTTOM_LINE_OFF \ + GENLIST_PART_PADDING_LEFT_SIZE( DIALOGUE_PADDING_SIZE_LEFT ) \ + GENLIST_PART_PADDING_RIGHT_SIZE_EDIT( DIALOGUE_PADDING_SIZE_RIGHT ) \ + _PARTS \ + GENLIST_PART_FLIP \ + } + +//****************************************************************************// +// ****************************** BG Image **********************************// +//****************************************************************************// +#define GENLIST_IMAGE_GROUPINDEX \ + images { \ + image: "00_index list_bg.png" COMP; \ + } +#define GENLIST_PART_INDEX_BG_IMAGE \ + part { name: "bg_image"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + color: GENLIST_GROUPINDEX_LIST_BG_COLOR; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_GROUPINDEX_LIST_PRESS_COLOR; \ + } \ + GENLIST_DESCRIPTION_FADEOUT \ + } + +#define GENLIST_PART_BG_IMAGE \ + part { name: "bg_image_clip"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + description { state: "2depth" 0.0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "bg_image"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + color: GENLIST_LIST_BG_COLOR; \ + } \ + description { state: "selected" 0.0; \ + color: GENLIST_LIST_PRESS_COLOR; \ + } \ + description { state: "disabled" 0.0; \ + color: GENLIST_LIST_DIM_COLOR; \ + } \ + GENLIST_DESCRIPTION_FADEOUT \ + } + +#define GENLIST_IMAGES_DIALOGUE_BG_IMAGE \ + images { \ + image : "00_list_group_bg.png" COMP; \ + image : "00_list_group_bg_top.png" COMP; \ + image : "00_list_group_bg_center.png" COMP; \ + image : "00_list_group_bg_bottom.png" COMP; \ + image : "00_list_group_bg_press.png" COMP; \ + image : "00_list_group_bg_top_press.png" COMP; \ + image : "00_list_group_bg_center_press.png" COMP; \ + image : "00_list_group_bg_bottom_press.png" COMP; \ + } + +#define GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + rel1 { \ + to_x: "bg_image_left"; \ + relative: 1 0; \ + } \ + rel2 { \ + to_x: "bg_image_right"; \ + relative: 0 1; \ + } + +#define GENLIST_PART_BG_IMAGE_DIALOGUE \ + part { name: "bg_image_clip"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + color: 255 255 255 255; \ + } \ + description { state: "2depth" 0.0; \ + color: 220 218 211 255; \ + } \ + } \ + part { name: "bg_image_left"; \ + type: SPACER; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 16 0; \ + max: 16 -1; \ + fixed: 1 0; \ + align: 0 0.5; \ + rel2.relative: 0 1; \ + } \ + } \ + part { name: "bg_image_right"; \ + type: SPACER; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 16 0; \ + max: 16 -1; \ + fixed: 1 0; \ + align: 1 0.5; \ + rel1.relative: 1 0; \ + } \ + description { state: "editmode" 0.0; \ + inherit: "default" 0.0; \ + min: (GENLIST_PADDING_SIZE_DEFAULT*2+GENLIST_ICON_BIG_SIZE) 0; \ + max: (GENLIST_PADDING_SIZE_DEFAULT*2+GENLIST_ICON_BIG_SIZE) 0; \ + } \ + } \ + part { name: "bg_image"; \ + clip_to: "bg_image_clip"; \ + type: IMAGE; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + color: 255 255 255 255; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg.png"; \ + border: 14 14 10 10; \ + border_scale: 1; \ + } \ + } \ + description { state: "selected" 0.0; \ + color: 255 255 255 255; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg_press.png"; \ + border: 14 14 10 10; \ + border_scale: 1; \ + } \ + } \ + description { state: "top" 0.0; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg_top.png"; \ + border: 14 14 10 2; \ + border_scale: 1; \ + } \ + } \ + description { state: "top_selected" 0.0; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg_top_press.png"; \ + border: 14 14 10 2; \ + border_scale: 1; \ + } \ + } \ + description { state: "center" 0.0; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg_center.png"; \ + border: 14 14 2 2; \ + border_scale: 1; \ + } \ + } \ + description { state: "center_selected" 0.0; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg_center_press.png"; \ + border: 14 14 2 2; \ + border_scale: 1; \ + } \ + } \ + description { state: "bottom" 0.0; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg_bottom.png"; \ + border: 14 14 2 10; \ + border_scale: 1; \ + } \ + } \ + description { state: "bottom_selected" 0.0; \ + GENLIST_PARAM_BG_IMAGE_DIALOGUE \ + image { \ + normal: "00_list_group_bg_bottom_press.png"; \ + border: 14 14 2 10; \ + border_scale: 1; \ + } \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default"; \ + color: 255 255 255 255; \ + } \ + GENLIST_DESCRIPTION_FADEOUT \ + } + +//****************************************************************************// +// ****************************** BASE ********************************// +//****************************************************************************// +#define GENLIST_PART_BASE \ + part { name: "base"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + align: 0.5 0.5; \ + color: 0 0 0 0; \ + } \ + } \ + GENLIST_PART_PERSPECTIVE_POINT + +#define GENLIST_PART_BASE_REORDER \ + part { name: "base"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + align: 0.5 0.5; \ + color: 0 0 0 0; \ + rel1 { \ + relative: 1 0; \ + to_x: "reorder.padding.left"; \ + } \ + rel2 { \ + relative: 0 1; \ + to_x: "reorder.padding.right"; \ + } \ + } \ + } \ + part { name: "reorder.padding.left"; \ + type: SPACER; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel2.relative: 0 1; \ + align: 0 0.5; \ + } \ + description { state: "reorder" 0.0; \ + inherit: "default" 0.0; \ + min: 16 0; \ + max: 16 -1; \ + } \ + } \ + part { name: "reorder.padding.right"; \ + type: SPACER; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + rel1.relative: 1 0; \ + align: 1 0.5; \ + } \ + description { state: "reorder" 0.0; \ + inherit: "default" 0.0; \ + min: 16 0; \ + max: 16 -1; \ + } \ + } \ + GENLIST_PART_PERSPECTIVE_POINT + +//****************************************************************************// +// ****************************** LINE ********************************// +//****************************************************************************// +#define GENLIST_PART_BOTTOM_LINE \ + part { name: "bottom_line"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 GENLIST_PART_LIST_LINE_HEIGHT; \ + max: -1 GENLIST_PART_LIST_LINE_HEIGHT; \ + fixed: 0 1; \ + align: 0.5 1; \ + color: GENLIST_LIST_LINE1_COLOR; \ + rel1.to: "bottom_line2"; \ + rel2.to: "bottom_line2"; \ + rel2.relative: 1 0; \ + } \ + description { state: "reorder" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_PRESS_COLOR; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_DIM_COLOR; \ + } \ + GENLIST_DESCRIPTION_FADEOUT \ + } \ + part { name: "bottom_line2"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 GENLIST_PART_LIST_LINE_HEIGHT; \ + max: -1 GENLIST_PART_LIST_LINE_HEIGHT; \ + fixed: 0 1; \ + align: 0.5 1; \ + color: GENLIST_LIST_LINE2_COLOR; \ + rel1.to_x: "elm.padding.left"; \ + rel1.relative: 1 0; \ + rel2.to_x: "elm.padding.right"; \ + rel2.relative: 0 1; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_PRESS_COLOR; \ + } \ + description { state: "reorder" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_DIM_COLOR; \ + } \ + GENLIST_DESCRIPTION_FADEOUT \ + } + +#define GENLIST_PART_BOTTOM_LINE_OFF \ + part { name: "bottom_line"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "reorder" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + } \ + part { name: "bottom_line2"; \ + type: RECT; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "reorder" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + } + +#define GENLIST_PART_DIVIDER_MARGIN \ + GENLIST_PART_SPACER("elm.padding.divider.top", \ + GENLIST_DESCRIPTION_ENVELOP("base", \ + align: 0.5 0; \ + min: 0 30; \ + max: -1 30; \ + fixed: 0 1; \ + rel2.relative: 1 0; \ + ) \ + ) \ + GENLIST_PART_SPACER("elm.padding.divider.bottom", \ + GENLIST_DESCRIPTION_ENVELOP("base", \ + align: 0.5 1; \ + min: 0 30; \ + max: -1 30; \ + fixed: 0 1; \ + rel1.relative: 0 1; \ + ) \ + ) \ + +#define GENLIST_PART_DIVIDER_L(LEFT) \ + GENLIST_PART_DIVIDER_MARGIN \ + GENLIST_PART_RECT("elm.divider1", \ + mouse_events: 0; \ + GENLIST_DESCRIPTION_LTB(LEFT, "elm.padding.divider.top", "elm.padding.divider.bottom", \ + min: 1 0; \ + max: 1 -1; \ + fixed: 1 0; \ + color: GENLIST_LIST_DIVIDER1_COLOR; \ + ) \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + ) \ + GENLIST_PART_RECT("elm.divider2", \ + mouse_events: 0; \ + GENLIST_DESCRIPTION_LTB("elm.divider1", "elm.padding.divider.top", "elm.padding.divider.bottom", \ + min: 1 0; \ + max: 1 -1; \ + fixed: 1 0; \ + color: GENLIST_LIST_DIVIDER2_COLOR; \ + ) \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + ) + +#define GENLIST_PART_DIVIDER_R(RIGHT) \ + GENLIST_PART_DIVIDER_MARGIN \ + GENLIST_PART_RECT("elm.divider1", \ + mouse_events: 0; \ + GENLIST_DESCRIPTION_RTB("elm.divider2", "elm.padding.divider.top", "elm.padding.divider.bottom", \ + min: 1 0; \ + max: 1 -1; \ + fixed: 1 0; \ + color: GENLIST_LIST_DIVIDER1_COLOR; \ + ) \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + ) \ + GENLIST_PART_RECT("elm.divider2", \ + mouse_events: 0; \ + GENLIST_DESCRIPTION_RTB(RIGHT, "elm.padding.divider.top", "elm.padding.divider.bottom", \ + min: 1 0; \ + max: 1 -1; \ + fixed: 1 0; \ + color: GENLIST_LIST_DIVIDER2_COLOR; \ + ) \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + ) + +#define GENLIST_PART_CENTER_LINE_LT(LEFT, TOP) \ + GENLIST_PART_SPACER("elm.padding.divider.left", \ + GENLIST_DESCRIPTION_L(LEFT, \ + min: 16 0; \ + max: 16 -1; \ + fixed: 1 0; \ + ) \ + ) \ + GENLIST_PART_SPACER("elm.padding.divider.right", \ + GENLIST_DESCRIPTION_ENVELOP("base", \ + min: 16 0; \ + max: 16 -1; \ + fixed: 1 0; \ + align: 1 0.5; \ + rel1.relative: 1 0; \ + ) \ + ) \ + GENLIST_PART_RECT("center_line", \ + mouse_events: 0; \ + GENLIST_DESCRIPTION_LRT("elm.padding.divider.left", "elm.padding.divider.right", TOP, \ + min: 0 1; \ + max: -1 1; \ + fixed: 0 1; \ + color: GENLIST_LIST_DIVIDER1_COLOR; \ + ) \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + ) \ + GENLIST_PART_RECT("center_line2", \ + GENLIST_DESCRIPTION_LRT("elm.padding.divider.left", "elm.padding.divider.right", "center_line", \ + min: 0 1; \ + max: -1 1; \ + fixed: 0 1; \ + color: GENLIST_LIST_DIVIDER2_COLOR; \ + ) \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + ) + +#define GENLIST_PART_COLORBAR \ + GENLIST_PART_SPACER("elm.padding.colorbar.top", \ + GENLIST_DESCRIPTION_ENVELOP("base", \ + align: 0.5 0; \ + fixed: 0 1; \ + min: 0 4; \ + max: -1 4; \ + rel2.relative: 1 0; \ + ) \ + ) \ + GENLIST_PART_SPACER("elm.padding.colorbar.bottom", \ + GENLIST_DESCRIPTION_ENVELOP("base", \ + align: 0.5 1; \ + fixed: 0 1; \ + min: 0 4; \ + max: -1 4; \ + rel1.relative: 0 1; \ + ) \ + ) \ + GENLIST_PART_ICON("elm.swallow.colorbar", \ + GENLIST_DESCRIPTION_LTB("bg_image", "elm.padding.colorbar.top", "elm.padding.colorbar.bottom", \ + min: GENLIST_ICON_COLORBAR_SIZE 0; \ + max: GENLIST_ICON_COLORBAR_SIZE -1; \ + fixed: 1 0; \ + rel1.relative: 0 1; \ + rel2.relative: 0 0; \ + ) \ + GENLIST_DESCRIPTION_FADEOUT \ + ) + +//****************************************************************************// +//********************************* PADDING **********************************// +//****************************************************************************// +#define GENLIST_PART_EXPANDED_PAD \ + part { name: "elm.swallow.pad"; \ + type: SWALLOW; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + visible: 0; \ + min: 0 0; \ + fixed: 1 0; \ + align: 0.0 0.5; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel2.relative: 0.0 1.0; \ + } \ + } \ + +#define GENLIST_PART_PADDING( NAME, SIZE, REL1, REL2 ) \ + GENLIST_PART_SPACER(NAME, \ + description { state: "default" 0.0; \ + min: SIZE 0; \ + max: SIZE -1; \ + fixed: 1 0; \ + align: 0.5 0.5; \ + rel1 { \ + relative: REL1; \ + to: "base"; \ + } \ + rel2 { \ + relative: REL2; \ + to: "base"; \ + } \ + } \ + ) + +#define GENLIST_PART_PADDING_LEFT \ + GENLIST_PART_EXPANDED_PAD \ + GENLIST_PART_SPACER("elm.padding.left", \ + GENLIST_DESCRIPTION_L("elm.swallow.pad", \ + min: GENLIST_PADDING_SIZE_LEFT 0; \ + max: GENLIST_PADDING_SIZE_LEFT -1; \ + fixed: 1 0; \ + ) \ + ) + +#define GENLIST_PART_PADDING_LEFT_SIZE( SIZE ) \ + GENLIST_PART_EXPANDED_PAD \ + GENLIST_PART_SPACER("elm.padding.left", \ + GENLIST_DESCRIPTION_L("elm.swallow.pad", \ + min: SIZE 0; \ + max: SIZE -1; \ + fixed: 1 0; \ + ) \ + ) + +#define GENLIST_PART_EDITBTN \ + part { name: "elm.icon.edit"; \ + type: SWALLOW; \ + scale: 1; \ + GENLIST_DESCRIPTION_R("elm.padding.edit.right", \ + fixed: 1 1; \ + visible: 0; \ + min: GENLIST_ICON_BIG_SIZE GENLIST_ICON_BIG_SIZE; \ + max: GENLIST_ICON_BIG_SIZE GENLIST_ICON_BIG_SIZE; \ + ) \ + description { state: "editmode" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + GENLIST_PART_SPACER("elm.padding.edit.right", \ + description { state: "default" 0.0; \ + fixed: 1 0; \ + align: 1.0 0.5; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel1.relative: 1 0; \ + min: GENLIST_PADDING_SIZE_RIGHT 0; \ + max: GENLIST_PADDING_SIZE_RIGHT -1; \ + } \ + ) + +#define GENLIST_PART_PADDING_RIGHT \ + GENLIST_PART_SPACER("elm.padding.right", \ + description { state: "default" 0.0; \ + min: GENLIST_PADDING_SIZE_RIGHT 0; \ + max: GENLIST_PADDING_SIZE_RIGHT -1; \ + fixed: 1 0; \ + align: 1.0 0.5; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel1.relative: 1 0; \ + } \ + ) + +#define GENLIST_PART_PADDING_RIGHT_SIZE( SIZE ) \ + GENLIST_PART_SPACER("elm.padding.right", \ + description { state: "default" 0.0; \ + min: SIZE 0; \ + max: SIZE -1; \ + fixed: 1 0; \ + align: 1.0 0.5; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel1.relative: 1 0; \ + } \ + ) + +#define GENLIST_PART_PADDING_RIGHT_EDIT \ + GENLIST_PART_SPACER("elm.padding.right", \ + description { state: "default" 0.0; \ + min: GENLIST_PADDING_SIZE_RIGHT 0; \ + max: GENLIST_PADDING_SIZE_RIGHT -1; \ + fixed: 1 0; \ + align: 1.0 0.5; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel1.relative: 1 0; \ + } \ + description { state: "editmode" 0.0; \ + inherit: "default" 0.0; \ + min: (DIALOGUE_PADDING_SIZE_RIGHT+GENLIST_ICON_BIG_SIZE+GENLIST_PADDING_SIZE_RIGHT) 0; \ + max: (DIALOGUE_PADDING_SIZE_RIGHT+GENLIST_ICON_BIG_SIZE+GENLIST_PADDING_SIZE_RIGHT) -1; \ + } \ + ) \ + GENLIST_PART_EDITBTN + +#define GENLIST_PART_PADDING_RIGHT_SIZE_EDIT( SIZE ) \ + GENLIST_PART_SPACER("elm.padding.right", \ + description { state: "default" 0.0; \ + min: SIZE 0; \ + max: SIZE -1; \ + fixed: 1 0; \ + align: 1.0 0.5; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel1.relative: 1 0; \ + } \ + description { state: "editmode" 0.0; \ + inherit: "default" 0.0; \ + min: (DIALOGUE_PADDING_SIZE_RIGHT+SIZE+GENLIST_ICON_BIG_SIZE) 0; \ + max: (DIALOGUE_PADDING_SIZE_RIGHT+SIZE+GENLIST_ICON_BIG_SIZE) -1; \ + } \ + ) \ + GENLIST_PART_EDITBTN + +#define GENLIST_PART_PADDING_TOP_2LINE \ + GENLIST_PART_SPACER("elm.padding.top", \ + description { \ + state: "default" 0.0; \ + min: 0 GENLIST_PADDING_SIZE_TOP_2LINE; \ + max: -1 GENLIST_PADDING_SIZE_TOP_2LINE; \ + fixed: 0 1; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel2.relative: 1.0 0.0; \ + align: 0.5 0.0; \ + } \ + ) + +#define GENLIST_PART_PADDING_TOP_SIZE( SIZE ) \ + GENLIST_PART_SPACER("elm.padding.top", \ + description { \ + state: "default" 0.0; \ + min: 0 SIZE; \ + max: -1 SIZE; \ + fixed: 0 1; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel2.relative: 1.0 0.0; \ + align: 0.5 0.0; \ + } \ + ) + + +#define GENLIST_PART_PADDING_BOTTOM_2LINE \ + GENLIST_PART_SPACER("elm.padding.bottom", \ + description { state: "default" 0.0; \ + min: 0 GENLIST_PADDING_SIZE_BOTTOM_2LINE; \ + max: -1 GENLIST_PADDING_SIZE_BOTTOM_2LINE; \ + fixed: 0 1; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel1.relative: 0.0 1.0; \ + align: 0.5 1.0; \ + } \ + ) + +#define GENLIST_PART_PADDING_BOTTOM_SIZE( SIZE ) \ + GENLIST_PART_SPACER("elm.padding.bottom", \ + description { state: "default" 0.0; \ + min: 0 SIZE; \ + max: -1 SIZE; \ + fixed: 0 1; \ + rel1.to: "base"; \ + rel2.to: "base"; \ + rel1.relative: 0.0 1.0; \ + align: 0.5 1.0; \ + } \ + ) + +#define GENLIST_PART_PADDING_R( NAME, RIGHT ) \ + GENLIST_PART_SPACER(NAME, \ + description { state: "default" 0.0; \ + fixed: 1 0; \ + min: GENLIST_PADDING_SIZE_DEFAULT 0; \ + max: GENLIST_PADDING_SIZE_DEFAULT -1; \ + align: 1 0.5; \ + rel1 { \ + relative: 0 0; \ + to_x: RIGHT; \ + } \ + rel2 { \ + relative: 0 1; \ + to_x: RIGHT; \ + } \ + } \ + ) + +#define GENLIST_PART_PADDING_R_SIZE( NAME, RIGHT, SIZE ) \ + GENLIST_PART_SPACER(NAME, \ + description { state: "default" 0.0; \ + fixed: 1 0; \ + min: SIZE 0; \ + max: SIZE -1; \ + align: 1 0.5; \ + rel1 { \ + relative: 0 0; \ + to_x: RIGHT; \ + } \ + rel2 { \ + relative: 0 1; \ + to_x: RIGHT; \ + } \ + } \ + ) + +#define GENLIST_PART_PADDING_L( NAME, LEFT ) \ + GENLIST_PART_SPACER(NAME, \ + description { state: "default" 0.0; \ + fixed: 1 0; \ + min: GENLIST_PADDING_SIZE_DEFAULT 0; \ + max: GENLIST_PADDING_SIZE_DEFAULT -1; \ + align: 0 0.5; \ + rel1 { \ + relative: 1 0; \ + to_x: LEFT; \ + } \ + rel2 { \ + relative: 1 1; \ + to_x: LEFT; \ + } \ + } \ + ) + +#define GENLIST_PART_PADDING_L_SIZE( NAME, LEFT, SIZE ) \ + GENLIST_PART_SPACER(NAME, \ + description { state: "default" 0.0; \ + fixed: 1 0; \ + min: SIZE 0; \ + max: SIZE -1; \ + align: 0 0.5; \ + rel1 { \ + relative: 1 0; \ + to_x: LEFT; \ + } \ + rel2 { \ + relative: 1 1; \ + to_x: LEFT; \ + } \ + } \ + ) + + +#define GENLIST_PART_PADDING_T_SIZE( NAME, TOP, SIZE ) \ + GENLIST_PART_SPACER(NAME, \ + description { state: "default" 0.0; \ + min: 0 SIZE; \ + max: -1 SIZE; \ + fixed: 0 1; \ + align: 0.5 0; \ + rel1 { \ + relative: 0 1; \ + to: TOP; \ + } \ + rel2 { \ + relative: 1 1; \ + to: TOP; \ + } \ + } \ + ) + +#define GENLIST_PART_PADDING_B_SIZE( NAME, BOTTOM, SIZE ) \ + GENLIST_PART_SPACER(NAME, \ + description { state: "default" 0.0; \ + min: 0 SIZE; \ + max: -1 SIZE; \ + fixed: 0 1; \ + align: 0.5 1; \ + rel1 { \ + relative: 0.5 0; \ + to: BOTTOM; \ + } \ + rel2 { \ + relative: 0.5 0; \ + to: BOTTOM; \ + } \ + } \ + ) + +#define GENLIST_PART_PERSPECTIVE_POINT \ + GENLIST_PART_RECT("point", \ + description { \ + state: "default" 0.0; \ + color: 0 0 0 0; \ + rel1 { relative: 0.0 0.0; } \ + rel2 { relative: 1.0 0.0; } \ + } \ + ) + +#define GENLIST_DESCRIPTION_ROTATE( param_x, param_y, param_z ) \ + description { state: "map_contracted" 0.0; \ + inherit: "default" 0.0; \ + map { \ + perspective: "point"; \ + on: 1; \ + smooth: 1; \ + perspective_on: 1; \ + backface_cull: 1; \ + rotation { \ + center: "point"; \ + x: param_x; \ + y: param_y; \ + z: param_z; \ + } \ + } \ + } \ + description { state: "map_expanded" 0.0; \ + inherit: "default" 0.0; \ + map { \ + perspective: "point"; \ + on: 1; \ + smooth: 1; \ + perspective_on: 1; \ + backface_cull: 1; \ + rotation { \ + center: "point"; \ + x: 0; \ + y: 0; \ + z: 0; \ + } \ + } \ + } \ + description { \ + state: "hide" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } + +#define GENLIST_PROGRAM_ROTATE( TARGET ) \ + program { name: "map_expand_start"; \ + signal: "flip_item"; \ + action: STATE_SET "map_contracted" 0.0; \ + target: "bg_image"; \ + TARGET \ + after: "map_expanding"; \ + } \ + program { name: "map_expanding"; \ + action: STATE_SET "hide" 0.0; \ + transition: LINEAR 0.2; \ + target: "bg_image"; \ + TARGET \ + after: "map_expand_end"; \ + } \ + program { name: "map_expand_end"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + TARGET \ + } \ + program { name: "map_contract_start"; \ + signal: "elm,state,contract_flip"; \ + action: STATE_SET "map_expanded" 0.0; \ + target: "bg_image"; \ + TARGET \ + after: "map_contracting"; \ + } \ + program { name: "map_contracting"; \ + action: STATE_SET "map_contracted" 0.0; \ + transition: LINEAR 0.3; \ + target: "bg_image"; \ + TARGET \ + after: "map_contract_end"; \ + } \ + program { name: "map_contract_end"; \ + action: STATE_SET "hide" 0.0; \ + target: "bg_image"; \ + TARGET \ + } + +// FIXME: swallow part cannot be fade out ??? +#define GENLIST_DESCRIPTION_FADEOUT_ICON \ + description { state: "fadeout" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + description { state: "fadein" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + +#define GENLIST_DESCRIPTION_FADEOUT_RECT \ + description { state: "fadeout" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 50; \ + visible: 0; \ + } \ + description { state: "fadein" 0.0; \ + inherit: "default" 0.0; \ + } \ + +#define GENLIST_DESCRIPTION_FADEOUT \ + description { state: "fadeout" 0.0; \ + inherit: "default" 0.0; \ + color: 255 255 255 50; \ + visible: 0; \ + } \ + description { state: "fadein" 0.0; \ + inherit: "default" 0.0; \ + } \ + +#define GENLIST_PROGRAM_EXPAND_FADE( TARGET ) \ + program { name: "expand"; \ + signal: "flip_item"; \ + action: STATE_SET "2depth" 0.0; \ + target: "bg_image_clip"; \ + after: "expand_start_fade"; \ + } \ + program { name: "expand_start_fade"; \ + action: STATE_SET "fadeout" 0.0; \ + after: "expand_end_fade"; \ + target: "bg_image"; \ + TARGET \ + } \ + program { name: "expand_end_fade"; \ + action: STATE_SET "default" 0.0; \ + transition: DECELERATE 0.3; \ + target: "bg_image"; \ + TARGET \ + } \ + program { name: "contract_fade"; \ + signal: "elm,state,contract_flip"; \ + action: STATE_SET "fadein" 0.0; \ + after: "contract_end_fade"; \ + target: "bg_image"; \ + TARGET \ + } \ + program { name: "contract_end_fade"; \ + action: STATE_SET "fadeout" 0.0; \ + transition: ACCELERATE 0.3; \ + target: "bg_image"; \ + TARGET \ + } + +#define GENLIST_PROGRAM_EXPAND_ROOT( TARGET ) \ + program { \ + name: "go_expanded"; \ + signal: "elm,state,expanded"; \ + source: "elm"; \ + action: STATE_SET "active" 0.0; \ + target: "bg_image"; \ + TARGET \ + } \ + program { \ + name: "go_contracted"; \ + signal: "elm,state,contracted"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + TARGET \ + } \ + program { \ + name: "show"; \ + signal: "elm,state,show"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + TARGET \ + } \ + program { \ + name: "hide"; \ + signal: "elm,state,hide"; \ + action: STATE_SET "hide" 0.0; \ + target: "bg_image"; \ + TARGET \ + } + +#define GENLIST_PROGRAM_EXPANDABLE( SRC ) \ + program { \ + name: "expand"; \ + signal: "mouse,up,1"; \ + SRC \ + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; \ + } \ + +// 2.2.7 Genlist_Edit mode (Rename) +// FIXME: padding is not needed when swallow content is NULL. +// But how can edje kwno existence of swallow content? +#define GENLIST_PART_FLIP \ + part { name: "elm.flip.event_block";\ + type: RECT;\ + mouse_events: 0; \ + repeat_events: 0;\ + description { state: "default" 0.0;\ + visible: 0; \ + } \ + description { state: "flip_enabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + color: GENLIST_LIST_BG_COLOR;\ + }\ + }\ + part { name: "elm.flip.padding.left"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 26 0; \ + max: 26 -1; \ + fixed: 1 0; \ + visible: 0; \ + align: 0 0.5; \ + rel1 { \ + relative: 0 0; \ + to: "base"; \ + } \ + rel2 { \ + relative: 0 1; \ + to: "base"; \ + } \ + } \ + } \ + part { name: "elm.flip.padding.right"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 26 0; \ + max: 26 -1; \ + fixed: 1 0; \ + visible: 0; \ + align: 1 0.5; \ + rel1 { \ + relative: 1 0; \ + to: "base"; \ + } \ + rel2 { \ + relative: 1 1; \ + to: "base"; \ + } \ + } \ + } \ + part { name: "elm.flip.content"; \ + type: SWALLOW; \ + scale: 1; \ + GENLIST_DESCRIPTION_LR("elm.flip.padding.left", "elm.flip.padding.icon.left", \ + aspect: 1 1; visible: 0; ) \ + description { state: "flip_enabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + GENLIST_PART_PADDING_R("elm.flip.padding.icon.left", "elm.flip.icon") \ + GENLIST_PART_ICON( "elm.flip.icon", \ + GENLIST_DESCRIPTION_R("elm.flip.padding.right", \ + visible: 0; \ + aspect: 1 1; \ + align: 1 0.5; \ + max: 154 74;) \ + description { state: "flip_enabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + ) + +//****************************************************************************// +// ******************************* Programs ********************************// +//**************************************************************************// +// signal: elm,state,%s,active +// a "check" item named %s went active +// signal: elm,state,%s,passive +// a "check" item named %s went passive +// default is passive +#define GENLIST_PROGRAM_DISABLED( TARGET ) \ + program { name: "enabled"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + TARGET \ + } \ + program { name: "disabled"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "bg_image"; \ + TARGET \ + } + +#define GENLIST_PROGRAM_DISABLED_BOTTOMLINE( TARGET ) \ + program { name: "enabled"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + target: "bottom_line"; \ + target: "bottom_line2"; \ + TARGET \ + } \ + program { name: "disabled"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "bg_image"; \ + target: "bottom_line"; \ + target: "bottom_line2"; \ + TARGET \ + } + +#define GENLIST_PROGRAM_SELECT( TARGET ) \ + program { name: "selected"; \ + signal: "elm,state,selected"; \ + source: "elm"; \ + action: STATE_SET "selected" 0.0; \ + target: "bg_image"; \ + TARGET \ + } \ + program { name: "unselected"; \ + signal: "elm,state,unselected"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + TARGET \ + transition: LINEAR 0.1; \ + } + +#define GENLIST_PROGRAM_SELECT_BOTTOMLINE( TARGET ) \ + program { name: "selected"; \ + signal: "elm,state,selected"; \ + source: "elm"; \ + action: STATE_SET "selected" 0.0; \ + target: "bg_image"; \ + target: "bottom_line"; \ + target: "bottom_line2"; \ + TARGET \ + } \ + program { name: "unselected"; \ + signal: "elm,state,unselected"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + target: "bottom_line"; \ + target: "bottom_line2"; \ + TARGET \ + transition: LINEAR 0.1; \ + } + +#define GENLIST_PROGRAM_SELECT_DIALOGUE( TARGET ) \ + program { name: "selected"; \ + signal: "elm,state,selected"; \ + source: "elm"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"bg_image", st, 30, vl); \ + if (!strcmp(st, "top")) \ + set_state(PART:"bg_image", "top_selected", 0.0); \ + else if (!strcmp(st, "center")) \ + set_state(PART:"bg_image", "center_selected", 0.0); \ + else if (!strcmp(st, "bottom")) \ + set_state(PART:"bg_image", "bottom_selected", 0.0); \ + else \ + set_state(PART:"bg_image", "selected", 0.0); \ + } \ + after: "target_selected"; \ + } \ + program { name: "unselected"; \ + signal: "elm,state,unselected"; \ + source: "elm"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"bg_image", st, 30, vl); \ + if (!strcmp(st, "top_selected")) \ + set_state(PART:"bg_image", "top", 0.0); \ + else if (!strcmp(st, "center_selected")) \ + set_state(PART:"bg_image", "center", 0.0); \ + else if (!strcmp(st, "bottom_selected")) \ + set_state(PART:"bg_image", "bottom", 0.0); \ + else \ + set_state(PART:"bg_image", "default", 0.0); \ + } \ + transition: LINEAR 0.1; \ + after: "target_unselected"; \ + } \ + program { name: "target_selected"; \ + action: STATE_SET "selected" 0.0; \ + TARGET \ + }\ + program { name: "target_unselected"; \ + action: STATE_SET "default" 0.0; \ + TARGET \ + }\ + program { name: "bg_top"; \ + signal: "elm,state,top"; \ + source: "*"; \ + action: STATE_SET "top" 0.0; \ + target: "bg_image"; \ + } \ + program { name: "bg_center"; \ + signal: "elm,state,center"; \ + source: "*"; \ + action: STATE_SET "center" 0.0; \ + target: "bg_image"; \ + } \ + program { name: "bg_bottom"; \ + signal: "elm,state,bottom"; \ + source: "*"; \ + action: STATE_SET "bottom" 0.0; \ + target: "bg_image"; \ + } \ + program { name: "bg_default"; \ + signal: "elm,state,default"; \ + source: "*"; \ + action: STATE_SET "default" 0.0; \ + target: "bg_image"; \ + } + + #if 0 + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + after: "flip_enabled_next"; \ + } \ + after: "flip_disabled_next"; + program { name: "flip_disabled_next"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "disclip"; \ + } + #endif + +#define GENLIST_PROGRAM_FLIP \ + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + target: "elm.flip.event_block"; \ + after: "flip_enabled_next"; \ + } \ + program { name: "flip_enabled_next"; \ + action: STATE_SET "flip_enabled" 0.0; \ + transition: DECELERATE 0.5; \ + target: "elm.flip.content"; \ + target: "elm.flip.icon"; \ + } \ + program { name: "flip_disabled"; \ + signal: "elm,state,flip,disabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + transition: DECELERATE 0.5; \ + target: "elm.flip.event_block"; \ + target: "elm.flip.content"; \ + target: "elm.flip.icon"; \ + } + +#define GENLIST_PROGRAM_FLIP_TARGET( TARGET ) \ + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + transition: DECELERATE 0.5; \ + TARGET; \ + } \ + program { name: "flip_disabled"; \ + signal: "elm,state,flip,disabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + transition: DECELERATE 0.5; \ + TARGET \ + } + +#define GENLIST_PROGRAM_EDITMODE \ + program { name: "edit_enabled"; \ + signal: "elm,state,edit,enabled"; \ + source: "*"; \ + action: STATE_SET "editmode" 0.0; \ + target: "elm.padding.right"; \ + target: "elm.icon.edit"; \ + target: "bg_image_right"; \ + } \ + program { name: "edit_disabled"; \ + signal: "elm,state,edit,disabled"; \ + source: "*"; \ + action: STATE_SET "editmode" 0.0; \ + target: "elm.padding.right"; \ + target: "elm.icon.edit"; \ + target: "bg_image_right"; \ + } + +#define GENLIST_PROGRAMS_INDEX( TARGET ) \ + programs { \ + GENLIST_PROGRAM_DISABLED( TARGET ) \ + } + +#define GENLIST_PROGRAMS_NORMAL( TARGET ) \ + programs { \ + GENLIST_PROGRAM_DISABLED_BOTTOMLINE( TARGET ) \ + GENLIST_PROGRAM_SELECT_BOTTOMLINE( TARGET ) \ + GENLIST_PROGRAM_EXPAND_FADE( target: "bottom_line"; target: "bottom_line2"; TARGET ) \ + GENLIST_PROGRAM_FLIP \ + } + +// FIXME: inheritance !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1 +// if GENLIST_PROGRAM_EXPAND is here, expanda effect is something wrong. +// because after can be duplicated when program inheriting. +#define GENLIST_PROGRAMS_DIALOGUE( TARGET ) \ + programs { \ + GENLIST_PROGRAM_DISABLED( TARGET ) \ + GENLIST_PROGRAM_SELECT_DIALOGUE( TARGET ) \ + GENLIST_PROGRAM_FLIP \ + GENLIST_PROGRAM_EDITMODE \ + } + +#define GENLIST_PROGRAMS_MULTILINE( TARGET ) \ + programs { \ + GENLIST_PROGRAM_DISABLED( TARGET ) \ + GENLIST_PROGRAM_SELECT_DIALOGUE( TARGET ) \ + GENLIST_PROGRAM_FLIP \ + } + +#define GENLIST_PROGRAMS_READ_TEXT1( TARGET ) \ + script { \ + public readed = 0; \ + } \ + programs { \ + GENLIST_PROGRAM_DISABLED_BOTTOMLINE( TARGET ) \ + GENLIST_PROGRAM_FLIP \ + program { name: "selected"; \ + signal: "elm,state,selected"; \ + source: "elm"; \ + action: STATE_SET "selected" 0.0; \ + target: "bg_image"; \ + target: "bottom_line"; \ + target: "bottom_line2"; \ + TARGET \ + } \ + program { name: "go_passive_target"; \ + signal: "elm,state,unselected"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + TARGET \ + after: "go_passive_text1"; \ + } \ + program { name: "go_passive_text1"; \ + transition: LINEAR 0.1; \ + script { \ + set_state(PART:"bg_image", "default", 0.0); \ + set_state(PART:"bottom_line", "default", 0.0); \ + set_state(PART:"bottom_line2", "default", 0.0); \ + if (get_int(readed) == 1) \ + set_state(PART:"elm.text.1", "read", 0.0); \ + else \ + set_state(PART:"elm.text.1", "default", 0.0); \ + } \ + } \ + program { name: "go_read"; \ + signal: "elm,state,read"; \ + source: "*"; \ + script { \ + set_int(readed, 1); \ + set_state(PART:"elm.text.1", "read", 0.0); \ + } \ + } \ + program { name: "go_unread"; \ + signal: "elm,state,unread"; \ + source: "*"; \ + script { \ + set_int(readed, 0); \ + set_state(PART:"elm.text.1", "default", 0.0); \ + } \ + } \ + } + +//****************************************************************************// +// ******************************* Icon Part ******************************// +//***************************************************************************// +#define GENLIST_PART_ICON(NAME, DESCRIPION) \ + part { name: NAME; \ + scale: 1; \ + type: SWALLOW; \ + DESCRIPION \ + GENLIST_DESCRIPTION_FADEOUT_ICON \ + } + +#define GENLIST_PARAM_ICON_BIG \ + min: GENLIST_ICON_BIG_SIZE GENLIST_ICON_BIG_SIZE; \ + max: GENLIST_ICON_BIG_SIZE GENLIST_ICON_BIG_SIZE; + +#define GENLIST_PARAM_ICON_SMALL \ + min: GENLIST_ICON_SMALL_SIZE GENLIST_ICON_SMALL_SIZE; \ + max: GENLIST_ICON_SMALL_SIZE GENLIST_ICON_SMALL_SIZE; + +#define GENLIST_PARAM_ICON_BTN_01 \ + min: 0 GENLIST_BTN_01_HEIGHT; \ + max: 0 GENLIST_BTN_01_HEIGHT; + +#define GENLIST_PARAM_ICON_BTN_02 \ + min: GENLIST_BTN_02_SIZE GENLIST_BTN_02_SIZE; \ + max: GENLIST_BTN_02_SIZE GENLIST_BTN_02_SIZE; + +#define GENLIST_PARAM_ICON_ONOFF_WIDTH \ + min: GENLIST_ICON_ONOFF_WIDTH GENLIST_ICON_ONOFF_HEIGHT; \ + max: GENLIST_ICON_ONOFF_WIDTH GENLIST_ICON_ONOFF_HEIGHT; + +#define GENLIST_PARAM_ICON_THUMBNAIL1\ + min: GENLIST_ICON_THUMBNAIL1_SIZE GENLIST_ICON_THUMBNAIL1_SIZE; \ + max: GENLIST_ICON_THUMBNAIL1_SIZE GENLIST_ICON_THUMBNAIL1_SIZE; + +#define GENLIST_PARAM_ICON_CHECK_RADIO \ + min: GENLIST_ICON_CHECK_RADIO_SIZE GENLIST_ICON_CHECK_RADIO_SIZE; \ + max: GENLIST_ICON_CHECK_RADIO_SIZE GENLIST_ICON_CHECK_RADIO_SIZE; + +#define GENLIST_PARAM_ICON_STAR \ + min: GENLIST_ICON_STAR_SIZE GENLIST_ICON_STAR_SIZE; \ + max: GENLIST_ICON_STAR_SIZE GENLIST_ICON_STAR_SIZE; \ + +#define GENLIST_PART_ICON_BIG_R(NAME, RIGHT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + fixed: 1 1; \ + GENLIST_PARAM_ICON_BIG \ + ) \ + ) + +#define GENLIST_PART_ICON_BIG_L(NAME, LEFT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_L(LEFT, \ + fixed: 1 1; \ + GENLIST_PARAM_ICON_BIG \ + ) \ + ) + +#define GENLIST_PART_ICON_SMALL_L(NAME, LEFT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_L(LEFT, \ + GENLIST_PARAM_ICON_SMALL \ + ) \ + ) + +#define GENLIST_PART_ICON_SMALL_LB(NAME, LEFT, BOTTOM) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_LB(LEFT, BOTTOM, \ + fixed: 1 1; \ + GENLIST_PARAM_ICON_SMALL \ + ) \ + ) + +#define GENLIST_PART_ICON_SMALL_LTB(NAME, LEFT, TOP, BOTTOM) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_LTB(LEFT, TOP, BOTTOM, \ + GENLIST_PARAM_ICON_SMALL \ + ) \ + ) + +#define GENLIST_PART_ICON_SMALL_RTB(NAME, RIGHT, TOP, BOTTOM) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_RTB(RIGHT, TOP, BOTTOM, \ + GENLIST_PARAM_ICON_SMALL \ + ) \ + ) + +#define GENLIST_PART_ICON_BTN_01_R(NAME, RIGHT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + GENLIST_PARAM_ICON_BTN_01 \ + ) \ + ) + +#define GENLIST_PART_ICON_BTN_02_R(NAME, RIGHT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + GENLIST_PARAM_ICON_BTN_02 \ + ) \ + ) + +#define GENLIST_PART_ICON_BTN_ONOFF_R(NAME, RIGHT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + GENLIST_PARAM_ICON_ONOFF_WIDTH \ + ) \ + ) + +#define GENLIST_PART_ICON_BTN_ONOFF_L(NAME, LEFT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_L(LEFT, \ + GENLIST_PARAM_ICON_ONOFF_WIDTH \ + ) \ + ) + +#define GENLIST_PART_ICON_THUMBNAIL1_R(NAME, RIGHT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + GENLIST_PARAM_ICON_THUMBNAIL1 \ + ) \ + ) + +#define GENLIST_PART_ICON_CHECK_RADIO_L(NAME, LEFT) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_L(LEFT, \ + GENLIST_PARAM_ICON_CHECK_RADIO \ + ) \ + ) + +#define GENLIST_PART_ICON_STAR_RTB(NAME, RIGHT, TOP, BOTTOM) \ + GENLIST_PART_ICON(NAME, \ + GENLIST_DESCRIPTION_RTB(RIGHT, TOP, BOTTOM, \ + GENLIST_PARAM_ICON_STAR \ + fixed: 1 1; \ + ) \ + ) + +/*****************************************************************************/ +/******************************* Genlist IMAGE ********************************/ +/*****************************************************************************/ +#define GENLIST_PART_IMAGE(NAME, DESCRIPION) \ + part { name: NAME; \ + scale: 1; \ + type: IMAGE; \ + DESCRIPION \ + GENLIST_DESCRIPTION_FADEOUT \ + } + +#define GENLIST_PARAM_PASSWORD_IMAGE \ + min: GENLIST_ICON_PASSWORD_SIZE GENLIST_ICON_PASSWORD_SIZE; \ + max: GENLIST_ICON_PASSWORD_SIZE GENLIST_ICON_PASSWORD_SIZE; \ + image.normal: "00_search_edit_field_bg_02.png"; \ + image.border: 4 4 4 4; \ + image.border_scale: 1; + +/*****************************************************************************/ +/******************************* Genlist Bubble ********************************/ +/*****************************************************************************/ +#define GENLIST_PARAM_BUBBLE \ + image { \ + normal: "00_list_bubble_bg.png"; \ + border: 8 8 0 0; \ + } \ + rel1.offset: -10 0; \ + rel2.offset: 10 0; + +#define GENLIST_PART_BUBBLE(TEXT_NAME) \ + GENLIST_PART_IMAGE("elm.bubble", \ + GENLIST_DESCRIPTION_ENVELOP(TEXT_NAME, \ + GENLIST_PARAM_BUBBLE \ + min: 48 38; \ + max: -1 38; \ + fixed: 0 1;) \ + GENLIST_DESCRIPTION_FADEOUT \ + ) + +#define GENLIST_IMAGES_EXPANDABLE_BTN \ + images { \ + image: "00_button_expand_closed.png" COMP; \ + image: "00_button_expand_opened.png" COMP; \ + } + +#define GENLIST_PART_EXPANDABLE_ARROW \ + GENLIST_PART_ICON("touch_arrow", \ + ignore_flags: ON_HOLD; \ + GENLIST_DESCRIPTION_ENVELOP("arrow", ) \ + GENLIST_DESCRIPTION_FADEOUT \ + ) \ + GENLIST_PART_IMAGE("arrow", \ + ignore_flags: ON_HOLD; \ + mouse_events: 0; \ + GENLIST_DESCRIPTION_R("elm.padding.right", \ + fixed: 1 1; \ + min: 74 74; \ + max: 74 74; \ + image.normal: "00_button_expand_closed.png"; \ + ) \ + description { state: "active" 0.0; \ + inherit: "default" 0.0; \ + image.normal: "00_button_expand_opened.png"; \ + } \ + GENLIST_DESCRIPTION_FADEOUT \ + ) +/*****************************************************************************/ +/******************************* Genlist RECT ********************************/ +/*****************************************************************************/ +#define GENLIST_PART_SPACER(NAME, DESCRIPION) \ + part { name: NAME; \ + scale: 1; \ + mouse_events: 0; \ + type: SPACER; \ + DESCRIPION \ + } + +#define GENLIST_PART_RECT(NAME, DESCRIPION) \ + part { name: NAME; \ + scale: 1; \ + type: RECT; \ + DESCRIPION \ + GENLIST_DESCRIPTION_FADEOUT_RECT \ + } + +#define GENLIST_PART_INDEX_LINE(LEFT, RIGHT, TOP, BOTTOM) \ + GENLIST_PART_RECT("index_line", \ + GENLIST_DESCRIPTION(LEFT, RIGHT, TOP, BOTTOM, \ + color: GENLIST_GROUPINDEX_LINE_COLOR; \ + min: 0 4; \ + max: -1 4;) \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_GROUPINDEX_LINE_FOCUS_COLOR; \ + } \ + ) + +/*****************************************************************************/ +/******************************* Genlist TEXT ********************************/ +/*****************************************************************************/ +#define GENLIST_PART_TEXT(NAME, DESCRIPION) \ + part { name: NAME; \ + scale: 1; \ + mouse_events: 0; \ + type: TEXT; \ + DESCRIPION \ + GENLIST_DESCRIPTION_FADEOUT \ + } + +#define GENLIST_PART_TEXTBLOCK(NAME, DESCRIPION) \ + part { name: NAME; \ + scale: 1; \ + mouse_events: 0; \ + type: TEXTBLOCK; \ + DESCRIPION \ + GENLIST_DESCRIPTION_FADEOUT \ + } + +/*************************** parameters **********************************/ +#define GENLIST_PARAM_TEXT_LIMIT_RB \ + rel1.to_x: "base"; /* This limits text growing. */\ + rel1.relative: 0.5 0; /* This limits text growing. */\ + text.max: 1 0; /* This limits text growing. */ + +#define GENLIST_PARAM_TEXT_LIMIT_RT \ + rel1.to_x: "base"; /* This limits text growing. */\ + rel1.relative: 0.5 1; /* This limits text growing. */\ + text.max: 1 0; /* This limits text growing. */ + +// Group Index +#define GENLIST_PARAM_INDEX_LIST \ + color: GENLIST_GROUPINDEX_LIST_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_GROUPINDEX_LIST_SIZE; \ + text_class: "list_item"; \ + } + +// Group Title +#define GENLIST_PARAM_DIALOGUE_GROUP_TITLE \ + color: GENLIST_DIALOGUE_GROUP_TITLE_COLOR; \ + text { \ + align: 0.0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_DIALOGUE_GROUP_TITLE_SIZE; \ + text_class: "list_item"; \ + } + +// Password style +#define GENLIST_PARAM_PASSWORD_TITLE \ + color: DIALOGUE_PASSWORD_TITLE_COLOR; \ + text { \ + font: "Tizen:style=Bold"; \ + size: DIALOGUE_PASSWORD_TITLE_SIZE; \ + min: 0 1; \ + align: 0 0.5; \ + text_class: "list_item"; \ + } + +// list main text +#define GENLIST_PARAM_LISTITEM \ + color: GENLIST_LIST_MAIN_TEXT_UNREAD_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Regular"; \ + size: GENLIST_LIST_MAIN_TEXT_SIZE; \ + text_class: "list_item"; \ + } + +#define GENLIST_PARAM_LISTITEM_TB \ + text { \ + min: 0 1; \ + style: "genlist_style_list_main_text_unread"; \ + } + +#define GENLIST_PARAM_LISTITEM_TB_WRAP \ + text { \ + min: 0 1; \ + style: "genlist_style_list_main_text_unread_wrap"; \ + } + +// list subtext +#define GENLIST_PARAM_SUBITEM_DEFAULT \ + color: GENLIST_LIST_SUB_TEXT_DEFAULT_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Medium"; \ + size: GENLIST_LIST_SUB_TEXT_SIZE; \ + text_class: "tizen"; \ + } + +#define GENLIST_PARAM_SUBITEM_SETTINGS \ + color: GENLIST_LIST_SUB_TEXT_SETTINGS_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Medium"; \ + size: GENLIST_LIST_SUB_TEXT_SIZE; \ + text_class: "tizen"; \ + } + +#define GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + text { \ + min: 0 1; \ + style: "genlist_style_list_sub_text_default"; \ + } + +#define GENLIST_PARAM_SUBITEM_DEFAULT_TB_WRAP \ + text { \ + min: 0 1; \ + style: "genlist_style_list_sub_text_default_wrap"; \ + } + +#define GENLIST_PARAM_SUBITEM_SETTINGS_TB \ + text { \ + min: 0 1; \ + style: "genlist_style_list_sub_text_settings"; \ + } + +#define GENLIST_PARAM_APPS_NAME\ + color: GENLIST_APPS_NAME_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_APPS_NAME_SIZE; \ + text_class: "list_item"; \ + } + +#define GENLIST_PARAM_APPS_INC\ + color: GENLIST_APPS_INC_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_APPS_INC_SIZE; \ + text_class: "list_item"; \ + } + +#define GENLIST_PARAM_APPS_RATING\ + color: GENLIST_APPS_RATING_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_APPS_RATING_SIZE; \ + text_class: "list_item"; \ + } + +#define GENLIST_PARAM_APPS_PRICE\ + color: GENLIST_APPS_PRICE_ORIGINAL_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_APPS_PRICE_SIZE; \ + text_class: "list_item"; \ + } + +#define GENLIST_PARAM_APPS_PRICE_SALE\ + color: GENLIST_APPS_PRICE_SALE_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_APPS_PRICE_SIZE; \ + text_class: "list_item"; \ + } + +#define GENLIST_PARAM_CONTENTS_TEXT \ + color: GENLIST_CONTENTS_TEXT_COLOR; \ + text { \ + align: 0 0.5; \ + min: 0 1; \ + font: "Tizen:style=Regular"; \ + size: GENLIST_CONTENTS_TEXT_SIZE; \ + text_class: "tizen"; \ + } + +/*************************** Descriptions **********************************/ +// group index +#define GENLIST_DESCRIPTION_INDEX_LIST \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_GROUPINDEX_LIST_FOCUS_COLOR; \ + } + +// list main text +#define GENLIST_DESCRIPTION_LISTITEM_OTHERS \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_MAIN_TEXT_UNREAD_DIM_COLOR; \ + } \ + description { state: "read" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_MAIN_TEXT_READ_COLOR; \ + } \ + description { state: "read,disabled" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_MAIN_TEXT_READ_DIM_COLOR; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_MAIN_TEXT_FOCUS_COLOR; \ + } + +#define GENLIST_DESCRIPTION_LISTITEM_OTHERS_TB \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_main_text_unread_dim"; \ + } \ + description { state: "read" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_main_text_read"; \ + } \ + description { state: "read,disabled" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_main_text_read_dim"; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_main_text_focus"; \ + } + +// list sub text +#define GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_SUB_TEXT_DEFAULT_DIM_COLOR; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_SUB_TEXT_FOCUS_COLOR; \ + } + +#define GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_sub_text_default_dim"; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_sub_text_focus"; \ + } + +#define GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB_WRAP \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_sub_text_default_dim_wrap"; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_sub_text_focus_wrap"; \ + } + +#define GENLIST_DESCRIPTION_SUBITEM_SETTINGS_OTHERS \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_SUB_TEXT_SETTINGS_DIM_COLOR; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_SUB_TEXT_FOCUS_COLOR; \ + } + +#define GENLIST_DESCRIPTION_SUBITEM_SETTINGS_OTHERS_TB \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_sub_text_settings_dim"; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_sub_text_focus"; \ + } + +// list main text multiline +#define GENLIST_DESCRIPTION_LISTITEM_OTHERS_TB_WRAP \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_main_text_unread_dim_wrap"; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + text.style: "genlist_style_list_main_text_focus_wrap"; \ + } + +/*************************** Parts **********************************/ +#define GENLIST_PART_DIALOGUE_GROUP_HELP_TEXT(NAME, LEFT, RIGHT, TOP, BOTTOM, PARAM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION(LEFT, RIGHT, TOP, BOTTOM, \ + text { \ + min: 0 1; \ + style: "genlist_style_dialogue_group_help_text"; \ + } \ + PARAM) \ + ) + +#define GENLIST_PART_LISTITEM(NAME, DESCRIPTION) \ + GENLIST_PART_TEXT(NAME, \ + DESCRIPTION \ + GENLIST_DESCRIPTION_LISTITEM_OTHERS \ + ) + +#define GENLIST_PART_LISTITEM_TB(NAME, DESCRIPTION) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + DESCRIPTION \ + GENLIST_DESCRIPTION_LISTITEM_OTHERS_TB \ + ) + +#define GENLIST_PART_LISTITEM_(NAME, HEIGHT, LEFT, RIGHT, TOP, BOTTOM, PARAM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION(LEFT, RIGHT, TOP, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_LISTITEM \ + PARAM \ + ) \ + GENLIST_DESCRIPTION_LISTITEM_OTHERS \ + ) + +#define GENLIST_PART_LISTITEM_TB_(NAME, HEIGHT, LEFT, RIGHT, TOP, BOTTOM, PARAM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION(LEFT, RIGHT, TOP, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_LISTITEM_TB \ + PARAM \ + ) \ + GENLIST_DESCRIPTION_LISTITEM_OTHERS_TB \ + ) + +#define GENLIST_PART_LISTITEM_LR(NAME, HEIGHT, LEFT, RIGHT, PARAM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LR(LEFT, RIGHT, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_LISTITEM \ + PARAM \ + ) \ + GENLIST_DESCRIPTION_LISTITEM_OTHERS \ + ) + +#define GENLIST_PART_LISTITEM_LRT_TB(NAME, HEIGHT, LEFT, RIGHT, TOP, PARAM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_LRT(LEFT, RIGHT, TOP, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_LISTITEM_TB \ + PARAM \ + ) \ + GENLIST_DESCRIPTION_LISTITEM_OTHERS_TB \ + ) + +#define GENLIST_PART_LISTITEM_LR_TB(NAME, HEIGHT, LEFT, RIGHT, PARAM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_LR(LEFT, RIGHT, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_LISTITEM_TB \ + PARAM \ + ) \ + GENLIST_DESCRIPTION_LISTITEM_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_(NAME, HEIGHT, LEFT, RIGHT, TOP, BOTTOM, PARAM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION(LEFT, RIGHT, TOP, BOTTOM, \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + PARAM \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM(NAME, DESCRIPTION) \ + GENLIST_PART_TEXT(NAME, \ + DESCRIPTION \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_DEFAULT_TB(NAME, DESCRIPTION) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + DESCRIPTION \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_R(NAME, HEIGHT, RIGHT) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_TEXT_LIMIT_RB \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_RB(NAME, HEIGHT, RIGHT, BOTTOM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_RB(RIGHT, BOTTOM, \ + min: 0 HEIGHT; \ + fixed: 1 1; \ + GENLIST_PARAM_TEXT_LIMIT_RB \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_RB_TB(NAME, HEIGHT, RIGHT, BOTTOM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_RB(RIGHT, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_TEXT_LIMIT_RB \ + fixed: 1 1; \ + GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_TB_(NAME, HEIGHT, LEFT, RIGHT, TOP, BOTTOM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION(LEFT, RIGHT, TOP, BOTTOM, \ + GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_R_FIXED(NAME, WIDTH, HEIGHT, RIGHT) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + min: WIDTH HEIGHT; \ + fixed: 1 1; \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_R_FIXED_TB(NAME, WIDTH, HEIGHT, RIGHT) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_R(RIGHT, \ + min: WIDTH HEIGHT; \ + fixed: 1 0; \ + GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_L_FIXED(NAME, WIDTH, HEIGHT, LEFT) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_L(LEFT, \ + min: WIDTH HEIGHT; \ + fixed: 1 1; \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_LR(NAME, HEIGHT, LEFT, RIGHT, PARAM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LR(LEFT, RIGHT, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + PARAM \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_LR_TB(NAME, HEIGHT, LEFT, RIGHT) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_LR(LEFT, RIGHT, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_LB(NAME, HEIGHT, LEFT, RIGHT) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LB(LEFT, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_LRB(NAME, HEIGHT, LEFT, RIGHT, BOTTOM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LRB(LEFT, RIGHT, BOTTOM, \ + min: 0 HEIGHT; \ + fixed: 1 1; /*FIXME: why text need this, but textblock doesn't */ \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_LRB_LIMIT(NAME, HEIGHT, LEFT, RIGHT, BOTTOM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LRB(LEFT, RIGHT, BOTTOM, \ + min: 0 HEIGHT; \ + fixed: 1 1; /*FIXME: why text need this, but textblock doesn't */ \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + fixed: 1 1; align: 0 1; text.max: 1 0; // This limits text growing. \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_SETTINGS_LRB(NAME, HEIGHT, LEFT, RIGHT, BOTTOM, PARAM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LRB(LEFT, RIGHT, BOTTOM, \ + min: 0 HEIGHT; \ + fixed: 1 1; /*FIXME: why text need this, but textblock doesn't */ \ + GENLIST_PARAM_SUBITEM_SETTINGS\ + PARAM; \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_SETTINGS_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_LRB_TB(NAME, HEIGHT, LEFT, RIGHT, BOTTOM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_LRB(LEFT, RIGHT, BOTTOM, \ + min: 0 HEIGHT; \ + fixed: 1 1; /*FIXME: why text need this, but textblock doesn't */ \ + GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_SETTINGS_LRB_TB(NAME, HEIGHT, LEFT, RIGHT, BOTTOM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_LRB(LEFT, RIGHT, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_SUBITEM_SETTINGS_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_SETTINGS_OTHERS_TB \ + ) + +#define GENLIST_PART_SUBITEM_LRT(NAME, HEIGHT, LEFT, RIGHT, TOP) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LRT(LEFT, RIGHT, TOP, \ + min: 0 HEIGHT; \ + fixed: 1 1; /*FIXME: why text need this, but textblock doesn't */ \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_LTB(NAME, HEIGHT, LEFT, TOP, BOTTOM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_LTB(LEFT, TOP, BOTTOM, \ + min: 0 HEIGHT; \ + fixed: 1 1; /*FIXME: why text need this, but textblock doesn't */ \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_RTB(NAME, HEIGHT, RIGHT, TOP, BOTTOM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_RTB(RIGHT, TOP, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_TEXT_LIMIT_RT \ + GENLIST_PARAM_SUBITEM_DEFAULT \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS \ + ) + +#define GENLIST_PART_SUBITEM_RTB_TB(NAME, HEIGHT, RIGHT, TOP, BOTTOM) \ + GENLIST_PART_TEXTBLOCK(NAME, \ + GENLIST_DESCRIPTION_RTB(RIGHT, TOP, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_TEXT_LIMIT_RT \ + GENLIST_PARAM_SUBITEM_DEFAULT_TB \ + ) \ + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB \ + ) + +#define GENLIST_PARAM_LIST_BUBBLE_TEXT \ + color: GENLIST_LIST_BUBBLE_TEXT_COLOR; \ + text { \ + align: 1 0.5; \ + min: 0 1; \ + font: "Tizen:style=Bold"; \ + size: GENLIST_LIST_BUBBLE_TEXT_SIZE; \ + text_class: "tizen"; \ + } + +#define GENLIST_PART_LIST_BUBBLE_TEXT_RTB(NAME, HEIGHT, RIGHT, TOP, BOTTOM) \ + GENLIST_PART_TEXT(NAME, \ + GENLIST_DESCRIPTION_RTB(RIGHT, TOP, BOTTOM, \ + min: 0 HEIGHT; \ + GENLIST_PARAM_TEXT_LIMIT_RT \ + GENLIST_PARAM_LIST_BUBBLE_TEXT \ + ) \ + ) + +#if 0 +#define GENLIST_PART_BASE__( param_item_height ) \ + part { name: "base"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_item_height; \ + color: LAYOUT_GROUP_LIST_BG_COLOR_INC; \ + } \ + } + +#define GENLIST_PART_BG \ + part { name: "bg"; \ + type: RECT; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + color: GENLIST_PART_DIALOGUE_GROUP_BG_COLOR; \ + } \ + description { state: "hide" 0.0; \ + inherit: "default" 0.0; \ + rel1 { relative: 0.025 0.0; } \ + rel2 { relative: 1.025 1.0; } \ + } \ + description { state: "hide" 0.1; \ + inherit: "default" 0.0; \ + rel1 { relative: 0.13 0.0; } \ + rel2 { relative: 1.13 1.0; } \ + } \ + description { state: "hide" 0.2; \ + inherit: "default" 0.0; \ + rel1 { relative: 0.5 0.0; } \ + rel2 { relative: 1.5 1.0; } \ + } \ + description { state: "hide" 0.3; \ + inherit: "default" 0.0; \ + rel1 { relative: 1.0 0.0; } \ + rel2 { relative: 2.0 1.0; } \ + } \ + } + +/******************************************************************************/ +/** ETC +/******************************************************************************/ +// FIXME: UX do not define selected state. But I thinkt that it is neededs :( + +#define GENLIST_PROOGRAM_EXPAND(SRC, TARGET) \ + program { \ + name: "expand"; \ + signal: "mouse,clicked,1"; \ + source: SRC; \ + action: SIGNAL_EMIT "elm,action,expand,toggle" "elm"; \ + } \ + program { \ + name: "go_expanded"; \ + signal: "elm,state,expanded"; \ + source: "elm"; \ + action: STATE_SET "active" 0.0; \ + TARGET \ + } \ + program { \ + name: "go_contracted"; \ + signal: "elm,state,contracted"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + TARGET \ + } + +#define GENLIST_PART_BASE_LIST_H( HEIGHT) \ + part { name: "base"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + align: 0.5 0.5; \ + color: 0 0 0 0; \ + rel2.relative: 1 0; \ + rel2.to: "bottom_line"; \ + min: 0 HEIGHT; \ + } \ + } \ + GENLIST_PART_BOTTOM_LINE + +#define GENLIST_PART_DIALOGUE_ITEM \ + part { name: "elm.rect.dialogue"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 10 0; \ + fixed: 1 0; \ + color: GENLIST_DIALOGUE_GROUP_LEFT_BG_COLOR_INC; \ + rel2.relative: 0.0 1.0; \ + align: 0.0 0.0; \ + } \ + } + +#define GENLIST_PART_DIALOGUE_RIGHT_LINE \ + part { name: "elm.rect.dialogue.right.line"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 1 0; \ + fixed: 1 0; \ + rel1 { \ + relative: 1.0 0.0; \ + offset: -1 0; \ + } \ + align: 1.0 0.0; \ + color: GENLIST_LIST_LINE1_COLOR; \ + } \ + } + +#define GENLIST_PROGRAM_FLIP_1TEXT \ + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + target: "elm.text"; \ + target: "elm.flip.content"; \ + } \ + program { name: "flip_disabled"; \ + signal: "elm,state,flip,disabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + target: "elm.flip.content"; \ + } + +#define GENLIST_PROGRAM_FLIP_2TEXT \ + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.flip.content"; \ + } \ + program { name: "flip_disabled"; \ + signal: "elm,state,flip,disabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.flip.content"; \ + } + +#define GENLIST_PROGRAM_FLIP_2TEXT_1ICON \ + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.icon"; \ + target: "elm.flip.content"; \ + } \ + program { name: "flip_disabled"; \ + signal: "elm,state,flip,disabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.icon"; \ + target: "elm.flip.content"; \ + } + +#define GENLIST_PROGRAM_FLIP_2TEXT_2ICON \ + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.icon.1"; \ + target: "elm.icon.2"; \ + target: "elm.flip.content"; \ + } \ + program { name: "flip_disabled"; \ + signal: "elm,state,flip,disabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.icon.1"; \ + target: "elm.icon.2"; \ + target: "elm.flip.content"; \ + } + +#define GENLIST_PROGRAM_FLIP_3TEXT_2ICON \ + program { name: "flip_enabled"; \ + signal: "elm,state,flip,enabled"; \ + source: "elm"; \ + action: STATE_SET "flip_enabled" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.text.3"; \ + target: "elm.icon.1"; \ + target: "elm.icon.2"; \ + target: "elm.flip.content"; \ + } \ + program { name: "flip_disabled"; \ + signal: "elm,state,flip,disabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text.1"; \ + target: "elm.text.2"; \ + target: "elm.text.3"; \ + target: "elm.icon.1"; \ + target: "elm.icon.2"; \ + target: "elm.flip.content"; \ + } + + +#define GENLIST_DESCRIPTION_INVISIBLE_SELECTED \ + description { state: "selected" 1.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } + +#define GENLIST_DESCRIPTION_FLIP_ENABLED \ + description { state: "flip_enabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } + +#define GENLIST_PROGRAM_SCRIPT_FLIP_SELECT_1TEXT \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + set_state(PART:"bg_image", "selected", 0.0); \ + if (!strcmp(st, "flip_enabled")) \ + set_state(PART:"elm.text", "selected", 1.0); \ + else \ + set_state(PART:"elm.text", "selected", 0.0); \ + } + + +/* genlist multisense macro - start */ +#define GENLIST_PROGRAM_AFTER_PLAY_BUTTON_PRESS \ + after: "play_button_press"; + +#define GENLIST_PROGRAM_PLAY_BUTTON_PRESS \ + program { name: "play_button_press"; \ + action: PLAY_SAMPLE "button-pressed" 1.0; \ + } +#endif + diff --git a/main/layout/genlist/genlist_size.edc b/main/layout/genlist/genlist_size.edc new file mode 100755 index 0000000..e639864 --- /dev/null +++ b/main/layout/genlist/genlist_size.edc @@ -0,0 +1,135 @@ +/* + * Copyright 2012 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. + */ + +/* hd_inc */ + +#define GENLIST_HEIGHT_1_INC 1 +#define GENLIST_HEIGHT_16_INC 16 +#define GENLIST_HEIGHT_33_INC 33 +#define GENLIST_HEIGHT_49_INC 49 +#define GENLIST_HEIGHT_62_INC 62 +#define GENLIST_HEIGHT_65_INC 65 +#define GENLIST_HEIGHT_72_INC 72 +#define GENLIST_HEIGHT_73_INC 73 +#define GENLIST_HEIGHT_77_INC 77 +#define GENLIST_HEIGHT_89_INC 89 +#define GENLIST_HEIGHT_93_INC 93 +#define GENLIST_HEIGHT_97_INC 97 +#define GENLIST_HEIGHT_113_INC 113 +#define GENLIST_HEIGHT_129_INC 129 +#define GENLIST_HEIGHT_177_INC 177 +#define GENLIST_HEIGHT_182_INC 182 +#define GENLIST_HEIGHT_190_INC 190 +#define GENLIST_HEIGHT_207_INC 207 +#define GENLIST_HEIGHT_260_INC 260 +#define GENLIST_HEIGHT_291_INC 291 +#define GENLIST_HEIGHT_454_INC 454 +#define GENLIST_HEIGHT_566_INC 566 + +#define GENLIST_PADDING_4_INC 4 +#define GENLIST_PADDING_5_INC 5 +#define GENLIST_PADDING_6_INC 6 +#define GENLIST_PADDING_8_INC 8 +#define GENLIST_PADDING_10_INC 10 +#define GENLIST_PADDING_11_INC 11 +#define GENLIST_PADDING_12_INC 12 +#define GENLIST_PADDING_13_INC 13 +#define GENLIST_PADDING_14_INC 14 +#define GENLIST_PADDING_16_INC 16 +#define GENLIST_PADDING_18_INC 18 +#define GENLIST_PADDING_21_INC 21 +#define GENLIST_PADDING_22_INC 22 +#define GENLIST_PADDING_24_INC 24 +#define GENLIST_PADDING_27_INC 27 +#define GENLIST_PADDING_32_INC 32 +#define GENLIST_PADDING_34_INC 34 +#define GENLIST_PADDING_46_INC 46 +#define GENLIST_PADDING_48_INC 48 +#define GENLIST_PADDING_64_INC 64 +#define GENLIST_PADDING_74_INC 74 +#define GENLIST_PADDING_88_INC 88 +#define GENLIST_PADDING_124_INC 124 + +#define GENLIST_FONT_20_INC 20 +#define GENLIST_FONT_27_INC 27 +#define GENLIST_FONT_28_INC 28 +#define GENLIST_FONT_30_INC 30 +#define GENLIST_FONT_32_INC 32 +#define GENLIST_FONT_STYLE_32_INC "32" +#define GENLIST_FONT_36_INC 36 +#define GENLIST_FONT_STYLE_36_INC "36" +#define GENLIST_FONT_40_INC 40 +#define GENLIST_FONT_STYLE_40_INC "40" +#define GENLIST_FONT_42_INC 42 +#define GENLIST_FONT_STYLE_42_INC "42" +#define GENLIST_FONT_44_INC 44 +#define GENLIST_FONT_STYLE_44_INC "44" +#define GENLIST_FONT_48_INC 48 +#define GENLIST_FONT_STYLE_48_INC "48" + +#define GENLIST_SIZE_6_INC 6 +#define GENLIST_SIZE_8_INC 8 +#define GENLIST_SIZE_10_INC 10 +#define GENLIST_SIZE_13_INC 13 +#define GENLIST_SIZE_16_INC 16 +#define GENLIST_SIZE_18_INC 18 +#define GENLIST_SIZE_21_INC 21 +#define GENLIST_SIZE_26_INC 26 +#define GENLIST_SIZE_32_INC 32 +#define GENLIST_SIZE_35_INC 35 +#define GENLIST_SIZE_38_INC 38 +#define GENLIST_SIZE_40_INC 40 +#define GENLIST_SIZE_42_INC 42 +#define GENLIST_SIZE_45_INC 45 +#define GENLIST_SIZE_48_INC 48 +#define GENLIST_SIZE_54_INC 54 +#define GENLIST_SIZE_56_INC 56 +#define GENLIST_SIZE_57_INC 57 +#define GENLIST_SIZE_61_INC 61 +#define GENLIST_SIZE_SLIDE_60_INC 60 +#define GENLIST_SIZE_64_INC 64 +#define GENLIST_SIZE_80_INC 80 +#define GENLIST_SIZE_90_INC 90 +#define GENLIST_SIZE_96_INC 96 +#define GENLIST_SIZE_112_INC 112 +#define GENLIST_SIZE_116_INC 116 +#define GENLIST_SIZE_128_INC 128 +#define GENLIST_SIZE_133_INC 133 +#define GENLIST_SIZE_141_INC 141 +#define GENLIST_SIZE_144_INC 144 +#define GENLIST_SIZE_154_INC 154 +#define GENLIST_SIZE_160_INC 160 +#define GENLIST_SIZE_163_INC 163 +#define GENLIST_SIZE_168_INC 168 +#define GENLIST_SIZE_174_INC 174 +#define GENLIST_SIZE_SLIDE_165_INC 165 +#define GENLIST_SIZE_176_INC 176 +#define GENLIST_SIZE_177_INC 177 +#define GENLIST_SIZE_192_INC 192 +#define GENLIST_SIZE_195_INC 195 +#define GENLIST_SIZE_206_INC 206 +#define GENLIST_SIZE_234_INC 234 +#define GENLIST_SIZE_235_INC 235 +#define GENLIST_SIZE_SLIDE_220_INC 220 +#define GENLIST_SIZE_390_INC 390 +#define GENLIST_SIZE_448_INC 448 +#define GENLIST_SIZE_560_INC 560 +#define GENLIST_SIZE_576_INC 576 +#define GENLIST_SIZE_672_INC 672 + +#define GENLIST_TREESIZE_16_INC 16 +#define GENLIST_TREESIZE_32_INC 32 + diff --git a/main/layout/genlist/genlist_styles.edc b/main/layout/genlist/genlist_styles.edc new file mode 100755 index 0000000..1e0e1fe --- /dev/null +++ b/main/layout/genlist/genlist_styles.edc @@ -0,0 +1,173 @@ +/* + * Copyright 2012 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. + */ + +// ------------------------------------------------------------------- +// 1 line ------------------------------------------------------- +// ------------------------------------------------------------------- +// 2.2.2.1 + group { name: "elm/genlist/item/ivug/2text.2/default"; + alias: "elm/genlist/item_odd/ivug/2text.2/default"; + alias: "elm/genlist/item_compress/ivug/2text.2/default"; + alias: "elm/genlist/item_compress_odd/ivug/2text.2/default"; + + GENLIST_DATA_ITEM_NORMAL + data.item: "texts" "elm.text.1 elm.text.2"; + data.item: "contents" "elm.icon.edit"; + + parts { + GENLIST_PART_BG_IMAGE + GENLIST_PART_BASE + GENLIST_PART_BOTTOM_LINE + GENLIST_PART_PADDING_LEFT + GENLIST_PART_PADDING_RIGHT + GENLIST_PART_PADDING_TOP_2LINE + GENLIST_PART_PADDING_BOTTOM_2LINE + + GENLIST_PART_LISTITEM_("elm.text.1", GENLIST_HEIGHT_2LINE_MAIN, + "elm.padding.left", "elm.padding.right", + "elm.padding.top", "elm.text.2", + ) + GENLIST_PART_SUBITEM_LRB("elm.text.2", GENLIST_HEIGHT_2LINE_SUB, + "elm.padding.left", "elm.padding.right", "elm.padding.bottom") + GENLIST_PART_FLIP + } + GENLIST_PROGRAMS_NORMAL( target: "elm.text.1"; target: "elm.text.2"; ) + } + +// 2.2.2.1 (textblock) + group { name: "elm/genlist/item/ivug/2text.2.tb/default"; + alias: "elm/genlist/item_odd/ivug/2text.2.tb/default"; + alias: "elm/genlist/item_compress/ivug/2text.2.tb/default"; + alias: "elm/genlist/item_compress_odd/ivug/2text.2.tb/default"; + + GENLIST_DATA_ITEM_NORMAL + data.item: "texts" "elm.text.1 elm.text.2"; + data.item: "contents" "elm.icon.edit"; + + parts { + GENLIST_PART_BG_IMAGE + GENLIST_PART_BASE + GENLIST_PART_BOTTOM_LINE + GENLIST_PART_PADDING_LEFT + GENLIST_PART_PADDING_RIGHT + GENLIST_PART_PADDING_TOP_2LINE + GENLIST_PART_PADDING_BOTTOM_2LINE + + GENLIST_PART_LISTITEM_TB_("elm.text.1", GENLIST_HEIGHT_2LINE_MAIN, + "elm.padding.left", "elm.padding.right", + "elm.padding.top", "elm.text.2", + ) + GENLIST_PART_SUBITEM_LRB_TB("elm.text.2", GENLIST_HEIGHT_2LINE_SUB, + "elm.padding.left", "elm.padding.right", "elm.padding.bottom" + ) + GENLIST_PART_FLIP + } + GENLIST_PROGRAMS_NORMAL( target: "elm.text.1"; target: "elm.text.2"; ) + } + + // 2.2.2.4 + group { name: "elm/genlist/item/ivug/multiline/2text.5icon/default"; + alias: "elm/genlist/item_odd/ivug/multiline/2ext.5icon/default"; + alias: "elm/genlist/item_compress/ivug/multiline/2text.5icon/default"; + alias: "elm/genlist/item_compress_odd/ivug/multiline/2text.5icon/default"; + // FIXME: deprecated name, wiil be removed + alias: "elm/genlist/item/multiline/2text.1icon/default"; + alias: "elm/genlist/item_odd/multiline/2ext.1icon/default"; + alias: "elm/genlist/item_compress/multiline/2text.1icon/default"; + alias: "elm/genlist/item_compress_odd/multiline/2text.1icon/default"; + + GENLIST_DATA_ITEM_NORMAL + data.item: "texts" "elm.text.1 elm.text.2"; + data.item: "contents" "elm.icon.1 elm.icon.2 elm.icon.3 elm.icon.4 elm.icon.5 elm.icon.edit"; + + parts { + GENLIST_PART_BG_IMAGE + GENLIST_PART_BASE + GENLIST_PART_BOTTOM_LINE + GENLIST_PART_PADDING_LEFT + GENLIST_PART_PADDING_RIGHT + GENLIST_PART_PADDING_TOP_SIZE( 16 ) + GENLIST_PART_PADDING_BOTTOM_SIZE( 16 ) + + GENLIST_PART_LISTITEM("elm.text.1", + GENLIST_DESCRIPTION_LRT("elm.padding.left", "elm.padding.icon5.left", "elm.padding.top", + GENLIST_PARAM_LISTITEM + min: 0 GENLIST_HEIGHT_2LINE_MAIN; ) + GENLIST_DESCRIPTION_LISTITEM_OTHERS + ) + GENLIST_PART_PADDING_R("elm.padding.icon5.left", "elm.icon.5") + GENLIST_PART_ICON_STAR_RTB("elm.icon.5", + "elm.icon.4", "elm.padding.top", "elm.text.2") + GENLIST_PART_ICON_STAR_RTB("elm.icon.4", + "elm.icon.3", "elm.padding.top", "elm.text.2") + GENLIST_PART_ICON_STAR_RTB("elm.icon.3", + "elm.icon.2", "elm.padding.top", "elm.text.2") + GENLIST_PART_ICON_STAR_RTB("elm.icon.2", + "elm.icon.1", "elm.padding.top", "elm.text.2") + GENLIST_PART_ICON_STAR_RTB("elm.icon.1", + "elm.padding.right", "elm.padding.top", "elm.text.2") + + + GENLIST_PART_PADDING_T_SIZE("elm.padding.text1.bottom", "elm.text.1", 16) + GENLIST_PART_TEXTBLOCK("elm.text.2", + GENLIST_DESCRIPTION("elm.padding.left", "elm.padding.right", "elm.padding.text1.bottom", "elm.padding.bottom", + GENLIST_PARAM_SUBITEM_DEFAULT_TB_WRAP + min: 0 GENLIST_HEIGHT_MULTILINE_SUB; ) + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB_WRAP + ) + GENLIST_PART_FLIP + } + GENLIST_PROGRAMS_NORMAL( target: "elm.text.1"; target: "elm.text.2"; ) + } + + + // 2.2.4.3 + group { name: "elm/genlist/item/ivug/multiline/2text/default"; + alias: "elm/genlist/item_odd/ivug/multiline/2ext/default"; + alias: "elm/genlist/item_compress/ivug/multiline/2text/default"; + alias: "elm/genlist/item_compress_odd/ivug/multiline/2text/default"; + + GENLIST_DATA_ITEM_NORMAL + data.item: "texts" "elm.text.1 elm.text.2"; + data.item: "contents" "elm.icon.edit"; + + parts { + GENLIST_PART_BG_IMAGE + GENLIST_PART_BASE + GENLIST_PART_BOTTOM_LINE + GENLIST_PART_PADDING_LEFT + GENLIST_PART_PADDING_RIGHT + GENLIST_PART_PADDING_TOP_2LINE + GENLIST_PART_PADDING_BOTTOM_2LINE + + GENLIST_PART_TEXT("elm.text.1", + GENLIST_DESCRIPTION_LRT("elm.padding.left", "elm.padding.right", "elm.padding.top", + GENLIST_PARAM_LISTITEM + min: 0 GENLIST_HEIGHT_2LINE_MAIN; ) + GENLIST_DESCRIPTION_LISTITEM_OTHERS + ) + GENLIST_PART_PADDING_T_SIZE("elm.padding.text1.bottom", "elm.text.1", 16) + GENLIST_PART_TEXTBLOCK("elm.text.2", + GENLIST_DESCRIPTION("elm.padding.left", "elm.padding.right", "elm.padding.text1.bottom", "elm.padding.bottom", + GENLIST_PARAM_SUBITEM_DEFAULT_TB_WRAP + min: 0 GENLIST_HEIGHT_MULTILINE_SUB; ) + GENLIST_DESCRIPTION_SUBITEM_DEFAULT_OTHERS_TB_WRAP + ) + GENLIST_PART_FLIP + } + GENLIST_PROGRAMS_NORMAL( target: "elm.text.1"; target: "elm.text.2"; ) + } + diff --git a/main/layout/genlist/genlist_textblock_styles.edc b/main/layout/genlist/genlist_textblock_styles.edc new file mode 100755 index 0000000..3f7c3b5 --- /dev/null +++ b/main/layout/genlist/genlist_textblock_styles.edc @@ -0,0 +1,124 @@ +/* + * Copyright 2012 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. + */ + + +#define STYLE_TAG \ + tag: "br" "\n";\ + tag: "ps" "ps";\ + tag: "tab" "\t";\ + tag: "b" "+ font=SLP:style=Bold";\ + +#define STYLE_TAG_MATCH \ + tag: "match" GENLIST_PART_MATCH_TAG_COLOR; \ + +// FIXME: Why this is needed? just don't use match color, right? damn textblock bug... +#define STYLE_TAG_MATCH_FOCUS \ + tag: "match" GENLIST_LIST_MAIN_TEXT_FOCUS_COLOR_STYLE; \ + + +styles { + // ********************** dialgoue group help text + style { name: "genlist_style_dialogue_group_help_text"; + base: "font=SLP:style=Medium font_size="GENLIST_DIALOGUE_GROUP_HELP_TEXT_SIZE" color="GENLIST_DIALOGUE_GROUP_HELP_TEXT_COLOR_STYLE" text_class=list_item wrap=mixed"; + STYLE_TAG + STYLE_TAG_MATCH + } + // ********************** list main text + style { name: "genlist_style_list_main_text_unread"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_UNREAD_COLOR_STYLE" text_class=list_item ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_main_text_unread_dim"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_UNREAD_DIM_COLOR_STYLE" text_class=list_item ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_main_text_read"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_READ_COLOR_STYLE" text_class=list_item ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_main_text_read_dim"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_READ_DIM_COLOR_STYLE" text_class=list_item ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_main_text_focus"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_FOCUS_COLOR_STYLE" text_class=list_item ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH_FOCUS + } + // ********************** list main text (multiline) + style { name: "genlist_style_list_main_text_unread_wrap"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_UNREAD_COLOR_STYLE" text_class=slp wrap=mixed"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_main_text_unread_dim_wrap"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_UNREAD_DIM_COLOR_STYLE" text_class=slp wrap=mixed"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_main_text_focus_wrap"; + base: "font=SLP:style=Regular font_size="GENLIST_LIST_MAIN_TEXT_SIZE" color="GENLIST_LIST_MAIN_TEXT_FOCUS_COLOR_STYLE" text_class=slp wrap=mixed"; + STYLE_TAG + STYLE_TAG_MATCH_FOCUS + } + // ********************** list sub text + style { name: "genlist_style_list_sub_text_default"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_DEFAULT_COLOR_STYLE" text_class=slp ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_sub_text_default_dim"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_DEFAULT_DIM_COLOR_STYLE" text_class=slp ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH_FOCUS + } + style { name: "genlist_style_list_sub_text_settings"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_SETTINGS_COLOR_STYLE" text_class=slp ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_sub_text_settings_dim"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_SETTINGS_DIM_COLOR_STYLE" text_class=slp ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_sub_text_focus"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_FOCUS_COLOR_STYLE" text_class=slp ellipsis=1.0"; + STYLE_TAG + STYLE_TAG_MATCH_FOCUS + } + // ********************** list sub text (multiline) + style { name: "genlist_style_list_sub_text_default_wrap"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_DEFAULT_COLOR_STYLE" text_class=slp wrap=mixed"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_sub_text_default_dim_wrap"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_DEFAULT_DIM_COLOR_STYLE" text_class=slp wrap=mixed"; + STYLE_TAG + STYLE_TAG_MATCH + } + style { name: "genlist_style_list_sub_text_focus_wrap"; + base: "font=SLP:style=Bold font_size="GENLIST_LIST_SUB_TEXT_SIZE" color="GENLIST_LIST_SUB_TEXT_FOCUS_COLOR_STYLE" text_class=slp wrap=mixed"; + STYLE_TAG + STYLE_TAG_MATCH + } +} + diff --git a/main/layout/genlist/ivug-genlist.edc b/main/layout/genlist/ivug-genlist.edc new file mode 100755 index 0000000..b91d7b0 --- /dev/null +++ b/main/layout/genlist/ivug-genlist.edc @@ -0,0 +1,29 @@ +/* + * Copyright 2012 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 "../ivug-theme.edc" + +collections { + +#include "genlist_size.edc" +#include "genlist_macro.edc" + +#include "genlist_textblock_styles.edc" +#include "genlist_styles.edc" +#include "genlist_group_index.edc" + +} + diff --git a/main/layout/icons/T01_Facebook.png b/main/layout/icons/T01_Facebook.png new file mode 100644 index 0000000000000000000000000000000000000000..3312a7d3574e2c7b6d07d708f899cd2b5d538a35 GIT binary patch literal 3094 zcmV+x4C(WUP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ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o8<|^W)pHHWw!(w(dqj0mUe?Ei#FShpJ%6}nj+Ae6b!Mq{5LBVTt4rK)hscn&R32g%!@H; zSI(`lJ}?k2Bi3;#gZp*x>_c=MubfU6?3VW%Md9~PX#wpBpB?Blxb7(PIRU%WI3U6d7r+$=U zU5nH+oVxh)p6fi>k}SPzLGF_2j0kbF6dK+iu8fFf8$u13Z*?0*0qFHc4Q literal 0 HcmV?d00001 diff --git a/main/layout/icons/T01_btn_play.png b/main/layout/icons/T01_btn_play.png new file mode 100644 index 0000000000000000000000000000000000000000..a19a8e0abe37402f432f20ff4ccb70de89ac9e8c GIT binary patch literal 6920 zcmWky1y~hL6kWQzODO^AZt3oBX?cV+((#aPkp}7R5)gPO-HmifH%OPjzyE&U>}!}%|*e`9RM&0{%>$V<~LFR zKv%bume$a)b@p&}w{>=*R+N^ec5!pIvHSP|0KAv7wIMp%2gL7g*RG_LBcaL4&RRsM z)LK$8P{Kq8W*RhHrAV6mMIy~EJXu*piov`{g!p)9ERiNFW;FT&$~H|wd`Mwr^zh?` zU!lVs>~?qTxoKW(uj(?paRQ|i6*En9jRH{D0(6e!Vl)7#m;k3{WY}8((GM^mq@(i&LNfqDxeI;K zbCw$1J!UXd84aSX^g^=1#;9zrDEj*Bub9RaNmvN^E#NIOCD^-tGRU}td2#++jsiel zA`uwv<&*a~cFp)We|$5x8QbA6+pd8QNY&%T@zs!YxgF*La!C z*h}tW+9;{7Z~NX%zgTasvpyn-t@8nO_F`~;iEL%>tq^XM8F39fIyY|t;G*5R>o*fB z0@OBSW5Vm@O#Dec?+pO8QT*x(0H!kZ>^j4Z;sdAvAd?r&Tqj9!)kVtMiA>prw9GOyt@UMFs)x&;P<<@?6Qm4Vv$MV>U^*mI;uD$`xQtT6=J1CJ^UkO}c$2e;3Q2 zzc*QFi?fs0SYP{3vN|#?~+JiuFZ0)A-YJ(@t7+2dw2;yb9!WNkdE44h<+m$*j~Y zgJIj*+dbPn+Z5Y07slw>mJ+T-ciNjwTEq5AWIM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^|J^78UoK9{?Ov0+=FjjRH5 zS@t8~(X%TU0i}U(^*ez&@o>1@7Cpllay&del{&sr9U)hd7^s@8U`X%H%+~M0C1;?- z9_R)&SOcV8j9j5+TwL5@uQO=xnw04A%Qcveox#{^!KDfM`$y6WsGMMF7ynQ#$y HnScHdLKhRd literal 0 HcmV?d00001 diff --git a/main/layout/images/00_zoom_in.png b/main/layout/images/00_zoom_in.png new file mode 100755 index 0000000000000000000000000000000000000000..3685b2cc2d67cca6715346076aa0f152c051eb0d GIT binary patch literal 4520 zcmV;Z5m)YsP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#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=aZm_R5C2;3%cdDsW{iZ`+l&=TA1ayq0InYx(p8r)(rEuT~Dz`(|=@ zJ7{3+#B@XbIXXEqp}N@F%W{od4*f{5b6a%*B!uv6a3J^)vz8}>SBa5AVGX4ak00I1f>gI1Qem1-pvdCy(Zv-ZiJd^g;3 zLNyFYW_Bi9xqF>p=lGNW2_YtumA64_KZx%4J_pcFDZQn4fj2q4t)j=-9=SO*s_Mmi zi*8NTgFIXDbF-HB!mh?HN@?o?HZtwvCucpX54y}!pvcNe16mAEtyOKHrT$L`RvQvq%jt2kznVFQW zKdtu23-cP1vzO%(wJ-8Zz!dZ5>9_XH2zIUmz;I-^_s#1E+)?7kJ5vBA7A>^-9$2Wb&@;230UQLJ+JI{Bk z?Jauun~>ylyX8>}0CLFpmo8F$+UdJ90H#s_9H)WXLFAXre&`=ml&uyY$3i*=iph%60!<_B<1k1Tps>}ly!y*R(5 zAZ_~}>HzH28Lk*WP1=rQRa%;9*wy$iIm@P$ML{X;AcSo>> zh~E7sgnQ?Y(A9&o7ZaB4BYv-6^f(74@0C#+7#mXQD~k+;E0?hAx0@N>wpy#!sX@-1 zd(|oV+)ZjHPY>m6LU}H6f3wf?d?Hau-A*lwOp4?xv~NfBL?b z>ZJ$3Tr*=ddkc21PSJ$@Gy1L3OsLfm zBw~`UYf$QG85BLvcDaz38MhodXxwsWW1`_YSF=Gxh#u#K=>B^o0hN$+%pYVccdv?iPKImN zwb09N{5~vOrAR34O3&#A_+7Wh{-yNC9`OGI09H(MX1ry5;s5{u07*qoM6N<$f)M;$ AJpcdz literal 0 HcmV?d00001 diff --git a/main/layout/images/00_zoom_out.png b/main/layout/images/00_zoom_out.png new file mode 100755 index 0000000000000000000000000000000000000000..03e0e96f8ffe060cb3826387ef23d75b205e4659 GIT binary patch literal 4183 zcmV-d5UB5oP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#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`W*_%rP_1v0ss^f$1c`tN^MF`GxzletM!>3l5R6peV9+?Tdy0ToKN;mT2}xO%}8H zC%^a5rF-p>587YhIrc*UR~c`>9|x=efSa=B)R|sw*<~!LEsEE3C95j}dAKM5cqS8l z(OCQNSFuj>y6M*Sk7vZ;o*8_xtF3H@6d21I?DWoZd!l0ivNXFG?r7>Gp@oxblP5if zF9%FDhh9qrQu$J`xx^D^R~d>X^E@p`y{1bCjOC37&2@(>Qhmv^b5;$=^#Btsm%7E_ zp3c>G4r?}OGrg#-&u3d&x;&IM=jS}fCcK-HsRw(dps#)9ceNej=y|{1<e9-=R^v?K)vJ_Niz5d5H;!T~_ zZdXFcpx%H=&`JPq+TnK6u3DR+pg1>PFd<8`i_zQH=cSvU&56T3H{|5`iH63ePDw(Z zCxrB70uTVecmpwga{+M5g)u`r+}YIQE*KP@g4=j}Mkc7Gm&rgXrd(ZGkh%cI5p_ns zW+Itq>Is=KKpm2BT_FE&&#K9OIk5WHFWT0NuF3*{qNw@}0hlVJA-`}xMN!Xf2*6Yz zjpdCF0PYO~xE3!#zP|?`FdQDnPq=j>S`uawLu3 z89ze^xwl~fm5_vgAQ;PjR765|m&JiUkEzK-+B*0puTnW(ya!-_5HhVP^qX~U`a|iP c9`HW{0Qigwe_|#im;e9(07*qoM6N<$f>+n?9smFU literal 0 HcmV?d00001 diff --git a/main/layout/images/theme/blue/00_winset_control_toolbar_bg.png b/main/layout/images/theme/blue/00_winset_control_toolbar_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..33148b2c85ba80d73ce28658e5eeee91c9ad06c6 GIT binary patch literal 2798 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e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awO(J#bXlS(0`R3$Y7&OwY`@=^qV0A|6h$+o)TC(Teh>sW zj`Lct*Rd>%N~Hoonx<&2+3j}3aXbV3>mJ}{fiMIHKp&`I#(Q7^%#~8p;_S}=&peX9 Th#9g>00000NkvXXu0mjfQ@YYe literal 0 HcmV?d00001 diff --git a/main/layout/images/theme/blue/T01_title_btn_press.png b/main/layout/images/theme/blue/T01_title_btn_press.png new file mode 100644 index 0000000000000000000000000000000000000000..49861ed6816e1d36764e2f327b59ebf50dd904da GIT binary patch literal 3126 zcmV-649W9}P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxR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{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0001LNklZE03UE$c^l#Y2?*7BOhJjN|Rle;5SQkk;gLm dtHBfD9stP9kupqU$btX>002ovPDHLkV1n&9SU3Ox literal 0 HcmV?d00001 diff --git a/main/layout/images/theme/white/00_winset_control_top_arrow.png b/main/layout/images/theme/white/00_winset_control_top_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..508c2c8300f490403b01b8ce184d86b4d90d303c GIT binary patch literal 3190 zcmV-+42koJP)71Q{00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*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^9q%`P|}H z008bAFdgjK+Cn8Sl;w42#_O7S;l3~~y8R|h*)pXM&3IksfwDX>0HoZ=51Ev!pu0PX zF^D9cR_@*AA0QP5{)O2_YgNSd8wvIB66ryh(uQrcT2Dcra!9t;oZvzHoBQU`k32}g zeY0z4KEE#n>~`9eOnx%V3y-96ex6&)*dN0xw+-+AEH!HLvN5f%7>I?xVkt;c73;Mg*RNmtB457zI~zceuf6X0dN5P c4}muW062R^z?5E`v;Y7A07*qoM6N<$f_eY)l>h($ literal 0 HcmV?d00001 diff --git a/main/layout/images/theme/white/00_winset_control_top_bg.png b/main/layout/images/theme/white/00_winset_control_top_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..d92230a88f7d34ad2ab833fdf3d6e40ea7f2e509 GIT binary patch literal 2844 zcmV+%3*+>OP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA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eX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0001ENklk%3DNI`@^ z;5w3uZs%Hq$XP*-*WBNpRA@8rG~Fie)As$NeZS|&9ZCY~x literal 0 HcmV?d00001 diff --git a/main/layout/images/theme/white/T01_Edit Field_clear.png b/main/layout/images/theme/white/T01_Edit Field_clear.png new file mode 100644 index 0000000000000000000000000000000000000000..83351518f27bdd708d7ecf6f6f90f9ba953609b8 GIT binary patch literal 3268 zcmV;#3_J6QP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9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Z{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0004GNklAs=7{>AcokeVhI7O)iUBzS*`eB4l7K@)KRB#gfFa@{6C7aZM zkSGdXC6c6z5xX?f`JVCRe#gO0&nxmgr-3d-0gOUt*0lF^O>X8q-jd=8X*Mj zb{pHahd~ekyb0HJN6kj#!*yMbT9YIRe`U2=5y$bn1je0Chva-NMF5WD0E{Kjvn-3# z>BK#$)oK7e2~?$&WLb6>6hZ)0Wihz@mU|-kXACsZKm!dl&_DwXG|)f;4g3X@dz;)% zc}pa))LIwyt~8gPxs-tawO(J#bXlS(0`R3$Y7&OwY`@=^qV0A|6h$+o)TC(Teh>sW zj`Lct*Rd>%N~Hoonx<&2+3j}3aXbV3>mJ}{fiMIHKp&`I#(Q7^%#~8p;_S}=&peX9 Th#9g>00000NkvXXu0mjfQ@YYe literal 0 HcmV?d00001 diff --git a/main/layout/images/theme/white/T01_title_btn_press.png b/main/layout/images/theme/white/T01_title_btn_press.png new file mode 100644 index 0000000000000000000000000000000000000000..49861ed6816e1d36764e2f327b59ebf50dd904da GIT binary patch literal 3126 zcmV-649W9}P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu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program { name: "left_btn_hide"; + signal: "elm,state,title_left_btn,hide"; + source: "elm"; + script { + set_int(buttons_visible, get_int(buttons_visible) - 1); + set_state(PART:"title_btns_padding", "default", 0.0); + if (get_int(buttons_visible) == 0) + set_state(PART:"bottom_right_padding", "default", 0.0); + } + } + program { name: "right_btn_show"; + signal: "elm,state,title_right_btn,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + script { + set_int(buttons_visible, get_int(buttons_visible) + 1); + set_state(PART:"bottom_right_padding", "visible", 0.0); + if (get_int(buttons_visible) >= 2) + set_state(PART:"title_btns_padding", "visible", 0.0); + } + } + program { name: "right_btn_hide"; + signal: "elm,state,title_right_btn,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + script { + set_int(buttons_visible, get_int(buttons_visible) - 1); + set_state(PART:"title_btns_padding", "default", 0.0); + if (get_int(buttons_visible) == 0) + set_state(PART:"bottom_right_padding", "default", 0.0); + } + } + program { name: "more_btn_show"; + signal: "elm,state,toolbar_more_btn,show"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,show", "elm"); + } + } + program { name: "more_btn_hide"; + signal: "elm,state,toolbar_more_btn,hide"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,hide", "elm"); + } + } + program { name: "toolbar_button1_show"; + signal: "elm,state,toolbar_button1,show"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,show", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) + 1); + if (get_int(toolbar_buttons_visible) >= 2) + { + set_state(PART:"toolbar_button1", "buttons_set", 0.0); + set_state(PART:"toolbar_button2", "buttons_set", 0.0); + } + } + } + program { name: "toolbar_button1_hide"; + signal: "elm,state,toolbar_button1,hide"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,hide", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) - 1); + set_state(PART:"toolbar_button1", "default", 0.0); + set_state(PART:"toolbar_button2", "default", 0.0); + } + } + program { name: "toolbar_button2_show"; + signal: "elm,state,toolbar_button2,show"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,show", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) + 1); + if (get_int(toolbar_buttons_visible) >= 2) + { + set_state(PART:"toolbar_button1", "buttons_set", 0.0); + set_state(PART:"toolbar_button2", "buttons_set", 0.0); + } + } + } + program { name: "toolbar_button2_hide"; + signal: "elm,state,toolbar_button2,hide"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,hide", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) - 1); + set_state(PART:"toolbar_button1", "default", 0.0); + set_state(PART:"toolbar_button2", "default", 0.0); + } + } + program { name: "toolbar_bg_show"; + signal: "elm,state,toolbar_bg,show"; + source: "elm"; + script { + set_state(PART:"toolbar_bg", "visible", 0.0); + set_int(tbar_bg, get_int(tbar_bg) + 1); + } + } + program { name: "toolbar_bg_hide"; + signal: "elm,state,toolbar_bg,hide"; + source: "elm"; + script { + set_int(tbar_bg, get_int(tbar_bg) - 1); + if (get_int(tbar_bg) <= 0) + set_state(PART:"toolbar_bg", "default", 0.0); + } + } + program { name: "toolbar_open_internal"; + signal: "elm,state,toolbar,open,internal"; + source: "elm"; + script { + set_int(tbar_close, 0); + set_state(PART:"toolbar_bg", "visible", 0.0); + } + } + program { name: "toolbar_close_internal"; + signal: "elm,state,toolbar,close,internal"; + source: "elm"; + script { + set_int(tbar_close, 1); + set_state(PART:"toolbar_bg", "default", 0.0); + } + } + program { name: "toolbar_open"; + signal: "elm,state,toolbar,open"; + source: ""; + action: STATE_SET "visible" 0.0; + target: "toolbar_bg"; + transition: LINEAR 0.2; + after: "toolbar_open_internal"; + } + program { name: "toolbar_close"; + signal: "elm,state,toolbar,close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "toolbar_bg"; + transition: LINEAR 0.2; + after: "toolbar_close_internal"; + } + program { name: "toolbar_instant_open"; + signal: "elm,state,toolbar,instant_open"; + source: ""; + script { + emit("elm,state,toolbar,open,internal", "elm"); + } + } + program { name: "toolbar_instant_close"; + signal: "elm,state,toolbar,instant_close"; + source: ""; + script { + emit("elm,state,toolbar,close,internal", "elm"); + } + } + program { name: "show_finished"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pushed_finished"; + action: SIGNAL_EMIT "elm,action,pushed,finished" ""; + } + program { name: "popped_finished"; + action: SIGNAL_EMIT "elm,action,popped,finished" ""; + } + program { + name: "title_clicked"; + signal: "mouse,clicked,1"; + source: "click_event_area"; + action: SIGNAL_EMIT "elm,action,title,clicked" ""; + } + program { + name: "display_mode_compress"; + signal: "display,mode,compress"; + source: ""; + script { + set_state(PART:"toolbar_bg", "default", 0.0); + } + } + program { + name: "display_mode_default"; + signal: "display,mode,default"; + source: ""; + script { + if ((get_int(tbar_bg) > 0) && (get_int(tbar_close) == 0)) + set_state(PART:"toolbar_bg", "visible", 0.0); + } + } + } + } + + group { name:"elm/naviframe/item/basic/ivug-main/noindicator"; + script { + public tbar_bg = 0; //Toolbar BG Show call count + public buttons_visible = 0; //when both buttons are visible + public toolbar_buttons_visible = 0; //when both toolbar buttons are visible + public tbar_close = 0; //Toolbar lastest Open/Close status + } + parts { + part { name: "base"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + visible: 0; + } + description { state: "left" 0.0; + inherit: "default" 0.0; + rel1.relative: -1.0 0.0; + rel2.relative: 0.0 1.0; + } + description { state: "right" 0.0; + inherit: "default" 0.0; + rel1.relative: 1.0 0.0; + rel2.relative: 2.0 1.0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 0; + clip_to: "content_clip"; + description { state: "default" 0.0; + align: 0.0 0.0; + rel1.relative: 0.0 0.0; + rel1.to: "base"; + rel2.relative: 1.0 1.0; + rel2.to: "base"; + } + } + part { name: "elm.swallow.detail"; // Detail view. + type: SWALLOW; + scale: 1; + repeat_events: 0; + description { state: "default" 0.0; + color: 255 0 0 100; + align: 0.0 0.0; + rel1.relative: 0.0 1.0; + rel1.to_x: "base"; + rel1.to_y: "title_bg"; + rel1.offset: 0 -10; + rel2.relative: 1.0 0.0; + rel2.to_x: "base"; + rel2.to_y: "toolbar_bg"; + visible: 1; + } + } + + part { name: "title_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 1 NAVIFRAME_TITLE_H_INC; + align: 0.0 0.0; + fixed: 0 1; + rel1 { relative: 0.0 0.0; to: "base"; } + rel2 { relative: 1.0 0.0; to: "base"; } + color: NAVIFRAME_TITLE_BG_COLOR_INC; + } + description { state: "hide" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 0 0; + fixed: 1 1; + } + } + part { name: "title_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "title_bg"; } + rel2 { to: "title_bg"; } + } + } + part { name: "top_padding"; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: NAVIFRAME_TITLE_TOP_PADDING_INC; + fixed: 0 1; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "title_bg"; } + rel2 { relative: 1.0 0.0; to: "title_bg"; } + visible: 0; + } + } + part { name: "padding_center_text1"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + min: NAVIFRAME_PADDING_INC; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "title_bg"; } + rel2 { relative: 0.0 1.0; to: "title_bg"; } + visible: 0; + } + description { state: "icon" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_ICON_PADDING_INC; + } + } + part { name: "content_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + } + } + part { name: "padding_center_text2"; + type: RECT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: NAVIFRAME_PADDING2_INC; + fixed: 1 0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "title_left_btn"; } + rel2 { relative: 0.0 1.0; to: "title_left_btn"; } + visible: 0; + } + } + part { name: "padding_bottom_text"; + type: RECT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: NAVIFRAME_BOTTOM_TEXT_PADDING_INC; + fixed: 0 1; + align: 0.0 1.0; + rel1 { relative: 0.0 1.0; to: "title_bg"; } + rel2 { relative: 1.0 1.0; to: "title_bg"; } + visible: 0; + } + } + part { name: "elm.text.title"; + type: TEXT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + text { font: "Tizen:style=Medium"; + size: NAVIFRAME_TITLE_FONT_SIZE_INC; + min: 0 0; + max: 1 0; + align: 0.0 0.5; + text_class: "tizen"; + } + color: NAVIFRAME_TITLE_TEXT_COLOR_INC; + align: 0.0 0.5; + fixed: 1 1; + rel1 { relative: 1.0 1.0; to_x: "padding_center_text1"; to_y: "top_padding"; } + rel2 { relative: 0.0 0.0; to_x: "padding_center_text2"; to_y: "padding_bottom_text"; } + } + description { state: "subtitle_is_set" 0.0; + inherit: "default" 0.0; + text { font: "Tizen:style=Medium"; + size: NAVIFRAME_TITLE_SMALL_FONT_SIZE_INC; + min: 0 0; + max: 1 0; + align: 0.0 0.2; + text_class: "tizen"; + } + align: 0.0 0.0; + rel1 { relative: 1.0 0.0; to_x: "padding_center_text1"; to_y: "top_padding"; } + } + } + part { name: "elm.text.subtitle"; + type: TEXT; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + text { font: "Tizen:style=Medium"; + size: NAVIFRAME_SUBTITLE_FONT_SIZE_INC; + min: 0 0; + max: 1 0; + text_class: "tizen"; + align: 0.0 1.0; + } + color: NAVIFRAME_SUBTITLE_TEXT_COLOR_INC; + align: 0.0 1.0; + fixed: 1 0; + rel1 { + relative: 1.0 1.0; + to_x: "padding_center_text1"; + to_y: "elm.text.title"; + } + rel2 { + relative: 0.0 1.0; + to_x: "padding_center_text2"; + to_y: "elm.text.title"; + } + } + } + part { name: "padding_before_text"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + align: 1.0 0.5; + rel1 { relative: 0.0 0.0; to: "elm.text.title"; } + rel2 { relative: 0.0 1.0; to: "elm.text.title"; } + fixed: 1 0; + min: NAVIFRAME_PADDING_INC; + visible: 0; + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_ICON_SIZE_INC; + fixed: 1 1; + rel1 { relative: 0.0 0.0; to: "padding_before_text"; } + rel2 { relative: 0.0 1.0; to: "padding_before_text"; } + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + align: 1.0 0.5; + } + } + part { name: "click_event_area"; + ignore_flags: ON_HOLD; + repeat_events: 1; + description { state: "default" 0.0; + rel1 { to: "title_bg"; } + rel2 { to: "title_bg"; } + } + } + part { name: "title_left_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + fixed: 1 1; + align: 1 0.5; + rel1 { relative: 0.0 0.0; to: "title_btns_padding"; } + rel2 { relative: 0.0 1.0; to: "title_btns_padding"; } + } + } + part { name: "title_btns_padding"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + fixed: 1 1; + align: 1 0.5; + visible: 0; + rel1 { relative: 0.0 0.0; to: "title_right_btn"; } + rel2 { relative: 0.0 1.0; to: "title_right_btn"; } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_PADDING2_INC; + } + } + part { name: "bottom_right_padding"; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 0 0; + fixed: 1 1; + align: 1.0 1.0; + rel1 { relative: 1.0 1.0; to: "title_bg"; } + rel2 { relative: 1.0 1.0; to: "title_bg"; } + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: NAVIFRAME_BOTTOM_RIGHT_PADDING_INC; + } + } + part { name: "title_right_btn"; + type: SWALLOW; + scale: 1; + clip_to: "title_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; + align: 1 0.5; + fixed: 1 1; + rel1 { relative: 1.0 1.0; to_x: "title_bg"; to_y: "top_padding"; } + rel2 { relative: 0.0 0.0; to: "bottom_right_padding"; } + } + } + part { name: "toolbar_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 0; + max: 999999 0; + fixed: 0 1; + align: 0.0 1.0; + visible: 0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: NAVIFRAME_TOOLBAR_BG_COLOR_INC; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + min: 0 NAVIFRAME_TOOLBAR_HEIGHT_INC; + max: 999999 NAVIFRAME_TOOLBAR_HEIGHT_INC; + visible: 1; + } + } + part { name: "more_btn_bg"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + min: NAVIFRAME_TOOLBAR_BUTTON_BG_PADDING_INC; + fixed: 1 0; + align: 0.0 0.0; + rel1 { relative: 0.0 0.0; to: "toolbar_bg"; } + rel2 { relative: 0.0 1.0; to: "toolbar_bg"; } + visible: 0; + } + } + part { name: "toolbar_more_btn"; + type: SWALLOW; + scale: 1; + clip_to: "toolbar_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_PREV_FUNC_BTN_SIZE_INC; + fixed: 1 1; + rel1.to: "more_btn_bg"; + rel2.to: "more_btn_bg"; + } + } + part { name: "prev_btn_bg"; + type: RECT; + scale: 1; + mouse_events: 0; + description { state: "default" 0.0; + min: NAVIFRAME_TOOLBAR_BUTTON_BG_PADDING_INC; + fixed: 1 0; + align: 1.0 0.0; + rel1 { relative: 1.0 0.0; to: "toolbar_bg"; } + rel2.to: "toolbar_bg"; + visible: 0; + } + } + part { name: "elm.swallow.prev_btn"; + type: SWALLOW; + scale: 1; + clip_to: "toolbar_clip"; + description { state: "default" 0.0; + max: NAVIFRAME_PREV_FUNC_BTN_SIZE_INC; + fixed: 1 1; + align: 0.5 0.5; + rel1.to: "prev_btn_bg"; + rel2.to: "prev_btn_bg"; + } + } + part { name: "toolbar_btns_area"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { relative: 1.0 0.0; to: "more_btn_bg"; } + rel2 { relative: 0.0 1.0; to: "prev_btn_bg"; } + visible: 0; + } + } + part { name: "toolbar_clip"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + rel1 { to: "toolbar_bg"; } + rel2 { to: "toolbar_bg"; } + } + } + part { name: "toolbar_button1"; + type: SWALLOW; + scale: 1; + clip_to: "toolbar_clip"; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1.to: "toolbar_btns_area"; + rel2.to: "toolbar_btns_area"; + } + description { state: "buttons_set" 0.0; + inherit: "default" 0.0; + align: 1.0 0.5; + rel2 { + relative: 0.0 1.0; + to: "toolbar_button_padding"; + } + } + } + part { name: "toolbar_button_padding"; + type: RECT; + scale : 1; + description { state: "default" 0.0; + min: NAVIFRAME_TOOLBAR_BUTTONS_PADDING_INC 0; + max: NAVIFRAME_TOOLBAR_BUTTONS_PADDING_INC 9999; + fixed : 1 0; + visible: 0; + align: 0.5 0.5; + rel1.to: "toolbar_clip"; + rel2.to: "toolbar_clip"; + } + } + part { name: "toolbar_button2"; + type: SWALLOW; + scale: 1; + clip_to: "toolbar_clip"; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1.to: "toolbar_btns_area"; + rel2.to: "toolbar_btns_area"; + } + description { state: "buttons_set" 0.0; + inherit: "default" 0.0; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + to: "toolbar_button_padding"; + } + } + } + } + programs { + program { name: "content_new_pushed"; + signal: "elm,state,new,pushed,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_pushed"; + signal: "elm,state,cur,pushed,internal"; + source: ""; + action: STATE_SET "left" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "pushed_finished"; + } + program { name: "content_prev_popped"; + signal: "elm,state,prev,popped,internal"; + source: ""; + action: STATE_SET "default" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "show_finished"; + } + program { name: "content_cur_popped"; + signal: "elm,state,cur,popped,internal"; + source: ""; + action: STATE_SET "right" 0.0; + target: "base"; + transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; + after: "popped_finished"; + } + program { name: "cur_pushed"; + signal: "elm,state,cur,pushed"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,pushed,internal", ""); + } + } + program { name: "new_pushed"; + signal: "elm,state,new,pushed"; + source: "elm"; + script { + set_state(PART:"base", "right", 0.0); + emit("elm,state,new,pushed,internal", ""); + } + } + program { name: "prev_popped"; + signal: "elm,state,prev,popped"; + source: "elm"; + script { + set_state(PART:"base", "left", 0.0); + emit("elm,state,prev,popped,internal", ""); + } + } + program { name: "cur_popped"; + signal: "elm,state,cur,popped"; + source: "elm"; + script { + set_state(PART:"base", "default", 0.0); + emit("elm,state,cur,popped,internal", ""); + } + } + program { name: "visible"; + signal: "elm,state,visible"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "base"; + } + program { name: "title_show"; + signal: "elm,state,title,show"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "title_bg"; + } + program { name: "title_hide"; + signal: "elm,state,title,hide"; + source: "elm"; + action: STATE_SET "hide" 0.0; + target: "title_bg"; + } + program { name: "subtitle_show"; + signal: "elm,state,subtitle,show"; + source: "elm"; + script { + set_state(PART:"elm.text.title", "subtitle_is_set", 0.0); + } + } + program { name: "subtitle_hide"; + signal: "elm,state,subtitle,hide"; + source: "elm"; + script { + set_state(PART:"elm.text.title", "default", 0.0); + } + } + program { name: "prev_btn_show"; + signal: "elm,state,prev_btn,show"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,show", "elm"); + } + } + program { name: "prev_btn_hide"; + signal: "elm,state,prev_btn,hide"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,hide", "elm"); + } + } + program { name: "icon_show"; + signal: "elm,state,icon,show"; + source: "elm"; + action: STATE_SET "icon" 0.0; + target: "padding_center_text1"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "padding_center_text1"; + } + program { name: "left_btn_show"; + signal: "elm,state,title_left_btn,show"; + source: "elm"; + script { + set_int(buttons_visible, get_int(buttons_visible) + 1); + set_state(PART:"bottom_right_padding", "visible", 0.0); + if (get_int(buttons_visible) >= 2) + set_state(PART:"title_btns_padding", "visible", 0.0); + } + } + program { name: "left_btn_hide"; + signal: "elm,state,title_left_btn,hide"; + source: "elm"; + script { + set_int(buttons_visible, get_int(buttons_visible) - 1); + set_state(PART:"title_btns_padding", "default", 0.0); + if (get_int(buttons_visible) == 0) + set_state(PART:"bottom_right_padding", "default", 0.0); + } + } + program { name: "right_btn_show"; + signal: "elm,state,title_right_btn,show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + script { + set_int(buttons_visible, get_int(buttons_visible) + 1); + set_state(PART:"bottom_right_padding", "visible", 0.0); + if (get_int(buttons_visible) >= 2) + set_state(PART:"title_btns_padding", "visible", 0.0); + } + } + program { name: "right_btn_hide"; + signal: "elm,state,title_right_btn,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + script { + set_int(buttons_visible, get_int(buttons_visible) - 1); + set_state(PART:"title_btns_padding", "default", 0.0); + if (get_int(buttons_visible) == 0) + set_state(PART:"bottom_right_padding", "default", 0.0); + } + } + program { name: "more_btn_show"; + signal: "elm,state,toolbar_more_btn,show"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,show", "elm"); + } + } + program { name: "more_btn_hide"; + signal: "elm,state,toolbar_more_btn,hide"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,hide", "elm"); + } + } + program { name: "toolbar_button1_show"; + signal: "elm,state,toolbar_button1,show"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,show", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) + 1); + if (get_int(toolbar_buttons_visible) >= 2) + { + set_state(PART:"toolbar_button1", "buttons_set", 0.0); + set_state(PART:"toolbar_button2", "buttons_set", 0.0); + } + } + } + program { name: "toolbar_button1_hide"; + signal: "elm,state,toolbar_button1,hide"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,hide", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) - 1); + set_state(PART:"toolbar_button1", "default", 0.0); + set_state(PART:"toolbar_button2", "default", 0.0); + } + } + program { name: "toolbar_button2_show"; + signal: "elm,state,toolbar_button2,show"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,show", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) + 1); + if (get_int(toolbar_buttons_visible) >= 2) + { + set_state(PART:"toolbar_button1", "buttons_set", 0.0); + set_state(PART:"toolbar_button2", "buttons_set", 0.0); + } + } + } + program { name: "toolbar_button2_hide"; + signal: "elm,state,toolbar_button2,hide"; + source: "elm"; + script { + emit("elm,state,toolbar_bg,hide", "elm"); + set_int(toolbar_buttons_visible, get_int(toolbar_buttons_visible) - 1); + set_state(PART:"toolbar_button1", "default", 0.0); + set_state(PART:"toolbar_button2", "default", 0.0); + } + } + program { name: "toolbar_bg_show"; + signal: "elm,state,toolbar_bg,show"; + source: "elm"; + script { + set_state(PART:"toolbar_bg", "visible", 0.0); + set_int(tbar_bg, get_int(tbar_bg) + 1); + } + } + program { name: "toolbar_bg_hide"; + signal: "elm,state,toolbar_bg,hide"; + source: "elm"; + script { + set_int(tbar_bg, get_int(tbar_bg) - 1); + if (get_int(tbar_bg) <= 0) + set_state(PART:"toolbar_bg", "default", 0.0); + } + } + program { name: "toolbar_open_internal"; + signal: "elm,state,toolbar,open,internal"; + source: "elm"; + script { + set_int(tbar_close, 0); + set_state(PART:"toolbar_bg", "visible", 0.0); + } + } + program { name: "toolbar_close_internal"; + signal: "elm,state,toolbar,close,internal"; + source: "elm"; + script { + set_int(tbar_close, 1); + set_state(PART:"toolbar_bg", "default", 0.0); + } + } + program { name: "toolbar_open"; + signal: "elm,state,toolbar,open"; + source: ""; + action: STATE_SET "visible" 0.0; + target: "toolbar_bg"; + transition: LINEAR 0.2; + after: "toolbar_open_internal"; + } + program { name: "toolbar_close"; + signal: "elm,state,toolbar,close"; + source: ""; + action: STATE_SET "default" 0.0; + target: "toolbar_bg"; + transition: LINEAR 0.2; + after: "toolbar_close_internal"; + } + program { name: "toolbar_instant_open"; + signal: "elm,state,toolbar,instant_open"; + source: ""; + script { + emit("elm,state,toolbar,open,internal", "elm"); + } + } + program { name: "toolbar_instant_close"; + signal: "elm,state,toolbar,instant_close"; + source: ""; + script { + emit("elm,state,toolbar,close,internal", "elm"); + } + } + program { name: "show_finished"; + action: SIGNAL_EMIT "elm,action,show,finished" ""; + } + program { name: "pushed_finished"; + action: SIGNAL_EMIT "elm,action,pushed,finished" ""; + } + program { name: "popped_finished"; + action: SIGNAL_EMIT "elm,action,popped,finished" ""; + } + program { + name: "title_clicked"; + signal: "mouse,clicked,1"; + source: "click_event_area"; + action: SIGNAL_EMIT "elm,action,title,clicked" ""; + } + program { + name: "display_mode_compress"; + signal: "display,mode,compress"; + source: ""; + script { + set_state(PART:"toolbar_bg", "default", 0.0); + } + } + program { + name: "display_mode_default"; + signal: "display,mode,default"; + source: ""; + script { + if ((get_int(tbar_bg) > 0) && (get_int(tbar_close) == 0)) + set_state(PART:"toolbar_bg", "visible", 0.0); + } + } + } + } + +} diff --git a/main/layout/ivug-popup.edc b/main/layout/ivug-popup.edc new file mode 100755 index 0000000..40aba02 --- /dev/null +++ b/main/layout/ivug-popup.edc @@ -0,0 +1,172 @@ +/* + * Copyright 2012 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. + */ + +/* referenced by elm_demo "popup_checkview" in popup_custom.edc */ +collections { + group { name: "popup_checkview"; + parts{ + part { name: "background"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + + part { name: "pad_t"; + scale : 1; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + align: 0.5 0.0; + min: 0 14; + fixed: 0 1; + rel1 { + relative: 1.0 0.0;to_x: "pad_l"; + } + rel2 { + relative: 0.0 0.0;to_x: "pad_r"; + } + } + } + part { name: "pad_l"; + scale: 1; + description { state: "default" 0.0; + min : 10 0; + fixed: 1 0; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 0.0 1.0; + } + align: 0.0 0.0; + } + } + part { name: "pad_r"; + scale: 1; + description { state: "default" 0.0; + min : 10 0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + align: 1.0 0.0; + } + } + part{ name:"elm.swallow.content"; + type: SWALLOW; + scale : 1; + description { state: "default" 0.0; + min: 380 0; + align: 0.5 0.5; + fixed: 1 0; + rel1 { + relative: 0.5 1.0; + to: "pad_t"; + } + rel2 { + relative: 0.5 0.0; + to: "pad_b"; + } + } + } + part { name: "pad_b"; + scale : 1; + mouse_events: 0; + repeat_events: 1; + description { state: "default" 0.0; + align: 0.5 1.0; + min: 0 100; + fixed: 0 1; + rel1 { + relative: 1.0 1.0;to_x: "pad_l"; + } + rel2 { + relative: 0.0 1.0;to_x: "pad_r"; + } + } + } + part { name: "elm.swallow.end"; + type: SWALLOW; + scale : 1; + mouse_events: 1; + repeat_events: 1; + description { state: "default" 0.0; + align: 0.0 1.0; + rel1 { + relative: 0.1 0.0; + to: "pad_b"; + } + rel2 { + relative: 1.0 1.0; + to: "pad_b"; + } + } + } + part { name: "elm.text"; + type: TEXT; + scale : 1; + mouse_events: 0; + description { state: "default" 0.0; + text { + font: "Tizen:style=Medium"; + size: 36; + min: 0 0; + align: 0.5 0.5; + text_class: "slp_medium"; + } + color: 0 0 0 255; + align: 0.0 1.0; + rel1 { + relative: 0.2 0.0; + to: "pad_b"; + } + rel2 { + relative: 0.8 1.0; + to: "pad_b"; + } + } + } + } + } + + group { name: "popup_entryview"; + parts{ + part{ name:"elm.swallow.content"; + type: SWALLOW; + scale : 1; + description { state: "default" 0.0; + align: 0.5 0.5; + rel1 { + relative: 0.0 0.0; + } + rel2 { + relative: 1.0 1.0; + } + } + } + } + } +} + diff --git a/main/layout/ivug-selectioninfo.edc b/main/layout/ivug-selectioninfo.edc new file mode 100755 index 0000000..9c66c61 --- /dev/null +++ b/main/layout/ivug-selectioninfo.edc @@ -0,0 +1,375 @@ +/* + * Copyright 2012 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. + */ + +/* +* Refer to themes\groups\selectioninfo.edc +*/ + +#define SELECTION_INFO_BACKGROUND_COLOR_INC 42 54 74 255 +#define SELECTION_INFO_TEXT_COLOR_INC 249 249 249 255 + +#define SELECTION_INFO_MIN_VER_W_INC 720 +#define SELECTION_INFO_MIN_HORZ_W_INC 1280 +#define SELECTION_INFO_VER_PADDING_INC 48 +#define SELECTION_INFO_LEFT_PADDING_INC 16 +#define SELECTION_INFO_TEXT_FONT_SIZE_INC 32 +#define SELECTION_INFO_MIN_VER_BOTTOM_64_H_INC 160//=95+48 150 +#define SELECTION_INFO_MIN_VER_BOTTOM_86_H_INC 160//=95+48 186 + +collections { + + group { name: "elm/standard/selectioninfo/vertical/bottom_12"; + parts { + part { name: "bg"; + type: RECT; + scale : 1; + description { + state: "default" 0.0; + min: SELECTION_INFO_MIN_VER_W_INC SELECTION_INFO_VER_PADDING_INC; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel2.relative: 0.5 1.0; + color: SELECTION_INFO_BACKGROUND_COLOR_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.0; + rel1 { to: "bg"; } + rel2 { to: "bg"; } + color: SELECTION_INFO_TEXT_COLOR_INC; + text { + font: "Tizen"; + size: SELECTION_INFO_TEXT_FONT_SIZE_INC; + text: ""; + text_class: "tizen"; + } + } + } + } + programs { + program { name: "clicked"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } + } + + group { name: "elm/standard/selectioninfo/vertical/bottom_64"; + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: SELECTION_INFO_MIN_VER_W_INC SELECTION_INFO_MIN_VER_BOTTOM_64_H_INC; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel2.relative: 0.5 1.0; + color: 0 0 0 0; + } + } + part { name: "base"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: 0 SELECTION_INFO_VER_PADDING_INC; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.32; to: "bg"; } + color: SELECTION_INFO_BACKGROUND_COLOR_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: SELECTION_INFO_TEXT_COLOR_INC; + text { + font: "Tizen"; + size: SELECTION_INFO_TEXT_FONT_SIZE_INC; + text: ""; + text_class: "tizen"; + } + } + } + } + programs { + program { + name: "clicked"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } + } + + group { name: "elm/standard/selectioninfo/vertical/bottom_86"; + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: SELECTION_INFO_MIN_VER_W_INC SELECTION_INFO_MIN_VER_BOTTOM_86_H_INC; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel2.relative: 0.5 1.0; + color: 0 0 0 0; + } + } + part { + name: "base"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: 0 SELECTION_INFO_VER_PADDING_INC; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.258; to: "bg"; } + color: SELECTION_INFO_BACKGROUND_COLOR_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: SELECTION_INFO_TEXT_COLOR_INC; + text { + font: "Tizen"; + size: SELECTION_INFO_TEXT_FONT_SIZE_INC; + text: ""; + text_class: "tizen"; + } + } + } + } + programs { + program { + name: "clicked"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } + } + + group { name: "elm/standard/selectioninfo/horizontal/bottom_12"; + parts { + part { name: "bg"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: SELECTION_INFO_MIN_HORZ_W_INC SELECTION_INFO_VER_PADDING_INC; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel2.relative: 0.5 1.0; + color: SELECTION_INFO_BACKGROUND_COLOR_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.0; + rel1 { to: "bg"; } + rel2 { to: "bg"; } + color: SELECTION_INFO_TEXT_COLOR_INC; + text { + font: "Tizen"; + size: SELECTION_INFO_TEXT_FONT_SIZE_INC; + text: ""; + text_class: "tizen"; + } + } + } + } + programs { + program { name: "clicked"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } + } + + group { name: "elm/standard/selectioninfo/horizontal/bottom_64"; + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: SELECTION_INFO_MIN_HORZ_W_INC SELECTION_INFO_MIN_VER_BOTTOM_64_H_INC; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel2.relative: 0.5 1.0; + color: 0 0 0 0; + } + } + part { name: "base"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: 0 SELECTION_INFO_VER_PADDING_INC; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.32; to: "bg"; } + color: SELECTION_INFO_BACKGROUND_COLOR_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: SELECTION_INFO_TEXT_COLOR_INC; + text { + font: "Tizen"; + size: SELECTION_INFO_TEXT_FONT_SIZE_INC; + text: ""; + text_class: "tizen"; + } + } + } + } + programs { + program { + name: "clicked"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } + } + + group { name: "elm/standard/selectioninfo/horizontal/bottom_86"; + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: SELECTION_INFO_MIN_HORZ_W_INC SELECTION_INFO_MIN_VER_BOTTOM_86_H_INC; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel2.relative: 0.5 1.0; + color: 0 0 0 0; + } + } + part { + name: "base"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: 0 SELECTION_INFO_VER_PADDING_INC; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.258; to: "bg"; } + color: SELECTION_INFO_BACKGROUND_COLOR_INC; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.0; + rel1 { to: "base"; } + rel2 { to: "base"; } + color: SELECTION_INFO_TEXT_COLOR_INC; + text { + font: "Tizen"; + size: SELECTION_INFO_TEXT_FONT_SIZE_INC; + text: ""; + text_class: "tizen"; + } + } + } + } + programs { + program { + name: "clicked"; + signal: "mouse,clicked,1"; + source: "base"; + action: SIGNAL_EMIT "elm,action,click" ""; + } + } + } + +} + diff --git a/main/layout/ivug-setas.edc b/main/layout/ivug-setas.edc new file mode 100755 index 0000000..da97d07 --- /dev/null +++ b/main/layout/ivug-setas.edc @@ -0,0 +1,212 @@ +/* + * Copyright 2012 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 "ivug-theme.edc" + +#define PADDING_VISIBILITY 0 + +#define NOTIFY_HEIGHT 47 + +collections { + +#define PROGRESSBAR_WIDTH 100 +#define PROGRESSBAR_HEIGHT 100 + + group { + name: "setas_view"; + + parts{ + part { + name: "bg"; + type: RECT; + scale:1; + description { + state: "default" 0.0; + color: 0 0 0 255; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + + part { + name: "indicator"; + type: RECT; + scale: 1; + repeat_events : 0; + description { + state: "default" 0.0; + min: 0 LAYOUT_INDICATOR_HEIGHT_INC; + // max: 0 LAYOUT_INDICATOR_HEIGHT_INC; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 0.0; + fixed: 0 1; + align: 0.5 0.0; + color: LAYOUT_INDICATOR_COLOR_INC; + visible: 0; + } + + description { + state: "hide" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + + part { name: "setasview.contents"; + type: RECT; + scale: 1; + repeat_events: 0; + description { state: "default" 0.0; + color: 0 0 0 100; + align: 0.0 0.0; + rel1.relative: 0.0 1.0; + rel1.to_x: "bg"; + rel1.to_y: "indicator"; + rel1.offset: 0 0; + rel2.relative: 1.0 0.0; + rel2.to_x: "bg"; + rel2.to_y: "toolbar_bg"; + rel2.offset: 0 -NOTIFY_HEIGHT; //for notify + visible: 1; + } + } + + part { name: "setasview.contents.swallow"; + type: SWALLOW; + scale: 1; + repeat_events: 0; + description { state: "default" 0.0; + rel1 { relative: 0 0; to:setasview.contents; } + rel2 { relative: 1 1; to:setasview.contents; } + visible: 1; + } + } + + part { name: "setasview.contents.swallow.notify"; + type: RECT; + scale: 1; + repeat_events: 0; + description { state: "default" 0.0; + rel1 { relative: 0 0; to:setasview.contents; } + rel2 { relative: 1 1; to:setasview.contents; offset: 0 NOTIFY_HEIGHT;} + visible: 1; + } + } + + part{ + name: "setasview.photocam"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; //allow scaling + + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0 0; to:setasview.contents; } + rel2 { relative: 1 1; to:setasview.contents; } + } + } + + part{ + name: "setasview.thumbnail"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; //allow scaling + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 1; + rel1 { relative: 0 0; to:setasview.contents; } + rel2 { relative: 1 1; to:setasview.contents; } + } + } + + part{ + name: "setasview.progressbar"; + type: SWALLOW; + scale: 1; //allow scaling + + description { + state: "default" 0.0; + min: PROGRESSBAR_WIDTH PROGRESSBAR_WIDTH; + max: PROGRESSBAR_WIDTH PROGRESSBAR_WIDTH; + fixed: 1 1; + visible: 1; + align: 0.5 0.5; + rel1 { relative: 0 0; to:"setasview.photocam"; } + rel2 { relative: 1 1; to:"setasview.photocam"; } + } + } + + part { + name: "event"; + type: RECT; + repeat_events: 1; + mouse_events: 1; + scale:1; + description { + state: "default" 0.0; + color: 0 0 0 0; + visible: 1; + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + } + } + + part{ + name: "setasview.scissorbox"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + rel1 { relative: 0 0; to:setasview.contents; } + rel2 { relative: 1 1; to:setasview.contents; } + } + } + + part { name: "toolbar_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 0 NAVIFRAME_TOOLBAR_HEIGHT_INC; + max: 999999 NAVIFRAME_TOOLBAR_HEIGHT_INC; + fixed: 0 1; + align: 0.0 1.0; + visible: 0; + rel1 { to: "bg"; } + rel2 { to: "bg"; } + color: NAVIFRAME_TOOLBAR_BG_COLOR_INC; + } + } + + } + programs { + program { + name: "bg_clicked"; + signal: "mouse,clicked,1"; + source: "event"; + action: SIGNAL_EMIT "setasview,bg,clicked" "edc"; + } + } + + } +} + diff --git a/main/layout/ivug-slider.edc b/main/layout/ivug-slider.edc new file mode 100755 index 0000000..51c0aaa --- /dev/null +++ b/main/layout/ivug-slider.edc @@ -0,0 +1,196 @@ +/* + * Copyright 2012 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. + */ + +// slider layout + +collections { +group { + + name: "slider"; + + images { + image: "T01_btn_play.png" COMP; + image: "T01_btn_paused.png" COMP; + } + + parts { + + part { name: "background"; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 255; + //color: 255 255 255 255; + visible: 1; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } + + part { name: "slider.contents"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + + part { name: "slider.thumbnail"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } +#if 0 + part { name: "clipper"; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + color: 128 255 255 255; + visible: 1; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } +#endif + +#if 1 + part { name: "slider.icon"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 0; + fixed: 1 1; + max: 72 72; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } +#endif + + part { name: "slider.progress"; + type: SWALLOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + } //parts + + programs { + + program { + name: "show_thumbnail"; + signal: "elm,state,show_thumbnail"; + source: "slider"; + action: STATE_SET "show" 0.0; + target: "slider.thumbnail"; + } + + program { + name: "hide_thumbnail"; + signal: "elm,state,hide_thumbnail"; + source: "slider"; + action: STATE_SET "default" 0.0; + target: "slider.thumbnail"; + } + + program { + name: "show_progress"; + signal: "elm,state,show,progress"; + source: "slider"; + action: STATE_SET "show" 0.0; + target: "slider.progress"; + } + + program { + name: "hide_progress"; + signal: "elm,state,hide,progress"; + source: "slider"; + action: STATE_SET "default" 0.0; + target: "slider.progress"; + } +#if 1 + program { + name: "show_icon"; + signal: "elm,state,show_icon"; + source: "slider"; + action: STATE_SET "show" 0.0; + target: "slider.icon"; + } + + program { + name: "hide_icon"; + signal: "elm,state,hide_icon"; + source: "slider"; + action: STATE_SET "default" 0.0; + target: "slider.icon"; + } + + + program { + name: "icon_click"; + signal: "mouse,clicked,1"; + source: "slider.icon"; + action: SIGNAL_EMIT "slider,icon,click" ""; + } +#endif + }//programs + + } //group + +} diff --git a/main/layout/ivug-slideshow-view.edc b/main/layout/ivug-slideshow-view.edc new file mode 100755 index 0000000..26cb515 --- /dev/null +++ b/main/layout/ivug-slideshow-view.edc @@ -0,0 +1,34 @@ +/* + * Copyright 2012 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. + */ + +collections { + group { + name: "ssview"; + parts { + part { name: "background"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; // Invisible area + visible: 1; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } + } + } +} diff --git a/main/layout/ivug-theme.edc b/main/layout/ivug-theme.edc new file mode 100755 index 0000000..b22cc9b --- /dev/null +++ b/main/layout/ivug-theme.edc @@ -0,0 +1,225 @@ +/* + * Copyright 2012 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. + */ + +/* +* Refer to themes/groups/naviframe.edc +*/ + +#define WHITE_THEME + +#ifdef BLUE_THEME + +#define GENLIST_PART_FONT_INDEX_LIST_COLOR_INC 240 240 240 255 +#define GENLIST_DIALOGUE_GROUP_BG_COLOR_INC 15 15 15 255 + +#define GENLIST_PART_TEXT_PRESS_STYLE_COLOR_INC "#F9F9F9FF" +#define GENLIST_PART_MATCH_TAG_COLOR_INC "+ color=#3F8DAD" + +#define GENLIST_PART_FONT_LIST_MAIN_TEXT_UNREAD_STYLE_COLOR_INC "#F9F9F9FF" +#define GENLIST_PART_FONT_LIST_SUB_TEXT_STYLE_COLOR_INC "#646464FF" +#define GENLIST_PART_FONT_FLEXIBLE_TEXT_MAIN_STYLE_COLOR_INC "#F9F9F9FF" +#define GENLIST_PART_FONT_FLEXIBLE_TEXT_SUB_STYLE_COLOR_INC "#959595FF" +#define GENLIST_PART_FONT_MULTILINE_TEXT_STYLE_COLOR_INC "#959595FF" +#define GENLIST_PART_FONT_3LINE_MAIN_TEXT_READ_STYLE_COLOR_INC "#F9F9F9FF" +#define GENLIST_PART_FONT_3LINE_MAIN_TEXT_UNREAD_STYLE_COLOR_INC "#F9F9F9FF" +#define GENLIST_PART_FONT_3LINE_MAIN_TEXT_FOCUS_STYLE_COLOR_INC "#F9F9F9FF" +#define GENLIST_PART_FONT_3LINE_MAIN_TEXT_2_STYLE_COLOR_INC "#F9F9F9FF"//"#688998FF" +#define GENLIST_PART_FONT_3LINE_MAIN_TEXT_2_FOCUS_STYLE_COLOR_INC "#F9F9F9FF" +#define GENLIST_PART_FONT_HELP_TEXT_STYLE_COLOR_INC "#929292FF" + +#define GENLIST_PART_BG_COLOR_INC 0 0 0 0 + +#define GENLIST_PART_FONT_LIST_SUB_TEXT_COLOR_INC 249 249 249 255 +#define GENLIST_PART_TEXT_PRESS_COLOR_INC 249 249 249 255 + +#define GENLIST_PART_FONT_LIST_MAIN_TEXT_UNREAD_COLOR_INC 100 100 100 255 + +#define GENLIST_PART_DISCLIP_COLOR_INC 255 255 255 64 + +#define GENLIST_PART_LIST_BG_COLOR_INC 0 0 0 0 +#define GENLIST_PART_LIST_LINE_COLOR_INC 68 68 68 0 +#define GENLIST_PART_LIST_PRESS_COLOR_INC 0 140 210 255 + +#define LAYOUT_INDICATOR_HEIGHT_INC 60 +#define LAYOUT_INDICATOR_COLOR_INC 41 61 94 255 // Same as Naviframe + +#define NAVIFRAME_TEXT_PADDING_INC 144 +#define NAVIFRAME_TEXT_PADDING_MORE_BUTTON_INC 278 +#define NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 186 + +#define NAVIFRAME_TITLE_H_INC 100 +#define NAVIFRAME_OH_CLOSED_H_INC 8 +#define NAVIFRAME_OH_OPENED_H_INC 106 +#define NAVIFRAME_OH_CONTENT_H_INC 74 +#define NAVIFRAME_OH_PADDING_INC 16 +#define NAVIFRAME_OH_OPENED_DOUBLE_H_INC 196 +#define NAVIFRAME_OH_SHADOW_H_INC 0 +#define NAVIFRAME_INDICATOR_W_INC 128 +#define NAVIFRAME_PADDING_EXPANDED_INC 141 +#define NAVIFRAME_TITLE_FONT_SIZE_INC 36 +#define NAVIFRAME_ICON_SIZE_INC 32 32 +#define NAVIFRAME_ICON_PADDING_INC 16 0 +#define NAVIFRAME_OH_ARROW_SIZE_INC 19 12 +#define NAVIFRAME_TITLE_TEXT_COLOR_INC 235 236 237 255 +#define NAVIFRAME_TITLE_BG_COLOR_INC 41 61 94 255 +#define NAVIFRAME_TITLE_LEFT_SEPARATOR_COLOR_INC 3 3 3 255 +#define NAVIFRAME_TITLE_RIGHT_SEPARATOR_COLOR_INC 52 52 52 255 +#define NAVIFRAME_OH_BORDER_INC 0 0 4 0 +#define NAVIFRAME_PADDING_INC 16 0 + +#define NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 10 +#define NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 10 +#define NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC 124 80 +#define NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 144 +#define NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 52 +#define NAVIFRAME_CONTROLBAR_BG_COLOR_INC 25 35 51 255 +#define CONTROLBAR_LARGE_HEIGHT_INC 122 +#define CONTROLBAR_SMALL_HEIGHT_INC 114 +#define NAVIFRAME_PREV_BTN_W_INC 124 +#define NAVIFRAME_CONTROLBAR_PADDING_INC 5 +#define NAVIFRAME_SEGMENT_TITLE_H_INC 136 +#define NAVIFRAME_SEGMENT_TITLE_FUNC_BTN_SIZE_INC 118 62 + + +#define NAVIFRAME_TITLE_SEGMENT_FONT_SIZE_INC 28 +#define NAVIFRAME_TITLE_SEGMENT_TEXT_H_INC 50 +#define NAVIFRAME_TITLE_SEGMENT_H_INC 74 + +#elif WHITE_THEME + +// List bg color +#define GENLIST_LIST_BG_COLOR 248 246 239 102 +#define GENLIST_DIALOGUE_BG_COLOR 248 246 239 255 +#define GENLIST_LIST_PRESS_COLOR 87 135 194 255 +#define GENLIST_LIST_DIM_COLOR 219 217 212 255 +#define GENLIST_LIST_LINE1_COLOR 211 209 203 255 +#define GENLIST_LIST_LINE2_COLOR 255 255 255 255 +#define GENLIST_LIST_DIVIDER1_COLOR 185 184 178 255 +#define GENLIST_LIST_DIVIDER2_COLOR 255 255 255 255 +#define GENLIST_LIST_CENTERLINE1_COLOR 206 205 202 255 +#define GENLIST_SELECT_ALL_BG_COLOR 220 218 211 255 + +// Group Index +#define GENLIST_GROUPINDEX_LIST_SIZE 32 +#define GENLIST_GROUPINDEX_LIST_COLOR 59 115 182 255 +#define GENLIST_GROUPINDEX_LIST_FOCUS_COLOR 255 255 255 255 + +#define GENLIST_GROUPINDEX_LIST_BG_COLOR 248 246 239 255 +#define GENLIST_GROUPINDEX_LIST_PRESS_COLOR 132 162 198 255 +#define GENLIST_GROUPINDEX_LINE_COLOR 59 115 182 255 +#define GENLIST_GROUPINDEX_LINE_FOCUS_COLOR 255 255 255 255 + +// Genlist Text +#define GENLIST_LIST_MAIN_TEXT_SIZE 44 +#define GENLIST_LIST_MAIN_TEXT_UNREAD_COLOR 0 0 0 255 +#define GENLIST_LIST_MAIN_TEXT_UNREAD_COLOR_STYLE "#000000FF" +#define GENLIST_LIST_MAIN_TEXT_UNREAD_DIM_COLOR 0 0 0 102 +#define GENLIST_LIST_MAIN_TEXT_UNREAD_DIM_COLOR_STYLE "#00000066" +#define GENLIST_LIST_MAIN_TEXT_READ_COLOR 128 128 128 255 +#define GENLIST_LIST_MAIN_TEXT_READ_DIM_COLOR 128 128 128 204 +#define GENLIST_LIST_MAIN_TEXT_FOCUS_COLOR 255 255 255 255 +#define GENLIST_LIST_MAIN_TEXT_FOCUS_COLOR_STYLE "#FFFFFFFF" + +#define GENLIST_LIST_SUB_TEXT_SIZE 32 +#define GENLIST_LIST_SUB_TEXT_DEFAULT_COLOR 128 128 128 255 +#define GENLIST_LIST_SUB_TEXT_DEFAULT_COLOR_STYLE "#808080FF" +#define GENLIST_LIST_SUB_TEXT_DEFAULT_DIM_COLOR 128 128 128 204 +#define GENLIST_LIST_SUB_TEXT_DEFAULT_DIM_COLOR_STYLE "#808080CC" +#define GENLIST_LIST_SUB_TEXT_SETTINGS_COLOR 59 115 182 255 +#define GENLIST_LIST_SUB_TEXT_SETTINGS_COLOR_STYLE "#3B73B6FF" +#define GENLIST_LIST_SUB_TEXT_SETTINGS_DIM_COLOR 59 115 182 76 +#define GENLIST_LIST_SUB_TEXT_SETTINGS_DIM_COLOR_STYLE "#3B73B64C" +#define GENLIST_LIST_SUB_TEXT_FOCUS_COLOR 255 255 255 255 +#define GENLIST_LIST_SUB_TEXT_FOCUS_COLOR_STYLE "#FFFFFFFF" + +#define GENLIST_CONTENTS_TEXT_SIZE 28 +#define GENLIST_CONTENTS_TEXT_COLOR 128 128 128 255 +#define GENLIST_CONTENTS_TEXT_COLOR_STYLE "#808080FF" + +#define GENLIST_LIST_BUBBLE_TEXT_SIZE 32 +#define GENLIST_LIST_BUBBLE_TEXT_COLOR 249 249 249 255 + +// Dialogue group +#define GENLIST_DIALOGUE_GROUP_TITLE_SIZE 32 +#define GENLIST_DIALOGUE_GROUP_TITLE_COLOR 59 115 182 255 + +#define GENLIST_APPS_NAME_SIZE 30 +#define GENLIST_APPS_NAME_COLOR 128 128 128 255 +#define GENLIST_APPS_INC_SIZE 30 +#define GENLIST_APPS_INC_COLOR 0 0 0 255 +#define GENLIST_APPS_RATING_SIZE 24 +#define GENLIST_APPS_RATING_COLOR 128 128 128 255 +#define GENLIST_APPS_PRICE_SIZE 24 +#define GENLIST_APPS_PRICE_ORIGINAL_COLOR 59 115 182 255 +#define GENLIST_APPS_PRICE_SALE_COLOR 229 33 52 255 +#define GENLIST_APPS_PRICE_FREE_COLOR 59 115 182 255 + +#define DIALOGUE_PASSWORD_TITLE_SIZE 32 +#define DIALOGUE_PASSWORD_TITLE_COLOR 128 128 128 255 + +#define GENLIST_DIALOGUE_GROUP_HELP_TEXT_SIZE 32 +#define GENLIST_DIALOGUE_GROUP_HELP_TEXT_COLOR_STYLE "#808080FF" +#define GENLIST_PART_MATCH_TAG_COLOR "+ color=#3F8DAD" + + +#define LAYOUT_INDICATOR_HEIGHT_INC 60 +#define LAYOUT_INDICATOR_COLOR_INC 0 0 0 255 + +#define NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 144 //temp + +#define NAVIFRAME_TITLE_BG_COLOR_INC 248 246 239 0 //fixed by ivug +#define NAVIFRAME_TOOLBAR_BG_COLOR_INC 248 246 239 255 +#define NAVIFRAME_TITLE_TOP_PADDING_INC 0 32 +#define NAVIFRAME_TITLE_H_INC 111 +#define NAVIFRAME_TAB_TITLE_H_INC 165 +#define NAVIFRAME_TOOLBAR_HEIGHT_INC 98 +#define NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC 68 68 +#define NAVIFRAME_PREV_FUNC_BTN_SIZE_INC 60 60 +#define NAVIFRAME_TITLE_TAB_H_INC 68 +#define NAVIFRAME_TITLE_TAB_LARGE_H_INC 111 +#define NAVIFRAME_TITLE_TAB_FONT_SIZE_INC 44 +#define NAVIFRAME_TITLE_TAB_TEXT_H_INC 87 +#define NAVIFRAME_TITLE_FONT_SIZE_INC 56 +#define NAVIFRAME_TITLE_SMALL_FONT_SIZE_INC 44 +#define NAVIFRAME_ICON_SIZE_INC 38 38 +#define NAVIFRAME_PADDING_INC 16 0 +#define NAVIFRAME_PADDING2_INC 18 0 +#define NAVIFRAME_PADDING3_INC 8 0 +#define NAVIFRAME_BOTTOM_TEXT_PADDING_INC 0 11 +#define NAVIFRAME_BOTTOM_RIGHT_PADDING_INC 26 11 +#define NAVIFRAME_BOTTOM_PADDING_INC 0 10 +#define NAVIFRAME_TOOLBAR_BUTTON_BG_PADDING_INC 115 0 +#define NAVIFRAME_TOOLBAR_BUTTONS_PADDING_INC 15 +#define NAVIFRAME_ICON_PADDING_INC 70 0 +#define NAVIFRAME_TITLE_TEXT_COLOR_INC 255 255 255 255 // fixed by ivug +#define NAVIFRAME_SUBTITLE_TEXT_COLOR_INC 59 115 182 255 +#define NAVIFRAME_SUBTITLE_FONT_SIZE_INC 32 + +#define CONTROLBAR_LARGE_HEIGHT_INC 122 +#define CONTROLBAR_SMALL_HEIGHT_INC 114 + +#define GENGRID_FONT_STYLE_18_INC "26" +// #define GENGRID_PART_BG_COLOR_INC 0 0 0 0 +#define GENGRID_PART_BG_COLOR_INC 0 0 0 0 +// #define GENGRID_PART_ITEM_BG_COLOR_INC 239 239 239 255 +#define GENGRID_PART_ITEM_BG_COLOR_INC 0 0 0 255 +#define GENGRID_PART_REORDER_BG_COLOR_INC 0 0 0 128 +#define GENGRID_PART_TEXTBLOCK_STYLE_COLOR_INC "#F9F9F9" + +#endif + + + diff --git a/main/res/images/image_drm_no_rights.jpg b/main/res/images/image_drm_no_rights.jpg new file mode 100644 index 0000000000000000000000000000000000000000..453af002c9a340907e027d8cdd5c4357091ff9b2 GIT binary patch literal 9588 zcmeI0c|4SFzsK(}!!WkU&LF1jWbBz5l&un4kYXxiD>G!5Fo>pXBTC4YLMYiH+1IiQ zMP$&AtTUErtaGO4oY!++&vX7c=Q)3z^T%BG>wEumfA8z{{d}+Y^||iXP5(-t0uG!u zF*gA~AP{hkaRKyk;3UA##s+0$Wrsqc931R0E&*;XPEIaS{)4;%a4{)KxR`{5G(uHQ zT1Ht`LPB0gLHVeP#{Pcy3muzh9F55dfyWDhjbN9I8>*pU37!({C6@5P@_5p#I{5U1` z$y zSzF)Or2eLDZU4~)0>J++>+j0`Nf#eO7YhUehCu)50+--Z3Bt}%cM3}P%Em=8b$ zzqjRc!(q%|_JGL%lL00JOa_@E==us=ZuHgb;v3%kds9i-aqU8(U8?mqGV(CspO`SjZb*jtFC;jFLp z??S(i*mLB+5>Ax7z8dz18 zs3bfWVbO#5C=L%#e2gouw!PDa#qzHZFJD#6-b9dDaSf1$*~EDal|l#d`E9cn)g5bdF%gDmj9$oz0={LgnFS&*S@VJ9@_GvyU&NdsjueOUR?#mAMIPh|U} zq!YZ`{OqM-E5i7{KAaG@!c%#W13L0%y`sT|9XCM5o@)0UIo_5DB?UTJ1a57;in5SH zFV|n$d?Qbp!_U$zitK2kO$nMp?(&4Sfqdnhb4P3R4vRx1h=xt@s_;;#@%e$xGoe_M zcf%^?M;)4zj|7wMd)vB!pHSplEnzfM>-d(d!}q%U5JoPR<)4pO5ka36;1~BVCC~xR zYSP>u7kcZkHyvnS>^q^-#68;a13LcQSfc-QsyV_(-o;Pn9J@5xP~yhNg#81SP&&|G zm_rAqYNhs%go~5kYXcQlO9uul41`cR)0yIJW4=$e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@?iUbc*Ub7<%EpLg8%D zl%1y9I6{4)R(p!C0G41Tc}XSS{~b7K6WFm8rtr2i3Z1be$3!l9sa82~rm5yz!~*9( zlzow&^s(c?0eS+U4P|79H`kq0O*2U+WqG3b65Tf~&4y+MH9g_lQkypZl<}9Ld`1aB zZRLSn!oMCxzej|EGc!^HsEH0^U2)_-ktA^lUkXa%058c#J{v~W77BLB@b?!=w72ib zOl%T~6GkLQOK=e_XUxN1*)3GXxfgsJpS+^Zn)CjFvyrK+Vk4p47_cpSTRx;bQ~tIB zKRAL~y3gL~R)ffppK>OKiIo`(fTGp#bqd}ZJv#R_FCR{N_~B!eaasa`Xq$XRXr%x0 zxan`uM0%mJApOY)r^m43v!hI5V`Ye9cvLV63@J;TDJ}0LlO~mK1*qSh1bU zA%*dJjH2DY_^Ke+Wu3DB?5pgr2!We~n)ID6 ztFF%q$h^Z{iy(UGr{4i36G3_lo<;;f>BOSZz-pz4mUxe1`}8(8L&&61*DRA1D7B(Egh@jmqVv({s;rC^`av%@_)W<#28lH6+ND$1hA zLrgtcT8qE7n_1~K3i=ZO`CMi&d%$FX$pDi9CId_cm<%u(U^2jDfXM)pf&cFe(7*i~ D*}aoW literal 0 HcmV?d00001 diff --git a/main/src/control/ivug-buddy-ug.cpp b/main/src/control/ivug-buddy-ug.cpp new file mode 100755 index 0000000..dc16a62 --- /dev/null +++ b/main/src/control/ivug-buddy-ug.cpp @@ -0,0 +1,149 @@ +/* + * Copyright 2012 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 // ug_destroy_me, ug_send_result + +#include "ivug-buddy-view.h" +#include "ivug-buddy-ug.h" + +#include "ivug-debug.h" +#include "ivug-string.h" +#include "ivug-context.h" + +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_MED + +#undef LOG_CAT +#define LOG_CAT "IV-BUDDY-UG" + +static void +_send_result(ui_gadget_h ug, const char *key1, const char *val1, const char *key2, const char *val2) +{ + ivug_ret_if(!ug); + + service_h service; + service_create(&service); + + if(key1 && val1) + { + MSG_HIGH("Bundle 1 : [%s = %s]", key1, val1); + service_add_extra_data(service, key1, val1); + } + if(key2 && val2) + { + MSG_HIGH("Bundle 2 : [%s = %s]", key2, val2); + service_add_extra_data(service, key2, val2); + } + ug_send_result(gGetUGHandle(), service); + + service_destroy(service); +} + +IvugCropUG * ivug_crop_ug_create(Evas_Object *parent, int w, int h, bool bRatioFix, const char *filepath) +{ + IvugCropUG *crop_ug = (IvugCropUG *)calloc(1, sizeof(IvugCropUG)); + if(crop_ug == NULL) + { + MSG_ERROR("crop_ug calloc error"); + return NULL; + } + + IvugCropView *crop_view = NULL; + Evas_Object *layout = NULL; + + crop_view = ivug_crop_view_create(parent); + if(crop_view == NULL) + { + MSG_ERROR("ivug_crop_view_create error"); + free(crop_ug); + return NULL; + } + + ivug_crop_view_box_size_set(crop_view, w, h); + //ivug_crop_view_file_set(crop_view, filepath); + ivug_crop_view_box_ratio_fix(crop_view, bRatioFix); + + layout = ivug_crop_view_get_object(crop_view); + + evas_object_smart_callback_add(layout, "ok,clicked", _ivug_crop_view_ok_clicked_cb, crop_ug); + evas_object_smart_callback_add(layout, "cancel,clicked", _ivug_crop_view_cancel_clicked_cb, crop_ug); + evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, crop_ug); + evas_object_smart_callback_add(layout, "download,failed", _on_msg_load_failed, crop_ug); + + crop_ug->crop_view = crop_view; + crop_ug->layout = layout; + crop_ug->parent = parent; + crop_ug->filepath = strdup(filepath); + + crop_ug->navi_bar = elm_naviframe_add(parent); + + evas_object_name_set(crop_ug->navi_bar, "Crop ug naviframe"); + +// Layout life cycle is controlled by application explictily. + elm_naviframe_content_preserve_on_pop_set(crop_ug->navi_bar, EINA_TRUE); + + Evas_Object *back_btn = ivug_button_add(crop_ug->navi_bar, "naviframe/end_btn/default", + IDS_BACK, NULL, on_crop_view_btn_back_clicked, crop_ug); + + crop_ug->navi_it = elm_naviframe_item_push(crop_ug->navi_bar, IDS_LOADING, back_btn, NULL, crop_ug->layout, NULL); + elm_naviframe_item_title_visible_set(crop_ug->navi_it, EINA_FALSE); + + ivug_crop_view_create_menu(crop_view, crop_ug->navi_bar); + + return crop_ug; +} + +Evas_Object * ivug_crop_ug_get_layout(IvugCropUG * crop_ug) +{ + IV_ASSERT(crop_ug != NULL); + + return crop_ug->navi_bar; +} + +bool ivug_crop_ug_destroy(IvugCropUG * crop_ug) +{ + IV_ASSERT(crop_ug != NULL); + + if(crop_ug->filepath) + { + free(crop_ug->filepath); + crop_ug->filepath = NULL; + } + + if(crop_ug->crop_view) + { + ivug_crop_view_destroy(crop_ug->crop_view); + crop_ug->crop_view = NULL; + } + crop_ug->layout = NULL; + + free(crop_ug); + + return true; +} + +bool ivug_crop_ug_start(IvugCropUG * crop_ug) +{ + MSG_HIGH("ivug_crop_ug_start"); + IV_ASSERT(crop_ug != NULL); + + ivug_crop_view_file_set(crop_ug->crop_view, crop_ug->filepath); + + return true; +} + diff --git a/main/src/control/ivug-buddy-ug.h b/main/src/control/ivug-buddy-ug.h new file mode 100755 index 0000000..e823e95 --- /dev/null +++ b/main/src/control/ivug-buddy-ug.h @@ -0,0 +1,51 @@ +/* + * Copyright 2012 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 __IVUG_BUDDY_UG_H__ +#define __IVUG_BUDDY_UG_H__ + +#include "ivug-buddy-view.h" + +typedef struct { + Ivug_BuddyView *buddy_view; + + Evas_Object *layout; + Evas_Object *parent; + + Evas_Object *navi_bar; + Elm_Object_Item *navi_it; + + char *filepath; +} IvugBuddyUG; + +#ifdef __cplusplus +extern "C" { +#endif + +IvugBuddyUG * ivug_buddy_ug_create(Evas_Object *parent, const char *filepath); + +Evas_Object * ivug_buddy_ug_get_layout(IvugBuddyUG * buddy_ug); + +bool ivug_buddy_ug_destroy(IvugBuddyUG * buddy_ug); + +bool ivug_buddy_ug_start(IvugBuddyUG * buddy_ug); + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_BUDDY_UG_H__ + diff --git a/main/src/control/ivug-context.c b/main/src/control/ivug-context.c new file mode 100755 index 0000000..1d8eb86 --- /dev/null +++ b/main/src/control/ivug-context.c @@ -0,0 +1,398 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-util.h" + +#include "ivug-db.h" + +#include // ug_destroy_me +#include "ivug-context.h" + +#include "ivug-callback.h" + +#define MAX_INSTALNCE (5) + +typedef struct +{ + ui_gadget_h ug; // ug handle + + Evas_Object *parent_win; +// EFL theme + Elm_Theme *th; + +// Window Geometry + int win_w, win_h; //size + int rot; //window rotation value ( 0~360 ) + + callback_handle_t *callback_handle; + + bool bDesktopMode; + +} AppData; + +static Eina_List *ContextList = NULL; + +Elm_Theme* +gGetSystemTheme(void) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + return ugContext->th; +} + +void +gGetSystemDimension(int *w, int *h) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + IV_ASSERT(w != NULL); + IV_ASSERT(h != NULL); + + *w = ugContext->win_w; + *h = ugContext->win_h; +} + + +void +gSetRotationDegree(int degree) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + ugContext->rot = degree; +} + + + +int +gGetRotationDegree(void) +{ +#if 0 + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + return ugContext->rot; +#else + return elm_win_rotation_get(ug_get_window()); +#endif + +} + +int gGetScreenWidth() +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + return ugContext->win_w; + +} + +int gGetScreenHeight() +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + return ugContext->win_h; + +} + +ui_gadget_h +gGetUGHandle(void) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + MSG_IMAGEVIEW_HIGH("Get ug handle = 0x%08x", ugContext->ug); + + return ugContext->ug; +} + +Evas_Object * +gGetCurrentWindow(void) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + MSG_IMAGEVIEW_HIGH("Get ug handle = 0x%08x", ugContext->ug); + + return ugContext->parent_win; +} + +callback_handle_t * +gGetCallbackHandle(void) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + return ugContext->callback_handle; +} + +bool +gIsDesktopMode(void) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + return ugContext->bDesktopMode; +} + +void +gSetDesktopMode(bool isDesktop) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + IV_ASSERT(ugContext != NULL); + + ugContext->bDesktopMode = isDesktop; +} + +#define IVUG_NAVIFRAME_NAME EDJ_PATH"/ivug-naviframe.edj" +#define IVUG_TOOLBAR_NAME EDJ_PATH"/ivug-toolbar.edj" +#define IVUG_BUTTON_NAME EDJ_PATH"/ivug-button.edj" +#define IVUG_SELECTION_INFO_NAME EDJ_PATH"/ivug-selectioninfo.edj" +#define IVUG_GENLIST EDJ_PATH"/ivug-genlist.edj" +#define IVUG_GENGRID EDJ_PATH"/ivug-gengrid.edj" + +static char *edj[] = { + IVUG_NAVIFRAME_NAME, + IVUG_TOOLBAR_NAME, + IVUG_BUTTON_NAME, + IVUG_SELECTION_INFO_NAME, + IVUG_GENLIST, + IVUG_GENGRID, + NULL, +}; + +bool +ivug_context_init(ui_gadget_h ug) +{ + AppData *Context = (AppData *)calloc(1, sizeof(AppData)); + if(Context == NULL) + { + MSG_IVUG_ERROR("Cannot allock memory"); + return false; + } + + Context->ug = ug; + Context->parent_win = ug_get_window(); + + if ( Context->parent_win ) + { + Context->rot = elm_win_rotation_get(Context->parent_win); + } + else + { + MSG_IMAGEVIEW_WARN("Cannot get parent window. rotation angle set as 0"); + Context->rot = 0; + } + +//get window width, height + int w, h; + + evas_object_geometry_get(Context->parent_win, NULL, NULL, &w, &h); + MSG_IMAGEVIEW_HIGH("Screen WH(%dx%d)", w, h); +// ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h); + Context->win_w = w; + Context->win_h = h; + + + PERF_CHECK_BEGIN(LVL2, "theme add"); + + int i = 0; + + Context->th = elm_theme_new(); + + IV_ASSERT(Context->th != NULL); + + elm_theme_ref_set(Context->th, NULL); + + for ( i = 0; edj[i] != NULL; i++) + { + elm_theme_extension_add(Context->th, edj[i]); + } + + PERF_CHECK_END(LVL2, "theme add"); + + ContextList = eina_list_prepend(ContextList, Context); + + MSG_IVUG_HIGH("Append to list. Context=0x%08x", Context); + +#ifdef USE_NEW_DB_API + PERF_CHECK_BEGIN(LVL2, "media svc connect"); + + ivug_db_create(); + + PERF_CHECK_END(LVL2, "media svc connect"); +#endif + + Context->callback_handle = ivug_callback_register(); + if(Context->callback_handle == NULL) + { + MSG_IVUG_ERROR("ivug_callback_register error"); + goto ERROR; + } + + Context->bDesktopMode = false; + const char *profile = elm_config_profile_get(); + if (strcmp(profile,"desktop") == 0) + { + Context->bDesktopMode = true; + } + + bindtextdomain(IVUG_TEXT_DOMAIN, IVUG_LOCALEDIR); //bind text domain + return TRUE; + +/**** Error routine ****/ +ERROR: + + if(Context->callback_handle) + { + ivug_callback_unregister(Context->callback_handle); + } + + +#ifdef USE_NEW_DB_API + ivug_db_destroy(); +#endif + + Context = eina_list_data_get(ContextList); + ContextList = eina_list_remove_list(ContextList, ContextList); + + if(Context->th) + { + int i = 0; + for ( i = 0; edj[i] != NULL; i++) + { + elm_theme_extension_del(Context->th, edj[i]); + } + + elm_theme_free(Context->th); + } + + MSG_IVUG_HIGH("Remove from list. Context=0x%08x, ug=0x%08x", Context, Context->ug); + + free(Context); + + return false; +} + + +bool +ivug_context_deinit(ui_gadget_h ug) +{ + AppData *Context = NULL; + + if(ContextList == NULL) + { + MSG_IVUG_ERROR("ContextList is NULL"); + return false; + } + + Eina_List *l = NULL; + Eina_List *l_next = NULL; + + EINA_LIST_FOREACH_SAFE(ContextList, l, l_next, Context) + { + if(Context == NULL) + { + MSG_IVUG_ERROR("Context is NULL"); + return false; + } + if (Context->ug == ug) + { + ContextList = eina_list_remove_list(ContextList, l); + MSG_IVUG_HIGH("Find ug handle(0x%08x) from ContextList.", ug); + + break; + } + } + + if(Context->callback_handle) + { + MSG_IVUG_HIGH("Removing Callback"); + ivug_callback_unregister(Context->callback_handle); + Context->callback_handle = NULL; + } + +#ifdef USE_NEW_DB_API + PERF_CHECK_BEGIN(LVL2, "ivug_db_destroy"); + ivug_db_destroy(); + PERF_CHECK_END(LVL2, "ivug_db_destroy"); +#endif + + PERF_CHECK_BEGIN(LVL2, "elm_theme_free"); + if(Context->th) + { + int i = 0; + for ( i = 0; edj[i] != NULL; i++) + { + elm_theme_extension_del(Context->th, edj[i]); + } + elm_theme_free(Context->th); + } + PERF_CHECK_END(LVL2, "elm_theme_free"); + + MSG_IVUG_HIGH("Remove from list. Context=0x%08x, ug=0x%08x", Context, Context->ug); + + free(Context); + + return true; +} + + +void ivug_context_destroy_me(const char *file, int line) +{ + AppData *ugContext; + ugContext = eina_list_data_get(ContextList); + + char *fname = strrchr(file, '/'); + + if (NULL != ugContext) + { + MSG_IMAGEVIEW_HIGH("Request to destory ug. UGhandle(0x%08x) from L(%d) %s", ugContext->ug, line, fname); + ug_destroy_me(ugContext->ug); + } + else + { + MSG_IMAGEVIEW_WARN("ugContext is NULL. from L(%d) %s", line, fname); + } + +} + + diff --git a/main/src/control/ivug-context.h b/main/src/control/ivug-context.h new file mode 100755 index 0000000..d16b379 --- /dev/null +++ b/main/src/control/ivug-context.h @@ -0,0 +1,81 @@ +/* + * Copyright 2012 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 __IVUG_CONTEXT_H__ +#define __IVUG_CONTEXT_H__ + +#include "ivug-common.h" + + +#include "ivug-callback.h" + +#include + +/* + Managing context(instance) +*/ +#ifdef __cplusplus +extern "C" { +#endif + +bool +ivug_context_deinit(ui_gadget_h ug); + +bool +ivug_context_init(ui_gadget_h ug); + +void +ivug_context_destroy_me(const char *file, int line); + +#define DESTROY_ME() \ + do { \ + ivug_context_destroy_me(__FILE__, __LINE__); \ + } while(0) + +void +gSetRotationDegree(int degree); + +Elm_Theme* +gGetSystemTheme(void); + +int +gGetRotationDegree(void); + +ui_gadget_h +gGetUGHandle(void); + +Evas_Object * +gGetCurrentWindow(void); + + +callback_handle_t * +gGetCallbackHandle(void); + +bool +gIsDesktopMode(void); + +void +gSetDesktopMode(bool isDesktop); + +int gGetScreenWidth(); +int gGetScreenHeight(); + +#ifdef __cplusplus +} +#endif + +#endif //__IVUG_CONTEXT_H__ diff --git a/main/src/control/ivug-crop-ug.cpp b/main/src/control/ivug-crop-ug.cpp new file mode 100755 index 0000000..b6cf52e --- /dev/null +++ b/main/src/control/ivug-crop-ug.cpp @@ -0,0 +1,448 @@ +/* + * Copyright 2012 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 // ug_destroy_me, ug_send_result + +#include "ivug-crop-view.h" +#include "ivug-crop-ug.h" + +#include "ivug-debug.h" +#include "ivug-string.h" +#include "ivug-context.h" +#include "ivug-db.h" + +#include "ivug-setas-view.h" + +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_MED + +#undef LOG_CAT +#define LOG_CAT "IV-CROP-UG" + +static void +_send_result(ui_gadget_h ug, const char *key1, const char *val1, const char *key2, const char *val2) +{ + ivug_ret_if(!ug); + + service_h service; + service_create(&service); + + if(key1 && val1) + { + MSG_HIGH("Bundle 1 : [%s = %s]", key1, val1); + service_add_extra_data(service, key1, val1); + } + if(key2 && val2) + { + MSG_HIGH("Bundle 2 : [%s = %s]", key2, val2); + service_add_extra_data(service, key2, val2); + } + ug_send_result(gGetUGHandle(), service); + + service_destroy(service); +} + +static void _ivug_crop_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + char *path = (char *)event_info; + + evas_object_smart_callback_del(obj, "ok,clicked", _ivug_crop_view_ok_clicked_cb); + + media_handle m_handle = NULL; + + m_handle = ivug_db_insert_file_to_DB(path); + if(m_handle == NULL) + { + MSG_ERROR("ivug_db_insert_file_to_DB failed %s", path); + } + else + { + ivug_db_destroy_file_handle(m_handle); + } + + _send_result(gGetUGHandle(), "crop_image_path", path, "http://tizen.org/appcontrol/data/selected", path); + + MSG_HIGH("Start destroy ug"); + ug_destroy_me(gGetUGHandle()); +} + +static void _ivug_setas_crop_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + char *path = (char *)event_info; + + MSG_MAIN_HIGH("_ivug_setas_view_ok_clicked_cb path = %s", path); + + evas_object_smart_callback_del(obj, "ok,clicked", _ivug_setas_crop_view_ok_clicked_cb); + + // do not insert to db + + int setas_data = (int)evas_object_data_get(obj, "setas_type"); + ivug_set_screen_type type = (ivug_set_screen_type)setas_data; + + int setas_mode = (int)evas_object_data_get(obj, "setas_mode"); + ivug_setas_mode mode = (ivug_setas_mode)setas_mode; + + const char* homescreen_path = IVUG_HOME_SCREEN_PATH; + const char* lockscreen_path = IVUG_LOCK_SCREEN_PATH; + const char* appsvc_home_path = IVUG_APPSVC_HOME_SCREEN_PATH; + + if(mode == IVUG_SETAS_CROP) + { + ivug_copy_file(path, appsvc_home_path); + _send_result(gGetUGHandle(), "crop_image_path", appsvc_home_path, + "http://tizen.org/appcontrol/data/selected", appsvc_home_path); + } + else + { + if(type == IVUG_CTRLBAR_SET_SCREEN_HOME) + { + ivug_copy_file(path, homescreen_path); + ivug_config_set_homescreen_image(homescreen_path); + _send_result(gGetUGHandle(), "homescreen_path", homescreen_path, NULL, NULL); + } + else if(type == IVUG_CTRLBAR_SET_SCREEN_LOCK) + { + ivug_copy_file(path, lockscreen_path); + ivug_config_set_lockscreen_image(lockscreen_path); + _send_result(gGetUGHandle(), "lockscreen_path", lockscreen_path, NULL, NULL); + } + else if(type == IVUG_CTRLBAR_SET_SCREEN_BOTH) + { + ivug_copy_file(path, homescreen_path); + ivug_config_set_homescreen_image(homescreen_path); + ivug_copy_file(path, lockscreen_path); + ivug_config_set_lockscreen_image(lockscreen_path); + _send_result(gGetUGHandle(), "homescreen_path", homescreen_path, "lockscreen_path", lockscreen_path); + } + } + + MSG_HIGH("Start destroy ug"); + ug_destroy_me(gGetUGHandle()); +} + + +static void _ivug_crop_view_cancel_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + //ivug_crop_ug_destroy((IvugCropUG *)data); + + evas_object_smart_callback_del(obj, "cancel,clicked", _ivug_crop_view_cancel_clicked_cb); + + _send_result(gGetUGHandle(), "crop_image_path", NULL, "http://tizen.org/appcontrol/data/selected", NULL); + + MSG_HIGH("Start destroy ug"); + ug_destroy_me(gGetUGHandle()); +} + +static void _ivug_crop_view_destroyed_cb(void *data, Evas_Object *obj, void *event_info) +{ + IvugCropUG *crop_ug = (IvugCropUG *)data; + + ivug_crop_view_destroy(crop_ug->crop_view); + + crop_ug->crop_view = NULL; +} + +static void on_crop_view_btn_back_clicked(void *data, Evas_Object *obj, void *event_info) +{ + IvugCropUG *crop_ug = (IvugCropUG *)data; + + ivug_crop_view_destroy(crop_ug->crop_view); + + crop_ug->crop_view = NULL; + + _send_result(gGetUGHandle(), "crop_image_path", NULL, "http://tizen.org/appcontrol/data/selected", NULL); + + MSG_HIGH("Start destroy ug"); + ug_destroy_me(gGetUGHandle()); +} + +static void _ivug_crop_view_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + IvugCropUG *crop_ug = (IvugCropUG *)data; + bool bShowMenu = (bool)event_info; + + if(bShowMenu) + { + elm_object_item_signal_emit(crop_ug->navi_it, "elm,state,toolbar,open", ""); + } + else + { + elm_object_item_signal_emit(crop_ug->navi_it, "elm,state,toolbar,close", ""); + } +} + +static Evas_Object* +_show_exit_popup( Evas_Object *parent, const char *title, const char *desc, void *data) +{ + MSG_SETAS_HIGH( "title: %s, desc %s", title, desc); + + Evas_Object* style1_popup = elm_popup_add(parent); + evas_object_size_hint_weight_set(style1_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_popup_timeout_set(style1_popup, (double)2.0); + elm_object_text_set(style1_popup, desc); + elm_object_part_text_set(style1_popup, "title,text", title); + + evas_object_smart_callback_add(style1_popup, "timeout", _ivug_crop_view_cancel_clicked_cb, data); + + evas_object_show(style1_popup); + evas_object_layer_set(style1_popup, EVAS_LAYER_MAX); + + return style1_popup; +} + +static void +_on_msg_load_failed(void *data, Evas_Object *obj, void *event_info) +{ + int error = (int)event_info; + + const char *szMsg = NULL; + + switch(error) + { + case CROP_ERROR_TYPE_INVALID_FILE: + szMsg = IDS_INVALID_IMAGE_FILE; + break; + case CROP_ERROR_TYPE_PERMISSION_DENIED: + szMsg = IDS_PERMISSION_DENIED; + break; + case CROP_ERROR_TYPE_UNKNOWN_FORMAT: + szMsg = "Unknown format"; + break; + case CROP_ERROR_TYPE_GENERAL: + default: + szMsg = IDS_FAILED; + break; + } + + MSG_ERROR("Load failed : %s", szMsg); + + _show_exit_popup(obj, IDS_ERROR, szMsg, data); +} + +IvugCropUG * ivug_crop_ug_create(Evas_Object *parent, int w, int h, bool bRatioFix, const char *filepath) +{ + IvugCropUG *crop_ug = (IvugCropUG *)calloc(1, sizeof(IvugCropUG)); + if(crop_ug == NULL) + { + MSG_ERROR("crop_ug calloc error"); + return NULL; + } + + IvugCropView *crop_view = NULL; + Evas_Object *layout = NULL; + + crop_view = ivug_crop_view_create(parent); + if(crop_view == NULL) + { + MSG_ERROR("ivug_crop_view_create error"); + free(crop_ug); + return NULL; + } + + ivug_crop_view_box_size_set(crop_view, w, h); + //ivug_crop_view_file_set(crop_view, filepath); + ivug_crop_view_box_ratio_fix(crop_view, bRatioFix); + + layout = ivug_crop_view_get_object(crop_view); + + evas_object_smart_callback_add(layout, "ok,clicked", _ivug_crop_view_ok_clicked_cb, crop_ug); + evas_object_smart_callback_add(layout, "cancel,clicked", _ivug_crop_view_cancel_clicked_cb, crop_ug); + evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, crop_ug); + evas_object_smart_callback_add(layout, "download,failed", _on_msg_load_failed, crop_ug); + //evas_object_smart_callback_add(layout, "clicked", _ivug_crop_view_clicked_cb, crop_ug); + + crop_ug->crop_view = crop_view; + crop_ug->layout = layout; + crop_ug->parent = parent; + crop_ug->filepath = strdup(filepath); + + crop_ug->navi_bar = elm_naviframe_add(parent); + +#ifdef USE_CUSTOM_STYLE + elm_object_theme_set(crop_ug->navi_bar, gGetSystemTheme() ); +#endif + const char *profile = elm_config_profile_get(); + if (!strcmp(profile,"mobile")) + { + elm_object_style_set(crop_ug->navi_bar, "ivug-main/default"); + } + else if (!strcmp(profile,"desktop")) + { + elm_object_style_set(crop_ug->navi_bar, "ivug-main/noindicator"); + } + else + { + MSG_MAIN_ERROR("Unknown profile : %s", profile); + } + + evas_object_name_set(crop_ug->navi_bar, "Crop ug naviframe"); + +// Layout life cycle is controlled by application explictily. + elm_naviframe_content_preserve_on_pop_set(crop_ug->navi_bar, EINA_TRUE); + + Evas_Object *back_btn = ivug_button_add(crop_ug->navi_bar, "naviframe/end_btn/default", + IDS_BACK, NULL, on_crop_view_btn_back_clicked, crop_ug); + + crop_ug->navi_it = elm_naviframe_item_push(crop_ug->navi_bar, IDS_LOADING, back_btn, NULL, crop_ug->layout, NULL); + elm_naviframe_item_title_visible_set(crop_ug->navi_it, EINA_FALSE); + + ivug_crop_view_create_menu(crop_view, crop_ug->navi_bar); + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + return crop_ug; +} + +IvugCropUG * ivug_setas_crop_ug_create(Evas_Object *parent, const char *filepath, ivug_setas_mode mode, ivug_set_screen_type type) +{ + IvugCropUG *crop_ug = (IvugCropUG *)calloc(1, sizeof(IvugCropUG)); + if(crop_ug == NULL) + { + MSG_ERROR("crop_ug calloc error"); + return NULL; + } + + IvugCropView *crop_view = NULL; + Evas_Object *layout = NULL; + + crop_view = ivug_crop_view_create(parent); + if(crop_view == NULL) + { + MSG_ERROR("ivug_crop_view_create error"); + free(crop_ug); + return NULL; + } + + layout = ivug_crop_view_get_object(crop_view); + + evas_object_smart_callback_add(layout, "ok,clicked", _ivug_setas_crop_view_ok_clicked_cb, crop_ug); + evas_object_smart_callback_add(layout, "cancel,clicked", _ivug_crop_view_cancel_clicked_cb, crop_ug); + evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, crop_ug); + evas_object_smart_callback_add(layout, "download,failed", _on_msg_load_failed, crop_ug); + //evas_object_smart_callback_add(layout, "clicked", _ivug_crop_view_clicked_cb, crop_ug); + + evas_object_data_set(layout, "setas_type", (void *)type); + evas_object_data_set(layout, "setas_mode", (void *)mode); + + crop_ug->crop_view = crop_view; + crop_ug->layout = layout; + crop_ug->parent = parent; + crop_ug->filepath = strdup(filepath); + + crop_ug->navi_bar = elm_naviframe_add(parent); + +#ifdef USE_CUSTOM_STYLE + elm_object_theme_set(crop_ug->navi_bar, gGetSystemTheme() ); +#endif + const char *profile = elm_config_profile_get(); + if (!strcmp(profile,"mobile")) + { + elm_object_style_set(crop_ug->navi_bar, "ivug-main/default"); + } + else if (!strcmp(profile,"desktop")) + { + elm_object_style_set(crop_ug->navi_bar, "ivug-main/noindicator"); + } + else + { + MSG_MAIN_ERROR("Unknown profile : %s", profile); + } + + evas_object_name_set(crop_ug->navi_bar, "Crop ug naviframe"); + +// Layout life cycle is controlled by application explictily. + elm_naviframe_content_preserve_on_pop_set(crop_ug->navi_bar, EINA_TRUE); + + Evas_Object *back_btn = ivug_button_add(crop_ug->navi_bar, "naviframe/end_btn/default", + IDS_BACK, NULL, on_crop_view_btn_back_clicked, crop_ug); + + crop_ug->navi_it = elm_naviframe_item_push(crop_ug->navi_bar, IDS_LOADING, back_btn, NULL, crop_ug->layout, NULL); + elm_naviframe_item_title_visible_set(crop_ug->navi_it, EINA_FALSE); + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + int lcd_x = 0; + int lcd_y = 0; + int lcd_w = 0; + int lcd_h = 0; + int rot = 0; + + ivug_crop_view_create_menu(crop_view, crop_ug->navi_bar); + + ivug_crop_view_destination_set(crop_view, DATA_PATH, ".iv_setas.jpg"); + + evas_object_geometry_get((Evas_Object *)ug_get_window(), &lcd_x, &lcd_y, &lcd_w, &lcd_h); + rot = gGetRotationDegree(); + if(rot == 90 || rot == 270) + { + int temp = lcd_w; + lcd_w = lcd_h; + lcd_h = temp; + } + + ivug_crop_view_box_size_set(crop_view, lcd_w, lcd_h); + + ivug_crop_view_box_ratio_fix(crop_view, true); + + return crop_ug; +} + +Evas_Object * ivug_crop_ug_get_layout(IvugCropUG * crop_ug) +{ + IV_ASSERT(crop_ug != NULL); + + return crop_ug->navi_bar; +} + +bool ivug_crop_ug_destroy(IvugCropUG * crop_ug) +{ + IV_ASSERT(crop_ug != NULL); + + if(crop_ug->filepath) + { + free(crop_ug->filepath); + crop_ug->filepath = NULL; + } + + if(crop_ug->crop_view) + { + ivug_crop_view_destroy(crop_ug->crop_view); + crop_ug->crop_view = NULL; + } + crop_ug->layout = NULL; + + free(crop_ug); + + return true; +} + +bool ivug_crop_ug_start(IvugCropUG * crop_ug) +{ + MSG_HIGH("ivug_crop_ug_start"); + IV_ASSERT(crop_ug != NULL); + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + ivug_crop_view_file_set(crop_ug->crop_view, crop_ug->filepath); + + return true; +} + diff --git a/main/src/control/ivug-crop-ug.h b/main/src/control/ivug-crop-ug.h new file mode 100755 index 0000000..1cebee3 --- /dev/null +++ b/main/src/control/ivug-crop-ug.h @@ -0,0 +1,55 @@ +/* + * Copyright 2012 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 __IVUG_CROP_UG_H__ +#define __IVUG_CROP_UG_H__ + +#include "ivug-crop-view.h" +#include "ivug-setas-view.h" + +typedef struct { + IvugCropView *crop_view; + + Evas_Object *layout; + Evas_Object *parent; + + Evas_Object *navi_bar; + Elm_Object_Item *navi_it; + + char *filepath; +} IvugCropUG; + +#ifdef __cplusplus +extern "C" { +#endif + +IvugCropUG * ivug_crop_ug_create(Evas_Object *parent, int w, int h, bool bRatioFix, const char *filepath); + +IvugCropUG * ivug_setas_crop_ug_create(Evas_Object *parent, const char *filepath, + ivug_setas_mode mode, ivug_set_screen_type type); + +Evas_Object * ivug_crop_ug_get_layout(IvugCropUG * crop_ug); + +bool ivug_crop_ug_destroy(IvugCropUG * crop_ug); + +bool ivug_crop_ug_start(IvugCropUG * crop_ug); + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_CROP_UG_H__ + diff --git a/main/src/control/ivug-detail-info.c b/main/src/control/ivug-detail-info.c new file mode 100755 index 0000000..86076c1 --- /dev/null +++ b/main/src/control/ivug-detail-info.c @@ -0,0 +1,723 @@ +/* + * Copyright 2012 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 "ivug-detail-info.h" + +#include + +#include + +#include "ivug-details-view.h" +#include + +#include "ivug-drm-common.h" + +#include "ivug-file-info.h" + +#include "ivug-string.h" + +#include "ivug-util.h" + + +#define NOMAL_BUF 128 + +#define DETAILS_DIR_PATH_LEN_MAX 4096 + +enum IVUG_SIZE_TYPE +{ + SIZE_BYTE = 0, + SIZE_KB, + SIZE_MB, + SIZE_GB +}; + +/* + Should free returned value after use +*/ +static char * +_get_drm_availabile_string(drm_permission_type_e permissionType) +{ + switch(permissionType) + { + case DRM_PERMISSION_TYPE_ANY: + return strdup(IDS_ANY); + break; + + case DRM_PERMISSION_TYPE_PLAY: + return strdup(IDS_PLAY); + break; + + case DRM_PERMISSION_TYPE_COLLABORATIVE_PLAY: + return strdup(IDS_COLLABORATIVE_PLAY); + break; + + case DRM_PERMISSION_TYPE_DISPLAY: + return strdup(IDS_DISPLAY); + break; + + case DRM_PERMISSION_TYPE_EXECUTE: + return strdup(IDS_EXECUTE); + break; + + case DRM_PERMISSION_TYPE_PRINT: + return strdup(IDS_PRINT); + break; + + case DRM_PERMISSION_TYPE_EXPORT_COPY: + return strdup(IDS_COPY); + break; + + case DRM_PERMISSION_TYPE_EXPORT_MOVE: + return strdup(IDS_MOVE); + break; + + default: + return strdup(IDS_N_A); + break; + + } +} + +static char * +_get_filesize_string(long long size) +{ +#define FILE_SIZE_LEN_MAX 64 + + MSG_DETAIL_HIGH("Entered size = %lld", size); + + char *tmp = (char *)calloc(1, sizeof(char)*(FILE_SIZE_LEN_MAX+1)); + if (tmp == NULL) + { + return NULL; + } + + if(size > (1<<30)) // GB + { + snprintf(tmp,FILE_SIZE_LEN_MAX,"%.1f GB", (double)size/(1<<30)); + } + else if(size > (1<<20)) // MB + { + snprintf(tmp,FILE_SIZE_LEN_MAX,"%.1f MB", (double)size/(1<<20)); + } + else if(size > (1<<10)) // KB + { + snprintf(tmp,FILE_SIZE_LEN_MAX,"%.0f KB", (double)size/(1<<10)); + } + else // Byte + { + snprintf(tmp,FILE_SIZE_LEN_MAX,"%lld B", size); + } + + MSG_DETAIL_HIGH("Result Size = %s", tmp); + return tmp; +} + +void _add_string(char **org, char *add_string) +{ + char *string = strdup(add_string); + if(*org == NULL) + { + *org = string; + } + else + { + *org = g_strconcat(*org, "/", string, NULL); + free(string); + } +} + +bool +ivug_datail_get_exif_info(/*out*/char** name, /*out*/char **contents, + const char *path, Media_Type stype, exif_info_type_e type) +{ +#define UG_EXIF_ARR_LENGTH 255 + + bool bret = false; + char *string = NULL; + int status = 0; + + double latitude = 0.0; + double longtitude = 0.0; + + switch(type) + { + case EXIF_INFO_ORIENTATION: + status = ivug_fileinfo_get_orientation(path); + if(status < 0) + return false; + *name = strdup(IDS_ORIENTATION); + switch(status) + { + case 1: + case 2: + *contents = strdup("0"); + break; + case 3: + case 4: + *contents = strdup("180"); + break; + case 5: + case 8: + *contents = strdup("270"); + break; + case 6: + case 7: + *contents = strdup("90"); + break; + default: + *contents = strdup(IDS_UNKNOWN); + break; + } + break; + case EXIF_INFO_LATITUDE: + if(stype == SLIDE_TYPE_IMAGE) // this will be removed!!!! + { + bret = ivug_fileinfo_get_image_gps_info(path, &latitude, &longtitude); + } + else if(stype == SLIDE_TYPE_VIDEO) + { + bret = ivug_fileinfo_get_video_gps_info(path, &latitude, &longtitude); + } + if(bret == false) + { + MSG_DETAIL_WARN("get latitude error"); + return false; + } + string = calloc(1, sizeof(char)*UG_EXIF_ARR_LENGTH); + snprintf(string , UG_EXIF_ARR_LENGTH, "%.5f", latitude); + + *name = strdup(IDS_LATITUDE); + *contents = string; + break; + + case EXIF_INFO_LONGITTUDE: + if(stype == SLIDE_TYPE_IMAGE) // this will be removed!!!! + { + bret = ivug_fileinfo_get_image_gps_info(path, &latitude, &longtitude); + } + else if(stype == SLIDE_TYPE_VIDEO) + { + bret = ivug_fileinfo_get_video_gps_info(path, &latitude, &longtitude); + } + if(bret == false) + { + MSG_DETAIL_WARN("get longtitude error"); + return false; + } + string = calloc(1, sizeof(char)*UG_EXIF_ARR_LENGTH); + snprintf(string , UG_EXIF_ARR_LENGTH, "%.5f", longtitude); + + *name = strdup(IDS_LONGITUDE); + *contents = string; + break; + + case EXIF_INFO_MANUFACTURE: + string = ivug_fileinfo_get_maker_name(path); + if(string == NULL) + return false; + *name = strdup(IDS_MANUFACTURE); + *contents = string; + break; + case EXIF_INFO_MODEL: + string = ivug_fileinfo_get_model_name(path); + if(string == NULL) + return false; + *name = strdup(IDS_MODEL); + *contents = string; + break; + case EXIF_INFO_FLASH: + status = ivug_fileinfo_get_flash_status(path); + if(status < 0) + return false; + *name = strdup(IDS_FLASH); + if(status == 1) + { + *contents = strdup(IDS_FLASH); + } + else + { + *contents = strdup(IDS_NO_FLASH); + } + break; + case EXIF_INFO_FOCAL_LENGTH: + string = ivug_fileinfo_get_focal_length(path); + if(string == NULL) + return false; + *name = strdup(IDS_FOCAL_LENGTH); + *contents = string; + break; + case EXIF_INFO_WHITE_BALANCE: + status = ivug_fileinfo_get_white_balance(path); + if(status < 0) + return false; + *name = strdup(IDS_WHITE_BALANCE); + if(status == 0) + { + *contents = strdup(IDS_AUTO); + } + else + { + *contents = strdup(IDS_MANUAL); + } + break; + case EXIF_INFO_APERTURE: + string = ivug_fileinfo_get_aperture(path); + if(string == NULL) + return false; + *name = strdup(IDS_APERTURE); + *contents = string; + break; + case EXIF_INFO_EXPOSURE_TIME: + string = ivug_fileinfo_get_exposure_time(path); + if(string == NULL) + return false; + *name = strdup(IDS_EXPOSURE_TIME); + *contents = string; + break; + case EXIF_INFO_ISO: + string = ivug_fileinfo_get_iso(path); + if(string == NULL) + return false; + *name = strdup(IDS_ISO); + *contents = string; + break; + default: + break; + } + + return true; +} + + +bool +ivug_datail_get_file_info(/*out*/char** name, /*out*/char **contents, + const char *path, Media_Type stype, file_info_type_e type) +{ + struct stat statbuf; + int width = 0; + int height = 0; + + switch(type) + { + case FILE_INFO_NAME: + *name = strdup(IDS_NAME); + *contents = ecore_file_strip_ext(ecore_file_file_get(path)); + break; + case FILE_INFO_FORMAT: + *name = strdup(IDS_FORMAT); + *contents = ivug_fileinfo_get_file_extension(path); + if(*contents == NULL) + { + *contents = strdup(IDS_UNKNOWN); + } + break; + case FILE_INFO_DATE_CREATED: + *name = strdup(IDS_DATE_CREATED); + if(stat(path, &statbuf) == -1) + { + MSG_DETAIL_ERROR("Cannot get stat()"); + *contents = strdup(IDS_UNKNOWN); + break; + } + *contents = ivug_get_icu_date(statbuf.st_mtime); + if(*contents == NULL) + { + *contents = strdup(IDS_UNKNOWN); + } + break; + case FILE_INFO_SIZE: + *name = strdup(IDS_SIZE); + if(stat(path, &statbuf) == -1) + { + MSG_DETAIL_ERROR("Cannot get stat()"); + *contents = strdup(IDS_UNKNOWN); + break; + } + *contents = _get_filesize_string(statbuf.st_size); + if(*contents == NULL) + { + *contents = strdup(IDS_UNKNOWN); + } + break; + case FILE_INFO_RESOLUTION: + *name = strdup(IDS_RESOLUTION); + *contents = (char *)calloc(1, sizeof(char)*NOMAL_BUF+1); + if(stype == SLIDE_TYPE_IMAGE) + { + if(ivug_fileinfo_get_image_resolution(path, &width, &height) == false) + { + snprintf(*contents, NOMAL_BUF, "%s", IDS_N_A); + } + else + { + snprintf(*contents, NOMAL_BUF,"%dX%d", width, height); + } + } + else if(stype == SLIDE_TYPE_VIDEO) + { + if ( ivug_fileinfo_get_video_resolution(path, &width, &height) == false) + { + snprintf(*contents, NOMAL_BUF, "%s", IDS_N_A); + } + else + { + snprintf(*contents, NOMAL_BUF,"%dX%d", width, height); + } + } + else + { + snprintf(*contents, NOMAL_BUF, "%s", IDS_N_A); + } + + break; + case FILE_INFO_FILE_LOCATION: + *name = strdup(IDS_LOCATION); + *contents = strdup(path); + break; + default: + break; + } + + return true; +} + + +bool +ivug_datail_get_drm_info(/*out*/char** name, /*out*/char **contents, + const char *path, Media_Type stype, drm_info_type_e type) +{ +#define VALIDITY_SIZE 80 + +#define MOUNTH_COUNT 12 //used for drm file info, +#define DAY_COUNT 30 +#define HOUR_COUNT 24 +#define SECOND_COUNT 3600.0 + + bool bret = false; + + if(ivug_drm_has_valid_ro(path) == false) + { + MSG_DETAIL_WARN("%s is not valid right object", path); + return false; + } + + char *string = NULL; + drm_constraint_info_s constraint_info; + drm_file_info_s info; + int ret = -1; + int i = -1; + char validity[VALIDITY_SIZE] = ""; + + switch(type) + { + case DRM_INFO_VENDOR: + *name = strdup(IDS_VENDOR); + *contents = ivug_drm_get_drm_vendor_info(path); + if(*contents == NULL) + { + *contents = strdup(IDS_UNKNOWN); + } + break; + case DRM_INFO_FORWARDING: + *name = strdup(IDS_FORWARDING); + bret = ivug_drm_get_forwarding_info(path); + if(bret == true) + { + *contents = strdup(IDS_POSSIBLE); + } + else + { + *contents = strdup(IDS_IMPOSSIBLE); + } + break; + case DRM_INFO_AVAILABLE_USES: + { + *name = strdup(IDS_AVAILABLE_USES); + + memset(&info, 0x0, sizeof(drm_file_info_s)); + ret = drm_get_file_info(path, &info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_file_info Failed!!, ret=0x%x", ret); + *contents = strdup(IDS_UNKNOWN); + return true; + } + if (info.oma_info.method == DRM_METHOD_TYPE_FORWARD_LOCK) + { + MSG_IVUG_HIGH("DRM_METHOD_TYPE_FORWARD_LOCK"); + *contents = strdup(IDS_ANY); + return true; + } + + for(i=DRM_PERMISSION_TYPE_NONE; i<=DRM_PERMISSION_TYPE_EXPORT_MOVE; i++) + { + memset(&constraint_info, 0x0, sizeof(drm_constraint_info_s)); + + ret = drm_get_constraint_info(path, i, &constraint_info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_constraint_info Failed!!, perm_type=%d ret=0x%x", i, ret); + continue; + } + + string = _get_drm_availabile_string(i); + _add_string(contents, string); + free(string); + } + if(*contents == NULL) + { + *contents = strdup(IDS_UNKNOWN); + } + } + break; + case DRM_INFO_TYPE: + { + *name = strdup(IDS_TYPE); + + memset(&info, 0x0, sizeof(drm_file_info_s)); + ret = drm_get_file_info(path, &info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_file_info Failed!!, ret=0x%x", ret); + *contents = strdup(IDS_UNKNOWN); + return true; + } + if (info.oma_info.method == DRM_METHOD_TYPE_FORWARD_LOCK) + { + MSG_IVUG_HIGH("DRM_METHOD_TYPE_FORWARD_LOCK"); + *contents = strdup(IDS_UNLIMITED); + return true; + } + + for(i=DRM_PERMISSION_TYPE_NONE; i<=DRM_PERMISSION_TYPE_EXPORT_MOVE; i++) + { + memset(&constraint_info, 0x0, sizeof(drm_constraint_info_s)); + + ret = drm_get_constraint_info(path, i, &constraint_info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_constraint_info Failed!!, perm_type=%d ret=0x%x", i, ret); + continue; + } + if(constraint_info.const_type.is_unlimited) + _add_string(contents, IDS_UNLIMITED); + + if(constraint_info.const_type.is_accumulated) + _add_string(contents, IDS_ACCUMULATED_TIME); + + if(constraint_info.const_type.is_count) + _add_string(contents, IDS_COUNT); + + if(constraint_info.const_type.is_datetime) + _add_string(contents, IDS_TIME); + + if(constraint_info.const_type.is_individual) + _add_string(contents, IDS_INDIVIDUAL); + + if(constraint_info.const_type.is_interval) + _add_string(contents, IDS_INTERVAL); + + if(constraint_info.const_type.is_system) + _add_string(contents, IDS_SYSTEM); + + if(constraint_info.const_type.is_timedcount) + _add_string(contents, IDS_TIMED_COUNT); + } + if(*contents == NULL) + { + *contents = strdup(IDS_UNKNOWN); + } + } + break; + case DRM_INFO_VALIDITY: + *name = strdup(IDS_VALIDITY); + + memset(&info, 0x0, sizeof(drm_file_info_s)); + ret = drm_get_file_info(path, &info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_file_info Failed!!, ret=0x%x", ret); + *contents = strdup(IDS_UNKNOWN); + return true; + } + if (info.oma_info.method == DRM_METHOD_TYPE_FORWARD_LOCK) + { + MSG_IVUG_HIGH("DRM_METHOD_TYPE_FORWARD_LOCK"); + *contents = strdup(IDS_UNLIMITED); + return true; + } + + for(i=DRM_PERMISSION_TYPE_NONE; i<=DRM_PERMISSION_TYPE_EXPORT_MOVE; i++) + { + memset(&constraint_info, 0x0, sizeof(drm_constraint_info_s)); + + ret = drm_get_constraint_info(path, i, &constraint_info); + if(ret != DRM_RETURN_SUCCESS) + { + MSG_IVUG_ERROR("drm_get_constraint_info Failed!!, perm_type=%d ret=0x%x", i, ret); + continue; + } + + if(constraint_info.const_type.is_unlimited) + { + MSG_IVUG_HIGH("Unlimited:for permission=%d", i); + _add_string(contents, IDS_UNLIMITED); + } + + if(constraint_info.const_type.is_accumulated) + { + MSG_IVUG_HIGH("Accumulated Constraint is present"); + MSG_IVUG_HIGH("accumulated_original_seconds=%d", + constraint_info.accumulated_original_seconds); + MSG_IVUG_HIGH("accumulated_remaining_seconds=%d", + constraint_info.accumulated_remaining_seconds); + + snprintf(validity, sizeof(validity),"Total %.1f hours", + constraint_info.accumulated_remaining_seconds/SECOND_COUNT); + _add_string(contents, validity); + } + + if(constraint_info.const_type.is_count) + { + MSG_IVUG_HIGH("Count Constraint is present"); + MSG_IVUG_HIGH("original_count=%d", + constraint_info.original_count); + MSG_IVUG_HIGH("remaining_count=%d", + constraint_info.remaining_count); + + snprintf(validity, sizeof(validity),"%d left", constraint_info.remaining_count); + _add_string(contents, validity); + } + + if(constraint_info.const_type.is_datetime) + { + MSG_IVUG_HIGH("DATETIME Constraint is present"); + MSG_IVUG_HIGH("start_time:" + "Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d", + constraint_info.start_time.tm_year, + constraint_info.start_time.tm_mon, + constraint_info.start_time.tm_mday, + constraint_info.start_time.tm_hour, + constraint_info.start_time.tm_min, + constraint_info.start_time.tm_sec); + + MSG_IVUG_HIGH("end_time:" + "Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d", + constraint_info.end_time.tm_year, + constraint_info.end_time.tm_mon, + constraint_info.end_time.tm_mday, + constraint_info.end_time.tm_hour, + constraint_info.end_time.tm_min, + constraint_info.end_time.tm_sec); + + snprintf(validity, sizeof(validity),"%d.%d.%d %d:%d ~ %d.%d.%d %d:%d:%d", + constraint_info.start_time.tm_mday, + constraint_info.start_time.tm_mon, + constraint_info.start_time.tm_year, + constraint_info.start_time.tm_hour, + constraint_info.start_time.tm_sec, + constraint_info.end_time.tm_mday, + constraint_info.end_time.tm_mon, + constraint_info.end_time.tm_year, + constraint_info.end_time.tm_hour, + constraint_info.end_time.tm_min, + constraint_info.end_time.tm_sec + ); + _add_string(contents, validity); + } + + if(constraint_info.const_type.is_individual) + { + MSG_IVUG_HIGH("INDIVIDUAL Constraint is present"); + MSG_IVUG_HIGH("individual_identity_type=%d " + "individual_id=%s", + constraint_info.individual_identity_type, + constraint_info.individual_id); + + _add_string(contents, IDS_INDIVIDUAL); + } + + if(constraint_info.const_type.is_interval) + { + MSG_IVUG_HIGH("INTERVAL Constraint is present"); + MSG_IVUG_HIGH("interval_time:" + "Year=%d,Month=%d,Day=%d,Hour=%d, minute=%d, Second=%d", + constraint_info.interval_time.tm_year, + constraint_info.interval_time.tm_mon, + constraint_info.interval_time.tm_mday, + constraint_info.interval_time.tm_hour, + constraint_info.interval_time.tm_min, + constraint_info.interval_time.tm_sec); + + if(constraint_info.interval_time.tm_year == 0 + && constraint_info.interval_time.tm_mon == 0 + && constraint_info.interval_time.tm_mday == 0 + && constraint_info.interval_time.tm_hour == 0) + { + snprintf(validity, sizeof(validity),"Total %d miniutes", constraint_info.interval_time.tm_min); + } + else + { + snprintf(validity, sizeof(validity),"Total %d hours", + ((constraint_info.interval_time.tm_year*MOUNTH_COUNT + + constraint_info.interval_time.tm_mon)*DAY_COUNT + + constraint_info.interval_time.tm_mday)*HOUR_COUNT + + constraint_info.interval_time.tm_hour + ); + } + _add_string(contents, validity); + } + + if(constraint_info.const_type.is_system){ + MSG_IVUG_HIGH("SYSTEM Constraint is present"); + MSG_IVUG_HIGH("system_identity_type=%d " + "system_id=%s", + constraint_info.system_identity_type, + constraint_info.system_id); + + _add_string(contents, IDS_SYSTEM); + } + + if(constraint_info.const_type.is_timedcount){ + MSG_IVUG_HIGH("TIMED-COUNT Constraint is present"); + MSG_IVUG_HIGH("timed_original_count=%d", + constraint_info.timed_original_count); + + MSG_IVUG_HIGH("timed_remaining_count=%d", + constraint_info.timed_remaining_count); + + MSG_IVUG_HIGH("timed_count_timer=%d", + constraint_info.timed_count_timer); + + snprintf(validity, sizeof(validity),"%d (%d sec)", + constraint_info.timed_remaining_count, + constraint_info.timed_count_timer + ); + _add_string(contents, validity); + } + } + if(*contents == NULL) + { + *contents = strdup(IDS_UNKNOWN); + } + break; + default: + break; + } + + return true; +} + diff --git a/main/src/control/ivug-detail-info.h b/main/src/control/ivug-detail-info.h new file mode 100755 index 0000000..021f646 --- /dev/null +++ b/main/src/control/ivug-detail-info.h @@ -0,0 +1,93 @@ +/* + * Copyright 2012 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 __IVUG_DETAIL_COMMON_H__ +#define __IVUG_DETAIL_COMMON_H__ + +#include + +#include "ivug-common.h" +#include "ivug-drm-common.h" +#include "ivug-media.h" + +typedef enum { + IVUG_DETAIL_ERROR_TYPE = -1, + IVUG_DETAIL_IMAGE_TYPE, + IVUG_DETAIL_VIDEO_TYPE +} ivug_detail_file_t; + +typedef enum +{ + FILE_INFO_NAME, + FILE_INFO_FORMAT, + FILE_INFO_DATE_CREATED, + FILE_INFO_SIZE, + FILE_INFO_RESOLUTION, + FILE_INFO_FILE_LOCATION, + FILE_INFO_MAX +}file_info_type_e; + +typedef enum +{ + EXIF_INFO_ORIENTATION, + EXIF_INFO_LATITUDE, + EXIF_INFO_LONGITTUDE, + EXIF_INFO_MANUFACTURE, + EXIF_INFO_MODEL, + EXIF_INFO_FLASH, + EXIF_INFO_FOCAL_LENGTH, + EXIF_INFO_WHITE_BALANCE, + EXIF_INFO_APERTURE, + EXIF_INFO_EXPOSURE_TIME, + EXIF_INFO_ISO, + EXIF_INFO_MAX +}exif_info_type_e; + +typedef enum +{ + DRM_INFO_VENDOR, + DRM_INFO_FORWARDING, + DRM_INFO_AVAILABLE_USES, + DRM_INFO_TYPE, + DRM_INFO_VALIDITY, + DRM_INFO_MAX +}drm_info_type_e; + +#ifdef __cplusplus +extern "C" { +#endif + +bool +ivug_datail_get_exif_info(/*out*/char** name_, /*out*/char **contents_, + const char *path, Media_Type stype, exif_info_type_e type); + +bool +ivug_datail_get_file_info(/*out*/char** name, /*out*/char **contents, + const char *path, Media_Type stype, file_info_type_e type); + +bool +ivug_datail_get_drm_info(/*out*/char** name, /*out*/char **contents, + const char *path, Media_Type stype, drm_info_type_e type); + + + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_DETAIL_COMMON_H__ + diff --git a/main/src/control/ivug-parameter.c b/main/src/control/ivug-parameter.c new file mode 100755 index 0000000..aa6bf24 --- /dev/null +++ b/main/src/control/ivug-parameter.c @@ -0,0 +1,819 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-debug.h" +#include "ivug-parameter.h" +#include "ivug-file-info.h" + +#include "ivug-db.h" +#include "ivug-util.h" + +#include "ivug-filter.h" + +//bundle key +#define IVUG_BUNDLE_KEY_VIEW_MODE "View Mode" +#define IVUG_BUNDLE_KEY_PATH "Path" +#define IVUG_BUNDLE_KEY_THUMBNAIL_PATH "Thumb Path" +#define IVUG_BUNDLE_KEY_ALBUM_IDX "Album index" +#define IVUG_BUNDLE_KEY_VIEW_BY "View By" +#define IVUG_BUNDLE_KEY_INDEX "Index" +#define IVUG_BUNDLE_KEY_SORT_BY "Sort By" +#define IVUG_BUNDLE_KEY_FOOTSTEPS "Footsteps" + +#define IVUG_BUNDLE_KEY_MAX_LONGITUDE "LON_MAX" +#define IVUG_BUNDLE_KEY_MIN_LONGITUDE "LON_MIN" +#define IVUG_BUNDLE_KEY_MAX_LATITUDE "LAT_MAX" +#define IVUG_BUNDLE_KEY_MIN_LATITUDE "LAT_MIN" + +#define IVUG_BUNDLE_KEY_SETAS_TYPE "Setas type" +#define IVUG_BUNDLE_KEY_TAG_NAME "Tag name" + +#define IVUG_BUNDLE_KEY_RESOLUTION "Resolution" +#define IVUG_BUNDLE_KEY_FIXED_RATIO "Fixed ratio" + +#define IVUG_BUNDLE_KEY_CROP_MODE "http://tizen.org/appcontrol/data/image/crop_mode" +#define IVUG_BUNDLE_VALUE_CROP_MODE_AUTO "auto" +#define IVUG_BUNDLE_VALUE_CROP_MODE_FIT_TO_SCREEN "fit_to_screen" + +#define IVUG_BUNDLE_KEY_MEDIA_TYPE "Media type" + +#define IVUG_BUNDLE_KEY_STANDALONE "Standalone" + +#define IVUG_BUNDLE_KEY_CONTACT_ID "Contact id" +#define IVUG_BUNDLE_KEY_CLUSTER_ID "Cluster id" +#define IVUG_BUNDLE_KEY_GROUP_ID "Group id" + +#define IVUG_BUNDLE_KEY_SELECTED_INDEX "Selected index" + +//default values +#define IVUG_DEFAULT_MODE IVUG_MODE_SINGLE +#define IVUG_DEFAULT_INDEX (1) // First item + +#define IVUG_FILE_PREFIX "file://" + +static inline +void _ivug_free(char **val) +{ + free(*val); + *val = NULL; +} + +static ivug_mode +_get_view_mode(ivug_parameter* data, const char* val) +{ + IV_ASSERT(val != NULL); + +#define IVUG_BUNDLE_VALUE_VIEW_MODE_ALBUM "ALBUM" +#define IVUG_BUNDLE_VALUE_VIEW_MODE_NORMAL "NORMAL" +#define IVUG_BUNDLE_VALUE_VIEW_MODE_SINGLE "SINGLE" +#define IVUG_BUNDLE_VALUE_VIEW_MODE_GALLERY "GALLERY" +#define IVUG_BUNDLE_VALUE_VIEW_MODE_CAMERA "CAMERA" +#define IVUG_BUNDLE_VALUE_VIEW_MODE_DISPLAY "DISPLAY" +#define IVUG_BUNDLE_VALUE_VIEW_MODE_SETAS "SETAS" +#define IVUG_BUNDLE_VALUE_VIEW_MODE_SLIDESHOW "SLIDESHOW" + + int len = strlen(val); + + if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_NORMAL, len) == 0 + || strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_GALLERY, len) == 0 ) + { + return IVUG_MODE_NORMAL; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_ALBUM, len) == 0) + { + // Probably, UnUsed. + MSG_IVUG_ERROR("ALBUM is deprecated!!!! plz check"); + printf("bundle key ALBUM is deprecated!!!! plz check\n"); + return IVUG_MODE_NORMAL; + } + else if ( strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_CAMERA, len) == 0) + { + data->start_index = 1; //apply window loading + data->view_by = IVUG_VIEW_BY_FOLDER; // In camera case, All images should be shown in camera folder. + return IVUG_MODE_CAMERA; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_SINGLE, len) == 0) + { + if(data->view_by != IVUG_VIEW_BY_FOLDER) + data->view_by = IVUG_VIEW_BY_FILE; + return IVUG_MODE_SINGLE; + } + else if ( strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_DISPLAY, len) == 0) + { + data->view_by = IVUG_VIEW_BY_FILE; + return IVUG_MODE_DISPLAY; + } + else if(strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_SETAS, len) == 0) + { + data->view_by = IVUG_VIEW_BY_FILE; + return IVUG_MODE_SETAS; + } + else if(strncmp(val, IVUG_BUNDLE_VALUE_VIEW_MODE_SLIDESHOW, len) == 0) + { + if(data->view_by == IVUG_VIEW_BY_INVAILD) + { + data->view_by = IVUG_VIEW_BY_FOLDER; + } + return IVUG_MODE_SLIDESHOW; + } + + MSG_IVUG_ERROR("Invalid mode : %s", val); + return IVUG_MODE_INVAILD; +} + + +static ivug_view_by +_get_view_by(const char* val) +{ + //bundle value +#define IVUG_BUNDLE_VALUE_VIEW_BY_ALL "All" +#define IVUG_BUNDLE_VALUE_VIEW_BY_FAVORITES "Favorites" +#define IVUG_BUNDLE_VALUE_VIEW_BY_TAGS "Tags" +#define IVUG_BUNDLE_VALUE_VIEW_BY_FLODER "By Folder" +#define IVUG_BUNDLE_VALUE_VIEW_BY_PLACES "Places" + + IV_ASSERT(val != NULL); + + int len = strlen(val); + + if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_FLODER, len) == 0 ) + { + return IVUG_VIEW_BY_FOLDER; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_ALL, len) == 0 ) + { + return IVUG_VIEW_BY_ALL; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_FAVORITES, len) == 0) + { + return IVUG_VIEW_BY_FAVORITES; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_TAGS, len) == 0) + { + return IVUG_VIEW_BY_TAG; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_VIEW_BY_PLACES, len) == 0) + { + return IVUG_VIEW_BY_PLACES; + } + + MSG_IVUG_ERROR("Invalid view by : %s", val); + + return IVUG_VIEW_BY_FILE; + +} + + +static ivug_setas_type +_get_setas_type(const char* val) +{ + IV_ASSERT(val != NULL); + +#define IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER "Wallpaper" +#define IVUG_BUNDLE_VALUE_SETAS_UG_LOCKSCREEN "Lockscreen" +#define IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_N_LOCKSCREEN "Wallpaper & Lockscreen" +#define IVUG_BUNDLE_VALUE_SETAS_UG_CALLERID "CallerID" +#define IVUG_BUNDLE_VALUE_SETAS_UG_VIDEO_CALLEID "VideoCallID" +#define IVUG_BUNDLE_VALUE_SETAS_UG_CROP "Crop" +#define IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_CROP "Wallpaper Crop" + + int len = strlen(val); + + if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER, len) == 0 ) + { + return IVUG_SET_AS_UG_TYPE_WALLPAPER; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_CROP, len) == 0 ) + { + return IVUG_SET_AS_UG_TYPE_WALLPAPER_CROP; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_LOCKSCREEN, len) == 0 ) + { + return IVUG_SET_AS_UG_TYPE_LOCKSCREEN; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_WALLPAPER_N_LOCKSCREEN, len) == 0 ) + { + return IVUG_SET_AS_UG_TYPE_WALLPAPER_N_LOCKSCREEN; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_CALLERID, len) == 0) + { + return IVUG_SET_AS_UG_TYPE_CALLER_ID; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_VIDEO_CALLEID, len) == 0) + { + return IVUG_SET_AS_UG_TYPE_VIDEO_CALL_ID; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_SETAS_UG_CROP, len) == 0) + { + return IVUG_SET_AS_UG_TYPE_CROP; + } + + MSG_IVUG_ERROR("Invalid setas ug type : %s", val); + return IVUG_SET_AS_UG_TYPE_INVALID; +} + +static ivug_media_type +_get_media_type(const char* val) +{ + IV_ASSERT(val != NULL); +#define IVUG_BUNDLE_VALUE_MEDIA_TYPE_ALL "All" +#define IVUG_BUNDLE_VALUE_MEDIA_TYPE_IMAGE "Image" +#define IVUG_BUNDLE_VALUE_MEDIA_TYPE_VIDEO "Video" + + int len = strlen(val); + + if (strncmp(val, IVUG_BUNDLE_VALUE_MEDIA_TYPE_IMAGE, len) == 0 ) + { + return IVUG_MEDIA_TYPE_IMAGE; + } + else if (strncmp(val, IVUG_BUNDLE_VALUE_MEDIA_TYPE_VIDEO, len) == 0) + { + return IVUG_MEDIA_TYPE_VIDEO; + } + else if(strncmp(val, IVUG_BUNDLE_VALUE_MEDIA_TYPE_ALL, len) == 0) + { + return IVUG_MEDIA_TYPE_ALL; + } + + MSG_IVUG_ERROR("Invalid media type : %s", val); + return IVUG_MEDIA_TYPE_MAX; +} + +static bool _data_print(service_h service, const char *key, void *user_data) +{ + char *value; + + char **value_array; + int array_len = 1; + int i; + bool array = false; + + service_is_extra_data_array(service, key, &array); + if(array == false) + { + service_get_extra_data(service, key, &value); + MSG_IVUG_HIGH(" %s : %s", key, value); + free(value); + } + else + { + service_get_extra_data_array(service, key, &value_array, &array_len); + MSG_IVUG_HIGH(" %s :", key); + for(i=0; ibStandalone = true; + _ivug_free(&standalone); + } + else + { + data->bStandalone = false; + } + + //parse path + char* szFilePath = NULL; + { + service_get_extra_data (service, IVUG_BUNDLE_KEY_PATH, &szFilePath); + if(szFilePath == NULL) + { + MSG_IVUG_ERROR("File path is NULL"); + service_get_uri(service, &szFilePath); // app gadget + if(szFilePath) + { + MSG_IMAGEVIEW_ERROR("App gadget launched %s", szFilePath); + service_add_extra_data (service, "View Mode", "SINGLE"); + } + } + if ( szFilePath != NULL ) + { + if(strncmp(IVUG_FILE_PREFIX, szFilePath, strlen(IVUG_FILE_PREFIX)) == 0) + { + data->filepath = strdup(szFilePath + strlen(IVUG_FILE_PREFIX)); + } + else + { + data->filepath = strdup(szFilePath); + } + MSG_IVUG_MED("Current File = %s", data->filepath); + _ivug_free(&szFilePath); + } + else + { + ivug_param_delete(data); + return NULL; + } + } + +// View By + char* szViewBy = NULL; + + service_get_extra_data (service, IVUG_BUNDLE_KEY_VIEW_BY, &szViewBy); + if (szViewBy != NULL) + { + MSG_IVUG_MED("View By = %s", szViewBy); + + data->view_by = _get_view_by(szViewBy); + + if (data->view_by == IVUG_VIEW_BY_TAG) + { + char* szTagName = NULL; + + service_get_extra_data (service, IVUG_BUNDLE_KEY_TAG_NAME, &szTagName); + if ( szTagName != NULL ) + { + tag_handle t_handle = ivug_db_get_tag_handle(szTagName); + if(t_handle == NULL) + { + MSG_IVUG_FATAL("View by Tag. but tag handle is NULL" ); + ivug_param_delete(data); + return NULL; + } + + data->tag_id = ivug_db_get_tag_id(t_handle); + + ivug_db_destroy_tag(t_handle); + + MSG_IVUG_HIGH("Tag name=%s", szTagName); + MSG_IVUG_HIGH("Tag id=%d", data->tag_id); + _ivug_free(&szTagName); + } + else + { + MSG_IVUG_FATAL("View by Tag. but Tagname is NULL" ); + + _ivug_free(&szViewBy); + ivug_param_delete(data); + return NULL; + } + } + _ivug_free(&szViewBy); + } + else + { + MSG_IVUG_ERROR("View By is NULL"); + data->view_by = IVUG_VIEW_BY_INVAILD; + } + + media_handle file_handle = ivug_db_get_file_handle(data->filepath); + if(file_handle == NULL) + { + MSG_IVUG_ERROR("Current File = %s is not in DB", data->filepath); + data->view_by = IVUG_VIEW_BY_FILE; + } + +//parse image index at album + char* val = NULL; + + service_get_extra_data (service, IVUG_BUNDLE_KEY_INDEX, &val); + if(val) + { + data->start_index = ivug_atoi(val); + MSG_IVUG_MED("Slide Index = %d", data->start_index); + _ivug_free(&val); + } + else + { + if(data->view_by == IVUG_VIEW_BY_FOLDER) + { + MSG_IVUG_WARN("IVUG_VIEW_BY_FOLDER but index was not set"); + data->start_index = IVUG_INVALID_INDEX; + } + else + { + data->start_index = IVUG_DEFAULT_INDEX; + } + MSG_IVUG_WARN("Slide Index is not set. Set as default : %d", data->start_index); + } + +//parse mode + char* szMode = NULL; + + service_get_extra_data (service, IVUG_BUNDLE_KEY_VIEW_MODE, &szMode); + if (szMode != NULL) + { + data->mode = _get_view_mode(data, szMode); + MSG_IVUG_MED("View mode is %s(%d)", szMode, data->mode); + _ivug_free(&szMode); + } + else + { + data->mode = IVUG_DEFAULT_MODE; + MSG_IVUG_HIGH("View mode is NULL. Set Default(%d)", data->mode); + } + + //parse album id -album id is cluster id of media service + service_get_extra_data (service, IVUG_BUNDLE_KEY_ALBUM_IDX, &val); + if(val && data->view_by != IVUG_VIEW_BY_ALL) + { + data->album_id = uuid_getuuid(val); + MSG_IVUG_MED("album_uuid is %s", uuid_getchar(data->album_id)); + } + else + { + data->album_id = INVALID_UUID; + MSG_IVUG_WARN("Album index is NULL"); + } + if(val) + _ivug_free(&val); + + if (data->view_by == IVUG_VIEW_BY_FOLDER && data->album_id == INVALID_UUID) + { +/* + example: + ********************************** + Bundle Count = 2 + View Mode:CAMERA + Path:/opt/usr/media/Camera shots/IMAGE0021.jpg + ********************************** +*/ + // Get album id from file path. + char *dir = ivug_get_directory(data->filepath); + media_handle m_handle = ivug_db_get_folder_handle(dir); + free(dir); + + if(data->album_id == INVALID_UUID) + { + if(m_handle == NULL) + { + MSG_IVUG_ERROR("View by Folder. but media handle is NULL" ); + //ivug_param_delete(data); + //return NULL; + data->view_by = IVUG_VIEW_BY_DIRECTORY; // check manually + } + else + { + data->album_id = ivug_db_get_folder_id(m_handle); + + ivug_db_destroy_folder_handle(m_handle); + + MSG_IVUG_HIGH("Get Album ID(%s) from file %s", uuid_getchar(data->album_id), data->filepath); + } + } + } + + service_get_extra_data (service, IVUG_BUNDLE_KEY_MEDIA_TYPE, &val); + if(val != NULL) + { + data->media_type = _get_media_type(val); + MSG_IVUG_MED("Media Type=%s(%d)", val, data->media_type); + _ivug_free(&val); + } + else + { + MSG_IVUG_WARN("Media type is not specified."); + } + + long long int m = 0; + long int e = 0; + + service_get_extra_data (service, IVUG_BUNDLE_KEY_MAX_LONGITUDE, &val); + if(val != NULL) + { + eina_convert_atod(val, strlen(val), &m, &e); + data->max_longitude = ldexp((double)m, e); + MSG_IVUG_MED("Max Longitude =%f", data->max_longitude); + _ivug_free(&val); + } + else + { + MSG_IVUG_MED("Max Longitude is not specified."); + } + + service_get_extra_data (service, IVUG_BUNDLE_KEY_MIN_LONGITUDE, &val); + if(val != NULL) + { + eina_convert_atod(val, strlen(val), &m, &e); + data->min_longitude = ldexp((double)m, e); + MSG_IVUG_MED("Min Longitude =%f", data->min_longitude); + _ivug_free(&val); + } + else + { + MSG_IVUG_MED("Min Longitude is not specified."); + } + + service_get_extra_data (service, IVUG_BUNDLE_KEY_MAX_LATITUDE, &val); + if(val != NULL) + { + eina_convert_atod(val, strlen(val), &m, &e); + data->max_latitude = ldexp((double)m, e); + MSG_IVUG_MED("Max Latitude =%f", data->max_latitude); + _ivug_free(&val); + } + else + { + MSG_IVUG_MED("Max Latitude is not specified."); + } + + service_get_extra_data (service, IVUG_BUNDLE_KEY_MIN_LATITUDE, &val); + if(val != NULL) + { + eina_convert_atod(val, strlen(val), &m, &e); + data->min_latitude = ldexp((double)m, e); + MSG_IVUG_MED("Min Latitude =%f", data->min_latitude); + _ivug_free(&val); + } + else + { + MSG_IVUG_MED("Min Latitude is not specified."); + } + + service_get_extra_data (service, IVUG_BUNDLE_KEY_SETAS_TYPE, &val); + if (val) + { + MSG_IVUG_MED("SetAs UG Type=%s", val); + data->setas_type = _get_setas_type(val); + + char* resolution = NULL; + + service_get_extra_data (service, IVUG_BUNDLE_KEY_RESOLUTION, &resolution); + if(resolution) + { + sscanf(resolution, "%5dx%5d", &(data->width), &(data->height)); + MSG_IVUG_MED("Rectangle width = %d, height = %d", data->width, data->height); + if(data->width == 0 || data->height == 0) + { + MSG_IVUG_ERROR("Resolution is invalid"); + _ivug_free(&resolution); + _ivug_free(&val); + ivug_param_delete(data); + return NULL; + } + } + else + { + data->width = 100; + data->height = 100; + MSG_IVUG_HIGH("Rectangle ratio is not set. Set as default : %dx%d", data->width, data->height); + } + + data->bRatioFix = false; + char* bRatioFix = NULL; + + service_get_extra_data (service, IVUG_BUNDLE_KEY_FIXED_RATIO, &bRatioFix); + if(bRatioFix) + { + MSG_IVUG_MED("Fixed ratio=%s", bRatioFix); + if(strcmp(bRatioFix, "TRUE") == 0) + { + data->bRatioFix = true; + } + _ivug_free(&bRatioFix); + } + + char* crop_mode = NULL; + service_get_extra_data (service, IVUG_BUNDLE_KEY_CROP_MODE, &crop_mode); + if(crop_mode) + { + MSG_IVUG_MED("Crop mode=%s", crop_mode); + if(strcmp(crop_mode, IVUG_BUNDLE_VALUE_CROP_MODE_FIT_TO_SCREEN) == 0) + { + int lcd_x = 0; + int lcd_y = 0; + int lcd_w = 0; + int lcd_h = 0; + int rot = 0; + evas_object_geometry_get((Evas_Object *)ug_get_window(), &lcd_x, &lcd_y, &lcd_w, &lcd_h); + rot = gGetRotationDegree(); + if(rot == 90 || rot == 270) + { + int temp = lcd_w; + lcd_w = lcd_h; + lcd_h = temp; + } + data->width = lcd_w; + data->height = lcd_h; + data->bRatioFix = true; + } + _ivug_free(&crop_mode); + } + + _ivug_free(&val); + } + + data->footsteps = false; /* default */ + service_get_extra_data (service, IVUG_BUNDLE_KEY_FOOTSTEPS, &val); + if (val) + { + MSG_IVUG_MED("Footsteps=%s", val); + if(strcmp(val, "TRUE") == 0) + { + data->footsteps = true; + } + _ivug_free(&val); + } + + + + + char **index_list = NULL; + int index_len = 0; + service_get_extra_data_array(service, IVUG_BUNDLE_KEY_SELECTED_INDEX, &index_list, &index_len); + if(index_list != NULL) + { + int i; + for(i=0; iselected_list = eina_list_append(data->selected_list, (void *)ivug_atoi(index_list[i])); + } + for(i=0; ifilepath) + { + free(data->filepath); + data->filepath = NULL; + } + + + uuid_free(data->album_id); + + free(data); + + MSG_IVUG_HIGH("Parameter is freed."); + +} + + + + + +Filter_struct *ivug_param_create_filter(const ivug_parameter *param) +{ + IV_ASSERT(param != NULL); + + Filter_struct *filter_str = (Filter_struct *)calloc(1, sizeof(Filter_struct)); + IV_ASSERT(filter_str != NULL); + + media_handle handle = NULL; + char *dir = NULL; + + if ( param->view_by == IVUG_VIEW_BY_DIRECTORY ) + { + filter_str->type = FILTER_DIRECTORY; + filter_str->view_by = param->view_by; + + Direcotry_Filter *filter = (Direcotry_Filter *)calloc(1, sizeof(Direcotry_Filter) ); + + IV_ASSERT(filter != NULL); + + filter_str->dir_filter = filter; + filter_str->dir_filter->basedir = ivug_get_directory(param->filepath); + filter_str->dir_filter->current = strdup( param->filepath ); + + return filter_str; + } + else + { + filter_str->type = FILTER_DB; + } + + filter_str->view_by = param->view_by; + filter_str->media_type = param->media_type; + filter_str->sort_type = param->sort_type; + filter_str->index = param->start_index; + filter_str->selected_list = param->selected_list; + if(param->filepath) + { + filter_str->filepath = strdup(param->filepath); + } + + if(filter_str->type == FILTER_DB) + { + DB_Filter *filter = calloc(1, sizeof(DB_Filter)); + + IV_ASSERT(filter != NULL); + + MSG_SDATA_HIGH("param->view_by is %d", param->view_by); + switch(filter_str->view_by) + { + case IVUG_VIEW_BY_PLACES: + filter->place.max_longitude = param->max_longitude; + filter->place.min_longitude = param->min_longitude; + filter->place.max_latitude = param->max_latitude; + filter->place.min_latitude = param->min_latitude; + break; + + case IVUG_VIEW_BY_TAG: + filter->tag_id = param->tag_id; + break; + + case IVUG_VIEW_BY_FAVORITES: + filter->album_id = INVALID_UUID; + break; + case IVUG_VIEW_BY_FILE: + filter->file_path = strdup(param->filepath); + break; + case IVUG_VIEW_BY_ALL: + filter->album_id = uuid_assign(param->album_id); + break; + case IVUG_VIEW_BY_FOLDER: + if(param->album_id == NULL) + { + dir = ivug_get_directory(param->filepath); + handle = ivug_db_get_folder_handle(dir); + filter->album_id = ivug_db_get_folder_id(handle); + free(dir); + } + else + { + filter->album_id = uuid_assign(param->album_id); + } + break; + case IVUG_VIEW_BY_DIRECTORY: + break; + case IVUG_VIEW_BY_INVAILD: + default: + MSG_SDATA_WARN("Invalid ViewBy : %d", param->view_by); + break; + + } + + filter_str->db_filter = filter; + } + + return filter_str; + +} + + diff --git a/main/src/control/ivug-parameter.h b/main/src/control/ivug-parameter.h new file mode 100755 index 0000000..c3c7556 --- /dev/null +++ b/main/src/control/ivug-parameter.h @@ -0,0 +1,115 @@ +/* + * Copyright 2012 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 __IVUG_PARAMETER_H__ +#define __IVUG_PARAMETER_H__ + +#include +#include +#include + +#include "ivug-define.h" +#include "ivug-datatypes.h" +#include "ivug-filter.h" + +typedef enum { + IVUG_MODE_INVAILD = 0x00, + IVUG_MODE_NORMAL, + IVUG_MODE_SINGLE, // just show one slide + IVUG_MODE_DISPLAY, // from "take a photo" in messenger + IVUG_MODE_FILE, // file viewer(can flick) + IVUG_MODE_CAMERA, // camera(can flick) + IVUG_MODE_SETAS, // SetAs in setting menu. + IVUG_MODE_SLIDESHOW, // Slideshow +} ivug_mode; + +//set as ug +typedef enum { + IVUG_SET_AS_UG_TYPE_INVALID = 0x00, + IVUG_SET_AS_UG_TYPE_WALLPAPER, + IVUG_SET_AS_UG_TYPE_LOCKSCREEN, + IVUG_SET_AS_UG_TYPE_WALLPAPER_N_LOCKSCREEN, + IVUG_SET_AS_UG_TYPE_CALLER_ID, + IVUG_SET_AS_UG_TYPE_VIDEO_CALL_ID, + IVUG_SET_AS_UG_TYPE_CROP, // For OSP + IVUG_SET_AS_UG_TYPE_WALLPAPER_CROP, + IVUG_SET_AS_UG_TYPE_MAX, +} ivug_setas_type; + +typedef struct { + ivug_mode mode; + ivug_setas_type setas_type; // Only needed when mode is IVUG_MODE_SETAS + + bool bStandalone; // launched by appsvc + + ivug_view_by view_by; + + char* filepath; + UUID album_id; //cluster id of media service + + ivug_media_type media_type; + ivug_sort_type sort_type; + + /* for places view */ + bool footsteps; + double max_longitude; + double min_longitude; + double max_latitude; + double min_latitude; + + /* for set as view crop box*/ + unsigned int width; + unsigned int height; + bool bRatioFix; + + int tag_id; + + int start_index; + + + + Eina_List *selected_list; +} ivug_parameter; + + +#ifdef __cplusplus +extern "C" { +#endif + + +ivug_parameter* +ivug_param_create_from_bundle(service_h service); + +void +ivug_param_delete(ivug_parameter* data); + + +/* + Covert ivug_paramter to db filter +*/ +Filter_struct * +ivug_param_create_filter(const ivug_parameter *param); + + +#ifdef __cplusplus +} +#endif + + + +#endif // __IVUG_PARAMETER_H__ + + diff --git a/main/src/control/ivug-popup.c b/main/src/control/ivug-popup.c new file mode 100755 index 0000000..4a42173 --- /dev/null +++ b/main/src/control/ivug-popup.c @@ -0,0 +1,600 @@ +/* + * Copyright 2012 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 "ivug-popup.h" + +#define NOTIFY_TIMEOUT 3.0 + +#define IVUG_POPUP_EDJ_NAME EDJ_PATH"/ivug-popup.edj" + +typedef struct _Ivug_Popup +{ + Evas_Object *parent; + Evas_Object *popup; + Evas_Object *layout; + + Evas_Object *obj; + + int selected_index; + + Popup_Response response; + + Evas_Smart_Cb callback; + void *data; + +}Ivug_Popup; + +typedef struct +{ + int index; + char *name; + Evas_Object *radio_main; + Ivug_Popup *p_iv_popup; + Elm_Object_Item *item; +} ivug_radio_popup_item; + +static Ivug_Popup * ivug_popup_create() +{ + Ivug_Popup *iv_popup = calloc(1, sizeof(Ivug_Popup)); + + return iv_popup; +} + +static void ivug_popup_delete(Ivug_Popup *iv_popup) +{ + + if(iv_popup->popup) + { + evas_object_del(iv_popup->popup); + iv_popup->popup = NULL; + } + + if(iv_popup->layout) + { + evas_object_del(iv_popup->layout); + iv_popup->layout = NULL; + } + + free(iv_popup); +} + +static void _on_popup_response(void *data, Evas_Object *obj, void *event_info ) +{ + IV_ASSERT(data != NULL); + + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + Popup_Response response = (Popup_Response)evas_object_data_get(obj, "response"); + MSG_IMAGEVIEW_HIGH("response callback=%d", response); + + if(iv_popup->callback) + { + iv_popup->callback(iv_popup->data, iv_popup->popup, (void *)response); + } + + ivug_popup_delete(iv_popup); +} + + +static void _on_ctxpopup_dismissed( void *data, Evas_Object *obj, void *event_info ) +{ +// Triggered when clicked outside ctxpopup + MSG_IMAGEVIEW_HIGH("Dismissed response"); + + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + + ivug_popup_delete(iv_popup); +} + +Evas_Object* +ivug_deletepopup_show(Evas_Object* parent, const char* title, + const char* contents, Evas_Smart_Cb response, void* user_data) +{ + Evas_Object *popup; + Evas_Object *btn_delete; + Evas_Object *btn_cancel; + //create popup + + IV_ASSERT(response != NULL); + + Ivug_Popup *iv_popup = ivug_popup_create(); + + popup = elm_popup_add(parent); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(popup, contents); + elm_object_part_text_set(popup, "title,text", title); + + btn_delete = ivug_button_add(popup, "popup_button/default", IDS_DELETE, NULL, _on_popup_response, iv_popup); + elm_object_part_content_set(popup, "button1", btn_delete); + evas_object_data_set(btn_delete, "response", (void *)POPUP_RESPONSE_OK); + + btn_cancel = ivug_button_add(popup, "popup_button/default", IDS_CANCEL, NULL, _on_popup_response, iv_popup); + elm_object_part_content_set(popup, "button2", btn_cancel); + evas_object_data_set(btn_cancel, "response", (void *)POPUP_RESPONSE_CANCEL); + + iv_popup->popup = popup; + iv_popup->callback = response; + iv_popup->data = user_data; + + evas_object_show(popup); + + return popup; +} + + +Evas_Object* +ivug_2btn_popup_show(Evas_Object* parent, const char* title, + const char* contents, Evas_Smart_Cb response, void* user_data) +{ + IV_ASSERT(response != NULL); + + Ivug_Popup *iv_popup = ivug_popup_create(); + + Evas_Object *popup; + Evas_Object *btn_yes; + Evas_Object *btn_no; + //create popup + + popup = elm_popup_add(parent); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_object_text_set(popup, contents); + if(title) + { + elm_object_part_text_set(popup, "title,text", title); + } + + btn_yes = ivug_button_add(popup, "popup_button/default", IDS_YES, NULL, _on_popup_response, iv_popup); + elm_object_part_content_set(popup, "button1", btn_yes); + evas_object_data_set(btn_yes, "response", (void *)POPUP_RESPONSE_OK); + + btn_no = ivug_button_add(popup, "popup_button/default", IDS_NO, NULL, _on_popup_response, iv_popup); + elm_object_part_content_set(popup, "button2", btn_no); + evas_object_data_set(btn_no, "response", (void *)POPUP_RESPONSE_CANCEL); + + iv_popup->popup = popup; + iv_popup->callback = response; + iv_popup->data = user_data; + + evas_object_show(popup); + evas_object_layer_set(popup, EVAS_LAYER_MAX); + + return popup; +} + +Evas_Object *ivug_timeout_popup_show(Evas_Object *parent, + Evas_Smart_Cb response, void *data, const char *sztitle, const char *content) + +{ + Ivug_Popup *iv_popup = ivug_popup_create(); + + Evas_Object *popup; + + popup = elm_popup_add(parent); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + elm_object_text_set(popup, content); + + if(response) + { + iv_popup->callback = response; + } + + if(data) + { + iv_popup->data = data; + } + + if ( sztitle ) + elm_object_part_text_set(popup, "title,text", sztitle); + + elm_popup_timeout_set(popup, 3.0); + evas_object_smart_callback_add(popup, "timeout", _on_popup_response, iv_popup); + + iv_popup->popup = popup; + + evas_object_show(popup); + + return popup; + +} + +static void _on_longpress_popup_selected(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + + const char *label = elm_object_item_text_get((Elm_Object_Item *)event_info); + if(label == NULL) + { + MSG_MAIN_ERROR("label is NULL"); + ivug_popup_delete(iv_popup); + return; + } + MSG_MAIN_HIGH("text(%s) is clicked", label); + + Longpress_Popup_Response response = LPPOPUP_RESPONSE_NONE; + if(strncmp(label, IDS_COPY, strlen(label)) == 0) + { + response = LPPOPUP_RESPONSE_COPY; + } + else if(strncmp(label, IDS_MANUALLY_DETECT, strlen(label)) == 0) + { + response = LPPOPUP_RESPONSE_MANUALLY_DETECT; + } + else + { + MSG_MAIN_WARN("Unknown Share type : %s", label); + } + MSG_MAIN_HIGH("response=%d", response); + + if(iv_popup->callback) + { + iv_popup->callback(iv_popup->data, iv_popup->popup, (void *)response); + } + + ivug_popup_delete(iv_popup); +} + +Evas_Object* +ivug_longpress_popup_show(Evas_Object *parent, int x, int y, Evas_Smart_Cb response, void *data) +{ + Ivug_Popup *iv_popup = ivug_popup_create(); + + Evas_Object* ctx_popup = NULL; + + ctx_popup = elm_ctxpopup_add(parent); + + elm_ctxpopup_item_append(ctx_popup, IDS_COPY, NULL, _on_longpress_popup_selected, iv_popup); + + + evas_object_smart_callback_add(ctx_popup, "dismissed", _on_ctxpopup_dismissed, iv_popup); + + evas_object_move(ctx_popup, x, y); + + iv_popup->popup = ctx_popup; + iv_popup->callback = response; + iv_popup->data = data; + + evas_object_show(ctx_popup); + + return ctx_popup; +} + + +void +_ivug_rename_enter_click_cb(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + IV_ASSERT(iv_popup != NULL); + + Evas_Object *entry = iv_popup->obj; + + char *name = elm_entry_markup_to_utf8 ( elm_entry_entry_get(entry) ); + + MSG_IMAGEVIEW_HIGH("name = %s", name); + + if(name) + { + char *new_name = NULL; + new_name = ivug_strip_string(name); + if(new_name == NULL) + { + MSG_IMAGEVIEW_ERROR( "rename failed"); + free(name); + ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(entry)); + return; + } + elm_object_text_set(entry, new_name); + if(iv_popup->callback) + { + iv_popup->callback(iv_popup->data, iv_popup->popup, (void *)POPUP_RESPONSE_OK); + } + ivug_popup_delete(iv_popup); + } + else + { + //ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(entry)); + } +} + +void +_ivug_rename_entry_changed(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + IV_ASSERT(iv_popup != NULL); + + Evas_Object *entry = iv_popup->obj; + Evas_Object *btn_ok = elm_object_part_content_get(iv_popup->popup, "button1"); + + char *content = elm_entry_markup_to_utf8 ( elm_entry_entry_get(entry) ); + + if (strlen(content) == 0) + { + MSG_IMAGEVIEW_HIGH("ISF1 : %s", content); + elm_object_disabled_set(btn_ok, EINA_TRUE); + } + else + { + MSG_IMAGEVIEW_HIGH("ISF : %s", content); + elm_object_disabled_set(btn_ok, EINA_FALSE); + } + free(content); +} + +void +_ivug_rename_maxlength_reached(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + IV_ASSERT(iv_popup != NULL); + + //todo : show popup +} + +Evas_Object *ivug_rename_popup_show(Evas_Object *parent, const char *filename, Evas_Smart_Cb response, void *data) +{ + Evas_Object *popup = NULL; + Evas_Object *entry = NULL; + Evas_Object *layout = NULL; + + Ivug_Popup *iv_popup = ivug_popup_create(); + if(iv_popup == NULL) + { + MSG_IMAGEVIEW_ERROR("ivug_popup_create ERROR"); + return NULL; + } + + popup = elm_popup_add(parent); + if(!popup) + { + MSG_IMAGEVIEW_ERROR("popup is NULL"); + goto ENTRY_POPUP_FREE; + } + //evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + //elm_object_style_set(popup, "menustyle"); + elm_object_part_text_set(popup, "title,text", "Rename"); + + layout = ivug_layout_add2(popup, IVUG_POPUP_EDJ_NAME, "popup_entryview"); + if(!layout) + { + MSG_IMAGEVIEW_ERROR("layout is NULL"); + goto ENTRY_POPUP_FREE; + } + + entry = elm_entry_add(popup); + elm_entry_scrollable_set(entry, EINA_TRUE); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_object_text_set(entry, filename); + elm_entry_cursor_end_set(entry); + elm_object_part_content_set(layout, "elm.swallow.content", entry); + elm_object_content_set(popup, layout); + + evas_object_smart_callback_add(entry, "activated", _ivug_rename_enter_click_cb, iv_popup); + evas_object_smart_callback_add(entry, "changed", _ivug_rename_entry_changed, iv_popup); + + static Elm_Entry_Filter_Limit_Size limit_filter_data; + limit_filter_data.max_char_count = 64; + limit_filter_data.max_byte_count = 0; + elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data); + evas_object_smart_callback_add(entry, "maxlength,reached", _ivug_rename_maxlength_reached, (void *)iv_popup); + + evas_object_show(layout); + + Evas_Object *btn_ok = ivug_button_add(popup, "popup_button/default", IDS_OK, NULL, _ivug_rename_enter_click_cb, iv_popup); + elm_object_part_content_set(popup, "button1", btn_ok); + evas_object_data_set(btn_ok, "response", (void *)POPUP_RESPONSE_OK); + + Evas_Object *btn_cancel = ivug_button_add(popup, "popup_button/default", IDS_CANCEL, NULL, _on_popup_response, iv_popup); + elm_object_part_content_set(popup, "button2", btn_cancel); + evas_object_data_set(btn_cancel, "response", (void *)POPUP_RESPONSE_CANCEL); + + iv_popup->popup = popup; + iv_popup->callback = response; + iv_popup->data = data; + iv_popup->obj = entry; + + evas_object_show(popup); + + return popup; + +ENTRY_POPUP_FREE: + if(popup) + { + evas_object_del(popup); + } + ivug_popup_delete(iv_popup); + return NULL; +} + +static void _block_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + Popup_Response response = (Popup_Response)evas_object_data_get(obj, "response"); + MSG_IMAGEVIEW_HIGH("response callback=%d", response); + + if(iv_popup->callback) + { + iv_popup->callback(iv_popup->data, iv_popup->popup, (void *)response); + } + + ivug_popup_delete(iv_popup); +} + +static char * +_gl_text_get(void *data, Evas_Object *obj, const char *part) +{ + ivug_radio_popup_item *popup_item = (ivug_radio_popup_item *)data; + //int index = popup_item->index; + + if (strcmp(part, "elm.text") == 0) + { + return strdup(popup_item->name); + } + return NULL; +} + +static Evas_Object * +_gl_content_get(void *data, Evas_Object *obj, const char *part) +{ + ivug_radio_popup_item *popup_item = (ivug_radio_popup_item *)data; + + Evas_Object *radio; + Evas_Object *radio_main = popup_item->radio_main; + int index = popup_item->index; + int selected_index = popup_item->p_iv_popup->selected_index; + + if (strcmp(part, "elm.icon") == 0 || strcmp(part, "elm.swallow.icon") == 0) + { + radio = elm_radio_add(obj); + elm_radio_state_value_set(radio, index); + elm_radio_group_add(radio, radio_main); + if (index == selected_index) + elm_radio_value_set(radio, selected_index); + evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL); + + return radio; + } + + return NULL; +} + +static void +_gl_del(void *data, Evas_Object *obj) +{ + ivug_radio_popup_item *popup_item = (ivug_radio_popup_item *)data; + + if(popup_item->name) + { + free(popup_item->name); + popup_item->name = NULL; + } + + free(popup_item); + + return; +} + +static void +_gl_sel(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_Popup *iv_popup = (Ivug_Popup *)data; + + Elm_Object_Item *item = (Elm_Object_Item *) event_info; + ivug_radio_popup_item *popup_item = NULL; + + MSG_IMAGEVIEW_HIGH("_gl_sel"); + + if (item) + { + popup_item = (ivug_radio_popup_item *)elm_object_item_data_get(item); + iv_popup->selected_index = popup_item->index; + elm_genlist_item_update(item); + + if(iv_popup->callback) + { + iv_popup->callback(iv_popup->data, iv_popup->popup, (void *)iv_popup->selected_index); + } + + ivug_popup_delete(iv_popup); + } +} + +Evas_Object *ivug_radio_popoup_show(Evas_Object *parent, char *title, + int selected_index, Eina_List *name_list, Evas_Smart_Cb response, void *data) +{ +#define GET_POPUP_HEIGHT(icnt) (((113*icnt-1) > 408) ? (408) : (113*icnt-1)) +#define GET_POPUP_WIDTH(icnt) (614) + + Evas_Object *popup; + int index = 0; + Elm_Object_Item *item; + Evas_Object *genlist; + Evas_Object *btn_close; + Evas_Object *radio_main; + + static Elm_Genlist_Item_Class itc = {0,}; + + ivug_radio_popup_item *popup_item; + + Ivug_Popup *iv_popup = ivug_popup_create(); + + popup = elm_popup_add(parent); + elm_object_style_set(popup, "menustyle");//elm_object_style_set(popup, "min_menustyle"); + elm_object_part_text_set(popup, "title,text", title); + evas_object_smart_callback_add(popup, "block,clicked", _block_clicked_cb, iv_popup); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + btn_close = ivug_button_add(popup, "popup_button/default", IDS_CLOSE, NULL, _on_popup_response, iv_popup); + elm_object_part_content_set(popup, "button1", btn_close); + evas_object_data_set(btn_close, "response", (void *)POPUP_RESPONSE_OK); + + itc.item_style = "1text.1icon.2"; + itc.func.text_get = _gl_text_get; + itc.func.content_get = _gl_content_get; + itc.func.state_get = NULL; + itc.func.del = _gl_del; + + genlist = elm_genlist_add(popup); + evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_propagate_events_set(genlist, EINA_FALSE); + + radio_main = elm_radio_add(genlist); + elm_radio_state_value_set(radio_main, -1); + elm_radio_value_set(radio_main, -1); + evas_object_propagate_events_set(radio_main, EINA_FALSE); + + Eina_List *l = NULL; + char *name = NULL; + + EINA_LIST_FOREACH(name_list, l, name) + { + popup_item = calloc(1, sizeof(ivug_radio_popup_item)); + popup_item->index = index++; + popup_item->name = strdup(name); + popup_item->radio_main = radio_main; + popup_item->p_iv_popup = iv_popup; + + item = elm_genlist_item_append(genlist, &itc, (void *)popup_item, NULL, + ELM_GENLIST_ITEM_NONE, _gl_sel, iv_popup); + + popup_item->item = item; + } + + Evas_Object *box; + box = elm_box_add(popup); + evas_object_size_hint_min_set(box, GET_POPUP_WIDTH(index-1) * elm_config_scale_get(), GET_POPUP_HEIGHT(index-1) * elm_config_scale_get()); + evas_object_show(genlist); + elm_box_pack_end(box, genlist); + elm_object_content_set(popup, box); + //elm_object_content_set(popup, genlist); + + iv_popup->popup = popup; + iv_popup->callback = response; + iv_popup->data = data; + iv_popup->obj = radio_main; + iv_popup->selected_index = selected_index; + + evas_object_show(popup); + + return popup; +} + + diff --git a/main/src/control/ivug-popup.h b/main/src/control/ivug-popup.h new file mode 100755 index 0000000..f500d48 --- /dev/null +++ b/main/src/control/ivug-popup.h @@ -0,0 +1,82 @@ +/* + * Copyright 2012 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 __IVUG_POPUP_H__ +#define __IVUG_POPUP_H__ + +#include "ivug-common.h" + +typedef enum _Popup_Response +{ + POPUP_RESPONSE_NONE = -1, + POPUP_RESPONSE_TIMEOUT = -2, + POPUP_RESPONSE_OK = -3, + POPUP_RESPONSE_CANCEL = -4, + POPUP_RESPONSE_CLOSE = -5 +}Popup_Response; + +typedef enum _Longpress_Popup_Response +{ + LPPOPUP_RESPONSE_NONE = 0, + LPPOPUP_RESPONSE_COPY, + LPPOPUP_RESPONSE_MANUALLY_DETECT, +}Longpress_Popup_Response; + +// Selected data + +#ifdef __cplusplus +extern "C" { +#endif + +/* + Create & show popup with 2 button (Yes/No) +*/ +Evas_Object* ivug_2btn_popup_show(Evas_Object* parent, const char* title, + const char* contents, Evas_Smart_Cb response, void* user_data); + +/* + Create & show popup with no button. +*/ +Evas_Object *ivug_timeout_popup_show(Evas_Object *parent, + Evas_Smart_Cb response, void *data, const char *sztitle, const char *content); + +Evas_Object* +ivug_deletepopup_show(Evas_Object* parent, const char* title, + const char* contents, Evas_Smart_Cb response, void* user_data); + + +/* + Create show copy popup in coordinate (x,y) +*/ +Evas_Object* ivug_longpress_popup_show(Evas_Object *parent, int x, int y, Evas_Smart_Cb response, void *data); + + +Evas_Object* ivug_deletepopup_show(Evas_Object* parent, const char* title, + const char* contents, Evas_Smart_Cb response, void* user_data); + +Evas_Object *ivug_rename_popup_show(Evas_Object *parent, const char *filename, Evas_Smart_Cb response, void *data); + +Evas_Object *ivug_radio_popoup_show(Evas_Object *parent, char *title, + int selected_index, Eina_List *name_list, Evas_Smart_Cb response, void *data); + + + +#ifdef __cplusplus +} +#endif + + +#endif //__IVUG_POPUP_H__ diff --git a/main/src/control/ivug-selectioninfo.c b/main/src/control/ivug-selectioninfo.c new file mode 100755 index 0000000..a516a19 --- /dev/null +++ b/main/src/control/ivug-selectioninfo.c @@ -0,0 +1,196 @@ +/* + * Copyright 2012 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 "ivug-common.h" + +#include + +#include "ivug-selectioninfo.h" + +#define NOTIFY_TIMEOUT 3.0 + +static void +_ivug_selectioninfo_timeout_cb(void *data, Evas_Object *obj, void *event_info) +{ + ivug_ret_if(obj == NULL); + + evas_object_del(obj); + obj = NULL; +} + +static void _on_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Coord x,y,w,h; + evas_object_geometry_get(obj, &x, &y, &w, &h); + + MSG_IMAGEVIEW_HIGH("Selection resized geomtery XYWH(%d,%d,%d,%d) angle=%d", x, y, w, h, gGetRotationDegree()); + + Evas_Object* layout = elm_object_content_get(obj); + ivug_retm_if(layout == NULL, "Notify content is NULL"); + + //Get the selectioninfo text + const char* text = edje_object_part_text_get(_EDJ(layout), "elm.text"); + +#ifdef USE_CUSTOM_STYLE + elm_object_theme_set(layout, gGetSystemTheme()); + + int rot_angle = gGetRotationDegree(); + if ( (rot_angle == 0) || (rot_angle == 180) ) + { + elm_layout_theme_set(layout, "standard", "selectioninfo", "vertical/bottom_86"); + } + else + { + elm_layout_theme_set(layout, "standard", "selectioninfo", "horizontal/bottom_64"); + } +#endif + + if(text) + { + //Reset the text, because the text will be missed if no reset + edje_object_part_text_set(_EDJ(layout), "elm.text", text); + } + +} + + +Evas_Object* +ivug_selectioninfo_create(Evas_Object* parent, const char* text) +{ + Evas_Object *notify; + + notify = elm_notify_add(parent); + ivug_retv_if(notify == NULL, NULL); + elm_notify_align_set(notify, ELM_NOTIFY_ALIGN_FILL, 1.0); + evas_object_size_hint_weight_set(notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(notify, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_smart_callback_add(notify, "timeout", _ivug_selectioninfo_timeout_cb, NULL); + elm_notify_timeout_set(notify, NOTIFY_TIMEOUT); + + int rot_angle = gGetRotationDegree(); + + Evas_Object* layout = elm_layout_add(parent); + +#ifdef USE_CUSTOM_STYLE + elm_object_theme_set(layout, gGetSystemTheme()); + + if ( (rot_angle == 0) || (rot_angle == 180) ) + { + elm_layout_theme_set(layout, "standard", "selectioninfo", "vertical/bottom_86"); + } + else + { + elm_layout_theme_set(layout, "standard", "selectioninfo", "horizontal/bottom_64"); + } +#endif + + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_content_set(notify, layout); + edje_object_part_text_set(_EDJ(layout), "elm.text", text); + + evas_object_event_callback_add(notify, EVAS_CALLBACK_RESIZE, _on_resize, NULL); + + evas_object_show(notify); + + return notify; +} + +Evas_Object* +ivug_notify_create(Evas_Object* parent, const char* text) +{ + Evas_Object *selection_info; + + selection_info = elm_layout_add(parent); + ivug_retv_if(selection_info == NULL, NULL); + evas_object_size_hint_weight_set(selection_info, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(selection_info, EVAS_HINT_FILL, EVAS_HINT_FILL); + +#ifdef USE_CUSTOM_STYLE + //elm_object_theme_set(selection_info, gGetSystemTheme()); +#endif + elm_layout_theme_set(selection_info, "standard", "selectioninfo", "default"); + + elm_object_part_text_set(selection_info, "elm.text", text); + + evas_object_show(selection_info); + + return selection_info; +} + +static void _on_timeout(void *data, Evas_Object *obj, void *event_info) +{ + evas_object_del(obj); // remove notify +} + +void +ivug_notify_timeout_create(Evas_Object* parent, const char* text, double align, + Evas_Smart_Cb timeout_cb, void *data) +{ + Evas_Object *notify = elm_notify_add(parent); + ivug_ret_if(notify == NULL); + elm_notify_align_set(notify, ELM_NOTIFY_ALIGN_FILL, align); + elm_notify_timeout_set(notify, 2.0); + + Evas_Object *selection_info = elm_layout_add(notify); + ivug_ret_if(selection_info == NULL); + evas_object_size_hint_weight_set(selection_info, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(selection_info, EVAS_HINT_FILL, EVAS_HINT_FILL); + +#ifdef USE_CUSTOM_STYLE + //elm_object_theme_set(selection_info, gGetSystemTheme()); +#endif + elm_layout_theme_set(selection_info, "standard", "selectioninfo", "default"); + + elm_object_part_text_set(selection_info, "elm.text", text); + + elm_object_content_set(notify, selection_info); + + if(timeout_cb) + evas_object_smart_callback_add(notify, "timeout", timeout_cb, data); + else + evas_object_smart_callback_add(notify, "timeout", _on_timeout, NULL); + + evas_object_show(notify); +} + +Evas_Object* +ivug_notify_static_create(Evas_Object* parent, const char* text, double align) +{ + Evas_Object *notify = elm_notify_add(parent); + ivug_retv_if(notify == NULL, NULL); + elm_notify_align_set(notify, ELM_NOTIFY_ALIGN_FILL, align); + + Evas_Object *selection_info = elm_layout_add(notify); + ivug_retv_if(selection_info == NULL, NULL); + evas_object_size_hint_weight_set(selection_info, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(selection_info, EVAS_HINT_FILL, EVAS_HINT_FILL); + +#ifdef USE_CUSTOM_STYLE + //elm_object_theme_set(selection_info, gGetSystemTheme()); +#endif + elm_layout_theme_set(selection_info, "standard", "selectioninfo", "default"); + + elm_object_part_text_set(selection_info, "elm.text", text); + + elm_object_content_set(notify, selection_info); + + evas_object_show(notify); + + return notify; +} + + diff --git a/main/src/control/ivug-selectioninfo.h b/main/src/control/ivug-selectioninfo.h new file mode 100755 index 0000000..91aa3c9 --- /dev/null +++ b/main/src/control/ivug-selectioninfo.h @@ -0,0 +1,42 @@ +/* + * Copyright 2012 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 __IVUG_SELECTIONINFO_H__ +#define __IVUG_SELECTIONINFO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +#define NOTIFY_ALIGN_TOP (0.04) // efl bug? not 0.0 +#define NOTIFY_ALIGN_BOTTOM (1.0) + +/* time out applied */ +Evas_Object * ivug_selectioninfo_create(Evas_Object* parent, const char* contents); + +Evas_Object * ivug_notify_create(Evas_Object* parent, const char* text); + +Evas_Object * ivug_notify_static_create(Evas_Object* parent, const char* text, double align); + +void ivug_notify_timeout_create(Evas_Object* parent, const char* text, double align, + Evas_Smart_Cb timeout_cb, void *data); + + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_SELECTIONINFO_H__ diff --git a/main/src/control/ivug-setas.cpp b/main/src/control/ivug-setas.cpp new file mode 100755 index 0000000..a71047f --- /dev/null +++ b/main/src/control/ivug-setas.cpp @@ -0,0 +1,323 @@ +/* + * Copyright 2012 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 "ivug-common.h" + +#include "ivug-debug.h" +#include "ivug-util.h" +#include "ivug-image.h" + +#include "ivug-setas.h" + +/* + Used for storing cropped image. +*/ +#define IVUG_HOME_SCREEN_TEMP_PATH DATA_PATH"/.homescreen_tmp.jpg" +#define IVUG_LOCK_SCREEN_TEMP_PATH DATA_PATH"/.lockscreen_tmp.jpg" + + +static Eina_Bool _crop_image(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *save_file, const char *option) +{ + if (ivug_remove_file(save_file) == false) + { + MSG_SETAS_ERROR( "Delete file %s: failed", save_file); + return EINA_FALSE; + } + + Evas_Object *ret_image = NULL; + + ret_image = ivug_image_region_image_get(photocam, rect->x, rect->y, rect->w , rect->h); + + if(ret_image == NULL) + { + MSG_SETAS_ERROR("Region get faied."); + return EINA_FALSE; + } + + if (evas_object_image_save(ret_image, save_file, NULL, option) == EINA_FALSE) + { + MSG_SETAS_ERROR("evas_object_image_save error. %s", save_file); + MSG_SETAS_ERROR("setas image save faied."); + evas_object_del(ret_image); + return EINA_FALSE; + } + + evas_object_del(ret_image); + + return EINA_TRUE; +} + + +static Eina_Bool _photocam_image_save(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char* tmp_file, const char* final_file) +{ +//2. Crop image and save it as tmp file + Eina_Bool ret; + + if ( tmp_file == NULL ) + { + if (ivug_remove_file(final_file) == false) // Remove dest file + { + MSG_SETAS_ERROR( "Delete file %s failed", final_file); + goto error; + } + + ret = _crop_image(photocam, rect, final_file, "quality=100 compress=9"); + if(ret == EINA_FALSE) + { + MSG_SETAS_ERROR("crop image failed!"); + goto error; + } + + } + else + { + // save ½ÇÆнà ÇöÀçÀÇ image¸¦ º¸È£Çϱâ À§ÇØ ¸ÕÀú tmp¿¡ ÀúÀåÇÑ ´ÙÀ½ rename ÇÑ´Ù. + ret = _crop_image(photocam, rect, tmp_file, "quality=100 compress=9"); + if(ret == EINA_FALSE) + { + MSG_SETAS_ERROR("crop image failed!"); + goto error; + } + + //3. Delete the lockscreen file if exist + if (ivug_remove_file(final_file) == false) + { + MSG_SETAS_ERROR( "Delete file %s failed", final_file); + goto error; + } + + //4. rename the tmp file to lock screen file + if(ivug_rename_file(tmp_file, final_file) == false) + { + MSG_SETAS_ERROR( "Rename file %s to %s failed", tmp_file, final_file); + goto error; + } + } + + return EINA_TRUE; +error: + if ( tmp_file != NULL ) + { + if(ivug_remove_file(tmp_file) == false) + { + MSG_SETAS_ERROR( "Delete file %s failed", tmp_file); + } + } + + return EINA_FALSE; +} + +Eina_Bool +_ivug_setas_save_home_screen(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *dest) +{ + MSG_SETAS_HIGH("Change Home Screen"); + + Eina_Bool ret = EINA_FALSE; + + ret = _photocam_image_save(photocam, rect, IVUG_HOME_SCREEN_TEMP_PATH, dest); + + if(ret == EINA_FALSE) + { + MSG_SETAS_ERROR("Create screen file failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +Eina_Bool +_ivug_setas_save_lock_screen(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *dest) +{ + MSG_SETAS_HIGH("Change Lock Screen"); + + Eina_Bool ret = EINA_FALSE; + + ret = _photocam_image_save(photocam, rect, IVUG_LOCK_SCREEN_TEMP_PATH, dest); + + if(ret == EINA_FALSE) + { + MSG_SETAS_ERROR( "Create screen file failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +Eina_Bool +_ivug_setas_save_homenlock_screen(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *home, const char *lock) +{ + MSG_SETAS_HIGH("Change Home&Lock Screen"); + +// Set homescreen image + Eina_Bool ret = EINA_FALSE; + + ret = _photocam_image_save(photocam, rect, IVUG_HOME_SCREEN_TEMP_PATH, home); + + if(ret == EINA_FALSE) + { + MSG_SETAS_ERROR( "Create screen file failed"); + return EINA_FALSE; + } + + if (ivug_remove_file(IVUG_LOCK_SCREEN_TEMP_PATH) == false) + { + MSG_SETAS_ERROR( "Detele file %s: failed", IVUG_LOCK_SCREEN_TEMP_PATH); + return EINA_FALSE; + } + +// Make a copy from home screen to lock screen + if( ecore_file_cp(home, IVUG_LOCK_SCREEN_TEMP_PATH) == EINA_FALSE) + { + MSG_SETAS_ERROR( "File copy failed"); + return EINA_FALSE; + } + + if(ivug_rename_file(IVUG_LOCK_SCREEN_TEMP_PATH, lock) == false) + { + MSG_SETAS_ERROR( "Rename file %s to %s failed", IVUG_LOCK_SCREEN_TEMP_PATH, lock ); + if(ivug_remove_file(IVUG_LOCK_SCREEN_TEMP_PATH)== false) + { + MSG_SETAS_ERROR( "delete tmp lock file failed %s", IVUG_LOCK_SCREEN_TEMP_PATH); + } + + return EINA_FALSE; + } + + sync(); //sync copied file. + + return EINA_TRUE; +} + + +#if 0 +static Eina_Bool +_ivug_setas_view_create_croped_image(Evas_Object *photocam, const char *save_file, + Evas_Coord_Rectangle rect, int width, int height, bool bFreeSize) +{ + IV_ASSERT(photocam != NULL); + IV_ASSERT(save_file != NULL); + + if(bFreeSize == true) + { + width = rect.w; + height = rect.h; + } + + if(width <= 0 || height <= 0) + { + MSG_SETAS_ERROR("input size parameter is invalid, w = %d, h = %d", width, height); + return EINA_FALSE; + } + + Evas_Object *ret_image = NULL; + + MSG_SETAS_HIGH("SCissorbox Rect:(%d,%d,%d,%d) Final=(%d,%d)", rect.x, rect.y, rect.w, rect.h, width, height); + + ret_image = ivug_image_region_image_get(photocam, rect.x, rect.y, rect.w, rect.h); + if(ret_image == NULL) + { + MSG_SETAS_ERROR("Region get faied."); + return EINA_FALSE; + } + + if (evas_object_image_save(ret_image, save_file, NULL, "quality=100 compress=9") == EINA_FALSE) + { + MSG_SETAS_ERROR("evas_object_image_save error. %s", save_file); + evas_object_del(ret_image); + return EINA_FALSE; + } + else + { + int fd = open(save_file, O_RDONLY); + if(fd < 0) + { + MSG_SETAS_ERROR("%s open error[%d]", save_file, fd); + evas_object_del(ret_image); + return EINA_FALSE; + } + fsync(fd); + int ret = close(fd); + if(ret < 0) + { + MSG_SETAS_ERROR("%s open error[%d]", save_file, ret); + } + } + + evas_object_del(ret_image); + + return EINA_TRUE; +} + + +static void +_ivug_setas_save_callerimage(Evas_Object *photocam, Evas_Coord_Rectangle *rect, char *filepath) +{ + MSG_SETAS_HIGH("Save CallerID"); + + char* save_file = SET_AS_CALL_ID_PATH; + + Evas_Coord_Rectangle box_rect; + + ivug_scissorbox_region_get(pSetAsView->select_box, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h)); + + Eina_Bool crop_sel_ret = _ivug_setas_view_create_croped_image(photocam, + save_file, box_rect, pSetAsView->box_width, pSetAsView->box_height, pSetAsView->bFreeSize); + if(crop_sel_ret == EINA_FALSE) + { + MSG_SETAS_ERROR( "Crop selector image failed!"); + } + + const char *lcd_file = SET_AS_CALL_ID_LCD_PATH; // ????? + + Eina_Bool crop_lcd_ret = EINA_FALSE; + + crop_lcd_ret = _ivug_setas_view_create_fit_image(pSetAsView->layout, pSetAsView->photocam, lcd_file); + if(crop_lcd_ret == EINA_FALSE) + { + MSG_SETAS_ERROR( "Crop lcd image failed!"); + } + + if(pSetAsView->Mode != IVUG_SETAS_NORMAL) + { + if ( crop_lcd_ret == EINA_TRUE && crop_sel_ret == EINA_TRUE ) + { + _ivug_setas_view_send_result(gGetUGHandle(), "crop_image_path", save_file, "image_path", lcd_file); + } + } +} +#endif + +Eina_Bool +_ivug_setas_save_cropimage(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *filepath) +{ + MSG_SETAS_HIGH("Save Cropped"); + + Eina_Bool ret = EINA_FALSE; + + ret = _photocam_image_save(photocam, rect, NULL, filepath); + + if(ret == EINA_FALSE) + { + MSG_SETAS_ERROR( "Create cropimage file failed"); + return EINA_FALSE; + } + + return EINA_TRUE; +} + + diff --git a/main/src/control/ivug-setas.h b/main/src/control/ivug-setas.h new file mode 100755 index 0000000..b57cef1 --- /dev/null +++ b/main/src/control/ivug-setas.h @@ -0,0 +1,42 @@ +/* + * Copyright 2012 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 __IVUG_SETAS_H__ +#define __IVUG_SETAS_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +Eina_Bool +_ivug_setas_save_home_screen(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *dest); + +Eina_Bool +_ivug_setas_save_lock_screen(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *dest); + +Eina_Bool +_ivug_setas_save_homenlock_screen(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *home, const char *lock); + +Eina_Bool +_ivug_setas_save_cropimage(Evas_Object *photocam, Evas_Coord_Rectangle *rect, const char *filepath); + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_SETAS_H__ + diff --git a/main/src/control/ivug-widget.c b/main/src/control/ivug-widget.c new file mode 100755 index 0000000..684cc1d --- /dev/null +++ b/main/src/control/ivug-widget.c @@ -0,0 +1,276 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-widget.h" + +#include + +#include + +static void _on_obj_deleted(void * data, Evas * e, Evas_Object * obj, void * event_info) +{ + char *szMsg = (char *)data; + IV_ASSERT(szMsg != NULL); + + MSG_IVUG_HIGH("On Object deleted. %s", szMsg); + + free(szMsg); +} + +void ivug_layout_attach_to_window(Evas_Object *parent, Evas_Object* layout) +{ +#ifdef USE_WIN_AS_PARENT + elm_win_resize_object_add(ug_get_window(), layout); +#else + Evas_Coord x, y, w, h; + evas_object_geometry_get(parent, &x, &y, &w, &h); + + evas_object_move(layout, x, y); + evas_object_resize(layout, w, h); +#endif +} + +void ivug_on_obj_deleted(Evas_Object* obj, const char *msg, const char *func, int line) +{ + static char buf[1024]; + + sprintf(buf, "%s(L%d):%s", func, line, msg); + + evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _on_obj_deleted, strdup(buf)); +} + +Evas_Object* ivug_bg_add(Evas_Object* parent, int r, int g, int b) +{ + IV_ASSERT(parent != NULL); + + Evas_Object *bg = elm_bg_add(parent); + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL); + +// elm_win_resize_object_add(parent, bg); + + elm_bg_color_set(bg, r, g, b); + + evas_object_show(bg); + + return bg; +} + +Evas_Object * +ivug_layout_add(Evas_Object *parent, const char *edj, const char *group) +{ + IV_ASSERT(parent != NULL); + + Evas_Object *layout; + + layout = elm_layout_add(parent); + + if ( layout == NULL ) + { + MSG_IVUG_ERROR("Cannot create layout"); + return NULL; + } + + if (elm_layout_file_set(layout, edj, group) == EINA_FALSE) + { + MSG_IVUG_ERROR("edj loading fail, filepath=%s Group=%s", edj, group); + evas_object_del(layout); + return NULL; + } + +/* + winÀÇ child¿¡ ´ëÇØ expand_set(EXPAND,EXPAND) ¸¦ ÇØÁÖÁö ¾ÊÀ¸¸é.. + + elm_win_resize_object_add() ³»ºÎ¿¡¼­, winÀÇ minWH, maxWH¸¦ ´Ù½Ã ±¸ÇÏ°Ô µÇ´Âµ¥, + + À̺κп¡¼­ max°ªÀ» minÀ¸·Î ÇÒ´ç Çعö¸®±â ¶§¹®¿¡ winÀÇ Å©±â°¡ minWHÀÇ Å©±â·Î °íÁ¤ µÇ¾î ¹ö¸°´Ù. + + ¹«Á¶°Ç EXPANDÇØÁÖ¾î¶ó.. elm_win°ú ¿¬°üÀÌ ÀÖ´Ù¸é .. +*/ + evas_object_size_hint_expand_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + ivug_layout_attach_to_window(parent, layout); + + return layout; +} + +Evas_Object* +ivug_default_layout_add( Evas_Object *win) +{ + IV_ASSERT(win != NULL); + + Evas_Object *layout; + layout = elm_layout_add(win); + + if ( layout == NULL ) + { + MSG_SETAS_ERROR("Cannot create layout"); + return NULL; + } + + Eina_Bool ret = EINA_FALSE; + + const char *profile = elm_config_profile_get(); + if (!strcmp(profile,"mobile")) + { + ret = elm_layout_theme_set(layout, "layout", "application", "default"); + MSG_IVUG_HIGH("layout/application/default"); + } + else if (!strcmp(profile,"desktop")) + { + ret = elm_layout_theme_set(layout, "layout", "application", "noindicator"); + MSG_IVUG_HIGH("layout/application/noindicator"); + } + + if (ret == EINA_FALSE) + { + MSG_IVUG_ERROR("theme set fail"); + evas_object_del(layout); + return NULL; + } + + evas_object_size_hint_expand_set( layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL ); + + evas_object_show(layout); + return layout; +} + +Evas_Object * +ivug_layout_add2(Evas_Object *parent, const char *edj, const char *group) +{ + IV_ASSERT(parent != NULL); + + Evas_Object *layout; + + layout = elm_layout_add(parent); + + if ( layout == NULL ) + { + MSG_IVUG_ERROR("Cannot create layout"); + return NULL; + } + + if (elm_layout_file_set(layout, edj, group) == EINA_FALSE) + { + MSG_IVUG_ERROR("edj loading fail, filepath=%s Group=%s", edj, group); + evas_object_del(layout); + return NULL; + } + + evas_object_size_hint_expand_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + + evas_object_show(layout); + return layout; +} + +Evas_Object *ivug_button_add(Evas_Object *parent, const char *style, const char *caption, Evas_Object *icon, Evas_Smart_Cb pFunc, const void * data ) +{ + IV_ASSERT(parent != NULL); + + Evas_Object *btn; + + btn = elm_button_add(parent); + if ( btn == NULL ) + { + return NULL; + } + + if ( style ) + elm_object_style_set(btn, style); + + if ( caption ) + elm_object_text_set(btn, caption); + + if ( icon ) + elm_object_part_content_set(btn, "icon", icon); + + elm_object_focus_allow_set(btn, EINA_FALSE); + evas_object_propagate_events_set(btn, EINA_FALSE); + + evas_object_smart_callback_add(btn, "clicked", pFunc, (void*)data); + + return btn; +} + +Evas_Object *ivug_icon_add(Evas_Object *parent, const char *edjname, const char *groupname) +{ + Evas_Object *icon; + + icon = elm_icon_add(parent); + + if ( elm_image_file_set(icon, edjname, groupname) == EINA_FALSE) + { + MSG_IVUG_ERROR("Cannot file set. EDJ=%s Group=%s", edjname, groupname); + evas_object_del(icon); + return NULL; + } + + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_image_resizable_set(icon, 1, 1); + evas_object_size_hint_expand_set(icon, 1, 1); + + return icon; +} + +Evas_Object *ivug_controlbar_add(Evas_Object *parent, const char *style) +{ + Evas_Object *toolbar = elm_toolbar_add(parent); + if (!toolbar) + { + MSG_IVUG_ERROR("tool bar failed"); + return NULL; + } + elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); + if(style) + elm_object_style_set(toolbar, style); + //elm_toolbar_homogeneous_set(toolbar, EINA_FALSE); + + return toolbar; +} + +Evas_Object *ivug_naviframe_add(Evas_Object *parent, const char *style) +{ + Evas_Object *navi_bar = elm_naviframe_add(parent); + if ( navi_bar == NULL) + { + MSG_IVUG_ERROR("elm_naviframe_add failed"); + return NULL; + } + + if(style) + { + elm_object_style_set(navi_bar, style); + } + else + { +#ifdef USE_CUSTOM_STYLE + elm_object_theme_set(navi_bar, gGetSystemTheme()); + elm_object_style_set(navi_bar, "ivug-main/default"); +#else + elm_object_style_set(navi_bar, "default"); +#endif + } + + evas_object_show(navi_bar); + + return navi_bar; +} + + diff --git a/main/src/control/ivug-widget.h b/main/src/control/ivug-widget.h new file mode 100755 index 0000000..21fbf3c --- /dev/null +++ b/main/src/control/ivug-widget.h @@ -0,0 +1,67 @@ +/* + * Copyright 2012 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 __IVUG_WIDGET_H__ +#define __IVUG_WIDGET_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +/* + Internal use only... use macro DELETE_LOG instead +*/ +void ivug_on_obj_deleted(Evas_Object* obj, const char *msg, const char *func, int line); + + +#define DELETE_NOTIFY(obj) \ + ivug_on_obj_deleted(obj, #obj, __func__, __LINE__) + +/* + Create elm_bg with color - r,g,b +*/ +Evas_Object * +ivug_bg_add(Evas_Object* parent, int r, int g, int b); + +Evas_Object * +ivug_layout_add(Evas_Object *win, const char *edjname, const char *groupname); + +Evas_Object * +ivug_layout_add2(Evas_Object *parent, const char *edj, const char *group); + +Evas_Object* +ivug_default_layout_add( Evas_Object *win); + +Evas_Object * +ivug_button_add(Evas_Object *parent, const char *style, const char *caption, Evas_Object *icon, Evas_Smart_Cb pFunc, const void *data ); + +Evas_Object * +ivug_icon_add(Evas_Object *parent, const char *edjname, const char *groupname); + +Evas_Object * +ivug_controlbar_add(Evas_Object *parent, const char *style); + +Evas_Object * +ivug_naviframe_add(Evas_Object *parent, const char *style); + + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_WIDGET_H__ + diff --git a/main/src/include/ivug-common.h b/main/src/include/ivug-common.h new file mode 100755 index 0000000..db8a00b --- /dev/null +++ b/main/src/include/ivug-common.h @@ -0,0 +1,94 @@ +/* + * Copyright 2012 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 __IVUG_COMMON_H__ +#define __IVUG_COMMON_H__ + +#include "ivug-define.h" +#include "ivug-datatypes.h" +#include "ivug-uuid.h" + +#include +#include + +#include "statistics.h" +#include "ivug-debug.h" +#include "ivug-string.h" +#include "ivug-util.h" +#include "ivug-define.h" +#include "ivug-config.h" +#include "ivug-widget.h" +#include "ivug-context.h" + +/* +Definition "PREFIX" is declared in CMakelist.txt + PREFIX is "/usr/ug" + PACKAGE is "ug-image-viewer-efl" + + Path name does not include trailing /. + + DATA_PATH is /opt/usr/ug/data +*/ + +#define LOCALE_PATH PREFIX"/res/locale" +#define IMAGE_PATH PREFIX"/res/images/"PACKAGE +#define EDJ_PATH PREFIX"/res/edje/"PACKAGE +#define DATA_PATH DATADIR"/"PACKAGE + +/* + Home screen and Lock screen image should be put in DATA_PATH. +*/ + + +#define USE_WIN_AS_PARENT + +#define NAVI_OPTION_BTN_STYLE "naviframe/title/default"//"multiline" + +#define WHITE_THEME + +#ifdef WHITE_THEME +#define IVUG_DEFAULT_BG_COLOR 249 +#else +#define IVUG_DEFAULT_BG_COLOR 48 +#endif + +#define USE_DEFAULT_DOWNLOADS_FOLDER + +#ifdef USE_DEFAULT_DOWNLOADS_FOLDER +#define DEFAULT_DOWNLOADS_FOLDER "/opt/usr/media/Downloads" +#endif + +#define PATH_SDCARD "/opt/storage/sdcard/" + +#define _EDJ(o) elm_layout_edje_get(o) + +#define IVUG_WEB_DOWNLOAD_TEMP_DIR DATA_PATH + +#define MENUBAR_TIMEOUT_SEC (5.0f) // 5sec + +/* + Final image path +*/ +#define IVUG_HOME_SCREEN_PATH DATA_PATH"/.homescreen.jpg"; +#define IVUG_LOCK_SCREEN_PATH DATA_PATH"/.lockscreen.jpg"; + +/* + Screen path for APPSVC +*/ +#define IVUG_APPSVC_HOME_SCREEN_PATH DATA_PATH"/.iv_homescreen.jpg"; + +#endif /* __IVUG_COMMON_H__ */ + diff --git a/main/src/include/ivug-crop-view.h b/main/src/include/ivug-crop-view.h new file mode 100755 index 0000000..a4a8fb6 --- /dev/null +++ b/main/src/include/ivug-crop-view.h @@ -0,0 +1,102 @@ +/* + * Copyright 2012 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 __IVUG_CROP_VIEW_H__ +#define __IVUG_CROP_VIEW_H__ + +#include "ivug-define.h" + + +typedef enum { + CROP_ERROR_TYPE_NONE, + CROP_ERROR_TYPE_UNKNOWN_FORMAT, + CROP_ERROR_TYPE_PERMISSION_DENIED, + CROP_ERROR_TYPE_INVALID_FILE, + CROP_ERROR_TYPE_GENERAL, +} Crop_Error; + +typedef struct { + Evas_Object *layout; + Evas_Object *notify; + + Evas_Object *photocam; + Evas_Object *cropbox; + + Evas_Object *gesture; + + Evas_Object *btn_back; + + Evas_Object *contents_area; + Evas_Object *notify_area; + Evas_Object *btn_ok; + + bool bShowMenu; + char *file_path; + char *result_path; + + char *dest_dir; + char *dest_name; + + int w; + int h; + + int prev_x; + int prev_y; + int prev_w; + int prev_h; + + Ecore_Timer *box_timer; + + int PrevRotate; +} IvugCropView; + +/* + signals + "loaded" with error code + "ok,clicked" - Button "OK" clicked with filepath + "cancel,clicked" - Button "Cancel" clicked + "destroyed" +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* this api is for trasition */ +void _ivug_crop_view_box_delete(IvugCropView *pCropView); + +IvugCropView *ivug_crop_view_create(Evas_Object *parent); + +bool ivug_crop_view_box_size_set(IvugCropView *pCropView, int w, int h); + +bool ivug_crop_view_box_ratio_fix(IvugCropView *pCropView, bool bFix); + +bool ivug_crop_view_file_set(IvugCropView *pCropView, const char *file); + +bool ivug_crop_view_destination_set(IvugCropView *pCropView, const char *dir, const char *name); + +void ivug_crop_view_destroy(IvugCropView *pCropView); + +Evas_Object *ivug_crop_view_get_object(IvugCropView *pCropView); + +void ivug_crop_view_create_menu(IvugCropView *pCropView, Evas_Object *navi_bar); + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_CROP_VIEW_H__ + diff --git a/main/src/include/ivug-details-view.h b/main/src/include/ivug-details-view.h new file mode 100755 index 0000000..9fd7e4a --- /dev/null +++ b/main/src/include/ivug-details-view.h @@ -0,0 +1,82 @@ +/* + * Copyright 2012 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 __DETAILS_VIEW_H__ +#define __DETAILS_VIEW_H__ + +#include +#include "ivug-datatypes.h" +#include "ivug-media.h" +#include "ivug-medialist.h" +#include "ivug-name-view.h" + +#include "ivug-detail-info.h" + +/* + "renamed" +*/ + +typedef struct { + Evas_Object *parent; + Evas_Object *bg; + + Evas_Object *layout; + Evas *evas; + Evas_Object *genlist; + +/* + |---------------| + | naviframe | + |---------------| + | | + | genlist | + | | + |---------------| +*/ + +/* Genlist class */ + Elm_Genlist_Item_Class itc; + Elm_Genlist_Item_Class title_itc; + Elm_Genlist_Item_Class multiline_icon_itc; + Elm_Genlist_Item_Class multiline_itc; + + char **filename; //for rename + char **path; //for rename + + Ivug_NameView *pNameView; + Media_Item *mitem; +} Ivug_DetailsView; + +#ifdef __cplusplus +extern "C" { +#endif + +Ivug_DetailsView *ivug_details_view_screen_create(Evas_Object *parent, Media_Item *mitem, ivug_view_by view_by); + +void ivug_details_view_destroy(Ivug_DetailsView *pDetailsView); + +Evas_Object *ivug_details_view_object_get(Ivug_DetailsView *pDetailsView); + +void ivug_details_view_update(Ivug_DetailsView *pDetailsView, const char *new_path); + +#ifdef __cplusplus +} +#endif + + +#endif // __DETAILS_VIEW_H__ + + diff --git a/main/src/include/ivug-main-view.h b/main/src/include/ivug-main-view.h new file mode 100755 index 0000000..1f4e06a --- /dev/null +++ b/main/src/include/ivug-main-view.h @@ -0,0 +1,145 @@ +/* + * Copyright 2012 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 __IVUG_MAIN_VIEWER_H__ +#define __IVUG_MAIN_VIEWER_H__ + +#include "ivug-common.h" +#include "ivug-parameter.h" +#include "ivug-medialist.h" + +#include "ivug-name-view.h" +#include "ivug-details-view.h" +#include "ivug-setas-view.h" +#include "ivug-crop-view.h" + + +#define MAX_CTRL_ITEM_CNT 5 +#define MAX_NAVI_ITEM_CNT 3 + +//navigation bar type +typedef enum { + NAVI_BAR_TYPE_NONE = 0x00, + NAVI_BAR_TYPE_EMPTY, // no control bar + NAVI_BAR_TYPE_IMAGE, // [Edit, Set, Info] default + NAVI_BAR_TYPE_FILE, // [Set, Info] default + NAVI_BAR_TYPE_VIDEO, // [Trim, Set, Info] default + NAVI_BAR_TYPE_SELECT, // [Ok, Cancel] from take photo +} ivug_toolbar; + +//control bar type +typedef enum { + CTRL_BAR_TYPE_NONE = 0x00, + CTRL_BAR_TYPE_EMPTY, // not exist ctrl bar + CTRL_BAR_TYPE_FILE, // [Delete,Share,Set,Info] file manager, video at gallery + CTRL_BAR_TYPE_READ_ONLY, // [Share, Set, Save, Info] + CTRL_BAR_TYPE_IMAGE, // [Delete,Share, Add tag, Slide show, Editor] from gallery + CTRL_BAR_TYPE_VIDEO, // [Delete,Share, Add tag, Slide show, Trim] from gallery +} ivug_ctrlbar; + +typedef enum { +// only shows in ctrlbar + TOOLBUTTON_DELETE, + TOOLBUTTON_SHARE, + TOOLBUTTON_ADDTAG, + TOOLBUTTON_SLIDESHOW, + TOOLBUTTON_SAVE, + +// shows in either toolbar or ctrlbar + TOOLBUTTON_EDIT, + TOOLBUTTON_SETAS, + TOOLBUTTON_DETAILS, + TOOLBUTTON_TRIM, + +// only shows in toolbar + TOOLBUTTON_OK, + TOOLBUTTON_CANCEL, + +// Navigation hearder + TOOLBUTTON_TOOL, + +// NULL button for spacing + TOOLBUTTON_NULL, + TOOLBUTTON_MAX, +} ToolButtonType; + +typedef enum { + TOOLBUTTON_IN_NONE, + TOOLBUTTON_IN_TOOLBAR, + TOOLBUTTON_IN_CTRLBAR, +} TooButtonPos; + +typedef struct { + Elm_Object_Item *item; // Control bar item in navigation header. ex) SetAs, Favorite, Info + TooButtonPos pos; +} ControlBar_Item; + + +typedef struct _SlideShow SlideShow; + +typedef struct _Ivug_MainView Ivug_MainView; + +#undef FIX_LAST_BLINK + +#ifdef __cplusplus +extern "C" { +#endif + +/* + Create MainView layout +*/ +Ivug_MainView * +ivug_main_view_create(Evas_Object* parent, ivug_mode mode, ivug_view_by view_by); + +Evas_Object * +ivug_main_view_object_get(Ivug_MainView *pMainView); + +void ivug_main_view_start(Ivug_MainView *pMainView); + +/* + Load media list from parameter. +*/ +bool ivug_main_view_set_list(Ivug_MainView *pMainView, ivug_parameter *ivug_param); + +/* + Start slide show. +*/ +void ivug_main_view_start_slideshow(Ivug_MainView *pMainView, Eina_Bool bSlideFirst); + +void ivug_main_view_resume(Ivug_MainView *pMainView); +void ivug_main_view_pause(Ivug_MainView *pMainView); + + +void ivug_main_view_destroy(Ivug_MainView *pMainView); + + +/* + Control GUI +*/ +void ivug_main_view_show_menu_bar(Ivug_MainView *pMainView); +void ivug_main_view_hide_menu_bar(Ivug_MainView *pMainView); + +void ivug_main_view_set_hide_timer(Ivug_MainView *pMainView); +void ivug_main_view_del_hide_timer(Ivug_MainView *pMainView); + +void _ivug_main_on_mmc_state_changed(keynode_t* node, void *data); + +#ifdef __cplusplus +} +#endif + +#endif //__IVUG_MAIN_VIEWER_H__ + diff --git a/main/src/include/ivug-name-view.h b/main/src/include/ivug-name-view.h new file mode 100755 index 0000000..2c780f1 --- /dev/null +++ b/main/src/include/ivug-name-view.h @@ -0,0 +1,83 @@ +/* + * Copyright 2012 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 __IVUG_NAME_VIEW_H__ +#define __IVUG_NAME_VIEW_H__ + +#include "ivug-common.h" +#include "ivug-media.h" + +typedef enum { + NAME_VIEW_RESPONSE_OK, + NAME_VIEW_RESPONSE_CANCEL, +} ivug_name_response; + +typedef void (*FNResponse)(ivug_name_response resp, const char *string, void *pClientData); + +typedef struct _Ivug_NameView +{ + Evas_Object *bg; + Evas_Object *layout; + Evas_Object *content; + + Evas_Object *navibar; + + Evas_Object *editfield; + Evas_Object *entry; + Evas_Object *btn_done; + + bool sip_show; + + FNResponse fnresponse; + void *clientdata; + +} Ivug_NameView; + +#ifdef __cplusplus +extern "C" { +#endif + +Ivug_NameView * +ivug_name_view_create(Evas_Object *parent, const char *title); + +void +ivug_name_view_set_title(Ivug_NameView *pNameView, const char *title); + +void +ivug_name_view_set_entry(Ivug_NameView *pNameView, const char *str); + +void +ivug_name_view_set_response_callback(Ivug_NameView *pNameView, FNResponse resp, void *data); + +void +ivug_name_view_destroy(Ivug_NameView *pNameView); + +Evas_Object * +ivug_name_view_object_get(Ivug_NameView *pNameView); + +void +ivug_name_view_set_focus(Ivug_NameView *pNameView); + +void +ivug_name_view_set_max_length(Ivug_NameView *pNameView, int max_len); + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_NAME_VIEW_H__ + + diff --git a/main/src/include/ivug-setas-view.h b/main/src/include/ivug-setas-view.h new file mode 100755 index 0000000..362508a --- /dev/null +++ b/main/src/include/ivug-setas-view.h @@ -0,0 +1,95 @@ +/* + * Copyright 2012 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 __IVUG_SETAS_VIEW_H__ +#define __IVUG_SETAS_VIEW_H__ + +#include "ivug-common.h" + +typedef enum { + NOTI_SUCCESS, + NOTI_FAIL, +} TEXT_POPUP_TYPE; + +typedef enum { + IVUG_CTRLBAR_SET_SCREEN_HOME, + IVUG_CTRLBAR_SET_SCREEN_LOCK, + IVUG_CTRLBAR_SET_SCREEN_BOTH, + IVUG_CTRLBAR_SET_SCREEN_UNDEFINED, // Show select popup when click ok button. + IVUG_CTRLBAR_SET_SCREEN_CALLERID, + IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID, + IVUG_CTRLBAR_SET_SCREEN_MAX +} ivug_set_screen_type; + +typedef enum { + IVUG_SETAS_NORMAL, // launched from mainview + IVUG_SETAS_UG, // ug mode + IVUG_SETAS_APPSVC, // appsvc mode + IVUG_SETAS_CROP // crop mode +} ivug_setas_mode; + +typedef enum { + SETAS_ERROR_TYPE_NONE, + SETAS_ERROR_TYPE_UNKNOWN_FORMAT, + SETAS_ERROR_TYPE_PERMISSION_DENIED, + SETAS_ERROR_TYPE_INVALID_FILE, + SETAS_ERROR_TYPE_GENERAL, +} SetAs_Error; + +typedef struct { + Evas_Object *ly_effect; // Layout for transition effect + + Evas_Object *content; // content + Evas_Object *genlist_popup; + + char *filename; + + ivug_setas_mode Mode; + ivug_set_screen_type Type; + + bool bInitFace; +} Ivug_SetAsView; + +#ifdef __cplusplus +extern "C" { +#endif + +Ivug_SetAsView * +ivug_setas_view_callerid_ug_create(Evas_Object *parent, const char* filepath, ivug_setas_mode mode, int output_width, int output_height); + +Ivug_SetAsView * +ivug_setas_view_video_call_id_ug_create(Evas_Object *parent, const char* filepath, ivug_setas_mode mode, int output_width, int output_height); + +void +ivug_setas_view_destroy(Ivug_SetAsView *pSetAsView); + +Evas_Object * +ivug_setas_view_object_get(Ivug_SetAsView *pSetAsView); + +// Called by main_view +Ivug_SetAsView * +ivug_setas_view_screen_create(Evas_Object *parent, ivug_setas_mode mode, ivug_set_screen_type screen_type); + +void ivug_setas_view_create_menu(Ivug_SetAsView *pSetAsView, Evas_Object *navi_bar, ivug_set_screen_type type); + +void ivug_setas_view_load_file(Ivug_SetAsView *pSetAsView, const char* filepath, ivug_set_screen_type type); + +#ifdef __cplusplus +} +#endif + + +#endif //__IVUG_SETAS_VIEW_H__ diff --git a/main/src/include/ivug-slider-item.h b/main/src/include/ivug-slider-item.h new file mode 100755 index 0000000..913786d --- /dev/null +++ b/main/src/include/ivug-slider-item.h @@ -0,0 +1,181 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +#include "ivug-common.h" +#include "ivug-medialist.h" +#include "ivug-slider.h" + + +typedef struct _Slide_Item Slide_Item; + +typedef void (*OnSliderStateChanged)(slide_state_t state, Slide_Item *si, void *client_data); + +typedef enum +{ + SITEM_TYPE_UNKNOWN, + SITEM_TYPE_IMAGE, + SITEM_TYPE_VIDEO, +} sitem_type_t; + +struct _Slide_Item { + int x, y, w, h; // Object geometry +//Data + slide_state_t state; + sitem_type_t type; + + Media_Item *mitem; + +//flag + Eina_Bool thumbnail_show; + +// UI + Evas_Object* layout; + Evas_Object* thumbnail; // thumbnail + + Evas_Object* vIcon; //video play icon + + Evas_Object* photocam; // photocam + + Evas_Object* progress; //progress bar for download. + +// Callback + bool bMenuVisible; + OnSliderStateChanged cb; + void *client_data; + + drm_handle_t drm_handle; +}; + +#ifdef __cplusplus +extern "C" { +#endif + +// GUI related +Slide_Item* +ivug_slider_item_add(Evas_Object *slider); + +void +ivug_slider_item_del(Slide_Item *si); + +// Geometry +void +ivug_slider_item_hide(Slide_Item *si); + +void +ivug_slider_item_show(Slide_Item *si); + +void +ivug_slider_item_move(Slide_Item *si, int x, int y); + +void +ivug_slider_item_resize(Slide_Item *si, int w, int h); + +void +ivug_slider_item_clip_set(Slide_Item *si, Evas_Object *clipper); + +void +ivug_slider_item_clip_unset(Slide_Item *si); + + +// Callback +bool +ivug_slider_item_set_callback(Slide_Item* si, OnSliderStateChanged cb, void *data); + + +// Data +const Media_Item * +ivug_slider_item_data_get(Slide_Item *si); + +/* + When item is NULL, Data is cleared +*/ +bool +ivug_slider_item_data_set(Slide_Item *si, Media_Item *item); + +bool +ivug_slider_item_icon_click_check(Slide_Item *si, int x, int y); + +drm_data_t * +ivug_slider_item_check_drm_constraint(Slide_Item *si); + + +// Item state +bool +ivug_slider_item_load(Slide_Item *si); + +void +ivug_slider_item_play(Slide_Item* si); + +void +ivug_slider_item_pause(Slide_Item* si); // --> Hide + +void +ivug_slider_item_resume(Slide_Item* si); // --> Show + +void +ivug_slider_item_stop(Slide_Item* si); + +void +ivug_slider_item_video_play(Slide_Item* si); + +void +ivug_slider_item_video_pause(Slide_Item* si); + + +// Control +bool +ivug_slider_item_region_size_get(Slide_Item *si, int *x, int *y, int *w, int *h); + +void +ivug_slider_item_hold_set(Slide_Item *si, Eina_Bool hold); // Ignore mouse event + +void +ivug_slider_item_zoom_reset(Slide_Item *si, Eina_Bool bAnim, int center_x, int center_y); + +void +ivug_slider_item_zoom_set(Slide_Item *si, double zoom, int center_x, int center_y); + +double +ivug_slider_item_zoom_get(Slide_Item* si); + + +bool +ivug_slider_item_image_rotate_set(Slide_Item *si, int angle); + + +void +ivug_slider_item_hide_menu(Slide_Item* si); + +void +ivug_slider_item_show_menu(Slide_Item* si); + +Evas_Object * +ivug_slider_item_image_get(Slide_Item* si); + +void +ivug_slider_item_image_size_get(Slide_Item* si, int *w, int *h); + +void ivug_slider_item_reload(Slide_Item* si); + + +#ifdef __cplusplus +} +#endif + + + diff --git a/main/src/include/ivug-slider.h b/main/src/include/ivug-slider.h new file mode 100755 index 0000000..92a1797 --- /dev/null +++ b/main/src/include/ivug-slider.h @@ -0,0 +1,166 @@ +/* + * Copyright 2012 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 __IVUG_SLIDER_H__ +#define __IVUG_SLIDER_H__ + +#include "ivug-define.h" + +#include +#include "ivug-medialist.h" +#include "ivug-drm-common.h" + +typedef enum { + SLIDE_STATE_NONE = 0x00, + SLIDE_STATE_SET, // Thumbnail is displayed. + + SLIDE_STATE_DOWNLOADING, // Web downloading. + SLIDE_STATE_DRM_CHECKING, // wait for drm popup + + SLIDE_STATE_READY, // Got original media + + SLIDE_STATE_LOADING, // Load main image or drm decryption. + SLIDE_STATE_LOADED, // Image is shown + +// Error state + SLIDE_STATE_DOWNLOAD_FAILED, // web download failed + SLIDE_STATE_NO_RIGHT, + SLIDE_STATE_ERROR, +} slide_state_t; + + +typedef enum { + SLIDE_TO_RIGHT = 0x00, + SLIDE_TO_LEFT, + SLIDE_INSTANTLY, +} slide_dir_t; + +typedef enum { + LONGTAP_ENDED, + LONGTAP_CANCELED, +} longtap_state; + +typedef enum { + CENTER_SLIDE, + NEXT_SLIDE, + PREV_SLIDE, + MAX_SLIDE, +} slide_index_t; + +/* + Slider signal list. + + "slider,clicked" : when click once + "slider,longpress,start" : when long press start on slider + "slider,longpress,end" : when long press end on slider + "slider,clicked,icon" : video icon clicked. + "slider,item,changed" : + + "slider,item,state,changed" + "slider,item,deleted" + + Object Configuration + + "conf-use-inline" : 1 for enable inline-play otherwise disabled + + +*/ + +typedef struct _Slide_Item Slide_Item; + +#ifdef __cplusplus +extern "C" { +#endif + +Evas_Object* +ivug_slider_add(Evas_Object* parent); + +void +ivug_slider_start(Evas_Object *obj); + +Eina_Bool +ivug_slider_set_medialist(Evas_Object* obj, Media_List *mList, Media_Item *current); + +void +ivug_slider_set_item(Evas_Object* obj, Media_Item *item, slide_dir_t dir); + +void +ivug_slider_set_item_to_slide(Evas_Object* obj, slide_index_t where, Media_Item *newItem); + +/* + Delete current media item +*/ +void +ivug_slider_delete_item(Evas_Object* obj); + +Slide_Item * +ivug_slider_get_sitem(Evas_Object* obj); + +Media_Item * +ivug_slider_get_item(Evas_Object* obj); + +slide_state_t +ivug_slider_get_state(Evas_Object* obj); + +/* + Go background - stop animation +*/ +void +ivug_slider_pause(Evas_Object* obj); + +/* + Go foreground - start animation +*/ +void +ivug_slider_resume(Evas_Object* obj); + +void +ivug_slider_skip(Evas_Object* obj); + +bool +ivug_slider_load(Evas_Object* obj); + +void +ivug_slider_dump_photocam(Evas_Object* obj); + +bool +ivug_slider_image_rotate(Evas_Object* obj, int angle); + +void +ivug_slider_set_menu_visibility(Evas_Object* obj, Eina_Bool bVisible); + +unsigned int +ivug_slider_zoom_level_get(Evas_Object *obj); + +void +ivug_slider_zoom_in(Evas_Object *obj); + +void +ivug_slider_zoom_out(Evas_Object *obj); + +void +ivug_slider_zoom_reset(Evas_Object *obj); + +bool +ivug_slider_reload(Evas_Object* obj); + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_SLIDER_H__ + diff --git a/main/src/include/ivug-slideshow-view.h b/main/src/include/ivug-slideshow-view.h new file mode 100755 index 0000000..caeca1e --- /dev/null +++ b/main/src/include/ivug-slideshow-view.h @@ -0,0 +1,84 @@ + + +/* + * Copyright 2012 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 __IVUG_SLIDESHOW_VIEWER_H__ +#define __IVUG_SLIDESHOW_VIEWER_H__ + +#include "ivug-parameter.h" +#include "ivug-medialist.h" + +#include "ivug-slideshow.h" + +typedef struct { + Evas_Object *parent; + + Evas_Object *layout; // Not visibile layout. + + ivug_view_by view_by; + +// List + Media_List *mList; + + Ecore_Event_Handler *keydown_handler; + Ecore_Idler *homekey_idler; + +// Slide show; + Media_Item *ss_curItem; + SlideShow *ssHandle; + + char *album_name; +} Ivug_SlideShowView; + + + +#ifdef __cplusplus +extern "C" { +#endif + + +Ivug_SlideShowView * +ivug_slideshow_view_create(Evas_Object* parent, ivug_mode mode, ivug_view_by view_by); + +Evas_Object * +ivug_slideshow_view_object_get(Ivug_SlideShowView *pSSView); + +bool +ivug_slideshow_view_set_list(Ivug_SlideShowView *pSSView, ivug_parameter *ivug_param); + +void +ivug_slideshow_view_start(Ivug_SlideShowView *pSSView); + +void +ivug_slideshow_view_resume(Ivug_SlideShowView *pSSView); + +void +ivug_slideshow_view_pause(Ivug_SlideShowView *pSSView); + +void +ivug_slideshow_view_destroy(Ivug_SlideShowView *pSSView); + +void +_ivug_slideshow_view_on_mmc_state_changed(keynode_t* node, void *data); + +#ifdef __cplusplus +} +#endif + + +#endif //__IVUG_SLIDESHOW_VIEWER_H__ + diff --git a/main/src/slider/ivug-slider-item.cpp b/main/src/slider/ivug-slider-item.cpp new file mode 100755 index 0000000..b03ea46 --- /dev/null +++ b/main/src/slider/ivug-slider-item.cpp @@ -0,0 +1,1223 @@ +/* + * Copyright 2012 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 "ivug-common.h" + +#include "EFLUtil.h" + +#include "ivug-slider-item.h" + +#include "ivug-image.h" + +#include "ivug-drm-common.h" + +#include "ivug-config.h" + +#define DEFAULT_THUMBNAIL_PATH IMAGE_PATH"/T01_Nocontents_broken.png" +#define DRM_NO_RIGHT_IMAGE_PATH IMAGE_PATH"/image_drm_no_rights.jpg" + +#define IVUG_SLIDER_EDJ EDJ_PATH"/ivug-slider.edj" + +#define USE_VIDEO_THUMBNAIL + + +/* + Determine whether LIL(Large image layer) loads or not. + + if define this feature, slider does not try to load image. only thumbnail is shown. +*/ +#undef DISABLE_LIL_LOADING + +/* + Use elm_icon istead of elm_image. elm_icon preserve image ratio. and seems more faster. +*/ + +static bool +_show_thumbnail( Slide_Item* si, const char *filepath) +{ + IV_ASSERT(si != NULL); + + if (si->thumbnail == NULL) + { + MSG_SITEM_FATAL("slide item or thumbnail object is NULL"); + return false; + } + + if ( filepath == NULL ) + { + MSG_SITEM_ERROR("thumbnail path is not exist"); + return false; + } + + MSG_SITEM_MED("Set thumbnail : %s", ivug_get_filename(filepath)); + + if (ivug_is_file_exist(filepath) == false ) + { + MSG_SITEM_ERROR("Cannot find thumbnail : %s", filepath); + filepath = DEFAULT_THUMBNAIL_PATH; + } + + if (elm_image_file_set(si->thumbnail, filepath, NULL) == EINA_FALSE) + { + MSG_SITEM_ERROR("Cannot load thumbnail : %s", filepath); + return false; + } + + int iw, ih; + + elm_image_object_size_get(si->thumbnail , &iw, &ih); + + evas_object_repeat_events_set(si->thumbnail, EINA_FALSE); + edje_object_signal_emit(_EDJ(si->layout), "elm,state,show_thumbnail", "slider"); + + MSG_SITEM_HIGH("Set thumbnail(%dx%d). %s", iw, ih, ivug_get_filename(filepath)); + +#ifdef _DEBUG + int bx, by, bw, bh; + evas_object_geometry_get(si->layout, &bx, &by, &bw, &bh); + + MSG_SITEM_MED("EDJE Geomtetry(%d,%d,%d,%d)", bx, by, bw, bh); +#endif + + return true; +} + +static bool +_hide_thumbnail(Slide_Item* si) +{ + IV_ASSERT(si != NULL); + + evas_object_repeat_events_set(si->thumbnail, EINA_TRUE); + + edje_object_signal_emit(_EDJ(si->layout), "elm,state,hide_thumbnail", "slider"); + + return true; +} + +static void _show_progressbar(Slide_Item *si) +{ + IV_ASSERT(si != NULL); + + if ( si->progress == NULL ) + { + //set progress + PERF_CHECK_BEGIN(LVL6, "set progress"); + + PERF_CHECK_BEGIN(LVL7, "elm_progressbar_add"); + si->progress = elm_progressbar_add(si->layout); + PERF_CHECK_END(LVL7, "elm_progressbar_add"); + + IV_ASSERT(si->progress != NULL); + + PERF_CHECK_BEGIN(LVL7, "set style"); + elm_object_style_set(si->progress, "list_process"); + PERF_CHECK_END(LVL7, "set style"); + + PERF_CHECK_BEGIN(LVL7, "set pulse"); + elm_progressbar_pulse(si->progress, EINA_FALSE); + PERF_CHECK_END(LVL7, "set pulse"); + + PERF_CHECK_BEGIN(LVL7, "swallow progress"); + elm_object_part_content_set(si->layout, "slider.progress", si->progress); + PERF_CHECK_END(LVL7, "swallow progress"); + + PERF_CHECK_END(LVL6, "set progress"); + } + + elm_progressbar_pulse(si->progress, EINA_TRUE); //start pulse. + + edje_object_signal_emit(_EDJ(si->layout), "elm,state,show,progress", "slider"); +} + +static void _hide_progressbar(Slide_Item *si) +{ + IV_ASSERT(si != NULL); + + if ( si->progress ) + { + elm_progressbar_pulse(si->progress, EINA_FALSE); //stop pulse. + } + edje_object_signal_emit(_EDJ(si->layout), "elm,state,hide,progress", "slider"); +} + + +static void _show_videoicon(Slide_Item *si) +{ + IV_ASSERT(si != NULL); + + edje_object_signal_emit(_EDJ(si->layout), "elm,state,show_icon", "slider"); // Hide video play icon +} + +static void _hide_videoicon(Slide_Item *si) +{ + IV_ASSERT(si != NULL); + + edje_object_signal_emit(_EDJ(si->layout), "elm,state,hide_icon", "slider"); // Hide video play icon + +// edje_object_signal_emit((si->layout), "elm,state,hide_icon", "slider"); // Hide video play icon +} + +static sitem_type_t _get_sitem_type(Media_Type mtype) +{ + switch(mtype) + { + case SLIDE_TYPE_IMAGE: + return SITEM_TYPE_IMAGE; + + case SLIDE_TYPE_VIDEO: + return SITEM_TYPE_VIDEO; + + case SLIDE_TYPE_NONE: + case SLIDE_TYPE_UNKNOWN: + default: + return SITEM_TYPE_UNKNOWN; + } + + return SITEM_TYPE_UNKNOWN; +} + +static char *_get_file_name(Slide_Item* si) +{ + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + + if ( mdata == NULL ) + { + return NULL; + } + + return ivug_get_filename(mdata->filepath); +} + + +static bool _set_mitem(Slide_Item* si, Media_Item *item) +{ + Media_Data *mdata = ivug_medialist_get_data(item); + IV_ASSERT(mdata != NULL); + + si->mitem = item; + + si->type = _get_sitem_type(mdata->slide_type); + + if ( si->type == SITEM_TYPE_IMAGE ) + { + _hide_videoicon(si); + elm_object_part_content_set(si->layout, "slider.contents", si->photocam); + } + else if ( si->type == SITEM_TYPE_VIDEO ) + { + _show_thumbnail(si, mdata->thumbnail_path); + elm_image_file_set(si->vIcon, EDJ_PATH"/ivug-icons.edj", "btn.video.play"); + _show_videoicon(si); + } + else + { + MSG_SITEM_WARN("Unknown type : %s", ivug_get_filename(mdata->filepath)); + _hide_videoicon(si); + } + + switch(mdata->slide_type) + { + case SLIDE_TYPE_IMAGE: + MSG_SITEM_HIGH("Set image. %s", ivug_get_filename(mdata->filepath)); + + if(mdata->bIsDRMContent == EINA_FALSE) + { + si->state = SLIDE_STATE_READY; + } + else + { + si->state = SLIDE_STATE_DRM_CHECKING; + } + break; + + case SLIDE_TYPE_VIDEO: + MSG_SITEM_HIGH("Set video. %s", ivug_get_filename(mdata->filepath)); + + si->state = SLIDE_STATE_READY; // Video dont need to load photocam + break; + + case SLIDE_TYPE_UNKNOWN: + MSG_SITEM_ERROR("Unknown image. %s", ivug_get_filename(mdata->filepath)); + + si->state = SLIDE_STATE_ERROR; + + break; + + default: + MSG_SITEM_ERROR("slide type invaild. Type=%d", mdata->slide_type); + si->state = SLIDE_STATE_ERROR; + return true; + break; + + } + + return true; +} + + +static bool _unset_mitem(Slide_Item* si) +{ +// Unswallow photocam + elm_object_part_content_unset(si->layout, "slider.contents"); + + switch(si->type) + { + case SITEM_TYPE_IMAGE: + evas_object_hide(si->photocam); + ivug_image_unset(si->photocam); //init photocam. + break; + case SITEM_TYPE_VIDEO: + break; + default: + break; + } + + si->state = SLIDE_STATE_NONE; + +// Resetting GUI + _hide_progressbar(si); + _hide_thumbnail(si); + _hide_videoicon(si); + + si->type = SITEM_TYPE_UNKNOWN; + si->mitem = NULL; + + MSG_SITEM_HIGH("Slider Item is cleared."); + + return true; +} + + + +inline +void _call_user_callback(Slide_Item* si) +{ + if ( si->cb ) + { + (si->cb)(si->state, si, si->client_data); + } +} + + +static void +_photocam_loaded_cb(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Slide_Item* si = static_cast(data); + +//hide progress. + _hide_progressbar(si); + + if ( si->mitem == NULL) + { + MSG_SITEM_ERROR("Debug Me! Data item is NULL."); + return; + } + + Media_Data* mdata = ivug_medialist_get_data(si->mitem); + if(mdata == NULL) + { + MSG_SITEM_ERROR("ivug_medialist_get_data failed."); + si->state = SLIDE_STATE_ERROR; + return; + } + + if ( si->state != SLIDE_STATE_LOADING ) + { + // can be STATE_ERROR, STATE_NO_RIGHT + MSG_SITEM_ERROR("Invalid slide state. %s", ivug_get_filename(mdata->filepath)); + MSG_SITEM_ERROR("state=%d %s (%d,%d,%d,%d)", si->state, mdata->filepath, si->x, si->y, si->w, si->h); + } + +#if 0 + typedef enum _Evas_Load_Error + { + EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */ + EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */ + EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */ + EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */ + EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */ + EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */ + EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */ + } Evas_Load_Error; /**< Load error you can get from loading of files - see evas_load_error_str() too */ +#endif + + Evas_Load_Error error = static_cast(reinterpret_cast(event_info)); +// Evas_Load_Error error = evas_object_image_load_error_get(ivug_image_internal_image_get(si->photocam)); + + if ( error != EVAS_LOAD_ERROR_NONE ) + { + MSG_SITEM_ERROR("Image loading failed. Error=%d File=%s", error, mdata->filepath); + si->state = SLIDE_STATE_ERROR; + + evas_object_hide(si->photocam); + + if ( error == EVAS_LOAD_ERROR_PERMISSION_DENIED) + { + _show_thumbnail(si, DRM_NO_RIGHT_IMAGE_PATH); + } + else + { + _show_thumbnail(si, DEFAULT_THUMBNAIL_PATH); + } + + _call_user_callback(si); + + return ; + } + + si->state = SLIDE_STATE_LOADED; + + int w, h; + + ivug_image_image_size_get(si->photocam, &w, &h); + + if (mdata->slide_type == SLIDE_TYPE_VIDEO) //if slide type is video, + { + MSG_SITEM_FATAL("slide type is video. thumbnail image "); + return; + } + + evas_object_show(obj); //photocam show. + + _call_user_callback(si); + + MSG_SITEM_HIGH("Photocam Pre-loaded. File=%s", ivug_get_filename(mdata->filepath)); +} + +static void _on_event_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + MSG_SITEM_HIGH("Event layer clicked : %s Layer=%d", evas_object_name_get(obj), evas_object_layer_get(obj)); +} + + +Slide_Item* +ivug_slider_item_add(Evas_Object *slider) +{ + Slide_Item* si = NULL; + + PERF_CHECK_BEGIN(LVL6, "init variable"); + + //create item + si = (Slide_Item*)calloc(1, sizeof (Slide_Item)); + + if ( si == NULL ) + { + MSG_SITEM_FATAL("Cannot allocated memory : %d.", sizeof (Slide_Item)); + return NULL; + } + + si->state = SLIDE_STATE_NONE; //set slide state + si->type = SITEM_TYPE_UNKNOWN; + + PERF_CHECK_END(LVL6, "init variable"); + +//Create the slider item layout + PERF_CHECK_BEGIN(LVL6, "create slider item layout"); + + Evas_Object *layout = EFL::create_layout(slider, IVUG_SLIDER_EDJ, "slider"); + if(layout == NULL) + { + MSG_SITEM_ERROR("Cannot load file : %s", IVUG_SLIDER_EDJ); + free(si); + return NULL; + } + + evas_object_name_set(layout, "Slider item edj"); + evas_object_event_callback_add(layout, EVAS_CALLBACK_MOUSE_DOWN, _on_event_mouse_down, NULL); + + si->layout = layout; + + PERF_CHECK_END(LVL6, "create slider item layout"); + +//set thumbnail. + PERF_CHECK_BEGIN(LVL6, "set thumbnail"); + + si->thumbnail = elm_icon_add(slider); + evas_object_name_set(si->thumbnail, "Thumbnail"); + elm_image_resizable_set(si->thumbnail, EINA_TRUE, EINA_TRUE); + elm_image_preload_disabled_set(si->thumbnail, EINA_FALSE); + + evas_object_event_callback_add(si->thumbnail, EVAS_CALLBACK_MOUSE_DOWN, _on_event_mouse_down, NULL); + + elm_object_part_content_set(si->layout, "slider.thumbnail", si->thumbnail); + + PERF_CHECK_END(LVL6, "set thumbnail"); + +//Add the photocam + PERF_CHECK_BEGIN(LVL6, "ivug_image_create"); + + si->photocam = ivug_image_create(si->layout); + evas_object_name_set(si->photocam, "photocam"); + evas_object_smart_callback_add(si->photocam, "loaded", _photocam_loaded_cb, si); + + PERF_CHECK_END(LVL6, "ivug_image_create"); + + PERF_CHECK_BEGIN(LVL6, "video icon"); + +// z-order be decided along added order + si->vIcon = elm_icon_add(slider); + elm_image_file_set(si->vIcon, EDJ_PATH"/ivug-icons.edj", "btn.video.play"); + + evas_object_name_set(si->vIcon, "video icon"); + evas_object_event_callback_add(si->vIcon, EVAS_CALLBACK_MOUSE_DOWN, _on_event_mouse_down, NULL); + + elm_object_part_content_set(si->layout, "slider.icon", si->vIcon); + PERF_CHECK_END(LVL6, "video icon"); + + si->bMenuVisible = true; // Default visibility is true + + evas_object_smart_member_add(si->layout, slider); + + int bx, by, bw, bh; + evas_object_geometry_get(si->layout, &bx, &by, &bw, &bh); + + MSG_SITEM_HIGH("Creating sitem(0x%08x): (%d,%d,%d,%d)", si, bx, by, bw, bh); + + return si; +} + + +void +ivug_slider_item_resize(Slide_Item* si, int w, int h) +{ + IV_ASSERT(si != NULL ); + + if ( si->w == w && si->h == h ) return; + MSG_SITEM_HIGH("SLIDER Resize to XYWH(%d,%d,%d,%d)", si->x, si->y, w, h ); + +// w,h is not Image's scale, but Object's scale + si->w = w; + si->h = h; + +// MSG_SITEM_HIGH("resize layout: %d, %d", si->w, si->h); + evas_object_resize(si->layout, si->w, si->h); + +} + + +void ivug_slider_item_move(Slide_Item* si, int x, int y) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_MED("SLIDER Move to XYWH(%d,%d,%d,%d)", x, y, si->w, si->h ); + + if ( si->x == x && si->y == y) return; + + //photocam + si->x = x; + si->y = y; + + if ( si->w == 0 || si->h == 0) return; + + evas_object_move(si->layout, x, y); + +// Center align +// evas_object_move(); +// si->vIcon + +} + +void ivug_slider_item_del(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Removing Slider Item"); + + ivug_slider_item_stop(si); + + si->mitem = NULL; // for error handling + + if (si->photocam) + { + evas_object_del(si->photocam); + si->photocam = NULL; + } + + if (si->thumbnail) + { + evas_object_del(si->thumbnail); + si->thumbnail = NULL; + } + + if (si->progress) + { + evas_object_del(si->progress); + si->progress = NULL; + } + + if(si->layout) + { + evas_object_del(si->layout); + si->layout = NULL; + } + + if ( si->vIcon ) + { + evas_object_del(si->vIcon); + si->vIcon = NULL; + } + + free(si); + + si = NULL; + + MSG_SITEM_HIGH("Removed Slider Item"); + +} + +void ivug_slider_item_hide(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Hide slide item"); + evas_object_hide(si->layout); +} + + +void ivug_slider_item_show(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Show slide item"); + evas_object_show(si->layout); +} + + +void +ivug_slider_item_clip_set(Slide_Item* si, Evas_Object *clipper) +{ + IV_ASSERT(si != NULL ); +// no need to check layout is NULL + int x, y, w, h; + + evas_object_geometry_get(clipper, &x, &y, &w, &h); + + MSG_SITEM_MED("SItem clip SET!! Geometry(%d,%d,%d,%d)", x, y, w, h); + + evas_object_clip_set(si->layout, clipper); +// evas_object_clip_set(si->photocam, clipper); +} + +void +ivug_slider_item_clip_unset(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); +// no need to check layout is NULL + evas_object_clip_unset(si->layout); +// evas_object_clip_unset(si->photocam); +} + +bool +ivug_slider_item_data_set(Slide_Item* si, Media_Item *item) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Data set. Item(0x%08x)", item); + + if ( item == NULL ) + { + if ( si->state == SLIDE_STATE_NONE ) + { + MSG_SITEM_WARN("Slide item is already cleared. just return. Mitem=0x%08x", si->mitem); + return true; + } + + MSG_SITEM_WARN("Set data NULL : %s", _get_file_name(si)); + _unset_mitem(si); + } + else + { + if ( si->state != SLIDE_STATE_NONE ) + { + MSG_SITEM_WARN("State is %d. Remove old : %s", si->state, _get_file_name(si)); + _unset_mitem(si); + } + + _set_mitem(si, item); + } + + return true; +} + + +#ifdef DISABLE_LIL_LOADING +Eina_Bool _signal_send_idler(void *data) +{ + Slide_Item *si = (Slide_Item *)data; + + _call_user_callback(si); + + return EINA_FALSE; +} +#endif + + +// Ready to Loading +bool +ivug_slider_item_load(Slide_Item *si) +{ + IV_ASSERT(si != NULL); + + if (si->state != SLIDE_STATE_READY) + { + MSG_SITEM_ERROR("Invalid state : %d", si->state); + return false; + } + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + IV_ASSERT(mdata != NULL); + + if(mdata->filepath == NULL) + { + MSG_SITEM_ERROR("file path is NULL"); + return false; + } + + MSG_SITEM_HIGH("Load file. %s", ivug_get_filename(mdata->filepath)); + + char path[IVUG_MAX_FILE_PATH_LEN] = {0,}; + + { + strncpy(path, mdata->filepath, sizeof(path)); + } + + +#ifdef DISABLE_LIL_LOADING + // For debugging + si->state = SLIDE_STATE_LOADED; + + ecore_idler_add(_signal_send_idler, si); + + return true; +#endif + + switch(mdata->slide_type) + { + case SLIDE_TYPE_IMAGE: + { + si->state = SLIDE_STATE_LOADING; + + if (ivug_image_file_set(si->photocam, path, NULL) != EVAS_LOAD_ERROR_NONE) + { + MSG_SITEM_ERROR("Failed photocam to set file file=%s", path); + si->state = SLIDE_STATE_ERROR; + + _show_thumbnail(si, DEFAULT_THUMBNAIL_PATH); + + _call_user_callback(si); + return false; + } + + return true; + + } + break; + case SLIDE_TYPE_VIDEO: + { + si->state = SLIDE_STATE_LOADED; + } + + break; + + default: + MSG_SITEM_ERROR("slide type invaild. Type=%d", mdata->slide_type); + return false; + break; + } + + return true; +} + +void ivug_slider_item_play(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + if(mdata == NULL) + { + MSG_SITEM_ERROR("current data is NULL"); + return; + } + + MSG_SITEM_HIGH("Start sitem. Type(%d) State(%d) %s", si->type, si->state, mdata->filepath); + + if ( si->state != SLIDE_STATE_LOADED ) + { + MSG_SITEM_ERROR("Play. but state is %d", si->state); + } + +// Start animation + if ( si->type == SITEM_TYPE_IMAGE ) + { + ivug_image_animated_set(si->photocam, EINA_TRUE); + } +} + +void ivug_slider_item_stop(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + if ( si->state != SLIDE_STATE_LOADED ) + { + // When very first/last image and invalid + return; + } + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + MSG_SITEM_HIGH("Stop sitem. %s", mdata->filepath); + + if (si->type == SITEM_TYPE_VIDEO) + { + ; + } + else if ( si->type == SITEM_TYPE_IMAGE ) + { + ivug_image_animated_set(si->photocam, EINA_FALSE); + } +} + + +void ivug_slider_item_pause(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + if ( si->state != SLIDE_STATE_LOADED ) + { + // When very first/last image and invalid + return; + } + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + MSG_SITEM_HIGH("Pause sitem. %s", mdata->filepath); + + if (si->type == SITEM_TYPE_VIDEO) + { + // Reset state. + } + else if ( si->type == SITEM_TYPE_IMAGE ) + { + ivug_image_animated_set(si->photocam, EINA_FALSE); + } +} + +void ivug_slider_item_resume(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + if ( si->state != SLIDE_STATE_LOADED ) + { + // When very first/last image and invalid + return; + } + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + MSG_SITEM_HIGH("Resume sitem. %s", mdata->filepath); + + if (si->type == SITEM_TYPE_IMAGE) + { + ivug_image_animated_set(si->photocam, EINA_TRUE); + } + else if (si->type == SITEM_TYPE_VIDEO) + { + } +} + +bool +ivug_slider_item_set_callback(Slide_Item* si, OnSliderStateChanged cb, void *data) +{ + IV_ASSERT(si != NULL ); + + si->cb = cb; + si->client_data = data; + + return true; +} + + +const Media_Item * +ivug_slider_item_data_get(Slide_Item *si) +{ + IV_ASSERT(si != NULL); + + return si->mitem; +} + +// Photocam +bool +ivug_slider_item_region_size_get(Slide_Item* si, int *x, int *y, int *w, int *h) +{ + IV_ASSERT(si != NULL ); + + if ( si->mitem == NULL) + { + MSG_SITEM_ERROR("Debug Me! Data item is NULL."); + return false; + } + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + + if ( mdata == NULL ) + { + MSG_SITEM_ERROR("slide type is NULL. Item=0x%08x", si); + return false; + } + + switch(si->type) + { + case SITEM_TYPE_IMAGE: + { + ivug_image_region_get(si->photocam, x, y, w, h); + } + break; + + case SITEM_TYPE_VIDEO: + { + { + return false; + } + } + break; + + case SITEM_TYPE_UNKNOWN: + return false; + break; + + default: + MSG_SITEM_ERROR("Unknwon type: %d", si->type); + return false; + break; + } + + return true; +} + + + +void +ivug_slider_item_hold_set(Slide_Item* si, Eina_Bool hold) +{ + IV_ASSERT(si != NULL ); + + switch(si->type) + { + case SITEM_TYPE_IMAGE: + { + ivug_image_hold_set(si->photocam, hold); + } + break; + + case SITEM_TYPE_VIDEO: + { + + } + break; + + case SITEM_TYPE_UNKNOWN: + default: + MSG_SITEM_ERROR("Unknwon type: %d", si->type); + break; + } + + +} + + +void +ivug_slider_item_zoom_reset(Slide_Item* si, Eina_Bool bAnim, int center_x, int center_y) +{ + IV_ASSERT(si != NULL ); + + switch(si->type) + { + case SITEM_TYPE_IMAGE: + { + Evas_Point pt; + + pt.x = center_x; + pt.y = center_y; + + ivug_image_zoom_reset(si->photocam, &pt); + } + break; + + case SITEM_TYPE_VIDEO: + { + + } + break; + + case SITEM_TYPE_UNKNOWN: + break; + + default: + MSG_SITEM_ERROR("Unknwon type: %d", si->type); + break; + + } + +} + + +void +ivug_slider_item_zoom_set(Slide_Item* si, double zoom, int center_x, int center_y) +{ + IV_ASSERT(si != NULL ); + + switch(si->type) + { + case SITEM_TYPE_IMAGE: + { + Evas_Point Center; + + Center.x = center_x; + Center.y = center_y; + ivug_image_zoom_set(si->photocam, zoom, &Center); + + } + break; + + case SITEM_TYPE_VIDEO: + break; + + case SITEM_TYPE_UNKNOWN: + break; + + default: + MSG_SITEM_ERROR("Unknwon type: %d", si->type); + break; + + } + +} + +double +ivug_slider_item_zoom_get(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + double ret = 1.0; + + switch(si->type) + { + case SITEM_TYPE_IMAGE: + { + ret = ivug_image_zoom_get(si->photocam); + } + break; + + case SITEM_TYPE_VIDEO: + break; + + case SITEM_TYPE_UNKNOWN: + break; + + default: + MSG_SITEM_ERROR("Unknwon type: %d", si->type); + break; + + } + + + return ret; +} + + +bool +ivug_slider_item_icon_click_check(Slide_Item *si, int x, int y) +{ + MSG_SITEM_HIGH("Check play icon clicked. SI=0x%08x, XY(%d,%d)", si, x, y); + + IV_ASSERT(si != NULL ); + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + + if ( mdata == NULL ) + { + MSG_SITEM_ERROR("Debug Me! Data item is NULL."); + return false; + } + + if ( mdata->slide_type == SLIDE_TYPE_VIDEO ) + { + if (si->vIcon) + { + Evas_Coord ix,iy,iw,ih; + + evas_object_geometry_get(si->vIcon, &ix, &iy, &iw, &ih); + + bool bInside = !( (x) > (ix + iw) || (x) < (ix) + || (y) > (iy + iw) || (y) < (iy) ); + + MSG_SITEM_HIGH("Item XYWH(%d,%d,%d,%d) XY(%d,%d) bInside=%d", ix,iy,iw,ih, x, y, bInside); + + return bInside; + } + } + + MSG_SITEM_HIGH("Slide type = %d", mdata->slide_type); + return false; +} + +drm_data_t * ivug_slider_item_check_drm_constraint(Slide_Item *si) +{ + IV_ASSERT(si != NULL); + + Media_Data *mdata = ivug_medialist_get_data(si->mitem); + if(mdata == NULL) + { + MSG_SLIDER_ERROR("mdata is NULL"); + return NULL; + } + + if(mdata->bIsDRMContent == EINA_FALSE) + { + MSG_SITEM_HIGH("It is not DRM file, path = %s", mdata->filepath); + return NULL; + } + + MSG_SITEM_HIGH("before check valid"); + if(ivug_drm_has_valid_ro(mdata->filepath) == 0) + { + MSG_SITEM_HIGH("RO is invalid, path = %s", mdata->filepath); + si->state = SLIDE_STATE_ERROR; + _show_thumbnail(si, DRM_NO_RIGHT_IMAGE_PATH); + evas_object_smart_callback_call(si->photocam, "loaded", (void *)EVAS_LOAD_ERROR_PERMISSION_DENIED); + //for lauch WAP purchase page + drm_data_t *result = (drm_data_t *)calloc(1, sizeof(drm_data_t)); + result->constraints = IVUG_DRM_RESULT_LIMITED; + result->data = -1; + return result; + } + MSG_SITEM_HIGH("RO is valid, path = %s", mdata->filepath); + + return ivug_drm_check_constraint(mdata->filepath); +} + + + +bool +ivug_slider_item_image_rotate_set(Slide_Item *si, int angle) +{ + IV_ASSERT(si != NULL); + + ivug_image_rotate_set(si->photocam, ( (ivug_image_rotate_get(si->photocam) - angle) % 360 )); + + return true; +} + + +// Video specific APIs + +void ivug_slider_item_video_play(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Start Video play"); + + if (si->type == SITEM_TYPE_VIDEO) + { + + } + +} + + +void ivug_slider_item_video_pause(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Pause Video play"); + + if (si->type == SITEM_TYPE_VIDEO) + { + + } +} + +void ivug_slider_item_hide_menu(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Hide menu"); + + si->bMenuVisible = false; + +// Item is video and state is playing then hide paused icon + if (si->type == SITEM_TYPE_VIDEO) + { + _hide_videoicon(si); + } + +} + + +void ivug_slider_item_show_menu(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + MSG_SITEM_HIGH("Show menu"); + + si->bMenuVisible = true; + +// Item is video and state is pause then show paused icon + if (si->type == SITEM_TYPE_VIDEO) + { + _show_videoicon(si); + } +} + +Evas_Object * +ivug_slider_item_image_get(Slide_Item* si) +{ + IV_ASSERT(si != NULL ); + + if ( (si->type == SITEM_TYPE_IMAGE) && (si->state == SLIDE_STATE_LOADED) ) + { + return ivug_image_internal_image_get(si->photocam); + } + + return NULL; + +} + + +void ivug_slider_item_image_size_get(Slide_Item* si, int *w, int *h) +{ + IV_ASSERT(si != NULL ); + + if ( (si->type == SITEM_TYPE_IMAGE) && (si->state == SLIDE_STATE_LOADED) ) + { + ivug_image_image_size_get(si->photocam, w, h); + } +} + +void ivug_slider_item_reload(Slide_Item* si) +{ + evas_object_del(si->photocam); + + si->photocam = ivug_image_create(si->layout); + evas_object_name_set(si->photocam, "photocam"); + evas_object_smart_callback_add(si->photocam, "loaded", _photocam_loaded_cb, si); + + elm_object_part_content_set(si->layout, "slider.contents", si->photocam); + + si->state = SLIDE_STATE_READY; + + ivug_slider_item_load(si); +} + diff --git a/main/src/slider/ivug-slider-mouse.cpp b/main/src/slider/ivug-slider-mouse.cpp new file mode 100755 index 0000000..69191fa --- /dev/null +++ b/main/src/slider/ivug-slider-mouse.cpp @@ -0,0 +1,928 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-slider-item.h" +#include "ivug-slider.h" + +#include "ivug-slider-priv.h" +#include "ECoreAnimator.h" + +#define LOGNTAP_THRESHOLD (100) // allow moving distance(pixel) + +#define LOG_LVL DBG_MSG_LVL_HIGH +#define LOG_CAT "IV-SMOUSE" + + +void +_ivug_slider_pass_event_to_item(struct Smart_Data *sd, Eina_Bool bPass) +{ + sd->bPassEvent = bPass; + + if ( bPass == EINA_TRUE) + { + MSG_SLIDER_MED("Photocam can get Event"); + } + else + { + MSG_SLIDER_MED("Photocam can not get Event"); + } + + for (int i = 0; i < MAX_SLIDE; i++) + { + ivug_slider_item_hold_set(sd->slide[i], !bPass); + } +} + + +bool _ivug_slider_is_visible(struct Smart_Data *sd, Slide_Item* si) +{ + if ( si->x + si->w < 0 ) + { + return false; + } + + if ( si->x > sd->x + sd->w ) + { + return false; + } + + return true; +} + +#define _ivug_slider_edge_state_get(si) __ivug_slider_edge_state_get(si, __func__, __LINE__) + +slide_edge_t __ivug_slider_edge_state_get(Slide_Item *si, const char *func, int line) +{ + int nx, ny, nw, nh; + + slide_edge_t result = EDGE::SLIDE_NO_EDGE; + + if ( ivug_slider_item_region_size_get(si, &nx, &ny, &nw, &nh) == false) + { + // false means video file item. in this case, no photocam exists. + MSG_MED("[%s:%4d] Slide fit. Thumbnail only", func, line); + result = EDGE::SLIDE_FIT; + + return result; + } + else + { + if ( nw <= (si->w + IMAGE_SCROLL_MARGIN) && (nh <= si->h + IMAGE_SCROLL_MARGIN)) + { + MSG_MED("[%20s:%4d] Slide fit", func, line); + result = EDGE::SLIDE_FIT; + } + else + { + if ( nx >= si->x - IMAGE_MOVE_MARGIN) + { + MSG_MED("[%20s:%4d] image edge left. N(%d,%d) Si(%d,%d)", func, line, nx, nw, si->x, si->w); + + result = (result | EDGE::SLIDE_LEFT_EDGE); + } + + if ( nx + nw <= si->x + si->w + IMAGE_MOVE_MARGIN) + { //edge right + MSG_MED("[%20s:%4d] image edge right. N(%d,%d) Si(%d,%d)", func, line, nx, nw, si->x, si->w); + result = (result | EDGE::SLIDE_RIGHT_EDGE); + } +#ifdef ENABLE_Y_SCR + if ( ny >= si->y ) + { + MSG_MED("[%20s:%4d] image edge top", func, line); + result = (result | EDGE::SLIDE_TOP_EDGE); + } + + if ( ny + nh <= si->y + si->h) + { //edge right + MSG_MED("[%20s:%4d] image edge bottom", func, line); + result = (result | EDGE::SLIDE_BOTTOM_EDGE); + } +#endif + } + } + + if ( result == EDGE::SLIDE_NO_EDGE ) + { + MSG_MED("[%20s:%4d] image over screen. Edge=%d N(%d,%d,%d,%d) Si(%d,%d,%d,%d)", func, line, result, nx, ny, nw, nh, si->x, si->y, si->w, si->h); + } + + return result; +} + +void _put_originate(struct Smart_Data *sd, shift_direction_t dir, int momentum) +{ + if ( dir == SLIDE_SHIFT_TO_LEFT ) + { + if ( sd->slide[PREV_SLIDE]->state == SLIDE_STATE_NONE ) + { + dir = SLIDE_SHIFT_NONE; + } + + MSG_MED("Prev slide state : %d", sd->slide[NEXT_SLIDE]->state); + } + + if ( dir == SLIDE_SHIFT_TO_RIGHT ) + { + if ( sd->slide[NEXT_SLIDE]->state == SLIDE_STATE_NONE ) + { + dir = SLIDE_SHIFT_NONE; + } + + MSG_MED("Next slide state : %d", sd->slide[NEXT_SLIDE]->state); + } + + int src_x, dst_x; + + switch(dir) + { + case SLIDE_SHIFT_TO_LEFT: + src_x = sd->slide[CENTER_SLIDE]->x; + dst_x = sd->x + sd->slide[CENTER_SLIDE]->w + IMAGE_BETWEEN_MARGIN; + + MSG_HIGH("Scroll --->. Move from %d, %d", src_x, dst_x); + + _ivug_slider_start_slide(sd, src_x, dst_x, momentum); + break; + + case SLIDE_SHIFT_TO_RIGHT: + src_x = sd->slide[CENTER_SLIDE]->x; + dst_x = sd->x -sd->slide[CENTER_SLIDE]->w - IMAGE_BETWEEN_MARGIN; + + MSG_HIGH("Scroll <---. Move from %d, %d", src_x, dst_x); + + _ivug_slider_start_slide(sd, src_x, dst_x, momentum); + break; + + case SLIDE_SHIFT_NONE: + src_x = sd->slide[CENTER_SLIDE]->x; + dst_x = sd->x; + + MSG_HIGH("Scroll to center. Move from %d, %d", src_x , dst_x); + + if (src_x == dst_x ) + { + MSG_WARN("No need to animation"); + return ; + } + // Defaut velocity + _ivug_slider_start_slide(sd, src_x, dst_x, ANIN_VELOCITY); + + break; + } + +} + +shift_direction_t _get_shift_direction(struct Smart_Data *sd) +{ +#define SHIFT_THRESHOLD (0.0f) + + Slide_Item* si = sd->slide[CENTER_SLIDE]; + + if ( abs( si->x - sd->x ) < 10 ) + { + MSG_HIGH("Shift None. si->x=%d sd->x=%d", si->x, sd->x); + return SLIDE_SHIFT_NONE; + } + + if ( (si->x - sd->x) > sd->w * SHIFT_THRESHOLD ) + { + // Scroll to ---> + MSG_HIGH("Shift ---->. si->x=%d sd->x=%d", si->x, sd->x); + return SLIDE_SHIFT_TO_LEFT; + } + else if ((si->x - sd->x) + si->w < sd->w * (1.0f - SHIFT_THRESHOLD) ) + { + // Scroll to <--- + MSG_HIGH("Shift <----. si->x=%d sd->x=%d", si->x, sd->x); + return SLIDE_SHIFT_TO_RIGHT; + } + + return SLIDE_SHIFT_NONE; + +} + + +Evas_Event_Flags _zoom_start(void *data, void *event_info) +{ + Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *) event_info; + MSG_LOW("zoom start <%d,%d> <%f>", p->x, p->y, p->zoom); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item* si = sd->slide[CENTER_SLIDE]; + + MSG_MED("%s MoveX=%d", __func__, si->x); + + sd->bZooming = false; + + if ( abs(si->x - sd->x) < IMAGE_MOVE_MARGIN) + { + _ivug_slider_slide_move(sd, 0, si->y); // Move to Center + _ivug_slider_pass_event_to_item(sd, EINA_TRUE); + sd->bZooming = true; + } + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _zoom_move(void *data, void *event_info) +{ + Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *) event_info; + MSG_LOW("zoom move <%d,%d> <%f>", p->x, p->y, p->zoom); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item* si = sd->slide[CENTER_SLIDE]; + + if ( sd->bZooming == false ) return EVAS_EVENT_FLAG_NONE; + + MSG_MED("%s MoveX=%d", __func__, si->x); + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _zoom_end(void *data, void *event_info) +{ + Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *) event_info; + MSG_LOW("zoom end <%d,%d> <%f>", p->x, p->y, p->zoom); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item* si = sd->slide[CENTER_SLIDE]; + + if ( sd->bZooming == false ) + { +// Flick image + shift_direction_t dir = _get_shift_direction(sd); + _put_originate(sd, dir, ANIN_VELOCITY); + + return EVAS_EVENT_FLAG_NONE; + } + + MSG_MED("%s. CenteSize WH(%d,%d)", __func__, si->w, si->h); // Si->w,h didnot change. after zoom + + sd->edge = _ivug_slider_edge_state_get(si); // Update Edge + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _zoom_abort(void *data, void *event_info) +{ + Elm_Gesture_Zoom_Info *p = (Elm_Gesture_Zoom_Info *) event_info; + MSG_LOW("zoom abort <%d,%d> <%f>", p->x, p->y, p->zoom); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item* si = sd->slide[CENTER_SLIDE]; + + if ( sd->bZooming == false ) + { +// Flick image + shift_direction_t dir = _get_shift_direction(sd); + _put_originate(sd, dir, ANIN_VELOCITY); + + return EVAS_EVENT_FLAG_NONE; + } + + MSG_MED("%s. CenteSize WH(%d,%d)", __func__, si->w, si->h); // Si->w,h didnot change. after zoom + + sd->edge = _ivug_slider_edge_state_get(si); // Update Edge + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _momentum_start(void *data, void *event_info) +{ + Elm_Gesture_Momentum_Info *p = (Elm_Gesture_Momentum_Info *) event_info; + MSG_MED("momentum_start <%d,%d>", p->x2, p->y2); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item* si = sd->slide[CENTER_SLIDE]; + +//save down position. + sd->prev_x = p->x2; + sd->prev_y = p->y2; + + sd->anim->Stop(); + +// Update Center!. + + sd->edge = _ivug_slider_edge_state_get(si); + + sd->bMomentumStarted = true; + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _momentum_move(void *data, void *event_info) +{ + Elm_Gesture_Momentum_Info *p = (Elm_Gesture_Momentum_Info *) event_info; + // _momentum_move is comming when pinch zoom + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + MSG_LOW("momentum move <%d,%d>, <%d,%d>, p->n=%d", p->x1, p->y1, p->x2, p->y2, p->n); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item* si = sd->slide[CENTER_SLIDE]; + + int dist_down_x = p->x2 - p->x1; + int dist_down_y = p->y2 - p->y1; + + if(sqrt(dist_down_x*dist_down_x + dist_down_y*dist_down_y) > LOGNTAP_THRESHOLD) + { + MSG_LOW("Long press cancel"); + sd->bLongtapEnable = false; + } + + if(sd->bLongtapEnable == true) + { + int longtap_dx = p->x2 - sd->longtap_prev_x; + int longtap_dy = p->y2 - sd->longtap_prev_y; + + if(sqrt(longtap_dx*longtap_dx + longtap_dy*longtap_dy) > LOGNTAP_THRESHOLD) + { + MSG_LOW("Long press cancel"); + evas_object_smart_callback_call(sd->obj, "slider,longpress,end", (void*)LONGTAP_ENDED); + } + } + +// MSG_MED("%s. XY(%d,%d)", __func__, cur->x, cur->y); + if ( sd->edge == EDGE::SLIDE_NO_EDGE ) + { + MSG_HIGH("Photocam handle this event"); + return EVAS_EVENT_FLAG_NONE; + } + + int dx, dy; + + dx = p->x2 - sd->prev_x; + dy = p->y2 - sd->prev_y; + + if ( dx == 0 ) return EVAS_EVENT_FLAG_NONE; + + sd->prev_x = p->x2; + sd->prev_y = p->y2; + + int dst_x, dst_y; + + dst_x = si->x + (dx); + dst_y = si->y + (dy); + + if ( sd->edge == EDGE::SLIDE_FIT) + { + MSG_MED("Case 1. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + _ivug_slider_pass_event_to_item(sd, EINA_FALSE); + + if ( dst_x >= 0 && sd->slide[PREV_SLIDE]->state == SLIDE_STATE_NONE) + { + MSG_HIGH("first file"); + dst_x = 0; + + // Update left shadow. + } + + if ( dst_x < 0 && sd->slide[NEXT_SLIDE]->state == SLIDE_STATE_NONE) + { + MSG_HIGH("last file"); + dst_x = 0; + } + + _ivug_slider_slide_move(sd, dst_x , si->y); + + return EVAS_EVENT_FLAG_NONE; + } + + if ( (si->x - sd->x) * (dst_x - sd->x) < 0 ) + { + MSG_MED("Case a. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + + dst_x = 0; + _ivug_slider_pass_event_to_item(sd, EINA_TRUE); + _ivug_slider_slide_move(sd, dst_x , si->y); + + return EVAS_EVENT_FLAG_NONE; + } + + if ( si->x != sd->x ) + { + MSG_MED("Case 2. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + + _ivug_slider_pass_event_to_item(sd, EINA_FALSE); + + if ( dst_x >= 0 && sd->slide[PREV_SLIDE]->state == SLIDE_STATE_NONE) + { + MSG_HIGH("first file"); + dst_x = 0; + } + + if ( dst_x < 0 && sd->slide[NEXT_SLIDE]->state == SLIDE_STATE_NONE) + { + MSG_HIGH("last file"); + dst_x = 0; + } + + _ivug_slider_slide_move(sd, dst_x , si->y); + + return EVAS_EVENT_FLAG_NONE; + } + + if ( sd->edge & EDGE::SLIDE_LEFT_EDGE) + { + if ( dx > 0 ) // Mouse --> + { + MSG_MED("Case 3. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + + _ivug_slider_pass_event_to_item(sd, EINA_FALSE); + + if ( dst_x >= 0 && sd->slide[PREV_SLIDE]->state == SLIDE_STATE_NONE) + { + MSG_HIGH("first file"); + dst_x = 0; + } + + _ivug_slider_slide_move(sd, dst_x , si->y); + + return EVAS_EVENT_FLAG_NONE; + } + else + { + MSG_MED("Case 4. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + + _ivug_slider_pass_event_to_item(sd, EINA_TRUE); + } + } + + if ( sd->edge & EDGE::SLIDE_RIGHT_EDGE) + { + if ( dx < 0 ) // Mouse <-- + { + MSG_MED("Case 5. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + + _ivug_slider_pass_event_to_item(sd, EINA_FALSE); + + if ( dst_x < 0 && sd->slide[NEXT_SLIDE]->state == SLIDE_STATE_NONE) + { + MSG_HIGH("last file"); + dst_x = 0; + } + + _ivug_slider_slide_move(sd, dst_x , si->y); + + return EVAS_EVENT_FLAG_NONE; + } + else + { + + MSG_MED("Case 6. edge=%d, X=%d dx=%d si->x=%d", sd->edge, dst_x, dx, si->x); + + _ivug_slider_pass_event_to_item(sd, EINA_TRUE); + + } + } + +#ifdef ENABLE_Y_SCR + + if ( sd->edge & EDGE::SLIDE_TOP_EDGE) + { + if ( dy > 0 ) // Mouse downward + { + MSG_MED("Case 7. edge=%d, Y=%d dy=%d si->y=%d", sd->edge, dst_y, dy, si->y); + + _ivug_slider_pass_event_to_item(sd, EINA_FALSE); + + return EVAS_EVENT_FLAG_NONE; + } + else + { + + MSG_MED("Case 8. edge=%d, Y=%d dy=%d si->y=%d", sd->edge, dst_y, dy, si->y); + + _ivug_slider_pass_event_to_item(sd, EINA_TRUE); + + } + } + + if ( sd->edge & EDGE::SLIDE_BOTTOM_EDGE) + { + if ( dy < 0 ) // Mouse downward. ^ + { + MSG_MED("Case 9. edge=%d, Y=%d dy=%d si->y=%d", sd->edge, dst_y, dy, si->y); + + _ivug_slider_pass_event_to_item(sd, EINA_FALSE); + + return EVAS_EVENT_FLAG_NONE; + } + else + { + + MSG_MED("Case 10. edge=%d, Y=%d dy=%d si->y=%d", sd->edge, dst_y, dy, si->y); + + _ivug_slider_pass_event_to_item(sd, EINA_TRUE); + + } + } +#endif + + sd->edge = _ivug_slider_edge_state_get(si); + return EVAS_EVENT_FLAG_NONE; + +} + +Evas_Event_Flags _momentum_end(void *data, void *event_info) +{ + Elm_Gesture_Momentum_Info *p = (Elm_Gesture_Momentum_Info *) event_info; + + //if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + MSG_MED("momentum end Cur=<%d,%d> M=<%d,%d>", p->x2, p->y2, p->mx, p->my); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + MSG_MED("Mouse Up : si->XYWH(%d,%d,%d,%d)", si->x, si->y, si->w, si->h); + +// Find Scroll Direction + sd->edge = _ivug_slider_edge_state_get(si); + + shift_direction_t dir = SLIDE_SHIFT_NONE; + + bool isFlick = abs(p->mx) < 1500 ? false : true; + + if ( isFlick == true ) + { +// momentumÀÌ 0ÀÌ ¾Æ´Ñ °æ¿ì(flick animation Áß°£¿¡ ´Ù½Ã click½Ã) center¸¦ ¾÷µ¥ÀÌÆ® Çؾߵdzª? ±×·¸°Ô ÇÏ¸é ºÎµå·¯¿ö Áúµí.. Çѵ¥.. ÀÏ´Ü pass + MSG_HIGH("Velocity = %d Momentum=%d", sd->momentum, p->mx); + + sd->momentum += p->mx; + + if ( (sd->edge & EDGE::SLIDE_LEFT_EDGE) && p->mx > 0) + { + // Flick + if ( p->mx + (si->x - sd->x) > sd->w ) + { + // Flick right + dir = SLIDE_SHIFT_TO_LEFT; + + MSG_HIGH("Flick Right ----------->"); + + if ( sd->slide[PREV_SLIDE]->state == SLIDE_STATE_NONE ) + { + dir = SLIDE_SHIFT_NONE; + sd->momentum = 0; + } + + MSG_MED("Prev slide state : %d", sd->slide[NEXT_SLIDE]->state); + } + } + + if ( (sd->edge & EDGE::SLIDE_RIGHT_EDGE) && p->mx < 0) + { + // Flick + if ( p->mx + ((si->x - sd->x) + si->w ) < 0 ) + { + // Flick left + dir = SLIDE_SHIFT_TO_RIGHT; + MSG_HIGH("Flick Left <-----------"); + + if ( sd->slide[NEXT_SLIDE]->state == SLIDE_STATE_NONE ) + { + dir = SLIDE_SHIFT_NONE; + sd->momentum = 0; + } + + MSG_MED("Next slide state : %d", sd->slide[NEXT_SLIDE]->state); + } + } + + MSG_MED("Velocity2 = %d", sd->momentum); + _put_originate(sd, dir, sd->momentum); + + } + else + { + MSG_MED("Si->x=%d", si->x); + + dir = _get_shift_direction(sd); + _put_originate(sd, dir, ANIN_VELOCITY); + + } + + sd->bLongtapEnable = true; + + sd->bMomentumStarted = false; + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _momentum_abort(void *data, void *event_info) +{ + Elm_Gesture_Momentum_Info *p = (Elm_Gesture_Momentum_Info *) event_info; + + MSG_MED("momentum abort Cur=<%d,%d> M=<%d,%d> N=%d", p->x2, p->y2, p->mx, p->my, p->n); + + //if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + MSG_MED("Mouse Up : si->XYWH(%d,%d,%d,%d)", si->x, si->y, si->w, si->h); + +// Find Scroll Direction + sd->edge = _ivug_slider_edge_state_get(si); + + shift_direction_t dir = SLIDE_SHIFT_NONE; + + bool isFlick = abs(p->mx) < 1500 ? false : true; + + if ( isFlick == true ) + { + if ( (sd->edge & EDGE::SLIDE_LEFT_EDGE) && p->mx > 0) + { + // Flick + if ( p->mx + ((si->x - sd->x) ) > sd->w ) + { + // Flick right + MSG_MED("Flick Right"); + dir = SLIDE_SHIFT_TO_LEFT; + } + } + + if ( (sd->edge & EDGE::SLIDE_RIGHT_EDGE) && p->mx < 0) + { + // Flick + if ( p->mx + ((si->x - sd->x) + si->w ) < 0 ) + { + // Flick left + MSG_MED("Flick Left"); + dir = SLIDE_SHIFT_TO_RIGHT; + } + } + } + else + { + MSG_MED("Si->x=%d", si->x); + dir = _get_shift_direction(sd); + } + + _put_originate(sd, dir, ANIN_VELOCITY); + + sd->bLongtapEnable = true; + + sd->bMomentumStarted = false; + + return EVAS_EVENT_FLAG_NONE; +} + + + +Evas_Event_Flags _flick_start(void *data, void *event_info) +{ + Elm_Gesture_Line_Info *p = (Elm_Gesture_Line_Info *) event_info; + + MSG_LOW("flick started x1,x2=(%d,%d) tx=%u mx=%d n=%u", + p->momentum.x1, p->momentum.x2, p->momentum.tx, + p->momentum.mx, p->momentum.n); + + return EVAS_EVENT_FLAG_NONE; +} + + +Evas_Event_Flags _flick_move(void *data, void *event_info) +{ + Elm_Gesture_Line_Info *p = (Elm_Gesture_Line_Info *) event_info; + + MSG_LOW("flick moving x1,x2=(%d,%d) tx=%u mx=%d n=%u", + p->momentum.x1, p->momentum.x2, p->momentum.tx, + p->momentum.mx, p->momentum.n); + + return EVAS_EVENT_FLAG_NONE; + +} + + +Evas_Event_Flags _flick_end(void *data, void *event_info) +{ + Elm_Gesture_Line_Info *p = (Elm_Gesture_Line_Info *) event_info; + + MSG_LOW("flick ended x1,x2=(%d,%d) tx=%u mx=%d n=%u", + p->momentum.x1, p->momentum.x2, p->momentum.tx, + p->momentum.mx, p->momentum.n); + return EVAS_EVENT_FLAG_NONE; +} + + +Evas_Event_Flags _flick_abort(void *data, void *event_info) +{ + Elm_Gesture_Line_Info *p = (Elm_Gesture_Line_Info *) event_info; + + MSG_LOW("flick aborted x1,x2=(%d,%d) tx=%u mx=%d n=%u", + p->momentum.x1, p->momentum.x2, p->momentum.tx, + p->momentum.mx, p->momentum.n); + return EVAS_EVENT_FLAG_NONE; +} + + + +Evas_Event_Flags _dbl_click_start(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Double click start"); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _dbl_click_end(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Double click end"); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags _dbl_click_abort(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Double click abort"); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags n_finger_tap_start(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Finger tab start. Time=%d", p->timestamp); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + return EVAS_EVENT_FLAG_NONE; +} + + +Evas_Event_Flags n_finger_tap_end(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Finger tab end. Time=%d", p->timestamp); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + if ( ivug_slider_item_icon_click_check(si, p->x, p->y ) == true ) + { + evas_object_smart_callback_call(sd->obj, "slider,clicked,icon", si); // Clicked video icon + } + else + { + evas_object_smart_callback_call(sd->obj, "slider,clicked", si); + } + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags n_finger_tap_abort(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Finger tab aborted. Time=%d", p->timestamp); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + return EVAS_EVENT_FLAG_NONE; +} + + +Evas_Event_Flags n_long_tap_start(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Long tab start, x=%d, y=%d", p->x, p->y); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + sd->longtap_count = 0; + + return EVAS_EVENT_FLAG_NONE; + +} + +Evas_Event_Flags n_long_tap_move(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Long tab move"); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + if(sd->longtap_count != 0) + { + return EVAS_EVENT_FLAG_NONE; + } + sd->longtap_count = 1; + + if(sd->bLongtapEnable == false) + { + MSG_HIGH("It is not long tap case"); + return EVAS_EVENT_FLAG_NONE; + } + + if(sd->bMomentumStarted == true) // compare down and longpressed position + { + sd->longtap_prev_x = p->x; + sd->longtap_prev_y = p->y; + + int longtap_dx = sd->prev_x - sd->longtap_prev_x; + int longtap_dy = sd->prev_y - sd->longtap_prev_y; + + if(sqrt(longtap_dx*longtap_dx + longtap_dy*longtap_dy) > LOGNTAP_THRESHOLD) + { + MSG_HIGH("It is not long tap"); + return EVAS_EVENT_FLAG_NONE; + } + } + + evas_object_smart_callback_call(sd->obj, "slider,longpress,start", p); + + return EVAS_EVENT_FLAG_NONE; +} + +Evas_Event_Flags n_long_tap_end(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Long tab end"); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + MSG_MED("Long press end"); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + MSG_ASSERT(sd != NULL); + + evas_object_smart_callback_call(sd->obj, "slider,longpress,end", (void*)LONGTAP_ENDED); + + return EVAS_EVENT_FLAG_NONE; + +} + +Evas_Event_Flags n_long_tap_abort(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_MED("Long tab abort"); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + return EVAS_EVENT_FLAG_NONE; + +} + + diff --git a/main/src/slider/ivug-slider-priv.h b/main/src/slider/ivug-slider-priv.h new file mode 100755 index 0000000..c39aafc --- /dev/null +++ b/main/src/slider/ivug-slider-priv.h @@ -0,0 +1,195 @@ +/* + * Copyright 2012 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 __IVUG_SLIDER_PRIV_H__ +#define __IVUG_SLIDER_PRIV_H__ + +#include "ivug-define.h" +#include "ivug-medialist.h" + +/*********************************************************************/ +/* Configuration */ +/*********************************************************************/ + +/* elm_config_finger_size_get = 40 */ +#define IMAGE_BETWEEN_MARGIN (30) // The value is width between photocam(unit is pixel). +#define IMAGE_MOVE_MARGIN ((int)IMAGE_BETWEEN_MARGIN*0.8) +/* If moved width is larger than IMAGE_SCROLL_MARGIN, image is scrolled */ +#define IMAGE_SCROLL_MARGIN (5) /* vertical move doen't over 5 pixel width */ +#define LONG_PRESS_MARGIN ((int)(elm_config_finger_size_get() / 3)) + + +#define ANIN_VELOCITY (5000) + +#undef ENABLE_Y_SCR + +typedef int slide_edge_t; + +namespace EDGE { + const int SLIDE_NO_EDGE = (1<<0); // 1 + + const int SLIDE_LEFT_EDGE = (1<<1); // 2 + const int SLIDE_RIGHT_EDGE = (1<<2); // 4 + +#ifdef ENABLE_Y_SCR + const int SLIDE_TOP_EDGE = (1<<3); // 8 + const int SLIDE_BOTTOM_EDGE = (1<<4); // 16 +#endif + + const int SLIDE_FIT = SLIDE_LEFT_EDGE | SLIDE_RIGHT_EDGE +#ifdef ENABLE_Y_SCR + | SLIDE_TOP_EDGE | SLIDE_BOTTOM_EDGE +#endif + ; +}; + +typedef enum { + SLIDE_SHIFT_NONE = 0x00, + SLIDE_SHIFT_TO_RIGHT, // <---------------------Mouse + SLIDE_SHIFT_TO_LEFT, // Mouse---------------------> +} shift_direction_t; + +class ECoreAnimator; +class CAnimator; + +#undef USE_CALC_JOB + +// slider +typedef struct Smart_Data +{ + Evas_Object *obj; // smart object itself. + Evas_Coord x, y, w, h; // Geometry of slider + + Evas_Object *clipper; + +//silde + Slide_Item* slide[MAX_SLIDE]; + +//data list + Eina_Bool bShow; + + Media_List* media_list; // Storing entire media list. + +// for flick anim + CAnimator *tween; + ECoreAnimator *anim; + + shift_direction_t last_dir; + int momentum; + +//Mouse event handler + Evas_Object *event_obj; // Mouse event receiver. + Evas_Object *gesture; + + bool bPassEvent; + bool bZooming; + + int prev_x; + int prev_y; + + bool bLongtapEnable; + bool bMomentumStarted; + + int longtap_count; + int longtap_prev_x; + int longtap_prev_y; + + slide_edge_t edge; + + Ecore_Idler *load_idler; + Ecore_Idler *item_load_idler; + + unsigned int zoom_level; + +#ifdef USE_CALC_JOB + Ecore_Job *calc_job; +#endif + + +} _Smart_Data; + + +#ifdef __cplusplus +extern "C" { +#endif + + + +// Common function between slide show and slider. + +void _ivug_slider_slide_move(struct Smart_Data *sd, Evas_Coord x, Evas_Coord y); + +// Common function between slide and slide mouse. + +void _ivug_slider_start_slide(struct Smart_Data *sd, int src_x, int dst_x, int momentum); + +void _ivug_slider_slide_shift(struct Smart_Data *sd, shift_direction_t direction); + +Evas_Event_Flags _zoom_start(void *data, void *event_info); + +Evas_Event_Flags _zoom_move(void *data, void *event_info); + +Evas_Event_Flags _zoom_end(void *data, void *event_info); + +Evas_Event_Flags _zoom_abort(void *data, void *event_info); + +Evas_Event_Flags _momentum_start(void *data, void *event_info); + +Evas_Event_Flags _momentum_move(void *data, void *event_info); + +Evas_Event_Flags _momentum_end(void *data, void *event_info); + +Evas_Event_Flags _momentum_abort(void *data, void *event_info); + +Evas_Event_Flags _dbl_click_start(void *data , void *event_info); + +Evas_Event_Flags _dbl_click_end(void *data , void *event_info); + +Evas_Event_Flags _dbl_click_abort(void *data , void *event_info); + +Evas_Event_Flags _flick_start(void *data, void *event_info); + +Evas_Event_Flags _flick_move(void *data, void *event_info); + +Evas_Event_Flags _flick_end(void *data, void *event_info); + +Evas_Event_Flags _flick_abort(void *data, void *event_info); + +Evas_Event_Flags n_finger_tap_start(void *data , void *event_info); + +Evas_Event_Flags n_finger_tap_end(void *data , void *event_info); + +Evas_Event_Flags n_finger_tap_abort(void *data , void *event_info); + +Evas_Event_Flags n_long_tap_start(void *data , void *event_info); + +Evas_Event_Flags n_long_tap_move(void *data , void *event_info); + +Evas_Event_Flags n_long_tap_end(void *data , void *event_info); + +Evas_Event_Flags n_long_tap_abort(void *data , void *event_info); + +void _put_originate(struct Smart_Data *sd, shift_direction_t dir, int momentum); + + +#ifdef __cplusplus +} +#endif + + + +#endif // __IVUG_SLIDER_PRIV_H__ + diff --git a/main/src/slider/ivug-slider.cpp b/main/src/slider/ivug-slider.cpp new file mode 100755 index 0000000..c737184 --- /dev/null +++ b/main/src/slider/ivug-slider.cpp @@ -0,0 +1,1397 @@ +/* + * Copyright 2012 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 // ug_destroy_me, ug_send_result + +#include "ivug-slider.h" +#include "ivug-common.h" + +#include "ivug-parameter.h" +#include "ivug-define.h" +#include "ivug-config.h" + +#include "ivug-util.h" +#include "ivug-medialist.h" +#include "ivug-media.h" + +#include "ivug-drm-common.h" +#include "ivug-mouse-event.h" +#include "ivug-slider-item.h" + +#include "ivug-slider-priv.h" + + +#include "ivug-image.h" + +#include "Animation.h" +#include "ECoreAnimator.h" +#include "ivug-slideshow.h" +#include "EFLUtil.h" + +#define LOG_CAT "IV-SLIDER" + +/* local subsystem globals */ +static Evas_Smart *_smart_ = NULL; + +#define USE_CLIPPER + +// Forward declaration +void _ivug_slider_slide_resize(struct Smart_Data *sd, Evas_Coord w, Evas_Coord h); +void _ivug_slider_slide_move(struct Smart_Data *sd, Evas_Coord x, Evas_Coord y); + +const char *_GetStateString(slide_state_t state) +{ + static const char *szState[] = + { + "None", + "Set", + "Downloading", + "DRM Checking", + "Ready", + "Loading", + "Loaded", + "Download Failed", + "No Right", + "Error", + }; + + return szState[state]; +} + +static Eina_Bool _idler_loading_func(void* data) +{ + struct Smart_Data *sd = static_cast(data); + + sd->load_idler = NULL; + MSG_SLIDER_MED("Do idle loading."); + + int i; + if ( sd->slide[CENTER_SLIDE]->state == SLIDE_STATE_READY ) // Center image must be loaded even while other image is loading. + { + MSG_SLIDER_MED("Idler. Load center item"); + ivug_slider_item_load(sd->slide[CENTER_SLIDE]); + goto end; + } + + for ( i = 0; i < MAX_SLIDE ; i++) + { + if ( sd->slide[i]->state == SLIDE_STATE_LOADING ) + { + goto end; + } + } + + if ( sd->slide[NEXT_SLIDE]->state == SLIDE_STATE_READY ) + { + MSG_SLIDER_MED("Idler. Load next item"); + ivug_slider_item_load(sd->slide[NEXT_SLIDE]); + goto end; + } + + if ( sd->slide[PREV_SLIDE]->state == SLIDE_STATE_READY ) + { + MSG_SLIDER_MED("Idler. Load prev item"); + ivug_slider_item_load(sd->slide[PREV_SLIDE]); + goto end; + } + + MSG_SLIDER_WARN("Idler. Nothing to do."); +end: + MSG_SLIDER_HIGH("Set Data loading State=%s,%s,%s", + _GetStateString(sd->slide[PREV_SLIDE]->state), + _GetStateString(sd->slide[CENTER_SLIDE]->state), + _GetStateString(sd->slide[NEXT_SLIDE]->state) + ); + + return ECORE_CALLBACK_CANCEL; + +} + +#define _do_load(sd) _do_load_dbg(sd, __func__, __LINE__) + +static void _do_load_dbg(struct Smart_Data *sd, const char *file, int line) +{ + if ( sd->load_idler ) + { + ecore_idler_del(sd->load_idler); + sd->load_idler = NULL; + } + + MSG_SLIDER_HIGH("Add idler for loading. from %s(%d)", file, line); + sd->load_idler = ecore_idler_add(_idler_loading_func, sd); +} + +static void _ivug_slider_on_center_changed(Evas_Object *obj, Slide_Item *old, Slide_Item *cur) +{ + IV_ASSERT(old != cur ); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + if ( old != NULL ) + { + ivug_slider_item_zoom_reset(old, EINA_FALSE, 0, 0); + ivug_slider_item_stop(old); // Stop DRM consume/Animation + } + + if(cur->state == SLIDE_STATE_LOADED) + { + ivug_slider_item_play(cur); + } + else + { + MSG_SLIDER_ERROR("Center changed. but Invalid state : %s", _GetStateString(cur->state)); + } + + Media_Item *mitem = NULL; + + mitem = cur->mitem; + + if ( mitem != NULL ) + { + Media_Data *pData = ivug_medialist_get_data(mitem); + + MSG_SLIDER_HIGH("Center item changed. %s State=%s", ivug_get_filename(pData->filepath), _GetStateString(cur->state)); + } + else + { + MSG_SLIDER_WARN("Center item changed. but Center item is NULL."); + } + + evas_object_smart_callback_call(sd->obj, "slider,item,changed", cur); +} + +void _ivug_slider_item_state_changed(slide_state_t state, Slide_Item *si, void *client_data) +{ + struct Smart_Data *sd = static_cast(client_data); + IV_ASSERT(sd != NULL); + + if ( sd->slide[CENTER_SLIDE] == si ) + { + MSG_SLIDER_HIGH("Center Item state changed. Old=%s New=%s", _GetStateString(state), _GetStateString(si->state)); + + if ( state == SLIDE_STATE_LOADED ) + { + ivug_slider_item_play(si); + evas_object_smart_callback_call(sd->obj, "slider,item,state,changed", si); + } + else if (state == SLIDE_STATE_DOWNLOAD_FAILED) + { + evas_object_smart_callback_call(sd->obj, "slider,item,state,changed", si); + } + else + { + evas_object_smart_callback_call(sd->obj, "slider,item,state,changed", si); + } + } + + _do_load(sd); + +} + +static void _on_event_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + MSG_SLIDER_HIGH("Event layer clicked : %s Layer=%d", evas_object_name_get(obj), evas_object_layer_get(obj)); +} + + +static void _on_event_mouse_wheel(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Wheel *Info = (Evas_Event_Mouse_Wheel *)event_info; + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + +#if 0 +struct _Evas_Event_Mouse_Wheel /** Wheel event */ +{ + int direction; /* 0 = default up/down wheel FIXME: more wheel types */ + int z; /* ...,-2,-1 = down, 1,2,... = up */ + + Evas_Point output; /**< The X/Y location of the cursor */ + Evas_Coord_Point canvas; /**< The X/Y location of the cursor */ + + void *data; + Evas_Modifier *modifiers; /**< modifier keys pressed during the event */ + Evas_Lock *locks; + unsigned int timestamp; + Evas_Event_Flags event_flags; + Evas_Device *dev; +}; +#endif +/* +W/IV-SLIDER( 2557): 0:00:18.005[F:ivug-slider.cpp L: 322][HIGH] Mouse Wheel. Dir=0 Z=1 Event=0 --> Wheel downward --> View Next +W/IV-SLIDER( 2557): 0:00:18.292[F:ivug-slider.cpp L: 322][HIGH] Mouse Wheel. Dir=0 Z=-1 Event=0 --> Wheel upward --> View Prev +*/ + + if ( Info->z == 1 ) + { + _put_originate(sd, SLIDE_SHIFT_TO_RIGHT, ANIN_VELOCITY); + } + else if ( Info->z == -1) + { + _put_originate(sd, SLIDE_SHIFT_TO_LEFT, ANIN_VELOCITY); + } + + + MSG_SLIDER_MED("Mouse Wheel. Dir=%d Z=%d Event=%d", Info->direction, Info->z, Info->event_flags); +} + + + +static Eina_Bool _item_loader_idler(void* data) +{ + IV_ASSERT(data != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get((Evas_Object *)data); + + sd->item_load_idler = NULL; + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + MSG_SLIDER_MED("Center Image load again"); + si->state = SLIDE_STATE_READY; + + ivug_slider_item_load(si); + + return ECORE_CALLBACK_CANCEL; +} + +static void _sizing_eval(void *data) +{ + struct Smart_Data *sd = (struct Smart_Data *)data; + +#ifdef USE_CALC_JOB + sd->calc_job = NULL; +#endif + + MSG_SLIDER_MED("Object geometry resized. (%d,%d,%d,%d)", sd->x, sd->y , sd->w , sd->h); + +#ifdef USE_CLIPPER + evas_object_move(sd->clipper, sd->x, sd->y); + evas_object_resize(sd->clipper, sd->w, sd->h); +#endif + + evas_object_move(sd->event_obj, sd->x, sd->y); + evas_object_resize(sd->event_obj, sd->w, sd->h); + + evas_object_smart_changed(sd->obj); +} + +static void +_ivug_slider_smart_add(Evas_Object *obj) +{ + MSG_SLIDER_MED("Slider Add : 0x%08x", obj); + + PERF_CHECK_BEGIN(LVL4, "slider smart add"); + + PERF_CHECK_BEGIN(LVL5, "initialize memory"); + + struct Smart_Data *sd = (struct Smart_Data *)calloc(1, sizeof(struct Smart_Data)); + IV_ASSERT(sd != NULL); + + evas_object_smart_data_set(obj, sd); + + sd->obj = obj; + sd->momentum = 0; + + sd->anim = new ECoreAnimator(); + + sd->edge = EDGE::SLIDE_FIT; + sd->last_dir = SLIDE_SHIFT_TO_RIGHT; /* default for first loading*/ + sd->bPassEvent = false; + sd->bLongtapEnable = true; + + evas_object_data_set(obj, "conf-use-inline", (void *)0); + + PERF_CHECK_END(LVL5, "initialize memory"); + + + //create slider item. + for (int idx = 0; idx < MAX_SLIDE; idx++) + { + PERF_CHECK_BEGIN(LVL5, "add slider item"); + sd->slide[idx] = ivug_slider_item_add(obj); + + ivug_slider_item_set_callback(sd->slide[idx], _ivug_slider_item_state_changed, sd); + + PERF_CHECK_END(LVL5, "add slider item"); + } + + PERF_CHECK_BEGIN(LVL5, "create child objects"); + + sd->event_obj = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_name_set(sd->event_obj, "slider-event"); + evas_object_color_set(sd->event_obj , 0, 0, 0, 0); // Fully Transparent object. + evas_object_size_hint_align_set(sd->event_obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_weight_set(sd->event_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_repeat_events_set(sd->event_obj, EINA_TRUE); + evas_object_show(sd->event_obj); + + evas_object_smart_member_add(sd->event_obj, obj); + + sd->gesture = elm_gesture_layer_add(sd->event_obj); + elm_gesture_layer_hold_events_set(sd->gesture, EINA_FALSE); + + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_START, _zoom_start, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_MOVE, _zoom_move, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_END, _zoom_end, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_ABORT, _zoom_abort, obj); + + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_START, _momentum_start, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_MOVE, _momentum_move, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_END, _momentum_end, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_ABORT, _momentum_abort, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_START, _flick_start, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_END, _flick_move, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_END, _flick_end, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_ABORT, _flick_abort, obj); + + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_DOUBLE_TAPS, ELM_GESTURE_STATE_START, _dbl_click_start, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_DOUBLE_TAPS, ELM_GESTURE_STATE_END, _dbl_click_end, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_DOUBLE_TAPS, ELM_GESTURE_STATE_ABORT, _dbl_click_abort, obj); + + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_START, n_finger_tap_start, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_END, n_finger_tap_end, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_ABORT, n_finger_tap_abort, obj); + + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_LONG_TAPS, ELM_GESTURE_STATE_START, n_long_tap_start, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_LONG_TAPS, ELM_GESTURE_STATE_MOVE, n_long_tap_move, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_LONG_TAPS, ELM_GESTURE_STATE_END, n_long_tap_end, obj); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_LONG_TAPS, ELM_GESTURE_STATE_ABORT, n_long_tap_abort, obj); + + if ( elm_gesture_layer_attach(sd->gesture, sd->event_obj) == EINA_FALSE) + { + MSG_SLIDER_ERROR("Cannot attach event rect"); + } + evas_object_name_set(sd->gesture, "Slider:Getsture"); + + evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_event_mouse_down, NULL); + evas_object_event_callback_add(sd->event_obj, EVAS_CALLBACK_MOUSE_DOWN, _on_event_mouse_down, NULL); + + evas_object_event_callback_add(sd->event_obj, EVAS_CALLBACK_MOUSE_WHEEL, _on_event_mouse_wheel, obj); + + sd->bLongtapEnable = true; + +#if 0 + for (int idx = 0; idx < MAX_SLIDE; idx++) + { + // Video iconÀÌ event¸¦ ¸ÕÀú ¹Þ°Ô Çϱâ À§ÇØ z orderÀ» º¯°æ ÇÑ´Ù. + evas_object_stack_above(sd->slide[idx]->vIcon, sd->event_obj); + } +#endif + + +#ifdef USE_CLIPPER + sd->clipper = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_color_set(sd->clipper, 255,255,255,255); + evas_object_smart_member_add(sd->clipper, obj); + evas_object_name_set(sd->clipper, "slider-clipper"); + + MSG_SLIDER_MED("Create clipper(0x%08x)", sd->clipper); + + evas_object_show(sd->clipper); +#endif + + PERF_CHECK_END(LVL5, "create child objects"); + + PERF_CHECK_END(LVL4, "slider smart add"); + + return; + +} + +static void +_ivug_slider_smart_del(Evas_Object *obj) +{ + MSG_SLIDER_MED("Slider delete. obj=0x%08x", obj); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + ivug_ret_if(!sd); + + if ( sd->tween) delete sd->tween; + sd->tween = NULL; + + if ( sd->anim) delete sd->anim; + sd->anim = NULL; + + if ( sd->item_load_idler ) + { + ecore_idler_del(sd->item_load_idler); + sd->item_load_idler = NULL; + } + + if ( sd->load_idler ) + { + ecore_idler_del(sd->load_idler); + sd->load_idler = NULL; + } + +#ifdef USE_CALC_JOB + if ( sd->calc_job ) ecore_job_del(sd->calc_job); + sd->calc_job = NULL; +#endif + + if ( sd->event_obj ) + { + evas_object_event_callback_del_full(sd->event_obj, EVAS_CALLBACK_MOUSE_WHEEL, _on_event_mouse_wheel, obj); + + evas_object_del(sd->event_obj); + sd->event_obj = NULL; + } + + if ( sd->gesture ) + { + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_ZOOM, ELM_GESTURE_STATE_ABORT, NULL, NULL); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_MOMENTUM, ELM_GESTURE_STATE_ABORT, NULL, NULL); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_FLICKS, ELM_GESTURE_STATE_ABORT, NULL, NULL); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_DOUBLE_TAPS, ELM_GESTURE_STATE_ABORT, NULL, NULL); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_ABORT, NULL, NULL); + elm_gesture_layer_cb_set(sd->gesture, ELM_GESTURE_N_LONG_TAPS, ELM_GESTURE_STATE_ABORT, NULL, NULL); + + evas_object_del(sd->gesture); + sd->gesture = NULL; + } + + for (int i = 0; i < MAX_SLIDE ; i++) //delete layout + { + ivug_slider_item_del(sd->slide[i]); + sd->slide[i] = NULL; + } + + +#ifdef USE_CLIPPER + if ( sd->clipper ) + { + evas_object_del(sd->clipper); + sd->clipper = NULL; + } +#endif + + + free(sd); + +} + + +static void +_ivug_slider_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) +{ + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + MSG_ASSERT(sd != NULL); + + if ((sd->x == x) && (sd->y == y)) return; + + MSG_SLIDER_MED("Slider Move : XY(%d,%d,%d,%d)", x, y, sd->w, sd->h); + + sd->x = x; + sd->y = y; + +#ifdef USE_CALC_JOB + if ( sd->calc_job ) ecore_job_del(sd->calc_job); + sd->calc_job = NULL; + + sd->calc_job = ecore_job_add(_sizing_eval, sd); +#else + _sizing_eval(sd); +#endif + +} + +static void +_ivug_slider_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) +{ + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + MSG_ASSERT(sd != NULL); + + if ((sd->w == w) && (sd->h == h)) return; + + MSG_SLIDER_MED("Slider Resize : XY(%d,%d,%d,%d)", sd->x, sd->y , w, h); + + + sd->w = w; + sd->h = h; + +#ifdef USE_CALC_JOB + if ( sd->calc_job ) ecore_job_del(sd->calc_job); + sd->calc_job = NULL; + + sd->calc_job = ecore_job_add(_sizing_eval, sd); +#else + _sizing_eval(sd); +#endif + +} + +static void +_ivug_slider_smart_show(Evas_Object *obj) +{ + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + MSG_ASSERT(sd != NULL); + + if ( sd->bShow == EINA_TRUE) return; + + sd->bShow = EINA_TRUE; + + MSG_SLIDER_MED("Slider Show"); + + ivug_slider_item_show(sd->slide[CENTER_SLIDE]); + ivug_slider_item_show(sd->slide[NEXT_SLIDE]); + ivug_slider_item_show(sd->slide[PREV_SLIDE]); + + evas_object_show(sd->event_obj); + +} + +static void +_ivug_slider_smart_hide(Evas_Object *obj) +{ + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + MSG_ASSERT(sd != NULL); + + if ( sd->bShow == EINA_FALSE) return; + + sd->bShow = EINA_FALSE; + + MSG_SLIDER_MED("Slider Hide"); + + ivug_slider_item_hide(sd->slide[CENTER_SLIDE]); + ivug_slider_item_hide(sd->slide[NEXT_SLIDE]); + ivug_slider_item_hide(sd->slide[PREV_SLIDE]); + + evas_object_hide(sd->event_obj); +} + +static void +_ivug_slider_smart_clip_set(Evas_Object *obj, Evas_Object * clip) +{ + int x, y, w, h; + evas_object_geometry_get(clip, &x, &y, &w, &h); + MSG_SLIDER_MED("Slider Clip set : Clipper=0x%08x (%d,%d,%d,%d)", clip, x, y, w, h); + +#ifdef USE_CLIPPER + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + for (int i = 0; i < MAX_SLIDE; i++) + { //set resize + ivug_slider_item_clip_set(sd->slide[i], sd->clipper); + } + + evas_object_clip_set(sd->event_obj, sd->clipper); +#endif + +} + +static void +_ivug_slider_smart_clip_unset(Evas_Object *obj) +{ + MSG_SLIDER_MED("Slider Clip unset"); + +#ifdef USE_CLIPPER + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + for (int i = 0; i < MAX_SLIDE; i++) + { //set resize + ivug_slider_item_clip_unset(sd->slide[i]); + } + + evas_object_clip_unset(sd->event_obj); +#endif + +} + +static void +_ivug_slider_smart_calculate(Evas_Object *obj) +{ + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + if ((sd->w == 0) || (sd->h == 0)) return; + + MSG_SLIDER_MED("Slider Calculate : XYWH(%d,%d, %d,%d)", sd->x, sd->y, sd->w, sd->h); + + sd->anim->Stop(); + + if ( sd->tween ) delete sd->tween; + sd->tween = NULL; + + _ivug_slider_slide_resize(sd, sd->w, sd->h); + _ivug_slider_slide_move(sd, sd->x, sd->y); +} + +// Smart Object +static void +_ivug_slider_smart_init(void) +{ + if (_smart_) return; + + { + PERF_CHECK_BEGIN(LVL3, "ivug_slider_smart_init"); + + const char* name = eina_stringshare_add("ivug-slider"); + MSG_SLIDER_MED("name=%s", name); + static Evas_Smart_Class sc = + { + NULL, + EVAS_SMART_CLASS_VERSION, + _ivug_slider_smart_add, + _ivug_slider_smart_del, + _ivug_slider_smart_move, + _ivug_slider_smart_resize, + _ivug_slider_smart_show, + _ivug_slider_smart_hide, + NULL, + _ivug_slider_smart_clip_set, + _ivug_slider_smart_clip_unset, + _ivug_slider_smart_calculate, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL + }; //Evas_smart_Class + sc.name = name; + _smart_ = evas_smart_class_new(&sc); + + PERF_CHECK_END(LVL3, "ivug_slider_smart_init"); + } +} + + +/******* slide UI function *******/ + +void +_ivug_slider_slide_move(struct Smart_Data *sd, Evas_Coord x, Evas_Coord y) +{ + IV_ASSERT(sd != NULL); + + MSG_SLIDER_LOW("Slider move. XY(%d,%d)", x, y); +#if 0 + int nOffset = 100; // For debugging + x += nOffset; +#endif + ivug_slider_item_move(sd->slide[CENTER_SLIDE], x, y); + + ivug_slider_item_move(sd->slide[PREV_SLIDE], x - sd->slide[PREV_SLIDE]->w - IMAGE_BETWEEN_MARGIN , y); + ivug_slider_item_move(sd->slide[NEXT_SLIDE], x + sd->slide[CENTER_SLIDE]->w + IMAGE_BETWEEN_MARGIN , y); +} + +void +_ivug_slider_slide_resize(struct Smart_Data *sd, Evas_Coord w, Evas_Coord h) +{ + IV_ASSERT(sd != NULL); + + ivug_slider_item_resize(sd->slide[CENTER_SLIDE], sd->w, sd->h); + ivug_slider_item_resize(sd->slide[PREV_SLIDE], sd->w, sd->h); + ivug_slider_item_resize(sd->slide[NEXT_SLIDE], sd->w, sd->h); +} + + +static void _ivug_slider_on_tween(double value, void *data) +{ + struct Smart_Data *sd = (struct Smart_Data *)data; + + _ivug_slider_slide_move(sd, value, sd->y); +} + +static void _ivug_slider_on_moment(double value, void *data) +{ + struct Smart_Data *sd = (struct Smart_Data *)data; + + sd->momentum = value; +} + +static bool _ivug_slider_on_ecore_animator(double value, void *pData) +{ + struct Smart_Data *sd = (struct Smart_Data *)pData; + + if ( sd->tween->IsFinished() ) + { + MSG_SLIDER_HIGH("animation ended"); + + shift_direction_t direction = SLIDE_SHIFT_NONE; + + if ( (sd->slide[CENTER_SLIDE]->x - sd->x) + sd->slide[CENTER_SLIDE]->w < 0 ) + { + direction = SLIDE_SHIFT_TO_RIGHT; + } + else if ( (sd->slide[CENTER_SLIDE]->x - sd->x) > sd->w ) + { + direction = SLIDE_SHIFT_TO_LEFT; + } + + _ivug_slider_slide_shift(sd, direction); // Change center item + + delete sd->tween; + sd->tween = NULL; + return false; + } + + MSG_SLIDER_LOW("On Animaion. %f ", value); + + sd->tween->Update(value); + + return true; +} + +void +_ivug_slider_start_slide(struct Smart_Data *sd, int src_x, int dst_x, int momentum) + { + // Slider Move animation. + IV_ASSERT(sd != NULL); + + if ( sd->anim == NULL ) + { + // When destroying gesture, abort message is comming. EFL behavior may be changed. + MSG_SLIDER_WARN("Slider is destroying..."); + return; + } + + sd->anim->Stop(); + + if ( sd->tween ) delete sd->tween; + sd->tween = NULL; + + if ( src_x == dst_x ) + { + MSG_SLIDER_ERROR("Src and Dest are same."); + return; + } + + double duration; + + duration = (src_x - dst_x) / (double)momentum; + + duration = fabs(duration); + + sd->tween = new CGroupAnimator(); + + sd->tween->AddAnimator(new CSingleAnimator(src_x, dst_x, duration, CTranstionFunc::EaseInoutTransit, _ivug_slider_on_tween, sd)); + sd->tween->AddAnimator(new CSingleAnimator(sd->momentum, 0, duration, CTranstionFunc::EaseInoutTransit, _ivug_slider_on_moment, sd)); + + sd->anim->Start(_ivug_slider_on_ecore_animator, (void *)sd); + + MSG_SLIDER_HIGH("Start scroll anim from %d~%d duration=%f Momentyum=%d~%d", src_x, dst_x, duration, sd->momentum, sd->momentum + (src_x - dst_x)); + +} + +void +_ivug_slider_slide_shift(struct Smart_Data *sd, shift_direction_t direction) +{ + IV_ASSERT(sd != NULL); + + if ( direction == SLIDE_SHIFT_NONE ) + { + MSG_SLIDER_ERROR("Shift none!. just return"); + return; + } + + sd->zoom_level = 0; //reset zoom level + + Media_Item *item = NULL; + Slide_Item *NewItem = NULL; + + if ( direction == SLIDE_SHIFT_TO_RIGHT ) + { + MSG_SLIDER_HIGH( "Slide shited. <-----"); + + NewItem = sd->slide[PREV_SLIDE]; + + item = ivug_medialist_get_next(sd->media_list, sd->slide[NEXT_SLIDE]->mitem); + + sd->slide[PREV_SLIDE] = sd->slide[CENTER_SLIDE]; + sd->slide[CENTER_SLIDE] = sd->slide[NEXT_SLIDE]; + sd->slide[NEXT_SLIDE] = NewItem; + + } + else + { + MSG_SLIDER_HIGH( "Slide shited. ----->"); + + NewItem = sd->slide[NEXT_SLIDE]; + item = ivug_medialist_get_prev(sd->media_list, sd->slide[PREV_SLIDE]->mitem); + + sd->slide[NEXT_SLIDE] = sd->slide[CENTER_SLIDE]; + sd->slide[CENTER_SLIDE] = sd->slide[PREV_SLIDE]; + sd->slide[PREV_SLIDE] = NewItem; + } + + ivug_slider_item_data_set(NewItem, item); //set data. + + MSG_SLIDER_MED("Center slide. XY(%d,%d)", sd->slide[CENTER_SLIDE]->x , sd->slide[CENTER_SLIDE]->y); + + sd->last_dir = direction; + + if ( direction == SLIDE_SHIFT_TO_RIGHT ) + { + _ivug_slider_on_center_changed(sd->obj, sd->slide[PREV_SLIDE], sd->slide[CENTER_SLIDE]); + } + else + { + _ivug_slider_on_center_changed(sd->obj, sd->slide[NEXT_SLIDE], sd->slide[CENTER_SLIDE]); + } + + _do_load(sd); + +} + + +Evas_Object* +ivug_slider_add(Evas_Object* parent) +{ + Evas_Object *obj = NULL; + + _ivug_slider_smart_init(); //init smart object for ivug slider + + PERF_CHECK_BEGIN(LVL3, "evas_object_smart_add"); + + obj = evas_object_smart_add(evas_object_evas_get(parent), _smart_); //create smart object. + evas_object_name_set(obj, "Slider"); + + ivug_retv_if(!obj, NULL); + + PERF_CHECK_END(LVL3, "evas_object_smart_add"); + + MSG_SLIDER_HIGH("Slider Added Obj(0x%08x) Evas(0x%08x) Parent(0x%08x)", obj, evas_object_evas_get(parent), parent); + + return obj; +} + +void +ivug_slider_start(Evas_Object *obj) +{ + IV_ASSERT(obj != NULL); + + MSG_SLIDER_HIGH("Slider start"); + + ivug_slider_load(obj); + +} + +Slide_Item * +ivug_slider_get_sitem(Evas_Object* obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + return sd->slide[CENTER_SLIDE]; +} + +Media_Item * +ivug_slider_get_item(Evas_Object* obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + return sd->slide[CENTER_SLIDE]->mitem; +} + +slide_state_t +ivug_slider_get_state(Evas_Object* obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + IV_ASSERT(sd != NULL); + + return sd->slide[CENTER_SLIDE]->state; +} + +void +ivug_slider_delete_item(Evas_Object* obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + IV_ASSERT(sd != NULL); + + ivug_slider_item_stop(sd->slide[CENTER_SLIDE]); + + shift_direction_t direction = SLIDE_SHIFT_NONE; + + if (sd->slide[NEXT_SLIDE]->state != SLIDE_STATE_NONE) + { + MSG_SLIDER_MED("right slide state : %s", _GetStateString(sd->slide[NEXT_SLIDE]->state)); + direction = SLIDE_SHIFT_TO_RIGHT; + } + else if (sd->slide[PREV_SLIDE]->state != SLIDE_STATE_NONE) + { + MSG_SLIDER_MED("left slide state : %s", _GetStateString(sd->slide[PREV_SLIDE]->state)); + direction = SLIDE_SHIFT_TO_LEFT; + } + + Media_Item *mitem = sd->slide[CENTER_SLIDE]->mitem; + + ivug_slider_item_data_set(sd->slide[CENTER_SLIDE], NULL); + ivug_medialist_delete_item(sd->media_list, mitem); //delete data. + + Media_Item* item = NULL; + +//move slide. + if ( direction == SLIDE_SHIFT_TO_RIGHT ) // <-------------- Next image + { + Slide_Item *tmp = sd->slide[CENTER_SLIDE]; + + item = ivug_medialist_get_next(sd->media_list, sd->slide[NEXT_SLIDE]->mitem); //get next data. + + sd->slide[CENTER_SLIDE] = sd->slide[NEXT_SLIDE]; + sd->slide[NEXT_SLIDE] = tmp; + + if(item != NULL) + { + ivug_slider_item_data_set(sd->slide[NEXT_SLIDE], item); + ivug_slider_item_load(sd->slide[NEXT_SLIDE]); + } + else + { + MSG_SLIDER_WARN("Item is NULL"); + } + } + else if ( direction == SLIDE_SHIFT_TO_LEFT) // Prev Image -----------> + { + Slide_Item *tmp = sd->slide[CENTER_SLIDE]; + + item = ivug_medialist_get_prev(sd->media_list, sd->slide[PREV_SLIDE]->mitem); + + sd->slide[CENTER_SLIDE] = sd->slide[PREV_SLIDE]; + sd->slide[PREV_SLIDE] = tmp; + + if(item != NULL) + { + ivug_slider_item_data_set(sd->slide[PREV_SLIDE], item); + ivug_slider_item_load(sd->slide[PREV_SLIDE]); + } + else + { + MSG_SLIDER_WARN("Item is NULL"); + } + } + else // Shift none + { + MSG_SLIDER_WARN("Direction is NONE"); + } + + _ivug_slider_slide_move(sd, 0 , sd->slide[CENTER_SLIDE]->y); //draw item + + ivug_slider_item_load(sd->slide[CENTER_SLIDE]); + + _ivug_slider_on_center_changed(sd->obj, NULL, sd->slide[CENTER_SLIDE]); + +} + +Eina_Bool +ivug_slider_set_medialist(Evas_Object* obj, Media_List *mList, Media_Item *current) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + IV_ASSERT(current != NULL); + + sd->media_list = mList; + + //set init + PERF_CHECK_BEGIN(LVL4, "set center"); + + ivug_slider_item_data_set(sd->slide[CENTER_SLIDE], current); + + PERF_CHECK_END(LVL4, "set center"); + + Media_Item *item = ivug_medialist_get_next(sd->media_list, current); + + PERF_CHECK_BEGIN(LVL4, "set next"); + + ivug_slider_item_data_set(sd->slide[NEXT_SLIDE], item); + + PERF_CHECK_END(LVL4, "set next"); + + item = ivug_medialist_get_prev(sd->media_list, current); + + PERF_CHECK_BEGIN(LVL4, "set prev"); + + ivug_slider_item_data_set(sd->slide[PREV_SLIDE], item); + + PERF_CHECK_END(LVL4, "set prev"); + + PERF_CHECK_BEGIN(LVL4, "_ivug_slider_on_center_changed"); + + _ivug_slider_on_center_changed(sd->obj, NULL, sd->slide[CENTER_SLIDE]); + + PERF_CHECK_END(LVL4, "_ivug_slider_on_center_changed"); + +// Is it needed???????.. Slide item load is called from slider_start!. +// _do_load(sd); + + return EINA_TRUE; +}//ivug slider set list + +void +ivug_slider_set_item(Evas_Object* obj, Media_Item *newItem, slide_dir_t dir) +{ + IV_ASSERT(obj != NULL); + IV_ASSERT(newItem != NULL); + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider set item. Dir=%d", dir); + + Media_Item *mitem = NULL; + + switch(dir) + { + case SLIDE_TO_RIGHT: // <--------------- Next image + ivug_slider_item_data_set(sd->slide[NEXT_SLIDE], newItem); + + _ivug_slider_start_slide(sd, sd->slide[CENTER_SLIDE]->x , sd->slide[CENTER_SLIDE]->w + IMAGE_BETWEEN_MARGIN, ANIN_VELOCITY); + + mitem = ivug_medialist_get_prev(sd->media_list, newItem); + + ivug_slider_item_data_set(sd->slide[PREV_SLIDE], mitem); + break; + case SLIDE_TO_LEFT: // Prev Image ------------------> + ivug_slider_item_data_set(sd->slide[PREV_SLIDE], newItem); + + _ivug_slider_start_slide(sd, sd->slide[CENTER_SLIDE]->x , sd->slide[CENTER_SLIDE]->w + IMAGE_BETWEEN_MARGIN, ANIN_VELOCITY); + + mitem = ivug_medialist_get_next(sd->media_list, newItem); + + ivug_slider_item_data_set(sd->slide[NEXT_SLIDE], mitem); + break; + case SLIDE_INSTANTLY: +// For avoid blinking, set item in next_slide and then swap with center + ivug_slider_item_data_set(sd->slide[NEXT_SLIDE], newItem); + + Slide_Item *sitem = sd->slide[CENTER_SLIDE]; + sd->slide[CENTER_SLIDE] = sd->slide[NEXT_SLIDE]; + sd->slide[NEXT_SLIDE] = sitem; + + _ivug_slider_slide_move(sd, 0, sd->slide[CENTER_SLIDE]->y); + + mitem = ivug_medialist_get_next(sd->media_list, newItem); + ivug_slider_item_data_set(sd->slide[NEXT_SLIDE], mitem); + + mitem = ivug_medialist_get_prev(sd->media_list, newItem); + ivug_slider_item_data_set(sd->slide[PREV_SLIDE], mitem); + + _do_load(sd); + + _ivug_slider_on_center_changed(sd->obj, sd->slide[NEXT_SLIDE] , sd->slide[CENTER_SLIDE]); + break; + } + +} + +void +ivug_slider_set_item_to_slide(Evas_Object* obj, slide_index_t where, Media_Item *newItem) +{ + IV_ASSERT(obj != NULL); + IV_ASSERT(newItem != NULL); + + if(where >= MAX_SLIDE) + { + MSG_SLIDER_ERROR("where is invalid %d, where"); + return; + } + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("ivug_slider_set_item_to_slide. where=%d", where); + + Media_Item *mitem = NULL; + + ivug_slider_item_data_set(sd->slide[where], newItem); + + _do_load(sd); +} + + +// Goto Background +void +ivug_slider_pause(Evas_Object *obj) +{ + if (obj == NULL) { + MSG_SLIDER_WARN("Slider is NULL"); + return; + } + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider pause"); + + ivug_slider_item_pause(sd->slide[CENTER_SLIDE]); +} + +// Goto Foreground +void +ivug_slider_resume(Evas_Object *obj) +{ + if (obj == NULL) { + MSG_SLIDER_WARN("Slider is NULL"); + return; + } + + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider resume"); + + ivug_slider_item_resume(sd->slide[CENTER_SLIDE]); +} + +void +ivug_slider_skip(Evas_Object* obj) +{ + ivug_ret_if(!obj); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + if ( sd->last_dir == SLIDE_SHIFT_TO_RIGHT) // <-------------- + { + if(sd->slide[NEXT_SLIDE]->mitem == NULL) + { + MSG_SLIDER_HIGH("next is NULL"); + if(sd->slide[PREV_SLIDE]->mitem == NULL) + { + MSG_SLIDER_HIGH("prev is NULL too, exit Image viewer"); + ug_destroy_me(gGetUGHandle()); + return; + } + _ivug_slider_start_slide(sd, sd->slide[CENTER_SLIDE]->x , sd->slide[CENTER_SLIDE]->w + IMAGE_BETWEEN_MARGIN, ANIN_VELOCITY); + } + else + { + _ivug_slider_start_slide(sd, sd->slide[CENTER_SLIDE]->x , -sd->slide[CENTER_SLIDE]->w - IMAGE_BETWEEN_MARGIN, ANIN_VELOCITY); + } + } + else if (sd->last_dir == SLIDE_SHIFT_TO_LEFT) // --------------> + { + if(sd->slide[PREV_SLIDE]->mitem == NULL) + { + MSG_SLIDER_HIGH("prev is NULL"); + if(sd->slide[NEXT_SLIDE]->mitem == NULL) + { + MSG_SLIDER_HIGH("next is NULL too, exit Image viewer"); + ug_destroy_me(gGetUGHandle()); + return; + } + _ivug_slider_start_slide(sd, sd->slide[CENTER_SLIDE]->x , -sd->slide[CENTER_SLIDE]->w - IMAGE_BETWEEN_MARGIN, ANIN_VELOCITY); + } + else + { + _ivug_slider_start_slide(sd, sd->slide[CENTER_SLIDE]->x , sd->slide[CENTER_SLIDE]->w + IMAGE_BETWEEN_MARGIN, ANIN_VELOCITY); + } + } +} + +bool ivug_slider_load(Evas_Object* obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + ivug_retv_if(!sd, EINA_FALSE); //check smart data. + + MSG_SLIDER_HIGH("Slider Load. 0x%08x", obj); + + if ( sd->item_load_idler ) + { + ecore_idler_del(sd->item_load_idler); + sd->item_load_idler = NULL; + } + + sd->item_load_idler = ecore_idler_add(_item_loader_idler, (void *)obj); + + return true; +} + + +bool ivug_slider_image_rotate(Evas_Object* obj, int angle) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + ivug_retv_if(!sd, FALSE); //check smart data. + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + return ivug_slider_item_image_rotate_set(si, angle); +} + +void +ivug_slider_set_menu_visibility(Evas_Object* obj, Eina_Bool bVisible) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider(0x%08x) Set menu visibility=%d.", obj, bVisible); + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + if ( bVisible == EINA_TRUE ) + { + ivug_slider_item_show_menu(si); + } + else + { + ivug_slider_item_hide_menu(si); + } +} + + + + +// For debugging. +void ivug_slider_dump_photocam(Evas_Object* obj) +{ + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + +// EFL::dump_obj(sd->slide[CENTER_SLIDE]->photocam, 0); +// EFL::dump_obj(obj, 0); + + Evas_Object *clipper; + + clipper = evas_object_clip_get(obj); + if (clipper) + { + Eina_List *clippees; + + Eina_List *l; + + clippees = (Eina_List *)evas_object_clipees_get(clipper); + MSG_SLIDER_HIGH("Clipper clips %i objects", eina_list_count(clippees)); + + void *data; + + EINA_LIST_FOREACH(clippees, l, data) + { + Evas_Object *obj_tmp = (Evas_Object *)data; + + int x, y, w, h; + evas_object_geometry_get(obj_tmp, &x, &y, &w, &h); + + MSG_SLIDER_HIGH("Obj=%s(%s) Geometry(%d,%d,%d,%d)", + evas_object_name_get(obj_tmp), evas_object_type_get(obj_tmp), + x, y, w, h); + // evas_object_show(obj_tmp); + } + } + + + Evas *e = evas_object_evas_get(sd->slide[CENTER_SLIDE]->photocam); + + int w, h; + + evas_output_size_get(e, &w, &h); + + int vx, vy, vw, vh; + + evas_output_viewport_get(e, &vx, &vy, &vw, &vh); + + EFL::dump_obj(sd->obj); + + MSG_SLIDER_HIGH("Evas Size(%d,%d) Viewport(%d,%d,%d,%d)", w, h, vx, vy, vw, vh); + +} + +unsigned int +ivug_slider_zoom_level_get(Evas_Object *obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider zoom level"); + + return sd->zoom_level; +} + +void +ivug_slider_zoom_in(Evas_Object *obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider zoom in"); + + if(sd->zoom_level > ZOOM_LEVEL_MAX) + { + MSG_MAIN_ERROR("zoom_level is %d", sd->zoom_level); + return; + } + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + double zoom = 0.0; + Evas_Coord ix = 0, iy = 0, iw = 0, ih = 0; + + evas_object_geometry_get(si->photocam, &ix, &iy, &iw, &ih); + + zoom = ivug_slider_item_zoom_get(si); + zoom *= ZOOM_LEVEL_STEP; + ivug_slider_item_zoom_set(si, zoom, iw/2, ih/2); + + ivug_slider_item_hold_set(si, EINA_FALSE); + + sd->zoom_level++; +} + +void +ivug_slider_zoom_out(Evas_Object *obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider zoom in"); + + if(sd->zoom_level == 0) + { + MSG_MAIN_ERROR("zoom_level is 0"); + return; + } + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + double zoom = 0.0; + Evas_Coord ix = 0, iy= 0, iw= 0, ih= 0; + + evas_object_geometry_get(si->photocam, &ix, &iy, &iw, &ih); + + zoom = ivug_slider_item_zoom_get(si); + zoom /= ZOOM_LEVEL_STEP; + ivug_slider_item_zoom_set(si, zoom, iw/2, ih/2); + + ivug_slider_item_hold_set(si, EINA_FALSE); + + sd->zoom_level--; +} + +void +ivug_slider_zoom_reset(Evas_Object *obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + MSG_SLIDER_HIGH("Slider zoom in"); + + sd->zoom_level = 0; + + Slide_Item *si = sd->slide[CENTER_SLIDE]; + + ivug_slider_item_zoom_reset(si, EINA_FALSE, 0, 0); +} + +bool ivug_slider_reload(Evas_Object* obj) +{ + IV_ASSERT(obj != NULL); + struct Smart_Data *sd = (struct Smart_Data *) evas_object_smart_data_get(obj); + + ivug_retv_if(!sd, EINA_FALSE); //check smart data. + + MSG_SLIDER_HIGH("Slider Reload. 0x%08x", obj); + + ivug_slider_item_reload(sd->slide[CENTER_SLIDE]); + + return true; +} + + diff --git a/main/src/ug-image-viewer.cpp b/main/src/ug-image-viewer.cpp new file mode 100755 index 0000000..fd497a3 --- /dev/null +++ b/main/src/ug-image-viewer.cpp @@ -0,0 +1,1058 @@ +/* + * Copyright 2012 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 /*EFL*/ + +#include "ivug-common.h" //common +#include "ivug-util.h" +#include "ivug-main-view.h" +#include "ivug-setas-view.h" +#include "ivug-crop-ug.h" +#include "ivug-details-view.h" +#include "ivug-popup.h" +#include "ivug-slideshow-view.h" + + +#include "EFLUtil.h" + + +#include "ivug-callback.h" +#include "ivug-context.h" + +#include "ivug-parameter.h" + +#define SHORTCUT_ICON_PATH "/usr/share/icons/default/small/org.tizen.image-viewer.png" + +typedef struct ug_data { + Evas_Object *base; // UG layout + +// View Data; + Ivug_MainView *main_view; + Ivug_SetAsView *setas_view; + IvugCropUG *crop_ug; + + Ivug_SlideShowView *ss_view; + + ivug_parameter* ivug_param; + + bool bError; + char *bErrMsg; + + Evas_Object *icon; + Ecore_Timer *exit_timer; + + Evas_Object *navi_bar; + Elm_Object_Item *navi_it; +} _AppData; + + +#undef TRACE_RENDER + +static void _on_base_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Coord x,y,w,h; + evas_object_geometry_get(obj, &x, &y, &w, &h); + + MSG_IMAGEVIEW_HIGH("Base layout resized geomtery XYWH(%d,%d,%d,%d) angle=%d", x, y, w, h, elm_win_rotation_get((Evas_Object *)ug_get_window())); +} + +static void _on_base_move(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Coord x,y,w,h; + evas_object_geometry_get(obj, &x, &y, &w, &h); + + MSG_IMAGEVIEW_HIGH("Base layout moved geomtery XYWH(%d,%d,%d,%d) angle=%d", x, y, w, h, elm_win_rotation_get((Evas_Object *)ug_get_window())); +} + + +static void _on_base_show(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("Base layout show"); +} + +static void _on_base_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("Base layout hide"); +} + +static void _on_receive_mouse_down (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("Base layout clicked : %s Layer=%d",evas_object_name_get(obj), evas_object_layer_get(obj)); +} + +static void _print_render_method(Evas *e) +{ + IV_ASSERT(e != NULL ); + + Eina_List *engines, *l; + int cur_id; + int id; + + engines = evas_render_method_list (); + if (!engines) { + MSG_IMAGEVIEW_ERROR("No engine is specified"); + return; + } + + cur_id = evas_output_method_get (e); + + char *name; + void *data; + EINA_LIST_FOREACH (engines, l, data) { + name = (char *)data; + id = evas_render_method_lookup (name); + if (name && id == cur_id) + { + MSG_IMAGEVIEW_HIGH("Render method is %s", name); + break; + } + } + +} + + +#ifdef TRACE_RENDER +static void _on_render_post(void *data, Evas *e, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("***************render_post***************"); + +#if 0 + struct ug_data *ugd = (struct ug_data *)data; + + if ( ugd->main_view && ugd->base ) + { + EFL::dump_obj(ugd->base,0); + } +#endif + +} + +static void _on_render_pre(void *data, Evas *e, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("***************render_pre ***************"); + +#if 0 + struct ug_data *ugd = (struct ug_data *)data; + + if ( ugd->main_view && ugd->base ) + { + EFL::dump_obj(ugd->base,0); + } +#endif +} +#endif + + + +static void _on_setas_view_destroyed(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + struct ug_data *ugd = (struct ug_data *)data; + + if(ugd->setas_view) + { + ivug_setas_view_destroy(ugd->setas_view); + ugd->setas_view = NULL; + } + + ug_destroy_me(gGetUGHandle()); +} + + +static void +_on_timeout_response(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + ui_gadget_h ug = (ui_gadget_h)data; + + MSG_IMAGEVIEW_ERROR("ERROR EXIT"); + + ug_destroy_me(ug); +} + +static Evas_Object* _set_win_icon(void) +{ +// set window icon + Evas_Object *o = evas_object_image_add(evas_object_evas_get((Evas_Object *)ug_get_window())); + evas_object_image_file_set(o, SHORTCUT_ICON_PATH, NULL); + elm_win_icon_object_set((Evas_Object *)ug_get_window(), o); + + return o; +} + +static void _win_profile_changed_cb(void *data, Evas_Object * obj, void *event_info) +{ + if (data == NULL) return; + + struct ug_data *ugd = (struct ug_data *)data; + + const char *profile = elm_config_profile_get(); + + if (!strcmp(profile, "desktop")) + { // desktop mode + gSetDesktopMode(true); + + // hide layout's indicator area + elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_HIDE); + + // set window icon + if (!ugd->icon) + { + ugd->icon = _set_win_icon(); + } + } + else + { // mobile + gSetDesktopMode(false); + + // show layout's indicator area + elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_SHOW); + } +} + +static Eina_Bool _on_exit_timer_expired(void *data) +{ + ivug_retv_if(!data, ECORE_CALLBACK_CANCEL); + + struct ug_data *ugd = (struct ug_data *)data; + + ugd->exit_timer = NULL; + + DESTROY_ME(); + + return ECORE_CALLBACK_CANCEL; +} + +static bool _is_mmc_inserted(void) +{ + int noti_message; + int ret = -1; + + ret = vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, ¬i_message); + + if ( ret != 0 ) // falied + { + MSG_NOTI_ERROR("Get %s is failed", VCONFKEY_SYSMAN_MMC_STATUS); + return false; + } + + if(noti_message == VCONFKEY_SYSMAN_MMC_MOUNTED) + { + return true; + } + + return false; + +} + +static void _on_mmc_state_changed(keynode_t* node, void *data) +{ + struct ug_data *ugd = (struct ug_data *)data; + if (NULL == ugd) { + return; + } + + if(_is_mmc_inserted() == false) + { + MSG_IMAGEVIEW_WARN("MMC Removed!"); + if(strncmp(ugd->ivug_param->filepath, PATH_SDCARD, strlen(PATH_SDCARD)) != 0 + && ugd->ivug_param->view_by != IVUG_VIEW_BY_ALL) + { + return; + } + + MSG_IMAGEVIEW_WARN("Request destroy UG=0x%08x", gGetUGHandle()); + + if(ugd->main_view) + { + _ivug_main_on_mmc_state_changed(node, ugd->main_view); + } + else if(ugd->ss_view) + { + _ivug_slideshow_view_on_mmc_state_changed(node, ugd->ss_view); + } + else + { + //ivug_timeout_popup_show(ugd->base, _on_timeout_response, gGetUGHandle(), IDS_ERROR, IDS_SD_CARD_REMOVED); + if(ugd->exit_timer == NULL) + { + ugd->exit_timer = ecore_timer_add(0.2, _on_exit_timer_expired, ugd); + } + } + } +} + +static Evas_Object *create_fullview(Evas_Object *win, struct ug_data *ugd) +{ + Evas_Object *base; + + /* Create Full view */ + base = EFL::create_layout(win, EDJ_PATH"/ivug-base.edj", "ivug_base"); + if (base == NULL) + { + MSG_IMAGEVIEW_HIGH("Cannot set layout. EDJ=%s Group=%s", EDJ_PATH"/ivug-base.edj", "ivug_base"); + return NULL; + } + + evas_object_name_set(base, "Base layout"); + + evas_object_size_hint_expand_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + return base; +} + +static Evas_Object *create_frameview(Evas_Object *parent, struct ug_data *ugd) +{ + Evas_Object *base; + + /* Create Frame view */ + base = elm_layout_add(parent); + evas_object_name_set(base, "Base layout frame"); + elm_layout_theme_set(base, "layout", "application", "default"); + + return base; +} + + +static void *on_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv) +{ + struct ug_data *ugd; + Evas_Object *conformant; + + PERF_CHECK_END(LVL0, "UG_MODULE_INIT -> On Create"); + + PERF_CHECK_BEGIN(LVL0, "On Create"); + + MSG_IMAGEVIEW_HIGH("Image Viewer : %s ug=0x%08x", __func__, ug); + + if (!ug || !priv) + { + MSG_IMAGEVIEW_ERROR("Error. ug=0x%08x priv=0x%08x", ug, priv); + return NULL; + } + + ugd = (struct ug_data *)priv; + + Evas_Object *win = (Evas_Object *)ug_get_window(); + + // it is for camera, camera can rotate even rotation is locked + if(ivug_config_get_can_rotate() == false) + { + elm_win_rotation_with_resize_set(win, 0); + } + + int wx, wy, ww, wh; + int ret = -1; + + evas_object_geometry_get(win, &wx, &wy, &ww, &wh); + + MSG_IMAGEVIEW_HIGH("Parent Info. Layout(0x%08x) Win(0x%08x) Size(%d,%d,%d,%d)", + ug_get_parent_layout(ug), win, wx, wy, ww, wh); + + PERF_CHECK_BEGIN(LVL1, "init context"); + //init + if (!ivug_context_init(ug)) + { + MSG_IMAGEVIEW_ERROR("ivug_main_init error"); + return NULL; + } + PERF_CHECK_END(LVL1, "init context"); + + PERF_CHECK_BEGIN(LVL1, "parse bundle"); + + ugd->ivug_param = ivug_param_create_from_bundle(service); + if ( ugd->ivug_param == NULL ) + { + MSG_IMAGEVIEW_ERROR("Cannot parse parameter"); + ugd->bError = true; + ugd->bErrMsg = strdup(IDS_UNABLE_TO_OPEN_FILE); + goto ON_CREATE_ERROR; + } + PERF_CHECK_END(LVL1, "parse bundle"); + + PERF_CHECK_BEGIN(LVL1, "creating base"); + + //create base + if (mode == UG_MODE_FULLVIEW) + { + MSG_IMAGEVIEW_HIGH("create base layout for FullView"); + ugd->base = create_fullview(win, ugd); + } else { + MSG_IMAGEVIEW_HIGH("create base layout for FrameView"); + ugd->base = create_frameview(win, ugd); + } + + PERF_CHECK_END(LVL1, "creating base"); + + if ( ugd->base == NULL ) + { + MSG_IMAGEVIEW_ERROR("Cannot create base view"); + ugd->bError = true; + ugd->bErrMsg = strdup(IDS_UNABLE_TO_OPEN_FILE); + goto ON_CREATE_ERROR; + } + +#ifdef TRACE_RENDER + evas_event_callback_add(evas_object_evas_get(ugd->base), EVAS_CALLBACK_RENDER_PRE, _on_render_pre, ugd); + evas_event_callback_add(evas_object_evas_get(ugd->base), EVAS_CALLBACK_RENDER_POST, _on_render_post, ugd); +#endif + + int ux1, uy1, uw1, uh1; + + evas_object_geometry_get(ugd->base, &ux1, &uy1, &uw1, &uh1); + + MSG_IMAGEVIEW_HIGH("UG base created : 0x%08x (%d,%d,%d,%d)", ugd->base, ux1, uy1, uw1, uh1); + + evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_MOUSE_DOWN, _on_receive_mouse_down, NULL); + + evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_RESIZE, _on_base_resize, ugd); + evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_MOVE, _on_base_move, NULL); + + evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_SHOW, _on_base_show, NULL); + evas_object_event_callback_add(ugd->base, EVAS_CALLBACK_HIDE, _on_base_hide, NULL); + + evas_object_smart_callback_add(win, "profile,changed", _win_profile_changed_cb, ugd); + + ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, _on_mmc_state_changed, ugd); + if ( ret == -1 ) + { + MSG_IMAGEVIEW_ERROR("Register %s is failed", VCONFKEY_SYSMAN_MMC_STATUS); + } + + if(ugd->ivug_param->mode == IVUG_MODE_SETAS) + { + MSG_IMAGEVIEW_HIGH("UG types=%d", ugd->ivug_param->setas_type); + + ivug_set_screen_type type = IVUG_CTRLBAR_SET_SCREEN_MAX; + + ivug_setas_mode setas_mode = IVUG_SETAS_UG; + if(ugd->ivug_param->bStandalone == true) + { + setas_mode = IVUG_SETAS_APPSVC; + } + + if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_CALLER_ID) + { + type = IVUG_CTRLBAR_SET_SCREEN_CALLERID; + ugd->setas_view = ivug_setas_view_callerid_ug_create(ugd->base, ugd->ivug_param->filepath, + setas_mode, ugd->ivug_param->width, ugd->ivug_param->height); + } + else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_VIDEO_CALL_ID) + { + type = IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID; + ugd->setas_view = ivug_setas_view_video_call_id_ug_create(ugd->base, ugd->ivug_param->filepath, + setas_mode, ugd->ivug_param->width, ugd->ivug_param->height); + } + else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER) + { + type = IVUG_CTRLBAR_SET_SCREEN_HOME; + ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath, + setas_mode, type); + } + else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_LOCKSCREEN) + { + type = IVUG_CTRLBAR_SET_SCREEN_LOCK; + ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath, + setas_mode, type); + } + else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER_N_LOCKSCREEN) + { + type = IVUG_CTRLBAR_SET_SCREEN_BOTH; + ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath, + setas_mode, type); + } + else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_WALLPAPER_CROP) + { + type = IVUG_CTRLBAR_SET_SCREEN_HOME; + setas_mode = IVUG_SETAS_CROP; + ugd->crop_ug = ivug_setas_crop_ug_create(ugd->base, ugd->ivug_param->filepath, + setas_mode, type); + } + else if(ugd->ivug_param->setas_type == IVUG_SET_AS_UG_TYPE_CROP) + { + // Crop UG + ugd->crop_ug = ivug_crop_ug_create(ugd->base, + ugd->ivug_param->width, ugd->ivug_param->height, + ugd->ivug_param->bRatioFix, ugd->ivug_param->filepath); + } + else + { + MSG_IMAGEVIEW_ERROR("Invalid SetAS UG Type:%d", ugd->ivug_param->setas_type); + return NULL; + } + + if(ugd->setas_view == NULL && ugd->crop_ug == NULL) + { + MSG_IMAGEVIEW_ERROR("SetAS UG creation failed Type:%d", ugd->ivug_param->setas_type); + ugd->bError = true; + ugd->bErrMsg = strdup("Layout Loading Fail"); + goto ON_CREATE_ERROR; + } + + Evas_Object *layout = NULL; + + if(ugd->setas_view) + { + Evas_Object *setasOjbect = ivug_setas_view_object_get(ugd->setas_view); + evas_object_smart_callback_add(setasOjbect, "destroy", _on_setas_view_destroyed, ugd); + + ugd->navi_bar = ivug_naviframe_add(ugd->base, NULL); + + evas_object_name_set(ugd->navi_bar, "UG naviframe"); + // Layout life cycle is controlled by application explictily. + elm_naviframe_content_preserve_on_pop_set(ugd->navi_bar, EINA_TRUE); + + Evas_Object *back_btn = ivug_button_add(ugd->navi_bar, "naviframe/end_btn/default", + IDS_BACK, NULL, _on_setas_view_destroyed, ugd); + + ugd->navi_it = elm_naviframe_item_push(ugd->navi_bar, + NULL, back_btn, NULL, setasOjbect, NULL); + elm_naviframe_item_title_visible_set(ugd->navi_it, EINA_FALSE); + + //conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + ivug_setas_view_create_menu(ugd->setas_view, ugd->navi_bar, type); + + ivug_setas_view_load_file(ugd->setas_view, ugd->ivug_param->filepath, type); + + //layout = ivug_setas_view_object_get(ugd->setas_view); + layout = ugd->navi_bar; + } + else if(ugd->crop_ug) + { + layout = ivug_crop_ug_get_layout(ugd->crop_ug); + } + + elm_object_part_content_set(ugd->base, "elm.swallow.content", layout); //swallow + } + else if (ugd->ivug_param->mode == IVUG_MODE_SLIDESHOW || ugd->ivug_param->footsteps) + { + PERF_CHECK_BEGIN(LVL1, "slideshow_view_create"); + + ugd->ss_view = ivug_slideshow_view_create(ugd->base, ugd->ivug_param->mode, ugd->ivug_param->view_by); + + PERF_CHECK_END(LVL1, "slideshow_view_create"); + + if (ugd->ss_view == NULL) //set main view. + { + MSG_IMAGEVIEW_ERROR("Best View Layout Lading Fail"); + ugd->bError = true; + ugd->bErrMsg = strdup("Layout Loading Fail"); + goto ON_CREATE_ERROR; + } + +// Load list. + PERF_CHECK_BEGIN(LVL1, "slideshow_view_load_list"); + + if ( ivug_slideshow_view_set_list(ugd->ss_view, ugd->ivug_param) == false) + { + MSG_IMAGEVIEW_ERROR("Cannot load media list for bestview."); + ugd->bError = true; + ugd->bErrMsg = strdup(IDS_UNABLE_TO_OPEN_FILE); + goto ON_CREATE_ERROR; + } + + Evas_Object *layout = ivug_slideshow_view_object_get(ugd->ss_view); + + elm_object_part_content_set(ugd->base, "elm.swallow.content", layout); //swallow + + PERF_CHECK_END(LVL1, "slideshow_view_load_list"); + + } + else + { + PERF_CHECK_BEGIN(LVL1, "main_view_create"); + + ugd->main_view = ivug_main_view_create(ugd->base, ugd->ivug_param->mode, ugd->ivug_param->view_by); + + PERF_CHECK_END(LVL1, "main_view_create"); + + if (ugd->main_view == NULL) //set main view. + { + MSG_IMAGEVIEW_ERROR("Main View Layout Loading Fail"); + ugd->bError = true; + ugd->bErrMsg = strdup("Layout Loading Fail"); + goto ON_CREATE_ERROR; + } + +// Load list. + PERF_CHECK_BEGIN(LVL1, "main_view_set_list"); + + if ( ivug_main_view_set_list(ugd->main_view, ugd->ivug_param) == false) + { + MSG_IMAGEVIEW_ERROR("Cannot load media list."); + // Need popup? + ugd->bError = true; + ugd->bErrMsg = strdup(IDS_UNABLE_TO_OPEN_FILE); + goto ON_CREATE_ERROR; + } + + Evas_Object *layout = ivug_main_view_object_get(ugd->main_view); + elm_object_part_content_set(ugd->base, "elm.swallow.content", layout); //swallow + + PERF_CHECK_END(LVL1, "main_view_set_list"); + } + + PERF_CHECK_END(LVL0, "On Create"); + + PERF_CHECK_BEGIN(LVL0, "On Create -> On Start"); + +// evas_object_size_hint_weight_set(ugd->base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + int ux, uy, uw, uh; + + evas_object_geometry_get(ugd->base, &ux, &uy, &uw, &uh); + + MSG_IMAGEVIEW_HIGH("Image Viewer : %s Base(0x%08x) Geometry(%d,%d,%d,%d)", __func__, ugd->base, ux, uy, uw, uh); + + return ugd->base; + +ON_CREATE_ERROR: + if(ugd->main_view) + { + ivug_main_view_destroy(ugd->main_view); + ugd->main_view = NULL; + } + + if (ugd->base == NULL) + { + ugd->base = elm_layout_add((Evas_Object *)ug_get_window()); + elm_layout_theme_set(ugd->base, "layout", "application", "default"); + } + + return ugd->base; +} + +static void on_start(ui_gadget_h ug, service_h service, void *priv) +{ + PERF_CHECK_END(LVL0, "On Create -> On Start"); + + PERF_CHECK_BEGIN(LVL0, "On Start"); + + if (!ug || !priv) + { + MSG_IMAGEVIEW_ERROR("Invalid UG. UG=0x%08x Priv=0x%08x", ug, priv); + return ; + } + + struct ug_data *ugd = (struct ug_data *)priv; + + int ux, uy, uw, uh; + + evas_object_geometry_get(ugd->base, &ux, &uy, &uw, &uh); + + MSG_IMAGEVIEW_HIGH("Image Viewer : %s BaseGeometry(%d,%d,%d,%d)", __func__, ux, uy, uw, uh); + + if(ugd->bError == true) + { + PERF_CHECK_END(LVL0, "On Start"); + MSG_IMAGEVIEW_ERROR("UG create has ERROR"); + ivug_timeout_popup_show(ugd->base, _on_timeout_response, ug, IDS_ERROR, ugd->bErrMsg); + return; + } + if ( ugd->ivug_param->mode == IVUG_MODE_SLIDESHOW || ugd->ivug_param->footsteps) + { + PERF_CHECK_BEGIN(LVL1, "slideshow_view_start"); + ivug_slideshow_view_start(ugd->ss_view); + PERF_CHECK_END(LVL1, "slideshow_view_start"); + } + else if ( ugd->main_view ) + { + PERF_CHECK_BEGIN(LVL1, "main_view_start"); + ivug_main_view_start(ugd->main_view); + PERF_CHECK_END(LVL1, "main_view_start"); + } + else if ( ugd->crop_ug ) + { + ivug_crop_ug_start(ugd->crop_ug); + } + + + PERF_CHECK_END(LVL0, "On Start"); +} + +static void on_pause(ui_gadget_h ug, service_h service, void *priv) +{ + MSG_IMAGEVIEW_HIGH("Image Viewer : %s", __func__); + + if (!ug || !priv) + { + MSG_IMAGEVIEW_ERROR("Invalid UG. UG=0x%08x Priv=0x%08x", ug, priv); + return ; + } + + struct ug_data *ugd = (struct ug_data *)priv; + + if(ugd->ivug_param == NULL) + { + MSG_IMAGEVIEW_ERROR("UG is destroying"); + return; + } + + if ( ugd->ivug_param->mode == IVUG_MODE_SLIDESHOW || ugd->ivug_param->footsteps) + { + ivug_slideshow_view_pause(ugd->ss_view); + } + else if ( ugd->main_view ) + { + ivug_main_view_pause(ugd->main_view); + } + +} + +static void on_resume(ui_gadget_h ug, service_h service, void *priv) +{ + MSG_IMAGEVIEW_HIGH("Image Viewer : %s", __func__); + + if (!ug || !priv) + { + IVUG_DEBUG_MSG("Invalid UG. UG=0x%08x Priv=0x%08x", ug, priv); + return ; + } + + struct ug_data *ugd = (struct ug_data *)priv; + + if ( ugd->ivug_param->mode == IVUG_MODE_SLIDESHOW || ugd->ivug_param->footsteps) + { + ivug_slideshow_view_resume(ugd->ss_view); + } + else if ( ugd->main_view ) + { + ivug_main_view_resume(ugd->main_view); + } + +} + +static void on_destroy(ui_gadget_h ug, service_h service, void *priv) +{ + MSG_IMAGEVIEW_HIGH("Image Viewer : %s(0x%08x) UG=0x%08x", __func__, on_destroy, ug); + + PERF_CHECK_BEGIN(LVL0, "On Destroy"); + + if (!ug || !priv) + { + MSG_IMAGEVIEW_ERROR("Invalid UG. UG=0x%08x Priv=0x%08x", ug, priv); + return ; + } + + struct ug_data *ugd = (struct ug_data *)priv; + +#ifdef TRACE_RENDER + evas_event_callback_del_full(evas_object_evas_get(ugd->base), EVAS_CALLBACK_RENDER_PRE, _on_render_pre, ugd); + evas_event_callback_del_full(evas_object_evas_get(ugd->base), EVAS_CALLBACK_RENDER_POST, _on_render_post, ugd); +#endif + + MSG_IMAGEVIEW_HIGH("On Destroy : ug=0x%08x", ug); + + int ret = vconf_ignore_key_changed(VCONFKEY_SYSMAN_MMC_STATUS, _on_mmc_state_changed); + if ( ret == -1 ) + { + MSG_MAIN_ERROR("Unegister %s is failed", VCONFKEY_SYSMAN_MMC_STATUS); + } + + if(ugd->bErrMsg) + { + free(ugd->bErrMsg); + ugd->bErrMsg = NULL; + } + + if(ugd->setas_view) + { + PERF_CHECK_BEGIN(LVL1, "SetAsView"); + ivug_setas_view_destroy(ugd->setas_view); + ugd->setas_view = NULL; + PERF_CHECK_END(LVL1, "SetAsView"); + } + + if(ugd->crop_ug) + { + ivug_crop_ug_destroy(ugd->crop_ug); + ugd->crop_ug = NULL; + } + //destroy main view. + if ( ugd->main_view ) + { + PERF_CHECK_BEGIN(LVL1, "MainView"); + ivug_main_view_destroy(ugd->main_view); + ugd->main_view = NULL; + PERF_CHECK_END(LVL1, "MainView"); + } + + if ( ugd->ss_view ) + { + PERF_CHECK_BEGIN(LVL1, "SlideShowView"); + ivug_slideshow_view_destroy(ugd->ss_view); + ugd->ss_view = NULL; + PERF_CHECK_END(LVL1, "SlideShowView"); + } + //delete param. + if(ugd->ivug_param) + { + ivug_param_delete(ugd->ivug_param); + ugd->ivug_param = NULL; + } + + //finalize data + PERF_CHECK_BEGIN(LVL1, "Context"); + if ( !ivug_context_deinit(ug)) + { + MSG_IMAGEVIEW_ERROR("ivug_main_deinit failed"); + } + PERF_CHECK_END(LVL1, "Context"); + + if (ugd->base) + { + PERF_CHECK_BEGIN(LVL1, "Base layout"); + evas_object_del(ugd->base); + ugd->base = NULL; + PERF_CHECK_END(LVL1, "Base layout"); + } + + MSG_IMAGEVIEW_HIGH("Destroyed ug"); + + PERF_CHECK_END(LVL0, "On Destroy"); +} + +static bool _data_print(service_h service, const char *key, void *user_data) +{ + char *value; + + service_get_extra_data(service, key, &value); + + MSG_IVUG_HIGH(" %s : %s", key, value); + + free(value); + + return true; +} + +static void on_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) +{ + MSG_IMAGEVIEW_HIGH("Image Viewer : %s UG=0x%08x", __func__, ug); //on message + + if (!ug || !priv) + { + MSG_IMAGEVIEW_ERROR("Invalid UG. UG=0x%08x Priv=0x%08x", ug, priv); + return; + } + + int ret = service_foreach_extra_data(msg, _data_print, NULL); + + if(SERVICE_ERROR_NONE != ret) + { + MSG_IVUG_ERROR("service_foreach_extra_data ERROR"); + } + + struct ug_data *ugd = (struct ug_data *)priv; + + //ivug_msg_type msg_type = IVUG_MSG_NONE; + + if(ugd->main_view == NULL) + { + MSG_IMAGEVIEW_ERROR("main view is NULL"); + return; + } + + ivug_callback_call(gGetCallbackHandle(), msg, NULL, NULL); + + return; +} + +static void on_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv) +{ + if (!ug || !priv) + { + MSG_IMAGEVIEW_ERROR("Invalid UG. UG=0x%08x Priv=0x%08x", ug, priv); + return; + } + MSG_IMAGEVIEW_HIGH("Image Viewer : %s UG=0x%08x event=%d", __func__, ug, event); //on message + + switch (event) { + case UG_EVENT_LOW_MEMORY: + MSG_IMAGEVIEW_HIGH("Get Event : Low Memory"); + break; + case UG_EVENT_LOW_BATTERY: + MSG_IMAGEVIEW_HIGH("Get Event : Low battery"); + break; + case UG_EVENT_LANG_CHANGE: + MSG_IMAGEVIEW_HIGH("Get Event : Language changed"); + break; + + case UG_EVENT_ROTATE_PORTRAIT: + case UG_EVENT_ROTATE_LANDSCAPE: + case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: + case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: + // Rotate event is not used now.. plz, use only resized callback. + break; + + default: + MSG_IMAGEVIEW_ERROR("Unknown event type : %d", event); + break; + } +} + +#if 0 +#include +#include + +#include + +static int __load(int argc, char **argv) +{ + + void *handle = NULL; + + struct timeval start_point, end_point; + + double operating_time; + + gettimeofday(&start_point, NULL); + + handle = dlopen(argv[1], RTLD_LAZY ); + + gettimeofday(&end_point, NULL); + + operating_time = (double)(end_point.tv_sec)+(double)(end_point.tv_usec)/1000000.0-(double)(start_point.tv_sec)-(double)(start_point.tv_usec)/1000000.0; + + printf("Dlopen(%s) %f usec\n",argv[1], operating_time); + + if (handle == NULL) + { + printf("Cannot open : %s", argv[1]); + return -1; + } + +// dlclose(handle); + + return 0; +} +#endif + +extern "C" UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) +{ + struct ug_data *ugd; + + MSG_IMAGEVIEW_HIGH("UG_MODULE_INIT. Ver=12.0"); + + if (!ops) + { + MSG_IMAGEVIEW_ERROR("OPS Pointer is NULL"); + return -1; + } + + ugd = (struct ug_data *)calloc(1, sizeof(struct ug_data)); //alloc ug_data memory + if (!ugd) + { + MSG_IMAGEVIEW_ERROR("Cannot allocate memory."); + return -1; + } + + IV_PERF_INIT(); + + ops->create = on_create; + ops->start = on_start; + ops->pause = on_pause; + ops->resume = on_resume; + ops->destroy = on_destroy; + ops->message = on_message; + ops->event = on_event; + ops->priv = ugd; + ops->opt = (ug_option)(UG_OPT_INDICATOR_ENABLE | UG_OPT_OVERLAP_ENABLE); + + PERF_CHECK_BEGIN(LVL0, "UG_MODULE_INIT -> On Create"); + +#if 0 + char *name[] = { + "abc1", + "/usr/ug/lib/libug-image-viewer-efl.so", + }; + + __load(2, name); + +#endif + + return 0; +} + +extern "C" UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) +{ + struct ug_data *ugd; + if (!ops) + { + MSG_IMAGEVIEW_ERROR("OPS Pointer is NULL"); + return; + } + + ugd = (struct ug_data *)ops->priv; + + if (ugd) + { + free(ugd); + } + + MSG_IMAGEVIEW_HIGH("UG_MODULE_EXIT"); + +#ifdef TA_SAVETO_FILE + FILE *fp = NULL; + + fp = fopen(DATADIR"/"PACKAGE"/TimeAnal", "a"); + + if ( fp != NULL ) + { + PERF_SHOW_RESULT(fp); + + fclose(fp); + } + else + { + MSG_IMAGEVIEW_HIGH("Cannot open file : %s", DATADIR"/"PACKAGE"/TimeAnal"); + } +#else + PERF_SHOW_RESULT(stderr); +#endif + + IV_PERF_DEINIT(); + +} + + +#define _CONSTRUCTOR __attribute__ ((constructor)) +#define _DESTRUCTOR __attribute__ ((destructor)) + +_CONSTRUCTOR void _DLLInit(void) +{ + printf("Image Viewer - Called constructor\n"); + MSG_IMAGEVIEW_HIGH("Image Viewer - Called constructor"); +} + +_DESTRUCTOR void _DLLExit(void) +{ + printf("Image Viewer - Called destructor\n"); + MSG_IMAGEVIEW_HIGH("Image Viewer - Called destructor"); +} + + +int main() +{ +/* For detecting undefined symbol */ + return -1; +} + diff --git a/main/src/view/ivug-crop-view.cpp b/main/src/view/ivug-crop-view.cpp new file mode 100755 index 0000000..91e9e61 --- /dev/null +++ b/main/src/view/ivug-crop-view.cpp @@ -0,0 +1,676 @@ +/* + * Copyright 2012 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 "ivug-crop-view.h" +#include "EFLUtil.h" +#include "ivug-debug.h" +#include "ivug-image.h" +#include "ivug-scissorbox.h" +#include "ivug-context.h" +#include "ivug-util.h" +#include "ivug-selectioninfo.h" +#include "ivug-db.h" + +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_MED + +#undef LOG_CAT +#define LOG_CAT "IV-CROP" + +#define EDJ_PATH PREFIX"/res/edje/"PACKAGE + +#define CROP_EDJ_FILE EDJ_PATH"/ivug-crop-view.edj" + +static void _on_layout_resized(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + IvugCropView *pCropView = static_cast(data); + /////////////////////////////////////////////////////////////////// + + int rotate = gGetRotationDegree(); + MSG_HIGH("rotate=%d", rotate); + if(pCropView->PrevRotate == rotate) + { + MSG_ERROR("smame rotate!, return"); + return; + } + pCropView->PrevRotate = rotate; + + int org_x, org_y, org_w, org_h; + + ivug_image_region_get(pCropView->photocam, &org_x, &org_y, &org_w, &org_h); + + pCropView->prev_x = org_x; + pCropView->prev_y = org_y; + pCropView->prev_w = org_w; + pCropView->prev_h = org_h; + + MSG_MED("prev_x=%d, prev_y=%d, prev_w=%d, prev_h=%d", pCropView->prev_x, pCropView->prev_y, pCropView->prev_w, pCropView->prev_h); + + if(org_w == 0 || org_h == 0) + return; + + int org_sx, org_sy, org_sw, org_sh; + ivug_scissorbox_region_get(pCropView->cropbox, &org_sx, &org_sy, &org_sw, &org_sh); + + MSG_MED("org_sx=%d, org_sy=%d, org_sw=%d, org_sh=%d", org_sx, org_sy, org_sw, org_sh); + + int dx = org_sx-org_x; + int dy = org_sy-org_y; + + int lcd_x, lcd_y, lcd_w, lcd_h; + + evas_object_geometry_get(pCropView->contents_area, &lcd_x, &lcd_y, &lcd_w, &lcd_h); + MSG_MED("lcd_x=%d, lcd_y=%d, lcd_w=%d, lcd_h=%d", lcd_x, lcd_y, lcd_w, lcd_h); + + int ph, pw; + + int img_w, img_h; + int ext_w, ext_h; + + img_w = org_w; + img_h = org_h; + ext_w = lcd_w; + ext_h = lcd_h; + + ph = (img_h * ext_w) / img_w; + + if (ph > ext_h) + { + pw = (img_w * ext_h) / img_h; + ph = ext_h; + } + else + { + pw = ext_w; + } + + double zoom = 0.0; + + if ( img_w > img_h) + { + zoom = (double)pw / img_w; + } + else + { + zoom = (double)ph / img_h; + } + + int sx, sy, sw, sh; + + sw = org_sw*zoom; + sh = org_sh*zoom; + dx *= zoom; + dy *= zoom; + + sx = lcd_x + (ext_w-img_w*zoom)/2 + dx; + sy = lcd_y + (ext_h-img_h*zoom)/2 + dy; + + ivug_scissorbox_boundary_set(pCropView->cropbox, lcd_x+(ext_w-img_w*zoom)/2, lcd_y+(ext_h-img_h*zoom)/2, img_w*zoom, img_h*zoom); + + /////////////////////////////////////////////////////////////////// + + MSG_MED("sx=%d, sy=%d, sw=%d, sh=%d", sx, sy, sw, sh); + + ivug_scissorbox_region_set(pCropView->cropbox, sx, sy, sw, sh); +} + +void _on_test(void *data, Evas_Object *obj, void *event_info) +{ + MSG_HIGH("Test signal received"); +} + +static Eina_Bool _on_box_timer_expired(void *data) +{ + ivug_retv_if(!data, ECORE_CALLBACK_CANCEL); + + IvugCropView *pCropView = static_cast(data); + + pCropView->box_timer = NULL; + + int x, y, w, h; + ivug_image_region_get(pCropView->photocam, &x, &y, &w, &h); + + pCropView->prev_x = x; + pCropView->prev_y = y; + pCropView->prev_w = w; + pCropView->prev_h = h; + + // Check error!. + + MSG_HIGH("Photcam image Geometry : %d,%d,%d,%d", x, y, w, h); + + // Get Internal image and set that as scissorbox client + Evas_Object *subObj = ivug_image_internal_image_get(pCropView->photocam); + + // Move crop box + ivug_scissorbox_attach(pCropView->cropbox, subObj); + + int nW = 0; + int nH = 0; + double ratio = 0.0; + + if(pCropView->w > 0 && pCropView->h > 0) + { + nW = pCropView->w; + nH = pCropView->h; + ratio = (double)nH/nW; + MSG_HIGH("hW : %d, nH : %d, ratio : %f", nW, nH, ratio); + if(ratio > 1.0) //height is more longer + { + if(nH > h) + { + nH = h; + nW = h/ratio; + MSG_HIGH("Calculated1 : %d,%d", nW, nH); + } + if(nW > w) + { + nW = w; + nH = w*ratio; + MSG_HIGH("Calculated2 : %d,%d", nW, nH); + } + } + else //width is more longer + { + if(nH > h) + { + nH = h; + nW = h/ratio; + MSG_HIGH("Calculated3 : %d,%d", nW, nH); + } + if(nW > w) + { + nW = w; + nH = w*ratio; + MSG_HIGH("Calculated4 : %d,%d", nW, nH); + } + } + } + else + { + nW = w / 2; + nH = h / 2; + } + + MSG_HIGH("Calculated : %d,%d", nW, nH); + + ivug_scissorbox_region_set(pCropView->cropbox, x + (w - nW) / 2, y + (h - nH) / 2, nW, nH); + + elm_object_disabled_set(pCropView->btn_ok, EINA_FALSE); + + return ECORE_CALLBACK_CANCEL; +} + +void _on_preloaded(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + IvugCropView *pCropView = static_cast(data); + + MSG_HIGH("Image preloaded"); + + if(pCropView->box_timer) + ecore_timer_del(pCropView->box_timer); + pCropView->box_timer = ecore_timer_add(0.5, _on_box_timer_expired, data); + + pCropView->notify_area = const_cast(edje_object_part_object_get(_EDJ(pCropView->layout), + "crop.contents.swallow.notify")); + + pCropView->notify = ivug_notify_static_create(pCropView->notify_area, IDS_CROP_NOTIFY, NOTIFY_ALIGN_BOTTOM); + + evas_object_show(pCropView->photocam); + + pCropView->PrevRotate = gGetRotationDegree(); +} + +static void +_ivug_crop_view_response_cb( void *data, Evas_Object *obj, void *event_info ) +{ + IV_ASSERT(obj != NULL); + IV_ASSERT(data != NULL); + + MSG_HIGH( "response callback=%d",(int)event_info); + IvugCropView *pCropView = static_cast(data); + + evas_object_hide(obj); // popup + evas_object_del(obj); + + evas_object_smart_callback_call(pCropView->layout, "ok,clicked", pCropView->result_path); + + // Remove view. + evas_object_smart_callback_call(pCropView->layout, "destroyed", NULL); + + //ivug_crop_view_destroy(pCropView); +} + + +static Evas_Object* +_show_exit_popup( Evas_Object *parent, const char *title, const char *desc, void *data) +{ + MSG_HIGH( "title: %s, desc %s", title, desc); + + Evas_Object* style1_popup = elm_popup_add(parent); + evas_object_size_hint_weight_set(style1_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_popup_timeout_set(style1_popup, (double)2.0); + elm_object_text_set(style1_popup, desc); + elm_object_part_text_set(style1_popup, "title,text", title); + + evas_object_smart_callback_add(style1_popup, "timeout", _ivug_crop_view_response_cb, data); + + evas_object_show(style1_popup); + evas_object_layer_set(style1_popup, EVAS_LAYER_MAX); + + return style1_popup; +} + +static char * _ivug_crop_create_name(IvugCropView *pCropView) +{ + char tempname[IVUG_MAX_FILE_PATH_LEN+1] = {0,}; + char *save_file = NULL; + + //evas encoder support jpg, png only + if(pCropView->dest_name) + { + char *dir = NULL; + if(pCropView->dest_dir) + { + dir = strdup(pCropView->dest_dir); + } + else + { + dir = ecore_file_dir_get(pCropView->file_path); + } + snprintf(tempname, sizeof(tempname), "%s/%s.jpg", dir, pCropView->dest_name); + free(dir); + save_file = strdup(tempname); + } + else + { + save_file = ivug_generate_file_name(pCropView->file_path, "jpg", pCropView->dest_dir); + } + + return save_file; +} + +static void _on_btn_save(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + IvugCropView *pCropView = static_cast(data); + + int rx, ry, rw, rh; + Evas_Object *ret_image = NULL; + + char* save_file = _ivug_crop_create_name(pCropView); + + if(save_file == NULL) + { + MSG_ERROR("Cannot generate file name"); + goto SAVE_FAILED; + } + + MSG_HIGH("Save clicked. %s", save_file); + +// Get region + ivug_scissorbox_region_get(pCropView->cropbox, &rx, &ry, &rw, &rh); // Get LCD + MSG_HIGH("SCissorbox Rect:(%d,%d,%d,%d)", rx, ry, rw, rh); + + ret_image = ivug_image_region_image_get(pCropView->photocam, rx, ry, rw, rh); + + if(ret_image == NULL) + { + MSG_ERROR("Region get faied."); + goto SAVE_FAILED; + } + + if (evas_object_image_save(ret_image, save_file, NULL, "quality=100 compress=9") == EINA_FALSE) + { + MSG_ERROR("evas_object_image_save error. %s", save_file); + goto SAVE_FAILED; + } + +// Check again! + { + int fd = open(save_file, O_RDONLY); + if(fd < 0) + { + MSG_ERROR("%s open error[%d]", save_file, fd); + goto SAVE_FAILED; + } + + int ret = close(fd); + if(ret < 0) + { + MSG_ERROR("%s open error[%d]", save_file, ret); + } + } + + pCropView->result_path = strdup(save_file); + + _show_exit_popup(pCropView->layout, IDS_CROP, IDS_SUCCESS, (void *)pCropView); + + evas_object_del(ret_image); + free(save_file); + + return; + +SAVE_FAILED: + _show_exit_popup(pCropView->layout, IDS_CROP, IDS_FAILED, (void *)pCropView); + + if(ret_image) + evas_object_del(ret_image); + if(save_file) + free(save_file); + + return; +} + +static void _on_btn_cancel(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + IvugCropView *pCropView = static_cast(data); + + MSG_HIGH("Cancel clicked"); + + evas_object_smart_callback_call(pCropView->layout, "cancel,clicked", NULL); + + evas_object_smart_callback_call(pCropView->layout, "destroyed", NULL); + + ivug_crop_view_destroy(pCropView); +} + +static Evas_Event_Flags _finger_tap_end(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_HIGH("Finger tab end. evt=%d", p->timestamp); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + IvugCropView *pCropView = static_cast(data); + IV_ASSERT(pCropView != NULL); + + if(pCropView->bShowMenu) + { + MSG_HIGH("Hide"); + elm_win_indicator_mode_set((Evas_Object*)ug_get_window(), ELM_WIN_INDICATOR_HIDE); + evas_object_hide(pCropView->notify); + } + else + { + MSG_HIGH("Show"); + if(gIsDesktopMode() == false) + { + elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_SHOW); + } + evas_object_show(pCropView->notify); + } + + pCropView->bShowMenu = !pCropView->bShowMenu; + + evas_object_smart_callback_call(pCropView->layout, "clicked", (void *)pCropView->bShowMenu); + + return EVAS_EVENT_FLAG_NONE; +} + +void _add_gesture_layer(Evas_Object *parent, IvugCropView *pCropView) +{ + IV_ASSERT(pCropView != NULL); + + Evas_Object *gesture = pCropView->gesture; + + gesture = elm_gesture_layer_add(parent); + elm_gesture_layer_hold_events_set(gesture, EINA_FALSE); + + elm_gesture_layer_cb_set(gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_END, _finger_tap_end, (void *)pCropView); + + if ( elm_gesture_layer_attach(gesture, pCropView->photocam) == EINA_FALSE) + { + MSG_ERROR("Cannot attach event rect"); + } + + evas_object_name_set(gesture, "Crop:Getsture"); +} + +void _ivug_crop_view_box_delete(IvugCropView *pCropView) +{ + IV_ASSERT(pCropView != NULL); + + if ( pCropView->cropbox) + { + evas_object_del(pCropView->cropbox); + pCropView->cropbox = NULL; + } + + return; +} + +IvugCropView *ivug_crop_view_create(Evas_Object *parent) +{ + IvugCropView *pCropView = (IvugCropView *)calloc(1, sizeof(IvugCropView)); + + Evas_Object *layout; + + layout = EFL::create_layout(parent, CROP_EDJ_FILE, "crop_view"); + + if ( layout == NULL ) + { + MSG_ERROR("Cannot create crop view"); + free(pCropView); + return NULL; + } + + pCropView->layout = layout; + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND ); + + pCropView->photocam = ivug_image_create(layout); + ivug_image_animated_set(pCropView->photocam, EINA_FALSE); + ivug_image_hold_set(pCropView->photocam , EINA_TRUE); // Disable mouse events + evas_object_smart_callback_add(pCropView->photocam, "loaded", _on_preloaded, pCropView); + + elm_object_part_content_set(layout, "photocam", pCropView->photocam ); + + pCropView->bShowMenu = true; + //_add_gesture_layer(layout, pCropView); + + pCropView->contents_area = ivug_default_layout_add(parent); + evas_object_name_set(pCropView->contents_area, "contets_area"); + if ( pCropView->contents_area == NULL ) + { + MSG_SETAS_ERROR("Cannot create contets_area."); + } + + elm_object_part_content_set(pCropView->layout, "crop.contents.swallow", pCropView->contents_area); + + pCropView->cropbox = ivug_scissorbox_add(pCropView->contents_area); + ivug_scissorbox_type_set(pCropView->cropbox, SCISSOR_BOX_TYPE_2); + + elm_object_part_content_set(layout, "scissorbox", pCropView->cropbox); + + evas_object_event_callback_add(layout, EVAS_CALLBACK_RESIZE, _on_layout_resized, pCropView ); + + MSG_HIGH("Create CropView"); + + evas_object_smart_callback_add(layout, "test", _on_test, NULL); + + evas_object_show(layout); + + pCropView->w = 0; + pCropView->h = 0; + + return pCropView; +} + +bool ivug_crop_view_box_size_set(IvugCropView *pCropView, int w, int h) +{ + IV_ASSERT(pCropView != NULL); + + pCropView->w = w; + pCropView->h = h; + + return true; +} + +bool ivug_crop_view_box_ratio_fix(IvugCropView *pCropView, bool bFix) +{ + IV_ASSERT(pCropView != NULL); + + ivug_scissorbox_ratio_fix(pCropView->cropbox, bFix); + + return true; +} + +bool ivug_crop_view_file_set(IvugCropView *pCropView, const char *file) +{ + IV_ASSERT(pCropView != NULL); + + Evas_Load_Error err; + + if ( pCropView->file_path ) + { + free(pCropView->file_path); + } + + pCropView->file_path = strdup(file); + + err = ivug_image_file_set(pCropView->photocam, file, "noanim"); + evas_object_smart_callback_call(pCropView->layout, "test", NULL); + + return true; +} + +bool ivug_crop_view_destination_set(IvugCropView *pCropView, const char *dir, const char *name) +{ + MSG_HIGH("ivug_crop_view_destination_set, to %s", dir); + + if(dir) + { + pCropView->dest_dir = strdup(dir); + } + if(name) + { + pCropView->dest_name = strdup(name); + } + + return true; +} + +void ivug_crop_view_destroy(IvugCropView *pCropView) +{ + IV_ASSERT(pCropView != NULL); + + MSG_HIGH("Destroy CropView"); + + if(pCropView->box_timer) + { + ecore_timer_del(pCropView->box_timer); + pCropView->box_timer = NULL; + } + + if ( pCropView->file_path ) + { + free(pCropView->file_path); + pCropView->file_path = NULL; + } + + if ( pCropView->result_path) + { + free(pCropView->result_path); + pCropView->result_path = NULL; + } + + if ( pCropView->dest_dir) + { + free(pCropView->dest_dir); + pCropView->dest_dir = NULL; + } + + if ( pCropView->dest_name) + { + free(pCropView->dest_name); + pCropView->dest_name = NULL; + } + + if ( pCropView->cropbox) + { + evas_object_del(pCropView->cropbox); + pCropView->cropbox = NULL; + } + + if ( pCropView->gesture) + { + evas_object_del(pCropView->gesture); + pCropView->gesture = NULL; + } + + if ( pCropView->photocam ) + { + evas_object_del(pCropView->photocam); + pCropView->photocam = NULL; + } + + if ( pCropView->contents_area) + { + evas_object_del(pCropView->contents_area); + pCropView->contents_area = NULL; + } + + if(pCropView->btn_back) + { + evas_object_del(pCropView->btn_back); + pCropView->btn_back = NULL; + } + + if ( pCropView->notify) + { + evas_object_del(pCropView->notify); + pCropView->notify = NULL; + } + + if ( pCropView->layout ) + { + evas_object_del(pCropView->layout); + pCropView->layout = NULL; + } + + free(pCropView); + + pCropView = NULL; +} + +Evas_Object *ivug_crop_view_get_object(IvugCropView *pCropView) +{ + IV_ASSERT(pCropView != NULL); + + return pCropView->layout; +} + +void ivug_crop_view_create_menu(IvugCropView *pCropView, Evas_Object *navi_bar) +{ + pCropView->btn_ok = ivug_button_add(navi_bar, "naviframe/toolbar/default", + IDS_SAVE, NULL, _on_btn_save, (void *)pCropView); + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(navi_bar); + elm_object_item_part_content_set(navi_it, "toolbar_button1", pCropView->btn_ok); + + elm_object_disabled_set(pCropView->btn_ok, EINA_TRUE); +} + + diff --git a/main/src/view/ivug-details-view.c b/main/src/view/ivug-details-view.c new file mode 100755 index 0000000..0d1aee1 --- /dev/null +++ b/main/src/view/ivug-details-view.c @@ -0,0 +1,485 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-main-view.h" +#include "ivug-string.h" +#include "ivug-file-info.h" + +#include "ivug-details-view.h" +#include "ivug-detail-info.h" + +#include "ivug-drm-common.h" + +#define DETAILS_EDJ_FILE EDJ_PATH"/ivug-details.edj" + +/* + this structure represent one item in genlist. +*/ +typedef struct +{ + char *m_ItemName; + char *m_ItemContents; + exif_info_type_e type; + Ivug_DetailsView *pDetailsView; +} ivug_file_list_item; + + +static char * +_ivug_details_gl_label_get(void *data, Evas_Object *obj, const char *part ) +{ + ivug_file_list_item *params = (ivug_file_list_item *)data; + + ivug_retvm_if(params == NULL, NULL, "params is NULL"); + + Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)params->pDetailsView; + ivug_retvm_if(pDetailsView == NULL, NULL, "pDetailsView is NULL"); + + //MSG_DETAIL_WARN("m_ItemName is %s", params->m_ItemName); + + if(strcmp(part, "elm.text.1") == 0) + { + if(params->m_ItemName) + { + return strdup(params->m_ItemName); + + } + else + { + return strdup(IDS_UNKNOWN); + } + } + else if(strcmp(part, "elm.text.2")==0) + { + if (params->m_ItemContents) { + return elm_entry_utf8_to_markup(params->m_ItemContents); + } else { + return elm_entry_utf8_to_markup(IDS_UNKNOWN); + } + } + + else + { + return NULL; + } + +} + +static void +_ivug_details_gl_del(void *data, Evas_Object *obj ) +{ + ivug_ret_if(NULL == data); + + ivug_file_list_item *params = (ivug_file_list_item *)data; + + ivug_retm_if(params == NULL, "params is NULL"); + if(params) + { + if(params->m_ItemName) + { + free(params->m_ItemName); + params->m_ItemName = NULL; + } + if(params->m_ItemContents) + { + free(params->m_ItemContents); + params->m_ItemContents = NULL; + } + free(params); + params = NULL; + } + + return; +} + +static char* +_ivug_details_gl_label_get_title(void *data, Evas_Object *obj,const char *part ) +{ + ivug_retv_if(NULL == data, NULL); + + if (!strcmp(part, "elm.text")) + { + return strdup(data); + } + + return NULL; +} + +static void _rename_button_clicked_cb(void *data, Evas_Object * obj, void *event_info) +{ + Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)data; + + MSG_DETAIL_HIGH("clicked event on Button"); + + evas_object_smart_callback_call(pDetailsView->layout, "rename,clicked", (void *)pDetailsView); + + return; +} + +static Evas_Object *_ivug_details_gl_icon_get_title(void *data, Evas_Object *obj, const char *part) +{ + ivug_file_list_item *params = (ivug_file_list_item *)data; + + ivug_retvm_if(params == NULL, NULL, "params is NULL"); + + Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)params->pDetailsView; + ivug_retvm_if(pDetailsView == NULL, NULL, "pDetailsView is NULL"); + + Evas_Object *btn = NULL; + + if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1")) { + btn = elm_button_add(pDetailsView->layout); + elm_object_style_set(btn, "rename"); + evas_object_smart_callback_add(btn, "clicked", _rename_button_clicked_cb, (void *)pDetailsView); + } + + return btn; +} + +static Eina_Bool +_ivug_details_gl_state_get(void *data, Evas_Object *obj, const char *part ) +{ + return EINA_FALSE; +} + +static Evas_Object * +_ivug_details_view_genlist_create(Ivug_DetailsView *pDetailsView, Evas_Object *parent) +{ + IV_ASSERT(pDetailsView != NULL); + + Evas_Object *genlist = NULL; + genlist = elm_genlist_add(parent); + + ivug_retvm_if(NULL == genlist, NULL, "Create Details genlist failed.."); + + elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS); + + elm_object_theme_set(genlist, gGetSystemTheme()); + + memset(&pDetailsView->itc, 0, sizeof(Elm_Genlist_Item_Class) ); + + pDetailsView->itc.version = ELM_GENLIST_ITEM_CLASS_VERSION; + pDetailsView->itc.item_style = "ivug/2text.2"; + pDetailsView->itc.func.text_get = _ivug_details_gl_label_get; + pDetailsView->itc.func.content_get = NULL; + pDetailsView->itc.func.state_get = _ivug_details_gl_state_get; + pDetailsView->itc.func.del = _ivug_details_gl_del; + + memset(&pDetailsView->title_itc, 0, sizeof(Elm_Genlist_Item_Class) ); + + // Set item class for dialogue group title + pDetailsView->title_itc.version = ELM_GENLIST_ITEM_CLASS_VERSION; + pDetailsView->title_itc.item_style = "grouptitle"; + pDetailsView->title_itc.func.text_get = _ivug_details_gl_label_get_title; + pDetailsView->title_itc.func.content_get = NULL; + pDetailsView->title_itc.func.state_get = NULL; + pDetailsView->title_itc.func.del = NULL; + + memset(&pDetailsView->multiline_icon_itc, 0, sizeof(Elm_Genlist_Item_Class) ); + + // Set item class for dialogue group title with icon + pDetailsView->multiline_icon_itc.version = ELM_GENLIST_ITEM_CLASS_VERSION; + pDetailsView->multiline_icon_itc.item_style = "ivug/multiline/2text.5icon"; + pDetailsView->multiline_icon_itc.func.text_get = _ivug_details_gl_label_get; + pDetailsView->multiline_icon_itc.func.content_get = _ivug_details_gl_icon_get_title; + pDetailsView->multiline_icon_itc.func.state_get = NULL; + pDetailsView->multiline_icon_itc.func.del = NULL; + + memset(&pDetailsView->multiline_itc, 0, sizeof(Elm_Genlist_Item_Class) ); + + pDetailsView->multiline_itc.version = ELM_GENLIST_ITEM_CLASS_VERSION; + pDetailsView->multiline_itc.item_style = "ivug/multiline/2text"; + pDetailsView->multiline_itc.func.text_get = _ivug_details_gl_label_get; + pDetailsView->multiline_itc.func.content_get = NULL; + pDetailsView->multiline_itc.func.state_get = NULL; + pDetailsView->multiline_itc.func.del = _ivug_details_gl_del; + + return genlist; +} + +static void +_ivug_detail_genlist_view_exif_info_create(Ivug_DetailsView *pDetailsView, const char *path, Media_Type stype) +{ + IV_ASSERT(pDetailsView != NULL); + + Evas_Object *genlist = NULL; + int index = 0; + bool ret = false; + + Elm_Object_Item *it = NULL; + + ivug_file_list_item *m_TempItem = NULL; + + genlist = pDetailsView->genlist; + + char *name = NULL; + char *contents = NULL; + + for (index = 0; index < EXIF_INFO_MAX; index++) + { + ret = ivug_datail_get_exif_info(&name, &contents, path, stype, index); + if(ret == false) + { + continue; + } + + m_TempItem = (ivug_file_list_item *)calloc(1, sizeof(ivug_file_list_item)); + ivug_retm_if(NULL == m_TempItem, "m_TempItem calloc failed"); + + m_TempItem->m_ItemName = name; + m_TempItem->m_ItemContents = contents; + m_TempItem->pDetailsView = pDetailsView; + + it = elm_genlist_item_append(genlist, &pDetailsView->multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + } + +} + +static void +_ivug_detail_genlist_view_file_view_create(Ivug_DetailsView *pDetailsView, const char *path, Media_Type stype) +{ + IV_ASSERT(pDetailsView != NULL); + + Evas_Object *genlist = NULL; + int index = 0; + + Elm_Object_Item *git = NULL; + Elm_Object_Item *it = NULL; + + ivug_file_list_item *m_TempItem = NULL; + + genlist = pDetailsView->genlist; + + char *name = NULL; + char *contents = NULL; + bool ret = false; + + git = elm_genlist_item_append(genlist, &pDetailsView->title_itc, strdup(IDS_DETAILS), NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL); + elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + + for (index = 0; index < FILE_INFO_MAX; index++) + { + ret = ivug_datail_get_file_info(&name, &contents, path, stype, index); + if(ret == false) + { + continue; + } + + m_TempItem = (ivug_file_list_item *)calloc(1, sizeof(ivug_file_list_item)); + if(m_TempItem == NULL) + { + continue; + } + + m_TempItem->m_ItemName = name; + if(index == FILE_INFO_NAME) + { + pDetailsView->filename = &(m_TempItem->m_ItemContents); // for rename + } + else if(index == FILE_INFO_FILE_LOCATION) + { + pDetailsView->path = &(m_TempItem->m_ItemContents); // for rename + } + m_TempItem->m_ItemContents = contents; + m_TempItem->pDetailsView = pDetailsView; + + if(index == 0) // for rename icon + { + it = elm_genlist_item_append(genlist, &pDetailsView->multiline_icon_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + } + else + { + it = elm_genlist_item_append(genlist, &pDetailsView->multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + } + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + } +} + +static void +_ivug_detail_genlist_view_drm_create(Ivug_DetailsView *pDetailsView, const char *path, Media_Type stype) +{ + IV_ASSERT(pDetailsView != NULL); + + Evas_Object *genlist = NULL; + int index = 0; + + Elm_Object_Item *it = NULL; + + ivug_file_list_item *m_TempItem = NULL; + + genlist = pDetailsView->genlist; + + char *name = NULL; + char *contents = NULL; + bool ret = false; + + for (index = 0; index < DRM_INFO_MAX; index++) + { + name = NULL; + contents = NULL; + ret = ivug_datail_get_drm_info(&name, &contents, path, stype, index); + if(ret == false) + { + continue; + } + + m_TempItem = (ivug_file_list_item *)calloc(1, sizeof(ivug_file_list_item)); + if(m_TempItem == NULL) + { + continue; + } + + m_TempItem->m_ItemName = name; + m_TempItem->m_ItemContents = contents; + m_TempItem->pDetailsView = pDetailsView; + + it = elm_genlist_item_append(genlist, &pDetailsView->multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY); + } + +} + +Ivug_DetailsView * +ivug_details_view_screen_create(Evas_Object *parent, Media_Item *mitem, ivug_view_by view_by) +{ + ivug_retv_if(!parent, NULL); + ivug_retv_if(!mitem, NULL); + + Media_Data *mdata = ivug_medialist_get_data(mitem); + ivug_retv_if(!mdata, NULL); + ivug_retv_if(!mdata->filepath, NULL); + + char *filepath = mdata->filepath; + Media_Type stype = mdata->slide_type; + + Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)calloc(1, sizeof(Ivug_DetailsView)); + if ( pDetailsView == NULL ) + { + MSG_DETAIL_FATAL("Cannot allocate memory"); + return NULL; + } + + pDetailsView->mitem = mitem; + +// Creating GUI + pDetailsView->evas = evas_object_evas_get(parent); + +//layout + + pDetailsView->layout = ivug_layout_add2(parent, DETAILS_EDJ_FILE, "details_view"); + if(pDetailsView->layout == NULL) + { + free(pDetailsView); + return NULL; + } + +#define IVUG_DETAILS_BG_ALPHA 200 + + pDetailsView->bg = evas_object_rectangle_add(evas_object_evas_get(pDetailsView->layout)); + if (pDetailsView->bg) + { + evas_object_size_hint_expand_set(pDetailsView->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(pDetailsView->bg, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(pDetailsView->bg, IVUG_DEFAULT_BG_COLOR, + IVUG_DEFAULT_BG_COLOR, IVUG_DEFAULT_BG_COLOR, IVUG_DETAILS_BG_ALPHA); + elm_object_part_content_set(pDetailsView->layout, "details_view.swallow.bg", + pDetailsView->bg); + } + + //create genlist + Evas_Object *genlist = NULL; + + genlist = _ivug_details_view_genlist_create(pDetailsView, pDetailsView->layout); + pDetailsView->genlist = genlist; + + _ivug_detail_genlist_view_file_view_create(pDetailsView, filepath, stype); + + if(mdata->bIsDRMContent == EINA_TRUE) + { + _ivug_detail_genlist_view_drm_create(pDetailsView, filepath, stype); + } + else + { + _ivug_detail_genlist_view_exif_info_create(pDetailsView, filepath, stype); + } + + elm_object_part_content_set(pDetailsView->layout, "details_view.genlist" , pDetailsView->genlist ); + + MSG_DETAIL_HIGH("Detail view(0x%08x) created for %s", pDetailsView, filepath); + + return pDetailsView; +} + + +Evas_Object * +ivug_details_view_object_get(Ivug_DetailsView *pDetailsView) +{ + IV_ASSERT(pDetailsView != NULL); + + return pDetailsView->layout; +} + +void +ivug_details_view_destroy(Ivug_DetailsView *pDetailsView) +{ + IV_ASSERT(pDetailsView != NULL); + MSG_DETAIL_HIGH("Removing Details VIew"); + +// Layout removed automatically when popping from navi item. + if (pDetailsView->genlist) { + elm_genlist_clear(pDetailsView->genlist); + pDetailsView->genlist = NULL; + } + if(pDetailsView->bg) + { + evas_object_del(pDetailsView->bg); + pDetailsView->bg = NULL; + } + + if(pDetailsView->layout) + { + evas_object_del(pDetailsView->layout); + pDetailsView->layout = NULL; + } + + free(pDetailsView); + + pDetailsView = NULL; +} + +void ivug_details_view_update(Ivug_DetailsView *pDetailsView, const char *new_path) +{ + MSG_IVUG_HIGH("ivug_details_view_update"); + + free(*(pDetailsView->filename)); + *(pDetailsView->filename) = ecore_file_strip_ext(ecore_file_file_get(new_path)); + + free(*(pDetailsView->path)); + *(pDetailsView->path) = strdup(new_path); + //elm_genlist_realized_items_update(pDetailsView->genlist); + Elm_Object_Item *item = NULL; + if (pDetailsView->genlist) { + item = elm_genlist_first_item_get(pDetailsView->genlist); + while (item) { + elm_genlist_item_update(item); + item = elm_genlist_item_next_get(item); + } + } +} + diff --git a/main/src/view/ivug-main-view-menu.cpp b/main/src/view/ivug-main-view-menu.cpp new file mode 100755 index 0000000..048d62a --- /dev/null +++ b/main/src/view/ivug-main-view-menu.cpp @@ -0,0 +1,1977 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-main-view.h" +#include "ivug-main-view-toolbar.h" +#include "ivug-main-view-menu.h" +#include "ivug-main-view-priv.h" + +#include "ivug-slider.h" +#include "ivug-slider-item.h" + +#include "ivug-listpopup.h" +#include "ivug-ext-ug.h" +#include "ivug-popup.h" +#include "ivug-selectioninfo.h" + +#include "ivug-media.h" +#include "ivug-slideshow.h" + +#include "ivug-file-info.h" +#include "ivug-exif.h" + +#include // ug_destroy_me, ug_send_result +#include +#include //app_manager_get_app_name + +#include "ivug-crop-view.h" + + + +#include // media_file_register + +#define IVUG_DEFINE_EXIF_ROTATE + +#define GALLERY_PKG_NAME "org.tizen.gallery" +#define SHORTCUT_PREFIX "gallery:imageviewer:" +#define SHORTCUT_PREFIX_LEN strlen(SHORTCUT_PREFIX) +#define SHORTCUT_ICON_PATH "/usr/share/icons/default/small/org.tizen.image-viewer.png" + +static void +_on_ext_ug_destroy_cb(ui_gadget_h ug, void *priv) +{ + if (!ug ) return; + + Ivug_MainView *pMainView = (Ivug_MainView *)priv; + + MSG_IMAGEVIEW_HIGH("UG destroyed"); + + pMainView->ext_ug = NULL; + + ivug_main_view_set_hide_timer(pMainView); +} + +static void _on_selectioninfo_deleted(void * data, Evas * e, Evas_Object * obj, void * event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("selection info deleted"); + + pMainView->selectioninfo = NULL; +} + +void _ivug_selectioninfo_create(Ivug_MainView *pMainView, const char *string) +{ + IV_ASSERT(pMainView != NULL); + + if(pMainView->selectioninfo) + { + evas_object_del(pMainView->selectioninfo); + pMainView->selectioninfo = NULL; + } + + pMainView->selectioninfo = ivug_selectioninfo_create(pMainView->layout, string); + IV_ASSERT(pMainView->selectioninfo != NULL); + + evas_object_event_callback_add(pMainView->selectioninfo, EVAS_CALLBACK_DEL, _on_selectioninfo_deleted, pMainView); +} + + +void _delete_details_view(Ivug_MainView *pMainView ) +{ + Evas_Object *detail_view_layout = elm_object_item_part_content_unset(pMainView->navi_it, "elm.swallow.detail"); + + MSG_MAIN_HIGH("Delete detail view. old layout=0x%08x", detail_view_layout); + + ivug_details_view_destroy(pMainView->pDetailsView); // Delete detail view. + pMainView->pDetailsView = NULL; + +} + + +static void _on_add_tag_view_destroy(void *data, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("transition finished"); + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + ivug_name_view_destroy(pMainView->pNameView); + pMainView->pNameView = NULL; // Will removed in add tag view. + + evas_object_smart_callback_del(pMainView->navi_bar, "transition,finished", + _on_add_tag_view_destroy); +} + +static void _on_add_tag_view_response(ivug_name_response resp, const char *str, void *pClientData) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)pClientData; + bool ret = false; + Media_Item *mitem = NULL; + Media_Data *mdata = NULL; + + Evas_Object *conformant = NULL; + + switch(resp) + { + case NAME_VIEW_RESPONSE_OK: + mitem = ivug_slider_get_item(pMainView->slider); + mdata = ivug_medialist_get_data(mitem); + + ret = ivug_mediadata_set_tag(mdata, str); + if(ret == false) + { + MSG_MAIN_ERROR("ivug_mediadata_set_tag failed: ret = %d", ret); + _ivug_selectioninfo_create(pMainView, IDS_FAILED); + } + else + { + MSG_MAIN_HIGH("New tags is added"); + _ivug_selectioninfo_create(pMainView, IDS_ADDED); + } + evas_object_smart_callback_add(pMainView->navi_bar, "transition,finished", + _on_add_tag_view_destroy, pMainView); + + elm_naviframe_item_pop(pMainView->navi_bar); + + pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar); + + conformant = (Evas_Object *)ug_get_conformant(); + elm_object_signal_emit(conformant, "elm,state,indicator,overlap", ""); + break; + case NAME_VIEW_RESPONSE_CANCEL: + MSG_MAIN_HIGH("Add tag is canceled"); + evas_object_smart_callback_add(pMainView->navi_bar, "transition,finished", + _on_add_tag_view_destroy, pMainView); + + elm_naviframe_item_pop(pMainView->navi_bar); + + pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar); + + conformant = (Evas_Object *)ug_get_conformant(); + elm_object_signal_emit(conformant, "elm,state,indicator,overlap", ""); + break; + default: + MSG_MAIN_ERROR("Unhandled mode : %d", resp); + break; + } + + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_TRUE); + elm_object_item_signal_emit(pMainView->navi_it, "elm,state,toolbar,open", ""); + + ivug_main_view_set_hide_timer(pMainView); +} + +static void +_on_setasview_deleted(void *data, Evas *e , Evas_Object *obj , void *event_info ) +{ + ivug_retm_if(!data, "data is NULL"); + Ivug_MainView *pMainView = (Ivug_MainView *)data; + MSG_MAIN_HIGH("SetAS View is destroyed"); + + pMainView->pSetAsView = NULL; + + ivug_main_view_set_hide_timer(pMainView); +} + +static void _on_setas_view_destroyed(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + elm_naviframe_item_pop(pMainView->navi_bar); + + pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar); + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,overlap", ""); + + if(pMainView->pSetAsView) + { + ivug_setas_view_destroy(pMainView->pSetAsView); + pMainView->pSetAsView = NULL; + } +} + +static void +_on_timeout_response(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + Ivug_MainView *pMainView = (Ivug_MainView *)data; + ivug_main_view_set_hide_timer(pMainView); +} + + +void _on_share_selected(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView->ext_ug == NULL); + + Ivug_ListPopup_Item *item = (Ivug_ListPopup_Item *)event_info; + + const char *label = (const char *)ivug_listpopup_item_get_data(item); + + if(label == NULL) + { + MSG_MAIN_ERROR("label is NULL"); + evas_object_del(obj); + ivug_main_view_set_hide_timer(pMainView); + return; + } + MSG_MAIN_HIGH("text(%s) is clicked", label); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + if(mdata == NULL) + { + MSG_MAIN_ERROR("sd is NULL"); + evas_object_del(obj); + return; + } + + char *path = NULL; + path = mdata->filepath; + + bool ret = false; + ret = ivug_ext_launch_to_send(path, label, _on_ext_ug_destroy_cb, data, pMainView->ext_ug); + + /* appsvc failed or ug_create failed */ + if(ret == false) + { + ivug_timeout_popup_show(pMainView->layout, _on_timeout_response, pMainView, NULL, IDS_APPLICATION_NOT_INSTALLED); + } + + evas_object_del(obj); +} + +static void _ivug_crop_view_transit_finished_cb(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + ivug_crop_view_destroy(pMainView->pCropView); + + pMainView->pCropView = NULL; + + evas_object_smart_callback_del(pMainView->navi_bar, "transition,finished", + _ivug_crop_view_transit_finished_cb); +} + +static void _ivug_crop_view_destroyed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + ivug_main_view_set_hide_timer(pMainView); + + evas_object_smart_callback_add(pMainView->navi_bar, "transition,finished", + _ivug_crop_view_transit_finished_cb, pMainView); + + _ivug_crop_view_box_delete(pMainView->pCropView); + + elm_naviframe_item_pop(pMainView->navi_bar); + pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar); + + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_TRUE); + + _update_title(pMainView); // after crop index changed + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,overlap", ""); +} + +#if 0 +static void _create_setas_view(Ivug_MainView *pMainView, const char *filepath, ivug_set_screen_type type) +{ + pMainView->pSetAsView = ivug_setas_view_screen_create(pMainView->layout, filepath, + IVUG_SETAS_NORMAL, type); + Evas_Object *setasOjbect = ivug_setas_view_object_get(pMainView->pSetAsView); + //evas_object_event_callback_add(setasOjbect, EVAS_CALLBACK_DEL, _on_setasview_deleted, pMainView); + evas_object_smart_callback_add(setasOjbect, "destroy", _on_setas_view_destroyed, pMainView); + + Evas_Object *back_btn = ivug_button_add(pMainView->navi_bar, "naviframe/end_btn/default", + IDS_BACK, NULL, _on_setas_view_destroyed, pMainView); + + pMainView->navi_it = elm_naviframe_item_push(pMainView->navi_bar, + NULL, back_btn, NULL, setasOjbect, NULL); + + ivug_setas_view_create_menu(pMainView->pSetAsView, pMainView->navi_bar, type); +} +#else + +static void _ivug_crop_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + char *path = (char *)event_info; + media_handle m_handle = NULL; + + MSG_MAIN_HIGH("_ivug_crop_view_ok_clicked_cb path = %d", path); + + evas_object_smart_callback_del(obj, "ok,clicked", _ivug_crop_view_ok_clicked_cb); + + m_handle = ivug_db_insert_file_to_DB(path); + if(m_handle == NULL) + { + MSG_MAIN_ERROR("ivug_db_insert_file_to_DB failed %s", path); + } + else + { + ivug_db_destroy_file_handle(m_handle); +} + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + Media_Item *mitem = ivug_medialist_prepend_item(pMainView->mList, path); + + Media_Item *c_mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *c_mdata = ivug_medialist_get_data(c_mitem); + if(c_mdata->index == 1) //left slide item added + { + MSG_MAIN_ERROR("add left slide item"); + ivug_slider_set_item_to_slide(pMainView->slider, PREV_SLIDE, mitem); + } +} + +static void _ivug_setas_view_ok_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + char *path = (char *)event_info; + + MSG_MAIN_HIGH("_ivug_setas_view_ok_clicked_cb path = %d", path); + + evas_object_smart_callback_del(obj, "ok,clicked", _ivug_crop_view_ok_clicked_cb); + + // do not insert to db + + int setas_data = (int)evas_object_data_get(obj, "setas_type"); + ivug_set_screen_type type = (ivug_set_screen_type)setas_data; + + const char* homescreen_path = IVUG_HOME_SCREEN_PATH; + const char* lockscreen_path = IVUG_LOCK_SCREEN_PATH; + + if(type == IVUG_CTRLBAR_SET_SCREEN_HOME) + { + ivug_copy_file(path, homescreen_path); + ivug_config_set_homescreen_image(homescreen_path); + } + else if(type == IVUG_CTRLBAR_SET_SCREEN_LOCK) + { + ivug_copy_file(path, lockscreen_path); + ivug_config_set_lockscreen_image(lockscreen_path); + } + else if(type == IVUG_CTRLBAR_SET_SCREEN_BOTH) + { + ivug_copy_file(path, homescreen_path); + ivug_config_set_homescreen_image(homescreen_path); + ivug_copy_file(path, lockscreen_path); + ivug_config_set_lockscreen_image(lockscreen_path); + } +} + +static void _create_setas_view(Ivug_MainView *pMainView, const char *filepath, ivug_set_screen_type type) +{ + IvugCropView *pCropView = ivug_crop_view_create(pMainView->layout); + + int lcd_x = 0; + int lcd_y = 0; + int lcd_w = 0; + int lcd_h = 0; + int rot = 0; + + Evas_Object *layout = ivug_crop_view_get_object(pCropView); + + evas_object_smart_callback_add(layout, "ok,clicked", _ivug_setas_view_ok_clicked_cb, pMainView); + evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, pMainView); + + evas_object_data_set(layout, "setas_type", (void *)type); + + Evas_Object *btn_back = ivug_button_add(layout, "naviframe/end_btn/default", + IDS_BACK, NULL, _ivug_crop_view_destroyed_cb, pMainView); + + pMainView->navi_it = elm_naviframe_item_push(pMainView->navi_bar, NULL, btn_back, NULL, pCropView->layout, NULL); + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + ivug_crop_view_create_menu(pCropView, pMainView->navi_bar); + + ivug_crop_view_file_set(pCropView, filepath); + + ivug_crop_view_destination_set(pCropView, DATA_PATH, ".iv_setas.jpg"); + + evas_object_geometry_get((Evas_Object *)ug_get_window(), &lcd_x, &lcd_y, &lcd_w, &lcd_h); + rot = gGetRotationDegree(); + if(rot == 90 || rot == 270) + { + int temp = lcd_w; + lcd_w = lcd_h; + lcd_h = temp; + } + + ivug_crop_view_box_size_set(pCropView, lcd_w, lcd_h); + + ivug_crop_view_box_ratio_fix(pCropView, true); + + pMainView->pCropView = pCropView; + + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_FALSE); +} +#endif + +void _on_setas_selected(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + Ivug_ListPopup_Item *item = (Ivug_ListPopup_Item *)event_info; + + const char *label = (const char *)ivug_listpopup_item_get_data(item); + + if(label == NULL) + { + MSG_MAIN_ERROR("label is NULL"); + evas_object_del(pMainView->ctx_popup2); + pMainView->ctx_popup2 = NULL; + ivug_main_view_set_hide_timer(pMainView); + return; + } + MSG_MAIN_HIGH("text(%s) is clicked", label); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + if(mdata == NULL) + { + MSG_MAIN_ERROR("sd is NULL"); + evas_object_del(pMainView->ctx_popup2); + pMainView->ctx_popup2 = NULL; + ivug_main_view_set_hide_timer(pMainView); + return; + } + + if(strncmp(label, IDS_HOME_SCREEN, strlen(label)) == 0) + { + _create_setas_view(pMainView, mdata->filepath, IVUG_CTRLBAR_SET_SCREEN_HOME); + } + else if(strncmp(label, IDS_LOCK_SCREEN, strlen(label)) == 0) + { + _create_setas_view(pMainView, mdata->filepath, IVUG_CTRLBAR_SET_SCREEN_LOCK); + } + else if(strncmp(label, IDS_HOME_AND_LOCK_SCREENS, strlen(label)) == 0) + { + _create_setas_view(pMainView, mdata->filepath, IVUG_CTRLBAR_SET_SCREEN_BOTH); + } + else if(strncmp(label, IDS_CALLER_IMAGE, strlen(label)) == 0) + { + pMainView->ext_ug = ivug_ext_launch_contact(mdata->filepath, _on_ext_ug_destroy_cb, data); + } + + evas_object_del(pMainView->ctx_popup2); + pMainView->ctx_popup2 = NULL; +} + + +void _on_addtag_selected(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + Ivug_ListPopup_Item *item = (Ivug_ListPopup_Item *)event_info; + + const char *label = (const char *)ivug_listpopup_item_get_data(item); + + if(label == NULL) + { + MSG_MAIN_ERROR("label is NULL"); + evas_object_del(pMainView->ctx_popup2); + pMainView->ctx_popup2 = NULL; + ivug_main_view_set_hide_timer(pMainView); + return; + } + + MSG_MAIN_HIGH("text(%s) is clicked", label); + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + if(mdata == NULL) + { + MSG_MAIN_ERROR("sd is NULL"); + evas_object_del(pMainView->ctx_popup2); + pMainView->ctx_popup2 = NULL; + ivug_main_view_set_hide_timer(pMainView); + return; + } + + if(strncmp(label, IDS_CREATE_TAG, strlen(label)) == 0) + { + pMainView->pNameView = ivug_name_view_create(pMainView->layout, IDS_CREATE_TAG); + + ivug_name_view_set_max_length(pMainView->pNameView, MAX_BYTE_LEN); + + ivug_name_view_set_response_callback(pMainView->pNameView, _on_add_tag_view_response, (void*)pMainView); + + Evas_Object *layout = ivug_name_view_object_get(pMainView->pNameView); + + pMainView->navi_it = elm_naviframe_item_push(pMainView->navi_bar, NULL, NULL, NULL, layout, NULL); + + Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_FALSE); + elm_object_item_signal_emit(pMainView->navi_it, "elm,state,toolbar,close", ""); + + ivug_name_view_set_focus(pMainView->pNameView); + } + else if(strncmp(label, IDS_FAVOURITES, strlen(label)) == 0) + { + if ( ivug_mediadata_set_favorite(mdata, true) == false ) + { + MSG_MAIN_ERROR("Error!. Set favorite for ID=%s", uuid_getchar(mdata->mediaID)); + goto ADD_FAIL; + } + + _ivug_selectioninfo_create(pMainView, IDS_ADDED); + ivug_main_view_set_hide_timer(pMainView); + } + else + { + bool ret = ivug_mediadata_set_tag(mdata, (char *)label); + if(ret == true) + { + _ivug_selectioninfo_create(pMainView, IDS_ADDED); + } + else + { + goto ADD_FAIL; + } + ivug_main_view_set_hide_timer(pMainView); + } + + evas_object_del(pMainView->ctx_popup2); + pMainView->ctx_popup2 = NULL; + + return; +ADD_FAIL: + _ivug_selectioninfo_create(pMainView, IDS_FAILED); + evas_object_del(pMainView->ctx_popup2); + pMainView->ctx_popup2 = NULL; + + ivug_main_view_set_hide_timer(pMainView); + + return; + +} + + +#ifndef USE_DEFAULT_DOWNLOADS_FOLDER + +void _on_save_selected(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + ivug_listpopup_item *item = (ivug_listpopup_item *)event_info; + + if ( item == NULL ) // No item is selected + { + evas_object_del(pMainView->popup); + pMainView->popup = NULL; + ivug_main_view_set_hide_timer(pMainView); + return; + } + MSG_MAIN_HIGH("Selected folder name = %s", item->caption); + + char *dir_path = (char *)item->data; // Should be freed + char dst_file[IVUG_MAX_FILE_PATH_LEN + 1] = {0,}; + const char *filename = NULL; + int ret = -1; + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + if ( mdata == NULL ) + { + MSG_MAIN_ERROR("Cannot get slide data."); + goto SAVE_FAIL; + } + + filename = ecore_file_file_get(mdata->filepath); + if (filename == NULL) + { + MSG_MAIN_ERROR("File does not existfilepath=%s", mdata->filepath); + goto SAVE_FAIL; + } + + snprintf(dst_file, IVUG_MAX_FILE_PATH_LEN, "%s/%s", dir_path, filename); + + if(!ecore_file_cp(mdata->filepath, dst_file)) + { + MSG_MAIN_ERROR("ecore_file_cp failed. From %s To %s", mdata->filepath, dst_file); + goto SAVE_FAIL; + } + + free(dir_path); + + ret = media_file_register(dst_file); + if(ret < 0) + { + MSG_MAIN_ERROR("Cannot add to album file %s. ret=%d", dst_file, ret); + _ivug_selectioninfo_create(pMainView, IDS_FAILED); + } + else + { + _ivug_selectioninfo_create(pMainView, IDS_SAVED); + } + + evas_object_del(pMainView->popup); + pMainView->popup = NULL; + + ivug_main_view_set_hide_timer(pMainView); + + return; + +SAVE_FAIL: + if(dir_path) + free(dir_path); + + _ivug_selectioninfo_create(pMainView, IDS_FAILED); + + evas_object_del(pMainView->popup); + pMainView->popup = NULL; + + ivug_main_view_set_hide_timer(pMainView); + + return; +} + +#endif + +static void +_on_delete_selected(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + int response_id = (int)event_info; + if(response_id == POPUP_RESPONSE_CANCEL) + { + MSG_MAIN_HIGH("cancel selected"); + ivug_main_view_set_hide_timer(pMainView); + return; + } + + if(pMainView->pDetailsView) + { + MSG_MAIN_HIGH("Delete details view."); + //_change_close_to_details(pMainView); + _delete_details_view(pMainView); + } + + MSG_MAIN_HIGH("Removing current slide."); + + ivug_main_view_set_hide_timer(pMainView); + + _ivug_selectioninfo_create(pMainView, IDS_DELETED); + + ivug_slider_delete_item(pMainView->slider); // this routine fire "item.changed" +} + +static void +_on_rename_selected(void *data, Evas_Object *obj, void *event_info) +{ + int response_id = (int)event_info; + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + MSG_MAIN_HIGH("DRM popup selected : %d", response_id); + + if(response_id == POPUP_RESPONSE_CANCEL) + { + MSG_MAIN_HIGH("cancel selected"); + } + else + { + MSG_MAIN_HIGH("unlock process"); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + IV_ASSERT(mdata != NULL); + + const char *old_fullpath = mdata->filepath; + char *old_dir = ecore_file_dir_get(old_fullpath); + char *ext = ivug_fileinfo_get_file_extension(old_fullpath); + + Evas_Object *popup = obj; + Evas_Object *layout = elm_object_content_get(popup); + Evas_Object *entry = elm_object_part_content_get(layout, "elm.swallow.content"); + + const char *new_name = elm_entry_entry_get(entry); + char new_fullpath[IVUG_MAX_FILE_PATH_LEN] = {0,}; + snprintf(new_fullpath, sizeof(new_fullpath),"%s/%s.%s", old_dir, new_name, ext); + + if(ivug_rename_file(old_fullpath, new_fullpath) == false) + { + MSG_MAIN_ERROR("ivug_rename_file failed"); + } + else + { + MSG_MAIN_HIGH("Rename %s -> %s", old_fullpath, new_fullpath); + free(mdata->filepath); + mdata->filepath = strdup(new_fullpath); + } + } + ivug_main_view_set_hide_timer(pMainView); +} + + + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// Button handlers +// + +static void _dismissed_cb(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + //evas_object_del(obj); + ivug_main_view_set_hide_timer(pMainView); + + if(pMainView->popup) //for tag popup + { + MSG_MAIN_HIGH("Removing popup 1"); + evas_object_del(pMainView->popup); + pMainView->popup = NULL; + } + else + { + MSG_MAIN_HIGH("Removing popup 2"); + evas_object_del(obj); + } + + + MSG_MAIN_HIGH("Popup dismissed"); +} + +#ifndef USE_DEFAULT_DOWNLOADS_FOLDER +static bool +_iter_album_list(media_handle media, void *user_data) +{ + ivug_listpopup_itemlist items = (ivug_listpopup_itemlist)user_data; + + char *name = ivug_db_get_folder_name(media); + char *path = ivug_db_get_folder_path(media); + + if(strlen(name) == 0) + { + ivug_listpopup_itemlist_add(items, 0, NULL, IDS_NO_NAME, (void *)strdup(path), false); + } + else + { + ivug_listpopup_itemlist_add(items, 0, NULL, name, (void *)strdup(path), false); + } + + if(name) + free(name); + if(path) + free(path); + + return 0; +} +#endif + + +static bool +_iter_tag_list(media_handle media, void *user_data) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)user_data; + + char *name = ivug_db_get_tag_name((tag_handle)media); + + if(pMainView->ctx_popup2) + { + ivug_listpopup_item_append(pMainView->ctx_popup2, NULL, name, name); + } + else if(pMainView->popup) + { + ivug_listpopup_item_append(pMainView->popup, NULL, name, name); + } + + MSG_IVUG_HIGH("tag name =%s", name); + + return 0; +} + + +void on_btn_back_clicked(void *data, Evas_Object *obj, void *event_info) +{ +// Back from main view + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_WARN("Back key from main view pressed"); + + if ( pMainView->pDetailsView ) + { + MSG_MAIN_HIGH("Details View Destroy"); + + ivug_details_view_destroy(pMainView->pDetailsView); + pMainView->pDetailsView = NULL; + return; + } + +// otherwise, from gallery, ug will be terminated + evas_object_smart_callback_del(obj, "clicked", on_btn_back_clicked); + +#ifndef FIX_LAST_BLINK + ivug_main_view_del_hide_timer(pMainView); + +// Slider should be removed before mList is freed. + if ( pMainView->slider ) + { + evas_object_del(pMainView->slider); + pMainView->slider = NULL; + } + + if ( pMainView->pNameView ) + { + MSG_MAIN_HIGH("Name View Destroy"); + ivug_name_view_destroy(pMainView->pNameView); + pMainView->pNameView = NULL; + } + + if ( pMainView->pSetAsView ) + { + MSG_MAIN_HIGH("SetAS View Destroy"); + ivug_setas_view_destroy(pMainView->pSetAsView); + pMainView->pSetAsView = NULL; + } + + if ( pMainView->pDetailsView ) + { + MSG_MAIN_HIGH("Details View Destroy"); + + ivug_details_view_destroy(pMainView->pDetailsView); + pMainView->pDetailsView = NULL; + } + + +#if 1 + if(pMainView->layout) // Remove topmost parent in main view. + { + evas_object_del(pMainView->layout); + pMainView->layout = NULL; + } + + if(pMainView->empty_layout) + { + evas_object_del(pMainView->empty_layout); + pMainView->empty_layout = NULL; + } +#else + +#endif + + if ( pMainView->mList ) + { + MSG_MAIN_HIGH("Remove media list"); + ivug_medialist_del(pMainView->mList); // ivug_medialist_del() is not working on destroy cb. + pMainView->mList = NULL; + } + +#endif + +#if 0 + /* comment below, because t show main view and this back btn, + *firstly slide show view is mouse up, then ivug_ss_delete() will be invoked in taht mouse up cb + */ + /* free slideshow */ + if ( pMainView->ssHandle ) + { + ivug_ss_delete(pMainView->ssHandle); + } +#endif + DESTROY_ME(); +} + +void on_btn_setas_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + IV_ASSERT(mdata != NULL); + + if ( mdata->filepath == NULL) + { + MSG_MAIN_ERROR("File path is NULL"); + return; + } + + //ivug_main_view_del_hide_timer(pMainView); + + Evas_Object* popup = NULL; + popup = ivug_listpopup_add(pMainView->area_obj); + + pMainView->ctx_popup2 = popup; + + evas_object_smart_callback_add(popup, "popup,dismissed", _dismissed_cb, pMainView); + evas_object_smart_callback_add(popup, "popup,selected", _on_setas_selected, pMainView); + + if (mdata->bIsDRMContent) + { + Ivug_ListPopup_Item *it = NULL; + + bool bDisableWallpaper = !ivug_drm_is_possible_to_setas(mdata->filepath, IVUG_DRM_SETAS_WALLPAPER); + bool bDisableCallerImage = !ivug_drm_is_possible_to_setas(mdata->filepath, IVUG_DRM_SETAS_CALLERID); + + it = ivug_listpopup_item_append(popup, NULL, IDS_HOME_SCREEN, IDS_HOME_SCREEN); + + if(bDisableWallpaper == true) + { + ivug_listpopup_item_disabled_set(it); + } + + it = ivug_listpopup_item_append(popup, NULL, IDS_LOCK_SCREEN, IDS_LOCK_SCREEN); + + if(bDisableWallpaper == true) + { + ivug_listpopup_item_disabled_set(it); + } + + it = ivug_listpopup_item_append(popup, NULL, IDS_HOME_AND_LOCK_SCREENS, IDS_HOME_AND_LOCK_SCREENS); + if(bDisableWallpaper == true) + { + ivug_listpopup_item_disabled_set(it); + } + + it = ivug_listpopup_item_append(popup, NULL, IDS_CALLER_IMAGE, IDS_CALLER_IMAGE); + if(bDisableCallerImage == true) + { + ivug_listpopup_item_disabled_set(it); + } + } + else + { + ivug_listpopup_item_append(popup, NULL, IDS_HOME_SCREEN, IDS_HOME_SCREEN); + ivug_listpopup_item_append(popup, NULL, IDS_LOCK_SCREEN, IDS_LOCK_SCREEN); + ivug_listpopup_item_append(popup, NULL, IDS_HOME_AND_LOCK_SCREENS, IDS_HOME_AND_LOCK_SCREENS); + ivug_listpopup_item_append(popup, NULL, IDS_CALLER_IMAGE, IDS_CALLER_IMAGE); + + } + + Evas_Coord x, y; + Evas_Coord w, h; + + Ivug_ListPopup_Item *item = (Ivug_ListPopup_Item *)event_info; + Elm_Object_Item *eoi = ivug_listpopup_item_get_item(item); + Evas_Object *button = elm_object_item_widget_get(eoi); + evas_object_geometry_get(button, &x, &y, &w, &h); + + MSG_MAIN_MED("x = %d, y = %d, w = %d, h = %d", x, y, w, h); + + + ivug_listpopup_context_show(popup, pMainView->area_obj, x+w/2, y+h/2); + IVUG_FUNC_LEAVE(); + return; +} + +static void _on_name_view_destroy(void *data, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("transition finished"); + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + ivug_name_view_destroy(pMainView->pNameView); + pMainView->pNameView = NULL; // Will removed in add tag view. + + evas_object_smart_callback_del(pMainView->navi_bar, "transition,finished", + _on_name_view_destroy); +} + +static bool _rename(Media_Data *mdata, const char *str) +{ + IV_ASSERT(mdata!=NULL); + + if(mdata->filepath == NULL || mdata->thumbnail_path == NULL) + { + MSG_MAIN_ERROR("filepath is NULL"); + return false; + } + + const char *old_fullpath = mdata->filepath; + char *old_dir = ecore_file_dir_get(old_fullpath); + char *ext = ivug_fileinfo_get_file_extension(old_fullpath); + + char new_fullpath[IVUG_MAX_FILE_PATH_LEN] = {0,}; + if(ext) + { + snprintf(new_fullpath, sizeof(new_fullpath),"%s/%s.%s", old_dir, str, ext); + } + else + { + snprintf(new_fullpath, sizeof(new_fullpath),"%s/%s", old_dir, str); + } + + bool ret = ivug_rename_file(old_fullpath, new_fullpath); + if(ret == false) + { + MSG_MAIN_ERROR("ivug_rename_file to %s failed", new_fullpath); + return false; + } + + if(ivug_db_rename(mdata->m_handle, new_fullpath) == false) + { + MSG_MAIN_ERROR("ivug_db_rename to %s failed", new_fullpath); + return false; + } + + ivug_db_destroy_file_handle(mdata->m_handle); + mdata->m_handle = ivug_db_get_file_handle_from_media_id(mdata->mediaID); + + MSG_DETAIL_HIGH("Rename %s -> %s", old_fullpath, new_fullpath); + free(mdata->filepath); + mdata->filepath = strdup(new_fullpath); + + free(mdata->thumbnail_path); + mdata->thumbnail_path = ivug_db_get_thumbnail_path(mdata->m_handle); + + return true; +} + +static void _on_rename_view_response(ivug_name_response resp, const char *str, void *pClientData) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)pClientData; + + if(resp != NAME_VIEW_RESPONSE_OK) + { + MSG_MAIN_ERROR("rename is canceled"); + + evas_object_smart_callback_add(pMainView->navi_bar, "transition,finished", + _on_name_view_destroy, pMainView); + + elm_naviframe_item_pop(pMainView->navi_bar); + + pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar); + + Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + elm_object_signal_emit(conformant, "elm,state,indicator,overlap", ""); + return; + } + + Ivug_DetailsView *pDetailsView = pMainView->pDetailsView; + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mData = ivug_medialist_get_data(mitem); + + if(_rename(mData, str) == false) + { + MSG_MAIN_ERROR("_rename to %s failed", str); + //ivug_notify_timeout_create(pMainView->layout, IDS_FAILED, 0.0, NULL, NULL); //it does not work + ivug_selectioninfo_create(pMainView->layout, IDS_FAILED); + } + else + { + if(*(pDetailsView->filename) == NULL + || *(pDetailsView->path) == NULL) + { + MSG_MAIN_ERROR("Detail view data is NULL"); + return; + } + + ivug_details_view_update(pDetailsView, mData->filepath); + + //update main view + if(pMainView->view_by == IVUG_VIEW_BY_FILE) + { + const char *title = ecore_file_file_get(mData->filepath); + elm_object_item_part_text_set(pMainView->navi_it, "elm.text.title", title); + } + + ivug_slider_set_item(pMainView->slider, mitem, SLIDE_INSTANTLY); + } + + evas_object_smart_callback_add(pMainView->navi_bar, "transition,finished", + _on_name_view_destroy, pMainView); + + elm_naviframe_item_pop(pMainView->navi_bar); + + pMainView->navi_it = elm_naviframe_top_item_get(pMainView->navi_bar); + + Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + elm_object_signal_emit(conformant, "elm,state,indicator,overlap", ""); +} + + +static void +_ivug_detail_view_rename_clicked_cb(void *data, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("ENTER : Btn rename clicked. obj=0x%08x data=0x%08x", obj, data); + ivug_ret_if(!obj||!data); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + pMainView->pNameView = ivug_name_view_create(pMainView->layout, IDS_CHANGE_NAME); + + char *name = ecore_file_strip_ext(ecore_file_file_get(mdata->filepath)); + + ivug_name_view_set_entry(pMainView->pNameView, name); + + // file name have to be smaller then MAX_BYTE_LEN include extension + '.' + int limit_len = MAX_BYTE_LEN; + + char *ext = ivug_fileinfo_get_file_extension(mdata->filepath); + if(ext) + { + limit_len -= (strlen(ext) + 1); // 1 is '.' + } + + ivug_name_view_set_max_length(pMainView->pNameView, limit_len); + + ivug_name_view_set_response_callback(pMainView->pNameView, _on_rename_view_response, (void*)pMainView); + + if(ext) + { + free(ext); + } + + free(name); + + Evas_Object *layout = ivug_name_view_object_get(pMainView->pNameView); + + pMainView->navi_it = elm_naviframe_item_push(pMainView->navi_bar, NULL, NULL, NULL, layout, NULL); + + Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_FALSE); + elm_object_item_signal_emit(pMainView->navi_it, "elm,state,toolbar,close", ""); + + ivug_name_view_set_focus(pMainView->pNameView); +} + + +void on_btn_details_clicked(void *data, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("ENTER : Btn detail view clicked. obj=0x%08x data=0x%08x", obj, data); + ivug_ret_if(!obj||!data); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + if(pMainView->pDetailsView) + { + MSG_MAIN_ERROR("details view already created"); + return; + } + if(pMainView->bShowMenu == false) + { + MSG_MAIN_ERROR("details view is hiding now"); + return; + } + + ivug_main_view_del_hide_timer(pMainView); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + IV_ASSERT(mdata != NULL); + + pMainView->pDetailsView = ivug_details_view_screen_create(pMainView->navi_bar, mitem, pMainView->view_by); + + if(!pMainView->pDetailsView) + { + MSG_MAIN_ERROR("create details view failed"); + ivug_main_view_set_hide_timer(pMainView); + return; + } + + Evas_Object *detail_layout = ivug_details_view_object_get(pMainView->pDetailsView); + + elm_object_item_part_content_set(pMainView->navi_it, "elm.swallow.detail", detail_layout); + + evas_object_smart_callback_add(detail_layout, "rename,clicked", _ivug_detail_view_rename_clicked_cb, pMainView); + + //_change_details_to_close(pMainView); + + MSG_MAIN_HIGH("LEAVE : Btn detail view clicked. obj=0x%08x data=0x%08x", obj, data); +} + + + +void on_btn_delete_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + ivug_main_view_del_hide_timer(pMainView); + + ivug_deletepopup_show(pMainView->layout, NULL, IDS_DELETE_MSG, _on_delete_selected, pMainView); + + return; +} + +bool _share_pkg_cb(service_h service, const char *package, void *user_data) +{ + Evas_Object* popup = (Evas_Object*)user_data; + + char *name = NULL; + + app_manager_get_app_name(package, &name); + + ivug_listpopup_item_append(popup, NULL, name, (void *)strdup(package)); + + free(name); + + return true; +} + +#ifdef USE_DEFAULT_APP_SERVICE +void on_btn_share_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + IV_ASSERT(mdata != NULL); + + if ( mdata->filepath == NULL) + { + MSG_MAIN_ERROR("File path is NULL"); + return; + } + + ivug_main_view_del_hide_timer(pMainView); + + Evas_Object* popup = NULL; + popup = ivug_listpopup_add(pMainView->area_obj); + + pMainView->ctx_popup = popup; + + evas_object_smart_callback_add(popup, "popup,dismissed", _dismissed_cb, pMainView); + evas_object_smart_callback_add(popup, "popup,selected", _on_share_selected, pMainView); + + service_h service; + service_create(&service); + service_set_operation(service, SERVICE_OPERATION_SEND); + service_set_uri(service, mdata->filepath); + service_foreach_app_matched(service, _share_pkg_cb, (void *)popup); + + ivug_listpopup_button_set(popup, IDS_CLOSE); + ivug_listpopup_popup_show(popup); +} +#else +void on_btn_share_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + IV_ASSERT(mdata != NULL); + + if ( mdata->filepath == NULL) + { + MSG_MAIN_ERROR("File path is NULL"); + return; + } + + ivug_main_view_del_hide_timer(pMainView); + + Evas_Object* popup = NULL; + popup = ivug_listpopup_add(pMainView->area_obj); + + pMainView->ctx_popup = popup; + + evas_object_smart_callback_add(popup, "popup,dismissed", _dismissed_cb, pMainView); + evas_object_smart_callback_add(popup, "popup,selected", _on_share_selected, pMainView); + + ivug_listpopup_item_append(popup, NULL, IDS_MESSAGE, IDS_MESSAGE); + ivug_listpopup_item_append(popup, NULL, IDS_EMAIL, IDS_EMAIL); + + switch(mdata->slide_type) + { + case SLIDE_TYPE_IMAGE: + ivug_listpopup_item_append(popup, NULL, IDS_WIFI_DIRECT, IDS_WIFI_DIRECT); + ivug_listpopup_item_append(popup, NULL, IDS_BLUETOOTH, IDS_BLUETOOTH); + + if(mdata->bIsDRMContent == EINA_TRUE) + { + break; + } + + ivug_listpopup_item_append(popup, NULL, IDS_FACEBOOK, IDS_FACEBOOK); + ivug_listpopup_item_append(popup, NULL, IDS_PICASA, IDS_PICASA); + + break; + case SLIDE_TYPE_VIDEO: + ivug_listpopup_item_append(popup, NULL, IDS_WIFI_DIRECT, IDS_WIFI_DIRECT); + ivug_listpopup_item_append(popup, NULL, IDS_BLUETOOTH, IDS_BLUETOOTH); + + if(mdata->bIsDRMContent == EINA_TRUE) + { + break; + } + ivug_listpopup_item_append(popup, NULL, IDS_FACEBOOK, IDS_FACEBOOK); + ivug_listpopup_item_append(popup, NULL, IDS_YOUTUBE, IDS_YOUTUBE); + + break; + case SLIDE_TYPE_UNKNOWN: + ivug_listpopup_item_append(popup, NULL, IDS_BLUETOOTH, IDS_BLUETOOTH); + break; + case SLIDE_TYPE_NONE: + default: + MSG_MAIN_WARN("Unknown slide type=%d", mdata->slide_type); + // Go through + } + + ivug_listpopup_button_set(popup, IDS_CLOSE); + ivug_listpopup_popup_show(popup); +} +#endif + +void on_btn_save_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + if(pMainView->popup) + { + MSG_MAIN_ERROR("popup already exist"); + return; + } + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + IV_ASSERT(mdata != NULL); + + if ( mdata->filepath == NULL) + { + MSG_MAIN_ERROR("File path is NULL"); + return; + } + + ivug_main_view_del_hide_timer(pMainView); + + MSG_MAIN_HIGH("Web image filepath %s, fileurl %s", mdata->filepath, mdata->fileurl); + +#ifdef USE_DEFAULT_DOWNLOADS_FOLDER + char dest_file[IVUG_MAX_FILE_PATH_LEN + 1] = {0,}; + const char *new_filename = ecore_file_file_get(mdata->filepath); + char *temp_filename = NULL; + + if (new_filename == NULL) + { + MSG_MAIN_ERROR("File does not exist filepath=%s", mdata->filepath); + ivug_main_view_set_hide_timer(pMainView); + return; + } + + if (ecore_file_dir_is_empty(DEFAULT_DOWNLOADS_FOLDER) == -1) + { + MSG_MAIN_WARN("Destination path doesn't exist. %s", DEFAULT_DOWNLOADS_FOLDER); + mkdir(DEFAULT_DOWNLOADS_FOLDER, DIR_MASK_DEFAULT); + } + + snprintf(dest_file, IVUG_MAX_FILE_PATH_LEN, "%s/%s", DEFAULT_DOWNLOADS_FOLDER, new_filename); + if(ecore_file_exists(dest_file)) + { + MSG_MAIN_WARN("file already exist"); + temp_filename = ivug_generate_file_name(dest_file, NULL, NULL); + snprintf(dest_file, IVUG_MAX_FILE_PATH_LEN, "%s/%s", DEFAULT_DOWNLOADS_FOLDER, ecore_file_file_get(temp_filename)); + free(temp_filename); + } + + if(ivug_copy_file(mdata->filepath, dest_file) == false) + { + _ivug_selectioninfo_create(pMainView, IDS_FAILED); + ivug_main_view_set_hide_timer(pMainView); + return; + } + // Add to album + /*int ret = media_file_register(dest_file); + if(ret < 0) + { + MSG_MAIN_ERROR("Cannot add to album file %s. ret=%d", dest_file, ret); + _ivug_selectioninfo_create(pMainView, IDS_FAILED); + } + else + { + _ivug_selectioninfo_create(pMainView, IDS_SAVED); + }*/ + _ivug_selectioninfo_create(pMainView, IDS_SAVED); +#else + ivug_listpopup_itemlist items = ivug_listpopup_itemlist_new(); + +// Get local album name. + + bool ret = ivug_db_get_all_folder_list(_iter_album_list, items); + if( ret == false ) + { + MSG_SDATA_ERROR( "ivug_db_get_all_folder_list failed: %d", ret); + return; + } + + pMainView->popup = ivug_listpopup_show(pMainView->layout, IDS_SAVE, items, _on_save_selected, pMainView); + + ivug_listpopup_itemlist_free(items); +#endif + + return; +} + + +void on_btn_tag_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + ivug_ret_if(!mdata); + + //ivug_main_view_del_hide_timer(pMainView); + + Evas_Object* popup = NULL; + popup = ivug_listpopup_add(pMainView->area_obj); + + pMainView->ctx_popup2 = popup; + + evas_object_smart_callback_add(popup, "popup,dismissed", _dismissed_cb, pMainView); + evas_object_smart_callback_add(popup, "popup,selected", _on_addtag_selected, pMainView); + + ivug_listpopup_item_append(popup, NULL, IDS_CREATE_TAG, IDS_CREATE_TAG); + ivug_listpopup_item_append(popup, NULL, IDS_FAVOURITES, IDS_FAVOURITES); + + bool ret = ivug_db_get_all_tag_list(_iter_tag_list, pMainView); + if( ret == false ) + { + MSG_SDATA_ERROR( "ivug_db_get_all_folder_list failed: %d", ret); + return; + } + + Evas_Coord x, y; + Evas_Coord w, h; + + Ivug_ListPopup_Item *item = (Ivug_ListPopup_Item *)event_info; + Elm_Object_Item *eoi = ivug_listpopup_item_get_item(item); + Evas_Object *button = elm_object_item_widget_get(eoi); + evas_object_geometry_get(button, &x, &y, &w, &h); + MSG_MAIN_HIGH("x = %d, y = %d, w = %d, h = %d", x, y, w, h); + + ivug_listpopup_context_show(popup, pMainView->area_obj, x+w/2, y+h/2); + return; +} + +void on_btn_slideshow_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("Start slide show"); + +/* + Just for debugging. +*/ +#if 0 + ivug_slider_dump_photocam(pMainView->slider); + return; + +#endif + + if(pMainView->pDetailsView) + { + MSG_MAIN_HIGH("Exit details view"); + //_change_close_to_details(pMainView); + _delete_details_view(pMainView); + ivug_main_view_set_hide_timer(pMainView); // for hide_count + } + + ivug_main_view_start_slideshow(pMainView, EINA_TRUE); + +} + +void on_btn_details_close_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("ENTER : Btn detail close clicked. obj=0x%08x data=0x%08x", obj, data); + + //_change_close_to_details(pMainView); + _delete_details_view(pMainView); + + ivug_main_view_set_hide_timer(pMainView); + + MSG_MAIN_HIGH("LEAVE : Btn detail close clicked. obj=0x%08x data=0x%08x", obj, data); +} + + + +/* + Used for only view type is select +*/ +void on_btn_selectok_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("Select OK."); + + service_h service; + service_create(&service); + + service_add_extra_data(service, "Result", "Ok"); + ug_send_result(gGetUGHandle(), service); + + service_destroy(service); + + DESTROY_ME(); + +} +/* + Used for only view type is select +*/ +void on_btn_selectcancel_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("Select Cancel"); + +//send result to caller + service_h service; + service_create(&service); + + service_add_extra_data(service, "Result", "Cancel"); + ug_send_result(gGetUGHandle(), service); + + service_destroy(service); + + DESTROY_ME(); + +} + +void on_btn_rename_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + IV_ASSERT(mdata != NULL); + + ivug_main_view_del_hide_timer(pMainView); + + char *old_fullpath = mdata->filepath; + char *old_name = ecore_file_strip_ext(ecore_file_file_get(old_fullpath)); + + ivug_rename_popup_show(pMainView->layout, old_name, _on_rename_selected, pMainView); + + free(old_name); +} + +static void +_on_copy_selected(void *data, Evas_Object *obj) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + //get current file path. + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + if (mdata == NULL) + { + MSG_MAIN_ERROR("slider data is NULL"); + return; + } + + char *path = NULL; + int len = 0; + + if(mdata->slide_type == SLIDE_TYPE_VIDEO) + { + path = mdata->thumbnail_path; + } + else + { + path = mdata->filepath; + } + len = strlen(path)+1; + + if (len < IVUG_MAX_FILE_PATH_LEN) + { + MSG_MAIN_HIGH("file path = %s", path); + elm_cnp_selection_set(pMainView->layout, ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_IMAGE, path, len); + _ivug_selectioninfo_create(pMainView, IDS_COPIED_TO_CLIPBOARD); + } + else + { + MSG_MAIN_ERROR("slider file path is too long"); + _ivug_selectioninfo_create(pMainView, IDS_FAILED); + } +} + +static void +_on_crop_selected(void *data, Evas_Object *obj) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + //get current file path. + Media_Item *WMitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(WMitem); + + if (mdata == NULL) + { + MSG_MAIN_ERROR("slider data is NULL"); + return; + } + + MSG_MAIN_HIGH("Create Crop view"); + IvugCropView *pCropView = ivug_crop_view_create(pMainView->layout); + + Evas_Object *layout = ivug_crop_view_get_object(pCropView); + + evas_object_smart_callback_add(layout, "ok,clicked", _ivug_crop_view_ok_clicked_cb, pMainView); + evas_object_smart_callback_add(layout, "destroyed", _ivug_crop_view_destroyed_cb, pMainView); + + Evas_Object *btn_back = ivug_button_add(layout, "naviframe/end_btn/default", + IDS_BACK, NULL, _ivug_crop_view_destroyed_cb, pMainView); + + pMainView->navi_it = elm_naviframe_item_push(pMainView->navi_bar, NULL, btn_back, NULL, pCropView->layout, NULL); + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + ivug_crop_view_create_menu(pCropView, pMainView->navi_bar); + + ivug_crop_view_file_set(pCropView, mdata->filepath); + + pMainView->pCropView = pCropView; + + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_FALSE); +} + +#include + +static void +_on_rotate_left_selected(void *data, Evas_Object *obj) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("Rotate l button clicked"); + + +#ifdef IVUG_DEFINE_EXIF_ROTATE + Media_Item *mitem = NULL; + Media_Data *mData = NULL; + + mitem = ivug_slider_get_item(pMainView->slider); + mData = ivug_medialist_get_data(mitem); + + int degree = 0; + + if ( ivug_exif_get_rotate(mData->filepath, °ree) < 0 ) + { + MSG_MAIN_ERROR("Cannot get degree : %s", mData->filepath); + return; + } + + + degree = degree - 90 ; + + if ( ivug_exif_set_rotate(mData->filepath, degree) < 0 ) + { + MSG_MAIN_ERROR("Cannot set degree : %s", mData->filepath); + return; + } + + ivug_db_refresh(mData->mediaID); + + ivug_slider_reload(pMainView->slider); // Refresh image + + +// Remove old thumbnail. not working +// ecore_file_remove(mData->thumbnail_path); + +// Get thumbnail. + char new_path[IVUG_MAX_FILE_PATH_LEN]; + + int ret = -1; + ret = thumbnail_request_from_db(mData->filepath, new_path, IVUG_MAX_FILE_PATH_LEN); + if (ret < 0) + { + MSG_MAIN_ERROR("thumbnail_request_from_db failed! %s", mData->filepath); + return; + } + +#if 0 + char dest[1024]; + + snprintf(dest, sizeof(dest) - 1, "/opt/media/thm_l_%d.jpg", degree); + + ecore_file_cp(new_path, dest); +#endif + + if ( mData->thumbnail_path != NULL ) + { + free(mData->thumbnail_path); + } + + mData->thumbnail_path = strdup(new_path); + + +#else + ivug_slider_image_rotate(pMainView->slider, -90); +#endif + + ivug_slider_zoom_reset(pMainView->slider); + + pMainView->zoom_level = 1; + elm_slider_value_set(pMainView->zoom_slider, 1.0); +} + +static void +_on_rotate_right_selected(void *data, Evas_Object *obj) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("Rotate r button clicked"); + + +#ifdef IVUG_DEFINE_EXIF_ROTATE + Media_Item *mitem = NULL; + Media_Data *mData = NULL; + + mitem = ivug_slider_get_item(pMainView->slider); + mData = ivug_medialist_get_data(mitem); + + int degree = 0; + + if ( ivug_exif_get_rotate(mData->filepath, °ree) < 0 ) + { + MSG_MAIN_ERROR("Cannot get degree : %s", mData->filepath); + return; + } + + + degree = degree + 90 ; + + if ( ivug_exif_set_rotate(mData->filepath, degree) < 0 ) + { + MSG_MAIN_ERROR("Cannot set degree : %s", mData->filepath); + return; + } + + ivug_db_refresh(mData->mediaID); + + ivug_slider_reload(pMainView->slider); // Refresh image + + +// Remove old thumbnail. not working +// ecore_file_remove(mData->thumbnail_path); + +// Get thumbnail. + char new_path[IVUG_MAX_FILE_PATH_LEN]; + + int ret = -1; + ret = thumbnail_request_from_db(mData->filepath, new_path, + IVUG_MAX_FILE_PATH_LEN); + if (ret < 0) + { + MSG_MAIN_ERROR("thumbnail_request_from_db failed! %s", mData->filepath); + return; + } + +#if 0 + char dest[1024]; + + snprintf(dest, sizeof(dest) - 1, "/opt/media/thm_r_%d.jpg", degree); + + ecore_file_cp(new_path, dest); +#endif + + if ( mData->thumbnail_path != NULL ) + { + free(mData->thumbnail_path); + } + + mData->thumbnail_path = strdup(new_path); + + +#else + ivug_slider_image_rotate(pMainView->slider, +90); +#endif + + ivug_slider_zoom_reset(pMainView->slider); + + pMainView->zoom_level = 1; + elm_slider_value_set(pMainView->zoom_slider, 1.0); +} + + +static void _on_more_selected(void *data, Evas_Object *obj, void *event_info) +{ +// obj is ctxpopup!. + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + Ivug_ListPopup_Item *item = (Ivug_ListPopup_Item *)event_info; + + const char *label = (const char *)ivug_listpopup_item_get_data(item); + if(label == NULL) + { + ivug_main_view_set_hide_timer(pMainView); + return; + } + + MSG_MAIN_HIGH("text(%s) is clicked", label); + + if(strncmp(label, IDS_COPY_TO_CLIPBOARD, strlen(label)) == 0) + { + _on_copy_selected(data, obj); + ivug_main_view_set_hide_timer(pMainView); + } + else if(strncmp(label, IDS_CROP, strlen(label)) == 0) + { + _on_crop_selected(data, obj); + } + else if(strncmp(label, IDS_ROTATE_LEFT, strlen(label)) == 0) + { + _on_rotate_left_selected(data, obj); + ivug_main_view_set_hide_timer(pMainView); + } + else if(strncmp(label, IDS_ROTATE_RIGHT, strlen(label)) == 0) + { + _on_rotate_right_selected(data, obj); + ivug_main_view_set_hide_timer(pMainView); + } + else if(strncmp(label, IDS_SET_AS, strlen(label)) == 0) + { + on_btn_setas_clicked(data, obj, event_info); + } + else if(strncmp(label, IDS_SLIDE_SHOW, strlen(label)) == 0) + { + on_btn_slideshow_clicked(data, obj, event_info); + } + else if(strncmp(label, IDS_DETAILS, strlen(label)) == 0) + { + on_btn_details_clicked(data, obj, event_info); + } + else if(strncmp(label, IDS_ADD_TAG, strlen(label)) == 0) + { + on_btn_tag_clicked(data, obj, event_info); + } + else if(strncmp(label, IDS_PRINT, strlen(label)) == 0) + { + Media_Item *WMitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(WMitem); + + if (mdata == NULL) + { + MSG_MAIN_ERROR("slider data is NULL"); + evas_object_del(pMainView->ctx_popup); + pMainView->ctx_popup = NULL; + ivug_main_view_set_hide_timer(pMainView); + return; + } + ivug_ext_launch_print(mdata->filepath); + } + + evas_object_del(pMainView->ctx_popup); + pMainView->ctx_popup = NULL; +} + +void on_btn_more_clicked(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + slide_state_t state = ivug_slider_get_state(pMainView->slider); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + IV_ASSERT(mdata != NULL); + + ivug_main_view_del_hide_timer(pMainView); + + Evas_Object* popup = NULL; + popup = ivug_listpopup_add(pMainView->area_obj); + + pMainView->ctx_popup = popup; + + evas_object_smart_callback_add(popup, "popup,dismissed", _dismissed_cb, pMainView); + evas_object_smart_callback_add(popup, "popup,selected", _on_more_selected, pMainView); + + if (state == SLIDE_STATE_ERROR || state == SLIDE_STATE_DOWNLOAD_FAILED) + { + MSG_MAIN_HIGH("slide state is invalid %d", state); + ivug_listpopup_item_append(popup, NULL, IDS_DETAILS, IDS_DETAILS); + goto MORE_BTN_END; + } + + if(mdata->slide_type == SLIDE_TYPE_IMAGE) + { + ivug_listpopup_item_append(popup, NULL, IDS_SET_AS, IDS_SET_AS); + ivug_listpopup_item_append(popup, NULL, IDS_SLIDE_SHOW, IDS_SLIDE_SHOW); + if(pMainView->pDetailsView == NULL) + ivug_listpopup_item_append(popup, NULL, IDS_DETAILS, IDS_DETAILS); + ivug_listpopup_item_append(popup, NULL, IDS_ADD_TAG, IDS_ADD_TAG); + + if(mdata->bIsDRMContent == EINA_FALSE) + { + ivug_listpopup_item_append(popup, NULL, IDS_CROP, IDS_CROP); + + int degree = 0; + if ( ivug_exif_get_rotate(mdata->filepath, °ree) == 0 ) + { + ivug_listpopup_item_append(popup, NULL, IDS_ROTATE_LEFT, IDS_ROTATE_LEFT); + ivug_listpopup_item_append(popup, NULL, IDS_ROTATE_RIGHT, IDS_ROTATE_RIGHT); + } + } + + ivug_listpopup_item_append(popup, NULL, IDS_PRINT, IDS_PRINT); + } + else if(mdata->slide_type == SLIDE_TYPE_VIDEO) + { + if(ivug_is_editable_video_file(mdata->filepath) == true) + { + ivug_listpopup_item_append(popup, NULL, IDS_TRIM, IDS_TRIM); + } + ivug_listpopup_item_append(popup, NULL, IDS_SLIDE_SHOW, IDS_SLIDE_SHOW); + if(pMainView->pDetailsView == NULL) + ivug_listpopup_item_append(popup, NULL, IDS_DETAILS, IDS_DETAILS); + ivug_listpopup_item_append(popup, NULL, IDS_ADD_TAG, IDS_ADD_TAG); + //ivug_listpopup_item_append(popup, NULL, IDS_CROP, IDS_CROP); + } + +MORE_BTN_END: + Evas_Coord x, y; + Evas_Coord w, h; + + evas_object_geometry_get(obj, &x, &y, &w, &h); + MSG_MAIN_MED("x = %d, y = %d, w = %d, h = %d", x, y, w, h); + + ivug_listpopup_context_show(popup, pMainView->area_obj, x+w/2, y+h/2); +} + diff --git a/main/src/view/ivug-main-view-menu.h b/main/src/view/ivug-main-view-menu.h new file mode 100755 index 0000000..6ccfecd --- /dev/null +++ b/main/src/view/ivug-main-view-menu.h @@ -0,0 +1,52 @@ +/* + * Copyright 2012 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 __IVUG_MAINVIEW_MENU_H__ +#define __IVUG_MAINVIEW_MENU_H__ + + +#ifdef __cplusplus +extern "C" { +#endif + +/* + Button handlers for main view +*/ + +void on_btn_selectcancel_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_selectok_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_slideshow_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_tag_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_save_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_share_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_delete_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_details_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_setas_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_back_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_details_close_clicked(void *data, Evas_Object *obj, void *event_info); + +void on_btn_rename_clicked(void *data, Evas_Object *obj, void *event_info); +void on_btn_more_clicked(void *data, Evas_Object *obj, void *event_info); + +void _ivug_selectioninfo_create(Ivug_MainView *pMainView, const char *string); + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_MAINVIEW_MENU_H__ + diff --git a/main/src/view/ivug-main-view-priv.h b/main/src/view/ivug-main-view-priv.h new file mode 100755 index 0000000..d751855 --- /dev/null +++ b/main/src/view/ivug-main-view-priv.h @@ -0,0 +1,127 @@ +/* + * Copyright 2012 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 __IVUG_MAINVIEW_PRIV_H__ +#define __IVUG_MAINVIEW_PRIV_H__ + +#include "ivug-define.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _Ivug_MainView{ + Evas_Object *parent; + Evas_Object *layout; /*Layout widget based on EDJ*/ + + Evas_Object *navi_bar; + Evas_Object *empty_layout; + Elm_Object_Item *navi_it; + Evas_Object* slider; //image viewer slider + + Evas_Object *back_btn; + + Evas_Object *area_obj; //lcd area except indicator + + Evas_Object* selectioninfo; + + Evas_Object *zoom_slider; + int zoom_level; + +/* + |------------------| + | navi_bar | + |------------------| + | tool_bar | + |------------------| + | | + | | + | | + | | + |------------------| + | ctrl_bar | + |------------------| +*/ + +// Toolbar + Evas_Object *tool_bar; + ivug_toolbar tool_bar_type; + +// Controlbar + Evas_Object *ctrl_bar; + ivug_ctrlbar ctrl_bar_type; + + Evas_Object *btn_more; + Evas_Object *btn_share; + Evas_Object *btn_download; + + bool bSetThmByUser; + + Evas_Object* popup; //popup + Evas_Object* ctx_popup; //context popup 1depth + Evas_Object* ctx_popup2; //context popup 2depth + + Evas_Object* longpress_popup; //long press popup + bool bLongpressEnd; + + Evas_Object *best_icon; + +// child view. + Ivug_NameView *pNameView; + Ivug_SetAsView *pSetAsView; + + Ivug_DetailsView *pDetailsView; + IvugCropView *pCropView; + +// List + Media_List *mList; + +//flag + bool bShowMenu; + + ivug_mode mode; + ivug_view_by view_by; + + ui_gadget_h ext_ug; + + Ecore_Event_Handler *keydown_handler; + + Ecore_Timer *exit_timer; + Ecore_Timer *hide_timer; + int hide_count; + + Ecore_Timer *popup_timer; + + char *album_name; + +// Slide show; + SlideShow *ssHandle; + + bool bClickPrevent; + bool bStandAlone; //if true, it is process not ug +}; + +void _update_title(struct _Ivug_MainView *pMainView); + +bool ivug_is_agif(const char *filepath); + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_MAINVIEW_PRIV_H__ + diff --git a/main/src/view/ivug-main-view-toolbar.cpp b/main/src/view/ivug-main-view-toolbar.cpp new file mode 100755 index 0000000..02bbf57 --- /dev/null +++ b/main/src/view/ivug-main-view-toolbar.cpp @@ -0,0 +1,198 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-main-view.h" +#include "ivug-main-view-menu.h" +#include "ivug-main-view-priv.h" + +#include "ivug-slider.h" + +#define MIME_TYPE_LEN (255) +#define MIME_TYPE_3GPP "video/3gpp" +#define PATH_CAMERA_LOCAL "/opt/usr/media/Camera" +#define PATH_CAMERA_SDCARD "/opt/storage/sdcard/Camera" + +/* Video editor can start when video exist in camera folder and 3gp file format */ + +bool ivug_is_editable_video_file(char *filepath) +{ + MSG_UTIL_MED("path = %s", filepath); + if(strncmp(filepath, PATH_CAMERA_LOCAL, strlen(PATH_CAMERA_LOCAL)) == 0 + || strncmp(filepath, PATH_CAMERA_SDCARD, strlen(PATH_CAMERA_SDCARD)) == 0) + { + efreet_mime_init(); + const char *type = NULL; + type = efreet_mime_type_get(ivug_get_filename(filepath)); + + efreet_mime_shutdown(); + + if ( type == NULL ) + { + MSG_UTIL_ERROR("Cannot get mime type for %s", filepath); + return false; + } + + MSG_UTIL_MED("mime type = %s", type); + if(strcmp(type, MIME_TYPE_3GPP) == 0) + { + return true; + } + } + return false; +} + +ivug_toolbar +_get_tool_bar_type(ivug_mode mode, Media_Type slide_type ) +{ + ivug_toolbar tool_bar_type = NAVI_BAR_TYPE_NONE; + + //calc navi bar style , temporary code. + static const char *szType[] = { + "[ INVALID ]", + "[ ]", + "[Set, Info]", + "[Ok, Cancel]", + }; + + + switch (mode) + { + case IVUG_MODE_NORMAL: + case IVUG_MODE_CAMERA: + tool_bar_type = NAVI_BAR_TYPE_EMPTY; + if (slide_type == SLIDE_TYPE_IMAGE) + { + tool_bar_type = NAVI_BAR_TYPE_IMAGE; + } + else if (slide_type == SLIDE_TYPE_VIDEO) + { + tool_bar_type = NAVI_BAR_TYPE_VIDEO; + } + else + { + tool_bar_type = NAVI_BAR_TYPE_EMPTY; + } + break; + case IVUG_MODE_SINGLE: + case IVUG_MODE_FILE: + { + tool_bar_type = NAVI_BAR_TYPE_FILE; + } + + break; + case IVUG_MODE_DISPLAY: + tool_bar_type = NAVI_BAR_TYPE_SELECT; + + break; + default: + MSG_MAIN_ERROR("Unhandled mode : %d", mode); + tool_bar_type = NAVI_BAR_TYPE_EMPTY; + + break; + } + + MSG_MAIN_MED("Mode=%d Slide=%d ToolBar=%s", mode, slide_type, szType[tool_bar_type]); + + return tool_bar_type; +} + + +ivug_ctrlbar +_get_ctrl_bar_type(ivug_mode mode, Media_Type slide_type) +{ + // this is temporary code. + ivug_ctrlbar type = CTRL_BAR_TYPE_FILE; + + static const char *szType[] = { + "[ Invalid ]", + "[ None ]", + "[Delete,Share,Set,Info]", + "[Delete,Share,Set,Info, Editor]", + "[Delete,Share,Set,Info, Trim]", + "[Share, Set, Save, Info]", + "[Delete,Share, Add tag, Slide show, Editor]", + "[Delete,Share, Add tag, Slide show, Trim]", + }; + + switch (mode) + { + case IVUG_MODE_NORMAL: + case IVUG_MODE_CAMERA: + if (slide_type == SLIDE_TYPE_IMAGE) + { + type = CTRL_BAR_TYPE_IMAGE; + } + else if (slide_type == SLIDE_TYPE_VIDEO) + { + type = CTRL_BAR_TYPE_VIDEO; + } + else if (slide_type == SLIDE_TYPE_UNKNOWN) + { + type = CTRL_BAR_TYPE_IMAGE; + } + else + { + MSG_MAIN_ERROR("Unhandled slide type : %d", slide_type); + type = CTRL_BAR_TYPE_FILE; + } + break; + case IVUG_MODE_SINGLE: + case IVUG_MODE_FILE: + { + type = CTRL_BAR_TYPE_FILE; + } + break; + case IVUG_MODE_DISPLAY: + type = CTRL_BAR_TYPE_EMPTY; + break; + case IVUG_MODE_SETAS: + type = CTRL_BAR_TYPE_EMPTY; + break; + default: + MSG_MAIN_ERROR("Unhandled mode : %d", mode); + type = CTRL_BAR_TYPE_FILE; + } + + MSG_MAIN_MED("Mode=%d Slide=%d CtrlBar=%s", mode, slide_type, szType[type]); + + return type; +} + +void _create_main_menu(Ivug_MainView *pMainView) +{ + if(pMainView->mode == IVUG_MODE_DISPLAY) + { + Evas_Object *btn_save = ivug_button_add(pMainView->navi_bar, "naviframe/toolbar/default", + IDS_SAVE, NULL, on_btn_selectok_clicked, pMainView); + elm_object_item_part_content_set(pMainView->navi_it, "toolbar_button1", btn_save); + } + else + { + pMainView->btn_more = ivug_button_add(pMainView->navi_bar, "naviframe/more/default", + NULL, NULL, on_btn_more_clicked, pMainView); + elm_object_item_part_content_set(pMainView->navi_it, "toolbar_more_btn", pMainView->btn_more); + + pMainView->btn_share = ivug_button_add(pMainView->navi_bar, "naviframe/toolbar/left", + IDS_SHARE, NULL, on_btn_share_clicked, pMainView); + elm_object_item_part_content_set(pMainView->navi_it, "toolbar_button1", pMainView->btn_share); + + Evas_Object *btn_del = ivug_button_add(pMainView->navi_bar, "naviframe/toolbar/right", + IDS_DELETE, NULL, on_btn_delete_clicked, pMainView); + elm_object_item_part_content_set(pMainView->navi_it, "toolbar_button2", btn_del); + } +} + diff --git a/main/src/view/ivug-main-view-toolbar.h b/main/src/view/ivug-main-view-toolbar.h new file mode 100755 index 0000000..0321dc4 --- /dev/null +++ b/main/src/view/ivug-main-view-toolbar.h @@ -0,0 +1,36 @@ +/* + * Copyright 2012 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 __IVUG_MAIN_VIEW_TOOLBAR_H__ +#define __IVUG_MAIN_VIEW_TOOLBAR_H__ + + +/* + Get ctrl/tool bar type from slide type. +*/ +ivug_ctrlbar _get_ctrl_bar_type(ivug_mode mode, Media_Type slide_type); +ivug_toolbar _get_tool_bar_type(ivug_mode mode, Media_Type slide_type ); + +Evas_Object *_create_ctrl_bar(Evas_Object *parent); +Evas_Object *_create_tool_bar(Evas_Object *parent); + +void _change_close_to_details(Ivug_MainView *pMainView); +void _change_details_to_close(Ivug_MainView *pMainView); + +void _create_main_menu(Ivug_MainView *pMainView); + +#endif // __IVUG_MAIN_VIEW_TOOLBAR_H__ + diff --git a/main/src/view/ivug-main-view.cpp b/main/src/view/ivug-main-view.cpp new file mode 100755 index 0000000..5cf621d --- /dev/null +++ b/main/src/view/ivug-main-view.cpp @@ -0,0 +1,1715 @@ +/* + * Copyright 2012 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 // ug_destroy_me, ug_send_result +#include +#include +#include // Key event +#include // round + +#include "ivug-common.h" +#include "ivug-parameter.h" + +#include "ivug-main-view.h" +#include "ivug-main-view-toolbar.h" +#include "ivug-main-view-menu.h" + +#include "ivug-filter.h" + +#include "ivug-ext-ug.h" + +#include "ivug-util.h" +#include "ivug-medialist.h" +#include "ivug-media.h" + +#include "ivug-popup.h" +#include "ivug-selectioninfo.h" + +#include "ivug-slider-item.h" +#include "ivug-slider.h" + +#include "ivug-setas-view.h" +#include "ivug-name-view.h" +#include "ivug-details-view.h" + +#include "ivug-listpopup.h" +#include "ivug-slideshow.h" + + +#include "ivug-ext-ug.h" + +#include "ivug-drm-common.h" +#include "EFLUtil.h" + + +#include "ivug-image.h" + +#include "ivug-main-view-priv.h" + +#undef HIDE_INDICATOR // For testing. +#define TEST_MOUSE_EVENT + +#define DEFAULT_THUMBNAIL_PATH IMAGE_PATH"/T01_Nocontents_broken.png" + +#define LONGTAP_TIMEOUT (2.0) // 2secs + +// EDJE +#define IVUG_MAIN_EDJ EDJ_PATH"/ivug-main.edj" +/////////////////////////////////////////////////////////////////////////////////////////////////// +// +// +static bool _destory_slideshow_and_ug(Ivug_MainView *pMainView, int state, bool bMmc_out); +static void _on_slideshow_finished(void *data, Evas_Object *obj, void *event_info); + +void _update_title(Ivug_MainView *pMainView) +{ +#define MAX_TITLE_LEN 256 + + static char title[MAX_TITLE_LEN]; + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + if (mdata == NULL) + { + MSG_MAIN_ERROR("slider data is NULL"); + return; + } + + if (pMainView->view_by == IVUG_VIEW_BY_FOLDER + || pMainView->view_by == IVUG_VIEW_BY_ALL + || pMainView->view_by == IVUG_VIEW_BY_PLACES) + { + snprintf(title, sizeof(title), "%d/%d", + mdata->index + 1, + ivug_medialist_get_count(pMainView->mList)); //get title. + } + else if(mdata->fileurl != NULL) + { + const char* filename = ivug_get_filename(mdata->fileurl); + if(filename) + { + snprintf(title, sizeof(title), "%s", filename); + } + } + else + { + MSG_MAIN_ERROR("set Title error"); + } + + IV_ASSERT(pMainView->navi_bar != NULL); + + MSG_MAIN_HIGH("Update title : %s", title); + + elm_object_item_text_set(pMainView->navi_it, title); + +} + + +static void +_on_longpress_popup_selected(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + +// Destroy copy popup + pMainView->longpress_popup = NULL; // object is removed automatically + + int response = (int)event_info; + + Media_Item *mtiem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mtiem); + if (mdata == NULL) + { + MSG_MAIN_ERROR("slider data is NULL"); + return; + } + + if(response == LPPOPUP_RESPONSE_COPY) + { + //get current file path. + + char *path = NULL; + int len = 0; + // This Will add to the article + char buf[IVUG_MAX_FILE_PATH_LEN] = {0,}; + + { + path = mdata->filepath; + len = strlen(mdata->filepath)+strlen("file://")+1; + snprintf(buf, IVUG_MAX_FILE_PATH_LEN, "file://%s", mdata->filepath); + } + + if (len < IVUG_MAX_FILE_PATH_LEN) + { + MSG_MAIN_HIGH("file path = %s, file url =%s", path, buf); + elm_cnp_selection_set(pMainView->layout, ELM_SEL_TYPE_CLIPBOARD, ELM_SEL_FORMAT_IMAGE, buf, sizeof(buf)); + _ivug_selectioninfo_create(pMainView, IDS_COPIED_TO_CLIPBOARD); + } + else + { + MSG_MAIN_ERROR("slider file path is too long"); + } + } +} + + +static Eina_Bool _on_key_down(void *user_data, int type, void *event) +{ + if (!user_data) { + MSG_IMAGEVIEW_ERROR("user data is NULL"); + return ECORE_CALLBACK_PASS_ON; + } + + Ivug_MainView *pMainView = (Ivug_MainView *)user_data; + + Ecore_Event_Key *key_event = (Ecore_Event_Key *) event; + + if (!strcmp(key_event->keyname, KEY_END)) + { + MSG_IMAGEVIEW_HIGH("Bakc(End) key"); + } + else if (!strcmp(key_event->keyname, KEY_SELECT)) + { + MSG_IMAGEVIEW_HIGH("Home key"); + } + else if (!strcmp(key_event->keyname, KEY_POWER)) + { + MSG_IMAGEVIEW_HIGH("Power key"); + if ( pMainView->ssHandle ) + { + ivug_ss_stop(pMainView->ssHandle); + } + } + + MSG_IMAGEVIEW_LOW("Key down : %s", key_event->keyname); + + return ECORE_CALLBACK_PASS_ON; +} + +static Eina_Bool _on_exit_timer_expired(void *data) +{ + ivug_retv_if(!data, ECORE_CALLBACK_CANCEL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + pMainView->exit_timer = NULL; + + DESTROY_ME(); + + return ECORE_CALLBACK_CANCEL; +} + +static void _on_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = static_cast(data); + IV_ASSERT(pMainView != NULL); + + Evas_Coord x,y,w,h; + evas_object_geometry_get(obj, &x, &y, &w, &h); + /** + * during slideshow, after rotation, resize cb of slideshow obj cannot be invoked, + so invoke it manually + */ + if(pMainView->ssHandle) + ivug_ss_resize(pMainView->ssHandle); + MSG_MAIN_HIGH("MainView resized geomtery XYWH(%d,%d,%d,%d) Rotate=%d", x, y, w, h, gGetRotationDegree()); + + if(pMainView->ctx_popup) // when rotated context popup will disapper at EFL + { + evas_object_del(pMainView->ctx_popup); + pMainView->ctx_popup = NULL; + } + + ivug_slider_zoom_reset(pMainView->slider); + + pMainView->zoom_level = 1; + elm_slider_value_set(pMainView->zoom_slider, 1.0); +} + +static bool _destory_slideshow_and_ug(Ivug_MainView *pMainView, + int state, + bool bMmc_out) +{ + IV_ASSERT(pMainView != NULL); + evas_object_smart_callback_del_full(ivug_ss_object_get(pMainView->ssHandle), + "slideshow,finished", _on_slideshow_finished, pMainView); + + ivug_allow_lcd_off(); + /*from gallery ablum*/ + if(bMmc_out) + { + if (pMainView->ssHandle) + { + MSG_MAIN_HIGH("image viewer end cause slide show ended"); + ivug_ss_delete(pMainView->ssHandle); + pMainView->ssHandle = NULL; + } + + DESTROY_ME(); + return true; + } + + return false; +} + + +void _ivug_main_on_mmc_state_changed(keynode_t* node, void *data) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + if (NULL == pMainView) { + return; + } + + if ( pMainView->ext_ug ) + { + MSG_IMAGEVIEW_HIGH("Extern UG is running"); + } + + if(pMainView->ssHandle) + { + ivug_ss_set_stop(pMainView->ssHandle); + _destory_slideshow_and_ug(pMainView, SLIDE_SHOW_STOPPED, true); + } else { + if(pMainView->exit_timer == NULL) + { + pMainView->exit_timer = ecore_timer_add(0.2, _on_exit_timer_expired, data); + } + } +} + +static void _show_zoom_icon(Ivug_MainView *pMainView) +{ + ivug_ret_if(!pMainView); + + MSG_MAIN_ERROR("_show_zoom_icon"); + + /*unsigned int zoom_level = ivug_slider_zoom_level_get(pMainView->slider); + if(zoom_level == 0) + { + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_out,disable","elm"); + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_in,enable","elm"); + } + else if(zoom_level == ZOOM_LEVEL_MAX) + { + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_in,disable","elm"); + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_out,enable","elm"); + } + else*/ + { + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_out,enable","elm"); + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_in,enable","elm"); + } + + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,zoom_slider,show","elm"); +} + +static void _hide_zoom_icon(Ivug_MainView *pMainView) +{ + ivug_ret_if(!pMainView); + + MSG_MAIN_ERROR("_hide_zoom_icon"); + + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_out,hide","elm"); + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,btn_zoom_in,hide","elm"); + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,zoom_slider,hide","elm"); +} + +static void _update_main_view(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + if(mdata == NULL) + { + MSG_MAIN_ERROR("mdata is NULL"); + return; + } + + PERF_CHECK_BEGIN(LVL6, "Set menu title"); + + _update_title(pMainView); + + PERF_CHECK_END(LVL6, "Set menu title"); + + slide_state_t state = ivug_slider_get_state(pMainView->slider); + + if(mdata->slide_type == SLIDE_TYPE_IMAGE && mdata->bIsDRMContent == false && state != SLIDE_STATE_ERROR) + { + _show_zoom_icon(pMainView); + } + else + { + _hide_zoom_icon(pMainView); + } + + return; +} + + +static void +_ivug_main_drm_popup_purchase_cb(void *data, Evas_Object *obj, void *event_info) +{ + int response_id = (int)event_info; + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + MSG_MAIN_HIGH("DRM popup selected : %d", response_id); + + if(response_id == POPUP_RESPONSE_CANCEL) + { + MSG_MAIN_HIGH("cancel selected"); +#ifdef USE_SLIDE_SKIP + MSG_MAIN_HIGH("shift again"); + ivug_slider_skip(pMainView->slider); +#else + ivug_slider_load(pMainView->slider); +#endif + } + else + { + MSG_MAIN_HIGH("unlock process"); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + char *url = ivug_drm_get_right_url(mdata->filepath); + if (url != NULL) + { + MSG_MAIN_HIGH("path = %s, right url : %s", mdata->filepath, url); + ivug_ext_launch_browser(url); + free(url); + } + else + { + MSG_MAIN_ERROR("ivug_drm_get_right_url error. path = %s", mdata->filepath); + } + } +} + + +static void +_ivug_main_drm_popup_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + int response_id = (int)event_info; + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + MSG_MAIN_HIGH("DRM popup selected : %d", response_id); + + if(response_id == POPUP_RESPONSE_CANCEL) + { + MSG_MAIN_HIGH("cancel selected"); +#ifdef USE_SLIDE_SKIP + MSG_MAIN_HIGH("shift again"); + ivug_slider_skip(pMainView->slider); +#else + ivug_slider_load(pMainView->slider); +#endif + + } + else + { + ivug_slider_load(pMainView->slider); + } +} + + +void _ivug_main_view_drm_process(drm_constraints result, int info, void *data) +{ +#define MAX_DBUFFER_SIZE 2048 + + ivug_ret_if(!data); + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + char string[MAX_DBUFFER_SIZE] = ""; + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + slide_state_t state = ivug_slider_get_state(pMainView->slider); + + if(mdata == NULL) + { + MSG_MAIN_ERROR("mdata is NULL"); + return; + } + + switch(result) + { + case IVUG_DRM_RESULT_LIMITED: + MSG_MAIN_HIGH("Limited"); + snprintf(string, sizeof(string), + IDS_DRM_UNLOCK, + ecore_file_file_get(mdata->filepath)); + ivug_2btn_popup_show(pMainView->layout, NULL, string, _ivug_main_drm_popup_purchase_cb, pMainView); + break; + case IVUG_DRM_RESULT_UNLIMITED: + MSG_MAIN_HIGH("Unlimited"); + if(state != SLIDE_STATE_LOADED) + { + ivug_slider_load(pMainView->slider); + } + break; + case IVUG_DRM_RESULT_COUNT: + MSG_MAIN_HIGH("Count = %d", info); + if(info > 2) + { + ivug_slider_load(pMainView->slider); + } + else if(info == 2) + { + snprintf(string, sizeof(string), + IDS_DRM_COUNT_BASED_OPEN_MANY, 2, + ecore_file_file_get(mdata->filepath)); + ivug_2btn_popup_show(pMainView->layout, NULL, string, _ivug_main_drm_popup_response_cb, pMainView); + } + else + { + snprintf(string, sizeof(string), + IDS_DRM_COUNT_BASED_OPEN_ONE, + ecore_file_file_get(mdata->filepath)); + ivug_2btn_popup_show(pMainView->layout, NULL, string, _ivug_main_drm_popup_response_cb, pMainView); + } + break; + case IVUG_DRM_RESULT_INTERVAL_DAYS: + MSG_MAIN_HIGH("Interval days = %d", info); + snprintf(string, sizeof(string), + IDS_DRM_INTERVAL_BASED_DAYS, + ecore_file_file_get(mdata->filepath), + info); + ivug_2btn_popup_show(pMainView->layout, NULL, string, _ivug_main_drm_popup_response_cb, pMainView); + break; + case IVUG_DRM_RESULT_ACCUMULATED: + MSG_MAIN_HIGH("Accumulated time = %d", info); + break; + case IVUG_DRM_RESULT_DATETIME: + case IVUG_DRM_RESULT_TIMED_COUNT: + case IVUG_DRM_RESULT_SYSTEM: + ivug_slider_load(pMainView->slider); + break; + default : + MSG_MAIN_WARN("Unknown resule : %d", result); + ivug_slider_load(pMainView->slider); + break; + } +} + + +static void +_on_slider_clicked(void *data, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("Main View Clicked"); + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + if(pMainView->bClickPrevent == true) + { + pMainView->bClickPrevent = false; + return; + } + + if (pMainView->bShowMenu) + { + ivug_main_view_hide_menu_bar(pMainView); + } + else + { + ivug_main_view_show_menu_bar(pMainView); + } + +} + +static void +_on_slider_icon_clicked(void *data, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("Main View Video icon Clicked"); + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + if (mdata == NULL) + { + MSG_MAIN_ERROR("slide data is NULL"); + return; + } + +// "Add tag" in video player shows only when launching from gallery. + else if (pMainView->mode == IVUG_MODE_FILE || pMainView->mode == IVUG_MODE_DISPLAY || pMainView->mode == IVUG_MODE_SINGLE ) + { + MSG_MAIN_HIGH("Launching simple video player. Mode=%d", pMainView->mode); + ivug_ext_launch_videoplayer_simple(mdata->filepath); + } + else + { + MSG_MAIN_HIGH("Launching normal video player"); + ivug_ext_launch_videoplayer(mdata->filepath); + } + +} + +static Eina_Bool _ivug_long_press_timer_expired(void *data) +{ + ivug_retv_if(!data, ECORE_CALLBACK_CANCEL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + MSG_SETAS_HIGH("long press timer expired"); + + pMainView->popup_timer = NULL; + + if(pMainView->bLongpressEnd == false) // still press + { + if(pMainView->longpress_popup) + { + IVUG_DEBUG_WARNING("copy popup remove"); + evas_object_del(pMainView->longpress_popup); + pMainView->longpress_popup = NULL; + } + } + + + return ECORE_CALLBACK_CANCEL; +} + +static void +_on_slider_long_press_start(void *data, Evas_Object *obj, void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + ivug_ret_if(!data||!p); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + MSG_MAIN_HIGH("LongPressed XY(%d,%d)", p->x, p->y); + + int x = p->x; + int y = p->y; + + if ( ivug_slider_get_state(pMainView->slider) != SLIDE_STATE_LOADED) + { + MSG_MAIN_ERROR("Long pressed. but state is not ready"); + return; + } + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + if(mdata == NULL) + { + MSG_MAIN_ERROR("mdata is NULL"); + return; + } + + if(mdata->slide_type != SLIDE_TYPE_IMAGE) + { + MSG_MAIN_ERROR("Long pressed. but it is not image"); + return; + } + + pMainView->longpress_popup = ivug_longpress_popup_show(pMainView->slider, x, y, _on_longpress_popup_selected, pMainView); + if (pMainView->longpress_popup == NULL) + { + IVUG_DEBUG_WARNING("long press popup create failed"); + return ; + } + + pMainView->bLongpressEnd = false; + + if(pMainView->popup_timer) + { + ecore_timer_del(pMainView->popup_timer); + } + pMainView->popup_timer = ecore_timer_add(LONGTAP_TIMEOUT, _ivug_long_press_timer_expired, pMainView); +} + +static void +_on_slider_long_press_end(void *data, Evas_Object *obj, void *event_info) +{ + //Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + //ivug_ret_if(!data||!p); + ivug_ret_if(!data); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + pMainView->bLongpressEnd = true; + + if(pMainView->popup_timer) + { + ecore_timer_del(pMainView->popup_timer); + pMainView->popup_timer = NULL; + } + + if((int)event_info == LONGTAP_CANCELED) + { + if(pMainView->longpress_popup) + { + IVUG_DEBUG_WARNING("copy popup remove"); + evas_object_del(pMainView->longpress_popup); + pMainView->longpress_popup = NULL; + } + } +} + +static void _on_remove_main_view_ui(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + ivug_main_view_del_hide_timer(pMainView); + + // Slider should be removed before mList is freed. + if ( pMainView->slider ) + { + evas_object_del(pMainView->slider); + pMainView->slider = NULL; + } + + if ( pMainView->pCropView ) + { + MSG_MAIN_HIGH("Crop View Destroy"); + ivug_crop_view_destroy(pMainView->pCropView); + pMainView->pCropView = NULL; + } + + if ( pMainView->pNameView ) + { + MSG_MAIN_HIGH("Name View Destroy"); + ivug_name_view_destroy(pMainView->pNameView); + pMainView->pNameView = NULL; + } + + if ( pMainView->pSetAsView ) + { + MSG_MAIN_HIGH("SetAS View Destroy"); + ivug_setas_view_destroy(pMainView->pSetAsView); + pMainView->pSetAsView = NULL; + } + + if ( pMainView->pDetailsView ) + { + MSG_MAIN_HIGH("Details View Destroy"); + + ivug_details_view_destroy(pMainView->pDetailsView); + pMainView->pDetailsView = NULL; + } + + + if(pMainView->layout) // Remove topmost parent in main view. + { + evas_object_del(pMainView->layout); + pMainView->layout = NULL; + } + + if(pMainView->empty_layout) + { + evas_object_del(pMainView->empty_layout); + pMainView->empty_layout = NULL; + } + + if ( pMainView->mList ) + { + MSG_MAIN_HIGH("Remove media list"); + ivug_medialist_del(pMainView->mList); // ivug_medialist_del() is not working on destroy cb. + pMainView->mList = NULL; + } +} + + +static void +_on_slider_item_changed(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + Slide_Item *sitem = (Slide_Item *)event_info; + + MSG_MAIN_HIGH("Image slider changed callback. "); + + if ( sitem == NULL || sitem->mitem == NULL) + { + // There is no item existed. terminate UG + MSG_MAIN_ERROR("No item is remained. exit UG. Sitem=0x%08x", sitem); + _on_remove_main_view_ui(pMainView); + DESTROY_ME(); + return; + } + + if(pMainView->selectioninfo != NULL) + { + MSG_MAIN_MED("Delete small noti"); + evas_object_del(pMainView->selectioninfo); + pMainView->selectioninfo = NULL; + } + + if (pMainView->longpress_popup) + { + MSG_MAIN_MED("Delete copy popup"); + evas_object_del(pMainView->longpress_popup); + pMainView->longpress_popup = NULL; + } + + drm_data_t *drm_data = ivug_slider_item_check_drm_constraint(sitem); + if(drm_data) + { + _ivug_main_view_drm_process(drm_data->constraints, drm_data->data, pMainView); + free(drm_data); + } + +// Update Main View. + if ( pMainView->bShowMenu == true ) + { + PERF_CHECK_BEGIN(LVL5, "Update main view"); + _update_main_view(pMainView); + PERF_CHECK_END(LVL5, "Update main view"); + } + + Media_Data *mdata = ivug_medialist_get_data(ivug_slider_item_data_get(sitem)); + + if(mdata->bIsDRMContent == true && ivug_drm_get_forwarding_info(mdata->filepath) == false) + { + elm_object_disabled_set(pMainView->btn_share, EINA_TRUE); + } + + pMainView->zoom_level = 1; + elm_slider_value_set(pMainView->zoom_slider, 1.0); + + ivug_slider_zoom_reset(pMainView->slider); +} + + +static void +_on_slider_item_state_changed(void *data, Evas_Object *obj, void *event_info) +{ +// Only called center item state is changed/ + MSG_MAIN_HIGH("Image slider item state changed callback. "); + ivug_ret_if(!data); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + Slide_Item *sitem = (Slide_Item *)event_info; + + if ( sitem == NULL || sitem->mitem == NULL) + { + // There is no item existed. terminate UG + MSG_MAIN_ERROR("No item is remained. exit UG"); + DESTROY_ME(); + + return; + } + + if(sitem->state == SLIDE_STATE_DOWNLOAD_FAILED) + { + MSG_MAIN_ERROR("Download failed"); + _ivug_selectioninfo_create(pMainView, IDS_DOWNLOAD_FAILED); + } + +} + + + +static void _on_receive_mouse_down (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + if (NULL == pMainView) { + return; + } + + ivug_main_view_del_hide_timer(pMainView); + + MSG_MAIN_HIGH("Event layer clicked : %s %s Layer=%d",evas_object_name_get(obj), evas_object_type_get(obj), evas_object_layer_get(obj)); +} + +#ifdef TEST_MOUSE_EVENT +static void _on_receive_mouse_down1 (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + char *name = (char *)data; + + MSG_MAIN_HIGH("Event layer mouse down : %s %s Layer=%d",evas_object_name_get(obj), name, evas_object_layer_get(obj)); +} + +static void _on_receive_mouse_up1 (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + char *name = (char *)data; + + MSG_MAIN_HIGH("Event layer mouse up : %s %s Layer=%d",evas_object_name_get(obj), name, evas_object_layer_get(obj)); +} + +#endif + + +static void _on_receive_mouse_up (void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + if (NULL == pMainView) { + return; + } + + ivug_main_view_set_hide_timer(pMainView); +} + +static void +_on_menu_state_changed(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + Ivug_MainView *pMainView = static_cast(data); + if (NULL == pMainView) { + return; + } + + MSG_MAIN_HIGH("Receive %s %s", emission, source); + + if ( strncmp(emission, "menu,show,finished", strlen(emission)) == 0 ) + { + elm_object_disabled_set(pMainView->ctrl_bar, EINA_FALSE); + } + else + { + evas_object_hide(pMainView->ctrl_bar); + elm_object_disabled_set(pMainView->ctrl_bar, EINA_TRUE); + } +} + + +static void _win_profile_changed_cb(void *data, Evas_Object * obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + IV_ASSERT(pMainView != NULL); + + const char *profile = elm_config_profile_get(); + + if (!strcmp(profile, "desktop")) + { // desktop mode + + // hide naviframe's back key + elm_object_item_part_content_set(pMainView->navi_it, "prev_btn", NULL); + } + else + { // mobile + + // show naviframe's back key + elm_object_item_part_content_set(pMainView->navi_it, "prev_btn", pMainView->back_btn); + } +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// +// External APIs +// + +static char * _ivug_get_folder_name(char *filepath) +{ + char *folder = ecore_file_dir_get(filepath); + + char *name = NULL; + + name = strrchr(folder, '/'); + if ( (name != NULL) && ((name+1) != NULL) ) + { + return strdup(name + 1); + } + + return NULL; +} + + +bool +ivug_main_view_set_list(Ivug_MainView *pMainView, ivug_parameter *ivug_param) +{ + MSG_MAIN_HIGH("Load media list."); + + PERF_CHECK_BEGIN(LVL2, "create media list"); + if (NULL == pMainView) { + return false; + } + + Media_List *mlist = ivug_medialist_create(); + if (mlist == NULL) + { + MSG_MAIN_ERROR("Creating media list failed"); + return false; + } + PERF_CHECK_END(LVL2, "create media list"); + + PERF_CHECK_BEGIN(LVL2, "create filter"); + + Filter_struct *filter = ivug_param_create_filter(ivug_param); + if (filter == NULL) + { + MSG_MAIN_ERROR("Creating filter failed"); + ivug_medialist_del(mlist); + return false; + } + + //do not use ivug_param->view_by after here + + PERF_CHECK_END(LVL2, "create filter"); + + Media_Item *current = NULL; + Media_Data *pData = NULL; + + + { + PERF_CHECK_BEGIN(LVL2, "media list load"); + current = ivug_medialist_load(mlist, filter); + PERF_CHECK_END(LVL2, "media list load"); + } + + if(current == NULL) + { + MSG_MAIN_ERROR("Media list load failed"); + goto LOAD_LIST_FAILED; + } + + pData = ivug_medialist_get_data(current); + if(pData == NULL) + { + MSG_MAIN_ERROR("current data is NULL"); + goto LOAD_LIST_FAILED; + } + if(pData->fileurl == NULL) + { + MSG_MAIN_ERROR("current fileurl is NULL"); + goto LOAD_LIST_FAILED; + } + + if(filter->view_by == IVUG_VIEW_BY_ALL) + { + pMainView->album_name = strdup(IDS_ALL_ALBUMS); + } + else if(filter->view_by == IVUG_VIEW_BY_FOLDER) + { + /* + media_handle m_handle = ivug_db_get_folder_handle(ecore_file_dir_get(ivug_param->filepath)); + if(m_handle == NULL) + { + MSG_IVUG_FATAL("View by Folder. but media handle is NULL" ); + return NULL; + } + + pMainView->album_name = ivug_db_get_folder_name(m_handle); + */ + pMainView->album_name = _ivug_get_folder_name(ivug_param->filepath); + if(pMainView->album_name == NULL) + { + pMainView->album_name = strdup(IDS_NO_NAME); + } + } + + pMainView->mList = mlist; + PERF_CHECK_BEGIN(LVL2, "media list set"); + + if(!ivug_slider_set_medialist(pMainView->slider, mlist, current)) { + MSG_MAIN_ERROR("ivug_slider_set_medialist error"); + goto LOAD_LIST_FAILED; + } + + PERF_CHECK_END(LVL2, "media list set"); + + ivug_data_filter_delete(filter); + + return true; + +LOAD_LIST_FAILED: + if(filter) + ivug_data_filter_delete(filter); + if(mlist) + ivug_medialist_del(mlist); + pMainView->mList = NULL; + return false; +} + +static void +_on_slideshow_finished(void *data, Evas_Object *obj, void *event_info) +{ + MSG_MAIN_HIGH("_on_slideshow_finished"); + IV_ASSERT(data != NULL); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + int ss_state = (int)event_info; + bool bDestoryed = false; + bDestoryed = _destory_slideshow_and_ug(pMainView, ss_state, false); + if (bDestoryed) { + return; + } + + Media_Item * item = NULL; + + if(pMainView->ssHandle) + { + + item = ivug_ss_item_get(pMainView->ssHandle); + ivug_ss_delete(pMainView->ssHandle); + pMainView->ssHandle = NULL; + + if(item) + ivug_slider_set_item(pMainView->slider, item, SLIDE_INSTANTLY); + } + + + ivug_slider_load(pMainView->slider); + ivug_main_view_show_menu_bar(pMainView); +} + +static void +_ivug_main_view_zoom_out_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + ivug_ret_if(!obj); + ivug_ret_if(!data); + + MSG_MAIN_ERROR("_ivug_main_view_zoom_out_cb"); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + double d_value = elm_slider_value_get(pMainView->zoom_slider); + + MSG_MAIN_HIGH("d_value = %lf", d_value); + + int value = (int)round(d_value); + + MSG_MAIN_HIGH("value = %d", value); + + if(value > 1) + { + ivug_main_view_del_hide_timer(pMainView); + + ivug_slider_zoom_out(pMainView->slider); + pMainView->zoom_level--; + elm_slider_value_set(pMainView->zoom_slider, value-1.0); + + ivug_main_view_set_hide_timer(pMainView); + } + + _show_zoom_icon(pMainView); +} + +static void +_ivug_main_view_zoom_in_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + ivug_ret_if(!obj); + ivug_ret_if(!data); + + MSG_MAIN_ERROR("_ivug_main_view_zoom_in_cb"); + + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + double d_value = elm_slider_value_get(pMainView->zoom_slider); + + MSG_MAIN_HIGH("d_value = %lf", d_value); + + int value = (int)round(d_value); + + MSG_MAIN_HIGH("value = %d", value); + + if(value <= ZOOM_LEVEL_MAX) + { + ivug_main_view_del_hide_timer(pMainView); + + ivug_slider_zoom_in(pMainView->slider); + pMainView->zoom_level++; + elm_slider_value_set(pMainView->zoom_slider, value+1.0); + + ivug_main_view_set_hide_timer(pMainView); + } + + _show_zoom_icon(pMainView); +} + +static void _zoom_slider_change_cb(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + double d_value = elm_slider_value_get(pMainView->zoom_slider); + + MSG_MAIN_HIGH("d_value = %lf", d_value); + + int value = (int)round(d_value); + + MSG_MAIN_HIGH("value = %d", value); + + while(pMainView->zoom_level > 0 + && pMainView->zoom_level <= ZOOM_LEVEL_MAX+1 + && value != pMainView->zoom_level) + { + if(value > pMainView->zoom_level) + { + ivug_slider_zoom_in(pMainView->slider); + pMainView->zoom_level++; + } + else if(value < pMainView->zoom_level) + { + ivug_slider_zoom_out(pMainView->slider); + pMainView->zoom_level--; + } + } +} + +static void _zoom_slider_start_cb(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + ivug_main_view_del_hide_timer(pMainView); +} + +static void _zoom_slider_end_cb(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_MainView *pMainView = (Ivug_MainView *)data; + + ivug_main_view_set_hide_timer(pMainView); +} + +Ivug_MainView * +ivug_main_view_create(Evas_Object* parent, ivug_mode mode, ivug_view_by view_by) +{ + IV_ASSERT(parent != NULL); + + MSG_MAIN_HIGH("Creating main view. Parent=0x%08x Mode=%d ViewBy=%d", parent, mode, view_by); + + PERF_CHECK_BEGIN(LVL2, "Create layout"); + +//create main view layout + Ivug_MainView *pMainView = (Ivug_MainView *)calloc(1, sizeof(Ivug_MainView) ); + IV_ASSERT(pMainView != NULL); + +// Set default value + pMainView->parent = parent; + pMainView->mode = mode; + pMainView->view_by = view_by; + + pMainView->bShowMenu = true; + + pMainView->hide_count = -1; + + Evas_Object *layout = EFL::create_layout(parent, IVUG_MAIN_EDJ, "mainview"); + if ( layout == NULL) //if failed + { + MSG_MAIN_ERROR("main layout create failed"); + free(pMainView); + return NULL; + } + + pMainView->layout = layout; + evas_object_name_set(pMainView->layout, "Main Layout"); + + PERF_CHECK_END(LVL2, "Create layout"); + + edje_object_signal_callback_add(_EDJ(pMainView->layout), + "menu,hide,finished", + "edc", + _on_menu_state_changed, + (void *)pMainView); + + edje_object_signal_callback_add(_EDJ(pMainView->layout), + "menu,show,finished", + "edc", + _on_menu_state_changed, + (void *)pMainView); + +// Navigation bar + PERF_CHECK_BEGIN(LVL2, "elm_naviframe_add"); + + pMainView->navi_bar = elm_naviframe_add(layout); + if ( pMainView->navi_bar == NULL) + { + MSG_MAIN_ERROR("navigation bar failed"); + ivug_main_view_destroy(pMainView); + return NULL; + } + evas_object_name_set(pMainView->navi_bar, "Main naviframe"); + +// Layout life cycle is controlled by application explictily. + elm_naviframe_content_preserve_on_pop_set(pMainView->navi_bar, EINA_TRUE); + +#ifdef USE_CUSTOM_STYLE + elm_object_theme_set(pMainView->navi_bar, gGetSystemTheme() ); +#endif + const char *profile = elm_config_profile_get(); + if (!strcmp(profile,"mobile")) + { + elm_object_style_set(pMainView->navi_bar, "ivug-main/default"); + } + else if (!strcmp(profile,"desktop")) + { + elm_object_style_set(pMainView->navi_bar, "ivug-main/noindicator"); + } + else + { + MSG_MAIN_ERROR("Unknown profile : %s", profile); + } + + elm_object_part_content_set(layout, "mainview.navibar", pMainView->navi_bar); //swallow + + PERF_CHECK_END(LVL2, "elm_naviframe_add"); + + PERF_CHECK_BEGIN(LVL2, "elm_layout_add"); + + pMainView->empty_layout = EFL::create_layout(layout, IVUG_MAIN_EDJ, "navi_content"); + if (pMainView->empty_layout == NULL) + { + IVUG_DEBUG_WARNING("layout create failed"); + ivug_main_view_destroy(pMainView); + return NULL; + } + + evas_object_name_set(pMainView->empty_layout, "Empty layout"); + PERF_CHECK_END(LVL2,"elm_layout_add"); + + if(pMainView->view_by != IVUG_VIEW_BY_FILE && pMainView->view_by != IVUG_VIEW_BY_INVAILD) + { + PERF_CHECK_BEGIN(LVL2, "Create thumblist"); + + + PERF_CHECK_END(LVL2, "Create thumblist"); + } + +//create slider + PERF_CHECK_BEGIN(LVL2, "ivug_slider_add"); + + pMainView->slider = ivug_slider_add(pMainView->empty_layout); + if (pMainView->slider == NULL) + { + MSG_MAIN_ERROR("image slider create failed"); + ivug_main_view_destroy(pMainView); + return NULL; + } + + elm_object_part_content_set(pMainView->empty_layout, "mainview.slider", pMainView->slider); //swallow + + PERF_CHECK_END(LVL2, "ivug_slider_add"); + + Evas_Object *slider = elm_slider_add(pMainView->empty_layout); + elm_slider_indicator_format_set(slider, "%1.0f"); + elm_slider_min_max_set(slider, 1, 5); + elm_slider_value_set(slider, 1); + + evas_object_smart_callback_add(slider, "changed", _zoom_slider_change_cb, pMainView); + evas_object_smart_callback_add(slider, "slider,drag,start", _zoom_slider_start_cb, pMainView); + evas_object_smart_callback_add(slider, "slider,drag,stop", _zoom_slider_end_cb, pMainView); + + elm_object_part_content_set(pMainView->empty_layout, "zoom_slider_area", slider); //swallow + + pMainView->zoom_slider = slider; + pMainView->zoom_level = 1; + + if (pMainView->mode != IVUG_MODE_DISPLAY) + { + PERF_CHECK_BEGIN(LVL2, "ivug_button_add"); + pMainView->back_btn = ivug_button_add(pMainView->navi_bar, "naviframe/end_btn/default", IDS_BACK, NULL, on_btn_back_clicked, pMainView); + PERF_CHECK_END(LVL2, "ivug_button_add"); + } + else + { + PERF_CHECK_BEGIN(LVL2, "ivug_button_add"); + pMainView->back_btn = ivug_button_add(pMainView->navi_bar, "naviframe/end_btn/default", IDS_BACK, NULL, on_btn_selectcancel_clicked, pMainView); + PERF_CHECK_END(LVL2, "ivug_button_add"); + } + + PERF_CHECK_BEGIN(LVL2, "elm_naviframe_item_push"); + pMainView->navi_it = elm_naviframe_item_push(pMainView->navi_bar, NULL, pMainView->back_btn, NULL, pMainView->empty_layout, NULL); + PERF_CHECK_END(LVL2, "elm_naviframe_item_push"); + + //Evas_Object *conformant = (Evas_Object *)ug_get_conformant(); + //elm_object_signal_emit(conformant, "elm,state,indicator,overlap", ""); + + evas_object_smart_callback_add((Evas_Object *)ug_get_window(), "profile,changed", _win_profile_changed_cb, pMainView); + + _create_main_menu(pMainView); + + PERF_CHECK_BEGIN(LVL2, "add event handler"); + +// elm_object_part_content_set(layout, "mainview.slider", pMainView->slider); //swallow + +//register mouse call back. + evas_object_smart_callback_add(pMainView->slider, "slider,clicked", _on_slider_clicked, pMainView); + evas_object_smart_callback_add(pMainView->slider, "slider,longpress,start", _on_slider_long_press_start, pMainView); + evas_object_smart_callback_add(pMainView->slider, "slider,longpress,end", _on_slider_long_press_end, pMainView); + evas_object_smart_callback_add(pMainView->slider, "slider,clicked,icon", _on_slider_icon_clicked, pMainView); + + evas_object_smart_callback_add(pMainView->slider, "slider,item,changed", _on_slider_item_changed, pMainView); + evas_object_smart_callback_add(pMainView->slider, "slider,item,state,changed", _on_slider_item_state_changed, pMainView); + + //MSG_MAIN_HIGH("binded main win address is %p\n", main_win); + +#ifdef TEST_MOUSE_EVENT + evas_object_event_callback_add(pMainView->navi_bar, EVAS_CALLBACK_MOUSE_DOWN, _on_receive_mouse_down1, (void *)"navigarion"); + evas_object_event_callback_add(pMainView->layout, EVAS_CALLBACK_MOUSE_DOWN, _on_receive_mouse_down1, (void *)"layout"); + evas_object_event_callback_add(pMainView->slider, EVAS_CALLBACK_MOUSE_DOWN, _on_receive_mouse_down1, (void *)"slider"); + evas_object_event_callback_add(pMainView->slider, EVAS_CALLBACK_MOUSE_UP, _on_receive_mouse_up1, (void *)"slider"); + evas_object_event_callback_add(const_cast(edje_object_part_object_get(_EDJ(pMainView->layout) , "clip")), EVAS_CALLBACK_MOUSE_DOWN, _on_receive_mouse_down1, (void *)"clip"); + evas_object_event_callback_add(const_cast(edje_object_part_object_get(_EDJ(pMainView->layout) , "mainview.navibar")), EVAS_CALLBACK_MOUSE_DOWN, _on_receive_mouse_down1, (void *)"navi swallow"); + evas_object_event_callback_add(pMainView->ctrl_bar, EVAS_CALLBACK_MOUSE_DOWN, _on_receive_mouse_down1, (void *)"controlbar"); +#endif + + evas_object_event_callback_add(pMainView->layout, EVAS_CALLBACK_RESIZE, _on_resize, pMainView); + + // zoom icon + edje_object_signal_callback_add(_EDJ(pMainView->empty_layout), + "mainview,zoom_out,clicked", + "", + _ivug_main_view_zoom_out_cb, + (void *)pMainView); + edje_object_signal_callback_add(_EDJ(pMainView->empty_layout), + "mainview,zoom_in,clicked", + "", + _ivug_main_view_zoom_in_cb, + (void *)pMainView); + + _show_zoom_icon(pMainView); + + pMainView->keydown_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _on_key_down, (void *)pMainView); + + { + int bx, by, bw, bh; + evas_object_geometry_get(pMainView->navi_bar, &bx, &by, &bw, &bh); + + MSG_MAIN_HIGH("Navibar Created. (%d,%d,%d,%d)", bx, by, bw, bh); + } + + { + int bx, by, bw, bh; + evas_object_geometry_get(pMainView->slider, &bx, &by, &bw, &bh); + + MSG_MAIN_HIGH("Slider Created. (%d,%d,%d,%d)", bx, by, bw, bh); + } + + { + int bx, by, bw, bh; + evas_object_geometry_get(pMainView->empty_layout, &bx, &by, &bw, &bh); + + MSG_MAIN_HIGH("Empty Created. (%d,%d,%d,%d)", bx, by, bw, bh); + } + + int bx, by, bw, bh; + evas_object_geometry_get(pMainView->layout, &bx, &by, &bw, &bh); + + MSG_MAIN_HIGH("Main View Created. (%d,%d,%d,%d)", bx, by, bw, bh); + +// For debugging. + DELETE_NOTIFY(pMainView->layout); + + PERF_CHECK_END(LVL2, "add event handler"); + + return pMainView; + +} + +void ivug_main_view_start_slideshow(Ivug_MainView *pMainView, Eina_Bool bSlideFirst) +{ + IV_ASSERT(pMainView != NULL); + + Media_Item *current = NULL; + + // Stop animation & movie play before slideshow is started. + ivug_slider_pause(pMainView->slider); + current = ivug_slider_get_item(pMainView->slider); + + ivug_prohibit_lcd_off(); + //ivug_main_view_hide_menu_bar(pMainView); + + pMainView->ssHandle = ivug_ss_create(pMainView->layout); + +// Register callback + evas_object_smart_callback_add(ivug_ss_object_get(pMainView->ssHandle), "slideshow,finished", _on_slideshow_finished, pMainView); + + ivug_main_view_hide_menu_bar(pMainView); + + ivug_ss_start(pMainView->ssHandle, current, pMainView->mList, bSlideFirst); +} + + +Evas_Object * +ivug_main_view_object_get(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + return pMainView->layout; +} + +void +ivug_main_view_start(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + + { + ivug_main_view_set_hide_timer(pMainView); + } + + + PERF_CHECK_BEGIN(LVL2, "slider start"); + ivug_slider_start(pMainView->slider); + PERF_CHECK_END(LVL2, "slider start"); + + + pMainView->area_obj = evas_object_rectangle_add(evas_object_evas_get(pMainView->layout)); + evas_object_size_hint_expand_set(pMainView->area_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(pMainView->area_obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(pMainView->area_obj, 0,0,0,0); + elm_object_part_content_set(pMainView->layout, "mainview.area", pMainView->area_obj); + +// evas_object_show(pMainView->area_obj); +} + + +void +ivug_main_view_resume(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + if (pMainView->slider == NULL) { + MSG_MAIN_HIGH("slider is NULL"); + return; + } + MSG_MAIN_HIGH("Main View Update"); + + Media_Item *mitem = ivug_slider_get_item(pMainView->slider); + Media_Data *mdata = ivug_medialist_get_data(mitem); + + IV_ASSERT(mdata != NULL); + + if (mdata->slide_type == SLIDE_TYPE_IMAGE || mdata->slide_type == SLIDE_TYPE_VIDEO ) + { + if(mdata->filepath && ecore_file_exists(mdata->filepath)) // Current file is not deleted + { + MSG_MAIN_HIGH("Current filepath : %s", mdata->filepath); + } + else + { + /*if file is not exist ug terminated temporally */ + MSG_MAIN_ERROR("Center file is not exist. stype=%d name=%s", mdata->slide_type, mdata->filepath); + DESTROY_ME(); + return ; + } + } + else + { + MSG_MAIN_ERROR("Unhandled slide type : %d", mdata->slide_type); + } + +// When resume, menu bar will be appeared. + if(!(pMainView->pNameView + || pMainView->pSetAsView + || pMainView->pCropView)) //child view is not exist + { + ivug_main_view_show_menu_bar(pMainView); + } + + ivug_slider_resume(pMainView->slider); +} + +void +ivug_main_view_pause(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + if ( pMainView->ssHandle ) + { + ivug_ss_stop(pMainView->ssHandle); + } + if (pMainView->slider) { + ivug_slider_pause(pMainView->slider); + } + + if(pMainView->bShowMenu == true) + { + ivug_main_view_del_hide_timer(pMainView); + } + // Stop photocam If AGIF +} + + +void +ivug_main_view_destroy(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + MSG_MAIN_HIGH("ENTER : Main View Destroy. pMainView=0x%08x", pMainView); + + ivug_main_view_del_hide_timer(pMainView); + + if (pMainView->popup_timer) + { + ecore_timer_del(pMainView->popup_timer); + pMainView->popup_timer = NULL; + } + + if (pMainView->popup) + { + evas_object_del(pMainView->popup); + pMainView->popup = NULL; + } + + if(pMainView->ctx_popup) + { + evas_object_del(pMainView->ctx_popup); + pMainView->ctx_popup = NULL; + } + + if (pMainView->ext_ug) + { + MSG_MAIN_HIGH("External UG Destroy"); + ug_destroy(pMainView->ext_ug); + pMainView->ext_ug = NULL; + } + + if (pMainView->exit_timer) + { + ecore_timer_del(pMainView->exit_timer); + pMainView->exit_timer = NULL; + } + + if ( pMainView->zoom_slider ) + { + evas_object_del(pMainView->zoom_slider); + pMainView->zoom_slider = NULL; + } + + MSG_MAIN_HIGH("Unregister system notifications"); + + if(pMainView->keydown_handler) + { + ecore_event_handler_del(pMainView->keydown_handler); + pMainView->keydown_handler = NULL; + } + + if(pMainView->album_name) + { + free(pMainView->album_name); + } + + if(pMainView->area_obj) + { + evas_object_del(pMainView->area_obj); + pMainView->area_obj = NULL; + } + +// Who remove medialist????? + _on_remove_main_view_ui(pMainView); + + EFL::dump_obj(pMainView->parent, 0); + free(pMainView); + + MSG_MAIN_HIGH("LEAVE : Main View Destroy."); + + return ; +} + +void ivug_main_view_set_hide_timer(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + return; +} + +void ivug_main_view_del_hide_timer(Ivug_MainView *pMainView) +{ + IV_ASSERT(pMainView != NULL); + + return; +} + +void +ivug_main_view_show_menu_bar(Ivug_MainView *pMainView) +{ + MSG_MAIN_HIGH("Show Menu"); + if (NULL == pMainView) { + return; + } + + pMainView->bShowMenu = true; + evas_object_show(pMainView->ctrl_bar); + + _update_main_view(pMainView); + +#ifdef HIDE_INDICATOR + elm_win_indicator_mode_set(ug_get_window(), ELM_WIN_INDICATOR_HIDE); +#else + if(gIsDesktopMode() == false) + { + elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_SHOW); + } +#endif +// edje_object_signal_emit(_EDJ(pMainView->layout), "mainview,show,menu", "elm"); + + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,show", "user"); + + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_TRUE); + elm_object_item_signal_emit(pMainView->navi_it, "elm,state,toolbar,open", ""); + + ivug_slider_set_menu_visibility(pMainView->slider, EINA_TRUE); + +#ifdef TEST_MOUSE_EVENT + Eina_List *l = const_cast(evas_object_clipees_get(pMainView->navi_bar)); + + MSG_MAIN_HIGH("Clipper clips %i objects", eina_list_count(l)); + + void *obj; + Eina_List *l1; + + EINA_LIST_FOREACH(l, l1, obj) + { + MSG_MAIN_HIGH("Object Type : %s", evas_object_name_get((Evas_Object *)obj)); + } + + Evas_Object *above; + Evas_Object *below; + + above = evas_object_above_get(pMainView->navi_bar); + MSG_MAIN_HIGH("Navi Above : 0x%08x %s %s", above, evas_object_name_get(above), evas_object_type_get(above)); + + below = evas_object_below_get(pMainView->navi_bar); + MSG_MAIN_HIGH("Navi Below : 0x%08x %s %s", below, evas_object_name_get(below), evas_object_type_get(below)); + + above = evas_object_above_get(pMainView->slider); + MSG_MAIN_HIGH("Slider Above : 0x%08x %s %s", above, evas_object_name_get(above), evas_object_type_get(above)); + + below = evas_object_below_get(pMainView->slider); + MSG_MAIN_HIGH("Slider Below : 0x%08x %s %s", below, evas_object_name_get(below), evas_object_type_get(below)); +#endif + + ivug_main_view_set_hide_timer(pMainView); + +} + +void +ivug_main_view_hide_menu_bar(Ivug_MainView *pMainView) +{ + MSG_MAIN_HIGH("Hide Menu"); + if (NULL == pMainView) { + return; + } + + ivug_main_view_del_hide_timer(pMainView); + + pMainView->bShowMenu = false; + + elm_object_disabled_set(pMainView->ctrl_bar, EINA_TRUE); + + edje_object_signal_emit(_EDJ(pMainView->empty_layout), "elm,state,hide", "user"); + + elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_HIDE); + +// edje_object_signal_emit(_EDJ(pMainView->layout), "mainview,hide,menu","elm"); + elm_naviframe_item_title_visible_set(pMainView->navi_it, EINA_FALSE); + elm_object_item_signal_emit(pMainView->navi_it, "elm,state,toolbar,close", ""); + + // zoom icon + _hide_zoom_icon(pMainView); + + ivug_slider_set_menu_visibility(pMainView->slider, EINA_FALSE); + +} + diff --git a/main/src/view/ivug-name-view.c b/main/src/view/ivug-name-view.c new file mode 100755 index 0000000..73285f8 --- /dev/null +++ b/main/src/view/ivug-name-view.c @@ -0,0 +1,588 @@ +/* + * Copyright 2012 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 "ivug-common.h" + +#include "ivug-name-view.h" +#include "ivug-popup.h" + +#include "ivug-media.h" + +#include "ivug-util.h" + +static void +_on_timeout_response(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_NameView *pNameView = (Ivug_NameView *)data; + + if ( pNameView->fnresponse ) + { + (pNameView->fnresponse)(NAME_VIEW_RESPONSE_CANCEL, NULL, pNameView->clientdata); + } + + //destroy after pop and transit ended + //ivug_name_view_destroy(pNameView); +} + +static void _on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_NameView *pNameView = (Ivug_NameView *)data; + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(pNameView->navibar); + + if(pNameView->sip_show == true) + { + int rot = gGetRotationDegree(); + if(rot == 90 || rot == 270) + { + elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE); + } + else + { + elm_naviframe_item_title_visible_set(navi_it, EINA_TRUE); + } + } + else + { + elm_naviframe_item_title_visible_set(navi_it, EINA_TRUE); + } +} + +static void +_on_keypad_show(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_NameView *pNameView = (Ivug_NameView *)data; + + pNameView->sip_show = true; + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(pNameView->navibar); + + int rot = gGetRotationDegree(); + if(rot == 90 || rot == 270) + { + elm_naviframe_item_title_visible_set(navi_it, EINA_FALSE); + } +} + +static void +_on_keypad_hide(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_NameView *pNameView = (Ivug_NameView *)data; + + pNameView->sip_show = false; + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(pNameView->navibar); + + elm_naviframe_item_title_visible_set(navi_it, EINA_TRUE); +} + + +static void +_on_invalid_name_timeout_response(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_NameView *pNameView = (Ivug_NameView *)data; + + ecore_imf_context_input_panel_show(elm_entry_imf_context_get(pNameView->entry)); +} + +static void +_ivug_rename_view_enter_click_cb(void *data, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("inside ..."); + Ivug_NameView *pNameView = (Ivug_NameView *)data; + IV_ASSERT(pNameView != NULL); + + Evas_Object *entry = elm_object_part_content_get(pNameView->editfield, "elm.icon.entry"); + + char *name = elm_entry_markup_to_utf8 ( elm_entry_entry_get(entry) ); + + MSG_IMAGEVIEW_HIGH("name = %s", name); + + if(name) + { + char *new_name = NULL; + new_name = ivug_strip_string(name); + if(new_name == NULL) + { + MSG_IMAGEVIEW_ERROR( "ivug_strip_string failed"); + ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(entry)); + ivug_timeout_popup_show(pNameView->layout, _on_timeout_response, pNameView, IDS_ERROR, IDS_ENTRY_IS_EMPTY); + free (name); + return; + } + + if ( pNameView->fnresponse ) + { + (pNameView->fnresponse)(NAME_VIEW_RESPONSE_OK, new_name, pNameView->clientdata); + } + + free(name); + + //destroy after pop and transit ended + //ivug_name_view_destroy(pNameView); + } + else + { + ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(entry)); + } +} + +void +_ivug_name_view_maxlength_reached(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_NameView *pNameView = (Ivug_NameView *)data; + IV_ASSERT(pNameView != NULL); + + //todo : show popup + +} + +static void +_ivug_name_view_done_cb(void *data, Evas_Object* obj, void* event_info ) +{ + MSG_IMAGEVIEW_HIGH( "pNameView Done "); + Ivug_NameView *pNameView = (Ivug_NameView *)data; + IV_ASSERT(pNameView != NULL); + + Evas_Object *entry = elm_object_part_content_get(pNameView->editfield, "elm.icon.entry"); + + char *name = elm_entry_markup_to_utf8 ( elm_entry_entry_get(entry) ); + + MSG_IMAGEVIEW_HIGH("name = %s", name); + + if(name) + { + char *new_name = NULL; + new_name = ivug_strip_string(name); + if(new_name == NULL) + { + MSG_IMAGEVIEW_ERROR( "ivug_strip_string failed"); + ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(entry)); + ivug_timeout_popup_show(pNameView->layout, _on_timeout_response, pNameView, IDS_ERROR, IDS_ENTRY_IS_EMPTY); + free (name); + return; + } + + if ( pNameView->fnresponse ) + { + (pNameView->fnresponse)(NAME_VIEW_RESPONSE_OK, new_name, pNameView->clientdata); + } + + free(name); + } + + //destroy after pop and transit ended + //ivug_name_view_destroy(pNameView); +} + +static void +_ivug_name_view_cancel_cb(void *data, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("pNameView Back"); + Ivug_NameView *pNameView = (Ivug_NameView *)data; + IV_ASSERT(pNameView != NULL); + + if(pNameView->sip_show == true) + { + ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(pNameView->entry)); + } + else + { + if ( pNameView->fnresponse ) + { + (pNameView->fnresponse)(NAME_VIEW_RESPONSE_CANCEL, NULL, pNameView->clientdata); + } + + //destroy after pop and transit ended + //ivug_name_view_destroy(pNameView); +} +} + +static void _ivug_name_view_on_entry_changed(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_NameView *pNameView = (Ivug_NameView *)data; + IV_ASSERT(pNameView != NULL); + + if (elm_object_focus_get(obj)) + { + if (elm_entry_is_empty(obj)) + elm_object_signal_emit(pNameView->editfield, "elm,state,eraser,hide", ""); + else + elm_object_signal_emit(pNameView->editfield, "elm,state,eraser,show", ""); + } + + Evas_Object *entry; + + entry = elm_object_part_content_get(pNameView->editfield, "elm.icon.entry"); + + char *content = elm_entry_markup_to_utf8 ( elm_entry_entry_get(entry) ); + + if (strlen(content) == 0) + { + MSG_IMAGEVIEW_HIGH("ISF1 : %s", content); + elm_object_part_text_set(pNameView->entry, "elm.guide", IDS_ENTER_NAME); + //elm_object_disabled_set(pNameView->btn_done, EINA_TRUE); + } + else if(ivug_validate_file_name(content) == false) + { + MSG_IMAGEVIEW_HIGH("invalid char ISF : %s", content); + char *new_str = strdup(content); + if (new_str) { + if (strlen(content) > 0) + new_str[strlen(content) - 1] = '\0'; + elm_entry_entry_set(pNameView->entry, new_str); + elm_entry_cursor_end_set(pNameView->entry); + free(new_str); + new_str = NULL; + } + ecore_imf_context_input_panel_hide(elm_entry_imf_context_get(pNameView->entry)); + ivug_timeout_popup_show(pNameView->layout, _on_invalid_name_timeout_response, + pNameView, NULL, IDS_INVALID_NAME); + } + else + { + MSG_IMAGEVIEW_HIGH("ISF : %s", content); + elm_object_part_text_set(pNameView->entry, "elm.guide", IDS_NULL); + elm_object_disabled_set(pNameView->btn_done, EINA_FALSE); + } + + free(content ); + +} + +static void _ivug_name_view_on_entry_changed_user(void *data, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("Entry changed by user"); +} + +static void _ivug_name_view_on_entry_preedit_changed(void *data, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("_ivug_name_view_on_entry_preedit_changed"); + + _ivug_name_view_on_entry_changed(data, obj, event_info); +} + +static void _ivug_name_view_on_entry_focused(void *data, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("_ivug_name_view_on_entry_focused"); + if (!elm_entry_is_empty(obj)) + elm_object_signal_emit(data, "elm,state,eraser,show", ""); + elm_object_signal_emit(data, "elm,state,rename,hide", ""); +} + +static void _ivug_name_view_on_entry_unfocused(void *data, Evas_Object *obj, void *event_info) +{ + MSG_IMAGEVIEW_HIGH("_ivug_name_view_on_entry_unfocused"); + + elm_object_signal_emit(data, "elm,state,eraser,hide", ""); + elm_object_signal_emit(data, "elm,state,rename,show", ""); +} + + +static void +_ivug_name_view_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + elm_object_focus_set(data, EINA_TRUE); // After button is clicked, entry should get focus again. + elm_entry_entry_set(data, ""); +} + +static Evas_Object *_ivug_name_view_editfield_create(void *data, Evas_Object *obj) +{ + Ivug_NameView *pNameView = (Ivug_NameView *)data; + + Evas_Object *editfield = elm_layout_add(obj); + elm_layout_theme_set(editfield, "layout", "item/editfield", "default"); + + Evas_Object *entry = elm_entry_add(editfield); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_scrollable_set(entry, EINA_TRUE); + elm_object_part_text_set(entry, "elm.guide", IDS_ENTER_NAME); + + evas_object_smart_callback_add(entry, "activated", _ivug_rename_view_enter_click_cb, pNameView); + evas_object_smart_callback_add(entry, "changed", _ivug_name_view_on_entry_changed, pNameView); + evas_object_smart_callback_add(entry, "preedit,changed", _ivug_name_view_on_entry_preedit_changed, pNameView); + evas_object_smart_callback_add(entry, "changed,user", _ivug_name_view_on_entry_changed_user, pNameView); + evas_object_smart_callback_add(entry, "focused", _ivug_name_view_on_entry_focused, editfield); + evas_object_smart_callback_add(entry, "unfocused", _ivug_name_view_on_entry_unfocused, editfield); + + elm_object_part_content_set(editfield, "elm.icon.entry", entry); + + //MSG_IMAGEVIEW_HIGH("entry = %s", elm_entry_entry_get(entry)); + + Evas_Object *button = elm_button_add(editfield); + elm_object_style_set(button, "editfield_clear"); // Make "X" marked button by changing style. + elm_object_part_content_set(editfield, "elm.icon.eraser", button); // Add eraser button to current editfield layout. + evas_object_smart_callback_add(button, "clicked", _ivug_name_view_eraser_clicked_cb, entry); + + pNameView->entry = entry; + + pNameView->editfield = editfield; + + return pNameView->editfield; + +} + +static Evas_Object *_ivug_name_view_create_content(Ivug_NameView *pNameView, Evas_Object *parent) +{ + ivug_retvm_if(!pNameView, NULL, "pNameView is NULL"); + ivug_retvm_if(!parent, NULL, "parent is NULL"); + + Eina_Bool ret = EINA_FALSE; + + Evas_Object *content_lay = elm_layout_add(parent); + evas_object_size_hint_weight_set(content_lay, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(content_lay, EVAS_HINT_FILL, EVAS_HINT_FILL ); + ret = elm_layout_file_set(content_lay, EDJ_PATH"/ivug-name-view.edj", "name_view"); + MSG_IMAGEVIEW_HIGH("ret is %d", ret); + ivug_retvm_if(ret == EINA_FALSE, NULL, "elm_layout_file_set ailed"); + + Evas_Object *editfield = _ivug_name_view_editfield_create(pNameView, content_lay); + elm_object_part_content_set(content_lay, "entry_part", editfield); + + evas_object_show(editfield); + + return content_lay; +} + +Ivug_NameView * +ivug_name_view_create(Evas_Object *parent, const char *title) +{ + MSG_IMAGEVIEW_HIGH( "... "); + + IV_ASSERT(parent != NULL); + + Ivug_NameView *pNameView = calloc(1, sizeof(Ivug_NameView)); + if ( pNameView == NULL) + { + MSG_IMAGEVIEW_ERROR("Cannot allocated memory"); + return NULL; + } + + MSG_IMAGEVIEW_HIGH( "Add Name View creation"); + + pNameView->layout = ivug_default_layout_add(parent); + + if ( pNameView->layout == NULL) + { + MSG_IMAGEVIEW_ERROR("Cannot create layout"); + free(pNameView); + return NULL; + } + + pNameView->bg = ivug_bg_add(pNameView->layout, IVUG_DEFAULT_BG_COLOR, IVUG_DEFAULT_BG_COLOR, IVUG_DEFAULT_BG_COLOR); + + if ( pNameView->bg == NULL) + { + MSG_IMAGEVIEW_ERROR("Cannot create bg"); + free(pNameView); + return NULL; + } + + elm_object_part_content_set(pNameView->layout, "elm.swallow.bg", pNameView->bg); + + Evas_Object *navi_bar; + navi_bar = elm_naviframe_add(pNameView->layout); + + if ( navi_bar == NULL) + { + MSG_IMAGEVIEW_ERROR("Cannot create navigation bar"); + free(pNameView); + return NULL; + } + + //using default naviframe + + elm_object_part_content_set(pNameView->layout, "elm.swallow.content", navi_bar ); + evas_object_show(navi_bar); + + pNameView->navibar = navi_bar; + + pNameView->content = _ivug_name_view_create_content(pNameView, navi_bar); + if(pNameView->content == NULL) + { + MSG_IMAGEVIEW_ERROR("Cannot create navigation bar"); + free(pNameView); + return NULL; + } + + Evas_Object *cancel_button, *done_button; + + cancel_button = ivug_button_add(navi_bar, "naviframe/end_btn/default", NULL, NULL, _ivug_name_view_cancel_cb, pNameView ); + + done_button = ivug_button_add(navi_bar, "naviframe/toolbar/default", IDS_DONE, NULL, _ivug_name_view_done_cb, pNameView ); + + pNameView->btn_done = done_button; + + //elm_object_disabled_set(done_button, EINA_TRUE); + + Elm_Object_Item *navi_it = NULL; + navi_it = elm_naviframe_item_push(pNameView->navibar, title, cancel_button, NULL, pNameView->content, NULL); + + Evas_Object *conformant = ug_get_conformant(); + + evas_object_smart_callback_add(conformant, "virtualkeypad,state,on", _on_keypad_show, pNameView); + evas_object_smart_callback_add(conformant, "virtualkeypad,state,off", _on_keypad_hide, pNameView); + evas_object_smart_callback_add(conformant, "clipboard,state,on", _on_keypad_show, pNameView); + evas_object_smart_callback_add(conformant, "clipboard,state,off", _on_keypad_hide, pNameView); + + evas_object_event_callback_add(pNameView->content, EVAS_CALLBACK_RESIZE, _on_resized, (void *)pNameView); + + elm_object_signal_emit(conformant, "elm,state,indicator,nooverlap", ""); + + //ivug_name_view_set_focus(pNameView); + + elm_object_item_part_content_set(navi_it, "toolbar_button1", done_button); + //elm_object_item_part_content_set(navi_it, "title_toolbar_button1", done_button); + //elm_object_item_part_content_set(navi_it, "title_prev_btn", cancel_button); + //elm_object_item_signal_emit(navi_it, "elm,state,sip,shown", ""); + + return pNameView; +} + + +void +ivug_name_view_destroy(Ivug_NameView *pNameView) +{ + ivug_ret_if(pNameView == NULL); + + MSG_IMAGEVIEW_HIGH( "Destroy Name View"); + + if(pNameView->entry) + { + evas_object_del(pNameView->entry); + pNameView->entry = NULL; + } + + if(pNameView->editfield) + { + evas_object_del(pNameView->editfield); + pNameView->editfield = NULL; + } + + if(pNameView->content) + { + evas_object_del(pNameView->content); + pNameView->content = NULL; + } + + if(pNameView->navibar) + { + evas_object_del(pNameView->navibar); + pNameView->navibar = NULL; + } + + if(pNameView->layout) + { + evas_object_del(pNameView->layout); + pNameView->layout = NULL; + } + + Evas_Object *conformant = ug_get_conformant(); + + evas_object_smart_callback_del(conformant, "virtualkeypad,state,on", _on_keypad_show); + evas_object_smart_callback_del(conformant, "virtualkeypad,state,off", _on_keypad_hide); + evas_object_smart_callback_del(conformant, "clipboard,state,on", _on_keypad_show); + evas_object_smart_callback_del(conformant, "clipboard,state,off", _on_keypad_hide); + + free(pNameView); + pNameView = NULL; + + MSG_IMAGEVIEW_HIGH("Name view removed"); +} + + +Evas_Object * +ivug_name_view_object_get(Ivug_NameView *pNameView) +{ + IV_ASSERT(pNameView != NULL); + + return pNameView->layout; + +} + +void +ivug_name_view_set_response_callback(Ivug_NameView *pNameView, FNResponse resp, void *data) +{ + IV_ASSERT(pNameView != NULL); + + if ( pNameView->fnresponse != NULL ) + { + MSG_IMAGEVIEW_WARN("Old response callback is overwritten"); + } + + pNameView->fnresponse = resp; + pNameView->clientdata = data; + +} + +void +ivug_name_view_set_title(Ivug_NameView *pNameView, const char *title) +{ + IV_ASSERT(pNameView!=NULL); + + Elm_Object_Item *navi_it; + + navi_it = elm_naviframe_top_item_get(pNameView->navibar); + + elm_object_item_part_text_set(navi_it, "elm.text.title", title); +} + +void +ivug_name_view_set_entry(Ivug_NameView *pNameView, const char *str) +{ + IV_ASSERT(pNameView!=NULL); + + elm_entry_entry_set(pNameView->entry, str); + + elm_entry_cursor_end_set(pNameView->entry); +} + +void +ivug_name_view_set_focus(Ivug_NameView *pNameView) +{ + elm_entry_cursor_end_set(pNameView->entry); + evas_object_show(pNameView->entry); + elm_object_focus_set(pNameView->entry, EINA_TRUE); // show keypad +} + +void +ivug_name_view_set_max_length(Ivug_NameView *pNameView, int max_len) +{ + IV_ASSERT(pNameView!=NULL); + + MSG_IMAGEVIEW_HIGH("ivug_name_view_set_max_length to %d", max_len); + + Evas_Object *entry = pNameView->entry; + + static Elm_Entry_Filter_Limit_Size limit_filter_data; + limit_filter_data.max_char_count = 0; + limit_filter_data.max_byte_count = max_len; + elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, &limit_filter_data); + + evas_object_smart_callback_add(entry, "maxlength,reached", _ivug_name_view_maxlength_reached, (void *) pNameView); +} + diff --git a/main/src/view/ivug-setas-view-callerid.cpp b/main/src/view/ivug-setas-view-callerid.cpp new file mode 100755 index 0000000..58f51c2 --- /dev/null +++ b/main/src/view/ivug-setas-view-callerid.cpp @@ -0,0 +1,637 @@ +/* + * Copyright 2012 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 "ivug-define.h" + +#include "ivug-setas-view-callerid.h" +#include "ivug-setas-view.h" + +#include "ivug-selectioninfo.h" + +#include "ivug-image.h" +#include "ivug-drm-common.h" +#include "EFLUtil.h" +#include "ivug-scissorbox.h" + +#include "ivug-db.h" + +#define EDJ_PATH PREFIX"/res/edje/"PACKAGE + +#define SETAS_EDJ_FILE EDJ_PATH"/ivug-setas.edj" + +#define CLICK_TIME_MAX (500) // click time. +#define CLICK_WIDTH_MIN (elm_config_finger_size_get() >> 1) //click width, if mouse move under this value and under click time, it is click. +#define CLICK_INTERVAL_TIME 0.15 + +/* it is temp define, because scroll, scroll,anim,end is called earlyer. + So find bound of scissor box again after SETAS_INTERVAL_TIME */ +#define SETAS_INTERVAL_TIME 0.1 +#define SETAS_INTERVAL_TIME_FIRST_LOAD 0.3 + +#define CROP_BOX_INTERVAL_TIME 0.3 + +typedef struct { + Evas_Object *layout; + Evas_Object *notify; + Evas_Object *notify_area; + Evas_Object *photocam; + + Evas_Object *contents_area; + + Evas_Object *gesture; + + Evas_Object *btn_ok; + + bool bShowMenu; // Current state for button's visibility + + char *filepath; + char *drm_filepath; + + Evas_Coord_Rectangle rect; + + int prev_x; + int prev_y; + int prev_w; + int prev_h; + + struct { + Evas_Object *box; + double ratio; + + Eina_Bool bAspectPreserve; + } crop; + + Ecore_Timer *box_timer; + +} TSetAsData; + +#define SETAS_DATA(obj) \ + (TSetAsData *)evas_object_data_get((Evas_Object *)(obj), "pSetAsData") + +static void _on_moved(void *data, Evas *e, Evas_Object *obj, void *event_info); +static void _on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info); + +static void _put_scissorbox_default(TSetAsData *pSetAsData) +{ + Evas_Object *image = ivug_image_internal_image_get(pSetAsData->photocam); + + int image_w = 0; + int image_h = 0; + double ratio = pSetAsData->crop.ratio; + Evas_Coord_Rectangle rect = {0,}; + + ivug_image_image_size_get(pSetAsData->photocam, &image_w, &image_h); // Get original image size. + + /*int degree = ivug_image_rotate_get(pSetAsData->photocam); + if(degree == 90 || degree == 270) //rotated + { + int temp = image_w; + image_w = image_h; + image_h = temp; + }*/ + + int lcd_x, lcd_y, lcd_w, lcd_h; + + evas_object_geometry_get(pSetAsData->contents_area, &lcd_x, &lcd_y, &lcd_w, &lcd_h); + MSG_SETAS_HIGH("lcd_x=%d, lcd_y=%d, lcd_w=%d, lcd_h=%d", lcd_x, lcd_y, lcd_w, lcd_h); + + int px, py, pw, ph; + ivug_image_region_get(pSetAsData->photocam, &px, &py, &pw, &ph); + + px = (lcd_w - pw) / 2; // do not use previous px, px is invalid because transition effect + + MSG_SETAS_WARN("region XYWH(%d,%d,%d,%d)", px, py, pw, ph); + + int ix, iy, iw, ih; + + if ( image_w > image_h ) // Landscape image + { + if(ratio > 1.0) // height is larger + { + iw = image_h / (2 * ratio); + ih = image_h / 2; + } + else + { + iw = image_h / 2; + ih = (image_h * ratio) / 2; + } + } + else + { + if(ratio > 1.0) // height is larger + { + iw = image_w / (2 * ratio); + ih = image_w / 2; + } + else + { + iw = image_w / 2; + ih = (image_w * ratio) / 2; + } + } + + ix = (image_w - iw)/2; + iy = (image_h - ih)/2; + + + rect.x = (double)ix * pw / image_w + px; + rect.y = (double)iy * ph / image_h + py; + + rect.w = (double)iw * pw / image_w; + rect.h = (double)ih * ph / image_h; + + MSG_SETAS_WARN("Zoom Put Box in LCD XYWH(%d,%d,%d,%d)", + rect.x, rect.y, rect.w, rect.h); + + ivug_scissorbox_region_set(pSetAsData->crop.box, rect.x, rect.y, rect.w, rect.h); + + ivug_scissorbox_attach(pSetAsData->crop.box, image); // Attach to photocam + + ivug_scissorbox_boundary_set(pSetAsData->crop.box, px, py, pw, ph); + + pSetAsData->prev_x = px; //lcd_x is wrong because transition effect + pSetAsData->prev_y = py; + pSetAsData->prev_w = pw; + pSetAsData->prev_h = ph; +} + +static Eina_Bool _put_scissorbox_timer_cb(void *data) +{ + TSetAsData *pSetAsData = SETAS_DATA(data); + + pSetAsData->box_timer = NULL; + + _put_scissorbox_default(pSetAsData); + + elm_object_disabled_set(pSetAsData->btn_ok, EINA_FALSE); + + return ECORE_CALLBACK_CANCEL; +} + + +static void +_on_btn_ok_clicked(void *data, Evas_Object *obj, void *event_info) +{ + TSetAsData *pSetAsData = SETAS_DATA(data); + IV_ASSERT(pSetAsData != NULL); + + MSG_SETAS_HIGH("OK button clicked"); + evas_object_smart_callback_call(pSetAsData->layout, "ok,clicked", NULL); + + evas_object_event_callback_del_full(pSetAsData->layout, EVAS_CALLBACK_MOVE, _on_moved, pSetAsData->layout); + evas_object_event_callback_del_full(pSetAsData->layout, EVAS_CALLBACK_RESIZE, _on_resized, pSetAsData->layout); + + if ( pSetAsData->crop.box ) + { + evas_object_del(pSetAsData->crop.box); + pSetAsData->crop.box = NULL; + } + +} + +static void +_on_photocam_loaded(void *data, Evas_Object *obj, void *event_info) +{ + TSetAsData *pSetAsData = SETAS_DATA(data); + MSG_SETAS_HIGH("Photocam preloaded"); + +#if 0 + typedef enum _Evas_Load_Error + { + EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */ + EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */ + EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */ + EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */ + EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */ + EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */ + EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */ + } Evas_Load_Error; /**< Load error you can get from loading of files - see evas_load_error_str() too */ +#endif + + Evas_Load_Error error = static_cast((int)event_info); + + if ( error != EVAS_LOAD_ERROR_NONE ) + { + MSG_SETAS_ERROR("Error occured during decoding. Error=%d", error); + + if ( error == EVAS_LOAD_ERROR_UNKNOWN_FORMAT ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_UNKNOWN_FORMAT); + } + else if ( error == EVAS_LOAD_ERROR_PERMISSION_DENIED ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_PERMISSION_DENIED); + } + else + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_INVALID_FILE); + } + + return; + } + + MSG_SETAS_HIGH("Photocam loaded."); + + pSetAsData->box_timer = ecore_timer_add(CROP_BOX_INTERVAL_TIME, _put_scissorbox_timer_cb, (void *)pSetAsData->layout); + + evas_object_smart_callback_call(pSetAsData->layout, "loaded", NULL); + + pSetAsData->notify_area = const_cast(edje_object_part_object_get(_EDJ(pSetAsData->layout), + "setasview.contents.swallow.notify")); + + pSetAsData->notify = ivug_notify_static_create(pSetAsData->notify_area, IDS_CALLER_ID_NOTIFY, NOTIFY_ALIGN_BOTTOM); +} + + +static void _on_moved(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ +// TSetAsData *pSetAsData = SETAS_DATA(data); + +} + +static void _on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + TSetAsData *pSetAsData = SETAS_DATA(data); + /////////////////////////////////////////////////////////////////// + int org_x, org_y, org_w, org_h; + + MSG_SETAS_MED("prev_x=%d, prev_y=%d, prev_w=%d, prev_h=%d", pSetAsData->prev_x, pSetAsData->prev_y, pSetAsData->prev_w, pSetAsData->prev_h); + + org_x = pSetAsData->prev_x; + org_y = pSetAsData->prev_y; + org_w = pSetAsData->prev_w; + org_h = pSetAsData->prev_h; + + if(org_w == 0 || org_h == 0) + return; + + int org_sx, org_sy, org_sw, org_sh; + ivug_scissorbox_region_get(pSetAsData->crop.box, &org_sx, &org_sy, &org_sw, &org_sh); + + MSG_SETAS_MED("org_sx=%d, org_sy=%d, org_sw=%d, org_sh=%d", org_sx, org_sy, org_sw, org_sh); + + int dx = org_sx-org_x; + int dy = org_sy-org_y; + + int lcd_x, lcd_y, lcd_w, lcd_h; + + evas_object_geometry_get(pSetAsData->contents_area, &lcd_x, &lcd_y, &lcd_w, &lcd_h); + MSG_SETAS_MED("lcd_x=%d, lcd_y=%d, lcd_w=%d, lcd_h=%d", lcd_x, lcd_y, lcd_w, lcd_h); + + int ph, pw; + + int img_w, img_h; + int ext_w, ext_h; + + img_w = org_w; + img_h = org_h; + ext_w = lcd_w; + ext_h = lcd_h; + + ph = (img_h * ext_w) / img_w; + + if (ph > ext_h) + { + pw = (img_w * ext_h) / img_h; + ph = ext_h; + } + else + { + pw = ext_w; + } + + double zoom = 0.0; + + if ( img_w > img_h) + { + zoom = (double)pw / img_w; + } + else + { + zoom = (double)ph / img_h; + } + + int sx, sy, sw, sh; + + sw = org_sw*zoom; + sh = org_sh*zoom; + dx *= zoom; + dy *= zoom; + + sx = lcd_x + (ext_w-img_w*zoom)/2 + dx; + sy = lcd_y + (ext_h-img_h*zoom)/2 + dy; + + + int bound_x, bound_y, bound_w, bound_h; + + bound_x = lcd_x+(ext_w-img_w*zoom)/2; + bound_y = lcd_y+(ext_h-img_h*zoom)/2; + bound_w = img_w*zoom; + bound_h = img_h*zoom; + + ivug_scissorbox_boundary_set(pSetAsData->crop.box, bound_x, bound_y, bound_w, bound_h); + + /////////////////////////////////////////////////////////////////// + + MSG_SETAS_MED("sx=%d, sy=%d, sw=%d, sh=%d", sx, sy, sw, sh); + + ivug_scissorbox_region_set(pSetAsData->crop.box, sx, sy, sw, sh); + + pSetAsData->prev_x = bound_x; + pSetAsData->prev_y = bound_y; + pSetAsData->prev_w = bound_w; + pSetAsData->prev_h = bound_h; + + MSG_SETAS_MED("prev_x=%d, prev_y=%d, prev_w=%d, prev_h=%d", pSetAsData->prev_x, pSetAsData->prev_y, pSetAsData->prev_w, pSetAsData->prev_h); +} + +static Evas_Event_Flags _finger_tap_end(void *data , void *event_info) +{ + Elm_Gesture_Taps_Info *p = (Elm_Gesture_Taps_Info *) event_info; + + MSG_SETAS_HIGH("Finger tab end. evt=%d", p->timestamp); + + if ( p->n != 1 ) return EVAS_EVENT_FLAG_NONE; + + TSetAsData *pSetAsData = (TSetAsData *)data; + IV_ASSERT(pSetAsData != NULL); + + if(pSetAsData->bShowMenu) + { + MSG_SETAS_HIGH("Hide"); + elm_win_indicator_mode_set((Evas_Object*)ug_get_window(), ELM_WIN_INDICATOR_HIDE); + evas_object_hide(pSetAsData->notify); + } + else + { + MSG_SETAS_HIGH("Show"); + if(gIsDesktopMode() == false) + { + elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_SHOW); + } + evas_object_show(pSetAsData->notify); + } + + pSetAsData->bShowMenu = !pSetAsData->bShowMenu; + + return EVAS_EVENT_FLAG_NONE; +} + +void _add_gesture_layer(Evas_Object *parent, TSetAsData *pSetAsData) +{ + IV_ASSERT(pSetAsData != NULL); + + Evas_Object *gesture = pSetAsData->gesture; + + gesture = elm_gesture_layer_add(parent); + elm_gesture_layer_hold_events_set(gesture, EINA_FALSE); + + elm_gesture_layer_cb_set(gesture, ELM_GESTURE_N_TAPS, ELM_GESTURE_STATE_END, _finger_tap_end, (void *)pSetAsData); + + if ( elm_gesture_layer_attach(gesture, pSetAsData->photocam) == EINA_FALSE) + { + MSG_SETAS_ERROR("Cannot attach event rect"); + } + + evas_object_name_set(gesture, "CallerID:Getsture"); +} + +Evas_Object *_ivug_setas_callerid_create_layout(Evas_Object *parent) +{ + TSetAsData *pSetAsData = (TSetAsData *)calloc(1, sizeof(TSetAsData)); + + if ( pSetAsData == NULL ) + { + MSG_SETAS_ERROR("Cannot alloc pSetasData"); + return NULL; + } + + Evas_Object *photocam = NULL; + + pSetAsData->layout = ivug_layout_add2(parent, SETAS_EDJ_FILE, "setas_view"); + if ( pSetAsData->layout == NULL ) + { + MSG_SETAS_ERROR("Cannot create layout."); + goto error; + } + + MSG_SETAS_HIGH("Create setas layout"); + pSetAsData->contents_area = ivug_default_layout_add(parent); + evas_object_name_set(pSetAsData->contents_area, "contets_area"); + if ( pSetAsData->contents_area == NULL ) + { + MSG_SETAS_ERROR("Cannot create contets_area."); + } + + elm_object_part_content_set(pSetAsData->layout, "setasview.contents.swallow", pSetAsData->contents_area); + + pSetAsData->crop.box = ivug_scissorbox_add(pSetAsData->contents_area); + + if ( pSetAsData->crop.box == NULL ) + { + MSG_SETAS_ERROR("Cannot create layout."); + goto error; + } + + evas_object_smart_member_add(pSetAsData->crop.box, pSetAsData->layout); + + photocam = ivug_image_create(pSetAsData->layout); + ivug_image_animated_set(photocam, EINA_FALSE); // Show first frame only when AGIF + ivug_image_hold_set(photocam , EINA_TRUE); // Disable mouse events + + evas_object_name_set(photocam, "setas_photocam"); + + pSetAsData->photocam = photocam; + + evas_object_smart_callback_add(photocam, "loaded", _on_photocam_loaded, (void *)pSetAsData->layout); + elm_object_part_content_set(pSetAsData->layout, "setasview.photocam", photocam); + evas_object_show(photocam); + + pSetAsData->bShowMenu = true; + //_add_gesture_layer(pSetAsData->layout, pSetAsData); + + evas_object_data_set(pSetAsData->layout, "pSetAsData", pSetAsData); + evas_object_event_callback_add(pSetAsData->layout, EVAS_CALLBACK_MOVE, _on_moved, pSetAsData->layout); + evas_object_event_callback_add(pSetAsData->layout, EVAS_CALLBACK_RESIZE, _on_resized, pSetAsData->layout); + + return pSetAsData->layout; + +error: + if ( pSetAsData->crop.box ) + evas_object_del(pSetAsData->crop.box); + + if ( pSetAsData->layout ) + evas_object_del(pSetAsData->layout); + + if ( pSetAsData ) + free(pSetAsData); + + return NULL; +} + +Evas_Object *_ivug_setas_callerid_delete_layout(Evas_Object *obj) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + IV_ASSERT(pSetAsData != NULL); + + if(pSetAsData->box_timer) + { + ecore_timer_del(pSetAsData->box_timer); + pSetAsData->box_timer = NULL; + } + + if(pSetAsData->photocam) + { + MSG_SETAS_HIGH("Removing photocam"); + evas_object_del(pSetAsData->photocam); + pSetAsData->photocam = NULL; + } + + if(pSetAsData->notify) + { + evas_object_del(pSetAsData->notify); + pSetAsData->notify = NULL; + } + + if(pSetAsData->contents_area) + { + evas_object_del(pSetAsData->contents_area); + pSetAsData->contents_area = NULL; + } + + if(pSetAsData->layout) + { + evas_object_event_callback_del_full(pSetAsData->layout, EVAS_CALLBACK_MOVE, _on_moved, pSetAsData->layout); + evas_object_event_callback_del_full(pSetAsData->layout, EVAS_CALLBACK_RESIZE, _on_resized, pSetAsData->layout); + evas_object_del(pSetAsData->layout); + pSetAsData->layout = NULL; + } + + if(pSetAsData->crop.box) + { + evas_object_del(pSetAsData->crop.box); + pSetAsData->crop.box = NULL; + } + if(pSetAsData->filepath) + { + free(pSetAsData->filepath); + pSetAsData->filepath = NULL; + } + + if(pSetAsData->drm_filepath) + { + ivug_remove_file(pSetAsData->drm_filepath); + free(pSetAsData->drm_filepath); + pSetAsData->drm_filepath = NULL; + } + + if(pSetAsData->btn_ok) + { + evas_object_del(pSetAsData->btn_ok); + pSetAsData->btn_ok = NULL; + } + + free(pSetAsData); + + return NULL; +} + +bool _ivug_setas_callerid_load_file(Evas_Object *obj, const char *filepath) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + MSG_SETAS_HIGH("Load image file : %s", filepath); + + pSetAsData->filepath = strdup(filepath); + + Evas_Load_Error error = EVAS_LOAD_ERROR_NONE; + error = ivug_image_file_set(pSetAsData->photocam, filepath, "noAnim"); + + if ( error != EVAS_LOAD_ERROR_NONE ) + { + MSG_SETAS_ERROR("FileSet Error=%d", error); + + if ( error == EVAS_LOAD_ERROR_UNKNOWN_FORMAT ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_UNKNOWN_FORMAT); + return false; + } + else if ( error == EVAS_LOAD_ERROR_PERMISSION_DENIED ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_PERMISSION_DENIED); + return false; + } + else + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_INVALID_FILE); + return false; + } + + return false; + } + + return true; +} + +Evas_Object *_ivug_setas_callerid_internal_image_get(Evas_Object *obj) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + MSG_SETAS_HIGH("Internal image get!"); + + return pSetAsData->photocam; +} + +bool _ivug_setas_callerid_select_region_get(Evas_Object *obj, int *x, int *y, int *w, int *h) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + if ( pSetAsData->crop.box == NULL) + { + return false; + } + + ivug_scissorbox_region_get(pSetAsData->crop.box, x, y, w, h); + + return true; +} + + +void _ivug_setas_callerid_aspect_ratio_set(Evas_Object *obj, double ratio) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + pSetAsData->crop.bAspectPreserve = TRUE; + pSetAsData->crop.ratio = ratio; + + ivug_scissorbox_ratio_fix( pSetAsData->crop.box, EINA_TRUE); +} + +void _ivug_setas_callerid_create_menu(Evas_Object *obj, Evas_Object *navi_bar) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + pSetAsData->btn_ok = ivug_button_add(navi_bar, "naviframe/toolbar/default", + IDS_SAVE, NULL, _on_btn_ok_clicked, (void *)pSetAsData->layout); + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(navi_bar); + elm_object_item_part_content_set(navi_it, "toolbar_button1", pSetAsData->btn_ok); + + elm_object_disabled_set(pSetAsData->btn_ok, EINA_TRUE); +} + diff --git a/main/src/view/ivug-setas-view-callerid.h b/main/src/view/ivug-setas-view-callerid.h new file mode 100755 index 0000000..4219f7c --- /dev/null +++ b/main/src/view/ivug-setas-view-callerid.h @@ -0,0 +1,54 @@ +/* + * Copyright 2012 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 __IVUG_SETAS_CALLERID_H__ +#define __IVUG_SETAS_CALLERID_H__ + +#include "ivug-common.h" + +// This functions are used for Crop(AUL) and CallerID(UG) + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + "load,failed" - Image decoding error + "ok,clicked" - Button "OK" clicked + "cancel,clicked" - Button "Cancel" clicked +*/ +Evas_Object *_ivug_setas_callerid_create_layout(Evas_Object *parent); + +Evas_Object *_ivug_setas_callerid_delete_layout(Evas_Object *obj); + +bool _ivug_setas_callerid_load_file(Evas_Object *obj, const char *filepath); + +Evas_Object *_ivug_setas_callerid_internal_image_get(Evas_Object *obj); + +bool _ivug_setas_callerid_select_region_get(Evas_Object *obj, int *x, int *y, int *w, int *h); + +void _ivug_setas_callerid_aspect_ratio_set(Evas_Object *obj, double ratio); + +void _ivug_setas_callerid_create_menu(Evas_Object *obj, Evas_Object *navi_bar); + +#ifdef __cplusplus +} +#endif + + +#endif //__IVUG_SETAS_CALLERID_H__ diff --git a/main/src/view/ivug-setas-view-wallpaper.cpp b/main/src/view/ivug-setas-view-wallpaper.cpp new file mode 100755 index 0000000..3f821a2 --- /dev/null +++ b/main/src/view/ivug-setas-view-wallpaper.cpp @@ -0,0 +1,310 @@ +/* + * Copyright 2012 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 "ivug-define.h" + +#include "ivug-setas-view-wallpaper.h" +#include "ivug-setas-view.h" + +#include "ivug-file-info.h" +#include "ivug-image.h" +#include "ivug-drm-common.h" +#include "EFLUtil.h" +#include "ivug-selectioninfo.h" + +#define EDJ_PATH PREFIX"/res/edje/"PACKAGE + +#define SETAS_EDJ_FILE EDJ_PATH"/ivug-setas.edj" + +#define CLICK_TIME_MAX (500) // click time. +#define CLICK_WIDTH_MIN (elm_config_finger_size_get() >> 1) //click width, if mouse move under this value and under click time, it is click. +#define CLICK_INTERVAL_TIME 0.15 + +/* it is temp define, because scroll, scroll,anim,end is called earlyer. + So find bound of scissor box again after SETAS_INTERVAL_TIME */ +#define SETAS_INTERVAL_TIME 0.1 +#define SETAS_INTERVAL_TIME_FIRST_LOAD 0.3 + +typedef struct { + Evas_Object *layout; + Evas_Object *photocam; + Evas_Object *notify; + + Evas_Object *contents_area; + + Evas_Object *btn_ok; + + bool bShowMenu; // Current state for button's visibility + char *drm_filepath; +} TSetAsData; + +#define SETAS_DATA(obj) \ + (TSetAsData *)evas_object_data_get((Evas_Object *)(obj), "pSetAsData") + +static void +_on_btn_ok_clicked(void *data, Evas_Object *obj, void *event_info) +{ + TSetAsData *pSetAsData = SETAS_DATA(data); + IV_ASSERT(pSetAsData != NULL); + + MSG_SETAS_HIGH("OK button clicked"); + + evas_object_smart_callback_call(pSetAsData->layout, "ok,clicked", NULL); +} + +static void +_on_photocam_loaded(void *data, Evas_Object *obj, void *event_info) +{ + TSetAsData *pSetAsData = SETAS_DATA(data); + MSG_SETAS_HIGH("Photocam preloaded"); +#if 0 + typedef enum _Evas_Load_Error + { + EVAS_LOAD_ERROR_NONE = 0, /**< No error on load */ + EVAS_LOAD_ERROR_GENERIC = 1, /**< A non-specific error occurred */ + EVAS_LOAD_ERROR_DOES_NOT_EXIST = 2, /**< File (or file path) does not exist */ + EVAS_LOAD_ERROR_PERMISSION_DENIED = 3, /**< Permission deinied to an existing file (or path) */ + EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, /**< Allocation of resources failure prevented load */ + EVAS_LOAD_ERROR_CORRUPT_FILE = 5, /**< File corrupt (but was detected as a known format) */ + EVAS_LOAD_ERROR_UNKNOWN_FORMAT = 6 /**< File is not a known format */ + } Evas_Load_Error; /**< Load error you can get from loading of files - see evas_load_error_str() too */ +#endif + + Evas_Load_Error error = static_cast((int)event_info); + + if ( error != EVAS_LOAD_ERROR_NONE ) + { + MSG_SETAS_ERROR("Error occured during decoding. Error=%d", error); + + if ( error == EVAS_LOAD_ERROR_UNKNOWN_FORMAT ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_UNKNOWN_FORMAT); + } + else if ( error == EVAS_LOAD_ERROR_PERMISSION_DENIED ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_PERMISSION_DENIED); + } + else + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_INVALID_FILE); + } + + return; + } + + MSG_SETAS_HIGH("Photocam loaded."); + + elm_object_disabled_set(pSetAsData->btn_ok, EINA_FALSE); + + evas_object_smart_callback_call(pSetAsData->layout, "loaded", NULL); +} + + +static void _on_moved(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ +// TSetAsData *pSetAsData = SETAS_DATA(data); + +} + +static void _on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ +// TSetAsData *pSetAsData = SETAS_DATA(data); + +} + +static void +_on_bg_clicked(void *data, Evas_Object* obj, const char *emission, const char *source ) +{ + MSG_SETAS_HIGH("BG Clicked"); + + TSetAsData *pSetAsData = SETAS_DATA(data); + + MSG_SETAS_HIGH("Bar flag is = %d", pSetAsData->bShowMenu); + if(pSetAsData->bShowMenu == true) + { + pSetAsData->bShowMenu = false; + } + else + { + pSetAsData->bShowMenu = true; + } +} + +Evas_Object *_ivug_setas_create_layout(Evas_Object *parent) +{ + TSetAsData *pSetAsData = (TSetAsData *)calloc(1, sizeof(TSetAsData)); + + if ( pSetAsData == NULL ) + { + MSG_SETAS_ERROR("Cannot alloc pSetasData"); + return NULL; + } + + pSetAsData->layout = ivug_layout_add2(parent , SETAS_EDJ_FILE, "setas_view"); + evas_object_name_set(pSetAsData->layout, "setas_layout"); + if ( pSetAsData->layout == NULL ) + { + MSG_SETAS_ERROR("Cannot create layout."); + free(pSetAsData); + return NULL; + } + evas_object_event_callback_add(pSetAsData->layout, EVAS_CALLBACK_MOVE, _on_moved, pSetAsData->layout); + evas_object_event_callback_add(pSetAsData->layout, EVAS_CALLBACK_RESIZE, _on_resized, pSetAsData->layout); + + Evas_Object *photocam; + photocam = ivug_image_create(pSetAsData->layout); + ivug_image_animated_set(photocam, EINA_FALSE); // Show first frame only when AGIF + evas_object_name_set(photocam, "setas_photocam"); + + evas_object_smart_callback_add(photocam, "loaded", _on_photocam_loaded, (void *)pSetAsData->layout); + elm_object_part_content_set(pSetAsData->layout, "setasview.photocam", photocam); + + evas_object_show(photocam); + + pSetAsData->photocam = photocam; + + edje_object_signal_callback_add(_EDJ(pSetAsData->layout), + "setasview,bg,clicked", "edc", + _on_bg_clicked, + (void *)pSetAsData->layout); + + pSetAsData->bShowMenu = true; + + MSG_SETAS_HIGH("Create setas layout"); + evas_object_data_set(pSetAsData->layout, "pSetAsData", pSetAsData); + + pSetAsData->contents_area = ivug_default_layout_add(parent); + evas_object_name_set(pSetAsData->contents_area, "contets_area"); + if ( pSetAsData->contents_area == NULL ) + { + MSG_SETAS_ERROR("Cannot create contets_area."); + } + + elm_object_part_content_set(pSetAsData->layout, "setasview.contents", pSetAsData->contents_area); + + pSetAsData->notify = ivug_notify_static_create(pSetAsData->contents_area, IDS_WALLPAPER_NOTIFY, NOTIFY_ALIGN_BOTTOM); + + evas_object_show(pSetAsData->layout); + return pSetAsData->layout; +} + +Evas_Object *_ivug_setas_delete_layout(Evas_Object *obj) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + IV_ASSERT(pSetAsData != NULL); + + if(pSetAsData->photocam) + { + MSG_SETAS_HIGH("Removing photocam"); + evas_object_del(pSetAsData->photocam); + pSetAsData->photocam = NULL; + } + + if(pSetAsData->notify) + { + evas_object_del(pSetAsData->notify); + pSetAsData->notify = NULL; + } + + if(pSetAsData->contents_area) + { + evas_object_del(pSetAsData->contents_area); + pSetAsData->contents_area = NULL; + } + + if(pSetAsData->layout) + { + evas_object_event_callback_del_full(pSetAsData->layout, EVAS_CALLBACK_MOVE, _on_moved, pSetAsData->layout); + evas_object_event_callback_del_full(pSetAsData->layout, EVAS_CALLBACK_RESIZE, _on_resized, pSetAsData->layout); + evas_object_del(pSetAsData->layout); + pSetAsData->layout = NULL; + } + + if(pSetAsData->drm_filepath) + { + ivug_remove_file(pSetAsData->drm_filepath); + free(pSetAsData->drm_filepath); + pSetAsData->drm_filepath = NULL; + } + + if(pSetAsData->btn_ok) + { + evas_object_del(pSetAsData->btn_ok); + pSetAsData->btn_ok = NULL; + } + + free(pSetAsData); + + return NULL; +} + +bool _ivug_setas_load_file(Evas_Object *obj, const char *filepath) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + MSG_SETAS_HIGH("Load image file : %s", filepath); + + Evas_Load_Error error = EVAS_LOAD_ERROR_NONE; + error = ivug_image_file_set(pSetAsData->photocam, filepath, "noAnim"); + + if ( error != EVAS_LOAD_ERROR_NONE ) + { + MSG_SETAS_ERROR("FileSet Error=%d", error); + + if ( error == EVAS_LOAD_ERROR_UNKNOWN_FORMAT ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_UNKNOWN_FORMAT); + return false; + } + else if ( error == EVAS_LOAD_ERROR_PERMISSION_DENIED ) + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_PERMISSION_DENIED); + return false; + } + else + { + evas_object_smart_callback_call(pSetAsData->layout, "load,failed", (void *)SETAS_ERROR_TYPE_INVALID_FILE); + return false; + } + + return false; + } + + return true; +} + +Evas_Object *_ivug_setas_internal_image_get(Evas_Object *obj) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + return pSetAsData->photocam; +} + +void _ivug_setas_view_create_menu(Evas_Object *obj, Evas_Object *navi_bar) +{ + TSetAsData *pSetAsData = SETAS_DATA(obj); + + pSetAsData->btn_ok = ivug_button_add(navi_bar, "naviframe/toolbar/default", + IDS_SAVE, NULL, _on_btn_ok_clicked, (void *)pSetAsData->layout); + + Elm_Object_Item *navi_it = elm_naviframe_top_item_get(navi_bar); + elm_object_item_part_content_set(navi_it, "toolbar_button1", pSetAsData->btn_ok); + + elm_object_disabled_set(pSetAsData->btn_ok, EINA_TRUE); +} + diff --git a/main/src/view/ivug-setas-view-wallpaper.h b/main/src/view/ivug-setas-view-wallpaper.h new file mode 100755 index 0000000..66d801c --- /dev/null +++ b/main/src/view/ivug-setas-view-wallpaper.h @@ -0,0 +1,46 @@ +/* + * Copyright 2012 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 __IVUG_SETAS_WALLPAPER_H__ +#define __IVUG_SETAS_WALLPAPER_H__ + +#include "ivug-common.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/* + "load,failed" - Image decoding error + "ok,clicked" - Button "OK" clicked + "cancel,clicked" - Button "Cancel" clicked +*/ +Evas_Object *_ivug_setas_create_layout(Evas_Object *parent); +Evas_Object *_ivug_setas_delete_layout(Evas_Object *obj); + +bool _ivug_setas_load_file(Evas_Object *obj, const char *filepath); + +Evas_Object *_ivug_setas_internal_image_get(Evas_Object *obj); + +void _ivug_setas_view_create_menu(Evas_Object *obj, Evas_Object *navi_bar); + +#ifdef __cplusplus +} +#endif + + +#endif //__IVUG_SETAS_WALLPAPER_H__ diff --git a/main/src/view/ivug-setas-view.c b/main/src/view/ivug-setas-view.c new file mode 100755 index 0000000..c4ebec4 --- /dev/null +++ b/main/src/view/ivug-setas-view.c @@ -0,0 +1,786 @@ +/* + * Copyright 2012 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 + +#include "ivug-common.h" +#include "ivug-parameter.h" + +#include "ivug-ext-ug.h" +#include "ivug-setas-view.h" +#include "ivug-setas-view-wallpaper.h" +#include "ivug-setas-view-callerid.h" +#include "ivug-setas.h" + +#include "ivug-listpopup.h" + + +#define EDJ_PATH PREFIX"/res/edje/"PACKAGE + +#define TRANSITION_EFFECT + +#define IVUG_RESULT_BUNDLE_KEY_ERROR "Error" +#define IVUG_RESULT_BUNDLE_VALUE_NOT_SUPPORTED "not_supported_file_type" + +/* + Caller ID image +*/ +#define SET_AS_CALL_ID_PATH DATA_PATH"/.callerid.jpg" + +#define SET_AS_VIDEO_CALL_ID_PATH DATA_PATH"/.videocallid.jpg" + +/* + Image displays when incomming call is recevied. +*/ +#define SET_AS_CALL_ID_LCD_PATH DATA_PATH"/.callerid_lcd.jpg" + +//set as +enum { + IVUG_SET_AS_TYPE_HOME = 0x00, + IVUG_SET_AS_TYPE_LOCK, + IVUG_SET_AS_TYPE_BOTH, + IVUG_SET_AS_TYPE_CALLER_ID, + IVUG_SET_AS_TYPE_MAX, +}; + + +static void _OnOK(Ivug_SetAsView *pSetAsView); +static void _OnCancel(Ivug_SetAsView *pSetAsView); +static Evas_Object*_show_exit_popup( Evas_Object *parent, const char *title, const char *desc, void *data); +static void _send_result(ui_gadget_h ug, const char *key1, const char *val1, const char *key2, const char *val2); +static void _send_result2(ui_gadget_h ug, const char *key1, const char *val1, + const char *key2, const char *val2, const char *key3, const char *val3); + + +static void +_on_msg_load_failed(void *data, Evas_Object *obj, void *event_info) +{ + Ivug_SetAsView *pSetAsView = (Ivug_SetAsView *) data; + + SetAs_Error error = (SetAs_Error)event_info; + + const char *szMsg = NULL; + + switch(error) + { + case SETAS_ERROR_TYPE_INVALID_FILE: + szMsg = IDS_INVALID_IMAGE_FILE; + break; + case SETAS_ERROR_TYPE_PERMISSION_DENIED: + szMsg = IDS_PERMISSION_DENIED; + break; + case SETAS_ERROR_TYPE_UNKNOWN_FORMAT: + szMsg = "Unknown format"; + break; + case SETAS_ERROR_TYPE_GENERAL: + default: + szMsg = IDS_FAILED; + break; + } + + MSG_SETAS_ERROR("Load failed : %s", szMsg); + + _show_exit_popup(obj, IDS_ERROR, szMsg, (void *)pSetAsView ); + + if ( pSetAsView->Mode != IVUG_SETAS_NORMAL ) + { + MSG_SETAS_ERROR("Send error message to ug caller app"); + _send_result(gGetUGHandle(), IVUG_RESULT_BUNDLE_KEY_ERROR, IVUG_RESULT_BUNDLE_VALUE_NOT_SUPPORTED, NULL, NULL); + } +} + + +static void +_on_msg_ok_clicked(void *data, Evas_Object *obj, void *event_info) +{ + MSG_SETAS_HIGH("ok clicked"); + + Ivug_SetAsView *pSetAsView = (Ivug_SetAsView *) data; + + _OnOK(pSetAsView); +} + + +static void +_on_msg_cancel_clicked(void *data, Evas_Object *obj, void *event_info) +{ + MSG_SETAS_HIGH("cancel clicked"); + + Ivug_SetAsView *pSetAsView = (Ivug_SetAsView *) data; + + _OnCancel(pSetAsView); +} + + +static void +_ivug_setas_view_remove(Ivug_SetAsView *pSetAsView) +{ + IV_ASSERT(pSetAsView != NULL); + +#if 0 + if(pSetAsView->select_box) + { + evas_object_del(pSetAsView->select_box); + pSetAsView->select_box = NULL; + } +#endif + + if(pSetAsView->Mode != IVUG_SETAS_NORMAL) + { + MSG_SETAS_HIGH("Start destroy ug"); + if ( pSetAsView->content) + { + if(pSetAsView->Type == IVUG_CTRLBAR_SET_SCREEN_CALLERID + || pSetAsView->Type == IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID) + { + _ivug_setas_callerid_delete_layout(pSetAsView->content); + } + else + { + _ivug_setas_delete_layout(pSetAsView->content); + } + pSetAsView->content = NULL; + } + ug_destroy_me(gGetUGHandle()); + return; + } + + MSG_SETAS_HIGH( "destroy data"); + + evas_object_smart_callback_call(pSetAsView->content, "destroy", pSetAsView); +} + + +static void +_ivug_setas_view_response_cb( void *data, Evas_Object *obj, void *event_info ) +{ + MSG_SETAS_HIGH( "response callback=%d",(int)event_info); +// Ivug_SetAsView *pSetAsView = (Ivug_SetAsView *)data; + + evas_object_hide(obj); // popup + evas_object_del(obj); + + _ivug_setas_view_remove((Ivug_SetAsView *)data); +} + + +static Evas_Object* +_show_exit_popup( Evas_Object *parent, const char *title, const char *desc, void *data) +{ + MSG_SETAS_HIGH( "title: %s, desc %s", title, desc); + + Evas_Object* style1_popup = elm_popup_add(parent); + evas_object_size_hint_weight_set(style1_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_popup_timeout_set(style1_popup, (double)2.0); + elm_object_text_set(style1_popup, desc); + elm_object_part_text_set(style1_popup, "title,text", title); + + evas_object_smart_callback_add(style1_popup, "timeout", _ivug_setas_view_response_cb, data); + + evas_object_show(style1_popup); + evas_object_layer_set(style1_popup, EVAS_LAYER_MAX); + + return style1_popup; +} + +static void +_send_result(ui_gadget_h ug, const char *key1, const char *val1, const char *key2, const char *val2) +{ + ivug_ret_if(!ug); + + service_h service; + service_create(&service); + if(key1 && val1) + { + MSG_SETAS_HIGH("Bundle 1 : [%s = %s]", key1, val1); + service_add_extra_data(service, key1, val1); + } + + if(key2 && val2) + { + MSG_SETAS_HIGH("Bundle 2 : [%s = %s]", key2, val2); + service_add_extra_data(service, key2, val2); + } + + ug_send_result(ug, service); + service_destroy(service); +} + +static void +_send_result2(ui_gadget_h ug, const char *key1, const char *val1, + const char *key2, const char *val2, const char *key3, const char *val3) +{ + ivug_ret_if(!ug); + + service_h service; + service_create(&service); + if(key1 && val1) + { + MSG_SETAS_HIGH("Bundle 1 : [%s = %s]", key1, val1); + service_add_extra_data(service, key1, val1); + } + + if(key2 && val2) + { + MSG_SETAS_HIGH("Bundle 2 : [%s = %s]", key2, val2); + service_add_extra_data(service, key2, val2); + } + + if(key3 && val3) + { + MSG_SETAS_HIGH("Bundle 3 : [%s = %s]", key3, val3); + service_add_extra_data(service, key3, val3); + } + + ug_send_result(ug, service); + service_destroy(service); +} + +static void _on_setas_homescreen(Ivug_SetAsView *pSetAsView) +{ + const char *homescreen_path = NULL; + + if(pSetAsView->Mode == IVUG_SETAS_NORMAL || pSetAsView->Mode == IVUG_SETAS_UG) + { + homescreen_path = IVUG_HOME_SCREEN_PATH; + } + else + { + homescreen_path = IVUG_APPSVC_HOME_SCREEN_PATH; + } + +// Save to Image + Evas_Coord_Rectangle box_rect; + evas_object_geometry_get(pSetAsView->content, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h)); + + MSG_SETAS_HIGH("Rect XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h); + + Eina_Bool ret = EINA_FALSE; + + ret = _ivug_setas_save_home_screen(_ivug_setas_internal_image_get( pSetAsView->content) ,&box_rect, homescreen_path); + + if ( ret == false ) + { + MSG_SETAS_ERROR("Error occured. when setAS. %s", homescreen_path); + _show_exit_popup(pSetAsView->content, IDS_HOME_SCREEN_WALLPAPER, IDS_FAILED, (void *)pSetAsView); + return; + } + + if(pSetAsView->Mode != IVUG_SETAS_CROP) + { + ret = ivug_config_set_homescreen_image(homescreen_path); + if(ret == true) + { + _show_exit_popup(pSetAsView->content, IDS_HOME_SCREEN_WALLPAPER, IDS_SUCCESS, (void *)pSetAsView); + _send_result(gGetUGHandle(), "homescreen_path", homescreen_path, NULL, NULL); + + MSG_SETAS_HIGH("Set Home screen: %s", homescreen_path); + } + else + { + _show_exit_popup(pSetAsView->content, IDS_HOME_SCREEN_WALLPAPER, IDS_FAILED, (void *)pSetAsView); + } + } + else // IVUG_SETAS_CROP + { + _show_exit_popup(pSetAsView->content, IDS_HOME_SCREEN_WALLPAPER, IDS_SUCCESS, (void *)pSetAsView); + _send_result(gGetUGHandle(), "crop_image_path", homescreen_path, + "http://tizen.org/appcontrol/data/selected", homescreen_path); + + MSG_SETAS_HIGH("Set Home screen: %s", homescreen_path); + } +} + + +static void _on_setas_lockscreen(Ivug_SetAsView *pSetAsView) +{ + MSG_SETAS_HIGH("Change Lock Screen"); + + char* lockscreen_path = IVUG_LOCK_SCREEN_PATH; + +// Save to Image + Evas_Coord_Rectangle box_rect; + evas_object_geometry_get(pSetAsView->content, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h) ); + + MSG_SETAS_HIGH("Rect XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h); + + Eina_Bool ret = EINA_FALSE; + + ret = _ivug_setas_save_lock_screen(_ivug_setas_internal_image_get( pSetAsView->content) ,&box_rect, lockscreen_path); + + if ( ret == false ) + { + MSG_SETAS_ERROR("Error occured. when setAS. %s", lockscreen_path); + } + + //Set the lock screen + if(pSetAsView->Mode != IVUG_SETAS_CROP) + { + ret = ivug_config_set_lockscreen_image(lockscreen_path); + } + + if(ret == EINA_TRUE) + { + _show_exit_popup(pSetAsView->content, IDS_LOCK_SCREEN_WALLPAPER, IDS_SUCCESS, pSetAsView); + _send_result(gGetUGHandle(), "lockscreen_path", lockscreen_path, NULL, NULL); + + MSG_SETAS_HIGH("Set Lock screen: %s", lockscreen_path); + } + else + { + _show_exit_popup(pSetAsView->content, IDS_LOCK_SCREEN_WALLPAPER, IDS_FAILED, pSetAsView); + } + +} + + +static void _on_setas_bothscreen(Ivug_SetAsView *pSetAsView) +{ + MSG_SETAS_HIGH("Change Home & Lock Screen"); + +// Set homescreen image + const char* homescreen_path = IVUG_HOME_SCREEN_PATH; + const char* lockscreen_path = IVUG_LOCK_SCREEN_PATH; + + Evas_Coord_Rectangle box_rect; + evas_object_geometry_get(pSetAsView->content, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h) ); + + MSG_SETAS_HIGH("Rect XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h); + + Eina_Bool ret = EINA_FALSE; + + ret = _ivug_setas_save_homenlock_screen(_ivug_setas_internal_image_get( pSetAsView->content),&box_rect, homescreen_path, lockscreen_path); + + char *title = elm_entry_utf8_to_markup(IDS_HOME_AND_LOCK_SCREENS); + + ret = ivug_config_set_homescreen_image(homescreen_path); + + if ( ret == false) + { + _show_exit_popup(pSetAsView->content, title, IDS_FAILED, pSetAsView); + } + else + { + ret = ivug_config_set_lockscreen_image(lockscreen_path); + if ( ret == false) + { + _show_exit_popup(pSetAsView->content, title, IDS_FAILED, pSetAsView); + } + else + { + _show_exit_popup(pSetAsView->content, title, IDS_SUCCESS, pSetAsView); + } + + } + + MSG_SETAS_HIGH("Set Home&Lock screen: %s %s", homescreen_path, lockscreen_path); + free(title); + + if(pSetAsView->Mode != IVUG_SETAS_NORMAL) + { + if(ret == EINA_TRUE) + { + _send_result(gGetUGHandle(), "homescreen_path", homescreen_path, "lockscreen_path", lockscreen_path); + } + } +} + + +static void _on_setas_callerid(Ivug_SetAsView *pSetAsView) +{ + MSG_SETAS_HIGH("Set Caller Image"); + +// Save to Image + Evas_Coord_Rectangle box_rect; + evas_object_geometry_get(pSetAsView->content, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h) ); + + MSG_SETAS_HIGH("Conetent area XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h); + +// LCD Image + Evas_Object *image = NULL; + + image = _ivug_setas_callerid_internal_image_get( pSetAsView->content); + + Eina_Bool ret = EINA_FALSE; + + char *title = elm_entry_utf8_to_markup(IDS_CALLER_IMAGE); + + ret = _ivug_setas_save_cropimage(image, &box_rect, SET_AS_CALL_ID_LCD_PATH); + if ( ret == false ) + { + MSG_SETAS_ERROR("Error occured. when setAS1. %s", SET_AS_CALL_ID_LCD_PATH); + _show_exit_popup(pSetAsView->content, title, IDS_FAILED, pSetAsView); + free(title); + return; + } + +// Cropped Image + _ivug_setas_callerid_select_region_get(pSetAsView->content, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h)); + + MSG_SETAS_HIGH("Cropped rect XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h); + + ret = _ivug_setas_save_cropimage(image ,&box_rect, SET_AS_CALL_ID_PATH); + if ( ret == false ) + { + MSG_SETAS_ERROR("Error occured. when setAS2. %s", SET_AS_CALL_ID_PATH); + _show_exit_popup(pSetAsView->content, title, IDS_FAILED, pSetAsView); + free(title); + return; + } + + if(pSetAsView->Mode != IVUG_SETAS_NORMAL) + { + //_send_result(gGetUGHandle(), "crop_image_path", SET_AS_CALL_ID_PATH, "image_path", SET_AS_CALL_ID_LCD_PATH); + _send_result2(gGetUGHandle(), "crop_image_path", SET_AS_CALL_ID_PATH, + "image_path", SET_AS_CALL_ID_LCD_PATH, "http://tizen.org/appcontrol/data/selected", SET_AS_CALL_ID_PATH); + _show_exit_popup(pSetAsView->content, title, IDS_SUCCESS, pSetAsView); + } + + free(title); + +} + +static void _on_setas_video_call_id(Ivug_SetAsView *pSetAsView) +{ + MSG_SETAS_HIGH("Set Caller Image"); + +// Save to Image + Evas_Coord_Rectangle box_rect; + +// LCD Image + Evas_Object *image = NULL; + + image = _ivug_setas_callerid_internal_image_get(pSetAsView->content); + + Eina_Bool ret = EINA_FALSE; + + char *title = elm_entry_utf8_to_markup(IDS_CALLER_IMAGE); + +// Cropped Image + _ivug_setas_callerid_select_region_get(pSetAsView->content, &(box_rect.x), &(box_rect.y), &(box_rect.w), &(box_rect.h)); + + MSG_SETAS_HIGH("Cropped rect XYWH(%d,%d,%d,%d)", box_rect.x, box_rect.y, box_rect.w , box_rect.h); + + ret = _ivug_setas_save_cropimage(image, &box_rect, SET_AS_VIDEO_CALL_ID_PATH); + if ( ret == false ) + { + MSG_SETAS_ERROR("Error occured. when setAS2. %s", SET_AS_VIDEO_CALL_ID_PATH); + _show_exit_popup(pSetAsView->content, title, IDS_FAILED, pSetAsView); + free(title); + return; + } + + if(pSetAsView->Mode != IVUG_SETAS_NORMAL) + { + _send_result(gGetUGHandle(), "crop_image_path", SET_AS_VIDEO_CALL_ID_PATH, + "http://tizen.org/appcontrol/data/selected", SET_AS_VIDEO_CALL_ID_PATH); + } + + _show_exit_popup(pSetAsView->content, title, IDS_SUCCESS, pSetAsView); + + free(title); + +} + + +static void +_on_type_popup_selected(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Ivug_SetAsView *pSetAsView = (Ivug_SetAsView *) data; + Ivug_ListPopup_Item *item = event_info; + + if ( item == NULL ) // Cancel is selected + { + MSG_SETAS_HIGH("Cancel is selected"); + evas_object_del(pSetAsView->genlist_popup); + pSetAsView->genlist_popup = NULL; + + return; + } + + const char *label = ivug_listpopup_item_get_data(item); + MSG_SETAS_HIGH("Create SetAsView. name= %s", label); + + if ( strcmp(IDS_HOME_SCREEN, label) == 0 ) + { + _on_setas_homescreen(pSetAsView); + } + else if ( strcmp(IDS_LOCK_SCREEN, label) == 0 ) + { + _on_setas_lockscreen(pSetAsView); + } + else if ( strcmp(IDS_HOME_AND_LOCK_SCREENS, label) == 0 ) + { + _on_setas_bothscreen(pSetAsView); + } + else + { + MSG_SETAS_ERROR("Unknown Set as type : %s", label); + } + + evas_object_del(pSetAsView->genlist_popup); + pSetAsView->genlist_popup = NULL; +} + + +static void _dismissed_cb(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + MSG_SETAS_HIGH("Popup dissmissed"); + + Ivug_SetAsView *pSetAsView = (Ivug_SetAsView *) data; + + if(pSetAsView->genlist_popup) + { + evas_object_del(pSetAsView->genlist_popup); + pSetAsView->genlist_popup = NULL; + } +} + + +static void +_OnOK(Ivug_SetAsView *pSetAsView) +{ + MSG_SETAS_HIGH("On Btn Done clicked"); + + Evas_Object *obj; + + switch(pSetAsView->Type) + { + case IVUG_CTRLBAR_SET_SCREEN_UNDEFINED: + MSG_SETAS_HIGH("Create setas wallpaper popup"); + + obj = ivug_listpopup_add(pSetAsView->content); + + evas_object_smart_callback_add(obj, "popup,dismissed", _dismissed_cb, pSetAsView); + evas_object_smart_callback_add(obj, "popup,selected", _on_type_popup_selected, pSetAsView); + + ivug_listpopup_item_append(obj, NULL,IDS_HOME_SCREEN, IDS_HOME_SCREEN); + ivug_listpopup_item_append(obj, NULL,IDS_LOCK_SCREEN, IDS_LOCK_SCREEN); + ivug_listpopup_item_append(obj, NULL,IDS_HOME_AND_LOCK_SCREENS, IDS_HOME_AND_LOCK_SCREENS); + + ivug_listpopup_title_set(obj, IDS_SET_AS); + + ivug_listpopup_button_set(obj, IDS_CLOSE); + + ivug_listpopup_popup_show(obj); + + + pSetAsView->genlist_popup = obj; + + break; + + case IVUG_CTRLBAR_SET_SCREEN_HOME: + _on_setas_homescreen(pSetAsView); + break; + case IVUG_CTRLBAR_SET_SCREEN_LOCK: + _on_setas_lockscreen(pSetAsView); + break; + case IVUG_CTRLBAR_SET_SCREEN_BOTH: + _on_setas_bothscreen(pSetAsView); + break; + case IVUG_CTRLBAR_SET_SCREEN_CALLERID: + _on_setas_callerid(pSetAsView); + break; + case IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID: + _on_setas_video_call_id(pSetAsView); + break; + default: + MSG_SETAS_ERROR("Unknown Set as type : %d", pSetAsView->Type); + break; + } + +} + +static void +_OnCancel(Ivug_SetAsView *pSetAsView) +{ + MSG_SETAS_HIGH("On Btn cancel clicked"); + + _ivug_setas_view_remove(pSetAsView); +} + +static void _on_setas_show(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + MSG_SETAS_HIGH("SetAs show"); +} + +static void _on_setas_hide(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + MSG_SETAS_HIGH("SetAs hide"); +} + +Ivug_SetAsView * +ivug_setas_view_screen_create(Evas_Object *parent, ivug_setas_mode mode, ivug_set_screen_type screen_type) +{ + Ivug_SetAsView *pSetAsView = NULL; + + MSG_SETAS_HIGH("Setas View creates"); + + pSetAsView = (Ivug_SetAsView *)calloc(1, sizeof(Ivug_SetAsView)); + + pSetAsView->Mode = mode; + pSetAsView->Type = screen_type; + + pSetAsView->content = _ivug_setas_create_layout(parent); + + evas_object_smart_callback_add(pSetAsView->content, "load,failed", _on_msg_load_failed, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "download,failed", _on_msg_load_failed, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "ok,clicked", _on_msg_ok_clicked, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "cancel,clicked", _on_msg_cancel_clicked, pSetAsView); + + evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_SHOW, _on_setas_show, pSetAsView); + evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_HIDE, _on_setas_hide, pSetAsView); + + return pSetAsView; +} + +Ivug_SetAsView * +ivug_setas_view_callerid_ug_create(Evas_Object *parent, const char* filepath, ivug_setas_mode mode, int output_width, int output_height) +{ + Ivug_SetAsView *pSetAsView = NULL; + + MSG_SETAS_HIGH("CallerID UG creates. ImgOut(%d,%d)", output_width, output_height); + + pSetAsView = (Ivug_SetAsView *)calloc(1, sizeof(Ivug_SetAsView)); + + pSetAsView->Mode = mode; + pSetAsView->Type = IVUG_CTRLBAR_SET_SCREEN_CALLERID; // Means that aspect ration should be preserved + + pSetAsView->content = _ivug_setas_callerid_create_layout(parent); + + evas_object_smart_callback_add(pSetAsView->content, "load,failed", _on_msg_load_failed, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "download,failed", _on_msg_load_failed, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "ok,clicked", _on_msg_ok_clicked, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "cancel,clicked", _on_msg_cancel_clicked, pSetAsView); + + evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_SHOW, _on_setas_show, pSetAsView); + evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_HIDE, _on_setas_hide, pSetAsView); + + _ivug_setas_callerid_aspect_ratio_set(pSetAsView->content, (double)output_height/output_width); + + return pSetAsView; +} + +Ivug_SetAsView * +ivug_setas_view_video_call_id_ug_create(Evas_Object *parent, const char* filepath, ivug_setas_mode mode, int output_width, int output_height) +{ + Ivug_SetAsView *pSetAsView = NULL; + + MSG_SETAS_HIGH("CallerID UG creates. ImgOut(%d,%d)", output_width, output_height); + + pSetAsView = (Ivug_SetAsView *)calloc(1, sizeof(Ivug_SetAsView)); + + pSetAsView->Mode = mode; + pSetAsView->Type = IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID; // Means that aspect ration should be preserved + + pSetAsView->content = _ivug_setas_callerid_create_layout(parent); + + evas_object_smart_callback_add(pSetAsView->content, "load,failed", _on_msg_load_failed, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "download,failed", _on_msg_load_failed, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "ok,clicked", _on_msg_ok_clicked, pSetAsView); + evas_object_smart_callback_add(pSetAsView->content, "cancel,clicked", _on_msg_cancel_clicked, pSetAsView); + + evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_SHOW, _on_setas_show, pSetAsView); + evas_object_event_callback_add(pSetAsView->content, EVAS_CALLBACK_HIDE, _on_setas_hide, pSetAsView); + + _ivug_setas_callerid_aspect_ratio_set(pSetAsView->content , (double)output_height/output_width); + + return pSetAsView; +} + + +Evas_Object * +ivug_setas_view_object_get(Ivug_SetAsView *pSetAsView) +{ + IV_ASSERT(pSetAsView != NULL); + + return pSetAsView->content; +} + +void +ivug_setas_view_destroy(Ivug_SetAsView *pSetAsView) +{ + MSG_SETAS_HIGH("Removing SetAs VIew"); + IV_ASSERT(pSetAsView != NULL); + + if ( pSetAsView->content) + { + if(pSetAsView->Type == IVUG_CTRLBAR_SET_SCREEN_CALLERID + || pSetAsView->Type == IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID) + { + _ivug_setas_callerid_delete_layout(pSetAsView->content); + } + else + { + _ivug_setas_delete_layout(pSetAsView->content); + } + //evas_object_del(pSetAsView->content); + pSetAsView->content = NULL; + } + + if ( pSetAsView->ly_effect) + { + evas_object_del(pSetAsView->ly_effect); + pSetAsView->ly_effect = NULL; + } + + if ( pSetAsView->filename ) + { + free(pSetAsView->filename); + pSetAsView->filename = NULL; + } + + free(pSetAsView); + pSetAsView = NULL; +} + +void ivug_setas_view_create_menu(Ivug_SetAsView *pSetAsView, Evas_Object *navi_bar, ivug_set_screen_type type) +{ + if(type == IVUG_CTRLBAR_SET_SCREEN_CALLERID + || type == IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID) + { + _ivug_setas_callerid_create_menu(pSetAsView->content, navi_bar); + } + else + { + _ivug_setas_view_create_menu(pSetAsView->content, navi_bar); + } +} + +void ivug_setas_view_load_file(Ivug_SetAsView *pSetAsView, const char* filepath, ivug_set_screen_type type) +{ + MSG_SETAS_HIGH("ivug_setas_view_load_file %s", filepath); + + if(type == IVUG_CTRLBAR_SET_SCREEN_CALLERID + || type == IVUG_CTRLBAR_SET_SCREEN_VIDEO_CALL_ID) + { + _ivug_setas_callerid_load_file(pSetAsView->content , filepath); + } + else + { + _ivug_setas_load_file(pSetAsView->content , filepath); + } +} + diff --git a/main/src/view/ivug-slideshow-view.cpp b/main/src/view/ivug-slideshow-view.cpp new file mode 100755 index 0000000..89fcbf7 --- /dev/null +++ b/main/src/view/ivug-slideshow-view.cpp @@ -0,0 +1,490 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-parameter.h" + +#include "ivug-slideshow-view.h" + +#include +#include +#include // Key event +#include // ug_send_result + +#include "ivug-filter.h" + +#include "ivug-popup.h" + +#include "EFLUtil.h" +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_MED + +#undef LOG_CAT +#define LOG_CAT "IV-SLIDESHOW" + + +#define IVUG_SS_EDJ EDJ_PATH"/ivug-slideshow-view.edj" + + +static void +_on_slideshow_finished(void *data, Evas_Object *obj, void *event_info); + +static void +_send_result(ui_gadget_h ug, const char *key1, const char *val1, const char *key2, const char *val2) +{ + ivug_ret_if(!ug); + + service_h service; + service_create(&service); + + if(key1 && val1) + { + MSG_HIGH("Bundle 1 : [%s = %s]", key1, val1); + service_add_extra_data(service, key1, val1); + } + if(key2 && val2) + { + MSG_HIGH("Bundle 2 : [%s = %s]", key2, val2); + service_add_extra_data(service, key2, val2); + } + ug_send_result(gGetUGHandle(), service); + + service_destroy(service); +} + + +static bool _destory_slideshow_and_ug(Ivug_SlideShowView *pSSView, + int state, + bool bMmc_out) +{ + IV_ASSERT(pSSView != NULL); + evas_object_smart_callback_del_full(ivug_ss_object_get(pSSView->ssHandle), + "slideshow,finished", _on_slideshow_finished, pSSView); + + ivug_allow_lcd_off(); + /* send msg to caller */ + if(state == SLIDE_SHOW_STOPPED) + { + _send_result(gGetUGHandle(), "EXIT", "NORMAL", NULL, NULL); + } + /*from gallery ablum*/ + + if (pSSView->ssHandle ) + { + MSG_HIGH("image viewer end cause slide show ended"); + ivug_ss_delete(pSSView->ssHandle); + } + pSSView->ssHandle = NULL; + + DESTROY_ME(); + return true; +} + +static Eina_Bool __stop_slideshow_cb(void *data) +{ + Ivug_SlideShowView *pSSView = (Ivug_SlideShowView *)data; + if (pSSView && (pSSView->ssHandle)) { + if(pSSView->homekey_idler) + { + ecore_idler_del(pSSView->homekey_idler); + pSSView->homekey_idler = NULL; + } + ivug_ss_stop(pSSView->ssHandle); + } + return ECORE_CALLBACK_CANCEL; +} + +static Eina_Bool _on_key_down(void *user_data, int type, void *event) +{ + if (!user_data) { + MSG_IMAGEVIEW_ERROR("user data is NULL"); + return ECORE_CALLBACK_PASS_ON; + } + + Ivug_SlideShowView *pSSView = static_cast(user_data); + + Ecore_Event_Key *key_event = (Ecore_Event_Key *) event; + + if (!strcmp(key_event->keyname, KEY_END)) + { + MSG_IMAGEVIEW_HIGH("Bakc(End) key"); + } + else if (!strcmp(key_event->keyname, KEY_SELECT)) + { + MSG_IMAGEVIEW_HIGH("Home key"); + /*home key,we need to stop slideshow also*/ + if (pSSView->homekey_idler == NULL) { + pSSView->homekey_idler = ecore_idler_add(__stop_slideshow_cb, pSSView); + } + } + else if (!strcmp(key_event->keyname, KEY_POWER)) + { + MSG_IMAGEVIEW_HIGH("Power key"); + if ( pSSView->ssHandle ) + { + ivug_ss_stop(pSSView->ssHandle); + } + } + + MSG_IMAGEVIEW_LOW("Key down : %s", key_event->keyname); + + return ECORE_CALLBACK_PASS_ON; +} + +static void +_on_slideshow_finished(void *data, Evas_Object *obj, void *event_info) +{ + MSG_HIGH("_on_slideshow_finished"); + IV_ASSERT(data != NULL); + + Ivug_SlideShowView *pSSView = static_cast(data); + + int ss_state = (int)event_info; + bool bDestoryed = false; + bDestoryed = _destory_slideshow_and_ug(pSSView, ss_state, false); +} + +static void _on_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Ivug_SlideShowView *pSSView = static_cast(data); + IV_ASSERT(pSSView != NULL); + + Evas_Coord x,y,w,h; + evas_object_geometry_get(obj, &x, &y, &w, &h); + +/** +* during slideshow, after rotation, resize cb of slideshow obj cannot be invoked, + so invoke it manually +*/ + if(pSSView->ssHandle) + ivug_ss_resize(pSSView->ssHandle); + + MSG_HIGH("SlideshowView resized geomtery XYWH(%d,%d,%d,%d) Rotate=%d", x, y, w, h, gGetRotationDegree()); +} + +void _ivug_slideshow_view_on_mmc_state_changed(keynode_t* node, void *data) +{ + Ivug_SlideShowView *pSSView = static_cast(data); + IV_ASSERT(pSSView != NULL); + + //ivug_timeout_popup_show(ivug_ss_object_get(pSSView->ssHandle), NULL, NULL, IDS_ERROR, IDS_SD_CARD_REMOVED); + ivug_ss_set_stop(pSSView->ssHandle); + _destory_slideshow_and_ug(pSSView, SLIDE_SHOW_STOPPED, true); +} + +static char * _ivug_get_folder_name(char *filepath) +{ + char *folder = ecore_file_dir_get(filepath); + + char *name = NULL; + + name = strrchr(folder, '/'); + if ( (name != NULL) && ((name+1) != NULL) ) + { + return strdup(name + 1); + } + + return NULL; +} + + +bool +ivug_slideshow_view_set_list(Ivug_SlideShowView *pSSView, ivug_parameter *ivug_param) +{ + MSG_HIGH("Load media list."); + + IV_ASSERT(pSSView != NULL); + + PERF_CHECK_BEGIN(LVL2, "create media list"); + + Media_List *mlist = ivug_medialist_create(); + if (mlist == NULL) + { + MSG_ERROR("Creating media list failed"); + return false; + } + PERF_CHECK_END(LVL2, "create media list"); + + PERF_CHECK_BEGIN(LVL2, "create filter"); + + Filter_struct *filter = ivug_param_create_filter(ivug_param); + if (filter == NULL) + { + MSG_ERROR("Creating filter failed"); + ivug_medialist_del(mlist); + return false; + } + + PERF_CHECK_END(LVL2, "create filter"); + + Media_Item *current = NULL; + Media_Data *pData = NULL; + + { + PERF_CHECK_BEGIN(LVL2, "media list load"); + current = ivug_medialist_load(mlist, filter); + PERF_CHECK_END(LVL2, "media list load"); + } + + if(current == NULL) + { + MSG_ERROR("Media list load failed"); + goto LOAD_LIST_FAILED; + } + + pData = ivug_medialist_get_data(current); + if(pData == NULL) + { + MSG_ERROR("current data is NULL"); + goto LOAD_LIST_FAILED; + } + + if(pData->fileurl == NULL) + { + MSG_ERROR("current fileurl is NULL"); + goto LOAD_LIST_FAILED; + } + +#ifdef USE_RESCAN_FILE_PATH_AT_LIST + if(strncmp(pData->fileurl, ivug_param->filepath, strlen(pData->fileurl)) != 0) + { + current = ivug_medialist_find_item_by_filename(mlist, ivug_param->filepath); + if(current == NULL) + { + MSG_ERROR("Media list load failed, %s is not exist at list", ivug_param->filepath); + goto LOAD_LIST_FAILED; + } + } +#endif + + if(ivug_param->view_by == IVUG_VIEW_BY_ALL) + { + pSSView->album_name = strdup(IDS_ALL_ALBUMS); + } + else if(ivug_param->view_by == IVUG_VIEW_BY_FOLDER) + { + /* + media_handle m_handle = ivug_db_get_folder_handle(ecore_file_dir_get(ivug_param->filepath)); + if(m_handle == NULL) + { + MSG_IVUG_FATAL("View by Folder. but media handle is NULL" ); + return NULL; + } + + pMainView->album_name = ivug_db_get_folder_name(m_handle); + */ + pSSView->album_name = _ivug_get_folder_name(ivug_param->filepath); + if(pSSView->album_name == NULL) + { + pSSView->album_name = strdup(IDS_NO_NAME); + } + } + + pSSView->mList = mlist; + PERF_CHECK_BEGIN(LVL2, "media list set"); + + pSSView->ss_curItem = current; + + PERF_CHECK_END(LVL2, "media list set"); + + ivug_data_filter_delete(filter); + + return true; + +LOAD_LIST_FAILED: + + if(filter) + ivug_data_filter_delete(filter); + + if(mlist) + ivug_medialist_del(mlist); + + pSSView->mList = NULL; + return false; +} + +Ivug_SlideShowView * +ivug_slideshow_view_create(Evas_Object* parent, ivug_mode mode, ivug_view_by view_by) +{ + IV_ASSERT(parent != NULL); + + MSG_HIGH("Creating slideshow view. Parent=0x%08x Mode=%d ViewBy=%d", parent, mode, view_by); + + PERF_CHECK_BEGIN(LVL2, "Create layout"); + +//create main view layout + Ivug_SlideShowView *pSSView = (Ivug_SlideShowView *)calloc(1, sizeof(Ivug_SlideShowView) ); + IV_ASSERT(pSSView != NULL); + +// Set default value + pSSView->parent = parent; + pSSView->view_by = view_by; + + Evas_Object *layout; + layout = elm_layout_add(parent); + if ( layout == NULL) //if failed + { + MSG_ERROR("main layout create failed"); + free(pSSView); + return NULL; + } + + pSSView->layout = layout; + evas_object_name_set(pSSView->layout, "SlideShow Layout"); + +#if 0 + if (elm_layout_file_set(layout, IVUG_SS_EDJ, "ssview") == EINA_FALSE) + { + MSG_MAIN_ERROR("edj loading fail, file=%s group=%s", IVUG_SS_EDJ, IVUG_SS_EDJ); + evas_object_del(layout); + free(pSSView); + return NULL; + } +#endif + evas_object_event_callback_add(pSSView->layout, EVAS_CALLBACK_RESIZE, _on_resize, pSSView); + + pSSView->keydown_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, _on_key_down, (void *)pSSView); + + MSG_HIGH("Main View Created"); + + return pSSView; +} + + +Evas_Object * +ivug_slideshow_view_object_get(Ivug_SlideShowView *pSSView) +{ + IV_ASSERT(pSSView != NULL); + + return pSSView->layout; +} + + +void +ivug_slideshow_view_start(Ivug_SlideShowView *pSSView) +{ + IV_ASSERT(pSSView != NULL); + + MSG_HIGH("Slide show running"); + + Media_Item *current = pSSView->ss_curItem; + + ivug_prohibit_lcd_off(); + //ivug_main_view_hide_menu_bar(pMainView); + + pSSView->ssHandle = ivug_ss_create(pSSView->layout); + +// Register callback + evas_object_smart_callback_add(ivug_ss_object_get(pSSView->ssHandle), "slideshow,finished", _on_slideshow_finished, pSSView); + + elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_HIDE); + + ivug_ss_start(pSSView->ssHandle, current, pSSView->mList, EINA_FALSE); + +} + + + +void +ivug_slideshow_view_resume(Ivug_SlideShowView *pSSView) +{ + IV_ASSERT(pSSView != NULL); + + MSG_HIGH("Slideshow View Resumed"); + + Media_Item *mitem = pSSView->ss_curItem; + Media_Data *mdata = ivug_medialist_get_data(mitem); + + IV_ASSERT(mdata != NULL); + + if (mdata->slide_type == SLIDE_TYPE_IMAGE || mdata->slide_type == SLIDE_TYPE_VIDEO ) + { + if(mdata->filepath && ecore_file_exists(mdata->filepath)) // Current file is not deleted + { + MSG_HIGH("Current filepath : %s", mdata->filepath); + } + else + { + /*if file is not exist ug terminated temporally */ + MSG_ERROR("Center file is not exist. stype=%d name=%s", mdata->slide_type, mdata->filepath); + DESTROY_ME(); + return ; + } + } + else + { + MSG_ERROR("Unhandled slide type : %d", mdata->slide_type); + } +} + + +void +ivug_slideshow_view_pause(Ivug_SlideShowView *pSSView) +{ + IV_ASSERT(pSSView != NULL); + + if ( pSSView->ssHandle ) + { + ivug_ss_stop(pSSView->ssHandle); + } + + // Stop photocam If AGIF +} + + +void +ivug_slideshow_view_destroy(Ivug_SlideShowView *pSSView) +{ + IV_ASSERT(pSSView != NULL); + + MSG_HIGH("ENTER : SlideShow View Destroy. pMainView=0x%08x", pSSView); + + MSG_HIGH("Unregister system notifications"); + if (pSSView->layout) { + evas_object_del(pSSView->layout); + pSSView->layout = NULL; + } + if(pSSView->keydown_handler) + { + ecore_event_handler_del(pSSView->keydown_handler); + pSSView->keydown_handler = NULL; + } + if(pSSView->homekey_idler) + { + ecore_idler_del(pSSView->homekey_idler); + pSSView->homekey_idler = NULL; + } + + if ( pSSView->mList ) + { + MSG_MAIN_HIGH("Remove media list"); + ivug_medialist_del(pSSView->mList); // ivug_medialist_del() is not working on destroy cb. + pSSView->mList = NULL; + } + if(pSSView->album_name) + { + free(pSSView->album_name); + pSSView->album_name = NULL; + } + EFL::dump_obj(pSSView->parent, 0); + free(pSSView); + pSSView = NULL; + MSG_HIGH("LEAVE : SlideShow View Destroy."); + + return ; +} + + diff --git a/medialist/CMakeLists.txt b/medialist/CMakeLists.txt new file mode 100755 index 0000000..1b255fb --- /dev/null +++ b/medialist/CMakeLists.txt @@ -0,0 +1,47 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(ivug_medialist C CXX) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(VERSION 0.1.0) + +INCLUDE_DIRECTORIES( + include + src + ${CMAKE_SOURCE_DIR}/include + ${IVUG_SOURCE_COMMON_DIR}/include + ${IVUG_SOURCE_FEATURE_DIR}/include +) + +SET(SRCS + src/ivug-medialist.c + src/ivug-mediadata.c + src/ivug-data-list.c + src/ivug-filter.c +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(${PROJECT_NAME}_pkgs REQUIRED + elementary + dlog + ui-gadget-1 + eina + ecore + capi-content-media-content +) + +FOREACH(flag ${${PROJECT_NAME}_pkgs_CFLAGS}) + SET(EXTRA_FLAGS "${EXTRA_FLAGS} ${flag}") +ENDFOREACH(flag) + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") + +ADD_LIBRARY(${PROJECT_NAME} STATIC ${SRCS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION} ) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${EXTRA_FLAGS}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} +ivug_common ivug_feature) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib) + diff --git a/medialist/include/ivug-filter.h b/medialist/include/ivug-filter.h new file mode 100755 index 0000000..71bbd5c --- /dev/null +++ b/medialist/include/ivug-filter.h @@ -0,0 +1,89 @@ +/* + * Copyright 2012 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 __IVUG_FILTER_H__ +#define __IVUG_FILTER_H__ + +#include + +#include "ivug-define.h" + + +typedef enum { + FILTER_DB, + FILTER_DIRECTORY, +}filter_type_e; + +typedef struct _DB_Filter{ + + union { /* CAUTION : Union type. check view_by variable before free()*/ + char *file_path; + struct { + double max_longitude; + double min_longitude; + double max_latitude; + double min_latitude; + } place; + + int tag_id; + + UUID album_id; // Cluster id + }; + +} DB_Filter; + + + +typedef struct _Directory_Filter { + const char *basedir; + const char *current; // Center Item. +} Direcotry_Filter; + +typedef struct _Filter_struct{ + filter_type_e type; + ivug_view_by view_by; + ivug_media_type media_type; + ivug_sort_type sort_type; + int index; + char *filepath; + + Eina_List *selected_list; + + + //union{ + DB_Filter *db_filter; + + Direcotry_Filter *dir_filter; + //} +}Filter_struct; + + +#ifdef __cplusplus +extern "C" { +#endif + +Filter_struct *ivug_data_filter_copy(const Filter_struct *filter); + +void ivug_data_filter_delete(Filter_struct *filter); + + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_FILTER_H__ + diff --git a/medialist/include/ivug-media.h b/medialist/include/ivug-media.h new file mode 100755 index 0000000..4f2ec76 --- /dev/null +++ b/medialist/include/ivug-media.h @@ -0,0 +1,79 @@ +/* + * Copyright 2012 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 __IVUG_MEDIA_H__ +#define __IVUG_MEDIA_H__ + +#include "ivug-datatypes.h" +#include "ivug-db.h" + +#include +#include + +//slide type +typedef enum { + SLIDE_TYPE_NONE = 0x00, + SLIDE_TYPE_IMAGE, + SLIDE_TYPE_VIDEO, + SLIDE_TYPE_UNKNOWN, // File is exists but it's type is unknown. +} Media_Type; + +// Meida_Data can be one in File, DB + +/* + This struct represents data for slide. + thumbnail_path is slide's thumbnail image path. + fileurl is saved item in media service. and drm. + filepath is local file path. if fileurl is http://.../test.jpg, filepath is NULL, when complete download filepath change to saved local file path. +*/ +typedef struct { + media_handle m_handle; + + int index; + +//Data + Media_Type slide_type; //image, video + bool bIsDRMContent; + + UUID mediaID; // Unique Media ID + + char* thumbnail_path; // thumbnail image file path. + + char* fileurl; // file url. + char* filepath; // file path in local file system. + char* drm_filepath; + + Ivug_DB_h *thumb_handle; +} Media_Data; + + +#ifdef __cplusplus +extern "C" { +#endif + +bool ivug_mediadata_set_tag(Media_Data *data, const char *newtag); +bool ivug_mediadata_set_favorite(Media_Data *data, bool bFavorite); + +bool ivug_mediadata_delete(Media_Data * mdata); + +bool ivug_mediadata_free(Media_Data * mdata); + + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_MEDIA_H__ diff --git a/medialist/include/ivug-medialist.h b/medialist/include/ivug-medialist.h new file mode 100755 index 0000000..a215708 --- /dev/null +++ b/medialist/include/ivug-medialist.h @@ -0,0 +1,84 @@ +/* + * Copyright 2012 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 __IVUG_MEDIALIST_H__ +#define __IVUG_MEDIALIST_H__ + +#include "ivug-define.h" +#include "ivug-datatypes.h" +#include "ivug-media.h" + +#include "ivug-filter.h" + + +typedef void *Media_Item; + +/* Opaque pointer for media list. */ +typedef void Media_List; + +typedef bool (*ivug_medialist_cb)(Media_List *mList, void *data); + +#ifdef __cplusplus +extern "C" { +#endif + +Media_List * ivug_medialist_create(); + +bool ivug_medialist_set_callback(Media_List *mList, ivug_medialist_cb callback, void *data); + +Media_Item *ivug_medialist_load(Media_List *mList, const Filter_struct *filter); + +void ivug_medialist_del(Media_List *mList); + +/* + return total count +*/ +int ivug_medialist_get_count(Media_List *mList); + + +/* + Needed for displaying title. ex) Index/Total Count +*/ +int ivug_medialist_get_index(Media_List *mList, Media_Item *item); + + +Media_Item *ivug_medialist_get_first(Media_List *mList); +Media_Item *ivug_medialist_get_last(Media_List *mList); + +Media_Item *ivug_medialist_get_next(Media_List *mList, Media_Item *item); +Media_Item *ivug_medialist_get_prev(Media_List *mList, Media_Item *item); + +void ivug_medialist_delete_item(Media_List *mList, Media_Item *item); + +Media_Data *ivug_medialist_get_data(const Media_Item *item); + +Media_Item *ivug_medialist_get_random_item(Media_List *mList); +Media_Item *ivug_medialist_get_shuffle_item(Media_List *mList, Media_Item *item); + + +Media_Item *ivug_medialist_find_item_by_index(Media_List *mList, int index); +Media_Item * ivug_medialist_find_item_by_filename(Media_List *mList, const char* filepath); + +Media_Item *ivug_medialist_append_item(Media_List *mList, const char *filepath); +Media_Item *ivug_medialist_prepend_item(Media_List *mList, const char *filepath); + + +#ifdef __cplusplus +} +#endif + +#endif //__IVUG_MEDIALIST_H__ + diff --git a/medialist/src/ivug-data-list.c b/medialist/src/ivug-data-list.c new file mode 100755 index 0000000..acad7b1 --- /dev/null +++ b/medialist/src/ivug-data-list.c @@ -0,0 +1,494 @@ +/* + * Copyright 2012 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 "ivug-define.h" + +#include "ivug-data-list.h" +#include "ivug-uuid.h" + +#include "ivug-debug.h" +#include "ivug-media.h" +#include "ivug-mediadata.h" +#include "ivug-medialist.h" + +#include "ivug-db.h" + +#include "ivug-dir.h" +#include "ivug-util.h" + +#include "ivug-filter.h" + +#include + +#include + +static char *_strerror_db(int error) +{ + switch(error) + { + case MEDIA_CONTENT_ERROR_INVALID_PARAMETER: + return "Invalid parameter"; + case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY : + return "Out of memory"; + case MEDIA_CONTENT_ERROR_DB_FAILED : + return "DB operation failed"; + default: + { + static char buf[40]; + sprintf(buf, "Error Code=%d", error); + return buf; + } + + } +} + + +static bool +_ivug_list_media_item_cb(media_info_h item, void *user_data) +{ + IV_ASSERT(user_data != NULL); + + media_info_h media = NULL; + media_info_clone(&media, item); + + Eina_List **list = (Eina_List **)user_data; + *list = eina_list_append(*list, media); + + return true; +} + + + +Eina_List * +ivug_list_load_DB_items(const Filter_struct *filter, int stp, int endp) +{ + IV_ASSERT(filter != NULL); + + DB_Filter *db_filter = filter->db_filter; + char *string = NULL; + int ret = MEDIA_CONTENT_ERROR_NONE; + + if (filter->view_by == IVUG_VIEW_BY_FILE) + { + Eina_List *list = NULL; + Media_Data *mData = ivug_alloc_mediadata_from_filepath(db_filter->file_path); + + list = eina_list_append(list, mData); + return list; + } + + filter_handle media_filter = NULL; + ivug_db_create_filter(&media_filter); + + if(filter->view_by == IVUG_VIEW_BY_PLACES) + { + string = calloc(1, sizeof(char)*IVUG_MAX_CONDITION_LEN); + snprintf(string, IVUG_MAX_CONDITION_LEN, + "(MEDIA_LONGITUDE >= %f AND MEDIA_LONGITUDE <= %f AND MEDIA_LATITUDE >= %f AND MEDIA_LATITUDE <= %f)", + db_filter->place.min_longitude, db_filter->place.max_longitude, + db_filter->place.min_latitude, db_filter->place.max_latitude); + } + ivug_db_set_filter(media_filter, filter->view_by, filter->media_type, string); + + ivug_db_set_filter_offset(media_filter, stp, endp); + + Eina_List *item_list = NULL; + + switch(filter->view_by) + { + case IVUG_VIEW_BY_FOLDER: + ret = media_folder_foreach_media_from_db(db_filter->album_id, + media_filter, _ivug_list_media_item_cb, &item_list); + break; + + case IVUG_VIEW_BY_ALL: + ret = media_info_foreach_media_from_db(media_filter, _ivug_list_media_item_cb, &item_list); + break; + + case IVUG_VIEW_BY_FAVORITES: + ret = media_info_foreach_media_from_db(media_filter, _ivug_list_media_item_cb, &item_list); + break; + + case IVUG_VIEW_BY_TAG: + ret = media_tag_foreach_media_from_db(db_filter->tag_id, media_filter, _ivug_list_media_item_cb, &item_list); + break; + case IVUG_VIEW_BY_PLACES: + ret = media_info_foreach_media_from_db(media_filter, _ivug_list_media_item_cb, &item_list); + break; + + default: + MSG_SDATA_FATAL("Invalid View By=%d", filter->view_by); + return NULL; + } + + ivug_db_destroy_filter(media_filter); + + if ( ret != MEDIA_CONTENT_ERROR_NONE ) + { + MSG_SDATA_ERROR("[%s] Error=%d VieBy=%d", __func__, ret, filter->view_by); + return NULL; + } + +// Creating media_list. + Eina_List *slide_list = NULL; + + Eina_List *item; + media_info_h mitem = NULL; + + Media_Data *mdata = NULL; + + int i = 0; + + EINA_LIST_FOREACH(item_list, item, mitem) + { + mdata = ivug_alloc_mediadata_from_media_handle(mitem); + mdata->index = i + stp; + + i++; + + IV_ASSERT(mdata != NULL); + + MSG_SDATA_LOW("Add Mdata. Mdata=0x%08x %s", mdata, mdata->filepath); + slide_list = eina_list_append(slide_list, mdata); + } + + EINA_LIST_FREE(item_list, mitem) + { + media_info_destroy(mitem); + } + + MSG_SDATA_HIGH("Item header=0x%08x Item loaded(%d~%d)", slide_list, stp, endp); + + return slide_list; +} + +Eina_List * +ivug_list_load_DB_items_list(const Filter_struct *filter, Eina_List *list) +{ + IV_ASSERT(filter != NULL); + + DB_Filter *db_filter = filter->db_filter; + char *string = NULL; + int ret = MEDIA_CONTENT_ERROR_NONE; + + filter_handle media_filter = NULL; + ivug_db_create_filter(&media_filter); + + if(filter->view_by == IVUG_VIEW_BY_PLACES) + { + string = calloc(1, sizeof(char)*IVUG_MAX_CONDITION_LEN); + snprintf(string, IVUG_MAX_CONDITION_LEN, + "(MEDIA_LONGITUDE >= %f AND MEDIA_LONGITUDE <= %f AND MEDIA_LATITUDE >= %f AND MEDIA_LATITUDE <= %f)", + db_filter->place.min_longitude, db_filter->place.max_longitude, + db_filter->place.min_latitude, db_filter->place.max_latitude); + } + ivug_db_set_filter(media_filter, filter->view_by, filter->media_type, string); + + Eina_List *l = NULL; + void *data = NULL; + int index = -1; + Eina_List *item_list = NULL; + + EINA_LIST_FOREACH(list, l, data) + { + index = (int)data; + ivug_db_set_filter_offset(media_filter, index, index); + + switch(filter->view_by) + { + case IVUG_VIEW_BY_FOLDER: + ret = media_folder_foreach_media_from_db(db_filter->album_id, + media_filter, _ivug_list_media_item_cb, &item_list); + break; + + case IVUG_VIEW_BY_ALL: + ret = media_info_foreach_media_from_db(media_filter, _ivug_list_media_item_cb, &item_list); + break; + + case IVUG_VIEW_BY_FAVORITES: + ret = media_info_foreach_media_from_db(media_filter, _ivug_list_media_item_cb, &item_list); + break; + + case IVUG_VIEW_BY_TAG: + ret = media_tag_foreach_media_from_db(db_filter->tag_id, media_filter, _ivug_list_media_item_cb, &item_list); + break; + case IVUG_VIEW_BY_PLACES: + ret = media_info_foreach_media_from_db(media_filter, _ivug_list_media_item_cb, &item_list); + break; + + default: + MSG_SDATA_FATAL("Invalid View By=%d", filter->view_by); + return NULL; + } + } + + ivug_db_destroy_filter(media_filter); + + if ( ret != MEDIA_CONTENT_ERROR_NONE ) + { + MSG_SDATA_ERROR("[%s] Error=%d VieBy=%d", __func__, ret, filter->view_by); + return NULL; + } + +// Creating media_list. + Eina_List *slide_list = NULL; + + Eina_List *item; + media_info_h mitem = NULL; + + Media_Data *mdata = NULL; + + int i = 0; + + EINA_LIST_FOREACH(item_list, item, mitem) + { + mdata = ivug_alloc_mediadata_from_media_handle(mitem); + mdata->index = i; + + i++; + + IV_ASSERT(mdata != NULL); + + MSG_SDATA_LOW("Add Mdata. Mdata=0x%08x %s", mdata, mdata->filepath); + slide_list = eina_list_append(slide_list, mdata); + } + + EINA_LIST_FREE(item_list, mitem) + { + media_info_destroy(mitem); + } + + MSG_SDATA_HIGH("Item header=0x%08x Item loaded %d items", slide_list, eina_list_count(item_list)); + + return slide_list; +} + + + +int ivug_list_get_item_cnt(const Filter_struct *filter) +{ + filter_h media_filter = NULL; + + int ret = MEDIA_CONTENT_ERROR_NONE; + + int count = 0; + + char *string = NULL; + + + if(filter->selected_list) + { + return eina_list_count(filter->selected_list); + } + + DB_Filter *db_filter = filter->db_filter; + + ivug_db_create_filter((filter_handle*)&media_filter); + if(filter->view_by == IVUG_VIEW_BY_PLACES) + { + string = calloc(1, sizeof(char)*IVUG_MAX_CONDITION_LEN); + snprintf(string, IVUG_MAX_CONDITION_LEN, + "(MEDIA_LONGITUDE >= %f AND MEDIA_LONGITUDE <= %f AND MEDIA_LATITUDE >= %f AND MEDIA_LATITUDE <= %f)", + db_filter->place.min_longitude, db_filter->place.max_longitude, + db_filter->place.min_latitude, db_filter->place.max_latitude); + } + ivug_db_set_filter(media_filter, filter->view_by, filter->media_type, string); + + switch(filter->view_by) + { + case IVUG_VIEW_BY_ALL: + ret = media_info_get_media_count_from_db(media_filter, &count); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_get_media_count_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_COUNT_ERROR; + } + MSG_SDATA_HIGH("IVUG_VIEW_BY_ALL. MediaType=%d Count=%d", filter->media_type, count); + break; + case IVUG_VIEW_BY_TAG: + if(db_filter->tag_id <= 0 ) + { + MSG_SDATA_ERROR("tag id is invalid"); + goto GET_COUNT_ERROR; + } + ret = media_tag_get_media_count_from_db(db_filter->tag_id, media_filter, &count); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_tag_get_tag_count_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_COUNT_ERROR; + } + MSG_SDATA_HIGH("IVUG_VIEW_BY_TAG. Count=%d", count); + break; + case IVUG_VIEW_BY_PLACES: + ret = media_info_get_media_count_from_db(media_filter, &count); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_get_media_count_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_COUNT_ERROR; + } + MSG_SDATA_HIGH("IVUG_VIEW_BY_PLACES. Count=%d", count); + break; + case IVUG_VIEW_BY_FOLDER: + if(db_filter->album_id == NULL) + { + MSG_SDATA_ERROR("album_id is NULL"); + goto GET_COUNT_ERROR; + } + ret = media_folder_get_media_count_from_db(db_filter->album_id, media_filter, &count); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_folder_get_media_count_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_COUNT_ERROR; + } + MSG_SDATA_HIGH("IVUG_VIEW_BY_FOLDER. Count=%d", count); + break; + case IVUG_VIEW_BY_FAVORITES: + ret = media_info_get_media_count_from_db(media_filter, &count); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_get_media_count_from_db is failed, err = %s", _strerror_db(ret)); + goto GET_COUNT_ERROR; + } + MSG_SDATA_HIGH("IVUG_VIEW_BY_FAVORITES. Count=%d", count); + break; + case IVUG_VIEW_BY_FILE: + count = 1; // item count is always 1 when by file + break; + default: + MSG_SDATA_ERROR("Unhandled view_by : %d", filter->view_by); + goto GET_COUNT_ERROR; + break; + } + + MSG_SDATA_HIGH("ivug_db_get_count success, count = %d", count); + + ivug_db_destroy_filter(media_filter); + return count; + +GET_COUNT_ERROR: + MSG_SDATA_ERROR("ivug_db_get_count FAILED"); + + ivug_db_destroy_filter(media_filter); + return -1; +} + +void ivug_list_delete_items(Eina_List *items) +{ + Media_Data* mdata; + + if ( items == NULL ) + { + MSG_SDATA_HIGH("Item list is NULL."); + return; + } + + MSG_SDATA_HIGH("Removing items. Count=%d", eina_list_count(items)); + + EINA_LIST_FREE(items, mdata) + { + ivug_free_mediadata(mdata); + } +} + + + + +static void enum_dir(const char *fname, void *user_data) +{ + IV_ASSERT(user_data != NULL); + + Eina_List **list = (Eina_List **)user_data; + +// Alloc new mdata + Media_Data *mdata = NULL; + + mdata = (Media_Data *)calloc(1, sizeof(Media_Data)); + +// Thumbnail path format.. ".thumbs/xxxx_thm.ext" +// File path format.. "xxxx_bestpic.ext" + + mdata->fileurl = strdup(fname); + mdata->filepath = strdup(fname); // file path in local file system. + mdata->slide_type = SLIDE_TYPE_IMAGE; // Currently, Best pic is only for image + +// Get thumblist. + char *dir = ivug_get_directory(fname); // User free return value. + char *file = ivug_get_filename(fname); // User should not free return value. + + char *thumbpath = (char *)malloc(strlen(dir) + strlen(file) + strlen("/.thumbs/")+ 1); + + sprintf(thumbpath, "%s/.thumbs/%s", dir, file); + + mdata->thumbnail_path = thumbpath; // thumbnail image file path. + + free(dir); + *list = eina_list_append(*list, (void *)mdata); + +} + +int ivug_list_get_dir_cnt(const char *basedir) +{ + int count = 0; + + count = GetFilesCountInDir(basedir); + + if ( count < 0 ) + { + MSG_SDATA_ERROR("Cannot get item count in dir : %s", basedir); + return 0; + } + + MSG_SDATA_HIGH("IVUG_VIEW_BY_DIRECTORY. Count=%d", count); + + return count; +} + + +Eina_List * +ivug_list_load_dir_items(const char *basedir) +{ + Eina_List *list = NULL; + + bool result = false; + + result = EnumFilesInDir(basedir, enum_dir, &list); + + if ( result == false) + { + MSG_SDATA_ERROR("Cannit get file list in %s", basedir); + return NULL; + } + + return list; +} + + +Eina_List *ivug_list_append_item(Eina_List *list, const char *filepath) +{ + Media_Data *mData = ivug_alloc_mediadata_from_filepath(filepath); + + list = eina_list_append(list, mData); + return list; +} + +Eina_List *ivug_list_prepend_item(Eina_List *list, const char *filepath) +{ + Media_Data *mData = ivug_alloc_mediadata_from_filepath(filepath); + + list = eina_list_prepend(list, mData); + return list; +} + diff --git a/medialist/src/ivug-data-list.h b/medialist/src/ivug-data-list.h new file mode 100755 index 0000000..141e0ed --- /dev/null +++ b/medialist/src/ivug-data-list.h @@ -0,0 +1,54 @@ +/* + * Copyright 2012 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 __IVUG_DATA_LIST_H__ +#define __IVUG_DATA_LIST_H__ + +#include "ivug-define.h" +#include "ivug-medialist.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + stp/endp is botn -1 when want to retrieve all items. +*/ + +Eina_List *ivug_list_load_DB_items(const Filter_struct *filter, int stp, int endp); + +Eina_List *ivug_list_load_DB_items_list(const Filter_struct *filter, Eina_List *list); + +int ivug_list_get_item_cnt(const Filter_struct *filter); + +void ivug_list_delete_items(Eina_List *items); + + +int ivug_list_get_dir_cnt(const char *basedir); + +Eina_List *ivug_list_load_dir_items(const char *basedir); + +Eina_List *ivug_list_append_item(Eina_List *list, const char *filepath); + +Eina_List *ivug_list_prepend_item(Eina_List *list, const char *filepath); + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/medialist/src/ivug-filter.c b/medialist/src/ivug-filter.c new file mode 100755 index 0000000..43088a3 --- /dev/null +++ b/medialist/src/ivug-filter.c @@ -0,0 +1,136 @@ +/* + * Copyright 2012 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 "ivug-datatypes.h" +#include "ivug-filter.h" + +#include + +#include "ivug-debug.h" +#include "ivug-uuid.h" +#include "ivug-util.h" + +void ivug_data_filter_delete(Filter_struct *filter_str) +{ + IV_ASSERT(filter_str != NULL); + + MSG_SDATA_HIGH("Removing filter struct. Type=%d", filter_str->type); + + if(filter_str->selected_list) + { + eina_list_free(filter_str->selected_list); + filter_str->selected_list = NULL; + } + + if(filter_str->type == FILTER_DB) + { + DB_Filter *filter = filter_str->db_filter; + switch(filter_str->view_by) + { + case IVUG_VIEW_BY_PLACES: + break; + case IVUG_VIEW_BY_TAG: + break; + case IVUG_VIEW_BY_FAVORITES: + break; + + case IVUG_VIEW_BY_FILE: + if ( filter->file_path ) + { + free(filter->file_path); + } + break; + case IVUG_VIEW_BY_ALL: + uuid_free(filter->album_id); + break; + + case IVUG_VIEW_BY_FOLDER: + uuid_free(filter->album_id); + break; + + case IVUG_VIEW_BY_INVAILD: + default: + MSG_SDATA_WARN("Invalid ViewBy : %d", filter_str->view_by); + break; + } + free(filter); + } + if(filter_str->filepath) + { + free(filter_str->filepath); + filter_str->filepath = NULL; + } + free(filter_str); +} + + +Filter_struct *ivug_data_filter_copy(const Filter_struct *filter_str) +{ + IV_ASSERT(filter_str != NULL); + Filter_struct *cFilter_str = calloc(1, sizeof(Filter_struct)); + IV_ASSERT(cFilter_str != NULL); + + memcpy(cFilter_str, filter_str, sizeof(Filter_struct)); + + if(filter_str->type == FILTER_DB) + { + DB_Filter *filter = filter_str->db_filter; + DB_Filter *cFilter = calloc(1, sizeof(DB_Filter)); + memcpy(cFilter, filter, sizeof(DB_Filter)); + + switch(filter_str->view_by) + { + case IVUG_VIEW_BY_PLACES: + break; + case IVUG_VIEW_BY_TAG: + cFilter->tag_id = filter->tag_id; + break; + case IVUG_VIEW_BY_FAVORITES: + break; + + case IVUG_VIEW_BY_FILE: + cFilter->file_path = strdup( filter->file_path ); + + if ( filter->file_path ) + { + free(filter->file_path); + } + break; + + case IVUG_VIEW_BY_ALL: + cFilter->album_id = uuid_assign( filter->album_id ); + break; + + case IVUG_VIEW_BY_FOLDER: + cFilter->album_id = uuid_assign( filter->album_id ); + break; + + case IVUG_VIEW_BY_INVAILD: + default: + MSG_SDATA_WARN("Invalid ViewBy : %d", filter_str->view_by); + break; + } + + cFilter_str->db_filter = cFilter; + } + if(filter_str->filepath) + { + cFilter_str->filepath = strdup(filter_str->filepath); + } + return cFilter_str; +} + + diff --git a/medialist/src/ivug-mediadata.c b/medialist/src/ivug-mediadata.c new file mode 100755 index 0000000..b460de5 --- /dev/null +++ b/medialist/src/ivug-mediadata.c @@ -0,0 +1,464 @@ +/* + * Copyright 2012 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 "ivug-define.h" +#include "ivug-datatypes.h" +#include "ivug-uuid.h" +#include "ivug-debug.h" +#include "ivug-mediadata.h" +#include "ivug-util.h" +#include "ivug-drm-common.h" +#include "ivug-file-info.h" + +#include "ivug-db.h" + +#include + +#define IMAGE_PATH PREFIX"/res/images/"PACKAGE +#define DEFAULT_THUMBNAIL_PATH IMAGE_PATH"/T01_Nocontents_broken.png" + +static char *_strerror_db(int error) +{ + switch(error) + { + case MEDIA_CONTENT_ERROR_INVALID_PARAMETER: + return "Invalid parameter"; + case MEDIA_CONTENT_ERROR_OUT_OF_MEMORY : + return "Out of memory"; + case MEDIA_CONTENT_ERROR_DB_FAILED : + return "DB operation failed"; + default: + { + static char buf[40]; + sprintf(buf, "Error Code=%d", error); + return buf; + } + + } +} + +static void _ivug_mediadata_thumbnail_cb(media_handle media, const char *path, void *data) +{ + MSG_SDATA_ERROR("_ivug_mediadata_thumbnail_cb, path = %s", path); + + Media_Data *mdata = (Media_Data *)data; + + mdata->thumbnail_path = strdup(path); + + ivug_db_cancel_thumbnail(mdata->thumb_handle); + + mdata->thumb_handle = NULL; +} + +Media_Data *ivug_alloc_mediadata_from_media_handle(media_handle media) +{ + IV_ASSERT(media != NULL); + + Media_Data * mdata = NULL; + mdata = (Media_Data *) calloc(1, sizeof(Media_Data)); + if (mdata == NULL) + { + MSG_SDATA_ERROR("Cannot allocate memory"); + return NULL; + } + + media_info_h item = (media_info_h)media; + + int ret = media_info_clone((media_info_h*)&(mdata->m_handle), item); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret)); + goto ALLOC_MHANDLE_ERROR; + } + + char *uuid = NULL; + + ret = media_info_get_media_id(item, &uuid); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret)); + goto ALLOC_MHANDLE_ERROR; + } + mdata->mediaID = uuid_assign(uuid); + free(uuid); + + //file url + ret = media_info_get_file_path(item, &(mdata->fileurl)); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret)); + goto ALLOC_MHANDLE_ERROR; + } + if (mdata->fileurl == NULL) + { + goto ALLOC_MHANDLE_ERROR; + } + + ret = media_info_get_thumbnail_path(item, &(mdata->thumbnail_path)); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret)); + goto ALLOC_MHANDLE_ERROR; + } + if(mdata->thumbnail_path == NULL) + { + MSG_SDATA_ERROR("thumbnail is NULL, request to DB"); + mdata->thumb_handle = ivug_db_create_thumbnail(mdata->m_handle, _ivug_mediadata_thumbnail_cb, (void *)mdata); + } + +#if 0 + // Useless codes because media_info_get_thumbnail_path() never failed. + if(mdata->thumbnail_path == NULL) + { + MSG_SDATA_ERROR("Thumbnail path is NULL"); + mdata->thumbnail_path = strdup(DEFAULT_THUMBNAIL_PATH); + } +#endif + + ret = media_info_is_drm(item, &(mdata->bIsDRMContent)); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret)); + goto ALLOC_MHANDLE_ERROR; + } + + media_content_type_e media_type = 0; + ret = media_info_get_media_type(item, &media_type); + if(ret != MEDIA_CONTENT_ERROR_NONE) + { + MSG_SDATA_ERROR("media_info_foreach_media_from_db is failed, err = %s", _strerror_db(ret)); + goto ALLOC_MHANDLE_ERROR; + } + + if(media_type == MEDIA_CONTENT_TYPE_IMAGE) + { + MSG_SDATA_MED("Local image : %s. %s", uuid_getchar( mdata->mediaID ), mdata->fileurl); + + mdata->slide_type = SLIDE_TYPE_IMAGE; + mdata->filepath = strdup(mdata->fileurl); + } + else if(media_type == MEDIA_CONTENT_TYPE_VIDEO) + { + MSG_SDATA_MED("Local video : %s. %s", uuid_getchar(mdata->mediaID), mdata->fileurl); + + mdata->slide_type = SLIDE_TYPE_VIDEO; + mdata->filepath = strdup(mdata->fileurl); + } + + return mdata; + +ALLOC_MHANDLE_ERROR: + if(mdata) + { + ivug_free_mediadata(mdata); + } + return NULL; +} + +Media_Data *ivug_alloc_mediadata_from_filepath(const char *filepath) +{ + IV_ASSERT(filepath != NULL); + + Media_Data * mdata = NULL; + + media_handle m_handle = ivug_db_get_file_handle(filepath); + if(m_handle) + { + mdata = ivug_alloc_mediadata_from_media_handle(m_handle); + if(mdata != NULL) + { + MSG_SDATA_HIGH("File path founded in DB."); + return mdata; + } + media_info_destroy(m_handle); + } + // Some file does not have media handle ex) USB host, Not inserted in DB yet + + MSG_SDATA_WARN("Cannot find in DB."); + + mdata = (Media_Data *) calloc(1, sizeof(Media_Data)); + if (mdata == NULL) + { + MSG_SDATA_ERROR("Cannot allocate memory"); + return NULL; + } + mdata->mediaID = INVALID_UUID; //copy id WMitem + + if (ivug_drm_is_drm_file(filepath) == EINA_TRUE) + { + mdata->bIsDRMContent = true; + } + char *mime_type = NULL; + mime_type = ivug_fileinfo_get_mime_type(filepath); + if (mime_type == NULL) + { + MSG_SDATA_WARN("file path is not vaild = %s", filepath); + mdata->slide_type = SLIDE_TYPE_UNKNOWN; + mdata->fileurl = NULL; + mdata->filepath = NULL; + return mdata; + } + + Media_Type slide_type = SLIDE_TYPE_NONE; + //image + if (strncmp(mime_type, "image/", strlen("image/")) == 0) + { + slide_type = SLIDE_TYPE_IMAGE; + } + else if (strncmp(mime_type, "video/", strlen("video/")) == 0) + { + slide_type = SLIDE_TYPE_VIDEO; + } + else + { + slide_type = SLIDE_TYPE_NONE; + } + MSG_SDATA_HIGH("File=%s Mime=%s", filepath, mime_type); + free(mime_type); //free strdup + if (slide_type == SLIDE_TYPE_IMAGE) + { + mdata->slide_type = SLIDE_TYPE_IMAGE; + mdata->fileurl = strdup(filepath); + if (mdata->fileurl == NULL) + { + MSG_SDATA_ERROR("strdup return NULL"); + goto ERROR; + } + mdata->filepath = strdup(filepath); + if (mdata->filepath == NULL) + { + MSG_SDATA_ERROR("strdup return NULL"); + free(mdata->fileurl); + goto ERROR; + } + } + else if (slide_type == SLIDE_TYPE_VIDEO) + { + mdata->slide_type = SLIDE_TYPE_VIDEO; + mdata->fileurl = strdup(filepath); + if (mdata->fileurl == NULL) + { + MSG_SDATA_ERROR("strdup return NULL"); + goto ERROR; + } + mdata->filepath = strdup(filepath); + if (mdata->filepath == NULL) + { + MSG_SDATA_ERROR("strdup return NULL"); + free(mdata->fileurl); + goto ERROR; + } + } + else + { + MSG_SDATA_WARN("file path is not vaild = %s", filepath); + mdata->slide_type = SLIDE_TYPE_UNKNOWN; + mdata->fileurl = NULL; + mdata->filepath = NULL; + } + return mdata; +ERROR: + if (mdata) + { + ivug_free_mediadata(mdata); + } + return NULL; +} + + + +Media_Data *ivug_alloc_mediadata_from_url(const char *url) +{ + IV_ASSERT(url != NULL); + + Media_Data * mdata = NULL; + mdata = (Media_Data *) calloc(1, sizeof(Media_Data)); + if (mdata == NULL) + { + MSG_SDATA_ERROR("Cannot allocate memory"); + return NULL; + } + + //file url + mdata->fileurl = strdup(url); + if (mdata->fileurl == NULL) + { + MSG_SDATA_ERROR("strdup return NULL"); + free(mdata); + return NULL; + } + + return mdata; +} + +void ivug_free_mediadata(Media_Data * mdata) +{ + IV_ASSERT(mdata != NULL); + +#ifdef USE_NEW_DB_API + if (mdata->thumb_handle) + { + ivug_db_cancel_thumbnail(mdata->thumb_handle); + mdata->thumb_handle = NULL; + } + + if(mdata->m_handle) + { + media_info_destroy(mdata->m_handle); + mdata->m_handle = NULL; + } +#endif + + uuid_free(mdata->mediaID); + + + //file path + if (mdata->filepath) + { + //IVUG_DEBUG_MSG("filepath =%s", sd->filepath); + free(mdata->filepath); + mdata->filepath = NULL; + } + + //file url + if (mdata->fileurl) + { + MSG_SDATA_MED("Remove media data. %s", mdata->fileurl); + free(mdata->fileurl); + mdata->fileurl = NULL; + } + + if (mdata->thumbnail_path) + { + free(mdata->thumbnail_path); + mdata->thumbnail_path = NULL; + } + + if (mdata->drm_filepath) + { + if ( ivug_remove_file(mdata->drm_filepath) == false) + { + MSG_SDATA_ERROR("Cannot delete drm file : %s", mdata->drm_filepath); + // Go though + } + + free(mdata->drm_filepath); + mdata->drm_filepath = NULL; + } + + free(mdata); +} + +bool ivug_mediadata_set_tag(Media_Data *data, const char *newtag) +{ + ivug_retv_if(!newtag, false); + + MSG_UTIL_HIGH("Add Tag : uuid(%s), tag_name=%s", uuid_getchar(data->mediaID), newtag); + + tag_handle tag; + bool ret = ivug_db_create_tag(&tag, newtag); + if(ret == false) + { + MSG_SDATA_WARN("tag already created"); + tag = ivug_db_get_tag_handle(newtag); + if(tag == NULL) + { + MSG_SDATA_ERROR("ivug_db_get_tag_handle ERROR"); + return false; + } + } + + ret = ivug_db_set_tag(data->m_handle, tag); + if(ret == false) + { + MSG_SDATA_ERROR("ivug_db_set_tag ERROR"); + } + + ivug_db_destroy_tag(tag); + + return ret; +} + +bool ivug_mediadata_set_favorite(Media_Data *data, bool bFavorite) +{ + MSG_UTIL_HIGH("Add Favorite : uuid(%s), bFavorite=%d", uuid_getchar(data->mediaID), bFavorite); + + return ivug_db_set_favorite(data->m_handle, bFavorite); +} + + + +bool ivug_mediadata_delete(Media_Data * mdata) +{ + IV_ASSERT(mdata != NULL); + + if (uuid_is_valid(mdata->mediaID) == true ) + { + int ret = media_info_delete_from_db(mdata->mediaID); + if (ret == MEDIA_CONTENT_ERROR_NONE) + { + if (mdata->filepath) + { + MSG_SDATA_HIGH("File removed. %s", mdata->filepath); + if (ivug_remove_file(mdata->filepath) == false) + { + MSG_SDATA_ERROR("file remove error : %s", mdata->filepath); + } + } + else + { + MSG_SDATA_ERROR("File path is NULL", mdata->filepath); + } + } + else + { + MSG_SDATA_ERROR("media_info_delete_from_db faild=%d uuid=%s file=%s", ret, uuid_getchar(mdata->mediaID), mdata->filepath); + return false; + } + } + else + { + MSG_SDATA_WARN("Invalid UUID. Path=%s", mdata->filepath); + + if (mdata->filepath) + { + MSG_SDATA_HIGH("File removed. %s", mdata->filepath); + + if (ivug_remove_file(mdata->filepath) == false) + { + MSG_SDATA_ERROR("file remove error : %s", mdata->filepath); + } + } + else + { + MSG_SDATA_ERROR("File path is NULL", mdata->filepath); + } + + } + + if (mdata->drm_filepath) + { + if ( ivug_remove_file(mdata->drm_filepath) == false) + { + MSG_SDATA_ERROR("Cannot delete drm file : %s", mdata->drm_filepath); + // Go though + } + } + + return true; +} + + diff --git a/medialist/src/ivug-mediadata.h b/medialist/src/ivug-mediadata.h new file mode 100755 index 0000000..db5b39c --- /dev/null +++ b/medialist/src/ivug-mediadata.h @@ -0,0 +1,58 @@ +/* + * Copyright 2012 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 __IVUG_MEDIADATA_H__ +#define __IVUG_MEDIADATA_H__ + + +#include "ivug-media.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Converting Media_Data from filepath + * @param filepath[in] + * +**/ +Media_Data *ivug_alloc_mediadata_from_filepath(const char* filepath); + + +/** + * Converting WMitem to Media_Data + * @param item[in] + * +**/ + +Media_Data *ivug_alloc_mediadata_from_media_handle(media_handle media); + +Media_Data *ivug_alloc_mediadata_from_url(const char *url); + + +/** + * Free memory used by Media_Data + * @param mdata[in] + * +**/ +void ivug_free_mediadata(Media_Data* mdata); + +#ifdef __cplusplus +} +#endif + +#endif // __IVUG_MEDIADATA_H__ diff --git a/medialist/src/ivug-medialist.c b/medialist/src/ivug-medialist.c new file mode 100755 index 0000000..f3aacd8 --- /dev/null +++ b/medialist/src/ivug-medialist.c @@ -0,0 +1,884 @@ +/* + * Copyright 2012 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 "ivug-define.h" + +#include "ivug-debug.h" +#include "ivug-medialist.h" + +#include "ivug-mediadata.h" + +#include "ivug-data-list.h" + + +#include "ivug-db.h" + +#include + +#undef DEBUG_DUMP_LIST + +#define LOAD_BLOCK_COUNT (100) + +#undef UNIT_TEST +#define UT_USE_DB +#define UT_TOTAL (50) +#define UT_INDEX (49) + +typedef struct { + Eina_List *header; // Start pointer for media list + int count; // Total count + + Ecore_Thread *thread; // Loading thread + Eina_Lock mutex; + Eina_Condition condition; + + Eina_Bool bTerminate; // + + bool bLoading; // Is thread loading on progress? + bool bStarted; // Is thread started? + Filter_struct *filter_str; + + Eina_List *shufflelist; // Shuffle liste + + Ecore_Job *callback_job; + ivug_medialist_cb cb; // loaded callback + void *data; +} _Media_List; + + +typedef struct { + _Media_List *_mList; + Filter_struct *filter_str; + + int center_block; + int max_block; +} ThreadParam; + +typedef enum { + BLOCK_LEFT, + BLOCK_RIGHT, +} BlockType; + +typedef struct { + _Media_List *_mList; + + BlockType direction; + Eina_List *list; +} ThreadMSG; + +static int _get_block_num(int index) +{ + return (index / LOAD_BLOCK_COUNT); +} + +static Eina_List *_load_partial(const Filter_struct *filter, int stp, int endp) +{ + Eina_List *header = NULL; + +#ifdef UT_USE_DB + { + if(filter->selected_list) + { + header = ivug_list_load_DB_items_list(filter, filter->selected_list); + } + else + { + header = ivug_list_load_DB_items(filter, stp, endp); + } + } + +#else + Eina_List *header = NULL; + + int i; + Media_Data *data; + + for (i = stp; i <= endp; i++) + { + data = malloc(sizeof(Media_Data)); + data->index = i; + + header = eina_list_append(header, data); + } +#endif + + MSG_SDATA_HIGH("Loaded : %d ~ %d", stp, endp); + + return header; +} + +static Eina_List *_load_block(const Filter_struct *filter, int block_num) +{ + int stp = block_num * LOAD_BLOCK_COUNT; + int endp = ((block_num + 1) * LOAD_BLOCK_COUNT) - 1; + + Eina_List *header = _load_partial(filter, stp, endp); + + MSG_SDATA_HIGH("Loaded block : %d", block_num); + + return header; +} + +static void _job_send_cb(void *data) +{ + IV_ASSERT(data != NULL); + + _Media_List *_mList = (_Media_List *)data; + if(_mList->cb) + { + _mList->cb(_mList, _mList->data); + } +} + +static void _call_loaded_callback(_Media_List *_mList) +{ + IV_ASSERT(_mList != NULL); + + if(_mList->callback_job) + ecore_job_del(_mList->callback_job); + + _mList->callback_job = ecore_job_add(_job_send_cb, _mList); +} + +static void _doLoad(Ecore_Thread *thread, _Media_List *_mList, const Filter_struct *filter, int center, int max_block) +{ + bool bRightEnd = false; + bool bLeftEnd = false; + int iter = 1; + + Eina_List *left; + Eina_List *right; + + while((bLeftEnd && bRightEnd) == false) + { + if ( center + iter <= max_block ) + { + right = _load_block(filter, center + iter); + +#if 0 + if ( ecore_thread_check(thread) == EINA_TRUE ) + { + MSG_SDATA_HIGH("Check True"); + ivug_list_delete_items(right); + break; + } +#else + if ( _mList->bTerminate == EINA_TRUE ) + { + MSG_SDATA_HIGH("Check True"); + ivug_list_delete_items(right); + return; + } +#endif + IV_ASSERT(right != NULL); + _mList->header = eina_list_merge (_mList->header, right); + } + else + { + bRightEnd = true; + } + + if ( center - iter >= 0) + { + left = _load_block(filter , center - iter); + +#if 0 + if ( ecore_thread_check(thread) == EINA_TRUE ) + { + MSG_SDATA_HIGH("Check True"); + ivug_list_delete_items(left); + break; + } +#else + if ( _mList->bTerminate == EINA_TRUE ) + { + MSG_SDATA_HIGH("Check True"); + ivug_list_delete_items(left); + return; + } +#endif + IV_ASSERT(left != NULL); + + _mList->header = eina_list_merge (left, _mList->header); + + } + else + { + bLeftEnd = true; + } + + iter++; + usleep(100); + } + + MSG_SDATA_HIGH("EinaCount=%d Count=%d", eina_list_count(_mList->header), _mList->count); +} + + +static void loader_heavy(void *data, Ecore_Thread *thread) +{ + MSG_SDATA_HIGH("Thread started. tID=0x%08x", thread); + ThreadParam *pParam = data; + +#if 0 + if ( ecore_thread_check(thread) == EINA_TRUE ) + { + MSG_SDATA_HIGH("Check True"); + return; + } +#else + + if ( pParam->_mList->bTerminate == EINA_TRUE ) + { + MSG_SDATA_HIGH("Check True"); + return; + } +#endif + + Eina_Bool ret = EINA_FALSE; + + ret = eina_lock_new(&pParam->_mList->mutex); + if(ret == EINA_FALSE) + { + MSG_SDATA_FATAL("eina_lock_new failed"); + } + else + { + ret = eina_condition_new(&pParam->_mList->condition, &pParam->_mList->mutex); + if(ret == EINA_FALSE) + { + MSG_SDATA_FATAL("eina_condition_new failed"); + } + } + + pParam->_mList->bStarted = true; + + MSG_SDATA_HIGH("Load : Begin"); + + _doLoad(thread, pParam->_mList, pParam->filter_str, pParam->center_block, pParam->max_block); + + MSG_SDATA_HIGH("Load : End"); + + pParam->_mList->thread = NULL; + + eina_lock_take(&pParam->_mList->mutex); + eina_condition_signal(&pParam->_mList->condition); + eina_lock_release(&pParam->_mList->mutex); +} + + +static void loader_end(void *data, Ecore_Thread *thread) +{ + ThreadParam *pParam = data; + + // MSG_SDATA_HIGH("Thread Ended. EinaCount=%d Count=%d", eina_list_count(pParam->_mList), pParam->_mList->count); + MSG_SDATA_HIGH("Thread Ended. tID=0x%08x", thread); + + PERF_CHECK_END(LVL3, "Deffered loading"); + + ivug_data_filter_delete(pParam->filter_str); + + _call_loaded_callback(pParam->_mList); +} + +static void loader_cancel(void *data, Ecore_Thread *thread) +{ + ThreadParam *pParam = data; + + MSG_SDATA_HIGH("Thread canceled. tID=0x%08x", thread); + + PERF_CHECK_END(LVL3, "Deffered loading"); + + ivug_data_filter_delete(pParam->filter_str); +} + +static int _sort_cb(const void *d1, const void *d2) +{ + return (rand() % 4 - 2) ; +} + +static Media_Item *_find_item(Media_List *mList, int index) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + Eina_List *l; + Media_Data *data; + + EINA_LIST_FOREACH(_mList->header, l, data) + { + if ( data->index == index) + { + return (Media_Item *)l; + } + } + + return NULL; +} + + +#ifdef DEBUG_DUMP_LIST +static void _print_shuffle(void *data) +{ + MSG_SDATA_HIGH("Item : %d", (int)data); +} + +static void _dump_list(Eina_List *list, void (*func)(void *)) +{ + Eina_List *l; + void *data; + + EINA_LIST_FOREACH(list, l, data) + { + func(data); + } + +} +#endif + +static void _create_shuffle_list(_Media_List *_mList) +{ + int i; + _mList->shufflelist = NULL; + for ( i = 0; i < _mList->count; i++) + { + _mList->shufflelist = eina_list_append(_mList->shufflelist, (void *)i); + } + + _mList->shufflelist = eina_list_sort(_mList->shufflelist, eina_list_count(_mList->shufflelist), _sort_cb); +} + +Media_List *ivug_medialist_create() +{ + _Media_List *_mList = calloc(1, sizeof(_Media_List)); + IV_ASSERT(_mList != NULL); + + srand((unsigned)time(NULL)); + + MSG_SDATA_HIGH("Create media list : 0x%08x", _mList); + + return (Media_List *)_mList; +} + +bool ivug_medialist_set_callback(Media_List *mList, ivug_medialist_cb callback, void *data) +{ + IV_ASSERT(mList != NULL); + + _Media_List *_mList = (_Media_List *)mList; + _mList->cb = callback; + _mList->data = data; + + return true; +} + +Media_Item * ivug_medialist_find_item_by_filename(Media_List *mList, const char* filepath) +{ + IV_ASSERT(mList != NULL); + IV_ASSERT(filepath != NULL); + _Media_List *_mList = (_Media_List *)mList; + + Eina_List *l; + Media_Data *data; + + EINA_LIST_FOREACH(_mList->header, l, data) + { + if(strncmp(data->fileurl, filepath, strlen(data->fileurl)) == 0) + { + return (Media_Item *)l; + } + } + MSG_SDATA_ERROR("Cannot find file path %s at list", filepath); + return NULL; +} + + +Media_Item *ivug_medialist_load(Media_List *mList, const Filter_struct *filter) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + MSG_SDATA_HIGH("Create slide data list. index=%d", filter->index); + + if ( _mList->header != NULL ) + { + MSG_SDATA_FATAL("Header is not NULL"); + return NULL; + } +// _mList->filter = ivug_data_filter_copy(filter); + + int db_idx = 0; + +#ifdef UNIT_TEST + _mList->count = UT_TOTAL; + db_idx = UT_INDEX; + +#else + PERF_CHECK_BEGIN(LVL3, "MediaList - Get list count"); + if(filter->view_by == IVUG_VIEW_BY_DIRECTORY) + { + _mList->count = ivug_list_get_dir_cnt(filter->dir_filter->basedir); + + if ( _mList->count == 0 ) + { + MSG_SDATA_ERROR("No file founded"); + return NULL; + } + + _mList->header = ivug_list_load_dir_items(filter->dir_filter->basedir); + +// Find Current. + Eina_List *l = NULL; + void *data; + + EINA_LIST_FOREACH(_mList->header, l, data) + { + Media_Data *pData = data; + + if (strcmp(pData->fileurl, filter->dir_filter->current) == 0) + { + return (Media_Item *)l; + } + } + + MSG_SDATA_ERROR("Not found current"); + return NULL; + } + else if(filter->view_by == IVUG_VIEW_BY_FOLDER && filter->index == IVUG_INVALID_INDEX) + { + _mList->count = ivug_list_get_item_cnt(filter); + if ( _mList->count == 0 ) + { + MSG_SDATA_ERROR("No file founded"); + return NULL; + } + PERF_CHECK_BEGIN(LVL3, "MediaList - load all block"); + _mList->header = _load_partial(filter, 0, _mList->count-1); // Load all + PERF_CHECK_END(LVL3, "MediaList - load all block"); + if(_mList->header == NULL) + { + MSG_SDATA_ERROR("MediaList is NULL"); + return NULL; + } + MSG_SDATA_HIGH("%d items loaded", eina_list_count(_mList->header)); + _create_shuffle_list(_mList); + Media_Item *cur = ivug_medialist_find_item_by_filename(mList, filter->filepath); + _call_loaded_callback(_mList); + return cur; + } + else + { + _mList->count = ivug_list_get_item_cnt(filter); + } + + PERF_CHECK_END(LVL3, "MediaList - Get list count"); + + MSG_SDATA_HIGH("Total item count=%d", _mList->count); + db_idx = filter->index - 1; +#endif + + if ( _mList->count < db_idx) + { + MSG_SDATA_ERROR("Invalid param"); + return NULL; + } + + int block_num = _get_block_num(db_idx); + int block_max = _get_block_num(_mList->count - 1); + + MSG_SDATA_HIGH("Total=%d Current=%d Block Count=%d", _mList->count, db_idx, block_max); + + PERF_CHECK_BEGIN(LVL3, "MediaList - load first block"); + + // Load Center + _mList->header = _load_block(filter, block_num); // Load current block + + PERF_CHECK_END(LVL3, "MediaList - load first block"); + + if(_mList->header == NULL) + { + //MSG_SDATA_FATAL("MediaList is NULL"); + MSG_SDATA_ERROR("MediaList is NULL"); + return NULL; + } + +// find current data; + MSG_SDATA_HIGH("Header=0x%08x Current nTh=%d", _mList->header, db_idx - (block_num * LOAD_BLOCK_COUNT)); + + PERF_CHECK_BEGIN(LVL3, "MediaList - Find current"); + + Eina_List *current = eina_list_nth_list(_mList->header, db_idx - (block_num * LOAD_BLOCK_COUNT)); + + PERF_CHECK_END(LVL3, "MediaList - Find current"); + + if(current == NULL) + { + MSG_SDATA_HIGH("current is NULL"); + return NULL; + } + + PERF_CHECK_BEGIN(LVL3, "MediaList - shuffle"); + + _create_shuffle_list(_mList); + + PERF_CHECK_END(LVL3, "MediaList - shuffle"); + + // _dump_list(_mList->shufflelist, _print_shuffle); + // MSG_SDATA_HIGH("ParamPath=%s CurrentPath=%s", param->filepath, _mList->current->filepath); + + if ( block_max == 0 && eina_list_count(_mList->header) < LOAD_BLOCK_COUNT ) + { + MSG_SDATA_HIGH("Deffered loading is not needed. BolckMax=%d FirstBlockCount=%d", block_max, eina_list_count(_mList->header)); + _call_loaded_callback(_mList); + return (Media_Item *)current; + } + + ThreadParam *pParam = NULL; + + pParam = malloc(sizeof(ThreadParam)); + + pParam->filter_str = ivug_data_filter_copy(filter); + pParam->_mList = _mList; + pParam->center_block = block_num; + pParam->max_block = block_max; + + _mList->bLoading = true; + + MSG_SDATA_HIGH("Starting thread"); + + PERF_CHECK_BEGIN(LVL3, "Deffered loading"); + + _mList->thread = ecore_thread_run(loader_heavy, loader_end, loader_cancel, pParam); + MSG_SDATA_HIGH("Thread ID= 0x%08x", _mList->thread); + MSG_SDATA_HIGH("Create slide data list END"); + + return (Media_Item *)current; +} + + +void +ivug_medialist_del(Media_List *mList) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + Eina_Bool ret = EINA_FALSE; + + MSG_SDATA_HIGH("Removing all media data"); + + if(_mList->callback_job) + { + ecore_job_del(_mList->callback_job); + } + + if ( _mList->thread ) + { + MSG_SDATA_HIGH("1. Thread cancel"); +#if 0 + if ( ecore_thread_cancel(_mList->thread) == EINA_TRUE ) + { + MSG_SDATA_HIGH("Thread canceled"); + } +#endif + _mList->bTerminate = EINA_TRUE; + + if(_mList->bStarted) + { + ret = eina_condition_wait(&_mList->condition); + if(ret == EINA_FALSE) + { + MSG_SDATA_ERROR("eina_condition_wait error"); + } + ret = eina_lock_release(&_mList->mutex); + if(ret == EINA_FALSE) + { + MSG_SDATA_ERROR("eina_lock_release error"); + } + eina_condition_free(&_mList->condition); + eina_lock_free(&_mList->mutex); + } + + _mList->thread = NULL; + MSG_SDATA_HIGH("2. Thread cancel"); + } + + ivug_list_delete_items(_mList->header); + _mList->header = NULL; + + eina_list_free(_mList->shufflelist); + _mList->shufflelist = NULL; + + _mList->bStarted = false; + + free(_mList); + +} + + +int ivug_medialist_get_count(Media_List *mList) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + return _mList->count; +} + +int ivug_medialist_get_index(Media_List *mList, Media_Item *item) +{ + IV_ASSERT(mList != NULL); + + Media_Data *pData; + + MSG_SDATA_HIGH("Loading is not finished"); + pData = (Media_Data *)eina_list_data_get((Eina_List *)item); + + return pData->index + 1; + + +#if 0 + PERF_CHECK_BEGIN("Get Index"); + + for (tmp = _mList->header, i= 0; tmp != NULL ; tmp = eina_list_next(tmp), i++) + { + if ( item == tmp ) + { + PERF_CHECK_END("Get Index"); + return i+1; // This index starts from 1 + } + } + + PERF_CHECK_END("Get Index"); + + + return 0; // Cannot find. +#endif + +} + +Media_Item *ivug_medialist_get_first(Media_List *mList) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + return (Media_Item *)_mList->header; +} + + +Media_Item *ivug_medialist_get_last(Media_List *mList) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + return (Media_Item *)eina_list_last(_mList->header); +} + +Media_Item *ivug_medialist_get_next(Media_List *mList, Media_Item *item) +{ + IV_ASSERT(mList != NULL); + + IV_ASSERT(item != NULL); + Eina_List *next = eina_list_next((Eina_List *)item); + + return (Media_Item *)next; +} + + +Media_Item *ivug_medialist_get_prev(Media_List *mList, Media_Item *item) +{ + IV_ASSERT(mList != NULL); + + IV_ASSERT(item != NULL); + Eina_List *prev = eina_list_prev((Eina_List *)item); + + return (Media_Item *)prev; + +} + +Media_Data *ivug_medialist_get_data(const Media_Item *item) +{ + IV_ASSERT(item != NULL); + + return (Media_Data *)eina_list_data_get((Eina_List *)item); +} + + +void ivug_medialist_delete_item(Media_List *mList, Media_Item *item) +{ + PERF_CHECK_BEGIN(LVL1, "MediaList - delete"); + + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + Media_Data *pData = (Media_Data *)eina_list_data_get((Eina_List *)item); + + Eina_List *list = eina_list_next((Eina_List *)item); + Eina_List *l; + Media_Data *data; + + EINA_LIST_FOREACH(list, l, data) + { + data->index = data->index - 1; + } + + _mList->header = eina_list_remove_list(_mList->header, (Eina_List *)item); + + // Change index + if ( ivug_mediadata_delete(pData) == false ) + { + MSG_SDATA_HIGH("Cannot delete mediadata"); + } + ivug_free_mediadata(pData); + + // Shuffle list? + _mList->count--; + + Eina_List *found = eina_list_data_find_list(_mList->shufflelist, (void *)_mList->count); + + _mList->shufflelist = eina_list_remove(_mList->shufflelist, found); + + MSG_SDATA_HIGH("Item removed. Total=%d", _mList->count); + + PERF_CHECK_END(LVL1, "MediaList - delete"); +} + + +Media_Item *ivug_medialist_get_random_item(Media_List *mList) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + int count = eina_list_count(_mList->header); + + return (Media_Item *)eina_list_nth_list(_mList->header, random() % count); +} + +Media_Item *ivug_medialist_get_shuffle_item(Media_List *mList, Media_Item *item) +{ + IV_ASSERT(mList != NULL); + _Media_List *_mList = (_Media_List *)mList; + + Media_Data *pData = (Media_Data *)eina_list_data_get((Eina_List *)item); + + Eina_List *found = eina_list_data_find_list(_mList->shufflelist, (void *)pData->index); + + if ( found != NULL ) + { + Media_Item *next; + Eina_List *iter; + + iter = eina_list_next(found); + + if ( iter == NULL ) + { + int nFirstIdx = (int)eina_list_data_get(_mList->shufflelist); + + next = _find_item(mList, nFirstIdx); + + MSG_SDATA_HIGH("End reached. rewind to first. Index=%d", nFirstIdx); + + return next; + } + + do { + next = _find_item(mList, (int)eina_list_data_get(iter)); + + if ( next == NULL ) + { + MSG_SDATA_HIGH("Index : %d is not loaded", (int)eina_list_data_get(iter)); + _mList->shufflelist = eina_list_demote_list(_mList->shufflelist, iter); + } + + iter = eina_list_next(found); + + } while(next == NULL); + + Media_Data *nData = (Media_Data *)eina_list_data_get((Eina_List *)next); + + MSG_SDATA_HIGH("Shuffle : %d->%d", pData->index, nData->index ); + +// _dump_list(_mList->shufflelist, _print_shuffle); + return next; + } + + MSG_SDATA_ERROR("Cannot find data. Index=%d", pData->index); + return NULL; +} + +Media_Item * +ivug_medialist_find_item_by_index(Media_List *mList, int index) +{ + IV_ASSERT(mList != NULL); + + _Media_List *_mList = (_Media_List *)mList; + + Media_Data *current = NULL; + Eina_List *l = NULL; + + EINA_LIST_FOREACH(_mList->header, l, current) + { + if(current == NULL) + { + MSG_IVUG_ERROR("album list is NULL"); + break; + } + if(current->index == index) + { + return (Media_Item *)l; + } + } + return NULL; +} + +Media_Item * ivug_medialist_append_item(Media_List *mList, const char *filepath) +{ + IV_ASSERT(mList != NULL); + + _Media_List *_mList = (_Media_List *)mList; + + _mList->header = ivug_list_append_item(_mList->header, filepath); + + _mList->count++; + + int index = 0; + Eina_List *l; + Media_Data *data; + EINA_LIST_FOREACH(_mList->header, l, data) + { + data->index = index++; + } + + return (Media_Item *)eina_list_last(_mList->header); +} + +Media_Item * ivug_medialist_prepend_item(Media_List *mList, const char *filepath) +{ + IV_ASSERT(mList != NULL); + + _Media_List *_mList = (_Media_List *)mList; + + _mList->header = ivug_list_prepend_item(_mList->header, filepath); + + _mList->count++; + + int index = 0; + Eina_List *l; + Media_Data *data; + EINA_LIST_FOREACH(_mList->header, l, data) + { + data->index = index++; + } + + return (Media_Item *)_mList->header; +} + diff --git a/packaging/changelog b/packaging/changelog new file mode 100644 index 0000000..511b1f8 --- /dev/null +++ b/packaging/changelog @@ -0,0 +1,3437 @@ +ug-image-viewer-efl (1.6.81) + + * update version + * Tag: ug-image-viewer-efl_1.6.81 + +ug-image-viewer-efl (1.6.80) + + * update version + * Tag: ug-image-viewer-efl_1.6.80 + +ug-image-viewer-efl (1.6.79) + + * update version + * Tag: ug-image-viewer-efl_1.6.79 + +ug-image-viewer-efl (1.6.78) + + * update version + * Tag: ug-image-viewer-efl_1.6.78 + +ug-image-viewer-efl (1.6.77) + + * update version + * Tag: ug-image-viewer-efl_1.6.77 + +ug-image-viewer-efl (1.6.75) + + * modify water ripple + * Tag: ug-image-viewer-efl_1.6.75 + +ug-image-viewer-efl (1.6.74) + + * fix build error + * Tag: ug-image-viewer-efl_1.6.74 + +ug-image-viewer-efl (1.6.73) + + * update version + * Tag: ug-image-viewer-efl_1.6.73 + +ug-image-viewer-efl (1.6.72) + + * fix PLM issue + * Tag: ug-image-viewer-efl_1.6.72 + +ug-image-viewer-efl (1.6.71) + + * update version + * Tag: ug-image-viewer-efl_1.6.71 + +ug-image-viewer-efl (1.6.70) + + * update version + * Tag: ug-image-viewer-efl_1.6.70 + +ug-image-viewer-efl (1.6.69) + + * show popup when invalid path + * Tag: ug-image-viewer-efl_1.6.69 + +ug-image-viewer-efl (1.6.68) + + * fix buddy photo share bug + * Tag: ug-image-viewer-efl_1.6.68 + +ug-image-viewer-efl (1.6.67) + + * fix slide show + * Tag: ug-image-viewer-efl_1.6.67 + +ug-image-viewer-efl (1.6.65) + + * fix bs at crop, buddy photo share + * Tag: ug-image-viewer-efl_1.6.65 + +ug-image-viewer-efl (1.6.62) + + * update + * Tag: ug-image-viewer-efl_1.6.62 + +ug-image-viewer-efl (1.6.60) + + * fix image remain problem + * Tag: ug-image-viewer-efl_1.6.60 + +ug-image-viewer-efl (1.6.59) unstable; urgency=low + + * fix bs at async face api + * Tag: ug-image-viewer-efl_1.6.59 + +ug-image-viewer-efl (1.6.58) unstable; urgency=low + + * fix bs at async face api + * Tag: ug-image-viewer-efl_1.6.58 + +ug-image-viewer-efl (1.6.57) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.57 + +ug-image-viewer-efl (1.6.56) unstable; urgency=low + + * fix slideshow effect + * Tag: ug-image-viewer-efl_1.6.56 + +ug-image-viewer-efl (1.6.55) unstable; urgency=low + + * fix bug, crop view + * Tag: ug-image-viewer-efl_1.6.55 + +ug-image-viewer-efl (1.6.54) unstable; urgency=low + + * fix bs + * Tag: ug-image-viewer-efl_1.6.54 + +ug-image-viewer-efl (1.6.53) unstable; urgency=low + + * appsvc -> appcontrol + * Tag: ug-image-viewer-efl_1.6.53 + +ug-image-viewer-efl (1.6.52) unstable; urgency=low + + * fix face svc api + * Tag: ug-image-viewer-efl_1.6.52 + +ug-image-viewer-efl (1.6.51) unstable; urgency=low + + * fix webalbum bs at crop view + * Tag: ug-image-viewer-efl_1.6.51 + +ug-image-viewer-efl (1.6.49) unstable; urgency=low + + * fix bs at crop view + * Tag: ug-image-viewer-efl_1.6.49 + +ug-image-viewer-efl (1.6.48) unstable; urgency=low + + * fix bs at crop view + * Tag: ug-image-viewer-efl_1.6.48 + +ug-image-viewer-efl (1.6.47) unstable; urgency=low + + * fix dali build break + * Tag: ug-image-viewer-efl_1.6.47 + +ug-image-viewer-efl (1.6.46) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.46 + +ug-image-viewer-efl (1.6.45) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.45 + +ug-image-viewer-efl (1.6.44) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.44 + +ug-image-viewer-efl (1.6.43) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.43 + +ug-image-viewer-efl (1.6.42) unstable; urgency=low + + * apply bestphoto, view by folder + * Tag: ug-image-viewer-efl_1.6.42 + +ug-image-viewer-efl (1.6.41) unstable; urgency=low + + * update changelog + * Tag: ug-image-viewer-efl_1.6.41 + +ug-image-viewer-efl (1.6.40) unstable; urgency=low + + * delay resize callback + * Tag: ug-image-viewer-efl_1.6.40 + +ug-image-viewer-efl (1.6.39) unstable; urgency=low + + * change vibrate api + * Tag: ug-image-viewer-efl_1.6.39 + +ug-image-viewer-efl (1.6.38) unstable; urgency=low + + * change web api parameter + * Tag: ug-image-viewer-efl_1.6.38 + +ug-image-viewer-efl (1.6.37) unstable; urgency=low + + * fix build option + * Tag: ug-image-viewer-efl_1.6.37 + +ug-image-viewer-efl (1.6.36) unstable; urgency=low + + * add rename icon to list + * Tag: ug-image-viewer-efl_1.6.36 + +ug-image-viewer-efl (1.6.35) unstable; urgency=low + + * fix double tap, longpress bug + * Tag: ug-image-viewer-efl_1.6.35 + +ug-image-viewer-efl (1.6.34) unstable; urgency=low + + * fix desktop mode GUI + * Tag: ug-image-viewer-efl_1.6.34 + + -- root Mon, 06 Aug 2012 16:44:48 +0900 + +ug-image-viewer-efl (1.6.33) unstable; urgency=low + + * fix build error + * Tag: ug-image-viewer-efl_1.6.33 + + -- root Mon, 06 Aug 2012 11:55:17 +0900 + +ug-image-viewer-efl (1.6.32) unstable; urgency=low + + * fix web downloader api + * Tag: ug-image-viewer-efl_1.6.32 + + -- root Mon, 06 Aug 2012 10:55:28 +0900 + +ug-image-viewer-efl (1.6.31) unstable; urgency=low + + * fix cropbox bound bug + * Tag: ug-image-viewer-efl_1.6.31 + + -- root Sat, 04 Aug 2012 11:39:00 +0900 + +ug-image-viewer-efl (1.6.30) unstable; urgency=low + + * fix setas control bar + * Tag: ug-image-viewer-efl_1.6.30 + + -- root Fri, 03 Aug 2012 10:40:17 +0900 + +ug-image-viewer-efl (1.6.29) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.29 + + -- root Wed, 01 Aug 2012 20:06:32 +0900 + +ug-image-viewer-efl (1.6.28) unstable; urgency=low + + * change face dependency + * Tag: ug-image-viewer-efl_1.6.28 + + -- root Wed, 01 Aug 2012 14:36:29 +0900 + +ug-image-viewer-efl (1.6.27) unstable; urgency=low + + * apply manifest + * Tag: ug-image-viewer-efl_1.6.27 + + -- root Tue, 31 Jul 2012 19:23:26 +0900 + +ug-image-viewer-efl (1.6.26) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.26 + + -- root Mon, 30 Jul 2012 09:43:41 +0900 + +ug-image-viewer-efl (1.6.25) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.25 + + -- root Sat, 28 Jul 2012 16:39:40 +0900 + +ug-image-viewer-efl (1.6.24) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.24 + + -- root Sat, 28 Jul 2012 13:32:23 +0900 + +ug-image-viewer-efl (1.6.23) unstable; urgency=low + + * fix crop BS + * Tag: ug-image-viewer-efl_1.6.23 + + -- root Fri, 27 Jul 2012 17:17:46 +0900 + +ug-image-viewer-efl (1.6.22) unstable; urgency=low + + * rename player handle + * Tag: ug-image-viewer-efl_1.6.22 + + -- root Fri, 27 Jul 2012 15:49:06 +0900 + +ug-image-viewer-efl (1.6.21) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.21 + + -- root Fri, 27 Jul 2012 14:21:01 +0900 + +ug-image-viewer-efl (1.6.20) unstable; urgency=low + + * fix emulater BS + * Tag: ug-image-viewer-efl_1.6.20 + + -- root Fri, 27 Jul 2012 14:05:31 +0900 + +ug-image-viewer-efl (1.6.19) unstable; urgency=low + + * fix camera folder path, motion popup text color + * Tag: ug-image-viewer-efl_1.6.19 + + -- root Thu, 26 Jul 2012 19:59:08 +0900 + +ug-image-viewer-efl (1.6.18) unstable; urgency=low + + * fix BS when crop failed + * Tag: ug-image-viewer-efl_1.6.18 + + -- root Thu, 26 Jul 2012 11:22:14 +0900 + +ug-image-viewer-efl (1.6.17) unstable; urgency=low + + * apply white theme + * Tag: ug-image-viewer-efl_1.6.17 + + -- root Thu, 26 Jul 2012 09:26:53 +0900 + +ug-image-viewer-efl (1.6.16) unstable; urgency=low + + * change api + * Tag: ug-image-viewer-efl_1.6.16 + + -- root Wed, 25 Jul 2012 13:26:03 +0900 + +ug-image-viewer-efl (1.6.15) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.15 + + -- root Mon, 23 Jul 2012 21:24:32 +0900 + +ug-image-viewer-efl (1.6.14) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.14 + + -- root Mon, 23 Jul 2012 17:03:57 +0900 + +ug-image-viewer-efl (1.6.13) unstable; urgency=low + + * fix BS + * Tag: ug-image-viewer-efl_1.6.13 + + -- root Mon, 23 Jul 2012 14:57:46 +0900 + +ug-image-viewer-efl (1.6.12) unstable; urgency=low + + * update version + * Tag: ug-image-viewer-efl_1.6.12 + + -- root Fri, 20 Jul 2012 15:51:05 +0900 + +ug-image-viewer-efl (1.6.11) unstable; urgency=low + + * apply motion zoom + * Tag: ug-image-viewer-efl_1.6.11 + + -- root Fri, 20 Jul 2012 15:16:09 +0900 + +ug-image-viewer-efl (1.6.10) unstable; urgency=low + + * apply managed UG api. + * Tag: ug-image-viewer-efl_1.6.10 + + -- root Wed, 18 Jul 2012 19:29:52 +0900 + +ug-image-viewer-efl (1.6.9) unstable; urgency=low + + * fix build error + * Tag: ug-image-viewer-efl_1.6.9 + + -- root Tue, 17 Jul 2012 18:34:39 +0900 + +ug-image-viewer-efl (1.6.8) unstable; urgency=low + + * fix slide show BS + * Tag: ug-image-viewer-efl_1.6.8 + + -- root Tue, 17 Jul 2012 18:16:06 +0900 + +ug-image-viewer-efl (1.6.7) unstable; urgency=low + + * update image viewer + * Tag: ug-image-viewer-efl_1.6.7 + + -- root Mon, 16 Jul 2012 16:22:35 +0900 + +ug-image-viewer-efl (1.6.6) unstable; urgency=low + + * apply video call id + * Tag: ug-image-viewer-efl_1.6.6 + + -- root Mon, 16 Jul 2012 11:57:58 +0900 + +ug-image-viewer-efl (1.6.5) unstable; urgency=low + + * fix crop box style, phone ug name + * Tag: ug-image-viewer-efl_1.6.5 + + -- root Fri, 13 Jul 2012 14:43:26 +0900 + +ug-image-viewer-efl (1.6.3) unstable; urgency=low + + * fix bs when delete item + * Tag: ug-image-viewer-efl_1.6.3 + + -- root Thu, 12 Jul 2012 19:20:07 +0900 + +ug-image-viewer-efl (1.6.2) unstable; urgency=low + + * fix bs + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.6.2 + + -- Jisung Ahn Wed, 11 Jul 2012 17:10:47 +0900 + +ug-image-viewer-efl (1.6.1) unstable; urgency=low + + * fix slideshow bs, hide menu at setas + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.6.1 + + -- Jisung Ahn Tue, 10 Jul 2012 18:42:34 +0900 + +ug-image-viewer-efl (1.6.0) unstable; urgency=low + + * apply new DB api + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.6.0 + + -- Jisung Ahn Thu, 05 Jul 2012 10:33:11 +0900 + +ug-image-viewer-efl (1.5.19) unstable; urgency=low + + * fix bug, launch speed + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.19 + + -- Jisung Ahn Fri, 06 Jul 2012 17:39:24 +0900 + +ug-image-viewer-efl (1.5.18) unstable; urgency=low + + * fix bundle bug + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.18 + + -- Jisung Ahn Wed, 04 Jul 2012 15:39:55 +0900 + +ug-image-viewer-efl (1.5.17) unstable; urgency=low + + * show popup at save fail + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.17 + + -- Jisung Ahn Tue, 03 Jul 2012 21:23:44 +0900 + +ug-image-viewer-efl (1.5.16) unstable; urgency=low + + * fix bug, fix GUI + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.16 + + -- Jisung Ahn Mon, 02 Jul 2012 20:29:25 +0900 + +ug-image-viewer-efl (1.5.15) unstable; urgency=low + + * enable face method, apply blue theme + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.15 + + -- Jisung Ahn Fri, 29 Jun 2012 20:28:10 +0900 + +ug-image-viewer-efl (1.5.14) unstable; urgency=low + + * enable allshare + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.14 + + -- Jisung Ahn Wed, 27 Jun 2012 19:30:33 +0900 + +ug-image-viewer-efl (1.5.13) unstable; urgency=low + + * apply face tag + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.13 + + -- Jisung Ahn Mon, 25 Jun 2012 21:10:37 +0900 + +ug-image-viewer-efl (1.5.12) unstable; urgency=low + + * fix set as GUI + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.12 + + -- Jisung Ahn Mon, 18 Jun 2012 10:35:45 +0900 + +ug-image-viewer-efl (1.5.11) unstable; urgency=low + + * Fix B/S when set wallpaper + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.11 + + -- Jisung Ahn Wed, 13 Jun 2012 13:27:27 +0900 + +ug-image-viewer-efl (1.5.10) unstable; urgency=low + + * remove mss + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.10 + + -- Jisung Ahn Mon, 11 Jun 2012 17:52:04 +0900 + +ug-image-viewer-efl (1.5.9) unstable; urgency=low + + * check drm at file set + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.9 + + -- Jisung Ahn Thu, 07 Jun 2012 19:11:45 +0900 + +ug-image-viewer-efl (1.5.8) unstable; urgency=low + + * fix error, apply asf(disabled) + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.8 + + -- Jisung Ahn Thu, 07 Jun 2012 10:05:15 +0900 + +ug-image-viewer-efl (1.5.7) unstable; urgency=low + + * fix ux feedback + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.7 + + -- Jisung Ahn Mon, 04 Jun 2012 17:36:31 +0900 + +ug-image-viewer-efl (1.5.6) unstable; urgency=low + + * update slideshow + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.6 + + -- Jisung Ahn Mon, 04 Jun 2012 11:04:51 +0900 + +ug-image-viewer-efl (1.5.5) unstable; urgency=low + + * fix rotate reset bs at invalid file + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.5 + + -- Jisung Ahn Tue, 29 May 2012 10:41:25 +0900 + +ug-image-viewer-efl (1.5.4) unstable; urgency=low + + * apply rotate function + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.4 + + -- Jisung Ahn Fri, 25 May 2012 19:30:31 +0900 + +ug-image-viewer-efl (1.5.3) unstable; urgency=low + + * update drm, fix bug + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.3 + + -- Jisung Ahn Fri, 25 May 2012 10:28:04 +0900 + +ug-image-viewer-efl (1.5.2) unstable; urgency=low + + * update slide show effect + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.2 + + -- Jisung Ahn Wed, 23 May 2012 15:22:11 +0900 + +ug-image-viewer-efl (1.5.1) unstable; urgency=low + + * apply copy popup + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.1 + + -- Jisung Ahn Mon, 21 May 2012 10:32:32 +0900 + +ug-image-viewer-efl (1.5.0) unstable; urgency=low + + * Add thumblist. Implement scroller. + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.5.0 + + -- Jisung Ahn Wed, 16 May 2012 10:50:02 +0900 + +ug-image-viewer-efl (1.4.47) unstable; urgency=low + + * enable done btn + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.47 + + -- Jisung Ahn Tue, 15 May 2012 17:17:55 +0900 + +ug-image-viewer-efl (1.4.46) unstable; urgency=low + + * fix slide show bug + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.46 + + -- Jisung Ahn Mon, 14 May 2012 16:31:10 +0900 + +ug-image-viewer-efl (1.4.45) unstable; urgency=low + + * fix bug + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.45 + + -- Jisung Ahn Mon, 14 May 2012 11:41:37 +0900 + +ug-image-viewer-efl (1.4.44) unstable; urgency=low + + * update version + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.44 + + -- Jisung Ahn Tue, 08 May 2012 14:35:32 +0900 + +ug-image-viewer-efl (1.4.43) unstable; urgency=low + + * apply motion panning, tool button + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.43 + + -- Jisung Ahn Mon, 07 May 2012 10:59:40 +0900 + +ug-image-viewer-efl (1.4.42) unstable; urgency=low + + * fix string + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.42 + + -- Jisung Ahn Thu, 03 May 2012 12:06:51 +0900 + +ug-image-viewer-efl (1.4.41) unstable; urgency=low + + * remove useless code + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.41 + + -- Jisung Ahn Fri, 13 Apr 2012 11:35:33 +0900 + +ug-image-viewer-efl (1.4.40) unstable; urgency=low + + * fix BS at abnomal exit case + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.40 + + -- Jisung Ahn Thu, 12 Apr 2012 13:54:12 +0900 + +ug-image-viewer-efl (1.4.39) unstable; urgency=low + + * fix BS + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.39 + + -- Jisung Ahn Tue, 10 Apr 2012 18:03:27 +0900 + +ug-image-viewer-efl (1.4.38) unstable; urgency=low + + * apply url-downloader + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.38 + + -- Jisung Ahn Fri, 06 Apr 2012 13:59:07 +0900 + +ug-image-viewer-efl (1.4.37) unstable; urgency=low + + * capi-uix-face API is changed + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.37 + + -- Jisung Ahn Thu, 29 Mar 2012 20:05:16 +0900 + +ug-image-viewer-efl (1.4.36) unstable; urgency=low + + * fix detail bug, red box bug, allshare icon + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.36 + + -- Jisung Ahn Thu, 29 Mar 2012 17:02:47 +0900 + +ug-image-viewer-efl (1.4.35) unstable; urgency=low + + * fix jira issue(motion popup), disable toolbar button + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.35 + + -- Jisung Ahn Tue, 27 Mar 2012 13:48:58 +0900 + +ug-image-viewer-efl (1.4.34) unstable; urgency=low + + * apply capi at setas + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.34 + + -- Jisung Ahn Mon, 26 Mar 2012 13:47:07 +0900 + +ug-image-viewer-efl (1.4.33) unstable; urgency=low + + * fix add tag view + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.33 + + -- Jisung Ahn Fri, 23 Mar 2012 10:48:47 +0900 + +ug-image-viewer-efl (1.4.32) unstable; urgency=low + + * add timeout callback + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.32 + + -- Jisung Ahn Thu, 22 Mar 2012 09:41:07 +0900 + +ug-image-viewer-efl (1.4.31) unstable; urgency=low + + * fix BS + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4.31 + + -- Jisung Ahn Tue, 20 Mar 2012 10:37:46 +0900 + +ug-image-viewer-efl (1.4-30) unstable; urgency=low + + * update naviframe, genlist + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-30 + + -- Jisung Ahn Thu, 15 Mar 2012 21:22:49 +0900 + +ug-image-viewer-efl (1.4-29) unstable; urgency=low + + * fix bug + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-29 + + -- Jisung Ahn Wed, 14 Mar 2012 18:54:39 +0900 + +ug-image-viewer-efl (1.4-28) unstable; urgency=low + + * update EFL 1.0 + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-28 + + -- Jisung Ahn Tue, 13 Mar 2012 20:58:59 +0900 + +ug-image-viewer-efl (1.4-27) unstable; urgency=low + + * change to CAPI, remove editfield api + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-27 + + -- Jisung Ahn Tue, 28 Feb 2012 17:43:07 +0900 + +ug-image-viewer-efl (1.4-26) unstable; urgency=low + + * Can set resolution at set as view + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-26 + + -- Jisung Ahn Thu, 23 Feb 2012 19:22:46 +0900 + +ug-image-viewer-efl (1.4-25) unstable; urgency=low + + * update changelog + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-25 + + -- Jisung Ahn Thu, 23 Feb 2012 17:41:57 +0900 + +ug-image-viewer-efl (1.4-24) unstable; urgency=low + + * fix bug + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-24 + + -- Jisung Ahn Mon, 20 Feb 2012 20:26:27 +0900 + +ug-image-viewer-efl (1.4-23) unstable; urgency=low + + * update efl api + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-23 + + -- Jisung Ahn Wed, 15 Feb 2012 20:40:50 +0900 + +ug-image-viewer-efl (1.4-22) unstable; urgency=low + + * fix bugs + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-22 + + -- Jisung Ahn Wed, 08 Feb 2012 11:26:49 +0900 + +ug-image-viewer-efl (1.4-21) unstable; urgency=low + + * add slider_pause, slider_resume + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-21 + + -- Jisung Ahn Fri, 03 Feb 2012 14:31:47 +0900 + +ug-image-viewer-efl (1.4-20) unstable; urgency=low + + * fix bug + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-20 + + -- Jisung Ahn Thu, 02 Feb 2012 19:08:14 +0900 + +ug-image-viewer-efl (1.4-19) unstable; urgency=low + + * enable setas button + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-19 + + -- Jisung Ahn Wed, 01 Feb 2012 14:39:00 +0900 + +ug-image-viewer-efl (1.4-18) unstable; urgency=low + + * upload for minfo + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-18 + + -- Jisung Ahn Tue, 31 Jan 2012 17:07:10 +0900 + +ug-image-viewer-efl (1.4-17) unstable; urgency=low + + * implement media list + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-17 + + -- Jisung Ahn Fri, 27 Jan 2012 17:50:50 +0900 + +ug-image-viewer-efl (1.4-16) unstable; urgency=low + + * change face detect api + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-16 + + -- Jisung Ahn Thu, 26 Jan 2012 19:48:19 +0900 + +ug-image-viewer-efl (1.4-15) unstable; urgency=low + + * change idler to job + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-15 + + -- Jisung Ahn Wed, 25 Jan 2012 16:02:23 +0900 + +ug-image-viewer-efl (1.4-14) unstable; urgency=low + + * fix crash for setas view + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-14 + + -- Jisung Ahn Fri, 20 Jan 2012 14:57:32 +0900 + +ug-image-viewer-efl (1.4-13) unstable; urgency=low + + * change share option + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-13 + + -- Jisung Ahn Thu, 19 Jan 2012 19:25:03 +0900 + +ug-image-viewer-efl (1.4-12) unstable; urgency=low + + * media svc api change + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-12 + + -- Jisung Ahn Wed, 18 Jan 2012 16:52:36 +0900 + +ug-image-viewer-efl (1.4-11) unstable; urgency=low + + * remove editfield edc + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-11 + + -- Jisung Ahn Tue, 17 Jan 2012 17:31:54 +0900 + +ug-image-viewer-efl (1.4-10) unstable; urgency=low + + * update naviframe, entry edc + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-10 + + -- Jisung Ahn Tue, 17 Jan 2012 15:32:50 +0900 + +ug-image-viewer-efl (1.4-9) unstable; urgency=low + + * update changelog + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-9 + + -- Jisung Ahn Mon, 16 Jan 2012 13:57:32 +0900 + +ug-image-viewer-efl (1.4-8) unstable; urgency=low + + * code refine + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-8 + + -- Jisung Ahn Fri, 06 Jan 2012 10:52:07 +0900 + +ug-image-viewer-efl (1.4-7) unstable; urgency=low + + * apply string + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-7 + + -- Jisung Ahn Mon, 26 Dec 2011 15:48:47 +0900 + +ug-image-viewer-efl (1.4-6) unstable; urgency=low + + * Update Changelog + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-6 + + -- Jisung Ahn Thu, 22 Dec 2011 10:16:04 +0900 + +ug-image-viewer-efl (1.4-5) unstable; urgency=low + + * Update changelog + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-5 + + -- Li Suxia Tue, 20 Dec 2011 10:08:15 +0800 + +ug-image-viewer-efl (1.4-4) unstable; urgency=low + + * Update changelog + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-4 + + -- Li Suxia Mon, 19 Dec 2011 16:45:24 +0800 + +ug-image-viewer-efl (1.4-3) unstable; urgency=low + + * update changelog + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-3 + + -- Jisung Ahn Mon, 19 Dec 2011 13:52:58 +0900 + +ug-image-viewer-efl (1.4-2) unstable; urgency=low + + * enable facebook appsvc + * Git: slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-2 + + -- Jisung Ahn Wed, 14 Dec 2011 15:09:23 +0900 + +ug-image-viewer-efl (1.4-1) unstable; urgency=low + + * version up + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-1 + + -- Jisung Ahn Tue, 13 Dec 2011 12:35:01 +0900 + +ug-image-viewer-efl (1.4-0) unstable; urgency=low + + * upload refactoring + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.4-0 + + -- Jisung Ahn Fri, 09 Dec 2011 17:17:46 +0900 + +ug-image-viewer-efl (1.3-77) unstable; urgency=low + + * prepare code open + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-77 + + -- Jisung Ahn Wed, 07 Dec 2011 10:48:42 +0900 + +ug-image-viewer-efl (1.3-76) unstable; urgency=low + + * fix CQ H0100137612(BS at wma file) + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-76 + + -- Jisung Ahn Mon, 28 Nov 2011 17:10:49 +0900 + +ug-image-viewer-efl (1.3-75) unstable; urgency=low + + * close detail view at web album + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-75 + + -- Jisung Ahn Thu, 24 Nov 2011 20:52:51 +0900 + +ug-image-viewer-efl (1.3-74) unstable; urgency=low + + * version for upload + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-74 + + -- Jisung Ahn Thu, 24 Nov 2011 19:48:40 +0900 + +ug-image-viewer-efl (1.3-73) unstable; urgency=low + + * update changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-73 + + -- Jisung Ahn Wed, 23 Nov 2011 13:11:47 +0900 + +ug-image-viewer-efl (1.3-72) unstable; urgency=low + + * Details view is popped from naviframe when destroy. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-72 + + -- root Tue, 22 Nov 2011 20:17:20 +0900 + +ug-image-viewer-efl (1.3-71) unstable; urgency=low + + * delete event blocker, destroy detail view + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-71 + + -- Jisung Ahn Wed, 16 Nov 2011 20:05:37 +0900 + +ug-image-viewer-efl (1.3-70) unstable; urgency=low + + * fix Lockup issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-70 + + -- Jisung Ahn Tue, 15 Nov 2011 18:53:40 +0900 + +ug-image-viewer-efl (1.3-69) unstable; urgency=low + + * fix GUI + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-69 + + -- Jisung Ahn Mon, 14 Nov 2011 21:27:06 +0900 + +ug-image-viewer-efl (1.3-68) unstable; urgency=low + + * fix popup width, change back key concept + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-68 + + -- Jisung Ahn Thu, 10 Nov 2011 17:02:20 +0900 + +ug-image-viewer-efl (1.3-67) unstable; urgency=low + + * fix prevet, set as bug, log, mss, photocam + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-67 + + -- Jisung Ahn Wed, 09 Nov 2011 15:32:32 +0900 + +ug-image-viewer-efl (1.3-66) unstable; urgency=low + + * fix places view BS, Modify all share icon position Response popup immediately. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-66 + + -- Jisung Ahn Thu, 03 Nov 2011 17:39:14 +0900 + +ug-image-viewer-efl (1.3-65) unstable; urgency=low + + * change editfield focus method + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-65 + + -- Jisung Ahn Wed, 02 Nov 2011 16:17:04 +0900 + +ug-image-viewer-efl (1.3-64) unstable; urgency=low + + * apply minfo api change + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-64 + + -- Jisung Ahn Wed, 02 Nov 2011 16:13:55 +0900 + +ug-image-viewer-efl (1.3-63) unstable; urgency=low + + * fix detail view effect, add scroll bar + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-63 + + -- Jisung Ahn Mon, 31 Oct 2011 20:58:30 +0900 + +ug-image-viewer-efl (1.3-62) unstable; urgency=low + + * fix share popup at web album, fix click event duration + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-62 + + -- Jisung Ahn Mon, 31 Oct 2011 18:03:57 +0900 + +ug-image-viewer-efl (1.3-61) unstable; urgency=low + + * change appsvc to ug, fix web download, fix add tag view max length effect + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-61 + + -- Jisung Ahn Thu, 27 Oct 2011 15:38:52 +0900 + +ug-image-viewer-efl (1.3-60) unstable; urgency=low + + * Fix details issue launch from myfile and adjust details view layout + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-60 + + -- Jisung Ahn Wed, 26 Oct 2011 13:02:01 +0900 + +ug-image-viewer-efl (1.3-59) unstable; urgency=low + + * fix BS while destroying, fix bundle value at allshare video + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-59 + + -- Jisung Ahn Tue, 25 Oct 2011 16:53:42 +0900 + +ug-image-viewer-efl (1.3-58) unstable; urgency=low + + * get application list from appsvc at share + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-58 + + -- Jisung Ahn Mon, 24 Oct 2011 14:34:34 +0900 + +ug-image-viewer-efl (1.3-57) unstable; urgency=low + + * Fix scissorbox issue & implement new details view + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-57 + + -- Li Suxia Sat, 22 Oct 2011 10:37:43 +0800 + +ug-image-viewer-efl (1.3-56) unstable; urgency=low + + * send result to caller when file type not supported + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-56 + + -- Jisung Ahn Wed, 19 Oct 2011 17:51:23 +0900 + +ug-image-viewer-efl (1.3-55) unstable; urgency=low + + * fix UI bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-55 + + -- Jisung Ahn Tue, 18 Oct 2011 13:48:30 +0900 + +ug-image-viewer-efl (1.3-54) unstable; urgency=low + + * update scissor box when rotated, update set as view + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-54 + + -- Jisung Ahn Thu, 13 Oct 2011 20:31:20 +0900 + +ug-image-viewer-efl (1.3-53) unstable; urgency=low + + * add trim menu at video file + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-53 + + -- Jisung Ahn Wed, 12 Oct 2011 21:10:51 +0900 + +ug-image-viewer-efl (1.3-52) unstable; urgency=low + + * slide show end when flicked + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-52 + + -- Jisung Ahn Tue, 11 Oct 2011 22:48:19 +0900 + +ug-image-viewer-efl (1.3-51) unstable; urgency=low + + * fix CQ and bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-51 + + -- Jisung Ahn Tue, 11 Oct 2011 21:17:37 +0900 + +ug-image-viewer-efl (1.3-50) unstable; urgency=low + + * fix UI + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-50 + + -- Jisung Ahn Tue, 11 Oct 2011 12:59:59 +0900 + +ug-image-viewer-efl (1.3-49) unstable; urgency=low + + * apply HD GUI, navi frame + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-49 + + -- Jisung Ahn Mon, 10 Oct 2011 20:11:32 +0900 + +ug-image-viewer-efl (1.3-48) unstable; urgency=low + + * apply app service twitter, picasa + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-48 + + -- Jisung Ahn Thu, 06 Oct 2011 19:42:59 +0900 + +ug-image-viewer-efl (1.3-47) unstable; urgency=low + + * change save view to save popup + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-47 + + -- Jisung Ahn Thu, 06 Oct 2011 13:39:58 +0900 + +ug-image-viewer-efl (1.3-46) unstable; urgency=low + + * fix Details view bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-46 + + -- Jisung Ahn Wed, 05 Oct 2011 19:33:59 +0900 + +ug-image-viewer-efl (1.3-45) unstable; urgency=low + + * apply scale decoding and footstep, update slide show, fix bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-45 + + -- Jisung Ahn Tue, 04 Oct 2011 20:14:35 +0900 + +ug-image-viewer-efl (1.3-44) unstable; urgency=low + + * apply allshare + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-44 + + -- Jisung Ahn Fri, 30 Sep 2011 14:59:37 +0900 + +ug-image-viewer-efl (1.3-43) unstable; urgency=low + + * enable dissolve effect, footsteps, enter key + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-43 + + -- Jisung Ahn Thu, 29 Sep 2011 14:17:09 +0900 + +ug-image-viewer-efl (1.3-42) unstable; urgency=low + + * code clean, change set as view GUI + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-42 + + -- Jisung Ahn Thu, 22 Sep 2011 17:32:51 +0900 + +ug-image-viewer-efl (1.3-41) unstable; urgency=low + + * Fix minor GUI bugs. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-41 + + -- Hyunwoo Kim Mon, 19 Sep 2011 19:32:15 +0900 + +ug-image-viewer-efl (1.3-40) unstable; urgency=low + + * enable motion, prevent mouse event when destroy, enable scroll margin + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-40 + + -- Jisung Ahn Sat, 17 Sep 2011 15:18:06 +0900 + +ug-image-viewer-efl (1.3-39) unstable; urgency=low + + * Disable any events just before terminate ug. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-39 + + -- Hyunwoo Kim Fri, 16 Sep 2011 22:35:07 +0900 + +ug-image-viewer-efl (1.3-38) unstable; urgency=low + + * Remove copy popup when flicking. + * Apply new GUI guide + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-38 + + -- Hyunwoo Kim Fri, 16 Sep 2011 18:23:03 +0900 + +ug-image-viewer-efl (1.3-37) unstable; urgency=low + + * Upload for verification + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-37 + + -- Jisung Ahn Thu, 15 Sep 2011 19:51:59 +0900 + +ug-image-viewer-efl (1.3-36) unstable; urgency=low + + * Fix issue thoat file_unset is not called sometimes + * Popup shows longer when setting wallpaper + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-36 + + -- Jisung Ahn Wed, 14 Sep 2011 12:44:12 +0900 + +ug-image-viewer-efl (1.3-35) unstable; urgency=low + + * fix minor BUG + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-35 + + -- Jisung Ahn Fri, 09 Sep 2011 20:46:13 +0900 + +ug-image-viewer-efl (1.3-34) unstable; urgency=low + + * modify zoom, UI, set as exif + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-34 + + -- Jisung Ahn Fri, 09 Sep 2011 14:55:33 +0900 + +ug-image-viewer-efl (1.3-33) unstable; urgency=low + + * Implement tap zoom + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-33 + + -- Jisung Ahn Thu, 08 Sep 2011 16:44:19 +0900 + +ug-image-viewer-efl (1.3-32) unstable; urgency=low + + * include image-vewer-ext-engine only armel build + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-32 + + -- Jisung Ahn Wed, 07 Sep 2011 20:58:41 +0900 + +ug-image-viewer-efl (1.3-31) unstable; urgency=low + + * add dependency image-viewer-ext-engine + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-31 + + -- Jisung Ahn Wed, 07 Sep 2011 19:45:13 +0900 + +ug-image-viewer-efl (1.3-30) unstable; urgency=low + + * disable allshare + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-30 + + -- Jisung Ahn Fri, 02 Sep 2011 15:06:18 +0900 + +ug-image-viewer-efl (1.3-29) unstable; urgency=low + + * update changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-29 + + -- Jisung Ahn Wed, 31 Aug 2011 20:06:40 +0900 + +ug-image-viewer-efl (1.3-28) unstable; urgency=low + + * avoid appsvc bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-28 + + -- Jisung Ahn Wed, 31 Aug 2011 14:58:02 +0900 + +ug-image-viewer-efl (1.3-27) unstable; urgency=low + + * prepare source open + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-27 + + -- Jisung Ahn Tue, 30 Aug 2011 15:01:55 +0900 + +ug-image-viewer-efl (1.3-26) unstable; urgency=low + + * apply DRM image operation + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-26 + + -- Jisung Ahn Wed, 17 Aug 2011 20:14:44 +0900 + +ug-image-viewer-efl (1.3-25) unstable; urgency=low + + * apply agif, remove widget type, add margin,, apply pm api + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-25 + + -- Jisung Ahn Tue, 16 Aug 2011 20:08:24 +0900 + +ug-image-viewer-efl (1.3-24) unstable; urgency=low + + * fix BS when copy popup at web image + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-24 + + -- Jisung Ahn Fri, 05 Aug 2011 11:27:33 +0900 + +ug-image-viewer-efl (1.3-23) unstable; urgency=low + + * Fix B/S when delete item in 2 items + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-23 + + -- Jisung Ahn Thu, 04 Aug 2011 21:04:55 +0900 + +ug-image-viewer-efl (1.3-22) unstable; urgency=low + + * Fix B/S when delete item in myfile + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-22 + + -- Hyunwoo Kim Thu, 04 Aug 2011 17:52:27 +0900 + +ug-image-viewer-efl (1.3-21) unstable; urgency=low + + * Ctrl bar is disabled during downloading. + * Change internal slider APIs + * Bug fixed that cannot get next item when flick continously. + * Implement details view + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl.git + * Tag: ug-image-viewer-efl_1.3-21 + + -- Hyunwoo Kim Tue, 02 Aug 2011 20:27:02 +0900 + +ug-image-viewer-efl (1.3-20) unstable; urgency=low + + * fix save view bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-20 + + -- Jisung Ahn Thu, 28 Jul 2011 20:08:08 +0900 + +ug-image-viewer-efl (1.3-19) unstable; urgency=low + + * code refactoring + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-19 + + -- Jisugn Ahn Tue, 26 Jul 2011 20:23:05 +0900 + +ug-image-viewer-efl (1.3-18) unstable; urgency=low + + * fix control bar, button style, shuffle, Eina_Bool + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-18 + + -- Jisung Ahn Fri, 22 Jul 2011 18:05:16 +0900 + +ug-image-viewer-efl (1.3-17) unstable; urgency=low + + * fix emulator BS + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-17 + + -- Jisung Ahn Thu, 21 Jul 2011 21:54:32 +0900 + +ug-image-viewer-efl (1.3-16) unstable; urgency=low + + * apply new slide show + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-16 + + -- Jisung Ahn Thu, 21 Jul 2011 19:50:17 +0900 + +ug-image-viewer-efl (1.3-15) unstable; urgency=low + + * apply transition effect + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-15 + + -- Jisung Ahn Wed, 20 Jul 2011 17:54:45 +0900 + +ug-image-viewer-efl (1.3-14) unstable; urgency=low + + * fix build error, rotate error + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-14 + + -- Jisung Ahn Mon, 11 Jul 2011 22:07:52 +0900 + +ug-image-viewer-efl (1.3-13) unstable; urgency=low + + * ImageViewer is terminated when MMC is removed. + * Add tag view is refined + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-13 + + -- Hyunwoo Kim Thu, 07 Jul 2011 19:43:59 +0900 + +ug-image-viewer-efl (1.3-12) unstable; urgency=low + + * fix cq, scissor box, svace + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-12 + + -- Jisung Ahn Mon, 04 Jul 2011 20:14:32 +0900 + +ug-image-viewer-efl (1.3-11) unstable; urgency=low + + * apply all share, fix delete BS + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-11 + + -- Jisung Ahn Fri, 01 Jul 2011 19:17:02 +0900 + +ug-image-viewer-efl (1.3-10) unstable; urgency=low + + * apply window loading + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-10 + + -- Jisung Ahn Wed, 29 Jun 2011 20:16:35 +0900 + +ug-image-viewer-efl (1.3-09) unstable; urgency=low + + * Fixed CQ + * Implement mouse event handler. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-09 + + -- Hyunwoo Kim Tue, 28 Jun 2011 10:47:43 +0900 + +ug-image-viewer-efl (1.3-08) unstable; urgency=low + + * Remove dependancy between ugd and other view. + * Fix prevents bug + * Support for multi instance + * Refactoring SetAs View + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-08 + + -- Hyunwoo Kim Fri, 24 Jun 2011 19:37:35 +0900 + +ug-image-viewer-efl (1.3-07) unstable; urgency=low + + * Upload for CQ defects fix, reupload + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-07 + + -- Li Suxia Wed, 22 Jun 2011 16:22:26 +0800 + +ug-image-viewer-efl (1.3-06) lucid; urgency=low + + * Upload for CQ defects fix + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-06 + + -- Li Suxia Wed, 22 Jun 2011 14:56:26 +0800 + +ug-image-viewer-efl (1.3-05) unstable; urgency=low + + * Improvement pinch zoom algorithm. + * Decrease animation time from 500ms to 200ms + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-05 + + -- Hyunwoo Kim Tue, 14 Jun 2011 15:50:33 +0900 + +ug-image-viewer-efl (1.3-04) unstable; urgency=low + + * apply sns finalize + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-04 + + -- Jisung Ahn Wed, 08 Jun 2011 15:34:25 +0900 + +ug-image-viewer-efl (1.3-03) unstable; urgency=low + + * update changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-03 + + -- Jisung Ahn Wed, 08 Jun 2011 14:18:52 +0900 + +ug-image-viewer-efl (1.3-02) unstable; urgency=low + + * update changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-02 + + -- Jisung Ahn Fri, 03 Jun 2011 19:00:26 +0900 + +ug-image-viewer-efl (1.3-01) unstable; urgency=low + + * Fix bug that video file does not flicked. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-01 + + -- Hyunwoo Kim Thu, 02 Jun 2011 09:51:42 +0900 + +ug-image-viewer-efl (1.3-00) unstable; urgency=low + + * Refactoring slide item + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.3-00 + + -- Jisung ahn Thu, 02 Jun 2011 09:51:42 +0900 + +ug-image-viewer-efl (1.2-12) unstable; urgency=low + + * fix control bar, block sns finalize, add test program, fix crop bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-12 + + -- Jisung Ahn Wed, 01 Jun 2011 21:29:06 +0900 + +ug-image-viewer-efl (1.2-11) unstable; urgency=low + + * code clean, fix bs, rotate bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-11 + + -- Jisung ahn Mon, 30 May 2011 20:48:29 +0900 + +ug-image-viewer-efl (1.2-10) unstable; urgency=low + + * fix bug, apply setas view click event + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-10 + + -- Jisung Ahn Thu, 26 May 2011 20:56:01 +0900 + +ug-image-viewer-efl (1.2-9) unstable; urgency=low + + * mouse event change ecore to evas, popup style change + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-9 + + -- Jisung Ahn Wed, 25 May 2011 19:34:02 +0900 + +ug-image-viewer-efl (1.2-8) unstable; urgency=low + + * fix icon, drm problem, warning, etc... + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-8 + + -- Jisung Ahn Tue, 24 May 2011 16:27:54 +0900 + +ug-image-viewer-efl (1.2-7) unstable; urgency=low + + * Block exif + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-7 + + -- Jisung Ahn Tue, 24 May 2011 11:44:09 +0900 + +ug-image-viewer-efl (1.2-6) unstable; urgency=low + + * Fix string issue, and update list issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-6 + + -- Li Suxia Tue, 24 May 2011 10:35:04 +0800 + +ug-image-viewer-efl (1.2-5) unstable; urgency=low + + * fixed black screen when web image resume + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-5 + + -- DongJin Choi Thu, 19 May 2011 17:50:32 +0900 + +ug-image-viewer-efl (1.2-4) unstable; urgency=low + + * updated changelog. fix installation error + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-4 + + -- DongJin Choi Thu, 19 May 2011 12:43:10 +0900 + +ug-image-viewer-efl (1.2-3) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-3 + + -- DongJin Choi Thu, 19 May 2011 12:15:30 +0900 + +ug-image-viewer-efl (1.2-2) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-2 + + -- DongJin Choi Thu, 19 May 2011 11:50:30 +0900 + +ug-image-viewer-efl (1.2-1) unstable; urgency=low + + * changed media-svc to libmedia-info + * removed elm_priv.h + * inserted bundle key for video player + * modified myphotocam mouse event + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-1 + + -- DongJin Choi Wed, 18 May 2011 16:51:19 +0900 + +ug-image-viewer-efl (1.2-00) unstable; urgency=low + + * Change directory structures + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.2-00 + + -- Hyunwoo Kim Wed, 18 May 2011 11:03:04 +0900 + +ug-image-viewer-efl (1.1-38) unstable; urgency=low + + * fixed black screen error, improvement image viewer loading time, fixed + some bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-38 + + -- Li Suxia Wed, 18 May 2011 10:52:02 +0900 + +ug-image-viewer-efl (1.1-37) unstable; urgency=low + + * Fix delete & tag message + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-37 + + -- Li Suxia Thu, 12 May 2011 21:44:41 +0800 + +ug-image-viewer-efl (1.1-36) unstable; urgency=low + + * fixed BS + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-36 + + -- DongJin Choi Thu, 12 May 2011 21:11:10 +0900 + +ug-image-viewer-efl (1.1-35) unstable; urgency=low + + * Upload again + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-35 + + -- Li Suxia Wed, 11 May 2011 14:14:11 +0800 + +ug-image-viewer-efl (1.1-34) unstable; urgency=low + + * Fix DRM issue & implement pause/resume + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-34 + + -- Li Suxia Wed, 11 May 2011 11:24:11 +0800 + +ug-image-viewer-efl (1.1-33) unstable; urgency=low + + * changed sns-framework pkg name to social-service + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-33 + + -- DongJin Choi Mon, 02 May 2011 20:06:10 +0900 + +ug-image-viewer-efl (1.1-32) unstable; urgency=low + + * Replace setas genlist with default + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-32 + + -- LiSuxia Tue, 03 May 2011 20:25:10 +0800 + +ug-image-viewer-efl (1.1-31) unstable; urgency=low + + * disable animation GIF + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-31 + + -- DongJin Choi Mon, 02 May 2011 20:06:10 +0900 + +ug-image-viewer-efl (1.1-30) unstable; urgency=low + + * inserted evas_norender function at exit image viewer UG + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-30 + + -- DongJin Choi Mon, 02 May 2011 19:06:10 +0900 + +ug-image-viewer-efl (1.1-29) unstable; urgency=low + + * exit elm_photocam_file_set function when Animation gif loading error + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-29 + + -- DongJin Choi Thu, 28 Apr 2011 20:21:11 +0900 + +ug-image-viewer-efl (1.1-28) unstable; urgency=low + + * changed macro name & updated calc_job function + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-28 + + -- DongJin Choi Thu, 28 Apr 2011 16:28:10 +0900 + +ug-image-viewer-efl (1.1-27) unstable; urgency=low + + * fixed bulid break. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-27 + + -- DongJin Choi Thu, 28 Apr 2011 10:41:10 +0900 + +ug-image-viewer-efl (1.1-26) unstable; urgency=low + + * changed BT launch method & fixed some bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-26 + + -- DongJin Choi Wed, 27 Apr 2011 21:07:30 +0900 + +ug-image-viewer-efl (1.1-25) unstable; urgency=low + + * Fix full build break + + -- Mike McCormack Wed, 27 Apr 2011 19:19:17 +0900 + +ug-image-viewer-efl (1.1-24) unstable; urgency=low + + * Add media-type support & fix issues: title, face detect + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-24 + + -- Li Suxia Tue, 26 Apr 2011 17:14:31 +0800 + +ug-image-viewer-efl (1.1-23) unstable; urgency=low + + * fixed sizing error & fixed some bug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-23 + + -- DongJin Choi Mon, 25 Apr 2011 11:59:30 +0900 + +ug-image-viewer-efl (1.1-22) unstable; urgency=low + + * Fix issues on crop image + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-22 + + -- Li Suxia Thu, 21 Apr 2011 19:14:33 +0800 + +ug-image-viewer-efl (1.1-21) unstable; urgency=low + + * fixed some error, changed snsfw name, inserted web album view function + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-21 + + -- DongJin Choi Wed, 20 Apr 2011 21:01:30 +0800 + +ug-image-viewer-efl (1.1-20) unstable; urgency=low + + * Fix issue on destroy & modify controlbar option for video + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-20 + + -- Li Suxia Wed, 20 Apr 2011 17:01:30 +0800 + +ug-image-viewer-efl (1.1-19) unstable; urgency=low + + * fixed error in caller id mode + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-19 + + -- DongJin Choi Tue, 19 Apr 2011 23:57:39 +0900 + +ug-image-viewer-efl (1.1-18) unstable; urgency=low + + * Fix issue on destroy slider + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-18 + + -- Li Suxia Tue, 19 Apr 2011 12:56:37 +0800 + +ug-image-viewer-efl (1.1-17) unstable; urgency=low + + * Dim option for video & DRM file + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-17 + + -- Li Suxia Mon, 18 Apr 2011 17:11:14 +0800 + +ug-image-viewer-efl (1.1-16) unstable; urgency=low + + * re-upload + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-16 + + -- DongJin Choi Fri, 15 Apr 2011 16:15:39 +0900 + +ug-image-viewer-efl (1.1-15) unstable; urgency=low + + * inserted tag option + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-15 + + -- DongJin Choi Fri, 15 Apr 2011 14:22:39 +0900 + +ug-image-viewer-efl (1.1-14) unstable; urgency=low + + * fixed delete slide error + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-14 + + -- DongJin Choi Fri, 15 Apr 2011 10:22:39 +0900 + +ug-image-viewer-efl (1.1-13) unstable; urgency=low + + * Reupload + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-13 + + -- Li Suxia Thu, 14 Apr 2011 17:06:33 +0800 + +ug-image-viewer-efl (1.1-12) unstable; urgency=low + + * Fix popup bs & implement view by favourite + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-12 + + -- Li Suxia Thu, 14 Apr 2011 18:58:33 +0800 + +ug-image-viewer-efl (1.1-11) lucid; urgency=low + + * Fix popup bs & implement view by favourite + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-11 + + -- Li Suxia Thu, 14 Apr 2011 18:45:26 +0800 + +ug-image-viewer-efl (1.1-10) unstable; urgency=low + + * fixed display mode error + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-10 + + -- DongJin Choi Thu, 14 Apr 2011 17:59:39 +0900 + +ug-image-viewer-efl (1.1-9) unstable; urgency=low + + * reupload image ug, because snsfw, updated changed log + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-9 + + -- DongJin Choi Tue, 12 Apr 2011 16:12:39 +0900 + +ug-image-viewer-efl (1.1-8) unstable; urgency=low + + * fixed build break + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-8 + + -- DongJin Choi Tue, 12 Apr 2011 16:12:39 +0900 + +ug-image-viewer-efl (1.1-7) unstable; urgency=low + + * fixed build break , wink, face detection engine + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-6 + + -- DongJin Choi Tue, 12 Apr 2011 10:04:39 +0900 + +ug-image-viewer-efl (1.1-6) unstable; urgency=low + + * fixed build break in i386 + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-6 + + -- DongJin Choi Tue, 12 Apr 2011 09:44:19 +0900 + +ug-image-viewer-efl (1.1-5) unstable; urgency=low + + * fixed build break i386 + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-5 + + -- DongJin Choi Tue, 12 Apr 2011 08:41:26 +0900 + +ug-image-viewer-efl (1.1-4) unstable; urgency=low + + * fixed build break i386 + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-4 + + -- DongJin Choi Tue, 12 Apr 2011 07:50:28 +0900 + +ug-image-viewer-efl (1.1-3) unstable; urgency=low + + * fixed build break + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-3 + + -- DongJin Choi Tue, 12 Apr 2011 07:33:26 +0900 + +ug-image-viewer-efl (1.1-2) unstable; urgency=low + + * fixed build break + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-2 + + -- DongJin Choi Mon, 11 Apr 2011 22:04:17 +0900 + +ug-image-viewer-efl (1.1-1) unstable; urgency=low + + * enable new image viewer + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.1-1 + + -- DongJin Choi Mon, 11 Apr 2011 20:44:49 +0900 + +ug-image-viewer-efl (1.0-182) unstable; urgency=low + + * remove deprecated api of ctxpopup + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-182 + + -- DongJin Choi Thu, 07 Apr 2011 21:00:26 +0900 + +ug-image-viewer-efl (1.0-181) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-181 + + -- Li Suxia Sat, 02 Apr 2011 10:22:15 +0900 + +ug-image-viewer-efl (1.0-180) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-180 + + -- Li Suxia Thu, 24 Mar 2011 14:15:06 +0900 + +ug-image-viewer-efl (1.0-179) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-179 + + -- Li Suxia Tue, 22 Mar 2011 13:54:33 +0900 + +ug-image-viewer-efl (1.0-178) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-178 + + -- Li Suxia Mon, 21 Mar 2011 21:39:52 +0900 + +ug-image-viewer-efl (1.0-176) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-176 + + -- DongJin Choi Fri, 18 Mar 2011 11:28:22 +0900 + +ug-image-viewer-efl (1.0-175) unstable; urgency=low + + * fixed BS + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-175 + + -- DongJin Choi Fri, 18 Mar 2011 11:05:58 +0900 + +ug-image-viewer-efl (1.0-174) unstable; urgency=low + + * inserted image-viewer base photocam + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-174 + + -- DongJin Choi Tue, 15 Mar 2011 09:46:46 +0900 + +ug-image-viewer-efl (1.0-173) unstable; urgency=low + + * modify snsfw api return value. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-173 + + -- DongJin Choi Mon, 14 Mar 2011 15:55:13 +0900 + +ug-image-viewer-efl (1.0-172) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-172 + + -- DongJin Choi Thu, 10 Mar 2011 19:59:20 +0900 + +ug-image-viewer-efl (1.0-171) unstable; urgency=low + + * remove sns framework wrong used code. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-171 + + -- DongJin Choi Thu, 10 Mar 2011 18:58:32 +0900 + +ug-image-viewer-efl (1.0-170) unstable; urgency=low + + * Upload again. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-170 + + -- Li Suxia Thu, 10 Mar 2011 09:23:50 +0900 + +ug-image-viewer-efl (1.0-169) unstable; urgency=low + + * Update git info. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-169 + + -- Li Suxia Wed, 09 Mar 2011 19:57:27 +0900 + +ug-image-viewer-efl (1.0-168) unstable; urgency=low + + * Update changelog again + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-168 + + -- Li Suxia Wed, 09 Mar 2011 19:01:06 +0900 + +ug-image-viewer-efl (1.0-167) unstable; urgency=low + + * update changelog & add stat. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-167 + + -- Li Suxia Wed, 09 Mar 2011 14:46:18 +0900 + +ug-image-viewer-efl (1.0-166) unstable; urgency=low + + * change sns launch method aul -> ug. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-166 + + -- DongJin Choi Tue, 08 Mar 2011 10:43:07 +0900 + +ug-image-viewer-efl (1.0-165) unstable; urgency=low + + * Update changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-165 + + -- Li Suxia Fri, 04 Mar 2011 15:41:03 +0900 + +ug-image-viewer-efl (1.0-164) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-164 + + -- DongJin Choi Mon, 28 Feb 2011 21:05:38 +0900 + +ug-image-viewer-efl (1.0-163) unstable; urgency=low + + * updated changelog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-163 + + -- Li Suxia Mon, 28 Feb 2011 21:03:30 +0900 + +ug-image-viewer-efl (1.0-162) unstable; urgency=low + + * fixed web download image problem. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-162 + + -- Li Suxia Mon, 28 Feb 2011 20:25:45 +0900 + +ug-image-viewer-efl (1.0-161) unstable; urgency=low + + * Apply new UI for setas wallpaper + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-161 + + -- Li Suxia Fri, 25 Feb 2011 16:36:41 +0800 + +ug-image-viewer-efl (1.0-160) unstable; urgency=low + + * Fix pause/resume issue for win rotate + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-160 + + -- Li Suxia Wed, 23 Feb 2011 17:55:26 +0800 + +ug-image-viewer-efl (1.0-159) unstable; urgency=low + + * fixed some CQ, crash log + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-159 + + -- DongJin Choi Tue, 22 Feb 2011 20:12:27 +0900 + +ug-image-viewer-efl (1.0-158) unstable; urgency=low + + * Enable control bar for single mode & return result for SETAS + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-158 + + -- Li Suxia Tue, 22 Feb 2011 17:55:16 +0800 + +ug-image-viewer-efl (1.0-157) unstable; urgency=low + + * Fix pause/resume issue related with win rotate + * Fix set home & lock screen related issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-157 + + -- Li Suxia Mon, 21 Feb 2011 17:56:34 +0800 + +ug-image-viewer-efl (1.0-155) unstable; urgency=low + + * Fix rectangle select issue & zoom rate issue & create lcd size image. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-155 + + -- Li Suxia Fri, 18 Feb 2011 17:28:29 +0800 + +ug-image-viewer-efl (1.0-154) unstable; urgency=low + + * fixed black screen problem when multi down , serveral times. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-154 + + -- Li Suxia Thu, 17 Feb 2011 14:03:36 +0900 + +ug-image-viewer-efl (1.0-153) unstable; urgency=low + + * Revise navibar & control bar for camera UG + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-153 + + -- Li Suxia Thu, 17 Feb 2011 09:19:25 +0800 + +ug-image-viewer-efl (1.0-152) unstable; urgency=low + + * Support selector for callerID ug, fix sort by issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-152 + + -- Li Suxia Wed, 16 Feb 2011 08:35:18 +0800 + +ug-image-viewer-efl (1.0-151) unstable; urgency=low + + * Implement callerID & wallpaper ug, refine single ug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-151 + + -- Li Suxia Mon, 14 Feb 2011 08:43:20 +0800 + +ug-image-viewer-efl (1.0-150) unstable; urgency=low + + * sensor framework disable when image viewer go to background + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-150 + + -- DongJin Choi Thu, 10 Feb 2011 14:36:02 +0900 + +ug-image-viewer-efl (1.0-149) unstable; urgency=low + + * inserted pmapi package + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-149 + + -- DongJin Choi Tue, 08 Feb 2011 18:06:24 +0900 + +ug-image-viewer-efl (1.0-148) unstable; urgency=low + + * rollback End key policy + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-148 + + -- DongJin Choi Mon, 07 Feb 2011 14:14:31 +0900 + +ug-image-viewer-efl (1.0-147) unstable; urgency=low + + * fixed Gallery BS problem ( remove undefined symbol mb_app_common_set_property) + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-147 + + -- DongJin Choi Sat, 05 Feb 2011 09:25:23 +0900 + +ug-image-viewer-efl (1.0-146) unstable; urgency=low + + * fixed some bug. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-146 + + -- DongJin Choi Tue, 01 Feb 2011 21:55:05 +0900 + +ug-image-viewer-efl (1.0-145) unstable; urgency=low + + * inserted gethering sns service list code. + * removed undefined function. ( mb_app_common_set_category ) + * image-viewer destory, when ums connected. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-145 + + -- DongJin Choi Tue, 01 Feb 2011 21:07:01 +0900 + +ug-image-viewer-efl (1.0-144) unstable; urgency=low + + * Fixed web image issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-144 + + -- Li Suxia Mon, 31 Jan 2011 09:16:39 +0800 + +ug-image-viewer-efl (1.0-143) unstable; urgency=low + + * Fixed black screen issue for web image & popup issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-143 + + -- Li Suxia Wed, 26 Jan 2011 17:37:11 +0800 + +ug-image-viewer-efl (1.0-142) unstable; urgency=low + + * Fixed BS related END KEY + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-142 + + -- DongJin Choi Tue, 25 Jan 2011 14:58:34 +0900 + +ug-image-viewer-efl (1.0-141) unstable; urgency=low + + * remove unused code in image_resize & image blend function & modify code related NFC + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-141 + + -- DongJin Choi Mon, 24 Jan 2011 14:17:27 +0900 + +ug-image-viewer-efl (1.0-139) unstable; urgency=low + + * Fix update slideshow issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-139 + + -- Li Suxia Sat, 22 Jan 2011 11:02:07 +0800 + +ug-image-viewer-efl (1.0-138) unstable; urgency=low + + * Fix buidl break + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-138 + + -- Li Suxia Wed, 19 Jan 2011 20:06:11 +0800 + +ug-image-viewer-efl (1.0-137) unstable; urgency=low + + * Apply new dir policy & fix ug close cb issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-137 + + -- Li Suxia Wed, 19 Jan 2011 17:58:32 +0800 + +ug-image-viewer-efl (1.0-136) unstable; urgency=low + + * Fixed BS at the Web Image Down Load + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-136 + + -- DongJin Choi Tue, 18 Jan 2011 18:40:41 +0900 + +ug-image-viewer-efl (1.0-135) unstable; urgency=low + + * Fix H0100118455: previous change error + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-135 + + -- Li Suxia Mon, 17 Jan 2011 11:50:31 +0800 + +ug-image-viewer-efl (1.0-134) unstable; urgency=low + + * Fix H0100118455 + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-134 + + -- Li Suxia Mon, 17 Jan 2011 10:54:17 +0800 + +ug-image-viewer-efl (1.0-133) unstable; urgency=low + + * Upload to fix H0100112470 + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-133 + + -- Li Suxia Thu, 13 Jan 2011 16:04:33 +0800 + +ug-image-viewer-efl (1.0-132) unstable; urgency=low + + * enable UG BACK KEY + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-132 + + -- DongJin Choi Thu, 13 Jan 2011 11:48:01 +0900 + +ug-image-viewer-efl (1.0-131) unstable; urgency=low + + * Remove heynoti depends + * Fix H0100116919 again: previous change merge conflict + * changed eml_popup_timeout_set parameter type + * Add support for view by tag + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-131 + + -- DongJin Choi Wed, 12 Jan 2011 15:20:27 +0900 + +ug-image-viewer-efl (1.0-130) unstable; urgency=low + + * Update geo list by media-svc change + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-130 + + -- Li Suxia Wed, 05 Jan 2011 17:16:27 +0800 + +ug-image-viewer-efl (1.0-129) unstable; urgency=low + + * Fix set issue: button not work & exit after done + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-129 + + -- Li Suxia Wed, 05 Jan 2011 14:20:03 +0800 + +ug-image-viewer-efl (1.0-128) unstable; urgency=low + + * Fix buildbreak on Elm_softkey related + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-128 + + -- Li Suxia Tue, 04 Jan 2011 13:59:53 +0800 + +ug-image-viewer-efl (1.0-127) unstable; urgency=low + + * fixed long press error + * Update footstep by gallery request + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-127 + + -- DongJin Choi Tue, 04 Jan 2011 12:09:35 +0900 + +ug-image-viewer-efl (1.0-126) unstable; urgency=low + + * Exit imageviewer once slideshow is finished from footst.. + * fixed long press action. CQ H0100114062 + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-126 + + -- DongJin Choi Thu, 30 Dec 2010 17:47:28 +0900 + +ug-image-viewer-efl (1.0-125) unstable; urgency=low + + * Fix delete issue & bs on launch myfile detail ug + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-125 + + -- Li Suxia Tue, 28 Dec 2010 08:33:51 +0800 + +ug-image-viewer-efl (1.0-124) unstable; urgency=low + + * fixed tag name + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-124 + + -- Li Suxia Mon, 27 Dec 2010 11:10:11 +0900 + +ug-image-viewer-efl (1.0-123) unstable; urgency=low + + * Regarding Text display error + * Comment out appcore api in video. + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-123 + + -- Li Suxia Mon, 27 Dec 2010 11:04:13 +0900 + +ug-image-viewer-efl (1.0-122) unstable; urgency=low + + * Remove depends on appcore + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-122 + + -- Li Suxia Fri, 24 Dec 2010 15:05:57 +0800 + +ug-image-viewer-efl (1.0-121) unstable; urgency=low + + * Remove appcore_set_i18n + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-121 + + -- Li Suxia Wed, 22 Dec 2010 10:49:02 +0800 + +ug-image-viewer-efl (1.0-120) unstable; urgency=low + + * Fix web image download cancel BS + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-120 + + -- Li Suxia Tue, 21 Dec 2010 15:07:54 +0800 + +ug-image-viewer-efl (1.0-119) unstable; urgency=low + + * Remove bluetooth-app in makefile + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-119 + + -- Li Suxia Mon, 20 Dec 2010 13:21:18 +0800 + +ug-image-viewer-efl (1.0-118) unstable; urgency=low + + * Remove video depends & applog + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-118 + + -- Li Suxia Mon, 20 Dec 2010 11:32:43 +0800 + +ug-image-viewer-efl (1.0-117) unstable; urgency=low + + * Fix exit issue for video change + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-117 + + -- Li Suxia Fri, 17 Dec 2010 17:38:13 +0800 + +ug-image-viewer-efl (1.0-116) unstable; urgency=low + + * Upload again for web issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-116 + + -- Li Suxia Thu, 16 Dec 2010 10:27:46 +0800 + +ug-image-viewer-efl (1.0-115) unstable; urgency=low + + * Comment out object del for BS + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-115 + + -- Li Suxia Wed, 15 Dec 2010 18:24:19 +0800 + +ug-image-viewer-efl (1.0-114) unstable; urgency=low + + * Fix pkg install issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-114 + + -- Li Suxia Wed, 15 Dec 2010 09:41:45 +0800 + +ug-image-viewer-efl (1.0-113) unstable; urgency=low + + * Fix view by places issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-113 + + -- Li Suxia Tue, 14 Dec 2010 19:25:04 +0800 + +ug-image-viewer-efl (1.0-112) unstable; urgency=low + + * Add view by place & fix i18n issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-112 + + -- Li Suxia Tue, 14 Dec 2010 18:54:34 +0800 + +ug-image-viewer-efl (1.0-111) unstable; urgency=low + + * Add share by twitter, print via bluetooth, update web image download + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-111 + + -- Li Suxia Tue, 14 Dec 2010 10:31:57 +0800 + +ug-image-viewer-efl (1.0-110) unstable; urgency=low + + * Update Po to fix multi-language issue + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-110 + + -- Li Suxia Fri, 10 Dec 2010 16:53:48 +0800 + +ug-image-viewer-efl (1.0-109) unstable; urgency=low + + * Fix break for sns + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-109 + + -- Li Suxia Fri, 10 Dec 2010 08:44:05 +0800 + +ug-image-viewer-efl (1.0-108) unstable; urgency=low + + * Fix break for Edje_Edit.h + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-108 + + -- Li Suxia Wed, 08 Dec 2010 17:31:20 +0800 + +ug-image-viewer-efl (1.0-107) unstable; urgency=low + + * add proction code to video + * Git: slp-source.sec.samsung.net:slp/pkgs/u/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-107 + + -- Li Suxia Wed, 08 Dec 2010 17:16:56 +0800 + +ug-image-viewer-efl (1.0-106) unstable; urgency=low + + * add proction code to video + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-106 + + -- Li Wen Fri, 03 Dec 2010 18:34:08 +0800 + +ug-image-viewer-efl (1.0-105) unstable; urgency=low + + * Fix BS on object del + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-105 + + -- Li Wen Fri, 03 Dec 2010 17:34:08 +0800 + +ug-image-viewer-efl (1.0-104) unstable; urgency=low + + * Change video capture code + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-104 + + -- Li Wen Wed, 01 Dec 2010 17:28:20 +0800 + +ug-image-viewer-efl (1.0-103) unstable; urgency=low + + * Revise multi-language support + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-103 + + -- Li Suxia Wed, 01 Dec 2010 16:58:20 +0800 + +ug-image-viewer-efl (1.0-102) unstable; urgency=low + + * Revert GUI change & fix delete controlbar BS + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-102 + + -- Li Suxia Tue, 30 Nov 2010 17:05:16 +0800 + +ug-image-viewer-efl (1.0-101) unstable; urgency=low + + * Change bluetooth launch + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-101 + + -- Li Suxia Mon, 29 Nov 2010 18:28:32 +0800 + +ug-image-viewer-efl (1.0-100) unstable; urgency=low + + * Support Korea language & enable web image download + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-100 + + -- Li Suxia Mon, 29 Nov 2010 18:17:17 +0800 + +ug-image-viewer-efl (1.0-99) unstable; urgency=low + + * Fix issue: unable to launch image-editor + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-99 + + -- Li Suxia Mon, 29 Nov 2010 09:01:09 +0800 + +ug-image-viewer-efl (1.0-98) unstable; urgency=low + + * Support open file not in default dir + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-98 + + -- Li Suxia Fri, 26 Nov 2010 16:36:42 +0800 + +ug-image-viewer-efl (1.0-97) unstable; urgency=low + + * Upload for view by all + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-97 + + -- Li Suxia Fri, 26 Nov 2010 13:27:57 +0800 + +ug-image-viewer-efl (1.0-96) unstable; urgency=low + + * Enable web image download + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-96 + + -- Li Suxia Tue, 23 Nov 2010 17:03:06 +0800 + +ug-image-viewer-efl (1.0-95) unstable; urgency=low + + * fix adding bookmark BS issue. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-95 + + -- Li Wen Mon, 22 Nov 2010 21:08:46 +0800 + +ug-image-viewer-efl (1.0-94) unstable; urgency=low + + * change to Syspopup_launch(volume, NULL) + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-94 + + -- Li Wen Mon, 22 Nov 2010 14:08:46 +0800 + +ug-image-viewer-efl (1.0-93) unstable; urgency=low + + * Upload for SINGLE mode issue fix + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-93 + + -- Li Suxia Fri, 19 Nov 2010 13:08:46 +0800 + +ug-image-viewer-efl (1.0-92) unstable; urgency=low + + * Reupload for build error + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-92 + + -- Li Suxia Thu, 18 Nov 2010 16:12:13 +0800 + +ug-image-viewer-efl (1.0-91) unstable; urgency=low + + * Fix editor issue and photocam issue. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-91 + + -- Li Suxia Thu, 18 Nov 2010 15:02:57 +0800 + +ug-image-viewer-efl (1.0-90) unstable; urgency=low + + * Remove UI window & add dbg package + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-90 + + -- Li Suxia Thu, 18 Nov 2010 09:52:37 +0800 + +ug-image-viewer-efl (1.0-89) unstable; urgency=low + + * Fix web download & copy & ctxpopup position issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-89 + + -- Li Suxia Tue, 16 Nov 2010 16:33:24 +0800 + +ug-image-viewer-efl (1.0-88) unstable; urgency=low + + * Remove mm_session & enable web image download + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-88 + + -- Li Suxia Mon, 15 Nov 2010 17:51:21 +0800 + +ug-image-viewer-efl (1.0-87) unstable; urgency=low + + * enabel ug-imageviewer's own wrapper + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-87 + + -- Gao Wei Mon, 15 Nov 2010 14:49:49 +0800 + +ug-image-viewer-efl (1.0-86) unstable; urgency=low + + * Fix slideshow & play lock up issue & refine copy + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-86 + + -- Li Suxia Fri, 12 Nov 2010 14:49:49 +0800 + +ug-image-viewer-efl (1.0-85) unstable; urgency=low + + * enabling ug's own mb-svc-wrapper + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-85 + + -- Gao Wei Fri, 12 Nov 2010 10:47:19 +0800 + +ug-image-viewer-efl (1.0-84) unstable; urgency=low + + * Enable video-player for camera + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-84 + + -- Li Suxia Thu, 11 Nov 2010 16:55:57 +0800 + +ug-image-viewer-efl (1.0-83) unstable; urgency=low + + * Fix set as issue: only close button show + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-83 + + -- Li Suxia Wed, 10 Nov 2010 15:04:47 +0800 + +ug-image-viewer-efl (1.0-82) unstable; urgency=low + + * re-packaging + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-82 + + -- Gao Wei Mon, 08 Nov 2010 10:47:19 +0800 + +ug-image-viewer-efl (1.0-81) unstable; urgency=low + + * Enable EXIF & Change phtocao bounce by EFL + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-81 + + -- Li Suxia Sat, 06 Nov 2010 14:47:19 +0800 + +ug-image-viewer-efl (1.0-80) unstable; urgency=low + + * Reupload by media-svc + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-80 + + -- Li Suxia Fri, 05 Nov 2010 13:38:48 +0800 + +ug-image-viewer-efl (1.0-79) unstable; urgency=low + + * Seperate image-viewer from ug & remove apputil dependency + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-79 + + -- Li Suxia Fri, 05 Nov 2010 08:42:51 +0800 + +ug-image-viewer-efl (1.0-78) unstable; urgency=low + + * Comment out EXIF + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-78 + + -- Li Suxia Thu, 04 Nov 2010 17:09:18 +0800 + +ug-image-viewer-efl (1.0-77) unstable; urgency=low + + * Fix email issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-77 + + -- Li Suxia Thu, 04 Nov 2010 17:01:56 +0800 + +ug-image-viewer-efl (1.0-76) unstable; urgency=low + + * Reupload for media-svc change and fix drag issue on video + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-76 + + -- Hyunjun Ko Wed, 03 Oct 2010 19:40:12 +0800 + +ug-image-viewer-efl (1.0-75) unstable; urgency=low + + * Reupload for media-svc change + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-75 + + -- Li Suxia Wed, 03 Nov 2010 15:43:41 +0800 + +ug-image-viewer-efl (1.0-74) unstable; urgency=low + + * Fix pinch zoom issue: disable bounce animator + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-74 + + -- Li Suxia Wed, 03 Nov 2010 11:24:49 +0800 + +ug-image-viewer-efl (1.0-73) unstable; urgency=low + + * Fix Set as issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-73 + + -- Li Suxia Mon, 01 Nov 2010 17:30:21 +0800 + +ug-image-viewer-efl (1.0-72) unstable; urgency=low + + * Fix delete issue on receive event after destroy + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-72 + + -- Li Suxia Fri, 29 Oct 2010 18:04:13 +0800 + +ug-image-viewer-efl (1.0-71) unstable; urgency=low + + * Fix delete issue on continuous click + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-71 + + -- Li Suxia Fri, 29 Oct 2010 10:58:21 +0800 + +ug-image-viewer-efl (1.0-70) unstable; urgency=low + + * Reupload because of mistake + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-70 + + -- Hyunjun Ko Wed, 27 Oct 2010 16:40:12 +0800 + +ug-image-viewer-efl (1.0-69) unstable; urgency=low + + * Reupload with media svc change. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-69 + + -- Hyunjun Ko Wed, 27 Oct 2010 16:25:12 +0800 + +ug-image-viewer-efl (1.0-68) unstable; urgency=low + + * Disable log info for demo + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-68 + + -- Li Suxia Wed, 27 Oct 2010 14:05:34 +0800 + +ug-image-viewer-efl (1.0-67) unstable; urgency=low + + * Fix delete issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-67 + + -- Li Suxia Wed, 27 Oct 2010 11:50:56 +0800 + +ug-image-viewer-efl (1.0-66) unstable; urgency=low + + * Fix album delete error + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-66 + + -- Li Suxia Wed, 27 Oct 2010 09:08:12 +0800 + +ug-image-viewer-efl (1.0-65) unstable; urgency=low + + * Add test code + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-65 + + -- Li Suxia Tue, 26 Oct 2010 17:53:01 +0800 + +ug-image-viewer-efl (1.0-63) unstable; urgency=low + + * Fix exit issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-63 + + -- Li Suxia Tue, 26 Oct 2010 14:46:53 +0800 + +ug-image-viewer-efl (1.0-62) unstable; urgency=low + + * Add error handler + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-62 + + -- Li Suxia Mon, 25 Oct 2010 18:06:55 +0800 + +ug-image-viewer-efl (1.0-61) unstable; urgency=low + + * Reupload with media svc change. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-61 + + -- Hyunjun Ko Sat, 23 Oct 2010 14:00:12 +0800 + +ug-image-viewer-efl (1.0-60) unstable; urgency=low + + * Upload with media svc change. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-60 + + -- Tang Feng Sat, 23 Oct 2010 12:45:36 +0800 + +ug-image-viewer-efl (1.0-59) unstable; urgency=low + + * Fix BS temp on free folder list. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-59 + + -- Li Suxia Fri, 22 Oct 2010 17:42:36 +0800 + +ug-image-viewer-efl (1.0-58) unstable; urgency=low + + * Support add to home in videoplayer + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-58 + + -- Li Suxia Fri, 22 Oct 2010 16:39:25 +0800 + +ug-image-viewer-efl (1.0-57) unstable; urgency=low + + * Add pre/next function for video + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-57 + + -- Li Wen Wed, 21 Oct 2010 17:15:22 +0800 + +ug-image-viewer-efl (1.0-56) unstable; urgency=low + + * Add support for git&wbmp + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-56 + + -- Li Suxia Wed, 20 Oct 2010 17:45:22 +0800 + +ug-image-viewer-efl (1.0-55) unstable; urgency=low + + * Add sort type support & aul launch not mime-based + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-55 + + -- Li Suxia Wed, 20 Oct 2010 10:47:31 +0800 + +ug-image-viewer-efl (1.0-54) unstable; urgency=low + + * Remove media-browser-svc completely + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-54 + + -- Li Wen Tue, 20 Oct 2010 09:56:02 +0800 + +ug-image-viewer-efl (1.0-53) unstable; urgency=low + + * Fix slideshow timer BS and indicator issue & build break + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-53 + + -- Li Suxia Tue, 19 Oct 2010 15:56:02 +0800 + +ug-image-viewer-efl (1.0-52) unstable; urgency=low + + * Modified to use new api in media-svc + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-52 + + -- Hyunjun Ko Mon, 18 Oct 2010 22:40:12 +0800 + +ug-image-viewer-efl (1.0-51) unstable; urgency=low + + * Fix album edit bug + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-51 + + -- Li Suxia Mon, 18 Oct 2010 16:31:13 +0800 + +ug-image-viewer-efl (1.0-50) unstable; urgency=low + + * Fix thumbpath for video file + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-49 + + -- Li Suxia Fri, 15 Oct 2010 16:44:42 +0800 + +ug-image-viewer-efl (1.0-49) unstable; urgency=low + + * Add places view. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-49 + + -- Sangjin Han Thu, 14 Oct 2010 15:39:00 +0900 + +ug-image-viewer-efl (1.0-48) unstable; urgency=low + + * Remove FM-SVC dependency + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-48 + + -- Li Suxia Wed, 13 Oct 2010 18:22:51 +0800 + +ug-image-viewer-efl (1.0-47) unstable; urgency=low + + * Enable to use new media-svc + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-47 + + -- Hyunjun Ko Tue, 12 Oct 2010 20:33:12 +0800 + +ug-image-viewer-efl (1.0-46) unstable; urgency=low + + * Fix drm path issue & support landscape for videoplayer + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-46 + + -- Li Suxia Mon, 11 Oct 2010 18:17:12 +0800 + +ug-image-viewer-efl (1.0-45) unstable; urgency=low + + * Fix flicking issue during zoom & merge video-player + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-45 + + -- Li Suxia Mon, 11 Oct 2010 10:12:14 +0800 + +ug-image-viewer-efl (1.0-44) unstable; urgency=low + * Adjust Copy feature & Fix grab key issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-44 + + -- Li Suxia Fri, 08 Oct 2010 16:43:48 +0800 + +ug-image-viewer-efl (1.0-43) unstable; urgency=low + + * Fix some CMakeLists.txt for the new build system. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-43 + + -- Sangjin Han Wed, 06 Oct 2010 18:09:00 +0900 + +ug-image-viewer-efl (1.0-42) unstable; urgency=low + + * Add USE_MEDIA_SVC define + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-42 + + -- Sangjin Han Fri, 01 Oct 2010 16:55:20 +0900 + +ug-image-viewer-efl (1.0-41) unstable; urgency=low + + * Change sound header file & remove libcommunities dependency + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-41 + + -- Byungwook Jang Thu, 30 Sep 2010 14:52:44 +0900 + +ug-image-viewer-efl (1.0-40) unstable; urgency=low + + * Implement aul & Fix favor icon issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-40 + + -- Li Suxia Wed, 29 Sep 2010 15:53:04 +0800 + +ug-image-viewer-efl (1.0-39) unstable; urgency=low + + * Replace navigation bar by navi-ext for 3 buttons + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-39 + + -- Li Suxia Tue, 28 Sep 2010 17:47:40 +0800 + +ug-image-viewer-efl (1.0-38) unstable; urgency=low + + * Fix BS for Home&End key + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-38 + + -- Li Suxia Mon, 27 Sep 2010 18:27:42 +0800 + +ug-image-viewer-efl (1.0-37) unstable; urgency=low + + * Adjust set as process & video-player for scalable UI + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-37 + + -- Li Suxia Mon, 27 Sep 2010 17:26:16 +0800 + +ug-image-viewer-efl (1.0-36) unstable; urgency=low + + * Fix indicator issue(hide video indicator) + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-36 + + -- Li Wen Sun, 26 Sep 2010 19:40:18 +0800 + +ug-image-viewer-efl (1.0-35) unstable; urgency=low + + * Fix indicator issue(hide video indicator) + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-35 + + -- Li Suxia Sun, 26 Sep 2010 18:40:18 +0800 + +ug-image-viewer-efl (1.0-34) unstable; urgency=low + + * Fix slide show for video-image + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-34 + + -- Li Suxia Sun, 26 Sep 2010 17:43:44 +0800 + +ug-image-viewer-efl (1.0-33) unstable; urgency=low + + * Fix flick not smooth issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-33 + + -- Li Suxia Sat, 25 Sep 2010 19:58:22 +0800 + +ug-image-viewer-efl (1.0-32) unstable; urgency=low + + * Fix video-image slideshow + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-32 + + -- Li Suxia Tue, 21 Sep 2010 18:13:48 +0800 + +ug-image-viewer-efl (1.0-31) unstable; urgency=low + + * Fix slideshow for video-image + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-31 + + -- Li Suxia Mon, 20 Sep 2010 17:39:13 +0800 + +ug-image-viewer-efl (1.0-30) unstable; urgency=low + + * Enable navibar cb in video-player & for upload + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-30 + + -- Li Suxia Mon, 20 Sep 2010 13:08:59 +0800 + +ug-image-viewer-efl (1.0-29) unstable; urgency=low + + * Fix pinch zoom flick issue. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-29 + + -- Li Suxia Fri, 17 Sep 2010 17:28:36 +0800 + +ug-image-viewer-efl (1.0-28) unstable; urgency=low + + * Fix pinch zoom flick issue. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-28 + + -- Li Suxia Thu, 16 Sep 2010 17:37:33 +0800 + +ug-image-viewer-efl (1.0-27) unstable; urgency=low + + * Fix repeat-event issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-27 + + -- Li Suxia Wed, 15 Sep 2010 11:33:23 +0800 + +ug-image-viewer-efl (1.0-26) unstable; urgency=low + + * Fix rotate issue + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-26 + + -- Li Suxia Tue, 14 Sep 2010 17:32:51 +0800 + +ug-image-viewer-efl (1.0-25) unstable; urgency=low + + * Enable Set_as feature + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-25 + + -- Li Suxia Tue, 14 Sep 2010 09:46:24 +0800 + +ug-image-viewer-efl (1.0-24) unstable; urgency=low + + * Reupload for EFL upgrade + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-24 + + -- Li Suxia Sat, 11 Sep 2010 16:37:21 +0800 + +ug-image-viewer-efl (1.0-23) unstable; urgency=low + + * Upload for EFL upgrade + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-23 + + -- Li Suxia Sat, 10 Sep 2010 16:31:55 +0800 + +ug-image-viewer-efl (1.0-22) unstable; urgency=low + + * Enable pinch zoom & adjust video slide. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-22 + + -- Li Suxia Thu, 09 Sep 2010 20:15:55 +0800 + +ug-image-viewer-efl (1.0-21) unstable; urgency=low + + * fix the bug of favorites + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-21 + + -- Gao Wei Tue, 08 Sep 2010 08:15:18 +0800 + +ug-image-viewer-efl (1.0-19) unstable; urgency=low + + *Fix language issue for myfile + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-19 + + -- Li Suxia Tue, 07 Sep 2010 13:15:18 +0800 + +ug-image-viewer-efl (1.0-18) unstable; urgency=low + + * Fix issue related with camera. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-18 + + -- Li Suxia Mon, 06 Sep 2010 15:30:17 +0800 + +ug-image-viewer-efl (1.0-17) unstable; urgency=low + + * Fix indicator & disable pinch zoom. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-17 + + -- Li Suxia Sat, 04 Sep 2010 17:32:32 +0800 + +ug-image-viewer-efl (1.0-16) unstable; urgency=low + + * Fix context popup issue, enable image-editor & set as wallpaper. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-16 + + -- Li Suxia Fri, 03 Sep 2010 08:35:01 +0800 + +ug-image-viewer-efl (1.0-15) unstable; urgency=low + + * Fix issue related with image-editor launch. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-15 + + -- Li Suxia Wed, 01 Sep 2010 17:44:31 +0800 + +ug-image-viewer-efl (1.0-14) unstable; urgency=low + + * Fix rotate issue. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-14 + + -- Li Suxia Wed, 01 Sep 2010 08:13:29 +0800 + +ug-image-viewer-efl (1.0-13) unstable; urgency=low + + * Fix landscape issue for quick view. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-13 + + -- Li Suxia Mon, 30 Aug 2010 17:48:42 +0800 + +ug-image-viewer-efl (1.0-12) unstable; urgency=low + + * fix build error in i686 + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-12 + + -- Gao Wei Fri, 27 Aug 2010 16:15:25 +0800 + +ug-image-viewer-efl (1.0-10) unstable; urgency=low + + * change mouse policy for UG_IVa + * remove common.h from db_handler.h + * Fix landscape bug. + * merge video codes into image viewera + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-10 + + -- Gao Wei Fri, 27 Aug 2010 09:15:25 +0800 + +ug-image-viewer-efl (1.0-8) unstable; urgency=low + + * enable gallery to use IV_UG + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-8 + + -- Gao Wei Wed, 25 Aug 2010 09:15:25 +0800 + +ug-image-viewer-efl (1.0-7) unstable; urgency=low + + * Update param parse and integrat videoplayer ug + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-7 + + -- Li Suxia Tue, 24 Aug 2010 17:03:49 +0800 + +ug-image-viewer-efl (1.0-6) unstable; urgency=low + + * ug will not cluster gallery's db + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-6 + + -- Gao Wei Thu, 23 Aug 2010 14:15:25 +0800 + +ug-image-viewer-efl (1.0-5) unstable; urgency=low + + * lay the evas_object_image under ly_standard + * Update parse param. + * Fix context popup position. + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-5 + + -- Gao Wei Thu, 21 Aug 2010 11:15:25 +0800 + +ug-image-viewer-efl (1.0-4) unstable; urgency=low + + * Upload initial version: image view, slide show + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-4 + + -- Li Suxia Thu, 19 Aug 2010 11:15:25 +0800 + +ug-image-viewer-efl (1.0-1) unstable; urgency=low + + * Upload initial version: image view, slide show + * Git: 165.213.180.234:/git/slp/pkgs/ug-image-viewer-efl + * Tag: ug-image-viewer-efl_1.0-1 + + -- Li Suxia Thu, 19 Aug 2010 10:09:25 +0800 + +ug-image-viewer-efl (1.0-0) unstable; urgency=low + + * Initial version + + -- Li Suxia Mon, 16 Aug 2010 14:00:29 +0900 diff --git a/packaging/ug-image-viewer-efl.changes b/packaging/ug-image-viewer-efl.changes new file mode 100644 index 0000000..ac0ae4e --- /dev/null +++ b/packaging/ug-image-viewer-efl.changes @@ -0,0 +1,134 @@ +* Wed Jun 19 2013 Telle-Tiia Pitkanen submit/tizen_2.2/20130619.073932@adfbbce +- Creating changelog + +* Wed Jun 19 2013 Telle-Tiia Pitkanen submit/tizen_2.2/20130619.073932@80869d0 +- Update version number to 1.7.9 +- Merge "Fixes TZSP-5994, TREL-206: Gallery crashes when end it under Task switcher." into tizen_2.1 +- Launch sharing ugs specifically. Fixes TZSP-6016, TDIS-5131 +- Fixes TZSP-5994, TREL-206: Gallery crashes when end it under Task switcher. +- remove bak file +- update license +- fix operation name +- Merge "fixing the invalid pointer usage" into tizen_2.1 +- Merge "Update license" into tizen_2.1 +- Update license +- fixing the invalid pointer usage +- Merge branch 'master' into 2.1 +- change vconf key for slideshow +- Merge branch 'master' into 2.1 +- add public result at crop +- Merge branch 'master' into 2.1 +- remove fatal to fail popup, show only one file that not in db +- Merge branch 'master' into 2.1 +- add print function +- merge with master +- update version +- update name view +- Tizen 2.1 base +- fix scissor box parent +- show fail popup when rename failed +- Merge branch 'master' into gerrithost/master +- Fix NABI TDIS-3807 +- Increase version_1 +- Merge "Increase version" into tizen_2.0 +- Increase version +- Fix for ug is not launched +- Merge branch 'master' into 2.0 +- apply cnp mode to entry +- Merge branch 'master' into 2.0 +- add license sentence +- Merge branch '2.0' +- fix size evaluation error +- fix region at setas +- Merge branch 'master' into 2.0 +- change app icon +- reset zoom level after rotate by exif +- rename first before db +- Merge branch '2.0' +- Merge branch '2.0' +- apply round globaly +- apply round at zoom slider +- Merge branch '2.0' +- change return value about exif +- load slider item when file deleted +- Merge "add indicator area at setas, crop view" into tizen_2.0 +- Merge branch '2.0' +- add indicator area at setas, crop view +- Merge "fix bug(rotate vconf, useless code)" into tizen_2.0 +- fix bug(rotate vconf, useless code) +- update exif +- update exif +- disable rotate when exif is none +- fix caller id rotate region error +- fix license install, change font name +- apply license +- show cropped file at list +- Merge branch '2.0' +- remove vibration +- Add error check +- Merge branch '2.0' +- enable appgadget +- change ctxpopup to center popup about share +- reset zoom level when item changed +- change license url +- rotate to 0 when rotation is locked +- remove add to home menu +- [TEMP] donot resize twice +- Merge branch 'master' into 2.0 +- abort mouse when pinch +- Merge branch 'master' into 2.0 +- set null when timer expired +- Merge branch 'master' into 2.0 +- add reload function +- apply conformant change +- remove scroll bar at photocam +- Merge branch 'master' into 2.0 +- fix crop region bug +- Merge branch 'master' into 2.0 +- fix app name +- hide zoom slider at some caces, show video thumbnail +- remove print option +- remove thumbnail show +- merge master +- change com.samsung to org.tizen +- fix prevent +- Merge branch 'master' into 2.0 +- merge from private +- fix for rsa +- merge from master +- Merge remote-tracking branch 'gerrithost/master' into 2.0 +- add image file +- use photocam at slideshow +- remove useless code +- remove useless file +- fix setas view +- Squashed commit of the following: +- remove dependency cont. +- remove dependency +- remove 3d dali +- sync main branch +- update string +- save to jpg +- Merge changes Ib0900870,I00430795 +- apply manifest +- Remove unused enum string +- Fix B/S when scrolling in window SDK +- change scissor box event area +- fix signal emit layout +- apply slider update +- update thumbnail after rename +- remove timer when back key selected +- apply zoom icon +- add window to service, remove popup when share app is nothing +- fix destroy me, remove danger code +- fix crop view gui +- add wallpaper bundle +- change icon +- add file:// prefix +- support "file://" prefix +- Fix debug macro +- add missing file +- initial upload +- apply FSL(Flora Software License) +- Initial empty repository + diff --git a/packaging/ug-image-viewer-efl.spec b/packaging/ug-image-viewer-efl.spec new file mode 100755 index 0000000..d207806 --- /dev/null +++ b/packaging/ug-image-viewer-efl.spec @@ -0,0 +1,99 @@ +%define cflags " -Wall -Wextra -g -fpie -fPIC -O3 -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -finstrument-functions -pie -Wl,--as-needed -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" +%define cxxflags " -Wall -Wextra -g -fpie -fPIC -O3 -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -finstrument-functions -pie -Wl,--as-needed -fvisibility-inlines-hidden -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" + +%define _usrdir /usr +%define _ugdir %{_usrdir}/ug +%define _datadir /opt%{_ugdir}/data + +Name: ug-image-viewer-efl +Summary: Image Viewer UI Gadget v1.0 +Version: 1.7.9 +Release: 0 +Group: misc +License: Flora Software License +Source0: %{name}-%{version}.tar.gz + +BuildRequires: cmake +BuildRequires: edje-tools +BuildRequires: gettext-tools +BuildRequires: prelink +BuildRequires: libicu-devel + +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(utilX) +BuildRequires: pkgconfig(libmedia-utils) +BuildRequires: pkgconfig(ui-gadget-1) +BuildRequires: pkgconfig(drm-client) +BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(libexif) +BuildRequires: pkgconfig(efreet) +BuildRequires: pkgconfig(mm-fileinfo) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(xext) +BuildRequires: pkgconfig(xcomposite) +BuildRequires: pkgconfig(media-thumbnail) +BuildRequires: pkgconfig(capi-system-power) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(capi-system-runtime-info) +BuildRequires: pkgconfig(capi-system-sensor) +BuildRequires: pkgconfig(capi-media-metadata-extractor) +BuildRequires: pkgconfig(capi-content-mime-type) +BuildRequires: pkgconfig(capi-content-media-content) +BuildRequires: pkgconfig(capi-system-system-settings) + +%description +Description: Image Viewer UI Gadget v1.0 + +%prep +%setup -q + +%build + +CFLAGS+=%cflags +CXXFLAGS+=%cxxflags + +%ifarch %{arm} +%define ARCH arm +CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon -mfloat-abi=softfp " +CFLAGS+=" -D_ARCH_ARM_ -mfpu=neon -mfloat-abi=softfp " +%else +%define ARCH i586 +%endif + +export CXXFLAGS +export CFLAGS + +cmake . -DCMAKE_INSTALL_PREFIX=%{_ugdir}/ -DCMAKE_DATA_DIR=%{_datadir} -DARCH=%{ARCH} + +make %{?jobs:-j%jobs} + + +%install +rm -rf %{buildroot} +%make_install +mkdir -p %{buildroot}/usr/share/license +cp LICENSE.Flora %{buildroot}/usr/share/license/%{name} + +execstack -c %{buildroot}%{_ugdir}/lib/libug-image-viewer-efl.so.0.1.0 + +%post +chown -R 5000:5000 %{_datadir}/ug-image-viewer-efl +mkdir -p /usr/ug/bin/ +ln -sf /usr/bin/ug-client /usr/ug/bin/image-viewer-efl + +%files +%manifest ug-image-viewer-efl.manifest +%defattr(-,root,root,-) +%dir %{_datadir}/ug-image-viewer-efl + +%defattr(-,root,root,-) +%{_ugdir}/* + +/usr/share/license/%{name} +/usr/share/packages/*.xml + diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt new file mode 100644 index 0000000..8525d2a --- /dev/null +++ b/res/CMakeLists.txt @@ -0,0 +1,5 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) + +INSTALL(DIRECTORY images/ DESTINATION ${CMAKE_INSTALL_PREFIX}/res/images/${IVUG_PACKAGE_NAME}) + +ADD_SUBDIRECTORY(po) diff --git a/res/appicon/ug-image-viewer-efl.png b/res/appicon/ug-image-viewer-efl.png new file mode 100755 index 0000000000000000000000000000000000000000..e20bd23aeb5c07f71ebe994f7f6f78071d3654cf GIT binary patch literal 24024 zcmV)RK(oJzP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B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Gbw>p)4{iEi8+&5QfvY%Z5&@!}_YQ*=rMI(z@GJ+t@o&)ir(HF(f;Fi_&F`0)oCs{fV$k$?8% zKlau9`$ze!8badcYHiPc-JNT1d(-)~KYMzmdSJD#HbzzD%c{IQEa=MAO^t8rvY{ns z>~Pjz)?B=*?@2LWj3uUobq14#z72)3uq6kP^Rb5kxT>raN~veLXybm{?Ok7nCqMqe z;V=H?^9LUpwBY+k9t7m0F!xouK7TkV3-A*^a36mhAMgE{r_69Z(rECqjSCy~g*TmF zee=WTR=@t#O7-B_x%IWCS+TaP!>OB5>12jbHpe(i=p)|WRKBH<%CV^k&N@_-7*aW1 z&Ix@NNGVe_o<4N!O_#GSrNdVbyC)xeb^4)4U!Hw@m`~atyk`l7pZJ0M@*mT6`O{^n zTV9w9Yt5?xDXsvklge(r?%d?QJGVy<-?24*{YGQYkG$KcE88^AHKWFRGwi}JrhpA& zP4U8E>7jD8&RXeW3~kI^m-BMb$Ag1qcD#@Lh3&T+gpa~&+oKXuFk^lfYy%AW^V_09lqM3?T=z8$Dgu~;R2=M(Z2U* zo;n=7%>nM}EcmOl;D`S|`uFHz_`>4}^H6*qJ;E*j-un5UsA0a8kN@ug_1Q39Ol0HO P00000NkvXXu0mjfTis4J literal 0 HcmV?d00001 diff --git a/res/images/T01_Nocontents_broken.png b/res/images/T01_Nocontents_broken.png new file mode 100644 index 0000000000000000000000000000000000000000..9326d0a5be19bea8add45169d1c4c03f40b54bec GIT binary patch literal 4880 zcmai1WmMGN_WmK=-60)AIW$OjBf}t#FbIPnDN6Ga4i4QdNH>TB4Be@efOJWTq%S!r z_2>TA{r0YV?}z>Dwa(ekUS~gF_H&}17;2FcF%ba(K&qpy4!O^R_t8s$caKy=9eVeP z&{Nyu6#x)Z|0}S7?Dq@+KxFhnP3_4OXAd8bSI!=u>^f>{?4I5pPA^_M0)XFQt_d7! zvP-9cSv^zLLx!g6c|d3h*deMhp)^UnAPzzbT_i`r0AJ3c-%meyE^ zB${X*e~Y6qKB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_#gx0&Q{HZe6Df6m~p02Vjq+_NIkmPNmJ96lnx+CK=wqDr&TrCJNbdJz?! +#include +#include "ivug-define.h" + +/* Original code is in appcore-common.h */ +#define gettext_noop(str) (str) /**< keyword for xgettext to extract translatable strings */ +#define N_(str) gettext_noop(str) /**< gettext_noop alias */ + + +#define LOCALE_PATH PREFIX"/res/locale" + +#ifndef PACKAGE +#error PACKAGE is not defined +#endif + +#ifndef LOCALE_PATH +#error LOCALE_PATH is not defined +#endif + +//string +#define IVUG_TEXT_DOMAIN PACKAGE +#define IVUG_LOCALEDIR LOCALE_PATH + +/***********************************************/ +/* String has to be sorted in ascending order. */ +/***********************************************/ + +// Not yet translated + + +#define IDS_DRM_INTERVAL_BASED_DAYS _("You can use %s for %d days. Would you like to open it now?") +#define IDS_DRM_TIME_BASED_GET _("%s is about to be locked. Do you want to get more licenses?") +#define IDS_DRM_COUNT_BASED_OPEN_ONE _("You have one more use of %s. Do you want to open it now?") +#define IDS_DRM_COUNT_BASED_OPEN_MANY _("You have %d more uses of %s. Do you want to open it now?") +#define IDS_DRM_COUNT_BASED_ONE_MORE_GET _("You have one more use of %s. Do you want to get more licenses?") +#define IDS_DRM_COUNT_BASED_NO_MORE_GET _("You have no more use of %s. Do you want to get more licenses?") +#define IDS_DRM_UNLOCK _("%s is currently locked. Do you want to unlock it now?") + +#define IDS_COLLABORATIVE_PLAY _("Collaborative play") + + +#define IDS_ADD_NAME (dgettext(IVUG_TEXT_DOMAIN, "IDS_FT_OPT_ADD_NAME")) +#define IDS_SET_AS_CALLER_ID (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_SET_AS_CALLER_ID_M_PAST_TENSE")) +#define IDS_MMS _("MMS") +#define IDS_INVALID_NAME _("Invalid name") + +#define IDS_ORIENTATION (dgettext(IVUG_TEXT_DOMAIN, "IDS_MEDIABR_HEADER_ORIENTATION")) +#define IDS_MANUFACTURE (dgettext(IVUG_TEXT_DOMAIN, "IDS_MEDIABR_HEADER_MANUFACTURER")) +#define IDS_MODEL (dgettext(IVUG_TEXT_DOMAIN, "IDS_MEDIABR_HEADER_MODEL")) +#define IDS_FLASH (dgettext(IVUG_TEXT_DOMAIN, "IDS_CAM_BODY_FLASH")) +#define IDS_NO_FLASH _("No Flash") +#define IDS_FOCAL_LENGTH (dgettext(IVUG_TEXT_DOMAIN, "IDS_CAM_BODY_FOCAL_LENGTH")) +#define IDS_WHITE_BALANCE (dgettext(IVUG_TEXT_DOMAIN, "IDS_CAM_BODY_WHITE_BALANCE")) +#define IDS_AUTO (dgettext(IVUG_TEXT_DOMAIN, "IDS_CAM_BODY_AUTO")) +#define IDS_MANUAL (dgettext("sys_string", "IDS_COM_BODY_MANUAL")) +#define IDS_APERTURE (dgettext(IVUG_TEXT_DOMAIN, "IDS_CAM_BODY_APERTURE")) +#define IDS_EXPOSURE_TIME (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_EXPOSURE_TIME_ABB")) +#define IDS_ISO (dgettext(IVUG_TEXT_DOMAIN, "IDS_CAM_BODY_ISO")) + +#define IDS_UNABLE_TO_OPEN_FILE _("Unable to open file") +#define IDS_CANNOT_LOAD_FILE_LST _("Cannot load file list") + +#define IDS_NULL _("") + +#define IDS_WIFI_DIRECT _("Wi-Fi Direct") + +#define IDS_ADD_TO_HOME (dgettext(IVUG_TEXT_DOMAIN, "IDS_MEDIABR_SK2_ADD_TO_HOME")) +#define IDS_CREATE_TAG (dgettext(IVUG_TEXT_DOMAIN, "IDS_MEDIABR_OPT_CREATE_TAG")) + +#define IDS_FACE_TAG (dgettext(IVUG_TEXT_DOMAIN, "IDS_PBR_OPT_FACE_TAGGING")) + +#define IDS_WALLPAPER_NOTIFY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_WALLPAPER")) +#define IDS_CROP_NOTIFY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_SELECT_AN_AREA_TO_CROP_THE_PICTURE")) +#define IDS_CALLER_ID_NOTIFY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_CONTACT_PICTURE")) +#define IDS_PRINT_NOTIFY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_SELECTED_AREA_WILL_BE_PRINTED")) + +/* Registered string in STMS IV */ +#define IDS_ACCUMULATED_TIME (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_ACCUMULATED_TIME")) +#define IDS_ADD_TAG (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_HEADER_ADD_TAG")) +#define IDS_ADDED (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_ADDED")) +#define IDS_ALL_ALBUMS (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_HEADER_ALL_ALBUMS")) +#define IDS_ANY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_ANY")) +#define IDS_AVAILABLE_USES (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_AVAILABLE_USES")) +#define IDS_BASIC (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_BASIC")) +#define IDS_BUDDY_PHOTO_SHARE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_BUDDY_PHOTO_SHARE")) +#define IDS_CALLER_IMAGE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_CALLER_IMAGE")) +#define IDS_COPY_TO_CLIPBOARD (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_COPY_TO_CLIPBOARD")) +#define IDS_COUNT (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_COUNT")) +#define IDS_CROP (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_CROP")) +#define IDS_DATE_CREATED (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_DATE_CREATED")) +#define IDS_DISPLAY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_DISPLAY")) +#define IDS_DO_NOT_SEND (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_DO_NOT_SEND")) +#define IDS_EDIT_TAG (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_EDIT_TAG")) +#define IDS_ENTER_TAG_NAME (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_ENTER_TAG_NAME")) +#define IDS_ENTRY_IS_EMPTY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_ENTRY_IS_EMPTY")) +#define IDS_EXECUTE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_EXECUTE")) +#define IDS_FORMAT (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_FILE_FORMAT")) +#define IDS_FILE_LOCATION (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_FILE_LOCATION")) +#define IDS_FILE_TRANSFER (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_FILE_TRANSFER")) +#define IDS_FORWARDING (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_FORWARDING")) +#define IDS_HOME_AND_LOCK_SCREEN_WALLPAPER (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_HOME_AND_LOCK_SCREEN_WALLPAPER")) +#define IDS_HOME_AND_LOCK_SCREENS (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_HOME_AND_LOCK_SCREENS")) +#define IDS_HOME_SCREEN (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_HOME_SCREEN")) +#define IDS_HOME_SCREEN_WALLPAPER (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_HEADER_HOME_SCREEN_WALLPAPER_ABB")) +#define IDS_IMPOSSIBLE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_IMPOSSIBLE")) +#define IDS_INDIVIDUAL (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_INDIVIDUAL")) +#define IDS_INTERVAL (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_INTERVAL")) +#define IDS_INVALID_IMAGE_FILE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_INVALID_IMAGE_FILE")) +#define IDS_LATITUDE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_LATITUDE")) +#define IDS_LOCK_SCREEN (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_LOCK_SCREEN")) +#define IDS_LOCK_SCREEN_WALLPAPER (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB")) +#define IDS_LONGITUDE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_LONGITUDE")) +#define IDS_MANUALLY_DETECT (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_MANUALLY_DETECT")) +#define IDS_MAX_CHAR_LENGTH_REACHED (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED")) +#define IDS_ME (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_ME")) +#define IDS_N_A (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_N_A")) +#define IDS_NEW_TAG (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_NEW_TAG")) +#define IDS_PERMISSION_DENIED (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_PERMISSION_DENIED")) +#define IDS_POSSIBLE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_POSSIBLE")) +#define IDS_PRINT (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_PRINT")) +#define IDS_PRINT_VIA_BLUETOOH (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_PRINT_VIA_BLUETOOTH")) +#define IDS_REMOVE_TAG (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_REMOVE_TAG")) +#define IDS_RESOLUTION (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_RESOLUTION")) +#define IDS_RIGHT_STATUS (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_RIGHT_STATUS")) +#define IDS_ROTATE_LEFT (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_ROTATE_LEFT")) +#define IDS_ROTATE_RIGHT (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_ROTATE_RIGHT")) +#define IDS_SD_CARD_REMOVED (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_SD_CARD_REMOVED")) +#define IDS_SELECT_DEVICE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_SELECT_DEVICE")) +#define IDS_SERVER_NAME (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_SERVER_NAME")) +#define IDS_SET_AS (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_SET_AS")) +#define IDS_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_POP_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN")) +#define IDS_SHARE (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_SHARE")) +#define IDS_SHARE_VIA (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_SHARE_VIA")) +#define IDS_SLIDE_SHOW (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_SLIDE_SHOW")) +#define IDS_TAG (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_TAG")) +#define IDS_TIMED_COUNT (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_TIMED_COUNT")) +#define IDS_TRIM (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_TRIM")) +#define IDS_UNLIMITED (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_UNLIMITED")) +#define IDS_USE_MOTION (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_OPT_USE_MOTION")) +#define IDS_VALIDITY (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_VALIDITY")) +#define IDS_VENDOR (dgettext(IVUG_TEXT_DOMAIN, "IDS_IV_BODY_VENDOR")) + + +// System string. +#define IDS_BLUETOOTH (dgettext("sys_string", "IDS_COM_BODY_BLUETOOTH")) +#define IDS_EMAIL (dgettext("sys_string", "IDS_COM_BODY_EMAIL")) +#define IDS_MESSAGE (dgettext("sys_string", "IDS_COM_BODY_MESSAGE")) +#define IDS_WI_FI (dgettext("sys_string", "IDS_COM_BODY_WI_FI")) +#define IDS_NFC (dgettext("sys_string", "IDS_COM_BODY_NFC")) + +#define IDS_FACEBOOK (dgettext("sys_string", "IDS_COM_BODY_FACEBOOK")) +#define IDS_PICASA (dgettext("sys_string", "IDS_COM_BODY_PICASA")) +#define IDS_TWITTER (dgettext("sys_string", "IDS_COM_BODY_TWITTER")) +#define IDS_YOUTUBE (dgettext("sys_string", "IDS_COM_BODY_YOU_TUBE")) + +#define IDS_APPLICATION_NOT_INSTALLED (dgettext("sys_string", "IDS_COM_BODY_APPLICATION_NOT_INSTALLED")) +#define IDS_BACK (dgettext("sys_string", "IDS_COM_BODY_BACK")) +#define IDS_CANCEL (dgettext("sys_string", "IDS_COM_SK_CANCEL")) +#define IDS_CLOSE (dgettext("sys_string", "IDS_COM_BODY_CLOSE")) +#define IDS_CHANGE_NAME (dgettext("sys_string", "IDS_COM_BODY_CHANGE_NAME")) +#define IDS_COPY (dgettext("sys_string", "IDS_COM_BODY_COPY")) +#define IDS_COPIED_TO_CLIPBOARD (dgettext("sys_string", "IDS_COM_POP_COPIED_TO_CLIPBOARD")) +#define IDS_DETAILS (dgettext("sys_string", "IDS_COM_BODY_DETAILS")) +#define IDS_DELETE_MSG (dgettext("sys_string", "IDS_COM_POP_DELETE_Q")) +#define IDS_DELETE (dgettext("sys_string", "IDS_COM_BODY_DELETE")) +#define IDS_DELETED (dgettext("sys_string", "IDS_COM_POP_DELETED")) +#define IDS_DONE (dgettext("sys_string", "IDS_COM_SK_DONE")) +#define IDS_DOWNLOAD (dgettext("sys_string", "IDS_COM_SK_DOWNLOAD")) +#define IDS_DOWNLOAD_FAILED (dgettext("sys_string", "IDS_COM_POP_DOWNLOAD_FAILED")) +#define IDS_EDIT (dgettext("sys_string", "IDS_COM_BODY_EDIT")) +#define IDS_ENTER_NAME (dgettext("sys_string", "IDS_COM_BODY_ENTER_NAME")) +#define IDS_ERROR (dgettext("sys_string", "IDS_COM_POP_ERROR")) +#define IDS_FAILED (dgettext("sys_string", "IDS_COM_POP_FAILED")) +#define IDS_FAVOURITES (dgettext("sys_string", "IDS_COM_BODY_FAVOURITES")) +#define IDS_LOADING (dgettext("sys_string", "IDS_COM_BODY_LOADING")) +#define IDS_LOCATION (dgettext("sys_string", "IDS_COM_BODY_LOCATION")) +#define IDS_MORE (dgettext("sys_string", "IDS_COM_BODY_MORE")) +#define IDS_MOVE (dgettext("sys_string", "IDS_COM_BODY_MOVE")) +#define IDS_NAME (dgettext("sys_string", "IDS_COM_BODY_DETAILS_NAME")) +#define IDS_NO (dgettext("sys_string", "IDS_COM_SK_NO")) +#define IDS_NO_NAME (dgettext("sys_string", "IDS_COM_BODY_NO_NAME")) +#define IDS_OFF (dgettext("sys_string", "IDS_COM_BODY_OFF")) +#define IDS_OK (dgettext("sys_string", "IDS_COM_SK_OK")) +#define IDS_ON (dgettext("sys_string", "IDS_COM_BODY_ON")) +#define IDS_PLAY (dgettext("sys_string", "IDS_COM_SK_PLAY")) +#define IDS_SAVE (dgettext("sys_string", "IDS_COM_SK_SAVE")) +#define IDS_SAVED (dgettext("sys_string", "IDS_COM_POP_SAVED")) +#define IDS_SEND (dgettext("sys_string", "IDS_COM_BODY_SEND")) +#define IDS_SET (dgettext("sys_string", "IDS_COM_SK_SET")) +#define IDS_SIZE (dgettext("sys_string", "IDS_COM_BODY_SIZE")) +#define IDS_SUCCESS (dgettext("sys_string", "IDS_COM_POP_SUCCESS")) +#define IDS_SYSTEM (dgettext("sys_string", "IDS_COM_BODY_SYSTEM")) +#define IDS_TIME (dgettext("sys_string", "IDS_COM_POP_TIME")) +#define IDS_TYPE (dgettext("sys_string", "IDS_COM_POP_TYPE")) +#define IDS_UNKNOWN (dgettext("sys_string", "IDS_COM_BODY_UNKNOWN")) +#define IDS_YES (dgettext("sys_string", "IDS_COM_SK_YES")) + + +#endif // __IVUG_STRING_H__ + + diff --git a/res/po/CMakeLists.txt b/res/po/CMakeLists.txt new file mode 100644 index 0000000..2b8b7d1 --- /dev/null +++ b/res/po/CMakeLists.txt @@ -0,0 +1,28 @@ +# for i18n + +SET(POFILES ar.po az.po bg.po ca.po cs.po da.po de_DE.po el_GR.po en.po en_PH.po en_US.po +es_ES.po es_MX.po et.po eu.po fi.po fr_CA.po fr_FR.po ga.po gl.po hi.po hr.po hu.po hy.po +is.po it_IT.po ja_JP.po ka.po kk.po ko_KR.po lt.po lv.po mk.po nb.po nl_NL.po pl.po pt_BR.po +pt_PT.po ro.po ru_RU.po sk.po sl.po sr.po sv.po tr_TR.po uk.po uz.po zh_CN.po zh_HK.po zh_SG.po zh_TW.po) + +SET(MSGFMT "/usr/bin/msgfmt") + +FOREACH(pofile ${POFILES}) + SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile}) + MESSAGE("PO: ${pofile}") + GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE) + GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE) + SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo) + ADD_CUSTOM_COMMAND( + OUTPUT ${moFile} + COMMAND ${MSGFMT} -o ${moFile} ${absPofile} + DEPENDS ${absPofile} + ) + INSTALL(FILES ${moFile} + DESTINATION /usr/ug/res/locale/${lang}/LC_MESSAGES RENAME ${IVUG_PACKAGE_NAME}.mo) + SET(moFiles ${moFiles} ${moFile}) +ENDFOREACH(pofile) + +MESSAGE(".mo files: ${moFiles}") +ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles}) + diff --git a/res/po/ar.po b/res/po/ar.po new file mode 100755 index 0000000..09247df --- /dev/null +++ b/res/po/ar.po @@ -0,0 +1,288 @@ +msgid "IDS_MEDIABR_SK2_ADD_TO_HOME" +msgstr "إضافة الى الرئيسية" + +msgid "IDS_CAM_BODY_AUTO" +msgstr "تلقائي" + +msgid "IDS_CAM_BODY_FLASH" +msgstr "فلاش" + +msgid "IDS_CAM_BODY_ISO" +msgstr "ISO" + +msgid "IDS_IV_OPT_COPY_TO_CLIPBOARD" +msgstr "نسخ إلى الحافظة" + +msgid "IDS_CAM_BODY_FLASH_ON" +msgstr "تشغيل فلاش" + +msgid "IDS_CAM_BODY_FLASH_OFF" +msgstr "إلغاء الفلاش" + +msgid "IDS_CAM_BODY_WHITE_BALANCE" +msgstr "توازن اللون الأبيض" + +msgid "IDS_CAM_BUTTON_AUTO" +msgstr "تلقائي" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "إنشاء ع." + +msgid "IDS_CAM_OPT_WHITE_BALANCE_ABB" +msgstr "توازن اللون الأبيض" + +msgid "IDS_IV_BODY_ACCUMULATED_TIME" +msgstr "الوقت المتراكم" + +msgid "IDS_IV_HEADER_ADD_TAG" +msgstr "إضافة علامة" + +msgid "IDS_IV_POP_ADDED" +msgstr "تمت الإضافة" + +msgid "IDS_IV_BODY_ANY" +msgstr "أي" + +msgid "IDS_IV_BODY_AVAILABLE_USES" +msgstr "الاستخدامات المتوفرة" + +msgid "IDS_IV_BODY_BASIC" +msgstr "أساسي" + +msgid "IDS_IV_BODY_CALLER_IMAGE" +msgstr "صورة المتصل" + +msgid "IDS_IV_BODY_COUNT" +msgstr "العدد" + +msgid "IDS_IV_BODY_DATE_CREATED" +msgstr "تاريخ الإنشاء" + +msgid "IDS_IV_BODY_DISPLAY" +msgstr "الشاشة" + +msgid "IDS_IV_POP_ENTER_TAG_NAME" +msgstr "أدخل اسم الرمز" + +msgid "IDS_IV_POP_ENTRY_IS_EMPTY" +msgstr "المدخل خالي" + +msgid "IDS_IV_BODY_EXECUTE" +msgstr "تنفيذ" + +msgid "IDS_IV_BODY_FILE_FORMAT" +msgstr "تنسيق الملف" + +msgid "IDS_IV_BODY_FILE_LOCATION" +msgstr "موقع الملف" + +msgid "IDS_IV_BODY_FORWARDING" +msgstr "التحويل" + +msgid "IDS_IV_HEADER_HOME_SCREEN_WALLPAPER_ABB" +msgstr "خلفية الشاشة الرئيسية" + +msgid "IDS_IV_BODY_IMPOSSIBLE" +msgstr "غير ممكن" + +msgid "IDS_IV_BODY_INDIVIDUAL" +msgstr "فردي" + +msgid "IDS_IV_BODY_INTERVAL" +msgstr "الفترة" + +msgid "IDS_IV_POP_INVALID_IMAGE_FILE" +msgstr "ملف صورة غير صالح" + +msgid "IDS_IV_BODY_LATITUDE" +msgstr "المدى" + +msgid "IDS_IV_BODY_LOCATIONS" +msgstr "المواقع" + +msgid "IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB" +msgstr "خلفية شاشة القفل" + +msgid "IDS_IV_BODY_LONGITUDE" +msgstr "خط الطول" + +msgid "IDS_IV_POP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED" +msgstr "تم بلوغ أقصى عدد من الأحرف (%d)" + +msgid "IDS_IV_BODY_N_A" +msgstr "غير متاح" + +msgid "IDS_IV_BODY_NEW_TAG" +msgstr "علامة جديدة" + +msgid "IDS_IV_POP_PERMISSION_DENIED" +msgstr "تم رفض الإذن" + +msgid "IDS_IV_BODY_POSSIBLE" +msgstr "ممكن" + +msgid "IDS_IV_BODY_PRINT" +msgstr "طباعة" + +msgid "IDS_IV_OPT_PRINT_VIA_BLUETOOTH" +msgstr "طباعة عبر البلوتوث" + +msgid "IDS_IV_BODY_RESOLUTION" +msgstr "الدقة" + +msgid "IDS_IV_BODY_RIGHT_STATUS" +msgstr "حالة الحقوق" + +msgid "IDS_IV_POP_SD_CARD_REMOVED" +msgstr "تمت إزالة بطاقة SD" + +msgid "IDS_IV_POP_SELECT_DEVICE" +msgstr "تحديد جهاز" + +msgid "IDS_IV_BODY_SERVER_NAME" +msgstr "اسم الخادم" + +msgid "IDS_IV_OPT_SET_AS" +msgstr "تعيين" + +msgid "IDS_IV_POP_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN" +msgstr "تعيين خلفية للشاشة الرئيسية وشاشة القفل" + +msgid "IDS_IV_OPT_SHARE" +msgstr "مشاركة" + +msgid "IDS_IV_OPT_SLIDE_SHOW" +msgstr "عرض الصور" + +msgid "IDS_IV_BODY_TIMED_COUNT" +msgstr "عداد محدد زمنيا" + +msgid "IDS_IV_OPT_TRIM" +msgstr "شذب" + +msgid "IDS_IV_BODY_UNLIMITED" +msgstr "غير محدود" + +msgid "IDS_IV_BODY_VALIDITY" +msgstr "الصلاحية" + +msgid "IDS_IV_BODY_VENDOR" +msgstr "التاجر" + +msgid "IDS_IV_OPT_FILE_TRANSFER" +msgstr "نقل الملف" + +msgid "IDS_IV_BODY_DO_NOT_SHOW_AGAIN" +msgstr "عدم العرض مرة أخرى" + +msgid "IDS_IV_BODY_TAP_AND_HOLD_AT_TWO_POINTS_THEN_TILT_DEVICE_BACK_AND_FORTH_TO_REDUCE_OR_ENLARGE_SCREEN" +msgstr "انقر مع الاستمرار فوق نقطتين ثم قم بإمالة الجهاز للخلف والأمام لتصغير الشاشة أو تكبيرها" + +msgid "IDS_IV_HEADER_LEARN_ABOUT_TILT" +msgstr "تعرف على الإمالة" + +msgid "IDS_IV_HEADER_ALL_ALBUMS" +msgstr "كافة الألبومات" + +msgid "IDS_IV_OPT_TAG" +msgstr "علامة" + +msgid "IDS_IV_OPT_HOME_AND_LOCK_SCREEN_WALLPAPER" +msgstr "خلفية ‏‫شاشة القفل والشاشة الرئيسية‬" + +msgid "IDS_IV_OPT_USE_MOTION" +msgstr "استخدام الحركة" + +msgid "IDS_IV_BODY_HOME_AND_LOCK_SCREENS" +msgstr "شاشتا القفل والرئيسية" + +msgid "IDS_IV_BODY_CROP" +msgstr "قص" + +msgid "IDS_IV_BODY_HOME_SCREEN" +msgstr "الشاشة الرئيسية" + +msgid "IDS_IV_BODY_LOCK_SCREEN" +msgstr "قفل الشاشة" + +msgid "IDS_IV_OPT_ROTATE_LEFT" +msgstr "تدوير لليسار" + +msgid "IDS_IV_OPT_ROTATE_RIGHT" +msgstr "تدوير لليمين" + +msgid "IDS_IV_OPT_MANUALLY_DETECT" +msgstr "اكتشاف يدوي" + +msgid "IDS_IV_BODY_ME" +msgstr "تعليقاتي" + +msgid "IDS_IV_OPT_EDIT_TAG" +msgstr "تعديل العلامة" + +msgid "IDS_IV_OPT_REMOVE_TAG" +msgstr "إزالة العلامة" + +msgid "IDS_IV_BODY_SHARE_VIA" +msgstr "مشاركة عبر" + +msgid "IDS_IV_BODY_DO_NOT_SEND" +msgstr "لا ترسل" + +msgid "IDS_IV_OPT_BUDDY_PHOTO_SHARE" +msgstr "مشاركة صورة الصديق" + +msgid "IDS_PBR_OPT_FACE_TAGGING" +msgstr "ترميز الوجه" + +msgid "IDS_COM_POP_IMAGE_VIEWER" +msgstr "عرض الصور" + +msgid "IDS_IV_BODY_NEARBY_DEVICES_T_ALLSHARE" +msgstr "الأجهزة المجاورة" + +msgid "IDS_IV_BODY_SELECT_AN_AREA_TO_CROP_THE_PICTURE" +msgstr "تحديد منطقة ما من أجل اقتصاص الصورة" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_WALLPAPER" +msgstr "سيتم تطبيق المنطقة المحددة على الخلفية" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_PRINTED" +msgstr "ستتم طباعة المنطقة المحددة" + +msgid "IDS_IV_BODY_YOU_CAN_SHARE_YOUR_MEDIA_WITH_OTHER_DEVICES_USING_NEARBY_DEVICES" +msgstr "يمكنك مشاركة الوسائط مع أجهزة أخرى باستخدام الأجهزة القريبة" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_CONTACT_PICTURE" +msgstr "سيتم تطبيق المنطقة المحددة على صورة جهة الاتصال" + +msgid "IDS_IV_BODY_EXPOSURE_TIME_ABB" +msgstr "زمن التعرض" + +msgid "IDS_CAM_BODY_APERTURE" +msgstr "الفتحة" + +msgid "IDS_MEDIABR_HEADER_ORIENTATION" +msgstr "التوجيه" + +msgid "IDS_MEDIABR_HEADER_MANUFACTURER" +msgstr "المصنع" + +msgid "IDS_CAM_BODY_FOCAL_LENGTH" +msgstr "البعد البؤري" + +msgid "IDS_CAM_HEADER_OSDOPTORIENTATION_SCENE" +msgstr "التوجيه" + +msgid "IDS_MEDIABR_HEADER_MODEL" +msgstr "الموديل" + +msgid "IDS_FT_OPT_ADD_NAME" +msgstr "إضافة اسم" + +msgid "IDS_IV_POP_SET_AS_CALLER_ID_M_PAST_TENSE" +msgstr "تعيين كهوية المتصل" + +msgid "IDS_MF_BODY_NO_FACE_DETECTED" +msgstr "لم يتم اكتشاف وجه" + diff --git a/res/po/az.po b/res/po/az.po new file mode 100755 index 0000000..601bd8b --- /dev/null +++ b/res/po/az.po @@ -0,0 +1,288 @@ +msgid "IDS_MEDIABR_SK2_ADD_TO_HOME" +msgstr "Başlanğıca əlavə et" + +msgid "IDS_CAM_BODY_AUTO" +msgstr "Avtomatik" + +msgid "IDS_CAM_BODY_FLASH" +msgstr "Parlaq işıq" + +msgid "IDS_CAM_BODY_ISO" +msgstr "ISO" + +msgid "IDS_IV_OPT_COPY_TO_CLIPBOARD" +msgstr "Mübadilə buferinə köçür" + +msgid "IDS_CAM_BODY_FLASH_ON" +msgstr "Flaş yandırılıb" + +msgid "IDS_CAM_BODY_FLASH_OFF" +msgstr "Flash off" + +msgid "IDS_CAM_BODY_WHITE_BALANCE" +msgstr "Ağın balansı" + +msgid "IDS_CAM_BUTTON_AUTO" +msgstr "Avtomatik" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Et.yaradın" + +msgid "IDS_CAM_OPT_WHITE_BALANCE_ABB" +msgstr "Ağ balans" + +msgid "IDS_IV_BODY_ACCUMULATED_TIME" +msgstr "Yığılmış vaxt" + +msgid "IDS_IV_HEADER_ADD_TAG" +msgstr "Et.əlv edn" + +msgid "IDS_IV_POP_ADDED" +msgstr "Əlavə edildi" + +msgid "IDS_IV_BODY_ANY" +msgstr "Hər hansı" + +msgid "IDS_IV_BODY_AVAILABLE_USES" +msgstr "İstifadəsi mümkün olanlar" + +msgid "IDS_IV_BODY_BASIC" +msgstr "Əsas" + +msgid "IDS_IV_BODY_CALLER_IMAGE" +msgstr "Zəng edənin şəkli" + +msgid "IDS_IV_BODY_COUNT" +msgstr "Say" + +msgid "IDS_IV_BODY_DATE_CREATED" +msgstr "Tarix yaradıldı" + +msgid "IDS_IV_BODY_DISPLAY" +msgstr "Displey" + +msgid "IDS_IV_POP_ENTER_TAG_NAME" +msgstr "Etiket adı daxil edin" + +msgid "IDS_IV_POP_ENTRY_IS_EMPTY" +msgstr "Boş qeyd" + +msgid "IDS_IV_BODY_EXECUTE" +msgstr "İcra et" + +msgid "IDS_IV_BODY_FILE_FORMAT" +msgstr "Faylın formatı" + +msgid "IDS_IV_BODY_FILE_LOCATION" +msgstr "Faylın yeri" + +msgid "IDS_IV_BODY_FORWARDING" +msgstr "Göndərilir" + +msgid "IDS_IV_HEADER_HOME_SCREEN_WALLPAPER_ABB" +msgstr "Əsas ekranin divar kağızı" + +msgid "IDS_IV_BODY_IMPOSSIBLE" +msgstr "Mümkün deyil" + +msgid "IDS_IV_BODY_INDIVIDUAL" +msgstr "Fərdi" + +msgid "IDS_IV_BODY_INTERVAL" +msgstr "İnterval" + +msgid "IDS_IV_POP_INVALID_IMAGE_FILE" +msgstr "Şəkil faylı səhvdir" + +msgid "IDS_IV_BODY_LATITUDE" +msgstr "En" + +msgid "IDS_IV_BODY_LOCATIONS" +msgstr "Yerlər" + +msgid "IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB" +msgstr "Ekranin divar kəğizi kilidlə" + +msgid "IDS_IV_BODY_LONGITUDE" +msgstr "Uzunluq" + +msgid "IDS_IV_POP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED" +msgstr "Simvolların sayı maksimuma (%d) çatıb" + +msgid "IDS_IV_BODY_N_A" +msgstr "M/D" + +msgid "IDS_IV_BODY_NEW_TAG" +msgstr "Yeni etiket" + +msgid "IDS_IV_POP_PERMISSION_DENIED" +msgstr "İcazə rədd edildi" + +msgid "IDS_IV_BODY_POSSIBLE" +msgstr "Mümkündür" + +msgid "IDS_IV_BODY_PRINT" +msgstr "Çap et" + +msgid "IDS_IV_OPT_PRINT_VIA_BLUETOOTH" +msgstr "Bluetooth vasitəsilə çap et" + +msgid "IDS_IV_BODY_RESOLUTION" +msgstr "Rezolyusiya" + +msgid "IDS_IV_BODY_RIGHT_STATUS" +msgstr "Düzgün status" + +msgid "IDS_IV_POP_SD_CARD_REMOVED" +msgstr "SD kart çıxarılmışdır" + +msgid "IDS_IV_POP_SELECT_DEVICE" +msgstr "Qurğu seç" + +msgid "IDS_IV_BODY_SERVER_NAME" +msgstr "Server adı" + +msgid "IDS_IV_OPT_SET_AS" +msgstr "Qur" + +msgid "IDS_IV_POP_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN" +msgstr "Əsas ekran üçün divar kağızını qur və ekranı kilidlə" + +msgid "IDS_IV_OPT_SHARE" +msgstr "Paylaş" + +msgid "IDS_IV_OPT_SLIDE_SHOW" +msgstr "Slayd göstərmə" + +msgid "IDS_IV_BODY_TIMED_COUNT" +msgstr "Məhdud say" + +msgid "IDS_IV_OPT_TRIM" +msgstr "Nizamla" + +msgid "IDS_IV_BODY_UNLIMITED" +msgstr "Limitsiz" + +msgid "IDS_IV_BODY_VALIDITY" +msgstr "Etibarlılıq" + +msgid "IDS_IV_BODY_VENDOR" +msgstr "Tədarükçü" + +msgid "IDS_IV_OPT_FILE_TRANSFER" +msgstr "Faylın köçürülməsi" + +msgid "IDS_IV_BODY_DO_NOT_SHOW_AGAIN" +msgstr "Bir daha göstərmə" + +msgid "IDS_IV_BODY_TAP_AND_HOLD_AT_TWO_POINTS_THEN_TILT_DEVICE_BACK_AND_FORTH_TO_REDUCE_OR_ENLARGE_SCREEN" +msgstr "İki nöqtədə vurub saxlayın daha sonra ekranı böyütmək və ya kiçiltmək üçün irəli və geri əyin" + +msgid "IDS_IV_HEADER_LEARN_ABOUT_TILT" +msgstr "Çevirmə haqqıda öyrənin" + +msgid "IDS_IV_HEADER_ALL_ALBUMS" +msgstr "Bütün albomlar" + +msgid "IDS_IV_OPT_TAG" +msgstr "Etiket" + +msgid "IDS_IV_OPT_HOME_AND_LOCK_SCREEN_WALLPAPER" +msgstr "Başlanğıc və kilid ekranı divar kağızı" + +msgid "IDS_IV_OPT_USE_MOTION" +msgstr "Hərəkətdən istifadə edin" + +msgid "IDS_IV_BODY_HOME_AND_LOCK_SCREENS" +msgstr "Əsas və kilid ekranları" + +msgid "IDS_IV_BODY_CROP" +msgstr "Yığ" + +msgid "IDS_IV_BODY_HOME_SCREEN" +msgstr "Əsas ekran" + +msgid "IDS_IV_BODY_LOCK_SCREEN" +msgstr "Ekranı kilidləyin" + +msgid "IDS_IV_OPT_ROTATE_LEFT" +msgstr "Sola döndər" + +msgid "IDS_IV_OPT_ROTATE_RIGHT" +msgstr "Sağa döndər" + +msgid "IDS_IV_OPT_MANUALLY_DETECT" +msgstr "Mexaniki aşkarla" + +msgid "IDS_IV_BODY_ME" +msgstr "Mən" + +msgid "IDS_IV_OPT_EDIT_TAG" +msgstr "Et.red edn" + +msgid "IDS_IV_OPT_REMOVE_TAG" +msgstr "Etiketi silin" + +msgid "IDS_IV_BODY_SHARE_VIA" +msgstr "Paylaş" + +msgid "IDS_IV_BODY_DO_NOT_SEND" +msgstr "Göndərmə" + +msgid "IDS_IV_OPT_BUDDY_PHOTO_SHARE" +msgstr "Dostun şəklini paylaş" + +msgid "IDS_PBR_OPT_FACE_TAGGING" +msgstr "Simanın etiketlənməsi" + +msgid "IDS_COM_POP_IMAGE_VIEWER" +msgstr "Şəkil göstərici" + +msgid "IDS_IV_BODY_NEARBY_DEVICES_T_ALLSHARE" +msgstr "Yaxınlıqdakı cihazlar" + +msgid "IDS_IV_BODY_SELECT_AN_AREA_TO_CROP_THE_PICTURE" +msgstr "Şəkli kəsmək üçün sahəni seçin" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_WALLPAPER" +msgstr "Seçilmiş sahə divar kağızına tətbiq ediləcək" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_PRINTED" +msgstr "Seçilmiş sahə çap ediləcək" + +msgid "IDS_IV_BODY_YOU_CAN_SHARE_YOUR_MEDIA_WITH_OTHER_DEVICES_USING_NEARBY_DEVICES" +msgstr "Siz yaxınlıqdakı cihazlardan istifadə edərək medianı digər cihazlarla paylaşa bilərsiniz" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_CONTACT_PICTURE" +msgstr "Seçilmiş sahə kontakt şəklinə tətbiq ediləcək" + +msgid "IDS_IV_BODY_EXPOSURE_TIME_ABB" +msgstr "Nümayiş vaxtı" + +msgid "IDS_CAM_BODY_APERTURE" +msgstr "Apertura" + +msgid "IDS_MEDIABR_HEADER_ORIENTATION" +msgstr "İsitqamət" + +msgid "IDS_MEDIABR_HEADER_MANUFACTURER" +msgstr "İstehsalçı" + +msgid "IDS_CAM_BODY_FOCAL_LENGTH" +msgstr "Linzanın uzunluğu" + +msgid "IDS_CAM_HEADER_OSDOPTORIENTATION_SCENE" +msgstr "İsitqamət" + +msgid "IDS_MEDIABR_HEADER_MODEL" +msgstr "Model" + +msgid "IDS_FT_OPT_ADD_NAME" +msgstr "Ad əlavə et" + +msgid "IDS_IV_POP_SET_AS_CALLER_ID_M_PAST_TENSE" +msgstr "Zəng edənin kimliyi kimi təyin et" + +msgid "IDS_MF_BODY_NO_FACE_DETECTED" +msgstr "Üz göstərilmir" + diff --git a/res/po/bg.po b/res/po/bg.po new file mode 100755 index 0000000..27790b8 --- /dev/null +++ b/res/po/bg.po @@ -0,0 +1,288 @@ +msgid "IDS_MEDIABR_SK2_ADD_TO_HOME" +msgstr "Добави към дом." + +msgid "IDS_CAM_BODY_AUTO" +msgstr "Авто" + +msgid "IDS_CAM_BODY_FLASH" +msgstr "Светкавица" + +msgid "IDS_CAM_BODY_ISO" +msgstr "ISO" + +msgid "IDS_IV_OPT_COPY_TO_CLIPBOARD" +msgstr "Копирай в клипборда" + +msgid "IDS_CAM_BODY_FLASH_ON" +msgstr "Светкавица вкл." + +msgid "IDS_CAM_BODY_FLASH_OFF" +msgstr "Светкавица изкл." + +msgid "IDS_CAM_BODY_WHITE_BALANCE" +msgstr "Баланс на бялото" + +msgid "IDS_CAM_BUTTON_AUTO" +msgstr "Авто" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Създ. таг" + +msgid "IDS_CAM_OPT_WHITE_BALANCE_ABB" +msgstr "Баланс на бялото" + +msgid "IDS_IV_BODY_ACCUMULATED_TIME" +msgstr "Натрупано време" + +msgid "IDS_IV_HEADER_ADD_TAG" +msgstr "Добави таг" + +msgid "IDS_IV_POP_ADDED" +msgstr "Добавен" + +msgid "IDS_IV_BODY_ANY" +msgstr "Всеки" + +msgid "IDS_IV_BODY_AVAILABLE_USES" +msgstr "Налични употреби" + +msgid "IDS_IV_BODY_BASIC" +msgstr "Базово" + +msgid "IDS_IV_BODY_CALLER_IMAGE" +msgstr "Изобр. повикващ" + +msgid "IDS_IV_BODY_COUNT" +msgstr "Броене" + +msgid "IDS_IV_BODY_DATE_CREATED" +msgstr "Дата на създаване" + +msgid "IDS_IV_BODY_DISPLAY" +msgstr "Дисплей" + +msgid "IDS_IV_POP_ENTER_TAG_NAME" +msgstr "Въведете име на таг" + +msgid "IDS_IV_POP_ENTRY_IS_EMPTY" +msgstr "Празен запис" + +msgid "IDS_IV_BODY_EXECUTE" +msgstr "Изпълни" + +msgid "IDS_IV_BODY_FILE_FORMAT" +msgstr "Формат на файла" + +msgid "IDS_IV_BODY_FILE_LOCATION" +msgstr "Местоположение на файла" + +msgid "IDS_IV_BODY_FORWARDING" +msgstr "Препращане" + +msgid "IDS_IV_HEADER_HOME_SCREEN_WALLPAPER_ABB" +msgstr "Тапет начален екран" + +msgid "IDS_IV_BODY_IMPOSSIBLE" +msgstr "Невъзможно" + +msgid "IDS_IV_BODY_INDIVIDUAL" +msgstr "Индивидуален" + +msgid "IDS_IV_BODY_INTERVAL" +msgstr "Интервал" + +msgid "IDS_IV_POP_INVALID_IMAGE_FILE" +msgstr "Невалиден файл на изображение" + +msgid "IDS_IV_BODY_LATITUDE" +msgstr "Геогр. ширина" + +msgid "IDS_IV_BODY_LOCATIONS" +msgstr "Местоположения" + +msgid "IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB" +msgstr "Тапет заключен екран" + +msgid "IDS_IV_BODY_LONGITUDE" +msgstr "Геогр. дължина" + +msgid "IDS_IV_POP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED" +msgstr "Достигнат е максималният брой знаци (%d)" + +msgid "IDS_IV_BODY_N_A" +msgstr "н.д." + +msgid "IDS_IV_BODY_NEW_TAG" +msgstr "Нов таг" + +msgid "IDS_IV_POP_PERMISSION_DENIED" +msgstr "Отказано разрешение" + +msgid "IDS_IV_BODY_POSSIBLE" +msgstr "Lъзможно" + +msgid "IDS_IV_BODY_PRINT" +msgstr "Отпечатаване" + +msgid "IDS_IV_OPT_PRINT_VIA_BLUETOOTH" +msgstr "Печат чрез Bluetooth" + +msgid "IDS_IV_BODY_RESOLUTION" +msgstr "Разделителна способност" + +msgid "IDS_IV_BODY_RIGHT_STATUS" +msgstr "Състояние на правата" + +msgid "IDS_IV_POP_SD_CARD_REMOVED" +msgstr "SD картата е извадена" + +msgid "IDS_IV_POP_SELECT_DEVICE" +msgstr "Избор на устр-во" + +msgid "IDS_IV_BODY_SERVER_NAME" +msgstr "Име на сървър" + +msgid "IDS_IV_OPT_SET_AS" +msgstr "Задаване като" + +msgid "IDS_IV_POP_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN" +msgstr "Задаване на тапет за началния екран и екрана за заключване" + +msgid "IDS_IV_OPT_SHARE" +msgstr "Споделям" + +msgid "IDS_IV_OPT_SLIDE_SHOW" +msgstr "Слайдшоу" + +msgid "IDS_IV_BODY_TIMED_COUNT" +msgstr "Отброяване по време" + +msgid "IDS_IV_OPT_TRIM" +msgstr "Орязване" + +msgid "IDS_IV_BODY_UNLIMITED" +msgstr "Неограничен" + +msgid "IDS_IV_BODY_VALIDITY" +msgstr "Валидност" + +msgid "IDS_IV_BODY_VENDOR" +msgstr "Доставчик" + +msgid "IDS_IV_OPT_FILE_TRANSFER" +msgstr "Прехвърляне на файл" + +msgid "IDS_IV_BODY_DO_NOT_SHOW_AGAIN" +msgstr "Не показвай отново" + +msgid "IDS_IV_BODY_TAP_AND_HOLD_AT_TWO_POINTS_THEN_TILT_DEVICE_BACK_AND_FORTH_TO_REDUCE_OR_ENLARGE_SCREEN" +msgstr "Чукнете и задръжте в две точки, след което наклонете устройството напред-назад, за да намалите или увеличите екрана" + +msgid "IDS_IV_HEADER_LEARN_ABOUT_TILT" +msgstr "Научете за накланянето" + +msgid "IDS_IV_HEADER_ALL_ALBUMS" +msgstr "Всички албуми" + +msgid "IDS_IV_OPT_TAG" +msgstr "Таг" + +msgid "IDS_IV_OPT_HOME_AND_LOCK_SCREEN_WALLPAPER" +msgstr "Тапет на началния екран и на заключен екран" + +msgid "IDS_IV_OPT_USE_MOTION" +msgstr "С движение" + +msgid "IDS_IV_BODY_HOME_AND_LOCK_SCREENS" +msgstr "Начален и заключен екран" + +msgid "IDS_IV_BODY_CROP" +msgstr "Изрязване" + +msgid "IDS_IV_BODY_HOME_SCREEN" +msgstr "Начален екран" + +msgid "IDS_IV_BODY_LOCK_SCREEN" +msgstr "Заключен екран" + +msgid "IDS_IV_OPT_ROTATE_LEFT" +msgstr "Завъртане наляво" + +msgid "IDS_IV_OPT_ROTATE_RIGHT" +msgstr "Завъртане надясно" + +msgid "IDS_IV_OPT_MANUALLY_DETECT" +msgstr "Ръчно откриване" + +msgid "IDS_IV_BODY_ME" +msgstr "Мен" + +msgid "IDS_IV_OPT_EDIT_TAG" +msgstr "Редакт.таг" + +msgid "IDS_IV_OPT_REMOVE_TAG" +msgstr "Премахни тага" + +msgid "IDS_IV_BODY_SHARE_VIA" +msgstr "Споделяне чрез" + +msgid "IDS_IV_BODY_DO_NOT_SEND" +msgstr "Не изпращай" + +msgid "IDS_IV_OPT_BUDDY_PHOTO_SHARE" +msgstr "Споделяне на снимки с приятели" + +msgid "IDS_PBR_OPT_FACE_TAGGING" +msgstr "Маркиране на хора в снимки" + +msgid "IDS_COM_POP_IMAGE_VIEWER" +msgstr "Програма за преглед на изображения" + +msgid "IDS_IV_BODY_NEARBY_DEVICES_T_ALLSHARE" +msgstr "Устройства наблизо" + +msgid "IDS_IV_BODY_SELECT_AN_AREA_TO_CROP_THE_PICTURE" +msgstr "Изберете област, за да изрежете снимката" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_WALLPAPER" +msgstr "Избраната зона ще бъде приложена към тапета" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_PRINTED" +msgstr "Избраната област ще бъде отпечатана" + +msgid "IDS_IV_BODY_YOU_CAN_SHARE_YOUR_MEDIA_WITH_OTHER_DEVICES_USING_NEARBY_DEVICES" +msgstr "Можете да споделите мултимедията си с други устройства, като използвате устройства наблизо" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_CONTACT_PICTURE" +msgstr "Избраната зона ще бъде приложена към снимката на записа" + +msgid "IDS_IV_BODY_EXPOSURE_TIME_ABB" +msgstr "Време на експ." + +msgid "IDS_CAM_BODY_APERTURE" +msgstr "Бленда" + +msgid "IDS_MEDIABR_HEADER_ORIENTATION" +msgstr "Ориентация" + +msgid "IDS_MEDIABR_HEADER_MANUFACTURER" +msgstr "Производител" + +msgid "IDS_CAM_BODY_FOCAL_LENGTH" +msgstr "Фокусно разстояние" + +msgid "IDS_CAM_HEADER_OSDOPTORIENTATION_SCENE" +msgstr "Ориентация" + +msgid "IDS_MEDIABR_HEADER_MODEL" +msgstr "Модел" + +msgid "IDS_FT_OPT_ADD_NAME" +msgstr "Добавяне на име" + +msgid "IDS_IV_POP_SET_AS_CALLER_ID_M_PAST_TENSE" +msgstr "Задаване като идентификация на обаждащия се" + +msgid "IDS_MF_BODY_NO_FACE_DETECTED" +msgstr "Не е разпознато лице" + diff --git a/res/po/ca.po b/res/po/ca.po new file mode 100755 index 0000000..96fedee --- /dev/null +++ b/res/po/ca.po @@ -0,0 +1,288 @@ +msgid "IDS_MEDIABR_SK2_ADD_TO_HOME" +msgstr "Afegir a l'inici" + +msgid "IDS_CAM_BODY_AUTO" +msgstr "Auto" + +msgid "IDS_CAM_BODY_FLASH" +msgstr "Flaix" + +msgid "IDS_CAM_BODY_ISO" +msgstr "ISO" + +msgid "IDS_IV_OPT_COPY_TO_CLIPBOARD" +msgstr "Copiar al porta-retalls" + +msgid "IDS_CAM_BODY_FLASH_ON" +msgstr "Flaix activat" + +msgid "IDS_CAM_BODY_FLASH_OFF" +msgstr "Flaix desactivat" + +msgid "IDS_CAM_BODY_WHITE_BALANCE" +msgstr "Balanç de blancs" + +msgid "IDS_CAM_BUTTON_AUTO" +msgstr "Auto" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Crear etiq" + +msgid "IDS_CAM_OPT_WHITE_BALANCE_ABB" +msgstr "Balanç de blancs" + +msgid "IDS_IV_BODY_ACCUMULATED_TIME" +msgstr "Temps acumulat" + +msgid "IDS_IV_HEADER_ADD_TAG" +msgstr "Afeg etiq" + +msgid "IDS_IV_POP_ADDED" +msgstr "Afegit" + +msgid "IDS_IV_BODY_ANY" +msgstr "Qualsevol" + +msgid "IDS_IV_BODY_AVAILABLE_USES" +msgstr "Usos disponibles" + +msgid "IDS_IV_BODY_BASIC" +msgstr "Bàsic" + +msgid "IDS_IV_BODY_CALLER_IMAGE" +msgstr "Imatge de la persona que truca" + +msgid "IDS_IV_BODY_COUNT" +msgstr "Comptatge" + +msgid "IDS_IV_BODY_DATE_CREATED" +msgstr "Data creació" + +msgid "IDS_IV_BODY_DISPLAY" +msgstr "Pantalla" + +msgid "IDS_IV_POP_ENTER_TAG_NAME" +msgstr "Introduir nom d'etiqueta" + +msgid "IDS_IV_POP_ENTRY_IS_EMPTY" +msgstr "L'entrada és buida" + +msgid "IDS_IV_BODY_EXECUTE" +msgstr "Executar" + +msgid "IDS_IV_BODY_FILE_FORMAT" +msgstr "Format del fitxer" + +msgid "IDS_IV_BODY_FILE_LOCATION" +msgstr "Ubicació del fitxer" + +msgid "IDS_IV_BODY_FORWARDING" +msgstr "Reenviant" + +msgid "IDS_IV_HEADER_HOME_SCREEN_WALLPAPER_ABB" +msgstr "Fons pantalla inici" + +msgid "IDS_IV_BODY_IMPOSSIBLE" +msgstr "No és possible" + +msgid "IDS_IV_BODY_INDIVIDUAL" +msgstr "Individual" + +msgid "IDS_IV_BODY_INTERVAL" +msgstr "Interval" + +msgid "IDS_IV_POP_INVALID_IMAGE_FILE" +msgstr "Arxiu d'imatges no vàlid" + +msgid "IDS_IV_BODY_LATITUDE" +msgstr "Latitud" + +msgid "IDS_IV_BODY_LOCATIONS" +msgstr "Ubicacions" + +msgid "IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB" +msgstr "Bloq fons pant inici" + +msgid "IDS_IV_BODY_LONGITUDE" +msgstr "Longitud" + +msgid "IDS_IV_POP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED" +msgstr "S'ha assolit el nombre màxim de caràcters (%d)" + +msgid "IDS_IV_BODY_N_A" +msgstr "N/D" + +msgid "IDS_IV_BODY_NEW_TAG" +msgstr "Nova etiqueta" + +msgid "IDS_IV_POP_PERMISSION_DENIED" +msgstr "Permís denegat" + +msgid "IDS_IV_BODY_POSSIBLE" +msgstr "Possible" + +msgid "IDS_IV_BODY_PRINT" +msgstr "Imprimir" + +msgid "IDS_IV_OPT_PRINT_VIA_BLUETOOTH" +msgstr "Imprimir mitjançant Bluetooth" + +msgid "IDS_IV_BODY_RESOLUTION" +msgstr "Resolució" + +msgid "IDS_IV_BODY_RIGHT_STATUS" +msgstr "Estat correcte" + +msgid "IDS_IV_POP_SD_CARD_REMOVED" +msgstr "Sense targeta SD" + +msgid "IDS_IV_POP_SELECT_DEVICE" +msgstr "Seleccioni dispositiu" + +msgid "IDS_IV_BODY_SERVER_NAME" +msgstr "Nom del servidor" + +msgid "IDS_IV_OPT_SET_AS" +msgstr "Definir com a" + +msgid "IDS_IV_POP_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN" +msgstr "Definir fons de la pantalla d'inici i bloquejar pantalla" + +msgid "IDS_IV_OPT_SHARE" +msgstr "Compartir" + +msgid "IDS_IV_OPT_SLIDE_SHOW" +msgstr "Presentació de diapositives" + +msgid "IDS_IV_BODY_TIMED_COUNT" +msgstr "Compte contrarellotge" + +msgid "IDS_IV_OPT_TRIM" +msgstr "Acoblar" + +msgid "IDS_IV_BODY_UNLIMITED" +msgstr "Il·limitat" + +msgid "IDS_IV_BODY_VALIDITY" +msgstr "Validesa" + +msgid "IDS_IV_BODY_VENDOR" +msgstr "Proveïdor" + +msgid "IDS_IV_OPT_FILE_TRANSFER" +msgstr "Transferència de fitxer" + +msgid "IDS_IV_BODY_DO_NOT_SHOW_AGAIN" +msgstr "No tornar a mostrar" + +msgid "IDS_IV_BODY_TAP_AND_HOLD_AT_TWO_POINTS_THEN_TILT_DEVICE_BACK_AND_FORTH_TO_REDUCE_OR_ENLARGE_SCREEN" +msgstr "Mantingui tocats dos punts i inclini el dispositiu endavant i endarrere per reduir o ampliar la pantalla" + +msgid "IDS_IV_HEADER_LEARN_ABOUT_TILT" +msgstr "Més info inclinació" + +msgid "IDS_IV_HEADER_ALL_ALBUMS" +msgstr "Tots els àlbums" + +msgid "IDS_IV_OPT_TAG" +msgstr "Etiqueta" + +msgid "IDS_IV_OPT_HOME_AND_LOCK_SCREEN_WALLPAPER" +msgstr "Fons de pantalla de pantalla d'inici i bloqueig" + +msgid "IDS_IV_OPT_USE_MOTION" +msgstr "Utilitzar moviment" + +msgid "IDS_IV_BODY_HOME_AND_LOCK_SCREENS" +msgstr "Pantalla inici i bloqueig" + +msgid "IDS_IV_BODY_CROP" +msgstr "Retallar" + +msgid "IDS_IV_BODY_HOME_SCREEN" +msgstr "Pantalla d'inici" + +msgid "IDS_IV_BODY_LOCK_SCREEN" +msgstr "Bloquejar pantalla" + +msgid "IDS_IV_OPT_ROTATE_LEFT" +msgstr "Girar cap a l'esquerra" + +msgid "IDS_IV_OPT_ROTATE_RIGHT" +msgstr "Girar cap a la dreta" + +msgid "IDS_IV_OPT_MANUALLY_DETECT" +msgstr "Detecció manual" + +msgid "IDS_IV_BODY_ME" +msgstr "Jo" + +msgid "IDS_IV_OPT_EDIT_TAG" +msgstr "Edit etiq" + +msgid "IDS_IV_OPT_REMOVE_TAG" +msgstr "Eliminar etiqueta" + +msgid "IDS_IV_BODY_SHARE_VIA" +msgstr "Compartir mitjançant" + +msgid "IDS_IV_BODY_DO_NOT_SEND" +msgstr "No enviar" + +msgid "IDS_IV_OPT_BUDDY_PHOTO_SHARE" +msgstr "Compartir foto d'amic" + +msgid "IDS_PBR_OPT_FACE_TAGGING" +msgstr "Etiqueta cares" + +msgid "IDS_COM_POP_IMAGE_VIEWER" +msgstr "Visor d'imatges" + +msgid "IDS_IV_BODY_NEARBY_DEVICES_T_ALLSHARE" +msgstr "Dispositius propers" + +msgid "IDS_IV_BODY_SELECT_AN_AREA_TO_CROP_THE_PICTURE" +msgstr "Seleccioni una àrea per retallar la foto" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_WALLPAPER" +msgstr "L'àrea seleccionada s'aplicarà al fons de pantalla" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_PRINTED" +msgstr "S'imprimirà l'àrea seleccionada" + +msgid "IDS_IV_BODY_YOU_CAN_SHARE_YOUR_MEDIA_WITH_OTHER_DEVICES_USING_NEARBY_DEVICES" +msgstr "Pot compartir els seus fitxers multimèdia amb altres dispositius mitjançant dispositius propers" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_CONTACT_PICTURE" +msgstr "L'àrea seleccionada s'aplicarà a la foto de contacte" + +msgid "IDS_IV_BODY_EXPOSURE_TIME_ABB" +msgstr "Temps expos" + +msgid "IDS_CAM_BODY_APERTURE" +msgstr "Obertura" + +msgid "IDS_MEDIABR_HEADER_ORIENTATION" +msgstr "Orientació" + +msgid "IDS_MEDIABR_HEADER_MANUFACTURER" +msgstr "Fabricant" + +msgid "IDS_CAM_BODY_FOCAL_LENGTH" +msgstr "Distància focal" + +msgid "IDS_CAM_HEADER_OSDOPTORIENTATION_SCENE" +msgstr "Orientació" + +msgid "IDS_MEDIABR_HEADER_MODEL" +msgstr "Model" + +msgid "IDS_FT_OPT_ADD_NAME" +msgstr "Afegir nom" + +msgid "IDS_IV_POP_SET_AS_CALLER_ID_M_PAST_TENSE" +msgstr "Definir com a ID de la persona que truca" + +msgid "IDS_MF_BODY_NO_FACE_DETECTED" +msgstr "Cap cara detectada" + diff --git a/res/po/cs.po b/res/po/cs.po new file mode 100755 index 0000000..655aa13 --- /dev/null +++ b/res/po/cs.po @@ -0,0 +1,288 @@ +msgid "IDS_MEDIABR_SK2_ADD_TO_HOME" +msgstr "Přidat do domů" + +msgid "IDS_CAM_BODY_AUTO" +msgstr "Automaticky" + +msgid "IDS_CAM_BODY_FLASH" +msgstr "Blesk" + +msgid "IDS_CAM_BODY_ISO" +msgstr "ISO" + +msgid "IDS_IV_OPT_COPY_TO_CLIPBOARD" +msgstr "Kopírovat do schránky" + +msgid "IDS_CAM_BODY_FLASH_ON" +msgstr "Zapnout blesk" + +msgid "IDS_CAM_BODY_FLASH_OFF" +msgstr "Flash_Off" + +msgid "IDS_CAM_BODY_WHITE_BALANCE" +msgstr "Vyvážení bílé" + +msgid "IDS_CAM_BUTTON_AUTO" +msgstr "Automaticky" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Vytv. zn." + +msgid "IDS_CAM_OPT_WHITE_BALANCE_ABB" +msgstr "Vyvážení bílé" + +msgid "IDS_IV_BODY_ACCUMULATED_TIME" +msgstr "Celkový čas" + +msgid "IDS_IV_HEADER_ADD_TAG" +msgstr "Přid. zn." + +msgid "IDS_IV_POP_ADDED" +msgstr "Přidáno" + +msgid "IDS_IV_BODY_ANY" +msgstr "Vše" + +msgid "IDS_IV_BODY_AVAILABLE_USES" +msgstr "Počet použití k dispozici" + +msgid "IDS_IV_BODY_BASIC" +msgstr "Základní" + +msgid "IDS_IV_BODY_CALLER_IMAGE" +msgstr "Obrázek volajícího" + +msgid "IDS_IV_BODY_COUNT" +msgstr "Počet" + +msgid "IDS_IV_BODY_DATE_CREATED" +msgstr "Datum vytvoření" + +msgid "IDS_IV_BODY_DISPLAY" +msgstr "Displej" + +msgid "IDS_IV_POP_ENTER_TAG_NAME" +msgstr "Zadejte název značky" + +msgid "IDS_IV_POP_ENTRY_IS_EMPTY" +msgstr "Prázdná položka" + +msgid "IDS_IV_BODY_EXECUTE" +msgstr "Provést" + +msgid "IDS_IV_BODY_FILE_FORMAT" +msgstr "Formát souboru" + +msgid "IDS_IV_BODY_FILE_LOCATION" +msgstr "Umístění souboru" + +msgid "IDS_IV_BODY_FORWARDING" +msgstr "Předání" + +msgid "IDS_IV_HEADER_HOME_SCREEN_WALLPAPER_ABB" +msgstr "Pozadí dom. obrazovky" + +msgid "IDS_IV_BODY_IMPOSSIBLE" +msgstr "Nemožné" + +msgid "IDS_IV_BODY_INDIVIDUAL" +msgstr "Individuální" + +msgid "IDS_IV_BODY_INTERVAL" +msgstr "Interval" + +msgid "IDS_IV_POP_INVALID_IMAGE_FILE" +msgstr "Neplatný soubor obrázku" + +msgid "IDS_IV_BODY_LATITUDE" +msgstr "Zeměpisná šířka" + +msgid "IDS_IV_BODY_LOCATIONS" +msgstr "Polohy" + +msgid "IDS_IV_HEADER_LOCK_SCREEN_WALLPAPER_ABB" +msgstr "Zamknout pozadí obr." + +msgid "IDS_IV_BODY_LONGITUDE" +msgstr "Zeměpisná délka" + +msgid "IDS_IV_POP_MAXIMUM_NUMBER_OF_CHARACTERS_HPD_REACHED" +msgstr "Bylo dosaženo maximálního počtu znaků (%d)" + +msgid "IDS_IV_BODY_N_A" +msgstr "Nepoužito" + +msgid "IDS_IV_BODY_NEW_TAG" +msgstr "Nová značka" + +msgid "IDS_IV_POP_PERMISSION_DENIED" +msgstr "Povolení bylo odepřeno" + +msgid "IDS_IV_BODY_POSSIBLE" +msgstr "Možné" + +msgid "IDS_IV_BODY_PRINT" +msgstr "Tisk" + +msgid "IDS_IV_OPT_PRINT_VIA_BLUETOOTH" +msgstr "Tisk přes Bluetooth" + +msgid "IDS_IV_BODY_RESOLUTION" +msgstr "Rozlišení" + +msgid "IDS_IV_BODY_RIGHT_STATUS" +msgstr "Stav práv" + +msgid "IDS_IV_POP_SD_CARD_REMOVED" +msgstr "SD karta byla vyjmuta" + +msgid "IDS_IV_POP_SELECT_DEVICE" +msgstr "Zvolte umístění" + +msgid "IDS_IV_BODY_SERVER_NAME" +msgstr "Název serveru" + +msgid "IDS_IV_OPT_SET_AS" +msgstr "Nastavit jako" + +msgid "IDS_IV_POP_SET_WALLPAPER_FOR_HOME_SCREEN_AND_LOCK_SCREEN" +msgstr "Nastavit pozadí pro domovskou obrazovku a zamknout obrazovku" + +msgid "IDS_IV_OPT_SHARE" +msgstr "Sdílet" + +msgid "IDS_IV_OPT_SLIDE_SHOW" +msgstr "Prezentace" + +msgid "IDS_IV_BODY_TIMED_COUNT" +msgstr "Násobek času" + +msgid "IDS_IV_OPT_TRIM" +msgstr "Oříznout" + +msgid "IDS_IV_BODY_UNLIMITED" +msgstr "Neomezeno" + +msgid "IDS_IV_BODY_VALIDITY" +msgstr "Platnost" + +msgid "IDS_IV_BODY_VENDOR" +msgstr "Dodavatel" + +msgid "IDS_IV_OPT_FILE_TRANSFER" +msgstr "Přenos souboru" + +msgid "IDS_IV_BODY_DO_NOT_SHOW_AGAIN" +msgstr "Znovu nezobrazovat" + +msgid "IDS_IV_BODY_TAP_AND_HOLD_AT_TWO_POINTS_THEN_TILT_DEVICE_BACK_AND_FORTH_TO_REDUCE_OR_ENLARGE_SCREEN" +msgstr "Chcete-li zmenšit nebo zvětšit displej, klepněte na dvě místa a držte je, a potom naklánějte zařízení dozadu a dopředu" + +msgid "IDS_IV_HEADER_LEARN_ABOUT_TILT" +msgstr "Informace o naklonění" + +msgid "IDS_IV_HEADER_ALL_ALBUMS" +msgstr "Všechna alba" + +msgid "IDS_IV_OPT_TAG" +msgstr "Značka" + +msgid "IDS_IV_OPT_HOME_AND_LOCK_SCREEN_WALLPAPER" +msgstr "Pozadí domovské obrazovky a zamknutého displeje" + +msgid "IDS_IV_OPT_USE_MOTION" +msgstr "Použít pohyb" + +msgid "IDS_IV_BODY_HOME_AND_LOCK_SCREENS" +msgstr "Domovská a zamknutá obrazovka" + +msgid "IDS_IV_BODY_CROP" +msgstr "Oříznout" + +msgid "IDS_IV_BODY_HOME_SCREEN" +msgstr "Domovská obrazovka" + +msgid "IDS_IV_BODY_LOCK_SCREEN" +msgstr "Zamknout displej" + +msgid "IDS_IV_OPT_ROTATE_LEFT" +msgstr "Otočit doleva" + +msgid "IDS_IV_OPT_ROTATE_RIGHT" +msgstr "Otočit doprava" + +msgid "IDS_IV_OPT_MANUALLY_DETECT" +msgstr "Detekovat ručně" + +msgid "IDS_IV_BODY_ME" +msgstr "Já" + +msgid "IDS_IV_OPT_EDIT_TAG" +msgstr "Upr. zn." + +msgid "IDS_IV_OPT_REMOVE_TAG" +msgstr "Odebrat značku" + +msgid "IDS_IV_BODY_SHARE_VIA" +msgstr "Sdílet pomocí" + +msgid "IDS_IV_BODY_DO_NOT_SEND" +msgstr "Neodesílat" + +msgid "IDS_IV_OPT_BUDDY_PHOTO_SHARE" +msgstr "Sdílet fotografii kamaráda" + +msgid "IDS_PBR_OPT_FACE_TAGGING" +msgstr "Přiřaz. oblič." + +msgid "IDS_COM_POP_IMAGE_VIEWER" +msgstr "Prohlížeč obrázků" + +msgid "IDS_IV_BODY_NEARBY_DEVICES_T_ALLSHARE" +msgstr "Nedaleká zařízení" + +msgid "IDS_IV_BODY_SELECT_AN_AREA_TO_CROP_THE_PICTURE" +msgstr "Vyberte oblast pro oříznutí obrázku" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_WALLPAPER" +msgstr "Vybraná oblast bude použita na pozadí" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_PRINTED" +msgstr "Vybraná oblast bude vytištěna" + +msgid "IDS_IV_BODY_YOU_CAN_SHARE_YOUR_MEDIA_WITH_OTHER_DEVICES_USING_NEARBY_DEVICES" +msgstr "Můžete sdílet média s ostatními zařízeními pomocí funkce nedaleká zařízení" + +msgid "IDS_IV_BODY_SELECTED_AREA_WILL_BE_APPLIED_TO_THE_CONTACT_PICTURE" +msgstr "Vybraná oblast bude použita pro obrázek kontaktu" + +msgid "IDS_IV_BODY_EXPOSURE_TIME_ABB" +msgstr "Doba expozice" + +msgid "IDS_CAM_BODY_APERTURE" +msgstr "Clona" + +msgid "IDS_MEDIABR_HEADER_ORIENTATION" +msgstr "Orientace" + +msgid "IDS_MEDIABR_HEADER_MANUFACTURER" +msgstr "Výrobce" + +msgid "IDS_CAM_BODY_FOCAL_LENGTH" +msgstr "Ohnisková vzdálenost" + +msgid "IDS_CAM_HEADER_OSDOPTORIENTATION_SCENE" +msgstr "Orientace" + +msgid "IDS_MEDIABR_HEADER_MODEL" +msgstr "Model" + +msgid "IDS_FT_OPT_ADD_NAME" +msgstr "Přidat jméno" + +msgid "IDS_IV_POP_SET_AS_CALLER_ID_M_PAST_TENSE" +msgstr "Nastavit jako ID volajícího" + +msgid "IDS_MF_BODY_NO_FACE_DETECTED" +msgstr "Nebyl rozpoznán žádný obličej" + diff --git a/res/po/csv2po_v2 b/res/po/csv2po_v2 new file mode 100644 index 0000000000000000000000000000000000000000..d9255125385073211ea0cdb0e6cb039edbdcb2e0 GIT binary patch literal 7586 zcmeHMeQ;FO6~DV#bj1iEU=1ZQD=ro)tO*7UO4~pZ2oeEFKq!TmW%uoeY9VRUTAu`{-|mWkR46G!}-mbPQZwlfy3PB#s;w1Xe5$oBWU_uXW( z&`$eb|LC1L@7&)#=iYNa&i#1ze!01Ioy+ACI=DrdAR6xXc>JAauO3?ZROgOs{`gAE zD@z~Eoqq55TR)?WWn2M5cc8zgg6=c6o#jz?7U)tCZLsey16>Z931VPv;^-g!7EGf(h_{2 z1m9YMTT5_F3GM*y81{JC4|BwP@k#L2IgKks2DqU}E({~unMxX#9ZcJXAu!A#4)0CE z*svL?;ds)>SY}vQb~@D6Bh2o&Eh4EdGl`tY6xwHmV*89pFrJ`_o!TcNQPZ{v5>P@3 zsf;Z;%}(Zygc2#sWTKf)i%3^Gp0pz4y5Z2Y9etZ|H8Fg_|VYaXj2eo|t#Am$?;mY6MxEg?Q6F7RDNgJ0xaHV=cs6BxZ|aTZkJZX3Jwch--ksWvKo0o`E;BZ=c!HzBP96 z0cae;=Z@{M_WM2F{LN52duUp4`t9In!YEE;K6f+*{!A5mrFUW;zQ;duXD3{%Ubhww zJxv4IQP(3>Da`AqSgNmjJ)M7H1`BXypZDzAJvL-tCx)K=6!lSl_H@l>_>v8Z zFWanm%{ImB_9$K-ReW`);tiJKO$QWjxli%duPVOfLB-n-E575Kihp4kJo_cD+g_GK zg>v4J$B=Ne0nHp}^?L`}{hk4jKi_!1P(WkYu6z{nk>{Yr4B1gnPH3%bRlbA#6Mj*MQcl`PlP=hr45pvk5q9aEx? z{?SZa!`43k$cGm*o2J=5|1j+!Oe{c-VMI`N2OI2$Jgbsij_6ip{lIIwx_guktLs90 z$!E=ea3k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+ SLIDE_SHOW_PAUSE, +} slideshow_state_t; + + +typedef struct _SlideShow SlideShow; + +#ifdef __cplusplus +extern "C" { +#endif + +SlideShow * +ivug_ss_create(Evas_Object *parent); + +bool +ivug_ss_start(SlideShow *pSlideShow , Media_Item *current, Media_List *list, Eina_Bool bSlideFirst); + +bool +ivug_ss_resume(SlideShow *pSlideShow); + +bool +ivug_ss_pause(SlideShow *pSlideShow); + +bool +ivug_ss_stop(SlideShow *pSlideShow); + +void +ivug_ss_delete(SlideShow *pSlideShow); + +void +ivug_ss_resize(SlideShow *pSlideShow); + +Media_Item * +ivug_ss_item_get(SlideShow *pSlideShow); + +Evas_Object * +ivug_ss_object_get(SlideShow *pSlideShow); + +Media_Item * +ivug_ss_get_next_item(Media_List *mList, + Media_Item *header, + Media_Item *current, + slide_show_mode mode); + +void +ivug_ss_set_stop(SlideShow *pSlideShow); // Remove this!!! + + +#ifdef __cplusplus +} +#endif + diff --git a/slideshow/res/images/T01_Noise.png b/slideshow/res/images/T01_Noise.png new file mode 100644 index 0000000000000000000000000000000000000000..d76dbfad42fe2e39485ca524eecbfd399ba0ff94 GIT binary patch literal 7937 zcmV+cAO7HpP)>PvcEH+Iw&5rY#LL-XkyMN17Rp z*^Qlz*dHa3*?sE1&Cv}emPm^FR%K=8@t<=tFP}Mi>a9Qj`Okm))1N;6_+vMJ{p(*> ztJP;d^O^s)@sB6}_mh7<``OR-r>o9xx_Vw0&)pkg-R-Ym_`(-H`sfcv?#W;N@|Vwj z?sH%K;ul>%|M|~*tFwn6ee_Wa`1s?$G>8tCppUC>|L})D)JOj>fBDN_`N~(k^4#n` z_uN}l_|rpubkOZfU;2`J&;R(xKN@@)`PAvRkDqws;Gx_5_P?-q->v-zUOar{m1D= z{QJ*d`oZPrestmD2gi=TvS;u0?K>_#@#NWu9zOoaqbHwy>fEl~S3TUf|K{F(#=q=| z=MO!6^1F8(xc9yz4?l8x`;IF{Go5jsyYgc<*3&F*{Amgcuy`|Cm=!+$#CacTk3M$R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@ThVzLgQbpDu`6mMg**(fk#_A|fJESysm6 z40^(1>*ca!P(cQKe0)BTk&!il6{v|eai3!+$AXhIIWLde0S5=?=)*|rA_XaF*=p+l zuOnWkD~jONgz=%Fx0))eQQL(o*dk7EC5SvVDb)Gj8v~r659bF>i`l@|`7{5t0GM%D zb8~ZkdHI1RIFSQrkM$iKDm9o0l|X3dXjN93{R%v-GHkT%@9%FEq#UON*=GfE5do~l z%2-%&ct@Hb314>7%;Xs9=?UR&Q6>excKG2zz44$E%05+pr*D8c;En@C&LHTc?eFP_ zdLnR?#X&g^V)EeD*jFGM;T^Ps|AMHcJw=`kR3X$kZuQ6gOHNL%$^p0Ya0XmdUy!ca zUdIdd%K1GeVQR^CiSn6$ta*vnmNYcc=zzA@fp_^y?d^|J^78UoK9{?Ov0+=FjjRH5 zS@t8~(X%TU0i}U(^*ez&@o>1@7Cpllay&del{&sr9U)hd7^s@8U`X%H%+~M0C1;?- z9_R)&SOcV8j9j5+TwL5@uQO=xnw04A%Qcveox#{^!KDfM`$y6WsGMMF7ynQ#$y HnScHdLKhRd literal 0 HcmV?d00001 diff --git a/slideshow/res/layout/ivug-ss-ly.edc b/slideshow/res/layout/ivug-ss-ly.edc new file mode 100755 index 0000000..7aae007 --- /dev/null +++ b/slideshow/res/layout/ivug-ss-ly.edc @@ -0,0 +1,146 @@ +/* + * Copyright 2012 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. + */ + +collections { + group { + name: "view.slideshow"; + parts { + part { name: "bg"; + type: RECT; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 255; + visible: 1; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } + } + + } +} + + +collections { + group { + name: "slayout"; + images { + image: "T01_btn_play.png" COMP; + } + parts { + /* add bg to unsend events to slider layer */ + part { name: "bg"; + type: RECT; + scale: 1; + mouse_events: 1; + //repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 255; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } + part { name: "content"; + type: SWALLOW; + scale: 1; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } + part { name: "thumbnail"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "play.icon"; + type: IMAGE; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 0; + fixed: 1 1; + max: 72 72; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + image.normal: "T01_btn_play.png"; + } + + description { + state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "show_thumbnail"; + signal: "elm,state,show_thumbnail"; + source: "slideshow"; + action: STATE_SET "show" 0.0; + target: "thumbnail"; + } + + program { + name: "hide_thumbnail"; + signal: "elm,state,hide_thumbnail"; + source: "slideshow"; + action: STATE_SET "default" 0.0; + target: "thumbnail"; + } + program { + name: "show_icon"; + signal: "elm,state,show_play_icon"; + source: "slideshow"; + action: STATE_SET "show" 0.0; + target: "play.icon"; + } + + program { + name: "hide_icon"; + signal: "elm,state,hide_play_icon"; + source: "slideshow"; + action: STATE_SET "default" 0.0; + target: "play.icon"; + } + } + } +} diff --git a/slideshow/src/control/ivug-slideshow.cpp b/slideshow/src/control/ivug-slideshow.cpp new file mode 100755 index 0000000..7b48718 --- /dev/null +++ b/slideshow/src/control/ivug-slideshow.cpp @@ -0,0 +1,998 @@ +/* + * Copyright 2012 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 "ivug-anim.h" +#include "ivug-slideshow.h" +#include "ivug-slideshow-priv.h" + +#include "ivug-debug.h" + +#include "ivug-config.h" +#include "ivug-define.h" +#include "ivug-datatypes.h" +#include "ivug-uuid.h" +#include "ivug-util.h" + +#include "ivug-image.h" + +#include +#include + +#include "statistics.h" + +#include "EFLUtil.h" + +#undef USE_IVUG_IMAGE + +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_MED + +#undef LOG_CAT +#define LOG_CAT "IV-SLIDESHOW" + +#define EDJ_PATH PREFIX"/res/edje/"PACKAGE +#define IVUG_SS_LY_EDJ_PATH EDJ_PATH"/ivug-ss-ly.edj" + +#define IVUG_IMAGE_BETWEEN_MARGIN (30) +#define IVUG_IMAGE_MOVE_MARGIN ((int)IVUG_IMAGE_BETWEEN_MARGIN*0.8) +#define IVUG_IMAGE_SCROLL_MARGIN (5) + +#define _EDJ(o) elm_layout_edje_get(o) + +void ivug_ss_get_screen_size(int *width, int *height) +{ + int rotation = elm_win_rotation_get((Evas_Object *)ug_get_window()); + + int screen_w = 0; + int screen_h = 0; + ecore_x_window_size_get(ecore_x_window_root_first_get(), &screen_w, &screen_h); + if(rotation == 0 || rotation == 180) + { + *width = screen_w; + *height = screen_h; + } + else if(rotation == 90 || rotation == 270) + { + *width = screen_h; + *height = screen_w; + } +} + +Media_Item *ivug_ss_get_next_item(Media_List *mList, + Media_Item *header, + Media_Item *current, + slide_show_mode mode) +{ + Media_Item *item = NULL; + + MSG_HIGH("Get Next Item : Header=0x%08x Current=0x%08x", header, current); + + MSG_HIGH("Get Next : Header=0x%08x Current=0x%08x", + header, current); + switch(mode) + { + case SLIDE_SHOW_MODE_REPEAT: + item = ivug_medialist_get_next(mList, current); + if ( item == NULL ) + { + item = ivug_medialist_get_first(mList); + } + break; + + case SLIDE_SHOW_MODE_NORMAL: + item = ivug_medialist_get_next(mList, current); + break; + + case SLIDE_SHOW_MODE_SHUFFLE_REPEAT: + item = ivug_medialist_get_shuffle_item(mList, current); + if ( item == NULL ) + { + MSG_ERROR("Never touch here"); + } + break; + + case SLIDE_SHOW_MODE_SHUFFLE: + item = ivug_medialist_get_shuffle_item(mList, current); + if ( item == header ) + { + MSG_ERROR("Reach end"); + return NULL; + } + break; + + default: + MSG_ERROR("Unknown mode : %d", mode); + item = NULL; + break; + } + + return item; + +} + + +static void +_moved(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + SlideShow *pSlideShow = (SlideShow *)data; + + Evas_Coord ox, oy, ow, oh; + evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); + + MSG_HIGH("Moved (%d,%d,%d,%d)", ox, oy, ow, oh); + + evas_object_move(pSlideShow->event, ox, oy); +} + +static void +_resized(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + SlideShow *pSlideShow = (SlideShow *)data; + + Evas_Coord ox, oy, ow, oh; + evas_object_geometry_get(obj, &ox, &oy, &ow, &oh); + + MSG_HIGH("Resized (%d,%d,%d,%d)", ox, oy, ow, oh); + + evas_object_resize(pSlideShow->event, ow, oh); + + evas_object_resize(pSlideShow->sLayout[pSlideShow->sCurrent].layout, ow, oh); + evas_object_resize(pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2].layout, ow, oh); +} + +static void +_shown(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + MSG_HIGH("SlideShow is Shown"); +} + +static void +_hidden(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + MSG_HIGH("SlideShow is Hidden"); +} + + +static void +_shown1(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + MSG_HIGH("%s is Shown", evas_object_name_get(obj)); +} + +static void +_hidden1(void *data, Evas *evas, Evas_Object *obj, void *event_info) +{ + MSG_HIGH("%s is Hidden", evas_object_name_get(obj)); +} + +static bool _ivug_ss_set_content(Slide_Layout *pSlide, Media_Item *item) +{ + Media_Data *mdata; + int ret = EVAS_LOAD_ERROR_NONE; + + pSlide->mitem = item; + + if(pSlide->mitem == NULL) + { + MSG_ERROR("Mitem is NULL"); + return false; + } + + mdata = ivug_medialist_get_data(item); + IV_ASSERT(mdata != NULL); + + MSG_HIGH("Start Loading : %s", mdata->filepath); + + if(mdata->slide_type == SLIDE_TYPE_VIDEO) + { + /* Display play icon */ + edje_object_signal_emit(elm_layout_edje_get(pSlide->layout), + "elm,state,show_play_icon", + "slideshow"); + + +#ifdef USE_IVUG_IMAGE + ret = ivug_image_file_set(pSlide->photocam, mdata->thumbnail_path, NULL); +#else + ret = elm_photocam_file_set(pSlide->photocam, mdata->thumbnail_path); +#endif + if(EVAS_LOAD_ERROR_NONE != ret) { + MSG_HIGH("elm_photocam_file_set failed"); + return false; + } + } + else + { + /* Hide play icon */ + edje_object_signal_emit(elm_layout_edje_get(pSlide->layout), + "elm,state,hide_play_icon", + "slideshow"); +#ifdef USE_IVUG_IMAGE + ret = ivug_image_file_set(pSlide->photocam, mdata->filepath, NULL); +#else + ret = elm_photocam_file_set(pSlide->photocam, mdata->filepath); +#endif + if(EVAS_LOAD_ERROR_NONE != ret) { + MSG_HIGH("elm_photocam_file_set failed"); + return false; + } + + if (elm_image_file_set(pSlide->thumbnail, mdata->thumbnail_path, NULL) == EINA_FALSE) + { + MSG_ERROR("Cannot load thumbnail : %s", mdata->thumbnail_path); + } + else + { + edje_object_signal_emit(_EDJ(pSlide->layout), "elm,state,show_thumbnail", "slideshow"); + } + } + MSG_HIGH("Load : %s", mdata->filepath); + elm_photocam_zoom_mode_set(pSlide->photocam, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT); + elm_photocam_paused_set(pSlide->photocam, true); + evas_object_size_hint_weight_set(pSlide->photocam, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + /* use for test + int w_p = 0; + int h_p = 0; + float ff = elm_photocam_zoom_get(pSlide->photocam); + char * cc = (char *)elm_photocam_file_get(pSlide->photocam); + elm_photocam_image_size_get(pSlide->photocam, &w_p, &h_p); + MSG_IVUG_HIGH("photocam_zoom:%f, %s ,%d,%d", ff,cc, w_p, h_p); + */ + return true; +} + + +static void _ivug_ss_update_pos(SlideShow *pSlideShow, Evas_Coord x, Evas_Coord y) +{ + IV_ASSERT(pSlideShow != NULL); + + MSG_HIGH("Update Pos(%d,%d) sCurrent=%d", x, y, pSlideShow->sCurrent); + +// x = x - 360; + + Slide_Layout *sLyCurrent = &pSlideShow->sLayout[pSlideShow->sCurrent]; + Slide_Layout *sLyNext = &pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2]; + + evas_object_move(sLyCurrent->layout, x, y); + evas_object_move(sLyNext->layout, + x + pSlideShow->screen_w + IVUG_IMAGE_BETWEEN_MARGIN , + y); +} +static bool _ivug_ss_load_next_image(SlideShow *pSlideShow) +{ + ivug_retv_if(!pSlideShow, false); + MSG_HIGH(""); + + Slide_Layout* sLyCurrent = &pSlideShow->sLayout[pSlideShow->sCurrent]; + Slide_Layout* sLy = &pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2]; + + Media_Item *next = NULL; + Media_Item *current = sLyCurrent->mitem; + do { + next = ivug_ss_get_next_item(pSlideShow->media_list, + pSlideShow->ss_Header, + current, + pSlideShow->ss_mode); + + if(next == NULL) { + sLy->mitem = NULL; + return false; + } + current = next; + }while(!_ivug_ss_set_content(sLy, next)); + + if(next) { + evas_object_show(sLy->layout); + } + + return true; +} + +void _ivug_ss_effect_finished(void *data) +{ + ivug_ret_if(!data); + SlideShow *pSlideShow = (SlideShow *) data; + MSG_HIGH("slideshow Effect ended"); + + if(pSlideShow->effect_engine) + { + MSG_HIGH("ivug_effect_finalize"); + ivug_effect_finalize(pSlideShow->effect_engine); + pSlideShow->effect_engine = NULL; + } + + /* Increse current index */ + pSlideShow->sCurrent = (pSlideShow->sCurrent + 1) % 2; + _ivug_ss_update_pos(pSlideShow, 0, 0); // Reset position + + Slide_Layout *sLyCurrent = &pSlideShow->sLayout[pSlideShow->sCurrent]; + Slide_Layout *sLyNext = &pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2]; + + Media_Item *next = NULL; + + next = ivug_ss_get_next_item(pSlideShow->media_list, + pSlideShow->ss_Header, + sLyCurrent->mitem, + pSlideShow->ss_mode); + + if(next == NULL) { + sLyNext->mitem = NULL; + MSG_ERROR("Cannot find next item"); + return; + } + + _ivug_ss_set_content(sLyNext, next); + +// Reset visibilaty because effect can hide layout + evas_object_show(sLyCurrent->layout); + evas_object_show(sLyNext->layout); + + MSG_HIGH("pSlideShow->bSS_StopFlag = %d", pSlideShow->bSS_StopFlag); + + if(pSlideShow->bSS_StopFlag == EINA_TRUE) + { + pSlideShow->state = SLIDE_SHOW_STOPPED; + pSlideShow->ss_Header = NULL; + evas_object_smart_callback_call(ivug_ss_object_get(pSlideShow), "slideshow,finished", (void *)SLIDE_SHOW_STOPPED); +// ivug_ss_delete(pSlideShow); + + pSlideShow->bSS_StopFlag = EINA_FALSE; + } + //EFL::dump_obj(pSlideShow->obj, 0); +} + +Evas_Object *_ivug_ss_create_layout(Evas_Object *parent, const char *edj_path, const char *group) +{ + MSG_ASSERT(parent != NULL); + MSG_ASSERT(edj_path != NULL); + MSG_ASSERT(group != NULL); + + Evas_Object *ly = NULL; + ly = elm_layout_add(parent); + + ivug_retv_if(!ly, NULL); + + if (elm_layout_file_set(ly , edj_path, group ) == EINA_FALSE) + { + MSG_ERROR("Cannot create layout. %s %s", edj_path, group); + evas_object_del(ly); + return NULL; + } + evas_object_size_hint_weight_set(ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ly, EVAS_HINT_FILL, EVAS_HINT_FILL); + + evas_object_show(ly); + return ly; +} + +// Slide Show related functions. +static Eina_Bool _ivug_ss_on_slide_interval(void *data) +{ + MSG_ASSERT(data != NULL); + + SlideShow *pSlideShow = (SlideShow*)data; + + MSG_HIGH("On Slide Interval"); + /* stopped by other operation */ + if (pSlideShow->state == SLIDE_SHOW_STOPPED) + { + pSlideShow->ss_timer = NULL; + MSG_ERROR("Slide show already stopped"); + return ECORE_CALLBACK_CANCEL; + } + + Slide_Layout *sLyCurrent = &pSlideShow->sLayout[pSlideShow->sCurrent]; + Slide_Layout *sLyNext = &pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2]; + + /* Next item is NULL */ + if(sLyNext->mitem == NULL) + { + MSG_HIGH("Next item is NULL"); + pSlideShow->ss_timer = NULL; + pSlideShow->ss_Header = NULL; + /* exit slide show after whole animation is over */ + ivug_ss_stop(pSlideShow); + + return ECORE_CALLBACK_CANCEL; + } + + /* Slideshow Effect */ + Effect_Engine *eng = ivug_effect_add(pSlideShow->effect_type); + MSG_ASSERT(eng != NULL); + + pSlideShow->effect_engine = eng; + + ivug_effect_init(pSlideShow->effect_engine, sLyCurrent->layout, sLyNext->layout); + + int rotation = elm_win_rotation_get((Evas_Object *)ug_get_window()); + ivug_ss_get_screen_size(&pSlideShow->screen_w, &pSlideShow->screen_h); + + if(ivug_effect_set_size(pSlideShow->effect_engine, pSlideShow->screen_w, pSlideShow->screen_h, rotation) == false) + { + pSlideShow->ss_timer = NULL; + ivug_effect_finalize(pSlideShow->effect_engine); + return ECORE_CALLBACK_CANCEL; + } + +// EFL::dump_obj(pSlideShow->obj, 0); + + ivug_effect_start(pSlideShow->effect_engine, _ivug_ss_effect_finished, pSlideShow); + + return ECORE_CALLBACK_RENEW; +} + + + +static Effect_Type _ivug_ss_get_trans_effect(ivug_effect_type type) +{ + MSG_MED("type %d", type); + switch(type) + { + case IVUG_EFFECT_TYPE_SLIDE: + return EFFECT_SLIDE; + case IVUG_EFFECT_TYPE_IRIS: + return EFFECT_IRIS; + case IVUG_EFFECT_TYPE_DISSOLVE: + return EFFECT_DISSOLVE; + case IVUG_EFFECT_TYPE_DISSOLVE_FADE: + return EFFECT_DISSOLVE_FADE; + case IVUG_EFFECT_TYPE_SPLIT: + return EFFECT_SPLIT; + default: + return EFFECT_SLIDE; + //break; + } + return EFFECT_NONE; +} + + + + +void _ivug_ss_on_mouse_down(void *data, Evas *e, + Evas_Object *obj, void *event_info) +{ + SlideShow *pSlideShow = (SlideShow *) data; + + MSG_HIGH("_ivug_ss_on_mouse_down, state is %d", pSlideShow->state); + + if (pSlideShow->click_timer) { + ecore_timer_del(pSlideShow->click_timer); + pSlideShow->click_timer = NULL; + } + + if(pSlideShow->ss_timer) { + ecore_timer_del(pSlideShow->ss_timer); + pSlideShow->ss_timer = NULL; + } +} + +void _ivug_ss_on_mouse_move(void *data, Evas *e, + Evas_Object *obj, void *event_info) +{ + MSG_LOW("_ivug_ss_on_mouse_move"); + return; +} + +static Eina_Bool _ivug_ss_clicked_timer_cb(void *data) +{ + SlideShow *pSlideShow = (SlideShow *)data; + if (NULL == pSlideShow) { + return ECORE_CALLBACK_CANCEL; + } + + pSlideShow->click_timer = NULL; + + if(pSlideShow->state == SLIDE_SHOW_RUNNING) { + ivug_ss_stop(pSlideShow); + //EFL::dump_obj(pSlideShow->obj, 0); + return ECORE_CALLBACK_CANCEL; + } + + MSG_HIGH("-------------_ivug_ss_clicked_timer_cb--------------"); + + pSlideShow->state = SLIDE_SHOW_INTERRUPTED; + evas_object_smart_callback_call(ivug_ss_object_get(pSlideShow), "slideshow,finished", (void *)SLIDE_SHOW_INTERRUPTED); + + return ECORE_CALLBACK_CANCEL; +} +void _ivug_ss_on_mouse_up(void *data, Evas *e, + Evas_Object *obj, void *event_info) +{ + SlideShow *pSlideShow = (SlideShow *)data; + if (NULL == pSlideShow) { + return; + } + MSG_HIGH("_ivug_ss_on_mouse_up, pSlideShow->v is %d", pSlideShow->state); + + if (pSlideShow->bMouse_event) { + if(pSlideShow->click_timer) + { + ecore_timer_del(pSlideShow->click_timer); + } + pSlideShow->click_timer = ecore_timer_add(0.3f, _ivug_ss_clicked_timer_cb, data); + } +} + +static Eina_Bool +_ivug_ss_auto_finish_timer_cb(void *data) +{ + ivug_retv_if(!data, ECORE_CALLBACK_CANCEL); + + SlideShow *pSlideShow = (SlideShow*)data; + /* exit slide show after whole animation is over */ + ivug_ss_stop(pSlideShow); + return ECORE_CALLBACK_CANCEL; +} + + +static void +_ivug_ss_photocam_loaded_cb(void *data, Evas_Object *obj, void *event_info) +{ + IV_ASSERT(data != NULL); + + Slide_Layout* sLy = static_cast(data); + SlideShow *pSlideShow = (SlideShow *)sLy->pSlideshow; + + if ( sLy->mitem == NULL) + { + MSG_ERROR("Debug Me! Data item is NULL."); + return; + } + + Media_Data* mdata = ivug_medialist_get_data(sLy->mitem); + if(mdata == NULL) + { + MSG_ERROR("ivug_medialist_get_data failed."); + return; + } + + Evas_Load_Error error = static_cast(reinterpret_cast(event_info)); + if ( error != EVAS_LOAD_ERROR_NONE ) + { + MSG_HIGH("Photocam Pre-loaded. File=%s", ivug_get_filename(mdata->filepath)); + MSG_SITEM_ERROR("Image loading failed. Error=%d File=%s", + error, mdata->filepath); + _ivug_ss_load_next_image((SlideShow *)sLy->pSlideshow); + return; + } + edje_object_signal_emit(_EDJ(pSlideShow->sLayout[pSlideShow->sCurrent].layout), "elm,state,hide_thumbnail", "slideshow"); + + MSG_SITEM_HIGH("Photocam Pre-loaded. File=%s", + ivug_get_filename(mdata->filepath)); + + return; +} + +static bool _ivug_ss_create_image_layout(Evas_Object *parent, Slide_Layout *sLayout) +{ + /* Create Layout for the current item */ + sLayout->layout = _ivug_ss_create_layout(parent, IVUG_SS_LY_EDJ_PATH, "slayout"); + + if(sLayout->layout == NULL) { + MSG_ERROR("Cannot create current layout"); + return false; + } + +#ifdef USE_IVUG_IMAGE + sLayout->photocam = ivug_image_create(sLayout->layout); +#else + sLayout->photocam = elm_photocam_add(sLayout->layout); +#endif + evas_object_size_hint_expand_set(sLayout->photocam, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(sLayout->photocam, EVAS_HINT_FILL, EVAS_HINT_FILL); + + elm_object_part_content_set(sLayout->layout, "content", sLayout->photocam); + + sLayout->thumbnail = elm_icon_add(sLayout->layout); + evas_object_name_set(sLayout->thumbnail, "Thumbnail"); + elm_object_part_content_set(sLayout->layout, "thumbnail", sLayout->thumbnail); + +#ifdef USE_IVUG_IMAGE +#else + elm_photocam_zoom_mode_set(sLayout->photocam, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT); + elm_photocam_paused_set(sLayout->photocam, EINA_TRUE); +#endif + + evas_object_smart_callback_add(sLayout->photocam, + "loaded", + _ivug_ss_photocam_loaded_cb, + sLayout); + + evas_object_show(sLayout->photocam); + evas_object_show(sLayout->layout); + + return true; +} + +SlideShow *ivug_ss_create(Evas_Object *parent) +{ + SlideShow *pSlideShow = NULL; + MSG_IVUG_HIGH("ivug_ss_create"); + pSlideShow = (SlideShow*)calloc(1,sizeof(SlideShow)); + if (pSlideShow == NULL) { + return NULL; + } + + pSlideShow->state = SLIDE_SHOW_STOPPED; + pSlideShow->bMouse_event = false; + ivug_effect_type ivug_effect = IVUG_EFFECT_TYPE_SLIDE; + ivug_config_get_slideshow_setting(&(pSlideShow->ss_mode), + &(pSlideShow->ss_interval_time), &ivug_effect); + if(ivug_effect == IVUG_EFFECT_TYPE_UNKNOWN) { + free(pSlideShow); + pSlideShow = NULL; + return NULL; + } + + pSlideShow->effect_type = _ivug_ss_get_trans_effect(ivug_effect); + + pSlideShow->obj = _ivug_ss_create_layout(parent, IVUG_SS_LY_EDJ_PATH, "view.slideshow"); + MSG_ASSERT(pSlideShow->obj != NULL); + evas_object_name_set(pSlideShow->obj, "slideshow"); + + /* Create Layout for the current item */ + if ( _ivug_ss_create_image_layout(pSlideShow->obj, &pSlideShow->sLayout[0]) == false) + { + MSG_ERROR("Cannot create current layout"); + free(pSlideShow); + return NULL; + } + pSlideShow->sLayout[0].pSlideshow = pSlideShow; + evas_object_name_set(pSlideShow->sLayout[0].layout, "Layout 0"); + + /* Create Layout for the next item */ + if ( _ivug_ss_create_image_layout(pSlideShow->obj, &pSlideShow->sLayout[1]) == false) + { + MSG_ERROR("Cannot create current layout"); + elm_object_part_content_unset(pSlideShow->sLayout[0].layout, "content"); + evas_object_del(pSlideShow->sLayout[0].photocam); + evas_object_del(pSlideShow->sLayout[0].layout); + free(pSlideShow); + return NULL; + } + + pSlideShow->sLayout[1].pSlideshow = pSlideShow; + evas_object_name_set(pSlideShow->sLayout[1].layout, "Layout 1"); + + evas_object_event_callback_add(pSlideShow->sLayout[0].layout, EVAS_CALLBACK_SHOW, _shown1, NULL); + evas_object_event_callback_add(pSlideShow->sLayout[0].layout, EVAS_CALLBACK_HIDE, _hidden1, NULL); + + evas_object_event_callback_add(pSlideShow->sLayout[1].layout, EVAS_CALLBACK_SHOW, _shown1, NULL); + evas_object_event_callback_add(pSlideShow->sLayout[1].layout, EVAS_CALLBACK_HIDE, _hidden1, NULL); + + /* Event rect */ + pSlideShow->event = evas_object_rectangle_add(evas_object_evas_get(parent)); + evas_object_name_set(pSlideShow->event, "ss_event"); + evas_object_color_set(pSlideShow->event, 0,0,0,0); + + evas_object_show(pSlideShow->event); + + //EFL::dump_obj(pSlideShow->obj, 0); + + evas_object_event_callback_add(pSlideShow->obj, EVAS_CALLBACK_MOVE, _moved, pSlideShow); + evas_object_event_callback_add(pSlideShow->obj, EVAS_CALLBACK_RESIZE, _resized, pSlideShow); + evas_object_event_callback_add(pSlideShow->obj, EVAS_CALLBACK_SHOW, _shown, pSlideShow); + evas_object_event_callback_add(pSlideShow->obj, EVAS_CALLBACK_HIDE, _hidden, pSlideShow); + +// Event + evas_object_event_callback_add(pSlideShow->event, EVAS_CALLBACK_MOUSE_DOWN, _ivug_ss_on_mouse_down, pSlideShow); + evas_object_event_callback_add(pSlideShow->event, EVAS_CALLBACK_MOUSE_MOVE, _ivug_ss_on_mouse_move, pSlideShow); + evas_object_event_callback_add(pSlideShow->event, EVAS_CALLBACK_MOUSE_UP, _ivug_ss_on_mouse_up, pSlideShow); + + return pSlideShow; +} + + +bool ivug_ss_start(SlideShow *pSlideShow , Media_Item *current, Media_List *list, Eina_Bool bSlideFirst) +{ + MSG_ASSERT(pSlideShow != NULL); + + ivug_ss_get_screen_size(&pSlideShow->screen_w, &pSlideShow->screen_h); + + if(pSlideShow->ss_interval_time < 0) + { + MSG_ERROR("slide show interval time is invalid !!!"); + return false; + } + + if (pSlideShow->state == SLIDE_SHOW_RUNNING ) + { + MSG_ERROR("Debug me!!! Slide show is running. remove previous one."); + ivug_ss_stop(pSlideShow); + } + + if (pSlideShow->effect_engine != NULL ) + { + MSG_FATAL("Debug Me!!!"); + return false; + } + + pSlideShow->sCurrent = 0; + pSlideShow->bSS_StopFlag = EINA_FALSE; + pSlideShow->ss_Header = current; + pSlideShow->media_list = list; + + MSG_ASSERT(pSlideShow->obj != NULL); + pSlideShow->bMouse_event = true; + evas_object_move(pSlideShow->obj, 0,0); + evas_object_resize(pSlideShow->obj, pSlideShow->screen_w, pSlideShow->screen_h); + + _ivug_ss_update_pos(pSlideShow, 0, 0); + + Slide_Layout *sLyCurrent = &pSlideShow->sLayout[pSlideShow->sCurrent]; + Slide_Layout *sLyNext = &pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2]; + + _ivug_ss_set_content(sLyCurrent, current); + + Media_Item *next = NULL; + + next = ivug_ss_get_next_item(pSlideShow->media_list, + pSlideShow->ss_Header, + sLyCurrent->mitem, + pSlideShow->ss_mode); + + if(next == NULL) + { + /* if last image is tapped, then after some time, back to main view directly */ + pSlideShow->ss_timer = NULL; + pSlideShow->ss_Header = NULL; + pSlideShow->state = SLIDE_SHOW_RUNNING; + + pSlideShow->ss_timer = ecore_timer_add(pSlideShow->ss_interval_time, _ivug_ss_auto_finish_timer_cb, pSlideShow); + return false; + } + + _ivug_ss_set_content(sLyNext, next); + + pSlideShow->state = SLIDE_SHOW_RUNNING; + +#if 0 + if(_ivug_ss_on_slide_interval(pSlideShow) == false) + { + pSlideShow->ss_timer = NULL; + pSlideShow->ss_Header = NULL; + + /* exit slide show after whole animation is over */ + ivug_ss_stop(pSlideShow); + return false; + } +#endif +// EFL::dump_obj(pSlideShow->obj, 0); + + if(pSlideShow->ss_timer) + { + ecore_timer_del(pSlideShow->ss_timer); + } + pSlideShow->ss_timer = ecore_timer_add(pSlideShow->ss_interval_time, _ivug_ss_on_slide_interval, pSlideShow); + + MSG_HIGH("Slide show started!"); + + return true; +} + + +bool ivug_ss_stop(SlideShow *pSlideShow) +{ + MSG_ASSERT(pSlideShow != NULL); + + MSG_HIGH("Slide show stopping"); + + if (pSlideShow->state != SLIDE_SHOW_RUNNING) + { + MSG_HIGH("pSlideShow->state != SLIDE_SHOW_RUNNING"); + return true; + } + + pSlideShow->bSS_StopFlag = EINA_TRUE; + + //delete timmer + if(pSlideShow->ss_timer) { + ecore_timer_del(pSlideShow->ss_timer); + pSlideShow->ss_timer = NULL; + } + + if(pSlideShow->click_timer) { + ecore_timer_del(pSlideShow->click_timer); + pSlideShow->click_timer = NULL; + } + if(pSlideShow->event) { + evas_object_del(pSlideShow->event); + pSlideShow->event = NULL; + } + + if(pSlideShow->effect_engine == NULL) + { + MSG_HIGH("Slide effect_engine = NULL"); + pSlideShow->state = SLIDE_SHOW_STOPPED; + pSlideShow->ss_Header = NULL; + pSlideShow->bSS_StopFlag = EINA_FALSE; + evas_object_smart_callback_call(ivug_ss_object_get(pSlideShow), "slideshow,finished", (void *)SLIDE_SHOW_STOPPED); + } + //MSG_HIGH("Stop slide show. but not run state"); + + return true; +} + +bool ivug_ss_resume(SlideShow *pSlideShow) +{ + MSG_HIGH("Slide show Resume"); + MSG_ASSERT(pSlideShow != NULL); + + if(pSlideShow->ss_timer) + { + ecore_timer_thaw(pSlideShow->ss_timer); + } + + pSlideShow->state = SLIDE_SHOW_RUNNING; + //MSG_HIGH("ivug_resume_slideshow"); + + return true; +} + +bool ivug_ss_pause(SlideShow *pSlideShow) +{ + MSG_HIGH("Slide show Pause"); + + MSG_ASSERT(pSlideShow != NULL); + + if(pSlideShow->ss_timer) + { + ecore_timer_freeze(pSlideShow->ss_timer); + } + + pSlideShow->state = SLIDE_SHOW_PAUSE; + + return true; +} + +Media_Item * ivug_ss_item_get(SlideShow *pSlideShow) +{ + MSG_ASSERT(pSlideShow != NULL); + + return pSlideShow->sLayout[(pSlideShow->sCurrent) % 2].mitem; +} + +void ivug_ss_delete(SlideShow *pSlideShow) +{ + MSG_HIGH("Slide show Delete"); + + if(!pSlideShow) + { + MSG_ERROR("Already deleted!!"); + return; + } + evas_object_event_callback_del(pSlideShow->event, EVAS_CALLBACK_MOUSE_DOWN, _ivug_ss_on_mouse_down); + evas_object_event_callback_del(pSlideShow->event, EVAS_CALLBACK_MOUSE_MOVE, _ivug_ss_on_mouse_move); + evas_object_event_callback_del(pSlideShow->event, EVAS_CALLBACK_MOUSE_UP, _ivug_ss_on_mouse_up); + + if(pSlideShow->effect_engine) + ivug_effect_finalize(pSlideShow->effect_engine); + + if(pSlideShow->ss_timer) { + ecore_timer_del(pSlideShow->ss_timer); + pSlideShow->ss_timer = NULL; + } + if(pSlideShow->click_timer) { + ecore_timer_del(pSlideShow->click_timer); + pSlideShow->click_timer = NULL; + } + + for ( int i = 0 ; i < 2; i++) + { + if(pSlideShow->sLayout[i].photocam) { + #ifdef USE_IVUG_IMAGE + ivug_image_unset(pSlideShow->sLayout[i].photocam); + #endif + evas_object_del(pSlideShow->sLayout[i].photocam); + pSlideShow->sLayout[i].photocam = NULL; + } + if(pSlideShow->sLayout[(pSlideShow->sCurrent) % 2].layout) + pSlideShow->sLayout[(pSlideShow->sCurrent) % 2].photocam = + elm_object_part_content_unset(pSlideShow->sLayout[(pSlideShow->sCurrent) % 2].layout, + "content"); + + if(pSlideShow->sLayout[(pSlideShow->sCurrent) % 2].photocam) { + evas_object_del(pSlideShow->sLayout[(pSlideShow->sCurrent) % 2].photocam); + pSlideShow->sLayout[(pSlideShow->sCurrent) % 2].photocam = NULL; + } + if(pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2].layout) + pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2].photocam = + elm_object_part_content_unset(pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2].layout, + "content"); + + if(pSlideShow->sLayout[i].layout) { + evas_object_del(pSlideShow->sLayout[i].layout); + pSlideShow->sLayout[i].layout = NULL; + } + + } + + if ( pSlideShow->event ) + { + evas_object_del(pSlideShow->event); + pSlideShow->event = NULL; + } + + if ( pSlideShow->obj ) + { + evas_object_del(pSlideShow->obj); + pSlideShow->obj = NULL; + } + + if(pSlideShow) + { + free(pSlideShow); + pSlideShow = NULL; + } + return; +} + +void ivug_ss_resize(SlideShow *pSlideShow) +{ + IVUG_FUNC_ENTER(); + /*This interface only used for 2d slideshow, + *So disable it when current is dali-slideshow. + *resize slide show layout and move them to right pos after rotation + */ + if (!pSlideShow) { + return; + } + if((pSlideShow->obj) && (pSlideShow->event)) { + ivug_ss_get_screen_size(&pSlideShow->screen_w, &pSlideShow->screen_h); + evas_object_resize(pSlideShow->obj, pSlideShow->screen_w, pSlideShow->screen_h); + Evas_Coord ox, oy, ow, oh; + evas_object_geometry_get(pSlideShow->obj, &ox, &oy, &ow, &oh); + + //MSG_HIGH("Moved (%d,%d,%d,%d)", ox, oy, ow, oh); + if(pSlideShow->event) + { + evas_object_move(pSlideShow->event, ox, oy); + } + + if(pSlideShow->sLayout[pSlideShow->sCurrent].layout) + { + evas_object_move(pSlideShow->sLayout[pSlideShow->sCurrent].layout, ox, oy); + } + if(pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2].layout) + { + evas_object_move(pSlideShow->sLayout[(pSlideShow->sCurrent + 1) % 2].layout, ox + pSlideShow->screen_w + IVUG_IMAGE_BETWEEN_MARGIN, oy); + } + //MSG_HIGH("_ivug_ss_resize_obj, Moved (%d,%d,%d,%d)", ox, oy, ow, oh); + } + + IVUG_FUNC_LEAVE(); +} + + + +Evas_Object *ivug_ss_object_get(SlideShow *pSlideShow) +{ + MSG_ASSERT(pSlideShow != NULL); + + return pSlideShow->obj; +} + +void +ivug_ss_set_stop(SlideShow *pSlideShow) +{ + MSG_ASSERT(pSlideShow != NULL); + + pSlideShow->state = SLIDE_SHOW_STOPPED; +} + diff --git a/slideshow/src/effect/include/ivug-anim.h b/slideshow/src/effect/include/ivug-anim.h new file mode 100755 index 0000000..ab950bd --- /dev/null +++ b/slideshow/src/effect/include/ivug-anim.h @@ -0,0 +1,64 @@ +/* + * Copyright 2012 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 __IVUG_ANIM_H__ +#define __IVUG_ANIM_H__ + +#include + +typedef enum { + ANIM_TYPE_LINEAR, + ANIM_TYPE_QUARTIC_INOUT, + ANIM_TYPE_QUINTIC_INOUT, + ANIM_TYPE_SINE, +} anim_type_t; + +/* + t: current time b: start time c: change in value d: duration +*/ +typedef double (*anim_transit_func_t) (double t, double b, double c, double d); + +typedef struct { +/* private */ + double duration; + double t_start; + double t_varing; + + anim_transit_func_t transit_func; + + void *user_data; +} anim_handle_t; + +#ifdef __cplusplus +extern "C" { +#endif + +anim_handle_t *create_animation(); + +void delete_animation(anim_handle_t *anim); + +bool update_animation(anim_handle_t *anim, double current, double *value); + +bool set_animation_type(anim_handle_t *anim, anim_type_t type); + +bool set_animation(anim_handle_t *anim, int start, int end, double duration); + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/slideshow/src/effect/include/ivug-effect.h b/slideshow/src/effect/include/ivug-effect.h new file mode 100755 index 0000000..6027517 --- /dev/null +++ b/slideshow/src/effect/include/ivug-effect.h @@ -0,0 +1,98 @@ +/* + * Copyright 2012 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 __IVUG_EFFECT_H__ +#define __IVUG_EFFECT_H__ + +#include +#include +#include "ivug-anim.h" + +#define EFFECT_LBYTES_ARGB8888(w) (((w) * 4)) +#define MAX_PERCENT (100.0f) +#define MIN_PERCENT (0.0f) + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *Effect_Data ; + +typedef void (*FuncFinished)(void *data); + +typedef struct { + Effect_Data eng_data; + + FuncFinished pFinishedCB; + void *ClientData; + + double t_base; // start time. + anim_handle_t *anim; + Ecore_Animator *animator; + + struct { + Effect_Data (*init) (Evas_Object *src, Evas_Object *dst); + bool (*set_size) (Effect_Data data, int screen_w, int screen_h, int rotation); + void (*animate) (Effect_Data data, double percent); + void (*pause) (Effect_Data data); /* Not used*/ + void (*resume) (Effect_Data data); /* Not used*/ + void (*finalize) (Effect_Data data); + + double (*get_duration)(Effect_Data data); + } func; + +} Effect_Engine; + +typedef enum _Effect_Type { + EFFECT_NONE, + EFFECT_IRIS, + EFFECT_DISSOLVE, + EFFECT_SLIDE, + EFFECT_DISSOLVE_FADE, + EFFECT_SPLIT, + EFFECT_MAX +} Effect_Type; + + + + + +Effect_Engine *ivug_effect_add(Effect_Type type); + +bool ivug_effect_init(Effect_Engine *engine, Evas_Object *src, Evas_Object *dst); +bool ivug_effect_set_size(Effect_Engine *engine, int w, int h, int rotation); +bool ivug_effect_start(Effect_Engine *engine, FuncFinished pFunc, void *data); +bool ivug_effect_pause(Effect_Engine *engine); +bool ivug_effect_resume(Effect_Engine *engine); +bool ivug_effect_finalize(Effect_Engine *engine); + + +/* + Private function for adding effect. Do not use below functions directly.. +*/ +Effect_Engine *ivug_fade_add(void); +Effect_Engine *ivug_iris_add(void); +Effect_Engine *ivug_dissolve_add(void); +Effect_Engine *ivug_blind_add(void); +Effect_Engine *ivug_slide_add(void); + + +#ifdef __cplusplus +} +#endif + + +#endif /* __IVUG_EFFECT_H__ */ diff --git a/slideshow/src/effect/ivug-anim.c b/slideshow/src/effect/ivug-anim.c new file mode 100755 index 0000000..7b76d1b --- /dev/null +++ b/slideshow/src/effect/ivug-anim.c @@ -0,0 +1,176 @@ +/* + * Copyright 2012 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 /* for NULL */ +#include +#include + +#include "ivug-debug.h" +#include "ivug-anim.h" + +/* + t: current time b: start time c: change in value d: duration +*/ +static double _anim_linear(double t, double b, double c, double d) +{ + if(d != 0.0) + t /= d; + return b + c * (t); +} + +static double _anim_sine(double t, double b, double c, double d) +{ + static const double const SIN_TABLE[91] = { + 0.0000f, 0.0174f, 0.0349f, 0.0523f, 0.0698f, + 0.0872f, 0.1045f, 0.1219f, 0.1392f, 0.1564f, + 0.1736f, 0.1908f, 0.2079f, 0.2249f, 0.2419f, + 0.2588f, 0.2756f, 0.2924f, 0.3090f, 0.3256f, + 0.3420f, 0.3584f, 0.3746f, 0.3907f, 0.4067f, + 0.4226f, 0.4384f, 0.4540f, 0.4695f, 0.4848f, + 0.5000f, 0.5150f, 0.5299f, 0.5446f, 0.5592f, + 0.5736f, 0.5878f, 0.6018f, 0.6157f, 0.6293f, + 0.6528f, 0.6561f, 0.6691f, 0.6820f, 0.6947f, + 0.7071f, 0.7193f, 0.7314f, 0.7431f, 0.7547f, + 0.7660f, 0.7772f, 0.7880f, 0.7986f, 0.8090f, + 0.8191f, 0.8290f, 0.8387f, 0.8480f, 0.8571f, + 0.8660f, 0.8746f, 0.8829f, 0.8910f, 0.8988f, + 0.9063f, 0.9135f, 0.9205f, 0.9272f, 0.9336f, + 0.9397f, 0.9455f, 0.9511f, 0.9563f, 0.9613f, + 0.9659f, 0.9703f, 0.9744f, 0.9781f, 0.9816f, + 0.9848f, 0.9877f, 0.9903f, 0.9926f, 0.9945f, + 0.9962f, 0.9976f, 0.9986f, 0.9994f, 0.9998f, + 1.0f + }; + + if(d != 0.0) + t /= d; /* normalize */ + + int idx = (int)(90.0 * t); + + return b + c * (SIN_TABLE[idx]); + +} + +static double _anim_ease_inout_quartic(double t, double b, + double c, double d) +{ + if(d != 0.0) + t /= d; + double ts = t * t; + double tc = ts * t; + return b + c * (-2 * tc + 3 * ts); + +} + +static double _anim_ease_inout_quintic(double t, double b, + double c, double d) +{ + if(d != 0.0) + t /= d; + double ts = t * t; + double tc = ts * t; + return b + c * (6 * tc * ts + -15 * ts * ts + 10 * tc); +} + +anim_handle_t *create_animation() +{ + anim_handle_t *anim; + + anim = calloc(1, sizeof(anim_handle_t)); + + if (anim == NULL) { + MSG_IVUG_ERROR("Cannot allocate memory"); + return NULL; + } + + return anim; + +} + +void delete_animation(anim_handle_t *anim) +{ + IV_ASSERT(anim != NULL); + + free(anim); + +} + +bool set_animation_type(anim_handle_t *anim, anim_type_t type) +{ + IV_ASSERT(anim != NULL); + + switch (type) { + case ANIM_TYPE_LINEAR: + anim->transit_func = _anim_linear; + break; + case ANIM_TYPE_QUARTIC_INOUT: + anim->transit_func = _anim_ease_inout_quartic; + break; + + case ANIM_TYPE_QUINTIC_INOUT: + anim->transit_func = _anim_ease_inout_quintic; + break; + + case ANIM_TYPE_SINE: + anim->transit_func = _anim_sine; + break; + default: + MSG_IVUG_ERROR("Invalid transition type=%d", type); + return false; + break; + } + + return true; +} + +bool set_animation(anim_handle_t *anim, int start, int end, double duration) +{ + IV_ASSERT(anim != NULL); + + //MSG_IVUG_HIGH("Set Anim. Start=%d End=%d Dur=%f", start, end, duration); + anim->duration = duration; + anim->t_start = start; + anim->t_varing = end - start; + + return true; +} + +bool update_animation(anim_handle_t *anim, double current, double *value) +{ + //MSG_IVUG_HIGH("update_animation"); + IV_ASSERT(anim != NULL); + IV_ASSERT(anim->transit_func != NULL); + + if (current >= anim->duration) { + *value = anim->t_start + anim->t_varing; + //MSG_IVUG_HIGH("End Start:%f Varing:%f Duration=%f", + //anim->t_start, anim->t_varing, anim->duration); + + //MSG_IVUG_HIGH("End Current=%f Value=%f", current, *value); + + return false; /* End of animation */ + } + + MSG_EFFECT_LOW("Start:%f Varing:%f Duration=%f Current=%f", anim->t_start, anim->t_varing, anim->duration, current); + + *value = anim->transit_func(current, anim->t_start, anim->t_varing, + anim->duration); + + MSG_EFFECT_LOW("Value = %f", *value); + + return true; +} diff --git a/slideshow/src/effect/ivug-blind.c b/slideshow/src/effect/ivug-blind.c new file mode 100755 index 0000000..b27446d --- /dev/null +++ b/slideshow/src/effect/ivug-blind.c @@ -0,0 +1,313 @@ +/* + * Copyright 2012 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 "ivug-debug.h" +#include "ivug-xcapture.h" +#include "ivug-effect.h" + +/* Currently only 4 is supported */ +#define DEFAULT_MAP_COUNT (4) +#define DEFAULT_FOCUL_DISTANCE (10000) + +#define DEFAULT_START_ANGLE (0.0f) +#define DEFAULT_END_ANGLE (90.0f) + +#define MAX_BLIND_NUM 8 + +typedef struct _Blind_Rotation Blind_Rotation; + +struct _Blind_Rotation { + bool cw; /* Clockwise rotation */ + float from, to; /* rotate angle: 0 ~ 360 */ +}; + +typedef struct _Blind_Data Blind_Data; + +struct _Blind_Data { + int bx; + int by; + int bw; + int bh; + + Evas_Object * img[MAX_BLIND_NUM]; + + Evas_Object * dst; + + Evas * evas; + + Blind_Rotation rotation; +}; + +static bool +__ivug_blind_image_create(Evas *e, Blind_Data *engine, + int *src_data) +{ + ivug_retvm_if(e == NULL, false, "Evas is NULL"); + ivug_retvm_if(engine == NULL, false, "engine is NULL"); + ivug_retvm_if(src_data == NULL, false, "src_data is NULL"); + + Blind_Data *eng_data = engine; + + ivug_retvm_if((eng_data->bw <= 0 || eng_data->bh <= 0), false, + "bw or bh is 0: [%d, %d]", eng_data->bw, eng_data->bh); + + int index; + int row = 0; + int col = 0; + + int *psrc = src_data; + int *dst_data = NULL; + + for (index = 0; index < MAX_BLIND_NUM; index++) { + eng_data->img[index] = evas_object_image_filled_add(e); + evas_object_image_size_set(eng_data->img[index], eng_data->bw, + eng_data->bh); + evas_object_image_fill_set(eng_data->img[index], 0, 0, + eng_data->bw, eng_data->bh); + evas_object_image_data_update_add(eng_data->img[index], 0, 0, + eng_data->bw, eng_data->bh); + + dst_data = + evas_object_image_data_get(eng_data->img[index], + EINA_TRUE); + + row = eng_data->bw; + col = eng_data->bh; + while (col--) { + while (row--) { + *dst_data++ = *psrc++; + } + + row = eng_data->bw; + } + + evas_object_resize(eng_data->img[index], eng_data->bw, + eng_data->bh); + evas_object_move(eng_data->img[index], eng_data->bx, + eng_data->by + eng_data->bh * index); + evas_object_show(eng_data->img[index]); + } + + return true; +} + +static Effect_Data __ivug_blind_init(Evas_Object *src, Evas_Object *dst) +{ + IV_ASSERT(src != NULL); + + Blind_Data *eng_data = calloc(1, sizeof(Blind_Data)); + if (eng_data == NULL) { + MSG_EFFECT_ERROR("Memory calloc failed"); + return NULL; + } + + eng_data->evas = evas_object_evas_get(src); + + Evas_Coord x, y, w, h; + evas_object_geometry_get(src, &x, &y, &w, &h); + + eng_data->bx = x; + eng_data->by = y; + + eng_data->dst = dst; + + evas_object_stack_below(dst, src); + evas_object_move(dst, 0, 0); + + eng_data->rotation.cw = true; + eng_data->rotation.from = DEFAULT_START_ANGLE; + eng_data->rotation.to = DEFAULT_END_ANGLE; + + /* Need hide the img_object here */ + evas_object_hide(src); + + return (Effect_Data)eng_data; +} + +static bool __ivug_blind_set_size(void *data, int screen_w, int screen_h, int rotation) +{ + IVUG_FUNC_ENTER(); + + ivug_retvm_if((screen_w <= 0 + || screen_h <= 0), false, + "screen_w or screen_h <= 0: [%d, %d]", screen_w, + screen_h); + + Blind_Data *eng_data = (Blind_Data *) data; + + /* Get the data from ecore evas */ + int size = 0; + int *src_data = (int *)ivug_xcapture_screen_data_get(&size, rotation); + ivug_retvm_if(src_data == NULL, false, "screen data is NULL"); + + if (size != screen_h * EFFECT_LBYTES_ARGB8888(screen_w)) { + MSG_EFFECT_ERROR("Screen data size is invalid: %d", size); + + free(src_data); + src_data = NULL; + + return false; + } + + eng_data->bw = screen_w; + eng_data->bh = screen_h / MAX_BLIND_NUM; + + MSG_EFFECT_HIGH("eng_data->bw = %d, eng_data->bh = %d", eng_data->bw, + eng_data->bh); + + int index; + for (index = 0; index < MAX_BLIND_NUM; index++) { + evas_object_del(eng_data->img[index]); + eng_data->img[index] = NULL; + } + + bool ret = __ivug_blind_image_create(eng_data->evas, + eng_data, src_data); + if (ret == false) { + MSG_EFFECT_ERROR("Create effect image failed"); + + free(src_data); + src_data = NULL; + + return false; + } + + free(src_data); + src_data = NULL; + + evas_object_move(eng_data->dst, 0, 0); + + IVUG_FUNC_LEAVE(); + + return true; +} + +static void _ivug_blind_rotation_op(void *data, double frame) +{ + IVUG_FUNC_ENTER(); + + Blind_Data *eng_data = (Blind_Data *) data; + ivug_retm_if(eng_data == NULL, "eng_data is NULL"); + + Blind_Rotation *rotation = &(eng_data->rotation); + + float degree; + + degree = rotation->from + (float)(frame * rotation->to); + + if (!rotation->cw) { + degree *= -1; + } + + MSG_EFFECT_MED("frame = %f, degree = %f", frame, degree); + + int offset = eng_data->bh / 2; + int y; + + Evas_Map *map = NULL; + int index; + for (index = 0; index < MAX_BLIND_NUM; index++) { + map = evas_map_new(DEFAULT_MAP_COUNT); + if (map == NULL) { + MSG_EFFECT_ERROR("Create map failed"); + break; + } + + evas_map_smooth_set(map, EINA_TRUE); + evas_map_util_points_populate_from_object_full(map, + eng_data->img + [index], 0); + + y = index * eng_data->bh + offset; + + evas_map_util_3d_rotate(map, degree, 0, 0, eng_data->bw / 2, y, 0); + evas_map_util_3d_perspective(map, eng_data->bw / 2, y, 0, + DEFAULT_FOCUL_DISTANCE); + + evas_object_map_enable_set(eng_data->img[index], EINA_TRUE); + evas_object_map_set(eng_data->img[index], map); + evas_map_free(map); + } + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_blind_anim(void *data, double percent) +{ +/* IVUG_FUNC_ENTER(); */ + + ivug_retm_if(data == NULL, "data is NULL"); + + Blind_Data *eng_data = (Blind_Data *) data; + + ivug_retm_if((percent < MIN_PERCENT + || percent > MAX_PERCENT), + "Invalide value: percent = [%f]", percent); + + double frame = percent / MAX_PERCENT; + _ivug_blind_rotation_op(eng_data, frame); + +/* IVUG_FUNC_LEAVE(); */ +} + +static void __ivug_blind_pause(void *data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_blind_resume(void *data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_blind_finialize(void *data) +{ + IVUG_FUNC_ENTER(); + + ivug_retm_if(data == NULL, "data is NULL"); + + Blind_Data *eng_data = (Blind_Data *) data; + + int index; + for (index = 0; index < MAX_BLIND_NUM; index++) { + evas_object_del(eng_data->img[index]); + eng_data->img[index] = NULL; + } + + free(eng_data); + eng_data = NULL; + + IVUG_FUNC_LEAVE(); +} + +Effect_Engine *ivug_blind_add(void) +{ + Effect_Engine *eng_blind = calloc(1, sizeof(Effect_Engine)); + ivug_retvm_if(eng_blind == NULL, NULL, "calloc failed"); + + eng_blind->func.init = &__ivug_blind_init; + eng_blind->func.set_size = &__ivug_blind_set_size; + eng_blind->func.animate = &__ivug_blind_anim; + eng_blind->func.pause = &__ivug_blind_pause; + eng_blind->func.resume = &__ivug_blind_resume; + eng_blind->func.finalize = &__ivug_blind_finialize; + + return eng_blind; +} diff --git a/slideshow/src/effect/ivug-dissolve.c b/slideshow/src/effect/ivug-dissolve.c new file mode 100755 index 0000000..552c782 --- /dev/null +++ b/slideshow/src/effect/ivug-dissolve.c @@ -0,0 +1,367 @@ +/* + * Copyright 2012 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 "ivug-debug.h" + +#include "ivug-xcapture.h" +#include "ivug-effect.h" + +#define BLOCK_ROW_NUM 20 +#define BLOCK_COL_NUM 12 + +#define DISSOLVE_NUM 240 // 20 * 12 + +const int const DISSOLVE_TABLE[DISSOLVE_NUM] = { + 201, 8, 82, 163, 181, 215, 0, 126, 30, 106, + 162, 122, 216, 18, 99, 70, 223, 89, 22, 191, + 103, 235, 154, 230, 50, 231, 14, 135, 60, 10, + 114, 210, 53, 113, 17, 199, 42, 165, 229, 100, + 97, 45, 125, 34, 15, 64, 48, 202, 150, 80, + 130, 2, 61, 86, 159, 239, 207, 95, 164, 168, + 55, 75, 169, 6, 145, 149, 173, 208, 205, 4, + 124, 13, 116, 194, 198, 175, 94, 176, 81, 144, + 184, 180, 187, 66, 72, 206, 24, 225, 220, 59, + 3, 182, 93, 237, 16, 227, 54, 119, 183, 38, + 101, 107, 21, 23, 143, 186, 233, 28, 213, 52, + 136, 31, 179, 228, 7, 129, 185, 123, 147, 131, + 111, 234, 192, 33, 139, 203, 160, 137, 47, 40, + 141, 172, 65, 157, 43, 88, 218, 44, 83, 62, + 217, 178, 193, 109, 189, 151, 115, 39, 91, 19, + 138, 76, 190, 209, 79, 63, 158, 196, 85, 214, + 56, 152, 108, 27, 222, 46, 156, 177, 105, 37, + 71, 96, 26, 87, 221, 68, 110, 117, 78, 112, + 188, 74, 77, 92, 69, 170, 238, 120, 35, 51, + 211, 146, 11, 148, 58, 5, 174, 41, 161, 84, + 12, 121, 171, 25, 1, 226, 166, 195, 134, 153, + 212, 142, 29, 9, 155, 132, 67, 200, 73, 127, + 197, 232, 140, 224, 104, 167, 90, 102, 57, 204, + 133, 128, 49, 118, 32, 219, 20, 236, 36, 98 +}; + +typedef struct _Dissolve_Data Dissolve_Data; + +struct _Dissolve_Data { + int screen_w; + int screen_h; + + int screen_x; + int screen_y; + + int block_w; /* block width*/ + int block_h; /* block height*/ + + int n_row; /* row number*/ + int n_col; /* col number*/ + + Evas_Object **diss_img; + Evas * evas; + Evas_Object *src; + Evas_Object *dst; +}; + +static bool +__ivug_dissolve_image_create(Evas *evas, Dissolve_Data * eng_data, + int *src_data) +{ + ivug_retvm_if(evas == NULL, false, "Evas is NULL"); + ivug_retvm_if(eng_data == NULL, false, "eng_data is NULL"); + ivug_retvm_if(src_data == NULL, false, "src_data is NULL"); + + ivug_retvm_if((eng_data->block_w <= 0 || eng_data->block_h <= 0), false, + "screen_w or screen_h is: [%d, %d]", eng_data->block_w, + eng_data->block_h); + + ivug_retvm_if((eng_data->n_row <= 0 || eng_data->n_col <= 0), false, + "n_row or n_col is: [%d, %d]", eng_data->n_row, + eng_data->n_col); + + int *psrc = NULL; + Evas_Object *img_obj = NULL; + int *dst_data = NULL; + + int i, j; + int start_pos = 0; + int index; + for (i = 0; i < eng_data->n_row; i++) { + for (j = 0; j < eng_data->n_col; j++) { + img_obj = evas_object_image_filled_add(evas); + evas_object_image_size_set(img_obj, eng_data->block_w, + eng_data->block_h); + + /* Locate at the left-top corner*/ + start_pos = + i * eng_data->screen_w * eng_data->block_h + + j * eng_data->block_w; + psrc = src_data + start_pos; +// MSG_EFFECT_HIGH("start_pos is %d", start_pos); + + /* Set the image data*/ + dst_data = evas_object_image_data_get(img_obj, + EINA_TRUE); + int row = eng_data->block_w; + int col = eng_data->block_h; + + while (col--) { + while (row--) { + *dst_data++ = *psrc++; + } + + row = eng_data->block_w; + psrc += (eng_data->n_col - 1) * row; + } + + evas_object_image_alpha_set(img_obj, EINA_TRUE); + evas_object_resize(img_obj, eng_data->block_w, + eng_data->block_h); + + /* Change the position*/ + int pos_x, pos_y; + pos_x = eng_data->screen_x + j * eng_data->block_w; + pos_y = eng_data->screen_y + i * eng_data->block_h; + +// MSG_EFFECT_HIGH("[pos_x, pos_y] is [%d, %d]\n", pos_x, +// pos_y); + evas_object_move(img_obj, pos_x, pos_y); + evas_object_show(img_obj); + + index = i * eng_data->n_col + j; + eng_data->diss_img[index] = img_obj; + } + } + + return true; +} + +static Effect_Data __ivug_dissolve_init(Evas_Object *src, Evas_Object *dst) +{ + IVUG_FUNC_ENTER(); + + IV_ASSERT(src != NULL); + + Dissolve_Data *eng_data = calloc(1, sizeof(Dissolve_Data)); + if (eng_data == NULL) { + MSG_EFFECT_ERROR("calloc for eng_data failed"); + return NULL; + } + + eng_data->evas = evas_object_evas_get(src); + + eng_data->src = src; + eng_data->dst = dst; + + evas_object_stack_below(dst, src); + evas_object_move(dst, 0, 0); + + /* Need hide the img_object here*/ + evas_object_hide(src); + + IVUG_FUNC_LEAVE(); + + return (Effect_Data)eng_data; +} + +static bool __ivug_dissolve_set_size(void *data, int screen_w, int screen_h, int rotation) +{ + IVUG_FUNC_ENTER(); + + IV_ASSERT(data != NULL); + + ivug_retvm_if((screen_w <= 0 + || screen_h <= 0), false, + "screen_w or screen_h <= 0: [%d, %d]", screen_w, + screen_h); + + MSG_EFFECT_HIGH("[screen_w, screen_h] = [%d, %d]", screen_w, screen_h); + + Dissolve_Data *eng_data = (Dissolve_Data *) data; + + /* Get the data from ecore evas*/ + int size = 0; + char *src_data = ivug_xcapture_screen_data_get(&size, rotation); + ivug_retvm_if(src_data == NULL, false, "screen data is NULL"); + + if (size != screen_h * EFFECT_LBYTES_ARGB8888(screen_w)) { + MSG_EFFECT_ERROR("Screen data size is invalid: %d", size); + + free(src_data); + src_data = NULL; + + return false; + } + + Evas_Coord x, y, w, h; + evas_object_geometry_get(eng_data->src, &x, &y, &w, &h); + eng_data->screen_x = x; + eng_data->screen_y = y; + eng_data->screen_w = w; + eng_data->screen_h = h; + + if(rotation == 0 || rotation == 180) + { + eng_data->n_row = BLOCK_ROW_NUM; + eng_data->n_col = BLOCK_COL_NUM; + } + else + { + eng_data->n_row = BLOCK_COL_NUM; + eng_data->n_col = BLOCK_ROW_NUM; + } + eng_data->block_h = eng_data->screen_h / eng_data->n_row; + eng_data->block_w = eng_data->screen_w / eng_data->n_col; + + MSG_EFFECT_HIGH("[n_row, n_col] is [%d, %d]", eng_data->n_row, + eng_data->n_col); + MSG_EFFECT_HIGH("[block_h, block_w] is [%d, %d]", eng_data->block_h, + eng_data->block_w); + + int block_num = eng_data->n_row * eng_data->n_col; + MSG_EFFECT_HIGH("block_num is %d", block_num); + + int i; + if(eng_data->diss_img != NULL) + { + for (i = 0; i < block_num; i++) { + if (eng_data->diss_img[i]) { + evas_object_del(eng_data->diss_img[i]); + } + eng_data->diss_img[i] = NULL; + } + free(eng_data->diss_img); + } + + eng_data->diss_img = (Evas_Object **)calloc(1, block_num * + sizeof(Evas_Object *)); + + bool ret = __ivug_dissolve_image_create(eng_data->evas, eng_data, + (int *)src_data); + if (!ret) { + MSG_EFFECT_ERROR("Create images failed"); + + free(src_data); + src_data = NULL; + + return false; + } + + free(src_data); + src_data = NULL; + + evas_object_move(eng_data->dst, 0, 0); + + IVUG_FUNC_LEAVE(); + + return true; +} + +static void __ivug_dissolve_image_data_clear(Evas_Object *image) +{ + ivug_retm_if(!image, "image object is NULL"); + + int w, h; + evas_object_image_size_get(image, &w, &h); + ivug_retm_if(w <= 0, "image width is less than 0"); + ivug_retm_if(h <= 0, "image height is less than 0"); + + int *data = evas_object_image_data_get(image, EINA_TRUE); + ivug_retm_if(!data, "data is NULL"); + + int size = w * h; + + memset(data, 0x0, size * sizeof(int)); + evas_object_image_data_update_add(image, 0, 0, w, h); +} + +static void __ivug_dissolve_anim(void *data, double percent) +{ +/* IVUG_FUNC_ENTER();*/ + + Dissolve_Data *eng_data = (Dissolve_Data *) data; + + ivug_retm_if(eng_data == NULL, "data is NULL"); + ivug_retm_if(eng_data->diss_img == NULL, "dissolve image is NULL"); + + int count = (eng_data->n_row * eng_data->n_col) * percent / MAX_PERCENT; + MSG_EFFECT_MED("percent = %f, count = %d", percent, count); + + int i; + for (i = 0; i < count; i++) { + MSG_EFFECT_MED("diss_array[%d] = %d", i, DISSOLVE_TABLE[i]); + __ivug_dissolve_image_data_clear(eng_data-> + diss_img[DISSOLVE_TABLE[i]]); + } + +/* IVUG_FUNC_LEAVE();*/ +} + +static void __ivug_dissolve_pause(void *data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_dissolve_resume(void *data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_dissolve_finialize(void *data) +{ + IVUG_FUNC_ENTER(); + + ivug_retm_if(data == NULL, "data is NULL"); + + Dissolve_Data *eng_data = (Dissolve_Data *) data; + + if (eng_data->diss_img) { + int block_num = eng_data->n_row * eng_data->n_col; + int i; + + for (i = 0; i < block_num; i++) { + if (eng_data->diss_img[i]) { + evas_object_del(eng_data->diss_img[i]); + } + + eng_data->diss_img[i] = NULL; + } + + free(eng_data->diss_img); + eng_data->diss_img = NULL; + } + + free(eng_data); + eng_data = NULL; + + IVUG_FUNC_LEAVE(); +} + +Effect_Engine *ivug_dissolve_add(void) +{ + Effect_Engine *eng_dissolve = calloc(1, sizeof(Effect_Engine)); + ivug_retvm_if(eng_dissolve == NULL, NULL, "calloc failed"); + + eng_dissolve->func.init = &__ivug_dissolve_init; + eng_dissolve->func.set_size = &__ivug_dissolve_set_size; + eng_dissolve->func.animate = &__ivug_dissolve_anim; + eng_dissolve->func.pause = &__ivug_dissolve_pause; + eng_dissolve->func.resume = &__ivug_dissolve_resume; + eng_dissolve->func.finalize = &__ivug_dissolve_finialize; + + return eng_dissolve; +} diff --git a/slideshow/src/effect/ivug-effect.c b/slideshow/src/effect/ivug-effect.c new file mode 100755 index 0000000..4fb5e7b --- /dev/null +++ b/slideshow/src/effect/ivug-effect.c @@ -0,0 +1,232 @@ +/* + * Copyright 2012 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 "ivug-debug.h" +#include "ivug-effect.h" + +#define SIN_TABLE_NUM 91 + +/* Animation acceleration table */ +static const float const EFFECT_SIN_TABLE[SIN_TABLE_NUM] = { + 0.0000f, 0.0174f, 0.0349f, 0.0523f, 0.0698f, + 0.0872f, 0.1045f, 0.1219f, 0.1392f, 0.1564f, + 0.1736f, 0.1908f, 0.2079f, 0.2249f, 0.2419f, + 0.2588f, 0.2756f, 0.2924f, 0.3090f, 0.3256f, + 0.3420f, 0.3584f, 0.3746f, 0.3907f, 0.4067f, + 0.4226f, 0.4384f, 0.4540f, 0.4695f, 0.4848f, + 0.5000f, 0.5150f, 0.5299f, 0.5446f, 0.5592f, + 0.5736f, 0.5878f, 0.6018f, 0.6157f, 0.6293f, + 0.6528f, 0.6561f, 0.6691f, 0.6820f, 0.6947f, + 0.7071f, 0.7193f, 0.7314f, 0.7431f, 0.7547f, + 0.7660f, 0.7772f, 0.7880f, 0.7986f, 0.8090f, + 0.8191f, 0.8290f, 0.8387f, 0.8480f, 0.8571f, + 0.8660f, 0.8746f, 0.8829f, 0.8910f, 0.8988f, + 0.9063f, 0.9135f, 0.9205f, 0.9272f, 0.9336f, + 0.9397f, 0.9455f, 0.9511f, 0.9563f, 0.9613f, + 0.9659f, 0.9703f, 0.9744f, 0.9781f, 0.9816f, + 0.9848f, 0.9877f, 0.9903f, 0.9926f, 0.9945f, + 0.9962f, 0.9976f, 0.9986f, 0.9994f, 0.9998f, + 1.0f +}; + +#define SLIDESHOW_ANI_TIME (1.0f) + + +static Eina_Bool +_on_effect_animator(void *data) +{ + IV_ASSERT( data != NULL); + Effect_Engine *engine = data; + + double value = 0.0; + + if (update_animation(engine->anim, ecore_loop_time_get() - engine->t_base, &value) == false ) // If last frame + { + engine->animator = NULL; + + MSG_EFFECT_HIGH("Last effect frame. value=%f", value); + + engine->func.animate(engine->eng_data, value); // Draw last frame. + // Inform to user. + if ( engine->pFinishedCB ) + { + engine->pFinishedCB(engine->ClientData); + } + + return ECORE_CALLBACK_CANCEL; + } + + engine->func.animate(engine->eng_data, value); + + return ECORE_CALLBACK_RENEW; +} + + +bool ivug_effect_init(Effect_Engine *engine, Evas_Object *src, Evas_Object *dst) +{ + IV_ASSERT(engine != NULL ); + + void *data = engine->func.init(src, dst); + if (data == NULL) { + MSG_EFFECT_ERROR("init returned data is NULL"); + + return false; + } + + engine->eng_data = data; + + engine->anim = create_animation(); + return true; +} + +bool ivug_effect_set_size(Effect_Engine *engine, int w, int h, int rotation) +{ + IV_ASSERT(engine != NULL ); + IV_ASSERT(engine->eng_data != NULL); + + if (engine->func.set_size == NULL) + { + MSG_EFFECT_ERROR("engine->func.set_size is NULL"); + return false; + } + + MSG_EFFECT_HIGH("set size. WH(%d,%d) Rotation(%d)", w, h, rotation); + return engine->func.set_size(engine->eng_data, w, h, rotation); +} + + +bool ivug_effect_start(Effect_Engine *engine, FuncFinished pFunc, void *data) +{ + ivug_retvm_if(engine == NULL, false, "engine is NULL"); + + IV_ASSERT(engine->func.animate != NULL); + IV_ASSERT(engine->eng_data != NULL); + +// Set up slide show animator + engine->t_base = ecore_loop_time_get(); + + double duration = SLIDESHOW_ANI_TIME; + + if (engine->func.get_duration ) + { + duration = engine->func.get_duration(engine->eng_data); + } + + set_animation_type(engine->anim, ANIM_TYPE_LINEAR); + set_animation(engine->anim, 0, 100, duration); // 0~100% during 1 seconds + + engine->pFinishedCB = pFunc; + engine->ClientData = data; + + if (engine->animator == NULL) + { + engine->animator = ecore_animator_add(_on_effect_animator, engine); + } + + return true; +} + +bool ivug_effect_pause(Effect_Engine *engine) +{ +/* Unused. */ + return true; +} + +bool ivug_effect_resume(Effect_Engine *engine) +{ +/* Unused. */ + return true; +} + +bool ivug_effect_finalize(Effect_Engine *engine) +{ + ivug_retvm_if(engine == NULL, false, "engine is NULL"); + + if ( engine->animator ) + { + ecore_animator_del(engine->animator); + engine->animator = NULL; + } + + if (engine->eng_data) + { + if (engine->func.finalize) + { + MSG_EFFECT_HIGH("finalize"); + engine->func.finalize(engine->eng_data); + } + else + { + MSG_EFFECT_ERROR("engine->func.finalize is NULL"); + } + + engine->eng_data = NULL; + } + else + { + MSG_EFFECT_ERROR("engine->eng_data is NULL"); + } + + if ( engine->anim ) + { + delete_animation(engine->anim); + } + + free(engine); + engine = NULL; + + return true; +} + +Effect_Engine *ivug_effect_add(Effect_Type type) +{ + Effect_Engine *eng = NULL; + + switch (type) { + case EFFECT_DISSOLVE_FADE: + eng = ivug_fade_add(); + break; + + case EFFECT_SPLIT: + eng = ivug_blind_add(); + break; + + case EFFECT_IRIS: + eng = ivug_iris_add(); + break; + + case EFFECT_DISSOLVE: + eng = ivug_dissolve_add(); + break; + + case EFFECT_SLIDE: + eng = ivug_slide_add(); + break; + + default: + MSG_EFFECT_ERROR("Unknown effect type=%d", type); + return NULL; + break; + } + + if (eng == NULL) + { + MSG_EFFECT_ERROR("Cannot create effect enigne. type=%d", type); + return NULL; + } + + return eng; +} diff --git a/slideshow/src/effect/ivug-fade.c b/slideshow/src/effect/ivug-fade.c new file mode 100755 index 0000000..8382c5a --- /dev/null +++ b/slideshow/src/effect/ivug-fade.c @@ -0,0 +1,160 @@ +/* + * Copyright 2012 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 "ivug-debug.h" +#include "ivug-effect.h" + +typedef struct _Fade_Data Fade_Data; + +struct _Fade_Data { + Evas_Object *src; + Evas_Object *dst; + + Evas_Object *object; + Evas_Object *orig_cliper; + + Evas_Object *cliper; + + Evas * evas; + + int screen_w; + int screen_h; +}; + +static void *__ivug_fade_init(Evas_Object *src, Evas_Object *dst) +{ + IVUG_FUNC_ENTER(); + + Fade_Data *eng_data = calloc(1, sizeof(Fade_Data)); + ivug_retvm_if(eng_data == NULL, NULL, "calloc return NULL"); + + eng_data->evas = evas_object_evas_get(src); + + eng_data->src = src; + eng_data->dst = dst; + +// Move object to 0,0 + evas_object_stack_below(dst, src); + + evas_object_move(dst, 0, 0); + evas_object_move(src, 0, 0); + + Evas_Object *orig_cliper = evas_object_clip_get(src); + eng_data->orig_cliper = orig_cliper; + + IVUG_FUNC_LEAVE(); + + return (Effect_Data)eng_data; +} + +static bool __ivug_fade_set_size(void *data, int screen_w, int screen_h, int rotation) +{ + IVUG_FUNC_ENTER(); + + ivug_retvm_if(data == NULL, false, "data is NULL"); + + Fade_Data *eng_data = (Fade_Data *) data; + + Evas_Coord x, y, w, h; + evas_object_geometry_get(eng_data->src, &x, &y, &w, &h); + + eng_data->screen_w = screen_w; + eng_data->screen_h = screen_h; + + if (eng_data->cliper) { + evas_object_clip_unset(eng_data->src); + evas_object_del(eng_data->cliper); + eng_data->cliper = NULL; + } + + Evas_Object *clip = evas_object_rectangle_add(eng_data->evas); + evas_object_color_set(clip, 255, 255, 255, 255); + evas_object_resize(clip, screen_w, screen_h); + evas_object_move(clip, x, y); + evas_object_show(clip); + + evas_object_clip_set(eng_data->src, clip); + eng_data->cliper = clip; + + evas_object_move(eng_data->dst, 0, 0); + + IVUG_FUNC_LEAVE(); + + return true; +} + +static void __ivug_fade_anim(void *data, double percent) +{ + Fade_Data *eng_data = (Fade_Data *) data; + + ivug_retm_if(eng_data == NULL, "data is NULL"); + ivug_retm_if(eng_data->cliper == NULL, "cliper is NULL"); + + int alpha = 255 * (MAX_PERCENT - percent) / MAX_PERCENT; + evas_object_color_set(eng_data->cliper, alpha, alpha, alpha, alpha); + + MSG_EFFECT_MED("alpha = %d", alpha); +} + +static void __ivug_fade_pause(void *data) +{ + MSG_EFFECT_HIGH("Fade paused"); +} + +static void __ivug_fade_resume(void *data) +{ + MSG_EFFECT_HIGH("Fade resumed"); +} + +static void __ivug_fade_finialize(void *data) +{ + MSG_EFFECT_HIGH("Fade destroy"); + + ivug_retm_if(data == NULL, "data is NULL"); + + Fade_Data *eng_data = (Fade_Data *) data; + + if (eng_data->cliper) { + evas_object_clip_unset(eng_data->src); + evas_object_del(eng_data->cliper); + eng_data->cliper = NULL; + } + + if (eng_data->src && eng_data->orig_cliper) + { + evas_object_clip_set(eng_data->src, eng_data->orig_cliper); + } + + free(eng_data); + eng_data = NULL; + +} + +Effect_Engine *ivug_fade_add(void) +{ + Effect_Engine *eng_fade = calloc(1, sizeof(Effect_Engine)); + ivug_retvm_if(eng_fade == NULL, NULL, "calloc failed"); + + eng_fade->func.init = &__ivug_fade_init; + eng_fade->func.set_size = &__ivug_fade_set_size; + eng_fade->func.animate = &__ivug_fade_anim; + eng_fade->func.pause = &__ivug_fade_pause; + eng_fade->func.resume = &__ivug_fade_resume; + eng_fade->func.finalize = &__ivug_fade_finialize; + + return eng_fade; +} + diff --git a/slideshow/src/effect/ivug-iris.c b/slideshow/src/effect/ivug-iris.c new file mode 100755 index 0000000..b49eee7 --- /dev/null +++ b/slideshow/src/effect/ivug-iris.c @@ -0,0 +1,185 @@ +/* + * Copyright 2012 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 "ivug-debug.h" +#include "ivug-effect.h" + + +typedef struct _Iris_Data Iris_Data; + +struct _Iris_Data { + Evas_Object *src; + Evas_Object *dst; + + Evas_Object *orig_cliper; + + Evas_Object *cliper; + + Evas * evas; + + int screen_w; + int screen_h; +}; + +static Effect_Data __ivug_iris_init(Evas_Object *src, Evas_Object *dst) +{ + IVUG_FUNC_ENTER(); + + Iris_Data *eng_data = calloc(1, sizeof(Iris_Data)); + ivug_retvm_if(eng_data == NULL, NULL, "calloc return NULL"); + + eng_data->evas = evas_object_evas_get(src); + //ivug_retvm_if(eng_data->evas == NULL, NULL, "Get evas is NULL"); + if (eng_data->evas == NULL) { + MSG_IVUG_HIGH("evas is null"); + if (eng_data) { + free(eng_data); + eng_data = NULL; + } + return NULL; + } + eng_data->src = src; + eng_data->dst = dst; + + Evas_Object *orig_cliper = evas_object_clip_get(src); + eng_data->orig_cliper = orig_cliper; + + evas_object_stack_below(dst, src); + evas_object_move(dst, 0, 0); + + IVUG_FUNC_LEAVE(); + + return (Effect_Data)eng_data; +} + +static bool __ivug_iris_set_size(void *data, int screen_w, int screen_h, int rotation) +{ + IVUG_FUNC_ENTER(); + + ivug_retvm_if((screen_w <= 0 + || screen_h <= 0), false, + "screen_w or screen_h <= 0: [%d, %d]", screen_w, + screen_h); + + Iris_Data *eng_data = (Iris_Data *) data; + + Evas_Coord x, y, w, h; + evas_object_geometry_get(eng_data->src, &x, &y, &w, &h); + eng_data->screen_w = screen_w; + eng_data->screen_h = screen_h; + + if (eng_data->cliper) { + evas_object_del(eng_data->cliper); + eng_data->cliper = NULL; + } + + Evas_Object *clip = evas_object_rectangle_add(eng_data->evas); + evas_object_resize(clip, screen_w, screen_h); + evas_object_move(clip, x, y); + evas_object_show(clip); + evas_object_clip_set(eng_data->src, clip); + eng_data->cliper = clip; + + evas_object_move(eng_data->dst, 0, 0); + + IVUG_FUNC_LEAVE(); + + return true; + +} + +static void __ivug_iris_anim(void *data, double percent) +{ +/* IVUG_FUNC_ENTER(); */ + + Iris_Data *eng_data = (Iris_Data *) data; + + ivug_retm_if(eng_data == NULL, "data is NULL"); + ivug_retm_if(eng_data->cliper == NULL, "cliper is NULL"); + + int w = eng_data->screen_w; + int h = eng_data->screen_h; + int x, y; + + w = w * (MAX_PERCENT - percent) / MAX_PERCENT; + h = h * (MAX_PERCENT - percent) / MAX_PERCENT; + + x = (eng_data->screen_w - w) / 2; + y = (eng_data->screen_h - h) / 2; + + MSG_EFFECT_MED("percent=%f, [x, y, w, h] = [%d, %d, %d, %d]", percent, x, y, w, h); + + evas_object_resize(eng_data->cliper, w, h); + evas_object_move(eng_data->cliper, x, y); + +/* IVUG_FUNC_LEAVE(); */ +} + +static void __ivug_iris_pause(void *data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_iris_resume(void *data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_iris_finialize(void *data) +{ + IVUG_FUNC_ENTER(); + + ivug_retm_if(data == NULL, "data is NULL"); + + Iris_Data *eng_data = (Iris_Data *) data; + + if (eng_data->cliper) { + evas_object_del(eng_data->cliper); + eng_data->cliper = NULL; + } + + if (eng_data->src && eng_data->orig_cliper) { + evas_object_clip_set(eng_data->src, eng_data->orig_cliper); + } + + free(eng_data); + eng_data = NULL; + + IVUG_FUNC_LEAVE(); +} + +Effect_Engine *ivug_iris_add(void) +{ + IVUG_FUNC_ENTER(); + + Effect_Engine *eng_iris = calloc(1, sizeof(Effect_Engine)); + ivug_retvm_if(eng_iris == NULL, NULL, "calloc failed"); + + eng_iris->func.init = &__ivug_iris_init; + eng_iris->func.set_size = &__ivug_iris_set_size; + eng_iris->func.animate = &__ivug_iris_anim; + eng_iris->func.pause = &__ivug_iris_pause; + eng_iris->func.resume = &__ivug_iris_resume; + eng_iris->func.finalize = &__ivug_iris_finialize; + + IVUG_FUNC_LEAVE(); + + return eng_iris; +} diff --git a/slideshow/src/effect/ivug-slide.c b/slideshow/src/effect/ivug-slide.c new file mode 100755 index 0000000..0b0603f --- /dev/null +++ b/slideshow/src/effect/ivug-slide.c @@ -0,0 +1,148 @@ +/* + * Copyright 2012 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 "ivug-debug.h" +#include "ivug-effect.h" +#include +#include +#include + + +typedef struct { + Evas_Object *src; + Evas_Object *dst; + + int screen_w; + int screen_h; +} Priv_Data; + +#define IMAGE_BETWEEN_MARGIN (30) + +static Effect_Data __ivug_slide_init(Evas_Object *src, Evas_Object *dst) +{ + Priv_Data *pData = calloc(1, sizeof(Priv_Data)); + IV_ASSERT(pData != NULL); + + pData->src = src; + pData->dst = dst; + + evas_object_stack_below(dst, src); + + evas_object_move(pData->src, 0, 0); + + return (Effect_Data)pData; +} + +static bool __ivug_slide_set_size(void *data, int screen_w, int screen_h, int rotation) +{ + Priv_Data *pData = (Priv_Data *)data; + IV_ASSERT(pData != NULL); + + pData->screen_w = screen_w; + pData->screen_h = screen_h; + + return true; +} + +static void _ivug_slide_get_screen_dimension(int *width, int *height) +{ + int rotation = elm_win_rotation_get((Evas_Object *)ug_get_window()); + + int screen_w = 0; + int screen_h = 0; + ecore_x_window_size_get(ecore_x_window_root_first_get(), &screen_w, &screen_h); + if(rotation == 0 || rotation == 180) + { + *width = screen_w; + *height = screen_h; + } + else if(rotation == 90 || rotation == 270) + { + *width = screen_h; + *height = screen_w; + } +} + +static void __ivug_slide_anim(Effect_Data data, double percent) +{ + Priv_Data *pData = (Priv_Data *)data; + + int first = 0; + int last = -pData->screen_w -IMAGE_BETWEEN_MARGIN; + //MSG_EFFECT_HIGH("pData->screen_w is %d", pData->screen_w); + //MSG_EFFECT_HIGH("last is %d", last); + int value = (double)first * (1.0f - percent / 100.0f) + (double)last * (percent / 100.0f); + + //MSG_EFFECT_HIGH("Slide animation. Value=%d %f", value, percent); + + Evas_Coord ow, oh; + /* + * during animation between 2 images, after rotation, 'w' gotten is 0 + * it's wrong, so let's use _ivug_slide_get_screen_dimension() to update + *pData->screen_w and pData->screen_h + */ + _ivug_slide_get_screen_dimension(&pData->screen_w, &pData->screen_h); + + ow = pData->screen_w; + oh = pData->screen_h; + //MSG_EFFECT_HIGH("in __ivug_slide_anim, pData->screen_w, pData->screen_h is %d, %d\n", ow, oh); + //MSG_EFFECT_HIGH("src des pos x is %d, %d\n", value ,oy); + //MSG_EFFECT_HIGH("dst des pos x is %d, %d\n", value + ow + IMAGE_BETWEEN_MARGIN ,oy); + evas_object_move(pData->src, value, 0); + evas_object_move(pData->dst, value + ow + IMAGE_BETWEEN_MARGIN, 0); + +} + +static void __ivug_slide_pause(Effect_Data data) +{ + +} + +static void __ivug_slide_resume(Effect_Data data) +{ + +} + +static void __ivug_slide_finialize(Effect_Data data) +{ + Priv_Data *pData = (Priv_Data *)data; + + free(pData); + +} + +static double __ivug_slide_get_duration(Effect_Data data) +{ + return 0.2f; +} + + + +Effect_Engine *ivug_slide_add(void) +{ + Effect_Engine *eng_slide = calloc(1, sizeof(Effect_Engine)); + ivug_retvm_if(eng_slide == NULL, NULL, "calloc failed"); + + eng_slide->func.init = __ivug_slide_init; + eng_slide->func.set_size = __ivug_slide_set_size; + eng_slide->func.animate = __ivug_slide_anim; + eng_slide->func.pause = __ivug_slide_pause; + eng_slide->func.resume = __ivug_slide_resume; + eng_slide->func.finalize = __ivug_slide_finialize; + eng_slide->func.get_duration = __ivug_slide_get_duration; + + return eng_slide; +} diff --git a/slideshow/src/effect/ivug-xcapture.c b/slideshow/src/effect/ivug-xcapture.c new file mode 100755 index 0000000..5f3aa52 --- /dev/null +++ b/slideshow/src/effect/ivug-xcapture.c @@ -0,0 +1,338 @@ +/* + * Copyright 2012 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 +#include + +#include +#include +#include +#include +#include + +#include "ivug-debug.h" + +#define MAX_ERROR_MSG_LEN 256 + +struct xcapture_t { + XImage *xim; + XShmSegmentInfo si; + int size; + Pixmap pix; +}; + +static int __ivug_xcapture_get_window_attribute(Window id, + int *depth, Visual **visual, + int *width, int *height) +{ + IV_ASSERT(id); + XWindowAttributes attr; + + if (!XGetWindowAttributes(ecore_x_display_get(), id, &attr)) { + MSG_EFFECT_ERROR("XGetWindowAttributes failed\n"); + return -1; + } + + if (attr.map_state == IsViewable && attr.class == InputOutput) { + *depth = attr.depth; + *width = attr.width; + *height = attr.height; + *visual = attr.visual; + } + + return 0; +} + +static struct xcapture_t *__ivug_xcapture(unsigned long id) +{ + IV_ASSERT(id); + + struct xcapture_t *handle = NULL; + int depth = 0; + int width = 0; + int height = 0; + Visual *visual = NULL; + char error_msg[MAX_ERROR_MSG_LEN] = { 0, }; + + handle = malloc(sizeof(struct xcapture_t)); + if (!handle) { + MSG_EFFECT_ERROR + ("Failed to allocate memory for __ivug_xcapture\n"); + return NULL; + } + + MSG_EFFECT_MED("Window : 0x%lX\n", id); + if (__ivug_xcapture_get_window_attribute + (id, &depth, &visual, &width, &height) < 0) { + MSG_EFFECT_ERROR("Failed to get the attributes from 0x%x\n", + (unsigned int)id); + free(handle); + return NULL; + } + + MSG_EFFECT_MED("WxH : %dx%d\n", width, height); + MSG_EFFECT_MED("Depth : %d\n", depth >> 3); + + /* NOTE: just add one more depth.... */ + handle->si.shmid = shmget(IPC_PRIVATE, + width * height * ((depth >> 3) + 1), + IPC_CREAT | 0666); + if (handle->si.shmid < 0) { + MSG_EFFECT_ERROR("Failed to get SHM %s\n", + strerror_r(errno, error_msg, + sizeof(error_msg))); + free(handle); + return NULL; + } + + handle->si.readOnly = False; + handle->si.shmaddr = shmat(handle->si.shmid, NULL, 0); + if (handle->si.shmaddr == (char *)-1) { + MSG_EFFECT_ERROR("Failed to attach shm %s\n", + strerror_r(errno, error_msg, + sizeof(error_msg))); + + shmctl(handle->si.shmid, IPC_RMID, 0); + free(handle); + return NULL; + } + + handle->xim = XShmCreateImage(ecore_x_display_get(), visual, depth, + ZPixmap, NULL, &handle->si, width, + height); + if (!handle->xim) { + MSG_EFFECT_ERROR("Failed create an image %s\n", + strerror_r(errno, error_msg, + sizeof(error_msg))); + + shmdt(handle->si.shmaddr); + shmctl(handle->si.shmid, IPC_RMID, 0); + free(handle); + return NULL; + } + + handle->size = handle->xim->bytes_per_line * handle->xim->height; + handle->xim->data = handle->si.shmaddr; + + handle->pix = XCompositeNameWindowPixmap(ecore_x_display_get(), id); + + if (XShmAttach(ecore_x_display_get(), &handle->si) == False) { + MSG_EFFECT_ERROR("Failed to attach\n"); + } + + if (XShmGetImage(ecore_x_display_get(), id, handle->xim, 0, 0, + 0xFFFFFFFF) == False) { + MSG_EFFECT_ERROR("Failed to get image\n"); + } + + XSync(ecore_x_display_get(), False); + return handle; +} + +static void __ivug_xcapture_destroy(struct xcapture_t *handle) +{ + ivug_retm_if(!handle, "handle is NULL"); + + XShmDetach(ecore_x_display_get(), &handle->si); + XFreePixmap(ecore_x_display_get(), handle->pix); + XDestroyImage(handle->xim); + + shmdt(handle->si.shmaddr); + shmctl(handle->si.shmid, IPC_RMID, 0); + + free(handle); +} + +static inline void *__ivug_xcapture_get_data(struct xcapture_t *handle, + int *size) +{ + ivug_retvm_if(!handle, NULL, "handle is NULL"); + + if (size) { + *size = handle->size; + } + + return handle->xim->data; +} + + +static void __ivug_xcapture_data_rotate_180cw(unsigned int **dst, + unsigned int *src, int width, + int height) +{ + ivug_retm_if(!src, "src is NULL"); + + unsigned int *p1, *p2, tmp; + int x, hw; + + /* memcpy */ + *dst = malloc(width * height * sizeof(unsigned int)); + memcpy(*dst, src, width * height * sizeof(unsigned int)); + + /* set width, height */ + hw = width * height; + x = (hw / 2); + p1 = *dst; + p2 = *dst + hw - 1; + for (; --x > 0;) { + tmp = *p1; + *p1 = *p2; + *p2 = tmp; + p1++; + p2--; + } +} + +static void __ivug_xcapture_data_rotate_90cw(unsigned int **dst, + unsigned int *src, int width, + int height) +{ + ivug_retm_if(!src, "src is NULL"); + + unsigned int *to = NULL, *from = NULL; + int x, y, w, hw; + + /* memcpy */ + *dst = malloc(width * height * sizeof(unsigned int)); + memcpy(*dst, src, width * height * sizeof(unsigned int)); + + /* set width, height */ + w = height; + height = width; + width = w; + hw = width * height; + + to = *dst + w - 1; + hw = -hw - 1; + from = src; + + for (x = width; --x >= 0;) { + for (y = height; --y >= 0;) { + *to = *from; + from++; + to += w; + } + + to += hw; + } +} + +static void __ivug_xcapture_data_rotate_270cw(unsigned int **dst, + unsigned int *src, int width, + int height) +{ + ivug_retm_if(!src, "src is NULL"); + + unsigned int *to, *from; + int x, y, w, hw; + + /* memcpy */ + *dst = malloc(width * height * sizeof(unsigned int)); + memcpy(*dst, src, width * height * sizeof(unsigned int)); + + /* set width, height */ + w = height; + height = width; + width = w; + + hw = width * height; + + to = *dst + hw - w; + w = -w; + hw = hw + 1; + from = src; + + for (x = width; --x >= 0;) { + for (y = height; --y >= 0;) { + *to = *from; + from++; + to += w; + } + + to += hw; + } +} + +static char *__ivug_xcapture_data_get(Ecore_X_Window win, int *size, + int rotation) +{ + struct xcapture_t *handle = NULL; + + handle = __ivug_xcapture(win); + if (!handle) { + MSG_EFFECT_ERROR("__ivug_xcapture failed"); + return NULL; + } + + int data_size = 0; + char *image = __ivug_xcapture_get_data(handle, &data_size); + if (!image || data_size == 0) { + MSG_EFFECT_ERROR("__ivug_xcapture_get_data failed"); + + __ivug_xcapture_destroy(handle); + return NULL; + } + + MSG_EFFECT_MED("handle->xim: width = %d, height = %d\n", + handle->xim->width, handle->xim->height); + + /* Free the data when unused */ + int width = 0; + int height = 0; + char *data = NULL; + + width = handle->xim->bytes_per_line / sizeof(int); + height = handle->xim->height; + + if (rotation == 180) { + __ivug_xcapture_data_rotate_180cw((unsigned int **)&data, + (unsigned int *)image, width, + height); + } else if (rotation == 90) { + __ivug_xcapture_data_rotate_90cw((unsigned int **)&data, + (unsigned int *)image, width, + height); + } else if (rotation == 270) { + __ivug_xcapture_data_rotate_270cw((unsigned int **)&data, + (unsigned int *)image, width, + height); + } else { /* all other cases treated as angle 0 */ + + data = (char *)calloc(1, data_size); + memcpy(data, image, data_size); + } + + __ivug_xcapture_destroy(handle); + + if (size) { + *size = data_size; + } + + return data; +} + +char *ivug_xcapture_screen_data_get(int *size, int rotation) +{ + Ecore_X_Window root; + root = ecore_x_window_focus_get(); + + /* Free the memory allocated when unused */ + return __ivug_xcapture_data_get(root, size, rotation); +} diff --git a/slideshow/src/effect/ivug-xcapture.h b/slideshow/src/effect/ivug-xcapture.h new file mode 100755 index 0000000..27d4368 --- /dev/null +++ b/slideshow/src/effect/ivug-xcapture.h @@ -0,0 +1,30 @@ +/* + * Copyright 2012 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 __IVUG_XCAPTURE_H__ +#define __IVUG_XCAPTURE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + + char *ivug_xcapture_screen_data_get(int *size, int rotation); + +#ifdef __cplusplus +} +#endif + +#endif /* __IVUG_XCAPTURE_H__ */ diff --git a/slideshow/src/effect/template.c b/slideshow/src/effect/template.c new file mode 100755 index 0000000..e4f1267 --- /dev/null +++ b/slideshow/src/effect/template.c @@ -0,0 +1,82 @@ +/* + * Copyright 2012 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 "ivug-common.h" +#include "ivug-effect.h" + + +typedef struct { + Evas_Object *src; + Evas_Object *dst; + + Evas_Object *object; + Evas_Object *orig_cliper; + + Evas_Object *cliper; + + int screen_w; + int screen_h; +} effect_data; + + +static Effect_Data __ivug_init(Evas_Object *src, Evas_Object *dst, int screen_w, int screen_h, int rotation) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_anim(Effect_Data data, double percent) +{ +/* IVUG_FUNC_ENTER(); */ + +/* IVUG_FUNC_LEAVE(); */ +} + +static void __ivug_pause(Effect_Data data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_resume(Effect_Data data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +static void __ivug_spin_finialize(Effect_Data data) +{ + IVUG_FUNC_ENTER(); + + IVUG_FUNC_LEAVE(); +} + +Effect_Engine *ivug_xxx_add(void) +{ + Effect_Engine *eng_spin = calloc(1, sizeof(Effect_Engine)); + ivug_retvm_if(eng_spin == NULL, NULL, "calloc failed"); + + eng_spin->func.init = &__ivug_init; + eng_spin->func.animate = &__ivug_anim; + eng_spin->func.pause = &__ivug_pause; + eng_spin->func.resume = &__ivug_resume; + eng_spin->func.finalize = &__ivug_finialize; + + return eng_spin; +} diff --git a/slideshow/src/include/ivug-slideshow-priv.h b/slideshow/src/include/ivug-slideshow-priv.h new file mode 100755 index 0000000..1390195 --- /dev/null +++ b/slideshow/src/include/ivug-slideshow-priv.h @@ -0,0 +1,86 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +// Slide Show + +/* + Start slide show. + + if bSlideFirst == EINA_TRUE, slide and then wait interval time + if bSlideFirst == EINA_FALSE, wait interval time and then slide +*/ +#include +#include + +#include "ivug-medialist.h" +#include "ivug-config.h" +#include "ivug-effect.h" + +#define DATA_PATH DATADIR"/"PACKAGE + +typedef struct +{ + void *pSlideshow; //SlideShow * + Evas_Object *layout; + Evas_Object *photocam; + Evas_Object *thumbnail; + + Media_Item *mitem; + + int x; // Need?? + int y; +} Slide_Layout; + +typedef enum{ + EVASPLUGIN_RESUMED = 0x00, + EVASPLUGIN_PAUSED, +} EvasPluginState_t; + + +typedef struct _SlideShow +{ + Evas_Object *obj; // Slide show view. + Evas_Object *event; // Mouse event + + /* slide show setting */ + double ss_interval_time; + Effect_Engine* effect_engine; + + Ecore_Timer *ss_timer; //slide show timer + Ecore_Timer *click_timer; + void* ss_user_data; + + Media_List *media_list; + Media_Item *ss_Header; // Start point + + int sCurrent; // 0 or 1 + int screen_w; + int screen_h; + + Ecore_Idler *load_idler; + + Slide_Layout sLayout[2]; + slide_show_mode ss_mode; + /* slide show effect*/ + Effect_Type effect_type; + EvasPluginState_t evas_plugin_state; + slideshow_state_t state; + Eina_Bool bSS_StopFlag; /* request slide show stop flag */ + bool bMouse_event; +}SlideShow; + diff --git a/ug-image-viewer-efl.manifest b/ug-image-viewer-efl.manifest new file mode 100644 index 0000000..3eb4608 --- /dev/null +++ b/ug-image-viewer-efl.manifest @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/ug-image-viewer-efl.xml b/ug-image-viewer-efl.xml new file mode 100644 index 0000000..4aa693c --- /dev/null +++ b/ug-image-viewer-efl.xml @@ -0,0 +1,26 @@ + + + + Jisung Ahn + Hyunwoo Kim + Image viewer Application + + ug-image-viewer-efl.png + + + + + + + + + + + + + + + + + + diff --git a/widget/CMakeLists.txt b/widget/CMakeLists.txt new file mode 100755 index 0000000..60c56ce --- /dev/null +++ b/widget/CMakeLists.txt @@ -0,0 +1,88 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(ivug_widget C CXX) + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(VERSION 0.1.0) + +SET(SRCS +# Helper files + src/common/Primitives.cpp + src/util/EFLUtil.cpp + src/util/ivug-listpopup.c + +#Image + src/image/ivug-image.cpp + +#Video + +# Face rect + +# Thumb list + +# ScissorBox + src/scissorbox/ScissorBox.cpp + src/scissorbox/ivug-scissorbox.cpp + +# Face tag + +# Face detail + +# Best Pic +) + +INCLUDE_DIRECTORIES( + ${CMAKE_SOURCE_DIR}/include + ${IVUG_SOURCE_COMMON_DIR}/include + ${IVUG_SOURCE_FEATURE_DIR}/include + include + src/common + src/animation + src/image + src/scissorbox +) + +INCLUDE(FindPkgConfig) +pkg_check_modules(${PROJECT_NAME}_pkgs REQUIRED + elementary + ecore + ecore-evas + edje + eina + evas + dlog +) + +FOREACH(flag ${${PROJECT_NAME}_pkgs_CFLAGS}) + SET(EXTRA_FLAGS "${EXTRA_FLAGS} ${flag}") +ENDFOREACH(flag) + +ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") +ADD_DEFINITIONS("-DLOG_LVL=DBG_MSG_LVL_HIGH") +ADD_DEFINITIONS("-DLOG_CAT=\"IV-WIDGET\"") + +message("WIDGET FLAGS=" ${CMAKE_CXX_FLAGS}) + +ADD_LIBRARY(${PROJECT_NAME} STATIC ${SRCS}) + +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION} ) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${EXTRA_FLAGS}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_pkgs_LDFLAGS} + ivug_common ivug_feature +) + +BUILD_EDJ(ivug-scroller.edc ivug-scroller.edj res/layout images) + +#install resouce files. +# Lack of a trailing slash means install this directory, trailing slash means +# install everything in this directory. + +# Install image files. +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${CMAKE_INSTALL_PREFIX}/res/images/${IVUG_PACKAGE_NAME}) + + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib) + + + diff --git a/widget/include/Animation.h b/widget/include/Animation.h new file mode 100755 index 0000000..324d067 --- /dev/null +++ b/widget/include/Animation.h @@ -0,0 +1,113 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +#include +#include "Transit.h" + +#include +#include "Exception.h" + +using namespace std; + +// Composite pattern +class CAnimator +{ +public: + CAnimator() {}; + + virtual ~CAnimator() {}; + + virtual void Update(double delta_t) = 0; + virtual bool IsFinished() = 0; + + virtual void AddAnimator(CAnimator *animator) { + throw new CException(CException::IO_ERROR); + }; + +protected: +}; + + +class CSingleAnimator : public CAnimator +{ +private: + CSingleAnimator() {}; +public: + CSingleAnimator(double first, double last, double duration, TranstionFunc transition, AnimationCB callback, void *data) { + m_actor = new CActor(first, last, duration, transition, callback, data); + }; + + virtual ~CSingleAnimator() { delete m_actor;}; + +// Overrides + void Update(double delta_t) { + m_actor->Update(delta_t); + }; + + bool IsFinished() { return m_actor->IsFinished(); }; + +private: + CActor *m_actor; +}; + +class CGroupAnimator : public CAnimator { +public: + CGroupAnimator() {}; + virtual ~CGroupAnimator() { ClearAll(); }; + + void AddAnimator(CAnimator *animator) { + m_actorlist.push_back(animator); + + m_actorlist.back()->Update(0); + }; + + void ClearAll() { + for ( list::iterator iter = m_actorlist.begin(); iter != m_actorlist.end(); iter++ ) + { + delete *iter; + } + + m_actorlist.clear(); + + }; + + bool IsFinished() { + return m_actorlist.empty(); + }; + + void Update(double delta_t) { + for ( list::iterator iter = m_actorlist.begin(); iter != m_actorlist.end(); ) + { + (*iter)->Update(delta_t); + + if ( (*iter)->IsFinished() == true ) + { + iter = m_actorlist.erase(iter); + } + else + { + iter++; + } + } + }; + +private: + list m_actorlist; + +}; + diff --git a/widget/include/ECoreAnimator.h b/widget/include/ECoreAnimator.h new file mode 100755 index 0000000..9a9cdb4 --- /dev/null +++ b/widget/include/ECoreAnimator.h @@ -0,0 +1,122 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +typedef bool (*CallbackFUNC)(double delta, void *data); + +#if 0 +template +struct func_bind +{ + static T obj; + static bool call(double value) { return (obj.*callback)(value); }; +}; + +template +T func_bind::obj; +#else + +template +class UserMemFunctor +{ +public: + UserMemFunctor(ObjType& obj, FunType fun) : m_obj(obj), m_func(fun) {} + void operator()(ParmType& p) { (m_obj.*m_func)(p); } +private: + ObjType& m_obj; + FunType m_func; +}; +#endif + +class ECoreAnimator { + static Eina_Bool _on_anim(void *data) + { + ECoreAnimator *thiz = static_cast(data); + + return thiz->OnAnimation(); + } + +public: + ECoreAnimator() : m_animator(NULL), m_bStarted(false) {}; + ~ECoreAnimator() { + Stop(); + }; + + void Start(CallbackFUNC cb, void *data) + { + m_cb = cb; + m_data = data; + + m_count = 0; + m_animator = ecore_animator_add(_on_anim, this); + m_bStarted = true; + } + + void Stop() { + if ( m_bStarted ) + { + m_bStarted = false; + ecore_animator_del(m_animator); + m_animator = NULL; + } + }; + + Eina_Bool OnAnimation() { + double current; + + if ( m_count == 0 ) + { + current = m_prev = ecore_loop_time_get(); + } + else + { + current = ecore_loop_time_get(); + } + + m_count++; + + if ( m_cb(current - m_prev, m_data) == false) + { + Stop(); + return ECORE_CALLBACK_CANCEL; + } + + m_prev = current; + return ECORE_CALLBACK_RENEW; + }; + + bool IsRunning() const { + return m_bStarted; + }; + +private: + Ecore_Animator *m_animator; + +// template +// func_bind m_f; + CallbackFUNC m_cb; + void *m_data; + + double m_prev; + bool m_bStarted; + + int m_count; + +}; + + + diff --git a/widget/include/EFLUtil.h b/widget/include/EFLUtil.h new file mode 100755 index 0000000..fdd6945 --- /dev/null +++ b/widget/include/EFLUtil.h @@ -0,0 +1,67 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +#include + +namespace EFL { + void get_evas_geometry(Evas_Object *obj, const char *prefix); + + Evas_Object *create_gesture(Evas_Object *parent); + + Evas_Object *create_rect(Evas_Object *parent); + + Evas_Object *create_clipper(Evas_Object *parent); + + Evas_Object *create_layout(Evas_Object *parent, const char *edj, const char *group); + + Evas_Object *create_button(Evas_Object *parent, const char *style, const char *icon, const char *caption); + + Evas_Object *create_icon(Evas_Object *parent, const char *edjname, const char *groupname); + + void dump_win(Evas_Object *obj); + + void dump_obj(Evas_Object *obj, int lvl = 0); + void dump_widget(Evas_Object *obj, int lvl); + + void dump_clipper(Evas_Object *clipper); + // Returned value Should be freed after using + char * current_render_method(Evas *e); + + Evas_Object *create_window(const char *title, int w, int h); + +}; + +namespace util { + typedef enum { + eImageCodec_JPEG, + eImageCodec_GIF, + eImageCodec_PNG, + eImageCodec_IMAGE, // tif.. other image files + eImageCodec_UNKNOWN, + } Image_Codec_Type; + + Image_Codec_Type + get_codec_type(const unsigned char *buffer, unsigned int size); + + Image_Codec_Type + get_codec_type(const char *filename); + + bool is_openGL_enabled(Evas *e); +}; + + diff --git a/widget/include/EvasSmartObj.h b/widget/include/EvasSmartObj.h new file mode 100755 index 0000000..fee0891 --- /dev/null +++ b/widget/include/EvasSmartObj.h @@ -0,0 +1,185 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +#include +#include "Primitives.h" +#include "ivug-debug.h" + +template +class CEvasSmartObject { +protected: + static const Evas_Smart_Cb_Description _signals[]; + +public: + CEvasSmartObject() : m_obj(NULL) {}; + virtual ~CEvasSmartObject() { + if ( m_obj ) + evas_object_del(m_obj); + m_obj= NULL; + }; + + static void SetClassName(const char *classname) + { + if (_smart_ == NULL ) + { // Damm buggy! Implement using template + const char* name = eina_stringshare_add(classname); + MSG_HIGH("Create smart class name=%s", name); + static Evas_Smart_Class sc = + { + NULL, + EVAS_SMART_CLASS_VERSION, + NULL, + _del, + _move, + _resize, + _show, + _hide, + _color_set, + _clip_set, + _clip_unset, + _calculate, + NULL, + NULL, + NULL, // Parent + NULL, + NULL, + NULL + }; //Evas_smart_Class + sc.name = name; + _smart_ = evas_smart_class_new(&sc); + } + } + + virtual Evas_Object *CreateObject(Evas_Object *parent) + { + m_obj = evas_object_smart_add(evas_object_evas_get(parent), _smart_); //create smart object. + evas_object_smart_data_set(m_obj, this); + + MSG_ASSERT(m_obj != NULL); + + return m_obj; + } + +private: + static void _del(Evas_Object * obj) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->remove(); + }; + + static void _move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->move(x, y); + }; + + static void _resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->resize(w, h); + }; + + static void _show(Evas_Object *obj) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->show(); + }; + + static void _hide(Evas_Object *obj) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->hide(); + }; + + static void _calculate(Evas_Object *obj) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->draw(); + }; + + static void _color_set(Evas_Object *obj, int r, int g, int b, int a) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->color_set(r,g,b,a); + }; + + static void _clip_set(Evas_Object *obj, Evas_Object * clip) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->clip_set(clip); + }; + + static void _clip_unset(Evas_Object *obj) + { + CEvasSmartObject *thiz = static_cast(evas_object_smart_data_get(obj)); + IV_ASSERT(thiz != NULL); + + thiz->clip_unset(); + }; + +protected: + virtual void move(int x, int y) { + m_rect.Left(x); + m_rect.Top(y); + }; + + virtual void resize(int w, int h) { + m_rect.Width(w); + m_rect.Height(h); + }; + + virtual void remove() {}; + virtual void show() {}; + virtual void hide() {}; + virtual void draw() {}; + virtual void color_set(int r, int g, int b, int a) {}; + virtual void clip_set(Evas_Object *clipper) {}; + virtual void clip_unset() {}; + +public: + Evas_Object *GetObject() const { return m_obj; }; + + const CRect GetGeometry() const { return m_rect; }; + +public: + CRect m_rect; + + Evas_Object *m_obj; + + static Evas_Smart *_smart_; + +}; + +template Evas_Smart *CEvasSmartObject::_smart_ = NULL; + diff --git a/widget/include/Exception.h b/widget/include/Exception.h new file mode 100755 index 0000000..c45b8c0 --- /dev/null +++ b/widget/include/Exception.h @@ -0,0 +1,33 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +class CException { +public: + typedef enum { + IO_ERROR, + } error_code; + + CException(error_code err) : m_err(err) {}; + ~CException() {}; + +private: + error_code m_err; +}; + + + diff --git a/widget/include/Object.h b/widget/include/Object.h new file mode 100755 index 0000000..c1baccc --- /dev/null +++ b/widget/include/Object.h @@ -0,0 +1,33 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + + +#include "EvasSmartObj.h" + +class CObject : public CEvasSmartObject { + +public: + CObject() : CEvasSmartObject() { + CEvasSmartObject::SetClassName("CObject"); + }; + + virtual ~CObject() {}; + + +}; + diff --git a/widget/include/Primitives.h b/widget/include/Primitives.h new file mode 100755 index 0000000..b285ef9 --- /dev/null +++ b/widget/include/Primitives.h @@ -0,0 +1,276 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +#include + +class CSize { +public: + static const CSize Zero; + + CSize(int _w = 0, int _h = 0) { + w = _w; + h = _h; + }; + + CSize(const CSize &rhs) { + SetSize(rhs.w, rhs.h); + }; + + void GetSize(int &w, int &h) const { + w = this->w; + h = this->h; + }; + + void SetSize(int _w, int _h) { + w = _w; + h = _h; + }; + + const CSize operator *(double mul) const { + return CSize(w * mul, h *mul); + } + + const CSize operator /(double mul) const { + return CSize(w / mul, h / mul); + } + + const CSize operator +(const CSize &rhs) const { + return CSize(w + rhs.Width(), h + rhs.Height()); + } + + const CSize operator -(const CSize &rhs) const { + return CSize(w - rhs.Width(), h - rhs.Height()); + } + + int Width() const { return w;}; + int Height() const { return h;}; + + void Width(int _w) { w = _w; }; + void Height(int _h) { h = _h; }; + + void Swap() { std::swap(w,h); }; + +private: + int w, h; +}; + + +class CPoint { +public: + static const CPoint Zero; + + CPoint(int _x = 0, int _y = 0) { + x = _x; + y = _y; + }; + + void GetPoint(int &x, int &y) const { + x = this->x; + y = this->y; + }; + + void MoveTo(int x_, int y_) { + x = x_; + y = y_; + }; + + void MoveBy(int x_, int y_) { + x += x_; + y += y_; + }; + + const CPoint operator -(const CPoint &rhs) const { + return CPoint(x - rhs.X(), y - rhs.Y()); + }; + + const CPoint operator +(const CPoint &rhs) const { + return CPoint(x + rhs.X(), y + rhs.Y()); + }; + + const CPoint operator +(const CSize &rhs) const { + return CPoint(x + rhs.Width(), y + rhs.Height()); + }; + + bool operator !=(const CPoint &rhs) const { + return (y != rhs.Y()) || (y != rhs.Y()) ; + }; + + + int X() const { return x; }; + int Y() const { return y; }; + + void X(int _x) { x = _x; }; + void Y(int _y) { y = _y; }; + +private: + int x, y; +}; + + + +class CRect { +public: + static const CRect Zero; +// with north-west gravity default. +public: + + CRect(int _x = 0, int _y = 0, int _w = 0, int _h = 0) { + SetRect(_x, _y, _w, _h); + }; + + CRect(const CRect &rhs) { + SetRect(rhs.Left(), rhs.Top(), rhs.Width(), rhs.Height()); + } + + CRect(const CPoint &_topleft, const CSize &_size) { + SetRect(_topleft.X(), _topleft.Y(), _size.Width(), _size.Height()); + } + + CRect(const CPoint &_topleft, const CPoint &_bottomright) { + topleft = _topleft; + bottomright = _bottomright; + } + + ~CRect() {}; + + const CRect operator /(double mul) const { + return CRect(Left(), Top(), Width() / mul, Height() / mul); + } + + bool operator !=(const CRect &rhs) const { + return ( topleft.X() != rhs.Left() ) || ( topleft.Y() != rhs.Top() ) || + ( bottomright.X() != rhs.Right() ) || ( bottomright.Y() != rhs.Bottom() ); + }; + + + void SetRect(int _x, int _y, int _w, int _h) { + topleft.X(_x); + topleft.Y(_y); + + SetSize(_w,_h); + }; + + void MoveTo(const CPoint &_topleft) + { + CSize cSize = GetSize(); + + topleft = _topleft; + SetSize(cSize); + } + + void MoveTo(int _x, int _y) + { + CSize cSize = GetSize(); + + topleft = CPoint(_x,_y); + SetSize(cSize); + } + + void MoveBy(const CPoint &_dpoint) // Difference move + { + topleft = topleft + _dpoint; + bottomright = bottomright + _dpoint; + } + + void MoveBy(int dx, int dy) // Difference move + { + topleft = topleft + CPoint(dx, dy); + bottomright = bottomright + CPoint(dx, dy); + } + + void Resize(int _w, int _h) + { + SetSize(_w, _h); + } + + const CPoint GetCenter() const { return CPoint(topleft.X() + Width() / 2, topleft.Y() + Height() / 2); }; +// Getter + const CSize GetSize() const { return CSize(Width() , Height() ); }; + + int Left() const { return topleft.X(); }; + int Right() const { return bottomright.X(); }; + int Top() const { return topleft.Y(); }; + int Bottom() const { return bottomright.Y(); }; + + const CPoint &TopLeft() const { return topleft; }; + const CPoint &BottomRight() const { return bottomright; }; + + bool IsValid() { + return !( Width() < 0 || Height() < 0 ); + }; + +// Setter + void SetSize(const CSize &newsize) { + Width(newsize.Width()); + Height(newsize.Height()); + }; + + void SetSize(int w, int h) { + Width(w); + Height(h); + }; + + void Left(int _V) { int W = Width(); topleft.X(_V); bottomright.X(_V + W); }; + void Right(int _V) { int W = Width(); bottomright.X(_V); topleft.X(_V - W); }; + void Top(int _V) { int H = Height(); topleft.Y(_V); bottomright.Y(_V + H); }; + void Bottom(int _V) { int H = Height(); bottomright.Y(_V); topleft.Y(_V - H);}; + + + int Width() const { return bottomright.X() - topleft.X(); }; + int Height() const { return bottomright.Y() - topleft.Y(); }; + void Width(int _W) { bottomright.X(topleft.X() + _W); }; + void Height(int _H) { bottomright.Y(topleft.Y() + _H); }; + + bool Intersect(const CRect &rhs) const { + return ( ( Left() < rhs.Right() ) && ( Top() < rhs.Bottom() ) && ( Right() > rhs.Left() ) && ( Bottom() > rhs.Top() )); + }; + + void Inflate(int x1, int y1, int x2, int y2) { + topleft.X( topleft.X() + x1); + topleft.Y( topleft.Y() + y1); + + bottomright.X( bottomright.X() + x2); + bottomright.Y( bottomright.Y() + y2); + }; + + friend CRect UnionRect(const CRect &rect1, const CRect &rect2); + friend CRect IntersectRect(const CRect &rect1, const CRect &rect2); + + bool Inside(const CPoint &rhs) const { + return (Left() < rhs.X()) && (rhs.X() < Left() + Width() ) && (Top() < rhs.Y()) && (rhs.Y() < Top() + Height() ); + }; + + bool Inside(const CRect &rhs) const { + return (Left() <= rhs.Left()) && (rhs.Right() <= Right() ) && (Top() <= rhs.Top()) && (rhs.Bottom() <= Bottom() ); + }; + + void Scale(double ratio_x, double ratio_y) { + topleft.X( topleft.X() * ratio_x); + bottomright.X( bottomright.X() * ratio_x); + + + topleft.Y( topleft.Y() * ratio_y); + bottomright.Y( bottomright.Y() * ratio_y); + }; + +private: + CPoint topleft; + CPoint bottomright; +}; + + diff --git a/widget/include/Transit.h b/widget/include/Transit.h new file mode 100755 index 0000000..18feeae --- /dev/null +++ b/widget/include/Transit.h @@ -0,0 +1,187 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +#include + +typedef double (*TranstionFunc)(double t); +typedef void (*AnimationCB)(double value, void *data); + + +class CTranstionFunc { +// Normalied transition fuctions. +public: + static double ConstTransit(double t) { + return 0; + }; + + static double LinearTransit(double t) { + return t; + }; + + static double SineTransit(double t) { + static const double SIN_TABLE[91] = { + 0.0000f, 0.0174f, 0.0349f, 0.0523f, 0.0698f, + 0.0872f, 0.1045f, 0.1219f, 0.1392f, 0.1564f, + 0.1736f, 0.1908f, 0.2079f, 0.2249f, 0.2419f, + 0.2588f, 0.2756f, 0.2924f, 0.3090f, 0.3256f, + 0.3420f, 0.3584f, 0.3746f, 0.3907f, 0.4067f, + 0.4226f, 0.4384f, 0.4540f, 0.4695f, 0.4848f, + 0.5000f, 0.5150f, 0.5299f, 0.5446f, 0.5592f, + 0.5736f, 0.5878f, 0.6018f, 0.6157f, 0.6293f, + 0.6528f, 0.6561f, 0.6691f, 0.6820f, 0.6947f, + 0.7071f, 0.7193f, 0.7314f, 0.7431f, 0.7547f, + 0.7660f, 0.7772f, 0.7880f, 0.7986f, 0.8090f, + 0.8191f, 0.8290f, 0.8387f, 0.8480f, 0.8571f, + 0.8660f, 0.8746f, 0.8829f, 0.8910f, 0.8988f, + 0.9063f, 0.9135f, 0.9205f, 0.9272f, 0.9336f, + 0.9397f, 0.9455f, 0.9511f, 0.9563f, 0.9613f, + 0.9659f, 0.9703f, 0.9744f, 0.9781f, 0.9816f, + 0.9848f, 0.9877f, 0.9903f, 0.9926f, 0.9945f, + 0.9962f, 0.9976f, 0.9986f, 0.9994f, 0.9998f, + 1.0f + }; + + int idx = (int)(90.0 * t); + + return (SIN_TABLE[idx]); + }; + + static double EaseInoutTransit(double t) { + double ts = t * t; + double tc = ts * t; + return (6 * tc * ts -15 * ts * ts + 10 * tc); + } + + static double EaseoutQuinticTransit(double t) { + double ts = t * t; + double tc = ts * t; + return (tc * ts - 5 * ts * ts + 10 * tc - 10 * ts + 5 * t); + } + + static double EaseoutCubicTransit(double t) { + double ts = t * t; + double tc = ts * t; + return (tc + -3*ts + 3*t); + } + +}; + + +class CTransit { +public: + CTransit(double first, double last, double duration , TranstionFunc transition) : m_duration(duration), m_current(0), m_start(first), m_last(last), + m_transition(transition) { + }; + + + CTransit() : m_duration(1.0f), m_current(0), m_transition(CTranstionFunc::ConstTransit) { + }; + + ~CTransit() { + }; + + void SetTransitFunction(TranstionFunc transition ) { + m_transition = transition; + m_current = 0.0f; + }; + + void SetDuration(double duration) // X variations(time) + { + m_duration = m_duration; + m_current = 0.0f; + } + + void SetInit(double first) // Y variationns + { + m_start = first; + m_current = 0.0f; + } + + void SetEnd(double last) // Y variationns + { + m_last = last; + m_current = 0.0f; + } + + double Update(double dt) { + double reminant = std::min(m_duration - m_current, dt ); + + m_current += reminant; + + return m_start + m_transition( m_current/m_duration ) * ( m_last - m_start); + + }; + + bool IsFinished() { + return m_current >= m_duration; + }; + +private: + double m_duration; + double m_current; + + double m_start; + double m_last; + + TranstionFunc m_transition; +}; + + + +class CActor { +public: + CActor() { + m_tween = new CTransit(); + }; + CActor(double first, double last, double duration, TranstionFunc transition, AnimationCB callback, void *data) : m_callback(callback), m_data(data) { + m_tween = new CTransit(first, last, duration, transition); + }; + + ~CActor() { + delete m_tween; + m_tween = NULL; + }; + + void SetCallback(AnimationCB callback, void *data) { + m_callback = callback; + m_data = data; + }; + + void SetConfig(double first, double last, double duration, TranstionFunc transition) + { + m_tween->SetTransitFunction(transition); + m_tween->SetInit(first); + m_tween->SetEnd(last); + m_tween->SetDuration(duration); + } + + void Update(double delta_t) + { + double value = m_tween->Update(delta_t); + + m_callback(value, m_data); + } + + bool IsFinished() const { return m_tween->IsFinished(); }; +private: + AnimationCB m_callback; + void *m_data; + + CTransit *m_tween; +}; + diff --git a/widget/include/ivug-image.h b/widget/include/ivug-image.h new file mode 100755 index 0000000..643065b --- /dev/null +++ b/widget/include/ivug-image.h @@ -0,0 +1,122 @@ +/* + * Copyright 2012 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 __IVUG_IMAGE_H__ +#define __IVUG_IMAGE_H__ + +#include + +#include "ivug-define.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +Evas_Object * +ivug_image_create(Evas_Object *parent); + + +/* + Load & Unload image file +*/ +Evas_Load_Error +ivug_image_file_set(Evas_Object *obj, const char *file, const char *key); + +Evas_Load_Error +ivug_image_mem_set(Evas_Object *obj, const char *buffer, unsigned int size, const char *key); + +Evas_Load_Error +ivug_image_unset(Evas_Object *obj); + +/* + Configuration +*/ + +void +ivug_image_hold_set(const Evas_Object *obj, Eina_Bool hold); // If set HOLD, all events including mouse is ignored. + +void +ivug_image_animated_set(const Evas_Object *obj, Eina_Bool bAnimation); // Determine whether AGIF is animated or not + +/* + Showing +*/ +void +ivug_image_zoom_set(Evas_Object *obj, double zoom, Evas_Point *pCenter); + +double +ivug_image_zoom_get(const Evas_Object *obj); + +void +ivug_image_zoom_reset(Evas_Object *obj, Evas_Point *pCenter); + + +void +ivug_image_rotate_set(Evas_Object *obj, int degree); + +int +ivug_image_rotate_get(Evas_Object *obj); + + + +/* + Get image's original size. +*/ +void +ivug_image_image_size_get(const Evas_Object *obj, int *w, int *h); + +Evas_Object * +ivug_image_internal_image_get(Evas_Object *obj); + +void +ivug_image_decoded_size_get(const Evas_Object *obj, int *w, int *h); + +unsigned char * +ivug_image_decoded_buffer_get(const Evas_Object *obj); + + +/* + Get display geometry. + x,y,w,h is LCD corrdinate +*/ +void +ivug_image_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h); // Geometry of internal image + +/* + Crop image and return cropped image as Evas_Object. + x,y,w,h is LCD corrdinate +*/ +Evas_Object * +ivug_image_region_image_get(Evas_Object *obj, int x, int y, int w, int h); + + +/* + +*/ +void ivug_image_coordinate_lcd_to_image(Evas_Object *photocam, int lcd_x, int lcd_y, int *img_x, int *img_y); +void ivug_image_coordinate_image_to_lcd(Evas_Object *photocam, int img_x, int img_y, int *lcd_x, int *lcd_y); + + +#ifdef __cplusplus +} +#endif + + + + +#endif // __IVUG_IMAGE_H__ + diff --git a/widget/include/ivug-listpopup.h b/widget/include/ivug-listpopup.h new file mode 100755 index 0000000..5621231 --- /dev/null +++ b/widget/include/ivug-listpopup.h @@ -0,0 +1,71 @@ +/* + * Copyright 2012 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 __IVUG_LISTPOPUP_H__ +#define __IVUG_LISTPOPUP_H__ + + +typedef void Ivug_ListPopup_Item; + +#ifdef __cplusplus +extern "C" { +#endif + +#include +/* + Signals + "popup,selected" event_info contains Ivug_ListPopup_Item which is used when append/prepend + "popup,dismissed" closed button pressed, in case of contextual, no dismised callback + +*/ + +Evas_Object *ivug_listpopup_add(Evas_Object *parent); + +Ivug_ListPopup_Item *ivug_listpopup_item_append(Evas_Object *obj, const char *iconpath, const char *caption, void *data); +Ivug_ListPopup_Item *ivug_listpopup_item_prepend(Evas_Object *obj, const char *iconpath, const char *caption, void *data); + +/* + Eina list includes (Ivug_ListPopup_Item *) - (Ivug_ListPopup_Item *) - (Ivug_ListPopup_Item *) .... +*/ +Eina_List *ivug_listpopup_items_get(Evas_Object *obj); + +/* + Valid only when genlist style popup +*/ +void ivug_listpopup_button_set(Evas_Object *obj, const char* caption); +void ivug_listpopup_title_set(Evas_Object *obj, const char* title); + + +void *ivug_listpopup_item_get_data(Ivug_ListPopup_Item *item); +void ivug_listpopup_item_disabled_set(Ivug_ListPopup_Item *item); +void ivug_listpopup_item_enabled_set(Ivug_ListPopup_Item *item); +const char *ivug_listpopup_item_get_text(Ivug_ListPopup_Item *item); +Elm_Object_Item *ivug_listpopup_item_get_item(Ivug_ListPopup_Item *item); + +/* + Show Time! +*/ +bool ivug_listpopup_popup_show(Evas_Object *obj); +bool ivug_listpopup_context_show(Evas_Object *obj, Evas_Object *hover, int x, int y); + + +#ifdef __cplusplus +} +#endif + + +#endif // __IVUG_LISTPOPUP_H__ + diff --git a/widget/include/ivug-scissorbox.h b/widget/include/ivug-scissorbox.h new file mode 100755 index 0000000..a73f1b2 --- /dev/null +++ b/widget/include/ivug-scissorbox.h @@ -0,0 +1,54 @@ +/* + * Copyright 2012 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 __IVUG_SCISSORBOX_H__ +#define __IVUG_SCISSORBOX_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + SCISSOR_BOX_TYPE_1, //. Image view + SCISSOR_BOX_TYPE_2, // Image edit +} eScissorBoxType; + + +Evas_Object *ivug_scissorbox_add(Evas_Object *parent); + +void ivug_scissorbox_type_set(Evas_Object *obj, eScissorBoxType type); + +void ivug_scissorbox_attach(Evas_Object *obj, Evas_Object *pObj); + +void ivug_scissorbox_region_set(Evas_Object *obj, int x, int y, int w, int h); +void ivug_scissorbox_region_get(Evas_Object *obj, int *x, int *y, int *w, int *h); + + +void ivug_scissorbox_boundary_set(Evas_Object *obj, int x, int y, int w, int h); + + +/*DEFAULT_RATIO_FIX = EINA_TRUE */ +void ivug_scissorbox_ratio_fix(Evas_Object *obj, Eina_Bool bFix); + +/* Default value is bOpaque = true */ +void ivug_scissorbox_set_opaque(Evas_Object *obj, Eina_Bool bOpaque); + +#ifdef __cplusplus +} +#endif + +#endif /* __IVUG_SCISSORBOX_H__*/ + diff --git a/widget/res/images/crop/T06_selection.png b/widget/res/images/crop/T06_selection.png new file mode 100644 index 0000000000000000000000000000000000000000..4928985c889b3c08ef4825d65850a7382d3ac08d GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^QXtI11|(N{`J4k%k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5XGCW-zLn>~)nHI>^V8G)neRHa9YkS}72g`RDNDAHh{~=;i z8uQ5jwgaj!tUPwHJmlzAKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v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4*n4SA%old5+S5a2)VB)%Htl7=SPa7bg8QPeMyqm`VCx# z5E7-7-mg?D|K&hw0W8m><^fe~AzG*@8qtNWbNrltjInXa1yd4=CDp^a>_kTQv~%S+dU|+);+{6wS%oCaIGoY2@j*WT+ZsK w#Q$|g@K;%=b~9musWM^9gmY^Kv&#Pl01~friu)~?AOHXW07*qoM6N<$f`TwEH~;_u literal 0 HcmV?d00001 diff --git a/widget/res/images/crop/T06_selection_Resizing_V.png b/widget/res/images/crop/T06_selection_Resizing_V.png new file mode 100644 index 0000000000000000000000000000000000000000..967937b79d61d8308b1deeff0863c205bc0d214a GIT binary patch literal 5852 zcmV<279;72P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;m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E)ZUsmot* zvQRdmzh9AcY5Z;PsDnsfv&YTHs~?LwSL$*6#;}%9OhdvYdz?^SfMIa!*P#ovGm6}h z>Sx$tXVS{b^Djm6thLYTmC*SZ3x9kinXl0ownL|tZ$0_ z5SW98WKTFfq{D*g5lwj61c)p zZ>~~L&B}_oLMIz%i82lwJpuy*Q`AA|-!ccb*QAxEYqD!zUn}H@^K?09D|ELG zSmVbaRNwL)0JedbfHuxF`gz9Gnag^aCzec3N%U-e&u4yj zg33P@83xX`9m@+L1A#NxD6!)5S3ybFHLv@bI#sTXKC_C|E4zZ{E_$`FQi z06M|8B{z(u7{+=Zpx;k__Mtv7h6B&XTK@6H&ry5@r=C9k(+6F|dha5YaXY3Nsqwkf zNIs@6AK<`J%m_5e(oiEX$M~Jy{3(U-!C)#1@jc*U4oJV}7XTtz%47^k{zkY|06=iG uFcB}(Y(;s@@^FmB@Gl}xe&9DeFamy!z&9qF@Okv-9MDkJRcTPN4gU|Hn~xg+ literal 0 HcmV?d00001 diff --git a/widget/res/images/crop/T06_selection_Rotate.png b/widget/res/images/crop/T06_selection_Rotate.png new file mode 100644 index 0000000000000000000000000000000000000000..1709767041c741b059eedfe500a29b024300a60b GIT binary patch literal 7466 zcmV+_9o6EAP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uo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_`I;RCBRY0XEDw1X_WXLZR@+&d$y+c%HYQUWi*dPFl`sH++$f zC8vP3$WgZECBI}#5MZ59GiH2P_cU629O&7~)8G0$LoYmq^1McibJu|b2fkFR)$YzW z6_xV}#x*Y{O$Mm)xoiPw2igjS!dp8#J3pMwq35WFa(}s8{$90O-H^i#<-V6S2bUuOswPt{0bM|A7>4WH+S>lY z_x%$@1ZNFdt;#VgSF!xc>zKd#Lb?_$MF#;UiLpt7h#YpsLGtT*QG_2xIBVFq?M3<212oNX@Ajs)0jsttea0@{NhSY0ZW z-W`VFIgNo#t%`_n+-YZX%*s_9v*L8-o_reJ%U0m|KF+%OuBO~qm8VhKLwg!$Eqk{< zNB?tA(f{ld3_Sf9eNR17p9vI8WA~M&>EqRE^(R@DJ)Cdv+MoMfawyz%0UM^;3^@~+ zskL4h1i`wNmX@nL&+8Ns#5qh7W73$`S;sJA{z7IPzlgRu$5L$Vpfqb1g|?1*)2Tc{ zWpFQXd4$n{UF`4e;XrQ>qk9JMf{>t4MCH2~opYm=O65P(G`+_;w++~rn`JYcn`HCE zv;Z5Beh%4^?-J|;=J>vURun}SgkgA&*1DxJmNN!xGQ^lM^YaS@yrAAuw^@pbV{Dp| zB{ACf@ca;+Po;9OYL;b>#&P_hG3F6qAlKYbQ^Yir!M$3*W=%%9PqycvUBGdk=PeGy z@J!$L7yG_He_VwmQt$0Jp?R~~*dEjI*LB92K4Z*_X_`LfoZBiQeN9>$$$f50xT66) z)Lf(7WE6jU83}_j&>z>Z8rR>NT0B oZqlG@I@&|DB-8P+=>q=G018rN(;&s2e*gdg07*qoM6N<$f&&j*u>b%7 literal 0 HcmV?d00001 diff --git a/widget/res/images/scissorbox/T01_CallerID_hold.png b/widget/res/images/scissorbox/T01_CallerID_hold.png new file mode 100644 index 0000000000000000000000000000000000000000..b31bc39afc7566dc8a6b18d62a568d3268b2ee4c GIT binary patch literal 2881 zcmV-H3%>M;P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z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C`008P>0026e000+nl3&F} z0001NNkl_==#bTvEyvT)?g~o(E@+zcu%Z4`71GCDie%vm=k+I fhoRh-65=%g`s)>l#W?e{00000NkvXXu0mjfa6ww# literal 0 HcmV?d00001 diff --git a/widget/res/images/scissorbox/T01_CallerID_line_W.png b/widget/res/images/scissorbox/T01_CallerID_line_W.png new file mode 100644 index 0000000000000000000000000000000000000000..f436338d3c7ca770aae38ebf85006c768140bfe7 GIT binary patch literal 2802 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L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^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000ZNklAFi00030{{sM>kOf{`iLUzq0000< KMNUMnLSTX*mo!fR literal 0 HcmV?d00001 diff --git a/widget/res/images/scissorbox/T01_CallerID_line_h.png b/widget/res/images/scissorbox/T01_CallerID_line_h.png new file mode 100644 index 0000000000000000000000000000000000000000..587a6da86ce2bd3bbfd75b72699739f10b00b501 GIT binary patch literal 2807 zcmVKLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o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2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000YNkl>9J$)f-O002ov JPDHLkV1nguFbMzv literal 0 HcmV?d00001 diff --git a/widget/res/images/scissorbox/T01_CallerID_normal.png b/widget/res/images/scissorbox/T01_CallerID_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..1787cdeb03ad7922b25d710bc9645a0032e2ccbd GIT binary patch literal 2879 zcmV-F3&8Y=P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004N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YWk;V1?B&kOT*(|-tL%J P1agI^tDnm{r-UW|fT}}a literal 0 HcmV?d00001 diff --git a/widget/res/layout/ivug-scroller.edc b/widget/res/layout/ivug-scroller.edc new file mode 100755 index 0000000..41d77ba --- /dev/null +++ b/widget/res/layout/ivug-scroller.edc @@ -0,0 +1,324 @@ +/* + * Copyright 2012 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. + */ + +#define DECO_WIDTH (10) + +#define VISIBILITY 1 + +#undef EDJE_DEBUG + +collections { + group { + name: "scroller"; + + script { + public gValue; // Glow value +/* + This makes edje crash... + const Message_ID { + glow = 0, + show, + hide, + }; +*/ + public message(Msg_Type:type, id, ...) { + if( (type==MSG_INT_SET) && (id==0) ) // Glow + { + new alpha; + + alpha = getarg(2); + + gValue = alpha; + + glow(alpha); + } + else if( (type==MSG_STRING_INT) && (id==0) ) // Glow Part + { + new alpha; + new partname[31]; + + snprintf(partname, 31, "%s",getarg(2)); + +#ifdef EDJE_DEBUG + set_text(PART:"dbg", partname); +#endif + glow_part(partname, alpha); + + + } + else if( (type==MSG_STRING) && (id==1) ) // MSG Show + { + new partname[31]; + + snprintf(partname, 31, "%s",getarg(2)); + set_state(get_part_id(partname), "default", 0.0); + } + else if( (type==MSG_STRING) && (id==2) ) // MSG Hide + { + new partname[31]; + + snprintf(partname, 31, "%s",getarg(2)); + + // set_text(PART:"dbg", partname); + + set_state(get_part_id(partname), "hide", 0.0); + + } + } + + public glow_part(partname[], value) { + new part_id; + + part_id = get_part_id(partname); + + custom_state(part_id, "default", 0.0); + set_state_val(part_id, STATE_COLOR, 255, 255, 255, value); + set_state(part_id, "custom", 0.0); + } + + public glow(value) { + glow_part("clip_t", value); + glow_part("clip_b", value); + glow_part("clip_l", value); + glow_part("clip_r", value); + } + + public unglow(value) { + glow_part("clip_t", value); + glow_part("clip_b", value); + glow_part("clip_l", value); + glow_part("clip_r", value); + } + } + + parts { + part { + name: "elm.rect.bg"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + color: 0 0 0 0; + } + } + +#ifdef EDJE_DEBUG + part { + name: "dbg"; + type: TEXT; + description { + min: 50 50; + state: "default" 0.0; + color: 0 0 255 255; /* blue */ + rel1.relative: 0.0 0.0; + rel2.relative: 1.0 1.0; + align: 0.2 0.5; + visible: 0; + text { + font: "arial"; + size: 22; + min: 1 1; + } + } + } +#endif + + part { + name: "glow_t"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "clip_t"; + description { + state: "default" 0.0; + visible: 1; + rel1.to: "clip_t"; + rel2.to: "clip_t"; + color: 255 0 0 255; + } + } + + part { + name: "glow_b"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "clip_b"; + description { + state: "default" 0.0; + visible: 1; + rel1.to: "clip_b"; + rel2.to: "clip_b"; + color: 255 0 0 255; + } + } + + + part { + name: "glow_l"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "clip_l"; + description { + state: "default" 0.0; + visible: 1; + rel1.to: "clip_l"; + rel2.to: "clip_l"; + color: 255 0 0 255; + } + } + + part { + name: "glow_r"; + type: RECT; + scale: 1; + mouse_events: 0; + clip_to: "clip_r"; + description { + state: "default" 0.0; + visible: 1; + rel1.to: "clip_r"; + rel2.to: "clip_r"; + color: 255 0 0 255; + } + } + + part { + name: "clip_t"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 0.0; } + align: 0.5 0.0; + min: 0 DECO_WIDTH; + color: 255 255 255 0; + } + description { + state: "hide" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + } + } + + part { + name: "clip_b"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + align: 0.5 1.0; + min: 0 DECO_WIDTH; + color: 255 255 255 0; + } + description { + state: "hide" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + } + } + + + part { + name: "clip_l"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 1.0; to_y: "clip_t"; } + rel2 { relative: 0.0 0.0; to_y: "clip_b";} + align: 0.0 0.5; + min: DECO_WIDTH 0; + color: 255 255 255 0; + } + description { + state: "hide" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + } + } + + part { + name: "clip_r"; + type: RECT; + scale: 1; + mouse_events: 0; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: 1.0 1.0; to_y: "clip_t"; } + rel2 { relative: 1.0 0.0; to_y: "clip_b";} + align: 1.0 0.5; + min: DECO_WIDTH 0; + color: 255 255 255 0; + } + + description { + state: "hide" 0.0; + inherit: "default" 0.0; + color: 255 255 255 0; + } + + } + } // End of parts + + programs { + program { name: "show"; + signal: "glow.show"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "clip_t"; + target: "clip_b"; + target: "clip_l"; + target: "clip_r"; + } + program { name: "hide"; + signal: "glow.hide"; + source: "elm"; + action: STATE_SET "hide" 0.0; + target: "clip_t"; + target: "clip_b"; + target: "clip_l"; + target: "clip_r"; + } + } + + } +} + +/* + Operation + + glow.[r/l/b/t].[show/hide] : Visibility + glow.[r/l/b/t].[glow] : Glow Effect. with value(0~255) + + +*/ + diff --git a/widget/src/common/BufferCanvas.h b/widget/src/common/BufferCanvas.h new file mode 100755 index 0000000..cc4c72f --- /dev/null +++ b/widget/src/common/BufferCanvas.h @@ -0,0 +1,54 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +class CBufferCanvas { +public: + CBufferCanvas() : m_ee(NULL), m_evas(NULL) {}; + ~CBufferCanvas() { + if ( m_ee) + ecore_evas_free(m_ee); + } + + void Create(int w, int h) { + m_ee = ecore_evas_buffer_new(w,h); + MSG_ASSERT(m_ee != NULL); + + m_evas = ecore_evas_get(m_ee); + }; + + Evas *GetCanvas() const { + return m_evas; + }; + + const void *GetPixels() const { + return ecore_evas_buffer_pixels_get(m_ee); + }; + + void Render() const { + ecore_evas_manual_render(m_ee); + }; + + +private: + +private: + Ecore_Evas *m_ee; + Evas *m_evas; + + +}; diff --git a/widget/src/common/Primitives.cpp b/widget/src/common/Primitives.cpp new file mode 100755 index 0000000..fce93a3 --- /dev/null +++ b/widget/src/common/Primitives.cpp @@ -0,0 +1,61 @@ +/* + * Copyright 2012 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 "Primitives.h" +#include + + +using namespace std; + + +const CRect CRect::Zero = CRect(0,0,0,0); +const CSize CSize::Zero = CSize(0,0); +const CPoint CPoint::Zero = CPoint(0,0); + + + +CRect UnionRect(const CRect &rect1, const CRect &rect2) +{ + return CRect( + CPoint( min(rect1.Left(), rect2.Left()), + min(rect1.Top(), rect2.Top()) ), + + CPoint( max(rect1.Right(), rect2.Right()), + max(rect1.Bottom(), rect2.Bottom()) ) + ); +} + + +CRect IntersectRect(const CRect &rect1, const CRect &rect2) +{ + CRect rect( + CPoint( max(rect1.Left(), rect2.Left()), + max(rect1.Top(), rect2.Top()) ), + + CPoint( min(rect1.Right(), rect2.Right()), + min(rect1.Bottom(), rect2.Bottom()) ) + ); + + if ( rect.IsValid() == false) + { + rect = CRect::Zero; + } + + return rect; +} + + + diff --git a/widget/src/image/ivug-image.cpp b/widget/src/image/ivug-image.cpp new file mode 100755 index 0000000..4ef151d --- /dev/null +++ b/widget/src/image/ivug-image.cpp @@ -0,0 +1,500 @@ +/* + * Copyright 2012 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 "ivug-define.h" + +#include +#include + +#include "ivug-debug.h" +#include "ivug-image.h" +#include "errno.h" + +#include "debug.h" + + +static Evas_Object *_crop_image(const char *file, int /* image coord */crop_x, int crop_y, int crop_w, int crop_h, int final_w, int final_h) +{ + MSG_HIGH("Crop image XYWH(%d,%d,%d,%d) Dimension(%d,%d)", crop_x, crop_y, crop_w, crop_h, final_w, final_h); + +// 1. Load source image into buffer canvas. + Ecore_Evas *m_ee; + m_ee = ecore_evas_buffer_new(final_w, final_h); + MSG_ASSERT(m_ee != NULL); + + Evas *evas = ecore_evas_get(m_ee); + + Evas_Object *bg; + + bg = evas_object_rectangle_add(evas); + evas_object_color_set(bg, 0, 0, 0, 255); /* black bg */ + evas_object_move(bg, 0, 0); /* at origin */ + evas_object_resize(bg, final_w, final_h); /* covers full canvas */ + evas_object_show(bg); + + Evas_Object *img; + + img = evas_object_image_filled_add(evas); + + evas_object_image_file_set(img, file, NULL); + + Evas_Load_Error err = evas_object_image_load_error_get(img); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. error string is \"%s\"", file, evas_load_error_str(err)); + return NULL; + } + + Eina_Bool bRegion = evas_object_image_region_support_get(img); + + evas_object_image_file_set(img, NULL, NULL); + + if ( bRegion == EINA_TRUE) + { + MSG_HIGH("Region supported"); + evas_object_image_load_orientation_set(img, EINA_TRUE); + evas_object_image_load_region_set(img, crop_x, crop_y, crop_w, crop_h); + + evas_object_image_file_set(img, file, NULL); + + Evas_Load_Error err = evas_object_image_load_error_get(img); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. error string is \"%s\"", file, evas_load_error_str(err)); + return NULL; + } + } + else + { + MSG_HIGH("Region not supported."); + +// Load full image + Evas_Object *src; + + src = evas_object_image_add(evas); + + evas_object_image_file_set(src, file, NULL); + + Evas_Load_Error err = evas_object_image_load_error_get(src); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. error string is \"%s\"", file, evas_load_error_str(err)); + return NULL; + } + + int w,h; + evas_object_image_size_get(src, &w, &h); + + MSG_HIGH("Image WH(%d,%d)", w, h); + +// Setup cropped buffer + evas_object_image_size_set(img, crop_w, crop_h); + evas_object_image_fill_set(img, 0, 0, crop_w, crop_h); + +// Copy image from src to img. + int *Src = (int *)evas_object_image_data_get(src, EINA_FALSE); // ImgBuffer's size is same as original image + MSG_ASSERT(Src != NULL); + + int *Dest = (int *)evas_object_image_data_get(img, EINA_TRUE); + MSG_ASSERT(Dest != NULL); + + int *Tmp = Dest; + + int ImgW = w; + int *pRow = Src + (crop_y * ImgW /* stride */ + crop_x) ; // Src begin buffer + + int nRow = crop_h; + int nCol = crop_w; + + MSG_HIGH("Crop(%d,%d,%d,%d) Stride=%d nRow=%d nCol=%d", crop_x, crop_y, crop_w, crop_h, ImgW, nRow, nCol); + + while(nRow--) + { + while(nCol--) + { + // ELM_MSG_HIGH("nRow=%d, nCol=%d, Src=0x%08x Dst=0x%08x", nRow, nCol, pRow , Dest); + *Tmp++ = *pRow++; + } + + nCol = crop_w; + pRow = pRow + (ImgW - crop_w /* stride */ ); + } + evas_object_image_data_set(src, (void *)Src); // Unref + evas_object_del(src); + + evas_object_image_data_set(img, (void *)Dest); + } + + int cw, ch; + + cw = crop_w; + ch = crop_h; + + int ph, pw; + int px, py; + +// Auto fit. why???????. Used when set wallpaper(image size is smaller than LCD) + ph = (ch * final_w) / cw; + + if (ph > final_h) + { + pw = (cw * final_h) / ch; + ph = final_h; + } + else + { + pw = final_w; + } + +// Calculate XY + px = (final_w - pw ) / 2; + py = (final_h - ph ) / 2; + + MSG_HIGH("CenterPut XYWH(%d,%d,%d,%d) in Buf(%d,%d)", px, py, pw, ph, final_w, final_h); + + evas_object_move(img, px, py); + evas_object_resize(img, pw, ph); // set object size which you want to scale + + evas_object_show(img); + +// evas_object_image_save(img, "/opt/ug/data/ug-image-viewer-efl/tt.jpg", NULL, NULL); + +// Copy Buffer canvas data to image object in current evas + const void *data = ecore_evas_buffer_pixels_get(m_ee); + MSG_ASSERT(data != NULL); + + Evas_Object *result; + result = evas_object_image_filled_add(evas); + + evas_object_image_size_set(result, final_w, final_h); + evas_object_image_data_set(result, const_cast(data)); + evas_object_image_data_update_add(result, 0, 0, final_w, final_h); + + MSG_HIGH("Cropped image is created. obj=0x%08x", result); + return result; +}; + + + +// APIs +EAPI Evas_Object *ivug_image_create(Evas_Object *parent) +{ + Evas_Object *obj; + + obj = elm_photocam_add(parent); + + elm_photocam_paused_set(obj, EINA_TRUE); + elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT); + + elm_scroller_policy_set(obj, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF); + + MSG_HIGH("Create photocam object. obj=0x%08x", obj); + return obj; +} + +EAPI Evas_Load_Error ivug_image_file_set(Evas_Object *obj, const char *file, const char *key) +{ + Evas_Load_Error err = EVAS_LOAD_ERROR_NONE; + + err = elm_photocam_file_set(obj, file); + + MSG_HIGH("photocam file set. %s error=%d", file, err); + + if ( err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("Photocam file set error! err=%d", err); + } + + return err; +} + +EAPI Evas_Load_Error ivug_image_mem_set(Evas_Object *obj, const unsigned char *buffer, unsigned int size, const char *key) +{ + MSG_ERROR("%s is not supported", __func__); + + return EVAS_LOAD_ERROR_GENERIC; +} + + +EAPI Evas_Load_Error ivug_image_unset(Evas_Object *obj) +{ + Evas_Load_Error err = EVAS_LOAD_ERROR_NONE; + + MSG_HIGH("photocam file unset. %s", elm_photocam_file_get(obj)); + + err = elm_photocam_file_set(obj, NULL); + return err; +} + +EAPI void ivug_image_zoom_set(Evas_Object *obj, double zoom, Evas_Point *pCenter) +{ + //elm_photocam_paused_set(obj, EINA_FALSE); //stop photocam animation + elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_MANUAL); + elm_photocam_zoom_set(obj, zoom); +} + +EAPI double ivug_image_zoom_get(const Evas_Object *obj) +{ + + return elm_photocam_zoom_get(obj); +} + +EAPI void ivug_image_image_size_get(const Evas_Object *obj, int *w, int *h) +{ +// Return original image size + elm_photocam_image_size_get(obj, w, h); + + MSG_HIGH("Image size XYWH(%d,%d)", *w, *h); + +} + +EAPI void ivug_image_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) +{ + Evas_Object *image; + + image = elm_photocam_internal_image_get(obj); + + if ( image == NULL ) + { + if(x) *x = 0; + if(y) *y = 0; + if(w) *w = 0; + if(h) *h = 0; + + return; + } + + evas_object_geometry_get(image, x ,y, w, h); +// elm_photocam_image_region_get(obj, x ,y, w, h); + + MSG_HIGH("Region size XYWH(%d,%d,%d,%d)", *x, *y, *w, *h); +} + +EAPI void ivug_image_decoded_size_get(const Evas_Object *obj, int *w, int *h) +{ + Evas_Object *image = NULL; + + image = elm_photocam_internal_image_get(obj); + + if ( image == NULL ) + { + if(w) *w = 0; + if(h) *h = 0; + + return; + } + + int iw, ih; + + elm_photocam_image_size_get(obj, &iw, &ih); + + int scale = evas_object_image_load_scale_down_get(obj); + + if(w) *w = iw / scale; + if(h) *h = ih / scale; +}; + + +EAPI unsigned char *ivug_image_decoded_buffer_get(const Evas_Object *obj) +{ + Evas_Object *image = NULL; + + image = elm_photocam_internal_image_get(obj); + + if ( image == NULL ) + { + return NULL; + } + + return (unsigned char *)evas_object_image_data_get(image, EINA_FALSE /* Get for reading Only*/ ); +} + +EAPI void ivug_image_hold_set(const Evas_Object *obj, Eina_Bool hold) +{ + MSG_ERROR("%s is not supported", __func__); +} + +EAPI void ivug_image_zoom_reset(Evas_Object *obj, Evas_Point *pCenter) +{ + Eina_Bool bPaused = elm_photocam_paused_get(obj); + + elm_photocam_paused_set(obj, EINA_TRUE); + elm_photocam_zoom_mode_set(obj, ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT); + elm_photocam_paused_set(obj, bPaused); + +} + +EAPI Evas_Object *ivug_image_region_image_get(Evas_Object *obj, int /* LCD coord */ x, int y, int w, int h ) +{ + MSG_HIGH("Region (%d,%d,%d,%d)", x, y, w, h); + + Evas_Object *image; + + image = elm_photocam_internal_image_get(obj); + + int ix, iy, iw, ih; + + evas_object_geometry_get(image, &ix, &iy, &iw, &ih); + + MSG_HIGH("Image geometry get : (%d,%d,%d,%d)", ix, iy, iw, ih); + + int ow, oh; + evas_object_image_size_get(image, &ow, &oh); + + ow = ow * evas_object_image_load_scale_down_get(image); + oh = oh * evas_object_image_load_scale_down_get(image); + + MSG_HIGH("Original image size(%d,%d)", ow, oh); + + int cx, cy, cw, ch; + +// Get intersect rect between xywh and ixywh + cx = ix; + if ( x > ix ) cx = x; + + cy = iy; + if ( y > iy ) cy = y; + + cw = w; + if ( x + w > ix + iw ) cw = iw; + + ch = h; + if ( y + h > iy + ih ) ch = ih; + + MSG_HIGH("Cropped XWYH(%d,%d,%d,%d)", cx, cy, cw, ch); + +// Get rect on image. + int gx, gy, gw, gh; + + gx = ( cx - ix ) * (double)ow/iw; + gy = ( cy - iy ) * (double)ow/iw; + + gw = cw * (double)ow/iw; + gh = ch * (double)ow/iw; + + MSG_HIGH("On image rect : (%d,%d,%d,%d) Scale=%d", gx, gy, gw, gh, evas_object_image_load_scale_down_get(image)); + + const char *file = NULL; + const char *key = NULL; + + evas_object_image_file_get(image, &file, &key); + + if ( file == NULL ) + { + MSG_ERROR("File is not loaded"); + return NULL; + } + + MSG_HIGH("File = %s %s", file, key ); + + MSG_HIGH("Image size get : (%d,%d)", ow, oh); + + Evas_Object *result = _crop_image(file, gx, gy, gw, gh, w, h); + + return result; +} + + +EAPI Evas_Object * +ivug_image_internal_image_get(Evas_Object *obj) +{ + return elm_photocam_internal_image_get(obj); +} + + +EAPI void ivug_image_animated_set(const Evas_Object *obj, Eina_Bool bAnimation) +{ + MSG_ERROR("%s is not supported", __func__); +} + +EAPI void ivug_image_rotate_set(Evas_Object *obj, int degree) +{ + MSG_ERROR("%s is not supported", __func__); +} + +EAPI int ivug_image_rotate_get(Evas_Object *obj) +{ + MSG_ERROR("%s is not supported", __func__); + + return 0; +} + +EAPI void ivug_image_coordinate_lcd_to_image(Evas_Object *photocam, int lcd_x, int lcd_y, int *img_x, int *img_y) +{ + MSG_ASSERT(photocam != NULL); + + int image_w, image_h; + + ivug_image_image_size_get(photocam, &image_w, &image_h); // Get original image size. + + MSG_UTIL_HIGH("size w=%d, h=%d", image_w, image_h); + + ivug_ret_if(image_w <= 0 || image_h <= 0); + + int gx, gy, gw, gh; + + ivug_image_region_get(photocam, &gx, &gy, &gw, &gh); + + MSG_UTIL_HIGH("region x=%d, y=%d, w=%d, h=%d", gx, gy, gw, gh); + + int image_x, image_y; + + image_x = lcd_x - gx; + image_y = lcd_y - gy; + + image_x = image_x*image_w/gw; + image_y = image_y*image_h/gh; + + MSG_UTIL_HIGH("changed x=%d, y=%d", image_x, image_y); + + *img_x = image_x; + *img_y = image_y; +} + +EAPI void ivug_image_coordinate_image_to_lcd(Evas_Object *photocam, int img_x, int img_y, int *lcd_x, int *lcd_y) +{ + MSG_ASSERT(photocam != NULL); + + int image_w, image_h; + + ivug_ret_if(photocam == NULL); + + ivug_image_image_size_get(photocam, &image_w, &image_h); // Get original image size. + + MSG_UTIL_HIGH("size w=%d, h=%d", image_w, image_h); + + ivug_ret_if(image_w <= 0 || image_h <= 0); + + int gx, gy, gw, gh; + + ivug_image_region_get(photocam, &gx, &gy, &gw, &gh); + + MSG_UTIL_HIGH("region x=%d, y=%d, w=%d, h=%d", gx, gy, gw, gh); + + int scr_x, scr_y; + + scr_x = img_x*gw/image_w; + scr_y = img_y*gh/image_h; + + scr_x = scr_x+gx; + scr_y = scr_y+gy; + + MSG_UTIL_HIGH("changed x=%d, y=%d", scr_x, scr_y); + + *lcd_x = scr_x; + *lcd_y = scr_y; +} + diff --git a/widget/src/scissorbox/ScissorBox.cpp b/widget/src/scissorbox/ScissorBox.cpp new file mode 100755 index 0000000..755ac76 --- /dev/null +++ b/widget/src/scissorbox/ScissorBox.cpp @@ -0,0 +1,1734 @@ +/* + * Copyright 2012 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 "ScissorBox.h" + +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_HIGH + +#undef LOG_CAT +#define LOG_CAT "IV-SCISSOR" + +#define IMAGE_PATH PREFIX"/res/images/"PACKAGE + +#define CROP_POT_PATH IMAGE_PATH"/scissorbox/T01_CallerID_normal.png" +#define CROP_POT_HOLD_PATH IMAGE_PATH"/scissorbox/T01_CallerID_hold.png" +#define CROP_POT_PRESS_PATH IMAGE_PATH"/scissorbox/T01_CallerID_press.png" + +#define CROP_LINEW_PATH IMAGE_PATH"/scissorbox/T01_CallerID_line_W.png" +#define CROP_LINEH_PATH IMAGE_PATH"/scissorbox/T01_CallerID_line_h.png" +#define CROP_LINEW_PRESS_PATH IMAGE_PATH"/scissorbox/T01_CallerID_line_W_press.png" +#define CROP_LINEH_PRESS_PATH IMAGE_PATH"/scissorbox/T01_CallerID_line_h_press.png" + +#define DEFAULT_POT_NUM (4) +#define DEFAULT_DIM_BG_ALPHA (102) + +#undef ALLOW_RECT_TRACE + +class CSelectBox { +public: + enum eState { + NORMAL, + HOLD, + PRESS, + }; + + enum eGripType { + GRIP_LEFT = (1 << 0), + GRIP_RIGHT = (1 << 1), + GRIP_TOP = (1 << 2), + GRIP_BOTTOM = (1 << 3), + }; + +public: + CSelectBox() : m_state(NORMAL), m_ratio(0.0f), m_bPreserve(false), m_rect(), m_bound(0,0,720,1280) + { + }; + + virtual ~CSelectBox() {}; + + virtual void Create(Evas_Object *obj) {}; + + virtual void Move(int x, int y) { + m_rect.Left(x); + m_rect.Top(y); + }; + + virtual void Resize(int w, int h){ + MSG_HIGH("Box resized %dx%d ratio=%f", w, h, m_ratio); + + m_rect.Width(w); + + if ( m_bPreserve == true ) + { + m_rect.Height(w * m_ratio); + } + else + { + m_rect.Height(h); + } + }; + + virtual void SetState(eState state) { + m_state = state; + }; + + virtual eState GetState() const { + return m_state; + }; + + virtual void SetRatio(double ratio) { + m_bPreserve = true; + + m_ratio = ratio; // h / w + }; + + virtual double GetRatio() const { + if ( m_bPreserve == true ) + return m_ratio; + + return 0.0f; + }; + + virtual void SetBound(const CRect &rect) + { + m_bound = rect; + } + + virtual const CRect &GetBound() const { return m_bound; }; + virtual const CRect &GetRegion() const { return m_rect; }; + + virtual void Draw() = 0; +private: + eState m_state; + double m_ratio; + bool m_bPreserve; + +protected: + CRect m_rect; + CRect m_bound; +}; + + +class CBox : public CSelectBox { //caller id +public: + const int SHADOW_DEPTH; + const int EVENT_GRIP_SIZE; + const CSize POT_SIZE; + + static void _line_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) {}; + static void _line_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) {}; + + static void _pot_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox *pBox = (CBox *)data; + +// Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info; + + pBox->OnGripMouseDown(); + }; + static void _pot_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) + { + CBox *pBox = (CBox *)data; + + Evas_Event_Mouse_Move *ev = (Evas_Event_Mouse_Move *) event_info; + + eGripType grip = static_cast (reinterpret_cast (evas_object_data_get(obj, "grip_type"))); + + if ( ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD ) + { + MSG_HIGH("On Hold"); + } + + if ( ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL ) + { + MSG_HIGH("On Scroller"); + } + + pBox->OnGripMouseMove(grip, ev->prev.output.x, ev->prev.output.y, ev->cur.output.x, ev->cur.output.y); + }; + + static void _pot_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox *pBox = (CBox *)data; + +// Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *) event_info; + + pBox->OnGripMouseUp(); + }; + + + static void _selector_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox *pBox = (CBox *)data; + + Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info; + + pBox->OnMouseDown(ev->output.x, ev->output.y); + + }; + + static void _selector_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox *pBox = (CBox *)data; + + Evas_Event_Mouse_Move *ev = (Evas_Event_Mouse_Move *) event_info; + + MSG_LOW("(%d,%d) --> (%d,%d)", ev->cur.output.x, ev->cur.output.y, ev->prev.output.x, ev->prev.output.y); + pBox->OnMouseMove(ev->prev.output.x, ev->prev.output.y, ev->cur.output.x, ev->cur.output.y); + }; + + static void _selector_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox *pBox = (CBox *)data; + + Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *) event_info; + + pBox->OnMouseUp(ev->output.x, ev->output.y); + }; + +public: + CBox() : CSelectBox(), SHADOW_DEPTH(4), EVENT_GRIP_SIZE(60), POT_SIZE(18,18), m_bMouseDown(false), m_bGripMouseDown(false) { }; + + virtual ~CBox() { + MSG_HIGH("Remove CBox"); + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + evas_object_del(selector_line[i]); + evas_object_del(selector_pot[i]); + evas_object_del(event_pot[i]); + } + + evas_object_del(center); + }; + + void OnMouseDown(int x, int y) + { + MSG_HIGH("Mouse down XY(%d,%d)", x, y); + + SetState(PRESS); + m_bMouseDown = true; + } + + void OnMouseMove(int px, int py, int cx, int cy) + { + // Inform changes to parent. + if ( m_bMouseDown == false ) return; + + int dx, dy; + + dx = cx - px; + dy = cy - py; + + MSG_MED("Mouse move XY(%d,%d) -> XY(%d,%d)", px, py, cx, cy); + + if ( dx == 0 && dy == 0) { + return; + }; + + if ( m_rect.Left() + dx < m_bound.Left() ) + { + MSG_HIGH("Left bound"); + dx = m_bound.Left() - m_rect.Left(); + } + + if ( m_rect.Right() + dx > m_bound.Right() ) + { + MSG_HIGH("Right bound"); + dx = m_bound.Right() - m_rect.Right(); + } + + if ( m_rect.Top() + dy < m_bound.Top() ) + { + MSG_HIGH("Top bound"); + dy = m_bound.Top() - m_rect.Top(); + } + + if ( m_rect.Bottom() + dy > m_bound.Bottom() ) + { + MSG_HIGH("Bottom bound"); + dy = m_bound.Bottom() - m_rect.Bottom(); + } + + // Move rect + m_rect.MoveBy(dx, dy); + + evas_object_smart_changed(evas_object_smart_parent_get(center)); + + } + + void OnMouseUp(int x, int y) + { + MSG_HIGH("Mouse up XY(%d,%d)", x, y); + SetState(NORMAL); + + m_bMouseDown = false; +// evas_object_smart_callback_call(sd->obj, SIG_CHANGED, NULL); + } + + void OnGripMouseUp() + { + m_bGripMouseDown = false; + SetState(NORMAL); + } + + void OnGripMouseDown() + { + m_bGripMouseDown = true; + SetState(HOLD); + } + + void OnGripMouseMove(eGripType grip, int px, int py, int cx, int cy) + { + if ( m_bGripMouseDown == false ) return; + + int dx = cx - px; + int dy = cy - py; + + if ( dx == 0 && dy == 0) { + return; + }; + + if ( GetRatio() != 0.0f ) + { + _GripMovePreserve(grip, dx, dy); + } + else + { + _GripMove(grip, dx, dy); + } + + MSG_HIGH("New Rect %d,%d,%d,%d", m_rect.Left(), m_rect.Top(), m_rect.Width(), m_rect.Height()); + + evas_object_smart_changed(evas_object_smart_parent_get(center)); + } + + virtual void SetState(eState state) { + CSelectBox::SetState(state); + + _LoadImage(); + }; + +private: + void _GripMove(eGripType grip, int dx, int dy) { + const int min_size = EVENT_GRIP_SIZE; + CRect rect = m_rect; + + int X1 = rect.Left(), Y1 = rect.Top() ,X2 = rect.Right(), Y2 = rect.Bottom(); + + if ( grip & GRIP_LEFT ) + { + X1 = rect.Left() + dx; + + if ( X1 < m_bound.Left() ) + { + MSG_HIGH("Left bound"); + X1 = m_bound.Left(); + } + + if ( rect.Width() - dx < min_size ) + { + X1 = rect.Right() - min_size; + + MSG_HIGH("X1 = %d (%d,%d)", X1, rect.Left(), rect.Right()); + } + } + + if ( grip & GRIP_TOP ) + { + Y1 = rect.Top() + dy; + + if ( Y1 < m_bound.Top() ) + { + MSG_HIGH("Top bound"); + Y1 = m_bound.Top(); + } + + if ( rect.Height() - dy < min_size ) + { + Y1 = rect.Bottom() - min_size; + + MSG_HIGH("Y1 = %d B=%d", Y1, rect.Bottom()); + } + } + + if ( grip & GRIP_RIGHT ) + { + X2 = rect.Right() + dx; + + if ( X2 > m_bound.Right() ) + { + MSG_HIGH("Right bound"); + X2 = m_bound.Right() ; + } + + if ( rect.Width() + dx < min_size ) + { + X2 = rect.Left() + min_size; + } + } + + if ( grip & GRIP_BOTTOM ) + { + Y2 = rect.Bottom() + dy; + + if ( Y2 > m_bound.Bottom() ) + { + MSG_HIGH("Bottom bound"); + Y2 = m_bound.Bottom(); + } + + if ( rect.Height() + dy < min_size ) + { + Y2 = rect.Top() + min_size; + } + } + + m_rect = CRect(X1, Y1, X2 - X1, Y2 - Y1); + + }; + + void _GripMovePreserve(eGripType grip, int dx, int dy) { + const int min_size = EVENT_GRIP_SIZE; + CRect rect = m_rect; + + int X = 0,Y = 0,W = 0,H = 0; + + double ratio = GetRatio(); + + MSG_HIGH("Dx=%d Dy=%d Ratio=%f", dx, dy, ratio); + + enum eDominantDirection + { + Direction_X, + Direction_Y + } ; + + eDominantDirection dir = Direction_X; + int mov_dist; + if(abs(dx) < abs(dy)) + { + dir = Direction_Y; + mov_dist = dy; + } + else + { + mov_dist = dx; + } + + if ( (grip & GRIP_LEFT) && (grip & GRIP_TOP) ) + { + MSG_HIGH("LEFT,TOP"); + + if ( dir == Direction_X ) + { + W = rect.Width() - mov_dist; + H = W * ratio; + + X = m_rect.Right() - W; + Y = m_rect.Bottom() - H; + } + else + { + H = rect.Height() - mov_dist; + W = H / ratio; + + X = m_rect.Right() - W; + Y = m_rect.Bottom() - H; + } + + + } + + if ( (grip & GRIP_RIGHT) && (grip & GRIP_TOP) ) + { + MSG_HIGH("RIGHT,TOP"); + + if ( dir == Direction_X ) + { + W = rect.Width() + mov_dist; + H = W * ratio; + + X = m_rect.Left(); + Y = m_rect.Bottom() - H; + } + else + { + H = rect.Height() - mov_dist; + W = H / ratio; + + X = m_rect.Left(); + Y = m_rect.Bottom() - H; + } + + } + + if ( (grip & GRIP_RIGHT) && (grip & GRIP_BOTTOM) ) + { + MSG_HIGH("RIGHT,BOTTOM"); + if ( dir == Direction_X ) + { + W = rect.Width() + mov_dist; + H = W * ratio; + + X = m_rect.Left(); + Y = m_rect.Top(); + } + else + { + H = rect.Height() + mov_dist; + W = H / ratio; + + X = m_rect.Left(); + Y = m_rect.Top(); + + } + + } + + if ( (grip & GRIP_LEFT) && (grip & GRIP_BOTTOM) ) + { + MSG_HIGH("LEFT,BOTTOM"); + + if ( dir == Direction_X ) + { + W = rect.Width() - mov_dist; + H = W * ratio; + + X = m_rect.Right() - W; + Y = m_rect.Top(); + } + else + { + H = rect.Height() + mov_dist; + W = H / ratio; + + X = m_rect.Right() - W; + Y = m_rect.Top(); + } + + } + + if ( W < min_size || H < min_size) + { + return; + } + + if ( X < m_bound.Left() || Y < m_bound.Top() || + X + W > m_bound.Right() || Y+H > m_bound.Bottom() ) + { + return; + } + + m_rect = CRect(X,Y,W,H); + + } + + void _LoadImage() { + const char *line_w; + const char *line_h; + const char *pot; + + if ( GetState() == NORMAL ) + { + line_w = CROP_LINEW_PATH; + line_h = CROP_LINEH_PATH; + + pot = CROP_POT_PATH; + } + else if ( GetState() == PRESS ) + { + line_w = CROP_LINEW_PRESS_PATH; + line_h = CROP_LINEH_PRESS_PATH; + + pot = CROP_POT_PRESS_PATH; + } + else if ( GetState() == HOLD ) + { + line_w = CROP_LINEW_PATH; + line_h = CROP_LINEH_PATH; + + pot = CROP_POT_HOLD_PATH; + } + else + { + MSG_FATAL("Invalid state"); + return; + } + + Evas_Load_Error err; + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + if(i % 2) // 1, 3 + { + evas_object_image_file_set(selector_line[i], line_w, NULL); + err = evas_object_image_load_error_get(selector_line[i]); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. %s", line_w, evas_load_error_str(err)); + } + } + else // 0, 2 + { + evas_object_image_file_set(selector_line[i], line_h, NULL); + err = evas_object_image_load_error_get(selector_line[i]); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. %s", line_h, evas_load_error_str(err)); + } + } + + evas_object_show(selector_line[i]); + + } + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + evas_object_image_file_set(selector_pot[i], pot, NULL); + + err = evas_object_image_load_error_get(selector_line[i]); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. %s", pot, evas_load_error_str(err)); + } + + evas_object_image_scale_hint_set(selector_pot[i], EVAS_IMAGE_SCALE_HINT_STATIC); + + evas_object_show(selector_pot[i]); + } + }; + +public: + + void Create(Evas_Object *obj) { + Evas *e = evas_object_evas_get(obj); + + center = evas_object_rectangle_add(e); + evas_object_color_set(center, 0, 0, 0, 0); + + evas_object_event_callback_add(center, EVAS_CALLBACK_MOUSE_DOWN, _selector_mouse_down, this); + evas_object_event_callback_add(center, EVAS_CALLBACK_MOUSE_UP, _selector_mouse_up, this); + evas_object_event_callback_add(center, EVAS_CALLBACK_MOUSE_MOVE, _selector_mouse_move, this); + + evas_object_smart_member_add(center, obj); + + evas_object_show(center); + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + selector_line[i] = evas_object_image_filled_add(e); + + evas_object_event_callback_add(selector_line[i], EVAS_CALLBACK_MOUSE_DOWN, _line_mouse_down, this); + evas_object_event_callback_add(selector_line[i], EVAS_CALLBACK_MOUSE_UP, _line_mouse_up, this); + + evas_object_smart_member_add(selector_line[i], obj); + } + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + /* Create image icon (pot) */ + selector_pot[i] = evas_object_image_filled_add(e); + + evas_object_image_scale_hint_set(selector_pot[i], EVAS_IMAGE_SCALE_HINT_STATIC); + + evas_object_smart_member_add(selector_pot[i], obj); + + /* Create event object above image icon (pot) */ + event_pot[i] = evas_object_rectangle_add(e); + evas_object_color_set(event_pot[i], 0, 0, 0, 0); + + evas_object_event_callback_add(event_pot[i], EVAS_CALLBACK_MOUSE_DOWN, _pot_mouse_down, this); + evas_object_event_callback_add(event_pot[i], EVAS_CALLBACK_MOUSE_UP, _pot_mouse_up, this); + evas_object_event_callback_add(event_pot[i], EVAS_CALLBACK_MOUSE_MOVE, _pot_mouse_move, this); + + evas_object_resize(event_pot[i], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE); + + evas_object_smart_member_add(event_pot[i], obj); + + evas_object_show(event_pot[i]); + } + + evas_object_data_set(event_pot[0], "grip_type",(void *)(GRIP_LEFT | GRIP_TOP)); + evas_object_data_set(event_pot[1], "grip_type",(void *)(GRIP_RIGHT | GRIP_TOP)); + evas_object_data_set(event_pot[2], "grip_type",(void *)(GRIP_RIGHT | GRIP_BOTTOM)); + evas_object_data_set(event_pot[3], "grip_type",(void *)(GRIP_LEFT | GRIP_BOTTOM)); + + _LoadImage(); + }; + + void Draw() { +// Check bound. + if ( m_bound.Inside(m_rect) == false ) + { + MSG_ERROR("Out of bound region. Rect(%d,%d,%d,%d) Bound(%d,%d,%d,%d)", m_rect.Left(), m_rect.Top(), m_rect.Width(), m_rect.Height(), + m_bound.Left(), m_bound.Top(), m_bound.Width(), m_bound.Height()); + + // Reset Rect + } + + evas_object_move(center, m_rect.Left(), m_rect.Top()); + evas_object_resize(center, m_rect.Width(), m_rect.Height()); + // Horizontal + evas_object_move(selector_line[0], m_rect.Left(), m_rect.Top()); + evas_object_resize(selector_line[0], m_rect.Width() , 8); + + evas_object_move(selector_line[2], m_rect.Left(), m_rect.Bottom() - (SHADOW_DEPTH / 2)); + evas_object_resize(selector_line[2], m_rect.Width() , 8); + + // Vertical + evas_object_move(selector_line[1], m_rect.Left(), m_rect.Top()); + evas_object_resize(selector_line[1], 8, m_rect.Height() ); + + evas_object_move(selector_line[3], m_rect.Right() - (SHADOW_DEPTH / 2), m_rect.Top()); + evas_object_resize(selector_line[3], 8, m_rect.Height()); + + evas_object_move(event_pot[0], m_rect.Left() - ( EVENT_GRIP_SIZE / 2), m_rect.Top() - ( EVENT_GRIP_SIZE / 2)); + evas_object_move(event_pot[1], m_rect.Right() - ( EVENT_GRIP_SIZE / 2), m_rect.Top() - ( EVENT_GRIP_SIZE / 2)); + evas_object_move(event_pot[2], m_rect.Right() - ( EVENT_GRIP_SIZE / 2), m_rect.Bottom() - ( EVENT_GRIP_SIZE / 2)); + evas_object_move(event_pot[3], m_rect.Left() - ( EVENT_GRIP_SIZE / 2), m_rect.Bottom() - ( EVENT_GRIP_SIZE / 2)); + + // Pot + int w, h; + + w = POT_SIZE.Width(); + h = POT_SIZE.Height(); + + evas_object_move(selector_pot[0], m_rect.Left() - 4, m_rect.Top() - 4 ); + evas_object_resize(selector_pot[0], w, h); + + evas_object_move(selector_pot[1], m_rect.Right() - 8, m_rect.Top() - 4 ); + evas_object_resize(selector_pot[1], w, h); + + evas_object_move(selector_pot[2], m_rect.Right() - 8, m_rect.Bottom() - 8); + evas_object_resize(selector_pot[2], w, h); + + evas_object_move(selector_pot[3], m_rect.Left() - 4, m_rect.Bottom() - 8); + evas_object_resize(selector_pot[3], w, h); + + }; + +private: + Evas_Object *selector_line[4]; + Evas_Object *event_pot[4]; + Evas_Object *selector_pot[4]; + + Evas_Object *center; + + bool m_bMouseDown; + bool m_bGripMouseDown; + +}; + + +#define CROP_SELECT_PATH IMAGE_PATH"/crop/T06_selection.png" + +#define CROP_RESIZE_H_PATH IMAGE_PATH"/crop/T06_selection_Resizing_h.png" +#define CROP_RESIZE_W_PATH IMAGE_PATH"/crop/T06_selection_Resizing_V.png" + +#define CROP_ROTATE_PATH IMAGE_PATH"/crop/T06_selection_Rotate.png" + +class CBox1 : public CSelectBox { // crop box +public: + const int EVENT_GRIP_SIZE; + const CSize POT_SIZE; + + static void _line_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) {}; + static void _line_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) {}; + + static void _pot_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox1 *pBox = (CBox1 *)data; + +// Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info; + + pBox->OnGripMouseDown(); + }; + static void _pot_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) + { + CBox1 *pBox = (CBox1 *)data; + + Evas_Event_Mouse_Move *ev = (Evas_Event_Mouse_Move *) event_info; + + eGripType grip = static_cast (reinterpret_cast (evas_object_data_get(obj, "grip_type"))); + + if ( ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD ) + { + MSG_HIGH("On Hold"); + } + + if ( ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL ) + { + MSG_HIGH("On Scroller"); + } + + pBox->OnGripMouseMove(grip, ev->prev.output.x, ev->prev.output.y, ev->cur.output.x, ev->cur.output.y); + }; + + static void _pot_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox1 *pBox = (CBox1 *)data; + +// Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *) event_info; + + pBox->OnGripMouseUp(); + }; + + + static void _selector_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox1 *pBox = (CBox1 *)data; + + Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info; + + pBox->OnMouseDown(ev->output.x, ev->output.y); + + }; + + static void _selector_mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox1 *pBox = (CBox1 *)data; + + Evas_Event_Mouse_Move *ev = (Evas_Event_Mouse_Move *) event_info; + + MSG_LOW("(%d,%d) --> (%d,%d)", ev->cur.output.x, ev->cur.output.y, ev->prev.output.x, ev->prev.output.y); + pBox->OnMouseMove(ev->prev.output.x, ev->prev.output.y, ev->cur.output.x, ev->cur.output.y); + }; + + static void _selector_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) { + CBox1 *pBox = (CBox1 *)data; + + Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *) event_info; + + pBox->OnMouseUp(ev->output.x, ev->output.y); + }; + +public: + CBox1() : CSelectBox(), EVENT_GRIP_SIZE(90), POT_SIZE(56,56), m_bMouseDown(false), m_bGripMouseDown(false) { }; + + virtual ~CBox1() { + MSG_HIGH("Remove CBox1"); + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + evas_object_del(selector_pot[i]); + evas_object_del(event_pot[i]); + } + + evas_object_del(this->sel_rotate); + evas_object_del(select_rect); + }; + + void OnMouseDown(int x, int y) + { + MSG_HIGH("Mouse down XY(%d,%d)", x, y); + + SetState(PRESS); + m_bMouseDown = true; + } + + void OnMouseMove(int px, int py, int cx, int cy) + { + // Inform changes to parent. + if ( m_bMouseDown == false ) return; + + int dx, dy; + + dx = cx - px; + dy = cy - py; + + MSG_HIGH("Mouse move XY(%d,%d) -> XY(%d,%d)", px, py, cx, cy); + + if ( dx == 0 && dy == 0) { + return; + }; + + if ( m_rect.Left() + dx < m_bound.Left() ) + { + MSG_HIGH("Left bound"); + dx = m_bound.Left() - m_rect.Left(); + } + + if ( m_rect.Right() + dx > m_bound.Right() ) + { + MSG_HIGH("Right bound"); + dx = m_bound.Right() - m_rect.Right(); + } + + if ( m_rect.Top() + dy < m_bound.Top() ) + { + MSG_HIGH("Top bound"); + dy = m_bound.Top() - m_rect.Top(); + } + + if ( m_rect.Bottom() + dy > m_bound.Bottom() ) + { + MSG_HIGH("Bottom bound"); + dy = m_bound.Bottom() - m_rect.Bottom(); + } + + // Move rect + m_rect.MoveBy(dx, dy); + + evas_object_smart_changed(evas_object_smart_parent_get(select_rect)); + + } + + void OnMouseUp(int x, int y) + { + MSG_HIGH("Mouse up XY(%d,%d)", x, y); + SetState(NORMAL); + + m_bMouseDown = false; +// evas_object_smart_callback_call(sd->obj, SIG_CHANGED, NULL); + } + + void OnGripMouseUp() + { + m_bGripMouseDown = false; + SetState(NORMAL); + } + + void OnGripMouseDown() + { + m_bGripMouseDown = true; + SetState(HOLD); + } + + void OnGripMouseMove(eGripType grip, int px, int py, int cx, int cy) + { + if ( m_bGripMouseDown == false ) return; + + int dx = cx - px; + int dy = cy - py; + + if ( dx == 0 && dy == 0) { + return; + }; + + if ( GetRatio() != 0.0f ) + { + _GripMovePreserve(grip, dx, dy); + } + else + { + _GripMove(grip, dx, dy); + } + + MSG_HIGH("New Rect %d,%d,%d,%d", m_rect.Left(), m_rect.Top(), m_rect.Width(), m_rect.Height()); + + evas_object_smart_changed(evas_object_smart_parent_get(select_rect)); + } + +private: + void _GripMove(eGripType grip, int dx, int dy) { + const int min_size = EVENT_GRIP_SIZE; + CRect rect = m_rect; + + int X1 = rect.Left(), Y1 = rect.Top() ,X2 = rect.Right(), Y2 = rect.Bottom(); + + if ( grip & GRIP_LEFT ) + { + X1 = rect.Left() + dx; + + if ( X1 < m_bound.Left() ) + { + MSG_HIGH("Left bound"); + X1 = m_bound.Left(); + } + + if ( rect.Width() - dx < min_size ) + { + X1 = rect.Right() - min_size; + + MSG_HIGH("X1 = %d (%d,%d)", X1, rect.Left(), rect.Right()); + } + } + + if ( grip & GRIP_TOP ) + { + Y1 = rect.Top() + dy; + + if ( Y1 < m_bound.Top() ) + { + MSG_HIGH("Top bound"); + Y1 = m_bound.Top(); + } + + if ( rect.Height() - dy < min_size ) + { + Y1 = rect.Bottom() - min_size; + + MSG_HIGH("Y1 = %d B=%d", Y1, rect.Bottom()); + } + } + + if ( grip & GRIP_RIGHT ) + { + X2 = rect.Right() + dx; + + if ( X2 > m_bound.Right() ) + { + MSG_HIGH("Right bound"); + X2 = m_bound.Right() ; + } + + if ( rect.Width() + dx < min_size ) + { + X2 = rect.Left() + min_size; + } + } + + if ( grip & GRIP_BOTTOM ) + { + Y2 = rect.Bottom() + dy; + + if ( Y2 > m_bound.Bottom() ) + { + MSG_HIGH("Bottom bound"); + Y2 = m_bound.Bottom(); + } + + if ( rect.Height() + dy < min_size ) + { + Y2 = rect.Top() + min_size; + } + } + + m_rect = CRect(X1, Y1, X2 - X1, Y2 - Y1); + + }; + + void _GripMovePreserve(eGripType grip, int dx, int dy) { + const int min_size = EVENT_GRIP_SIZE; + CRect rect = m_rect; + + int X = 0,Y = 0,W = 0,H = 0; + + double ratio = GetRatio(); + + MSG_HIGH("Dx=%d Dy=%d Ratio=%f", dx, dy, ratio); + + enum eDominantDirection + { + Direction_X, + Direction_Y + } ; + + eDominantDirection dir = Direction_X; + int mov_dist; + if(abs(dx) < abs(dy)) + { + dir = Direction_Y; + mov_dist = dy; + } + else + { + mov_dist = dx; + } + + if ( (grip & GRIP_LEFT) || (grip & GRIP_TOP) ) + { + MSG_HIGH("LEFT,TOP"); + + if ( dir == Direction_X ) + { + W = rect.Width() - mov_dist; + H = W * ratio; + + X = m_rect.Right() - W; + Y = m_rect.Bottom() - H; + } + else + { + H = rect.Height() - mov_dist; + W = H / ratio; + + X = m_rect.Right() - W; + Y = m_rect.Bottom() - H; + } + + + } + + + if ( (grip & GRIP_RIGHT) || (grip & GRIP_BOTTOM) ) + { + MSG_HIGH("RIGHT,BOTTOM"); + if ( dir == Direction_X ) + { + W = rect.Width() + mov_dist; + H = W * ratio; + + X = m_rect.Left(); + Y = m_rect.Top(); + } + else + { + H = rect.Height() + mov_dist; + W = H / ratio; + + X = m_rect.Left(); + Y = m_rect.Top(); + + } + + } + + +#if 0 + if ( (grip & GRIP_RIGHT) && (grip & GRIP_TOP) ) + { + MSG_HIGH("RIGHT,TOP"); + + if ( dir == Direction_X ) + { + W = rect.Width() + mov_dist; + H = W * m_ratio; + + X = m_rect.Left(); + Y = m_rect.Bottom() - H; + } + else + { + H = rect.Height() - mov_dist; + W = H / m_ratio; + + X = m_rect.Left(); + Y = m_rect.Bottom() - H; + } + + } + + if ( (grip & GRIP_LEFT) && (grip & GRIP_BOTTOM) ) + { + MSG_HIGH("LEFT,BOTTOM"); + + if ( dir == Direction_X ) + { + W = rect.Width() - mov_dist; + H = W * m_ratio; + + X = m_rect.Right() - W; + Y = m_rect.Top(); + } + else + { + H = rect.Height() + mov_dist; + W = H / m_ratio; + + X = m_rect.Right() - W; + Y = m_rect.Top(); + } + + } +#endif + + if ( W < min_size || H < min_size) + { + return; + } + + if ( X < m_bound.Left() || Y < m_bound.Top() || + X + W > m_bound.Right() || Y+H > m_bound.Bottom() ) + { + return; + } + + m_rect = CRect(X,Y,W,H); + + } + + void _LoadImage() { + + Evas_Load_Error err; + + evas_object_image_file_set(select_rect, CROP_SELECT_PATH, NULL); + err = evas_object_image_load_error_get(select_rect); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. %s", CROP_SELECT_PATH, evas_load_error_str(err)); + } + + evas_object_image_border_set(select_rect, 6, 6, 6, 6); + evas_object_show(select_rect); + + const char *szPot[] = { + CROP_RESIZE_H_PATH, + CROP_RESIZE_H_PATH, + CROP_RESIZE_W_PATH, + CROP_RESIZE_W_PATH + }; + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + evas_object_image_file_set(selector_pot[i], szPot[i], NULL); + + err = evas_object_image_load_error_get(selector_pot[i]); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. %s", szPot[i], evas_load_error_str(err)); + } + + evas_object_image_scale_hint_set(selector_pot[i], EVAS_IMAGE_SCALE_HINT_STATIC); + + evas_object_show(selector_pot[i]); + } + + /*evas_object_image_file_set(sel_rotate, CROP_ROTATE_PATH, NULL); + + err = evas_object_image_load_error_get(sel_rotate); + if (err != EVAS_LOAD_ERROR_NONE) + { + MSG_ERROR("could not load image '%s'. %s", CROP_ROTATE_PATH, evas_load_error_str(err)); + } + + evas_object_image_scale_hint_set(sel_rotate, EVAS_IMAGE_SCALE_HINT_STATIC); + + evas_object_show(sel_rotate);*/ + + }; + +public: + virtual void SetState(eState state) { + CSelectBox::SetState(state); + + _LoadImage(); + }; + + void Create(Evas_Object *obj) { + Evas *e = evas_object_evas_get(obj); + + select_rect = evas_object_image_filled_add(e); + + evas_object_event_callback_add(select_rect, EVAS_CALLBACK_MOUSE_DOWN, _selector_mouse_down, this); + evas_object_event_callback_add(select_rect, EVAS_CALLBACK_MOUSE_UP, _selector_mouse_up, this); + evas_object_event_callback_add(select_rect, EVAS_CALLBACK_MOUSE_MOVE, _selector_mouse_move, this); + + evas_object_smart_member_add(select_rect, obj); + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + /* Create image icon (pot) */ + selector_pot[i] = evas_object_image_filled_add(e); + + evas_object_image_scale_hint_set(selector_pot[i], EVAS_IMAGE_SCALE_HINT_STATIC); + + evas_object_smart_member_add(selector_pot[i], obj); + + /* Create event object above image icon (pot) */ + event_pot[i] = evas_object_rectangle_add(e); + evas_object_color_set(event_pot[i], 0, 0, 0, 0); + + evas_object_event_callback_add(event_pot[i], EVAS_CALLBACK_MOUSE_DOWN, _pot_mouse_down, this); + evas_object_event_callback_add(event_pot[i], EVAS_CALLBACK_MOUSE_UP, _pot_mouse_up, this); + evas_object_event_callback_add(event_pot[i], EVAS_CALLBACK_MOUSE_MOVE, _pot_mouse_move, this); + + evas_object_smart_member_add(event_pot[i], obj); + + evas_object_show(event_pot[i]); + } + + + evas_object_data_set(event_pot[0], "grip_type",(void *)GRIP_LEFT); + evas_object_data_set(event_pot[1], "grip_type",(void *)GRIP_RIGHT); + evas_object_data_set(event_pot[2], "grip_type",(void *)GRIP_TOP); + evas_object_data_set(event_pot[3], "grip_type",(void *)GRIP_BOTTOM); + + sel_rotate = evas_object_image_filled_add(e); + evas_object_smart_member_add(sel_rotate, obj); + + _LoadImage(); + }; + + void Draw() { +// Check bound. + if ( m_bound.Inside(m_rect) == false ) + { + MSG_ERROR("Out of bound region. Rect(%d,%d,%d,%d) Bound(%d,%d,%d,%d)", m_rect.Left(), m_rect.Top(), m_rect.Width(), m_rect.Height(), + m_bound.Left(), m_bound.Top(), m_bound.Width(), m_bound.Height()); + } + + MSG_HIGH("Rect. %d,%d,%d,%d", m_rect.Left(), m_rect.Top(), m_rect.Width(), m_rect.Height()); + + const int margin_l = -1; + const int margin_r = -1; + const int margin_t = -1; + const int margin_b = -1; + + int mx, my, mw, mh; + + mx = m_rect.Left() + margin_l; + my = m_rect.Top() + margin_t; + mw = m_rect.Width() - margin_l - margin_r; + mh = m_rect.Height() - margin_t - margin_b; + + evas_object_move(select_rect, mx, my); + evas_object_resize(select_rect, mw, mh); + + int w, h; + + w = POT_SIZE.Width(); + h = POT_SIZE.Height(); + +// Event handle. + evas_object_resize(event_pot[0], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE); + evas_object_move(event_pot[0], m_rect.Left() - ( EVENT_GRIP_SIZE ) + w/2, m_rect.Top() + m_rect.Height() / 2 - ( EVENT_GRIP_SIZE / 2 )); // Left + + evas_object_resize(event_pot[1], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE); + evas_object_move(event_pot[1], m_rect.Right() - w/2, m_rect.Top() + m_rect.Height() / 2 - ( EVENT_GRIP_SIZE / 2 )); // Right + + evas_object_resize(event_pot[2], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE); + evas_object_move(event_pot[2], m_rect.Left() + m_rect.Width() / 2 - ( EVENT_GRIP_SIZE / 2 ), m_rect.Top() - ( EVENT_GRIP_SIZE ) + h/2); // Top + + evas_object_resize(event_pot[3], EVENT_GRIP_SIZE, EVENT_GRIP_SIZE); + evas_object_move(event_pot[3], m_rect.Left() + m_rect.Width() / 2 - ( EVENT_GRIP_SIZE / 2 ), m_rect.Bottom() - h/2 ); // Bottom + +#ifdef SHOW_EVENT_AREA + evas_object_color_set(event_pot[0], 255, 255, 255, 100); + evas_object_color_set(event_pot[1], 255, 255, 0, 100); + evas_object_color_set(event_pot[2], 255, 0, 255, 100); + evas_object_color_set(event_pot[3], 0, 255, 255, 100); +#endif + + // Pot + const int lw = 4; + const int lh = 4; +// L + evas_object_resize(selector_pot[0], w, h); + evas_object_move(selector_pot[0], m_rect.Left() - w / 2 + lw, m_rect.Top() + m_rect.Height() / 2 - h / 2 ); +// R + evas_object_move(selector_pot[1], m_rect.Right() - w / 2 -lw, m_rect.Top() + m_rect.Height() / 2 - h / 2 ); + evas_object_resize(selector_pot[1], w, h); +// T + evas_object_move(selector_pot[2], m_rect.Left() + m_rect.Width() / 2 - w / 2 , m_rect.Top() - h / 2 + lh); + evas_object_resize(selector_pot[2], w, h); +// B + evas_object_move(selector_pot[3], m_rect.Left() + m_rect.Width() / 2 - w / 2, m_rect.Bottom() - h / 2 - lh); + evas_object_resize(selector_pot[3], w, h); + + evas_object_move(sel_rotate, m_rect.Right() - w / 2 - lw , m_rect.Top() - h / 2 + lh); + evas_object_resize(sel_rotate, w, h); + + }; + +private: + Evas_Object *select_rect; // Center rect + + Evas_Object *event_pot[4]; + Evas_Object *selector_pot[4]; + + Evas_Object *sel_rotate; + + bool m_bMouseDown; + bool m_bGripMouseDown; +}; + + +template<> +const Evas_Smart_Cb_Description CEvasSmartObject::_signals[] = { + {NULL, NULL}, +}; + +Evas_Object *CScissorBox::CreateObject(Evas_Object *parent) { + CEvasSmartObject::CreateObject(parent); + + evas_object_smart_callbacks_descriptions_set(GetObject(), _signals); + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + m_opaque[i] = evas_object_rectangle_add(evas_object_evas_get(parent)); + + evas_object_color_set(m_opaque[i], 0, 0, 0, DEFAULT_DIM_BG_ALPHA); + evas_object_smart_member_add(m_opaque[i], GetObject()); + evas_object_repeat_events_set(m_opaque[i], EINA_TRUE); + } + + m_box = new CBox(); + + m_box->Create( GetObject() ); + + m_parent = parent; + + MSG_HIGH("Scissorbox created"); + return GetObject(); +}; + +void CScissorBox::remove() +{ + MSG_HIGH("Destroy ScissorBox. m_box=0x%08x", m_box); + + if ( m_target ) + { + UnRegisterCB(); + m_target = NULL; + } + + m_parent = NULL; + + for (int i = 0; i < DEFAULT_POT_NUM; i++) + { + evas_object_hide(m_opaque[i]); + evas_object_del(m_opaque[i]); + } + + if ( m_job ) + { + ecore_job_del(m_job); + m_job = NULL; + } + + delete m_box; + + delete this; +} + + +void CScissorBox::SetOpaque(bool bOpaque) +{ +#if 0 + // Determine whether BG is drawn or not. + if ( bOpaque == m_bOpaque ) + { + return; + } +#endif + + +/* +m_rect +------------------------------ +| m_opaque[0] | +| ___________________________ | +| ---- | +| m_opaque[3] |bg | m_opaque[1] | +|_______________----___________ | +| | +| m_opaque[2] | +------------------------------ +*/ + if ( bOpaque == true ) + { + evas_object_show(m_opaque[0]); + evas_object_show(m_opaque[1]); + evas_object_show(m_opaque[2]); + evas_object_show(m_opaque[3]); + } + else + { + evas_object_hide(m_opaque[0]); + evas_object_hide(m_opaque[1]); + evas_object_hide(m_opaque[2]); + evas_object_hide(m_opaque[3]); + } + + m_bOpaque = bOpaque; + +} + + +void CScissorBox::SetPreserveRatio(bool bPreserveRatio) +{ + m_bPreserveRatio = bPreserveRatio; + + if ( m_bPreserveRatio == true ) + { + CRect rect = m_box->GetRegion(); + + if ( rect.Width() != 0 ) + { + MSG_HIGH("Set to preserve ratio"); + m_box->SetRatio((double)rect.Height() / rect.Width()); + } + } + +} + +void CScissorBox::SetRegion(int x, int y, int w, int h) +{ + MSG_HIGH("Set Region(%d,%d,%d,%d)", x, y, w, h); + + m_box->Move(x,y); + + if ( m_bPreserveRatio == true ) + { + m_box->SetRatio((double)h / w); + } + + m_box->Resize(w,h); + m_bSetRegion = true; + + evas_object_smart_changed(GetObject()); +} + +void CScissorBox::SetBound(int x, int y, int w, int h) +{ + MSG_HIGH("Set Bound(%d,%d,%d,%d)", x, y, w, h); + + CRect rect(x, y, w, h); + m_box->SetBound(rect); + + + evas_object_smart_changed(GetObject()); +} + +void CScissorBox::SetBoxType(eType type) +{ +// Remove old one and reload + if ( m_boxtype != type ) + { + // Load again + if ( m_box ) + { + const CRect &bound = m_box->GetBound(); + const CRect ®ion = m_box->GetRegion(); + double ratio = m_box->GetRatio(); + + delete m_box; + m_box = NULL; + + if ( type == IMAGE_VIEW ) + { + m_box = new CBox; + } + else + { + m_box = new CBox1; + } + + m_box->Create( GetObject() ); + + m_box->SetBound(bound); + m_box->Move(region.Left(), region.Top()); + m_box->Resize(region.Width(), region.Height()); + + if ( m_bPreserveRatio == true ) + { + m_box->SetRatio(ratio); + } + + } + } + + m_boxtype = type; +} + + +const CRect &CScissorBox::GetRegion() const +{ + return m_box->GetRegion(); +} + + +void CScissorBox::Attach(Evas_Object *obj) +{ + MSG_HIGH("Attach client! obj=%s", evas_object_type_get(obj)); + + if ( m_target ) + UnRegisterCB(); + + m_target = obj; + + RegisterCB(); + + SetOpaque(true); + + OnTargetChanged(); +} + + +void CScissorBox::draw() +{ + if ( m_box == NULL ) return; + + if ( m_bOpaque == true) + { + const CRect &box_rect = m_box->GetRegion(); + + if ( box_rect != CRect::Zero ) + { + int x, y, w, h; + evas_output_viewport_get(evas_object_evas_get(GetObject()), &x, &y, &w, &h); + + MSG_LOW("Evas View port Output : %d,%d,%d,%d", x,y,w, h); + + evas_object_move(m_opaque[0], x, y); + evas_object_resize(m_opaque[0], w, box_rect.Top()); + + evas_object_move(m_opaque[1], box_rect.Right(), box_rect.Top()); + evas_object_resize(m_opaque[1], w - box_rect.Right() , box_rect.Height() ); + + evas_object_move(m_opaque[2], x, box_rect.Bottom()); + evas_object_resize(m_opaque[2], w , h - box_rect.Bottom() ); + + evas_object_move(m_opaque[3], x, box_rect.Top()); + evas_object_resize(m_opaque[3], box_rect.Left() , box_rect.Height() ); + } + } + + m_box->Draw(); +} + +void CScissorBox::OnTargetChanged() +{ + if ( m_job ) + { + ecore_job_del(m_job); + } + + m_job = ecore_job_add(_OnChangedJob, this); + +} + +void CScissorBox::ApplyChanges() +{ + int x, y, w, h; + + int lcd_x, lcd_y, lcd_w, lcd_h; + + evas_object_geometry_get(m_parent, &lcd_x, &lcd_y, &lcd_w, &lcd_h); + MSG_HIGH("LCD size (%d,%d,%d,%d)", lcd_x, lcd_y, lcd_w, lcd_h); + + double lcd_ratio = (double)lcd_h/lcd_w; + + if ( m_target == NULL ) + { + x = 0; + y = 0; + w = lcd_w; + h = lcd_h; + } + else + { + evas_object_geometry_get(m_target, &x, &y, &w, &h); + } + + // evas_object_geometry_get is not corret when image loaded before show effect ended + if(lcd_ratio > (double)h/w) + { + x = 0; + } + else + { + x = (lcd_w - w)/2; + } + + MSG_HIGH("Target Changed (%d,%d,%d,%d)->(%d,%d,%d,%d)", tRect.Left(), tRect.Top(), tRect.Width(), tRect.Height(), x, y, w, h); + + if ( w == 0 || h == 0 ) + { + MSG_WARN("Size does not changed"); + return; + } + + CRect bound(x,y,w,h); // Boundary size is same as target + m_box->SetBound(bound); + + MSG_HIGH("Set Bound rect(%d,%d,%d,%d)", bound.Left(), bound.Top(), bound.Width(), bound.Height() ); + + if ( m_bSetRegion == false ) + { + int nW = w / 2; + int nH = h / 2; + + m_box->Move(x + (w - nW) / 2, y + (h - nH) / 2 ); + m_box->Resize(nW, nH); + + MSG_HIGH("Region is not set yet. BoxRegion(%d,%d,%d,%d)", x + (w - nW) / 2, y + (h - nH) / 2, nW, nH); + evas_object_smart_changed(GetObject()); + + return; + } + +#ifdef ALLOW_RECT_TRACE + if ( tRect.Width() == 0 || tRect.Height() == 0 ) + { + MSG_WARN("First time"); + tRect = CRect(x,y,w,h); + return; + } + + double zRatio = (double)w / tRect.Width(); + + const CRect &box_rect = m_box->GetRegion(); + +// Convert to rect on image; + int ix = box_rect.Left() - tRect.Left(); + int iy = box_rect.Top() - tRect.Top(); + + int rx = ix * zRatio; + int ry = iy * zRatio; + int rw = box_rect.Width() * zRatio; + int rh = box_rect.Height() * zRatio; + + m_box->Move(rx + x, ry + y); + m_box->Resize(rw, rh); + + MSG_HIGH("%d,%d %d,%d,%d,%d", ix, iy, rx, ry, rw, rh); +#endif + tRect = CRect(x,y,w,h); + +#ifndef ALLOW_RECT_TRACE + const CRect &box_rect = m_box->GetRegion(); + + if ( bound.Inside(box_rect) == false ) + { + MSG_ERROR("Out of bound region. Rect(%d,%d,%d,%d) Bound(%d,%d,%d,%d)", box_rect.Left(), box_rect.Top(), box_rect.Width(), box_rect.Height(), + bound.Left(), bound.Top(), bound.Width(), bound.Height()); + + int ph, pw; + + ph = (box_rect.Height() * bound.Width()) / box_rect.Width(); + + if (ph > bound.Height()) + { + pw = (box_rect.Width() * bound.Height()) / box_rect.Height(); + ph = bound.Height(); + } + else + { + pw = bound.Width(); + } + + pw = pw / 2; + ph = ph / 2; + + MSG_ERROR("New WH(%d,%d)", pw, ph); + + m_box->Move(bound.Left() + (bound.Width() - pw ) / 2, bound.Top() + (bound.Height() - ph) / 2 ); + m_box->Resize(pw , ph); + +#if 0 + // Reset Rect + int nW = bound.Width() / 2; + int nH = bound.Height() / 2; + + if ( nW > nH ) + { + nW = bound.Width() / 2; + nH = bound.Height() / 2; + } + else + { + nW = bound.Width() / 2; + nH = bound.Height() / 2; + } + + m_box->Move(bound.Left() + (bound.Width() - nW) / 2, bound.Top() + (bound.Height() - nH) / 2 ); + m_box->Resize(nW, nH); +#endif + + } + +#endif // ALLOW_RECT_TRACE + + evas_object_smart_changed(GetObject()); + +} + + diff --git a/widget/src/scissorbox/ScissorBox.h b/widget/src/scissorbox/ScissorBox.h new file mode 100755 index 0000000..4162841 --- /dev/null +++ b/widget/src/scissorbox/ScissorBox.h @@ -0,0 +1,124 @@ +/* + * Copyright 2012 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. + */ + +#pragma once + +#include "ivug-debug.h" +#include "EvasSmartObj.h" +#include "Ecore.h" + +using namespace std; + +class CSelectBox; + +class CScissorBox : public CEvasSmartObject { +public: + enum eType { + IMAGE_VIEW, + IMAGE_EDIT, + }; + +public: + CScissorBox() : CEvasSmartObject(), m_box(NULL), m_boxtype(IMAGE_VIEW), m_bOpaque(false), m_target(NULL), m_bPreserveRatio(false), m_bSetRegion(false), m_job(NULL) { + CEvasSmartObject::SetClassName("ScissorBox"); + }; + + virtual ~CScissorBox() { + MSG_HIGH("~CScissorBox freed"); + }; + + Evas_Object *CreateObject(Evas_Object *parent); + + void SetOpaque(bool bOpaque); + void SetRegion(int x, int y, int w, int h); + void SetBound(int x, int y, int w, int h); + void SetPreserveRatio(bool bPreserveRatio); + void SetBoxType(eType type); + + void Attach(Evas_Object *image); + + const CRect &GetRegion() const; + + void draw(); + void remove(); + void resize(int w, int h) { + MSG_HIGH("Scissor box resized. WH(%d,%d)", w, h); + }; + + static void _on_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) + { + //CScissorBox *scissorbox = (CScissorBox *)data; + + //scissorbox->OnTargetChanged(); + }; + + static void _on_move(void *data, Evas *e, Evas_Object *obj, void *event_info) { + // CScissorBox *scissorbox = (CScissorBox *)data; + + //scissorbox->OnTargetChanged(); + }; + + static void _OnChangedJob(void *data) { + CScissorBox *scissorbox = (CScissorBox *)data; + + scissorbox->OnChanged(); + } + + void OnTargetChanged(); + + void OnChanged() { + m_job = NULL; + ApplyChanges(); + }; + + void ApplyChanges(); + +private: + void RegisterCB() { + MSG_ASSERT(m_target != NULL); + + evas_object_event_callback_add(m_target, EVAS_CALLBACK_RESIZE, _on_resize, this); + evas_object_event_callback_add(m_target, EVAS_CALLBACK_MOVE, _on_move, this); + + } + + void UnRegisterCB() { + evas_object_event_callback_del_full(m_target, EVAS_CALLBACK_RESIZE, _on_resize, this); + evas_object_event_callback_del_full(m_target, EVAS_CALLBACK_MOVE, _on_move, this); + }; + + +private: + CSelectBox *m_box; + + eType m_boxtype; + + bool m_bOpaque; + Evas_Object *m_opaque[4]; + + Evas_Object *m_target; + + bool m_bPreserveRatio; + bool m_bSetRegion; // If region is set already, + Ecore_Job *m_job; + + CRect tRect; // Target rectangle + + Evas_Object *m_parent; // parent layout +}; + + + diff --git a/widget/src/scissorbox/ivug-scissorbox.cpp b/widget/src/scissorbox/ivug-scissorbox.cpp new file mode 100755 index 0000000..e268ea8 --- /dev/null +++ b/widget/src/scissorbox/ivug-scissorbox.cpp @@ -0,0 +1,127 @@ +/* + * Copyright 2012 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 "ivug-scissorbox.h" +#include "ivug-debug.h" + +#include "ScissorBox.h" + +#define SCISSORBOX_CLASS(obj) \ + static_cast(evas_object_data_get((obj), "CScissorBox")) + + +IVAPI Evas_Object *ivug_scissorbox_add(Evas_Object *parent) +{ + CScissorBox *scissorbox = new CScissorBox; + + Evas_Object *obj = scissorbox->CreateObject(parent); + MSG_ASSERT(obj != NULL); + + evas_object_data_set(obj, "CScissorBox", scissorbox); + + MSG_HIGH("Create scissorBox object. class=0x%08x obj=0x%08x", scissorbox, obj); + return obj; +} + +IVAPI void ivug_scissorbox_type_set(Evas_Object *obj, eScissorBoxType type) +{ + MSG_ASSERT(obj != NULL); + CScissorBox *scissorbox = SCISSORBOX_CLASS(obj); + + if ( type == SCISSOR_BOX_TYPE_1 ) + { + scissorbox->SetBoxType(CScissorBox::IMAGE_VIEW); + } + else + { + scissorbox->SetBoxType(CScissorBox::IMAGE_EDIT); + } + +} + +IVAPI void ivug_scissorbox_attach(Evas_Object *obj, Evas_Object *pObj) +{ + CScissorBox *scissorbox = SCISSORBOX_CLASS(obj); + MSG_ASSERT(pObj != NULL); + + scissorbox->Attach(pObj); +} + +IVAPI void ivug_scissorbox_region_get(Evas_Object *obj, int *x, int *y, int *w, int *h) +{ + MSG_ASSERT(obj != NULL); + CScissorBox *scissorbox = SCISSORBOX_CLASS(obj); + + const CRect ®ion = scissorbox->GetRegion(); + + if ( x ) *x = region.Left(); + if ( y ) *y = region.Top(); + if ( w ) *w = region.Width(); + if ( h ) *h = region.Height(); + +} + +IVAPI void ivug_scissorbox_region_set(Evas_Object *obj, int x, int y, int w, int h) +{ + MSG_ASSERT(obj != NULL); + CScissorBox *scissorbox = SCISSORBOX_CLASS(obj); + + scissorbox->SetRegion(x,y,w,h); +} + +IVAPI void ivug_scissorbox_boundary_set(Evas_Object *obj, int x, int y, int w, int h) +{ + MSG_ASSERT(obj != NULL); + CScissorBox *scissorbox = SCISSORBOX_CLASS(obj); + + scissorbox->SetBound(x,y,w,h); +} + + +IVAPI void ivug_scissorbox_ratio_fix(Evas_Object *obj, Eina_Bool bFix) +{ + MSG_ASSERT(obj != NULL); + CScissorBox *scissorbox = SCISSORBOX_CLASS(obj); + + if ( bFix == EINA_TRUE ) + { + scissorbox->SetPreserveRatio(true); + } + else + { + scissorbox->SetPreserveRatio(false); + } + +} + +IVAPI void ivug_scissorbox_set_opaque(Evas_Object *obj, Eina_Bool bOpaque) +{ + MSG_ASSERT(obj != NULL); + CScissorBox *scissorbox = SCISSORBOX_CLASS(obj); + + if ( bOpaque == EINA_TRUE ) + { + scissorbox->SetOpaque(true); + } + else + { + scissorbox->SetOpaque(false); + } +} + + diff --git a/widget/src/util/EFLUtil.cpp b/widget/src/util/EFLUtil.cpp new file mode 100755 index 0000000..ac0068d --- /dev/null +++ b/widget/src/util/EFLUtil.cpp @@ -0,0 +1,524 @@ +/* + * Copyright 2012 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 "EFLUtil.h" +#include "ivug-debug.h" + +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_HIGH +#undef LOG_CAT +#define LOG_CAT "IV-UTIL" + +namespace EFL { + +extern "C" const char * +elm_widget_type_get(const Evas_Object *obj); + + +extern void * +elm_widget_data_get(const Evas_Object *obj); + + +void get_evas_geometry(Evas_Object *obj, const char *prefix) +{ + int x, y, w, h; + + evas_object_geometry_get(obj, &x, &y, &w, &h); + + MSG_HIGH("%s XYWH(%d,%d,%d,%d)", prefix); +} + +Evas_Object *create_gesture(Evas_Object *parent) +{ + Evas_Object *gesture; + + gesture = elm_gesture_layer_add(parent); + + return gesture; +} + +Evas_Object *create_rect(Evas_Object *parent) +{ + Evas_Object *obj; + + obj = evas_object_rectangle_add(evas_object_evas_get(parent)); + + evas_object_size_hint_expand_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(obj, 0,0,0,0); + + return obj; +} + +Evas_Object *create_clipper(Evas_Object *parent) +{ + Evas_Object *obj; + + obj = evas_object_rectangle_add(evas_object_evas_get(parent)); + + evas_object_size_hint_expand_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_color_set(obj, 255,255,255,255); + + return obj; +} + + +Evas_Object *create_layout(Evas_Object *parent, const char *edj, const char *group) +{ + MSG_ASSERT(parent != NULL); + + Evas_Object *layout; + layout = elm_layout_add(parent); + + if ( layout == NULL ) + { + MSG_ERROR("Cannot create layout"); + return NULL; + } + + if ( elm_layout_file_set(layout, edj, group) == EINA_FALSE) + { + MSG_ERROR("Layout file set failed! %s in %s", group, edj); + evas_object_del(layout); + return NULL; + } + + evas_object_size_hint_expand_set( layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_fill_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL ); + + evas_object_show(layout); + return layout; +} + +Evas_Object *create_button(Evas_Object *parent, const char *style, const char *icon, const char *caption) +{ + Evas_Object *btn = NULL; + + btn = elm_button_add(parent); + elm_object_style_set(btn, style); + + if ( icon ) + { + Evas_Object *ic = NULL; + ic = elm_icon_add(btn); + elm_image_file_set(ic, icon, NULL); + evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); + elm_object_part_content_set(btn, "icon", ic); + } + + if ( caption ) + { + elm_object_text_set(btn, caption); + } + + return btn; +} + + +Evas_Object *create_icon(Evas_Object *parent, const char *edjname, const char *groupname) +{ + Evas_Object *icon; + + icon = elm_icon_add(parent); + + if ( elm_image_file_set(icon, edjname, groupname) == EINA_FALSE) + { + MSG_IVUG_ERROR("Cannot file set. EDJ=%s Group=%s", edjname, groupname); + evas_object_del(icon); + return NULL; + } + + evas_object_size_hint_aspect_set(icon, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + elm_image_resizable_set(icon, 1, 1); + evas_object_size_hint_expand_set(icon, 1, 1); + + return icon; +} + + +void dump_win(Evas_Object *obj) +{ + void *pData = elm_widget_data_get(obj); + + Eina_List *subobjs = (Eina_List *)( pData + (4 * 6 )); + + { + int x, y, w, h; + + evas_object_geometry_get(obj, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(obj); + Eina_Bool pass = evas_object_pass_events_get(obj); + Eina_Bool visible = evas_object_visible_get(obj); + Eina_Bool propagate = evas_object_propagate_events_get(obj); + + MSG_HIGH("Win=%s(%s,0x%08x) %s(%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(obj), elm_widget_type_get(obj), obj, evas_object_type_get(obj), x, y, w, h, pass, repeat, visible, propagate); + + } + + const Eina_List *l; + const Evas_Object *child; + + void *MyData = NULL; + + EINA_LIST_FOREACH(subobjs, l, MyData) + { + child = (const Evas_Object *)MyData; + + int x, y, w, h; + + evas_object_geometry_get(child, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(child); + Eina_Bool pass = evas_object_pass_events_get(child); + Eina_Bool visible = evas_object_visible_get(child); + Eina_Bool propagate = evas_object_propagate_events_get(child); + + MSG_HIGH(" Obj=%s(%s,0x%08x) %s(%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(child), elm_widget_type_get(child), child, evas_object_type_get(child), x, y, w, h, pass, repeat, visible, propagate); + } + +} + +void dump_obj(Evas_Object *obj, int lvl) +{ + Eina_List *list = evas_object_smart_members_get(obj); + + if ( lvl == 0 ) + { + int x, y, w, h; + + evas_object_geometry_get(obj, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(obj); + Eina_Bool pass = evas_object_pass_events_get(obj); + Eina_Bool visible = evas_object_visible_get(obj); + Eina_Bool propagate = evas_object_propagate_events_get(obj); + + MSG_HIGH("Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(obj), evas_object_type_get(obj), obj, x, y, w, h, pass, repeat, visible, propagate); + lvl++; + } + + Evas_Object *data; + Eina_List *l; + + for (l = list, data = (Evas_Object *)eina_list_data_get(l); l; l = eina_list_next(l), data = (Evas_Object *)eina_list_data_get(l)) + { + int x, y, w, h; + + evas_object_geometry_get(data, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(data); + Eina_Bool pass = evas_object_pass_events_get(data); + Eina_Bool visible = evas_object_visible_get(data); + Eina_Bool propagate = evas_object_propagate_events_get(data); + + if ( lvl == 0 ) + { + MSG_HIGH("Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(data), evas_object_type_get(data), data, x, y, w, h, pass, repeat, visible, propagate); + } + else + { + char *space = new char[lvl*2+1]; + + for ( int i = 0; i < lvl*2; i++) + { + space[i] = ' '; + } + + space[lvl*2] = '\0'; + + MSG_HIGH("%sObj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", space, evas_object_name_get(data), evas_object_type_get(data), data, x, y, w, h, pass, repeat, visible, propagate); + + delete[] space; + } + + dump_obj(data, lvl+1); + + } +} + + + + void dump_widget(Evas_Object *obj, int lvl) + { + Eina_List *list = evas_object_smart_members_get(obj); + + if ( lvl == 0 ) + { + int x, y, w, h; + + evas_object_geometry_get(obj, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(obj); + Eina_Bool pass = evas_object_pass_events_get(obj); + Eina_Bool visible = evas_object_visible_get(obj); + Eina_Bool propagate = evas_object_propagate_events_get(obj); + + MSG_HIGH("Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(obj), elm_widget_type_get(obj), obj, x, y, w, h, pass, repeat, visible, propagate); + lvl++; + } + + Evas_Object *data; + Eina_List *l; + + for (l = list, data = (Evas_Object *)eina_list_data_get(l); l; l = eina_list_next(l), data = (Evas_Object *)eina_list_data_get(l)) + { + int x, y, w, h; + + evas_object_geometry_get(data, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(data); + Eina_Bool pass = evas_object_pass_events_get(data); + Eina_Bool visible = evas_object_visible_get(data); + Eina_Bool propagate = evas_object_propagate_events_get(data); + + if ( elm_widget_type_get(data) != NULL || evas_object_name_get(data) != NULL ) + { + if ( lvl == 0 ) + { + MSG_HIGH("Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(data), elm_widget_type_get(data), data, x, y, w, h, pass, repeat, visible, propagate); + } + else + { + char *space = new char[lvl*2+1]; + + for ( int i = 0; i < lvl*2; i++) + { + space[i] = ' '; + } + + space[lvl*2] = '\0'; + + MSG_HIGH("%sObj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", space, evas_object_name_get(data), elm_widget_type_get(data), data, x, y, w, h, pass, repeat, visible, propagate); + + delete[] space; + } + } + + dump_widget(data, lvl+1); + + } + } + + + void dump_clipper(Evas_Object *clipper) + { + + const Eina_List *clippees; + const Eina_List *l; + + Evas_Object *data; + + data = clipper; + int x, y, w, h; + + evas_object_geometry_get(data, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(data); + Eina_Bool pass = evas_object_pass_events_get(data); + Eina_Bool visible = evas_object_visible_get(data); + Eina_Bool propagate = evas_object_propagate_events_get(data); + + MSG_HIGH("Clipper Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(data), evas_object_type_get(data), data, x, y, w, h, pass, repeat, visible, propagate); + + clippees = evas_object_clipees_get(clipper); + void *tmp; + EINA_LIST_FOREACH(clippees, l, tmp) + { + data = (Evas_Object *)tmp; + int x, y, w, h; + + evas_object_geometry_get(data, &x, &y, &w, &h); + Eina_Bool repeat = evas_object_repeat_events_get(data); + Eina_Bool pass = evas_object_pass_events_get(data); + Eina_Bool visible = evas_object_visible_get(data); + Eina_Bool propagate = evas_object_propagate_events_get(data); + + MSG_HIGH(" Obj=%s(%s,0x%08x) (%d,%d,%d,%d) P%d|R%d|V%d|E%d", evas_object_name_get(data), evas_object_type_get(data), data, x, y, w, h, pass, repeat, visible, propagate); + } + } + +char * current_render_method(Evas *e) +{ + char *szRet = NULL; + + //get render list that usable + Eina_List *engine_list = evas_render_method_list(); + + //id of rendering method + int current_id = evas_output_method_get(e); + + //check rendering method same + Eina_List *l; + + const char *engine_name; + + for (l = engine_list, engine_name = (const char *)eina_list_data_get(l); l; l = eina_list_next(l),engine_name = (const char *)eina_list_data_get(l)) + { + //id value of specific rendering method + int engine_id = evas_render_method_lookup(engine_name); + + //"software_x11", "gl_x11" + if (engine_id == current_id) + { + MSG_HIGH("current render method is %s!", engine_name); + szRet = strdup(engine_name); + break; + } + } + + evas_render_method_list_free(engine_list); + + return szRet; +} + +Evas_Object *create_window(const char *title, int w, int h) +{ + Evas_Object *win; + + win = elm_win_add(NULL, "main", ELM_WIN_BASIC); + elm_win_title_set(win, title); + + evas_object_resize(win, w, h); + evas_object_show(win); + + return win; +} + + + +}; + + +namespace util { + +Image_Codec_Type +get_codec_type(const unsigned char *buffer, unsigned int size) +{ + if ( size < 8 ) + { + MSG_ERROR("To small buffer size : %d", size); + return eImageCodec_UNKNOWN; + } + + if ( buffer[0] == 0xff && buffer[1] == 0xd8) // JPEG + { + return eImageCodec_JPEG; + } + else if(buffer[0] == 0x89 && buffer[1] == 0x50 && buffer[2] == 0x4e && buffer[3] == 0x47 && + buffer[4] == 0x0d && buffer[5] == 0x0a && buffer[6] == 0x1a && buffer[7] == 0x0a ) + { + return eImageCodec_PNG; + } + else + { + // ("GIF87a" or "GIF89a") + + if ( memcmp(buffer, "GIF8", 4) == 0 ) + { + if (buffer[4] == '9' || buffer[4] == '7' ) + { + if ( buffer[5] == 'a') + { + return eImageCodec_GIF; + } + } + } + } + + return eImageCodec_IMAGE; +} + +Image_Codec_Type +get_codec_type(const char *filename) +{ + FILE *fp = NULL; + + fp = fopen(filename, "rb"); + + if ( fp == NULL ) + { + char error_msg[256]; + MSG_ERROR("Cannot find %s", filename); + MSG_ERROR("Cannot open file : %s", strerror_r(errno, error_msg, sizeof(error_msg)) ); + + return eImageCodec_UNKNOWN; + } + + unsigned char buffer[8]; + int readcnt = 0; + + readcnt = fread(&buffer, 1, sizeof(buffer), fp); + + if ( readcnt != sizeof(buffer) ) + { + if(feof(fp)) + { + MSG_ERROR("End Of File"); + } + if(ferror(fp)) + { + perror("fread ERROR"); + } + MSG_ERROR("Read Error. file = %s, readcnt = %d", filename, readcnt); + + fclose(fp); + return eImageCodec_UNKNOWN; + } + + fclose(fp); + + MSG_LOW("ReadCount=%d", readcnt); + return get_codec_type(buffer, readcnt); + +} + + +bool is_openGL_enabled(Evas *e) +{ + MSG_ASSERT(e != NULL ); + + Eina_List *engines, *l; + int cur_id; + int id; + void *data; + + engines = evas_render_method_list (); + if (!engines) { + MSG_ERROR("No engine is specified"); + return false; + } + + cur_id = evas_output_method_get (e); + + EINA_LIST_FOREACH (engines, l, data) { + const char *name = (char *)data; + + id = evas_render_method_lookup (name); + if (name && id == cur_id) + { + if (!strcmp (name, "gl_x11")) { + return true; + } + break; + } + } + + return false; + +} + + +}; + + diff --git a/widget/src/util/ivug-listpopup.c b/widget/src/util/ivug-listpopup.c new file mode 100755 index 0000000..8bd8f2e --- /dev/null +++ b/widget/src/util/ivug-listpopup.c @@ -0,0 +1,489 @@ +/* + * Copyright 2012 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 "ivug-debug.h" + +#include +#include "ivug-listpopup.h" + +#undef LOG_LVL +#define LOG_LVL DBG_MSG_LVL_HIGH + +#undef LOG_CAT +#define LOG_CAT "IV-POPUP" + +typedef struct { + Evas_Object *obj; + + Evas_Object *popup; + Evas_Object *parent; + Eina_List *list; + + const char *title; + const char *caption; +} ListPopup; + + +typedef struct { + Evas_Object *obj; // This object + + Elm_Object_Item *item; + + const char *iconpath; + const char *caption; + void *data; + + bool bDisabled; + +} ListPopupItem; + +#define IV_LISTPOPUP(obj) \ + (ListPopup *)(evas_object_data_get((obj), "LISTPOPUP")) + +static char * +_on_label_set(void *data, Evas_Object *obj, const char *part) +{ + IV_ASSERT( data != NULL); + + ListPopupItem *item = (ListPopupItem *)data; + + return strdup(item->caption); //dump +} + + +static void +_on_genlist_selected(void *data, Evas_Object *obj, void *event_info) +{ + MSG_ASSERT(data != NULL); + + ListPopupItem *item = data; +// ListPopup *pListPopup = IV_LISTPOPUP(item->obj); + + MSG_HIGH("Genlist item selected"); + + evas_object_smart_callback_call(item->obj, "popup,selected", item); + +} + + +static void +_on_ctxpopup_selected(void *data, Evas_Object *obj, void *event_info) +{ + MSG_ASSERT(data != NULL); + +// +// Elm_Object_Item *item = (Elm_Object_Item *)event_info; + ListPopupItem *item = data; +// ListPopup *pListPopup = IV_LISTPOPUP(item->obj); + + MSG_HIGH("Ctxpopup item selected. obj=0x%08x", item->obj); + + evas_object_smart_callback_call(item->obj, "popup,selected", item); + +} + + +static void _on_item_del(void *data, Evas_Object *obj) +{ + MSG_ASSERT(data != NULL); + + ListPopupItem *item = data; + + MSG_HIGH("Remove item"); + + if ( item->caption ) + eina_stringshare_del(item->caption); + + item->caption = NULL; + + if ( item->iconpath ) + eina_stringshare_del(item->iconpath); + item->iconpath = NULL; + + free(item); +} + + +static void +_on_popup_close(void *data, Evas_Object *obj, void *event_info) +{ + MSG_ASSERT(data != NULL); + + ListPopup *pListPopup = data; + + MSG_HIGH("Genlist Popup Dismissed"); + + evas_object_smart_callback_call(pListPopup->obj, "popup,dismissed", NULL); +} + +static void _on_genpopup_deleted(void * data, Evas * e, Evas_Object * obj, void * event_info) +{ + MSG_HIGH("Remove genlist popup"); + + ListPopup *pListPopup = data; + + if ( pListPopup->title ) + eina_stringshare_del(pListPopup->title); + + pListPopup->title = NULL; + + if ( pListPopup->popup ) + { + evas_object_del(pListPopup->popup); + } + + + free(pListPopup); +} + + +static void _on_ctxpopup_deleted(void * data, Evas * e, Evas_Object * obj, void * event_info) +{ + MSG_HIGH("Remove ctx popup"); + + ListPopup *pListPopup = data; + + if ( pListPopup->title ) + eina_stringshare_del(pListPopup->title); + + pListPopup->title = NULL; + + EINA_LIST_FREE(pListPopup->list, data) + { + _on_item_del(data, NULL); + } + + pListPopup->list = NULL; + + if ( pListPopup->popup ) + { + evas_object_del(pListPopup->popup); + } + + + free(pListPopup); +} + +static void _on_dismissed_cb(void *data, Evas_Object *obj, void *event_info) +{ + ListPopup *pListPopup = data; + + MSG_HIGH("Ctx Popup Dismissed"); + evas_object_smart_callback_call(pListPopup->obj, "popup,dismissed", NULL); +} + + +Evas_Object *ivug_listpopup_add(Evas_Object *parent) +{ + Evas_Object *obj = NULL; + +// Creating dummy object because we cannot + obj = elm_box_add(parent); + + ListPopup *pListPopup = (ListPopup *)calloc(1, sizeof(ListPopup)); + + pListPopup->parent = parent; + + pListPopup->list = NULL; + pListPopup->obj = obj; + pListPopup->title = NULL; + pListPopup->caption = NULL; + evas_object_data_set(obj, "LISTPOPUP", (void *)pListPopup); + + MSG_HIGH("List popup is added. obj=0x%08x", obj); + + return obj; +} + + +Ivug_ListPopup_Item *ivug_listpopup_item_append(Evas_Object *obj, const char *iconpath, const char *caption, void *data) +{ + ListPopup *pListPopup = IV_LISTPOPUP(obj); + + ListPopupItem *item = calloc(1,sizeof(ListPopupItem)); + + item->obj = obj; + + if (iconpath ) + { + item->iconpath = eina_stringshare_add(iconpath); + } + + if ( caption ) + { + item->caption = eina_stringshare_add(caption); + } + + item->bDisabled = false; + item->data = data; + + MSG_HIGH("Item append: %s", caption); + + pListPopup->list = eina_list_append(pListPopup->list, item); + + return item; +} + + +Ivug_ListPopup_Item *ivug_listpopup_item_prepend(Evas_Object *obj, const char *iconpath, const char *caption, void *data) +{ + ListPopup *pListPopup = IV_LISTPOPUP(obj); + + ListPopupItem *item = (ListPopupItem *)calloc(1, sizeof(ListPopupItem)); + + item->obj = obj; + item->iconpath = eina_stringshare_add(item->iconpath); + item->caption = eina_stringshare_add(item->caption); + item->bDisabled = false; + item->data = data; + + MSG_HIGH("Item prepend: %s", caption); + + pListPopup->list = eina_list_prepend(pListPopup->list, item); + + return item; +} + + +Eina_List *ivug_listpopup_items_get(Evas_Object *obj) +{ + ListPopup *pListPopup = IV_LISTPOPUP(obj); + + return pListPopup->list; +} + + +void ivug_listpopup_item_disabled_set(Ivug_ListPopup_Item *item) +{ + ListPopupItem *item_ = item; + + item_->bDisabled = true; +} + +void ivug_listpopup_item_enabled_set(Ivug_ListPopup_Item *item) +{ + ListPopupItem *item_ = item; + + item_->bDisabled = false; + +} + +void *ivug_listpopup_item_get_data(Ivug_ListPopup_Item *item) +{ + ListPopupItem *item_ = (Ivug_ListPopup_Item *)item; + + return item_->data; +} + +const char *ivug_listpopup_item_get_text(Ivug_ListPopup_Item *item) +{ + ListPopupItem *item_ = (Ivug_ListPopup_Item *)item; + + return item_->caption; +} + +Elm_Object_Item *ivug_listpopup_item_get_item(Ivug_ListPopup_Item *item) +{ + ListPopupItem *item_ = (Ivug_ListPopup_Item *)item; + + return item_->item; +} + +void ivug_listpopup_title_set(Evas_Object *obj, const char* title) +{ + ListPopup *pListPopup = IV_LISTPOPUP(obj); + + MSG_ASSERT(title != NULL); + + pListPopup->title = eina_stringshare_add(title); + + MSG_MED("Popup title set : %s", title); +} + +void ivug_listpopup_button_set(Evas_Object *obj, const char* caption) +{ + ListPopup *pListPopup = IV_LISTPOPUP(obj); + + MSG_ASSERT(caption != NULL); + + pListPopup->caption = eina_stringshare_add(caption); + + MSG_MED("Popup caption set : %s", caption); +} + +bool ivug_listpopup_popup_show(Evas_Object *obj) +{ + ListPopup *pListPopup = IV_LISTPOPUP(obj); + + if ( pListPopup->popup ) + { + MSG_WARN("Previous popup is remained"); + } + + Evas_Object *popup; +// create popup + popup = elm_popup_add(pListPopup->parent); + + if (!popup) + { + MSG_ERROR("Error : popup create failed."); + return false; + } + + pListPopup->popup = popup; + + elm_object_style_set(popup, "min_menustyle"); + elm_object_part_text_set(popup, "title,text", pListPopup->title); + + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_weight_set(popup, EVAS_HINT_FILL, EVAS_HINT_FILL); + + Evas_Object *btn_close = NULL; + + if ( pListPopup->caption ) + { + btn_close = elm_button_add(popup); + elm_object_text_set(btn_close, pListPopup->caption); + elm_object_part_content_set(popup, "button1", btn_close); + } + +// create genlist + Evas_Object *genlist; + static Elm_Genlist_Item_Class itc = {0,}; + + genlist = elm_genlist_add(popup); + + itc.version = ELM_GENLIST_ITEM_CLASS_VERSION; + itc.item_style = "1text"; + itc.func.text_get = _on_label_set; + itc.func.content_get = NULL; + itc.func.state_get = NULL; + itc.func.del = _on_item_del; + + evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(genlist, EVAS_HINT_FILL, EVAS_HINT_FILL); + + int count = eina_list_count(pListPopup->list); + + ListPopupItem *pItem = NULL; + Eina_List *tmp; + Elm_Object_Item *gItem; + + EINA_LIST_FOREACH(pListPopup->list, tmp, pItem) + { + MSG_MED("Add popup item. %s", pItem->caption); + gItem = elm_genlist_item_append(genlist, &itc, pItem, NULL /* parent */, ELM_GENLIST_ITEM_NONE, _on_genlist_selected, pItem); + pItem->item = gItem; + + elm_object_item_disabled_set(gItem, pItem->bDisabled); + } + + +// Put together + +#define GET_POPUP_HEIGHT(icnt) (((113*icnt-1) > 408) ? (408) : (113*icnt-1)) +#define GET_POPUP_WIDTH(icnt) (614) + + Evas_Object *box; + box = elm_box_add(popup); + evas_object_size_hint_min_set(box, GET_POPUP_WIDTH(count) * elm_config_scale_get(), GET_POPUP_HEIGHT(count) * elm_config_scale_get()); + evas_object_show(genlist); + elm_box_pack_end(box, genlist); + elm_object_content_set(popup, box); + + if ( btn_close ) + { + evas_object_smart_callback_add(btn_close, "clicked", _on_popup_close, pListPopup); + } + + evas_object_event_callback_add(pListPopup->obj, EVAS_CALLBACK_DEL, _on_genpopup_deleted, pListPopup); + + MSG_HIGH("Show Genlist Popup"); + + evas_object_show(popup); + + return true; +} + + +bool ivug_listpopup_context_show(Evas_Object *obj, Evas_Object *hover, int x, int y) +{ + ListPopup *pListPopup = IV_LISTPOPUP(obj); + + if ( pListPopup->popup ) + { + MSG_WARN("Previous popup is remained"); + } + + Evas_Object* ctxpopup = NULL; + ctxpopup = elm_ctxpopup_add(obj); + + if (!ctxpopup) + { + MSG_ERROR("Error : popup create failed."); + return false; + } + + pListPopup->popup = ctxpopup; + + elm_ctxpopup_hover_parent_set(ctxpopup, hover); + + elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_DOWN, + ELM_CTXPOPUP_DIRECTION_UP, + ELM_CTXPOPUP_DIRECTION_RIGHT, + ELM_CTXPOPUP_DIRECTION_LEFT); + + + ListPopupItem *pItem = NULL; + Eina_List *tmp; + Elm_Object_Item *gItem; + + Evas_Object *icon; + + EINA_LIST_FOREACH(pListPopup->list, tmp, pItem) + { + MSG_MED("Add popup item. %s", pItem->caption); + + if ( pItem->iconpath ) + { + icon = elm_icon_add(ctxpopup); + elm_image_file_set(icon, pItem->iconpath, NULL); + } + else + { + icon = NULL; + } + + gItem = elm_ctxpopup_item_append(ctxpopup, pItem->caption, icon, _on_ctxpopup_selected, pItem); + pItem->item = gItem; + + elm_object_item_disabled_set(gItem, pItem->bDisabled); + } + + evas_object_event_callback_add(pListPopup->obj, EVAS_CALLBACK_DEL, _on_ctxpopup_deleted, pListPopup); + + evas_object_smart_callback_add(ctxpopup, "dismissed", _on_dismissed_cb, pListPopup); + + evas_object_move(ctxpopup, x, y); + + MSG_HIGH("Show Context Popup(%d,%d)", x, y); + + evas_object_show(ctxpopup); + + return true; +} + + -- 2.7.4