From 2b57430d83dbb459799bca77e75853a98b01e426 Mon Sep 17 00:00:00 2001 From: Sehong Na Date: Sat, 31 May 2014 12:55:37 +0900 Subject: [PATCH 1/1] Initialize Tizen 2.3 --- CMakeLists.txt | 181 ++ INSTALL | 33 + LICENSE.Flora | 206 ++ NOTICE | 4 + include/data/gl-data-type.h | 143 ++ include/data/gl-data-util.h | 59 + include/data/gl-data.h | 188 ++ include/data/gl-local-data.h | 99 + include/features/gl-albums-edit.h | 30 + include/features/gl-albums-new.h | 28 + include/features/gl-albums-rename.h | 31 + include/features/gl-albums-sel.h | 29 + include/features/gl-albums.h | 36 + include/features/gl-tags-edit.h | 29 + include/features/gl-tags-new.h | 28 + include/features/gl-tags-rename.h | 27 + include/features/gl-tags.h | 34 + include/features/gl-thumbs-edit.h | 30 + include/features/gl-thumbs-sel.h | 28 + include/features/gl-thumbs.h | 52 + include/gallery.h | 499 ++++ include/util/gl-debug.h | 151 ++ include/util/gl-drm.h | 30 + include/util/gl-exif.h | 58 + include/util/gl-ext-exec.h | 35 + include/util/gl-ext-ug-load.h | 53 + include/util/gl-fs.h | 61 + include/util/gl-icons.h | 44 + include/util/gl-lang.h | 36 + include/util/gl-strings.h | 115 + include/util/gl-thread-util.h | 38 + include/util/gl-ui-util.h | 133 + include/util/gl-util.h | 158 ++ include/widget/gl-button.h | 33 + include/widget/gl-controlbar.h | 45 + include/widget/gl-ctxpopup.h | 31 + include/widget/gl-editfield.h | 40 + include/widget/gl-nocontents.h | 35 + include/widget/gl-notify.h | 38 + include/widget/gl-popup.h | 45 + include/widget/gl-progressbar.h | 28 + include/widget/gl-rotate-bg.h | 32 + include/widget/gl-thumb.h | 38 + include/widget/gl-tile.h | 71 + org.tizen.gallery.manifest | 16 + org.tizen.gallery.rule | 214 ++ org.tizen.gallery.xml | 75 + packaging/org.tizen.gallery.spec | 104 + res/gallery.uri | 2 + res/icon/org.tizen.gallery.png | Bin 0 -> 57662 bytes res/po/CMakeLists.txt | 30 + res/po/POTFILES.in | 28 + res/po/ar.po | 63 + res/po/az.po | 63 + res/po/bg.po | 63 + res/po/ca.po | 63 + res/po/cs.po | 63 + res/po/da.po | 63 + res/po/de_DE.po | 63 + res/po/el_GR.po | 63 + res/po/en.po | 63 + res/po/en_PH.po | 63 + res/po/en_US.po | 63 + res/po/es_ES.po | 63 + res/po/es_MX.po | 63 + res/po/et.po | 63 + res/po/eu.po | 63 + res/po/fi.po | 63 + res/po/fr_CA.po | 63 + res/po/fr_FR.po | 63 + res/po/ga.po | 63 + res/po/gl.po | 63 + res/po/hi.po | 63 + res/po/hr.po | 63 + res/po/hu.po | 63 + res/po/hy.po | 63 + res/po/is.po | 63 + res/po/it_IT.po | 63 + res/po/ja_JP.po | 63 + res/po/ka.po | 63 + res/po/kk.po | 63 + res/po/ko_KR.po | 63 + res/po/lt.po | 63 + res/po/lv.po | 63 + res/po/mk.po | 63 + res/po/nb.po | 63 + res/po/nl_NL.po | 63 + res/po/pl.po | 63 + res/po/pt_BR.po | 63 + res/po/pt_PT.po | 63 + res/po/ro.po | 63 + res/po/ru_RU.po | 63 + res/po/sk.po | 63 + res/po/sl.po | 63 + res/po/sr.po | 63 + res/po/sv.po | 63 + res/po/tr_TR.po | 63 + res/po/uk.po | 63 + res/po/update-po.sh | 60 + res/po/uz.po | 63 + res/po/zh_CN.po | 63 + res/po/zh_HK.po | 63 + res/po/zh_SG.po | 63 + res/po/zh_TW.po | 63 + res/white_theme/edc/gallery-edc-res.h | 45 + res/white_theme/edc/gallery.edc | 572 +++++ res/white_theme/edc/gl-check.edc | 969 ++++++++ res/white_theme/edc/gl-entry.edc | 714 ++++++ res/white_theme/edc/gl-gengrid-item-albums.edc | 377 +++ res/white_theme/edc/gl-gengrid-item-thumbview.edc | 1014 ++++++++ res/white_theme/edc/gl-genlist-item-tags.edc | 873 +++++++ res/white_theme/edc/gl-genlist-sweep.edc | 371 +++ res/white_theme/edc/gl-nocontents.edc | 88 + res/white_theme/edc/images/00_EditField_clear.png | Bin 0 -> 3275 bytes .../edc/images/00_EditField_clear_press.png | Bin 0 -> 3278 bytes res/white_theme/edc/images/00_check_bg_dim.png | Bin 0 -> 2890 bytes .../edc/images/00_search_input_field_bg.png | Bin 0 -> 3130 bytes .../edc/images/00_winset_title_tabbar_bg.png | Bin 0 -> 3394 bytes .../edc/images/T01_Nocontents_picture.png | Bin 0 -> 7487 bytes res/white_theme/edc/images/T01_album_checkbox.png | Bin 0 -> 3151 bytes .../edc/images/T01_album_checkbox_check.png | Bin 0 -> 3223 bytes res/white_theme/edc/images/T01_btn_play.png | Bin 0 -> 2974 bytes res/white_theme/edc/images/T01_check.png | Bin 0 -> 3035 bytes res/white_theme/edc/images/T01_checkbox.png | Bin 0 -> 2944 bytes .../edc/images/T01_grid_select_check.png | Bin 0 -> 4247 bytes res/white_theme/edc/images/T01_main_folder_bg.png | Bin 0 -> 4436 bytes res/white_theme/edc/sounds/S_Touch_30ms.wav | Bin 0 -> 24740 bytes res/white_theme/images/T01_Nocontents_broken.png | Bin 0 -> 6301 bytes res/white_theme/images/T01_controlbar_icon_add.png | Bin 0 -> 3044 bytes .../images/T01_controlbar_icon_albums.png | Bin 0 -> 3075 bytes res/white_theme/images/T01_controlbar_icon_tag.png | Bin 0 -> 3572 bytes .../images/gallery_tag_default_thumbnail.png | Bin 0 -> 394 bytes .../images/gallery_tag_favorites_thumbnail.png | Bin 0 -> 5303 bytes .../images_edc/T01_btn_thumbnail_play.png | Bin 0 -> 6552 bytes res/white_theme/images_edc/T01_icon_lock.png | Bin 0 -> 8333 bytes .../images_edc/T01_icon_thumbnail_bookmark.png | Bin 0 -> 3807 bytes .../images_edc/T01_icon_thumbnail_favorite.png | Bin 0 -> 3974 bytes .../images_edc/T01_list_icon_bookmark.png | Bin 0 -> 5171 bytes res/white_theme/images_edc/gl-images.edc | 57 + src/data/gl-data-type.c | 149 ++ src/data/gl-data-util.c | 514 ++++ src/data/gl-data.c | 2494 +++++++++++++++++++ src/data/gl-local-data.c | 1479 ++++++++++++ src/features/gl-albums-edit.c | 318 +++ src/features/gl-albums-new.c | 238 ++ src/features/gl-albums-rename.c | 446 ++++ src/features/gl-albums-sel.c | 232 ++ src/features/gl-albums.c | 913 +++++++ src/features/gl-tags-edit.c | 301 +++ src/features/gl-tags-new.c | 204 ++ src/features/gl-tags-rename.c | 202 ++ src/features/gl-tags.c | 1000 ++++++++ src/features/gl-thumbs-edit.c | 488 ++++ src/features/gl-thumbs-sel.c | 226 ++ src/features/gl-thumbs.c | 921 +++++++ src/gallery.c | 1135 +++++++++ src/util/gl-debug.c | 142 ++ src/util/gl-drm.c | 83 + src/util/gl-exif.c | 1702 +++++++++++++ src/util/gl-ext-exec.c | 344 +++ src/util/gl-ext-ug-load.c | 909 +++++++ src/util/gl-fs.c | 683 ++++++ src/util/gl-lang.c | 255 ++ src/util/gl-thread-util.c | 658 +++++ src/util/gl-ui-util.c | 1101 +++++++++ src/util/gl-util.c | 2546 ++++++++++++++++++++ src/widget/gl-button.c | 94 + src/widget/gl-controlbar.c | 723 ++++++ src/widget/gl-ctxpopup.c | 401 +++ src/widget/gl-editfield.c | 502 ++++ src/widget/gl-nocontents.c | 211 ++ src/widget/gl-notify.c | 196 ++ src/widget/gl-popup.c | 314 +++ src/widget/gl-progressbar.c | 139 ++ src/widget/gl-rotate-bg.c | 394 +++ src/widget/gl-thumb.c | 252 ++ src/widget/gl-tile.c | 250 ++ ug-gallery-efl.manifest | 5 + ug.gallery-efl.include | 39 + ug/ug-gallery-efl/CMakeLists.txt | 102 + ug/ug-gallery-efl/include/gallery-efl.h | 259 ++ ug/ug-gallery-efl/include/ge-albums.h | 31 + ug/ug-gallery-efl/include/ge-button.h | 31 + ug/ug-gallery-efl/include/ge-data-type.h | 118 + ug/ug-gallery-efl/include/ge-data.h | 66 + ug/ug-gallery-efl/include/ge-debug.h | 126 + ug/ug-gallery-efl/include/ge-drm.h | 30 + ug/ug-gallery-efl/include/ge-exif.h | 56 + ug/ug-gallery-efl/include/ge-ext-ug-load.h | 28 + ug/ug-gallery-efl/include/ge-gridview.h | 29 + ug/ug-gallery-efl/include/ge-icon.h | 31 + ug/ug-gallery-efl/include/ge-lang.h | 35 + ug/ug-gallery-efl/include/ge-local-data.h | 59 + ug/ug-gallery-efl/include/ge-rotate-bg.h | 32 + ug/ug-gallery-efl/include/ge-strings.h | 59 + ug/ug-gallery-efl/include/ge-thumb.h | 29 + ug/ug-gallery-efl/include/ge-tile.h | 58 + ug/ug-gallery-efl/include/ge-ui-util.h | 65 + ug/ug-gallery-efl/include/ge-util.h | 37 + ug/ug-gallery-efl/res/edc/gallery-efl-check.edc | 381 +++ ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h | 30 + .../res/edc/gallery-efl-gengrid-item-albums.edc | 188 ++ .../res/edc/gallery-efl-gengrid-item-thumbview.edc | 931 +++++++ .../res/edc/gallery-efl-nocontents.edc | 89 + ug/ug-gallery-efl/res/edc/gallery-efl.edc | 152 ++ .../res/edc/images/T01_Nocontents_picture.png | Bin 0 -> 7487 bytes ug/ug-gallery-efl/res/edc/images/T01_btn_play.png | Bin 0 -> 2974 bytes .../res/edc/images/T01_grid_select_check.png | Bin 0 -> 4247 bytes .../res/edc/images/T01_main_folder_bg.png | Bin 0 -> 4436 bytes .../res/images/T01_Nocontents_broken.png | Bin 0 -> 4880 bytes ug/ug-gallery-efl/res/images/T01_icon_lock.png | Bin 0 -> 8333 bytes .../res/images/T01_icon_thumbnail_bookmark.png | Bin 0 -> 3807 bytes .../res/images/T01_icon_thumbnail_favorite.png | Bin 0 -> 3974 bytes ug/ug-gallery-efl/src/gallery-efl.c | 661 +++++ ug/ug-gallery-efl/src/ge-albums.c | 648 +++++ ug/ug-gallery-efl/src/ge-button.c | 68 + ug/ug-gallery-efl/src/ge-data-type.c | 146 ++ ug/ug-gallery-efl/src/ge-data.c | 988 ++++++++ ug/ug-gallery-efl/src/ge-debug.c | 26 + ug/ug-gallery-efl/src/ge-drm.c | 84 + ug/ug-gallery-efl/src/ge-exif.c | 1361 +++++++++++ ug/ug-gallery-efl/src/ge-ext-ug-load.c | 284 +++ ug/ug-gallery-efl/src/ge-gridview.c | 714 ++++++ ug/ug-gallery-efl/src/ge-lang.c | 180 ++ ug/ug-gallery-efl/src/ge-local-data.c | 612 +++++ ug/ug-gallery-efl/src/ge-rotate-bg.c | 396 +++ ug/ug-gallery-efl/src/ge-thumb.c | 181 ++ ug/ug-gallery-efl/src/ge-tile.c | 125 + ug/ug-gallery-efl/src/ge-ui-util.c | 561 +++++ ug/ug-gallery-efl/src/ge-util.c | 308 +++ ug/ug-gallery-efl/ug-gallery-efl.xml | 60 + 231 files changed, 45622 insertions(+) create mode 100755 CMakeLists.txt create mode 100755 INSTALL create mode 100755 LICENSE.Flora create mode 100755 NOTICE create mode 100755 include/data/gl-data-type.h create mode 100755 include/data/gl-data-util.h create mode 100755 include/data/gl-data.h create mode 100755 include/data/gl-local-data.h create mode 100755 include/features/gl-albums-edit.h create mode 100755 include/features/gl-albums-new.h create mode 100755 include/features/gl-albums-rename.h create mode 100755 include/features/gl-albums-sel.h create mode 100755 include/features/gl-albums.h create mode 100755 include/features/gl-tags-edit.h create mode 100755 include/features/gl-tags-new.h create mode 100755 include/features/gl-tags-rename.h create mode 100755 include/features/gl-tags.h create mode 100755 include/features/gl-thumbs-edit.h create mode 100755 include/features/gl-thumbs-sel.h create mode 100755 include/features/gl-thumbs.h create mode 100755 include/gallery.h create mode 100755 include/util/gl-debug.h create mode 100755 include/util/gl-drm.h create mode 100755 include/util/gl-exif.h create mode 100755 include/util/gl-ext-exec.h create mode 100755 include/util/gl-ext-ug-load.h create mode 100755 include/util/gl-fs.h create mode 100755 include/util/gl-icons.h create mode 100755 include/util/gl-lang.h create mode 100755 include/util/gl-strings.h create mode 100755 include/util/gl-thread-util.h create mode 100755 include/util/gl-ui-util.h create mode 100755 include/util/gl-util.h create mode 100755 include/widget/gl-button.h create mode 100755 include/widget/gl-controlbar.h create mode 100755 include/widget/gl-ctxpopup.h create mode 100755 include/widget/gl-editfield.h create mode 100755 include/widget/gl-nocontents.h create mode 100755 include/widget/gl-notify.h create mode 100755 include/widget/gl-popup.h create mode 100755 include/widget/gl-progressbar.h create mode 100755 include/widget/gl-rotate-bg.h create mode 100755 include/widget/gl-thumb.h create mode 100755 include/widget/gl-tile.h create mode 100644 org.tizen.gallery.manifest create mode 100755 org.tizen.gallery.rule create mode 100755 org.tizen.gallery.xml create mode 100644 packaging/org.tizen.gallery.spec create mode 100755 res/gallery.uri create mode 100755 res/icon/org.tizen.gallery.png create mode 100755 res/po/CMakeLists.txt create mode 100755 res/po/POTFILES.in 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 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/update-po.sh 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 res/white_theme/edc/gallery-edc-res.h create mode 100755 res/white_theme/edc/gallery.edc create mode 100755 res/white_theme/edc/gl-check.edc create mode 100755 res/white_theme/edc/gl-entry.edc create mode 100755 res/white_theme/edc/gl-gengrid-item-albums.edc create mode 100755 res/white_theme/edc/gl-gengrid-item-thumbview.edc create mode 100755 res/white_theme/edc/gl-genlist-item-tags.edc create mode 100755 res/white_theme/edc/gl-genlist-sweep.edc create mode 100755 res/white_theme/edc/gl-nocontents.edc create mode 100755 res/white_theme/edc/images/00_EditField_clear.png create mode 100755 res/white_theme/edc/images/00_EditField_clear_press.png create mode 100755 res/white_theme/edc/images/00_check_bg_dim.png create mode 100755 res/white_theme/edc/images/00_search_input_field_bg.png create mode 100755 res/white_theme/edc/images/00_winset_title_tabbar_bg.png create mode 100755 res/white_theme/edc/images/T01_Nocontents_picture.png create mode 100755 res/white_theme/edc/images/T01_album_checkbox.png create mode 100755 res/white_theme/edc/images/T01_album_checkbox_check.png create mode 100755 res/white_theme/edc/images/T01_btn_play.png create mode 100755 res/white_theme/edc/images/T01_check.png create mode 100755 res/white_theme/edc/images/T01_checkbox.png create mode 100755 res/white_theme/edc/images/T01_grid_select_check.png create mode 100755 res/white_theme/edc/images/T01_main_folder_bg.png create mode 100755 res/white_theme/edc/sounds/S_Touch_30ms.wav create mode 100755 res/white_theme/images/T01_Nocontents_broken.png create mode 100755 res/white_theme/images/T01_controlbar_icon_add.png create mode 100755 res/white_theme/images/T01_controlbar_icon_albums.png create mode 100755 res/white_theme/images/T01_controlbar_icon_tag.png create mode 100755 res/white_theme/images/gallery_tag_default_thumbnail.png create mode 100755 res/white_theme/images/gallery_tag_favorites_thumbnail.png create mode 100755 res/white_theme/images_edc/T01_btn_thumbnail_play.png create mode 100755 res/white_theme/images_edc/T01_icon_lock.png create mode 100755 res/white_theme/images_edc/T01_icon_thumbnail_bookmark.png create mode 100755 res/white_theme/images_edc/T01_icon_thumbnail_favorite.png create mode 100755 res/white_theme/images_edc/T01_list_icon_bookmark.png create mode 100755 res/white_theme/images_edc/gl-images.edc create mode 100755 src/data/gl-data-type.c create mode 100755 src/data/gl-data-util.c create mode 100755 src/data/gl-data.c create mode 100755 src/data/gl-local-data.c create mode 100755 src/features/gl-albums-edit.c create mode 100755 src/features/gl-albums-new.c create mode 100755 src/features/gl-albums-rename.c create mode 100755 src/features/gl-albums-sel.c create mode 100755 src/features/gl-albums.c create mode 100755 src/features/gl-tags-edit.c create mode 100755 src/features/gl-tags-new.c create mode 100755 src/features/gl-tags-rename.c create mode 100755 src/features/gl-tags.c create mode 100755 src/features/gl-thumbs-edit.c create mode 100755 src/features/gl-thumbs-sel.c create mode 100755 src/features/gl-thumbs.c create mode 100755 src/gallery.c create mode 100755 src/util/gl-debug.c create mode 100755 src/util/gl-drm.c create mode 100755 src/util/gl-exif.c create mode 100755 src/util/gl-ext-exec.c create mode 100755 src/util/gl-ext-ug-load.c create mode 100755 src/util/gl-fs.c create mode 100755 src/util/gl-lang.c create mode 100755 src/util/gl-thread-util.c create mode 100755 src/util/gl-ui-util.c create mode 100755 src/util/gl-util.c create mode 100755 src/widget/gl-button.c create mode 100755 src/widget/gl-controlbar.c create mode 100755 src/widget/gl-ctxpopup.c create mode 100755 src/widget/gl-editfield.c create mode 100755 src/widget/gl-nocontents.c create mode 100755 src/widget/gl-notify.c create mode 100755 src/widget/gl-popup.c create mode 100755 src/widget/gl-progressbar.c create mode 100755 src/widget/gl-rotate-bg.c create mode 100755 src/widget/gl-thumb.c create mode 100755 src/widget/gl-tile.c create mode 100755 ug-gallery-efl.manifest create mode 100755 ug.gallery-efl.include create mode 100755 ug/ug-gallery-efl/CMakeLists.txt create mode 100755 ug/ug-gallery-efl/include/gallery-efl.h create mode 100755 ug/ug-gallery-efl/include/ge-albums.h create mode 100755 ug/ug-gallery-efl/include/ge-button.h create mode 100755 ug/ug-gallery-efl/include/ge-data-type.h create mode 100755 ug/ug-gallery-efl/include/ge-data.h create mode 100755 ug/ug-gallery-efl/include/ge-debug.h create mode 100755 ug/ug-gallery-efl/include/ge-drm.h create mode 100755 ug/ug-gallery-efl/include/ge-exif.h create mode 100755 ug/ug-gallery-efl/include/ge-ext-ug-load.h create mode 100755 ug/ug-gallery-efl/include/ge-gridview.h create mode 100755 ug/ug-gallery-efl/include/ge-icon.h create mode 100755 ug/ug-gallery-efl/include/ge-lang.h create mode 100755 ug/ug-gallery-efl/include/ge-local-data.h create mode 100755 ug/ug-gallery-efl/include/ge-rotate-bg.h create mode 100755 ug/ug-gallery-efl/include/ge-strings.h create mode 100755 ug/ug-gallery-efl/include/ge-thumb.h create mode 100755 ug/ug-gallery-efl/include/ge-tile.h create mode 100755 ug/ug-gallery-efl/include/ge-ui-util.h create mode 100755 ug/ug-gallery-efl/include/ge-util.h create mode 100755 ug/ug-gallery-efl/res/edc/gallery-efl-check.edc create mode 100755 ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h create mode 100755 ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc create mode 100755 ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc create mode 100755 ug/ug-gallery-efl/res/edc/gallery-efl-nocontents.edc create mode 100755 ug/ug-gallery-efl/res/edc/gallery-efl.edc create mode 100755 ug/ug-gallery-efl/res/edc/images/T01_Nocontents_picture.png create mode 100755 ug/ug-gallery-efl/res/edc/images/T01_btn_play.png create mode 100755 ug/ug-gallery-efl/res/edc/images/T01_grid_select_check.png create mode 100755 ug/ug-gallery-efl/res/edc/images/T01_main_folder_bg.png create mode 100755 ug/ug-gallery-efl/res/images/T01_Nocontents_broken.png create mode 100755 ug/ug-gallery-efl/res/images/T01_icon_lock.png create mode 100755 ug/ug-gallery-efl/res/images/T01_icon_thumbnail_bookmark.png create mode 100755 ug/ug-gallery-efl/res/images/T01_icon_thumbnail_favorite.png create mode 100755 ug/ug-gallery-efl/src/gallery-efl.c create mode 100755 ug/ug-gallery-efl/src/ge-albums.c create mode 100755 ug/ug-gallery-efl/src/ge-button.c create mode 100755 ug/ug-gallery-efl/src/ge-data-type.c create mode 100755 ug/ug-gallery-efl/src/ge-data.c create mode 100755 ug/ug-gallery-efl/src/ge-debug.c create mode 100755 ug/ug-gallery-efl/src/ge-drm.c create mode 100755 ug/ug-gallery-efl/src/ge-exif.c create mode 100755 ug/ug-gallery-efl/src/ge-ext-ug-load.c create mode 100755 ug/ug-gallery-efl/src/ge-gridview.c create mode 100755 ug/ug-gallery-efl/src/ge-lang.c create mode 100755 ug/ug-gallery-efl/src/ge-local-data.c create mode 100755 ug/ug-gallery-efl/src/ge-rotate-bg.c create mode 100755 ug/ug-gallery-efl/src/ge-thumb.c create mode 100755 ug/ug-gallery-efl/src/ge-tile.c create mode 100755 ug/ug-gallery-efl/src/ge-ui-util.c create mode 100755 ug/ug-gallery-efl/src/ge-util.c create mode 100755 ug/ug-gallery-efl/ug-gallery-efl.xml diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..9aa96fe --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,181 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(gallery C) + +SET(RSRC_DIR res) + +SET(EDC_DIR white_theme/edc) +SET(IMG_DIR white_theme/edc/images) +SET(SOUND_DIR white_theme/edc/sounds) +SET(IMG_EDC_DIR white_theme/images_edc) + +SET(SRCS src/gallery.c + src/features/gl-albums.c + src/features/gl-albums-edit.c + src/features/gl-albums-new.c + src/features/gl-albums-sel.c + src/features/gl-thumbs.c + src/features/gl-thumbs-edit.c + src/features/gl-thumbs-sel.c + src/features/gl-tags.c + src/features/gl-tags-edit.c + src/features/gl-tags-new.c + src/features/gl-tags-rename.c + src/features/gl-albums-rename.c + src/widget/gl-button.c + src/widget/gl-controlbar.c + src/widget/gl-editfield.c + src/widget/gl-nocontents.c + src/widget/gl-notify.c + src/widget/gl-popup.c + src/widget/gl-ctxpopup.c + src/widget/gl-progressbar.c + src/widget/gl-rotate-bg.c + src/widget/gl-tile.c + src/widget/gl-thumb.c + src/util/gl-debug.c + src/util/gl-fs.c + src/util/gl-ui-util.c + src/util/gl-ext-exec.c + src/util/gl-ext-ug-load.c + src/util/gl-util.c + src/util/gl-drm.c + src/util/gl-thread-util.c + src/util/gl-lang.c + src/util/gl-exif.c + src/data/gl-data-type.c + src/data/gl-data.c + src/data/gl-data-util.c + src/data/gl-local-data.c +) + +SET(VENDOR "tizen") +SET(PACKAGE ${PROJECT_NAME}) +SET(PKGNAME "org.${VENDOR}.gallery") +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(BINDIR "${PREFIX}/bin") +SET(RESDIR "${PREFIX}/res") +SET(DATADIR "${PREFIX}/data") +SET(LOCALEDIR "${RESDIR}/locale") +SET(ICONDIR "/usr/share/icons/default/small") +SET(EDJDIR "${RESDIR}/edje") + +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") +MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/data) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/util) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/widget) +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/features) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + capi-content-media-content + drm-client + ui-gadget-1 + elementary + ecore-imf + ecore-x + eina + evas + edje + vconf + ecore + ecore-file + ecore-input + dlog + glib-2.0 + gthread-2.0 + capi-appfw-application + capi-appfw-app-manager + haptic + utilX + notification +) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fpie") +SET(CMAKE_C_FLAGS_RELEASE "-O2 -fpie") + +FIND_PROGRAM(UNAME NAMES uname) +EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") +IF("${ARCH}" MATCHES "arm") + ADD_DEFINITIONS("-DTARGET") + MESSAGE("add -DTARGET") +ENDIF("${ARCH}" MATCHES "arm") + +ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"") +ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") +ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"") +ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") +ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"") +ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"") +ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"") +ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"") +ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") + +ADD_DEFINITIONS("-D_USE_DLOG_") +ADD_DEFINITIONS("-D_USE_ROTATE_BG") +ADD_DEFINITIONS("-D_RENAME_ALBUM_SENSITIVE") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") +SET(CMAKE_LDFLAGS "-Wl,-zdefs" ) + +ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lstdc++ ) + +ADD_CUSTOM_COMMAND(OUTPUT gallery.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${IMG_DIR} + -sd ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${SOUND_DIR} + ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${EDC_DIR}/gallery.edc ${CMAKE_BINARY_DIR}/gallery.edj + DEPENDS ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${EDC_DIR}/gallery.edc +) + +ADD_CUSTOM_COMMAND(OUTPUT gl-images.edj + COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${IMG_EDC_DIR} + ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${IMG_EDC_DIR}/gl-images.edc ${CMAKE_BINARY_DIR}/gl-images.edj + DEPENDS ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${IMG_EDC_DIR}/gl-images.edc +) + +ADD_CUSTOM_TARGET(edj_build DEPENDS gallery.edj gl-images.edj) + +ADD_DEPENDENCIES(${PROJECT_NAME} edj_build) + +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/gallery.edj DESTINATION ${EDJDIR}) +INSTALL(FILES ${CMAKE_BINARY_DIR}/gl-images.edj DESTINATION ${EDJDIR}) + +# install manifest file & icon +INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.xml DESTINATION /usr/share/packages) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/icon/${PKGNAME}.png DESTINATION ${ICONDIR}) + +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/white_theme/images DESTINATION ${RESDIR}) + +# install content shortcut uri file +INSTALL(FILES ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/gallery.uri DESTINATION /usr/share/miregex) + +# install application HOME directory +INSTALL(DIRECTORY DESTINATION /opt/usr/apps/${PKGNAME}/data) + +# Share APP mo files with Gallery UG +SET(GALLERY_UG_PROJECT_NAME ug-gallery-efl) + +# install smack rule file +INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.gallery.rule DESTINATION /etc/smack/accesses.d) + +# install ug smack include file +INSTALL(FILES ${CMAKE_SOURCE_DIR}/ug.gallery-efl.include DESTINATION /etc/smack/accesses2.d) + +# i18n +ADD_SUBDIRECTORY(res/po) + +# UG +ADD_SUBDIRECTORY(ug/ug-gallery-efl) + diff --git a/INSTALL b/INSTALL new file mode 100755 index 0000000..3f81c54 --- /dev/null +++ b/INSTALL @@ -0,0 +1,33 @@ +1. make the build directory + + ex) + + $ mkdir build + + +2. change the working directory to the build directory + + ex) + + $ cd build + + +3. run 'cmake' + + $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/opt/apps/@@PKGNAME@@ + + ex) + + $ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/apps/@@PKGNAME@@ + + or + + $ cmake .. + + +4. make & make install + + ex) + + $ make -j 2 && make install + 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..2116819 --- /dev/null +++ b/NOTICE @@ -0,0 +1,4 @@ +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/include/data/gl-data-type.h b/include/data/gl-data-type.h new file mode 100755 index 0000000..5e96a96 --- /dev/null +++ b/include/data/gl-data-type.h @@ -0,0 +1,143 @@ +/* + * Copyright (c) 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 _GL_DATA_TYPE_H_ +#define _GL_DATA_TYPE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _cplusplus +extern "C" +{ +#endif + + +#define GL_FREEIF(ptr) \ + do { \ + if(ptr != NULL) \ + { \ + free(ptr); \ + ptr = NULL; \ + } \ + } while (0) + +#define GL_FREE(ptr) \ + do { \ + free(ptr); \ + ptr = NULL; \ + } while (0) + +#define GL_TYPE_ALBUM (0x55551) +#define GL_TYPE_TAG (0x55552) +#define GL_TYPE_MEDIA (0x55553) + +typedef enum { + GL_STORE_T_PHONE = 0, /**< Stored only in phone */ + GL_STORE_T_MMC, /**< Stored only in MMC */ + GL_STORE_T_ALL, /**< Stored only in All albums album */ +} gl_store_type_e; + + +typedef struct _gl_album_t gl_album_s; +typedef struct _gl_media_t gl_media_s; +typedef struct _gl_image_t gl_image_s; +typedef struct _gl_video_t gl_video_s; +typedef struct _gl_tag_t gl_tag_s; + +struct _gl_album_t { + int gtype; /*self-defination type, when free this struct space, use it*/ + media_folder_h folder_h; /*the handle of operating this folder*/ + char *uuid; /*folder UUID*/ + char *display_name; /*album name*/ + char *path; /*the full path of this folder*/ + int type; /*storage type*/ + time_t mtime; /*modified time*/ + int count; /*the media count in this folder*/ + void *_reserved; /*reserved*/ +}; + +struct _gl_media_t { + int gtype; /*self-defination type, when free this struct space, use it*/ + media_info_h media_h; /*the handle of operating this media*/ + char *uuid; /*meida id*/ + int type; /*meida type, image or video*/ + char *thumb_url; /*the thumbnail full path of this meida file*/ + char *file_url; /*the full path of this meida file*/ + time_t mtime; /*modified time*/ + char *album_uuid; /*folder UUID*/ + char *display_name; /*item name*/ + bool favorite; /*favorite level*/ + + char *ext; + + union { + gl_image_s *image_info; /*image information*/ + gl_video_s *video_info; /*video information*/ + }; + + void *_reserved; /*reserved*/ +}; + +struct _gl_image_t { + char *media_uuid; /*media uuid*/ + image_meta_h image_h; /*the handle of operating this image*/ + int orientation; /*the orientation of this image*/ + + void *_reserved; /*reserved*/ +}; + +struct _gl_video_t { + char *media_uuid; /*media uuid*/ + video_meta_h video_h; /*the handle of operating this video*/ + char *title; /*the title of video*/ + time_t last_played_pos; /*the last played position*/ + int duration; /*the duration of this video*/ + int bookmarks; /*whether exist bookmarks*/ + + void *_reserved; /*reserved*/ +}; + +struct _gl_tag_t { + int gtype; /*self-defination type, when free this struct space, use it*/ + media_tag_h tag_h; /*the handle of operating this tag */ + int _id; /*tag id */ + char *tag_name; /*tag name */ + int count; /*the media count included into this tag*/ + + void *_reserved; /*reserved*/ +}; + +int _gl_data_type_new_tag(gl_tag_s **t_item); +int _gl_data_type_new_album(gl_album_s **album); + +int _gl_data_type_free_tag_list(Eina_List **list); +int _gl_data_type_free_glitem(void **item); + +#ifdef _cplusplus +} +#endif + + +#endif /* _GL_DATA_TYPE_H_ */ + diff --git a/include/data/gl-data-util.h b/include/data/gl-data-util.h new file mode 100755 index 0000000..ecb6e5b --- /dev/null +++ b/include/data/gl-data-util.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 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 _GL_DATA_UTIL_H_ +#define _GL_DATA_UTIL_H_ + +#include +#include +#include +#include "gl-data.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +bool _gl_data_util_get_file_dir_name(const char *file_path, char *filename, + char *dir_name, char *dir_path); +gl_item *_gl_data_util_calloc_gitem(void); +int _gl_data_util_free_gitem(gl_item *gitem); +gl_cluster *_gl_data_util_calloc_gcluster(void); +int _gl_data_util_free_gcluster(gl_cluster *gcluster); +gl_cluster *_gl_data_util_new_gcluster_all(void *data, int count); +gl_cluster_list *_gl_data_util_calloc_cluster_list(void); +gl_tag *_gl_data_util_calloc_gtag(void); +int _gl_data_util_free_gtag(gl_tag *gtag); +int _gl_data_util_clear_gtype_item_list(Eina_List **elist); +int _gl_data_util_clear_item_list(Eina_List **elist); +int _gl_data_util_get_selected_cluster_id_list(void *data, + Eina_List **sel_id_list); +int _gl_data_util_get_selected_item_id_list(void *data, + Eina_List **sel_id_list); +bool _gl_data_util_check_selected_id(Eina_List **sel_id_list, const char *id); +int _gl_data_util_free_selected_id_list(Eina_List **sel_id_list); +int _gl_data_util_check_album_selected_files(gl_cluster *album, int *drm_cnt, + int *img_cnt, int *sel_cnt); +int _gl_data_util_check_tag_selected_files(void *data, int *drm_cnt, + int *img_cnt, int *sel_cnt); +int _gl_data_util_free_tag_list(void *data); +gl_tag *_gl_data_util_get_favor_tag(void *data); + +#ifdef _cplusplus +} +#endif +#endif /* _GL_DATA_UTIL_H_ */ + diff --git a/include/data/gl-data.h b/include/data/gl-data.h new file mode 100755 index 0000000..69506e8 --- /dev/null +++ b/include/data/gl-data.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 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 _GL_DATA_H_ +#define _GL_DATA_H_ + +#include +#include +#include +#include "gl-local-data.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +/* Specified ID for customed items, which don't exist in DB */ +#define GL_TAG_FAVORITES_ID 0 +#define GL_ALBUM_ALL_ID "GALLERY_ALBUM_ALL_ALBUMS_ID" + +#define GL_MAX_BYTES_FOR_CHAR 3 +#define GL_FILE_PATH_LEN_MAX (4095 * GL_MAX_BYTES_FOR_CHAR + 1) +#define GL_FILE_NAME_LEN_MAX (255 * GL_MAX_BYTES_FOR_CHAR + 1) +#define GL_DIR_PATH_LEN_MAX GL_FILE_PATH_LEN_MAX +#define GL_ARRAY_LEN_MAX 256 +#define GL_FILE_EXT_LEN_MAX 256 +#define GL_FIRST_VIEW_START_POS 0 +#define GL_FIRST_VIEW_END_POS 47 //27 /*maybe 2 pages(=48 medias) is better, especially select album then drag up immediately */ +#define GL_GET_UNTIL_LAST_RECORD 65536 //-1 /* Fixme: Do not use 65536. */ +#define GL_GET_ALL_RECORDS -1 +#define GL_GET_ONE_RECORDS 1 +#define GL_GET_ALL_RECORDS_ID NULL +#define GL_JPEG_FILE_EXT "jpg" + +typedef enum +{ + GL_CATEGORY_NONE, + GL_CATEGORY_FOLDER, + GL_CATEGORY_FAVORITES, + GL_CATEGORY_MAX +} gl_cate_type; + +typedef enum{ + GL_SORT_BY_NONE, /**< No Sort */ + GL_SORT_BY_NAME_DESC, /**< Sort by display name descending */ + GL_SORT_BY_NAME_ASC, /**< Sort by display name ascending */ + GL_SORT_BY_DATE_DESC, /**< Sort by modified_date descending */ + GL_SORT_BY_DATE_ASC, /**< Sort by modified_date ascending */ +} gl_sort_type_e; + +typedef struct +{ + gl_album_s *cluster; + int index; + Elm_Object_Item *item; + bool checked; + + void *ad; /* Save ad to prevent use global variable */ + void *_reserved; +} gl_cluster; + +typedef struct +{ + Eina_List *clist; + /* Editable albums count */ + int edit_cnt; +} gl_cluster_list; + +typedef enum +{ + GL_ICON_NORMAL, + GL_ICON_EXPIRED_DRM, + GL_ICON_CORRUPTED_FILE +}gl_icon_type; + +typedef struct _gl_item +{ + gl_media_s *item; + Elm_Object_Item *elm_item; + Evas_Object *check_obj; + bool checked; + int sequence; + int store_type; + void *ad; /* Save ad to prevent use global variable */ + void *_reserved; +} gl_item; + +typedef struct +{ + gl_tag_s *tag; + Elm_Object_Item *item; + Evas_Object *check_obj; + bool checked; + bool cover_set; + void *ad; /* Save ad to prevent use global variable */ + void *_reserved; +} gl_tag; + +bool _gl_data_get_cluster_list(void *data); +int _gl_data_update_cluster_list(void *data); +int _gl_data_get_cluster_by_id(void *data, const char *cluster_id, + gl_cluster **cluster); +int _gl_data_get_cluster_by_path(void *data, const char *path, + gl_cluster **cluster); +int _gl_data_get_item_cnt(void *data, const char *cluster_id, bool b_favor, + int album_type, int *item_cnt); +int _gl_data_update_item_cnt(gl_cluster *album); +int _gl_data_update_item_list(void *data); +int _gl_data_get_item_list(void *data, gl_cate_type mode, gl_cluster *album, + int start_pos, int end_pos); +bool _gl_data_is_item_cnt_zero(void *data, media_content_type_e type); +int _gl_data_get_first_item(void *data, media_content_type_e type, + gl_item **fitem, bool b_selected); +int _gl_data_clear_default_item_list(void *data); +int _gl_data_get_item_list_without_tag(void *data, gl_cluster *album, + const char *tag_name, int start_pos, + int end_pos); +int _gl_data_update_item_list_without_tag(void *data, gl_cluster *album, + const char *tag_name); +int _gl_data_get_first_several_favor_items(void *data, gl_item *items[], + int *item_count, + media_content_order_e sort_type); +int _gl_data_get_first_several_items(gl_cluster *album, gl_item *items[], + int *item_count, + media_content_order_e sort_type); +int _gl_data_destroy_item(gl_item *gitem); +int _gl_data_get_item_by_index(void *data, int idx, bool select_mode, + gl_item **gitem); +int _gl_data_get_orig_item_by_index(void *data, gl_item **gitem, int idx); +int _gl_data_item_list_remove(void *data, gl_item *gitem); +int _gl_data_remove_item(gl_item * gitem); +int _gl_data_selected_list_append(void *data, gl_item *gitem); +int _gl_data_selected_list_remove(void *data, gl_item *gitem); +gl_item *_gl_data_selected_list_get_nth(void *data, int idx); +int _gl_data_selected_list_finalize(void *data); +int _gl_data_selected_list_count(void *data); +bool _gl_data_is_albums_selected_empty(void *data); +int _gl_data_get_albums_selected_files_path_str(void *data, gchar sep_c, + char **path_str, int *sel_cnt); +int _gl_data_get_albums_selected_cnt(void *data); +int _gl_data_albums_selected_list_append(void *data, gl_cluster *item); +int _gl_data_albums_selected_list_remove(void *data, gl_cluster *item); +int _gl_data_finalize_albums_selected_list(void *data); +bool _gl_data_check_update(void *data, bool b_all); +int _gl_data_init(); +int _gl_data_finalize(void *data); +gl_cluster *_gl_data_new_cluster(void); +bool _gl_data_is_root_path(const char *path); +bool _gl_data_is_default_album(const char *match_folder, gl_album_s *album); +int _gl_data_get_tag_by_index(void *data, gl_tag **tag, int idx); +int _gl_data_get_first_several_tag_items(void *data, unsigned tag_id, + gl_item *items[], int *item_count); +bool _gl_data_is_in_tag_list(void *data, const char *tagname); +int _gl_data_get_tag_count_all(void *data); +int _gl_data_get_tag_list(void *data, Eina_List **elist); +int _gl_data_update_tag_list(void *data, Eina_List **elist); +int _gl_data_tags_list_remove(void *data, gl_tag *gtag); +int _gl_data_get_tag_by_id(void *data, int tag_id, gl_tag **gtag); +int _gl_data_get_item_list_tagname(void *data, unsigned int tag_id, + bool with_meta, Eina_List ** elist); +int _gl_data_tags_selected_list_append(void *data, gl_tag *gtag); +int _gl_data_tags_selected_list_remove(void *data, gl_tag *gtag); +int _gl_data_finalize_tags_selected_list(void *data); +int _gl_data_get_tags_selected_cnt(void *data); +bool _gl_data_is_tags_selected_empty(void *data); +int _gl_data_get_tags_selected_files_path_str(void *data, gchar sep_c, + char **path_str, int *sel_cnt); +int _gl_data_delete_media(void *data, gl_media_s *media_item); +int _gl_data_create_thumb(gl_item *gitem, media_thumbnail_completed_cb callback, + void *user_data); + +#ifdef _cplusplus +} +#endif +#endif /* _GL_DATA_H_ */ diff --git a/include/data/gl-local-data.h b/include/data/gl-local-data.h new file mode 100755 index 0000000..1b6c2e8 --- /dev/null +++ b/include/data/gl-local-data.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 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 _GL_LOCAL_DATA_H_ +#define _GL_LOCAL_DATA_H_ + +#include "gl-data-type.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + + +/*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music*/ +#define GL_CONDITION_IMAGE_VIDEO "(MEDIA_TYPE=0 OR MEDIA_TYPE=1)" +#define GL_CONDITION_WITHOUT_TAG "((MEDIA_TYPE=0 OR MEDIA_TYPE=1) AND (media_uuid NOT IN (SELECT media_uuid FROM tag_map WHERE tag_id=%d)))" +#define GL_CONDITION_WITHOUT_FAVOURITE "((MEDIA_TYPE=0 OR MEDIA_TYPE=1) AND (FAVOURITE=0))" +#define GL_CONDITION_IMAGE "(MEDIA_TYPE=0)" +#define GL_CONDITION_VIDEO "(MEDIA_TYPE=1)" +#define GL_CONDITION_TAG_NAME "(TAG_NAME=\'%s\')" +/**< 0-not favourite, 1-favourite*/ +#define GL_CONDITION_FAV_IMAGE_VIDEO "((MEDIA_TYPE=0 OR MEDIA_TYPE=1) AND MEDIA_FAVORITE=1)" +#define GL_CONDITION_TAG NULL + + +#define CONDITION_LENGTH 200 +#define KEYWORD_LENGTH 20 + +typedef struct _gl_filter_t gl_filter_s; + +struct _gl_filter_t { + char cond[CONDITION_LENGTH]; /*set media type or favorite type, or other query statement*/ + media_content_collation_e collate_type; /*collate type*/ + media_content_order_e sort_type; /*sort type*/ + char sort_keyword[KEYWORD_LENGTH]; /*sort keyword*/ + int offset; /*offset*/ + int count; /*count*/ + bool with_meta; /*whether get image or video info*/ +}; + +int _gl_local_data_connect(void); +int _gl_local_data_disconnect(void); +int _gl_local_data_get_album_by_path(char *path, gl_album_s **album); +int _gl_local_data_get_album_list(gl_filter_s *condition, Eina_List **elist); +int _gl_local_data_get_media_by_path(const char *path, gl_media_s **mitem); +int _gl_local_data_get_media_count(const char *cluster_id, gl_filter_s *condition, + int *item_cnt); +int _gl_local_data_get_all_media_count(gl_filter_s *filter, int *item_cnt); +int _gl_local_data_get_album_media_list(gl_filter_s *condition, + const char *album_id, Eina_List **elist); +int _gl_local_data_get_all_albums_media_list(gl_filter_s *condition, + Eina_List **elist); +int _gl_local_data_get_album_media_list_without_tag(gl_filter_s *condition, + const char *album_id, + const char *tag_name, + Eina_List **elist); +int _gl_local_data_get_media_count_wichout_tag(int tag_id, char *album_uuid); +int _gl_local_data_get_all_albums_media_list_without_tag(gl_filter_s *condition, + const char *tag_name, + Eina_List **elist); +int _gl_local_data_get_tag_list(gl_filter_s *condition, Eina_List **elist); +int _gl_local_data_get_tag_list_by_media_id(gl_filter_s *condition, + const char *media_id, + Eina_List **elist); +int _gl_local_data_get_tag_media_count(int tag_id, gl_filter_s *condtion, + int *item_cnt); +int _gl_local_data_get_tag_media_list(unsigned int tag_id, + gl_filter_s *condition, + Eina_List **elist); +int _gl_local_data_add_tag(const char *tagname, const char *media_uuid); +int _gl_local_data_delete_tag(gl_tag_s *tag); +int _gl_local_data_remove_tag(gl_tag_s *tag, const char *media_uuid); +int _gl_local_data_set_favorite(gl_media_s *item, bool favor); +int _gl_local_data_delete_album(const char *album_uuid); +int _gl_local_data_add_media(const char *file_url, media_info_h *info); +int _gl_local_data_get_thumb(gl_media_s *mitem, char **thumb); +int _gl_local_data_move_media(gl_media_s *mitem, const char *dst); + +#ifdef _cplusplus +} +#endif + + +#endif + diff --git a/include/features/gl-albums-edit.h b/include/features/gl-albums-edit.h new file mode 100755 index 0000000..6d6eacd --- /dev/null +++ b/include/features/gl-albums-edit.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 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 _GL_ALBUMS_EDIT_H_ +#define _GL_ALBUMS_EDIT_H_ + +#include +#include "gallery.h" + +int _gl_albums_edit_create_view(void *data); +int _gl_albums_edit_update_view(void *data); +int _gl_albums_edit_pop_view(void *data); +int _gl_albums_edit_share(void *data, const char *label); +int _gl_albums_edit_update_lang(void *data); + +#endif + diff --git a/include/features/gl-albums-new.h b/include/features/gl-albums-new.h new file mode 100755 index 0000000..d3eafbd --- /dev/null +++ b/include/features/gl-albums-new.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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 _GL_ALBUMS_NEW_H_ +#define _GL_ALBUMS_NEW_H_ + +#include +#include "gallery.h" + +int _gl_albums_new_create_view(void *data); +int _gl_albums_new_pop_view(void *data); +int _gl_albums_new_process(void *data, bool b_enter); + +#endif + diff --git a/include/features/gl-albums-rename.h b/include/features/gl-albums-rename.h new file mode 100755 index 0000000..826955a --- /dev/null +++ b/include/features/gl-albums-rename.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 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 _GL_ALBUMS_RENAME_H_ +#define _GL_ALBUMS_RENAME_H_ + +#include +#include "gallery.h" + +int _gl_albums_rename_create_view(void *data, gl_cluster *album); +int _gl_albums_rename_update_view(void *data); +int _gl_albums_rename_pop_view(void *data); +int _gl_albums_rename_process(void *data, bool b_enter); +int _gl_albums_rename_update_lang(void *data); + +#endif + diff --git a/include/features/gl-albums-sel.h b/include/features/gl-albums-sel.h new file mode 100755 index 0000000..417babd --- /dev/null +++ b/include/features/gl-albums-sel.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 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 _GL_ALBUMS_SEL_H_ +#define _GL_ALBUMS_SEL_H_ + +#include +#include "gallery.h" + +int _gl_albums_sel_create_view(void *data); +int _gl_albums_sel_update_view(void *data); +int _gl_albums_sel_pop_view(void *data); +int _gl_albums_sel_update_lang(void *data); + +#endif + diff --git a/include/features/gl-albums.h b/include/features/gl-albums.h new file mode 100755 index 0000000..57cc8a5 --- /dev/null +++ b/include/features/gl-albums.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 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 _GL_ALBUMS_H_ +#define _GL_ALBUMS_H_ + +#include +#include "gallery.h" + +Evas_Object *_gl_albums_add_gengrid(void *data, Evas_Object *parent); +Evas_Object *gl_albums_create_view(void *data, Evas_Object * parent); +int gl_albums_update_view(void *data); +int _gl_albums_create_items(void *data, Evas_Object *parent); +int gl_albums_sel_album(gl_cluster * album_item); +int gl_albums_update_items(void *data); +int gl_albums_comeback_from_view(void *data); +int gl_albums_change_to_view(void *data); +int gl_albums_remove_nocontents(void *data); +int gl_albums_free_cover_thumbs(void *data); +int gl_albums_free_data(void *data); +int _gl_albums_reset_view(void *data, const char *uuid, const char *aul_type); + +#endif /* _GL_ALBUMS_H_ */ diff --git a/include/features/gl-tags-edit.h b/include/features/gl-tags-edit.h new file mode 100755 index 0000000..60405f4 --- /dev/null +++ b/include/features/gl-tags-edit.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 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 _GL_TAGS_EDIT_H_ +#define _GL_TAGS_EDIT_H_ + +#include +#include "gallery.h" + +int _gl_tags_edit_create_view(void *data); +int _gl_tags_edit_pop_view(void *data); +int _gl_tags_edit_share(void *data, const char *label); +int _gl_tags_edit_update_lang(void *data); + +#endif + diff --git a/include/features/gl-tags-new.h b/include/features/gl-tags-new.h new file mode 100755 index 0000000..36a6a8a --- /dev/null +++ b/include/features/gl-tags-new.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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 _GL_TAGS_NEW_H_ +#define _GL_TAGS_NEW_H_ + +#include +#include "gallery.h" + +int _gl_tags_new_create_view(void *data); +int _gl_tags_new_pop_view(void *data); +int _gl_tags_new_process(void *data, bool b_enter); + +#endif + diff --git a/include/features/gl-tags-rename.h b/include/features/gl-tags-rename.h new file mode 100755 index 0000000..23d730c --- /dev/null +++ b/include/features/gl-tags-rename.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 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 _GL_TAGS_RENAME_H_ +#define _GL_TAGS_RENAME_H_ + +#include +#include "gallery.h" + +int _gl_tags_rename_create_view(void *data, gl_tag *gtag); +int _gl_tags_rename_process(void *data); + +#endif + diff --git a/include/features/gl-tags.h b/include/features/gl-tags.h new file mode 100755 index 0000000..e62efab --- /dev/null +++ b/include/features/gl-tags.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 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 _GL_TAGS_H_ +#define _GL_TAGS_H_ + +#include +#include "gallery.h" + +int _gl_tags_add_btns(void *data); +int gl_tag_unset_rename(void *data); +Evas_Object *gl_tag_create_view(void *data, Evas_Object * parent); +int gl_tag_update_view(void *data); +int _gl_tag_comeback_from_view(void *data); +bool _gl_tags_sel_home_tag(void *data, const char *tag_id); +int _gl_tags_reset_view(void *data, const char *tag_id, const char *aul_type); +const char *_gl_tags_get_current_tag_name(void *data); +int _gl_tags_del(void *data); +int _gl_tags_update_lang(void *data); + +#endif /* _GL_TAGS_H_ */ diff --git a/include/features/gl-thumbs-edit.h b/include/features/gl-thumbs-edit.h new file mode 100755 index 0000000..243d187 --- /dev/null +++ b/include/features/gl-thumbs-edit.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 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 _GL_THUMB_EDIT_H_ +#define _GL_THUMB_EDIT_H_ + +#include +#include "gallery.h" + +int _gl_thumbs_edit_add_btns(void *data, Evas_Object *parent, + Elm_Object_Item *nf_it); +int _gl_thumbs_edit_create_view(void *data); +int _gl_thumbs_edit_pop_view(void *data); +int _gl_thumbs_edit_update_lang(void *data); + +#endif + diff --git a/include/features/gl-thumbs-sel.h b/include/features/gl-thumbs-sel.h new file mode 100755 index 0000000..f0365a5 --- /dev/null +++ b/include/features/gl-thumbs-sel.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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 _GL_THUMB_SEL_H_ +#define _GL_THUMB_SEL_H_ + +#include +#include "gallery.h" + +int _gl_thumbs_sel_create_view(void *data, gl_cluster *album_item); +int _gl_thumbs_sel_pop_view(void *data); +int _gl_thumbs_sel_update_lang(void *data); + +#endif + diff --git a/include/features/gl-thumbs.h b/include/features/gl-thumbs.h new file mode 100755 index 0000000..d169bce --- /dev/null +++ b/include/features/gl-thumbs.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 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 _GL_GRIDVIEW_H_ +#define _GL_GRIDVIEW_H_ + +#include +#include "gallery.h" + + +typedef enum _gl_thumb_mode { + GL_THUMB_ALL, + GL_THUMB_IMAGES, + GL_THUMB_VIDEOS, + GL_THUMB_ALBUMS, +} gl_thumb_mode; + +void _gl_thumbs_mouse_down(void *data, Evas *e, Evas_Object *obj, + void *event_info); +void _gl_thumbs_mouse_up(void *data, Evas *e, Evas_Object *obj, + void *event_info); +Evas_Object *_gl_thumbs_add_grid(void *data, Evas_Object *parent, + gl_thumb_mode mode, bool b_use_idler); +int _gl_thumbs_show_edit_view(void *data); +int _gl_thumbs_show_view(void *data); +Eina_Bool _gl_thumbs_update_view(void *data); +int _gl_thumbs_create_view(void *data, int nf_mode, char *title, bool b_idler, + Evas_Smart_Cb func); +int _gl_thumbs_update_count(void *data, int new_cnt); +bool _gl_thumbs_get_view(void *data, Evas_Object **view); +int _gl_thumbs_set_nocontents(void *data, Evas_Object *noc); +int _gl_thumbs_set_size(void *data, Evas_Object *gridview); +int _gl_thumbs_clear_cbs(Evas_Object *grid); +int _gl_thumbs_delete_view(void *data); +int _gl_thumbs_update_size(void *data, Evas_Object *view); +int _gl_thumbs_del_append_idler(void *data); + +#endif /* _GL_GRIDVIEW_H_ */ + diff --git a/include/gallery.h b/include/gallery.h new file mode 100755 index 0000000..c3f4feb --- /dev/null +++ b/include/gallery.h @@ -0,0 +1,499 @@ +/* + * Copyright (c) 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 _GALLERY_H_ +#define _GALLERY_H_ + +#include +#include +#include +#include +#include +#include "gl-data.h" +#include + +#ifdef _cplusplus +extern "C" +{ +#endif + +#if !defined(APPDIR) +# define APPDIR "/usr/apps/org.tizen.gallery" +#endif + +#if !defined(PACKAGE) +# define PACKAGE "gallery" +#endif + +#if !defined(LOCALEDIR) +# define LOCALEDIR APPDIR"/res/locale" +#endif + +#if !defined(EDJDIR) +# define EDJDIR APPDIR"/res/edje" +#endif + +#if !defined(IMAGEDIR) +# define IMAGEDIR APPDIR"/res/images/" +#endif + +#define PKGNAME_GALLERY "org.tizen.gallery" + +/******** EDJ File path ********/ + +#define GL_EDJ_FILE EDJDIR "/" PACKAGE ".edj" + +/******** Groups name ********/ + +#define GL_GRP_CONTROLBAR "gallery/controlbar" +#define GL_GRP_CONTROLBAR_LY "gallery/controlbar_layout" +#define GL_GRP_PHOTOFRAME "photoframe" + +/******* Part name ***********/ + +#define GL_NAVIFRAME_PREV_BTN "prev_btn" +#define GL_NAVIFRAME_TITLE_PREV_BTN "title_prev_btn" +#define GL_NAVIFRAME_TITLE_RIGHT_BTN "title_right_btn" +#define GL_NAVIFRAME_TITLE_BTN1 "title_toolbar_button1" + +#define GL_NAVIFRAME_BTN1 "toolbar_button1" +#define GL_NAVIFRAME_BTN2 "toolbar_button2" +#define GL_NAVIFRAME_MORE "toolbar_more_btn" + + +#define GL_POPUP_TEXT "title,text" +#define GL_NOCONTENTS_TEXT "elm.text" +#define GL_GRID_TEXT "elm.text" + +#define GL_IMF_ON "virtualkeypad,state,on" +#define GL_IMF_OFF "virtualkeypad,state,off" + +/******** Style name ********/ + +#define GL_CLASS_GENGRID "gengrid" +#define GL_BUTTON_STYLE_RENAME "rename" +#define GL_BUTTON_STYLE_NAVI_MORE "naviframe/more/default" +#define GL_BUTTON_STYLE_NAVI_TITLE "naviframe/title/default" +#define GL_BUTTON_STYLE_NAVI_TITLE_PLUS "naviframe/title/icon/plus" +/* TMP: use Done to replace Edit */ +#define GL_BUTTON_STYLE_NAVI_TOOLBAR "naviframe/toolbar/default" +#define GL_BUTTON_STYLE_NAVI_MORE "naviframe/more/default" +#define GL_BUTTON_STYLE_NAVI_TOOLBAR_LEFT "naviframe/toolbar/left" +#define GL_BUTTON_STYLE_NAVI_TOOLBAR_RIGHT "naviframe/toolbar/right" + +#define GL_BUTTON_STYLE_SWEEP "sweep" +#define GL_BUTTON_STYLE_SWEEP_DELETE "sweep/delete" +/* Button object style of previous button of naviframe */ +#define GL_BUTTON_STYLE_NAVI_PRE "naviframe/back_btn/default" + +#define GL_CHECKBOX_STYLE_GRID "gallery/grid" +#define GL_CHECKBOX_STYLE_DEFAULT "gallery/default" +#define GL_GENLIST_STYLE_DEFAULT GL_CHECKBOX_STYLE_DEFAULT + +#define GL_GENLIST_ITEM_STYLE_SWEEP2_TAG "mode/gallery/slide2_tag" + +#define GL_NF_ANI_TABBAR "tabbar" + +/******** String ********/ + +#define GL_SEPERATOR_BT '?' +/* MIME type */ +#define GL_MIME_IMAGE_ALL "image/*" +#define GL_MIME_VIDEO_ALL "video/*" +/* For local album */ +#define GL_AUL_ALBUM "album" +#define GL_AUL_TAG "tag" +/*From live-gallery opening album tab request*/ +#define GL_ALBUM_UUID_DEFAULT "default" + +/******** Numerical value ********/ + +/* Window width and height */ +#define GL_WIN_WIDTH 720 +#define GL_WIN_HEIGHT 1280 + +#define GL_ALBUM_COVER_THUMB_NUM 1 +/* Normal albums cover have maximum 4 thumbnails */ +#define GL_ALBUM_COVER_THUMB_NUM_SEC 4 + +/* Size of thumbnails in gridview */ +#define GL_GRID_ITEM_SIZE_W 178 +#define GL_GRID_ITEM_SIZE_H 193 +/* Thumbnail would be enlarged if medias count is less than 7 */ +#define GL_GRID_ITEM_ZOOM_LEVEL_02 2 +#define GL_GRID_ITEM_ZOOM_LEVEL_02_CNT 6 + +/* String length of mtye item id */ +#define GL_MTYPE_ITEN_ID_LEN_MAX 37 + +/* String length of album name */ +#define GL_ALBUM_NAME_LEN_MAX GL_FILE_NAME_LEN_MAX + +#define GL_DATE_INFO_LEN_MAX 256 +#define GL_POPUP_DESC_LEN_MAX 256 +#define GL_EXT_STR_COUNT_LEN 20 + +/* Maximum number of entry string, 255 Chars of album name (linux system) */ +#define GL_ENTRY_STR_CHAR_MAX 255 +/* Maximum length of entry string, 255 Bytes of tag name */ +#define GL_ENTRY_STR_LEN_MAX (GL_ARRAY_LEN_MAX - 1) + +/* 1s=1000ms */ +#define GL_TIME_MSEC_PER_SEC 1000 +/*1s = 1000000us*/ +#define GL_TIME_USEC_PER_SEC 1000000L +/* 1ms=1000us */ +#define GL_TIME_USEC_PER_MSEC 1000 +/* 1min=60s */ +#define GL_TIME_SEC_PER_MIN 60 +/* 1h=60min */ +#define GL_TIME_MIN_PER_HOUR 60 +/* 1h=(60x60)s */ +#define GL_TIME_SEC_PER_HOUR (GL_TIME_MIN_PER_HOUR * GL_TIME_SEC_PER_MIN) + +/* itoa length max ----> 1(sign) + 10(2^31) + 1(NULL) */ +#define GL_INTERGER_LEN_MAX 12 + +#define GL_ERROR_BUF_LEN 1024 + +/* File system related String definition */ +#define GL_ROOT_PATH_PHONE "/opt/usr/media" +#define GL_ROOT_PATH_MMC "/opt/storage/sdcard" +#define GL_DEFAULT_PATH_IMAGES "/Images and videos" +#define GL_DATA_FOLDER_PATH "/opt/usr/apps/"PKGNAME_GALLERY"/data" + +#define GL_NAVIFRAME_OBJ_DATA_KEY "gl_naviframe_data_key" + +/******** Enumeration ********/ + +typedef enum _gl_aul_launch_type +{ + GL_AUL_T_NONE, + GL_AUL_T_SELECT_ONE, + GL_AUL_T_SELECT_MULTIPLE, + GL_AUL_T_SELECT_SETAS, + GL_AUL_T_SELECT_ALBUM, + GL_AUL_T_VIEW_ALBUM, +} gl_aul_launch_type; + +typedef enum { + GL_AUL_SETAS_T_NONE, + GL_AUL_SETAS_T_WALLPAPER, + GL_AUL_SETAS_T_CROP_WALLPAPER, + GL_AUL_SETAS_T_CALLER_ID, +} gl_aul_setas_type; + +typedef enum _gl_aul_file_type +{ + GL_AUL_FILE_T_NONE, + GL_AUL_FILE_T_IMAGE, + GL_AUL_FILE_T_VIDEO, + GL_AUL_FILE_T_ALL, +} gl_aul_file_type; + +typedef enum _gl_view_mode +{ + GL_VIEW_NONE, + GL_VIEW_ALBUMS, + GL_VIEW_ALBUMS_EDIT, + GL_VIEW_ALBUMS_RENAME, + GL_VIEW_ALBUMS_SELECT, + GL_VIEW_TAGS, + GL_VIEW_TAGS_EDIT, + GL_VIEW_THUMBS, + GL_VIEW_THUMBS_EDIT, + GL_VIEW_THUMBS_SELECT, +} gl_view_mode; + +typedef enum _gl_app_exit_mode +{ + GL_APP_EXIT_NONE, + GL_APP_EXIT_MASS_STORAGE, +} gl_app_exit_mode; + +typedef enum _gl_entry_mode +{ + GL_ENTRY_NONE, + GL_ENTRY_NEW_ALBUM, + GL_ENTRY_RENAME_ALBUM, + GL_ENTRY_NEW_TAG, + GL_ENTRY_RENAME_TAG, +} gl_entry_mode; + +/* Grid view created for different thumbnails view types */ +typedef enum _gl_gird_t gl_grid_t_e; +enum _gl_gird_t { + GL_GRID_T_NONE, + GL_GRID_T_LOCAL, + GL_GRID_T_ALLALBUMS, + GL_GRID_T_TAGS, +}; + +/******** Structure ********/ + +typedef struct +{ + Evas_Object *ctrlbar_ly; + Evas_Object *ctrlbar_edit_view; + Evas_Object *ctrlbar_edit_ly; + Evas_Object *ctrlbar; + /* Layout of albums view/tags view */ + Evas_Object *ctrlbar_view_ly; + /* Naviframe item pushed to stack */ + Elm_Object_Item *nf_it; + Elm_Object_Item *nf_it_edit; + int tab_mode; /* State of controlbar item: Albums, Tags */ + int rotate_mode; /* Save rotation mode of normal view */ +} gl_ctrl_info; + +typedef struct +{ + Elm_Genlist_Item_Class taglic; /* Genlist item class of tags list view */ + /* Genlist item class of tags list view for sweep */ + Elm_Genlist_Item_Class sweeplic; + Evas_Object *tags_view; /* Tags view object */ + Evas_Object *conformant; + /* Edit item state */ + bool b_edit_disable; + Elm_Object_Item *rename_item; /* Save genlist item in rename mode */ + Eina_List *tags_elist; /* List of all tags */ + Eina_List *selected_tags_elist; /* List of all selected tags */ + int tags_cnt; /* Media items count append to listview */ + gl_tag *current_tag; /* 1. Select tag to show medias */ + /* 2. Select tag for rename */ + + /* Tag_name of selected tag or newly created one */ + char new_tag_name[GL_ALBUM_NAME_LEN_MAX]; + /*True: it's favourites tag */ + bool b_favor_tag; +} gl_tag_info; + +typedef struct +{ + Evas_Coord x; + Evas_Coord y; + bool b_pressed; +} gl_grid_touch_info; + +typedef struct +{ + Elm_Gengrid_Item_Class thumbgic; /* Gengrid item class of thumbnails view */ + Evas_Object *navi_content_edit_view; + Evas_Object *navi_content_edit_ly; + Evas_Object *navi_content_ly; + /* Thumbnail selection view for Add tag to photo */ + Evas_Object *select_view; + Evas_Object *select_view_ly; + Evas_Object *all_grid_view; + Evas_Object *all_grid_nocontents; + bool b_slideshow_disable; + Evas_Object *slideshow_btn; + /* Edit */ + Evas_Object *edit_btn; + /* Naviframe item pushed to stack */ + Elm_Object_Item *nf_it; + Elm_Object_Item *nf_it_edit; + Elm_Object_Item *nf_it_select; + gl_grid_touch_info grid_touch_info; /* Added for shrink effect while select thumbnail */ + /* It's thumbnails icon size, not grid item size */ + int icon_size; + Ecore_Idler *grid_append_idler; /* Use idler to append other medias to gridview */ + /* if album contains more than (GL_FIRST_VIEW_END_POS+1) medias */ + /* 1. Indicate view mode(All/Images/Videos) of thumbnails view */ + /* 2. Set types for creating nocontents view */ + int view_mode; + int thumbs_cnt; /* Media items count appended to gridview */ + int updated_thumbs_cnt; /* Media items count appended to gridview while refreshing */ + bool back_to_normal; /* When back from edit mode, reset checkbox state */ + + gl_grid_t_e grid_type; +} gl_grid_info; + +typedef struct +{ + bool app_called_by_me; /* Indicates if any application invoked by Gallery */ + ui_gadget_h ug_called_by_me; + int ug_type; + int iv_type; + void *ug_login_data; + int sort_type; /* Types: wminfo_media_sort_type; pass it to imageviewer */ + ui_gadget_h gallery_ug_called_by_me; /* The gallery-ug called by Gallery for appcontrol */ +} gl_ug_info; + +typedef struct +{ + Elm_Gengrid_Item_Class albumgic; /* Gengrid item class of albums view */ + Evas_Object *albums_view; /* Albums view object */ + Evas_Object *albums_nocontents; /* Nocontents object */ + /* Albums view object for Add tag to photo */ + Evas_Object *select_view; + /* Albums view layout object for Add tag to photo */ + Evas_Object *select_view_ly; + + /* Edit item state */ + bool b_edit_disable; + gl_item *cover_thumbs[GL_ALBUM_COVER_THUMB_NUM]; /* Media items of album cover */ + gl_cluster *current_album; /* Album selected for showing thumbnails view/list view */ + /* Album selected for rename/open locked album */ + gl_cluster *selected_album; + /* Save destination album id while move/save */ + char *path; + char new_album_name[GL_ALBUM_NAME_LEN_MAX]; + Eina_List *selected_albums_elist; /* List of all selected albums */ + gl_cluster_list *cluster_list; /* List of all albums */ + int albums_cnt; /* Albums count appended to gridview */ + int album_medias_cnt; /* Media items count of a album, it is showed in album cover */ + bool update_albums_list; /* Flag indicate to update albums list when back to normal view. */ + /* 1. MMC Inserted/Removed in thumbnails edit mode; */ + char dest_folder[GL_DIR_PATH_LEN_MAX]; /* The full path of destination album of movement */ + bool move_new_album; /* True: move medias to album newly created, */ + /* False: move to album already created */ + /* Variables below are related to gallery launching */ + service_h recv_service; /* The service received when app_reset */ + bool gallery_launched; + /* Launching from shotcut(album added to home) */ + bool aul_launch_by_mime; + int aul_launch_type; + int aul_file_type; + int aul_setas_type; + bool b_show_drm; + char *aul_id; + char *aul_type; + char* aul_homescreen_path; + char* aul_lockscreen_path; + char* aul_callid_size; + char* aul_callid_path; + + Ecore_Idler *create_albums_idler; /* Use idler to append albums to albums view */ + /* Use idler to activate window when launching Gallery UG */ + Ecore_Idler *activate_win_idler; + Elm_Object_Item *nf_it_select; +} gl_album_info; + +typedef struct +{ + Evas_Object *editfield; + Evas_Object *imf_entry; + Ecore_IMF_Context *imf_context; + + /* Type: gl_entry_mode; Indicate usage of entry */ + int entry_mode; + /* Button 'Done' in new album/tag view */ + Evas_Object *done_btn; + Elm_Object_Item *nf_it; + /* Handle for play vibration */ + int haptic_handle; + /* Timer for closing vibration */ + Ecore_Timer *vibration_timer; + haptic_device_h *device_handle; + haptic_effect_h *effect_handle; +} gl_entry_info; + +typedef struct +{ + Elm_Genlist_Item_Class popuplit; /* Genlist item class of list view in popupinfo.popup */ + Evas_Object *popup; + int popup_mode; + /* Selectioninfo popup layout */ + Evas_Object *selinfo_ly; + Ecore_Timer *del_timer; +} gl_popup_info; + +typedef struct { + Eina_List *medias_elist; /* List of all selected medias of a album/tag/marker */ + int images_cnt; /* Images count selected */ + int drms_cnt; /* DRM files count selected */ + int jpeg_cnt; /* JEPG files count selected */ + /* All media count */ + int sel_cnt; + /* Timer for adding frequency when clicking select-all */ + Ecore_Timer *selall_timer; + /* Checkbox state of select-all */ + Eina_Bool ck_state; +} gl_selected_info; + +typedef struct { + Evas_Object *pbar_popup; + Evas_Object *pbar; + Evas_Object *status_label; + /** + * After progressbar showed completely, use timer to + * emit next signal to write pipe to continue to operate medias. + */ + Ecore_Timer *start_thread_timer; + /** + * After thread operation done, use idler to + * delete progressbar after it's showed completely(status is 100%). + */ + Ecore_Idler *del_pbar_idler; + Ecore_Pipe *sync_pipe; /* Pipe for communication between main and child thread */ + pthread_mutex_t pbar_lock; /* Lock for state of 'Cancel' button */ + pthread_mutex_t refresh_lock; /* Lock for progressbar refreshing */ + pthread_cond_t refresh_cond; /* Condition for progressbar refreshing */ + int refresh_flag; /* Indicates progressbar updated or not while moving or deleting */ + int pbar_cancel; /* State of 'Cancel' button on progressbar popup */ + /* Medias count already operated */ + int finished_cnt; +} gl_pbar_info; + +typedef struct +{ + Evas_Object *win; + double win_scale; + Evas_Object *main_layout; + Evas_Object *naviframe; + Evas_Object *bg; + Evas_Object *ctxpopup; + int rotate_mode; /* Type: appcore_rm; Indicate rotation mode of whole application */ + int view_mode; /* Type: gl_view_mode; Indicate view mode of whole application */ + bool reentrant; + /* Mouse down event handle */ + Ecore_Event_Handler *keydown_handler; + /* Font type change event handle */ + Ecore_Event_Handler *font_handler; + int all_medias_cnt; + time_t last_mtime; + Eina_List *medias_elist; /* List of all medias of a album/tag/marker */ + int medias_cnt; /* Count of all medias of a album/tag/marker */ + int medias_op_type; /* Type: Move or Delete medias */ + int mmc_state; /* MMC state(Inserted, Removed) */ + Ecore_Job *rename_album_job; + bool home_key; +} gl_main_info; + +struct _gl_appdata +{ + gl_main_info maininfo; + gl_ctrl_info ctrlinfo; /* Global variables about controlbar */ + gl_album_info albuminfo; /* Global variables about albums view */ + gl_tag_info taginfo; /* Global variables about tags view */ + gl_grid_info gridinfo; /* Global variables about thumbnails view */ + gl_entry_info entryinfo; /* Global variables about entry */ + gl_popup_info popupinfo; /* Global variables about popup */ + gl_pbar_info pbarinfo; /* Global variables about progressbar */ + gl_ug_info uginfo; /* Global variables about ug */ + gl_selected_info selectedinfo; /* Global variables about files selected */ +}; + +typedef struct _gl_appdata gl_appdata; + +int gallery_reset_app(void *data); + +#ifdef _cplusplus +} +#endif + +#endif /* _GALLERY_H_ */ diff --git a/include/util/gl-debug.h b/include/util/gl-debug.h new file mode 100755 index 0000000..800e45b --- /dev/null +++ b/include/util/gl-debug.h @@ -0,0 +1,151 @@ +/* + * Copyright (c) 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 _GL_DEBUG_H_ +#define _GL_DEBUG_H_ + +#include +#include +#include + +#ifdef _cplusplus +extern "C" +{ +#endif + +#ifdef LOG_TAG +#undef LOG_TAG +#endif + + +#define LOG_TAG "GALLERY" +#define LOG_TAG_LAUNCH "GALLERY_LAUNCH" + +/* anci c color type */ +#define FONT_COLOR_RESET "\033[0m" +#define FONT_COLOR_RED "\033[31m" +#define FONT_COLOR_GREEN "\033[32m" +#define FONT_COLOR_YELLOW "\033[33m" +#define FONT_COLOR_BLUE "\033[34m" +#define FONT_COLOR_PURPLE "\033[35m" +#define FONT_COLOR_CYAN "\033[36m" +#define FONT_COLOR_GRAY "\033[37m" + +#ifdef _USE_LOG_FILE_ +FILE *g_log_fp; +#endif // _USE_LOG_FILE_ + +#ifdef _USE_LOG_FILE_ + +#define gl_dbg(fmt,arg...) fprintf(g_log_fp, "[%s: %d]" fmt "\n", __FUNCTION__, __LINE__, ##arg) + +#elif defined _USE_DLOG_ + +#define gl_dbg(fmt, arg...) LOGD("[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg) +#define gl_dbgW(fmt, arg...) LOGW(FONT_COLOR_GREEN"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg) +#define gl_dbgE(fmt, arg...) LOGE(FONT_COLOR_RED"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg) + +typedef struct { + const char *fname; + int nline; + const char *szcategory; +} debug_msg_type; + +void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...); + +#define __LAUNCH_TEST_LOG(szCat, ...) \ + do { \ + if (1) \ + { \ + static debug_msg_type msg______unique______name___ = { \ + __FILE__, \ + __LINE__, \ + szCat, \ + }; \ + _custom_debug_msg(&msg______unique______name___, ##__VA_ARGS__); \ + } \ + } while(0) + +#define gl_dbg_launch(...) __LAUNCH_TEST_LOG(LOG_TAG_LAUNCH, ##__VA_ARGS__) + + +#elif defined _USE_LOG_CONSOLE_ + +#define gl_dbg(fmt,arg...) fprintf(stdout, "[%s: %d]" fmt "\n", __FUNCTION__, __LINE__, ##arg) +#define gl_dbgW(fmt, arg...) fprintf(stdout, "[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg) +#define gl_dbgE(fmt, arg...) fprintf(stdout, "[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg) + +#else + +#define gl_dbg(fmt,arg...) +#define gl_dbgW(fmt, arg...) +#define gl_dbgE(fmt, arg...) +#endif + +//void gl_init_debug_handler (const char *appname); +//void gl_close_debug_handler(); + +#include +#include + +//long gl_get_debug_time(void); +//void gl_reset_debug_time(void); +//void gl_print_debug_time(char* time_string); +void gl_print_debug_time_ex(long start, long end, const char *func_name, char *time_string); + + + +#define gl_retm_if(expr, fmt, arg...) do { \ + if(expr) { \ + gl_dbgE(fmt, ##arg); \ + gl_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \ + return; \ + } \ +} while (0) + +#define gl_retvm_if(expr, val, fmt, arg...) do { \ + if(expr) { \ + gl_dbgE(fmt, ##arg); \ + gl_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \ + return (val); \ + } \ +} while (0) + +#define GL_CHECK_EXCEP(expr) do { \ + if(!(expr)) { \ + gl_dbgE("Critical ERROR ########################################## Check below item.");\ + goto gl_exception;\ + } \ +} while (0) + +#define GL_CHECK_VAL(expr, val) gl_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!") +#define GL_CHECK_NULL(expr) gl_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!") +#define GL_CHECK_FALSE(expr) gl_retvm_if(!(expr), false, "Invalid parameter, return FALSE!") +#define GL_CHECK_CANCEL(expr) gl_retvm_if(!(expr), ECORE_CALLBACK_CANCEL, "Invalid parameter, return ECORE_CALLBACK_CANCEL!") +#define GL_CHECK(expr) gl_retm_if(!(expr), "Invalid parameter, return!") + +#define gl_assert(expr) do { \ + if(!(expr)) { \ + gl_dbgE("Critical ERROR ########################################## Check below item.");\ + assert(false); \ + } \ +} while (0) + +#ifdef _cplusplus +} +#endif + +#endif /* _GL_DEBUG_H_ */ diff --git a/include/util/gl-drm.h b/include/util/gl-drm.h new file mode 100755 index 0000000..87ee079 --- /dev/null +++ b/include/util/gl-drm.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 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 _GL_DRM_H_ +#define _GL_DRM_H_ + +#include +#include + +Eina_Bool gl_drm_is_drm_file(const char *file_path); +Eina_Bool gl_drm_check_valid_ro(const char *file_path, + drm_permission_type_e permType); +char *gl_drm_get_file_path(void *item); +int gl_drm_get_permtype(int gitem_type); + +#endif /* _GL_DRM_H_ */ + diff --git a/include/util/gl-exif.h b/include/util/gl-exif.h new file mode 100755 index 0000000..adf8d30 --- /dev/null +++ b/include/util/gl-exif.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 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. + */ + +#ifdef _USE_ROTATE_BG + +#ifndef _GL_EXIF_H_ +#define _GL_EXIF_H_ + +#include +#include + +#ifdef _cplusplus +extern "C" +{ +#endif + +/* +Orientation - angle +1 - 0 +3 - 180 +6 - 90 +8 - 270 +*/ +typedef enum _gl_orientation_rot_t gl_orientation_rot_e; + +enum _gl_orientation_rot_t { + GL_ORIENTATION_ROT_ERR = 0, + GL_ORIENTATION_ROT_0 = 1, + GL_ORIENTATION_ROT_180 = 3, + GL_ORIENTATION_ROT_90 = 6, + GL_ORIENTATION_ROT_270 = 8, +}; +bool _gl_exif_check_img_type(char *file_path); +int _gl_exif_get_orientation(char *file_path, unsigned int *orientation); +int _gl_exif_set_orientation(char *file_path, unsigned int orientation); +int _gl_exif_get_rotated_orientation(unsigned int orientation, bool b_left); + +#ifdef _cplusplus +} +#endif + +#endif /* _GL_EXIF_H_ */ + +#endif + diff --git a/include/util/gl-ext-exec.h b/include/util/gl-ext-exec.h new file mode 100755 index 0000000..aeb4361 --- /dev/null +++ b/include/util/gl-ext-exec.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 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 _GL_EXT_EXEC_H_ +#define _GL_EXT_EXEC_H_ + +typedef enum +{ + GL_LAUNCH_FAIL, + GL_LAUNCH_SUCCESS +} gl_launch_status; + +typedef enum +{ + GL_APP_NONE = -1, + GL_APP_VIDEOPLAYER, +} gl_ext_app_type; + +int gl_ext_exec(void *data, gl_ext_app_type type); +int _gl_ext_load_camera(void); + +#endif /* _GL_EXT_EXEC_H_ */ diff --git a/include/util/gl-ext-ug-load.h b/include/util/gl-ext-ug-load.h new file mode 100755 index 0000000..6c6e768 --- /dev/null +++ b/include/util/gl-ext-ug-load.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 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 _GL_EXT_UG_LOAD_H_ +#define _GL_EXT_UG_LOAD_H_ + +#include +#include "gl-data.h" + +typedef enum +{ + GL_UG_FAIL, + GL_UG_SUCCESS +} gl_ug_load_status; + +typedef enum +{ + GL_UG_MSG, + GL_UG_EMAIL, + GL_UG_BT, + GL_UG_IMAGEVIEWER, + GL_UG_CNT, +} gl_ext_ug_type; + +typedef enum +{ + GL_UG_IV, + /*Invoke imageviewer to slideshow on local album */ + GL_UG_IV_SLIDESHOW, + /*Invoke imageviewer to slideshow selected files */ + GL_UG_IV_SLIDESHOW_SELECTED, + GL_UG_IV_CNT, +} gl_ext_iv_type; + +int gl_ext_load_ug(void *data, gl_ext_ug_type type); +int gl_ext_load_iv_ug(void *data, gl_item *item, gl_ext_iv_type type); +int gl_ext_load_gallery_ug(void *data); +int gl_ext_destroy_gallery_ug(void *data); + +#endif /* _GL_EXT_UG_LOAD_H_ */ diff --git a/include/util/gl-fs.h b/include/util/gl-fs.h new file mode 100755 index 0000000..e1f2b6c --- /dev/null +++ b/include/util/gl-fs.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 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 _GL_FS_H_ +#define _GL_FS_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct _gl_node_info_t gl_node_info_s; +struct _gl_node_info_t { + /* Parent path */ + char *path; + /* File/folder name */ + char *name; + /* Modified time */ + time_t mtime; + /* File size / folder's content size */ + long long size; +}; + +int _gl_fs_get_file_stat(const char *filename, gl_node_info_s **node); +long long _gl_fs_get_folder_size(char *path); +int _gl_fs_rm_folder(char *path, long long cut_size, long long max_size, + unsigned int expired_time); +#ifdef _RENAME_ALBUM_SENSITIVE +bool _gl_fs_check_name_case(char *dir, char *exist_name); +#endif +bool _gl_fs_is_low_memory(unsigned long long total_size); +bool _gl_fs_get_ext(const char *file_path, char *file_ext, char *new_path); +Eina_Bool _gl_fs_move(const char *src, const char *dst); +char *_gl_fs_get_unique_full_path(char *file_path, char *ext); +bool _gl_fs_validate_name(const char *new_name); +int _gl_fs_get_default_folder(char *path); +bool _gl_fs_mkdir(const char *path); + +#endif + diff --git a/include/util/gl-icons.h b/include/util/gl-icons.h new file mode 100755 index 0000000..f484a82 --- /dev/null +++ b/include/util/gl-icons.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 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 _GL_ICONS_H_ +#define _GL_ICONS_H_ + +#include "gallery.h" + +/******** Image path ********/ +#define GL_DEFAULT_THUMB_ICON IMAGEDIR"T01_Nocontents_broken.png" +#define GL_DB_DEFAULT_THUMB "/opt/usr/data/file-manager-service/.thumb/thumb_default.png" + +#define GL_DEFAULT_TAG_COVER IMAGEDIR"gallery_tag_default_thumbnail.png" +#define GL_TAG_FAVORITES_THUMB IMAGEDIR"gallery_tag_favorites_thumbnail.png" +#define GL_CBAR_ICON_ADD IMAGEDIR"T01_controlbar_icon_add.png" + +#define GL_CTRL_ICON_ALBUMS IMAGEDIR"T01_controlbar_icon_albums.png" +#define GL_CTRL_ICON_TAGS IMAGEDIR"T01_controlbar_icon_tag.png" + +/******** Image group in EDC file ********/ + +#define GL_IMAGES_EDJ_FILE EDJDIR"/gl-images.edj" + +#define GL_LOCK_ICON "T01_icon_lock.png" +#define GL_THUMB_FAVOR_ICON "T01_icon_thumbnail_favorite.png" +#define Gl_VIDEO_PLAY_ICON "T01_btn_thumbnail_play.png" +#define GL_THUMB_BOOKMARK "T01_icon_thumbnail_bookmark.png" +#define GL_LIST_BOOKMARK "T01_list_icon_bookmark.png" + +#endif + diff --git a/include/util/gl-lang.h b/include/util/gl-lang.h new file mode 100755 index 0000000..ef304df --- /dev/null +++ b/include/util/gl-lang.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 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 _GL_LANG_H_ +#define _GL_LANG_H_ + +#include "gallery.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +int _gl_lang_update(void *data); +int _gl_lang_update_thumb_edit_button(void *data, Elm_Object_Item *nf_it); + +#ifdef _cplusplus +} +#endif + + +#endif + diff --git a/include/util/gl-strings.h b/include/util/gl-strings.h new file mode 100755 index 0000000..775f1b1 --- /dev/null +++ b/include/util/gl-strings.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 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. + */ + +/* This header file includes all multi language strings which need display */ +#ifndef _GL_STRINGS_H_ +#define _GL_STRINGS_H_ + +#ifdef _cplusplus +extern "C" +{ +#endif + +/* hard code strings and already translated strings in gallery po files */ +#define GL_ALBUM_ALL_NAME _("IDS_MEDIABR_BODY_ALL_ALBUMS") +#define GL_ALBUM_DEFAULT_NAME _("Camera") +#define GL_ALBUM_DOWNLOAD_NAME _("Downloads") +#define GL_STR_UNDER_IMPLEMENTATION _("Under Implementation!") +#define GL_STR_CTRL_ITEM_TAGS _("IDS_MEDIABR_BODY_TAGS") + +#define GL_STR_EDIT dgettext("sys_string", "IDS_COM_BODY_EDIT") +#define GL_STR_DOWNLOAD dgettext("sys_string", "IDS_COM_SK_DOWNLOAD") +#define GL_STR_SLIDESHOW _("IDS_MEDIABR_BUTTON_SLIDE_SHOW") + +#define GL_STR_INVALID_INPUT_PARAMETER _("IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER") +#define GL_STR_ENTRY_IS_EMPTY _("IDS_MEDIABR_POP_ENTRY_IS_EMPTY") +#define GL_STR_SAME_NAME_ALREADY_IN_USE _("IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE") + +#define GL_STR_UNABLE_tO_RENAME _("IDS_MEDIABR_POP_UNABLE_TO_RENAME") +#define GL_STR_NO_ALBUMS_SELECTED _("IDS_MEDIABR_POP_NO_ALBUMS_SELECTED") +#define GL_STR_NO_TAGS_SELECTED _("IDS_MEDIABR_POP_NO_TAGS_SELECTED") +#define GL_STR_SELECT_ALBUM _("IDS_MEDIABR_HEADER_SELECT_ALBUM") +#define GL_STR_SELECT_TAGS _("IDS_MEDIABR_BODY_SELECT_TAGS") +#define GL_STR_SELECT_ITEM _("IDS_MEDIABR_HEADER_SELECT_ITEM") +#define GL_STR_NO_ALBUMS _("IDS_MEDIABR_BODY_NO_ALBUMS") +#define GL_STR_NO_TAGS _("IDS_MEDIABR_POP_NO_TAGS") + +#define GL_STR_EMPTY _("") +#define GL_ALBUM_PHOME_ROOT_NAME _("IDS_MEDIABR_POP_NO_NAME") + +#ifdef _USE_ROTATE_BG +#define GL_STR_ROTATE_LEFT _("IDS_MEDIABR_OPT_ROTATE_LEFT") +#define GL_STR_ROTATE_RIGHT _("IDS_MEDIABR_OPT_ROTATE_RIGHT") +#define GL_STR_ROTATING _("Rotating") +#define GL_STR_ROTATED _("Rotated") +#endif + +#define GL_STR_RETRY_Q _("IDS_MEDIABR_POP_RETRY_Q") +#define GL_STR_CREATE_TAG _("IDS_MEDIABR_OPT_CREATE_TAG") +#define GL_STR_RENAME_TAG dgettext("sys_string", "IDS_COM_BODY_CHANGE_NAME") +#define GL_STR_CREATE_ALBUM _("IDS_MEDIABR_OPT_CREATE_ALBUM") + +/* system strings which are included in sys-string-0 po files */ +#define GL_STR_CAMERA dgettext("sys_string", "IDS_COM_BODY_CAMERA") +#define GL_STR_DOWNLOADS dgettext("sys_string", "IDS_COM_BODY_DOWNLOADS") +#define GL_STR_NO_FAVOR_VIDEOS dgettext("sys_string", "IDS_COM_BODY_NO_VIDEOS") +#define GL_STR_NO_FAVOR_IMAGES dgettext("sys_string", "IDS_COM_BODY_NO_IMAGES") +#define GL_STR_NO_FAVOR_ITEMS dgettext("sys_string", "IDS_COM_BODY_NO_ITEMS") +#define GL_TAG_FAVORITES_NAME dgettext("sys_string", "IDS_COM_BODY_FAVOURITES") +#define GL_ALBUM_IMAGES_NAME dgettext("sys_string", "IDS_COM_BODY_IMAGES") +#define GL_ALBUM_VIDEOS_NAME dgettext("sys_string", "IDS_COM_BODY_VIDEOS") +#define GL_STR_MOVE dgettext("sys_string", "IDS_COM_BODY_MOVE") +#define GL_STR_SHARE dgettext("sys_string", "IDS_COM_BUTTON_SHARE") +#define GL_STR_CANCEL dgettext("sys_string", "IDS_COM_SK_CANCEL") +#define GL_STR_CLOSE dgettext("sys_string", "IDS_COM_BODY_CLOSE") +#define GL_STR_DELETE dgettext("sys_string", "IDS_COM_OPT_DELETE") +#define GL_STR_DONE dgettext("sys_string", "IDS_COM_SK_DONE") +#define GL_STR_CTRL_ITEM_ALBUMS dgettext("sys_string", "IDS_COM_BODY_ALBUMS") +#define GL_SHARE_MESSAGE dgettext("sys_string", "IDS_COM_BODY_MESSAGE") +#define GL_SHARE_EMAIL dgettext("sys_string", "IDS_COM_BODY_EMAIL") +#define GL_SHARE_BLUETOOTH dgettext("sys_string", "IDS_COM_BODY_BLUETOOTH") +#define GL_STR_NO_ITEMS dgettext("sys_string", "IDS_COM_BODY_NO_ITEMS") +#define GL_STR_NO_IMAGES dgettext("sys_string", "IDS_COM_BODY_NO_IMAGES") +#define GL_STR_NO_CONTENTS dgettext("sys_string", "IDS_COM_BODY_NO_CONTENTS") +#define GL_STR_DELETED dgettext("sys_string", "IDS_COM_POP_DELETED") +#define GL_STR_REMOVED dgettext("sys_string", "IDS_COM_POP_REMOVED") +#define GL_STR_REMOVE dgettext("sys_string", "IDS_COM_SK_REMOVE") +#define GL_STR_ALL dgettext("sys_string", "IDS_COM_BODY_ALL") +#define GL_STR_IMAGES dgettext("sys_string", "IDS_COM_BODY_IMAGES") +#define GL_STR_VIDEOS dgettext("sys_string", "IDS_COM_BODY_VIDEOS") +#define GL_STR_YES dgettext("sys_string", "IDS_COM_SK_YES") +#define GL_STR_NO dgettext("sys_string", "IDS_COM_SK_NO") +#define GL_STR_DELETE_COMFIRMATION dgettext("sys_string", "IDS_COM_POP_DELETE_Q") +#define GL_STR_OK dgettext("sys_string", "IDS_COM_SK_OK") +#define GL_STR_ADD dgettext("sys_string", "IDS_COM_SK_ADD") +#define GL_STR_ADD_TAG dgettext("sys_string", "IDS_COM_OPT_ADD_TAG") +#define GL_STR_SELECTED dgettext("sys_string", "IDS_COM_POP_SELECTED") +#define GL_STR_CHNAGE_NAME dgettext("sys_string", "IDS_COM_BODY_CHANGE_NAME") +#define GL_STR_NO_VIDEOS dgettext("sys_string", "IDS_COM_BODY_NO_VIDEOS") +#define GL_STR_ADDED dgettext("sys_string", "IDS_COM_POP_ADDED") +#define GL_STR_MOVED dgettext("sys_string", "IDS_COM_POP_MOVED") +#define GL_STR_DELETING dgettext("sys_string", "IDS_COM_POP_DELETING") +#define GL_STR_MOVING dgettext("sys_string", "IDS_COM_POP_MOVING") +#define GL_STR_RENAME dgettext("sys_string", "IDS_COM_SK_RENAME") +#define GL_STR_SELECT_ALL dgettext("sys_string", "IDS_COM_BODY_SELECT_ALL") +#define GL_STR_NO_FILES_SELECTED dgettext("sys_string", "IDS_COM_POP_NO_FILES_SELECTED") +#define GL_STR_APPLICATION_NOT_INSTALLED dgettext("sys_string", "IDS_COM_BODY_APPLICATION_NOT_INSTALLED") + +#ifdef _cplusplus +} +#endif +#endif + diff --git a/include/util/gl-thread-util.h b/include/util/gl-thread-util.h new file mode 100755 index 0000000..a018824 --- /dev/null +++ b/include/util/gl-thread-util.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 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 _GL_THREAD_UTIL_H_ +#define _GL_THREAD_UTIL_H_ +typedef enum +{ + GL_PB_CANCEL_NONE, /* Initial state */ + GL_PB_CANCEL_NORMAL, /* Moving or deleting is in process */ + GL_PB_CANCEL_BUTTON, /* Cancel button tapped while moving or deleting */ + GL_PB_CANCEL_MMC, /* MMC removed, src album or dest album vanished while moving or deleting */ + GL_PB_CANCEL_ERROR, /* Error happened while moving or deleting */ + GL_PB_CANCEL_RESET, /* Reset gallery while moving or deleting */ +} gl_pb_cancel_mode; + +int gl_thread_emit_next_signal(void *data); +int gl_thread_wait_next_signal(void *data); +int gl_thread_set_cancel_state(void *data, int val); +int gl_thread_get_cancel_state(void *data, int *val); +void gl_thread_write_pipe(void *data, int finished_cnt, int popup_op); +int gl_thread_gen_data_thread(void *data); +int gl_thread_destroy_lock(void *data); +int gl_thread_init_lock(void *data); + +#endif /* _GL_THREAD_UTIL_H_ */ diff --git a/include/util/gl-ui-util.h b/include/util/gl-ui-util.h new file mode 100755 index 0000000..031ee75 --- /dev/null +++ b/include/util/gl-ui-util.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 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 _GL_UI_UTIL_H_ +#define _GL_UI_UTIL_H_ + +#include "gallery.h" +#include "gl-icons.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +#define _EDJ(o) elm_layout_edje_get(o) +#define _GET_ICON(_path) \ + ((1 == ecore_file_exists(_path) && (ecore_file_size(_path) > 0)) ? _path : GL_DEFAULT_THUMB_ICON) + +/* Signals used in Gallery's views */ +#define GL_SIGNAL_VIEW_SELALL_SHOW "selectall_show" +#define GL_SIGNAL_VIEW_SELALL_HIDE "selectall_hide" +#define GL_SIGNAL_VIEW_SELALL_TAG "selectall_show_tag" +#define GL_SIGNAL_VIEW_DEFAULT "elm,swallow_view,state,default" +#define GL_SIGNAL_VIEW_EDIT "elm,swallow_view,state,edit" +#define GL_SIGNAL_VIEW_MOVEUP "elm,swallow_view,state,moveup" +#define GL_SIGNAL_VIEW_TABBAR_BG_HIDE "elm,tabbar_bg,state,hide" +#define GL_SIGNAL_VIEW_TABBAR_BG_SHOW_PORT "elm,tabbar_bg,state,show_port" +#define GL_SIGNAL_VIEW_TABBAR_BG_SHOW_LAND "elm,tabbar_bg,state,show_land" +#define GL_SIGNAL_VIEW_TABBAR_DEFAULT "elm,tabbar,state,default" +#define GL_SIGNAL_VIEW_TABBAR_LAND "elm,tabbar,state,landscape" + +#define GL_TRANS_FINISHED "transition,finished" + +typedef enum +{ + GL_NAVI_ALBUMS, + GL_NAVI_ALBUMS_EDIT, + GL_NAVI_ALBUMS_RENAME, + GL_NAVI_ALBUMS_NEW, + GL_NAVI_ALBUMS_SELECT, + GL_NAVI_TAGS, + GL_NAVI_TAGS_EDIT, + GL_NAVI_TAGS_NEW, + GL_NAVI_TAGS_RENAME, + GL_NAVI_THUMBS, + GL_NAVI_THUMBS_WEB, + GL_NAVI_THUMBS_DOWNLOAD, + GL_NAVI_THUMBS_EDIT, + GL_NAVI_THUMBS_SELECT, +} gl_navi_mode; + +typedef enum +{ + GL_POPUP_SHARE_MESSAGE, + GL_POPUP_SHARE_EMAIL, + GL_POPUP_SHARE_BT, + GL_POPUP_SHARE_NUM, +} gl_popup_share_item; + +typedef enum { + GL_POPUP_MOVE_TAG_MOVE, + GL_POPUP_MOVE_TAG_TAG, + GL_POPUP_MOVE_TAG_NUM, +} gl_popup_move_tag_item; + +typedef enum _gl_ui_albums_btn_t gl_ui_albums_btn_e; + +enum _gl_ui_albums_btn_t { + GL_UI_ALBUMS_FIRST, + GL_UI_ALBUMS_REMAKE, +}; + +typedef struct _ctx_share_table +{ + gl_popup_share_item item; + const char *label; +} gl_popup_share_tbl; + +typedef struct _ctx_mv_tag_table { + gl_popup_move_tag_item item; + const char *label; +} gl_popup_mv_tag_tbl; + +Evas_Object *gl_ui_create_main_ly(Evas_Object *parent); +Evas_Object *gl_ui_create_naviframe(Evas_Object *parent); +int gl_ui_set_navi_title_visible(void *data, bool b_visible); +int gl_ui_create_title_and_push(void *data, Evas_Object *parent, + Evas_Object *obj, gl_navi_mode mode, char *title); +Evas_Object *gl_ui_load_edj(Evas_Object * parent, const char *file, const char *group); +Evas_Object *_gl_ui_get_view_layout(void *data, int view_mode); +int _gl_ui_update_selall(void *data, int all_cnt, int selected_cnt); +int gl_ui_update_select_widgets(void *data); +int gl_ui_show_selall(void *data); +int _gl_ui_pop_to_thumb(void *data); +int _gl_ui_disable_slideshow(void *data, bool b_disable); +int _gl_ui_show_add_btn(void *data); +int _gl_ui_clear_btns(void *data); +int _gl_ui_add_btns_albums(void *data, int type); +int _gl_ui_add_conform_cbs(Evas_Object *naviframe); +int _gl_ui_del_conform_cbs(Evas_Object *naviframe); +int _gl_ui_disable_btn(Evas_Object *btn); +int _gl_ui_enable_btn(Evas_Object *btn); +int _gl_ui_disable_each_btn(Elm_Object_Item *nf_it, bool b_more, bool b_btn1, + bool b_btn2); +int _gl_ui_disable_btns(Elm_Object_Item *nf_it, bool b_disable); +Evas_Object *_gl_ui_get_btn(void *data, Elm_Object_Item *nf_it, + const char *part); +void _gl_ui_slideshow_cb(void *data, Evas_Object *obj, void *event_info); +void _gl_ui_edit_cb(void *data, Evas_Object *obj, void *event_info); +int _gl_ui_set_btns_text(Elm_Object_Item *nf_it, char *btn_text, char *btn_text2); +int _gl_ui_reset_scroller_pos(Evas_Object *obj); +int _gl_ui_del_scroller_pos(Evas_Object *obj); +int _gl_ui_save_scroller_pos(Evas_Object *obj); +int _gl_ui_restore_scroller_pos(Evas_Object *obj); + +#ifdef _cplusplus +} +#endif + +#endif // end of _GL_UI_UTIL_H_ diff --git a/include/util/gl-util.h b/include/util/gl-util.h new file mode 100755 index 0000000..07bbc9e --- /dev/null +++ b/include/util/gl-util.h @@ -0,0 +1,158 @@ +/* + * Copyright (c) 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 _GL_UTIL_H_ +#define _GL_UTIL_H_ + +#include "gl-data.h" +#include "gallery.h" + +/* File system related String definition */ + +#define GL_HOME_ALBUM_COVER_NUM 1 + +#define GL_FILE_EXISTS(path) \ + (path && (1 == ecore_file_exists(path)) && (ecore_file_size(path) > 0)) +#define GL_ICON_SET_FILE(icon, img) \ + elm_image_file_set(icon, GL_IMAGES_EDJ_FILE, img) + +#define GL_IF_DEL_TIMER(timer) if(timer){ecore_timer_del(timer); timer = NULL;} +#define GL_IF_DEL_IDLER(idler) if(idler){ecore_idler_del(idler); idler = NULL;} +#define GL_IF_DEL_OBJ(obj) if(obj){evas_object_del(obj); obj = NULL;} + +typedef enum +{ + GL_MMC_STATE_NONE, + GL_MMC_STATE_ADDED, + GL_MMC_STATE_ADDED_MOVING, /* Move medias to MMC or from MMC */ + GL_MMC_STATE_ADDING_MOVING, /* Insert MMC while operate medias */ + GL_MMC_STATE_REMOVED, + GL_MMC_STATE_REMOVED_MOVING, /* Remove MMC while move medias to MMC or from MMC */ +} gl_mmc_state_mode; + +typedef enum +{ + GL_UPDATE_VIEW_NONE, + GL_UPDATE_VIEW_NORMAL, + GL_UPDATE_VIEW_MMC_REMOVED, /* Update view when MMC removed */ + GL_UPDATE_VIEW_MMC_ADDED, /* Update view when MMC inserted */ +} gl_update_view_mode; + +typedef enum +{ + GL_MEDIA_OP_NONE, + GL_MEDIA_OP_MOVE, + GL_MEDIA_OP_DELETE, + /* Add tag to media */ + GL_MEDIA_OP_ADD_TAG, + /* Remove tag from media */ + GL_MEDIA_OP_REMOVE_TAG, +#ifdef _USE_ROTATE_BG + GL_MEDIA_OP_ROTATING_LEFT, + GL_MEDIA_OP_ROTATING_RIGHT, +#endif +} gl_media_op_mode; + +typedef enum +{ + GL_POPUP_OP_NONE, + GL_POPUP_OP_SAME_ALBUM, + GL_POPUP_OP_DUPLICATED_NAME, + GL_POPUP_OP_PROTECTED_FILE, +} gl_popup_op_mode; + +typedef enum +{ + GL_SHARE_NONE, + GL_SHARE_DRM, /* DRM file selected, disable share option */ + GL_SHARE_IMAGE_ONE, /* One image selection */ + GL_SHARE_IMAGE_ONE_JPEG, /* One jpeg image selection */ + GL_SHARE_IMAGE_MULTI, /* Multiple images selection */ + GL_SHARE_IMAGE_MULTI_JPEG, /* Multiple jpeg images selection */ + GL_SHARE_IMAGE_VIDEO, /* Image(s) and Video(s) selection */ + GL_SHARE_VIDEO_ONE, /* One video selection */ + GL_SHARE_VIDEO_MULTI, /* Multiple videos selection */ +} gl_share_mode; + +typedef enum +{ + GL_INVALID_NONE, + GL_INVALID_NEW_ENTRY, + GL_INVALID_NEW_ENTRY_NOC, /* Show nocontents view */ + GL_INVALID_NEW_TAG_VIDEO, +} gl_invalid_mode; + +int gl_get_view_mode(void *data); +int gl_set_view_mode(void *data, int mode); +int _gl_use_thread_operate_medias(void *data, char *pbar_title, int all_cnt, + int op_type); +int _gl_move_media_thumb(gl_item * gitem, char *new_dir_name, + bool is_full_path, int *popup_op); +int _gl_move_media(gl_item *gitem, char *new_dir_name, bool is_full_path); +int gl_move_selected(void *data); +int gl_move_to_album(void *data); +int gl_move_root_album(void* data, gl_cluster* cur_album, char* dest_path); +int gl_update_move_view(void *data); +int gl_del_medias(void *data); +int gl_del_selected(void *data); +int gl_update_del_view(void *data); +int _gl_get_selected_paths(void *data, gchar sep_c, char **path_str, + int *sel_cnt); +int _gl_share_load(void *data, const char *label); +int gl_share_select_item(void *data, const char *label); +int gl_add_to_tag(void *data, const char *tagname); +int gl_add_tag(void *data, gl_tag * gtag); +int gl_add_tag_to_selected(void *data); +int gl_update_add_tag_view(void *data); +int gl_remove_tag_items(void *data); +int gl_remove_tag_from_selected(void *data); +int gl_update_remove_tag_view(void *data); +int gl_check_mmc_state(void *data, char *dest_folder); +int gl_del_albums(void *data); +int gl_refresh_albums_list(void *data); +int gl_reg_db_update_noti(void *data); +int gl_dereg_db_update_noti(void); +void gl_set_mmc_notifd(int fd); +Eina_Bool gl_update_view(void *data, int mode); +int gl_get_selected_files_path_str(void *data, gchar sep_c, char **path_str, + int *sel_cnt); +int gl_make_new_album(const char *name); +bool gl_check_gallery_empty(void* data); +bool gl_is_rotation_locked(void); +bool gl_is_image_valid(void *data, char *filepath); +#ifdef _USE_ROTATE_BG +int _gl_rotate_images(void *data, bool b_left); +int _gl_rotate_selected(void *data, int op_type); +int _gl_update_rotate_view(void *data); +#endif +int _gl_slideshow(void *data); +int gl_get_entry_text(Evas_Object * entry, char *entry_text, int len_max); +int gl_set_entry_text(Evas_Object *entry, char *entry_text); +int _gl_get_valid_album_name(void *data, char* album_name, bool b_new, + bool b_enter); +char* _gl_get_i18n_album_name(gl_cluster *album); +int _gl_get_valid_tag_name(void *data, char* tag_name, bool b_new, bool b_enter); +int gl_get_share_mode(void *data); +int gl_del_invalid_widgets(void *data, int invalid_m); +int _gl_destroy_ctrl_edit_view(void *data); +int _gl_destroy_thumbs_edit_view(void *data); +int gl_destroy_thumbs_view(void *data); +int gl_pop_to_ctrlbar_ly(void *data, bool b_update_albums_list); +int gl_play_vibration(void *data); +char *_gl_get_duration_string(unsigned int v_dur); +gl_icon_type _gl_get_icon_type(gl_item *git); + +#endif /* _GL_UTIL_H_ */ diff --git a/include/widget/gl-button.h b/include/widget/gl-button.h new file mode 100755 index 0000000..86facff --- /dev/null +++ b/include/widget/gl-button.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 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 _GL_BUTTON_H_ +#define _GL_BUTTON_H_ + +#include +#include "gallery.h" + +/**< Evas smart objects' "smart callback" function signature */ +typedef void (*But_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); + +Evas_Object *_gl_but_create_but(Evas_Object *parent, const char *icon, + const char *text, const char *style, + But_Smart_Cb cb_func, const void *data); +Evas_Object *_gl_but_create_but_popup(Evas_Object *parent, const char *text, + But_Smart_Cb cb_func, const void *data); + +#endif /* _GL_BUTTON_H_ */ + diff --git a/include/widget/gl-controlbar.h b/include/widget/gl-controlbar.h new file mode 100755 index 0000000..bc46c37 --- /dev/null +++ b/include/widget/gl-controlbar.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 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 _GL_CONTROLBAR_H_ +#define _GL_CONTROLBAR_H_ + +#include +#include "gallery.h" + +#define GL_CBAR_OCCUPIED_PBAR 4 +#define GL_CBAR_OCCUPIED_SEGMENT 4 + +typedef enum _gl_ctrl_tab_mode +{ + GL_CTRL_TAB_ALBUMS, + GL_CTRL_TAB_TAGS, + GL_CTRL_TAB_CNT, +} gl_ctrl_tab_mode; + +void _gl_ctrl_segment_change_cb(void *data, Evas_Object *obj, void *event_info); +Evas_Object *gl_ctrl_create_ctrlbar_view(Evas_Object * parent); +Evas_Object *gl_ctrl_create_ctrlbar_ly(Evas_Object *parent); +Evas_Object *gl_ctrl_create_ctrlbar(void *data, int mode); +int gl_ctrl_disable_tab_event(void *data, bool disabled); +int _gl_ctrl_sel_tabbar_item(void *data, const char *aul_type); +int _gl_ctrl_show_tabbar(void *data, bool b_show); +bool gl_ctrl_rotate_ctrlbar(void *data, int mode); +int gl_ctrl_disable_ctrlbar(void *data, bool disabled); +int _gl_ctrl_disable_btn(void *data, bool disabled, int mode); +int _gl_ctrl_disable_btns(void *data, Elm_Object_Item *nf_it, bool b_disable); + +#endif /* _GL_CONTROLBAR_H_ */ diff --git a/include/widget/gl-ctxpopup.h b/include/widget/gl-ctxpopup.h new file mode 100755 index 0000000..176fe15 --- /dev/null +++ b/include/widget/gl-ctxpopup.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 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 _GL_CTXPOPUP_H_ +#define _GL_CTXPOPUP_H_ + +typedef int (*ctx_append_cb) (void *data, Evas_Object *parent); + +int _gl_ctxpopup_create(void *data, Evas_Object *but, ctx_append_cb append_cb); +int _gl_ctxpopup_del(void *data); +int _gl_ctxpopup_create_albums(void *data, Evas_Object *but); +int _gl_ctxpopup_create_thumbs(void *data, Evas_Object *but); +int _gl_ctxpopup_create_share(void *data, Evas_Object *but); +int _gl_ctxpopup_create_move(void *data); +int _gl_ctxpopup_create_addtag(void *data); + +#endif + diff --git a/include/widget/gl-editfield.h b/include/widget/gl-editfield.h new file mode 100755 index 0000000..995403c --- /dev/null +++ b/include/widget/gl-editfield.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 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 _GL_EDITFIELD_H_ +#define _GL_EDITFIELD_H_ + +#include "gallery.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +Evas_Object *_gl_editfield_create(void *data, Evas_Object *parent, + char *default_label); +Evas_Object *_gl_editfield_create_genlist(void *data, Evas_Object *parent, + char *label); +int _gl_editfield_hide_imf(void *data); +int _gl_editfield_show_imf(void *data); +int _gl_editfield_destroy_imf(void *data); + + +#ifdef _cplusplus +} +#endif + +#endif // end of _GL_EDITFIELD_H_ diff --git a/include/widget/gl-nocontents.h b/include/widget/gl-nocontents.h new file mode 100755 index 0000000..c319f95 --- /dev/null +++ b/include/widget/gl-nocontents.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 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 _GL_NOCONTENTS_H_ +#define _GL_NOCONTENTS_H_ + +#include "gallery.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +Evas_Object *_gl_nocontents_create(void *data); +bool _gl_nocontents_update_label(Evas_Object *noc, const char *new_label); +bool _gl_nocontents_show(void *data); + +#ifdef _cplusplus +} +#endif + +#endif // end of _GL_NOCONTENTS_H_ diff --git a/include/widget/gl-notify.h b/include/widget/gl-notify.h new file mode 100755 index 0000000..c284e4a --- /dev/null +++ b/include/widget/gl-notify.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 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 _GL_NOTIFY_H_ +#define _GL_NOTIFY_H_ + +#include "gallery.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +int _gl_notify_create_notiinfo(void *data, const char *text); +int _gl_notify_create_selinfo(void *data, Evas_Object *parent, + Elm_Object_Item *nf_it, int all_cnt, + int selected_cnt, bool b_update); +int _gl_notify_destroy_selinfo(void *data); +int _gl_notify_update_lang(void *data, int cnt, int view_mode); + +#ifdef _cplusplus +} +#endif + +#endif // end of _GL_NOTIFY_H_ diff --git a/include/widget/gl-popup.h b/include/widget/gl-popup.h new file mode 100755 index 0000000..8f94739 --- /dev/null +++ b/include/widget/gl-popup.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 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 _GL_POPUP_H_ +#define _GL_POPUP_H_ + +#define GL_MOVE_TAG_MOVE GL_STR_MOVE +#define GL_MOVE_TAG_TAG GL_STR_ADD_TAG +#define GL_POPUP_STRING_MAX 256 + +typedef enum _gl_popup_mode { + GL_POPUP_NOBUT, + GL_POPUP_NOBUT_MOV_DEL, + GL_POPUP_NOBUT_APPEXIT, + GL_POPUP_ALBUM_NEW_EMPTY, + GL_POPUP_ALBUM_NEW_DUPLICATE, + GL_POPUP_ALBUM_NEW_INVALID, + GL_POPUP_ALBUM_RENAME_EMPTY, + GL_POPUP_ALBUM_RENAME_DUPLICATE, + GL_POPUP_ALBUM_RENAME_INVALID, + GL_POPUP_ALBUM_DELETE, + GL_POPUP_TAG_DELETE, + GL_POPUP_TAG_NEW_EMPTY, + GL_POPUP_TAG_RENAEM_EMPTY, + GL_POPUP_TAG_RENAME_DUPLICATE, +} gl_popup_mode; + +int gl_popup_create_albums_del_popup(void *data); +int gl_popup_create_tag_del_popup(void *data); +int gl_popup_create_popup(void *data, gl_popup_mode mode, char *desc); + +#endif /* _GL_POPUP_H_ */ diff --git a/include/widget/gl-progressbar.h b/include/widget/gl-progressbar.h new file mode 100755 index 0000000..ecb6aaf --- /dev/null +++ b/include/widget/gl-progressbar.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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 _GL_PROGRESSBAR_H_ +#define _GL_PROGRESSBAR_H_ + +/* Font style for show label of popup */ +#define GL_FONT_STYLE_POP_S "" +#define GL_FONT_STYLE_POP_E "" + +int gl_pb_make_thread_pbar(void *data, Evas_Object * parent, char *title); +int gl_pb_refresh_thread_pbar(void *data, int cur_cnt, int total_cnt); +int gl_pb_del_pbar(void *data); + +#endif /* _GL_PROGRESSBAR_H_ */ diff --git a/include/widget/gl-rotate-bg.h b/include/widget/gl-rotate-bg.h new file mode 100755 index 0000000..af38056 --- /dev/null +++ b/include/widget/gl-rotate-bg.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 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. + */ + +#ifdef _USE_ROTATE_BG + +#ifndef _GL_ROTATE_BG_H_ +#define _GL_ROTATE_BG_H_ + +#include "gallery.h" + +Evas_Object *_gl_rotate_bg_add(Evas_Object *parent); +int _gl_rotate_bg_set_file(Evas_Object *bg, const char *file, int w, int h); +int _gl_rotate_bg_rotate_image(Evas_Object *bg, unsigned int orient); +int _gl_rotate_bg_add_image(Evas_Object *bg, int w, int h); +int _gl_rotate_bg_set_image_file(Evas_Object *bg, const char *file); + +#endif + +#endif diff --git a/include/widget/gl-thumb.h b/include/widget/gl-thumb.h new file mode 100755 index 0000000..9793fd6 --- /dev/null +++ b/include/widget/gl-thumb.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 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 _GL_THUMB_H_ +#define _GL_THUMB_H_ + +#define GL_GENGRID_ITEM_STYLE_THUMBNAIL "gallery/thumbnail_view" +#define GL_THUMB_ICON "elm.swallow.icon" +#define GL_THUMB_CHECKBOX "elm.swallow.end" + +Evas_Object *_gl_thumb_show_part_icon_image(Evas_Object *obj, char *path, + int orient, bool b_favor, + bool is_expired_drm, int item_size); +Evas_Object *_gl_thumb_show_part_icon_video(Evas_Object *obj, char *path, + unsigned int v_dur, int bk_len, + bool b_favor, bool is_expired_drm, + int item_size); +Evas_Object *_gl_thumb_show_part_checkbox(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, const void *data); +Evas_Object *_gl_thumb_add_gengrid(Evas_Object *parent); +int _gl_thumb_update_gengrid(Evas_Object *view); +int _gl_thumb_set_size(void *data, Evas_Object *view, int count, int *size); + +#endif + diff --git a/include/widget/gl-tile.h b/include/widget/gl-tile.h new file mode 100755 index 0000000..4c506e2 --- /dev/null +++ b/include/widget/gl-tile.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 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 _GL_TILE_H_ +#define _GL_TILE_H_ + +#include "gl-data.h" + +#define GL_TILE_THUMB_1 1 +#define GL_TILE_THUMB_2 2 +#define GL_TILE_THUMB_3 3 +#define GL_TILE_THUMB_5 5 +#define GL_TILE_THUMB_6 6 + +#define GT_TILE_ONLYICON "elm.swallow.onlyicon" +#define GT_TILE_ICON "elm.swallow.icon" +#define GT_TILE_LABEL "label_bg" +#define GL_TILE_CHECKBOX "elm.swallow.end" +#define GL_TILE_CHECKBOX_GRID "elm.swallow.check_grid" +#define GL_TILE_RENAME "elm.swallow.rename" + +#define GL_GENGRID_STYLE_ALBUM_VIEW "gallery/albums_view" +#define GL_GENGRID_STYLE_ALBUM_EDIT_VIEW "gallery/albums_edit_view" + +/* Size of album icon */ +#define GL_TILE_SIZE 318 +/* Size of table padding */ +#define GL_TILE_PAD 3 +#define GL_TILE_PAD_2 2 +/* Pure size of album icon; value: 196 */ +#define GL_TILER_ICON_S (GL_TILE_SIZE - 2 * GL_TILE_PAD) +/** +* Album icon is set by elm_table, +* it's divided into 3x3, 9 grids, each grid size is 64 +*/ +#define GL_TILE_GRID_S 102 +/* value: 130 */ +#define GL_TILE_2X_GRID_S (GL_TILER_ICON_S - GL_TILE_GRID_S - GL_TILE_PAD) + +typedef int (*bg_file_set_cb) (Evas_Object *bg, void *data); + +Evas_Object *_gl_tile_show_part_icon(Evas_Object *obj, const char *part, + int length, double scale, + bg_file_set_cb func, void **data); +Evas_Object *_gl_tile_show_part_label(Evas_Object *obj, int index, + bool b_default); +Evas_Object *_gl_tile_show_part_checkbox_grid(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, + const void *data); +Evas_Object *_gl_tile_show_part_checkbox(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, const void *data); +Evas_Object *_gl_tile_show_part_rename(Evas_Object *obj, Evas_Smart_Cb func, + const void *data); +int _gl_tile_get_mtime(time_t *mtime1, time_t *mtime2, char *buf, int max_len); +Evas_Object *_gl_tile_add_gengrid(void *data, Evas_Object *parent); + + +#endif diff --git a/org.tizen.gallery.manifest b/org.tizen.gallery.manifest new file mode 100644 index 0000000..265d0ab --- /dev/null +++ b/org.tizen.gallery.manifest @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/org.tizen.gallery.rule b/org.tizen.gallery.rule new file mode 100755 index 0000000..f09440f --- /dev/null +++ b/org.tizen.gallery.rule @@ -0,0 +1,214 @@ +org.tizen.gallery system::vconf rwxat +org.tizen.gallery system::home rwxat +org.tizen.gallery system::media rwxat +org.tizen.gallery system::homedir rwxat +org.tizen.gallery system::share rwxat +org.tizen.gallery dali rwxat +org.tizen.gallery pulseaudio rwxat +org.tizen.gallery sys-assert::core rwxat +org.tizen.gallery device::hwcodec rw--- +org.tizen.gallery device::video rw--- +org.tizen.gallery device::camera rw--- +org.tizen.gallery system::crash -wx-- +org.tizen.gallery system::use_internet rwxat +org.tizen.gallery libaccounts-svc::db rw--- +org.tizen.gallery pkgmgr::db rw--- +org.tizen.gallery ail::db rw--- +org.tizen.gallery media-data::db rw--- +org.tizen.gallery app-svc::db rw--- +org.tizen.gallery email-service::db rw--- +org.tizen.gallery cloud-content-sync::db rw--- +org.tizen.gallery org.tizen.gallery::web-media.db rwx-- +org.tizen.gallery org.tizen.gallery::gallery-media.db rwx-- +org.tizen.gallery org.tizen.gallery::face-svc.db rwx-- +org.tizen.gallery notification::db rw--- +org.tizen.gallery org.tizen.indicator rwx-- +org.tizen.gallery org.tizen.image-editor rwx-- +org.tizen.gallery org.tizen.email rwx-- +org.tizen.gallery org.tizen.message rwx-- +org.tizen.gallery org.tizen.camera-app rw--- +org.tizen.gallery org.tizen.group-cast rw--- +org.tizen.gallery org.tizen.cluster-home rwx-- +org.tizen.gallery org.tizen.gallery-service rwx-- +org.tizen.gallery org.tizen.smemo rwx-- +org.tizen.gallery org.tizen.contacts rwx-- +org.tizen.gallery org.tizen.setting rwx-- +org.tizen.gallery download-provider rw--- +org.tizen.gallery wifi_direct_manager rw--- +org.tizen.gallery power_manager rwx-- +org.tizen.gallery email-service rwx-- +org.tizen.gallery contacts-service rwx-- +org.tizen.gallery media-server rwx-- +org.tizen.gallery sound_server rwx-- +org.tizen.gallery system-server rwxa- +org.tizen.gallery mdm-server rwx-- +org.tizen.gallery xorg rwx-- +org.tizen.gallery isf rwx-- +org.tizen.gallery immvibed rwx-- +org.tizen.gallery dbus rwxat +org.tizen.gallery data-provider-master rw--- +org.tizen.gallery data-provider-master::shortcut rw--- +org.tizen.gallery data-provider-master::shortcut.livebox -w--- +org.tizen.gallery data-provider-master::notification rw--- +org.tizen.gallery smemo r-x-- +org.tizen.gallery crash-worker r-x-- +org.tizen.gallery msg-service rwx-- +org.tizen.gallery webkit2-efl r-x-- +org.tizen.gallery ug-image-viewer-efl rwxat +org.tizen.gallery net.wifi-qs rwx-- +org.tizen.gallery sys-assert::info -wx-- +org.tizen.gallery allshare::svc rwx-- +org.tizen.gallery cloud-content-sync rwx-- +org.tizen.gallery drmfw rw--- +org.tizen.gallery deviced rwxa- +org.tizen.gallery xorg::screencapture r---- +org.tizen.gallery contacts-service::db rwx-- +org.tizen.gallery device::app_logging -w--- +org.tizen.gallery csc-manager rwx-- +org.tizen.gallery org.tizen.gallery rwxa- +org.tizen.gallery ims-service::db rw--- +org.tizen.gallery system::vconf_inhouse rwxat +org.tizen.gallery system::vconf_setting rwxat +org.tizen.gallery system::vconf_system rw--- +e17 org.tizen.gallery rw--- +media-server org.tizen.gallery -w--- +org.tizen.gallery contacts-service::svc rw--- +org.tizen.gallery contacts-service::phonelog rw--- +org.tizen.gallery msg-service::read rw--- +org.tizen.gallery msg-service::write rw--- +org.tizen.gallery msg-service::wappush rw--- +org.tizen.gallery telephony_framework::api_manager r---- +org.tizen.gallery telephony_framework::api_modem -w--- +org.tizen.gallery cbhm rwx-- +org.tizen.gallery data-provider-master::utility rw--- +org.tizen.gallery net-config r-x-- +org.tizen.gallery pkgmgr r---- +org.tizen.gallery efreet r-x-- +org.tizen.gallery org.tizen.myfile rw--- +org.tizen.gallery ug-email-viewer-efl rwx-- +org.tizen.gallery ug-email-docsearch-efl --x-- +org.tizen.gallery camera-external-engine rw--- +org.tizen.gallery system::vconf_inouse r---- +org.tizen.gallery system::vconf_privacy r---- +org.tizen.gallery system::vconf_multimedia rw--- +org.tizen.gallery system::vconf_network rw--- +org.tizen.gallery system::vconf_misc r---- +aul org.tizen.gallery rwx-- +isf org.tizen.gallery r-x-- +org.tizen.gallery-service org.tizen.gallery rwx-- +org.tizen.cluster-home ug-image-viewer-efl r-x-- +org.tizen.lockscreen ug-image-viewer-efl r-x-- +org.tizen.gallery smemo::db rw--- +org.tizen.gallery org.tizen.browser rw--- +org.tizen.gallery org.tizen.calendar rwx-- +org.tizen.gallery calendar-service rwx-- +org.tizen.gallery device::sys_logging -w--- +org.tizen.gallery data-provider-master::badge rw--- +org.tizen.gallery resman::db rw--- +org.tizen.gallery map-efl rwxat +org.tizen.gallery ug-email-composer-efl rwxat +org.tizen.gallery ui-gadget::client --x-- +org.tizen.gallery secure-storage::pkcs12 r---- +org.tizen.gallery email-service::write rw--- +org.tizen.gallery calendar-service::svc rw--- +org.tizen.app-tray org.tizen.gallery r-x-- +org.tizen.gallery ug_bluetooth r-x-- +org.tizen.gallery syspopup::db rwx-- +org.tizen.gallery bt-service::admin -w--- +org.tizen.gallery bt-service::gap -w--- +org.tizen.gallery bt-service::manager -w--- +org.tizen.gallery system::app_logging -w--- +org.tizen.gallery svi-data rwxat +org.tizen.gallery org.tizen.volume rwx-- +org.tizen.gallery org.tizen.setting::default-resources r-x-- +org.tizen.gallery device::mdnie rw--- +org.tizen.gallery pkgmer::db r---- +org.tizen.gallery stt-server rwx-- +org.tizen.gallery tts-server rwx-- +org.tizen.gallery ug-camera-efl rwxat +org.tizen.gallery vcs-server rwx-- +org.tizen.gallery image-filter-d::db rw--- +org.tizen.gallery location_fw::db rw--- +org.tizen.gallery org.tizen.svoice rwx-- +org.tizen.gallery org.tizen.dropbox r-x-- +org.tizen.gallery org.tizen.facebook r-x-- +org.tizen.gallery oma-ds-agent rwx-- +oma-ds-agent org.tizen.gallery rwx-- +org.tizen.gallery oma-ds-agent::cfg rwxat +org.tizen.setting org.tizen.gallery r-x-- +org.tizen.setting oma-ds-agent::cfg rwx-- +system::use_internet oma-ds-agent rwx-- +oma-ds-agent system::use_internet rwx-- +org.tizen.gallery syslogd rwx-- +org.tizen.gallery e17 r---- +org.tizen.gallery dlogutil r-x-- +org.tizen.gallery telephony_framework r-x-- +org.tizen.gallery aul r-x-- +org.tizen.gallery ode r-x-- +org.tizen.gallery sensor-framework r-x-- +org.tizen.gallery secure-storage r-x-- +org.tizen.gallery starter r-x-- +org.tizen.gallery osp-app-service r-x-- +org.tizen.gallery osp-security-service r-x-- +org.tizen.gallery osp-channel-service r-x-- +org.tizen.gallery org.tizen.app-tray r-x-- +org.tizen.gallery org.tizen.quickpanel r-x-- +org.tizen.gallery connman rwx-- +org.tizen.gallery mobicore-daemon r-x-- +org.tizen.gallery alarm-server rwx-- +org.tizen.gallery brcm_daemon r-x-- +org.tizen.gallery resman r-x-- +org.tizen.gallery osp-connectivity-service rwx-- +org.tizen.gallery push-service rwx-- +org.tizen.gallery eas-engine rwx-- +org.tizen.gallery org.tizen.data-provider-slave rwx-- +org.tizen.gallery org.tizen.data-provider-slave rwx-- +org.tizen.gallery usb-server rwx-- +org.tizen.gallery mtp-responder rwx-- +org.tizen.gallery sdbd rwx-- +ui-gadget::client oma-ds-agent::svc rw--- +org.tizen.gallery data-provider-master::notification.client -w--- +org.tizen.gallery samsung-account-front r-x-- +org.tizen.gallery worldclock::db rw--- +org.tizen.gallery thumb-server r---- +org.tizen.gallery data-provider-master::shortcut.shortcut -w--- +context-service org.tizen.gallery r-x-- +org.tizen.gallery location_fw::client rwx-- +org.tizen.gallery org.tizen.smartsearch --x-- +org.tizen.gallery ug-map-efl rwxat +system::use_internet org.tizen.gallery -w--- +org.tizen.gallery obexd r-x-- +org.tizen.gallery org.tizen.fileshare-service rwxat +org.tizen.fileshare-service org.tizen.gallery r-x-- +org.tizen.gallery nfc-manager rwx-- +org.tizen.gallery nfc-manager::p2p rwx-- +org.tizen.gallery nfc-manager::admin rwx-- +org.tizen.gallery ug-setting-gallery-efl rwxat +org.tizen.gallery org.tizen.music-player --x-- +org.tizen.cluster-home org.tizen.gallery r-x-- +org.tizen.gallery phone-misc::db rw--- +org.tizen.gallery msg-service::db rw--- +org.tizen.gallery ug-msg-viewer-efl rwxat +org.tizen.data-provider-slave org.tizen.gallery rwx-- +org.tizen.contacts org.tizen.gallery rwx-- +org.tizen.camera-app org.tizen.gallery rwx-- +org.tizen.email org.tizen.gallery rwx-- +org.tizen.music-player org.tizen.gallery rw--- +org.tizen.dailybriefing-agent org.tizen.gallery --x-- +org.tizen.volume org.tizen.gallery --x-- +org.tizen.quickpanel org.tizen.gallery r-x-- +org.tizen.lockscreen org.tizen.gallery r-x-- +org.tizen.indicator org.tizen.gallery rwx-- +webkit2-efl org.tizen.gallery --x-- +nfc-share-service org.tizen.gallery rw--- +net.wifi-qs org.tizen.gallery --x-- +org.tizen.data-provider-slave media-data::db rwx-- +org.tizen.data-provider-slave media-server rwx-- +org.tizen.data-provider-slave download-provider r---- +org.tizen.data-provider-slave cloud-content-sync r-x-- +org.tizen.data-provider-slave drmfw rwx-- +org.tizen.data-provider-slave org.tizen.gallery::face-svc.db rw--- +org.tizen.data-provider-slave org.tizen.gallery::web-media.db rw--- +org.tizen.data-provider-slave org.tizen.gallery::gallery-media.db rw--- +org.tizen.add-viewer org.tizen.gallery rwx-- +org.tizen.gallery org.tizen.browser::vconf_public rw--- diff --git a/org.tizen.gallery.xml b/org.tizen.gallery.xml new file mode 100755 index 0000000..8138156 --- /dev/null +++ b/org.tizen.gallery.xml @@ -0,0 +1,75 @@ + + + + Jiansong Jin + Gallery + + org.tizen.gallery.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packaging/org.tizen.gallery.spec b/packaging/org.tizen.gallery.spec new file mode 100644 index 0000000..e6959db --- /dev/null +++ b/packaging/org.tizen.gallery.spec @@ -0,0 +1,104 @@ +%define _optdir /opt/usr +%define _usrdir /usr +%define _appdir %{_usrdir}/apps +%define _appdatadir %{_optdir}/apps +%define _ugdir %{_usrdir}/ug + +Name: org.tizen.gallery +Summary: org.tizen.gallery UX +Version: 1.1.48 +Release: 1 +Group: Applications +License: Flora-1.1 +Source0: %{name}-%{version}.tar.gz +BuildRequires: cmake +BuildRequires: gettext-tools +BuildRequires: edje-tools +BuildRequires: pkgconfig(capi-content-media-content) +BuildRequires: pkgconfig(drm-client) +BuildRequires: pkgconfig(ui-gadget-1) +BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(ecore-imf) +BuildRequires: pkgconfig(ecore-x) +BuildRequires: pkgconfig(eina) +BuildRequires: pkgconfig(evas) +BuildRequires: pkgconfig(edje) +BuildRequires: pkgconfig(ecore) +BuildRequires: pkgconfig(ecore-file) +BuildRequires: pkgconfig(ecore-input) +BuildRequires: pkgconfig(vconf) +BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gthread-2.0) +BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(haptic) +BuildRequires: pkgconfig(utilX) +BuildRequires: pkgconfig(notification) + +Requires: media-server ug-image-viewer-efl + +%description +Description: org.tizen.gallery UX + +%package -n ug-gallery-efl +Summary: gallery UG +Group: TO_BE/FILLED_IN + +%description -n ug-gallery-efl +Description: gallery UG + +%prep +%setup -q + +%build + +%ifarch %{arm} +CXXFLAGS+=" -D_ARCH_ARM_ -mfpu=neon -mfloat-abi=softfp" +%endif + +cmake . -DCMAKE_INSTALL_PREFIX=%{_appdir}/org.tizen.gallery + +make %{?jobs:-j%jobs} + +%install +rm -rf %{buildroot} +mkdir -p %{buildroot}/usr/share/license +cp LICENSE.Flora %{buildroot}/usr/share/license/org.tizen.gallery +cp LICENSE.Flora %{buildroot}/usr/share/license/ug-gallery-efl + +%make_install + +%post +chown -R 5000:5000 %{_appdatadir}/org.tizen.gallery/data +%postun + +%post -n ug-gallery-efl +mkdir -p /usr/ug/bin/ +ln -sf /usr/bin/ug-client /usr/ug/bin/gallery-efl +%postun -n ug-gallery-efl + +%files -n org.tizen.gallery +%manifest org.tizen.gallery.manifest +%defattr(-,root,root,-) +%{_appdir}/org.tizen.gallery/bin/* +%{_appdir}/org.tizen.gallery/res/locale/* +/usr/share/icons/default/small/* +%{_appdir}/org.tizen.gallery/res/images/* +%{_appdir}/org.tizen.gallery/res/edje/* +%{_appdatadir}/org.tizen.gallery/data +/usr/share/packages/org.tizen.gallery.xml +/usr/share/miregex/* +/etc/smack/accesses.d/org.tizen.gallery.rule +/usr/share/license/org.tizen.gallery + +%files -n ug-gallery-efl +%manifest ug-gallery-efl.manifest +%defattr(-,root,root,-) +%{_ugdir}/lib/libug-gallery-efl.so* +%{_ugdir}/res/edje/gallery-efl/* +%{_ugdir}/res/images/gallery-efl/* +%{_ugdir}/res/locale/*/*/ug-gallery*.mo +/usr/share/packages/ug-gallery-efl.xml +/etc/smack/accesses2.d/ug.gallery-efl.include +/usr/share/license/ug-gallery-efl diff --git a/res/gallery.uri b/res/gallery.uri new file mode 100755 index 0000000..721d80e --- /dev/null +++ b/res/gallery.uri @@ -0,0 +1,2 @@ +(^( )*gallery:)([a-zA-Z0-9]+) +Gallery Album Shortcut Internal diff --git a/res/icon/org.tizen.gallery.png b/res/icon/org.tizen.gallery.png new file mode 100755 index 0000000000000000000000000000000000000000..34aacd0b6307cf62eaaba501f73c5dbf4931d31b GIT binary patch literal 57662 zcmdSC2Y_8wxwpSgn=^eTQ__0~gg_E{??H;7NV|a85CpLyHdGWrq$pk$QE7r;LqJeb zQL6ObODGA1^gfwPpE>RSJZsNHz25r&^t*mL*>ld>d+k-;-`m!^%KrMh-g$6C?fBXd zLc^hl9C#F;pY^P+;_oN3x8BW1%_k2z;nN}1wR)z)RX-dXLhTW!&!7LUcYXMb&z$k; z51;YLsfW&=KlPKJI^)#SKlY&zKL7ePN1t}g(Q8KU-T!9K0f$|D?)MHmNpZaI5eP4n9?o_76f?ML1}>TPe!PI&CPi!TusXuD)-(i5FFx)*f)> zds63qEp^{#F5T_0>T}z|eqa370Y4A>9h5rvnk%+EI$W0xA9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2=bqt)bE{?< z|Fo|Qny9DVF*ho45wj$B|NGy5&0tUGMVNcD3XJ83Yg4K zhRqEX%-;}3N%R#z6)|2B7T{8l9BqtU#x-ID+!)reqmC<9EOMv}geI6px9?%!@y~zc z>wCY$VG>dm>nZ2$^@bs8dxp4SrPu#bE&B)W-Zp&s$l#qM%dbZrUdFnW6)0g^{y{VW z69kZa1~0lIGm`$U+u0@~Q9s?yLQt{+0f0OPTNfmw2bXw?9vheuMqwfvIb| a`r7**`21G7G$+Y>Zn)`P|9su;pZR}zP;Y$z literal 0 HcmV?d00001 diff --git a/res/po/CMakeLists.txt b/res/po/CMakeLists.txt new file mode 100755 index 0000000..bdb759a --- /dev/null +++ b/res/po/CMakeLists.txt @@ -0,0 +1,30 @@ +# 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 res/locale/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo) +#Share mo files with Gallery UG. + INSTALL(FILES ${moFile} DESTINATION /usr/ug/res/locale/${lang}/LC_MESSAGES RENAME ${GALLERY_UG_PROJECT_NAME}.mo) + SET(moFiles ${moFiles} ${moFile}) +ENDFOREACH(pofile) + +MESSAGE(".mo files: ${moFiles}") +ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles}) diff --git a/res/po/POTFILES.in b/res/po/POTFILES.in new file mode 100755 index 0000000..e8ad1de --- /dev/null +++ b/res/po/POTFILES.in @@ -0,0 +1,28 @@ +# List of source files containing translatable strings. +../src/gallery.c +../src/features/gl-albums.c +../src/features/gl-gridview.c +../src/features/gl-listview.c +../src/features/gl-places-footsteps.c +../src/features/gl-places.c +../src/features/gl-tags.c +../src/features/gl-webalbum.c +../src/widget/gl-button.c +../src/widget/gl-controlbar.c +../src/widget/gl-nocontents.c +../src/widget/gl-popup.c +../src/widget/gl-progressbar.c +../src/util/gl-2d-util.c +../src/util/gl-allshare-util.c +../src/util/gl-db-handler.c +../src/util/gl-debug.c +../src/util/gl-ext-exec.c +../src/util/gl-ext-ug-load.c +../src/util/gl-net-if.c +../src/util/gl-ptp-util.c +../src/util/gl-share-login.c +../src/util/gl-sns-util.c +../src/util/gl-ta.c +../src/util/gl-thread-util.c +../src/util/gl-ui-util.c +../src/util/gl-util.c diff --git a/res/po/ar.po b/res/po/ar.po new file mode 100755 index 0000000..14827c2 --- /dev/null +++ b/res/po/ar.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "البطاقات" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "كافة الألبومات" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "الألبومات" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "لا توجد ألبومات" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "تحديد العلامات" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "إنشاء ألبوم" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "غير قادر على تغيير الاسم. جاري استخدام الملف" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "لا يوجد اسم" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "لا توجد ألبومات محددة" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "لم يتم تحديد أية علامات" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "اختيار عنصر" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "تحديد ألبوم‬" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "هل تريد إعادة المحاولة؟" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "نفس الاسم مستخدم مسبقا" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "المدخل خالي" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "متغير إدخال غير صحيح" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "إنشاء ع." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "لا توجد علامات" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "تدوير لليسار" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "تدوير لليمين" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "عرض شرائح" + diff --git a/res/po/az.po b/res/po/az.po new file mode 100755 index 0000000..3932ebd --- /dev/null +++ b/res/po/az.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Yarlıklar" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Bütün albomlar" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albomlar" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Albom yoxdur" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Etiketləri seç" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Albom yaradın" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Yenidən adlandırmaq mümkün deyildir" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Ad yoxdur" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Albom seçilməyib" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Heç bir etiket seçilməyib" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Element seç" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Albom seç" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Yenidən cəhd edilsin?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Eyni ad hazırda istifadə edilir" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Boş qeyd" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Yanlış daxiletmə parametrləri" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Et.yaradın" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Etiket yoxdur" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Sola döndər" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Sağa döndər" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slyd nmyşi" + diff --git a/res/po/bg.po b/res/po/bg.po new file mode 100755 index 0000000..0951d9d --- /dev/null +++ b/res/po/bg.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Тагове" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Всички албуми" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Албуми" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Няма албуми" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Изберете тагове" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Създаване на албум" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Не може да се преименува" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Без име" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Не са избрани албуми" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Няма избрани тагове" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Изберете елемент" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Избор на албум" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Повторен опит?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Такова име вече се използва" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Празен запис" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Невалиден параметър на входа" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Създ. таг" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Без тагове" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Завъртане наляво" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Завъртане надясно" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Слайдшоу" + diff --git a/res/po/ca.po b/res/po/ca.po new file mode 100755 index 0000000..74ac58d --- /dev/null +++ b/res/po/ca.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etiquetes" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Tots els àlbums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Àlbums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Cap àlbum" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Seleccionar etiquetes" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Crear àlbum" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "No es pot canviar nom" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Sense nom" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Sense àlbums seleccionats" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "No s'ha seleccionat cap etiqueta" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Seleccionar element" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Seleccionar àlbum" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Tornar-ho a intentar?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "El mateix nom ja està en ús" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "L'entrada és buida" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Paràmetre d'entrada no vàlid" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Crear etiq" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Sense etiquetes" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Girar cap a l'esquerra" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Girar cap a la dreta" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diaposit" + diff --git a/res/po/cs.po b/res/po/cs.po new file mode 100755 index 0000000..13a9d60 --- /dev/null +++ b/res/po/cs.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Značky" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "VÅ¡echna alba" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Alba" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Žádná alba" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Vyberte značky" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Vytvořit album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nelze přejmenovat" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Žádný název" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nejsou vybrána žádná alba" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nejsou vybrány žádné značky" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Vybrat položku" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Vybrat album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Opakovat?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Stejný název je již použit" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Prázdná položka" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Chybný vstupní parametr" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Vytv. zn." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Žádné značky" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Otočit doleva" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Otočit doprava" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Prezent." + diff --git a/res/po/da.po b/res/po/da.po new file mode 100755 index 0000000..3cab903 --- /dev/null +++ b/res/po/da.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tags" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alle album" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ingen album" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Vælg koder" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Opret album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Kunne ikke omdøbe" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Intet navn" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Ingen valgte album" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Der er ikke valgt nogen koder" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Vælg element" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Vælg album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Prøv igen?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Det samme navn er allerede i brug" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Posten er tom" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Ugyldigt inputparameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Opret kode" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Ingen tags" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotér mod uret" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotér med uret" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diasshow" + diff --git a/res/po/de_DE.po b/res/po/de_DE.po new file mode 100755 index 0000000..741269f --- /dev/null +++ b/res/po/de_DE.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tags" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alle Alben" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Alben" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Keine Alben" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Tags auswählen" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Album erstellen" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Umbenennen nicht möglich" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Kein Name" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Keine Alben ausgewählt." + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Keine Tags ausgewählt" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Element auswählen" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Album auswählen" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Erneut versuchen?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Derselbe Name wird bereits verwendet" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Eintrag ist leer" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Ungültiger Eingabeparameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Tag erst." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Keine Markierungen" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Nach links drehen" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Nach rechts drehen" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diashow" + diff --git a/res/po/el_GR.po b/res/po/el_GR.po new file mode 100755 index 0000000..3282ced --- /dev/null +++ b/res/po/el_GR.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Ετικέτες" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Όλα τα άλμπουμ" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Άλμπουμ" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Δεν υπάρχουν άλμπουμ" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Επιλέξτε ετικέτα" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Δημιουργία άλμπουμ" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Δεν είναι δυνατή η μετονομασία" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Κανένα όνομα" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Δεν έχουν επιλεγεί άλμπουμ" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Δεν έχουν επιλεγεί ετικέτες" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Επιλογή στοιχείου" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Επιλογή άλμπουμ" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Επανάληψη;" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Το όνομα χρησιμοποιείται ήδη" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Κενή καταχώρηση" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Μη έγκυρη παράμετρος δεδομένων εισόδου" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Δημ. ετικ." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Δεν υπάρχουν ετικέτες" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Περιστροφή προς τα αριστερά" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Περιστροφή προς τα δεξιά" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Παρ/σίαση" + diff --git a/res/po/en.po b/res/po/en.po new file mode 100755 index 0000000..39c3042 --- /dev/null +++ b/res/po/en.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tags" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "All albums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "No albums" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Select tags" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Create album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Unable to rename" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "No name" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "No albums selected" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "No tags selected" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Select item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Select album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Retry?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Same name already in use" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entry is empty" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Invalid input parameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Create tag" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "No tags" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotate left" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotate right" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slide show" + diff --git a/res/po/en_PH.po b/res/po/en_PH.po new file mode 100755 index 0000000..e244a39 --- /dev/null +++ b/res/po/en_PH.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tags" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "All albums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "No albums" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Select tags" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Create album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Unable to rename" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "No name" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "No albums selected" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "No tags selected" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Select item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Select album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Retry?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Same name already in use" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Phone contact is empty" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Invalid input parameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Create tag" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "No tags" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotate left" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotate right" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slide show" + diff --git a/res/po/en_US.po b/res/po/en_US.po new file mode 100755 index 0000000..39c3042 --- /dev/null +++ b/res/po/en_US.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tags" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "All albums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "No albums" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Select tags" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Create album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Unable to rename" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "No name" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "No albums selected" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "No tags selected" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Select item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Select album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Retry?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Same name already in use" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entry is empty" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Invalid input parameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Create tag" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "No tags" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotate left" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotate right" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slide show" + diff --git a/res/po/es_ES.po b/res/po/es_ES.po new file mode 100755 index 0000000..32de096 --- /dev/null +++ b/res/po/es_ES.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etiquetas" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Todos los álbumes" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Álbumes" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "No hay álbumes" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Seleccionar etiquetas" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Crear álbum" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Imposible cambiar el nombre" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Sin nombre" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "No hay álbumes seleccionados" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "No hay etiquetas seleccionadas" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Seleccionar elemento" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Seleccionar álbum" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "¿Volver a intentar?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "El mismo nombre ya está en uso" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entrada vacía" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parámetro de entrada no válido" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Crear etiq" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Sin etiquetas" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Girar a la izquierda" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Girar a la derecha" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Pres diap" + diff --git a/res/po/es_MX.po b/res/po/es_MX.po new file mode 100755 index 0000000..e368eaf --- /dev/null +++ b/res/po/es_MX.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etiquetas" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Todos los álbumes" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Álbumes" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "No hay álbumes" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Seleccionar etiquetas" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Crear álbum" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "No se puede renombrar" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Sin nombre" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "No hay álbumes seleccionados" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "No hay etiquetas seleccionadas" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Seleccionar elemento" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Seleccionar álbum" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "¿Volver a intentar?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Ya existe ese nombre" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entrada vacía" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parámetro de entrada no válido" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Crear etiq" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Sin etiquetas" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Girar a la izquierda" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Girar a la derecha" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Pres diap" + diff --git a/res/po/et.po b/res/po/et.po new file mode 100755 index 0000000..610f5b4 --- /dev/null +++ b/res/po/et.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Sildid" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Kõik albumid" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumid" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Albumid puuduvad" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Vali silte" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Loo album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Ei saa ümber nimetada" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nimi puudub" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Ühtegi albumit pole valitud" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Silte ei ole valitud" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Vali üksus" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Valige album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Proovi uuesti?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "See nimi on juba kasutusel" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Kirje on tühi" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Vigane sisestusparameeter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Loo silt" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Silte pole" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Pööra vasakule" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Pööra paremale" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slaidis." + diff --git a/res/po/eu.po b/res/po/eu.po new file mode 100755 index 0000000..9f28d55 --- /dev/null +++ b/res/po/eu.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etiketak" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Album guztiak" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumak" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Albumik ez" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Aukeratu etiketak" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Albuma sortu" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Ezin da berrizendatu" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Izenik gabe" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Ez da albumik aukeratu" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Ez da etiketarik aukeratu" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Elementua aukeratu" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Aukeratu albuma" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Berriz saiatu?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Izen bera dagoeneko erabiltzen" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Sarrera hutsik dago" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Sarrera parametro baliogabea" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Sor. etik." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Etiketarik ez" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Ezkerrera biratu" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Eskuinera biratu" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Erakusketa" + diff --git a/res/po/fi.po b/res/po/fi.po new file mode 100755 index 0000000..9128e48 --- /dev/null +++ b/res/po/fi.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tunnisteet" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Kaikki albumit" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumit" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ei albumeita" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Valitse tunnisteet" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Luo albumi" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Ei voi nimetä uudelleen" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Ei nimeä" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Albumeita ei ole valittu" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Tunnisteita ei ole valittu" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Valitse kohde" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Valitse albumi" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Yritetäänkö uudelleen?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Sama nimi on jo käytössä" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Tyhjä tieto" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Virheellinen syöteparametri" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Luo tunn." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Ei tunnisteita" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Kierrä vastapäivään" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Kierrä myötäpäivään" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diaesitys" + diff --git a/res/po/fr_CA.po b/res/po/fr_CA.po new file mode 100755 index 0000000..8339c84 --- /dev/null +++ b/res/po/fr_CA.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Libellés" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Tous les albums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Aucun album" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Sélectionner libellés" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Créer un album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Impossible de renommer l'élément" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Aucun nom" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Aucun album sélectionné" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Aucun libellé sélectionné" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Sélectionner un élément" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Sélectionner un album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Réessayer?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Nom déjà utilisé" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entrée vide" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Paramètre d'entrée non valide" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Nv libellé" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Aucun libellé" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Pivoter vers la gauche" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Pivoter vers la droite" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diaporama" + diff --git a/res/po/fr_FR.po b/res/po/fr_FR.po new file mode 100755 index 0000000..1ca6c92 --- /dev/null +++ b/res/po/fr_FR.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Libellés" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Tous les albums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Aucun album" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Sélectionner libellés" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Créer un album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Impossible de renommer l'élément" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Aucun nom" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Aucun album sélectionné" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Aucun libellé sélectionné" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Sélectionner un élément" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Sélectionner un album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Réessayer ?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Nom déjà utilisé" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entrée vide" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Paramètre d'entrée non valide" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Nv libellé" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Aucun tag" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotation à gauche" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotation à droite" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diaporama" + diff --git a/res/po/ga.po b/res/po/ga.po new file mode 100755 index 0000000..6f33824 --- /dev/null +++ b/res/po/ga.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Clibeanna" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Gach albam" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albaim" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Níl albaim ann" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Roghnaigh clibeanna" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Déan albam" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Ní féidir athainmniú" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Níl ainm ann" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Níor roghnaíodh albam" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Níl clib roghnaithe" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Roghnaigh mír" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Roghnaigh albam" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Atriail?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Ainm céanna in úsáid cheana" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Tá an iontráil folamh" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Paraiméadar ionchuir neamhbhailí" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Déan clib" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Níl clibeanna ann" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rothlaigh ar chlé" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rothlaigh ar dheis" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Sleamhnán" + diff --git a/res/po/gl.po b/res/po/gl.po new file mode 100755 index 0000000..f424871 --- /dev/null +++ b/res/po/gl.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etiquetas" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Todos os álbums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Álbums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Non hai álbums" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Seleccionar etiquetas" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Crear álbum" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Non se pode cambiar o nome" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Sen nome" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Non hai ningún álbum seleccionado" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Non hai etiquetas seleccionadas" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Seleccionar elemento" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Seleccionar álbum" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Volver intentar?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Este nome xa está en uso" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "A entrada está baleira" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parámetro de entrada non válido" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Crear etiq" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Ningunha etiqueta" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Xirar á esquerda" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Xirar á dereita" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diapos" + diff --git a/res/po/hi.po b/res/po/hi.po new file mode 100755 index 0000000..f336e53 --- /dev/null +++ b/res/po/hi.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "टैग्‍स" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "सभी एलबम्‍स" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "अल्बम्स" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "कोई एल्बम नहीं" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "टैग्स चुनें" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "अल्बम बनाएँ" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "नाम बदलने में अक्षम" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "नाम नहीं" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "कोई अल्बम चुना नहीं गया" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "कोई टैग्स चुने नहीं" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "मद चुनें" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "एल्बम चुनें" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "पुनः प्रयास करें?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "ऐसा ही नाम पहले से इस्तेमाल में है" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "प्रविष्टि खाली है" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "अमान्य इनपुट पैरामीटर" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "टैग बनाएँ" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "कोई टैग्स नहीं" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "बाएँ घुमाएँ" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "दाएँ घुमाएँ" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "स्लाइड शो" + diff --git a/res/po/hr.po b/res/po/hr.po new file mode 100755 index 0000000..2cdee41 --- /dev/null +++ b/res/po/hr.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Oznake" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Svi albumi" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumi" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nema albuma" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Odaberite oznake" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Novi album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nemoguće preimenovati" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nema imena" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nema odabranih albuma" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nema odabranih oznaka" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Odaberite stavku" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Odaberi album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Ponoviti?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Već postoji isto ime" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Unos prazan" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Neispravan ulazni parametar" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Nova oznaka" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Nema oznaka" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotiraj ulijevo" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotiraj udesno" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Prezentacija" + diff --git a/res/po/hu.po b/res/po/hu.po new file mode 100755 index 0000000..3455be1 --- /dev/null +++ b/res/po/hu.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Címkék" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Összes album" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumok" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nincs album" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Jelöljön ki címkéket" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Album létrehozása" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nem lehet átnevezni" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nincs név" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nincs kijelölt album" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nincs kiválasztott címke" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Elem kiválasztása" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Album kiválasztása" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Újra próbálkozik?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Már van ilyen név" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "A bejegyzés üres" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Érvénytelen bemeneti paraméter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Létrehozás" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Nincs címke" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Forgatás balra" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Forgatás jobbra" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diavet." + diff --git a/res/po/hy.po b/res/po/hy.po new file mode 100755 index 0000000..7b7aa34 --- /dev/null +++ b/res/po/hy.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Հայտանիշեր" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Բոլոր ալբոմները" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Ալբոմներ" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ալբոմներ Õ¹Õ¯Õ¡Õ¶" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Ընտրել հատկորոշիչներ" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Ստեղծել Õ¡Õ¬Õ¢Õ¸Õ´" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Հնարավոր Õ¹Õ§ վերանվանել" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Անուն Õ¹Õ¯Õ¡" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Ոչ Õ´Õ« Õ¡Õ¬Õ¢Õ¸Õ´ Õ¹Õ« ընտրվել" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Հատկորոշիչներ Õ¹Õ¥Õ¶ ընտրվել" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Ընտրել տարրը" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Ընտրել Õ¡Õ¬Õ¢Õ¸Õ´" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Կրկին փորձե՞լ" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Նույն անունն արդեն օգտագործվում Õ§" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Գրառումը դատարկ Õ§" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Անվավեր ներածված պարամետր" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Ստեղծ ÕºÕ«Õ¿Õ¯" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Հատկորոշիչներ Õ¹Õ¯Õ¡Õ¶" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Պտտել Õ±Õ¡Õ­" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Պտտել Õ¡Õ»" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Սլյդ շոու" + diff --git a/res/po/is.po b/res/po/is.po new file mode 100755 index 0000000..6b2a9f3 --- /dev/null +++ b/res/po/is.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Merki" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Allar plötur" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Möppur" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Engar möppur" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Velja merki" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Búa til albúm" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Mistókst að breyta heiti" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Ekkert heiti" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Engar plötur valdar" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Engin merki valin" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Velja hlut" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Velja plötu" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Reyna aftur" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Þetta heiti er þegar í notkun" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Færsla er tóm" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Ógild ílagsfæribreyta" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Búa til" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Engin merki" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Snúið til vinstri" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Snúið til hægri" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Skyggnur" + diff --git a/res/po/it_IT.po b/res/po/it_IT.po new file mode 100755 index 0000000..69eab7e --- /dev/null +++ b/res/po/it_IT.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tag" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Tutti gli album" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Album" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nessun album" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Seleziona tag" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Crea album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Impossibile rinominare" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nessun nome" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nessun album selezionato" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nessun tag selezionato" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Seleziona elemento" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Seleziona album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Riprovare?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Stesso nome già in uso" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Voce vuota" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parametro inserimento non valido" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Crea tag" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Nessun tag" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Ruota a sinistra" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Ruota a destra" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Present." + diff --git a/res/po/ja_JP.po b/res/po/ja_JP.po new file mode 100755 index 0000000..5ccd0bf --- /dev/null +++ b/res/po/ja_JP.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "タグ" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "全アルバム" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "アルバム" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "アルバムがありません。" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "タグを選択" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "アルバム​作成" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "名前を変更できません。" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "名前なし" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "アルバムが選択されていません。" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "タグ​が​選択​されて​いません" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "アイテムを選択" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "アルバムを選択" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "やり直し​ます​か?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "同じ名前が既に使用されています" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "入力されていません。" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "入力パラメータが無効です。" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "タグ​作成" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "タグがありません。" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "左に回転" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "右に回転" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "スライドショー" + diff --git a/res/po/ka.po b/res/po/ka.po new file mode 100755 index 0000000..39abf4d --- /dev/null +++ b/res/po/ka.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "ტეგები" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "ყველა ალბომი" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "ალბომები" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "ალბომები არ არის" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "ჩანართების არჩევა" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "ალბომის შექმნა" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "სახელს ვერ შეცვლით" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "უსახელო" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "ალბომი არ არის არჩეული" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "ჩანართები არ არის არჩეული" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "ელემენტის არჩევა" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "ალბომის არჩევა" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "თავიდან ვცადო?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "იგივე სახელი უკვე გამოყენებულია" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "ცარიელი ჩანაწ." + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "შეყვანილი პარამეტრი არასწორია" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "ჩან.შექმნა" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "იარლიყები არაა" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "მარცხნივ მოტრიალება" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "მარჯვნივ მოტრიალება" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "სლაიდ–შოუ" + diff --git a/res/po/kk.po b/res/po/kk.po new file mode 100755 index 0000000..f65020c --- /dev/null +++ b/res/po/kk.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Белгілер" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Барлық альбомдар" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Альбомдар" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Альбомдар жоқ" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Тегтерді таңдау" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Альбом жасау" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Атын өзгерту мүмкін емес" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Ондай есім жоқ" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Альбомдар таңдалмады" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Ешқандай тег таңдалмады" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Элемент таңдау" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Альбом таңдау" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Қайталау керек пе?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Мұндай атау қолданыста бар" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Енгізбе бос" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Жарамсыз енгізу өлшемі" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Тег жасау" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Тегтер жоқ" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Солға бұру" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Оңға бұру" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Слайдшоу" + diff --git a/res/po/ko_KR.po b/res/po/ko_KR.po new file mode 100755 index 0000000..7583818 --- /dev/null +++ b/res/po/ko_KR.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "태그" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "모든 앨범" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "앨범" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "앨범이 없습니다" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "태그를 선택하세요" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "앨범 추가" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "이름을 변경할 수 없습니다" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "이름이 없습니다" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "선택된 앨범이 없습니다" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "선택된 태그가 없습니다" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "항목 선택" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "앨범 선택" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "다시 시도할까요?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "사용 중인 이름입니다" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "입력된 내용이 없습니다" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "입력값이 바르지 않습니다" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "태그 추가" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "태그 없음" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "왼쪽으로 회전" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "오른쪽으로 회전" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "슬라이드쇼" + diff --git a/res/po/lt.po b/res/po/lt.po new file mode 100755 index 0000000..88f2a12 --- /dev/null +++ b/res/po/lt.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Žymos" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Visi albumai" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumai" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Albumų nėra" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Pasirinkti žymas" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Sukurti albumą" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Neįmanoma pervardinti" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nėra vardo" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nėra pasirinktų albumų" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nėra pasirinktų žymų" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Pasirinkti elementą" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Pasirinkti albumą" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Bandyti dar kartą?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Toks pavadinimas jau yra" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Ä®raÅ¡as tuščias" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Netinkami įvestų duomenų nustatymai" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Kurti žymą" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Žymų nėra" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Sukti į kairę" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Sukti į deÅ¡inę" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Skaid.rod." + diff --git a/res/po/lv.po b/res/po/lv.po new file mode 100755 index 0000000..684a01f --- /dev/null +++ b/res/po/lv.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "AtzÄ«mes" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Visi albumi" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumi" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nav albumu" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Izvēlēties atzÄ«mes" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Izveidot albumu" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nevar pārdēvēt" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nav vārda" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nav izvēlēts neviens albums" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nav izvēlēta neviena atzÄ«me" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Izvēlieties vienumu" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Izvēlēties albumu" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Vai mēģināt vēlreiz?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Šāds nosaukums jau tiek lietots" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Ieraksts nav norādÄ«ts" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "NederÄ«gs ievades parametrs" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Izv. atz." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Nav atzÄ«mju" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Pagriezt pa kreisi" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Pagriezt pa labi" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slaidrāde" + diff --git a/res/po/mk.po b/res/po/mk.po new file mode 100755 index 0000000..ddf0d74 --- /dev/null +++ b/res/po/mk.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Ознаки" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Сите албуми" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Албуми" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Нема албуми" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Изберете ознаки" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Нов албум" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Не може да се преименува" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Нема име" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Не се избрани албуми" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Нема избрано ознаки" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Избери запис" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Избери албум" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Повторен обид?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Истото име веќе се користи" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Записот е празен" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Неважечки влезен параметар" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Напр.озн." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Нема ознаки" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Ротирај лево" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Ротирај десно" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Слајдови" + diff --git a/res/po/nb.po b/res/po/nb.po new file mode 100755 index 0000000..3e17f16 --- /dev/null +++ b/res/po/nb.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tagger" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alle album" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Album" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ingen album" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Velg tagger" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Lag album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Kan ikke gi nytt navn" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Ingen navn" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Ingen album valgt" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Ingen tagger valgt" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Velg objekt" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Velg album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Prøve pÃ¥ nytt?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Samme navn allerede i bruk" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Oppføringen er tom" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Ugyldig inndataparameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Oppr. tagg" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Ingen tagger" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Roter mot klokken" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Roter med klokken" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Bildevisn" + diff --git a/res/po/nl_NL.po b/res/po/nl_NL.po new file mode 100755 index 0000000..026621f --- /dev/null +++ b/res/po/nl_NL.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Tags" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alle albums" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albums" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Geen albums" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Tags selecteren" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Album maken" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Kan de naam niet wijzigen" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Geen naam" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Geen albums geselecteerd" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Geen tags geselecteerd" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Item selecteren" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Album selecteren" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Opnieuw?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Naam is al in gebruik" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Geen gegevens" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Ongeldige invoerparameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Tag maken" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Geen tags" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Linksom draaien" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rechtsom draaien" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diashow" + diff --git a/res/po/pl.po b/res/po/pl.po new file mode 100755 index 0000000..9668ddc --- /dev/null +++ b/res/po/pl.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etykiety" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Wszystkie albumy" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumy" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Brak albumów" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Wybierz etykiety" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Utwórz album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nie można zmienić nazwy" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Bez nazwy" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nie wybrano albumów" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nie wybrano etykiet" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Wybierz element" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Wybierz album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Spróbować ponownie?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Ta sama nazwa jest już w użyciu" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Wpis jest pusty" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Nieprawidłowy parametr wejściowy" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Utw.etyk." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Brak etykiet" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Obróć w lewo" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Obróć w prawo" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Pok. slajd" + diff --git a/res/po/pt_BR.po b/res/po/pt_BR.po new file mode 100755 index 0000000..1b46b0c --- /dev/null +++ b/res/po/pt_BR.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Marcas" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Todos os álbuns" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Álbuns" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nenhum álbum" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Selecionar tags" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Criar álbum" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Impossível renomear" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Sem nome" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nenhum álbum selecionado" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nenhuma das etiquetas selecionadas" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Selecionar item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Selecionar álbum" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Repetir?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "O mesmo nome já está sendo utilizado" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entrada vazia" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parâmetro de entrada inválido" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Criar tag" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Sem marcas" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Girar para a esquerda" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Girar para a direita" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Ver slides" + diff --git a/res/po/pt_PT.po b/res/po/pt_PT.po new file mode 100755 index 0000000..efac905 --- /dev/null +++ b/res/po/pt_PT.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etiquetas" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Todos os álbuns" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Álbuns" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nenhuns álbuns" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Seleccionar etiquetas" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Criar álbum" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Impossível mudar nome" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Sem nome" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nenhuns álbuns seleccionados" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nenhumas etiquetas seleccionadas" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Seleccionar item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Seleccionar álbum" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Tentar novamente?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Já está a ser utilizado o mesmo nome" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entrada vazia" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parâmetro de entrada inválido" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Criar etiq." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Sem etiquetas" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rodar para a esquerda" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rodar para a direita" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diaporama" + diff --git a/res/po/ro.po b/res/po/ro.po new file mode 100755 index 0000000..dd1f579 --- /dev/null +++ b/res/po/ro.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etichete" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Toate albumele" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albume" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nu există albume" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Selectare etichete" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Creare album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Imposibil de redenumit" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nici un nume" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nu sunt albume selectate" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nu a fost selectată nicio etichetă" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "SelectaÅ£i elementul" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Selectare album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "ReîncercaÅ£i?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Acelaşi nume deja în uz" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "LocaÅ£ie liberă" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parametru de intrare incorect" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Creare" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Nicio etichetă" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotire stânga" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotire dreapta" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Ex. diap." + diff --git a/res/po/ru_RU.po b/res/po/ru_RU.po new file mode 100755 index 0000000..2331f70 --- /dev/null +++ b/res/po/ru_RU.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Метки" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Все альбомы" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Альбомы" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Нет альбомов" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Выберите теги" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Создать альбом" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Невозможно переименовать" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Нет имени" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Альбомы не выбраны" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Не выбраны метки" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Выберите элемент" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Выберите альбом" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Повторить?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Имя уже используется" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Пустая запись" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Неверные параметры ввода" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Создать метку" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Нет меток" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Повернуть влево" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Повернуть вправо" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Слайд-шоу" + diff --git a/res/po/sk.po b/res/po/sk.po new file mode 100755 index 0000000..ad32b2a --- /dev/null +++ b/res/po/sk.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Značky" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "VÅ¡etky albumy" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumy" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Žiadne albumy" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "VybraÅ¥ značky" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "VytvoriÅ¥ album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nedá sa premenovaÅ¥" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Žiadny názov" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Nie sú vybraté žiadne albumy" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Žiadne vybraté značky" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "VybraÅ¥ položku" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "VybraÅ¥ album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "OpakovaÅ¥?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Rovnaký názov sa už používa" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Prázdna položka" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Neplatný vstupný parameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Vytv. zn." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Žiadne značky" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "OtočiÅ¥ doľava" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "OtočiÅ¥ doprava" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Prezent." + diff --git a/res/po/sl.po b/res/po/sl.po new file mode 100755 index 0000000..80e5304 --- /dev/null +++ b/res/po/sl.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Oznake" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Vsi albumi" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumi" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ni albumov" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Izberi oznake" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Ustvari album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Ni mogoče preimenovati" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Brez imena" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Ni izbranih albumov" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Ni izbranih oznak" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Izberi predmet" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Izberite album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Poskusim znova?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "XXX se že uporablja" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Prazen vnos" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Neveljaven vhodni parameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Ustv. ozn." + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Brez oznak" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Zavrti v levo" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Zavrti v desno" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Diaproj." + diff --git a/res/po/sr.po b/res/po/sr.po new file mode 100755 index 0000000..54b2164 --- /dev/null +++ b/res/po/sr.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Oznake" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Svi albumi" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albumi" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nema albuma" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Izaberi oznake" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Kreiraj album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nemoguće preimenovati" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nema imena" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Albumi nisu izabrani" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Nema izabranih oznaka" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Izaberi objekat" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Izaberi album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Ponovi?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Taj naziv je već u upotrebi" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Unos je prazan" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Neispravan ulazni parametar" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Označi" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Bez oznaka" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotiraj ulevo" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotiraj udesno" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slajd-Å¡ou" + diff --git a/res/po/sv.po b/res/po/sv.po new file mode 100755 index 0000000..da847be --- /dev/null +++ b/res/po/sv.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Taggar" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alla album" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Album" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Inga album" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Välj taggar" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Skapa album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Kan inte byta namn" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Inget namn" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Inga valda album" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Inga valda taggar" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Välj objekt" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Välj album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Försök igen?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Detta namn används redan" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Posten är tom" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Felaktig indataparameter" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Skapa tagg" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Inga taggar" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Rotera moturs" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Rotera medurs" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Bildspel" + diff --git a/res/po/tr_TR.po b/res/po/tr_TR.po new file mode 100755 index 0000000..23a8cbf --- /dev/null +++ b/res/po/tr_TR.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Etiketler" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Tüm albümler" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albümler" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Albüm yok" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Ä°mleri seçin" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Albüm oluştur" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Yeniden adlandırılamıyor. Dosya kullanımda." + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Ä°sim yok" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Albüm seçilmedi" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Ä°m seçili değil" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Öğe seç" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Albüm seç" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Tekrar denensin mi?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Ä°sim zaten kullanımda" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Girdi yok" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Geçersiz giriş parametresi" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Ä°m oluştur" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Etiket yok" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Saat yönünün tersine döndür" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Saat yönünde döndür" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slayt şov" + diff --git a/res/po/uk.po b/res/po/uk.po new file mode 100755 index 0000000..cd1df36 --- /dev/null +++ b/res/po/uk.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Теги" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Усі альбоми" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Альбоми" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Немає альбомів" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Виберіть теги" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Створити альбом" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Неможливо перейменувати" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Немає імені" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Не вибрано альбомів" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Не вибрано тегів" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Виберіть елемент" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Вибір альбому" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Повторити?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Ім’я вже використовується" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Запис порожній" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Неправильний вхідний параметр" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Створ. тег" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Без тегів" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Обернути ліворуч" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "Обернути праворуч" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Слайд-шоу" + diff --git a/res/po/update-po.sh b/res/po/update-po.sh new file mode 100755 index 0000000..6e710ce --- /dev/null +++ b/res/po/update-po.sh @@ -0,0 +1,60 @@ +#!/bin/sh + +PACKAGE=gallery +SRCROOT=.. +POTFILES=POTFILES.in + +#ALL_LINGUAS= am az be ca cs da de el en_CA en_GB es et fi fr hr hu it ja ko lv mk ml ms nb ne nl pa pl pt pt_BR ru rw sk sl sr sr@Latn sv ta tr uk vi zh_CN zh_TW +ALL_LINGUAS="en_US en_GB ja ko zh_CN" + +XGETTEXT=/usr/bin/xgettext +MSGMERGE=/usr/bin/msgmerge + +echo -n "Make ${PACKAGE}.pot " +if [ ! -e $POTFILES ] ; then + echo "$POTFILES not found" + exit 1 +fi + +$XGETTEXT --default-domain=${PACKAGE} --directory=${SRCROOT} \ + --add-comments --keyword=_ --keyword=N_ --files-from=$POTFILES +if [ $? -ne 0 ]; then + echo "xgettext error" + exit 1 +fi + +if [ ! -f ${PACKAGE}.po ]; then + echo "No such file: ${PACKAGE}.po" + exit 1 +fi + +rm -f ${PACKAGE}.pot && mv ${PACKAGE}.po ${PACKAGE}.pot +echo "done" + +for LANG in $ALL_LINGUAS; do + echo "$LANG : " + + if [ ! -e $LANG.po ] ; then + sed 's/CHARSET/UTF-8/g' ${PACKAGE}.pot > ${LANG}.po + echo "${LANG}.po created" + else + if $MSGMERGE ${LANG}.po ${PACKAGE}.pot -o ${LANG}.new.po ; then + if cmp ${LANG}.po ${LANG}.new.po > /dev/null 2>&1; then + rm -f ${LANG}.new.po + else + if mv -f ${LANG}.new.po ${LANG}.po; then + echo "" + else + echo "msgmerge for $LANG.po failed: cannot move $LANG.new.po to $LANG.po" 1>&2 + rm -f ${LANG}.new.po + exit 1 + fi + fi + else + echo "msgmerge for $LANG failed!" + rm -f ${LANG}.new.po + fi + fi + echo "" +done + diff --git a/res/po/uz.po b/res/po/uz.po new file mode 100755 index 0000000..e2d881d --- /dev/null +++ b/res/po/uz.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "Teglar" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Barcha albomlar" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "Albom" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Albomlar yo‘q" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "Teglarni tanlang" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Albom yaratish" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Nomini o‘zgartirib bo‘lmaydi" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Nom yo‘q" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Albom tanlanmagan" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "Hech qanday teg tanlanmagan" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Element tanlang" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Albom tanlash" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Qayta urinib ko‘rilsinmi?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Bunday nom avvaldan ishlatilmoqda" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Kiritish bo‘sh" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Noto‘g‘ri kiritish parametri" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "Teg yarat" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "Teglar yo‘q" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "Chapga aylantir." + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "O‘ngga aylantir." + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "Slayd-shou" + diff --git a/res/po/zh_CN.po b/res/po/zh_CN.po new file mode 100755 index 0000000..bc13eaa --- /dev/null +++ b/res/po/zh_CN.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "标签" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "所有相册" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "专辑" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "沒有专辑" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "选择标签" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "新建相册" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "无法重命名" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "无名称" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "未选择音乐库" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "没有选择标签" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "选择项目" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "选择相册" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "重试?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "相同名字已使用" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "空记录" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "输入参数无效" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "创建标签" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "无标签" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "向左旋转" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "向右旋转" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "幻灯片" + diff --git a/res/po/zh_HK.po b/res/po/zh_HK.po new file mode 100755 index 0000000..a9f1c78 --- /dev/null +++ b/res/po/zh_HK.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "標籤" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "全部專輯" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "專輯" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "無專輯" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "選擇標籤" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "建立相簿" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "無法重新命名" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "無名稱" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "未選擇專輯" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "標籤未選取" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "選擇項目" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "選擇專輯" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "要重試嗎?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "相同名稱已被使用" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "空白記錄" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "輸入參數無效" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "建立標籤" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "無標籤" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "左轉" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "右轉" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "投影片放映" + diff --git a/res/po/zh_SG.po b/res/po/zh_SG.po new file mode 100755 index 0000000..f43f61a --- /dev/null +++ b/res/po/zh_SG.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "标签" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "所有相册" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "相册" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "无相册" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "选择标签" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "新建相册" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "无法重命名" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "无名称" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "未选择音乐库" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "没有选择标签" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "选择项目" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "选择音乐库" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "重试?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "相同名称已在使用" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "空记录" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "输入参数无效" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "创建标签" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "无标签" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "向左旋转" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "向右旋转" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "幻灯片" + diff --git a/res/po/zh_TW.po b/res/po/zh_TW.po new file mode 100755 index 0000000..f6effe5 --- /dev/null +++ b/res/po/zh_TW.po @@ -0,0 +1,63 @@ +msgid "IDS_MEDIABR_BODY_TAGS" +msgstr "標籤" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "所有相簿" + +msgid "IDS_MEDIABR_BUTTON_ALBUMS" +msgstr "相簿" + +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "無專輯" + +msgid "IDS_MEDIABR_BODY_SELECT_TAGS" +msgstr "選擇關鍵字" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "建立專輯" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "無法重新命名" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "無姓名" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "未選擇相簿" + +msgid "IDS_MEDIABR_POP_NO_TAGS_SELECTED" +msgstr "沒有選擇標籤" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "選擇項目" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "選擇專輯" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "要重試嗎?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "相同名稱已在使用中" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "項目為空" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "輸入參數無效" + +msgid "IDS_MEDIABR_OPT_CREATE_TAG" +msgstr "建立標籤" + +msgid "IDS_MEDIABR_POP_NO_TAGS" +msgstr "無標籤" + +msgid "IDS_MEDIABR_OPT_ROTATE_LEFT" +msgstr "向左旋轉" + +msgid "IDS_MEDIABR_OPT_ROTATE_RIGHT" +msgstr "向右旋轉" + +msgid "IDS_MEDIABR_BUTTON_SLIDE_SHOW" +msgstr "投影片放映" + diff --git a/res/white_theme/edc/gallery-edc-res.h b/res/white_theme/edc/gallery-edc-res.h new file mode 100755 index 0000000..4d68a92 --- /dev/null +++ b/res/white_theme/edc/gallery-edc-res.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 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. + */ + +/* Definition of image path used in edc file */ + +/* gl-nocontents.edc */ +#define GALLERY_EDC_IMAGE_NOCONTENTS_PIC "T01_Nocontents_picture.png" + +/* gl-gengrid-item-albums.edc */ +#define GALLERY_EDC_IMAGE_MAIN_FOLDER_BG "T01_main_folder_bg.png" + +/* gl-gengrid-item-thumbview.edc */ +#define GALLERY_EDC_IMAGE_BUTTON_PLAY "T01_btn_play.png" + +/* gallery.edc */ +#define GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG "00_winset_title_tabbar_bg.png" + +#define GALLERY_EDC_SOUND_TOUCH_30MS "S_Touch_30ms.wav" + +/* gl-check.edc */ +#define GALLERY_EDC_IMAGE_CHECK_BG "T01_checkbox.png" +#define GALLERY_EDC_IMAGE_CHECK_ALBUM_BG "T01_album_checkbox.png" +#define GALLERY_EDC_IMAGE_CHECK_BG_DIM "00_check_bg_dim.png" +#define GALLERY_EDC_IMAGE_CHECK_BG_CHECKING "T01_check.png" +#define GALLERY_EDC_IMAGE_CHECK_ALBUM_BG_CHECKING "T01_album_checkbox_check.png" +#define GALLERY_EDC_IMAGE_CHECK_GRID "T01_grid_select_check.png" + +/* gl-entry.edc */ +#define GALLERY_EDC_IMAGE_EDITFIELD_CLEAR "00_EditField_clear.png" +#define GALLERY_EDC_IMAGE_EDITFIELD_CLEAR_PRESS "00_EditField_clear_press.png" +#define GALLERY_EDC_IMAGE_SEARCH_INPUT_FIELD_BG "00_search_input_field_bg.png" + diff --git a/res/white_theme/edc/gallery.edc b/res/white_theme/edc/gallery.edc new file mode 100755 index 0000000..bda9c36 --- /dev/null +++ b/res/white_theme/edc/gallery.edc @@ -0,0 +1,572 @@ +/* + * Copyright (c) 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 FONT_ROM "SLP:style=Roman" +#define FONT_MED "SLP:style=Medium" +#define INDICATOR_H 27 +#define NAVI_H 67 +#define GALLERY_EDC_COLOR_THEME_GRAY 91 91 91 255 +#define GALLERY_EDC_COLOR_BG 248 246 239 255 +#define ENTRY_H 112 +#define ENTRY_MAX_W 1280 +#define CONTROLBAR_LARGE_HEIGHT_INC 117 +#define CONTROLBAR_SMALL_HEIGHT_INC 98 +/* Set select all bg color same as genlist */ +#define GENLIST_SELECT_ALL_BG_COLOR 220 218 211 255 +#define SELECT_ALL_BG_COLOR GENLIST_SELECT_ALL_BG_COLOR +#define NAVIFRAME_TITLE_BG_COLOR_INC 248 246 239 255 +#define GENLIST_PART_BOTTOM_LINE_COLOR_VIDEO 82 82 82 255 +#define SELINFO_H 48 + +#include "gallery-edc-res.h" + +collections { +#include "gl-genlist-item-tags.edc" +#include "gl-genlist-sweep.edc" +#include "gl-gengrid-item-thumbview.edc" +#include "gl-gengrid-item-albums.edc" +#include "gl-check.edc" +#include "gl-nocontents.edc" +#include "gl-entry.edc" + + group { + name: "gallery/controlbar_layout"; + parts { + part { + name: "background"; + type, RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; offset: 0 0; } + rel2 { relative: 1.0 1.0; offset: -1 -1; } + color: GALLERY_EDC_COLOR_BG; + } + + } + part { + name: "elm.swallow.tabbar"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 CONTROLBAR_LARGE_HEIGHT_INC; + fixed: 1 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 0.0;} + } + description { + state: "landscape" 0.0; + inherit: "default" 0.0; + min: 0 CONTROLBAR_SMALL_HEIGHT_INC; + } + description { + state: "hide" 0.0; + inherit: "default" 0.0; + min: 0 0; + max: 0 0; + visible: 0; + } +#ifdef _USE_DALI + description { + state: "default_invisible" 0.0; + min: 0 CONTROLBAR_LARGE_HEIGHT_INC; + fixed: 1 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 0.0;} + visible: 0; + } + description { + state: "landscape_invisible" 0.0; + inherit: "default" 0.0; + min: 0 CONTROLBAR_SMALL_HEIGHT_INC; + visible: 0; + } +#endif + } + part { + name: "elm.swallow.content"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 1.0; to: "elm.swallow.tabbar"; } + rel2 { relative: 1.0 1.0; } + } + description { + /* Tabbar hide, enlarge size to cover tabbar region */ + state: "fullscreen" 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + } + programs + { + program { + name: "tabbar_default"; + signal: "elm,tabbar,state,default"; + source: "elm"; + transition: DECELERATE 0.5; + script { + set_state(PART:"elm.swallow.tabbar", "default", 0.0); + set_state(PART:"elm.swallow.content", "default", 0.0); + } + } + program { + name: "tabbar_landscape"; + signal: "elm,tabbar,state,landscape"; + source: "elm"; + script { + set_state(PART:"elm.swallow.tabbar", "landscape", 0.0); + set_state(PART:"elm.swallow.content", "default", 0.0); + } + } + program { + name: "tabbar_hide"; + signal: "elm,tabbar,state,hide"; + source: "elm"; + script { + set_state(PART:"elm.swallow.tabbar", "hide", 0.0); + set_state(PART:"elm.swallow.content", "fullscreen", 0.0); + } + } + } + } + + group { + name: "gallery/controlbar"; + parts { + part { + name: "background"; + type, RECT; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; offset: 0 0; } + rel2 { relative: 1.0 1.0; offset: -1 -1; } + color: 0 0 0 0 ; + } + + } + part { + name: "elm.tabbar.bg"; + //type: IMAGE; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 0 0; + fixed: 1 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 0.0;} + //image.normal: GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG; + color: NAVIFRAME_TITLE_BG_COLOR_INC; + } + description { + state: "show_port" 0.0; + inherit: "default" 0.0; + min: 0 CONTROLBAR_LARGE_HEIGHT_INC; + } + description { + state: "show_land" 0.0; + inherit: "default" 0.0; + min: 0 CONTROLBAR_SMALL_HEIGHT_INC; + } + } + part { + name: "selectall_bg"; + type: RECT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 112; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 1.0; to: "elm.tabbar.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.tabbar.bg"; } + color: 0 0 0 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + color: SELECT_ALL_BG_COLOR; + } + description { + state: "visible_tag" 0.0; + inherit: "default" 0.0; + min: 0 TAG_ITEM_H; + color: SELECT_ALL_BG_COLOR; + } + } + part { + name: "selectall_bottom_line"; + type: RECT; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 2; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 1.0; to: "selectall_bg"; } + rel2 { relative: 1.0 0.0; to: "background"; } + color: 0 0 0 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + color: GENLIST_PART_BOTTOM_LINE_COLOR_VIDEO; + } + description { + state: "visible_tag" 0.0; + inherit: "default" 0.0; + color: GENLIST_PART_BOTTOM_LINE_COLOR_TAG; + + } + } + part { + name: "selectall_check_leftpadding"; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.0; + + color: 0 0 0 255; + visible: 0; + rel1 { relative: 0.0 0.0; to: "selectall_bg"; } + rel2 { relative: 0.0 1.0; to: "selectall_bg"; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + + } + + } + + part { + name: "selectall_check"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + fixed: 1 1; + min: 42 42; + rel1 { relative: 1.0 0.0; to: "selectall_check_leftpadding"; } + rel2 { relative: 1.0 1.0; to: "selectall_check_leftpadding"; } + visible : 0; + + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + + } + + part { + name: "selectall_check_rightpadding"; + type: RECT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 16 0; + fixed: 1 0; + align: 0.0 0.0; + color: 0 0 0 0; + rel1 { relative: 1.0 0.0; to: "selectall_check"; } + rel2 { relative: 1.0 1.0; to: "selectall_check"; } + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + + } + + part { + name: "selectall_text"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + rel1 { relative: 1.0 0.0; to: "selectall_check_rightpadding"; } + rel2 { relative: 1.0 1.0; to: "selectall_bg"; } + color: 0 0 0 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 44; + text: ""; + align: 0.0 0.5; + } + visible: 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + + part { + name: "selectall_inner"; + type: RECT; + mouse_events: 0; + scale: 1; + + description { + state: "defalut" 0.0; + min: 0 1; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 1.0; to: "selectall_bg"; } + rel2 { relative: 1.0 1.0; to: "selectall_bottom_line"; } + color: 90 90 90 0; + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "contents"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 1.0; to: "elm.tabbar.bg"; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "edit" 0.0; + rel1 { relative: 0.0 1.0; to: "selectall_inner"; } + rel2 { relative: 1.0 1.0; } + } + } + part { + name: "elm.swallow.view"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "edit" 0.0; + rel1 { relative: 0.0 1.0; to: "selectall_inner"; } + rel2 { relative: 1.0 1.0; } + } + description { //normal thumbnails view for 2d effect + state: "thumb_edit_2d" 0.0; + //min: 480 800-115; + //align: 0.5 1.0; + rel1 { relative: 0.0 0.0; offset: 0 55; } + rel2 { relative: 1.0 1.0;} + } + description { //move edit view up while selectioninfo shown + state: "moveup" 0.0; + rel1 { relative: 0.0 1.0; to: "selectall_inner"; } + rel2 { relative: 1.0 0.0; to: "elm.swallow.selinfo"; } + + } + } + part { + name: "elm.swallow.selinfo"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: 0 SELINFO_H; // bottom padding size for selectioninfo + fixed: 0 1; + align: 0.5 1.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + visible: 0; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "elm.swallow.weblist_view"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + } + } + } + + programs + { + program { + name: "swallow_view_default"; + signal: "elm,swallow_view,state,default"; + source: "elm"; + script { + set_state(PART:"elm.swallow.view", "default", 0.0); + } + } + program { + name: "swallow_view_edit"; + signal: "elm,swallow_view,state,edit"; + source: "elm"; + script { + set_state(PART:"elm.swallow.view", "edit", 0.0); + set_state(PART:"elm.swallow.selinfo", "default", 0.0); + } + } + program { + name: "selectall_show_after"; + action: STATE_SET "visible" 0.0; + target: "selectall_check_leftpadding"; + target: "selectall_check"; + target: "selectall_check_rightpadding"; + target: "selectall_text"; + target: "selectall_inner"; + } + program { + name: "selectall_show"; + signal: "selectall_show"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "selectall_bg"; + target: "selectall_bottom_line"; + after: "selectall_show_after"; + } + program { + name: "selectall_show_tag"; + signal: "selectall_show_tag"; + source: "elm"; + action: STATE_SET "visible_tag" 0.0; + target: "selectall_bg"; + target: "selectall_bottom_line"; + after: "selectall_show_after"; + } + program { + name: "selectall_show_web"; + signal: "selectall_show_web"; + source: "elm"; + action: STATE_SET "visible_web" 0.0; + target: "selectall_bottom_line"; + after: "selectall_show_after"; + } + program { + name: "selectall_hide"; + signal: "selectall_hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "selectall_bg"; + target: "selectall_bottom_line"; + target: "selectall_check_leftpadding"; + target: "selectall_check"; + target: "selectall_check_rightpadding"; + target: "selectall_text"; + target: "selectall_inner"; + } + //emit signal to set checkbox state in .c codes + program { name: "selectall_bg_click2"; + signal: "mouse,clicked,1"; + source: "selectall_bg"; + action: SIGNAL_EMIT "elm,action,click" "selectall_bg"; + } + program { + name: "swallow_view_thumb_edit_2d"; + signal: "elm,swallow_view,state,thumb_edit_2d"; + source: "elm"; + script { + set_state(PART:"elm.swallow.view", "thumb_edit_2d", 0.0); + set_state(PART:"elm.swallow.selinfo", "default", 0.0); + } + } + program { + name: "swallow_view_moveup"; + signal: "elm,swallow_view,state,moveup"; + source: "elm"; + script { + set_state(PART:"elm.swallow.view", "moveup", 0.0); + set_state(PART:"elm.swallow.selinfo", "show", 0.0); + } + } + program { + name: "tabbar_bg_default"; + signal: "elm,tabbar_bg,state,hide"; + source: "elm"; + script { + set_state(PART:"elm.tabbar.bg", "default", 0.0); + } + } + program { + name: "tabbar_bg_show_port"; + signal: "elm,tabbar_bg,state,show_port"; + source: "elm"; + script { + set_state(PART:"elm.tabbar.bg", "show_port", 0.0); + } + } + program { + name: "tabbar_bg_show_land"; + signal: "elm,tabbar_bg,state,show_land"; + source: "elm"; + script { + set_state(PART:"elm.tabbar.bg", "show_land", 0.0); + } + } + } + } + group { name: "gl_bg_layout"; + parts { + part { name: "bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 0 0 0 45; + } + } + part { name: "elm.swallow.image"; + type: SWALLOW; + description { state: "default" 0.0; + } + } + } + } +} + diff --git a/res/white_theme/edc/gl-check.edc b/res/white_theme/edc/gl-check.edc new file mode 100755 index 0000000..4e97272 --- /dev/null +++ b/res/white_theme/edc/gl-check.edc @@ -0,0 +1,969 @@ +/* + * Copyright (c) 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 CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 60 60 + +#define CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC 255 255 255 255 +#define CHECK_DEFAULT_TEXT_PRESSED_COLOR_INC 255 255 255 255 +#define CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC 136 136 136 136 + +//////////////////////////////////////////////////////////////////////////////////////// +// +// check default textblock style +// +/////////////////////////////////////////////////////////////////////////////////////// + styles { + style { name: "check_label_textblock_style"; + base: "font=SLP:style=Roman text_class=slp font_size=32 color=#ffffff wrap=char"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp"; + tag: "b" "+ font=SLP:style=Bold text_class=slp"; + tag: "whitecolor" "+ color=#ffffff"; + tag: "tab" "\t"; + } + } + +#define CHECK_STATE_DEFAULT 0 +#define CHECK_STATE_VISIBLE 1 +#define CHECK_STATE_DISABLED_VISIBLE 2 +#define CHECK_STATE_DISABLED 3 + +//////////////////////////////////////////////////////////////////////////////// +#define CHECK_STYLE_DEFAULT(style_name, image_bg, image_checking, min_width, min_height) \ + group { name: "elm/check/base/"style_name; \ + images { \ + image: image_bg COMP; \ + image: GALLERY_EDC_IMAGE_CHECK_BG_DIM COMP; \ + image: image_checking COMP; \ + } \ + script { \ + public check_state = CHECK_STATE_DEFAULT; \ + } \ + parts { \ + part { name: "back_bg"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel2.relative: 0.0 1.0; \ + align: 0 0.5; \ + min: min_width min_height; \ + fixed: 1 0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "bg"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \ + max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \ + fixed: 1 1; \ + rel1.to: "back_bg"; \ + rel2.to: "back_bg"; \ + image.normal: image_bg; \ + fill.smooth : 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + image.normal: GALLERY_EDC_IMAGE_CHECK_BG_DIM; \ + fill.smooth : 0; \ + } \ + } \ + part { name: "check"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "bg"; \ + rel2.to: "bg"; \ + visible: 0; \ + image.normal: image_checking; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "elm.swallow.content"; \ + type: SWALLOW; \ + description { state: "default" 0.0; \ + fixed: 1 0; \ + visible: 0; \ + color: 255 255 255 255; \ + align: 0.0 0.5; \ + rel1 { \ + to_x: "bg"; \ + relative: 1.0 0.0; \ + offset: 1 1; \ + } \ + rel2 { \ + to_x: "bg"; \ + relative: 1.0 1.0; \ + offset: 2 -2; \ + } \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + fixed: 1 1; \ + visible: 1; \ + aspect: 1.0 1.0; \ + aspect_preference: VERTICAL; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 128 128 128 128; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + color: 128 128 128 128; \ + fixed: 1 1; \ + visible: 1; \ + aspect: 1.0 1.0; \ + } \ + } \ + part { name: "elm.text"; \ + type: TEXTBLOCK; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + visible: 0; \ + fixed: 0 1; \ + rel1 { \ + relative: 1.0 0.5; \ + offset: 1 1; \ + to_x: "elm.swallow.content"; \ + } \ + rel2 { \ + relative: 1.0 0.5; \ + offset: -2 -2; \ + } \ + align: 0.0 0.5; \ + text { \ + style: "check_label_textblock_style"; \ + min: 0 0; \ + } \ + color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + text.min: 1 1; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + text.min: 1 1; \ + color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \ + } \ + } \ + part { name: "events1"; \ + type: RECT; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "events2"; \ + type: RECT; \ + repeat_events: 1; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "disabler"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + } \ + programs { \ + program { name: "click"; \ + signal: "mouse,clicked,1"; \ + source: "events1"; \ + action: SIGNAL_EMIT "elm,action,check,toggle" ""; \ + } \ + program { name: "check_on"; \ + signal: "elm,state,check,on"; \ + source: "elm"; \ + script { \ + set_int(check_state, CHECK_STATE_VISIBLE); \ + set_state(PART:"check", "visible", 0.0); \ + } \ + } \ + program { name: "check_off"; \ + signal: "elm,state,check,off"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "check"; \ + script { \ + if (get_int(check_state) == CHECK_STATE_VISIBLE) \ + { \ + set_int(check_state, CHECK_STATE_DEFAULT); \ + set_state(PART:"check", "default", 0.0); \ + } \ + } \ + } \ + program { name: "text_show"; \ + signal: "elm,state,text,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "text_hide"; \ + signal: "elm,state,text,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "icon_show"; \ + signal: "elm,state,icon,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.swallow.content"; \ + } \ + program { name: "icon_hide"; \ + signal: "elm,state,icon,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.swallow.content"; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "disabler"; \ + target: "bg"; \ + after: "disable_text"; \ + } \ + program { name: "disable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.text", "disabled", 0.0); \ + get_state(PART:"elm.swallow.content", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.swallow.content", "disabled", 0.0); \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + { \ + set_state(PART:"check", "disabled_visible", 0.0); \ + set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \ + } \ + } \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "disabler"; \ + target: "bg"; \ + after: "enable_text"; \ + } \ + program { name: "enable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"elm.text", "visible", 0.0); \ + else \ + set_state(PART:"elm.text", "default", 0.0); \ + get_state(PART:"elm.swallow.content", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.swallow.content", "visible", 0.0); \ + else \ + set_state(PART:"elm.swallow.content", "default", 0.0); \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + { \ + set_state(PART:"check", "visible", 0.0); \ + set_int(check_state, CHECK_STATE_VISIBLE); \ + } \ + else \ + set_int(check_state, CHECK_STATE_DEFAULT); \ + } \ + } \ + } \ + } + +//////////////////////////////////////////////////////////////////////////////// + CHECK_STYLE_DEFAULT("gallery/default", GALLERY_EDC_IMAGE_CHECK_BG, GALLERY_EDC_IMAGE_CHECK_BG_CHECKING, 42, 42) + +//////////////////////////////////////////////////////////////////////////////// + CHECK_STYLE_DEFAULT("gallery/album", GALLERY_EDC_IMAGE_CHECK_ALBUM_BG, GALLERY_EDC_IMAGE_CHECK_ALBUM_BG_CHECKING, 60, 60) + +//////////////////////////////////////////////////////////////////////////////// +#define CHECK_STYLE_GRID(style_name, image_grid, width, height) \ + group { name: "elm/check/base/"style_name; \ + images.image: image_grid COMP; \ + parts { \ + part { name: "bg"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + description { state: "pressed" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "icon_bg_img"; \ + type: RECT; \ + mouse_events: 0; \ + scale : 1; \ + description { \ + color: 0 0 0 0; \ + rel1 { relative: GAP_W/W (GAP_H+1)/H;} \ + rel2 { relative: (W-GAP_W)/W 1;} \ + } \ + } \ + part { name: "icon_bg"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + rel1 { relative: 0 0; to: "icon_bg_img"; } \ + rel2 { relative: 1 1; to: "icon_bg_img"; } \ + } \ + } \ + part { name: "bg2"; \ + type: RECT; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "icon_bg"; \ + rel2.to: "icon_bg"; \ + align: 0.5 0.5; \ + min: width height; \ + max: width height; \ + color: 0 0 0 0; \ + } \ + description { state: "pressed" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "selected_bg"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "icon_bg"; \ + rel2.to: "icon_bg"; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 153; \ + visible: 1; \ + } \ + } \ + part { name: "check"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "bg2"; \ + rel2.to: "bg2"; \ + visible: 0; \ + image.normal: image_grid; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + description { state: "pressed" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "elm.swallow.content"; \ + type: SWALLOW; \ + description { \ + state: "default" 0.0; \ + fixed: 1 0; \ + visible: 0; \ + color: 255 255 255 255; \ + align: 0.0 0.5; \ + rel1 { \ + to_x: "bg2"; \ + relative: 1.0 0.0; \ + offset: 1 1; \ + } \ + rel2 { \ + to_x: "bg2"; \ + relative: 1.0 1.0; \ + offset: 2 -2; \ + } \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + fixed: 1 1; \ + visible: 1; \ + aspect: 1.0 1.0; \ + aspect_preference: VERTICAL; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 128 128 128 128; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + color: 128 128 128 128; \ + fixed: 1 1; \ + visible: 1; \ + aspect: 1.0 1.0; \ + } \ + } \ + part { name: "elm.text"; \ + type: TEXTBLOCK; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + visible: 0; \ + fixed: 0 1; \ + rel1 { \ + relative: 1.0 0.5; \ + offset: 1 1; \ + to_x: "elm.swallow.content"; \ + } \ + rel2 { \ + relative: 1.0 0.5; \ + offset: -2 -2; \ + } \ + color: 255 255 255 255; \ + align: 0.0 0.5; \ + text { \ + style: "check_label_textblock_style"; \ + min: 0 0; \ + } \ + color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + text.min: 1 1; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + text.min: 1 1; \ + color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \ + } \ + } \ + part { name: "events"; \ + type: RECT; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "disabler"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + } \ + programs { \ + program { name: "click"; \ + signal: "mouse,up,1"; \ + source: "events"; \ + action: SIGNAL_EMIT "elm,action,check,toggle" ""; \ + after: "bg_normal"; \ + } \ + program { name: "bg_normal"; \ + script { \ + set_state(PART:"bg", "default", 0.0); \ + set_state(PART:"bg2", "default", 0.0); \ + } \ + } \ + program { name: "mouseout"; \ + signal: "mouse,out"; \ + source: "events"; \ + after: "bg_check_normal"; \ + } \ + program { name: "bg_check_normal"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "pressed")) \ + set_state(PART:"check", "visible", 0.0); \ + set_state(PART:"bg", "default", 0.0); \ + set_state(PART:"bg2", "default", 0.0); \ + } \ + } \ + program { name: "pressed"; \ + signal: "mouse,down,1"; \ + source: "events"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"check", "pressed", 0.0); \ + set_state(PART:"bg", "pressed", 0.0); \ + set_state(PART:"bg2", "pressed", 0.0); \ + } \ + } \ + program { name: "check_on"; \ + signal: "elm,state,check,on"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "check"; \ + target: "selected_bg"; \ + } \ + program { name: "check_off"; \ + signal: "elm,state,check,off"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "check"; \ + target: "selected_bg"; \ + } \ + program { name: "text_show"; \ + signal: "elm,state,text,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "text_hide"; \ + signal: "elm,state,text,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "icon_show"; \ + signal: "elm,state,icon,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.swallow.content"; \ + } \ + program { name: "icon_hide"; \ + signal: "elm,state,icon,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.swallow.content"; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "disabler"; \ + target: "bg"; \ + target: "bg2"; \ + after: "disable_text"; \ + } \ + program { name: "disable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.text", "disabled", 0.0); \ + get_state(PART:"elm.swallow.content", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.swallow.content", "disabled", 0.0); \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"check", "disabled_visible", 0.0); \ + } \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "disabler"; \ + target: "bg"; \ + target: "bg2"; \ + after: "enable_text"; \ + } \ + program { name: "enable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"elm.text", "visible", 0.0); \ + else \ + set_state(PART:"elm.text", "default", 0.0); \ + get_state(PART:"elm.swallow.content", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.swallow.content", "visible", 0.0); \ + else \ + set_state(PART:"elm.swallow.content", "default", 0.0); \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"check", "visible", 0.0); \ + } \ + } \ + } \ + } + +//////////////////////////////////////////////////////////////////////////////// + CHECK_STYLE_GRID("gallery/grid", GALLERY_EDC_IMAGE_CHECK_GRID, 64, 64) + +//////////////////////////////////////////////////////////////////////////////// + group { name: "elm/check/base/gallery/album/grid"; + parts { + part { name: "bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + color: 0 0 0 0; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "bg2"; + type: RECT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + align: 0.5 0.5; + min: 40 40; + max: 40 40; + color: 0 0 0 0; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "selected_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + rel1.to: "bg"; + rel2.to: "bg"; + color: 0 0 0 0; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + color: 0 0 0 153; + visible: 1; + } + } + part { name: "check"; + type: RECT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + rel1.to: "bg2"; + rel2.to: "bg2"; + color: 0 0 0 0; + visible: 0; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + } + description { state: "pressed" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + } + } + part { name: "elm.swallow.content"; + type: SWALLOW; + description { + state: "default" 0.0; + fixed: 1 0; + visible: 0; + color: 255 255 255 255; + align: 0.0 0.5; + rel1 { + to_x: "bg2"; + relative: 1.0 0.0; + offset: 1 1; + } + rel2 { + to_x: "bg2"; + relative: 1.0 1.0; + offset: 2 -2; + } + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + fixed: 1 1; + visible: 1; + aspect: 1.0 1.0; + aspect_preference: VERTICAL; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + color: 128 128 128 128; + fixed: 1 1; + visible: 1; + aspect: 1.0 1.0; + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + visible: 0; + fixed: 0 1; + rel1 { + relative: 1.0 0.5; + offset: 1 1; + to_x: "elm.swallow.content"; + } + rel2 { + relative: 1.0 0.5; + offset: -2 -2; + } + color: 255 255 255 255; + align: 0.0 0.5; + text { + style: "check_label_textblock_style"; + min: 0 0; + } + color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; + } + description { state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + } + description { state: "disabled_visible" 0.0; + inherit: "default" 0.0; + visible: 1; + text.min: 1 1; + color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; + } + } + part { name: "events"; + type: RECT; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "disabler"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + visible: 0; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "click"; + signal: "mouse,up,1"; + source: "events"; + action: SIGNAL_EMIT "elm,action,check,toggle" ""; + after: "bg_normal"; + } + program { name: "bg_normal"; + script { + set_state(PART:"bg", "default", 0.0); + set_state(PART:"bg2", "default", 0.0); + } + } + program { name: "mouseout"; + signal: "mouse,out"; + source: "events"; + after: "bg_check_normal"; + } + program { name: "bg_check_normal"; + script { + new st[31]; + new Float:vl; + get_state(PART:"check", st, 30, vl); + if (!strcmp(st, "pressed")) + set_state(PART:"check", "visible", 0.0); + set_state(PART:"bg", "default", 0.0); + set_state(PART:"bg2", "default", 0.0); + } + } + program { name: "pressed"; + signal: "mouse,down,1"; + source: "events"; + script { + new st[31]; + new Float:vl; + get_state(PART:"check", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"check", "pressed", 0.0); + set_state(PART:"bg", "pressed", 0.0); + set_state(PART:"bg2", "pressed", 0.0); + } + } + program { name: "check_on"; + signal: "elm,state,check,on"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "check"; + target: "selected_bg"; + } + program { name: "check_off"; + signal: "elm,state,check,off"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "check"; + target: "selected_bg"; + } + program { name: "text_show"; + signal: "elm,state,text,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.text"; + } + program { name: "text_hide"; + signal: "elm,state,text,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + } + program { name: "icon_show"; + signal: "elm,state,icon,visible"; + source: "elm"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.content"; + } + program { name: "icon_hide"; + signal: "elm,state,icon,hidden"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.content"; + } + program { name: "disable"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disabler"; + target: "bg"; + target: "bg2"; + after: "disable_text"; + } + program { name: "disable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.text", "disabled_visible", 0.0); + else + set_state(PART:"elm.text", "disabled", 0.0); + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); + else + set_state(PART:"elm.swallow.content", "disabled", 0.0); + get_state(PART:"check", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"check", "disabled_visible", 0.0); + } + } + program { name: "enable"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disabler"; + target: "bg"; + target: "bg2"; + after: "enable_text"; + } + program { name: "enable_text"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.text", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"elm.text", "visible", 0.0); + else + set_state(PART:"elm.text", "default", 0.0); + get_state(PART:"elm.swallow.content", st, 30, vl); + if (!strcmp(st, "visible")) + set_state(PART:"elm.swallow.content", "visible", 0.0); + else + set_state(PART:"elm.swallow.content", "default", 0.0); + get_state(PART:"check", st, 30, vl); + if (!strcmp(st, "disabled_visible")) + set_state(PART:"check", "visible", 0.0); + } + } + } + } + +#undef CHECK_STATE_DEFAULT +#undef CHECK_STATE_VISIBLE +#undef CHECK_STATE_DISABLED_VISIBLE +#undef CHECK_STATE_DISABLED diff --git a/res/white_theme/edc/gl-entry.edc b/res/white_theme/edc/gl-entry.edc new file mode 100755 index 0000000..68643ad --- /dev/null +++ b/res/white_theme/edc/gl-entry.edc @@ -0,0 +1,714 @@ +/* + * Copyright (c) 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: "elm/layout/searchbar/cancel_button" */ + +#define ENTRY_TEXT_SIZE_INC 44 + +#define EDITFIELD_TITLE_SIZE_INC 32 +#define EDITFIELD_TITLE_COLOR_INC 124 124 124 255 +#define EDITFIELD_GUIDE_TEXT_COLOR_INC 144 169 199 255 + +#define SEARCHBAR_BACKGROUND_COLOR_INC 215 225 232 255 +#define SEARCHBAR_CANCEL_BUTTON_W_INC 134 +#define SEARCHBAR_CANCEL_BUTTON_WITH_PADDING_W_INC 150 +#define SEARCHBAR_CANCEL_BUTTON_WITH_DOUBLE_PADDING_W_INC 166 +#define SEARCHBAR_TOP_PADDING_INC 18 +#define SEARCHBAR_BOTTOM_PADDING_INC 18 +#define SEARCHBAR_HEIGHT_INC 74 +#define SEARCHBAR_LEFT_PADDING_INC 16 +#define SEARCHBAR_RIGHT_PADDING_INC 16 +#define SEARCHBAR_INPUTFIELD_BORDER_INC 6 6 6 6 +#define SEARCHBAR_LEFT_ICON_PADDING_INC 0 +#define SEARCHBAR_ICON_MIN_W_INC 42 +#define SEARCHBAR_ICON_MIN_H_INC 42 +#define SEARCHBAR_LEFT_PADDING_SEARCHFIELD_INC 16 +#define SEARCHBAR_RIGHT_PADDING_SEARCHFIELD_INC 8 +#define SEARCHBAR_SEARCH_TEXTFIELD_H_INC 60 + +#define EDITFIELD_SEARCHBAR_TOP1_SINGLE_INC 6 +#define EDITFIELD_SEARCHBAR_TOP1_MULTI_INC 10 +#define EDITFIELD_SEARCHBAR_TOP2_INC 10 +#define EDITFIELD_SEARCHBAR_LEFT1_INC 0 +#define EDITFIELD_SEARCHBAR_LEFT2_INC 0 +#define EDITFIELD_SEARCHBAR_RIGHT1_ERASER_SHOW_INC 56 +#define EDITFIELD_SEARCHBAR_RIGHT2_INC 5 +#define EDITFIELD_SEARCHBAR_BOTTOM1_SINGLE_INC 8 +#define EDITFIELD_SEARCHBAR_BOTTOM1_MULTI_INC 2 +#define EDITFIELD_SEARCHBAR_BOTTOM2_SINGLE_INC 16 +#define EDITFIELD_SEARCHBAR_BOTTOM2_MULTI_INC 2 +#define EDITFIELD_SEARCHBAR_BOTTOM3_SINGLE_INC 50 +#define EDITFIELD_SEARCHBAR_BOTTOM3_MULTI_INC 50 + +#define EDITFIELD_SEARCHBAR_ERASER_MINW_INC 38 +#define EDITFIELD_SEARCHBAR_ERASER_MINH_INC 38 +#define EDITFIELD_SEARCHBAR_ERASER_EVENT_MINW_INC 38 +#define EDITFIELD_SEARCHBAR_ERASER_EVENT_MINH_INC 50 + +group { name: "elm/layout/searchbar/gallery"; + images { + image: GALLERY_EDC_IMAGE_EDITFIELD_CLEAR COMP; + image: GALLERY_EDC_IMAGE_EDITFIELD_CLEAR_PRESS COMP; + image: GALLERY_EDC_IMAGE_SEARCH_INPUT_FIELD_BG COMP; + } + parts { + part { name: "top_padding_rect"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + min: 0 SEARCHBAR_TOP_PADDING_INC; + fixed: 0 1; + align: 0 0; + color: SEARCHBAR_BACKGROUND_COLOR_INC; + rel2.relative: 1.0 0.0; + } + } + part { name: "bottom_padding_rect"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + min: 0 SEARCHBAR_BOTTOM_PADDING_INC; + fixed: 0 1; + align: 0 1; + color: SEARCHBAR_BACKGROUND_COLOR_INC; + rel1.relative: 0.0 1.0; + } + } + part { name: "base_bg"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 0 SEARCHBAR_HEIGHT_INC; + align: 0 0.5; + fixed: 0 1; + rel1 { + relative: 0.0 1.0; + to: "top_padding_rect"; + } + rel2 { + relative: 1.0 0.0; + to: "bottom_padding_rect"; + } + } + } + part { name: "left_padding_rect"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + min: SEARCHBAR_LEFT_PADDING_INC 0; + fixed: 1 0; + align: 0 0; + rel2.relative: 0.0 1.0; + color: SEARCHBAR_BACKGROUND_COLOR_INC; + } + } + part { name: "right_padding_rect"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + min: SEARCHBAR_RIGHT_PADDING_INC 0; + fixed: 1 0; + align: 1 0; + rel1.relative: 1.0 0.0; + color: SEARCHBAR_BACKGROUND_COLOR_INC; + } + } + part { name: "right_field_and_btn_padding_rect"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + min: SEARCHBAR_CANCEL_BUTTON_WITH_DOUBLE_PADDING_W_INC 0; + fixed: 1 0; + align: 1 0; + rel1.relative: 1.0 0.0; + color: SEARCHBAR_BACKGROUND_COLOR_INC; + } + } + part { name: "right_btn_padding_rect"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 1; + min: SEARCHBAR_CANCEL_BUTTON_WITH_PADDING_W_INC 0; + fixed: 1 0; + align: 1 0; + rel1.relative: 1.0 0.0; + color: SEARCHBAR_BACKGROUND_COLOR_INC; + } + } + part { name: "inputfield_rect"; + type: IMAGE; + scale: 1; + description { state: "default" 0.0; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + to_x: "left_padding_rect"; + to_y: "base_bg"; + } + rel2 { + relative: 0.0 1.0; + to_x: "right_padding_rect"; + to_y: "base_bg"; + } + image { + normal: GALLERY_EDC_IMAGE_SEARCH_INPUT_FIELD_BG; + border: SEARCHBAR_INPUTFIELD_BORDER_INC; + } + } + description { state: "in" 0.0; + inherit: "default" 0.0; + rel2.to_x: "right_field_and_btn_padding_rect"; + } + } + part { name: "left_icon_padding_rect"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: SEARCHBAR_LEFT_ICON_PADDING_INC 0; + fixed: 1 0; + align: 0 0; + rel1.to: "inputfield_rect"; + rel2 { + relative: 0.0 1.0; + to: "inputfield_rect"; + } + } + } + part { name: "left_padding_search_textfield"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: SEARCHBAR_LEFT_PADDING_SEARCHFIELD_INC 0; + fixed: 1 0; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + to_x: "left_icon_padding_rect"; + to_y: "inputfield_rect"; + } + rel2 { + relative: 1.0 1.0; + to_x: "left_icon_padding_rect"; + to_y: "inputfield_rect"; + } + } + } + part { name: "right_padding_search_textfield"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: SEARCHBAR_RIGHT_PADDING_SEARCHFIELD_INC 0; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 1.0 0.0; + to: "inputfield_rect"; + } + rel2 { + relative: 1.0 1.0; + to: "inputfield_rect"; + } + } + } + part { name: "search_textfield"; + type: RECT; + mouse_events: 1; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + color: 0 0 0 0; + min: 0 SEARCHBAR_SEARCH_TEXTFIELD_H_INC; + fixed: 0 1; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + to: "left_padding_search_textfield"; + } + rel2 { + relative: 0.0 1.0; + to: "right_padding_search_textfield"; + } + } + } + part { name: "button_cancel"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + fixed: 1 1; + min: SEARCHBAR_CANCEL_BUTTON_W_INC 0; + align: 0.0 0.5; + state: "default" 0.0; + rel1 { + relative: 1.0 1.0; + to_x: "base_bg"; + to_y: "top_padding_rect"; + } + rel2 { + relative: 1.0 0.0; + to_x: "base_bg"; + to_y: "bottom_padding_rect"; + } + } + description { state: "in" 0.0; + visible:1; + min: SEARCHBAR_CANCEL_BUTTON_W_INC 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 1.0; + to_x: "right_btn_padding_rect"; + to_y: "top_padding_rect"; + } + rel2 { + relative: 0.0 0.0; + to_x: "right_padding_rect"; + to_y: "bottom_padding_rect"; + } + } + } + part { name: "top1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_SEARCHBAR_TOP1_SINGLE_INC; + fixed: 1 1; + rel1 { + relative: 0.0 0.0; + to: "search_textfield"; + } + rel2 { + relative: 1.0 0.0; + to: "search_textfield"; + } + align: 0.5 0; + } + description { state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_SEARCHBAR_TOP1_MULTI_INC; + } + } + part { name: "top2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_SEARCHBAR_TOP2_INC; + fixed: 1 1; + rel1 { + relative: 0.0 0.0; + to: "search_textfield"; + } + rel2 { + relative: 1.0 0.0; + to: "search_textfield"; + } + align: 0.5 0; + } + } + part { name: "left1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: EDITFIELD_SEARCHBAR_LEFT1_INC 0; + fixed: 1 1; + align: 0 0; + rel1 { + relative: 0.0 0.0; + to: "search_textfield"; + } + rel2 { + relative: 0.0 1.0; + to: "search_textfield"; + } + } + } + part { name: "left2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: EDITFIELD_SEARCHBAR_LEFT2_INC 0; + fixed: 1 1; + align: 0 0; + rel1 { + relative: 0.0 0.0; + to: "search_textfield"; + } + rel2 { + relative: 0.0 1.0; + to: "search_textfield"; + } + } + } + part { name: "right1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: EDITFIELD_SEARCHBAR_RIGHT1_ERASER_SHOW_INC 0; + fixed: 1 1; + align: 1 0; + rel1 { + relative: 1.0 0.0; + to: "search_textfield"; + } + rel2.to: "search_textfield"; + } + } + part { name: "right2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: EDITFIELD_SEARCHBAR_RIGHT2_INC 0; + fixed: 1 1; + align: 1 0; + rel1 { + relative: 1.0 0.0; + to: "search_textfield"; + } + rel2.to: "search_textfield"; + } + } + part { name: "bottom1"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_SEARCHBAR_BOTTOM1_SINGLE_INC; + fixed: 1 1; + align: 0 1; + rel1 { + relative: 0.0 1.0; + to: "search_textfield"; + } + rel2.to: "search_textfield"; + } + description { state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_SEARCHBAR_BOTTOM1_MULTI_INC; + } + } + part { name: "bottom2"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_SEARCHBAR_BOTTOM2_SINGLE_INC; + fixed: 0 1; + rel1 { + relative: 0.0 1.0; + to: "search_textfield"; + } + rel2.to: "search_textfield"; + align: 0 1; + } + description { state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_SEARCHBAR_BOTTOM2_MULTI_INC; + } + } + part { name: "bottom3"; + type: RECT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + min: 0 EDITFIELD_SEARCHBAR_BOTTOM3_SINGLE_INC; + fixed: 0 1; + rel1 { + relative: 0.0 1.0; + to: "search_textfield"; + } + rel2.to: "search_textfield"; + align: 0 1; + } + description { state: "elm.text.show" 0.0; + inherit: "default" 0.0; + min: 0 EDITFIELD_SEARCHBAR_BOTTOM3_MULTI_INC; + } + } + part { name: "elm.text"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + visible: 0; + align: 0.0 0.0; + min: 0 34; + fixed: 1 1; + rel1 { + relative: 1.0 1.0; + to_x: "left2"; + to_y: "top2"; + } + rel2 { + relative: 1.0 1.0; + to_x: "left2"; + to_y: "top2"; + } + color: EDITFIELD_TITLE_COLOR_INC; + text { + font: "SLP:style=Medium"; + size: EDITFIELD_TITLE_SIZE_INC; + min: 1 1; + align: 0.0 0.0; + text_class: "slp"; + } + } + description { state: "elm.text.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "elm.guidetext"; + type: TEXT; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + align: 0.0 0.0; + fixed: 1 1; + rel1.to: "elm.swallow.content"; + rel2.to: "elm.swallow.content"; + color: EDITFIELD_GUIDE_TEXT_COLOR_INC; + text { + font: "SLP:style=Roman"; + size: ENTRY_TEXT_SIZE_INC; + min: 0 0; + align: 0.0 0.5; + text_class: "slp"; + } + } + description { state: "hidden" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "elm.swallow.content"; + type: SWALLOW; + scale: 1; + ignore_flags: ON_HOLD; + description { state: "default" 0.0; + min: 0 40; + rel1 { + relative : 1.0 1.0; + to_x: "left1"; + to_y: "top1"; + } + rel2 { + relative : 0.0 0.0; + to_x: "right1"; + to_y: "bottom1"; + } + align: 0.0 0.5; + } + } + part { name: "eraser_image"; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: EDITFIELD_SEARCHBAR_ERASER_MINW_INC EDITFIELD_SEARCHBAR_ERASER_MINH_INC; + fixed: 1 1; + align: 1 0.5; + rel1 { + relative: 0.0 0.5; + to_x : "right2"; + } + rel2 { + relative: 0.0 0.5; + to_x : "right2"; + } + } + description { state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + image { + normal: GALLERY_EDC_IMAGE_EDITFIELD_CLEAR; + border: 10 10 10 10; + border_scale: 1; + } + } + description { + state: "elm.eraser.pressed" 0.0; + inherit: "default" 0.0; + visible: 1; + image { + normal: GALLERY_EDC_IMAGE_EDITFIELD_CLEAR_PRESS; + border: 8 8 8 8; + border_scale: 1; + } + } + } + part { name: "eraser"; + type: RECT; + scale: 1; + mouse_events: 1; + description { state: "default" 0.0; + visible: 0; + min: EDITFIELD_SEARCHBAR_ERASER_EVENT_MINW_INC EDITFIELD_SEARCHBAR_ERASER_EVENT_MINH_INC; + fixed: 1 1; + align: 1 0.5; + color: 0 0 0 0; + rel1 { + relative: 0.0 0.5; + to_x : "right2"; + } + rel2 { + relative: 0.0 0.5; + to_x : "right2"; + } + } + description { state: "elm.eraser.show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "guidetext_show"; + signal: "elm,state,guidetext,show"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.guidetext"; + } + program { + name: "guidetext_hide"; + signal: "elm,state,guidetext,hide"; + source: "elm"; + action: STATE_SET "hidden" 0.0; + target: "elm.guidetext"; + } + program { + name: "eraser_show"; + signal: "elm,state,eraser,show"; + source: "elm"; + action: STATE_SET "elm.eraser.show" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "eraser_hide"; + signal: "elm,state,eraser,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "eraser_image"; + target: "eraser"; + } + program { + name: "label_show"; + signal: "elm,state,title,show"; + source: "elm"; + action: STATE_SET "elm.text.show" 0.0; + target: "elm.text"; + target: "top1"; + target: "bottom1"; + target: "bottom2"; + target: "bottom3"; + } + program { + name: "label_hide"; + signal: "elm,state,title,hide"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.text"; + target: "top1"; + target: "bottom1"; + target: "bottom2"; + target: "bottom3"; + } + program { + name: "eraser_clicked"; + signal: "mouse,clicked,1"; + source: "eraser"; + action: SIGNAL_EMIT "elm,eraser,clicked" "elm"; + } + program { + name: "bg_clicked"; + signal: "mouse,clicked,1"; + source: "search_textfield"; + action: SIGNAL_EMIT "elm,bg,clicked" "elm"; + } + program { name: "cancel_in"; + signal: "cancel,in"; + source: ""; + action: STATE_SET "in" 0.0; + target: "button_cancel"; + target: "inputfield_rect"; + transition: ACCELERATE 0.4; + } + program { name: "cancel_out"; + signal: "cancel,out"; + source: ""; + action: STATE_SET "default" 0.0; + target: "button_cancel"; + target: "inputfield_rect"; + transition: ACCELERATE 0.4; + } + program { name: "cancel_show"; + signal: "cancel,show"; + source: ""; + action: STATE_SET "in" 0.0; + target: "button_cancel"; + target: "inputfield_rect"; + } + program { name: "cancel_hide"; + signal: "cancel,hide"; + source: ""; + action: STATE_SET "default" 0.0; + target: "button_cancel"; + target: "inputfield_rect"; + } + program { + name: "eraser_pressed"; + signal: "mouse,down,1"; + source: "eraser"; + action: STATE_SET "elm.eraser.pressed" 0.0; + target: "eraser_image"; + } + program { + name: "eraser_unpressed"; + signal: "mouse,up,1"; + source: "eraser"; + action: STATE_SET "elm.eraser.show" 0.0; + target: "eraser_image"; + } + } +} + diff --git a/res/white_theme/edc/gl-gengrid-item-albums.edc b/res/white_theme/edc/gl-gengrid-item-albums.edc new file mode 100755 index 0000000..6839cac --- /dev/null +++ b/res/white_theme/edc/gl-gengrid-item-albums.edc @@ -0,0 +1,377 @@ +/* + * Copyright (c) 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. + */ + +/* 14 + 334 + 10 */ +#define ALBUM_ITEM_W 358 +/* 26 + 334 */ +#define ALBUM_ITEM_H 360 + +#define ALBUM_W 334 +#define ALBUM_H 334 + +#define ALBUM_GAP_L 12 +#define ALBUM_GAP_R 12 +#define ALBUM_GAP_T 26 + +#define ALBUM_ICON_W 318 +#define ALBUM_ICON_H 318 + +#define ALBUM_ICON_GAP_L 8 +#define ALBUM_ICON_GAP_R 8 +#define ALBUM_ICON_GAP_B 16 +#define ALBUM_ICON_PAD 3 + +#define ALBUM_TEXT_AREA_W 207 +#define ALBUM_TEXT_AREA_H 102 +#define ALBUM_TEXT_GAP_L 4 +#define ALBUM_TEXT_GAP_R 4 +#define ALBUM_TEXT_SNS_X 60 +#define ALBUM_TEXT_NAME_H 32 +#define ALBUM_TEXT_DATE_H 25 +#define ALBUM_PBAR_W 183 +#define ALBUM_PBAR_H 10 +#define ALBUM_PBAR_GAP_L 6 +#define ALBUM_PBAR_GAP_T 8 + +#define ALBUM_SNS_ICON_W 32 +#define ALBUM_SNS_ICON_H 32 + +#define ALBUM_RENAME_BTN_W 64 +#define ALBUM_RENAME_BTN_H 64 + +#define ALBUM_CHECKBOX_W 60 +#define ALBUM_CHECKBOX_H 60 +#define ALBUM_CHECKBOX_GAP_L 1 +#define ALBUM_CHECKBOX_GAP_T 8 + +#define ALBUM_ICON_BG_COLOR_INC 190 189 189 255 + +group { + name: "elm/gengrid/item/gallery/albums_view/default"; + + data.item: "texts" "elm.text.name elm.text.date elm.text.count"; + data.item: "contents" "elm.swallow.onlyicon label_bg"; + images { + image: GALLERY_EDC_IMAGE_MAIN_FOLDER_BG COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + color: 255 0 0 0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + part { name: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + min : ALBUM_W ALBUM_H; + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_MAIN_FOLDER_BG; + } + rel1 { relative: ALBUM_GAP_L/ALBUM_ITEM_W ALBUM_GAP_T/ALBUM_ITEM_H; to:"bg"; } + rel2 { relative: (ALBUM_ITEM_W-ALBUM_GAP_R-1)/ALBUM_ITEM_W 1.0; to:"bg"; } + } + } + part { name: "icon_bg"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + min : ALBUM_ICON_W ALBUM_ICON_H; + state: "default" 0.0; + color: ALBUM_ICON_BG_COLOR_INC; + rel1 { relative: ALBUM_ICON_GAP_L/ALBUM_ICON_W 0.0; to:"icon_bg_img"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_GAP_R+2)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_GAP_B+2)/ALBUM_ICON_H; to:"icon_bg_img"; } + } + } + part { + name: "elm.swallow.onlyicon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_ICON_PAD/ALBUM_ICON_W) (ALBUM_ICON_PAD/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "label_bg"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_ICON_PAD/ALBUM_ICON_W) (ALBUM_ICON_PAD/ALBUM_ICON_H); offset: 0 0; to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1)/ALBUM_ICON_H); offset: 0 0; to: "icon_bg"; } + } + } + part { + name: "edit_text_bg"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 0; + rel1 { relative: 0.0 0.0; to: "label_bg"; } + rel2 { relative: 1.0 1.0; to: "label_bg"; } + color: 100 100 100 100; + } + } + part { + name: "elm.text.date"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W ALBUM_TEXT_NAME_H/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H+ALBUM_TEXT_DATE_H-1)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + color: 190 190 190 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 22; + align: 0.0 0.5; + } + } + } + part { + name: "elm.text.count"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: ((ALBUM_TEXT_GAP_L+ALBUM_SNS_ICON_W+1)/ALBUM_TEXT_AREA_W) ALBUM_TEXT_SNS_X/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W 1.0; to: "label_bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 38; + align: 1.0 0.5; + } + } + } + part { + name: "elm.text.name"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W 0.0; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H-1)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 28; + align: 0.0 0.5; + } + } + } + } +} + +group { + name: "elm/gengrid/item/gallery/albums_edit_view/default"; + data.item: "texts" "elm.text.name elm.text.date elm.text.count"; + data.item: "contents" "elm.swallow.onlyicon elm.swallow.end elm.swallow.check_grid label_bg elm.swallow.rename"; + images { + image: GALLERY_EDC_IMAGE_MAIN_FOLDER_BG COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + color: 255 0 0 0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + part { name: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + min : ALBUM_W ALBUM_H; + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_MAIN_FOLDER_BG; + } + rel1 { relative: ALBUM_GAP_L/ALBUM_ITEM_W ALBUM_GAP_T/ALBUM_ITEM_H; to:"bg"; } + rel2 { relative: (ALBUM_ITEM_W-ALBUM_GAP_R-1)/ALBUM_ITEM_W 1.0; to:"bg"; } + } + } + part { name: "icon_bg"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + min : ALBUM_ICON_W ALBUM_ICON_H; + state: "default" 0.0; + color: ALBUM_ICON_BG_COLOR_INC; + rel1 { relative: ALBUM_ICON_GAP_L/ALBUM_ICON_W 0.0; to:"icon_bg_img"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_GAP_R+2)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_GAP_B+2)/ALBUM_ICON_H; to:"icon_bg_img"; } + } + } + part { + name: "elm.swallow.onlyicon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_ICON_PAD/ALBUM_ICON_W) (ALBUM_ICON_PAD/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "label_bg"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_ICON_PAD/ALBUM_ICON_W) (ALBUM_ICON_PAD/ALBUM_ICON_H); offset: 0 0; to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1)/ALBUM_ICON_H); offset: 0 0; to: "icon_bg"; } + } + } + part { + name: "edit_text_bg"; + type: RECT; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + visible: 0; + rel1 { relative: 0.0 0.0; to: "label_bg"; } + rel2 { relative: 1.0 1.0; to: "label_bg"; } + color: 100 100 100 100; + } + } + part { + name: "elm.text.date"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W ALBUM_TEXT_NAME_H/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H+ALBUM_TEXT_DATE_H-1)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + color: 190 190 190 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 22; + align: 0.0 0.5; + } + } + } + part { + name: "elm.text.count"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: ((ALBUM_TEXT_GAP_L+ALBUM_SNS_ICON_W+1)/ALBUM_TEXT_AREA_W) ALBUM_TEXT_SNS_X/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W 1.0; to: "label_bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 38; + align: 1.0 0.5; + } + } + } + part { + name: "elm.text.name"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_TEXT_GAP_L+25)/ALBUM_TEXT_AREA_W 0.0; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H-1)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 28; + align: 0.0 0.5; + } + } + } + part { + name: "elm.swallow.rename"; + type: SWALLOW; + description { + state: "default" 0.0; + min: ALBUM_RENAME_BTN_W ALBUM_RENAME_BTN_H; + max: ALBUM_RENAME_BTN_W ALBUM_RENAME_BTN_H; + rel1 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD-ALBUM_RENAME_BTN_W)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_PAD-ALBUM_RENAME_BTN_H)/ALBUM_ICON_H); to:"icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H); to:"icon_bg"; } + } + } + part { + name: "elm.swallow.check_grid"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + max : (ALBUM_ICON_W+2) (ALBUM_ICON_H+2); + rel1 { relative: (ALBUM_ICON_GAP_L-1)/ALBUM_ICON_W 0.0; to:"icon_bg_img"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_GAP_R+3)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_GAP_B+4)/ALBUM_ICON_H; to:"icon_bg_img"; } + } + } + part { + name: "elm.swallow.end"; + type: SWALLOW; + description { + state: "default" 0.0; + min: ALBUM_CHECKBOX_W ALBUM_CHECKBOX_H; + max: ALBUM_CHECKBOX_W ALBUM_CHECKBOX_H; + rel1 { relative: (ALBUM_CHECKBOX_GAP_L)/ALBUM_ITEM_W (ALBUM_CHECKBOX_GAP_T)/ALBUM_ITEM_H; to:"bg"; } + rel2 { relative: (ALBUM_CHECKBOX_GAP_L+ALBUM_CHECKBOX_W)/ALBUM_ITEM_W (ALBUM_CHECKBOX_GAP_T+ALBUM_CHECKBOX_H+1)/ALBUM_ITEM_H; to:"bg"; } + } + } + } +} + diff --git a/res/white_theme/edc/gl-gengrid-item-thumbview.edc b/res/white_theme/edc/gl-gengrid-item-thumbview.edc new file mode 100755 index 0000000..c0b6a17 --- /dev/null +++ b/res/white_theme/edc/gl-gengrid-item-thumbview.edc @@ -0,0 +1,1014 @@ +/* + * Copyright (c) 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. + */ + +/* Grid item background size W: 10+158+10; H: 24+158 */ +#define W 178 +#define H 193 +#define GAP_W 2 +#define GAP_H 18 + +/* Favourites icon boundary size */ +#define FAVOR_ICON_W 30 +#define FAVOR_ICON_H 30 + +group { + name: "elm/gengrid/item/gallery/thumbnail_view/default"; + + data.item: "contents" "elm.swallow.icon elm.swallow.end"; + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + color: 0 0 0 0; + rel1 { relative: 0.0 0.0; offset: 0 0;} + rel2 { relative: 1.0 1.0; offset: 0 0;} + } + } + part { + name: "icon_bg"; + type: RECT; + scale : 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 0; + color: 0 0 0 0; + rel1 { relative: 0.0 0.0;to:"bg"; } + rel2 { relative: 1.0 1.0;to:"bg"; } + + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + rel1 { relative: 0.0 0.0; to: "icon_bg"; } + rel2 { relative: 1.0 1.0; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.end"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.icon"; } + } + } + } + + programs { + program { + name: "movedonw_bg"; + signal: "movedown,bg,show"; + source: "bg"; + action: STATE_SET "move_down" 0.0; + target: "bg"; + } + } +} + + + + +group +{ + name: "elm/gengrid/photoframe/default_layout"; + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + } + + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_favor"; + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#endif + } + + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video"; + images { + image: GALLERY_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video_favor"; + images { + image: GALLERY_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "favoricon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (FAVOR_ICON_W*2+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } +#endif + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + rel1 { relative: 1 0; to: "favoricon_bg";} +#else + rel1 { relative: 1 0; to: "elm.videoicon_bg";} +#endif + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "favoricon_bg"; } + rel2 { relative: 1.0 1.0; to: "favoricon_bg"; } + } + } +#endif + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video_bookmark"; + images { + image: GALLERY_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (FAVOR_ICON_W*2+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } +#endif + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + rel1 { relative: 1 0; to: "bookmarkicon_bg";} +#else + rel1 { relative: 1 0; to: "elm.videoicon_bg";} +#endif + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.bookmarkicon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "bookmarkicon_bg"; } + rel2 { relative: 1.0 1.0; to: "bookmarkicon_bg"; } + } + } +#endif + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video_favor_bookmark"; + images { + image: GALLERY_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "favoricon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (FAVOR_ICON_W*2+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "favoricon_bg";} + rel2 { relative: (FAVOR_ICON_W*3+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } +#endif + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + rel1 { relative: 1 0; to: "bookmarkicon_bg";} +#else + rel1 { relative: 1 0; to: "elm.videoicon_bg";} +#endif + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "favoricon_bg"; } + rel2 { relative: 1.0 1.0; to: "favoricon_bg"; } + } + } + part { + name: "elm.swallow.bookmarkicon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "bookmarkicon_bg"; } + rel2 { relative: 1.0 1.0; to: "bookmarkicon_bg"; } + } + } +#endif + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +/*106+2*/ +#define ZOOMED_W 108 +/*106+10*/ +#define ZOOMED_H 116 + +#define ZOOMED_GAP_H 10 +#define ZOOMED_GAP_W 2 + +group +{ + name: "elm/gengrid/photoframe/zoomed_default_layout"; + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: 0 0;} + rel2 { relative: (ZOOMED_W-ZOOMED_GAP_W)/ZOOMED_W (ZOOMED_H-ZOOMED_GAP_H)/ZOOMED_H;} + } + } + } + + programs { + + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + diff --git a/res/white_theme/edc/gl-genlist-item-tags.edc b/res/white_theme/edc/gl-genlist-item-tags.edc new file mode 100755 index 0000000..89d4420 --- /dev/null +++ b/res/white_theme/edc/gl-genlist-item-tags.edc @@ -0,0 +1,873 @@ +/* + * Copyright (c) 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 GENLIST_LIST_BG_COLOR GALLERY_EDC_COLOR_BG +#define GENLIST_LIST_PRESS_COLOR 87 135 194 255 +#define GENLIST_PART_BOTTOM_LINE_INC 169 169 169 255 +#define GENLIST_PART_DISCLIP_COLOR_INC 255 255 255 110 // alpha was 64 +#define GENLIST_PART_BOTTOM_LINE_COLOR_TAG 169 169 169 255 + +#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: 0 0 0 0; \ + } \ + } + +#define GENLIST_PART_BASE_SWEEP_COLOR( param_item_height ) \ + part { name: "base"; \ + type: RECT; \ + repeat_events: 1; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: 0 param_item_height; \ + color: GENLIST_LIST_BG_COLOR; \ + } \ + } + +#define GENLIST_PART_BG_IMAGE \ + part { name: "bg_image"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + color: GENLIST_LIST_BG_COLOR; \ + } \ + description { state: "selected" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_LIST_PRESS_COLOR; \ + } \ + } + +#define GENLIST_PART_BOTTOM_LINE_TAG \ + part { name: "bottom_line"; \ + type: RECT; \ + clip_to: "disclip"; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: 0 1; \ + fixed: 0 1; \ + visible: 1; \ + color: GENLIST_PART_BOTTOM_LINE_COLOR_TAG; \ + rel1 { \ + relative: 0.0 1.0; \ + offset: 0 -1; \ + } \ + } \ + } + +#define GENLIST_PART_PADDING_TOP( param_padding_size ) \ + part { name: "elm.padding.top"; \ + type: RECT; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + min: 0 param_padding_size; \ + fixed: 0 1; \ + visible: 0; \ + rel2.relative: 1.0 0.0; \ + align: 0.0 0.0; \ + } \ + } + +#define GENLIST_PART_PADDING_BOTTOM( param_padding_size ) \ + part { name: "elm.padding.bottom"; \ + type: RECT; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + min: 0 param_padding_size; \ + fixed: 0 1; \ + visible: 0; \ + rel1.relative: 0.0 1.0; \ + align: 0.0 1.0; \ + } \ + } + +#define GENLIST_PART_PADDING_LEFT( param_padding_size ) \ + part { name: "elm.padding.left"; \ + type: RECT; \ + scale: 1; \ + description { \ + state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel2.relative: 0.0 1.0; \ + align: 0.0 0.0; \ + } \ + } + +#define GENLIST_PART_PADDING_RIGHT( param_padding_size ) \ + part { name: "elm.padding.right"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: param_padding_size 0; \ + fixed: 1 0; \ + visible: 0; \ + rel1.relative: 1.0 0.0; \ + align: 1.0 0.0; \ + } \ + } + +#define GENLIST_PART_DISCLIP \ + part { name: "disclip"; \ + type: RECT; \ + description { state: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: GENLIST_PART_DISCLIP_COLOR_INC; \ + } \ + } + + +#define TAG_COLOR_GAP 190 189 189 255 +#define TAG_COLOR_TITLE 0 0 0 255 +#define TAG_COLOR_COUNT 124 124 124 255 +#define TAG_COLOR_RENAME_BG 255 255 255 255 +#define TAG_FONT_TITLE 44 +#define TAG_FONT_COUNT 32 + +#define TAG_ITEM_H 128 +#define TAG_PAD_L 16 +#define TAG_PAD_R 16 +#define TAG_PAD_ICON_R 16 +#define TAG_PAD_ICON_L 16 +#define TAG_PAD_RENAME_BTN_L 16 +#define TAG_ICON_BG_W 112 +#define TAG_ICON_BG_H 112 +#define TAG_INTER 2 +#define TAG_CHECKBOX_W 42 +#define TAG_CHECKBOX_H 42 +#define TAG_RENAME_BTN_W 64 +#define TAG_RENAME_BTN_H 64 +#define TAG_TITLE_H 64 +#define TAG_DURATION_H 48 +#define TAG_DURATION_W 72 +#define TAG_RENAME_BG_H 112 + +// genlist for tags view +group { name: "elm/genlist/item/tags_list/gallery/default"; + alias: "elm/genlist/item_odd/tags_list/gallery/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text.title elm.text.tag_count"; + data.item: "contents" "elm.icon"; + data.item: "flips" "elm.flip.content"; + parts { + GENLIST_PART_BASE_SWEEP_COLOR( TAG_ITEM_H ) + GENLIST_PART_BG_IMAGE + GENLIST_PART_BOTTOM_LINE_TAG + GENLIST_PART_PADDING_LEFT( TAG_PAD_L ) + GENLIST_PART_PADDING_RIGHT( TAG_PAD_R ) + + part { name: "elm.padding.icon.right"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: TAG_PAD_ICON_R 0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + to_x: "elm.icon"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 0; + to_x: "elm.icon"; + } + color: 0 0 0 0; + align: 0.0 0.0; + } + } + part { name: "icon_bg"; + clip_to: "disclip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: TAG_ICON_BG_W TAG_ICON_BG_H; + max: TAG_ICON_BG_W TAG_ICON_BG_H; + fixed: 1 1; + align: 0.0 0.5; + color: TAG_COLOR_GAP; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.left"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 0; + to_x: "elm.padding.left"; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + } + } +//tag thumbnail + part { name: "elm.icon"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1 { + relative: TAG_INTER/TAG_ICON_BG_W TAG_INTER/TAG_ICON_BG_H; + to: "icon_bg"; + } + rel2 { + relative: (TAG_ICON_BG_W-TAG_INTER+1)/TAG_ICON_BG_W (TAG_ICON_BG_H-TAG_INTER+1)/TAG_ICON_BG_H; + to: "icon_bg"; + } + } + } +//tag name + part { name: "elm.text.title"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: 0 TAG_TITLE_H; + fixed: 0 1; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.icon.right"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.text.tag_count"; + } + color: TAG_COLOR_TITLE; + text { + font: "SLP:style=Regular"; + text_class: "slp"; + size: TAG_FONT_TITLE; + min: 0 1; + align: 0.0 0.5; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + +//tag count + part { name: "elm.text.tag_count"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: TAG_DURATION_W TAG_DURATION_H; + max: TAG_DURATION_W TAG_DURATION_H; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 0.0; + to_x: "elm.padding.right"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + } + color: TAG_COLOR_COUNT; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: TAG_FONT_COUNT; + min: 0 1; + align: 1.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: TAG_COLOR_COUNT; + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.flip.content.bg"; + clip_to: "disclip"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 0 TAG_RENAME_BG_H; + fixed: 0 1; + align: 0 0.5; + color: TAG_COLOR_RENAME_BG; + rel1 { + relative: 1.0 0.0; + offset: 50 0; + to_x: "elm.padding.icon.right"; + to_y: "icon_bg"; + } + rel2 { + relative: 0.0 1.0; + offset: -50 0; + to_x: "elm.padding.right"; + to_y: "icon_bg"; + } + } + description { state: "flip_enabled" 0.0; + visible: 1; + min: 0 TAG_RENAME_BG_H; + fixed: 0 1; + align: 0 0.5; + color: TAG_COLOR_RENAME_BG; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.icon.right"; + to_y: "icon_bg"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.padding.right"; + to_y: "icon_bg"; + } + } + } + + part { name: "elm.flip.content"; + clip_to: "disclip"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 0 TAG_RENAME_BG_H; + fixed: 0 1; + align: 0 0.5; + rel1 { + relative: 1.0 0.0; + offset: 50 0; + to_x: "elm.padding.icon.right"; + to_y: "icon_bg"; + } + rel2 { + relative: 0.0 1.0; + offset: -50 0; + to_x: "elm.padding.right"; + to_y: "icon_bg"; + } + } + description { state: "flip_enabled" 0.0; + visible: 1; + min: 0 TAG_RENAME_BG_H; + fixed: 0 1; + align: 0 0.5; + rel1 { + relative: 1.0 0.0; + offset: 5 0; + to_x: "elm.padding.icon.right"; + to_y: "icon_bg"; + } + rel2 { + relative: 0.0 1.0; + offset: -5 0; + to_x: "elm.padding.right"; + to_y: "icon_bg"; + } + } + } + + GENLIST_PART_DISCLIP + } + programs { + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.flip.content", st, 30, vl); + if (!strcmp(st, "default")) + { + set_state(PART:"bg_image", "selected", 0.0); + set_state(PART:"elm.text.tag_count", "selected", 0.0); + set_state(PART:"elm.text.title", "selected", 0.0); + } + } + //action: STATE_SET "selected" 0.0; + //target: "bg_image"; + //target: "elm.text.tag_count"; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg_image"; + target: "elm.text.tag_count"; + target: "elm.text.title"; + transition: LINEAR 0.1; + } + program { name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + program { name: "flip_enabled"; + signal: "elm,state,flip,enabled"; + source: "elm"; + action: STATE_SET "flip_enabled" 0.0; + target: "elm.text.tag_count"; + target: "elm.text.title"; + after: "enable_flip_mode_next"; + } + program { name: "enable_flip_mode_next"; + action: STATE_SET "flip_enabled" 0.0; + transition: DECELERATE 0.5; + target: "icon_bg"; + target: "elm.flip.content.bg"; + target: "elm.flip.content"; + } + program { name: "flip_disabled"; + signal: "elm,state,flip,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.flip.content"; + target: "elm.flip.content.bg"; + after: "disable_flip_mode_next"; + } + program { name: "disable_flip_mode_next"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "elm.text.tag_count"; + target: "elm.text.title"; + target: "icon_bg"; + } + } +} + +// genlist for tags edit view +group { name: "elm/genlist/item/tags_list_edit/gallery/default"; + alias: "elm/genlist/item_odd/tags_list_edit/gallery/default"; + + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.text.title elm.text.tag_count"; + data.item: "contents" "elm.icon elm.swallow.checkbox elm.swallow.rename"; + data.item: "flips" "elm.flip.content"; + parts { + GENLIST_PART_BASE( TAG_ITEM_H ) + GENLIST_PART_BG_IMAGE + GENLIST_PART_BOTTOM_LINE_TAG + GENLIST_PART_PADDING_LEFT( TAG_PAD_L ) + GENLIST_PART_PADDING_RIGHT( TAG_PAD_R ) + +//checkbox + part { name: "elm.swallow.checkbox"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: TAG_CHECKBOX_W TAG_CHECKBOX_H; + max: TAG_CHECKBOX_W TAG_CHECKBOX_H; + fixed: 1 1; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.left"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 0; + to_x: "elm.padding.left"; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.padding.icon.left"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: TAG_PAD_ICON_L 0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + to_x: "elm.swallow.checkbox"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 0; + to_x: "elm.swallow.checkbox"; + } + color: 0 0 0 0; + align: 0.0 0.0; + } + } + part { name: "elm.padding.icon.right"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: TAG_PAD_ICON_R 0; + fixed: 1 0; + rel1 { + relative: 1.0 0.0; + to_x: "elm.icon"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 0; + to_x: "elm.icon"; + } + color: 0 0 0 0; + align: 0.0 0.0; + } + } + part { name: "icon_bg"; + clip_to: "disclip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: TAG_ICON_BG_W TAG_ICON_BG_H; + max: TAG_ICON_BG_W TAG_ICON_BG_H; + fixed: 1 1; + align: 0.0 0.5; + color: TAG_COLOR_GAP; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.icon.left"; + } + rel2 { + relative: 1.0 1.0; + to_x: "elm.padding.icon.left"; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.left"; + } + rel2 { + relative: 1.0 1.0; + to_x: "elm.padding.left"; + } + } + } +//tag thumbnail + part { name: "elm.icon"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1 { + relative: TAG_INTER/TAG_ICON_BG_W TAG_INTER/TAG_ICON_BG_H; + to: "icon_bg"; + } + rel2 { + relative: (TAG_ICON_BG_W-TAG_INTER+1)/TAG_ICON_BG_W (TAG_ICON_BG_H-TAG_INTER+1)/TAG_ICON_BG_H; + to: "icon_bg"; + } + } + } +//tag name + part { name: "elm.text.title"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: 0 TAG_TITLE_H; + fixed: 0 1; + align: 0.0 0.5; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.icon.right"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.text.tag_count"; + } + color: TAG_COLOR_TITLE; + text { + font: "SLP:style=Regular"; + text_class: "slp"; + size: TAG_FONT_TITLE; + min: 0 1; + align: 0.0 0.5; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: 255 255 255 255; + } + } + +//rename button + part { name: "elm.swallow.rename"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + min: TAG_RENAME_BTN_W TAG_RENAME_BTN_H; + max: TAG_RENAME_BTN_W TAG_RENAME_BTN_H; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 0.0; + to_x: "elm.padding.right"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.right"; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.padding.rename.left"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: TAG_PAD_RENAME_BTN_L 0; + fixed: 1 0; + visible: 0; + rel1 { + relative: 0.0 0.0; + to_x: "elm.swallow.rename"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.swallow.rename"; + } + align: 1.0 0.0; + } + } +//tag count + part { name: "elm.text.tag_count"; + clip_to: "disclip"; + type: TEXT; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: TAG_DURATION_W TAG_DURATION_H; + max: TAG_DURATION_W TAG_DURATION_H; + fixed: 1 0; + align: 1.0 0.5; + rel1 { + relative: 0.0 0.0; + to_x: "elm.padding.rename.left"; + } + rel2 { + relative: 0.0 1.0; + to_x: "elm.padding.rename.left"; + } + color: TAG_COLOR_COUNT; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: TAG_FONT_COUNT; + min: 0 1; + align: 1.0 0.5; + } + } + description { state: "selected" 0.0; + inherit: "default" 0.0; + color: TAG_COLOR_COUNT; + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { name: "elm.flip.content.bg"; + clip_to: "disclip"; + type: RECT; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 0 TAG_RENAME_BG_H; + fixed: 0 1; + align: 0 0.5; + color: TAG_COLOR_RENAME_BG; + rel1 { + relative: 1.0 0.0; + to_x: "elm.padding.icon.right"; + to_y: "icon_bg"; + } + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.swallow.rename"; + to_y: "icon_bg"; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 1; + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.padding.right"; + to_y: "icon_bg"; + } + } + } + + part { name: "elm.flip.content"; + clip_to: "disclip"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { state: "default" 0.0; + visible: 0; + min: 0 TAG_RENAME_BG_H; + fixed: 0 1; + align: 0 0.5; + rel1 { + relative: 1.0 0.0; + offset: 5 0; + to_x: "elm.padding.icon.right"; + to_y: "icon_bg"; + } + rel2 { + relative: 0.0 1.0; + offset: -5 0; + to_x: "elm.swallow.rename"; + to_y: "icon_bg"; + } + } + description { state: "flip_enabled" 0.0; + inherit: "default" 0.0; + visible: 1; + rel2 { + relative: 0.0 1.0; + offset: 0 0; + to_x: "elm.padding.right"; + to_y: "icon_bg"; + } + } + } + GENLIST_PART_DISCLIP + } + programs { + program { name: "go_active"; + signal: "elm,state,selected"; + source: "elm"; + script { + new st[31]; + new Float:vl; + get_state(PART:"elm.flip.content", st, 30, vl); + if (!strcmp(st, "default")) + { + set_state(PART:"bg_image", "selected", 0.0); + set_state(PART:"elm.text.tag_count", "selected", 0.0); + set_state(PART:"elm.text.title", "selected", 0.0); + } + } + //action: STATE_SET "selected" 0.0; + //target: "bg_image"; + //target: "elm.text.tag_count"; + } + program { name: "go_passive"; + signal: "elm,state,unselected"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "bg_image"; + target: "elm.text.title"; + target: "elm.text.tag_count"; + transition: LINEAR 0.1; + } + program { name: "go_disabled"; + signal: "elm,state,disabled"; + source: "elm"; + action: STATE_SET "disabled" 0.0; + target: "disclip"; + } + program { name: "go_enabled"; + signal: "elm,state,enabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "disclip"; + } + program { name: "flip_enabled"; + signal: "elm,state,flip,enabled"; + source: "elm"; + action: STATE_SET "flip_enabled" 0.0; + target: "elm.text.tag_count"; + target: "elm.text.title"; + after: "enable_flip_mode_next"; + } + program { name: "enable_flip_mode_next"; + action: STATE_SET "flip_enabled" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.checkbox"; + target: "elm.swallow.rename"; + target: "icon_bg"; + target: "elm.flip.content.bg"; + target: "elm.flip.content"; + } + program { name: "flip_disabled"; + signal: "elm,state,flip,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "elm.flip.content"; + target: "elm.flip.content.bg"; + after: "disable_flip_mode_next"; + } + program { name: "disable_flip_mode_next"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "elm.swallow.rename"; + target: "elm.text.tag_count"; + target: "elm.text.title"; + target: "icon_bg"; + target: "elm.swallow.checkbox"; + } + } +} diff --git a/res/white_theme/edc/gl-genlist-sweep.edc b/res/white_theme/edc/gl-genlist-sweep.edc new file mode 100755 index 0000000..6a380f8 --- /dev/null +++ b/res/white_theme/edc/gl-genlist-sweep.edc @@ -0,0 +1,371 @@ +/* + * Copyright (c) 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 GENLIST_HEIGHT_113_INC 113 +#define GENLIST_HEIGHT_129_INC TAG_ITEM_H + +#define GENLIST_PADDING_6_INC 6 +#define GENLIST_PADDING_11_INC 11 +#define GENLIST_PADDING_13_INC 13 +#define GENLIST_PADDING_16_INC 16 + +#define GENLIST_FONT_32_INC 32 +#define GENLIST_FONT_44_INC 44 + +#define GENLIST_SIZE_13_INC 13 +#define GENLIST_SIZE_16_INC 16 +#define GENLIST_SIZE_45_INC 45 +#define GENLIST_SIZE_56_INC 56 +#define GENLIST_SIZE_57_INC 57 +#define GENLIST_SIZE_SLIDE_60_INC 60 +#define GENLIST_SIZE_SLIDE_165_INC 165 +#define GENLIST_SIZE_SLIDE_220_INC 220 +#define GENLIST_SIZE_390_INC 390 + +#define GENLIST_TREESIZE_32_INC 32 + +#define GENLIST_PART_SLIDE_TEXT_COLOR_INC 0 0 0 255 + +#define GENLIST_SWEEP_BG_COLOR_INC GENLIST_LIST_BG_COLOR + +#define SWEEP_ICON_112_W 112 +#define SWEEP_INTER_2_W 2 +#define SWEEP_COLOR_GAP 190 189 189 255 + + group { name: "elm/genlist/item/mode/gallery/slide2_tag/default"; + alias: "elm/genlist/item_odd/mode/gallery/slide2_tag/default"; + alias: "elm/genlist/item_compress/mode/gallery/slide2_tag/default"; + alias: "elm/genlist/item_compress_odd/mode/gallery/slide2_tag/default"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; + data.item: "texts" "elm.slide.text.1"; + data.item: "contents" "elm.slide.swallow.1 elm.slide.swallow.2 elm.slide.icon"; + data.item: "mode_part" "elm.swallow.origin"; + data.item: "treesize" "GENLIST_TREESIZE_32_INC"; + + parts { + part { name: "base"; + type: RECT; + clip_to: "disclip"; + scale: 1; + description { state: "default" 0.0; + min: 0 GENLIST_HEIGHT_129_INC; + color: GENLIST_SWEEP_BG_COLOR_INC; + } + } + part { name: "bottom_line"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + description { state: "default" 0.0; + min: 0 1; + fixed: 0 1; + visible: 1; + color: GENLIST_PART_BOTTOM_LINE_INC; + rel1 { + relative: 0.0 1.0; + offset: 0 -1; + to: "base"; + } + rel2.to: "base"; + } + } + part { name: "base.padding.left"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: GENLIST_SIZE_16_INC 0; + fixed: 1 0; + visible: 0; + align: 0 0.5; + rel1.to: "base"; + rel2 { + relative: 0 1; + to: "base"; + } + } + } + part { name: "base.padding.right"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: GENLIST_SIZE_16_INC 0; + fixed: 1 0; + visible: 0; + align: 1 0.5; + rel1 { + relative: 1 0; + to: "base"; + } + rel2.to: "base"; + } + } + part { name: "base.padding.icon"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: SWEEP_ICON_112_W 0; + fixed: 1 0; + visible: 0; + align: 1 0.5; + rel1.to: "base.padding.right"; + rel2 { + relative: 0 1; + to: "base.padding.right"; + } + } + } + part { name: "base.padding.icon.left"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: GENLIST_SIZE_16_INC 0; + fixed: 1 0; + visible: 0; + align: 1 0.5; + rel1.to: "base.padding.icon"; + rel2 { + relative: 0 1; + to: "base.padding.icon"; + } + } + } + part { name: "base.padding.bottom"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: 0 GENLIST_PADDING_11_INC; + fixed: 0 1; + visible: 0; + align: 0.5 1; + rel1 { + relative: 0 1; + to: "base"; + } + rel2 { + relative: 1 1; + to: "base"; + } + } + } + part { name: "elm.slide.text.1"; + type: TEXT; + clip_to: "disclip"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: 0 GENLIST_SIZE_56_INC; + fixed: 0 1; + align: 0.5 0; + rel1 { + relative: 1 0; + to_x: "base.padding.left"; + to_y: "base"; + } + rel2 { + relative: 0 0; + to_x: "base.padding.icon.left"; + to_y: "base"; + } + color: GENLIST_PART_SLIDE_TEXT_COLOR_INC; + text { + font: "SLP:style=Roman"; + text_class: "slp"; + size: GENLIST_FONT_32_INC; + min: 0 1; + align: 0.5 0.5; + } + } + } + part { name: "base.padding.center"; + type: RECT; + clip_to: "disclip"; + mouse_events: 0; + scale: 1; + description { state: "default" 0.0; + min: GENLIST_SIZE_16_INC 0; + fixed: 1 0; + visible: 0; + align: 0.5 0.5; + rel1 { + relative: 0.5 0; + to_x: "elm.slide.text.1"; + to_y: "base"; + } + rel2 { + relative: 0.5 1; + to_x: "elm.slide.text.1"; + to_y: "base"; + } + } + } + part { name: "elm.slide.swallow.1"; + type: SWALLOW; + clip_to: "disclip"; + description { state: "default" 0.0; + rel1 { + relative: 1 1; + to_x: "base.padding.left"; + to_y: "elm.slide.text.1"; + } + rel2 { + relative: 0 0; + to_x: "base.padding.center"; + to_y: "base.padding.bottom"; + } + } + } + part { name: "elm.slide.swallow.2"; + type: SWALLOW; + clip_to: "disclip"; + description { state: "default" 0.0; + rel1 { + relative: 1 1; + to_x: "base.padding.center"; + to_y: "elm.slide.text.1"; + } + rel2 { + relative: 0 0; + to_x: "base.padding.icon.left"; + to_y: "base.padding.bottom"; + } + } + } + + part { name: "elm.slide.icon_bg"; + clip_to: "disclip"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: TAG_ICON_BG_W TAG_ICON_BG_H; + max: TAG_ICON_BG_W TAG_ICON_BG_H; + fixed: 1 1; + align: 0.0 0.5; + color: SWEEP_COLOR_GAP; + rel1 { + relative: 0.0 0.0; + to: "base.padding.icon"; + } + rel2 { + relative: 1.0 1.0; + offset: 0 0; + to: "base.padding.icon"; + } + } + } + part { name: "elm.slide.icon"; + clip_to: "disclip"; + type: SWALLOW; + scale: 1; + description { state: "default" 0.0; + fixed: 1 1; + align: 0.5 0.5; + rel1 { + relative: SWEEP_INTER_2_W/SWEEP_ICON_112_W SWEEP_INTER_2_W/SWEEP_ICON_112_W; + to: "elm.slide.icon_bg"; + } + rel2 { + relative: (SWEEP_ICON_112_W-SWEEP_INTER_2_W+1)/SWEEP_ICON_112_W (SWEEP_ICON_112_W-SWEEP_INTER_2_W+1)/SWEEP_ICON_112_W; + to: "elm.slide.icon_bg"; + } + } + } + // Transparent part between base parts and slidable parts + part { name: "event_block_layer"; + type: RECT; + clip_to: "disclip"; + mouse_events: 1; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + color: 0 0 0 0; + } + description { state: "repeat_events" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + // Swallow part for original genlist item style + part { name: "elm.swallow.origin"; + clip_to: "disclip"; + type: SWALLOW; + description { state: "default" 0.0; + } + description { state: "slide" 0.0; + inherit: "default" 0.0; + rel1.relative: 1 0; + rel2.relative: 2 1; + } + } + part { name: "disclip"; + type: RECT; + description { state: "default" 0.0; + rel1.to: "base"; + rel2.to: "base"; + } + description { state: "disabled" 0.0; + inherit: "default" 0.0; + color: GENLIST_PART_DISCLIP_COLOR_INC; + } + } + } + programs { + program { + name: "slide_right"; + signal: "elm,state,slide,active"; + source: "elm"; + action: STATE_SET "slide" 0.0; + target: "elm.swallow.origin"; + transition: ACCELERATE 0.5; + after: "unblock_event"; + } + program { + name: "unblock_event"; + action: STATE_SET "repeat_events" 0.0; + target: "event_block_layer"; + } + program { + name: "slide_left"; + signal: "elm,state,slide,passive"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "event_block_layer"; + after: "slide_left2"; + } + program { + name: "slide_left2"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.origin"; + transition: DECELERATE 0.5; + after: "slide_left_finished"; + } + program { + name: "slide_left_finished"; + action: SIGNAL_EMIT "elm,state,slide,passive,finished" "elm"; + } + } + } + diff --git a/res/white_theme/edc/gl-nocontents.edc b/res/white_theme/edc/gl-nocontents.edc new file mode 100755 index 0000000..675d03f --- /dev/null +++ b/res/white_theme/edc/gl-nocontents.edc @@ -0,0 +1,88 @@ +/* + * Copyright (c) 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 NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC 32 +#define NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC 173 170 165 255 + + group { + name: "elm/layout/nocontents/gallery"; + styles{ + style { name: "nocontent_style"; + base: "font=SLP:style=Roman text_class=slp font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=word"; + tag: "br" "\n"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp"; + tag: "b" "+ font=SLP:style=Bold text_class=slp"; + tag: "tab" "\t"; + } + } + images { + image: GALLERY_EDC_IMAGE_NOCONTENTS_PIC COMP; + } + parts { + part { name: "bg"; + scale: 1; + type: RECT; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + } + part { name: "nocontents.image"; + description { state: "default" 0.0; + visible: 1; + align: 0.5 0.0; + rel1 { relative: 203/720 296/1016; to: "bg";} + rel2 { relative: (203+314)/720 (296+310)/1016; to: "bg";} + image { + normal: GALLERY_EDC_IMAGE_NOCONTENTS_PIC; + border: 1 1 1 1; + border_scale: 1; + } + aspect: 1.0 1.0; + aspect_preference: BOTH; + } + } + part { name: "middle.padding"; + scale: 1; + type: RECT; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + rel1 { relative: 0.0 1.0; to_y: "nocontents.image";} + rel2 { relative: 1.0 (296+310+54)/1016; to: "bg";} + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + description { state: "default" 0.0; + fixed: 0 1; + align: 0.5 0.0; + visible: 1; + rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "middle.padding";} + rel2 { relative: 1.0 1.0; to: "bg";} + color: NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC; + text { + style: "nocontent_style"; + align: 0.5 0.5; + min: 0 0; + max: 0 1; + } + } + } + } + } diff --git a/res/white_theme/edc/images/00_EditField_clear.png b/res/white_theme/edc/images/00_EditField_clear.png new file mode 100755 index 0000000000000000000000000000000000000000..0244344034f9c74a12616272db34310b0eecedab GIT binary patch literal 3275 zcmV;+3^enJP)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_CMttHv6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<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`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} z0001WNklJQ3`EhNh!re_MQB-u85n}CXxSr5BoASl6byh<`8qd#va3sG z#*8cgs=5Ogu>HLM0ZtLQlbNBa4Jb~>bP-we7>eW93P5I30tzUgfC36AAWx_|8ubeu oK=)`sV>fA5fqVe~0RR630PwLGy;${NP5=M^07*qoM6N<$f+=uSSpWb4 literal 0 HcmV?d00001 diff --git a/res/white_theme/edc/images/00_search_input_field_bg.png b/res/white_theme/edc/images/00_search_input_field_bg.png new file mode 100755 index 0000000000000000000000000000000000000000..096accf8df0be0a11254cd3477fa089937131c0d GIT binary patch literal 3130 zcm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F<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0004HNkl=@CdjEB>YMV?0`?I z`UN1pmYz%|lNbGd|5={rkFB*fNfJZ^fEeR`yWM_RE|+gan8& z%M=KCo*#t}sMqUw?|&02M1*Fuc?1Ll7;A0ny~jECN2$UXlLA*qBuRp`_U280#Z)U) z^H1XcV1P2lxWB7VmgOEO4RE>J?auBhZZ?}U;L-r+i^bwJ#z(^b07*qoM6N<$f`yaT9smFU literal 0 HcmV?d00001 diff --git a/res/white_theme/edc/images/00_winset_title_tabbar_bg.png b/res/white_theme/edc/images/00_winset_title_tabbar_bg.png new file mode 100755 index 0000000000000000000000000000000000000000..aafefef06d8eb7047893710556424358dedd4313 GIT binary patch literal 3394 zcmV-I4ZZS-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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jTl+GM#3$sI`G@4IN5+H+uA)uZbNjZ zWQ4VU%*sfNP|1Le8ZX-TwcVTAF)fTDfxZLXTCjrZ^$C>=JfrG@I%lUX#dLe9s zKM_6rA%Efdo9fzLy!V*zgzxs|l6;XfQ%+6pW-ilx#<}@7jLWy)>>d9yCMo8QN|V~- za8Ufq58$^QK9xhnQ5}8QE7%e24@_f!VzJd@=JfvfK7VA#FSTz|B@&)b7p?la-!dmT(fC^&QW zbbe?1QEz;DXDQ;`l=K(#3pKD~xWyrC=+69h>|_?|U@R4zjg5*{_`TpxD#Jx?c@dZI zGNZr0V+mQAFeayL>2&B2T@K!c95j@wpxof&#PJwJUUfiYpX=x;qOtyTTt zi|zAD=$QAIWD)me+2u$BHD2BFaXfFlH1{Ak>qEe!@{1k9F7Inne|Nvo`=KyZ z<=aQM&i1-O7eWQUzg%XvU4JC}SeoqjyXn~BQ{`C}Z&ntWk|OW$+)GuSbhS5yz0B;b z0U$yG05EX?@SA+q+W_#75&-PDU#-$S0N_Svy7id=04T!T$PgAb|7~8`g2Ir4>I>N? zcg}dw03sZ7{f7LviA}1UC4vskkVHo!Wvx33>*=BBF3}I^l@;d~dFfpoPc=cqYo=m+ z`C-XpYmE_&%4dc5DVHaR(RWd@TPgjAA6;x`U^&riUl<57m@L8rGNlseN14#s+U%jk z){$R{fLi`tvz`YmFyl%E1CEIAoO|t7(e{j*~piOw}gb&|H9*{B{|C);(ER`a literal 0 HcmV?d00001 diff --git a/res/white_theme/edc/images/T01_album_checkbox_check.png b/res/white_theme/edc/images/T01_album_checkbox_check.png new file mode 100755 index 0000000000000000000000000000000000000000..8f921d74052dace4a5cdc534cfa3bd3ecc232159 GIT binary patch literal 3223 zcmV;I3~2L-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%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E@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} z0002VNklw5r`&oI!UMKEa^tP5LNGTTkd1HmeS zU=V}J2M`3ywXARI>cIbYubM4~?4DpmFe8LOr`1)ycDI;`> z5%#}5a4)<>4~x7~eLx3~x1hJ&_>6bF;&{(fC07i4&zNJIMJSRuWkxu{e;&RJ00Y$_ Une5_z9RL6T07*qoM6N<$f(>hgw*UYD literal 0 HcmV?d00001 diff --git a/res/white_theme/edc/images/T01_check.png b/res/white_theme/edc/images/T01_check.png new file mode 100755 index 0000000000000000000000000000000000000000..d5057e46a386bf5e7c1b4373171b9c3698119cbe GIT binary patch literal 3035 zcmV<13ncW3P)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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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} z00037Nkl)B#8s2a5w7PzgxDLF)h{;2?3({TVoAPKGJF z1BVatIc;*Ayd=|R97nvv7I>3=L7xFKRWa4xRMk{>(`QYst}|5u&;wXr&xCBMX5>Kt zoU4{D12F)h8Ylw+fFNX@j2=L?LLSri@0!6>_tEhZ9qdWSLCE0wq@XbovrSdEdb0JxfkQYad1C}%QxbocMg_fEA%|DoM=gM1(qY42R#x-< d3;KA_?*O6yga9Y^j$;4-002ovPDHLkV1gCWnhO8` literal 0 HcmV?d00001 diff --git a/res/white_theme/edc/images/T01_checkbox.png b/res/white_theme/edc/images/T01_checkbox.png new file mode 100755 index 0000000000000000000000000000000000000000..61dc76a36e5e2ed78f3376c5867fbc2a520beec9 GIT binary patch literal 2944 zcmV-`3xD*9P)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^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mq-*GF3yf*cvdMgetM3>!bsllOFW;_8tVD1?~sd+8Z0W_ALu_KR^>Gg%>*R*WOc9V& z53;QnLZMK|>-D|{JPx!7k#(s~ab_a{DfOVQukTnU(Q9pOeN$}i7Ad&uGl|};BfwTP zU7`nGulJR7dLZX_JH%Dql+5Oq3<0*%xlXFJR>0rb*!aegBS((sdVW_(0`hi8Nc-=@ z6+*&tAz~GFDTKJAeNCc?S+0IJ$rT{uAQzeg@9x;`Fi^W4ilHITMgZ6juP( zNLnnEZ4DqQF7g)vKc4j|P9993>!UFj^@1k9PXUv1P^sj?!kCluyFx}~A&3UzQZJY? zyAc}!QJM8fv1UH)lFf4pBuj^CF*a55_bDKj>F!RkQlO9oSR`n&LwIZzr76IRddt!= t0dpbB|1eP|piDrSfHDDP0_Jf1I{@8}Bkd6$9hm?C002ovPDHLkV1i%-=^+3B literal 0 HcmV?d00001 diff --git a/res/white_theme/edc/images/T01_main_folder_bg.png b/res/white_theme/edc/images/T01_main_folder_bg.png new file mode 100755 index 0000000000000000000000000000000000000000..16d1d5965e0d44e55e6c0e015be43729cfd137fc GIT binary patch literal 4436 zcmeHJS2Wy@w*CpxdyQVBMelW#(Q7bbv_uI*L<>=4jA$eBC!!lBBzl=7B8QD=0RW&gH8HRS01~Ue zgOdCYvuSte`zKKanK*_301eCEK>`#M-T(kF}E zbdn!U0yt+0vXK;L00JytNCUt}6Q~`z^UM%{$^oq2<~Vg=S{jfub?`O;-ZcSTct)Cf zfRYxFvq2_G0A$gC+kmie1dxyquo~?-_j=v13^zPQf+KnCxV+=gXl*8PCW|ssxX@ z^>pL&CYq~r-f?deLTaqzCPDYbMB^+pf7^!(Pz}BzK`H}sa2848@eC@QM#+(%cp}(s zLdKjbBJdf>Y9nNxp==^=`wSvrZ^FB;{pgx{vWrn`hUNgE@bo+hYb>7?S8t>JjrJqB zrBanE!RR&3*ZZOJ1?lX?sIQMcaA`kRDcSg13DMy|o@59NM;|#l~RLH{h1>E`cOrRD}t7(%;0Ui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rEb zo0Lg!hEkndw=>u?{Asdh;ab%-^-n%0GCgpLC4$fjoGm0(X~qy zciKSQCCmSd#Z0pzpq?B>()OxXU& z^P=pc7`V*uIXA-V#^?=CJn;cT;9e_Z=+cB6Kb0J zLkiBXJCJi6M$_*$yc$bp6>DqR$RzL#ASTI;IeR#omBrQ|z# zr;!C#S{1T3Mnc1skHce##KY|)c-zdA>7t_c&gSOki>+6N2K-DY zq*^+XUufCT;GCJM(-60}cC@j7d9dHU6Klw^NOePa86*@S?7`3E!1NO&v|xxcjBJ07 zWLP`cMmCT9M2&AltkjHfUwM+5=c=&RwAO<7%(NJ)LOgxvvI^8T%1-BSipCA-e}IH` z$FkJ3P1zP%dmcD40u#9~UxT z==QKDGFqhI_~$0NGU!?bBfho1BL$iMa}%`g@6^#W^y~LDPQ7&WsMSEhR;j6ns&E?T zNbza=q@F5t9Ct9PjmKK(l&<|QwZ#y@#V zP_PMGYi~nNXTJzAQ`)H{wVp4`+4k2uco}12w=tKbNF>(oO=Yh6U=mo=N`lgcR~<>6 zR8x}F>eau=ObEwRp)0M8bLkNke0ZJ_uCJ%}Z5CW(S@BqxK=7<;X1UL`3TAxRD>0pZ z_+fA>_d^0U{T7)AH5hYr}dM=k2i+ ZK%u2iXylP8_n)%`m>OCcVD#Od{uk7Av3mdj literal 0 HcmV?d00001 diff --git a/res/white_theme/edc/sounds/S_Touch_30ms.wav b/res/white_theme/edc/sounds/S_Touch_30ms.wav new file mode 100755 index 0000000000000000000000000000000000000000..99ba74d953ddc929ae302303c0a815f202697151 GIT binary patch literal 24740 zcmeIx>rY#C7zgm*Ifu5V6iP2!YblhD%AkNwWQt4N#v(9qUPwb=iNP=jyJ*yy%sFID z*j{XlMv`f_MJ0iSZOJx`lT8V8Av2oe29C_~_u*7_yC*OBZ z@+6-;kFBbrqP>BTx*fIU``$ieRuMv|wJ!ULkW;%ULK78f+;eEpk+m5V1Rwwb2tWV= z5P$##9)*A?z9lY*KT@}nUSVAdhjKQpEUh}lDx*j@7ham1?{F(8#PMI;`ybS=b`f)0 zVP>^8TEsk?UfiEwYYHfz7kd1rsqsIPf8YM=jeF7I7iMZ!zM$JQpP086bQGl&AJ~+a zt1#B3oQP-pznwZU)HV3gy=vF#zgy@33gssWnyDcEQw=t1GN6EXvcFJ?pN^Jds&kpLXSF=1@K+vDvHy5jll8I8f{G1pjL&YsV7=(MSO>9gEr|CPCy z+?L5#r*6);eUeax@EIFYA2u|aD$Ts<%k+!d(c~1WihE~iuXoZ@I(^+kd3*c?|Fnuf zv3hla+uXrf$$Y-=U?7V>Li$*l>eBjDL(EY1Sn0Z* z%79cQ)^UzN(?i>XcCT$=i$An77AdEi**>LRyG?gjr&zyDJ*23U91wcBK(NbS_|WD1 zbg>|?E4(k}q-b_m>Snb~`?1!gZd9I=`xri9<6Borz`Uec`eB(~ZRWm@Tj&>Mor*r? zYpNR6HD#ybsH}&+oydx84ck|8f>pthm9N9ik-lfj@H3&7&_uX|FN=L6nCL2rQ+8Zln(UKbX4|AbCP1V@U2IEaf~)2(a6j{o=xDrN z9H4^C6-lo&U3Ob~M^c{jCf!8r!rgdF>{|4LXn(XL=89Jc{bC9A9=)3xXCll+CYdqO z8z>cdT5J$JiL;5TiQzvFDCj=k> z0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV= K5P-n{S>Rue2ZFNz literal 0 HcmV?d00001 diff --git a/res/white_theme/images/T01_Nocontents_broken.png b/res/white_theme/images/T01_Nocontents_broken.png new file mode 100755 index 0000000000000000000000000000000000000000..c200d0c6ea27c8007c7b11366d5e0f66e4de8425 GIT binary patch literal 6301 zcmbVPcQl+`w|~66O7u>UFrq|6k1|>qy^Lr<7|}%?MAVEDorEB|5haK&1R1^8=q(sT zuS3)k^-jLK?pojdzI)fY>;7@-Zojkl+0S!!)Dx&G`K{Zx001CYS5wj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;XO9u}>O!UoQvZ zU{9xxkT>63ai7~U-n1VC4cF{Y;DRTyTDaS0=kq~-i88`4x2ba49IiNBhmgF;Np``C zkJeVdp{gH+auqCXm~f|W^IL|MPfKi#+I@Be|CSo{YB)WotuM#q?w(AEJdi?`(qMvX zLg~SpQ`AtN3q|=I(5Tm3#C~L0IVTrUES#@8BqH-b0?gK7(;Qz!0W{hG}8!vom=R5*R(cv|U5>i=s6@^3Kz p#rQv#|Hkw`6*T`7lfxApfER)`z6P&P;p#s?T^XuWu4wV*KLCoP^zi@y literal 0 HcmV?d00001 diff --git a/res/white_theme/images/T01_controlbar_icon_add.png b/res/white_theme/images/T01_controlbar_icon_add.png new file mode 100755 index 0000000000000000000000000000000000000000..c370376f6a5193acafa1f3c5c7649938a02440f6 GIT binary patch literal 3044 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;Q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{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} z0009YNkli+=^#slC0r~|t|11M=6 zZwwfaV>H@)_c-tdxOymqhGH3*iTM0G;0nABRDnI~p|tVAH>`&ui5T4AFMDcF_RN1K)rrz*B{NNaSowu%BU2@K1;{UVQlVFG9Zhs?W;z_tNkQ3}xWBnS0?{V5L1YH&WZ zi0P1RGr&AB(uqz+6*mQ32r1`b*UfpEV;*i%UJvO4;|@_3Tt$YRH;-~aQA&B-*aFVl z8loz=ec-;7`Cq_K$xWKWrGiah(PDq~^H#I92CgY0hm9nS@jF<$fBKRf|H_60YCofF+Ze)48h_HC(#_mt+nmX$Cru(*c@5 zrjFAE>L9J)OaPN0t>H`o;~-~k;!FZnkh8!mEQjfTS+qiS1eXRd4B0VU(oQB$$CC%% ub^>;&RqNHr{>qgBGhhbHfEh3%{tN)S@fJmQ`&T0X0000KdU|?>hK8o5rqU1*Mn)DE7W(@7CMG79mX=mlR_5mB8X6kf+S;0$ zng#|2W@cu#wzl^6_BJ*)4h{~Ej*fPAcCN0jZflzRu3h?(Xg$9v(hEK7B^N z0)P&<;OXKRQW1CNj5#BNfdI4N9OP|K5MVGk%xwFZ^O(Sm`k?7A4)a|Qk-OSbusV(F{k4{* zvz#qLgIm|liro=n+!Ep|_$dAC^)qvBGcYte2$&q=m*i~vXI&~ReMiK=S7Mc>Q&6w4 m(;CYb?Q1zrQOPaKuhz6q6P5TLq7C#K1B0ilpUXO@geCyleT5$Y literal 0 HcmV?d00001 diff --git a/res/white_theme/images/gallery_tag_favorites_thumbnail.png b/res/white_theme/images/gallery_tag_favorites_thumbnail.png new file mode 100755 index 0000000000000000000000000000000000000000..b55bdda9c2779b296fb4156fe93ee5b9d3ce1e99 GIT binary patch literal 5303 zcmV;o6iDldP)KLZ*U+IBfRsybQ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61wsIrp&sYv?m;} px#u*8_c)A(OtsR2DlT4-0nHCl?w-r0Zir7`KvhvophFJgr literal 0 HcmV?d00001 diff --git a/res/white_theme/images_edc/T01_icon_lock.png b/res/white_theme/images_edc/T01_icon_lock.png new file mode 100755 index 0000000000000000000000000000000000000000..44c98dac1993712d9ccbeece66c48f4848c69b6e GIT binary patch literal 8333 zcmW+)WmHsM8@(eibf-wSNJ>a|r*wA=NFyaVbV^D$N)6r8Eg%ijDILT zowL_|_B!{89r;m3788vW4FCX4c{wR{_-gv!g93)XH_|-$;0vm=oZe>uK*#^@0Rb6V zBmjV>YAY%E@uQ8Co6~0-Cub^oNl7YaS0`&*dn*9&TFlmfXlm>e3E!++cquSRfjmGk}9q zXG#6}i53Lh`U?rYqv=BK06<>T=qNy!a%L9?S@;X~fke6?2pR(Fa!cS-M1c|jV&1V5 zMSz$L2%4S7paJ9|0;aj<5_tHjx5hAWj`E7VNKFCA!r!s>#oqr*nQG$v2{j)2$fm05-uThEvD*Y5+lvDYs~ z03a`c5FYKtlh+tl<=7Z+Y$KKl>p>^@g~r@`^Lcx`%vlTo{<`^3KC`gbkwOK*P>1IN z`eQ^JWAr@tn`rA=Y_SF)Z+}te!udaKr1RsO7Z$d+w&oT3Bn-@c>-arGdQ7@>p6u`Z zg&uFN);l)n0^b`2$|Byb_l#UB6_Sl7qK23+@5ISIHle>fl26n0$(uLpG81g7;km?0 zWyD;(FQkc-NPOE*KlNg{vBvU%AhN~-RDTiy`6RHG7+D}(D>CBfx^->b0Kj>xQ}-Vx z6a=VE@ZWLImlM$^**tmxYAv7W0szKRbZnZx>qG}o06;1)khxm?&1E+UOBa}|8)>;4 z{n3;+M1robM*>Fz%@RuHYWlW3NP;PBw3?jRl>LtwId_+uO<0mM7F&ct34Fj-BqLrOVvN>`R#N8!cHO znIZWNGrMLftO&LWL)W^{8rF;}HP-N}l+ohS*epf;lTxMy%l>$%@kRquDp(Q@gOoUF zivIA|dx`|>^(ytMO8!vGt1;PZ`$dIr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je9b+6rSzX^!#3MoLA zrfENjJr2V#W_>7_F>GlOMiWeX7>j3|@^90HDCx^(HX zuIu_HFe9+q3`lDeO8&48uczF1)tgNh0fRn&;krWXD zQh|KnMc@tKLQ6}_m2fz0JPDYAfq|*a%*?NVCg5c$M&|ZKZ31jSIq(+nSz}}4&zh#C zb^3aHdv5_>0`CJSfWttxWZ0626iI0VDu6eE3-$H&o?tK-P6tePclVz_8_+CaoIuVd zOpL@B4OI>_0H4;@*7mNftZ1pgw70ik2fmQgbX+R46(&xmjzB#F90g7R=exSP#&-)7 z2n5z7%)7uVz_VMXDM67h03BEbW`Idx^4PIs`Mb?EHk&QS?RMV>ZUR%l5}=6~YQ*b0 z1YiI`V9{!|F1TE-L#ZUdrlzI?z#Om)ghU(@-KhpHX9oZHygShSguciFjGf%5hB_2Blc?DzXu z8X6j|03E<(nSH-;xm@4(^z=-{^1{x}&W{0mbg}lhK>Mqzs;Z-JIypJ{_t~>&f0G~= zfpfsy(r(@Z&I9dkx4Um(VBl^vn8)M!8gKw=JRnno`dO{0s3_2NJv=ltbi1vsZOY^E z+yNGWd%!d>3#`Z;X$1-a=h)cTLS0?mba8QUVQXt^>6tTUj##Z$n=ExQywsY+1hmJK0?u>_Ix|IiTv#3_(?3P(tV{{CA;;@+$0yO3DY0C6 gmw!+syw^Vi0Q>Gvbm;C0OaK4?07*qoM6N<$f_`{u(EtDd literal 0 HcmV?d00001 diff --git a/res/white_theme/images_edc/T01_list_icon_bookmark.png b/res/white_theme/images_edc/T01_list_icon_bookmark.png new file mode 100755 index 0000000000000000000000000000000000000000..06fa9ac5f2574a6f2f2b3fcd8ba89cdeab70f477 GIT binary patch literal 5171 zcmV-36wK?1P)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%c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Pbq#>f55wSIO3C|Nh?mfqS2!1=F!T=@ zW2;r_3^!I5;Ech{%)m?2&RuhN+{)58eo`Cry{sr7$cvJ-ZA)6E!CDKH(pf3xUP|bL zguoXAPu!iv;h#E5a)*?SM<(VIQ^J4=3nA$Bdb6Fh^K(S(s?*qP1Lz#5nuVxy2=>weg#_{j7r!V+}FZ z_}b{N%C@o2VW_RylD7yO$O4ns8d~YtXfrW*UP^`929=eUQtHHen~Ddl;UF7%j%%%5 zhjn%c7uXJ&PDg0BzYu{P{6b`U4Uzv74Qy>1{7kwl!DtOa2neGHIOjJ;2(0&d{6d2S zv{I1eIgCf6w~RGMlO$;d2ww?;-~qOzMHvn*42mMxZL`JuJ;`8baM z>IqS)wmH}~vKB&oK1tJA&UpZvaP_tAAn2R}r4&e6Ly;FY%d(?dt3Prf{@&|!PWF2J zA__xvh#yNS|Dm*bq$tWCan2tWs{)fYQl|@oFc}?|QrgjIRE$QW6RK@rr%9-yHZtU#gSx8Sa5!Aa^Zc0B`mhk<<^D|nP`BG{!Z386 z=K&>jA~PWXP(t%KPLBG1aMT!cx~{5ovX=KJN%G|&2xbW(bQ?QDtAxlH15!$;stWQf ztE#GckumnGe!usxwA0DcG^M`pyNhXUP4xo-;DQ4e9IUl(0)Y>dQeTpd{7KU`Kkz*7 zcF*&GG4`pnIRy-G)&e@bX!T}gW#v?!XKxr|=Y8KhJQ&QJ==b}z@B2V0b?XYw%Y;z| zaTJ$f5FV4V&YPy42ZTpC;|Dq8ccDYyIX9grGDqHeXMFPHNkGJ&F-9Wd;UEZp-S7A3 zJDpAyMG*)gE?8yrN@hX;DJ3cl!;?aYlS--c%gaN*EX%NInmetvu*>DY0|43hg8%-Z;4%OJ002ovPDHLkV1kPEwmAR* literal 0 HcmV?d00001 diff --git a/res/white_theme/images_edc/gl-images.edc b/res/white_theme/images_edc/gl-images.edc new file mode 100755 index 0000000..962a343 --- /dev/null +++ b/res/white_theme/images_edc/gl-images.edc @@ -0,0 +1,57 @@ +/* + * Copyright (c) 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 RESOURCE_IMAGE( FILE_NAME ) \ + group { \ + name: FILE_NAME; \ + images.image: FILE_NAME COMP; \ + parts { \ + part { name: "image"; \ + description { \ + state: "default" 0.0; \ + image.normal: FILE_NAME; \ + aspect: 1 1; \ + aspect_preference: BOTH; \ + } \ + } \ + } \ + } + +#define RESOURCE_IMAGE_LOSSY( FILE_NAME ) \ + group { \ + name: FILE_NAME; \ + images.image: FILE_NAME LOSSY 85; \ + parts { \ + part { name: "image"; \ + description { \ + state: "default" 0.0; \ + image.normal: FILE_NAME; \ + aspect: 1 1; \ + aspect_preference: BOTH; \ + } \ + } \ + } \ + } + +collections { + RESOURCE_IMAGE("T01_icon_lock.png"); + RESOURCE_IMAGE("T01_icon_thumbnail_favorite.png"); + + RESOURCE_IMAGE("T01_btn_thumbnail_play.png"); + RESOURCE_IMAGE("T01_icon_thumbnail_bookmark.png"); + RESOURCE_IMAGE("T01_list_icon_bookmark.png"); +} + diff --git a/src/data/gl-data-type.c b/src/data/gl-data-type.c new file mode 100755 index 0000000..a0f2bcb --- /dev/null +++ b/src/data/gl-data-type.c @@ -0,0 +1,149 @@ +/* + * Copyright (c) 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 "gl-data-type.h" +#include "gl-debug.h" +int _gl_data_type_new_tag(gl_tag_s **t_item) +{ + GL_CHECK_VAL(t_item, -1); + gl_tag_s *tmp_item = (gl_tag_s *)calloc(1, sizeof(gl_tag_s)); + GL_CHECK_VAL(tmp_item, -1); + tmp_item->gtype = GL_TYPE_TAG; + *t_item = tmp_item; + return 0; +} +int _gl_data_type_new_album(gl_album_s **album) +{ + GL_CHECK_VAL(album, -1); + gl_album_s *tmp_item = (gl_album_s *)calloc(1, sizeof(gl_album_s)); + GL_CHECK_VAL(tmp_item, -1); + tmp_item->gtype = GL_TYPE_ALBUM; + *album = tmp_item; + return 0; +} + + +static int __gl_data_type_free_media(gl_media_s **item) +{ + GL_CHECK_VAL(item, -1); + GL_CHECK_VAL(*item, -1); + gl_media_s *tmp_item = *item; + + /* For local medias */ + if (tmp_item->media_h) { + media_info_destroy(tmp_item->media_h); + tmp_item->media_h = NULL; + } + + GL_FREEIF(tmp_item->uuid); + GL_FREEIF(tmp_item->thumb_url); + GL_FREEIF(tmp_item->file_url); + GL_FREEIF(tmp_item->album_uuid); + GL_FREEIF(tmp_item->display_name); + GL_FREEIF(tmp_item->ext); + + if (MEDIA_CONTENT_TYPE_IMAGE == tmp_item->type && + tmp_item->image_info) { + /* For local medias */ + if (tmp_item->image_info->image_h) { + image_meta_destroy(tmp_item->image_info->image_h); + tmp_item->image_info->image_h = NULL; + } + + GL_FREEIF(tmp_item->image_info->media_uuid); + GL_FREE(tmp_item->image_info); + } else if (MEDIA_CONTENT_TYPE_VIDEO == tmp_item->type && + tmp_item->video_info) { + /* For local medias */ + if (tmp_item->video_info->video_h) { + video_meta_destroy(tmp_item->video_info->video_h); + tmp_item->video_info->video_h = NULL; + } + + GL_FREEIF(tmp_item->video_info->media_uuid); + GL_FREEIF(tmp_item->video_info->title); + } + + GL_FREE(tmp_item); + *item = NULL; + return 0; +} + +static int __gl_data_type_free_tag(gl_tag_s **t_item) +{ + GL_CHECK_VAL(t_item, -1); + GL_CHECK_VAL(*t_item, -1); + gl_tag_s *tmp_item = *t_item; + GL_FREEIF(tmp_item->tag_name); + if (tmp_item->tag_h) + media_tag_destroy(tmp_item->tag_h); + GL_FREE(tmp_item); + *t_item = NULL; + return 0; +} + +int _gl_data_type_free_tag_list(Eina_List **list) +{ + GL_CHECK_VAL(list, -1); + GL_CHECK_VAL(*list, -1); + gl_tag_s *item = NULL; + Eina_List *tmp_list = *list; + EINA_LIST_FREE(tmp_list, item) { + if (item) + __gl_data_type_free_tag(&item); + } + eina_list_free(*list); + *list = NULL; + return 0; +} + +static int __gl_data_type_free_album(gl_album_s **album) +{ + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(*album, -1); + gl_album_s *tmp_album = *album; + + GL_FREEIF(tmp_album->uuid); + GL_FREEIF(tmp_album->display_name); + GL_FREEIF(tmp_album->path); + + if (tmp_album->folder_h) + media_folder_destroy(tmp_album->folder_h); + GL_FREE(tmp_album); + *album = NULL; + return 0; +} + +int _gl_data_type_free_glitem(void **item) +{ + GL_CHECK_VAL(item, -1); + GL_CHECK_VAL(*item, -1); + int ret = -1; + + if(((gl_album_s *)*item)->gtype == GL_TYPE_ALBUM) + ret = __gl_data_type_free_album((gl_album_s **)item); + else if (((gl_tag_s *)*item)->gtype == GL_TYPE_TAG) + ret = __gl_data_type_free_tag((gl_tag_s **)item); + else if (((gl_media_s *)*item)->gtype == GL_TYPE_MEDIA) + ret = __gl_data_type_free_media((gl_media_s **)item); + + if (ret < 0) + return -1; + else + return 0; +} + diff --git a/src/data/gl-data-util.c b/src/data/gl-data-util.c new file mode 100755 index 0000000..f5cd908 --- /dev/null +++ b/src/data/gl-data-util.c @@ -0,0 +1,514 @@ +/* + * Copyright (c) 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 "gl-data-util.h" +#include "gl-controlbar.h" +#include "gallery.h" +#include "gl-debug.h" +#include "gl-drm.h" +#include "gl-util.h" +#include "gl-strings.h" +#include "gl-data-type.h" + +bool _gl_data_util_get_file_dir_name(const char *file_path, char *filename, + char *dir_name, char *dir_path) +{ + GL_CHECK_FALSE(file_path); + gint i = 0; + gint count = 0; + for (i = strlen(file_path); i >= 0; i--) { + if (file_path[i] != '\0') { + count++; + } + if (file_path[i] == '/') { + if (filename != NULL) { + memcpy(filename, &file_path[i + 1], --count); + *(filename + count) = '\0'; + gl_dbg("File Name = %s", filename); + } + if (dir_path != NULL) { + memcpy(dir_path, &file_path[0], i); + *(dir_path + i) = '\0'; + gl_dbg("Directory Name = %s", dir_path); + } + if (dir_name != NULL) { + count = 0; + for (--i; i >= 0; i--) { + count++; + if (file_path[i] == '/') { + memcpy(dir_name, &file_path[i + 1], --count); + *(dir_name + count) = '\0'; + gl_dbg("Directory Name = %s", dir_name); + count = 0; + return true; + } + } + } + return true; + } + } + + return false; +} + +/* +* create a gl_item +*/ +gl_item *_gl_data_util_calloc_gitem(void) +{ + gl_item *gitem = (gl_item *)calloc(1, sizeof(gl_item)); + GL_CHECK_NULL(gitem); + return gitem; +} + +int _gl_data_util_free_gitem(gl_item *gitem) +{ + GL_CHECK_VAL(gitem, -1); + if (gitem->item) { + _gl_data_type_free_glitem((void **)&(gitem->item)); + gitem->item = NULL; + } + + GL_FREEIF(gitem->_reserved); + GL_FREE(gitem); + return 0; +} + +gl_cluster *_gl_data_util_calloc_gcluster(void) +{ + gl_cluster *gcluster = (gl_cluster *)calloc(1, sizeof(gl_cluster)); + GL_CHECK_NULL(gcluster); + return gcluster; +} + +int _gl_data_util_free_gcluster(gl_cluster *gcluster) +{ + GL_CHECK_VAL(gcluster, -1); + if (gcluster->cluster) { + _gl_data_type_free_glitem((void **)&(gcluster->cluster)); + gcluster->cluster = NULL; + } + + GL_FREEIF(gcluster->_reserved); + GL_FREE(gcluster); + return 0; +} + +gl_cluster *_gl_data_util_new_gcluster_all(void *data, int count) +{ + gl_dbg(""); + GL_CHECK_NULL(data); + gl_cluster *gcluster = NULL; + gl_album_s *mcluster = NULL; + + gcluster = _gl_data_util_calloc_gcluster(); + GL_CHECK_NULL(gcluster); + + _gl_data_type_new_album(&mcluster); + if (mcluster == NULL) { + GL_FREE(gcluster); + return NULL; + } + + mcluster->uuid = strdup(GL_ALBUM_ALL_ID); + mcluster->count = count; + mcluster->type = GL_STORE_T_ALL; + mcluster->display_name = strdup(GL_ALBUM_ALL_NAME); + gcluster->ad = data; + gcluster->cluster = mcluster; + return gcluster; +} + +gl_cluster_list *_gl_data_util_calloc_cluster_list(void) +{ + gl_cluster_list *clus_list = (gl_cluster_list *)calloc(1, + sizeof(gl_cluster_list)); + GL_CHECK_NULL(clus_list); + return clus_list; +} + +/* +* create a gl_tag +*/ +gl_tag *_gl_data_util_calloc_gtag(void) +{ + gl_tag *gtag = (gl_tag *)calloc(1, sizeof(gl_tag)); + GL_CHECK_NULL(gtag); + return gtag; +} + +/* +* destroy a gl_tag +*/ +int _gl_data_util_free_gtag(gl_tag *gtag) +{ + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(gtag->tag, -1); + + _gl_data_type_free_glitem((void **)&(gtag->tag)); + gtag->tag = NULL; + GL_FREE(gtag); + return 0; +} + +/* Clear eina_list got from DB */ +int _gl_data_util_clear_gtype_item_list(Eina_List **elist) +{ + void *current = NULL; + + if (elist && *elist) { + gl_dbg("Clear gtype items list"); + EINA_LIST_FREE(*elist, current) { + if (current) { + _gl_data_type_free_glitem((void **)¤t); + current = NULL; + } + } + *elist = NULL; + } + + return 0; +} + +int _gl_data_util_clear_item_list(Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + gl_item *current = NULL; + if (*elist) { + gl_dbg("Clear elist"); + EINA_LIST_FREE(*elist, current) { + _gl_data_util_free_gitem(current); + current = NULL; + } + *elist = NULL; + } + + return 0; + +} + +int _gl_data_util_get_selected_cluster_id_list(void *data, + Eina_List **sel_id_list) +{ + GL_CHECK_VAL(sel_id_list, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->albuminfo.selected_albums_elist, -1); + gl_cluster *gcluster = NULL; + char *item_id = NULL; + + /* Save ID of selected clusters */ + EINA_LIST_FREE(ad->albuminfo.selected_albums_elist, gcluster) { + if (gcluster && gcluster->cluster && gcluster->cluster->uuid) { + item_id = strdup(gcluster->cluster->uuid); + *sel_id_list = eina_list_append(*sel_id_list, + (void *)item_id); + } + } + return 0; +} + +int _gl_data_util_get_selected_item_id_list(void *data, + Eina_List **sel_id_list) +{ + GL_CHECK_VAL(sel_id_list, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->selectedinfo.medias_elist, -1); + gl_item *gitem = NULL; + char *item_id = NULL; + + /* Save ID of selected items */ + EINA_LIST_FREE(ad->selectedinfo.medias_elist, gitem) { + if (gitem && gitem->item && gitem->item->uuid) { + item_id = strdup(gitem->item->uuid); + *sel_id_list = eina_list_append(*sel_id_list, + (void *)item_id); + } + } + return 0; +} + +/* Check ID is in the list or not */ +bool _gl_data_util_check_selected_id(Eina_List **sel_id_list, const char *id) +{ + GL_CHECK_FALSE(sel_id_list); + Eina_List *tmp_elist = NULL; + void *p_id = NULL; + GL_CHECK_FALSE(id); + + if (eina_list_count(*sel_id_list) == 0) { + gl_dbgE("sel_id_list is empty!"); + return false; + } + + EINA_LIST_FOREACH(*sel_id_list, tmp_elist, p_id) { + if (p_id == NULL) { + gl_dbgE("Invalid p_id!"); + continue; + } + /* Get next one if they wasn't equal */ + if (g_strcmp0(id, (char *)p_id)) { + p_id = NULL; + continue; + } + *sel_id_list = eina_list_remove(*sel_id_list, p_id); + GL_FREE(p_id); + return true; + } + return false; +} + +/* Free list of selected IDs */ +int _gl_data_util_free_selected_id_list(Eina_List **sel_id_list) +{ + GL_CHECK_VAL(sel_id_list, -1); + if (*sel_id_list == NULL) { + gl_dbg("sel_id_list is empty!"); + return -1; + } + + void *p_id = NULL; + EINA_LIST_FREE(*sel_id_list, p_id) { + if (p_id == NULL) { + gl_dbgE("Invalid p_id!"); + continue; + } + GL_FREE(p_id); + } + *sel_id_list = NULL; + return 0; +} + +int _gl_data_util_check_album_selected_files(gl_cluster *album, int *drm_cnt, + int *img_cnt, int *sel_cnt) +{ + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(album->cluster, -1); + GL_CHECK_VAL(album->cluster->uuid, -1); + GL_CHECK_VAL(album->ad, -1); + int _sel_cnt = 0; + int _img_cnt = 0; + int _drm_cnt = 0; + int err = -1; + Eina_List *itemlist = NULL; + gl_filter_s filter; + + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = false; + + if (album->cluster->type == GL_STORE_T_ALL) { + gl_dbg("All albums"); + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + } else if (album->cluster->type == GL_STORE_T_PHONE || + album->cluster->type == GL_STORE_T_MMC) { + gl_dbg("Local album"); + err = _gl_local_data_get_album_media_list(&filter, + album->cluster->uuid, + &itemlist); + } else { + gl_dbgE("Wrong cluster type!"); + return -1; + } + + if ((err == 0) && (itemlist != NULL)) { + gl_media_s *item = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + + _sel_cnt++; + if (album->cluster->type == GL_STORE_T_PHONE || + album->cluster->type == GL_STORE_T_MMC || + album->cluster->type == GL_STORE_T_ALL) { + if (item->type == MEDIA_CONTENT_TYPE_IMAGE) + _img_cnt++; + /* Update selected DRM files count */ + if (gl_drm_is_drm_file(item->file_url)) + _drm_cnt++; + } else { + /* Checkme: now only image supported for web */ + _img_cnt++; + } + item = NULL; + } + } + gl_dbg("Selected items count: %d, image count: %d, drm count: %d.", + _sel_cnt, _img_cnt, _drm_cnt); + if (sel_cnt) + *sel_cnt = _sel_cnt; + if (drm_cnt) + *drm_cnt = _drm_cnt; + if (img_cnt) + *img_cnt = _img_cnt; + return 0; +} + +int _gl_data_util_check_tag_selected_files(void *data, int *drm_cnt, + int *img_cnt, int *sel_cnt) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->taginfo.selected_tags_elist, -1); + GString *selected_path_list = g_string_new(NULL); + gl_tag *gtag = NULL; + Eina_List *l = NULL; + int err = -1; + Eina_List *itemlist = NULL; + int _sel_cnt = 0; + int _img_cnt = 0; + int _drm_cnt = 0; + + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = true; + + EINA_LIST_FOREACH(ad->taginfo.selected_tags_elist, l, gtag) { + if (gtag == NULL || gtag->tag == NULL || + gtag->tag->tag_name == NULL) { + if (selected_path_list) { + g_string_free(selected_path_list, true); + selected_path_list = NULL; + } + return -1; + } + + err = _gl_local_data_get_tag_media_list(gtag->tag->_id, &filter, + &itemlist); + + if ((err == 0) && (itemlist != NULL)) { + gl_media_s *item = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + + if (strstr(selected_path_list->str, item->file_url)) { + gl_dbgW("Already counted!"); + continue; + } + + _sel_cnt++; + + if (item->type == MEDIA_CONTENT_TYPE_IMAGE) + _img_cnt++; + /* Update selected DRM files count */ + if (gl_drm_is_drm_file(item->file_url)) + _drm_cnt++; + + g_string_append(selected_path_list, item->file_url); + g_string_append_c(selected_path_list, '?'); + item = NULL; + } + } + } + + g_string_free(selected_path_list, true); + + gl_dbg("Selected items count: %d, image count: %d, drm count: %d.", + _sel_cnt, _img_cnt, _drm_cnt); + if (sel_cnt) + *sel_cnt = _sel_cnt; + if (drm_cnt) + *drm_cnt = _drm_cnt; + if (img_cnt) + *img_cnt = _img_cnt; + return 0; +} + +/* +* free tag list. +*/ +int _gl_data_util_free_tag_list(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->taginfo.tags_elist) { + gl_tag *gtag = NULL; + Eina_List *tags_list = ad->taginfo.tags_elist; + EINA_LIST_FREE(tags_list, gtag) { + if (gtag) { + _gl_data_util_free_gtag(gtag); + gtag = NULL; + } + } + + ad->taginfo.tags_elist = NULL; + } + + return 0; +} + +/* +* get favorites tag from libmedia-info +*/ +gl_tag *_gl_data_util_get_favor_tag(void *data) +{ + gl_dbg(""); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + /* add favorites tag */ + gl_tag_s *favor_tag = NULL; + + _gl_data_type_new_tag(&favor_tag); + GL_CHECK_NULL(favor_tag); + favor_tag->tag_name = strdup(GL_TAG_FAVORITES_NAME); + favor_tag->_id = GL_TAG_FAVORITES_ID; + favor_tag->gtype = 0; + + gl_tag *favor_gtag = _gl_data_util_calloc_gtag(); + if (!favor_gtag) { + gl_dbgE("_gl_data_util_calloc_gtag() failed!"); + _gl_data_type_free_glitem((void **)&favor_tag); + return NULL; + } + favor_gtag->tag = favor_tag; + + /* Get favorites item count */ + int item_count = 0; + int err = _gl_data_get_item_cnt(ad, GL_GET_ALL_RECORDS_ID, true, + GL_STORE_T_PHONE, &item_count); + if (err == 0) { + favor_tag->count = item_count; + } else { + gl_dbgE("_gl_data_get_item_cnt failed!"); + favor_tag->count = 0; + } + gl_dbg("===Tag [Favourites] has %d item(s)", favor_tag->count); + + return favor_gtag; +} + diff --git a/src/data/gl-data.c b/src/data/gl-data.c new file mode 100755 index 0000000..fb3cb24 --- /dev/null +++ b/src/data/gl-data.c @@ -0,0 +1,2494 @@ +/* + * Copyright (c) 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 "gl-data.h" +#include "gl-data-util.h" +#include "gl-controlbar.h" +#include "gallery.h" +#include "gl-debug.h" +#include "gl-drm.h" +#include "gl-util.h" +#include "gl-strings.h" +#include "gl-icons.h" +#include "gl-exif.h" + +static int __gl_data_clear_cluster_list(void *data, bool b_force) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *current = NULL; + Eina_List *tmp_list = NULL; + + // 2011.1.3 han - To reset current album when clear cluster list. + ad->albuminfo.current_album = NULL; + + if (ad->albuminfo.cluster_list) { + if (ad->albuminfo.cluster_list->clist) { + tmp_list = ad->albuminfo.cluster_list->clist; + + EINA_LIST_FREE(tmp_list, current) { + if (current) { + _gl_data_util_free_gcluster(current); + current = NULL; + } + } + ad->albuminfo.cluster_list->clist = NULL; + } + + if (b_force) { + GL_FREE(ad->albuminfo.cluster_list); + } + } + + return 0; +} + +static int __gl_data_get_cluster_list(void *data, bool b_update) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int length = 0; + int all_item_cnt = 0; + Eina_List *item_list = NULL; + gl_album_s *f_data = NULL; + gl_cluster *default_album = NULL; + int err = -1; + int edit_album_cnt = 0; + gl_filter_s filter; + gl_album_s *new_mc = NULL; + Eina_List *sel_id_list = NULL; + bool b_selected = false; + char new_mc_id[GL_MTYPE_ITEN_ID_LEN_MAX] = { 0, }; + char sel_id[GL_MTYPE_ITEN_ID_LEN_MAX] = { 0, }; + gl_dbg(""); + + memset(&filter, 0x00, sizeof(gl_filter_s)); + + if (b_update) { + gl_dbg("Update mode."); + gl_cluster *album_item = ad->albuminfo.selected_album; + if (album_item && album_item->cluster && + album_item->cluster->uuid) { + g_strlcpy(sel_id, album_item->cluster->uuid, + GL_MTYPE_ITEN_ID_LEN_MAX); + gl_dbg("Save selected album ID: %s.", sel_id); + } + ad->albuminfo.selected_album = NULL; + /* Get selected cluster IDs list */ + _gl_data_util_get_selected_cluster_id_list(ad, &sel_id_list); + /* Free old list */ + _gl_data_finalize_albums_selected_list(ad); + /* Clear cluster list */ + __gl_data_clear_cluster_list(ad, false); + } + + + //ad->new_album_name is the cluster name of newly created album + //in moving medias to new album case. + if (strlen(ad->albuminfo.new_album_name)) { + memset(ad->albuminfo.new_album_name, 0x00, GL_ALBUM_NAME_LEN_MAX); + //get gl_media_s from DB via folder full path(URL). + err = _gl_local_data_get_album_by_path(ad->albuminfo.dest_folder, + &new_mc); + if (err != 0) { + gl_dbgE("Faild to get album[%d]!", err); + } else if (new_mc->count == 0) { + //media records of this cluster havn't been inserted to DB. + //save the cluster ID. + //update cluster item count while refresh albums view in _gl_albums_get_label(). + gl_dbg("Get newly created gl_media_s, url: %s.", + ad->albuminfo.dest_folder); + g_strlcpy(new_mc_id, new_mc->uuid, + GL_MTYPE_ITEN_ID_LEN_MAX); + _gl_data_type_free_glitem((void **)&new_mc); + } + } + + //get real albums + memset(filter.cond, 0x00, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = false; + + gl_dbg("Get_album_list:start"); + err = _gl_local_data_get_album_list(&filter, &item_list); + gl_dbg("Get_album_list:end, %d", err); + if (err != 0) { + gl_dbg("No record!"); + ad->albuminfo.cluster_list->clist = NULL; + if (item_list) + _gl_data_util_clear_gtype_item_list(&item_list); + } + + gl_cluster *gcluster = NULL; + EINA_LIST_FREE(item_list, f_data) { + if (f_data == NULL || f_data->uuid == NULL) { + gl_dbgE("Invalid gl_media_s!"); + continue; + } + gl_dbg("folder id: %s.", f_data->uuid); + + /** + * To skip MMC albums if MMC already unmounted, + * in case of delay updating in DB. + */ + if ((ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED_MOVING || + ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED) && + f_data->type == GL_STORE_T_MMC) { + gl_dbgW("MMC was unmounted, skip MMC album!"); + _gl_data_type_free_glitem((void **)&f_data); + continue; + } + + if (f_data->type == GL_STORE_T_PHONE || + f_data->type == GL_STORE_T_MMC) { + if (f_data->count == 0) { + if (!g_strcmp0(f_data->uuid, new_mc_id)) { + /* append the newly created cluster to list */ + gl_dbg("empty local album, but it's newly created..."); + } else { + /* Skip empty album */ + gl_dbg("empty local album, skipping it..."); + _gl_data_type_free_glitem((void **)&f_data); + continue; + } + } + all_item_cnt += f_data->count; + } + + gcluster = NULL; + gcluster = _gl_data_new_cluster(); + if (gcluster == NULL) { + gl_dbgE("_gl_data_new_cluster failed!"); + _gl_data_type_free_glitem((void **)&f_data); + continue; + } + + gcluster->ad = ad; + gcluster->cluster = f_data; + + length += f_data->count; + + if (_gl_data_is_default_album(GL_ALBUM_DEFAULT_NAME, f_data)) { + /** + * Default album: Camera Shot + * Now Camera Shot is located in Phone. + * If user can determine the location of default album, + * here we should get the path and check it's in Phone or MMC. + */ + default_album = gcluster; + ad->albuminfo.cluster_list->clist = eina_list_prepend(ad->albuminfo.cluster_list->clist, + gcluster); + } else if (_gl_data_is_default_album(GL_ALBUM_DOWNLOAD_NAME, f_data)) { + if (default_album) + ad->albuminfo.cluster_list->clist = eina_list_append_relative(ad->albuminfo.cluster_list->clist, + gcluster, default_album); + else + ad->albuminfo.cluster_list->clist = eina_list_prepend(ad->albuminfo.cluster_list->clist, + gcluster); + }else { + ad->albuminfo.cluster_list->clist = eina_list_append(ad->albuminfo.cluster_list->clist, + gcluster); + } + /* Default album 'Camera shots' showed in edit view */ + edit_album_cnt++; + + if (sel_id_list) { + b_selected = _gl_data_util_check_selected_id(&sel_id_list, + f_data->uuid); + if (b_selected) { + b_selected = false; + /* Set checkbox state */ + gcluster->checked = true; + /* Append gcluster to selected list */ + _gl_data_albums_selected_list_append(ad, gcluster); + } + } + if (strlen(sel_id) > 0 && !g_strcmp0(sel_id, f_data->uuid)) { + gl_dbgW("Found selected_album."); + ad->albuminfo.selected_album = gcluster; + } + } + + /* Clear list of selected ID */ + if (sel_id_list) { + b_selected = _gl_data_util_check_selected_id(&sel_id_list, + GL_ALBUM_ALL_ID); + _gl_data_util_free_selected_id_list(&sel_id_list); + } + + ad->albuminfo.cluster_list->edit_cnt = edit_album_cnt; + /** + * add "all" album, only inclduing local albums temporarily, + */ + if (all_item_cnt) { + /* Create "All albums" album if any local file exists */ + gcluster = _gl_data_util_new_gcluster_all(ad, all_item_cnt); + if (gcluster == NULL) { + gl_dbgE("_gl_data_util_new_gcluster_all failed!"); + __gl_data_clear_cluster_list(ad, false); + return -1; + } + if (b_selected) { + b_selected = false; + /* Set checkbox state */ + gcluster->checked = true; + /* Append gcluster to selected list */ + _gl_data_albums_selected_list_append(ad, gcluster); + } + + if (default_album) + ad->albuminfo.cluster_list->clist = eina_list_append_relative(ad->albuminfo.cluster_list->clist, + gcluster, default_album); + else + ad->albuminfo.cluster_list->clist = eina_list_prepend(ad->albuminfo.cluster_list->clist, + gcluster); + default_album = gcluster; + + /* Get latest item for saving lastest modified time */ + Eina_List *item_list = NULL; + memset(&filter, 0x00, sizeof(gl_filter_s)); + gl_media_s *mitem = NULL; + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, + KEYWORD_LENGTH); + filter.offset = GL_FIRST_VIEW_START_POS; + filter.count = GL_GET_ONE_RECORDS; + filter.with_meta = false; + + _gl_local_data_get_all_albums_media_list(&filter, &item_list); + if (item_list) { + gl_dbg("list length is %d", eina_list_count(item_list)); + mitem = eina_list_nth(item_list, 0); + if (mitem) { + ad->maininfo.last_mtime = mitem->mtime; + _gl_data_type_free_glitem((void **)&mitem); + } + eina_list_free(item_list); + } + ad->maininfo.all_medias_cnt = all_item_cnt; + } + + gl_dbg("Cluster Done."); + return length; +} + +gl_cluster *_gl_data_new_cluster(void) +{ + return _gl_data_util_calloc_gcluster(); +} + +/* +* Check it's default album[Camera shot] or not +*/ +bool _gl_data_is_default_album(const char *match_folder, gl_album_s *album) +{ + GL_CHECK_FALSE(album); + GL_CHECK_FALSE(album->display_name); + GL_CHECK_FALSE(album->uuid); + GL_CHECK_FALSE(match_folder); + + /* Name is 'Camera shot and' folder locates in Phone */ + if (!g_strcmp0(album->display_name, match_folder) && + album->type == GL_STORE_T_PHONE) { + char parent_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + + gl_dbg("Full path: %s", album->path); + + _gl_data_util_get_file_dir_name(album->path, NULL, NULL, + parent_path); + gl_dbg("Parent path: %s.", parent_path); + + /* And parent folder is Phone root path, it's default folder */ + return (g_strcmp0(parent_path, GL_ROOT_PATH_PHONE) == 0); + } + + return false; +} + +int _gl_data_clear_default_item_list(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + _gl_data_util_clear_item_list(&(ad->maininfo.medias_elist)); + + return 0; +} + +bool _gl_data_get_cluster_list(void *data) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + int n_entire_items = 0; + + __gl_data_clear_cluster_list(ad, true); + + ad->albuminfo.cluster_list = _gl_data_util_calloc_cluster_list(); + GL_CHECK_FALSE(ad->albuminfo.cluster_list); + n_entire_items = __gl_data_get_cluster_list(ad, false); + if (n_entire_items <= 0) //if error code is returned, negative value is possible + { + return false; + } + gl_dbg("cluster-length:%d", n_entire_items); + + return true; +} + +int _gl_data_update_cluster_list(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int len = 0; + + len = __gl_data_get_cluster_list(ad, true); + gl_dbg("Cluster list length: %d.", len); + if (len <= 0) + return -1; + + return 0; +} + +int _gl_data_get_cluster_by_id(void *data, const char *cluster_id, + gl_cluster **cluster) +{ + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(cluster, -1); + GL_CHECK_VAL(cluster_id, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_cluster *current = NULL; + + *cluster = NULL; + + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + int length = eina_list_count(ad->albuminfo.cluster_list->clist); + gl_dbg("album length: %d, current album id: %s", length, cluster_id); + + for (i = 0; i < length; i++) { + current = eina_list_nth(ad->albuminfo.cluster_list->clist, i); + if (current && current->cluster && current->cluster->uuid) { + gl_dbg("cluster : %s", current->cluster->display_name); + } else { + gl_dbgE("cluster is NULL"); + break; + } + + if (!g_strcmp0(current->cluster->uuid, cluster_id)) { + *cluster = current; + gl_dbgW("Found!"); + return 0; + } + } + return -1; +} + +int _gl_data_get_cluster_by_path(void *data, const char *path, + gl_cluster **cluster) +{ + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(cluster, -1); + GL_CHECK_VAL(path, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_cluster *current = NULL; + + *cluster = NULL; + + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + int length = eina_list_count(ad->albuminfo.cluster_list->clist); + gl_dbg("album length: %d, path: %s", length, path); + + for (i = 0; i < length; i++) { + current = eina_list_nth(ad->albuminfo.cluster_list->clist, i); + if (current && current->cluster && current->cluster->path) { + gl_dbg("cluster : %s", current->cluster->display_name); + } else { + gl_dbgE("cluster is NULL"); + continue; + } + + if (!g_strcmp0(current->cluster->path, path)) { + *cluster = current; + gl_dbgW("Found!"); + return 0; + } + } + return -1; +} + +/* +* get tag by index from tags_elist. +*/ +int _gl_data_get_tag_by_index(void *data, gl_tag **tag, int idx) +{ + GL_CHECK_VAL(tag, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + *tag = eina_list_nth(ad->taginfo.tags_elist, idx); + if (*tag == NULL) + return -1; + + return 0; +} + +/* +* check whether some tag already in tags list. +*/ +bool _gl_data_is_in_tag_list(void *data, const char *tagname) +{ + GL_CHECK_FALSE(tagname); + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_FALSE(ad->taginfo.tags_elist); + gl_dbg(""); + + Eina_List *tmp_elist = NULL; + gl_tag *mtag = NULL; + Eina_List *tags_list = ad->taginfo.tags_elist; + EINA_LIST_FOREACH(tags_list, tmp_elist, mtag) { + if (mtag && mtag->tag) { + if (mtag->tag->tag_name && + (g_strcmp0(mtag->tag->tag_name, tagname) == 0)) { + //debug msg + gl_dbg("Tag already exists--found tag %s***", + mtag->tag->tag_name); + return true; + } + mtag = NULL; + } + } + + gl_dbg("A new tag %s +++", tagname); + + return false; +} + +/* +* get all count of tags list +* 0 returned if tags_elist doesn't exist. +*/ +int _gl_data_get_tag_count_all(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->taginfo.tags_elist) + return eina_list_count(ad->taginfo.tags_elist); + else + return 0; +} + +/* +* get all tags from database via media service, +* tag list(param: elist) would be returned to caller, and also saved as tags_list. +*/ +int _gl_data_get_tag_list(void *data, Eina_List **elist) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Eina_List *taglist = NULL; + int err = -1; + gl_dbg(""); + + _gl_data_util_free_tag_list(ad); + + gl_tag *favor_gtag = _gl_data_util_get_favor_tag(ad); + if (favor_gtag == NULL) { + gl_dbgE("_gl_data_util_get_favor_tag failed!"); + if (elist) + *elist = NULL; + return -1; + } + favor_gtag->ad = ad; + ad->taginfo.tags_elist = eina_list_append(ad->taginfo.tags_elist, + favor_gtag); + + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, TAG_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = false; + err = _gl_local_data_get_tag_list(&filter, &taglist); + if ((err != 0) || (taglist == NULL)) { + gl_dbgE("(err != 0) || (taglist == NULL)"); + if (taglist) + _gl_data_util_clear_gtype_item_list(&taglist); + + if (elist) + *elist = ad->taginfo.tags_elist; + + return err; + } + + gl_tag_s *mtag = NULL; + gl_tag *gtag = NULL; + EINA_LIST_FREE(taglist, mtag) { + if (mtag == NULL) { + gl_dbgE("Invalid mtag!"); + continue; + } + gtag = _gl_data_util_calloc_gtag(); + if (gtag == NULL) { + gl_dbgE("_gl_data_util_calloc_gtag failed!"); + _gl_data_type_free_glitem((void **)&mtag); + continue; + } + + gtag->ad = ad; + gtag->tag = mtag; + ad->taginfo.tags_elist = eina_list_append(ad->taginfo.tags_elist, + gtag); + } + + if (elist) + *elist = ad->taginfo.tags_elist; + + return err; +} + +int _gl_data_update_tag_list(void *data, Eina_List **elist) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Eina_List *taglist = NULL; + int err = -1; + char current_tag_name[GL_ALBUM_NAME_LEN_MAX] = { 0, }; + gl_tag *current_tag = ad->taginfo.current_tag; + bool b_reset = false; + gl_dbg(""); + /* Save current tag name */ + if (current_tag && current_tag->tag && current_tag->tag->tag_name) { + gl_dbg("Current tag: %s", current_tag->tag->tag_name); + b_reset = true; + g_strlcpy(current_tag_name, current_tag->tag->tag_name, + sizeof(current_tag_name)); + } + /* Set current_tag NULL */ + ad->taginfo.current_tag = NULL; + /* Clear old tag list */ + _gl_data_util_free_tag_list(ad); + /* Add favourites tag */ + gl_tag *favor_gtag = _gl_data_util_get_favor_tag(ad); + if (favor_gtag == NULL || favor_gtag->tag == NULL) { + gl_dbgE("_gl_data_util_get_favor_tag failed!"); + if (elist) + *elist = NULL; + if (favor_gtag) + _gl_data_util_free_gtag(favor_gtag); + return -1; + } + if (b_reset && favor_gtag->tag->tag_name && + !g_strcmp0(favor_gtag->tag->tag_name, current_tag_name)) { + gl_dbg("Current tag reset."); + b_reset = false; + ad->taginfo.current_tag = favor_gtag; + } + favor_gtag->ad = ad; + ad->taginfo.tags_elist = eina_list_append(ad->taginfo.tags_elist, + favor_gtag); + + /* Get normal tags from DB */ + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, TAG_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.count = GL_GET_ALL_RECORDS; + filter.offset = GL_GET_ALL_RECORDS; + filter.with_meta = false; + err = _gl_local_data_get_tag_list(&filter, &taglist); + if ((err != 0) || (taglist == NULL)) { + gl_dbgE("(err != 0) || (taglist == NULL)"); + if (taglist) + _gl_data_util_clear_gtype_item_list(&taglist); + + if (elist) + *elist = ad->taginfo.tags_elist; + + return err; + } + + gl_tag_s *mtag = NULL; + gl_tag *gtag = NULL; + EINA_LIST_FREE(taglist, mtag) { + if (mtag == NULL) { + gl_dbgE("Invalid mtag!"); + continue; + } + gtag = _gl_data_util_calloc_gtag(); + if (gtag == NULL) { + gl_dbgE("_gl_data_util_calloc_gtag failed!"); + _gl_data_type_free_glitem((void **)&mtag); + continue; + } + if (b_reset && !g_strcmp0(mtag->tag_name, current_tag_name)) { + gl_dbg("Current tag reset."); + b_reset = false; + ad->taginfo.current_tag = gtag; + } + gtag->ad = ad; + gtag->tag = mtag; + ad->taginfo.tags_elist = eina_list_append(ad->taginfo.tags_elist, + gtag); + } + + if (elist) + *elist = ad->taginfo.tags_elist; + + return err; +} + +/* +* remove tag from tags_elist +*/ +int _gl_data_tags_list_remove(void *data, gl_tag *gtag) +{ + gl_dbg(""); + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(gtag->tag, -1); + GL_CHECK_VAL(gtag->tag->tag_name, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *current = NULL; + Eina_List *l = NULL; + + Eina_List *tags_list = ad->taginfo.tags_elist; + EINA_LIST_FOREACH(tags_list, l, current) { + if (!current || !current->tag || !current->tag->tag_name) { + gl_dbgE("NULL tag, continue..."); + continue; + } + if (gtag->tag->_id == current->tag->_id){ + gl_dbg("Found!"); + tags_list = eina_list_remove(tags_list, current); + ad->taginfo.tags_elist = tags_list; + _gl_local_data_delete_tag(gtag->tag); + _gl_data_util_free_gtag(gtag); + break; + } + current = NULL; + } + + return 0; +} + +int _gl_data_get_tag_by_id(void *data, int tag_id, gl_tag **gtag) +{ + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(gtag, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_tag *current = NULL; + + *gtag = NULL; + + GL_CHECK_VAL(ad->taginfo.tags_elist, -1); + int length = eina_list_count(ad->taginfo.tags_elist); + gl_dbg("Tag length: %d, current tag ID: %d", length, tag_id); + + for (i = 0; i < length; i++) { + current = eina_list_nth(ad->taginfo.tags_elist, i); + if (current && current->tag) { + gl_dbg("Tag: %s", current->tag->tag_name); + } else { + gl_dbgE("Tag is NULL"); + break; + } + + if (current->tag->_id == tag_id) { + *gtag = current; + gl_dbgW("Found!"); + return 0; + } + } + return 0; +} + +/* +* get media item list belongs to some tagname(param: tag_name). +* media item list(param: elist) would be returned to caller, and also saved as ad->media_elist. +*/ +int _gl_data_get_item_list_tagname(void *data, unsigned int tag_id, + bool with_meta, Eina_List ** elist) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + Eina_List *itemlist = NULL; + int err = -1; + + _gl_data_clear_default_item_list(ad); //free item list got previously. + + gl_filter_s filter; + memset(&filter,0x00,sizeof(gl_filter_s)); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, MEDIA_DISPLAY_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = true; + ad->uginfo.sort_type = filter.sort_type; // Media-svc: ORDER BY tag_name ASC; + + err = _gl_local_data_get_tag_media_list(tag_id, &filter, &itemlist); + if ((err == 0) && (itemlist != NULL)) { + gl_media_s *item = NULL; + gl_item *gitem = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item) { + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem() failed"); + _gl_data_type_free_glitem((void **)&item); + continue; + } + + gitem->ad = ad; + gitem->item = item; + ad->maininfo.medias_elist = eina_list_append(ad->maininfo.medias_elist, gitem); + item = NULL; + gitem = NULL; + } + } + + if (elist) + *elist = ad->maininfo.medias_elist; + + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + } else { + ad->maininfo.medias_cnt = 0; + if (itemlist) + _gl_data_util_clear_gtype_item_list(&itemlist); + if (elist) + *elist = NULL; + } + + //gl_dbg("DB all count : %d, ad->media_elist=%p", ad->media_cnt, ad->media_elist); + return err; +} + +int _gl_data_get_first_several_tag_items(void *data, unsigned tag_id, + gl_item *items[], int *item_count) +{ + GL_CHECK_VAL(item_count, -1); + GL_CHECK_VAL(items, -1); + GL_CHECK_VAL(data, -1); + Eina_List *itemlist = NULL; + gl_media_s *item = NULL; + gl_item *gitem = NULL; + int result_cnt = 0; + int err = -1; + + gl_filter_s filter; + memset(&filter,0x00,sizeof(gl_filter_s)); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, MEDIA_DISPLAY_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_FIRST_VIEW_START_POS; + filter.count = *item_count; + filter.with_meta = true; + + //get a media items' list who are included to the same tag with 'tag_name'. + err = _gl_local_data_get_tag_media_list(tag_id, &filter, &itemlist); + if (err != 0 || itemlist == NULL) { + gl_dbg("Failed to get tag medias[%d]!", err); + *item_count = 0; + if (itemlist) + _gl_data_util_clear_gtype_item_list(&itemlist); + return -1; + } + + EINA_LIST_FREE(itemlist, item) { + if (item == NULL) { + gl_dbgE("Invalid gl_media_s!"); + continue; + } + result_cnt++; + if(result_cnt <= *item_count) { + gitem = NULL; + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + result_cnt--; + continue; + } + gitem->item = item; + items[result_cnt-1] = gitem; + } else { + _gl_data_type_free_glitem((void **)&item); + } + item = NULL; + } + + if(*item_count > result_cnt) + *item_count = result_cnt; + + //gl_dbg("count=%d", *item_count); + return 0; +} +/* +* append tag to tags_selected_elist +*/ +int _gl_data_tags_selected_list_append(void *data, gl_tag *gtag) +{ + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(gtag->tag, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + ad->taginfo.selected_tags_elist = eina_list_append(ad->taginfo.selected_tags_elist, + gtag); + _gl_data_util_check_tag_selected_files(data, + &(ad->selectedinfo.drms_cnt), + &(ad->selectedinfo.images_cnt), + &(ad->selectedinfo.sel_cnt)); + + return 0; +} + +/* +* append album to selected_albums_elist +*/ +int _gl_data_albums_selected_list_append(void *data, gl_cluster *item) +{ + GL_CHECK_VAL(item, -1); + GL_CHECK_VAL(item->cluster, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int drm_cnt = 0; + int img_cnt = 0; + int sel_cnt = 0; + + _gl_data_util_check_album_selected_files(item, &drm_cnt, &img_cnt, + &sel_cnt); + + ad->selectedinfo.images_cnt = ad->selectedinfo.images_cnt + img_cnt; + ad->selectedinfo.drms_cnt = ad->selectedinfo.drms_cnt + drm_cnt; + ad->selectedinfo.sel_cnt = ad->selectedinfo.sel_cnt + sel_cnt; + ad->albuminfo.selected_albums_elist = eina_list_append(ad->albuminfo.selected_albums_elist, item); + + return 0; +} + +/* +* remove tag from tags_selected_elist +*/ +int _gl_data_tags_selected_list_remove(void *data, gl_tag *gtag) +{ + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(gtag->tag, -1); + GL_CHECK_VAL(gtag->tag->tag_name, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *current = NULL; + Eina_List *l = NULL; + + Eina_List *tags_list = ad->taginfo.selected_tags_elist; + EINA_LIST_FOREACH(tags_list, l, current) + { + if (!current || !current->tag) { + gl_dbg("NULL tag in selected list, continue..."); + continue; + } + if (gtag->tag->_id == current->tag->_id) { + ad->taginfo.selected_tags_elist = eina_list_remove(ad->taginfo.selected_tags_elist, + current); + _gl_data_util_check_tag_selected_files(data, + &(ad->selectedinfo.drms_cnt), + &(ad->selectedinfo.images_cnt), + &(ad->selectedinfo.sel_cnt)); + break; + } + current = NULL; + } + + return 0; +} + +/* +* free tags_selected_elist +*/ +int _gl_data_finalize_tags_selected_list(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *gtag = NULL; + + Eina_List *tags_list = ad->taginfo.selected_tags_elist; + EINA_LIST_FREE(tags_list, gtag) + { + if (gtag) + gtag->checked = false; + } + + ad->taginfo.selected_tags_elist = NULL; + return 0; +} + +/* +* return selected tags list count +*/ +int _gl_data_get_tags_selected_cnt(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + if (ad->taginfo.selected_tags_elist) + { + return eina_list_count(ad->taginfo.selected_tags_elist); + } + else + { + return 0; + } +} + +bool _gl_data_is_tags_selected_empty(void *data) +{ + GL_CHECK_VAL(data, 1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *gtag = NULL; + + Eina_List *l = NULL; + EINA_LIST_FOREACH(ad->taginfo.selected_tags_elist, l, gtag) { + if (gtag && gtag->tag && gtag->tag->count) + return false; + gtag = NULL; + } + + return true; +} + +int _gl_data_get_tags_selected_files_path_str(void *data, gchar sep_c, + char **path_str, int *sel_cnt) +{ + GL_CHECK_VAL(path_str, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->taginfo.selected_tags_elist, -1); + GString *selected_path_list = g_string_new(NULL); + gl_tag *gtag = NULL; + int selected_item_cnt = 0; + Eina_List *l = NULL; + int err = -1; + Eina_List *itemlist = NULL; + + gl_filter_s filter; + memset(&filter,0x00,sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, MEDIA_DISPLAY_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = true; + + EINA_LIST_FOREACH(ad->taginfo.selected_tags_elist, l, gtag) { + if (gtag == NULL || gtag->tag == NULL || + gtag->tag->tag_name == NULL) { + if (selected_path_list) { + g_string_free(selected_path_list, true); + selected_path_list = NULL; + } + return -1; + } + + err = _gl_local_data_get_tag_media_list(gtag->tag->_id, &filter, + &itemlist); + if ((err == 0) && (itemlist != NULL)) { + gl_media_s *item = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + + if (strstr(selected_path_list->str, item->file_url)) { + gl_dbgW("Already appended!"); + continue; + } + + selected_item_cnt++; + g_string_append(selected_path_list, item->file_url); + g_string_append_c(selected_path_list, sep_c); + item = NULL; + } + } + } + gl_dbg("Selected items count: %d.", selected_item_cnt); + if (sel_cnt) + *sel_cnt = selected_item_cnt; + int len = strlen(selected_path_list->str); + g_string_truncate(selected_path_list, len - 1); + /** + * Frees the memory allocated for the GString. + * If free_segment is true it also frees the character data. + * If it's false, the caller gains ownership of the buffer + * and must free it after use with g_free(). + */ + *path_str = g_string_free(selected_path_list, false); + GL_CHECK_VAL(*path_str, -1); + gl_dbg("Total string:\n\n\t>>@@:> %s <:@@<<\n", *path_str); + return 0; +} + +/** +* Get medias count of album or favourites tag. +* b_favor, True: it's favourites tag, False: it's album. +*/ +int _gl_data_get_item_cnt(void *data, const char *cluster_id, bool b_favor, + int album_type, int *item_cnt) +{ + GL_CHECK_VAL(item_cnt, -1); + GL_CHECK_VAL(data, -1); + int err = -1; + gl_dbg("cluster_id: %s, b_favor: %d.", cluster_id, b_favor); + + gl_filter_s filter; + memset(&filter,0x00,sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = false; + + if (b_favor) { + /* It's favourites tag */ + g_strlcpy(filter.cond, GL_CONDITION_FAV_IMAGE_VIDEO, + CONDITION_LENGTH); + err = _gl_local_data_get_all_media_count(&filter, item_cnt); + } else { + GL_CHECK_VAL(cluster_id, -1); + if (album_type == GL_STORE_T_PHONE || + album_type == GL_STORE_T_MMC) { + /*It's normal album*/ + err = _gl_local_data_get_media_count(cluster_id, &filter, + item_cnt); + } else if (album_type == GL_STORE_T_ALL) { + /* All albums */ + gl_dbg("All albums media count."); + err = _gl_local_data_get_all_media_count(&filter, item_cnt); + } else { + gl_dbgE("Invalid cluster_id!"); + return -1; + } + } + + if (err < 0) { + gl_dbg("Failed to get item count[err: %d]!", err); + return -1; + } + + gl_dbg("Item count: %d.", *item_cnt); + return 0; +} + +int _gl_data_update_item_cnt(gl_cluster *album) +{ + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(album->cluster, -1); + int item_count = 0; + int err = -1; + GL_CHECK_VAL(album->cluster->uuid, -1); + err = _gl_data_get_item_cnt(album->ad, album->cluster->uuid, false, + album->cluster->type, &item_count); + if (err != 0) { + gl_dbg("_gl_data_get_item_cnt failed!"); + album->cluster->count = 0; + return -1; + } + + gl_dbg("Media count: old=%d, new=%d", album->cluster->count, + item_count); + album->cluster->count = item_count; + + return 0; +} + +int _gl_data_get_item_list(void *data, gl_cate_type mode, gl_cluster *album, + int start_pos, int end_pos) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Eina_List *itemlist = NULL; + int err = -1; + int store_type = GL_STORE_T_PHONE; + gl_filter_s filter; + + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = start_pos; + filter.count = end_pos - start_pos + 1; + filter.with_meta = true; + + /* get file-type from service when launched by appcontrol */ + if (ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { + if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_IMAGE) { + g_strlcpy(filter.cond, GL_CONDITION_IMAGE, + CONDITION_LENGTH); + } else if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_VIDEO) { + g_strlcpy(filter.cond, GL_CONDITION_VIDEO, + CONDITION_LENGTH); + } + } + + if (mode == GL_CATEGORY_FOLDER) { + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(album->cluster, -1); + gl_dbg("db_get_item_list--folder category; start_pos[%d], end_pos[%d]\n", + start_pos, end_pos); + + GL_CHECK_VAL(album->cluster->uuid, -1); + store_type = album->cluster->type; + + /* Real album */ + if (store_type == GL_STORE_T_PHONE || + store_type == GL_STORE_T_MMC) { + ad->uginfo.sort_type = filter.sort_type; + + if (start_pos == (GL_FIRST_VIEW_END_POS + 1) && + end_pos == GL_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + gl_dbg("Gridview append idler; Keep medias_elist unchanged."); + } else { + /*Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + } + err = _gl_local_data_get_album_media_list(&filter, + album->cluster->uuid, + &itemlist); + } else if (store_type == GL_STORE_T_ALL) { + /* Get "All" album medias */ + gl_dbg("db_get_item_list--all media\n"); + ad->uginfo.sort_type = filter.sort_type; + + if (start_pos == (GL_FIRST_VIEW_END_POS + 1) && + end_pos == GL_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + gl_dbg("Gridview append idler; Keep medias_elist unchanged."); + } else { + /* Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + } + + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + } else { + gl_dbgE("Wrong cluster type!"); + return -1; + } + } else if (mode == GL_CATEGORY_FAVORITES) { + _gl_data_clear_default_item_list(ad); + + g_strlcpy(filter.cond, GL_CONDITION_FAV_IMAGE_VIDEO, + CONDITION_LENGTH); + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = true; + + ad->uginfo.sort_type = filter.sort_type; + + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + } else { + gl_dbg("View by: %d, undefined till now", mode); + } + + gl_dbg("Error code: %d", err); + if ((err == 0) && (itemlist != NULL)) { + gl_media_s *item = NULL; + gl_item *gitem = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + continue; + } + + gitem->ad = ad; + gitem->item = item; + gitem->store_type = store_type; + ad->maininfo.medias_elist = eina_list_append(ad->maininfo.medias_elist, + gitem); + item = NULL; + gitem = NULL; + } + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + gl_dbg("View by: %d, ad->maininfo.medias_elist=%p", mode, ad->maininfo.medias_elist); + } else { + ad->maininfo.medias_cnt = 0; + if (start_pos == (GL_FIRST_VIEW_END_POS + 1) && + end_pos == GL_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + gl_dbg("Gridview append idler; View by: %d, ad->maininfo.medias_elist=%p", + mode, ad->maininfo.medias_elist); + } else { + ad->maininfo.medias_elist = NULL; + } + if (itemlist) + _gl_data_util_clear_gtype_item_list(&itemlist); + } + + gl_dbg("DB all count : %d", ad->maininfo.medias_cnt); + return err; +} + +int _gl_data_update_item_list(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Eina_List *itemlist = NULL; + int err = -1; + int view_mode = gl_get_view_mode(ad); + Eina_List *sel_id_list = NULL; + gl_item *gitem = NULL; + int store_type = GL_STORE_T_PHONE; + gl_filter_s filter; + + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = true; + + if (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_THUMBS_SELECT) { + gl_dbg("Edit view."); + /* Get ID list of selected items */ + _gl_data_util_get_selected_item_id_list(ad, &sel_id_list); + /* Free old list */ + _gl_data_selected_list_finalize(ad); + } + + /* In albums tab, or album select view from tag, current album is available */ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_ALBUMS || + view_mode == GL_VIEW_THUMBS_SELECT) { + gl_cluster *cur_album = ad->albuminfo.current_album; + GL_CHECK_VAL(cur_album, -1); + GL_CHECK_VAL(cur_album->cluster, -1); + GL_CHECK_VAL(cur_album->cluster->uuid, -1); + store_type = cur_album->cluster->type; + + ad->uginfo.sort_type = filter.sort_type; + /* Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + + if (store_type == GL_STORE_T_ALL) { + gl_dbg("All albums medias"); + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + } else { + gl_dbg("Local album medias"); + err = _gl_local_data_get_album_media_list(&filter, + cur_album->cluster->uuid, + &itemlist); + } + } else if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + /* Set current tag */ + gl_tag *cur_tag = ad->taginfo.current_tag; + GL_CHECK_VAL(cur_tag, -1); + GL_CHECK_VAL(cur_tag->tag, -1); + /* get favorites tag */ + if (cur_tag->tag->_id == GL_TAG_FAVORITES_ID) { + gl_dbg("Favourites tag medias"); + /* Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + g_strlcpy(filter.cond, GL_CONDITION_FAV_IMAGE_VIDEO, + CONDITION_LENGTH); + + ad->uginfo.sort_type = filter.sort_type; + + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + } else { + gl_dbg("Normal tag medias"); + _gl_data_clear_default_item_list(ad); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, MEDIA_DISPLAY_NAME, + KEYWORD_LENGTH); + ad->uginfo.sort_type = filter.sort_type; + + err = _gl_local_data_get_tag_media_list(cur_tag->tag->_id, + &filter, + &itemlist); + } + } + + gl_dbg("Error code: %d", err); + if ((err != 0) || (itemlist == NULL)) { + gl_dbgE("(err != 0) || (itemlist == NULL)"); + ad->maininfo.medias_cnt = 0; + ad->maininfo.medias_elist = NULL; + /* Clear list of selected ID */ + if (sel_id_list) { + eina_list_free(sel_id_list); + sel_id_list = NULL; + } + + if (itemlist) + _gl_data_util_clear_gtype_item_list(&itemlist); + + return err; + } + + bool b_selected = false; + gl_media_s *item = NULL; + Eina_List *medias_elist = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + continue; + } + gitem->ad = ad; + gitem->item = item; + gitem->store_type = store_type; + + /* Append item to medias_elist */ + medias_elist = eina_list_append(ad->maininfo.medias_elist, + gitem); + ad->maininfo.medias_elist = medias_elist; + + if (sel_id_list) { + b_selected = _gl_data_util_check_selected_id(&sel_id_list, + item->uuid); + if (b_selected) { + b_selected = false; + /* Set checkbox state */ + gitem->checked = true; + /* Append gitem to selected list */ + _gl_data_selected_list_append(ad, gitem); + } + } + } + + /* Clear list of selected ID */ + if (sel_id_list) + _gl_data_util_free_selected_id_list(&sel_id_list); + + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + gl_dbg("All medias count:%d.", ad->maininfo.medias_cnt); + return err; +} + +int _gl_data_get_item_list_without_tag(void *data, gl_cluster *album, + const char *tag_name, int start_pos, + int end_pos) +{ + GL_CHECK_VAL(tag_name, -1); + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(album->cluster, -1); + GL_CHECK_VAL(album->cluster->uuid, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Eina_List *itemlist = NULL; + int err = -1; + gl_filter_s filter; + + memset(&filter,0x00,sizeof(gl_filter_s)); + if (ad->taginfo.current_tag && ad->taginfo.current_tag->tag && + ad->taginfo.current_tag->tag->_id == GL_TAG_FAVORITES_ID) + g_strlcpy(filter.cond, GL_CONDITION_WITHOUT_FAVOURITE, CONDITION_LENGTH); + else + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = start_pos; + filter.count = end_pos - start_pos + 1; + filter.with_meta = true; + + gl_dbg("tag_name[%s], start_pos[%d], end_pos[%d]", tag_name, start_pos, + end_pos); + + /* Real album */ + if (album->cluster->type == GL_STORE_T_PHONE || + album->cluster->type == GL_STORE_T_MMC) { + if (start_pos == (GL_FIRST_VIEW_END_POS + 1) && + end_pos == GL_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + gl_dbg("Gridview append idler; Keep medias_elist unchanged."); + } else { + /*Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + } + + err = _gl_local_data_get_album_media_list_without_tag(&filter, + album->cluster->uuid, + tag_name, + &itemlist); + } else if (album->cluster->type == GL_STORE_T_ALL) { + /* All albums */ + gl_dbg("All albums medias"); + if (start_pos == (GL_FIRST_VIEW_END_POS + 1) && + end_pos == GL_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + gl_dbg("Gridview append idler; Keep medias_elist unchanged."); + } else { + /* Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + } + + err = _gl_local_data_get_all_albums_media_list_without_tag(&filter, + tag_name, + &itemlist); + } else { + gl_dbgE("Wrong album type!"); + return -1; + } + + gl_dbg("Error code: %d", err); + if ((err == 0) && (itemlist != NULL)) { + gl_media_s *item = NULL; + gl_item *gitem = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + continue; + } + + gitem->ad = ad; + gitem->item = item; + gitem->store_type = album->cluster->type; + ad->maininfo.medias_elist = eina_list_append(ad->maininfo.medias_elist, + gitem); + item = NULL; + gitem = NULL; + } + + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + gl_dbg("medias_elist=%p", ad->maininfo.medias_elist); + } else { + ad->maininfo.medias_cnt = 0; + if (start_pos == (GL_FIRST_VIEW_END_POS + 1) && + end_pos == GL_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + gl_dbg("Gridview append idler; medias_elist=%p", + ad->maininfo.medias_elist); + } else { + ad->maininfo.medias_elist = NULL; + } + if (itemlist) + _gl_data_util_clear_gtype_item_list(&itemlist); + } + + gl_dbg("All count: %d", ad->maininfo.medias_cnt); + return err; +} + +int _gl_data_update_item_list_without_tag(void *data, gl_cluster *album, + const char *tag_name) +{ + GL_CHECK_VAL(tag_name, -1); + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(album->cluster, -1); + GL_CHECK_VAL(album->cluster->uuid, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Eina_List *itemlist = NULL; + int err = -1; + Eina_List *sel_id_list = NULL; + gl_item *gitem = NULL; + gl_filter_s filter; + + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = true; + + /* Get ID list of selected items */ + _gl_data_util_get_selected_item_id_list(ad, &sel_id_list); + /* Free old list */ + _gl_data_selected_list_finalize(ad); + + /* Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + + /* Real album */ + if (album->cluster->type == GL_STORE_T_PHONE || + album->cluster->type == GL_STORE_T_MMC) { + err = _gl_local_data_get_album_media_list_without_tag(&filter, + album->cluster->uuid, + tag_name, + &itemlist); + } else if (album->cluster->type == GL_STORE_T_ALL) { + /* All albums */ + gl_dbg("All albums medias"); + err = _gl_local_data_get_all_albums_media_list_without_tag(&filter, + tag_name, + &itemlist); + } else { + gl_dbgE("Wrong album type!"); + return -1; + } + + gl_dbg("Error code: %d", err); + if ((err != 0) || (itemlist == NULL)) { + gl_dbgE("(err != 0) || (itemlist == NULL)"); + ad->maininfo.medias_cnt = 0; + ad->maininfo.medias_elist = NULL; + /* Clear list of selected ID */ + if (sel_id_list) { + eina_list_free(sel_id_list); + sel_id_list = NULL; + } + + if (itemlist) + _gl_data_util_clear_gtype_item_list(&itemlist); + + return err; + } + + bool b_selected = false; + gl_media_s *item = NULL; + Eina_List *medias_elist = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + continue; + } + gitem->ad = ad; + gitem->item = item; + gitem->store_type = album->cluster->type; + + /* Append item to medias_elist */ + medias_elist = eina_list_append(ad->maininfo.medias_elist, + gitem); + ad->maininfo.medias_elist = medias_elist; + + if (sel_id_list) { + b_selected = _gl_data_util_check_selected_id(&sel_id_list, + item->uuid); + if (b_selected) { + b_selected = false; + /* Set checkbox state */ + gitem->checked = true; + /* Append gitem to selected list */ + _gl_data_selected_list_append(ad, gitem); + } + } + } + + /* Clear list of selected ID */ + if (sel_id_list) + _gl_data_util_free_selected_id_list(&sel_id_list); + + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + gl_dbg("All medias count:%d.", ad->maininfo.medias_cnt); + return err; +} + +int _gl_data_get_first_several_favor_items(void *data, gl_item *items[], + int *item_count, + media_content_order_e sort_type) +{ + GL_CHECK_VAL(items, -1); + GL_CHECK_VAL(item_count, -1); + GL_CHECK_VAL(data, -1); + Eina_List *itemlist = NULL; + gl_media_s *item = NULL; + gl_item *gitem = NULL; + int result_cnt = 0; + int err = -1; + //gl_dbg(""); + + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_FAV_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = sort_type; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_FIRST_VIEW_START_POS; + filter.count = *item_count; + filter.with_meta = false; + + err = _gl_local_data_get_all_albums_media_list(&filter, &itemlist); + if (err != 0 || itemlist == NULL) { + gl_dbg("Failed to get all medias[%d]!", err); + *item_count = 0; + if (itemlist) + _gl_data_util_clear_gtype_item_list(&itemlist); + return -1; + } + + EINA_LIST_FREE(itemlist, item) { + if (item == NULL) { + gl_dbgE("Invalid gl_media_s!"); + continue; + } + result_cnt++; + if(result_cnt <= *item_count) { + gitem = NULL; + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + result_cnt--; + continue; + } + gitem->item = item; + items[result_cnt-1] = gitem; + } else { + _gl_data_type_free_glitem((void **)&item); + } + item = NULL; + } + + if(*item_count > result_cnt) + *item_count = result_cnt; + + //gl_dbg("count=%d", *item_count); + return 0; +} + +int _gl_data_get_first_several_items(gl_cluster *album, gl_item *items[], + int *item_count, + media_content_order_e sort_type) +{ + GL_CHECK_VAL(items, -1); + GL_CHECK_VAL(item_count, -1); + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(album->cluster, -1); + GL_CHECK_VAL(album->cluster->uuid, -1); + GL_CHECK_VAL(album->ad, -1); + gl_appdata *ad = (gl_appdata *)album->ad; + Eina_List *item_list = NULL; + int result_cnt = 0; + gl_media_s *item = NULL; + gl_item *gitem = NULL; + int err = -1; + + if (*item_count <= 0) + return 0; + + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + if (ad->taginfo.current_tag && ad->taginfo.current_tag->tag) { + if (ad->taginfo.current_tag->tag->_id == GL_TAG_FAVORITES_ID) + g_strlcpy(filter.cond, GL_CONDITION_WITHOUT_FAVOURITE, + CONDITION_LENGTH); + else + snprintf(filter.cond, CONDITION_LENGTH, + GL_CONDITION_WITHOUT_TAG, + ad->taginfo.current_tag->tag->_id); + } else { + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + } + filter.sort_type = sort_type; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_FIRST_VIEW_START_POS; + filter.count = *item_count; + filter.with_meta = false; + + if (album->cluster->type == GL_STORE_T_PHONE || + album->cluster->type == GL_STORE_T_MMC) { + /* real album */ + err = _gl_local_data_get_album_media_list(&filter, + album->cluster->uuid, + &item_list); + if (err != 0 || item_list == NULL) { + gl_dbgE("Get album medias failed[%d]", err); + *item_count = 0; + if (item_list) + _gl_data_util_clear_gtype_item_list(&item_list); + return -1; + } + + EINA_LIST_FREE(item_list, item) { + if (item == NULL) { + gl_dbgE("Invalid gl_media_s!"); + continue; + } + result_cnt++; + if(result_cnt <= *item_count) { + gitem = NULL; + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + result_cnt--; + continue; + } + gitem->item = item; + items[result_cnt-1] = gitem; + } else { + _gl_data_type_free_glitem((void **)&item); + } + item = NULL; + } + + if(*item_count > result_cnt) + *item_count = result_cnt; + } else if (album->cluster->type == GL_STORE_T_ALL) { + /* add "All" album */ + gl_dbg("db_get_item_list--all media\n"); + /* use new api to get all local files, mmc status checking would be done in new apis */ + err = _gl_local_data_get_all_albums_media_list(&filter, + &item_list); + if (err != 0 || item_list == NULL) { + gl_dbgE("Failed to get all medias[%d]!", err); + *item_count = 0; + if (item_list) + _gl_data_util_clear_gtype_item_list(&item_list); + + return -1; + } + + EINA_LIST_FREE(item_list, item) { + if (item == NULL) { + gl_dbgE("Invalid gl_media_s!"); + continue; + } + result_cnt++; + if(result_cnt <= *item_count) { + gitem = NULL; + gitem = _gl_data_util_calloc_gitem(); + if (gitem == NULL) { + gl_dbgE("_gl_data_util_calloc_gitem failed!"); + _gl_data_type_free_glitem((void **)&item); + result_cnt--; + continue; + } + gitem->item = item; + gitem->store_type = album->cluster->type; + items[result_cnt-1] = gitem; + } else { + _gl_data_type_free_glitem((void **)&item); + } + item = NULL; + } + + if(*item_count > result_cnt) + *item_count = result_cnt; + } else { + gl_dbgE("Wrong cluster type!"); + return -1; + } + + if (*item_count) { + gl_dbg("first %d items for this album(%s)", + *item_count, album->cluster->display_name); + } + + return 0; +} + +bool _gl_data_is_item_cnt_zero(void *data, media_content_type_e type) +{ + GL_CHECK_VAL(data, false); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_item *gitem = NULL; + + /* Get all medias count of current album */ + int all_cnt = ad->maininfo.medias_cnt; + for (i = 1; i <= all_cnt; i++) { + _gl_data_get_item_by_index(ad, i, false, &gitem); + if (gitem && gitem->item) { + if (gitem->item->type == type) { + return false; + } + } + } + + gl_dbg(" item_cnt = 0 "); + return true; +} + +int _gl_data_get_first_item(void *data, media_content_type_e type, + gl_item **fitem, bool b_selected) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_item *gitem = NULL; + + /* Get first item for 'All' */ + if (type == MEDIA_CONTENT_TYPE_OTHERS) { + _gl_data_get_item_by_index(ad, 1, b_selected, &gitem); + *fitem = gitem; + return 0; + } + + /* Get first item for "Images" or "Videos" */ + for (i = 1; i <= ad->maininfo.medias_cnt; i++) { + _gl_data_get_item_by_index(ad, i, b_selected, &gitem); + if (gitem && gitem->item && gitem->item->type == type) { + *fitem = gitem; + return 0; + } + } + + gl_dbgW("Not found!"); + return -1; +} + +int _gl_data_destroy_item(gl_item *gitem) +{ + GL_CHECK_VAL(gitem, -1); + GL_CHECK_VAL(gitem->item, -1); + _gl_data_util_free_gitem(gitem); + return 0; +} + +/** +* select_mode: true, get item from selected_media_elist; false, get item from media_elist. +*/ +int _gl_data_get_item_by_index(void *data, int idx, bool select_mode, + gl_item **gitem) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (!select_mode) { + if (idx > ad->maininfo.medias_cnt) { + gl_dbg("db_get_item_by_index(%d) is failed, ad->maininfo.medias_cnt=%d\n", + idx, ad->maininfo.medias_cnt); //test + *gitem = NULL; + return -1; + } + + *gitem = eina_list_nth(ad->maininfo.medias_elist, idx - 1); + } else { + Eina_List *sel_list = ad->selectedinfo.medias_elist; + *gitem = (gl_item *) eina_list_nth(sel_list, --idx); + } + return 0; +} + +int _gl_data_get_orig_item_by_index(void *data, gl_item **gitem, int idx) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (idx > ad->maininfo.medias_cnt) + { + gl_dbg("_gl_data_get_orig_item_by_index(%d) is failed(>media_cnt-%d)\n", + idx, ad->maininfo.medias_cnt); //test + *gitem = NULL; + return -1; + } + + *gitem = eina_list_nth(ad->maininfo.medias_elist, idx - 1); + + return 0; +} + +int _gl_data_item_list_remove(void *data, gl_item *gitem) +{ + GL_CHECK_VAL(gitem, -1); + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(gitem->item->uuid, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_item *current = NULL; + Eina_List *l = NULL; + + Eina_List *media_elist = ad->maininfo.medias_elist; + EINA_LIST_FOREACH(media_elist, l, current) { + if (current == NULL || current->item == NULL || + current->item->uuid == NULL) { + gl_dbgE("Invalid gitem!"); + continue; + } + + if (!g_strcmp0(current->item->uuid, gitem->item->uuid)) { + ad->maininfo.medias_elist = eina_list_remove(ad->maininfo.medias_elist, + current); + ad->maininfo.medias_cnt--; + _gl_data_destroy_item(current); + break; + } + current = NULL; + } + + return 0; +} + +/* Remove file from DB and file system */ +int _gl_data_remove_item(gl_item *gitem) +{ + GL_CHECK_VAL(gitem, -1); + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(gitem->item->uuid, -1); + int ret = -1; + + /* Delete record from DB then delete media from file system */ + ret = media_info_delete_from_db(gitem->item->uuid); + if (ret != 0) { + gl_dbgE("media_info_delete_from_db failed[%d]!", ret); + return -1; + } + + if (!ecore_file_unlink(gitem->item->file_url)) { + char *error_msg = calloc(1, GL_ARRAY_LEN_MAX); + GL_CHECK_VAL(error_msg, -1); + gl_dbgE("ecore_file_unlink failed[Err:%s]!", + strerror_r(errno, error_msg, GL_ARRAY_LEN_MAX)); + GL_FREE(error_msg); + return -1; + } + + return 0; +} + +gl_item *_gl_data_selected_list_get_nth(void *data, int idx) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + + return eina_list_nth(ad->selectedinfo.medias_elist, idx); +} + +int _gl_data_selected_list_append(void *data, gl_item *gitem) +{ + GL_CHECK_VAL(gitem, -1); + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Update selected images count */ + if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) { + ad->selectedinfo.images_cnt++; +#ifdef _USE_ROTATE_BG + gl_dbg("Ext: %s", gitem->item->ext); + if (gitem->item->ext && + !strcasecmp(gitem->item->ext, GL_JPEG_FILE_EXT)) { + unsigned int orientation = 1; + if(_gl_exif_get_orientation(gitem->item->file_url, &orientation) == 0) + ad->selectedinfo.jpeg_cnt++; + } +#endif + } + + /* Update selected DRM files count */ + if (gl_drm_is_drm_file(gitem->item->file_url)) + ad->selectedinfo.drms_cnt++; + + Eina_List *sel_list = ad->selectedinfo.medias_elist; + sel_list = eina_list_append(sel_list, gitem); + ad->selectedinfo.medias_elist = sel_list; + return 0; +} + +int _gl_data_selected_list_remove(void *data, gl_item *gitem) +{ + GL_CHECK_VAL(gitem, -1); + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(gitem->item->uuid, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_item *current = NULL; + Eina_List *l = NULL; + + Eina_List *sel_list = ad->selectedinfo.medias_elist; + EINA_LIST_FOREACH(sel_list, l, current) { + if (current == NULL || current->item == NULL || + current->item->uuid == NULL) { + gl_dbgE("Invalid gitem!"); + continue; + } + if (!g_strcmp0(current->item->uuid, gitem->item->uuid)) { + /* Update selected images count */ + if (current->item->type == MEDIA_CONTENT_TYPE_IMAGE && + ad->selectedinfo.images_cnt > 0) { + ad->selectedinfo.images_cnt--; +#ifdef _USE_ROTATE_BG + if (gitem->item->ext && + !strcasecmp(gitem->item->ext,GL_JPEG_FILE_EXT) && + ad->selectedinfo.jpeg_cnt > 0) { + unsigned int orientation = 1; + if(_gl_exif_get_orientation(gitem->item->file_url, &orientation) == 0) + ad->selectedinfo.jpeg_cnt--; + } +#endif + } + + /* Update selected DRM files count */ + if (gl_drm_is_drm_file(gitem->item->file_url) && + ad->selectedinfo.drms_cnt > 0) + ad->selectedinfo.drms_cnt--; + + sel_list = eina_list_remove(sel_list, current); + ad->selectedinfo.medias_elist = sel_list; + break; + } + current = NULL; + } + return 0; +} + +int _gl_data_selected_list_finalize(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_item *gitem = NULL; + + Eina_List *sel_list = ad->selectedinfo.medias_elist; + EINA_LIST_FREE(sel_list, gitem) { + if (gitem) + gitem->checked = false; + } + + ad->selectedinfo.medias_elist = NULL; + ad->selectedinfo.images_cnt = 0; + ad->selectedinfo.drms_cnt = 0; +#ifdef _USE_ROTATE_BG + ad->selectedinfo.jpeg_cnt = 0; +#endif + return 0; +} + +int _gl_data_selected_list_count(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + return eina_list_count(ad->selectedinfo.medias_elist); +} + +bool _gl_data_is_root_path(const char *path) +{ + if (path == NULL) + return false; + + if (!g_strcmp0(GL_ROOT_PATH_PHONE, path) || + !g_strcmp0(GL_ROOT_PATH_MMC, path)) { + gl_dbg("Root path: %s", path); + return true; + } + + return false; +} + +bool _gl_data_is_albums_selected_empty(void *data) +{ + GL_CHECK_VAL(data, 1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *album = NULL; + + Eina_List *l = NULL; + EINA_LIST_FOREACH(ad->albuminfo.selected_albums_elist, l, album) { + if (album && album->cluster && album->cluster->count) + return false; + album = NULL; + } + + return true; +} + +/** + * If 'All albums' selected for share, only append files contained in 'All albums'; + * If both local albums and web albums selected, 'Share' item should be disabled. + */ +int _gl_data_get_albums_selected_files_path_str(void *data, gchar sep_c, + char **path_str, int *sel_cnt) +{ + GL_CHECK_VAL(path_str, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->albuminfo.selected_albums_elist, -1); + GString *selected_path_list = g_string_new(NULL); + gl_cluster *album = NULL; + int selected_item_cnt = 0; + Eina_List *l = NULL; + int err = -1; + Eina_List *itemlist = NULL; + + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = false; + + EINA_LIST_FOREACH(ad->albuminfo.selected_albums_elist, l, album) { + if (album == NULL || album->cluster == NULL || + album->cluster->uuid == NULL) { + if (selected_path_list) { + g_string_free(selected_path_list, true); + selected_path_list = NULL; + } + return -1; + } + if (album->cluster->type == GL_STORE_T_ALL) { + gl_dbg("All albums"); + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + /** + *Clear previous appended path, + * replaced with All albums content + */ + if (selected_path_list && selected_path_list->str) { + gl_dbgW("Free previous path string!"); + g_string_free(selected_path_list, true); + selected_path_list = g_string_new(NULL); + selected_item_cnt = 0; + } + } else if (album->cluster->type == GL_STORE_T_PHONE || + album->cluster->type == GL_STORE_T_MMC) { + gl_dbg("Local album"); + err = _gl_local_data_get_album_media_list(&filter, + album->cluster->uuid, + &itemlist); + } else { + gl_dbgE("Wrong cluster type!"); + return -1; + } + + if ((err == 0) && (itemlist != NULL)) { + gl_media_s *item = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + + selected_item_cnt++; + g_string_append(selected_path_list, item->file_url); + g_string_append_c(selected_path_list, sep_c); + item = NULL; + } + + /* Break for look if 'All albums' appended */ + if (album->cluster->type == GL_STORE_T_ALL) { + gl_dbg("Appent All albums content."); + break; + } + } + } + gl_dbg("Selected items count: %d.", selected_item_cnt); + if (sel_cnt) + *sel_cnt = selected_item_cnt; + int len = strlen(selected_path_list->str); + g_string_truncate(selected_path_list, len - 1); + /** + * Frees the memory allocated for the GString. + * If free_segment is true it also frees the character data. + * If it's false, the caller gains ownership of the buffer + * and must free it after use with g_free(). + */ + *path_str = g_string_free(selected_path_list, false); + GL_CHECK_VAL(*path_str, -1); + gl_dbg("Total string:\n\n\t>>@@:> %s <:@@<<\n", *path_str); + return 0; +} + +int _gl_data_get_albums_selected_cnt(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + return eina_list_count(ad->albuminfo.selected_albums_elist); +} + +int _gl_data_albums_selected_list_remove(void *data, gl_cluster *item) +{ + GL_CHECK_VAL(item, -1); + GL_CHECK_VAL(item->cluster, -1); + GL_CHECK_VAL(item->cluster->uuid, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *current = NULL; + Eina_List *l = NULL; + + Eina_List *sel_list = ad->albuminfo.selected_albums_elist; + EINA_LIST_FOREACH(sel_list, l, current) { + if (current == NULL || current->cluster == NULL || + current->cluster->uuid == NULL) { + gl_dbgE("Invalid gcluster!"); + continue; + } + + if (!g_strcmp0(current->cluster->uuid, item->cluster->uuid)) { + int drm_cnt = 0; + int img_cnt = 0; + int sel_cnt = 0; + + _gl_data_util_check_album_selected_files(item, &drm_cnt, + &img_cnt, + &sel_cnt); + + ad->selectedinfo.images_cnt = ad->selectedinfo.images_cnt - img_cnt; + ad->selectedinfo.drms_cnt = ad->selectedinfo.drms_cnt - drm_cnt; + ad->selectedinfo.sel_cnt = ad->selectedinfo.sel_cnt - sel_cnt; + + ad->albuminfo.selected_albums_elist = eina_list_remove(ad->albuminfo.selected_albums_elist, + current); + break; + } + current = NULL; + } + + return 0; +} + +int _gl_data_finalize_albums_selected_list(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *item = NULL; + + Eina_List *sel_list = ad->albuminfo.selected_albums_elist; + EINA_LIST_FREE(sel_list, item) { + if (item) + item->checked = false; + } + + ad->selectedinfo.images_cnt = 0; + ad->selectedinfo.drms_cnt = 0; + ad->selectedinfo.sel_cnt = 0; + ad->albuminfo.selected_albums_elist = NULL; + return 0; +} + +bool _gl_data_check_update(void *data, bool b_all) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + int err = -1; + Eina_List *item_list = NULL; + gl_media_s *mitem = NULL; + int cnt = 0; + gl_item *gitem = NULL; + + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.with_meta = false; + filter.offset = GL_FIRST_VIEW_START_POS; + filter.count = GL_GET_ONE_RECORDS; + + if (b_all) { + /* Get latest item */ + err = _gl_local_data_get_all_albums_media_list(&filter, + &item_list); + if (err != 0 || item_list == NULL) + goto DB_NEED_UPDATE; + + mitem = eina_list_nth(item_list, 0); + /* Compare modified time */ + if (mitem == NULL || mitem->mtime != ad->maininfo.last_mtime) + goto DB_NEED_UPDATE; + + /* Get all medias count */ + err = _gl_data_get_item_cnt(ad, GL_ALBUM_ALL_ID, false, + GL_STORE_T_ALL, &cnt); + if (err != 0) + goto DB_NEED_UPDATE; + + /* Compare medias count */ + if (cnt != ad->maininfo.all_medias_cnt) + goto DB_NEED_UPDATE; + } else { + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_tag *cur_tag = ad->taginfo.current_tag; + if (cur_tag == NULL || cur_tag->tag == NULL) + goto DB_NEED_UPDATE; + + /* Get all medias count */ + if (cur_tag->tag->_id == GL_TAG_FAVORITES_ID) + err = _gl_data_get_item_cnt(ad, + GL_GET_ALL_RECORDS_ID, + true, + GL_STORE_T_PHONE, + &cnt); + else + err = _gl_local_data_get_tag_media_count(cur_tag->tag->_id, + &filter, + &cnt); + if (err != 0) + goto DB_NEED_UPDATE; + /* Compare medias count */ + if (cnt != ad->maininfo.medias_cnt) + goto DB_NEED_UPDATE; + } else { + gitem = eina_list_nth(ad->maininfo.medias_elist, 0); + if (gitem == NULL || gitem->item == NULL) + goto DB_NEED_UPDATE; + + gl_cluster *cur_album = ad->albuminfo.current_album; + if (cur_album == NULL || cur_album->cluster == NULL || + cur_album->cluster->uuid == NULL) + goto DB_NEED_UPDATE; + + /* Get latest item */ + if (cur_album->cluster->type == GL_STORE_T_ALL) { + err = _gl_local_data_get_all_albums_media_list(&filter, + &item_list); + } else if (cur_album->cluster->type == GL_STORE_T_PHONE || + cur_album->cluster->type == GL_STORE_T_MMC) { + err = _gl_local_data_get_album_media_list(&filter, + cur_album->cluster->uuid, + &item_list); + } else { + gl_dbgE("Wrong cluster type!"); + return false; + } + + if (err != 0) + goto DB_NEED_UPDATE; + + mitem = eina_list_nth(item_list, 0); + /* Compare modified time */ + if (mitem == NULL || mitem->mtime != gitem->item->mtime) + goto DB_NEED_UPDATE; + + /* Get all medias count */ + err = _gl_data_get_item_cnt(ad, cur_album->cluster->uuid, + false, + cur_album->cluster->type, + &cnt); + if (err != 0) + goto DB_NEED_UPDATE; + + /* Compare medias count */ + if (cnt != ad->maininfo.medias_cnt) + goto DB_NEED_UPDATE; + } + } + + mitem = NULL; + EINA_LIST_FREE(item_list, mitem) { + _gl_data_type_free_glitem((void **)&mitem); + mitem = NULL; + } + return false; + + DB_NEED_UPDATE: + mitem = NULL; + EINA_LIST_FREE(item_list, mitem) { + _gl_data_type_free_glitem((void **)&mitem); + mitem = NULL; + } + gl_dbgW("Need to update data and view!"); + return true; +} + +int _gl_data_init() +{ + int err = _gl_local_data_connect(); + if (err != 0) + gl_dbgE("Connect to media-content DB failed!"); + + return err; +} + +int _gl_data_finalize(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + __gl_data_clear_cluster_list(ad, true); + _gl_data_clear_default_item_list(ad); + + _gl_data_util_free_tag_list(ad); + + int err = _gl_local_data_disconnect(); + if (err != 0) + gl_dbgE("Disconnect with media-content DB failed!"); + + return err; +} + +int _gl_data_delete_media(void *data, gl_media_s *media_item) +{ + GL_CHECK_VAL(media_item, -1); + int ret = -1; + + if (media_item->gtype == GL_TYPE_MEDIA) + ret = media_info_delete_from_db(media_item->uuid); + return ret; +} + +/* Creates a thumbnail image for given the media, asynchronously */ +int _gl_data_create_thumb(gl_item *gitem, media_thumbnail_completed_cb callback, + void *user_data) +{ + GL_CHECK_VAL(gitem, -1); + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(gitem->item->media_h, -1); + int ret = -1; + gl_dbg("File[%s]", gitem->item->file_url); + + ret = media_info_create_thumbnail(gitem->item->media_h, callback, + user_data); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to create thumbnail!"); + return -1; + } + return 0; +} + diff --git a/src/data/gl-local-data.c b/src/data/gl-local-data.c new file mode 100755 index 0000000..87393db --- /dev/null +++ b/src/data/gl-local-data.c @@ -0,0 +1,1479 @@ +/* + * Copyright (c) 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 "gl-local-data.h" +#include "gl-debug.h" +#include "gl-data.h" + +typedef struct _gl_transfer_data_t gl_transfer_data_s; +typedef struct _gl_foreach_data_t gl_foreach_data_s; + +struct _gl_transfer_data_t { + void **userdata; + filter_h filter; + char *album_id; + bool with_meta; +}; + +struct _gl_foreach_data_t { + void **userdata; + filter_h filter; + char *album_id; + char *tag_name; + bool with_meta; +}; + +static int __gl_local_data_create_filter(gl_filter_s *condition, filter_h *filter) +{ + GL_CHECK_VAL(filter, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h tmp_filter = NULL; + ret = media_filter_create(&tmp_filter); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Fail to create filter"); + return -1; + } + + if (strlen(condition->cond) > 0) { + ret = media_filter_set_condition(tmp_filter, condition->cond, + condition->collate_type); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Fail to set condition"); + goto GL_LOCAL_FAILED; + } + } + + if (strlen(condition->sort_keyword) > 0) { + ret = media_filter_set_order(tmp_filter, condition->sort_type, + condition->sort_keyword, + condition->collate_type); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Fail to set order"); + goto GL_LOCAL_FAILED; + } + } + + if (condition->offset != -1 && condition->count != -1 && + condition->count > 0) { + ret = media_filter_set_offset(tmp_filter, condition->offset, + condition->count); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Fail to set offset"); + goto GL_LOCAL_FAILED; + } + } + + *filter = tmp_filter; + return 0; + + GL_LOCAL_FAILED: + + if (tmp_filter) { + media_filter_destroy(tmp_filter); + tmp_filter = NULL; + *filter = NULL; + } + return -1; +} + +static int __gl_local_data_destroy_filter(filter_h filter) +{ + GL_CHECK_VAL(filter, -1); + if (media_filter_destroy(filter) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to destroy filter!"); + return -1; + } + + return 0; +} + +static bool __gl_local_data_get_album_list_cb(media_folder_h folder, + void *data) +{ + GL_CHECK_FALSE(data); + gl_transfer_data_s *tmp_data = (gl_transfer_data_s *)data; + GL_CHECK_FALSE(tmp_data->userdata); + GL_CHECK_FALSE(tmp_data->filter); + GL_CHECK_FALSE(folder); + + Eina_List **elist = (Eina_List **)(tmp_data->userdata); + gl_album_s *album = NULL; + + album = (gl_album_s *)calloc(1, sizeof(gl_album_s)); + GL_CHECK_FALSE(album); + album->gtype = GL_TYPE_ALBUM; + + if (media_folder_clone(&(album->folder_h), folder) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone folder handle failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_folder_get_folder_id(folder, &(album->uuid)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get folder id failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_folder_get_modified_time(folder, &(album->mtime)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get modified time failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_folder_get_storage_type(folder, (media_content_storage_e *)&(album->type)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get storage type failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_folder_get_name(folder, &(album->display_name)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get folder name failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_folder_get_path(folder, &(album->path)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get folder name failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_folder_get_media_count_from_db(album->uuid, tmp_data->filter, &(album->count)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get count[uuid: %s]", album->uuid); + goto GL_LOCAL_FAILED; + } + + *elist = eina_list_append(*elist, album); + + return true; + + GL_LOCAL_FAILED: + + _gl_data_type_free_glitem((void **)(&album)); + return false; +} + +static bool __gl_local_data_get_media_list_cb(media_info_h media, void *data) +{ + GL_CHECK_FALSE(data); + gl_transfer_data_s *tmp_data = (gl_transfer_data_s *)data; + GL_CHECK_FALSE(tmp_data->userdata); + GL_CHECK_FALSE(media); + gl_media_s *item = NULL; + gl_image_s *image_info = NULL; + gl_video_s *video_info = NULL; + image_meta_h image_handle = NULL; + video_meta_h video_handle = NULL; + char *ext = NULL; + + int ret = -1; + Eina_List **elist = (Eina_List **)(tmp_data->userdata); + + item = (gl_media_s *)calloc(1, sizeof(gl_media_s)); + GL_CHECK_FALSE(item); + item->gtype = GL_TYPE_MEDIA; + + if (media_info_clone(&(item->media_h), media) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone media handle failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_info_get_media_id(media, &(item->uuid)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media id failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_info_get_display_name(media, &(item->display_name)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media display name failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_info_get_file_path(media, &(item->file_url)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media file path failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_info_get_media_type(media, (media_content_type_e *)&(item->type)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media type failed!"); + goto GL_LOCAL_FAILED; + } + if (media_info_get_thumbnail_path(media, &(item->thumb_url)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media thumbnail path failed!"); + goto GL_LOCAL_FAILED; + } + gl_dbg("thumb_url: %s", item->thumb_url); + if (media_info_get_modified_time(media, &(item->mtime)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media modified time failed!"); + goto GL_LOCAL_FAILED; + } + if (media_info_get_favorite(media, &(item->favorite)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media rating failed!"); + goto GL_LOCAL_FAILED; + } + /* Without meta */ + if (!tmp_data->with_meta) + goto GL_LOCAL_SUCCESS; + + if (item->type == MEDIA_CONTENT_TYPE_IMAGE) { + ret = media_info_get_image(media, &image_handle); + if (ret != MEDIA_CONTENT_ERROR_NONE || image_handle == NULL) { + gl_dbgE("Failed to get image handle[%d]!", ret); + goto GL_LOCAL_FAILED; + } + + image_info = (gl_image_s *)calloc(1, sizeof(gl_image_s)); + if (NULL == image_info){ + gl_dbgE("Failed to calloc!"); + goto GL_LOCAL_FAILED; + } + item->image_info = image_info; + + if (image_meta_clone(&(image_info->image_h), image_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone image handle failed!"); + goto GL_LOCAL_FAILED; + } + + if (image_meta_get_media_id(image_handle, &(image_info->media_uuid)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get image id failed!"); + goto GL_LOCAL_FAILED; + } + + if (image_meta_get_orientation(image_handle, (media_content_orientation_e *)&(image_info->orientation)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get image orientation failed!"); + goto GL_LOCAL_FAILED; + } + + if (image_meta_destroy(image_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Destroy image handle failed!"); + goto GL_LOCAL_FAILED; + } + } else if (item->type == MEDIA_CONTENT_TYPE_VIDEO) { + ret = media_info_get_video(media, &video_handle); + if (ret != MEDIA_CONTENT_ERROR_NONE || video_handle == NULL) { + gl_dbgE("Failed to get video handle[%d]!", ret); + goto GL_LOCAL_FAILED; + } + + video_info = (gl_video_s *)calloc(1, sizeof(gl_video_s)); + if (NULL == video_info) { + gl_dbgE("Failed to calloc!"); + goto GL_LOCAL_FAILED; + } + item->video_info = video_info; + + if (video_meta_clone(&(video_info->video_h), video_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone video handle failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_media_id(video_handle, &(video_info->media_uuid)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video id failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_title(video_handle, &(video_info->title)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video title failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_duration(video_handle, &(video_info->duration)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video duration failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_played_time(video_handle, &(video_info->last_played_pos)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video last played position failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_destroy(video_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Destroy video handle failed!"); + goto GL_LOCAL_FAILED; + } + + /* Get bookmark elist in case of video */ + if (video_info->media_uuid) { + video_info->bookmarks = 0; + int count = 0; + ret = media_info_get_bookmark_count_from_db(video_info->media_uuid, + NULL, + &count); + if (ret != MEDIA_CONTENT_ERROR_NONE) + gl_dbgE("Failed to get bookmark[%d]", ret); + else + video_info->bookmarks = count; + } + } else { + gl_dbgE("Wrong media type[%d]!", item->type); + } + + GL_LOCAL_SUCCESS: + + /* Get extension */ + ext = strrchr(item->file_url, '.'); + if (ext) + item->ext = strdup(ext + 1); + else + gl_dbgE("Extension is NULL!"); + + /* Save album uuid */ + if (tmp_data->album_id) + item->album_uuid = strdup(tmp_data->album_id); + else + item->album_uuid = NULL; + + *elist = eina_list_append(*elist, item); + return true; + + GL_LOCAL_FAILED: + + if (image_handle) + image_meta_destroy(image_handle); + if (video_handle) + video_meta_destroy(video_handle); + + _gl_data_type_free_glitem((void **)(&item)); + return false; +} + +static bool __gl_local_data_get_tag_list_cb(media_tag_h tag_handle, void* data) +{ + GL_CHECK_FALSE(data); + gl_transfer_data_s *tmp_data = (gl_transfer_data_s *)data; + GL_CHECK_FALSE(tmp_data->userdata); + Eina_List **elist = (Eina_List **)(tmp_data->userdata); + GL_CHECK_FALSE(tag_handle); + + gl_tag_s *t_item = (gl_tag_s *)calloc(1, sizeof(gl_tag_s)); + GL_CHECK_FALSE(t_item); + t_item->gtype = GL_TYPE_TAG; + + if (media_tag_clone(&(t_item->tag_h), tag_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone tag handle failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_tag_get_tag_id(tag_handle, &(t_item->_id)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get tag id failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_tag_get_name(tag_handle, &(t_item->tag_name)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get tag name failed!"); + goto GL_LOCAL_FAILED; + } + + if (tmp_data->filter && + media_tag_get_media_count_from_db(t_item->_id, tmp_data->filter, &(t_item->count)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get tag meida count failed!"); + goto GL_LOCAL_FAILED; + } + + *elist = eina_list_append(*elist, t_item); + return true; + + GL_LOCAL_FAILED: + + _gl_data_type_free_glitem((void **)(&t_item)); + return false; +} + +static int __gl_local_data_get_tag_list_by_media_id_without_tag(gl_filter_s *condition, + const char *media_id, + Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = NULL; + tran_data.album_id = NULL; + tran_data.with_meta = false; + + gl_dbg("Get tags by media id without tag--start"); + ret = media_info_foreach_tag_from_db(media_id, filter, + __gl_local_data_get_tag_list_cb, + &tran_data); + gl_dbg("Get tags by media id without tag--over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get tags[%d]!", ret); + return -1; + } + + return 0; +} + +static bool __gl_local_data_get_media_list_without_tag_cb(media_info_h media, + void *data) +{ + GL_CHECK_FALSE(data); + gl_foreach_data_s *fe_data = (gl_foreach_data_s*)data; + GL_CHECK_FALSE(fe_data->userdata); + GL_CHECK_FALSE(media); + gl_media_s *item = NULL; + gl_image_s *image_info = NULL; + gl_video_s *video_info = NULL; + image_meta_h image_handle = NULL; + video_meta_h video_handle = NULL; + char *ext = NULL; + char *uuid; + + /* Get media uuid first */ + if (media_info_get_media_id(media, &uuid) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media id failed!"); + goto GL_LOCAL_FAILED; + } + + Eina_List *taglist = NULL; + int err = -1; + gl_dbg("UUID: %s", uuid); + gl_filter_s filter; + memset(&filter, 0x00, sizeof(gl_filter_s)); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, TAG_NAME, KEYWORD_LENGTH); + /* Check media is tagged with current tag_name or not */ + snprintf(filter.cond, CONDITION_LENGTH, + GL_CONDITION_IMAGE_VIDEO" AND "GL_CONDITION_TAG_NAME, + fe_data->tag_name); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + + err = __gl_local_data_get_tag_list_by_media_id_without_tag(&filter, uuid, + &taglist); + + if (taglist) { + gl_dbgW("Media tagged!"); + GL_FREEIF(uuid); + /* If media tagged, then skip it and get next */ + return true; + } + + int ret = -1; + Eina_List **elist = (Eina_List **)(fe_data->userdata); + + item = (gl_media_s *)calloc(1, sizeof(gl_media_s)); + GL_CHECK_FALSE(item); + item->gtype = GL_TYPE_MEDIA; + + if (media_info_clone(&(item->media_h), media) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone media handle failed!"); + goto GL_LOCAL_FAILED; + } + + item->uuid = uuid; + + if (media_info_get_display_name(media, &(item->display_name)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media display name failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_info_get_file_path(media, &(item->file_url)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media file path failed!"); + goto GL_LOCAL_FAILED; + } + + if (media_info_get_media_type(media, (media_content_type_e *)&(item->type)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media type failed!"); + goto GL_LOCAL_FAILED; + } + if (media_info_get_thumbnail_path(media, &(item->thumb_url)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media thumbnail path failed!"); + goto GL_LOCAL_FAILED; + } + gl_dbg("thumb_url: %s", item->thumb_url); + if (media_info_get_modified_time(media, &(item->mtime)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media modified time failed!"); + goto GL_LOCAL_FAILED; + } + if (media_info_get_favorite(media, &(item->favorite)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media rating failed!"); + goto GL_LOCAL_FAILED; + } + + /* Without meta */ + if (!fe_data->with_meta) + goto GL_LOCAL_SUCCESS; + + if (item->type == MEDIA_CONTENT_TYPE_IMAGE) { + ret = media_info_get_image(media, &image_handle); + if (ret != MEDIA_CONTENT_ERROR_NONE || image_handle == NULL) { + gl_dbgE("Failed to get image handle[%d]!", ret); + goto GL_LOCAL_FAILED; + } + + image_info = (gl_image_s *)calloc(1, sizeof(gl_image_s)); + if (NULL == image_info){ + gl_dbgE("Failed to calloc!"); + goto GL_LOCAL_FAILED; + } + item->image_info = image_info; + + if (image_meta_clone(&(image_info->image_h), image_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone image handle failed!"); + goto GL_LOCAL_FAILED; + } + + if (image_meta_get_media_id(image_handle, &(image_info->media_uuid)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get image id failed!"); + goto GL_LOCAL_FAILED; + } + + if (image_meta_get_orientation(image_handle, (media_content_orientation_e *)&(image_info->orientation)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get image orientation failed!"); + goto GL_LOCAL_FAILED; + } + + if (image_meta_destroy(image_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Destroy image handle failed!"); + goto GL_LOCAL_FAILED; + } + } else if (item->type == MEDIA_CONTENT_TYPE_VIDEO) { + ret = media_info_get_video(media, &video_handle); + if (ret != MEDIA_CONTENT_ERROR_NONE || video_handle == NULL) { + gl_dbgE("Failed to get video handle[%d]!", ret); + goto GL_LOCAL_FAILED; + } + + video_info = (gl_video_s *)calloc(1, sizeof(gl_video_s)); + if (NULL == video_info) { + gl_dbgE("Failed to calloc!"); + goto GL_LOCAL_FAILED; + } + item->video_info = video_info; + + if (video_meta_clone(&(video_info->video_h), video_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Clone video handle failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_media_id(video_handle, &(video_info->media_uuid)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video id failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_title(video_handle, &(video_info->title)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video title failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_duration(video_handle, &(video_info->duration)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video duration failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_get_played_time(video_handle, &(video_info->last_played_pos)) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get video last played position failed!"); + goto GL_LOCAL_FAILED; + } + + if (video_meta_destroy(video_handle) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Destroy video handle failed!"); + goto GL_LOCAL_FAILED; + } + + /* Get bookmark elist in case of video */ + if (video_info->media_uuid) { + video_info->bookmarks = 0; + int count = 0; + ret = media_info_get_bookmark_count_from_db(video_info->media_uuid, + NULL, + &count); + if (ret != MEDIA_CONTENT_ERROR_NONE) + gl_dbgE("Failed to get bookmark[%d]", ret); + else + video_info->bookmarks = count; + } + } else { + gl_dbgE("Wrong media type[%d]!", item->type); + } + + GL_LOCAL_SUCCESS: + + /* Get extension */ + ext = strrchr(item->file_url, '.'); + if (ext) + item->ext = strdup(ext + 1); + else + gl_dbgE("Extension is NULL!"); + + /* Save album uuid */ + if (fe_data->album_id) + item->album_uuid = strdup(fe_data->album_id); + else + item->album_uuid = NULL; + + *elist = eina_list_append(*elist, item); + return true; + + GL_LOCAL_FAILED: + + if (image_handle) + image_meta_destroy(image_handle); + if (video_handle) + video_meta_destroy(video_handle); + + _gl_data_type_free_glitem((void **)(&item)); + return false; +} + +/* Connect to media-content database */ +int _gl_local_data_connect(void) +{ + int ret = -1; + ret = media_content_connect(); + if(ret == MEDIA_CONTENT_ERROR_NONE) { + gl_dbg("DB connection is success"); + return 0; + } else { + gl_dbgE("DB connection is failed[%d]!", ret); + return -1; + } +} + +/* Disconnect from media-content database */ +int _gl_local_data_disconnect(void) +{ + int ret = -1; + ret = media_content_disconnect(); + if(ret == MEDIA_CONTENT_ERROR_NONE) { + gl_dbg("DB disconnection is success"); + return 0; + } else { + gl_dbgE("DB disconnection is failed[%d]!", ret); + return -1; + } +} + +int _gl_local_data_get_album_by_path(char *path, gl_album_s **album) +{ + GL_CHECK_VAL(path, -1); + GL_CHECK_VAL(album, -1); + int ret = -1; + Eina_List *list = NULL; + gl_filter_s condition; + gl_album_s *_item = NULL; + int i = 0; + + if (strlen(path) <=0) { + gl_dbgE("Invalid path!"); + return -1; + } + gl_dbg("path: %s", path); + + memset(&condition, 0x00, sizeof(gl_filter_s)); + g_strlcpy(condition.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + g_strlcpy(condition.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + condition.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + condition.sort_type = MEDIA_CONTENT_ORDER_DESC; + condition.offset = -1; + condition.count = -1; + condition.with_meta = false; + + snprintf(condition.cond, CONDITION_LENGTH, + "(%s=0 OR %s=1) AND %s=\'%s\'", MEDIA_TYPE, MEDIA_TYPE, + FOLDER_PATH, path); + + ret = _gl_local_data_get_album_list(&condition, &list); + if (ret != 0 || NULL == list) { + gl_dbgE("Failed to get album list[%d]!", ret); + ret = -1; + } else if (NULL != list) { + *album = eina_list_nth(list, 0); + i = 1; + ret = 0; + } + + /* Free other items */ + if (list) { + int len = eina_list_count(list); + gl_dbg("len: %d", len); + + for(; i < len; i++) { + _item = eina_list_nth(list, i); + _gl_data_type_free_glitem((void **)(&_item)); + } + + eina_list_free(list); + } + + return ret; +} + +int _gl_local_data_get_album_list(gl_filter_s *condition, Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + filter_h media_filter = NULL; + gl_filter_s media_condition; + memset(&media_condition, 0x00, sizeof(gl_filter_s)); + g_strlcpy(media_condition.cond, GL_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + media_condition.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(media_condition.sort_keyword, MEDIA_MODIFIED_TIME, + KEYWORD_LENGTH); + media_condition.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + media_condition.offset = -1; + media_condition.count = -1; + media_condition.with_meta = false; + + ret = __gl_local_data_create_filter(&media_condition, &media_filter); + if (ret != 0) { + __gl_local_data_destroy_filter(filter); + gl_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = media_filter; + tran_data.album_id = NULL; + tran_data.with_meta = false; + + gl_dbg("Get folders--start"); + ret = media_folder_foreach_folder_from_db(filter, + __gl_local_data_get_album_list_cb, + &tran_data); + gl_dbg("Get folders---over"); + + __gl_local_data_destroy_filter(media_filter); + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get all folders[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_media_by_path(const char *path, gl_media_s **mitem) +{ + GL_CHECK_VAL(mitem, -1); + GL_CHECK_VAL(path, -1); + int ret = -1; + Eina_List *list = NULL; + gl_filter_s condition; + gl_media_s *_mitem = NULL; + int i = 0; + + if (strlen(path) <=0) { + gl_dbgE("Invalid path!"); + return -1; + } + gl_dbg("path: %s", path); + + memset(&condition, 0x00, sizeof(gl_filter_s)); + g_strlcpy(condition.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + g_strlcpy(condition.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + condition.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + condition.sort_type = MEDIA_CONTENT_ORDER_DESC; + condition.offset = -1; + condition.count = -1; + condition.with_meta = true; + + snprintf(condition.cond, CONDITION_LENGTH, + "(%s=0 OR %s=1) AND %s=\'%s\'", MEDIA_TYPE, MEDIA_TYPE, + MEDIA_PATH, path); + ret = _gl_local_data_get_all_albums_media_list(&condition, &list); + if (ret != 0 || NULL == list) { + gl_dbgE("Failed to get all albums[%d]!", ret); + ret = -1; + } else if (NULL != list) { + *mitem = eina_list_nth(list, 0); + i = 1; + ret = 0; + } + + /* Free other items */ + if (list) { + int len = eina_list_count(list); + gl_dbg("len: %d", len); + + for(; i < len; i++) { + _mitem = eina_list_nth(list, i); + _gl_data_type_free_glitem((void **)(&_mitem)); + } + + eina_list_free(list); + } + + return ret; +} + +int _gl_local_data_get_media_count(const char *cluster_id, gl_filter_s *condition, + int *item_cnt) +{ + GL_CHECK_VAL(cluster_id, -1); + GL_CHECK_VAL(condition, -1); + GL_CHECK_VAL(item_cnt, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + gl_dbg("Get media count--start"); + ret = media_folder_get_media_count_from_db(cluster_id, filter, item_cnt); + gl_dbg("Get media count---over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get media count[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_all_media_count(gl_filter_s *condtion, int *item_cnt) +{ + GL_CHECK_VAL(condtion, -1); + GL_CHECK_VAL(item_cnt, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condtion, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + gl_dbg("Get media count--start"); + ret = media_info_get_media_count_from_db(filter, item_cnt); + gl_dbg("Get media count---over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get media count[%d]", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_album_media_list(gl_filter_s *condition, + const char *album_id, Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(album_id, -1); + GL_CHECK_VAL(condition, -1); + gl_dbg("album id: %s", album_id); + + int ret = -1; + filter_h filter = NULL; + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = NULL; + tran_data.album_id = (char *)album_id; + tran_data.with_meta = condition->with_meta; + + gl_dbg("Get medias--start"); + ret = media_folder_foreach_media_from_db(album_id, filter, + __gl_local_data_get_media_list_cb, + &tran_data); + gl_dbg("Get medias--start"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get medias[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_all_albums_media_list(gl_filter_s *condition, + Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = NULL; + tran_data.album_id = NULL; + tran_data.with_meta = condition->with_meta; + + gl_dbg("Get all medias--start"); + ret = media_info_foreach_media_from_db(filter, + __gl_local_data_get_media_list_cb, + &tran_data); + gl_dbg("Get all medias--over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get medias[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_media_count_wichout_tag(int tag_id, char *album_uuid) +{ + GL_CHECK_VAL(album_uuid, -1); + int ret = -1; + filter_h filter = NULL; + int item_cnt = 0; + + gl_filter_s condtion; + memset(&condtion, 0x00, sizeof(gl_filter_s)); + if (tag_id == GL_TAG_FAVORITES_ID) + snprintf(condtion.cond, CONDITION_LENGTH, + GL_CONDITION_WITHOUT_FAVOURITE); + else + snprintf(condtion.cond, CONDITION_LENGTH, + GL_CONDITION_WITHOUT_TAG, tag_id); + condtion.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(condtion.sort_keyword, MEDIA_MODIFIED_TIME, + KEYWORD_LENGTH); + condtion.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + condtion.offset = -1; + condtion.count = -1; + condtion.with_meta = false; + + ret = __gl_local_data_create_filter(&condtion, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + gl_dbg("Get media count--start"); + if (!g_strcmp0(album_uuid, GL_ALBUM_ALL_ID)) + ret = media_info_get_media_count_from_db(filter, &item_cnt); + else + ret = media_folder_get_media_count_from_db(album_uuid, filter, &item_cnt); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get count[uuid: %s]", album_uuid); + item_cnt = 0; + } + gl_dbg("Get media count---over"); + + __gl_local_data_destroy_filter(filter); + + return item_cnt; +} + +int _gl_local_data_get_album_media_list_without_tag(gl_filter_s *condition, + const char *album_id, + const char *tag_name, + Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(album_id, -1); + GL_CHECK_VAL(condition, -1); + gl_dbg("album id: %s, tag_name: %s", album_id, tag_name); + + int ret = -1; + filter_h filter = NULL; + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_foreach_data_s fe_data; + memset(&fe_data, 0x00, sizeof(gl_foreach_data_s)); + fe_data.userdata = (void **)elist; + fe_data.filter = NULL; + fe_data.album_id = (char *)album_id; + fe_data.tag_name = (char *)tag_name; + fe_data.with_meta = condition->with_meta; + + gl_dbg("Get medias without tag--start"); + ret = media_folder_foreach_media_from_db(album_id, filter, + __gl_local_data_get_media_list_without_tag_cb, + &fe_data); + gl_dbg("Get medias without tag--over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get medias[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_all_albums_media_list_without_tag(gl_filter_s *condition, + const char *tag_name, + Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + gl_dbg("tag_name: %s", tag_name); + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_foreach_data_s fe_data; + memset(&fe_data, 0x00, sizeof(gl_foreach_data_s)); + fe_data.userdata = (void **)elist; + fe_data.filter = NULL; + fe_data.album_id = NULL; + fe_data.tag_name = (char *)tag_name; + fe_data.with_meta = condition->with_meta; + + gl_dbg("Get all medias without tag--start"); + ret = media_info_foreach_media_from_db(filter, + __gl_local_data_get_media_list_without_tag_cb, + &fe_data); + gl_dbg("Get all medias without tag--over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get medias[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_tag_list(gl_filter_s *condition, Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed"); + return -1; + } + + filter_h media_filter = NULL; + gl_filter_s media_condition; + memset(&media_condition,0x00,sizeof(gl_filter_s)); + g_strlcpy(media_condition.cond, GL_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + media_condition.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(media_condition.sort_keyword, MEDIA_MODIFIED_TIME, + KEYWORD_LENGTH); + media_condition.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + media_condition.offset = -1; + media_condition.count = -1; + media_condition.with_meta = false; + + ret = __gl_local_data_create_filter(&media_condition, &media_filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + __gl_local_data_destroy_filter(filter); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = media_filter; + tran_data.album_id = NULL; + tran_data.with_meta = false; + + gl_dbg("Get tags--start"); + ret = media_tag_foreach_tag_from_db(filter, __gl_local_data_get_tag_list_cb, + &tran_data); + gl_dbg("Get tags--over"); + + __gl_local_data_destroy_filter(media_filter); + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get tags[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_tag_list_by_media_id(gl_filter_s *condition, + const char *media_id, + Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = NULL; + tran_data.album_id = NULL; + tran_data.with_meta = false; + + gl_dbg("Get tags--start"); + ret = media_info_foreach_tag_from_db(media_id, filter, + __gl_local_data_get_tag_list_cb, + &tran_data); + gl_dbg("Get tags--over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get tags[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_tag_media_count(int tag_id, gl_filter_s *condtion, + int *item_cnt) +{ + GL_CHECK_VAL(condtion, -1); + GL_CHECK_VAL(item_cnt, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condtion, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_dbg("Get media count--start"); + ret = media_tag_get_media_count_from_db(tag_id, filter, item_cnt); + gl_dbg("Get media count--start"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get media count[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_get_tag_media_list(unsigned int tag_id, + gl_filter_s *condition, + Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + GL_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __gl_local_data_create_filter(condition, &filter); + if (ret != 0) { + gl_dbgE("Create filter failed!"); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = NULL; + tran_data.album_id = NULL; + tran_data.with_meta = condition->with_meta; + + gl_dbg("Get tag medias--start"); + ret = media_tag_foreach_media_from_db(tag_id, filter, + __gl_local_data_get_media_list_cb, + &tran_data); + gl_dbg("Get tag medias--over"); + + __gl_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to get tag media[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_add_tag(const char *tagname, const char *media_uuid) +{ + GL_CHECK_VAL(tagname, -1); + int ret = -1; + Eina_List *list = NULL; + media_tag_h tag_h = NULL; + gl_filter_s tag_condition; + + memset(&tag_condition, 0x00, sizeof(gl_filter_s)); + tag_condition.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(tag_condition.sort_keyword, TAG_NAME, KEYWORD_LENGTH); + tag_condition.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + tag_condition.offset = -1; + tag_condition.count = -1; + tag_condition.with_meta = false; + + /* Check tag exits or not */ + _gl_local_data_get_tag_list(&tag_condition, &list); + bool is_exist = false; + if (list) { + Eina_List *tmp = NULL; + gl_tag_s *t_item = NULL; + EINA_LIST_FOREACH(list, tmp, t_item) { + if (!g_strcmp0(t_item->tag_name, tagname)) { + tag_h = t_item->tag_h; + is_exist = true; + gl_dbgW("Found!"); + break; + } + } + } + + /* Add new tag to DB */ + if (!is_exist) { + ret = media_tag_insert_to_db(tagname, &tag_h); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to add new tag[%d]!", ret); + ret = -1; + goto GL_LOCAL_FAILED; + } + } + + if (tag_h && media_uuid) { + gl_dbg("media_uuid: %s", media_uuid); + ret = media_tag_add_media(tag_h, media_uuid); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Add tag to media failed[%d]!", ret); + ret = -1; + goto GL_LOCAL_FAILED; + } + + ret = media_tag_update_to_db(tag_h); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Update tag to DB failed[%d]!", ret); + ret = -1; + goto GL_LOCAL_FAILED; + } + } else { + gl_dbgE("Invalid tag handle or uuid!"); + ret = -1; + goto GL_LOCAL_FAILED; + } + + ret = 0; + + GL_LOCAL_FAILED: + + /* Free new tag handle */ + if (!is_exist) + media_tag_destroy(tag_h); + _gl_data_type_free_tag_list(&list); + return ret; +} + +int _gl_local_data_delete_tag(gl_tag_s *tag) +{ + GL_CHECK_VAL(tag, -1); + GL_CHECK_VAL(tag->_id, -1); + int ret = -1; + + ret = media_tag_delete_from_db(tag->_id); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Delete tag failed[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_remove_tag(gl_tag_s *tag, const char *media_uuid) +{ + GL_CHECK_VAL(tag, -1); + GL_CHECK_VAL(tag->tag_h, -1); + GL_CHECK_VAL(media_uuid, -1); + int ret = -1; + + ret = media_tag_remove_media(tag->tag_h, media_uuid); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Remove tag failed[%d]!", ret); + return -1; + } + + ret = media_tag_update_to_db(tag->tag_h); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Update tag to DB failed[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_set_favorite(gl_media_s *item, bool favor) +{ + GL_CHECK_VAL(item, -1); + GL_CHECK_VAL(item->media_h, -1); + gl_dbg("favor: %d", favor); + + int ret = -1; + ret = media_info_set_favorite(item->media_h, favor); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Set tag favorite failed[%d]!", ret); + return -1; + } + + ret = media_info_update_to_db(item->media_h); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Update tag to DB failed[%d]!", ret); + return -1; + } + + return 0; +} + +int _gl_local_data_delete_album(const char *album_uuid) +{ + GL_CHECK_VAL(album_uuid, -1); + gl_filter_s filter; + int ret = -1; + + memset(&filter, 0x00, sizeof(gl_filter_s)); + g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.offset = -1; + filter.count = -1; + filter.with_meta = false; + + Eina_List *itemlist = NULL; + gl_media_s *item = NULL; + + ret = _gl_local_data_get_album_media_list(&filter, album_uuid, + &itemlist); + if (ret != 0) { + gl_dbgE("Get album medias failed[%d]!", ret); + return -1; + } + + EINA_LIST_FREE(itemlist, item) { + if (item == NULL) { + gl_dbgE("Invalid item!"); + continue; + } + + media_info_delete_from_db(item->uuid); + _gl_data_type_free_glitem((void **)&item); + } + + return 0; +} + +int _gl_local_data_add_media(const char *file_url, media_info_h *info) +{ + GL_CHECK_VAL(file_url, -1); + int ret = -1; + media_info_h item = NULL; + gl_dbg("file_url is %s", file_url); + + ret = media_info_insert_to_db(file_url, &item); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Failed to insert media to DB[%d]!", ret); + if (item) + media_info_destroy(item); + return -1; + } + + if (info) { + *info = item; + } else { + gl_dbgW("Destroy media_info item!"); + media_info_destroy(item); + } + + return 0; +} + +int _gl_local_data_get_thumb(gl_media_s *mitem, char **thumb) +{ + GL_CHECK_VAL(mitem, -1); + GL_CHECK_VAL(mitem->media_h, -1); + + if (media_info_get_thumbnail_path(mitem->media_h, thumb) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Get media thumbnail path failed!"); + return -1; + } + + return 0; +} + +int _gl_local_data_move_media(gl_media_s *mitem, const char *dst) +{ + GL_CHECK_VAL(dst, -1); + GL_CHECK_VAL(mitem, -1); + GL_CHECK_VAL(mitem->media_h, -1); + + if (media_info_move_to_db(mitem->media_h, dst) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Move media thumbnail failed!"); + return -1; + } + + return 0; +} + diff --git a/src/features/gl-albums-edit.c b/src/features/gl-albums-edit.c new file mode 100755 index 0000000..455847b --- /dev/null +++ b/src/features/gl-albums-edit.c @@ -0,0 +1,318 @@ +/* + * Copyright (c) 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 "gallery.h" +#include "gl-albums.h" +#include "gl-albums-edit.h" +#include "gl-debug.h" +#include "gl-strings.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-icons.h" +#include "gl-controlbar.h" +#include "gl-ctxpopup.h" +#include "gl-button.h" +#include "gl-notify.h" +#include "gl-popup.h" + +static void __gl_albums_edit_trans_finished_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbgW("view_mode: %d", view_mode); + evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, + __gl_albums_edit_trans_finished_cb); + + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_ALBUMS_EDIT) + elm_gengrid_clear(ad->albuminfo.albums_view); + else + gl_dbgE("Wrong view mode!"); +} + +/* callback after user tap Cancel button in option header in edit view */ +static void __gl_albums_edit_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + GL_CHECK(obj); + gl_dbg(""); + /* Disable item when it is clicked to prevent it is called for many times */ + if (_gl_albums_edit_pop_view(data) == 0) + _gl_ui_disable_btn(obj); +} + +static void __gl_albums_edit_del_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_dbg(""); + + if ((gl_get_view_mode(data) == GL_VIEW_ALBUMS_EDIT)) { + if (_gl_data_get_albums_selected_cnt(data) == 0) { + gl_dbgW("No albums selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_ALBUMS_SELECTED); + return; + } + gl_popup_create_albums_del_popup(data); + } else { + gl_dbgE("Unknow mode!"); + } +} + +static void __gl_albums_edit_share_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + + int view_mode = gl_get_view_mode(ad); + int cnt = 0; + if (view_mode == GL_VIEW_ALBUMS_EDIT) { + cnt = _gl_data_get_albums_selected_cnt(ad); + if (cnt == 0) { + gl_dbgW("No albums selected!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_ALBUMS_SELECTED); + return; + } + /* Check albums are empty */ + if (_gl_data_is_albums_selected_empty(ad)) { + gl_dbgW("No thumbs selected!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + _gl_ctxpopup_create_share(data, obj); + } else { + gl_dbgE("Unknow mode!"); + } +} + +/** + * Use naviframe api to push albums edit view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_albums_edit_push_view(void *data, Evas_Object *parent, + Evas_Object *obj) +{ + gl_dbg("GL_NAVI_ALBUMS_EDIT"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, + __gl_albums_edit_trans_finished_cb, + data); + Evas_Object *end_btn = NULL; + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_albums_edit_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + /* Push to stack */ + nf_it = elm_naviframe_item_push(parent, NULL, end_btn, NULL, obj, + GL_NF_ANI_TABBAR); + ad->ctrlinfo.nf_it_edit = nf_it; + elm_naviframe_item_title_visible_set(nf_it, EINA_FALSE); + + Evas_Object *btn = NULL; + /* Delete */ + btn = _gl_but_create_but(parent, NULL, GL_STR_DELETE, + GL_BUTTON_STYLE_NAVI_TOOLBAR_RIGHT, + __gl_albums_edit_del_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN2, btn); + _gl_ui_disable_btn(btn); + /* Share */ + btn = _gl_but_create_but(parent, NULL, GL_STR_SHARE, + GL_BUTTON_STYLE_NAVI_TOOLBAR_LEFT, + __gl_albums_edit_share_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, btn); + _gl_ui_disable_btn(btn); + return 0; +} + +int _gl_albums_edit_create_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + + gl_set_view_mode(ad, GL_VIEW_ALBUMS_EDIT); + + ad->ctrlinfo.ctrlbar_edit_ly = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(ad->ctrlinfo.ctrlbar_edit_ly, -1); + ad->ctrlinfo.ctrlbar_edit_view = gl_albums_create_view(ad, + ad->ctrlinfo.ctrlbar_edit_ly); + if (ad->ctrlinfo.ctrlbar_edit_view == NULL) { + gl_dbgE("Failed to create view!"); + evas_object_del(ad->ctrlinfo.ctrlbar_edit_ly); + ad->ctrlinfo.ctrlbar_edit_ly = NULL; + return -1; + } + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_edit_ly, + "elm.swallow.view", + ad->ctrlinfo.ctrlbar_edit_view); + edje_object_signal_emit(_EDJ(ad->ctrlinfo.ctrlbar_edit_ly), + GL_SIGNAL_VIEW_EDIT, "elm"); + /* Display 'Select all' widget */ + gl_ui_show_selall(ad); + __gl_albums_edit_push_view(ad, ad->maininfo.naviframe, + ad->ctrlinfo.ctrlbar_edit_ly); + return 0; +} + +int _gl_albums_edit_update_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + _gl_data_update_cluster_list(data); + + if (gl_check_gallery_empty(data) || + ad->albuminfo.cluster_list->edit_cnt == 0) { + /* Remove invalid widgets */ + gl_del_invalid_widgets(data, GL_INVALID_NONE); + + gl_dbgW("None editable albums, show albums view!"); + _gl_albums_edit_pop_view(data); + return 0; + } + + int sel_cnt = _gl_data_get_albums_selected_cnt(data); + int invalid_m = GL_INVALID_NONE; + /* Album selected for rename was deleted */ + if (sel_cnt == 0) { + /* None albums selected */ + gl_dbgW("None albums selected!"); + /* Disable control bar buttons */ + _gl_ctrl_disable_btns(data, ad->ctrlinfo.nf_it_edit, true); + /* Remove invalid widgets */ + gl_del_invalid_widgets(data, invalid_m); + } + + /* Update edit view, other update view in cancel callback */ + _gl_albums_create_items(data, ad->ctrlinfo.ctrlbar_edit_view); + gl_ctrl_rotate_ctrlbar(data, GL_VIEW_ALBUMS_EDIT); + /* Display selectioninfo */ + _gl_notify_create_selinfo(data, ad->ctrlinfo.ctrlbar_edit_ly, + ad->ctrlinfo.nf_it_edit, + ad->albuminfo.albums_cnt, sel_cnt, true); + return 0; +} + +int _gl_albums_edit_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + ad->albuminfo.selected_album = NULL; + + elm_naviframe_item_pop_to(ad->ctrlinfo.nf_it); + + _gl_destroy_ctrl_edit_view(data); + + _gl_data_finalize_albums_selected_list(data); + /** + * after back to albums view from albums edit view, + * option header should be defaultly closed + */ + + _gl_data_get_cluster_list(data); + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + + gl_albums_change_to_view(data); + _gl_notify_destroy_selinfo(data); + if (gl_check_gallery_empty(data)) { + gl_ctrl_disable_ctrlbar(data, true); + _gl_ctrl_disable_btn(data, true, GL_NAVI_ALBUMS); + } else { + gl_ctrl_disable_ctrlbar(data, false); + if (ad->albuminfo.cluster_list->edit_cnt == 0) { + gl_dbg("None editable albums, disable items."); + _gl_ctrl_disable_btn(data, true, GL_NAVI_ALBUMS); + } + } + + gl_ctrl_rotate_ctrlbar(data, GL_VIEW_ALBUMS); + return 0; +} + +/* Share album's content */ +int _gl_albums_edit_share(void *data, const char *label) +{ + GL_CHECK_VAL(label, -1); + GL_CHECK_VAL(data, -1); + gl_dbg("label : %s ", label); + + int cnt = _gl_data_get_albums_selected_cnt(data); + gl_dbg("Selected album(s) count: %d.", cnt); + if (cnt < 1) { + gl_dbgE("None album selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_ALBUMS_SELECTED); + return -1; + } + if (_gl_data_is_albums_selected_empty(data)) { + gl_dbgE("None thumb selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return -1; + } + + return _gl_share_load(data, label); +} + +int _gl_albums_edit_update_lang(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.nf_it_edit, -1); + + /*Reset select info text*/ + int cnt = _gl_data_get_albums_selected_cnt(ad); + _gl_notify_update_lang(ad, cnt, GL_VIEW_ALBUMS_EDIT); + + if (ad->popupinfo.popup) { + if (ad->popupinfo.popup_mode == GL_POPUP_ALBUM_DELETE) + gl_popup_create_albums_del_popup(data); + else if (ad->popupinfo.popup_mode == GL_POPUP_NOBUT) + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_ALBUMS_SELECTED); + } + + /*Album view or 3D normal view*/ + _gl_ui_set_btns_text(ad->ctrlinfo.nf_it_edit, GL_STR_SHARE, + GL_STR_DELETE); + return 0; +} + diff --git a/src/features/gl-albums-new.c b/src/features/gl-albums-new.c new file mode 100755 index 0000000..0f6543e --- /dev/null +++ b/src/features/gl-albums-new.c @@ -0,0 +1,238 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-fs.h" +#include "gl-albums-new.h" +#include "gl-albums.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-controlbar.h" +#include "gl-editfield.h" +#include "gl-button.h" +#include "gl-popup.h" +#include "gl-strings.h" +#include "gl-fs.h" + +static void __gl_albums_new_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + __gl_albums_new_cancel_cb); + _gl_albums_new_pop_view(data); +} + +static void __gl_albums_new_done_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times */ + if (_gl_albums_new_process(data, false) == 0) + evas_object_smart_callback_del(obj, "clicked", + __gl_albums_new_done_cb); +} + +/** + * Use naviframe api to push new album view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_albums_new_push_view(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_ALBUMS_NEW"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + Evas_Object *done_btn = NULL; + Evas_Object *cancel_btn = NULL; + Evas_Object *end_btn = NULL; + + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_albums_new_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, + NULL); + ad->entryinfo.nf_it = nf_it; + /* Add 'Cancel' button */ + cancel_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_albums_new_cancel_cb, data); + GL_CHECK_VAL(cancel_btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_PREV_BTN, + cancel_btn); + /* Add 'Done' button */ + done_btn = _gl_but_create_but(parent, NULL, GL_STR_DONE, + GL_BUTTON_STYLE_NAVI_TITLE, + __gl_albums_new_done_cb, data); + GL_CHECK_VAL(done_btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, done_btn); + ad->entryinfo.done_btn = done_btn; + + /* Add callbacks to show/hide title toolbar */ + _gl_ui_add_conform_cbs(parent); + return 0; +} + +int _gl_albums_new_create_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *editfield_ly = NULL; + gl_dbg(""); + + ad->entryinfo.entry_mode = GL_ENTRY_NEW_ALBUM; + editfield_ly = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(data, -1); + Evas_Object *entry = _gl_editfield_create(ad, editfield_ly, NULL); + if (entry == NULL) { + gl_dbgE("Failed to add entry!"); + evas_object_del(editfield_ly); + ad->entryinfo.entry_mode = GL_ENTRY_NONE; + return -1; + } + elm_object_part_content_set(editfield_ly, "elm.swallow.view", entry); + edje_object_signal_emit(_EDJ(editfield_ly), GL_SIGNAL_VIEW_DEFAULT, + "elm"); + __gl_albums_new_push_view(ad, ad->maininfo.naviframe, editfield_ly, + GL_STR_CREATE_ALBUM); + _gl_editfield_show_imf(ad); + return 0; +} + +int _gl_albums_new_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + elm_naviframe_item_pop(ad->maininfo.naviframe); + _gl_editfield_destroy_imf(ad); + + gl_ui_update_select_widgets(ad); + + return 0; +} + +/* +* @param b_enter +* True: Enter key on Keyboard pressed, False: Button Done clicked +*/ +int _gl_albums_new_process(void *data, bool b_enter) +{ + gl_dbg("b_enter: %d", b_enter); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->entryinfo.editfield == NULL) { + gl_dbgE("Edit filed is NULL"); + goto NEW_ALBUM_FAILED; + } + + if (ad->entryinfo.imf_context) + ecore_imf_context_input_panel_hide(ad->entryinfo.imf_context); + + Evas_Object *entry = ad->entryinfo.imf_entry; + char name[GL_ALBUM_NAME_LEN_MAX] = { 0, }; + + /* Get utf8 format string */ + if (gl_get_entry_text(entry, name, GL_ALBUM_NAME_LEN_MAX) != 0) { + gl_dbgE("Get entry text failed!"); + goto NEW_ALBUM_FAILED; + } + + /* Get valid name */ + if (_gl_get_valid_album_name(ad, name, true, b_enter) != 0) { + if (b_enter) + _gl_editfield_hide_imf(ad); + return -1; + } + gl_dbg("Valid album name: %s", name); + + /* Check whether the new folder exist */ + char new_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + char parent[GL_DIR_PATH_LEN_MAX] = { 0, }; + + /* Get default images new_path, make new album under it */ + if (_gl_fs_get_default_folder(parent) != 0) { + gl_dbgE("Failed to get default image dir new_path!"); + goto NEW_ALBUM_FAILED; + } + + /* Make dir full new_path of new album */ + snprintf(new_path, GL_DIR_PATH_LEN_MAX, "%s/%s", parent, name); + gl_dbg("New dir new_path: %s", new_path); +#ifdef _RENAME_ALBUM_SENSITIVE + if (_gl_fs_check_name_case(new_path, name)) +#endif + { + memset(new_path, 0x00, GL_DIR_PATH_LEN_MAX); + snprintf(new_path, GL_DIR_PATH_LEN_MAX, "%s/%s", parent, name); + gl_dbg("New dir new_path: %s", new_path); + int res = ecore_file_dir_is_empty(new_path); + /** + * If dir is empty, 1 is returned, + * if it contains at least 1 file, 0 is returned. + * On failure, -1 is returned. + */ + gl_dbg("ecore_file_dir_is_empty return value: %d", res); + if (res == 0) { + char *popup_desc; + popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, + sizeof(char)); + if (popup_desc == NULL) { + gl_dbgE("memory allocation fail!"); + return -1; + } + + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_SAME_NAME_ALREADY_IN_USE, + GL_STR_RETRY_Q); + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, GL_POPUP_ALBUM_NEW_DUPLICATE, + popup_desc); + GL_FREE(popup_desc); + gl_dbgW("New folder already exists!"); + return -1; + } + } + + /* Save new album name */ + char* new_album = ad->albuminfo.new_album_name; + g_strlcpy(new_album, name, GL_ALBUM_NAME_LEN_MAX); + new_album[GL_ALBUM_NAME_LEN_MAX - 1] = '\0'; + _gl_editfield_destroy_imf(ad); + + /* Move/Save files to dest album */ + gl_move_to_album(ad); + return 0; + + NEW_ALBUM_FAILED: + _gl_albums_new_pop_view(ad); + return -1; +} + diff --git a/src/features/gl-albums-rename.c b/src/features/gl-albums-rename.c new file mode 100755 index 0000000..12a2930 --- /dev/null +++ b/src/features/gl-albums-rename.c @@ -0,0 +1,446 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-fs.h" +#include "gl-albums-rename.h" +#include "gl-albums.h" +#include "gl-albums-edit.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-controlbar.h" +#include "gl-editfield.h" +#include "gl-button.h" +#include "gl-popup.h" +#include "gl-strings.h" +#include "gl-fs.h" + +static void __gl_albums_rename_trans_finished_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbgW("view_mode: %d", view_mode); + + evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, + __gl_albums_rename_trans_finished_cb); + + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_ALBUMS_RENAME) + elm_gengrid_clear(ad->ctrlinfo.ctrlbar_edit_view); + else + gl_dbgE("Wrong view mode!"); +} + +static void __gl_albums_rename_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + __gl_albums_rename_cancel_cb); + _gl_albums_rename_pop_view(data); +} + +static void __gl_albums_rename_done_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times*/ + if (_gl_albums_rename_process(data, false) == 0) + evas_object_smart_callback_del(obj, "clicked", + __gl_albums_rename_done_cb); +} + +/** + * Use naviframe api to push albums rename view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_albums_rename_push_view(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_ALBUMS_RENAME"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + Evas_Object *done_btn = NULL; + Evas_Object *end_btn = NULL; + + _gl_ctrl_show_tabbar(ad, false); + + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, + __gl_albums_rename_trans_finished_cb, + data); + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_albums_rename_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, + NULL); + /* Add 'Done' button */ + done_btn = _gl_but_create_but(parent, NULL, GL_STR_DONE, + GL_BUTTON_STYLE_NAVI_TOOLBAR, + __gl_albums_rename_done_cb, data); + GL_CHECK_VAL(done_btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, done_btn); + ad->entryinfo.done_btn = done_btn; + ad->entryinfo.nf_it = nf_it; + + /* Add callbacks to show/hide title toolbar */ + _gl_ui_add_conform_cbs(parent); + return 0; +} + +int _gl_albums_rename_create_view(void *data, gl_cluster *album) +{ + GL_CHECK_VAL(album, -1); + GL_CHECK_VAL(album->cluster, -1); + GL_CHECK_VAL(album->cluster->display_name, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *editfield_ly = NULL; + int view_mode = gl_get_view_mode(data); + gl_dbg(""); + + if(ad->maininfo.rename_album_job) { + ecore_job_del(ad->maininfo.rename_album_job); + ad->maininfo.rename_album_job = NULL; + } + if (view_mode != GL_VIEW_ALBUMS_EDIT) { + gl_dbgE("Unexpected view mode(%d)!", view_mode); + return -1; + } + + gl_set_view_mode(data, GL_VIEW_ALBUMS_RENAME); + ad->entryinfo.entry_mode = GL_ENTRY_RENAME_ALBUM; + + editfield_ly = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(editfield_ly, -1); + Evas_Object *entry = _gl_editfield_create(data, editfield_ly, + album->cluster->display_name); + if (entry == NULL) { + gl_dbgE("Failed to add entry!"); + gl_set_view_mode(data, view_mode); + ad->entryinfo.entry_mode = GL_ENTRY_NONE; + evas_object_del(editfield_ly); + return -1; + } + + elm_object_part_content_set(editfield_ly, "elm.swallow.view", entry); + edje_object_signal_emit(_EDJ(editfield_ly), GL_SIGNAL_VIEW_DEFAULT, + "elm"); + __gl_albums_rename_push_view(data, ad->maininfo.naviframe, editfield_ly, + GL_STR_CHNAGE_NAME); + _gl_editfield_show_imf(data); + return 0; +} + +int _gl_albums_rename_update_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + _gl_data_update_cluster_list(data); + + if (gl_check_gallery_empty(data) || + ad->albuminfo.cluster_list->edit_cnt == 0) { + /* Remove invalid widgets */ + gl_del_invalid_widgets(data, GL_INVALID_NONE); + + gl_dbgW("None editable albums, show albums view!"); + _gl_albums_edit_pop_view(data); + return 0; + } + + /* Album selected for rename was deleted */ + if (ad->albuminfo.selected_album == NULL) { + gl_dbgW("Rename invalid album!"); + /* Remove rename view */ + _gl_albums_rename_pop_view(data); + return 0; + } + + /* Cluster list updated, clear view */ + elm_gengrid_clear(ad->ctrlinfo.ctrlbar_edit_view); + return 0; +} + +int _gl_albums_rename_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + gl_dbg(""); + + /* Hide title from animation */ + gl_ui_set_navi_title_visible(data, EINA_FALSE); + ad->albuminfo.selected_album = NULL; + gl_set_view_mode(data, GL_VIEW_ALBUMS_EDIT); + /* manually popup view after rename album */ + elm_naviframe_item_pop(ad->maininfo.naviframe); + /* Recover the previous UI */ + gl_ctrl_rotate_ctrlbar(data, GL_VIEW_ALBUMS_EDIT); + _gl_editfield_destroy_imf(data); + /* Update edit view */ + gl_albums_update_items(data); + return 0; +} + +/* +* @param b_enter +* True: Enter key on Keyboard pressed, False: Button Done clicked +*/ +int _gl_albums_rename_process(void *data, bool b_enter) +{ + gl_dbg("b_enter: %d", b_enter); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + bool b_root_path = false; + gl_cluster *album_item = NULL; + + if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_RENAME) { + gl_dbgE("View mode is wrong!"); + goto RENAME_FAILED; + } + + album_item = ad->albuminfo.selected_album; + if (album_item == NULL || album_item->cluster == NULL || + album_item->cluster->uuid == NULL) { + gl_dbgE("selected_album is NULL!"); + goto RENAME_FAILED; + } + + char name[GL_FILE_NAME_LEN_MAX] = { 0, }; + /* Get utf8 format string */ + int ret = -1; + ret = gl_get_entry_text(ad->entryinfo.imf_entry, name, + GL_FILE_NAME_LEN_MAX); + if (ret != 0) { + gl_dbgE("Get entry text failed!"); + goto RENAME_FAILED; + } + + /* Get valid name */ + if (_gl_get_valid_album_name(ad, name, false, b_enter) != 0) { + if (b_enter) + _gl_editfield_hide_imf(ad); + return -1; + } + + gl_dbg("Valid album name: %s", name); + /* Get src folder path */ + char old_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + if (album_item->cluster->path) { + g_strlcpy(old_path, album_item->cluster->path, + GL_DIR_PATH_LEN_MAX); + gl_dbg("Src folder: %s", old_path); + if (_gl_data_is_root_path(old_path)) { + /** + * Root path, couldn't rename root path, + * make the new dest folder + * and move all files for root path to it. + */ + gl_dbg("Rename [No Name] album's name."); + b_root_path = true; + } + } else { + gl_dbgE("gl_db_get_folder_fullpath failed(%d)!", ret); + goto RENAME_FAILED; + } + + /* Get dest folder path */ + char new_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + char parent[GL_DIR_PATH_LEN_MAX] = { 0, }; + + if (b_root_path) { + /* Get default images path, make dest foler under it */ + char default_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + if (_gl_fs_get_default_folder(default_path) != 0) { + gl_dbgW("Failed to get default images path!"); + goto RENAME_FAILED; + } + + snprintf(new_path, GL_DIR_PATH_LEN_MAX, "%s/%s", default_path, + name); + new_path[strlen(new_path)] = '\0'; + g_strlcpy(parent, default_path, GL_DIR_PATH_LEN_MAX); + } else { + g_strlcpy(new_path, old_path, GL_DIR_PATH_LEN_MAX); + g_strlcpy(parent, old_path, GL_DIR_PATH_LEN_MAX); + + int i = 0; + int length = strlen(old_path); + for (i = length; i >= 0; i--) { + if (new_path[i] == '/') { + gl_dbg("length=%d, i=%d", length, i); + /* Path like "/root/abc/" */ + if (i == length - 1) + continue; + memcpy(&new_path[i + 1], name, strlen(name)); + new_path[i + 1 + strlen(name)] = '\0'; + parent[i] = '\0'; + break; + } + } + } + + gl_dbg("Dest folder: %s", new_path); +#ifdef _RENAME_ALBUM_SENSITIVE + if (!strcasecmp(old_path, new_path)) +#else + if (!g_strcmp0(old_path, new_path)) +#endif + { + gl_dbgW("Same as current name!"); + goto RENAME_FAILED; + } + + /** + * If dir is empty, 1 is returned, + * if it contains at least 1 file, 0 is returned. + * On failure, -1 is returned. + */ +#ifdef _RENAME_ALBUM_SENSITIVE + if (_gl_fs_check_name_case(new_path, name)) +#endif + { + memset(new_path, 0x00, GL_DIR_PATH_LEN_MAX); + snprintf(new_path, GL_DIR_PATH_LEN_MAX, "%s/%s", parent, name); + gl_dbg("New dir path: %s", new_path); + int res = ecore_file_dir_is_empty(new_path); + gl_dbg("ecore_file_dir_is_empty return value: %d", res); + if (res == 0) { + char *popup_desc; + popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, + sizeof(char)); + if (popup_desc == NULL) { + gl_dbgE("memory allocation fail!"); + return -1; + } + + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_SAME_NAME_ALREADY_IN_USE, GL_STR_RETRY_Q); + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, GL_POPUP_ALBUM_RENAME_DUPLICATE, + popup_desc); + GL_FREE(popup_desc); + gl_dbgW("New folder already exists!"); + return -1; + } + } + + if (b_root_path) { + /** + * Case 1: Rename virtual album 'No Name'. + * It couldn't be done by updating album record in DB directly. + * Cuz it would change the folder path of all folder records, + * to make them invalid. + * + * Create new folder under default images path, + * Move all medias under root path to new folder. + */ + if (gl_make_new_album(name) != 0) { + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_UNABLE_tO_RENAME); + gl_dbgE("Failed to make a new directory!"); + goto RENAME_FAILED; + } + + /* Move medias from 'No Name' album to new album */ + if (gl_move_root_album(ad, album_item, new_path) != 0) { + gl_dbg("gl_move_root_album failed!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_UNABLE_tO_RENAME); + goto RENAME_FAILED; + } else { + gl_dbg("New album added, update albums list."); + ad->albuminfo.selected_album = NULL; + _gl_data_update_cluster_list(ad); + } + } else { + /** + * Case 2: Rename normal album. Update album record in DB. + */ + media_folder_set_name(album_item->cluster->folder_h, name); + ret = media_folder_update_to_db(album_item->cluster->folder_h); + if (ret < 0) { + gl_dbg("media_folder_set_name failed (%d)!", ret); + goto RENAME_FAILED; + } + + /** + * Change folder name in file system + * for some special name, DB update success, but file mv failed. + * So, do this first. + */ + if (ecore_file_exists(old_path)) { + if (!ecore_file_mv(old_path, new_path)) + gl_dbg("ecore_file_mv failed!"); + } else { + gl_dbgW("Source folder path doesn't exist!"); + } + } + /* Update memory */ + if (!b_root_path) { + GL_FREEIF(album_item->cluster->display_name); + album_item->cluster->display_name = strdup(name); + } + + if (album_item->cluster->path) { + free(album_item->cluster->path); + album_item->cluster->path = strdup(new_path); + } + + _gl_albums_rename_pop_view(ad); + return 0; + + RENAME_FAILED: + _gl_albums_rename_pop_view(ad); + return -1; +} + +int _gl_albums_rename_update_lang(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->entryinfo.nf_it, -1); + + elm_object_item_text_set(ad->entryinfo.nf_it, GL_STR_CHNAGE_NAME); + if (ad->popupinfo.popup) { + char *popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, + sizeof(char)); + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_SAME_NAME_ALREADY_IN_USE, GL_STR_RETRY_Q); + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, GL_POPUP_ALBUM_RENAME_DUPLICATE, + popup_desc); + GL_FREE(popup_desc); + } + + return 0; +} + diff --git a/src/features/gl-albums-sel.c b/src/features/gl-albums-sel.c new file mode 100755 index 0000000..f7330aa --- /dev/null +++ b/src/features/gl-albums-sel.c @@ -0,0 +1,232 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-albums-sel.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-controlbar.h" +#include "gl-button.h" +#include "gl-nocontents.h" +#include "gl-notify.h" +#include "gl-strings.h" +#include "gl-albums.h" +#include "gl-tags.h" +#include "gl-thumbs.h" + +static void __gl_albums_sel_trans_finished_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbgW("view_mode: %d", view_mode); + evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, + __gl_albums_sel_trans_finished_cb); + + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_ALBUMS_SELECT) { + if (ad->gridinfo.all_grid_nocontents == NULL) + elm_gengrid_clear(ad->gridinfo.all_grid_view); + } else { + gl_dbgE("Wrong view mode!"); + } +} + +/* callback after user tap Cancel button in option header in select album view */ +static void __gl_albums_sel_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Disable item when it is clicked to prevent it is called for many times */ + if (_gl_albums_sel_pop_view(data) == 0) + _gl_ui_disable_btn(obj); +} + +/** + * Use naviframe api to push new album view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_albums_sel_push_view(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_ALBUMS_SELECT"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, + __gl_albums_sel_trans_finished_cb, data); + Evas_Object *end_btn = NULL; + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_albums_sel_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + /* Push to stack */ + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, + NULL); + ad->albuminfo.nf_it_select = nf_it; + return 0; +} + +/* Free data after layout deleted */ +static void __gl_albums_sel_delete_layout_cb(void *data, Evas *e, + Evas_Object *obj, void *ei) +{ + gl_dbg("Delete layout ---"); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + _gl_ui_del_scroller_pos(ad->albuminfo.select_view); + gl_dbg("Delete layout +++"); +} + +int _gl_albums_sel_create_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + gl_dbg(""); + + /* Create tags view layout for Select album */ + Evas_Object *layout = NULL; + layout = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(layout, -1); + 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); + /* Register delete callback */ + evas_object_event_callback_add(layout, EVAS_CALLBACK_DEL, + __gl_albums_sel_delete_layout_cb, data); + /* Save view mode */ + int pre_view_m = gl_get_view_mode(data); + /* Set view mode of Select album */ + gl_set_view_mode(data, GL_VIEW_ALBUMS_SELECT); + Evas_Object *view = NULL; + /* Get latest cluster list */ + _gl_data_get_cluster_list(data); + /* Create tags view for Select album */ + view = gl_albums_create_view(data, layout); + if (view == NULL) { + evas_object_del(layout); + /* Reset view mode */ + gl_set_view_mode(data, pre_view_m); + return -1; + } + + /* Set view to layout */ + elm_object_part_content_set(layout, "elm.swallow.view", view); + __gl_albums_sel_push_view(data, ad->maininfo.naviframe, layout, + GL_STR_SELECT_ALBUM); + /* Send signal to show different layout */ + edje_object_signal_emit(_EDJ(layout), GL_SIGNAL_VIEW_DEFAULT, "elm"); + /* Save pointer of View and Layout */ + ad->albuminfo.select_view = view; + ad->albuminfo.select_view_ly = layout; + gl_dbg("Done"); + return 0; +} + +int _gl_albums_sel_update_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Update albums list */ + gl_refresh_albums_list(data); + /* Append griditems */ + _gl_albums_create_items(data, ad->albuminfo.select_view); + + if (ad->albuminfo.albums_cnt == 0) { + gl_dbgE("None albums for selection!"); + GL_CHECK_VAL(ad->taginfo.current_tag, -1); + gl_tag *cur_tag = ad->taginfo.current_tag; + GL_CHECK_VAL(cur_tag->tag, -1); + /* Update item list */ + if (cur_tag->tag->_id == GL_TAG_FAVORITES_ID) + _gl_data_get_item_list(data, GL_CATEGORY_FAVORITES, + NULL, GL_GET_ALL_RECORDS, + GL_GET_ALL_RECORDS); + else + _gl_data_get_item_list_tagname(data, cur_tag->tag->_id, + true, NULL); + if (ad->maininfo.medias_cnt == 0) { + ad->albuminfo.select_view = NULL; + ad->albuminfo.select_view_ly = NULL; + ad->albuminfo.nf_it_select = NULL; + /* Show tags view */ + gl_dbg("Change to tags view"); + _gl_tag_comeback_from_view(data); + + elm_naviframe_item_pop_to(ad->ctrlinfo.nf_it); + if (!_gl_data_get_tag_count_all(data)) + _gl_ctrl_disable_btn(data, true, GL_NAVI_TAGS); + return 0; + } + /* change to previous view */ + _gl_albums_sel_pop_view(data); + } + return 0; +} + +/* callback after user tap Cancel button in option header in select album view */ +int _gl_albums_sel_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Popup naviframe item */ + elm_naviframe_item_pop_to(ad->gridinfo.nf_it); + ad->albuminfo.select_view = NULL; + ad->albuminfo.select_view_ly = NULL; + ad->albuminfo.nf_it_select = NULL; + + GL_CHECK_VAL(ad->taginfo.current_tag, -1); + /* Update new medias list */ + gl_dbg("Update items list"); + if (ad->taginfo.current_tag->tag->_id == GL_TAG_FAVORITES_ID) + _gl_data_get_item_list(ad, GL_CATEGORY_FAVORITES, NULL, + GL_GET_ALL_RECORDS, GL_GET_ALL_RECORDS); + else + _gl_data_get_item_list_tagname(ad, + ad->taginfo.current_tag->tag->_id, + true, NULL); + + /* Reset view mode and update edit view */ + gl_set_view_mode(ad, GL_VIEW_THUMBS); + if (_gl_thumbs_show_view(ad) != 0) { + _gl_nocontents_show(ad); + _gl_notify_destroy_selinfo(ad); + } + return 0; +} + +int _gl_albums_sel_update_lang(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->albuminfo.nf_it_select, -1); + gl_dbg(""); + elm_object_item_text_set(ad->albuminfo.nf_it_select, + GL_STR_SELECT_ALBUM); + return 0; +} + diff --git a/src/features/gl-albums.c b/src/features/gl-albums.c new file mode 100755 index 0000000..d860c37 --- /dev/null +++ b/src/features/gl-albums.c @@ -0,0 +1,913 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-albums.h" +#include "gl-thumbs.h" +#include "gl-controlbar.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-drm.h" +#include "gl-button.h" +#include "gl-data.h" +#include "gl-popup.h" +#include "gl-progressbar.h" +#include "gl-tags.h" +#include "gl-tile.h" +#include "gl-thumbs-sel.h" +#include "gl-thumbs-edit.h" +#include "gl-albums-sel.h" +#include "gl-albums-edit.h" +#include "gl-albums-rename.h" +#include "gl-strings.h" +#include "gl-nocontents.h" +#include "gl-notify.h" +#ifdef _USE_ROTATE_BG +#include "gl-rotate-bg.h" +#include "gl-exif.h" +#endif + +void _gl_albums_realized(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg_launch(" realized"); +} + +static void _gl_albums_comeback_from_view_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + _gl_albums_comeback_from_view_cb); + + /* Hide title from animation */ + gl_ui_set_navi_title_visible(ad, EINA_FALSE); + ad->albuminfo.aul_launch_type = GL_AUL_T_NONE; + if (_gl_data_check_update(ad, true)) + gl_refresh_albums_list(ad); + + gl_albums_comeback_from_view(ad); + + _gl_ctrl_disable_btn(ad, false, GL_NAVI_ALBUMS); +} + +/** +* @Brif Update checkbox state and album cover and update selectioninfo. +* +* @Param data gl_appdata. +* @Param album_item album item. +* @Param check_obj object of checkbox. +* @Param b_ck_box true: Checkbox selection, false: album cover selection. +*/ +static int _gl_albums_update_check_state(void *data, + gl_cluster *album_item, + Evas_Object *check_obj, bool b_ck_box) +{ + GL_CHECK_VAL(album_item, -1); + GL_CHECK_VAL(album_item->cluster, -1); + GL_CHECK_VAL(album_item->cluster->uuid, -1); + GL_CHECK_VAL(check_obj, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("Select checkbox[1]/album_cover[0]: %d.", b_ck_box); + + /* Update state of checkbox */ + album_item->checked = !album_item->checked; + gl_dbg("album (%s) check state: %d", album_item->cluster->display_name, + album_item->checked); + + /** + * If album cover selected, update checkbox icon manually, + * If checkbox selected, its icon is updated by system automatically. + */ + Evas_Object *ck = NULL; + if (b_ck_box == false) + ck = elm_object_item_part_content_get(album_item->item, + GL_TILE_CHECKBOX); + else + ck = elm_object_item_part_content_get(album_item->item, + GL_TILE_CHECKBOX_GRID); + elm_check_state_set(ck, album_item->checked); + + if (album_item->checked) { + gl_dbg("Append:%s, id:%s", album_item->cluster->display_name, + album_item->cluster->uuid); + _gl_data_albums_selected_list_append(ad, album_item); + } else { + gl_dbg("Remove:%s, id:%s", album_item->cluster->display_name, + album_item->cluster->uuid); + _gl_data_albums_selected_list_remove(ad, album_item); + } + + /* Display selectioninfo */ + int cnt = _gl_data_get_albums_selected_cnt(ad); + _gl_notify_create_selinfo(ad, ad->ctrlinfo.ctrlbar_edit_ly, + ad->ctrlinfo.nf_it_edit, + ad->albuminfo.albums_cnt, cnt, false); + return 0; +} + +static void _gl_albums_check_changed(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_cluster *album_item = (gl_cluster *)data; + GL_CHECK(album_item->ad); + gl_appdata *ad = (gl_appdata *)album_item->ad; + gl_dbg(""); + + if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_EDIT) { + gl_dbgE("Wrong view mode!"); + return; + } + + /* Checkbox selected, b_ck_box=true */ + _gl_albums_update_check_state(ad, album_item, obj, true); +} + +static void _gl_albums_check_grid_changed(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_cluster *album_item = (gl_cluster *)data; + GL_CHECK(album_item->ad); + gl_appdata *ad = (gl_appdata *)album_item->ad; + gl_dbg(""); + + if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_EDIT) { + gl_dbgE("Wrong view mode!"); + return; + } else { + /* gl_dbg("EditMode"); */ + } + + /* Grid checkbox selected, b_ck_box=false */ + _gl_albums_update_check_state(ad, album_item, obj, false); +} + +/* Callback of album item selection */ +static void __gl_albums_sel_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_cluster *album_item = (gl_cluster *)data; + GL_CHECK(album_item->cluster); + GL_CHECK(album_item->ad); + gl_appdata *ad = (gl_appdata *)album_item->ad; + int view_mode = gl_get_view_mode(ad); + + gl_dbg("view mode: %d.", view_mode); + if (view_mode != GL_VIEW_ALBUMS_EDIT) { + if (album_item->cluster->count == 0) { + gl_dbgW("Empty album, return!"); + return; + } + _gl_ui_save_scroller_pos(obj); + gl_albums_sel_album(album_item); + } +} + +static void __gl_albums_rename_job_cb(void *data) +{ + GL_CHECK(data); + gl_cluster *album = (gl_cluster *)data; + GL_CHECK(album->ad); + gl_appdata *ad = (gl_appdata *)album->ad; + /* save album selected for rename */ + if (_gl_albums_rename_create_view(album->ad, album) == 0) + ad->albuminfo.selected_album = album; +} + +static void _gl_albums_rename_btn_cb(void *data, Evas_Object *obj, + void *event_info) +{ + gl_dbg(""); + GL_CHECK(data); + gl_cluster *album_item = (gl_cluster *)data; + gl_appdata *ad = (gl_appdata *)album_item->ad; + + /* Return if album selected */ + if (!album_item->checked) { + gl_dbgW("Album checked!"); + return; + } + + /* Album cover selected, b_ck_box=false, deselect checkbox */ + Evas_Object *ck = NULL; + ck = elm_object_item_part_content_get(album_item->item, + GL_TILE_CHECKBOX); + _gl_albums_update_check_state(ad, album_item, ck, false); + _gl_ui_save_scroller_pos(ad->albuminfo.albums_view); + if(ad->maininfo.rename_album_job) { + ecore_job_del(ad->maininfo.rename_album_job); + ad->maininfo.rename_album_job = NULL; + } + ad->maininfo.rename_album_job = ecore_job_add(__gl_albums_rename_job_cb, + album_item); +} + +static char *__gl_albums_get_text(void *data, Evas_Object *obj, const char *part) +{ + GL_CHECK_NULL(part); + GL_CHECK_NULL(strlen(part)); + GL_CHECK_NULL(data); + gl_cluster *album_item = (gl_cluster *)data; + GL_CHECK_NULL(album_item->cluster); + GL_CHECK_NULL(album_item->cluster->display_name); + GL_CHECK_NULL(album_item->cluster->uuid); + GL_CHECK_NULL(album_item->ad); + gl_appdata *ad = (gl_appdata *)album_item->ad; + char buf[GL_ALBUM_NAME_LEN_MAX] = { 0, }; + + if (!g_strcmp0(part, "elm.text.name")) { + gl_dbg_launch(" text.name"); + gl_dbg("text.name"); + if (_gl_data_is_root_path(album_item->cluster->path)) { + snprintf(buf, sizeof(buf), "%s", + GL_ALBUM_PHOME_ROOT_NAME); + } else if (album_item->cluster->display_name && + strlen(album_item->cluster->display_name)) { + char *new_name = _gl_get_i18n_album_name(album_item); + snprintf(buf, sizeof(buf), "%s", new_name); + } else { + gl_dbgE("Album name[%s] is wrong!", + album_item->cluster->display_name); + } + } else if (!g_strcmp0(part, "elm.text.date")) { + int i = 0; + int item_count = GL_ALBUM_COVER_THUMB_NUM; + gl_item **items1 = ad->albuminfo.cover_thumbs; + gl_albums_free_cover_thumbs(ad); + + _gl_data_get_first_several_items(album_item, items1, &item_count, + MEDIA_CONTENT_ORDER_DESC); + if (item_count <= 0) { + gl_dbg("Empty album..."); + ad->albuminfo.album_medias_cnt = 0; + return NULL; + } + + ad->albuminfo.album_medias_cnt = item_count; + if (items1[0] == NULL || items1[0]->item == NULL) { + gl_dbgE("[Error] Invalid item!"); + ad->albuminfo.album_medias_cnt = 0; + return NULL; + } + + item_count = 1; + gl_item *items2[1]; + int sort_t = MEDIA_CONTENT_ORDER_ASC; + memset(items2, 0x00, item_count * sizeof(int)); + _gl_data_get_first_several_items(album_item, + items2, &item_count, + sort_t); + + if (item_count <= 0) { + gl_dbg("Empty album..."); + return NULL; + } + + if (items2[0] == NULL || items2[0]->item == NULL) { + gl_dbgE("Invalid items2[0]!"); + ad->albuminfo.album_medias_cnt = 0; + return NULL; + } + _gl_tile_get_mtime((time_t *)&(items1[0]->item->mtime), + (time_t *)&(items2[0]->item->mtime), + buf, GL_ALBUM_NAME_LEN_MAX); + + for (i = 0; i < item_count; i++) { + _gl_data_destroy_item(items2[i]); + items2[i] = NULL; + } + } else if (!g_strcmp0(part, "elm.text.count")) { + int count = 0; + if (ad->taginfo.current_tag && ad->taginfo.current_tag->tag) { + int tag_id = ad->taginfo.current_tag->tag->_id; + count = _gl_local_data_get_media_count_wichout_tag(tag_id, + album_item->cluster->uuid); + } else { + _gl_data_update_item_cnt(album_item); + count = album_item->cluster->count; + } + + snprintf(buf, sizeof(buf), "%d", count); + } + + return strdup(buf); + +} + +static int __gl_albums_set_bg_file(Evas_Object *bg, void *data) +{ + gl_item *git = (gl_item *)data; + char *bg_path = GL_DEFAULT_THUMB_ICON; + gl_icon_type ret_val = -1; + + if (git == NULL || git->item == NULL) { + gl_dbgE("Invalid item :%p", git); + goto GL_ALBUMS_FAILED; + } + + /* Is it DRM file? Has a valid RO? */ + if(_gl_get_icon_type(git) == GL_ICON_EXPIRED_DRM) { + gl_dbgW("Expired DRM!"); + goto GL_ALBUMS_FAILED; + } + + ret_val= 0; + bg_path = _GET_ICON(git->item->thumb_url); + + GL_ALBUMS_FAILED: + +#ifdef _USE_ROTATE_BG + _gl_rotate_bg_set_image_file(bg, bg_path); +#else + elm_bg_file_set(bg, bg_path, NULL); +#endif + + return ret_val; +} + +static Evas_Object *__gl_albums_get_content(void *data, Evas_Object *obj, const char *part) +{ + GL_CHECK_NULL(part); + GL_CHECK_NULL(strlen(part)); + GL_CHECK_NULL(data); + gl_cluster *album_item = (gl_cluster *)data; + GL_CHECK_NULL(album_item->cluster); + GL_CHECK_NULL(album_item->ad); + gl_appdata *ad = (gl_appdata *)album_item->ad; + GL_CHECK_NULL(album_item->cluster->uuid); + int view_mode = gl_get_view_mode(ad); + + if (view_mode != GL_VIEW_ALBUMS && + view_mode != GL_VIEW_ALBUMS_EDIT && + view_mode != GL_VIEW_ALBUMS_SELECT) + return NULL; + + Evas_Object *_obj = NULL; + if (!g_strcmp0(part, GT_TILE_ONLYICON)) { + _obj = _gl_tile_show_part_icon(obj, part, + ad->albuminfo.album_medias_cnt, + ad->maininfo.win_scale, + __gl_albums_set_bg_file, + (void **)ad->albuminfo.cover_thumbs); + } else if (!g_strcmp0(part, GT_TILE_LABEL)) { + /** + * for "All albums" and "Camera shots", their colors should be + * 25:25:25 by new gui + */ + bool b_default = false; + if (album_item->cluster->type == GL_STORE_T_ALL || + _gl_data_is_default_album(GL_ALBUM_DEFAULT_NAME, album_item->cluster)) + b_default = true; + _obj = _gl_tile_show_part_label(obj, album_item->index, + b_default); + + gl_dbg_launch(" content"); + if (ad->albuminfo.album_medias_cnt <= 0) + gl_dbg("Empty album"); + } else if (!g_strcmp0(part, GL_TILE_CHECKBOX_GRID) && + view_mode == GL_VIEW_ALBUMS_EDIT) { + _obj = _gl_tile_show_part_checkbox_grid(obj, album_item->checked, + _gl_albums_check_grid_changed, + data); + } else if (!g_strcmp0(part, GL_TILE_CHECKBOX) && + view_mode == GL_VIEW_ALBUMS_EDIT) { + _obj = _gl_tile_show_part_checkbox(obj, album_item->checked, + _gl_albums_check_changed, + data); + } else if (!g_strcmp0(part, GL_TILE_RENAME) && + view_mode == GL_VIEW_ALBUMS_EDIT) { + /** + * Fixme: In My Files app, it's unable to rename + * 'My video clips', 'Wallpapers' and 'My photo clips'. + * Maybe we need to remove rename button + * from these three albums cover. + */ + + /** + * Don't add rename button to 'All' and Web albums + * and 'Camera shot'[default album] + */ + if (album_item->cluster->type == GL_STORE_T_ALL || + _gl_data_is_default_album(GL_ALBUM_DEFAULT_NAME, album_item->cluster)) + return NULL; + + _obj = _gl_tile_show_part_rename(obj, _gl_albums_rename_btn_cb, + data); + } + + return _obj; +} + +int _gl_albums_create_items(void *data, Evas_Object *parent) +{ + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_cluster *album_item = NULL; + int length = 0; + gl_dbg(""); + + gl_ctrl_disable_tab_event(ad, true); + + if (elm_gengrid_items_count(parent) > 0) { + /* Save scroller position before clearing gengrid */ + _gl_ui_save_scroller_pos(parent); + /* Clear albums view */ + elm_gengrid_clear(parent); + } + + if (gl_get_view_mode(ad) == GL_VIEW_ALBUMS_EDIT) + ad->albuminfo.albumgic.item_style = GL_GENGRID_STYLE_ALBUM_EDIT_VIEW; + else + ad->albuminfo.albumgic.item_style = GL_GENGRID_STYLE_ALBUM_VIEW; + ad->albuminfo.albumgic.func.text_get = __gl_albums_get_text; + ad->albuminfo.albumgic.func.content_get = __gl_albums_get_content; + + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, -1); + Eina_List *clist = ad->albuminfo.cluster_list->clist; + length = eina_list_count(clist); + gl_dbg("Albums length: %d", length); + const char *al_id = NULL; + Elm_Gengrid_Item_Class *pgic = &(ad->albuminfo.albumgic); + int item_cnt = 0; + + gl_dbg_launch(" for:elm_gengrid_item_append:start"); + for (i = 0; i < length; i++) { + album_item = eina_list_nth(clist, i); + GL_CHECK_VAL(album_item, -1); + GL_CHECK_VAL(album_item->cluster, -1); + GL_CHECK_VAL(album_item->cluster->display_name, -1); + GL_CHECK_VAL(album_item->cluster->uuid, -1); + al_id = album_item->cluster->uuid; + if (ad->maininfo.view_mode == GL_VIEW_ALBUMS_EDIT && + !g_strcmp0(al_id, GL_ALBUM_ALL_ID)) + continue; + if (ad->taginfo.current_tag && ad->taginfo.current_tag->tag) { + int tag_id = ad->taginfo.current_tag->tag->_id; + if (_gl_local_data_get_media_count_wichout_tag(tag_id, album_item->cluster->uuid) < 1) + continue; + } + + album_item->item = elm_gengrid_item_append(parent, pgic, + album_item, + __gl_albums_sel_cb, + album_item); + album_item->index = item_cnt; + item_cnt++; + gl_dbg("Append[%s], id=%s.", album_item->cluster->display_name, + al_id); + } + gl_dbg_launch(" for:elm_gengrid_item_append:end"); + + /* Restore previous position of scroller */ + _gl_ui_restore_scroller_pos(parent); + ad->albuminfo.albums_cnt = item_cnt; + + gl_ctrl_disable_tab_event(ad, false); + + return 0; +} + +static int __gl_albums_reset_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d", view_mode); + + if (view_mode != GL_VIEW_ALBUMS && + view_mode != GL_VIEW_ALBUMS_EDIT && + view_mode != GL_VIEW_ALBUMS_RENAME) { + gl_dbg("Change to albums view"); + gl_destroy_thumbs_view(ad); + gl_refresh_albums_list(ad); + gl_albums_comeback_from_view(ad); + } else if (view_mode == GL_VIEW_ALBUMS_EDIT || + view_mode == GL_VIEW_ALBUMS_RENAME) { + gl_del_invalid_widgets(ad, GL_INVALID_NONE); + _gl_albums_edit_pop_view(ad); + } + + return 0; +} + +int gl_albums_sel_album(gl_cluster *album_item) +{ + GL_CHECK_VAL(album_item, -1); + GL_CHECK_VAL(album_item->cluster, -1); + GL_CHECK_VAL(album_item->cluster->uuid, -1); + GL_CHECK_VAL(album_item->ad, -1); + gl_appdata *ad = (gl_appdata *)album_item->ad; + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, -1); + int view_mode = gl_get_view_mode(ad); + + if (view_mode == GL_VIEW_ALBUMS) { + gl_dbg("View mode!"); + } else if (view_mode == GL_VIEW_ALBUMS_SELECT) { + gl_dbg("Select mode!"); + _gl_thumbs_sel_create_view(ad, album_item); + return 0; + } else { + gl_dbgW("Wrong view mode"); + return -1; + } + char *al_na = _gl_get_i18n_album_name(album_item); + gl_dbg("current %s album, id=%s", al_na, album_item->cluster->uuid); + ad->albuminfo.current_album = album_item; + _gl_data_get_item_list(ad, GL_CATEGORY_FOLDER, album_item, + GL_FIRST_VIEW_START_POS, GL_FIRST_VIEW_END_POS); + + gl_navi_mode mode = GL_NAVI_THUMBS; + if (_gl_data_is_root_path(album_item->cluster->path)) { + /* check root case */ + al_na = GL_ALBUM_PHOME_ROOT_NAME; + } else if (ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { + /* launch by appcontrol */ + if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_IMAGE) + al_na = GL_ALBUM_IMAGES_NAME; + else if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_VIDEO) + al_na = GL_ALBUM_VIDEOS_NAME; + else if (al_na == NULL) + al_na = GL_ALBUM_ALL_NAME; + } + + _gl_thumbs_create_view(ad, mode, al_na, true, + _gl_albums_comeback_from_view_cb); + + /* Checkme: clear albums view for animation effect pause issue */ + elm_gengrid_clear(ad->albuminfo.albums_view); + gl_dbg("albums_view 0x%x cleared", ad->albuminfo.albums_view); + gl_dbg("Done albums selected"); + return 0; +} + +Evas_Object *_gl_albums_add_gengrid(void *data, Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + GL_CHECK_NULL(data); + Evas_Object *grid = _gl_tile_add_gengrid(data, parent); + evas_object_smart_callback_add(grid, "realized", _gl_albums_realized, + data); + evas_object_show(grid); + _gl_ui_reset_scroller_pos(grid); + return grid; +} + +Evas_Object *gl_albums_create_view(void *data, Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_NULL(ad->albuminfo.cluster_list); + gl_dbg(""); + gl_dbg_launch(" gl_albums_create_view:start"); + + gl_albums_free_cover_thumbs(ad); + memset(ad->albuminfo.cover_thumbs, 0x00, + GL_ALBUM_COVER_THUMB_NUM * sizeof(int)); + ad->albuminfo.album_medias_cnt = 0; + ad->albuminfo.albums_cnt = 0; + + Evas_Object *grid = _gl_albums_add_gengrid(data, parent); + GL_CHECK_NULL(grid); + + if (ad->maininfo.view_mode != GL_VIEW_THUMBS) + _gl_albums_create_items(ad, grid); + + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d", view_mode); + if (view_mode == GL_VIEW_ALBUMS_SELECT) { + if (ad->albuminfo.albums_cnt == 0) { + gl_dbgE("None albums!"); + _gl_ui_del_scroller_pos(grid); + evas_object_del(grid); + grid = _gl_nocontents_create(ad); + } else { + evas_object_show(grid); + } + return grid; + } + + /* show no contents none album exists */ + if (gl_check_gallery_empty(ad)) { + _gl_ui_del_scroller_pos(grid); + evas_object_del(grid); + grid = NULL; + + /* Set the grid view mode for creating nocontents view */ + ad->gridinfo.view_mode = GL_THUMB_ALBUMS; + Evas_Object *noc = _gl_nocontents_create(ad); + evas_object_show(noc); + ad->albuminfo.albums_nocontents = noc; + + return noc; + } else { + ad->albuminfo.albums_nocontents = NULL; + } + + gl_dbg("gl_albums_create_view:done"); + gl_dbg_launch(" gl_albums_create_view:end"); + + return grid; +} + +/* From thumbnails view to albums view */ +int gl_albums_comeback_from_view(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + gl_set_view_mode(ad, GL_VIEW_ALBUMS); + gl_ctrl_rotate_ctrlbar(ad, GL_VIEW_ALBUMS); + + _gl_thumbs_delete_view(ad); + + ad->albuminfo.current_album = NULL; + gl_albums_update_items(ad); + return 0; +} + +/* From albums edit view to albums view */ +int gl_albums_change_to_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + gl_dbg(""); + + ad->albuminfo.albums_cnt = 0; + GL_CHECK_VAL(ad->albuminfo.albums_view, -1); + gl_set_view_mode(ad, GL_VIEW_ALBUMS); + /* changed to show no contents if needed */ + if (gl_check_gallery_empty(ad)) { + if (ad->albuminfo.albums_view) { + _gl_ui_del_scroller_pos(ad->albuminfo.albums_view); + evas_object_del(ad->albuminfo.albums_view); + } + + /* Set the grid view mode for creating nocontents view */ + ad->gridinfo.view_mode = GL_THUMB_ALBUMS; + Evas_Object *noc = _gl_nocontents_create(ad); + ad->albuminfo.albums_nocontents = noc; + ad->albuminfo.albums_view = noc; + evas_object_show(noc); + + Evas_Object *old_view = NULL; + old_view = elm_object_part_content_unset(ad->ctrlinfo.ctrlbar_view_ly, + "contents"); + _gl_ui_del_scroller_pos(old_view); + evas_object_del(old_view); + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_view_ly, + "contents", noc); + } else { + _gl_albums_create_items(ad, ad->albuminfo.albums_view); + } + + return 0; +} + +/* Update albums view */ +int gl_albums_update_items(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + int view_mode = gl_get_view_mode(ad); + ad->albuminfo.albums_cnt = 0; + gl_dbg(""); + /* Changed to show no contents if needed */ + if (gl_check_gallery_empty(ad)) { + /* Set the grid view mode for creating nocontents view */ + ad->gridinfo.view_mode = GL_THUMB_ALBUMS; + _gl_ui_del_scroller_pos(ad->albuminfo.albums_view); + evas_object_del(ad->albuminfo.albums_view); + + Evas_Object *noc = _gl_nocontents_create(ad); + ad->albuminfo.albums_nocontents = noc; + ad->albuminfo.albums_view = noc; + evas_object_show(noc); + + Evas_Object *old_view = NULL; + old_view = elm_object_part_content_unset(ad->ctrlinfo.ctrlbar_view_ly, + "contents"); + _gl_ui_del_scroller_pos(old_view); + evas_object_del(old_view); + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_view_ly, + "contents", noc); + } else { + if (view_mode == GL_VIEW_ALBUMS_EDIT) { + _gl_albums_create_items(ad, + ad->ctrlinfo.ctrlbar_edit_view); + /* Display selectioninfo */ + int cnt = _gl_data_get_albums_selected_cnt(ad); + _gl_notify_create_selinfo(ad, + ad->ctrlinfo.ctrlbar_edit_ly, + ad->ctrlinfo.nf_it_edit, + ad->albuminfo.albums_cnt, cnt, + true); + } else { + if (ad->albuminfo.albums_nocontents) { + /** + * current view is nocontents, + * unset it first then create albums view. + */ + gl_albums_remove_nocontents(ad); + } else { + Evas_Object *al_view = NULL; + al_view = ad->albuminfo.albums_view; + _gl_albums_create_items(ad, al_view); + } + } + } + + return 0; +} + +/* Update albums list and refresh albums view, remove invalid widgets */ +int gl_albums_update_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d.", view_mode); + + gl_albums_free_cover_thumbs(ad); + memset(ad->albuminfo.cover_thumbs, 0x00, + GL_ALBUM_COVER_THUMB_NUM * sizeof(int)); + ad->albuminfo.albums_cnt = 0; + + if (view_mode == GL_VIEW_ALBUMS) { + /* Update albums list*/ + gl_refresh_albums_list(ad); + + /* Only newly downloaded web album */ + if (ad->albuminfo.albums_nocontents) { + gl_albums_remove_nocontents(ad); + } else if (!gl_check_gallery_empty(ad)) { + _gl_albums_create_items(ad, ad->albuminfo.albums_view); + if (ad->albuminfo.cluster_list->edit_cnt) + _gl_ctrl_disable_btn(ad, false, GL_NAVI_ALBUMS); + else + _gl_ctrl_disable_btn(ad, true, GL_NAVI_ALBUMS); + } else { + gl_dbg("View is empty."); + gl_albums_update_items(ad); + _gl_ctrl_disable_btn(ad, true, GL_NAVI_ALBUMS); + gl_ctrl_disable_ctrlbar(ad, true); + } + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + _gl_albums_edit_update_view(data); + } else if (view_mode == GL_VIEW_ALBUMS_RENAME) { + _gl_albums_rename_update_view(data); + } else if (view_mode == GL_VIEW_ALBUMS_SELECT) { + /* Update albums selection view */ + _gl_albums_sel_update_view(data); + } + return 0; +} + +/** +* Remove nocontents view and show albums view. +* Case 1, gallery is empty->home key tapped +* ->take photos with camera->back to gallery; +*/ +int gl_albums_remove_nocontents(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *view = NULL; + gl_dbg(""); + + if (ad->albuminfo.albums_nocontents && !gl_check_gallery_empty(ad)) { + gl_dbg("Remove nocontents view then create albums view."); + evas_object_del(ad->albuminfo.albums_nocontents); + ad->albuminfo.albums_nocontents = NULL; + + view = gl_albums_create_view(ad, ad->maininfo.naviframe); + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_view_ly, + "contents", view); + evas_object_show(view); + ad->albuminfo.albums_view = view; + + _gl_ctrl_disable_btn(ad, false, GL_NAVI_ALBUMS); + gl_ctrl_disable_ctrlbar(ad, false); + } else if (ad->albuminfo.albums_nocontents) { + gl_dbg("Gallery is empty!"); + bool b_update = false; + b_update = _gl_nocontents_update_label(ad->albuminfo.albums_nocontents, + GL_STR_NO_ALBUMS); + /* Update toolbar state */ + if (b_update) + _gl_ctrl_disable_btn(ad, false, GL_NAVI_ALBUMS); + } else { + gl_dbg("Nocontents was removed!"); + } + + return 0; +} + +int gl_albums_free_cover_thumbs(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + + for (i = 0; i < GL_ALBUM_COVER_THUMB_NUM; i++) { + if (ad->albuminfo.cover_thumbs[i]) { + _gl_data_destroy_item(ad->albuminfo.cover_thumbs[i]); + ad->albuminfo.cover_thumbs[i] = NULL; + } + } + + return 0; +} + +/* Free resources allocated for albums view */ +int gl_albums_free_data(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + gl_albums_free_cover_thumbs(data); + GL_FREEIF(ad->albuminfo.path); + return 0; +} + +int _gl_albums_reset_view(void *data, const char *uuid, const char *aul_type) +{ + GL_CHECK_VAL(aul_type, -1); + GL_CHECK_VAL(uuid, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + + if (!g_strcmp0(aul_type, GL_AUL_ALBUM) && + g_strcmp0(uuid, GL_ALBUM_UUID_DEFAULT)) { + gl_cluster *album = ad->albuminfo.current_album; + if (album && album->cluster && album->cluster->uuid) { + bool b_cur_album_exists = false; + if (!g_strcmp0(album->cluster->uuid, uuid)) { + int its_cnt = 0; + int ret = -1; + ret = _gl_data_get_item_cnt(ad, uuid, false, + album->cluster->type, + &its_cnt); + if (ret != 0 || its_cnt == 0) + gl_dbgE("Empty current album!"); + else + b_cur_album_exists = true; + } + + /* Current album exists and it's not empty */ + if (b_cur_album_exists) { + gl_dbg("Current album, update view"); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + gl_del_invalid_widgets(ad, GL_INVALID_NONE); + /* Set flag to update albums list */ + ad->albuminfo.update_albums_list = true; + _gl_thumbs_edit_pop_view(ad); + } else { + gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); + } + + return -1; + } + } + + __gl_albums_reset_view(ad); + } else { + __gl_albums_reset_view(ad); + + _gl_ctrl_sel_tabbar_item(ad, aul_type); + } + + return 0; +} + diff --git a/src/features/gl-tags-edit.c b/src/features/gl-tags-edit.c new file mode 100755 index 0000000..c1b9638 --- /dev/null +++ b/src/features/gl-tags-edit.c @@ -0,0 +1,301 @@ +/* + * Copyright (c) 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 "gl-tags.h" +#include "gl-tags-edit.h" +#include "gl-debug.h" +#include "gl-strings.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-icons.h" +#include "gl-controlbar.h" +#include "gl-ctxpopup.h" +#include "gl-button.h" +#include "gl-notify.h" +#include "gl-popup.h" + +/* +* delete selected tags from tags list view. +*/ +static int __gl_tags_edit_del(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *gtag = NULL; + int cnt = _gl_data_get_tags_selected_cnt(ad); + int i = 0; + gl_dbg(""); + + Eina_List *selected_list = ad->taginfo.selected_tags_elist; + if ((selected_list == NULL) || (cnt == 0)) { + gl_dbgE("tags selected list is empty!"); + return -1; + } + + gl_dbg("selected list length=%d", cnt); + for (i = 0; i < cnt; i++) { + gtag = eina_list_nth(selected_list, i); + if (gtag && gtag->tag) { + gl_dbg("tag name: %s", gtag->tag->tag_name); + _gl_local_data_delete_tag(gtag->tag); + } + } + + /* update the tags view */ + _gl_tags_edit_pop_view(ad); + /* add notification */ + _gl_notify_create_notiinfo(ad, GL_STR_DELETED); + return 0; +} + +static void __gl_tags_edit_trans_finished_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbgW("view_mode: %d", view_mode); + evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, + __gl_tags_edit_trans_finished_cb); + + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_TAGS_EDIT) + elm_genlist_clear(ad->taginfo.tags_view); + else + gl_dbgE("Wrong view mode!"); +} + +static void __gl_tags_edit_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Disable item when it is clicked to prevent it is called for many times */ + if (_gl_tags_edit_pop_view(data) == 0) + _gl_ui_disable_btn(obj); +} + +static void __gl_tags_edit_del_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + int view_mode = gl_get_view_mode(data); + gl_dbg(""); + + if (view_mode == GL_VIEW_TAGS_EDIT) { + if (_gl_data_get_tags_selected_cnt(data) == 0) { + gl_dbg("No tags selected, return!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_TAGS_SELECTED); + return; + } + + __gl_tags_edit_del(data); + } else { + gl_dbgE("Unkonw mode!"); + } +} + +static void __gl_tags_edit_share_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_TAGS_EDIT) { + if (_gl_data_get_tags_selected_cnt(ad) == 0) { + gl_dbg("No tags selected, return!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_TAGS_SELECTED); + return; + } + /* Check tags are empty */ + if (_gl_data_is_tags_selected_empty(ad)) { + gl_dbg("No thumbs selected, return!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + } else { + gl_dbgE("Unknow mode!"); + return; + } + + _gl_ctxpopup_create_share(data, obj); +} + +/** + * Use naviframe api to push tags eidt view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_tags_edit_push_view(void *data, Evas_Object *parent, + Evas_Object *obj) +{ + gl_dbg("GL_NAVI_TAGS_EDIT"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, + __gl_tags_edit_trans_finished_cb, ad); + Evas_Object *end_btn = NULL; + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_tags_edit_cancel_cb, ad); + GL_CHECK_VAL(end_btn, -1); + /* Push to stack */ + nf_it = elm_naviframe_item_push(parent, NULL, end_btn, NULL, obj, + GL_NF_ANI_TABBAR); + elm_naviframe_item_title_visible_set(nf_it, EINA_FALSE); + ad->ctrlinfo.nf_it_edit = nf_it; + + Evas_Object *btn = NULL; + /* Delete */ + btn = _gl_but_create_but(parent, NULL, GL_STR_DELETE, + GL_BUTTON_STYLE_NAVI_TOOLBAR_RIGHT, + __gl_tags_edit_del_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN2, btn); + _gl_ui_disable_btn(btn); + /* Share */ + btn = _gl_but_create_but(parent, NULL, GL_STR_SHARE, + GL_BUTTON_STYLE_NAVI_TOOLBAR_LEFT, + __gl_tags_edit_share_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, btn); + _gl_ui_disable_btn(btn); + + return 0; +} + +int _gl_tags_edit_create_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *layout = NULL; + Evas_Object *view = NULL; + + gl_set_view_mode(data, GL_VIEW_TAGS_EDIT); + + layout = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(layout, -1); + + view = gl_tag_create_view(ad, layout); + if (view == NULL) { + gl_dbgE("Failed to create tags edit view!"); + evas_object_del(layout); + return -1; + } + + evas_object_show(view); + elm_object_part_content_set(layout, "elm.swallow.view", view); + edje_object_signal_emit(_EDJ(layout), GL_SIGNAL_VIEW_EDIT, "elm"); + + ad->ctrlinfo.ctrlbar_edit_ly = layout; + ad->ctrlinfo.ctrlbar_edit_view = view; + + gl_ui_show_selall(ad); + __gl_tags_edit_push_view(ad, ad->maininfo.naviframe, layout); + return 0; +} + +int _gl_tags_edit_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + + elm_naviframe_item_pop(ad->maininfo.naviframe); + + gl_tag_unset_rename(data); + _gl_destroy_ctrl_edit_view(data); + + /* Set current gtag NULL for rename */ + ad->taginfo.current_tag = NULL; + _gl_data_finalize_tags_selected_list(data); + + gl_set_view_mode(data, GL_VIEW_TAGS); + gl_tag_update_view(data); + + if (_gl_data_get_tag_count_all(data) <= 1) { + _gl_ctrl_disable_btn(data, true, GL_NAVI_TAGS); + } + _gl_notify_destroy_selinfo(data); + return 0; +} + +/* Share tag's content */ +int _gl_tags_edit_share(void *data, const char *label) +{ + GL_CHECK_VAL(label, -1); + GL_CHECK_VAL(data, -1); + gl_dbg("label : %s ", label); + + int cnt = _gl_data_get_tags_selected_cnt(data); + gl_dbg("Selected tag(s) count: %d.", cnt); + if (cnt < 1) { + gl_dbgE("None tag selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_TAGS_SELECTED); + return -1; + } + if (_gl_data_is_tags_selected_empty(data)) { + gl_dbgE("None thumb selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return -1; + } + + return _gl_share_load(data, label); +} + +int _gl_tags_edit_update_lang(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.nf_it_edit, -1); + + /*Reset select info text*/ + int cnt = _gl_data_get_tags_selected_cnt(ad); + _gl_notify_update_lang(ad, cnt, GL_VIEW_TAGS_EDIT); + + if (ad->popupinfo.popup) { + if (ad->popupinfo.popup_mode == GL_POPUP_NOBUT) + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + else if (ad->popupinfo.popup_mode == GL_POPUP_NOBUT) + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_TAGS_SELECTED); + } + + _gl_ui_set_btns_text(ad->ctrlinfo.nf_it_edit, GL_STR_SHARE, + GL_STR_DELETE); + return 0; +} + diff --git a/src/features/gl-tags-new.c b/src/features/gl-tags-new.c new file mode 100755 index 0000000..b381d57 --- /dev/null +++ b/src/features/gl-tags-new.c @@ -0,0 +1,204 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-tags-new.h" +#include "gl-tags.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-controlbar.h" +#include "gl-editfield.h" +#include "gl-button.h" +#include "gl-strings.h" + +static void __gl_tags_new_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", __gl_tags_new_cancel_cb); + _gl_tags_new_pop_view(data); +} + +static void __gl_tags_new_done_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times */ + if (_gl_tags_new_process(data, false) == 0) + evas_object_smart_callback_del(obj, "clicked", + __gl_tags_new_done_cb); +} + +/** + * Use naviframe api to push new tag view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_tags_new_push_view(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_TAGS_NEW"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + Evas_Object *done_btn = NULL; + Evas_Object *cancel_btn = NULL; + Evas_Object *end_btn = NULL; + + if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS) + _gl_ctrl_show_tabbar(ad, false); + + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_tags_new_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, + NULL); + ad->entryinfo.nf_it = nf_it; + /* Add 'Cancel' button */ + cancel_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_tags_new_cancel_cb, data); + GL_CHECK_VAL(cancel_btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_PREV_BTN, + cancel_btn); + /* Add 'Done' button */ + done_btn = _gl_but_create_but(parent, NULL, GL_STR_DONE, + GL_BUTTON_STYLE_NAVI_TOOLBAR, + __gl_tags_new_done_cb, data); + GL_CHECK_VAL(done_btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, done_btn); + ad->entryinfo.done_btn = done_btn; + + /* Add callbacks to show/hide title toolbar */ + _gl_ui_add_conform_cbs(parent); + return 0; +} + +/* +* create a new tag +*/ +int _gl_tags_new_create_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *editfield_ly = NULL; + gl_dbg(""); + + ad->entryinfo.entry_mode = GL_ENTRY_NEW_TAG; + + editfield_ly = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(editfield_ly, -1); + Evas_Object *entry = _gl_editfield_create(ad, editfield_ly, NULL); + if (entry == NULL) { + gl_dbgE("Failed to add entry!"); + ad->entryinfo.entry_mode = GL_ENTRY_NONE; + evas_object_del(entry); + return -1; + } + elm_object_part_content_set(editfield_ly, "elm.swallow.view", entry); + edje_object_signal_emit(_EDJ(editfield_ly), GL_SIGNAL_VIEW_DEFAULT, + "elm"); + __gl_tags_new_push_view(ad, ad->maininfo.naviframe, editfield_ly, + GL_STR_CREATE_TAG); + _gl_editfield_show_imf(ad); + return 0; +} + +/* +* cancel adding a new tag. +*/ +int _gl_tags_new_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + int view_m = gl_get_view_mode(ad); + /* in tags list view case */ + if (view_m == GL_VIEW_TAGS) { + /* Hide title from animation */ + gl_ui_set_navi_title_visible(ad, EINA_FALSE); + elm_naviframe_item_pop(ad->maininfo.naviframe); + _gl_editfield_destroy_imf(ad); + /* Rotate bottom toolbar+tabbar */ + gl_ctrl_rotate_ctrlbar(ad, GL_VIEW_TAGS); + /* Recover the previous UI */ + gl_tag_update_view(ad); + } else { + elm_naviframe_item_pop(ad->maininfo.naviframe); + _gl_editfield_destroy_imf(ad); + gl_ui_update_select_widgets(ad); + } + return 0; +} + +/* +* After adding a new tag, then move selected items to this newly created tag. +* +* @param b_enter +* True: Enter key on Keyboard pressed, False: Button Done clicked +*/ +int _gl_tags_new_process(void *data, bool b_enter) +{ + gl_dbg("b_enter: %d", b_enter); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->entryinfo.editfield == NULL) { + gl_dbgE("Editfield is NULL!"); + goto NEW_TAG_FAILED; + } + + if (ad->entryinfo.imf_context) + ecore_imf_context_input_panel_hide(ad->entryinfo.imf_context); + + Evas_Object *entry = ad->entryinfo.imf_entry; + char tname[GL_ARRAY_LEN_MAX] = { 0, }; + + /* Get utf8 format string */ + if (gl_get_entry_text(entry, tname, GL_ARRAY_LEN_MAX) != 0) { + gl_dbgE("Get entry text failed!"); + goto NEW_TAG_FAILED; + } + + /* Get valid name */ + if (_gl_get_valid_tag_name(ad, tname, true, b_enter) != 0) { + if (b_enter) + _gl_editfield_hide_imf(ad); + return -1; + } + gl_dbg("Valid tag name: %s", tname); + + _gl_editfield_destroy_imf(ad); + /* Add selected items to new tag */ + gl_add_to_tag(ad, tname); + return 0; + + NEW_TAG_FAILED: + _gl_tags_new_pop_view(ad); + return -1; +} + diff --git a/src/features/gl-tags-rename.c b/src/features/gl-tags-rename.c new file mode 100755 index 0000000..d55f960 --- /dev/null +++ b/src/features/gl-tags-rename.c @@ -0,0 +1,202 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-tags-rename.h" +#include "gl-tags.h" +#include "gl-tags-new.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-controlbar.h" +#include "gl-editfield.h" +#include "gl-button.h" +#include "gl-popup.h" +#include "gl-strings.h" + +static void __gl_tags_rename_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + __gl_tags_rename_cancel_cb); + + _gl_tags_new_pop_view(data); +} + +static void __gl_tags_rename_done_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Delete callback when it is clicked to prevent it is called for many times */ + if (_gl_tags_rename_process(data) == 0) + evas_object_smart_callback_del(obj, "clicked", + __gl_tags_rename_done_cb); +} + +/** + * Use naviframe api to push new tag view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_tags_rename_push_view(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_TAGS_NEW"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + Evas_Object *done_btn = NULL; + Evas_Object *cancel_btn = NULL; + Evas_Object *end_btn = NULL; + + if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS) + _gl_ctrl_show_tabbar(ad, false); + + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_tags_rename_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, + NULL); + ad->entryinfo.nf_it = nf_it; + /* Add 'Cancel' button */ + cancel_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_tags_rename_cancel_cb, data); + GL_CHECK_VAL(cancel_btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_PREV_BTN, + cancel_btn); + /* Add 'Done' button */ + done_btn = _gl_but_create_but(parent, NULL, GL_STR_DONE, + GL_BUTTON_STYLE_NAVI_TITLE, + __gl_tags_rename_done_cb, data); + GL_CHECK_VAL(done_btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, done_btn); + ad->entryinfo.done_btn = done_btn; + + /* Add callbacks to show/hide title toolbar */ + _gl_ui_add_conform_cbs(parent); + return 0; +} + +int _gl_tags_rename_create_view(void *data, gl_tag *gtag) +{ + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *editfield_ly = NULL; + gl_dbg(""); + + ad->entryinfo.entry_mode = GL_ENTRY_RENAME_TAG; + + editfield_ly = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(editfield_ly, -1); + Evas_Object *entry = _gl_editfield_create(ad, editfield_ly, + gtag->tag->tag_name); + if (entry == NULL) { + gl_dbgE("Failed to add entry!"); + ad->entryinfo.entry_mode = GL_ENTRY_NONE; + evas_object_del(editfield_ly); + return -1; + } + elm_object_part_content_set(editfield_ly, "elm.swallow.view", entry); + edje_object_signal_emit(_EDJ(editfield_ly), GL_SIGNAL_VIEW_DEFAULT, + "elm"); + __gl_tags_rename_push_view(ad, ad->maininfo.naviframe, editfield_ly, + GL_STR_RENAME_TAG); + _gl_editfield_show_imf(ad); + return 0; +} + +int _gl_tags_rename_process(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *gtag = ad->taginfo.current_tag; + char tname[GL_ARRAY_LEN_MAX] = { 0, }; + int ret = 0; + + if (gtag == NULL || gtag->item == NULL || gtag->tag->tag_name == NULL) { + gl_dbgE("Invalid gatag!"); + ret = -1; + goto INVALID_TAG_NAME; + } + /* Get utf8 format string */ + ret = gl_get_entry_text(ad->entryinfo.imf_entry, tname, + GL_ARRAY_LEN_MAX); + if (ret != 0) { + gl_dbgE("Get entry text failed!"); + ret = -1; + goto INVALID_TAG_NAME; + } + + /* Get valid name */ + if (_gl_get_valid_tag_name(ad, tname, false, true) != 0){ + ret = -1; + goto INVALID_TAG_NAME; + } + gl_dbg("Valid tag name: %s", tname); + + if (g_strcmp0(gtag->tag->tag_name, tname)) { + /* Check whether the new tag same as other tag */ + bool res = _gl_data_is_in_tag_list(ad, tname); + if (res) { + gl_popup_create_popup(ad, GL_POPUP_TAG_RENAME_DUPLICATE, + GL_STR_SAME_NAME_ALREADY_IN_USE); + gl_dbgW("New tag already exists!"); + ret = -1; + goto INVALID_TAG_NAME; + } + + /* Rename tag in libmedia-info */ + media_tag_set_name(gtag->tag->tag_h, tname); + media_tag_update_to_db(gtag->tag->tag_h); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Update tag to DB failed[%d]!", ret); + ret = -1; + goto INVALID_TAG_NAME; + } + gl_dbg("Rename tag %s to %s", gtag->tag->tag_name, tname); + /* Update tag name in memory */ + GL_FREEIF(gtag->tag->tag_name); + gtag->tag->tag_name = strdup(tname); + } else { + gl_dbgW("Same as current name!"); + } + + INVALID_TAG_NAME: + + if (ad->entryinfo.nf_it) { + _gl_tags_new_pop_view(ad); + ad->taginfo.current_tag = NULL; + } else { + /* Unset rename mode */ + gl_tag_unset_rename(ad); + } + _gl_editfield_destroy_imf(ad); + + return ret; +} + diff --git a/src/features/gl-tags.c b/src/features/gl-tags.c new file mode 100755 index 0000000..b991bf2 --- /dev/null +++ b/src/features/gl-tags.c @@ -0,0 +1,1000 @@ +/* + * Copyright (c) 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 "gl-tags.h" +#include "gl-tags-edit.h" +#include "gl-tags-new.h" +#include "gl-tags-rename.h" +#include "gl-debug.h" +#include "gl-thumbs.h" +#include "gl-thumbs-edit.h" +#include "gl-controlbar.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-popup.h" +#include "gl-button.h" +#include "gl-data.h" +#include "gl-ext-ug-load.h" +#include "gl-ext-exec.h" +#include "gl-notify.h" +#include "gl-ctxpopup.h" +#include "gl-editfield.h" +#include "gl-strings.h" +#include "gl-icons.h" + +/* 112 -2x2 */ +#define GL_TAG_ICON_SIZE 108 + +#define GL_GENLIST_ITEM_STYLE_TAGS "tags_list" +#define GL_GENLIST_ITEM_STYLE_TAGS_EDIT "tags_list_edit" + +static char *__gl_tag_get_text(void *data, Evas_Object *obj, const char *part) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(part); + GL_CHECK_NULL(data); + gl_tag *gtag = (gl_tag *) data; + GL_CHECK_NULL(gtag->tag); + GL_CHECK_NULL(gtag->tag->tag_name); + char buf[GL_ARRAY_LEN_MAX] = { 0, }; + + if (!g_strcmp0(part, "elm.text.title") || + !g_strcmp0(part, "elm.slide.text.1")) { + return strdup(gtag->tag->tag_name); + } else if (!g_strcmp0(part, "elm.text.tag_count")) { + snprintf(buf, sizeof(buf), "%d", (int)(gtag->tag->count)); + return strdup(buf); + } + return NULL; +} + +static void __gl_tag_rename1_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_tag *gtag = (gl_tag *) data; + GL_CHECK(gtag->ad); + gl_appdata *ad = (gl_appdata *)gtag->ad; + gl_dbg(""); + + gl_tag_unset_rename(ad); + + if (gl_get_view_mode(ad) == GL_VIEW_TAGS) { + /* Mode item */ + Elm_Object_Item *it = NULL; + it = (Elm_Object_Item *)elm_genlist_decorated_item_get(ad->taginfo.tags_view); + /* Finish genlist sweep*/ + if (it) { + elm_genlist_item_decorate_mode_set(it, "slide", EINA_FALSE); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DEFAULT); + } + } + + if (gtag && gtag->item) { + gl_dbg("Valid tag item."); + /* Disable buttons in toolbar */ + if (gl_get_view_mode(ad) == GL_VIEW_TAGS) + _gl_ctrl_disable_btns(ad, ad->ctrlinfo.nf_it, true); + + elm_genlist_item_flip_set(gtag->item, EINA_TRUE); + /* Set current gtag for rename */ + ad->taginfo.rename_item = gtag->item; + ad->taginfo.current_tag = gtag; + } else { + gl_dbgE("Invalid tag item."); + } +} + +static void __gl_tag_rename2_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_tag *gtag = (gl_tag *)data; + GL_CHECK(gtag->ad); + gl_appdata *ad = (gl_appdata *)gtag->ad; + gl_dbg(""); + ad->taginfo.current_tag = gtag; + _gl_tags_rename_create_view(gtag->ad, gtag); +} + +static void _gl_tag_check_changed(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_tag *gtag = (gl_tag *) data; + GL_CHECK(gtag->ad); + gl_appdata *ad = (gl_appdata *)gtag->ad; + int view_mode = gl_get_view_mode(ad); + gl_dbg(""); + + if (view_mode != GL_VIEW_TAGS_EDIT) { + gl_dbg("ViewMode.%d. now return.", view_mode); + return; + } else { + gl_dbg("Edit Mode"); + } + + gl_tag_unset_rename(ad); + + int cnt = 0; + Eina_Bool checked = elm_check_state_get(obj);; + + gtag->checked = checked; + if (checked) { + gl_dbg("Append:%s", gtag->tag->tag_name); + _gl_data_tags_selected_list_append(ad, gtag); + } else { + gl_dbg("Remove:%s", gtag->tag->tag_name); + _gl_data_tags_selected_list_remove(ad, gtag); + } + + cnt = _gl_data_get_tags_selected_cnt(ad); + + /* Display selectioninfo */ + _gl_notify_create_selinfo(ad, ad->ctrlinfo.ctrlbar_edit_ly, + ad->ctrlinfo.nf_it_edit, ad->taginfo.tags_cnt, + cnt, false); +} + +static void __gl_tag_flick_left_cb(void *data, Evas_Object *obj, void *event_info) +{ + elm_object_scroll_freeze_push(obj); +} + +static void __gl_tag_flick_right_cb(void *data, Evas_Object *obj, void *event_info) +{ + elm_object_scroll_freeze_push(obj); +} + +static void __gl_tag_flick_stop_cb(void *data, Evas_Object *obj, void *event_info) +{ + elm_object_scroll_freeze_pop(obj); +} + +static void __gl_tag_set_sweep(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg(""); + GL_CHECK(obj); + GL_CHECK(event_info); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *gtag = (gl_tag *)elm_object_item_data_get(event_info); + GL_CHECK(gtag); + GL_CHECK(gtag->tag); + if (gtag->tag->_id == GL_TAG_FAVORITES_ID) { + gl_dbgW("Favourites item"); + return; + } + /* Disable sweep if in wrong view mode */ + if (gl_get_view_mode(ad) != GL_VIEW_TAGS) { + gl_dbgE("Wrong view mode!"); + return; + } + if (elm_genlist_item_flip_get(event_info)) { + gl_dbgW("In flip mode!"); + return; + } + /* Unset rename item first */ + if (ad->taginfo.rename_item) { + gl_dbg("Reset previous rename item first."); + gl_tag_unset_rename(ad); + } + /* Finish other swept item */ + Elm_Object_Item *it = NULL; + it = (Elm_Object_Item *)elm_genlist_decorated_item_get(obj); + if (it && it != event_info) { + gl_dbg("Reset previous swept item first."); + elm_genlist_item_decorate_mode_set(it, "slide", EINA_FALSE); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DEFAULT); + } + /* Start genlist sweep */ + elm_genlist_item_decorate_mode_set(event_info, "slide", EINA_TRUE); + elm_genlist_item_select_mode_set(event_info, ELM_OBJECT_SELECT_MODE_NONE); +} + +static void __gl_tag_unset_sweep(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg(""); + GL_CHECK(obj); + GL_CHECK(event_info); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_tag *gtag = (gl_tag *)elm_object_item_data_get(event_info); + GL_CHECK(gtag); + GL_CHECK(gtag->tag); + if (gtag->tag->_id == GL_TAG_FAVORITES_ID) { + gl_dbgW("Favourites item"); + return; + } + /* Disable sweep if in wrong view mode */ + if (gl_get_view_mode(ad) != GL_VIEW_TAGS) { + gl_dbgE("Wrong view mode!"); + return; + } + if (elm_genlist_item_flip_get(event_info)) { + gl_dbgW("In flip mode!"); + return; + } + /* Finish genlist sweep */ + elm_genlist_item_decorate_mode_set(event_info, "slide", EINA_FALSE); + elm_genlist_item_select_mode_set(event_info, ELM_OBJECT_SELECT_MODE_DEFAULT); +} + +static void __gl_tag_cancel_sweep(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg(""); + GL_CHECK(obj); + /* Get sweeped item */ + Elm_Object_Item *it = NULL; + it = (Elm_Object_Item *)elm_genlist_decorated_item_get(obj); + /* Finish genlist sweep */ + if (it) { + elm_genlist_item_decorate_mode_set(it, "slide", EINA_FALSE); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DEFAULT); + } +} + +static void __gl_tag_del_cb(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg(""); + GL_CHECK(data); + gl_tag *gtag = (gl_tag *) data; + GL_CHECK(gtag->ad); + gl_appdata *ad = (gl_appdata *)gtag->ad; + + if (gl_get_view_mode(ad) == GL_VIEW_TAGS) { + gl_popup_create_tag_del_popup(gtag); + return; + } +} + +static Evas_Object *__gl_tag_get_content(void *data, Evas_Object *obj, const char *part) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(part); + GL_CHECK_NULL(data); + gl_tag *gtag = (gl_tag *) data; + GL_CHECK_NULL(gtag->tag); + GL_CHECK_NULL(gtag->tag->tag_name); + GL_CHECK_NULL(gtag->ad); + gl_appdata *ad = (gl_appdata *)gtag->ad; + //gl_dbg("[%s]", part); + //gl_dbg("gtag->tag == %p", gtag->tag); + + if (!g_strcmp0(part, "elm.swallow.checkbox")) { + Evas_Object *ck = NULL; + if (gl_get_view_mode(ad) == GL_VIEW_TAGS_EDIT) { + ck = elm_check_add(obj); + GL_CHECK_NULL(ck); + evas_object_propagate_events_set(ck, EINA_FALSE); + gtag->check_obj = ck; + elm_check_state_set(ck, gtag->checked); + + evas_object_smart_callback_add(ck, "changed", + _gl_tag_check_changed, + data); + evas_object_show(ck); + } + + return ck; + } else if (!g_strcmp0(part, "elm.icon") || !g_strcmp0(part, "elm.slide.icon")) { + /* + * _gl_tag_icon_get() will be invoked twice for each tag item while create list view. + * So return NULL to prevent duplicated setting tag cover at the first time. + * Cause it takes much time(about 200ms for tag containing 1000 items) to get data from DB. + * Only return right cover at the second time. + */ + if (gtag->cover_set == false && g_strcmp0(part, "elm.slide.icon")) { + //gl_dbg("Tag cover will be set next time."); + gtag->cover_set = true; + return NULL; + } + + char image_path[GL_FILE_PATH_LEN_MAX] = { 0, }; + gl_item *gl_tag_items[1]; + int item_count = 1; + + if (gtag->tag->_id == GL_TAG_FAVORITES_ID) { + /* + gl_tag_items[0] = NULL; + _gl_data_get_first_several_favor_items(ad, gl_tag_items, + &item_count, + MEDIA_CONTENT_ORDER_DESC); + if (gl_tag_items[0] && gl_tag_items[0]->item) { + g_strlcpy(image_path, + gl_tag_items[0]->item->thumb_url, + GL_FILE_PATH_LEN_MAX); + _gl_data_destroy_item(gl_tag_items[0]); + gl_tag_items[0] = NULL; + } else */{ + g_strlcpy(image_path, GL_TAG_FAVORITES_THUMB, + GL_FILE_PATH_LEN_MAX); + } + } else if (gtag->tag->count == 0) { + g_strlcpy(image_path, GL_DEFAULT_TAG_COVER, + GL_FILE_PATH_LEN_MAX); + } else { + gl_tag_items[0] = NULL; + _gl_data_get_first_several_tag_items(ad, + gtag->tag->_id, + gl_tag_items, + &item_count); + if (gl_tag_items[0] && gl_tag_items[0]->item) { + g_strlcpy(image_path, + gl_tag_items[0]->item->thumb_url, + GL_FILE_PATH_LEN_MAX); + _gl_data_destroy_item(gl_tag_items[0]); + gl_tag_items[0] = NULL; + } else { + g_strlcpy(image_path, GL_DEFAULT_TAG_COVER, + GL_FILE_PATH_LEN_MAX); + } + } + + Evas_Object *bg = elm_bg_add(obj); + GL_CHECK_NULL(bg); + elm_bg_load_size_set(bg, GL_TAG_ICON_SIZE, GL_TAG_ICON_SIZE); + elm_bg_file_set(bg, _GET_ICON(image_path), NULL); + evas_object_size_hint_max_set(bg, GL_TAG_ICON_SIZE, + GL_TAG_ICON_SIZE); + evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, + 1, 1); + 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); + return bg; + } else if (!g_strcmp0(part, "elm.swallow.rename")) { + Evas_Object *btn = NULL; + btn = _gl_but_create_but(obj, NULL, NULL, + GL_BUTTON_STYLE_RENAME, + __gl_tag_rename1_cb, data); + GL_CHECK_NULL(btn); + evas_object_propagate_events_set(btn, EINA_FALSE); + return btn; + } else if (!g_strcmp0(part, "elm.flip.content")) { + /* This is used when the flip mode is enabled. */ + Evas_Object *edit_f = NULL; + ad->entryinfo.entry_mode = GL_ENTRY_RENAME_TAG; + edit_f = _gl_editfield_create_genlist(ad, obj, + gtag->tag->tag_name); + return edit_f; + } else if (!g_strcmp0(part, "elm.slide.swallow.1")) { + Evas_Object *rename_btn = NULL; + rename_btn = _gl_but_create_but(obj, NULL, GL_STR_RENAME, + GL_BUTTON_STYLE_SWEEP, + __gl_tag_rename2_cb, gtag); + GL_CHECK_NULL(rename_btn); + return rename_btn; + } else if (!g_strcmp0(part, "elm.slide.swallow.2")) { + Evas_Object *del_btn = NULL; + del_btn = _gl_but_create_but(obj, NULL, GL_STR_DELETE, + GL_BUTTON_STYLE_SWEEP_DELETE, + __gl_tag_del_cb, data); + GL_CHECK_NULL(del_btn); + return del_btn; + } + + return NULL; +} + +static void +_gl_tag_list_sel(void *data, Evas_Object * obj, void *event_info) +{ + gl_dbg(""); +} + +/* +* back to tags list view +*/ +static void __gl_tags_comeback_from_view_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + __gl_tags_comeback_from_view_cb); + + /* Hide title from animation */ + gl_ui_set_navi_title_visible(ad, EINA_FALSE); + + /* Change to tags view */ + _gl_tag_comeback_from_view(data); + _gl_ctrl_disable_btn(ad, false, GL_NAVI_TAGS); +} + +/* +* after tag selected, show medias of this tag. +*/ +static int +_gl_tag_show_thumbs(void *data, gl_tag * gtag) +{ + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(gtag->tag, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (gl_get_view_mode(ad) != GL_VIEW_TAGS) + { + gl_dbg("EditMode.. now return."); + return -1; + } + + gl_dbg("current tag %s , id=%d", gtag->tag->tag_name, gtag->tag->_id); + + if (gtag->tag->_id == GL_TAG_FAVORITES_ID) // get favorites tag + _gl_data_get_item_list(ad, GL_CATEGORY_FAVORITES, NULL, + GL_GET_ALL_RECORDS, GL_GET_UNTIL_LAST_RECORD); + else // get normal tags + _gl_data_get_item_list_tagname(ad, gtag->tag->_id, true, NULL); + + /* Set current tag */ + ad->taginfo.current_tag = gtag; + + _gl_thumbs_create_view(ad, GL_NAVI_THUMBS, gtag->tag->tag_name, false, + __gl_tags_comeback_from_view_cb); + gl_dbg("done _gl_tag_show_thumbs"); + return 0; +} + +/* +* 1. Edit view mode, check checkbox if selected; +* 2. Normal view moce, show thumbnails view of selected tag. +*/ +static void _gl_tag_sel(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_tag *gtag = (gl_tag *) data; + GL_CHECK(gtag->ad); + gl_appdata *ad = (gl_appdata *)gtag->ad; + gl_dbg(""); + + Elm_Object_Item *gen_item = elm_genlist_selected_item_get(obj); + GL_CHECK(gen_item); + elm_genlist_item_selected_set(gen_item, EINA_FALSE); + if (elm_genlist_item_flip_get(gen_item)) + return; + + /* Save scroller position before clearing gengrid */ + _gl_ui_save_scroller_pos(obj); + if (ad->taginfo.rename_item) { + gl_tag_unset_rename(ad); + return; + } + + int cnt = 0; + int view_mode = gl_get_view_mode(ad); + gl_dbg("tag %s selected...", gtag->tag->tag_name); + + if (view_mode == GL_VIEW_TAGS_EDIT) { + gtag->checked = !gtag->checked; + elm_check_state_set(gtag->check_obj, gtag->checked); + + if (gtag->checked) { + gl_dbg("Append"); + _gl_data_tags_selected_list_append(ad, gtag); + } else { + gl_dbg("Remove"); + _gl_data_tags_selected_list_remove(ad, gtag); + } + + cnt = _gl_data_get_tags_selected_cnt(ad); + /* Display selectioninfo */ + _gl_notify_create_selinfo(ad, ad->ctrlinfo.ctrlbar_edit_ly, + ad->ctrlinfo.nf_it_edit, + ad->taginfo.tags_cnt, cnt, false); + } else { + _gl_tag_show_thumbs(ad, gtag); + } +} + +// _gl_tag_list_drag_cb is called when the item is dragged +static void +_gl_tag_list_drag_cb(void *data, Evas_Object * obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + + gl_tag_unset_rename(ad); +} + +static void _gl_tag_update_view(void *data, Evas_Object * obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *genlist = obj; + int item_cnt = 0; + Eina_List *tag_elist = NULL; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d.", view_mode); + + if (elm_genlist_items_count(genlist) > 0) { + /* Save scroller position before clearing gengrid */ + _gl_ui_save_scroller_pos(genlist); + /* Clear old view */ + elm_genlist_clear(genlist); + } + + if (view_mode == GL_VIEW_TAGS) { + ad->taginfo.taglic.item_style = GL_GENLIST_ITEM_STYLE_TAGS; + _gl_data_get_tag_list(ad, &tag_elist); + } else { + ad->taginfo.taglic.item_style = GL_GENLIST_ITEM_STYLE_TAGS_EDIT; + tag_elist = ad->taginfo.tags_elist; + } + + if (tag_elist == NULL) { + gl_dbgE("Invalid tag_elist!"); + } + + Eina_List *tmp_elist = NULL; + gl_tag *gtag = NULL; + Elm_Genlist_Item_Class *plic = NULL; + EINA_LIST_FOREACH(tag_elist, tmp_elist, gtag) { + if (gtag == NULL || gtag->tag == NULL) { + gl_dbgE("Invalid gtag!"); + continue; + } + + if (view_mode == GL_VIEW_TAGS_EDIT && + gtag->tag->_id == GL_TAG_FAVORITES_ID) { + gl_dbg("Favorites tag, skipping in edit mode"); + continue; + } else if (view_mode == GL_VIEW_TAGS_EDIT || + gtag->tag->_id == GL_TAG_FAVORITES_ID) { + plic = &(ad->taginfo.taglic); + } else { + plic = &(ad->taginfo.sweeplic); + } + + gl_dbg("===Append tag [%s]", gtag->tag->tag_name); + gtag->item = elm_genlist_item_append(genlist, plic, + (void *)gtag, NULL, + ELM_GENLIST_ITEM_NONE, + _gl_tag_sel, gtag); + item_cnt++; + } + + /* Restore previous position of scroller */ + _gl_ui_restore_scroller_pos(genlist); + ad->taginfo.tags_cnt = item_cnt; + evas_object_smart_callback_add(genlist, "selected", _gl_tag_list_sel, + NULL); +} + +static int __gl_tags_reset_view(void *data, bool is_tag) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(data); + gl_dbg("view_mode: %d", view_mode); + + /* Change to Tags view first */ + if (view_mode != GL_VIEW_TAGS && view_mode != GL_VIEW_TAGS_EDIT) { + gl_destroy_thumbs_view(data); + _gl_tag_comeback_from_view(data); + } else if (view_mode == GL_VIEW_TAGS && + ad->entryinfo.entry_mode == GL_ENTRY_NEW_TAG) { + gl_del_invalid_widgets(data, GL_INVALID_NEW_ENTRY); + } else if (view_mode == GL_VIEW_TAGS_EDIT) { + /* is_tag is false, clear edit would be done in view_change_cb of tabbar */ + if (is_tag) + _gl_tags_edit_pop_view(data); + } + + return 0; +} + +static void __gl_tags_edit_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->uginfo.ug_called_by_me || ad->gridinfo.grid_append_idler) { + /** + * Prevent changed to edit view in wrong way. + * 1. When invoke imageviewer UG; + * 2. First show thumbnails view, use idler to append other medias. + */ + gl_dbgW("UG invoked!"); + return; + } + _gl_ctxpopup_del(data); + + int view_mode = gl_get_view_mode(data); + gl_dbg("mode: %d", view_mode); + if (view_mode == GL_VIEW_TAGS) + _gl_tags_edit_create_view(data); + else + gl_dbgE("Wrong view mode!"); +} + +/* +* In tags list view, when tap "add tag button" in title bar, show UI for adding tag. +* Add a new tag to tags list. +*/ +static void _gl_tags_create_tag_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_dbg(""); + _gl_ctxpopup_del(data); + _gl_tags_new_create_view(data); +} + +static int __gl_tags_ctxpopup_append(void *data, Evas_Object *parent) +{ + gl_dbg(""); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Show edit item */ + if (!ad->taginfo.b_edit_disable) + elm_ctxpopup_item_append(parent, GL_STR_EDIT, NULL, + __gl_tags_edit_cb, data); + elm_ctxpopup_item_append(parent, GL_STR_CREATE_TAG, NULL, + _gl_tags_create_tag_cb, data); + return 0; +} + +static void __gl_tags_more_cb(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg("more button clicked"); + /* Add 'Edit' + 'Create tag' */ + GL_CHECK(data); + _gl_ctxpopup_create(data, obj, __gl_tags_ctxpopup_append); +} + +/** + * Launch camera + */ +static void __gl_tags_camera_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_dbg(""); + _gl_ext_load_camera(); +} + +int _gl_tags_add_btns(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + GL_CHECK_VAL(ad->ctrlinfo.nf_it, -1); + Evas_Object *parent = ad->maininfo.naviframe; + Elm_Object_Item *nf_it = ad->ctrlinfo.nf_it; + Evas_Object *btn = NULL; + + /* Remove btns */ + _gl_ui_clear_btns(data); + + /* More */ + btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_MORE, + __gl_tags_more_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_MORE, btn); + /* not only favorites tag */ + if (_gl_data_get_tag_count_all(ad) > 1) + ad->taginfo.b_edit_disable = false; + else + ad->taginfo.b_edit_disable = true; + /* Camera */ + btn = _gl_but_create_but(parent, NULL, GL_STR_CAMERA, + GL_BUTTON_STYLE_NAVI_TOOLBAR, + __gl_tags_camera_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, btn); + return 0; +} + +/* Unset rename mode if any item is in rename mode */ +int gl_tag_unset_rename(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + _gl_editfield_destroy_imf(ad); + + /* Enable buttons in toolbar */ + if (gl_get_view_mode(ad) == GL_VIEW_TAGS) + _gl_ctrl_disable_btns(ad, ad->ctrlinfo.nf_it, false); + + if (ad->taginfo.rename_item) + elm_genlist_item_flip_set(ad->taginfo.rename_item, EINA_FALSE); + + ad->taginfo.rename_item = NULL; + /* Set current gtag NULL for rename */ + ad->taginfo.current_tag = NULL; + + return 0; +} + +/* Free data after layout deleted */ +static void __gl_tags_delete_layout_cb(void *data, Evas *e, Evas_Object *obj, + void *ei) +{ + gl_dbg("Delete layout ---"); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + _gl_ui_del_scroller_pos(ad->taginfo.tags_view); + gl_dbg("Delete layout +++"); +} + +Evas_Object *gl_tag_create_view(void *data, Evas_Object *parent) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *genlist = NULL; + int item_cnt = 0; + int view_mode = gl_get_view_mode(ad); + gl_dbg(""); + + ad->taginfo.rename_item = NULL; + /* Set current gtag NULL for rename */ + ad->taginfo.current_tag = NULL; + + if (view_mode == GL_VIEW_TAGS_EDIT) { + ad->taginfo.taglic.item_style = GL_GENLIST_ITEM_STYLE_TAGS_EDIT; + } else { + ad->taginfo.taglic.item_style = GL_GENLIST_ITEM_STYLE_TAGS; + /* Sweep class */ + ad->taginfo.sweeplic.item_style = GL_GENLIST_ITEM_STYLE_TAGS; + ad->taginfo.sweeplic.decorate_item_style = GL_GENLIST_ITEM_STYLE_SWEEP2_TAG; + ad->taginfo.sweeplic.func.text_get = __gl_tag_get_text; + ad->taginfo.sweeplic.func.content_get = __gl_tag_get_content; + } + ad->taginfo.taglic.decorate_item_style = NULL; + ad->taginfo.taglic.decorate_all_item_style = NULL; + ad->taginfo.taglic.func.text_get = __gl_tag_get_text; + ad->taginfo.taglic.func.content_get = __gl_tag_get_content; + genlist = elm_genlist_add(parent); + elm_object_style_set(genlist, GL_GENLIST_STYLE_DEFAULT); + 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); + _gl_ui_reset_scroller_pos(genlist); + + Eina_List *tag_elist = NULL; + _gl_data_get_tag_list(ad, &tag_elist); + GL_CHECK_NULL(tag_elist); + + Eina_List *tmp_elist = NULL; + gl_tag *gtag = NULL; + Elm_Genlist_Item_Class *plic = NULL; + EINA_LIST_FOREACH(tag_elist, tmp_elist, gtag) { + if (!gtag || !gtag->tag) { + gl_dbgE("Invalid tag!"); + continue; + } + + if (view_mode == GL_VIEW_TAGS_EDIT && + gtag->tag->_id == GL_TAG_FAVORITES_ID) { + gl_dbg("Favorites tag, skipping in edit mode"); + continue; + } else if (view_mode == GL_VIEW_TAGS_EDIT || + gtag->tag->_id == GL_TAG_FAVORITES_ID) { + plic = &(ad->taginfo.taglic); + } else { + plic = &(ad->taginfo.sweeplic); + } + + gl_dbg("===Append tag [%s]", gtag->tag->tag_name); + gtag->item = elm_genlist_item_append(genlist, plic, + (void *)gtag, NULL, + ELM_GENLIST_ITEM_NONE, + _gl_tag_sel, gtag); + item_cnt++; + } + + ad->taginfo.tags_cnt = item_cnt; + if (view_mode == GL_VIEW_TAGS_EDIT) { + evas_object_smart_callback_add(genlist, "drag,start,up", + _gl_tag_list_drag_cb, ad); + evas_object_smart_callback_add(genlist, "drag,start,down", + _gl_tag_list_drag_cb, ad); + } else { + /* Stop flicking(up/down direction) when sweep list item*/ + evas_object_smart_callback_add(genlist, "drag,start,left", + __gl_tag_flick_left_cb, ad); + evas_object_smart_callback_add(genlist, "drag,start,right", + __gl_tag_flick_right_cb, ad); + evas_object_smart_callback_add(genlist, "drag,stop", + __gl_tag_flick_stop_cb, ad); + /* Add callback for sweeping */ + evas_object_smart_callback_add(genlist, "drag,start,right", + __gl_tag_set_sweep, ad); + evas_object_smart_callback_add(genlist, "drag,start,left", + __gl_tag_unset_sweep, ad); + evas_object_smart_callback_add(genlist, "drag,start,up", + __gl_tag_cancel_sweep, ad); + evas_object_smart_callback_add(genlist, "drag,start,down", + __gl_tag_cancel_sweep, ad); + } + + if (item_cnt > 0) + evas_object_smart_callback_add(genlist, "selected", + _gl_tag_list_sel, NULL); + else + gl_dbgE("Favorites tag would be displayed at least!"); + + /* Register delete callback */ + evas_object_event_callback_add(parent, EVAS_CALLBACK_DEL, + __gl_tags_delete_layout_cb, data); + + return genlist; +} + +int gl_tag_update_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + Evas_Object *view_obj = NULL; + gl_dbg("view_mode: %d.", view_mode); + + if (view_mode == GL_VIEW_TAGS) { + GL_CHECK_VAL(ad->taginfo.tags_view, -1); + view_obj = ad->taginfo.tags_view; + } else if (view_mode == GL_VIEW_TAGS_EDIT) { + GL_CHECK_VAL(ad->ctrlinfo.ctrlbar_edit_view, -1); + view_obj = ad->ctrlinfo.ctrlbar_edit_view; + } + + _gl_tag_update_view(ad, view_obj, NULL); + + return 0; +} + +/* +* back to tags list view +*/ +int _gl_tag_comeback_from_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + gl_ctrl_rotate_ctrlbar(ad, GL_VIEW_TAGS); + gl_set_view_mode(ad, GL_VIEW_TAGS); + ad->taginfo.current_tag = NULL; + gl_tag_update_view(ad); + + _gl_thumbs_delete_view(ad); + gl_dbg("done"); + return 0; +} + +bool _gl_tags_sel_home_tag(void *data, const char *tag_id) +{ + GL_CHECK_FALSE(data); + gl_tag *gtag = NULL; + gl_dbg(""); + + if (tag_id == NULL) { + gl_dbgE("Invalid parameters!"); + goto GL_TAGS_FAILED; + } + + /* Find selected tag */ + _gl_data_get_tag_by_id(data, atoi(tag_id), >ag); + if (gtag == NULL || gtag->tag == NULL || gtag->tag->tag_name == NULL) { + gl_dbgE("Tag doesn't exit!"); + goto GL_TAGS_FAILED; + } + _gl_tag_show_thumbs(data, gtag); + + return true; + + GL_TAGS_FAILED: + + gl_popup_create_popup(data, GL_POPUP_NOBUT_APPEXIT, + GL_STR_NO_TAGS); + /* Update tags view */ + gl_tag_update_view(data); + + return false; +} + +int _gl_tags_reset_view(void *data, const char *tag_id, const char *aul_type) +{ + GL_CHECK_VAL(aul_type, -1); + GL_CHECK_VAL(tag_id, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (!g_strcmp0(aul_type, GL_AUL_TAG)) { + gl_tag *gtag = ad->taginfo.current_tag; + if (gtag && gtag->tag && (gtag->tag->_id == atoi(tag_id))) { + gl_dbg("Current tag, update view"); + int view_mode = gl_get_view_mode(data); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + gl_del_invalid_widgets(data, GL_INVALID_NONE); + _gl_thumbs_edit_pop_view(data); + } else { + gl_update_view(data, GL_UPDATE_VIEW_NORMAL); + } + return -1; + } + + __gl_tags_reset_view(data, true); + } else { + __gl_tags_reset_view(data, false); + + _gl_ctrl_sel_tabbar_item(data, aul_type); + } + + return 0; +} + +const char *_gl_tags_get_current_tag_name(void *data) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_FALSE(ad->taginfo.current_tag); + GL_CHECK_FALSE(ad->taginfo.current_tag->tag); + GL_CHECK_FALSE(ad->taginfo.current_tag->tag->tag_name); + + return ad->taginfo.current_tag->tag->tag_name; +} + +/* Delete one tag item in normal view */ +int _gl_tags_del(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_tag *gtag = (gl_tag *)data; + GL_CHECK_VAL(gtag->ad, -1); + gl_appdata *ad = (gl_appdata *)gtag->ad; + GL_CHECK_VAL(ad->taginfo.tags_view, -1); + gl_dbg(""); + + /* Mode item */ + Elm_Object_Item *it = NULL; + it = (Elm_Object_Item *)elm_genlist_decorated_item_get(ad->taginfo.tags_view); + /* Finish genlist sweep*/ + if (it) { + elm_genlist_item_decorate_mode_set(it, "slide", EINA_FALSE); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_ALWAYS); + } + + GL_CHECK_VAL(gtag->item, -1); + elm_object_item_del(gtag->item); + /* Remove tag from list, destroy it and remove its record from DB */ + _gl_data_tags_list_remove(ad, gtag); + /* Disable edit item if only 'favourites' item exits */ + if (_gl_data_get_tag_count_all(ad) <= 1) { + _gl_ctrl_disable_btn(ad, true, GL_NAVI_TAGS); + } + /* Add notification */ + _gl_notify_create_notiinfo(ad, GL_STR_DELETED); + return 0; +} + +int _gl_tags_update_lang(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag_update_view(ad); + GL_CHECK_VAL(ad->ctrlinfo.nf_it, -1); + _gl_ui_set_btns_text(ad->ctrlinfo.nf_it, GL_STR_CAMERA, NULL); + return 0; +} + diff --git a/src/features/gl-thumbs-edit.c b/src/features/gl-thumbs-edit.c new file mode 100755 index 0000000..24faae3 --- /dev/null +++ b/src/features/gl-thumbs-edit.c @@ -0,0 +1,488 @@ +/* + * Copyright (c) 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 "gl-thumbs-edit.h" +#include "gl-thumbs.h" +#include "gl-debug.h" +#include "gl-strings.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-icons.h" +#include "gl-controlbar.h" +#include "gl-ctxpopup.h" +#include "gl-button.h" +#include "gl-notify.h" +#include "gl-popup.h" +#include "gl-lang.h" +#include "gl-ext-exec.h" +#include "gl-ext-ug-load.h" +#include "gl-fs.h" + +static void __gl_thumbs_edit_trans_finished_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbgW("view_mode: %d", view_mode); + evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, + __gl_thumbs_edit_trans_finished_cb); + + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_THUMBS_EDIT) { + if (ad->entryinfo.entry_mode != GL_ENTRY_NONE) + return; + elm_gengrid_clear(ad->gridinfo.all_grid_view); + } else { + gl_dbgE("Wrong view mode!"); + } +} + +/* callback after user tap Cancel button in option header in edit view */ +static void __gl_thumbs_edit_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + GL_CHECK(obj); + gl_dbg(""); + /* Disable item when it is clicked to prevent it is called for many times */ + if (_gl_thumbs_edit_pop_view(data) == 0) + _gl_ui_disable_btn(obj); +} + +static void __gl_thumbs_edit_share_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + + int view_mode = gl_get_view_mode(ad); + int cnt = 0; + if (view_mode == GL_VIEW_THUMBS_EDIT) { + cnt = _gl_data_selected_list_count(ad); + if (cnt == 0) { + gl_dbg("No thumbs selected, return!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + } else { + gl_dbgE("Unknow mode!"); + return; + } + + _gl_ctxpopup_create_share(data, obj); +} + +static void __gl_thumbs_edit_addtag_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + _gl_ctxpopup_del(data); + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + if (_gl_data_selected_list_count(ad) == 0) { + gl_dbg("No thumbs selected, return!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + } else { + gl_dbgW("Unknow mode!"); + return; + } + + _gl_ctxpopup_create_addtag(ad); +} + +/* move media to album in edit view */ +static void __gl_thumbs_edit_move_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + _gl_ctxpopup_del(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(data); + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + + if (view_mode == GL_VIEW_THUMBS_EDIT) { + if (_gl_data_selected_list_count(data) == 0) { + gl_dbgW("No thumbs selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + + _gl_ctxpopup_create_move(data); + } else { + gl_dbgE("Unknow mode!"); + } +} + +#ifdef _USE_ROTATE_BG +static void __gl_thumbs_edit_rotate_left_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + if (_gl_data_selected_list_count(data) == 0) { + gl_dbgW("No thumbs selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + _gl_ctxpopup_del(data); + _gl_rotate_images(data, true); +} + +static void __gl_thumbs_edit_rotate_right_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + if (_gl_data_selected_list_count(data) == 0) { + gl_dbgW("No thumbs selected!"); + gl_popup_create_popup(data, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + _gl_ctxpopup_del(data); + _gl_rotate_images(data, false); +} +#endif + +static int __gl_thumbs_edit_ctxpopup_append(void *data, Evas_Object *parent) +{ + gl_dbg(""); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->ctrlinfo.tab_mode != GL_CTRL_TAB_TAGS) { + elm_ctxpopup_item_append(parent, GL_STR_ADD_TAG, NULL, + __gl_thumbs_edit_addtag_cb, data); + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_ALBUMS) + elm_ctxpopup_item_append(parent, GL_STR_MOVE, NULL, + __gl_thumbs_edit_move_cb, + data); + } + + if (!ad->gridinfo.b_slideshow_disable) + elm_ctxpopup_item_append(parent, GL_STR_SLIDESHOW, NULL, + _gl_ui_slideshow_cb, data); + +#ifdef _USE_ROTATE_BG + if (ad->gridinfo.view_mode != GL_THUMB_VIDEOS) { + int share_m = gl_get_share_mode(ad); + if (share_m == GL_SHARE_IMAGE_ONE_JPEG || + share_m == GL_SHARE_IMAGE_MULTI_JPEG) { + gl_dbg("Enable more button"); + elm_ctxpopup_item_append(parent, GL_STR_ROTATE_LEFT, + NULL, + __gl_thumbs_edit_rotate_left_cb, + data); + elm_ctxpopup_item_append(parent, GL_STR_ROTATE_RIGHT, + NULL, + __gl_thumbs_edit_rotate_right_cb, + data); + } + } +#endif + return 0; +} + +static void __gl_thumbs_edit_more_cb(void *data, Evas_Object *obj, + void *event_info) +{ + gl_dbg("more button clicked"); + /* Add items */ + GL_CHECK(data); + _gl_ctxpopup_create(data, obj, __gl_thumbs_edit_ctxpopup_append); +} + +static void __gl_thumbs_edit_del_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + int cnt = _gl_data_selected_list_count(ad); + if (cnt == 0) + { + gl_dbgW("No thumbs selected!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, GL_STR_NO_FILES_SELECTED); + return; + } + + gl_del_medias(ad); + } else { + gl_dbgW("Unknow mode!"); + } +} + +static void __gl_thumbs_edit_remove_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + + if (_gl_data_selected_list_count(ad) == 0) { + gl_dbgW("No thumbs selected!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) + gl_remove_tag_items(data); + } else { + gl_dbgE("Unkonw mode!"); + } +} + +/** + * Use naviframe api to push thumbnails eidt view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_thumbs_edit_push_view(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_THUMBS_EDIT"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, + __gl_thumbs_edit_trans_finished_cb, + data); + Evas_Object *end_btn = NULL; + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_thumbs_edit_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + /* Push to stack */ + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, NULL); + ad->gridinfo.nf_it_edit = nf_it; + + return _gl_thumbs_edit_add_btns(data, parent, nf_it); +} + +int _gl_thumbs_edit_add_btns(void *data, Evas_Object *parent, + Elm_Object_Item *nf_it) +{ + GL_CHECK_VAL(nf_it, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *btn = NULL; + + /* Remove slideshow button */ + _gl_ui_disable_slideshow(ad, true); + + /* More */ + btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_MORE, + __gl_thumbs_edit_more_cb, + data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, + GL_NAVIFRAME_MORE, + btn); + _gl_ui_disable_btn(btn); + /* Delete */ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_ALBUMS) + btn = _gl_but_create_but(parent, NULL, GL_STR_DELETE, + GL_BUTTON_STYLE_NAVI_TOOLBAR_RIGHT, + __gl_thumbs_edit_del_cb, data); + else /* Remove */ + btn = _gl_but_create_but(parent, NULL, GL_STR_REMOVE, + GL_BUTTON_STYLE_NAVI_TOOLBAR_RIGHT, + __gl_thumbs_edit_remove_cb, + data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN2, btn); + _gl_ui_disable_btn(btn); + /* Share */ + btn = _gl_but_create_but(parent, NULL, GL_STR_SHARE, + GL_BUTTON_STYLE_NAVI_TOOLBAR_LEFT, + __gl_thumbs_edit_share_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, btn); + _gl_ui_disable_btn(btn); + + return 0; +} + +int _gl_thumbs_edit_create_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + if (ad->uginfo.ug_called_by_me || ad->gridinfo.grid_append_idler) { + /** + * Prevent changed to edit view in wrong way. + * 1. When invoke imageviewer UG; + * 2. First show thumbnails view, use idler to append other medias. + */ + gl_dbg("UG invoked or appending gridview."); + return -1; + } + _gl_ctxpopup_del(data); + + int view_mode = gl_get_view_mode(data); + gl_dbg("mode: %d", view_mode); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + /* Fixme: maybe we should disable edit button until grid append idler is done */ + /** + * Happen in quickly tap edit button, + * it will invoke edit_cb several time + * and push some unuseful views. + */ + gl_dbg("Already in edit mode, return."); + return -1; + } + + Evas_Object *layout = NULL; + layout = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(layout, -1); + 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); + ad->gridinfo.navi_content_edit_ly = layout; + + Evas_Object *view = NULL; + + gl_set_view_mode(ad, GL_VIEW_THUMBS_EDIT); + if (ad->gridinfo.view_mode == GL_THUMB_ALL) + view = _gl_thumbs_add_grid(ad, layout, GL_THUMB_ALL, + false); + else if (ad->gridinfo.view_mode == GL_THUMB_VIDEOS) + view = _gl_thumbs_add_grid(ad, layout, GL_THUMB_VIDEOS, + false); + else + view = _gl_thumbs_add_grid(ad, layout, GL_THUMB_IMAGES, + false); + + if (view == NULL) { + gl_dbgE("View creation failed!"); + evas_object_del(layout); + ad->gridinfo.navi_content_edit_ly = NULL; + return -1; + } + + ad->gridinfo.navi_content_edit_view = view; + + elm_object_part_content_set(layout, "elm.swallow.view", view); + __gl_thumbs_edit_push_view(ad, ad->maininfo.naviframe, layout, + GL_STR_SELECT_ITEM); + edje_object_signal_emit(_EDJ(layout), GL_SIGNAL_VIEW_EDIT, "elm"); + gl_ui_show_selall(ad); + gl_dbg("Done"); + return 0; +} + +int _gl_thumbs_edit_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + elm_naviframe_item_pop_to(ad->gridinfo.nf_it); + + _gl_destroy_thumbs_edit_view(data); + _gl_data_selected_list_finalize(data); + + gl_set_view_mode(data, GL_VIEW_THUMBS); + + if (ad->albuminfo.update_albums_list) { + /* + * Update albums list if MMC added/removed, + * or save web files to local album. + */ + ad->albuminfo.update_albums_list = false; + gl_refresh_albums_list(data); + } + + _gl_thumbs_show_view(data); + _gl_notify_destroy_selinfo(data); + return 0; +} + +int _gl_thumbs_edit_update_lang(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->gridinfo.nf_it_edit, -1); + + elm_object_item_text_set(ad->gridinfo.nf_it_edit, GL_STR_SELECT_ITEM); + + int cnt = _gl_data_selected_list_count(ad); + _gl_notify_update_lang(ad, cnt, GL_VIEW_THUMBS_EDIT); + + if (ad->popupinfo.popup){ + if (ad->popupinfo.popup_mode == GL_POPUP_NOBUT) + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + } + + if (ad->entryinfo.nf_it) { + if (GL_ENTRY_NEW_ALBUM == ad->entryinfo.entry_mode) + elm_object_item_text_set(ad->entryinfo.nf_it, + GL_STR_CREATE_ALBUM); + else if (GL_ENTRY_NEW_TAG == ad->entryinfo.entry_mode) + elm_object_item_text_set(ad->entryinfo.nf_it, + GL_STR_CREATE_TAG); + } + + _gl_lang_update_thumb_edit_button(ad, ad->gridinfo.nf_it_edit); + return 0; +} + diff --git a/src/features/gl-thumbs-sel.c b/src/features/gl-thumbs-sel.c new file mode 100755 index 0000000..9918bd7 --- /dev/null +++ b/src/features/gl-thumbs-sel.c @@ -0,0 +1,226 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-thumbs-sel.h" +#include "gl-albums-sel.h" +#include "gl-tags.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-controlbar.h" +#include "gl-button.h" +#include "gl-nocontents.h" +#include "gl-popup.h" +#include "gl-notify.h" +#include "gl-strings.h" +#include "gl-thumbs.h" + +static void __gl_thumbs_sel_trans_finished_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbgW("view_mode: %d", view_mode); + evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, + __gl_thumbs_sel_trans_finished_cb); + + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_THUMBS_SELECT) + elm_gengrid_clear(ad->albuminfo.select_view); + else + gl_dbgE("Wrong view mode!"); +} + +static void __gl_thumbs_sel_cancel_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_dbg(""); + /* Disable item when it is clicked to prevent it is called for many times */ + if (_gl_thumbs_sel_pop_view(data) == 0) + _gl_ui_disable_btn(obj); +} + +static void __gl_thumbs_sel_done_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + + /* Disable item when it is clicked to prevent it is called for many times */ + _gl_ui_disable_btn(obj); + + ad->albuminfo.current_album = NULL; + + GL_CHECK(ad->taginfo.current_tag); + gl_add_tag(data, ad->taginfo.current_tag); +} + +/** + * Use naviframe api to push thumbnails eidt view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_thumbs_sel_push_view(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_THUMBS_SELECT"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, + __gl_thumbs_sel_trans_finished_cb, data); + Evas_Object *end_btn = NULL; + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_thumbs_sel_cancel_cb, data); + GL_CHECK_VAL(end_btn, -1); + /* Push to stack */ + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, + NULL); + ad->gridinfo.nf_it_select = nf_it; + + /* Done */ + Evas_Object *btn = NULL; + btn = _gl_but_create_but(parent, NULL, GL_STR_DONE, + GL_BUTTON_STYLE_NAVI_TOOLBAR, + __gl_thumbs_sel_done_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, btn); + _gl_ui_disable_btn(btn); + return 0; +} + +/* Free data after layout deleted */ +static void __gl_thumbs_sel_delete_layout_cb(void *data, Evas *e, + Evas_Object *obj, void *ei) +{ + gl_dbg("Delete layout ---"); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + _gl_ui_del_scroller_pos(ad->gridinfo.select_view); + gl_dbg("Delete layout +++"); +} + +/** + * Album selected for adding tags to photo + */ +int _gl_thumbs_sel_create_view(void *data, gl_cluster *album_item) +{ + GL_CHECK_VAL(album_item, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Get items list without current tag */ + _gl_data_get_item_list_without_tag(data, album_item, + _gl_tags_get_current_tag_name(ad), + GL_GET_ALL_RECORDS, + GL_GET_ALL_RECORDS); + + if (ad->maininfo.medias_cnt <= 0) { + gl_dbgW("All medias are tagged!"); + /* Add notification */ + _gl_notify_create_notiinfo(data, GL_STR_ADDED); + return -1; + } + + Evas_Object *layout = NULL; + /* Add layout */ + layout = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(layout, -1); + 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); + /* Register delete callback */ + evas_object_event_callback_add(layout, EVAS_CALLBACK_DEL, + __gl_thumbs_sel_delete_layout_cb, data); + /* Save view mode */ + int pre_view_m = gl_get_view_mode(data); + /* Set new view mode */ + gl_set_view_mode(data, GL_VIEW_THUMBS_SELECT); + /* Save grid view mode */ + int gridview_m = ad->gridinfo.view_mode; + /* Add view */ + Evas_Object *view = NULL; + view = _gl_thumbs_add_grid(data, layout, GL_THUMB_ALL, false); + /* Restore grid view mode */ + if (gridview_m != GL_THUMB_ALL) + ad->gridinfo.view_mode = gridview_m; + if (view == NULL) { + evas_object_del(layout); + gl_popup_create_popup(data, GL_POPUP_NOBUT, GL_STR_NO_ALBUMS); + /* Reset view mode */ + gl_set_view_mode(data, pre_view_m); + return -1; + } + + /* Set view to layout */ + elm_object_part_content_set(layout, "elm.swallow.view", view); + /* Push view to naviframe */ + __gl_thumbs_sel_push_view(data, ad->maininfo.naviframe, layout, + GL_STR_SELECT_ITEM); + edje_object_signal_emit(_EDJ(layout), GL_SIGNAL_VIEW_EDIT, "elm"); + ad->gridinfo.select_view = view; + ad->gridinfo.select_view_ly = layout; + + ad->albuminfo.current_album = album_item; + + /* Show select all widget */ + gl_ui_show_selall(ad); + gl_dbg("Done"); + return 0; +} + +int _gl_thumbs_sel_pop_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + ad->albuminfo.current_album = NULL; + /* Clear selected list */ + _gl_data_selected_list_finalize(data); + _gl_thumbs_clear_cbs(ad->gridinfo.select_view); + ad->gridinfo.select_view= NULL; + ad->gridinfo.select_view_ly= NULL; + /* Pop naviframe item*/ + elm_naviframe_item_pop(ad->maininfo.naviframe); + /* Reset view mode */ + gl_set_view_mode(data, GL_VIEW_ALBUMS_SELECT); + /* Update view */ + _gl_albums_sel_update_view(data); + return 0; +} + +int _gl_thumbs_sel_update_lang(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->gridinfo.nf_it_select, -1); + gl_dbg(""); + elm_object_item_text_set(ad->gridinfo.nf_it_select, + GL_STR_SELECT_ITEM); + int sel_cnt = _gl_data_selected_list_count(ad); + _gl_notify_update_lang(ad, sel_cnt, GL_VIEW_THUMBS_SELECT); + _gl_ui_set_btns_text(ad->gridinfo.nf_it_select, GL_STR_DONE, NULL); + return 0; +} + diff --git a/src/features/gl-thumbs.c b/src/features/gl-thumbs.c new file mode 100755 index 0000000..76e1107 --- /dev/null +++ b/src/features/gl-thumbs.c @@ -0,0 +1,921 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-thumbs.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-drm.h" +#include "gl-albums.h" +#include "gl-data.h" +#include "gl-ext-ug-load.h" +#include "gl-ext-exec.h" +#include "gl-controlbar.h" +#include "gl-nocontents.h" +#include "gl-notify.h" +#include "gl-strings.h" +#include "gl-icons.h" +#include "gl-thumb.h" +#ifdef _USE_ROTATE_BG +#include "gl-exif.h" +#endif + +/* Icon swallowed to part "elm.swallow.icon" */ +#define GL_GRID_TOUCH_RANGE 20 +typedef struct _gl_thumb_data_t gl_thumb_data_s; + +struct _gl_thumb_data_t{ + void *ad; + gl_item *item; +}; + +static void __gl_thumbs_open_file(void *data) +{ + gl_dbg(""); + GL_CHECK(data); + gl_item *gitem = (gl_item *)data; + GL_CHECK(gitem->item); + GL_CHECK(gitem->item->file_url); + GL_CHECK(strlen(gitem->item->file_url)); + GL_CHECK(gitem->ad); + gl_appdata *ad = (gl_appdata *)gitem->ad; + int view_mode = gl_get_view_mode(ad); + if (view_mode != GL_VIEW_THUMBS) { + gl_dbgE("Error view mode!"); + return; + } + + if (ad->gridinfo.view_mode == GL_THUMB_VIDEOS) { + gl_dbg("Loading VIDEO-PLAYER"); + gl_ext_exec(gitem, GL_APP_VIDEOPLAYER); + } else { + gl_dbg("Loading UG-IMAGE(VIDEO)-VIEWER"); + gl_ext_load_iv_ug(ad, gitem, GL_UG_IV); + } +} + +static void __gl_thumbs_sel_cb(void *data, Evas_Object *obj, void *event_info) +{ + _gl_ui_save_scroller_pos(obj); + __gl_thumbs_open_file(data); +} + +static void __gl_thumbs_longpressed(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(event_info); + void *it_data = elm_object_item_data_get(event_info); + GL_CHECK(it_data); + gl_dbg(""); + if (gl_get_view_mode(data) == GL_VIEW_THUMBS) + __gl_thumbs_open_file(it_data); +} + +static void __gl_thumbs_check_changed(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_item *gitem = (gl_item *) data; + GL_CHECK(gitem->ad); + gl_appdata *ad = (gl_appdata *)gitem->ad; + int view_mode = gl_get_view_mode(ad); + Evas_Object *view_ly = NULL; + Elm_Object_Item *nf_it = NULL; + gl_dbg(""); + + if (view_mode == GL_VIEW_THUMBS_EDIT) { + view_ly = ad->gridinfo.navi_content_edit_ly; + nf_it = ad->gridinfo.nf_it_edit; + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + view_ly = ad->gridinfo.select_view_ly; + nf_it = ad->gridinfo.nf_it_select; + } else { + return; + } + + + Eina_Bool checked = elm_check_state_get(obj); + gitem->checked = checked; + if (checked) { + gl_dbg("Append:%s", gitem->item->file_url); + _gl_data_selected_list_append(ad, gitem); + } else { + gl_dbg("Remove:%s", gitem->item->file_url); + _gl_data_selected_list_remove(ad, gitem); + } + + /* Display selectioninfo */ + int sel_cnt = _gl_data_selected_list_count(ad); + _gl_notify_create_selinfo(ad, view_ly, nf_it, ad->gridinfo.thumbs_cnt, + sel_cnt, false); +} + +/* Only for local medias */ +static void __gl_thumbs_create_thumb_cb(media_content_error_e error, + const char *path, void *user_data) +{ + GL_CHECK(user_data); + gl_thumb_data_s *thumb_data = (gl_thumb_data_s *)user_data; + GL_CHECK(thumb_data->ad); + gl_appdata *ad = (gl_appdata *)thumb_data->ad; + gl_item *gitem = thumb_data->item; + GL_FREE(thumb_data); + + if (gl_get_view_mode(ad) != GL_VIEW_THUMBS && + gl_get_view_mode(ad) != GL_VIEW_THUMBS_EDIT) + return; + + GL_CHECK(gitem); + GL_CHECK(gitem->item); + if (GL_FILE_EXISTS(path)) { + gl_dbg("Update item with new thumb path[%s]", path); + /* Update thumb path */ + GL_FREEIF(gitem->item->thumb_url); + gitem->item->thumb_url = strdup(path); + elm_gengrid_item_update(gitem->elm_item); + } else { + gl_dbgE("Invalid thumb path!"); + } +} + +/* Use file to create new thumb if possible */ +static int __gl_thumbs_create_thumb(gl_item *gitem) +{ + GL_CHECK_VAL(gitem, -1); + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(gitem->item->file_url, -1); + + if (GL_FILE_EXISTS(gitem->item->file_url)) { + gl_thumb_data_s *thumb_data = NULL; + thumb_data = (gl_thumb_data_s *)calloc(1, sizeof(gl_thumb_data_s)); + GL_CHECK_VAL(thumb_data, -1); + thumb_data->ad = gitem->ad; + thumb_data->item = gitem; + _gl_data_create_thumb(gitem, __gl_thumbs_create_thumb_cb, + thumb_data); + return 0; + } + return -1; +} + +static Evas_Object *__gl_thumbs_get_content(void *data, Evas_Object *obj, + const char *part) +{ + GL_CHECK_NULL(part); + GL_CHECK_NULL(strlen(part)); + GL_CHECK_NULL(data); + gl_item *gitem = (gl_item *)data; + GL_CHECK_NULL(gitem->item); + GL_CHECK_NULL(gitem->ad); + gl_appdata *ad = (gl_appdata *)gitem->ad; + int view_mode = gl_get_view_mode(ad); + int item_size = ad->gridinfo.icon_size; + bool is_expired_drm = false; + + if (!g_strcmp0(part, GL_THUMB_ICON)) { + Evas_Object *layout = NULL; + char *path = NULL; + char *drm_path = NULL; + unsigned int orient = 0; + + /* Is it DRM file? Has a valid RO? */ + if(_gl_get_icon_type(gitem) == GL_ICON_EXPIRED_DRM) { + path = GL_DEFAULT_THUMB_ICON; + is_expired_drm = true; + /* Only one photo in a (normal, not web) album */ + } else if (ad->maininfo.medias_cnt < 2 && + gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) { + if (!g_strcmp0(GL_DB_DEFAULT_THUMB, gitem->item->thumb_url)) { + path = GL_DEFAULT_THUMB_ICON; + } else { + drm_path = gl_drm_get_file_path(gitem); + path = _GET_ICON(drm_path); + if (gl_is_image_valid(ad, path) == false) + path = _GET_ICON(gitem->item->thumb_url); +#ifdef _USE_ROTATE_BG + /* Rotate bg if it's created from original file */ + if (!g_strcmp0(path, gitem->item->file_url)) + _gl_exif_get_orientation(path, &orient); +#endif + } + } else { + /* Use default image */ + if (GL_FILE_EXISTS(gitem->item->thumb_url)) { + path = gitem->item->thumb_url; + } else { + path = GL_DEFAULT_THUMB_ICON; + __gl_thumbs_create_thumb(gitem); + } + } + + if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) { + unsigned int v_dur = 0; + if (gitem->item->video_info) { + v_dur = gitem->item->video_info->duration; + } + int bk_len = 0; + if (gitem->item->video_info == NULL) + bk_len = 0; + else + bk_len = gitem->item->video_info->bookmarks; + layout = _gl_thumb_show_part_icon_video(obj, path, + v_dur, bk_len, + gitem->item->favorite, + is_expired_drm, + item_size); + } else { + layout = _gl_thumb_show_part_icon_image(obj, path, + orient, + gitem->item->favorite, + is_expired_drm, + item_size); + } + + GL_FREEIF(drm_path); + return layout; + } else if (!g_strcmp0(part, GL_THUMB_CHECKBOX) && + (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_THUMBS_SELECT)) { + Evas_Object *ck = NULL; + ck = _gl_thumb_show_part_checkbox(obj, gitem->checked, + __gl_thumbs_check_changed, + data); + GL_CHECK_NULL(ck); + + gitem->check_obj = ck; + return ck; + } + + return NULL; +} + +static int __gl_thumbs_set_type(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + ad->gridinfo.grid_type = GL_GRID_T_NONE;; + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + ad->gridinfo.grid_type = GL_GRID_T_TAGS; + } else { + gl_cluster *cur_album = ad->albuminfo.current_album; + GL_CHECK_VAL(cur_album, -1); + GL_CHECK_VAL(cur_album->cluster, -1); + + if (cur_album->cluster->type == GL_STORE_T_PHONE || + cur_album->cluster->type == GL_STORE_T_MMC) + ad->gridinfo.grid_type = GL_GRID_T_LOCAL; + else if (cur_album->cluster->type == GL_STORE_T_ALL) + ad->gridinfo.grid_type = GL_GRID_T_ALLALBUMS; + else + gl_dbgE("Wrong cluster storage type!"); + } + gl_dbg("Gridview type: %d", ad->gridinfo.grid_type); + return 0; +} + +static bool __gl_thumbs_create_items(void *data, Evas_Object *parent) +{ + GL_CHECK_FALSE(data); + GL_CHECK_FALSE(parent); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + int item_cnt = 0; + gl_item *gitem = NULL; + int ret = -1; + /* Get all medias count of current album */ + int cnt = ad->maininfo.medias_cnt; + gl_dbg("List count : %d gv_mode : %d", cnt, ad->gridinfo.view_mode); + + ad->gridinfo.thumbgic.item_style = GL_GENGRID_ITEM_STYLE_THUMBNAIL; + ad->gridinfo.thumbgic.func.text_get = NULL; + ad->gridinfo.thumbgic.func.content_get = __gl_thumbs_get_content; + + if (elm_gengrid_items_count(parent) > 0) { + /* Save scroller position before clearing gengrid */ + _gl_ui_save_scroller_pos(parent); + elm_gengrid_clear(parent); + } + + for (i = 1; i <= cnt; i++) { + _gl_data_get_item_by_index(ad, i, false, &gitem); + if (gitem == NULL || gitem->item == NULL || + gitem->item->uuid == NULL) { + gl_dbgE("Invalid gitem. continue..."); + continue; + } + + /* For PTP Album, file_url is NULL untill the file is saved from camera */ + if (!gitem->item->file_url) { + gl_dbg("file_url is invalid."); + ret = _gl_data_delete_media(ad, gitem->item); + if (ret != 0) + continue; + _gl_data_selected_list_remove(ad, gitem); + _gl_data_item_list_remove(ad, gitem); + cnt--; + i--; + gitem = NULL; + continue; + } + + if (ad->gridinfo.back_to_normal) { + gitem->checked = false; + //gitem->check_obj = NULL; + } + + if (ad->gridinfo.view_mode == GL_THUMB_IMAGES && + gitem->item->type != MEDIA_CONTENT_TYPE_IMAGE) + continue; + if (ad->gridinfo.view_mode == GL_THUMB_VIDEOS && + gitem->item->type != MEDIA_CONTENT_TYPE_VIDEO) + continue; + gitem->elm_item = elm_gengrid_item_append(parent, + &(ad->gridinfo.thumbgic), + gitem, + __gl_thumbs_sel_cb, + gitem); + item_cnt++; + gitem->sequence = item_cnt; + + } + + _gl_ui_restore_scroller_pos(parent); + ad->gridinfo.thumbs_cnt = item_cnt; + ad->gridinfo.back_to_normal = false; + + if (item_cnt == 0) + return EINA_FALSE; + else + return EINA_TRUE; +} + +/* +* Set new view to all/image_grid_view. +* +* b_noc, true: it's nocontents view, false: normal view. +*/ +static int __gl_thumbs_set_view(void *data, Evas_Object *view, bool b_noc) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + ad->gridinfo.all_grid_view = view; + if (b_noc) + _gl_thumbs_set_nocontents(ad, view); + else + _gl_thumbs_set_nocontents(ad, NULL); + + return 0; +} + +/* +* When select album, show first (GL_FIRST_VIEW_END_POS+1) medias. +* Then use idler to get other medias from DB and appened +* them to gridview. +* In order to reduce transit time of first show of thumbnails view. +* Cause most of time is spent for getting records from DB, +* so we get first (GL_FIRST_VIEW_END_POS+1) items and show thumbnails view, +* it will accelerate view show. +*/ +static int __gl_thumbs_idler_append_items(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->albuminfo.current_album, -1); + GL_CHECK_VAL(ad->gridinfo.all_grid_view, -1); + int i = 0; + int item_cnt = 0; + gl_item *gitem = NULL; + /* Get all medias count of current album */ + int cnt = ad->maininfo.medias_cnt; + int ret = -1; + + gl_dbg("First view medias count: %d; girdview mode: %d", + cnt, ad->gridinfo.view_mode); + if (ad->maininfo.medias_cnt != (GL_FIRST_VIEW_END_POS + 1)) { + gl_dbg("No any more items, return!"); + return -1; + } + /* Get other items from DB */ + ret = _gl_data_get_item_list(ad, GL_CATEGORY_FOLDER, + ad->albuminfo.current_album, + (GL_FIRST_VIEW_END_POS + 1), + GL_GET_UNTIL_LAST_RECORD); + if (ret < 0) { + gl_dbgE("Get items list failed[%d]!", ret); + return ret; + } + + cnt = ad->maininfo.medias_cnt; + gl_dbg("Grid view all medias count: %d", cnt); + + if (ad->gridinfo.view_mode != GL_THUMB_ALL) { + /* Event gridview mode is wrong, we still need to get other records */ + gl_dbg("Gridview mode is wrong, return!"); + return -1; + } + + /* From (GL_FIRST_VIEW_END_POS + 2)th item to last one */ + i = GL_FIRST_VIEW_END_POS + 2; + + for (; i <= cnt; i++) { + _gl_data_get_item_by_index(ad, i, false, &gitem); + if (gitem == NULL || gitem->item == NULL || + gitem->item->uuid == NULL ) { + gl_dbgE("Invalid gitem, continue..."); + continue; + } + + if (!gitem->item->file_url) { + gl_dbg("file_url is invalid."); + _gl_data_delete_media(ad, gitem->item); + _gl_data_selected_list_remove(ad, gitem); + _gl_data_item_list_remove(ad, gitem); + cnt--; + i--; + gitem = NULL; + continue; + } + + if (ad->gridinfo.view_mode == GL_THUMB_IMAGES && + gitem->item->type != MEDIA_CONTENT_TYPE_IMAGE) + continue; + if (ad->gridinfo.view_mode == GL_THUMB_VIDEOS && + gitem->item->type != MEDIA_CONTENT_TYPE_VIDEO) + continue; + gitem->elm_item = elm_gengrid_item_append(ad->gridinfo.all_grid_view, + &(ad->gridinfo.thumbgic), + gitem, + __gl_thumbs_sel_cb, + gitem); + item_cnt++; + gitem->sequence = item_cnt + GL_FIRST_VIEW_END_POS + 1; + } + + gl_dbgW("\tUse idler to append other medias--Done!"); + if (item_cnt == 0) { + return -1; + } else { + ad->gridinfo.thumbs_cnt = item_cnt + GL_FIRST_VIEW_END_POS + 1; + gl_dbg("All count appended: %d", ad->gridinfo.thumbs_cnt); + return 0; + } +} + +static Eina_Bool __gl_thumbs_append_items_idler_cb(void *data) +{ + GL_CHECK_CANCEL(data); + + /* Try to get other medias from DB and append them to gridview */ + if (__gl_thumbs_idler_append_items(data) < 0) { + gl_dbgE("Failed to append grid items!"); + } else { + gl_dbg("Successful to append grid items!"); + } + + /* Remove idler after all items appended */ + _gl_thumbs_del_append_idler(data); + + return ECORE_CALLBACK_CANCEL; +} + +void _gl_thumbs_mouse_down(void *data, Evas *e, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(event_info); + GL_CHECK(data); + gl_item *gitem = (gl_item *) data; + GL_CHECK(gitem->ad); + gl_appdata *ad = (gl_appdata *)gitem->ad; + Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info; + + ad->gridinfo.grid_touch_info.x = ev->output.x; + ad->gridinfo.grid_touch_info.y = ev->output.y; +} + +void _gl_thumbs_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_item *gitem = (gl_item *) data; + GL_CHECK(gitem->ad); + gl_appdata *ad = (gl_appdata *)gitem->ad; + + if (!event_info || !obj) + goto RET_WO_EXEC; + + Evas_Event_Mouse_Up *ev = event_info; + if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD || + ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL) + goto RET_WO_EXEC; + + if ((abs(ad->gridinfo.grid_touch_info.x - ev->output.x) > GL_GRID_TOUCH_RANGE) || + (abs(ad->gridinfo.grid_touch_info.y - ev->output.y) > GL_GRID_TOUCH_RANGE)) + goto RET_WO_EXEC; + + gl_dbg(""); + __gl_thumbs_open_file(data); + return; + + RET_WO_EXEC: + return; +} + +Evas_Object *_gl_thumbs_add_grid(void *data, Evas_Object *parent, + gl_thumb_mode mode, bool b_use_idler) +{ + GL_CHECK_NULL(parent); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *grid = NULL; + ad->gridinfo.view_mode = mode; + grid = _gl_thumb_add_gengrid(parent); + evas_object_smart_callback_add(grid, "realized", NULL, data); + evas_object_smart_callback_add(grid, "unrealized", NULL, data); + evas_object_smart_callback_add(grid, "longpressed", + __gl_thumbs_longpressed, data); + + /* Set grid view type */ + __gl_thumbs_set_type(ad); + _gl_ui_reset_scroller_pos(grid); + + int view_mode = gl_get_view_mode(ad); + + if (!__gl_thumbs_create_items(ad, grid)) { + _gl_ui_del_scroller_pos(grid); + evas_object_del(grid); + grid = NULL; + Evas_Object *noc = _gl_nocontents_create(ad); + _gl_thumbs_set_nocontents(ad, noc); + evas_object_show(noc); + return noc; + } + + gl_dbg("thumbs_cnt : %d", ad->gridinfo.thumbs_cnt); + _gl_thumbs_set_size(ad, grid); + if (view_mode != GL_VIEW_THUMBS_SELECT) + _gl_thumbs_set_nocontents(ad, NULL); + evas_object_show(grid); + + if (b_use_idler && + ad->maininfo.medias_cnt == (GL_FIRST_VIEW_END_POS + 1)) { + gl_dbgW("\tUse idler to append other medias--Start"); + /* Remove idler */ + _gl_thumbs_del_append_idler(ad); + /* Add idler */ + ad->gridinfo.grid_append_idler = ecore_idler_add(__gl_thumbs_append_items_idler_cb, + ad); + } + + return grid; +} + +int _gl_thumbs_show_edit_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + bool b_ret = false; + Evas_Object *view = NULL; + gl_dbg("view_mode: %d", view_mode); + + if (view_mode == GL_VIEW_THUMBS_EDIT) { + view = ad->gridinfo.navi_content_edit_view; + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + view = ad->gridinfo.select_view; + } else { + gl_dbgE("Wrong view mode!"); + return -1; + } + GL_CHECK_VAL(view, -1); + b_ret = __gl_thumbs_create_items(ad, view); + _gl_thumbs_set_size(ad, NULL); + + if (!b_ret) { + gl_dbgE("Create items failed!"); + return -1; + } else { + return 0; + } +} + +int _gl_thumbs_show_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int gridview_mode = ad->gridinfo.view_mode; + bool b_ret = false; + gl_dbg("gridview_mode: %d", gridview_mode); + + if (ad->gridinfo.all_grid_view == NULL) { + gl_dbg("Error : Any gridview doesn't exist"); + return -1; + } + + /* Come back from edit mode, save state */ + ad->gridinfo.back_to_normal = true; + b_ret = __gl_thumbs_create_items(ad, + ad->gridinfo.all_grid_view); + _gl_thumbs_set_size(ad, NULL); + + if (!b_ret) { + gl_dbgE("Create items failed!"); + return -1; + } else { + return 0; + } +} + +Eina_Bool _gl_thumbs_update_view(void *data) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + Eina_Bool res = EINA_FALSE; + Evas_Object *gv = NULL; + int view_mode = gl_get_view_mode(ad); + bool b_view = false; + gl_dbg(""); + + if (view_mode == GL_VIEW_THUMBS_EDIT) { + gl_dbg("\n\nEdit_Mode\n"); + gv = ad->gridinfo.navi_content_edit_view; + } else { + b_view = _gl_thumbs_get_view(ad, &gv); + GL_CHECK_FALSE(gv); + } + if (b_view) { + res = __gl_thumbs_create_items(ad, gv); + if (!res) { + gl_dbg("__gl_thumbs_create_items() return false..."); + evas_object_hide(gv); + _gl_ui_del_scroller_pos(gv); + evas_object_del(gv); + __gl_thumbs_set_view(ad, NULL, false); + Evas_Object *noc = _gl_nocontents_create(ad); + evas_object_show(noc); + __gl_thumbs_set_view(ad, noc, true); + + elm_object_part_content_unset(ad->gridinfo.navi_content_ly, + "elm.swallow.view"); + elm_object_part_content_set(ad->gridinfo.navi_content_ly, + "elm.swallow.view", noc); + } else { + _gl_thumbs_set_size(ad, gv); + } + } else { + gl_dbg("Remove nocontents view."); + evas_object_hide(gv); + _gl_ui_del_scroller_pos(gv); + evas_object_del(gv); + __gl_thumbs_set_view(ad, NULL, false); + bool b_noc = false; + int view_m = ad->gridinfo.view_mode; + + Evas_Object *view = NULL; + view = _gl_thumbs_add_grid(ad, ad->gridinfo.navi_content_ly, + view_m, false); + if (ad->gridinfo.all_grid_nocontents) + b_noc = true; + + /* No nocotents removed, gridview created, enable edit button */ + if (!b_noc) { + /* When nocontents removed from webalbum, + * it means this empty album was just refreshed + * to download photo from web, progressbr showed. + */ + _gl_ctrl_disable_btn(ad, false, GL_NAVI_THUMBS); + } + __gl_thumbs_set_view(ad, view, b_noc); + + elm_object_part_content_unset(ad->gridinfo.navi_content_ly, + "elm.swallow.view"); + elm_object_part_content_set(ad->gridinfo.navi_content_ly, + "elm.swallow.view", view); + } + + return res; +} + +int _gl_thumbs_create_view(void *data, int nf_mode, char *title, bool b_idler, + Evas_Smart_Cb func) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *layout = NULL; + Evas_Object *view = NULL; + + gl_set_view_mode(data, GL_VIEW_THUMBS); + layout = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + GL_CHECK_VAL(layout, -1); + 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); + view = _gl_thumbs_add_grid(ad, layout, GL_THUMB_ALL, b_idler); + if (view == NULL) { + evas_object_del(layout); + gl_dbgE("Failed to add gridview!"); + return -1; + } + + elm_object_part_content_set(layout, "elm.swallow.view", view); + ad->gridinfo.all_grid_view = view; + ad->gridinfo.navi_content_ly = layout; + + gl_ui_create_title_and_push(ad, ad->maininfo.naviframe, layout, nf_mode, + title); + + Evas_Object *bk_btn = NULL; + bk_btn = elm_object_item_part_content_get(ad->gridinfo.nf_it, + GL_NAVIFRAME_PREV_BTN); + elm_object_style_set(bk_btn, GL_BUTTON_STYLE_NAVI_PRE); + evas_object_smart_callback_add(bk_btn, "clicked", func, ad); + + edje_object_signal_emit(_EDJ(layout), GL_SIGNAL_VIEW_DEFAULT, "elm"); + gl_dbg("Done"); + return 0; +} + +int _gl_thumbs_update_count(void *data, int new_cnt) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + gl_dbg("gridview display item count=%d", new_cnt); + ad->gridinfo.updated_thumbs_cnt = new_cnt; + + return 0; +} + +/** +* Get all/image_grid_view. +* +* True returned if it's normal view, if it's nocontents view return false. +*/ +bool _gl_thumbs_get_view(void *data, Evas_Object **view) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *gv = NULL; + bool b_view = false; + + gv = ad->gridinfo.all_grid_view; + if (gv && ad->gridinfo.all_grid_nocontents == NULL) + b_view = true; + + /* Nocontents */ + if (!b_view) + gl_dbg("Previous view is Nocontents..."); + + /* Return view */ + if (view) + *view = gv; + + return b_view; +} + +/* Assign new value to all/image_grid_nocontents */ +int _gl_thumbs_set_nocontents(void *data, Evas_Object *noc) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + ad->gridinfo.all_grid_nocontents = noc; + + return 0; +} + +int _gl_thumbs_set_size(void *data, Evas_Object *gridview) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int cnt = 0; + Evas_Object *gv = NULL; + int view_mode = gl_get_view_mode(ad); + + if (gridview) { + gv = gridview; + } else { + bool b_view = false; + if (view_mode == GL_VIEW_THUMBS_EDIT) { + b_view = true; + gv = ad->gridinfo.navi_content_edit_view; + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + b_view = true; + gv = ad->gridinfo.select_view; + } else { + b_view = _gl_thumbs_get_view(ad, &gv); + } + + if (!b_view || !gv) { + gl_dbgE("gridview is invalid!"); + return -1; + } + } + + if (ad->gridinfo.updated_thumbs_cnt <= 0) { + cnt = ad->gridinfo.thumbs_cnt; + } else { + cnt = ad->gridinfo.updated_thumbs_cnt; + ad->gridinfo.updated_thumbs_cnt = 0; + } + + return _gl_thumb_set_size(ad, gv, cnt, &(ad->gridinfo.icon_size)); +} + +int _gl_thumbs_clear_cbs(Evas_Object *grid) +{ + GL_CHECK_VAL(grid, -1); + evas_object_smart_callback_del(grid, "longpressed", + __gl_thumbs_longpressed); + return 0; +} + +int _gl_thumbs_delete_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Destroy idler */ + _gl_thumbs_del_append_idler(data); + + if (ad->gridinfo.all_grid_view != NULL) { + _gl_ui_del_scroller_pos(ad->gridinfo.all_grid_view); + _gl_thumbs_clear_cbs(ad->gridinfo.all_grid_view); + evas_object_del(ad->gridinfo.all_grid_view); + ad->gridinfo.all_grid_view = NULL; + } + ad->gridinfo.grid_type = GL_GRID_T_NONE; + ad->gridinfo.all_grid_nocontents = NULL; + ad->gridinfo.edit_btn = NULL; + return 0; +} + +/* Update griditem size */ +int _gl_thumbs_update_size(void *data, Evas_Object *view) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *_view = NULL; + int view_mode = gl_get_view_mode(ad); + gl_dbg(""); + + if (ad->gridinfo.thumbs_cnt <= GL_GRID_ITEM_ZOOM_LEVEL_02_CNT) { + gl_dbgW("Thumbs count is less than 7!"); + return -1; + } + + if (view) { + _view = view; + } else { + bool b_view = false; + if (view_mode == GL_VIEW_THUMBS_EDIT) { + b_view = true; + _view = ad->gridinfo.navi_content_edit_view; + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + b_view = true; + _view = ad->gridinfo.select_view; + } else { + b_view = _gl_thumbs_get_view(ad, &_view); + } + + if (!b_view || !_view) { + gl_dbgE("gridview is invalid!"); + return -1; + } + } + + _gl_thumbs_set_size(data, _view); + + _gl_thumb_update_gengrid(_view); + + return 0; +} + +int _gl_thumbs_del_append_idler(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->gridinfo.grid_append_idler) { + ecore_idler_del(ad->gridinfo.grid_append_idler); + ad->gridinfo.grid_append_idler = NULL; + } + + return 0; +} + diff --git a/src/gallery.c b/src/gallery.c new file mode 100755 index 0000000..7c99a8f --- /dev/null +++ b/src/gallery.c @@ -0,0 +1,1135 @@ +/* + * Copyright (c) 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 /* Key event */ +#include "gallery.h" +#include "gl-debug.h" +#include "gl-albums.h" +#include "gl-thumbs.h" +#include "gl-controlbar.h" +#include "gl-ui-util.h" +#include "gl-lang.h" +#include "gl-util.h" +#include "gl-data.h" +#include "gl-ext-ug-load.h" +#include "gl-ext-exec.h" +#include "gl-tags.h" +#include "gl-popup.h" +#include "gl-ctxpopup.h" +#include "gl-progressbar.h" +#include "gl-editfield.h" +#include "gl-notify.h" +#include "gl-thread-util.h" +#include "gl-strings.h" + +#define GL_BG_COLOR_R 248 +#define GL_BG_COLOR_G 246 +#define GL_BG_COLOR_B 239 + +#define GL_BD_LAUNCH_TYPE "launch-type" +#define GL_BD_ALBUM_ID "album-id" +#define GL_BD_FILE_TYPE "file-type" +#define GL_BD_DRM_TYPE "drm-type" +#define GL_BD_SETAS_TYPE "setas-type" +#define GL_BD_CALLERID_SIZE "callerid-size" +#define GL_BD_CALLERID_PATH "callerid-path" +#define GL_BD_HOMESCREEN_PATH "homescreen-path" +#define GL_BD_LOCKSCREEN_PATH "lockscreen-path" +#define GL_BD_SELECT_ALBUM "select-album" +#define GL_BD_SELECT_ONE "select-one" +#define GL_BD_SELECT_MULTIPLE "select-multiple" +#define GL_BD_SELECT_SETAS "select-setas" +#define GL_BD_FILE_TYPE_IMAGE "image" +#define GL_BD_FILE_TYPE_VIDEO "video" +#define GL_BD_FILE_TYPE_ALL "all" +#define GL_BD_SETAS_WALLPALER "wallpaper" +#define GL_BD_SETAS_CALLERID "callerid" +#define GL_BD_SHOW_DRM_FILE "true" + +#define GL_BD_SELECTION_MODE "http://tizen.org/appcontrol/data/selection_mode" +#define GL_BD_SELECTION_MODE_SINGLE "single" +#define GL_BD_SELECTION_MODE_MULTI "multiple" + +#define GL_AUL_SEP ":" +#define GL_SERVICE_OPERATION_WALLPAPER "http://tizen.org/appcontrol/operation/wallpaper" + +struct text_part { + char *part; + char *msgid; +}; + +static struct text_part main_txt[] = { + {"txt_title", "Application template",}, + {"txt_mesg", "Click to exit",}, +}; + +/* User-defined function */ +static int _gallery_init_app_svc(void *data); + +static void _gallery_win_del_cb(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbgW("_gallery_win_del_cb!!"); + GL_CHECK(data); + + elm_exit(); +} + + +static int _gallery_update_ts(Evas_Object *eo, struct text_part *tp, int size) +{ + int i = 0; + + if (eo == NULL || tp == NULL || size < 0) { + return -1; + } + for (i = 0; i < size; i++) { + if (tp[i].part && tp[i].msgid) { + edje_object_part_text_set(eo, tp[i].part, + tp[i].msgid); + } + } + + return 0; +} + +static void _gallery_lang_changed_cb(void *data) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK(ad->maininfo.main_layout); + + _gallery_update_ts(elm_layout_edje_get(ad->maininfo.main_layout), + main_txt, sizeof(main_txt) / sizeof(main_txt[0])); + _gl_lang_update(data); +} + +static Eina_Bool __gallery_key_down_cb(void *data, int type, void *event) +{ + if (!data) { + gl_dbgE("Invalid parameter!"); + return ECORE_CALLBACK_PASS_ON; + } + + gl_appdata *ad = (gl_appdata *)data; + ad->maininfo.home_key = false; + Ecore_Event_Key *key_event = (Ecore_Event_Key *)event; + + if (!strcmp(key_event->keyname, KEY_END)) { + gl_dbgW("Bakc(End) key"); + } else if (!strcmp(key_event->keyname, KEY_SELECT)) { + gl_dbgW("Home key"); + ad->maininfo.home_key = true; + } else if (!strcmp(key_event->keyname, KEY_POWER)) { + gl_dbgW("Power key"); + } + + gl_dbg("Key down : %s", key_event->keyname); + + return ECORE_CALLBACK_PASS_ON; +} + +static void _gallery_low_battery_cb(void *data) +{ + gl_dbg(""); + + /* ug_send_event(UG_EVENT_LOW_BATTERY); */ + /* 0 : default handler, 1:user handler */ +} + +/** + * Perform an UI update according to the given rotation angle. + * Do not call elm_win_rotation_set / elm_win_rotation_with_resize_set. + * ecore_evas has already called + * elm_win_rotation_set / elm_win_rotation_with_resize_set function. + * + * Please set NULL to app_device_orientation_cb member of app_event_callback_s structure. + * And don't use app_device_orientation_cb callback which is supported by capi +*/ +static void __gallery_rot_changed_cb(void *data, Evas_Object *obj, void *event) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK(ad->maininfo.win); + /* changed_ang value is 0 90 180 270 */ + int changed_ang = elm_win_rotation_get(ad->maininfo.win); + gl_dbg("New angle: %d, old angle: %d", changed_ang, + ad->maininfo.rotate_mode); + if (changed_ang == ad->maininfo.rotate_mode) + return; + else + ad->maininfo.rotate_mode = changed_ang; + + enum ug_event evt = UG_EVENT_NONE; + /* Send event to UG */ + switch (changed_ang) { + case APP_DEVICE_ORIENTATION_0: + evt = UG_EVENT_ROTATE_PORTRAIT; + break; + case APP_DEVICE_ORIENTATION_90: + evt = UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN; + break; + case APP_DEVICE_ORIENTATION_180: + evt = UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN; + break; + case APP_DEVICE_ORIENTATION_270: + evt = UG_EVENT_ROTATE_LANDSCAPE; + break; + } + ug_send_event(evt); + + int view_mode = gl_get_view_mode(ad); + if (ad->uginfo.ug_called_by_me) { + if (view_mode == GL_VIEW_ALBUMS){ + gl_ctrl_rotate_ctrlbar(ad, GL_VIEW_NONE); + } + return; + } + gl_ctrl_rotate_ctrlbar(ad, GL_VIEW_NONE); +} + +static Eina_Bool __gallery_prop_change(void *data, int ev_type, void *ev) +{ + GL_CHECK_FALSE(ev); + Ecore_X_Event_Window_Property *event = ev; + + if (event->win != ecore_x_window_root_first_get()) + return ECORE_CALLBACK_PASS_ON; + + if (event->atom != ecore_x_atom_get("FONT_TYPE_change")) + return ECORE_CALLBACK_PASS_ON; + + gl_dbg("Font is changed!(FONT_TYPE_change)"); + /* Remove ctxpopup */ + _gl_ctxpopup_del(data); + + return ECORE_CALLBACK_PASS_ON; +} + +void profile_changed_cb(void *data, Evas_Object * obj, void *event) +{ + const char *profile = elm_config_profile_get(); + + if (strcmp(profile, "desktop") == 0) + elm_win_indicator_mode_set (obj, ELM_WIN_INDICATOR_HIDE); + else + elm_win_indicator_mode_set (obj, ELM_WIN_INDICATOR_SHOW); +} + +static Evas_Object *_gallery_create_win(void *data, const char *name) +{ + gl_dbg_launch(" _gallery_create_win:start"); + GL_CHECK_NULL(name); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *eo = NULL; + + gl_dbg_launch(" elm_win_add:start"); + eo = elm_win_add(NULL, name, ELM_WIN_BASIC); + gl_dbg_launch(" elm_win_add:end"); + if (eo) { + /** + * Register a list of rotation angles that your application supports + * + * The window manager is going to decide rotation of application windows + * by referring the list of rotation angles. + * In this means if your application sets 0, 90 and 270 degrees to be the list of + * supported rotation angles, the window manager will not rotate your + * application window if the device is rotated 180 degrees + */ + if (elm_win_wm_rotation_supported_get(eo)) { + const int rots[4] = { APP_DEVICE_ORIENTATION_0, + APP_DEVICE_ORIENTATION_90, + APP_DEVICE_ORIENTATION_180, + APP_DEVICE_ORIENTATION_270 }; + gl_dbg(""); + elm_win_wm_rotation_available_rotations_set(eo, rots, 4); + } + /* pass '-1' value to this API then it will unset preferred rotation angle */ + elm_win_wm_rotation_preferred_rotation_set(eo, -1); + + elm_win_autodel_set(eo, EINA_TRUE); + elm_win_title_set(eo, name); + evas_object_smart_callback_add(eo, "profile,changed", + profile_changed_cb, ad); + evas_object_smart_callback_add(eo, "delete,request", + _gallery_win_del_cb, ad); + evas_object_smart_callback_add(eo, "wm,rotation,changed", + __gallery_rot_changed_cb, data); + ad->maininfo.win_scale = elm_config_scale_get(); + gl_dbg("main window scale: %f", ad->maininfo.win_scale); + + /*register x window property change callback */ + ecore_x_event_mask_set(ecore_x_window_root_first_get(), + ECORE_X_EVENT_MASK_WINDOW_PROPERTY); + + ad->maininfo.font_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, + __gallery_prop_change, + evas_object_evas_get(eo)); + } + + gl_dbg("_gallery_create_win:done"); + gl_dbg_launch(" _gallery_create_win:end"); + return eo; +} + +/* Parent is main window */ +static Evas_Object *_gallery_create_bg(Evas_Object *parent) +{ + gl_dbg_launch(" _gallery_create_bg:start"); + GL_CHECK_NULL(parent); + Evas_Object *bg = NULL; + + gl_dbg_launch(" elm_bg_add:start"); + bg = elm_bg_add(parent); + gl_dbg_launch(" elm_bg_add:end"); + /* Show special color of background */ + elm_bg_color_set(bg, GL_BG_COLOR_R, GL_BG_COLOR_G, GL_BG_COLOR_B); + 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); + evas_object_show(bg); + gl_dbg_launch(" _gallery_create_bg:end"); + + return bg; +} + +/* Parent is main window */ +static Evas_Object *_gallery_create_conform(Evas_Object *parent) +{ + gl_dbg_launch(" _gallery_create_conform:start"); + GL_CHECK_NULL(parent); + Evas_Object *conform = NULL; + + gl_dbg_launch(" elm_conformant_add:start"); + conform = elm_conformant_add(parent); + gl_dbg_launch(" elm_conformant_add:end"); + + evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(conform, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_win_resize_object_add(parent, conform); + evas_object_show(conform); + gl_dbg_launch(" _gallery_create_conform:end"); + + return conform; +} + +static int _gallery_create_view_ly(gl_appdata *ad) +{ + gl_dbg_launch(" _gallery_create_view_ly:start"); + GL_CHECK_VAL(ad, -1); + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *cbar = NULL; + + Evas_Object *layout = gl_ctrl_create_ctrlbar_view(ad->maininfo.naviframe); + + ad->ctrlinfo.ctrlbar_view_ly = layout; + + /* create controlbar downside */ + cbar = gl_ctrl_create_ctrlbar(ad, GL_CTRL_TAB_ALBUMS); + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_ly, + "elm.swallow.tabbar", cbar); + _gl_ctrl_show_tabbar(ad, true); + ad->ctrlinfo.ctrlbar = cbar; + + gl_ui_create_title_and_push(ad, ad->maininfo.naviframe, + ad->ctrlinfo.ctrlbar_view_ly, + GL_NAVI_ALBUMS, GL_STR_CTRL_ITEM_ALBUMS); + gl_dbg_launch(" _gallery_create_view_ly:end"); + + return 0; +} + +static Eina_Bool __gallery_activate_win_idler_cb(void *data) +{ + GL_CHECK_CANCEL(data); + gl_appdata *ad = (gl_appdata *)data; + + gl_dbgW("elm_win_activate - start!"); + elm_win_activate(ad->maininfo.win); + gl_dbgW("elm_win_activate - done!"); + + if (ad->albuminfo.activate_win_idler) { + ecore_idler_del(ad->albuminfo.activate_win_idler); + ad->albuminfo.activate_win_idler = NULL; + } + + return ECORE_CALLBACK_CANCEL; +} + +static Eina_Bool _gallery_create_albums_idler_cb(void *data) +{ + gl_dbg_launch(" _gallery_create_albums_idler_cb:start"); + GL_CHECK_CANCEL(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("_gallery_create_albums_idler_cb:start"); + + gl_dbgW("\tIdler: gallery is launched!"); + + /* Initialize libmedia-info */ + _gl_data_init(); + gl_dbg("DB initialization:done"); + /* Get cluster list from libmedia-info */ + gl_dbg_launch(" _gl_data_get_cluster_list:start"); + _gl_data_get_cluster_list(ad); + gl_dbg_launch(" _gl_data_get_cluster_list:end"); + GL_CHECK_FALSE(ad->albuminfo.cluster_list); + gl_dbg("_gl_data_get_cluster_list:done"); + /* Set view mode */ + gl_set_view_mode(ad, GL_VIEW_ALBUMS); + /** + * Disbale 'edit' button if none editable albums + * (albums except 'All albums'/'Camera shot'/'AllShare') exist. + */ + if (gl_check_gallery_empty(ad) || + ad->albuminfo.cluster_list->edit_cnt == 0) + _gl_ctrl_disable_btn(ad, true, GL_NAVI_ALBUMS); + /* Update albums view, append items */ + gl_albums_update_items(ad); + + /** + * Disable control bar when none album exists. + * or File system is unmounted. + */ + if (gl_check_gallery_empty(ad)) + gl_ctrl_disable_ctrlbar(ad, true); + else + gl_ctrl_disable_ctrlbar(ad, false); + + gl_dbg("_gallery_create_albums_idler_cb:done"); + + if (ad->albuminfo.create_albums_idler) { + ecore_idler_del(ad->albuminfo.create_albums_idler); + ad->albuminfo.create_albums_idler = NULL; + } + + gl_dbg_launch(" _gallery_create_albums_idler_cb:end"); + return ECORE_CALLBACK_CANCEL; +} + +/** + * + * Elm_win + * |-> Elm_bg + * |-> Elm_conformant + * |-> Elm_layout(main_layout) + * |-> Elm_layout(ctrlbar_ly) + * |-> Elm_naviframe(naviframe) + * |-> Elm_layout(ctrlbar_view_ly) + * |-> Elm_gengrid(albums_view/tags_view/places_view/...) +*/ +static int _gallery_init_view(gl_appdata *ad) +{ + gl_dbg_launch(" _gallery_init_view:start"); + gl_dbg(""); + GL_CHECK_VAL(ad, -1); + Evas_Object *ly = NULL; + + /* Background. */ + ad->maininfo.bg = _gallery_create_bg(ad->maininfo.win); + GL_CHECK_VAL(ad->maininfo.bg, -1); + /* Conformant. */ + Evas_Object *conform = _gallery_create_conform(ad->maininfo.win); + GL_CHECK_VAL(conform, -1); + /* Set if this window is an illume conformant window */ + elm_win_conformant_set(ad->maininfo.win, EINA_TRUE); + /* Base Layout */ + ad->maininfo.main_layout = gl_ui_create_main_ly(conform); + GL_CHECK_VAL(ad->maininfo.main_layout, -1); + /* Set base layout to conformant */ + elm_object_content_set(conform, ad->maininfo.main_layout); + /* Indicator */ + elm_win_indicator_mode_set(ad->maininfo.win, ELM_WIN_INDICATOR_SHOW); + gl_dbg("gl_ui_create_main_ly: done"); + /* Create control layout */ + ly = gl_ctrl_create_ctrlbar_ly(ad->maininfo.main_layout); + GL_CHECK_VAL(ly, -1); + ad->ctrlinfo.ctrlbar_ly = ly; + /* Set control layout to main layout */ + elm_object_part_content_set(ad->maininfo.main_layout, + "elm.swallow.content", ly); + /* Create Naviframe */ + ad->maininfo.naviframe = gl_ui_create_naviframe(ad->ctrlinfo.ctrlbar_ly); + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + /* Set Naviframe to control layout */ + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_ly, + "elm.swallow.content", + ad->maininfo.naviframe); + + evas_object_data_set(ad->maininfo.naviframe, GL_NAVIFRAME_OBJ_DATA_KEY, + conform); + + gl_dbg("gl_ctrl_create_ctrlbar_view: done"); + + /* Create view layout and Set view layout to Naviframe*/ + _gallery_create_view_ly(ad); + + /* Add albums view and append nothing */ + Evas_Object *layout_inner = NULL; + layout_inner = _gl_albums_add_gengrid(ad, ad->ctrlinfo.ctrlbar_view_ly); + GL_CHECK_FALSE(layout_inner); + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_view_ly, "contents", + layout_inner); + ad->albuminfo.albums_view = layout_inner; + ad->albuminfo.gallery_launched = true; + + gl_dbg_launch(" _gallery_init_view:end"); + + return 0; +} + +static bool _gallery_create(void *data) +{ + gl_dbg_launch("create:start"); + gl_dbgW("==Create=="); + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + ad->maininfo.reentrant = TRUE; + Evas_Object *win = NULL; + + elm_theme_extension_add(NULL, GL_EDJ_FILE); + + /* create window */ + win = _gallery_create_win(ad, PACKAGE); + GL_CHECK_FALSE(win); + ad->maininfo.win = win; + + /* initialize gallery view */ + if (_gallery_init_view(ad) != 0) { + gl_dbgE("_gallery_init_view failed"); + return false; + } + /* _gallery_lang_changed_cb(ad); */ + + gl_dbg_launch(" evas_object_show(win):start"); + evas_object_show(win); + gl_dbg_launch(" evas_object_show(win):end"); + gl_dbg("evas_object_show(win):done"); + /* Register callbacks of DB update */ + gl_dbg("system event cb:done"); + + gl_dbg_launch(" register callbacks:start"); + gl_reg_db_update_noti(ad); + /* Register key down handler */ + ad->maininfo.keydown_handler = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, + __gallery_key_down_cb, + data); + gl_dbg_launch(" register callbacks:end"); + + if (ad->albuminfo.create_albums_idler == NULL) { + /* Use idler to load albums view */ + Ecore_Idler *idl = NULL; + idl = ecore_idler_add(_gallery_create_albums_idler_cb, ad); + ad->albuminfo.create_albums_idler = idl; + gl_dbg("create_albums_idler added: 0x%x", + ad->albuminfo.create_albums_idler); + } + gl_dbg_launch("create:end"); + + return true; +} + +static int _gallery_close_app(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->albuminfo.create_albums_idler) { + ecore_idler_del(ad->albuminfo.create_albums_idler); + ad->albuminfo.create_albums_idler = NULL; + } + + if (ad->albuminfo.activate_win_idler) { + ecore_idler_del(ad->albuminfo.activate_win_idler); + ad->albuminfo.activate_win_idler = NULL; + } + /* Destroy idler */ + _gl_thumbs_del_append_idler(ad); + /* destroy rename album job.*/ + if(ad->maininfo.rename_album_job) { + ecore_job_del(ad->maininfo.rename_album_job); + ad->maininfo.rename_album_job = NULL; + } + /* Destroy vibration timer */ + if (ad->entryinfo.vibration_timer) { + ecore_timer_del(ad->entryinfo.vibration_timer); + ad->entryinfo.vibration_timer = NULL; + } + /* Free Ecore_Pipe object created */ + if (ad->pbarinfo.sync_pipe) { + ecore_pipe_del(ad->pbarinfo.sync_pipe); + ad->pbarinfo.sync_pipe = NULL; + } + + if (ad->pbarinfo.start_thread_timer) { + ecore_timer_del(ad->pbarinfo.start_thread_timer); + ad->pbarinfo.start_thread_timer = NULL; + } + + if (ad->pbarinfo.del_pbar_idler) { + ecore_idler_del(ad->pbarinfo.del_pbar_idler); + ad->pbarinfo.del_pbar_idler = NULL; + } + + /* Destroy timer for removing popup */ + if (ad->popupinfo.del_timer) { + ecore_timer_del(ad->popupinfo.del_timer); + ad->popupinfo.del_timer = NULL; + } + + /* Remove down event handler */ + if(ad->maininfo.keydown_handler) { + ecore_event_handler_del(ad->maininfo.keydown_handler); + ad->maininfo.keydown_handler = NULL; + } + + /*Remove font type change event handler*/ + if (ad->maininfo.font_handler) { + ecore_event_handler_del(ad->maininfo.font_handler); + ad->maininfo.font_handler = NULL; + } + + /* Remove key data for confirmant */ + evas_object_data_del(ad->maininfo.naviframe, GL_NAVIFRAME_OBJ_DATA_KEY); + /* Remove IMF */ + _gl_editfield_destroy_imf(ad); + + _gl_ctxpopup_del(ad); + + /* Clear data about thumb callbacks */ + _gl_destroy_thumbs_edit_view(ad); + if (ad->gridinfo.select_view) + _gl_thumbs_clear_cbs(ad->gridinfo.select_view); + _gl_thumbs_delete_view(ad); + + /* DB update callback unregister. */ + gl_dereg_db_update_noti(); + + /* Free memory allocated for appcontrol */ + _gallery_init_app_svc(ad); + + ug_destroy_all(); +#if 0 + if (ad->maininfo.main_layout) + evas_object_del(ad->maininfo.main_layout); +#endif +/*BS launched after connecting to PC while Gallery open in mass storage mode.*/ +#if 0 + if (ad->maininfo.win) + evas_object_del(ad->maininfo.win); +#endif + gl_albums_free_data(data); + + /* disconnet with libmedia-info */ + _gl_data_finalize(ad); + +#ifdef _USE_SBESM + _gl_ext_deinitialize_sbeam(data); +#endif + + gl_dbgW("==Cleaning done=="); + + return 0; +} + +static void _gallery_terminate(void *data) +{ + gl_dbgW("==Terminate=="); + GL_CHECK(data); + _gallery_close_app(data); +} + +static void _gallery_pause(void *data) +{ + gl_dbgW("==Pause=="); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + ad->maininfo.reentrant = TRUE; + + if (ad->maininfo.home_key) { + gl_ext_destroy_gallery_ug(ad); + ad->maininfo.home_key = false; + } + + ug_pause(); +} + +static void _gallery_resume(void *data) +{ + gl_dbg_launch("resume:start"); + gl_dbgW("==Resume=="); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + + ug_resume(); + /* Video palyer was close when pause Gallery */ + ad->uginfo.app_called_by_me = false; + + /* Show cursor and IMF if not popup showed */ + if (ad->entryinfo.editfield) { + if (ad->popupinfo.popup) { + gl_dbg("Hide Entry cursor and IMF"); + _gl_editfield_hide_imf(ad); + } else { + gl_dbg("Show Entry cursor and IMF"); + _gl_editfield_show_imf(ad); + } + } + + /* Update view */ + gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); + + gl_dbg_launch("resume:done"); +} +static int __gallery_reset_app(void *data, const char *cluster_id, + const char *aul_type) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.win, -1); + int view_mode = gl_get_view_mode(ad); + gl_dbg(""); + + if (cluster_id == NULL || aul_type == NULL) { + gl_dbgE("Invalid aul parameters!"); + goto GALLERY_RESET_FAILED; + } + + if (ad->pbarinfo.sync_pipe) { + gl_dbgW("Cancel move/delete pthread/Pipe!"); + /* Set cancel state to make child thread exit */ + gl_thread_set_cancel_state(ad, GL_PB_CANCEL_RESET); + return -1; + } + + if (view_mode == GL_VIEW_NONE) { + /* First launch gallery then show shortcut album/tag */ + _gl_data_init(); + gl_dbg("Launch gallery at the first time"); + _gl_data_get_cluster_list(ad); + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + /* Set view mode */ + gl_set_view_mode(ad, GL_VIEW_ALBUMS); + /* Select tabbar item contains shortcut item */ + _gl_ctrl_sel_tabbar_item(ad, aul_type); + } else if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_dbg("In Tags tab"); + if (_gl_tags_reset_view(ad, cluster_id, aul_type) < 0) + goto GALLERY_RESET_FAILED; + } else { + gl_dbg("In Albums tab"); + if (_gl_albums_reset_view(ad, cluster_id, aul_type) < 0) + goto GALLERY_RESET_FAILED; + } + + if (g_strcmp0(cluster_id, GL_ALBUM_ALL_ID) == 0 && + g_strcmp0(aul_type, GL_AUL_ALBUM) == 0) + goto GALLERY_RESET_SUCCESS; + + /* Remove idler for other tabbar item */ + if (ad->albuminfo.create_albums_idler) { + gl_dbgW("Remove album creation idler!"); + ecore_idler_del(ad->albuminfo.create_albums_idler); + ad->albuminfo.create_albums_idler = NULL; + } + + if (!g_strcmp0(aul_type, GL_AUL_TAG)) { + /* Show shortcut tag */ + if (_gl_tags_sel_home_tag(ad, cluster_id) == false) { + /* Tag doesn't exist */ + gl_dbgE("Tag(livepanel) doesn't exist!"); + goto GALLERY_RESET_FAILED; + } + } else { + gl_dbgE("Wrong type!"); + goto GALLERY_RESET_FAILED; + } + GALLERY_RESET_SUCCESS: + elm_win_activate(ad->maininfo.win); + return 0; + + GALLERY_RESET_FAILED: + elm_win_activate(ad->maininfo.win); + return -1; +} + +/* init appcontrol launch related global variables */ +static int _gallery_init_app_svc(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_dbg(""); + gl_appdata *ad = (gl_appdata *)data; + + ad->albuminfo.aul_launch_type = GL_AUL_T_NONE; + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_NONE; + ad->albuminfo.aul_setas_type = GL_AUL_SETAS_T_NONE; + GL_FREEIF(ad->albuminfo.aul_id); + GL_FREEIF(ad->albuminfo.aul_type); + ad->albuminfo.aul_launch_by_mime = false; + + if(ad->albuminfo.recv_service) { + service_destroy(ad->albuminfo.recv_service); + ad->albuminfo.recv_service = NULL; + } + + GL_FREEIF(ad->albuminfo.aul_callid_size); + GL_FREEIF(ad->albuminfo.aul_callid_path); + GL_FREEIF(ad->albuminfo.aul_homescreen_path); + GL_FREEIF(ad->albuminfo.aul_lockscreen_path); + return 0; +} + +static int __gallery_parse_contain_drm(void *data, service_h service) +{ + GL_CHECK_VAL(service, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + char *contain_drm = NULL; + + ad->albuminfo.b_show_drm = false; + service_get_extra_data(service, GL_BD_DRM_TYPE, &contain_drm); + gl_dbg("DRM: %s", contain_drm); + if (contain_drm) { + if (!strcasecmp(contain_drm, GL_BD_SHOW_DRM_FILE)) + ad->albuminfo.b_show_drm= true; + GL_FREE(contain_drm); + } + + return 0; +} + +static int __gallery_parse_launch_type(void *data, service_h service) +{ + GL_CHECK_VAL(service, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_aul_launch_type launch_type = GL_AUL_T_NONE; + char *launch_type_str = NULL; + char *select_mode = NULL; + char *setas_type_str = NULL; + gl_dbg(""); + + /* get launch-type */ + service_get_extra_data(service, GL_BD_SELECTION_MODE, &select_mode); + if (select_mode) { + if (!strcasecmp(select_mode, GL_BD_SELECTION_MODE_SINGLE)) { + ad->albuminfo.aul_launch_type = GL_AUL_T_SELECT_ONE; + GL_FREEIF(select_mode); + return 0; + } else if (!strcasecmp(select_mode, GL_BD_SELECTION_MODE_MULTI)) { + ad->albuminfo.aul_launch_type = GL_AUL_T_SELECT_MULTIPLE; + GL_FREEIF(select_mode); + return 0; + } + } + service_get_extra_data(service, GL_BD_LAUNCH_TYPE, &launch_type_str); + if (launch_type_str == NULL) { + gl_dbg("set to default launch type: select-one"); + ad->albuminfo.aul_launch_type = GL_AUL_T_SELECT_ONE; + return 0; + } else { + gl_dbg("launch-type: %s", launch_type_str); + } + + if(!strcasecmp(launch_type_str, GL_BD_SELECT_ALBUM)) { + launch_type = GL_AUL_T_SELECT_ALBUM; + } else if(!strcasecmp(launch_type_str, GL_BD_SELECT_ONE)) { + launch_type = GL_AUL_T_SELECT_ONE; + } else if(!strcasecmp(launch_type_str, GL_BD_SELECT_MULTIPLE)) { + launch_type = GL_AUL_T_SELECT_MULTIPLE; + } else if(!strcasecmp(launch_type_str, GL_BD_SELECT_SETAS)) { + launch_type = GL_AUL_T_SELECT_SETAS; + + /* get setas-type */ + service_get_extra_data(service, GL_BD_SETAS_TYPE, &setas_type_str); + if(setas_type_str == NULL) { + GL_FREE(launch_type_str); + return 0; + } + gl_dbg("setas-type: %s", setas_type_str); + + gl_aul_setas_type setas_type = GL_AUL_SETAS_T_NONE; + char *path = NULL; + char *size = NULL; + + if (!strcasecmp(setas_type_str, GL_BD_SETAS_WALLPALER)) { + setas_type = GL_AUL_SETAS_T_WALLPAPER; + + /* get homscreen-path */ + service_get_extra_data(service, GL_BD_HOMESCREEN_PATH, + &path); + if (path) { + gl_dbg("homescreen-path: %s", path); + ad->albuminfo.aul_homescreen_path = path; + path = NULL; + } + /* get lockscreen-path */ + service_get_extra_data(service, GL_BD_LOCKSCREEN_PATH, + &path); + if (path) { + gl_dbg("lockscreen-path: %s", path); + ad->albuminfo.aul_lockscreen_path = path; + path = NULL; + } + } else if (!strcasecmp(setas_type_str, GL_BD_SETAS_CALLERID)) { + setas_type = GL_AUL_SETAS_T_CALLER_ID; + /* get callerid-size */ + service_get_extra_data(service, GL_BD_CALLERID_SIZE, + &size); + if (size) { + gl_dbg("callerid-size: %s", size); + ad->albuminfo.aul_callid_size = size; + } + /* get callerid-path */ + service_get_extra_data(service, GL_BD_CALLERID_PATH, + &path); + if (path) { + gl_dbg("callerid-path: %s", path); + ad->albuminfo.aul_callid_path = path; + } + } + + ad->albuminfo.aul_setas_type = setas_type; + GL_FREE(setas_type_str); + } + + ad->albuminfo.aul_launch_type = launch_type; + GL_FREE(launch_type_str); + return 0; +} + +/* analysis parameters */ +static int __gallery_parse_param(void *data, service_h service) +{ + GL_CHECK_VAL(service, -1); + GL_CHECK_VAL(data, -1); + gl_dbg(""); + gl_appdata *ad = (gl_appdata *)data; + char *operation = NULL; + char *uri = NULL; + char *mime = NULL; + + /* init */ + _gallery_init_app_svc(ad); + + /* save current service handle */ + service_clone(&ad->albuminfo.recv_service, service); + + service_get_operation(service, &operation); + gl_dbg("operation: %s", operation); + + service_get_uri(service, &uri); + if(uri) { + gl_dbg("uri: %s", uri); + char *str_pre = NULL; + char *str_suf = NULL; + str_pre = strtok_r(uri, GL_AUL_SEP, &str_suf); + gl_dbg("str_pre: %s, str_suf: %s", str_pre, str_suf); + GL_CHECK_VAL(str_pre, -1); + GL_CHECK_VAL(str_suf, -1); + str_pre = strtok_r(str_suf, GL_AUL_SEP, &str_suf); + gl_dbg("str_pre: %s, str_suf: %s", str_pre, str_suf); + GL_CHECK_VAL(str_pre, -1); + GL_CHECK_VAL(str_suf, -1); + ad->albuminfo.aul_id = strdup(str_suf); + ad->albuminfo.aul_type = strdup(str_pre); + ad->albuminfo.aul_launch_by_mime = true; + gl_dbg("Type: %s, ID: %s", ad->albuminfo.aul_type, + ad->albuminfo.aul_id); + return 0; + } + + if(!strcasecmp(operation, SERVICE_OPERATION_DEFAULT)) { + return -1; + } else if (!strcasecmp(operation, SERVICE_OPERATION_VIEW)) { + /* OPERATION_VIEW */ + ad->albuminfo.aul_launch_type = GL_AUL_T_VIEW_ALBUM; + + /* get file-type from service */ + char *file_type_str = NULL; + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_ALL; /* default */ + service_get_extra_data(service, GL_BD_FILE_TYPE, &file_type_str); + if(file_type_str) { + gl_dbg("file type: %s", file_type_str); + if (!g_strcmp0(file_type_str, GL_BD_FILE_TYPE_IMAGE)) { + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_IMAGE; + } else if (!g_strcmp0(file_type_str, GL_BD_FILE_TYPE_VIDEO)) { + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_VIDEO; + } + GL_FREE(file_type_str); + } + /* get album-id */ + char *album_id_str = NULL; + service_get_extra_data(service, GL_BD_ALBUM_ID, &album_id_str); + + if(album_id_str) { + gl_dbg("album-id: %s", album_id_str); + ad->albuminfo.aul_id = album_id_str; + } else { + gl_dbg("album-id is invalid, set to default (ALL)"); + ad->albuminfo.aul_id = strdup(GL_ALBUM_ALL_ID); + } + /* To show album, so tabbar item must be Albums */ + ad->albuminfo.aul_type = strdup(GL_AUL_ALBUM); + } else if (!strcasecmp(operation, SERVICE_OPERATION_PICK)) { + /* OPERATION_PICK */ + /* get file-type from mime */ + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_ALL; /* default */ + service_get_mime(service, &mime); + if(mime) { + + gl_dbg("mime: %s", mime); + if (!g_strcmp0(mime, GL_MIME_IMAGE_ALL)) { + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_IMAGE; + } else if (!g_strcmp0(mime, GL_MIME_VIDEO_ALL)) { + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_VIDEO; + } + } + + __gallery_parse_launch_type(ad, service); + __gallery_parse_contain_drm(ad, service); + } else if (!strcasecmp(operation, GL_SERVICE_OPERATION_WALLPAPER)) { + /* Wallpaper */ + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_IMAGE; + ad->albuminfo.aul_launch_type = GL_AUL_T_SELECT_SETAS; + /* The wallpaper doesn't need crop currently, but IV ug returns "crop_image_path" */ + ad->albuminfo.aul_setas_type = GL_AUL_SETAS_T_CROP_WALLPAPER; + __gallery_parse_contain_drm(ad, service); + + char *path = NULL; + service_get_extra_data(service, GL_BD_HOMESCREEN_PATH, &path); + if (path) { + gl_dbg("homescreen-path: %s", path); + ad->albuminfo.aul_homescreen_path = path; + } + } + + return 0; +} + +static void _gallery_reset(service_h service, void *data) +{ + gl_dbgW("==Reset=="); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK(ad->maininfo.win); + + if (ad->maininfo.reentrant) { + ad->maininfo.reentrant = FALSE; + } else { + gl_dbgW("Gallery reentrant is not allowed, return!"); + return; + } + + /* Destroy gallery ug */ + if (ad->uginfo.gallery_ug_called_by_me) { + gl_dbgW("Destroy Gallery UG launched, show App view!"); + ug_destroy(ad->uginfo.gallery_ug_called_by_me); + ad->uginfo.gallery_ug_called_by_me = NULL; + } + + /* Parse parameters */ + if(__gallery_parse_param(data, service) != 0) { + if (ad->albuminfo.aul_launch_by_mime == false && + ad->albuminfo.aul_launch_type == GL_AUL_T_NONE) { +/*@@ 1. Launch Gallery from menu screen/Smart search app, albums view showed @@*/ + int view_m = gl_get_view_mode(ad); + gl_dbg("view_m: %d", view_m); + /* Launch Gallery at the first time */ + if (view_m == GL_VIEW_NONE) { + gl_dbg("Set view mode as GL_VIEW_ALBUMS"); + gl_set_view_mode(ad, GL_VIEW_ALBUMS); + } else { + gl_dbg("Update view"); + gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); + } + } else { + gl_dbgE("Failed to parse parameters, update view!"); + gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); + } + elm_win_activate(ad->maininfo.win); + return; + } + + if (ad->albuminfo.aul_launch_by_mime || + ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { +/*@@ 2. Launch Gallery from live-magazine/shortcut(add to home) @@*/ + __gallery_reset_app(data, ad->albuminfo.aul_id, + ad->albuminfo.aul_type); + } else { +/*@@ 3. Load Gallery UG @@*/ + gl_dbg("Start loading Gallery UG"); + if (gl_ext_load_gallery_ug(ad) == GL_UG_SUCCESS) { + if (gl_get_view_mode(ad) == GL_VIEW_NONE) { + gl_dbg("elm_win_activate"); + elm_win_activate(ad->maininfo.win); + } else { + if (ad->albuminfo.activate_win_idler) { + ecore_idler_del(ad->albuminfo.activate_win_idler); + ad->albuminfo.activate_win_idler = NULL; + } + /* To show UG faster then app */ + Ecore_Idler *idler = NULL; + idler = ecore_idler_add(__gallery_activate_win_idler_cb, + ad); + ad->albuminfo.activate_win_idler = idler; + } + } + } +} + +int gallery_reset_app(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("Reset gallery[cluster ID: %s]", ad->albuminfo.aul_id); + return __gallery_reset_app(data, ad->albuminfo.aul_id, + ad->albuminfo.aul_type); +} + +int main(int argc, char *argv[]) +{ + gl_dbg_launch("main:start"); + gl_dbgW("==Gallery=="); + gl_appdata gl_ad; + int ret; + + app_event_callback_s event_callback; + + event_callback.create = _gallery_create; + event_callback.terminate = _gallery_terminate; + event_callback.pause = _gallery_pause; + event_callback.resume = _gallery_resume; + event_callback.service = _gallery_reset; + event_callback.low_memory = NULL; + event_callback.low_battery = _gallery_low_battery_cb; + event_callback.device_orientation = NULL; + event_callback.language_changed = _gallery_lang_changed_cb; + event_callback.region_format_changed = NULL; + + /* Enable OpenGL */ + setenv("ELM_ENGINE", "gl", 1); + + memset(&gl_ad, 0x00, sizeof(gl_appdata)); + + ret = app_efl_main(&argc, &argv, &event_callback, &gl_ad); + + gl_dbgW("==Gallery gone=="); + gl_dbg_launch("main:done"); + return ret; +} diff --git a/src/util/gl-debug.c b/src/util/gl-debug.c new file mode 100755 index 0000000..6f30dd2 --- /dev/null +++ b/src/util/gl-debug.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 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 "gl-debug.h" + +#ifdef _USE_LOG_FILE_ +#include +static char _g_file_path[GL_FILE_PATH_LEN_MAX] = { 0, }; +#endif + +#ifdef _PERFORMANCE_CHECK_ +static long g_time_usec = 0L; +#endif + +void _custom_debug_msg(debug_msg_type *debug_msg, const char *msg, ...) +{ + va_list va; + +#define DIRECORY_SPLITTER '/' + const char*pFileName = NULL; + + pFileName = strrchr(debug_msg->fname, DIRECORY_SPLITTER); + pFileName = (NULL == pFileName)?debug_msg->fname:(pFileName+1); + + va_start(va, msg); + + static char buf[2048]; + int i ; + //i = snprintf(buf, 2048, "[%s : %d] ", pFileName, debug_msg->nline); + i = snprintf(buf, 2048, "[%-16.16s : %5d] ", pFileName, debug_msg->nline); + + vsnprintf( buf + i, 2048 - i, msg, va); + + print_log(DLOG_DEBUG, debug_msg->szcategory, "%s", buf); + + va_end(va); +} + +#if 0 +void +gl_init_debug_handler(const char *appname) +{ +#ifdef _USE_LOG_FILE_ + if (appname == NULL) + return; + + memset(_g_file_path, 0x00, sizeof(_g_file_path)); + + //sprintf(_g_file_path, "/tmp/%s", appname); + snprintf(_g_file_path, sizeof(_g_file_path), "/tmp/%s", appname); + if (ecore_file_can_read(_g_file_path)) + remove(_g_file_path); + + g_log_fp = fopen(_g_file_path, "a"); +#elif defined _USE_DLOG_ + //dlog_init(NULL); +#endif +} + +void +gl_close_debug_handler() +{ +#ifdef _USE_LOG_FILE_ + if (g_log_fp != NULL) + fclose(g_log_fp); +#elif defined _USE_DLOG_ + //dlog_deinit(NULL); +#endif +} +#endif + +#if 0 +long +gl_get_debug_time(void) +{ +#ifdef _PERFORMANCE_CHECK_ + struct timeval time; + memset(&time,0x00,sizeof(struct timeval)); + gettimeofday(&time, NULL); + return time.tv_sec * GL_TIME_USEC_PER_SEC + time.tv_usec; +#else + return 0L; +#endif +} + +void +gl_reset_debug_time(void) +{ +#ifdef _PERFORMANCE_CHECK_ + struct timeval time; + memset(&time,0x00,sizeof(struct timeval)); + gettimeofday(&time, NULL); + g_time_usec = time.tv_sec * GL_TIME_USEC_PER_SEC + time.tv_usec; +#endif +} +#endif + +#if 0 +void +gl_print_debug_time(char *time_string) +{ +#ifdef _PERFORMANCE_CHECK_ + struct timeval time; + double totaltime = 0.0; + memset(&time,0x00,sizeof(struct timeval)); + gettimeofday(&time, NULL); + totaltime = (double)(time.tv_sec * GL_TIME_USEC_PER_SEC + time.tv_usec - g_time_usec) / CLOCKS_PER_SEC; + + gl_dbg("time [%s] : %f \n", time_string, totaltime); +#endif +} + +void +mb_print_debug_time_ex(long start, long end, const char *func_name, char *time_string) +{ +#ifdef _PERFORMANCE_CHECK_ + double totaltime = 0.0; + + totaltime = (double)(end - start) / CLOCKS_PER_SEC; + + gl_dbg("time [%s: %s] : %f \n", func_name, time_string, totaltime); +#endif +} +#endif + +/* EOF */ diff --git a/src/util/gl-drm.c b/src/util/gl-drm.c new file mode 100755 index 0000000..517dc12 --- /dev/null +++ b/src/util/gl-drm.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 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 "gallery.h" +#include "gl-debug.h" +#include "gl-drm.h" +#include "gl-icons.h" + +char *gl_drm_get_file_path(void *item) +{ + GL_CHECK_NULL(item); + gl_item *gitem = (gl_item *) item; + GL_CHECK_NULL(gitem->item); + GL_CHECK_NULL(gitem->item->file_url); + gl_dbg("filepath: %s", gitem->item->file_url); + + if (gl_drm_is_drm_file(gitem->item->file_url)) + return strdup(GL_DEFAULT_THUMB_ICON); + else + return strdup(gitem->item->file_url); +} + +Eina_Bool gl_drm_is_drm_file(const char *file_path) +{ + GL_CHECK_FALSE(file_path); + + drm_bool_type_e is_drm_file = DRM_UNKNOWN; + if (drm_is_drm_file(file_path, &is_drm_file) != DRM_RETURN_SUCCESS) { + gl_dbgE("drm_is_drm_file error"); + return EINA_FALSE; + } + + if (DRM_TRUE == is_drm_file) + return EINA_TRUE; + return EINA_FALSE; +} + +int gl_drm_get_permtype(int gitem_type) +{ + switch(gitem_type) { + case MEDIA_CONTENT_TYPE_IMAGE: + return DRM_PERMISSION_TYPE_DISPLAY; + case MEDIA_CONTENT_TYPE_VIDEO: + return DRM_PERMISSION_TYPE_PLAY; + default: + return -1; + } +} + +Eina_Bool gl_drm_check_valid_ro(const char *file_path, + drm_permission_type_e permType) +{ + GL_CHECK_FALSE(file_path); + gl_dbg("file_path: %s", file_path); + int ret = -1; + + drm_license_status_e license_status = DRM_LICENSE_STATUS_UNDEFINED; + ret = drm_get_license_status(file_path, permType, &license_status); + if (DRM_RETURN_SUCCESS == ret && + DRM_LICENSE_STATUS_VALID == license_status) { + return EINA_TRUE; + } + else { + gl_dbg("No valid ro, return %d", license_status); + return EINA_FALSE; + } +} + diff --git a/src/util/gl-exif.c b/src/util/gl-exif.c new file mode 100755 index 0000000..7460a08 --- /dev/null +++ b/src/util/gl-exif.c @@ -0,0 +1,1702 @@ +/* + * Copyright (c) 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 +*/ + +#ifdef _USE_ROTATE_BG + +#include +#include +#include +#include +#include "gl-exif.h" +#include "gl-debug.h" +#include "gallery.h" + +#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 GL_DATA_FOLDER_PATH"/.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"); + GL_FREEIF(time_buf); + return ret; +} + +/* Add exif to jfif , don't have exif */ +static int __gl_exif_add_exif_to_jfif(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(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, 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(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; +} + +int _gl_exif_get_orientation(char *file_path, unsigned int *orientation) +{ + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(file_path, -1); + gl_dbg("file_path: %s", file_path); + + return __gl_exif_rw_orient(file_path, orientation, false); +} + +int _gl_exif_set_orientation(char *file_path, unsigned int orientation) +{ + GL_CHECK_VAL(file_path, -1); + gl_dbg("file_path: %s", file_path); + + return __gl_exif_rw_orient(file_path, &orientation, true); +} + +int _gl_exif_get_rotated_orientation(unsigned int orientation, bool b_left) +{ + int rotated_orientataion; + gl_dbg("b_left: %d", b_left); + + switch (orientation){ + case GL_ORIENTATION_ROT_0: + /* true: 0 -> 270, false: 0 -> 90 */ + if (b_left) + rotated_orientataion = GL_ORIENTATION_ROT_270; + else + rotated_orientataion = GL_ORIENTATION_ROT_90; + break; + case GL_ORIENTATION_ROT_90: + /* true: 90 -> 0, false: 90 -> 180 */ + if (b_left) + rotated_orientataion = GL_ORIENTATION_ROT_0; + else + rotated_orientataion = GL_ORIENTATION_ROT_180; + break; + case GL_ORIENTATION_ROT_180: + /* true: 180 -> 90, false: 180 -> 270 */ + if (b_left) + rotated_orientataion = GL_ORIENTATION_ROT_90; + else + rotated_orientataion = GL_ORIENTATION_ROT_270; + break; + case GL_ORIENTATION_ROT_270: + /* true: 270 -> 180, false: 270 -> 0 */ + if (b_left) + rotated_orientataion = GL_ORIENTATION_ROT_180; + else + rotated_orientataion = GL_ORIENTATION_ROT_0; + break; + default: + gl_dbgE("Wrong oriectation: %d!", orientation); + /* true: 0 -> 270, false: 0 -> 90 */ + if (b_left) + rotated_orientataion = GL_ORIENTATION_ROT_270; + else + rotated_orientataion = GL_ORIENTATION_ROT_90; + break; + } + + gl_dbg("New orientation: %d", rotated_orientataion); + return rotated_orientataion; +} + +#endif + diff --git a/src/util/gl-ext-exec.c b/src/util/gl-ext-exec.c new file mode 100755 index 0000000..7982a28 --- /dev/null +++ b/src/util/gl-ext-exec.c @@ -0,0 +1,344 @@ +/* + * Copyright (c) 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 "gl-drm.h" +#include "gl-ext-exec.h" +#include "gl-debug.h" +#include "gallery.h" +#include "gl-data.h" +#include "gl-util.h" +#include "gl-popup.h" +#include "gl-controlbar.h" +#include "gl-strings.h" + +#define GL_APP_PKG_VIDEOPLAYER "org.tizen.video-player" +#define GL_APP_PKG_CAMERA "org.tizen.camera-app" + +#define GL_ARGV_VIDEO_LIST_TYPE "video_list_type" +#define GL_ARGV_VIDEO_ALL_FOLDER_VIDEO "all_folder_video" +#define GL_ARGV_VIDEO_FOLDER "folder" +#define GL_ARGV_VIDEO_LIST_FAVORITE "favorite" +#define GL_ARGV_VIDEO_TAG_VIDEO "tag_video" +#define GL_ARGV_VIDEO_TAG_NAME "tag_name" + +#define GL_ARGV_VIDEO_ORDER_TYPE "order_type" +#define GL_ARGV_VIDEO_ORDER_DATE_DESC "date_desc" +#define GL_ARGV_VIDEO_START_POS "start_pos_time" + +#define GL_ARGV_VIDEO_LAUNCH_APP "launching_application" +#define GL_ARGV_VIDEO_LAUNCH_GALLERY "gallery" + +#define GL_ARGV_PATH "path" + +//refer to imageviewer +static int __gl_ext_launch_video_player(void *data, service_h service) +{ + GL_CHECK_VAL(service, -1); + GL_CHECK_VAL(data, -1); + gl_item *gitem = (gl_item *)data; + GL_CHECK_VAL(gitem->ad, -1); + gl_appdata *ad = (gl_appdata *)gitem->ad; + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(gitem->item->uuid, -1); + GL_CHECK_VAL(gitem->item->file_url, -1); + + int last_pos = 0; + char last_pos_str[GL_INTERGER_LEN_MAX] = { 0, }; + + GL_CHECK_VAL(gitem->item->video_info, -1); + last_pos = gitem->item->video_info->last_played_pos; + eina_convert_itoa(last_pos, last_pos_str); + gl_dbg("last_pos : %d", last_pos); + + const char *video_path = gitem->item->file_url; + + bool file_is_drm = gl_drm_is_drm_file(video_path); + + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + /* Tag view */ + gl_dbg("Tags view"); + gl_tag *current_tag = ad->taginfo.current_tag; + if (current_tag && current_tag->tag && current_tag->tag->tag_name) { + gl_dbg("Current tag: %s", current_tag->tag->tag_name); + if (current_tag->tag->_id == GL_TAG_FAVORITES_ID) { + gl_dbg("Favourite tag"); + service_add_extra_data(service, + GL_ARGV_VIDEO_LIST_TYPE, + GL_ARGV_VIDEO_LIST_FAVORITE); + service_add_extra_data(service, + GL_ARGV_VIDEO_ORDER_TYPE, + GL_ARGV_VIDEO_ORDER_DATE_DESC); + service_add_extra_data(service, + GL_ARGV_VIDEO_LAUNCH_APP, + GL_ARGV_VIDEO_LAUNCH_GALLERY); + service_add_extra_data(service, + GL_ARGV_VIDEO_START_POS, + last_pos_str); + } else { + gl_dbg("Normal tag"); + service_add_extra_data(service, + GL_ARGV_VIDEO_LIST_TYPE, + GL_ARGV_VIDEO_TAG_VIDEO); + service_add_extra_data(service, + GL_ARGV_VIDEO_TAG_NAME, + current_tag->tag->tag_name); + service_add_extra_data(service, + GL_ARGV_VIDEO_ORDER_TYPE, + GL_ARGV_VIDEO_ORDER_DATE_DESC); + service_add_extra_data(service, + GL_ARGV_VIDEO_LAUNCH_APP, + GL_ARGV_VIDEO_LAUNCH_GALLERY); + service_add_extra_data(service, + GL_ARGV_VIDEO_START_POS, + last_pos_str); + } + } else { + /* Fixme: return or not? */ + gl_dbgE("Invalid current tag, return?"); + } + } else { + /* Albums view */ + gl_cluster *cur_cluster = ad->albuminfo.current_album; + if (cur_cluster && cur_cluster->cluster) { + gl_dbg("Album: %s", cur_cluster->cluster->display_name); + if (cur_cluster->cluster->type == GL_STORE_T_ALL) { + gl_dbg("All album"); + service_add_extra_data(service, + GL_ARGV_VIDEO_LIST_TYPE, + GL_ARGV_VIDEO_ALL_FOLDER_VIDEO); + service_add_extra_data(service, + GL_ARGV_VIDEO_ORDER_TYPE, + GL_ARGV_VIDEO_ORDER_DATE_DESC); + service_add_extra_data(service, + GL_ARGV_VIDEO_LAUNCH_APP, + GL_ARGV_VIDEO_LAUNCH_GALLERY); + service_add_extra_data(service, + GL_ARGV_VIDEO_START_POS, + last_pos_str); + } else if (cur_cluster->cluster->type == GL_STORE_T_PHONE || + cur_cluster->cluster->type == GL_STORE_T_MMC) { + gl_dbg("Real album"); + service_add_extra_data(service, + GL_ARGV_VIDEO_LIST_TYPE, + GL_ARGV_VIDEO_FOLDER); + service_add_extra_data(service, + GL_ARGV_VIDEO_ORDER_TYPE, + GL_ARGV_VIDEO_ORDER_DATE_DESC); + service_add_extra_data(service, + GL_ARGV_VIDEO_LAUNCH_APP, + GL_ARGV_VIDEO_LAUNCH_GALLERY); + service_add_extra_data(service, + GL_ARGV_VIDEO_START_POS, + last_pos_str); + } else { + gl_dbg("Web album? Under construction..."); + } + } else { + /* Fixme: return or not? */ + gl_dbgE("Invalid current album, return?"); + } + } + + int ret = 0; + if (file_is_drm) { + gl_dbg("DRM file."); + service_add_extra_data(service, GL_ARGV_PATH, video_path); + service_set_operation(service, SERVICE_OPERATION_DEFAULT); + service_set_package(service, GL_APP_PKG_VIDEOPLAYER); + ret = service_send_launch_request(service, NULL, NULL); + } else { + gl_dbg("Not DRM file."); + service_add_extra_data(service, GL_ARGV_PATH, video_path); + service_set_operation(service, SERVICE_OPERATION_DEFAULT); + service_set_package(service, GL_APP_PKG_VIDEOPLAYER); + ret = service_send_launch_request(service, NULL, NULL); + } + + if (ret == SERVICE_ERROR_NONE) + return 0; + else + return -1; +} + +static int __gl_ext_compose_exec_cmd(void *data, gl_ext_app_type type, + char *path, char **pkg_name, + service_h service) +{ + GL_CHECK_VAL(data, -1); + gl_dbg("type:%d, path:%s", type, path); + + switch (type) { + case GL_APP_VIDEOPLAYER: + GL_CHECK_VAL(path, -1); + *pkg_name = GL_APP_PKG_VIDEOPLAYER; + break; + default: + *pkg_name = NULL; + } + + return 0; +} + +static void __gl_ext_service_reply_cb(service_h request, service_h reply, + service_result_e result, void *user_data) +{ + gl_dbg(""); + switch(result) { + case SERVICE_RESULT_SUCCEEDED: + gl_dbg("SERVICE_RESULT_SUCCEEDED"); + break; + case SERVICE_RESULT_FAILED: + gl_dbg("SERVICE_RESULT_FAILED"); + break; + case SERVICE_RESULT_CANCELED: + gl_dbg("SERVICE_RESULT_CANCELED"); + break; + default: + gl_dbgE("Unhandled value: %d!", result); + break; + } +} + +static int __gl_ext_load(const char *operation, const char *pkg) +{ + gl_dbg("operation: %s, pkg: %s", operation, pkg); + int ret = -1; + int destroy_ret = -1; + service_h handle; + + ret = service_create(&handle); + if(ret != SERVICE_ERROR_NONE) { + gl_dbgE("service_create failed[%d]!", ret); + return GL_LAUNCH_FAIL; + } + + ret = service_set_operation(handle, operation); + if(ret != SERVICE_ERROR_NONE) { + gl_dbgE("service_set_operation [%s] failed[%d]!", operation, + ret); + goto GL_EXT_FAILED; + } + + if(pkg) { + ret = service_set_package(handle, pkg); + if(ret != SERVICE_ERROR_NONE) { + gl_dbgE("service_set_package [%s] failed[%d]!", pkg, + ret); + goto GL_EXT_FAILED; + } + } + + ret = service_send_launch_request(handle, __gl_ext_service_reply_cb, + NULL); + if(ret != SERVICE_ERROR_NONE) { + gl_dbgE("service_send_launch_request failed[%d]!", ret); + goto GL_EXT_FAILED; + } + + GL_EXT_FAILED: + destroy_ret = service_destroy(handle); + if(destroy_ret != SERVICE_ERROR_NONE) { + gl_dbgE("service_destroy failed[%d]!", destroy_ret); + return GL_LAUNCH_FAIL; + } + + return (ret == SERVICE_ERROR_NONE ? GL_LAUNCH_SUCCESS : GL_LAUNCH_FAIL); +} + +int gl_ext_exec(void *data, gl_ext_app_type type) +{ + GL_CHECK_VAL(data, -1); + gl_item *gitem = (gl_item *)data; + GL_CHECK_VAL(gitem->ad, -1); + gl_appdata *ad = (gl_appdata *)gitem->ad; + GL_CHECK_VAL(gitem->item, -1); + GL_CHECK_VAL(gitem->item->file_url, -1); + char *path = gitem->item->file_url; + service_h service = NULL; + char *pkg_name = NULL; + + if (ad->uginfo.app_called_by_me) { + gl_dbgE("APP launched, return!"); + return GL_LAUNCH_FAIL; + } + + service_create(&service); + GL_CHECK_VAL(service, GL_LAUNCH_FAIL); + + __gl_ext_compose_exec_cmd(ad, type, path, &pkg_name, service); + if (pkg_name == NULL) { + service_destroy(service); + return GL_LAUNCH_FAIL; + } + + int ret = 0; + if (type == GL_APP_VIDEOPLAYER) { + if (path == NULL) { + service_destroy(service); + return GL_LAUNCH_FAIL; + } + if (__gl_ext_launch_video_player(data, service) != 0) { + service_destroy(service); + return GL_LAUNCH_FAIL; + } + } else { + service_set_operation(service, SERVICE_OPERATION_DEFAULT); + service_set_package(service, pkg_name); + ret = service_send_launch_request(service, NULL, NULL); + if (ret != SERVICE_ERROR_NONE) { + service_destroy(service); + gl_dbgE("service_send_launch_request failed[%d]!", ret); + return GL_LAUNCH_FAIL; + } + } + + ret = service_destroy(service); + if (ret != SERVICE_ERROR_NONE) { + ad->uginfo.app_called_by_me = true; + return GL_LAUNCH_SUCCESS; + } else { + return GL_LAUNCH_FAIL; + } +} + +/** + * Launching Camera application + */ +int _gl_ext_load_camera(void) +{ + gl_dbg(""); + app_context_h app_context; + + int ret = APP_MANAGER_ERROR_NONE; + ret = app_manager_get_app_context(GL_APP_PKG_CAMERA, &app_context); + if (ret == APP_MANAGER_ERROR_NONE) { + gl_dbg("Resume Camera"); + app_manager_resume_app(app_context); + return GL_LAUNCH_SUCCESS; + } else if (ret == APP_MANAGER_ERROR_NO_SUCH_APP) { + gl_dbg("Launch Camera"); + return __gl_ext_load(SERVICE_OPERATION_DEFAULT, + GL_APP_PKG_CAMERA); + } + + gl_dbgE("Error case[%d]!", ret); + return GL_LAUNCH_FAIL; +} + diff --git a/src/util/gl-ext-ug-load.c b/src/util/gl-ext-ug-load.c new file mode 100755 index 0000000..6338c2d --- /dev/null +++ b/src/util/gl-ext-ug-load.c @@ -0,0 +1,909 @@ +/* + * Copyright (c) 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 "gl-ext-ug-load.h" +#include "gl-debug.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-albums.h" +#include "gl-thumbs.h" +#include "gallery.h" +#include "gl-popup.h" +#include "gl-strings.h" +#include "gl-controlbar.h" +#include "gl-editfield.h" + +#define GL_UG_PKG_MESSAGE "msg-composer-efl" +#define GL_UG_PKG_EMAIL "email-composer-efl" +#define GL_UG_PKG_IV "image-viewer-efl" +#define GL_UG_PKG_BLUETOOTH "setting-bluetooth-efl" +#define GL_UG_PKG_GALLERY "gallery-efl" + +#define GL_SEPERATOR_MAIL '\n' + +#define GL_ARGV_MSG_ATTACHFILE "ATTACHFILE" +#define GL_ARGV_EMAIL_RUN_TYPE "RUN_TYPE" +#define GL_ARGV_EMAIL_RUN_5 "5" +#define GL_ARGV_EMAIL_ATTACHMENT "ATTACHMENT" +#define GL_ARGV_BT_LAUNCH_TYPE "launch-type" +#define GL_ARGV_BT_LAUNCH_SEND "send" +#define GL_ARGV_BT_FILECOUNT "filecount" +#define GL_ARGV_BT_FILES "files" + +#define GL_ARGV_IV_VIEW_MODE "View Mode" +#define GL_ARGV_IV_VIEW_GALLERY "GALLERY" +#define GL_ARGV_IV_VIEW_SLIDESHOW "SLIDESHOW" +#define GL_ARGV_IV_PATH "Path" +#define GL_ARGV_IV_INDEX "Index" +#define GL_ARGV_IV_VIEW_BY "View By" +#define GL_ARGV_IV_VIEW_BY_FOLER "By Folder" +#define GL_ARGV_IV_VIEW_BY_ALL "All" +#define GL_ARGV_IV_VIEW_BY_FAVOR "Favorites" +#define GL_ARGV_IV_VIEW_BY_TAGS "Tags" +#define GL_ARGV_IV_MEDIA_TYPE "Media type" +#define GL_ARGV_IV_MEDIA_ALL "All" +#define GL_ARGV_IV_MEDIA_IMAGE "Image" +#define GL_ARGV_IV_MEDIA_VIDEO "Video" +#define GL_ARGV_IV_TAG_NAME "Tag name" +#define GL_ARGV_IV_ALBUM_INDEX "Album index" +#define GL_ARGV_IV_SORT_BY "Sort By" +#define GL_ARGV_IV_SORT_NAME "Name" +#define GL_ARGV_IV_SORT_NAMEDESC "NameDesc" +#define GL_ARGV_IV_SORT_DATE "Date" +#define GL_ARGV_IV_SORT_DATEDESC "DateDesc" + +#define GL_ARGV_LAUNCH_TYPE "launch-type" +#define GL_ARGV_FILE_TYPE "file-type" +#define GL_ARGV_DRM_TYPE "drm-type" +#define GL_ARGV_SETAS_TYPE "setas-type" +#define GL_ARGV_CALLERID_SIZE "callerid-size" +#define GL_ARGV_CALLERID_PATH "callerid-path" +#define GL_ARGV_HOMESCREEN_PATH "homescreen-path" +#define GL_ARGV_LOCKSCREEN_PATH "lockscreen-path" + +#define GL_ARGV_SETAS_WALLPALER "wallpaper" +#define GL_ARGV_SETAS_CROP_WALLPALER "crop-wallpaper" +#define GL_ARGV_SETAS_CALLERID "callerid" +#define GL_ARGV_SELECT_ALBUM "select-album" +#define GL_ARGV_SELECT_ONE "select-one" +#define GL_ARGV_SELECT_MULTIPLE "select-multiple" +#define GL_ARGV_SELECT_SETAS "select-setas" +#define GL_ARGV_SELECT_RETURN_FOLDER_PATH "folder-path" +#define GL_ARGV_SELECT_RETURN_COUNT "count" +#define GL_ARGV_SELECT_RETURN_PATH "path" +#define GL_ARGV_SETAS_RETURN_CROP_PATH "crop-image-path" +#define GL_ARGV_SETAS_RETURN_PATH "image-path" +#define GL_ARGV_FILE_TYPE_IMAGE "image" +#define GL_ARGV_FILE_TYPE_VIDEO "video" +#define GL_ARGV_FILE_TYPE_ALL "all" +#define GL_ARGC_SELECTED_FILES "Selected index" +#define GL_ARGV_IV_INDEX_VALUE "1" +#define GL_ARGV_DRM_TRUE "true" + +#define GL_ARGV_SETAS_RETURN_HOMESCREEN_PATH_FROM_IV "homescreen_path" + +static void __gl_ext_destroy_ug(void *data) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK(ad->uginfo.ug_called_by_me); + int view_mode = gl_get_view_mode(data); + gl_dbg("View mode: %d", view_mode); + + ug_destroy(ad->uginfo.ug_called_by_me); + ad->uginfo.ug_called_by_me = NULL; + + bool is_slideshow = false; + if (ad->uginfo.ug_type == GL_UG_IMAGEVIEWER && + ad->uginfo.iv_type != GL_UG_IV) + is_slideshow = true; + /* Clear type first */ + ad->uginfo.ug_type = -1; + ad->uginfo.iv_type = -1; + + /* Show cursor and IMF if not popup showed */ + if (ad->entryinfo.editfield) + _gl_editfield_show_imf(ad); + + /** + * If (1) view_mode is set as GL_VIEW_THUMBS in gridview, + * It means ug_called_by_me is ImageViewer UG. + */ + if (view_mode == GL_VIEW_THUMBS) { + if (!is_slideshow) + gl_update_view(data, GL_UPDATE_VIEW_NORMAL); + } +} + +static void __gl_ext_ug_layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) +{ + gl_dbg(""); + GL_CHECK(ug); + GL_CHECK(priv); + + Evas_Object *base = NULL; + base = ug_get_layout(ug); + if (!base) { + gl_dbgE("ug_get_layout failed!"); + ug_destroy(ug); + return; + } + gl_appdata *ad = (gl_appdata *)priv; + + switch (mode) { + case UG_MODE_FULLVIEW: + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + /* Disable effect when AUL, other show effect */ + /* Disable effect according to IV for descresing launching time */ + if((ad->albuminfo.aul_launch_type != GL_AUL_T_NONE && + ad->albuminfo.aul_launch_type != GL_AUL_T_VIEW_ALBUM) || + ad->uginfo.ug_type == GL_UG_IMAGEVIEWER) { + gl_dbg("No animation."); + ug_disable_effect(ug); + } + evas_object_show(base); + break; + default: + break; + } +} + +static void __gl_ext_ug_result_cb(ui_gadget_h ug, service_h result, void *priv) +{ + GL_CHECK(priv); + gl_dbg(""); +} + +static void __gl_ext_ug_destroy_cb(ui_gadget_h ug, void *priv) +{ + GL_CHECK(priv); + gl_appdata *ad = (gl_appdata *)priv; + gl_dbg(""); + + if(ad->albuminfo.aul_launch_type == GL_AUL_T_NONE || + ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { + GL_CHECK(ad->uginfo.ug_called_by_me); + __gl_ext_destroy_ug(ad); + } else { + GL_CHECK(ug); + gl_dbg("Destroy Gallery UG directly."); + /* init launch-type after gallery-ug is closed */ + ad->albuminfo.aul_launch_type = GL_AUL_T_NONE; + + ug_destroy(ug); + ad->uginfo.gallery_ug_called_by_me = NULL; + + elm_win_lower(ad->maininfo.win); + gl_dbg("Pause Gallery App."); + } +} + +static char **__gl_ext_get_select_index(void *data, int *size) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_NULL(ad->selectedinfo.medias_elist); + gl_item *current = NULL; + char *index = NULL; + int i = 0; + char **media_index = NULL; + int pos = 0; + int sel_cnt = _gl_data_selected_list_count(ad); + + media_index = (char **)calloc(sel_cnt, sizeof(char *)); + GL_CHECK_NULL(media_index); + gl_dbg("select media count: %d", sel_cnt); + + for (i = 0; i < sel_cnt; ++i) { + _gl_data_get_item_by_index(ad, i+1, true, ¤t); + index = (char *)calloc(1, GL_INTERGER_LEN_MAX); + if (current == NULL || current->item == NULL || index == NULL) { + for (pos = 0; pos < i; ++pos) { + GL_FREEIF(media_index[pos]); + } + + GL_FREEIF(index); + GL_FREE(media_index); + return NULL; + } + gl_dbg("Sequence: %d", current->sequence); + snprintf(index, GL_INTERGER_LEN_MAX, "%d", + current->sequence - 1); + media_index[i] = index; + index = NULL; + } + + if (size) + *size = sel_cnt; + + return media_index; +} + +static int __gl_ext_add_sortby(service_h service, int sort) +{ + GL_CHECK_VAL(service, GL_UG_FAIL); + + switch (sort) { + case GL_SORT_BY_NAME_DESC: + /* Sort by display name descending */ + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_NAMEDESC); + gl_dbg("Name descending"); + break; + case GL_SORT_BY_NAME_ASC: + /* Sort by display name ascending */ + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_NAME); + gl_dbg("Name ascending"); + break; + case GL_SORT_BY_DATE_DESC: + /* Sort by modified_date descending */ + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_DATEDESC); + gl_dbg("Date descending"); + break; + case GL_SORT_BY_DATE_ASC: + /* Sort by modified_date ascending */ + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_DATE); + gl_dbg("Date ascending"); + break; + default: + /* No Sort, use GL_SORT_BY_NAME_ASC */ + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_NAME); + gl_dbg("no sort, use default Name ascending"); + break; + } + return 0; +} + +/* Slideshow selected images */ +static int __gl_ext_slideshow_selected(void *data, service_h service) +{ + GL_CHECK_VAL(service, GL_UG_FAIL); + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + char **media_index = NULL; + int media_size = 0; + + media_index = __gl_ext_get_select_index(ad, &media_size); + if (media_index == NULL) { + gl_dbgE("Invalid select index!"); + return GL_UG_FAIL; + } + gl_dbg("Set selected medias, media_index[%p], size[%d]", media_index, + media_size); + service_add_extra_data_array(service, GL_ARGC_SELECTED_FILES, + (const char **)media_index, media_size); + /*free space of the medias index*/ + int i = 0; + for (i = 0; i < media_size; ++i) { + GL_FREEIF(media_index[i]); + } + GL_FREE(media_index); + media_index = NULL; + + service_add_extra_data(service, GL_ARGV_IV_INDEX, + GL_ARGV_IV_INDEX_VALUE); + return GL_UG_SUCCESS; +} + +static int __gl_ext_set_thumbs_mode(void *data, service_h service, int type) +{ + GL_CHECK_VAL(service, GL_UG_FAIL); + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d", view_mode); + + /* 2.0, Local file */ + if (GL_UG_IV_SLIDESHOW == type || + GL_UG_IV_SLIDESHOW_SELECTED == type) + service_add_extra_data(service, GL_ARGV_IV_VIEW_MODE, + GL_ARGV_IV_VIEW_SLIDESHOW); + else + service_add_extra_data(service, GL_ARGV_IV_VIEW_MODE, + GL_ARGV_IV_VIEW_GALLERY); + + switch (view_mode) { + case GL_VIEW_THUMBS: + case GL_VIEW_THUMBS_EDIT: + /* Type according to different seg. */ + if (ad->gridinfo.view_mode == GL_THUMB_IMAGES) { + service_add_extra_data(service, GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_IMAGE); + gl_dbg("Media type: Image"); + } else if (ad->gridinfo.view_mode == GL_THUMB_VIDEOS) { + service_add_extra_data(service, GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_VIDEO); + gl_dbg("Media type: Video"); + } else { + service_add_extra_data(service, GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_ALL); + gl_dbg("Media type: All"); + } + break; + default: + service_add_extra_data(service, GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_ALL); + gl_dbg("Media type: All"); + break; + } + return GL_UG_SUCCESS; +} +static int __gl_ext_albums_set_iv(void *data, service_h service, int type) +{ + GL_CHECK_VAL(service, GL_UG_FAIL); + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->albuminfo.current_album, GL_UG_FAIL); + gl_cluster *cur_album = ad->albuminfo.current_album; + gl_dbg("type: %d", type); + + /* 2.0, Local file */ + if (__gl_ext_set_thumbs_mode(data, service, type) == GL_UG_FAIL) + return GL_UG_FAIL; + + if (ad->gridinfo.grid_type == GL_GRID_T_ALLALBUMS) { + /* 2.1, 'All' album->thumbnails view */ + service_add_extra_data(service, GL_ARGV_IV_VIEW_BY, + GL_ARGV_IV_VIEW_BY_ALL); + gl_dbg("View By: All"); + } else { + /* 2.3, Other albums->thumbnails view */ + service_add_extra_data(service, GL_ARGV_IV_VIEW_BY, + GL_ARGV_IV_VIEW_BY_FOLER); + gl_dbg("View By: By Folder"); + } + + if (cur_album->cluster && cur_album->cluster->uuid) { + gl_dbg("album id: %s", cur_album->cluster->uuid); + service_add_extra_data(service, GL_ARGV_IV_ALBUM_INDEX, + cur_album->cluster->uuid); + } + return GL_UG_SUCCESS; +} + +static int __gl_ext_tags_set_iv(void *data, service_h service, int type) +{ + GL_CHECK_VAL(service, GL_UG_FAIL); + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->taginfo.current_tag, GL_UG_FAIL); + gl_dbg("type: %d", type); + + if (__gl_ext_set_thumbs_mode(data, service, type) == GL_UG_FAIL) + return GL_UG_FAIL; + + /* 2.4, Tags->thumbnails view */ + gl_tag *cur_tag = ad->taginfo.current_tag; + if (cur_tag->tag && cur_tag->tag->tag_name) { + if (cur_tag->tag->_id == GL_TAG_FAVORITES_ID) { + /* 2.4.1, Favourites tag->thumbnails view */ + service_add_extra_data(service, GL_ARGV_IV_VIEW_BY, + GL_ARGV_IV_VIEW_BY_FAVOR); + gl_dbg("View By: Favorites"); + } else { + /* 2.4.2, Normal tag->thumbnails view */ + service_add_extra_data(service, GL_ARGV_IV_VIEW_BY, + GL_ARGV_IV_VIEW_BY_TAGS); + gl_dbg("View By: Tags"); + } + + service_add_extra_data(service, GL_ARGV_IV_TAG_NAME, + cur_tag->tag->tag_name); + } else { + gl_dbgE("Invalid tag!"); + return GL_UG_FAIL; + } + return GL_UG_SUCCESS; +} + +/* Invoke Imageviewer UG */ +int gl_ext_load_iv_ug(void *data, gl_item *item, gl_ext_iv_type type) +{ + GL_CHECK_VAL(item, GL_UG_FAIL); + GL_CHECK_VAL(item->item, GL_UG_FAIL); + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.win, GL_UG_FAIL); + Evas_Object *win = ad->maininfo.win; + struct ug_cbs cbs; + ui_gadget_h ug = NULL; + service_h service = NULL; + gl_dbg("type: %d", type); + + if (ad->uginfo.ug_called_by_me) { + gl_dbgE("Already exits some UG called by me, type(%d)!", type); + return GL_UG_FAIL; + } + + memset(&cbs, 0x00, sizeof(struct ug_cbs)); + cbs.layout_cb = __gl_ext_ug_layout_cb; + cbs.result_cb = __gl_ext_ug_result_cb; + cbs.destroy_cb = __gl_ext_ug_destroy_cb; + cbs.priv = ad; + + service_create(&service); + GL_CHECK_VAL(service, GL_UG_FAIL); + + UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE); + ad->uginfo.ug_type = GL_UG_IMAGEVIEWER; + ad->uginfo.iv_type = type; + + int ret = GL_UG_FAIL; + switch (ad->ctrlinfo.tab_mode) { + case GL_CTRL_TAB_ALBUMS: + ret = __gl_ext_albums_set_iv(data, service, type); + break; + case GL_CTRL_TAB_TAGS: + ret = __gl_ext_tags_set_iv(data, service, type); + break; + default: + gl_dbgE("Wrong tab mode!"); + } + + if (ret == GL_UG_FAIL) { + gl_dbgW("Service data setting failed!"); + service_destroy(service); + return GL_UG_FAIL; + } + + service_add_extra_data(service, GL_ARGV_IV_PATH, item->item->file_url); + + /* Sort by type */ + __gl_ext_add_sortby(service, ad->uginfo.sort_type); + + if (type == GL_UG_IV_SLIDESHOW_SELECTED) { + if (__gl_ext_slideshow_selected(ad, service) == GL_UG_FAIL) { + gl_dbgE("Failed to slideshow selected files!"); + service_destroy(service); + return GL_UG_FAIL; + } + } else if (type == GL_UG_IV || type == GL_UG_IV_SLIDESHOW) { + char sequence_str[GL_INTERGER_LEN_MAX] = { 0, }; + eina_convert_itoa(item->sequence, sequence_str); + gl_dbg("sequence : %s", sequence_str); + service_add_extra_data(service, GL_ARGV_IV_INDEX, sequence_str); + } + + ug = ug_create(NULL, GL_UG_PKG_IV, UG_MODE_FULLVIEW, service, &cbs); + ad->uginfo.ug_called_by_me = ug; + service_destroy(service); + + if (ug) { + return GL_UG_SUCCESS; + } else { + gl_dbgE("ug_create failed!"); + return GL_UG_FAIL; + } +} + +int gl_ext_load_ug(void *data, gl_ext_ug_type type) +{ + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.win, GL_UG_FAIL); + struct ug_cbs cbs; + ui_gadget_h ug = NULL; + service_h service = NULL; + Evas_Object *win = ad->maininfo.win; + int view_m = gl_get_view_mode(ad); + gl_dbg("view_m: %d", view_m); + + if (ad->uginfo.ug_called_by_me) { + gl_dbg("Already exits some UG, Request type(%d)", type); + return GL_UG_FAIL; + } + + ad->uginfo.ug_type = type; + + memset(&cbs,0x00,sizeof(struct ug_cbs)); + char *filepath_arg = NULL; + + cbs.layout_cb = __gl_ext_ug_layout_cb; + cbs.result_cb = __gl_ext_ug_result_cb; + cbs.destroy_cb = __gl_ext_ug_destroy_cb; + cbs.priv = ad; + + service_create(&service); + GL_CHECK_VAL(service, GL_UG_FAIL); + + UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE); + + int sel_cnt = 0; + char count_arg[GL_EXT_STR_COUNT_LEN] = { 0, }; + switch (type) { + case GL_UG_MSG: + _gl_get_selected_paths(ad, GL_SEPERATOR_MAIL, &filepath_arg, + NULL); + if(filepath_arg == NULL) + goto EXT_UG_FAILED; + + service_add_extra_data(service, GL_ARGV_MSG_ATTACHFILE, + filepath_arg); + + ug = ug_create(NULL, GL_UG_PKG_MESSAGE, + UG_MODE_FULLVIEW, service, &cbs); + break; + case GL_UG_EMAIL: + _gl_get_selected_paths(ad, GL_SEPERATOR_MAIL, &filepath_arg, + NULL); + if(filepath_arg == NULL) + goto EXT_UG_FAILED; + + service_add_extra_data(service, GL_ARGV_EMAIL_RUN_TYPE, + GL_ARGV_EMAIL_RUN_5); + service_add_extra_data(service, GL_ARGV_EMAIL_ATTACHMENT, + filepath_arg); + + ug = ug_create(NULL, GL_UG_PKG_EMAIL, UG_MODE_FULLVIEW, + service, &cbs); + break; + case GL_UG_BT: + _gl_get_selected_paths(ad, GL_SEPERATOR_BT, &filepath_arg, + &sel_cnt); + if(filepath_arg == NULL) + goto EXT_UG_FAILED; + + service_add_extra_data(service, GL_ARGV_BT_LAUNCH_TYPE, + GL_ARGV_BT_LAUNCH_SEND); + + snprintf(count_arg, sizeof(count_arg), "%d", sel_cnt); + service_add_extra_data(service, GL_ARGV_BT_FILECOUNT, + count_arg); + + service_add_extra_data(service, GL_ARGV_BT_FILES, filepath_arg); + + ug = ug_create(NULL, GL_UG_PKG_BLUETOOTH, UG_MODE_FULLVIEW, + service, &cbs); + break; + default: + gl_dbgE("Wrong UG type!"); + goto EXT_UG_FAILED; + } + + if (filepath_arg) { + g_free(filepath_arg); + filepath_arg = NULL; + } + + ad->uginfo.ug_called_by_me = ug; + service_destroy(service); + + if (ug) { + gl_dbgW("ug_create success!"); + return GL_UG_SUCCESS; + } else { + gl_dbgE("ug_create failed!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_APPLICATION_NOT_INSTALLED); + return GL_UG_FAIL; + } + + EXT_UG_FAILED: + + gl_dbgE("EXT_UG_FAILED!"); + service_destroy(service); + return GL_UG_FAIL; +} + +static void __gl_ext_gallery_ug_result_cb(ui_gadget_h ug, service_h result, + void *priv) +{ + GL_CHECK(priv); + gl_appdata *ad = (gl_appdata *)priv; + char *ret_str = NULL; + int service_ret = -1; + service_h service = ad->albuminfo.recv_service; + service_h reply = NULL; + bool b_reply = false; + gl_dbg(""); + + if (service_create(&reply) != SERVICE_ERROR_NONE) { + gl_dbgE("service_create failed!"); + return; + } + GL_CHECK(reply); + + switch(ad->albuminfo.aul_launch_type) { + case GL_AUL_T_SELECT_ALBUM: + service_get_extra_data(result, + GL_ARGV_SELECT_RETURN_FOLDER_PATH, + &ret_str); + if(ret_str) { + gl_dbg("return folder-path: %s", ret_str); + service_add_extra_data(reply, SERVICE_DATA_SELECTED, + ret_str); + GL_FREE(ret_str); + b_reply = true; + } + break; + + case GL_AUL_T_SELECT_ONE: + service_get_extra_data(result, GL_ARGV_SELECT_RETURN_PATH, + &ret_str); + if(ret_str) { + gl_dbg("return path: %s", ret_str); + service_add_extra_data(reply, SERVICE_DATA_SELECTED, + ret_str); + GL_FREE(ret_str); + b_reply = true; + } + break; + + case GL_AUL_T_SELECT_MULTIPLE: + service_get_extra_data(result, GL_ARGV_SELECT_RETURN_COUNT, + &ret_str); + if(ret_str) { + gl_dbg("return count: %s", ret_str); + service_add_extra_data(reply, + GL_ARGV_SELECT_RETURN_COUNT, + ret_str); + GL_FREE(ret_str); + b_reply = true; + } + + service_get_extra_data(result, GL_ARGV_SELECT_RETURN_PATH, + &ret_str); + if(ret_str) { + gl_dbg("return path: %s", ret_str); + service_add_extra_data(reply, SERVICE_DATA_SELECTED, + ret_str); + GL_FREE(ret_str); + b_reply = true; + } + break; + + case GL_AUL_T_SELECT_SETAS: + service_get_extra_data(result, GL_ARGV_SETAS_RETURN_PATH, + &ret_str); + if(ret_str) { + gl_dbg("return image-path: %s", ret_str); + service_add_extra_data(reply, GL_ARGV_SETAS_RETURN_PATH, + ret_str); + GL_FREE(ret_str); + b_reply = true; + } + + /* When IV ug returns "crop_image_path" */ + service_get_extra_data(result, GL_ARGV_SETAS_RETURN_CROP_PATH, &ret_str); + if (ret_str && + (ad->albuminfo.aul_setas_type == GL_AUL_SETAS_T_CALLER_ID || + ad->albuminfo.aul_setas_type == GL_AUL_SETAS_T_CROP_WALLPAPER)) { + gl_dbg("return image-path: %s", ret_str); + service_add_extra_data(reply, + GL_ARGV_SETAS_RETURN_CROP_PATH, + ret_str); + GL_FREE(ret_str); + b_reply = true; + } + + /* When IV ug returns "homescreen_path" */ + service_get_extra_data(result, GL_ARGV_SETAS_RETURN_HOMESCREEN_PATH_FROM_IV, &ret_str); + if (ret_str && + ad->albuminfo.aul_setas_type == GL_AUL_SETAS_T_WALLPAPER) { + gl_dbg("return image-path: %s", ret_str); + service_add_extra_data(reply, GL_ARGV_SETAS_RETURN_HOMESCREEN_PATH_FROM_IV, ret_str); + GL_FREE(ret_str); + b_reply = true; + } + break; + + default: + break; + } + + /* Send result to caller */ + if(b_reply) { + service_ret = service_reply_to_launch_request(reply, service, + SERVICE_RESULT_SUCCEEDED); + } else { + gl_dbgE("service_get_extra_data failed!"); + service_ret = service_reply_to_launch_request(reply, service, + SERVICE_RESULT_CANCELED); + } + + service_destroy(reply); + if (service_ret != SERVICE_ERROR_NONE) + gl_dbgE("service_reply_to_launch_request failed!"); +} + +int gl_ext_load_gallery_ug(void *data) +{ + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + struct ug_cbs cbs; + ui_gadget_h ug = NULL; + service_h service = NULL; + Evas_Object *win = ad->maininfo.win; + int launch_type = 0; + int setas_type = 0; + int file_type = 0; + char *val = NULL; + + if (ad->uginfo.gallery_ug_called_by_me) { + gl_dbgW("Gallery UG called by me, destroy it first!"); + ug_destroy(ad->uginfo.gallery_ug_called_by_me); + ad->uginfo.gallery_ug_called_by_me = NULL; + } + + memset(&cbs, 0x00, sizeof(struct ug_cbs)); + + cbs.layout_cb = __gl_ext_ug_layout_cb; + cbs.result_cb = __gl_ext_gallery_ug_result_cb; + cbs.destroy_cb = __gl_ext_ug_destroy_cb; + cbs.priv = ad; + + service_create(&service); + GL_CHECK_VAL(service, GL_UG_FAIL); + + UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE); + + /* add launch-type */ + launch_type = ad->albuminfo.aul_launch_type; + gl_dbg("launch-type: %d", launch_type); + switch (launch_type) { + case GL_AUL_T_SELECT_ONE: + service_add_extra_data(service, GL_ARGV_LAUNCH_TYPE, + GL_ARGV_SELECT_ONE); + break; + case GL_AUL_T_SELECT_MULTIPLE: + service_add_extra_data(service, GL_ARGV_LAUNCH_TYPE, + GL_ARGV_SELECT_MULTIPLE); + break; + case GL_AUL_T_SELECT_SETAS: + service_add_extra_data(service, GL_ARGV_LAUNCH_TYPE, + GL_ARGV_SELECT_SETAS); + + setas_type = ad->albuminfo.aul_setas_type; + gl_dbg("setas-type: %d", setas_type); + switch(setas_type) { + case GL_AUL_SETAS_T_WALLPAPER: + case GL_AUL_SETAS_T_CROP_WALLPAPER: + if (setas_type == GL_AUL_SETAS_T_WALLPAPER) { + service_add_extra_data(service, + GL_ARGV_SETAS_TYPE, + GL_ARGV_SETAS_WALLPALER); + } else if ( setas_type == GL_AUL_SETAS_T_CROP_WALLPAPER ) { + service_add_extra_data(service, + GL_ARGV_SETAS_TYPE, + GL_ARGV_SETAS_CROP_WALLPALER); + } + val = ad->albuminfo.aul_homescreen_path; + if(val) { + gl_dbg("homescreen-path: %s", val); + service_add_extra_data(service, + GL_ARGV_HOMESCREEN_PATH, + val); + } + + val = ad->albuminfo.aul_lockscreen_path; + if(val) { + gl_dbg("lockscreen-path: %s", val); + service_add_extra_data(service, + GL_ARGV_LOCKSCREEN_PATH, + val); + } + + break; + case GL_AUL_SETAS_T_CALLER_ID: + service_add_extra_data(service, GL_ARGV_SETAS_TYPE, + GL_ARGV_SETAS_CALLERID); + val = ad->albuminfo.aul_callid_size; + if(val) { + gl_dbg("callerid-size: %s", val); + service_add_extra_data(service, + GL_ARGV_CALLERID_SIZE, + val); + } + + val = ad->albuminfo.aul_callid_path; + if(val) { + gl_dbg("callerid-path: %s", val); + service_add_extra_data(service, + GL_ARGV_CALLERID_PATH, + val); + } + + break; + default: + gl_dbgE("Undefine mode!"); + service_destroy(service); + return GL_UG_FAIL; + } + + break; + case GL_AUL_T_SELECT_ALBUM: + service_add_extra_data(service, GL_ARGV_LAUNCH_TYPE, + GL_ARGV_SELECT_ALBUM); + break; + default: + gl_dbgE("Undefine mode!"); + service_destroy(service); + return GL_UG_FAIL; + } + + /* add file-type */ + file_type = ad->albuminfo.aul_file_type; + gl_dbg("file-type: %d", file_type); + switch (file_type) { + case GL_AUL_FILE_T_IMAGE: + service_add_extra_data(service, GL_ARGV_FILE_TYPE, + GL_ARGV_FILE_TYPE_IMAGE); + break; + case GL_AUL_FILE_T_VIDEO: + service_add_extra_data(service, GL_ARGV_FILE_TYPE, + GL_ARGV_FILE_TYPE_VIDEO); + break; + case GL_AUL_FILE_T_ALL: + service_add_extra_data(service, GL_ARGV_FILE_TYPE, + GL_ARGV_FILE_TYPE_ALL); + break; + default: + gl_dbgE("Undefine mode!"); + service_destroy(service); + return GL_UG_FAIL; + } + /* add whether contain drm file */ + if (ad->albuminfo.b_show_drm) + service_add_extra_data(service, GL_ARGV_DRM_TYPE, + GL_ARGV_DRM_TRUE); + + ug = ug_create(NULL, GL_UG_PKG_GALLERY, UG_MODE_FULLVIEW, service, + &cbs); + service_destroy(service); + + gl_dbg("ug_create: %p.", ug); + ad->uginfo.gallery_ug_called_by_me = ug; + if (ug) { + Evas_Object *ug_ly = ug_get_layout(ug); + if (ug_ly) { + evas_object_raise(ug_ly); + } else { + gl_dbgE("ug_get_layout failed!"); + return GL_UG_FAIL; + } + return GL_UG_SUCCESS; + } else { + gl_dbgE("ug_create failed!"); + return GL_UG_FAIL; + } +} + +int gl_ext_destroy_gallery_ug(void *data) +{ + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_dbg(""); + gl_appdata *ad = (gl_appdata *)data; + + /* For select appcontrol, destory ug when HOME key is pressed */ + if (ad->albuminfo.aul_launch_type != GL_AUL_T_NONE && + ad->albuminfo.aul_launch_type != GL_AUL_T_VIEW_ALBUM && + ad->uginfo.gallery_ug_called_by_me) { + gl_dbg("To destroy UG"); + __gl_ext_ug_destroy_cb(ad->uginfo.gallery_ug_called_by_me, ad); + } else { + gl_dbg("AUL none"); + } + + return GL_UG_SUCCESS; +} + diff --git a/src/util/gl-fs.c b/src/util/gl-fs.c new file mode 100755 index 0000000..ef58fd6 --- /dev/null +++ b/src/util/gl-fs.c @@ -0,0 +1,683 @@ +/* + * Copyright (c) 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 "gl-fs.h" +#include "gallery.h" +#include "gl-debug.h" + +static int __gl_fs_free_node(gl_node_info_s *pnode) +{ + GL_CHECK_VAL(pnode, -1); + if (pnode->path) { + g_free(pnode->path); + pnode->path = NULL; + } + if (pnode->name) { + g_free(pnode->name); + pnode->name = NULL; + } + g_free(pnode); + return 0; +} + +static int __gl_fs_clear_list(Eina_List **elist) +{ + GL_CHECK_VAL(elist, -1); + gl_node_info_s *pnode = NULL; + if (*elist) { + EINA_LIST_FREE(*elist, pnode) { + __gl_fs_free_node(pnode); + pnode = NULL; + } + *elist = NULL; + } + return 0; +} + +/* Append bigger one, prepend smaller one, first node is oldest one */ +static int __gl_fs_compare(const void *data1, const void *data2) +{ + gl_node_info_s *pnode1 = (gl_node_info_s *)data1; + gl_node_info_s *pnode2 = (gl_node_info_s *)data2; + + int ret = -(pnode1->mtime - pnode2->mtime); + gl_dbg("mtime1[%d], mtime2[%d], ret[%d]", pnode1->mtime, pnode2->mtime, + ret); + return ret; +} + +static int __gl_fs_read_dir(char *path, Eina_List **dir_list, + Eina_List **file_list) +{ + GL_CHECK_VAL(file_list, -1); + GL_CHECK_VAL(dir_list, -1); + GL_CHECK_VAL(path, -1); + + DIR *pdir = NULL; + struct dirent *ent = NULL; + int count = 0; + char *childpath = NULL; + int cp_len = 0; + gl_node_info_s *pnode = NULL; + int copiednum = 0; + + pdir = opendir(path); + GL_CHECK_VAL(pdir, -1); + + while ((ent = readdir(pdir)) != NULL) { + if (g_strcmp0(ent->d_name, ".") == 0 || + g_strcmp0(ent->d_name, "..") == 0) { + continue; + } + /*only deal with dirs and regular files*/ + if ((ent->d_type & DT_DIR) == 0 && (ent->d_type & DT_REG) == 0) + continue; + + /*get date & size*/ + cp_len = strlen(path) + 1 + strlen(ent->d_name) + 1; + childpath = g_new0(char, cp_len); + if (childpath == NULL) + continue; + + copiednum = g_snprintf(childpath, cp_len, "%s/%s", path, + ent->d_name); + if (copiednum < 0) { + g_free(childpath); + childpath = NULL; + continue; + } + + pnode = g_new0(gl_node_info_s, 1); + if (pnode == NULL) { + g_free(childpath); + childpath = NULL; + continue; + } + /*get path*/ + pnode->path = g_strdup(path); + /*get name*/ + pnode->name = g_strdup(ent->d_name); + + if (_gl_fs_get_file_stat(childpath, &pnode) < 0) { + g_free(pnode); + pnode = NULL; + g_free(childpath); + childpath = NULL; + continue; + } + g_free(childpath); + childpath = NULL; + + if (ent->d_type & DT_DIR) + *dir_list = eina_list_append(*dir_list, pnode); + else + *file_list = eina_list_append(*file_list, pnode); + count++; + } + closedir(pdir); + + return 0; +} + +static int __gl_fs_get_file_list(GString *folder_name, Eina_List **dir_list, + Eina_List **file_list) +{ + GL_CHECK_VAL(folder_name, -1); + GL_CHECK_VAL(folder_name->str, -1); + GL_CHECK_VAL(folder_name->len, -1); + return __gl_fs_read_dir(folder_name->str, dir_list, file_list); +} + +/* Get sorted folders list by folder's modified time */ +static long long __gl_fs_sort_folders_by_mtime(char *path, + Eina_List **sorted_list) +{ + if (!ecore_file_is_dir(path)) { + gl_dbgE("Not a directory!"); + return 0; + } + + long long size = 0; + long long sub_size = 0; + GString *fullpath = g_string_new(path); + Eina_List *dir_list = NULL; + Eina_List *file_list = NULL; + int error_code = 0; + error_code = __gl_fs_get_file_list(fullpath, &dir_list, &file_list); + + if (error_code == 0) { + int i = 0; + int dir_cnt = eina_list_count(dir_list); + int file_cnt = eina_list_count(file_list); + gl_node_info_s *pnode = NULL; + for (i = 0; i < file_cnt; i++) { + pnode = (gl_node_info_s *)eina_list_nth(file_list, i); + if (pnode == NULL) { + gl_dbgE("Invalid node!"); + continue; + } + size += pnode->size; + pnode = NULL; + } + gl_dbg("file_cnt[%lld], size[%lld]", file_cnt, size); + + i = 0; + pnode = NULL; + char *sub_folder = NULL; + gl_dbg("dir_cnt[%d]", dir_cnt); + for (i = 0; i < dir_cnt; i++) { + pnode = (gl_node_info_s *)eina_list_nth(dir_list, i); + if (pnode == NULL) { + gl_dbgE("Invalid node!"); + continue; + } + sub_folder = g_strconcat(pnode->path, "/", pnode->name, + NULL); + if (sub_folder) { + gl_dbg("sub_folder[%s]", pnode->name); + sub_size = __gl_fs_sort_folders_by_mtime(sub_folder, + sorted_list); + pnode->size = sub_size; + size += sub_size; + gl_dbg("mtime[%d]", pnode->mtime); + *sorted_list = eina_list_sorted_insert(*sorted_list, + __gl_fs_compare, + pnode); + g_free(sub_folder); + sub_folder = NULL; + } else { + gl_dbgE("Invalid sub folder!"); + } + pnode = NULL; + } + } + + if (fullpath) { + g_string_free(fullpath, true); + fullpath = NULL; + } + + if (file_list) + __gl_fs_clear_list(&file_list); + + if (dir_list) { + eina_list_free(dir_list); + dir_list = NULL; + } + + return size; +} + +static unsigned long long __gl_fs_get_free_space(int state) +{ + struct statvfs info; + char *path = NULL; + + if (state == GL_STORE_T_PHONE) + path = GL_ROOT_PATH_PHONE; + else if (state == GL_STORE_T_MMC) + path = GL_ROOT_PATH_MMC; + else + return 0; + + if (-1 == statvfs(path, &info)) + return 0; + + return ((unsigned long long)(info.f_bsize)) * ((unsigned long long)(info.f_bavail)); +} + +int _gl_fs_get_file_stat(const char *filename, gl_node_info_s **node) +{ + struct stat statbuf; + GL_CHECK_VAL(node, -1); + GL_CHECK_VAL(*node, -1); + GL_CHECK_VAL(filename, -1); + + if (stat(filename, &statbuf) == -1) + return -1; + + /* total size, in bytes */ + (*node)->size = statbuf.st_size; + (*node)->mtime = statbuf.st_mtime; + return 0; +} + +long long _gl_fs_get_folder_size(char *path) +{ + if (!ecore_file_is_dir(path)) { + gl_dbgE("Not a directory!"); + return 0; + } + + long long size = 0; + long long sub_size = 0; + GString *fullpath = g_string_new(path); + Eina_List *file_list = NULL; + Eina_List *dir_list = NULL; + int error_code = 0; + error_code = __gl_fs_get_file_list(fullpath, &dir_list, &file_list); + + if (error_code == 0) { + int i = 0; + int dir_cnt = eina_list_count(dir_list); + int file_cnt = eina_list_count(file_list); + gl_node_info_s *pnode = NULL; + for (i = 0; i < file_cnt; i++) { + pnode = (gl_node_info_s *)eina_list_nth(file_list, i); + if (pnode == NULL) { + gl_dbgE("Invalid node!"); + continue; + } + size += pnode->size; + pnode = NULL; + } + gl_dbg("file_cnt[%d], size[%d]", file_cnt, size); + + gl_dbg("dir_cnt[%d]", dir_cnt); + i = 0; + pnode = NULL; + char *sub_folder = NULL; + for (i = 0; i < dir_cnt; i++) { + pnode = (gl_node_info_s *)eina_list_nth(dir_list, i); + if (pnode == NULL) { + gl_dbgE("Invalid node!"); + continue; + } + sub_folder = g_strconcat(pnode->path, "/", pnode->name, + NULL); + if (sub_folder) { + gl_dbg("sub_folder[%s]", pnode->name); + sub_size = _gl_fs_get_folder_size(sub_folder); + pnode->size = sub_size; + size += sub_size; + gl_dbg("mtime[%d]", pnode->mtime); + g_free(sub_folder); + sub_folder = NULL; + } else { + gl_dbgE("Invalid sub folder!"); + } + pnode = NULL; + } + } + + if (fullpath) { + g_string_free(fullpath, true); + fullpath = NULL; + } + + if (file_list) + __gl_fs_clear_list(&file_list); + + if (dir_list) + __gl_fs_clear_list(&dir_list); + return size; +} + +int _gl_fs_rm_folder(char *path, long long cut_size, long long max_size, + unsigned int expired_time) +{ + GL_CHECK_VAL(path, -1); + gl_node_info_s *pnode = NULL; + Eina_List *dir_list = NULL; + Eina_List *l = NULL; + long long size = 0; + gl_dbg("Size cut/max[%lld/%lld]", cut_size, max_size); + + size = __gl_fs_sort_folders_by_mtime(path, &dir_list); + GL_CHECK_VAL(dir_list, -1); + + char *folder = NULL; + long long _cut_size = 0; + if (size > max_size) + _cut_size = size - max_size + cut_size; + else if (size + cut_size > max_size) + _cut_size = cut_size; + gl_dbg("Size cut/total[%lld/%lld]", _cut_size, size); + + unsigned int current_t = 0; + struct timeval tv; + gettimeofday(&tv, NULL); + current_t = tv.tv_sec + tv.tv_usec / GL_TIME_USEC_PER_SEC; + gl_dbg("current time[%d], expired time[%d]", current_t, expired_time); + long long rm_size = 0; + + EINA_LIST_FOREACH(dir_list, l, pnode) { + if (pnode == NULL || pnode->path == NULL || pnode->name == NULL) + continue; + + /* Get full path of folder */ + folder = g_strconcat(pnode->path, "/", pnode->name, NULL); + if (folder == NULL) + continue; + + gl_dbg("mtime[%d], path[%s]", pnode->mtime, folder); + if (pnode->mtime + expired_time < current_t) { + /* Remove folder */ + gl_dbgW("Remove!"); + ecore_file_recursive_rm(folder); + g_free(folder); + folder = NULL; + rm_size += pnode->size; + continue; + } else if (_cut_size == 0 || rm_size >= _cut_size) { + gl_dbgW("Done!"); + break; + } + + /* Remove folder */ + ecore_file_recursive_rm(folder); + g_free(folder); + folder = NULL; + + gl_dbg("size[cut/dir]=%lld/%lld", _cut_size, pnode->size); + if (pnode->size >= _cut_size) { + gl_dbgW("Done!"); + break; + } + + pnode = NULL; + } + __gl_fs_clear_list(&dir_list); + return 0; +} + +#ifdef _RENAME_ALBUM_SENSITIVE +bool _gl_fs_check_name_case(char *dir, char *exist_name) +{ + GL_CHECK_FALSE(dir); + GL_CHECK_FALSE(exist_name); + gl_dbg(""); + + char dest_dir[GL_DIR_PATH_LEN_MAX] = {0}; + char dest_filename[GL_FILE_NAME_LEN_MAX] = {0}; + char *tmp = NULL; + tmp = strrchr(dir, '/'); + if (tmp) { + g_strlcpy(dest_filename, tmp + 1, GL_FILE_NAME_LEN_MAX); + tmp[0] = '\0'; + g_strlcpy(dest_dir, dir, GL_DIR_PATH_LEN_MAX); + tmp[0] = '/'; + } else { + return false; + } + + bool ret = false; + Eina_List *name_list = NULL; + if((name_list = ecore_file_ls(dest_dir)) == NULL) { + gl_dbgE("open dir failed!"); + return false; + } else { + char *dir_name = NULL; + EINA_LIST_FREE(name_list, dir_name) { + if (dir_name && + strcasecmp(dir_name, dest_filename) == 0) { + gl_dbg("Have same name directory"); + ret = true; + memset(exist_name, 0x00, GL_ALBUM_NAME_LEN_MAX); + g_strlcpy(exist_name, dir_name, + GL_ALBUM_NAME_LEN_MAX); + break; + } + GL_FREEIF(dir_name); + } + } + return ret; +} +#endif + +bool _gl_fs_is_low_memory(unsigned long long total_size) +{ + unsigned long long free_size = __gl_fs_get_free_space(GL_STORE_T_PHONE); + if (total_size && free_size < total_size) { + gl_dbgE("Low memory: Free(%llu Byte) < required(%llu Byte)!", + free_size, total_size); + return true; + } + + return false; +} + +/* +* return file extension, f.e. jpg; then return new path without ext. +*/ +bool _gl_fs_get_ext(const char *file_path, char *file_ext, char *new_path) +{ + int i = 0; + for (i = strlen(file_path); i >= 0; i--) { + if ((file_path[i] == '.') && (i < GL_FILE_PATH_LEN_MAX)) { + g_strlcpy(file_ext, &file_path[i + 1], GL_FILE_EXT_LEN_MAX); + g_strlcpy(new_path, file_path, i + 1); + new_path[i] = '\0'; + gl_dbg("path without extension :%s", new_path); + return true; + } + + /* meet the dir. no ext */ + if (file_path[i] == '/') + return true; + } + return true; +} + +/* one copy of function "ecore_file_mv" from the file "ecore_file.c" for lock debugging */ +/* +* Use gl_file_mv() to move medias to other album. +* Media-server, which is different with libmedia-info, watches src and dest folder, +* it updates libmedia-info DB asynchronously. +* While move/copy mass data in My Files appliation, +* After move/copy done in My files, check the dest folder in Gallery. +* You'll find its content is changing. +* gl_file_mv() operate libmedia-info DB synchronously, so it's faster than media-server. +*/ + +/* +* stop using "rename" when moving from mmc to phone for correct db update. +*/ +Eina_Bool _gl_fs_move(const char *src, const char *dst) +{ + GL_CHECK_FALSE(src); + GL_CHECK_FALSE(dst); + + gl_dbg("\n\tSrc: %s\n\tDest: %s", src, dst); + /* + * From->To: MMC->MMC or Phone->Phone + */ + if (rename(src, dst)) { + /* + * File cannot be moved directly because + * it resides on a different mount point. + */ + if (errno == EXDEV) { + /* + * From->To: MMC->Phone or Phone->MMC + */ + gl_dbgW("errno = EXDEV(%d): Cross-device link", errno); + struct stat st; + + /* + * Make sure this is a regular file before + * we do anything fancy. + */ + if (stat(src, &st) < 0) { + gl_dbgE("stat fail[%d]!", errno); + return EINA_FALSE; + } + if (S_ISREG(st.st_mode)) { + /* + * Copy to dst file + */ + if (!ecore_file_cp(src, dst)) { + gl_dbgE("Copy file failed[%d]!", errno); + return EINA_FALSE; + } + + + /* + * Delete src file + */ + if (!ecore_file_unlink(src)) + gl_dbgE("Delete file failed[%d]!", errno); + + /* Write file to filesystem immediately */ + sync(); + return EINA_TRUE; + } + gl_dbgE("S_ISREG fail[%d]!", errno); + return EINA_FALSE; + } + + gl_dbgE("Fail[%d]!", errno); + return EINA_FALSE; + } + /* Write file to filesystem immediately */ + sync(); + return EINA_TRUE; +} + +char *_gl_fs_get_unique_full_path(char *file_path, char *ext) +{ + char *file_name = file_path; + char *extension = ext; + char *final_path = NULL; + int final_path_len = 0; + int extension_len = 0; + int suffix_count = 0; + /* means suffix on file name. up to "_99999" */ + const int max_suffix_count = 99999; + /* 1 means "_" */ + int suffix_len = (int)log10(max_suffix_count + 1) + 1; + + if (!file_path) + return NULL; + + gl_dbg("file_path=[%s], ext=[%s]", file_path, ext); + + if (extension) + extension_len = strlen(extension); + + /* first 1 for ".", last 1 for NULL */ + final_path_len = strlen(file_name) + 1 + suffix_len + extension_len + 1; + + final_path = (char*)calloc(1, final_path_len); + if (!final_path) { + gl_dbgE("calloc failed!"); + return NULL; + } + + do { + /* e.g) /tmp/abc.jpg + * if there is no extension name, just make a file name without extension */ + if (0 == extension_len) { + if (suffix_count == 0) { + snprintf(final_path, final_path_len, "%s", + file_name); + } else { + snprintf(final_path, final_path_len, "%s_%d", + file_name, suffix_count); + } + } else { + if (suffix_count == 0) { + snprintf(final_path, final_path_len, "%s.%s", + file_name, extension); + } else { + snprintf(final_path, final_path_len, "%s_%d.%s", + file_name, suffix_count, extension); + } + } + + if (ecore_file_exists(final_path)) { + suffix_count++; + if (suffix_count > max_suffix_count) { + gl_dbgE("Max suffix count!"); + GL_FREE(final_path); + break; + } else { + memset(final_path, 0x00, final_path_len); + continue; + } + } + + break; + } while (1); + + gl_dbg("Decided path = [%s]", final_path); + return final_path; +} + +bool _gl_fs_validate_name(const char *new_name) +{ + GL_CHECK_FALSE(new_name); + char invalid_chars[] = { '/', '\\', ':', '*', '?', '"', '<', '>', '|', '\0' }; + char *ptr = invalid_chars; + + gl_dbg("new album name is %s\n", new_name); + while (*ptr != '\0') + { + gl_dbg("invalid character is %c", *ptr); + if (strchr(new_name, (*ptr)) != NULL) + { + return false; + } + ++ptr; + } + + return true; +} + +int _gl_fs_get_default_folder(char *path) +{ + int len = 0; + GL_CHECK_VAL(path, -1); + + len = snprintf(path, GL_DIR_PATH_LEN_MAX, "%s", + GL_ROOT_PATH_PHONE); + if (len < 0) { + gl_dbgE("snprintf returns failure!"); + return -1; + } else { + path[len] = '\0'; + len = -1; + } + + len = g_strlcat(path, GL_DEFAULT_PATH_IMAGES, + GL_DIR_PATH_LEN_MAX); + if (len >= GL_DIR_PATH_LEN_MAX) { + gl_dbgE("strlcat returns failure(%d)!", len); + return -1; + } + gl_dbg("Default images path: %s.", path); + + return 0; +} + +bool _gl_fs_mkdir(const char *path) +{ + GL_CHECK_FALSE(path); + struct stat st; + if (stat(path, &st) < 0) { + if (!ecore_file_mkpath(path)) { + gl_dbgE("Failed to mkdir!"); + return false; + } + } + return true; +} + diff --git a/src/util/gl-lang.c b/src/util/gl-lang.c new file mode 100755 index 0000000..d9959e5 --- /dev/null +++ b/src/util/gl-lang.c @@ -0,0 +1,255 @@ +/* + * Copyright (c) 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 "gallery.h" +#include "gl-lang.h" +#include "gl-strings.h" +#include "gl-popup.h" +#include "gl-ctxpopup.h" +#include "gl-debug.h" +#include "gl-tags.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-progressbar.h" +#include "gl-controlbar.h" +#include "gl-notify.h" +#include "gl-albums-sel.h" +#include "gl-albums-edit.h" +#include "gl-albums-rename.h" +#include "gl-thumbs-sel.h" +#include "gl-thumbs-edit.h" +#include "gl-tags-edit.h" + +static int __gl_lang_update_all_albums_name(void *data); + +static int __gl_lang_update_tabbar(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.ctrlbar, -1); + Evas_Object *ctrlbar = ad->ctrlinfo.ctrlbar; + + /*Reset text for tabbar*/ + Elm_Object_Item *item = NULL; + item = elm_toolbar_first_item_get(ctrlbar); + elm_object_item_text_set(item, GL_STR_CTRL_ITEM_ALBUMS); + char *tab_name = NULL; + int i = GL_CTRL_TAB_TAGS; + for (; i < GL_CTRL_TAB_CNT; ++i) { + item = elm_toolbar_item_next_get(item); + switch (i) { + case GL_CTRL_TAB_TAGS: + tab_name = GL_STR_CTRL_ITEM_TAGS; + break; + default: + break; + } + elm_object_item_text_set(item, tab_name); + } + return 0; +} + +static int __gl_lang_update_albums(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.nf_it, -1); + + __gl_lang_update_tabbar(data); + + /*Album view */ + _gl_ui_set_btns_text(ad->ctrlinfo.nf_it, GL_STR_CAMERA, NULL); + __gl_lang_update_all_albums_name(ad); + return 0; +} + +static int __gl_lang_update_thumb(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->gridinfo.nf_it, -1); + char *title = NULL; + char *btn_text2 = GL_STR_SLIDESHOW; + + switch (ad->ctrlinfo.tab_mode) { + case GL_CTRL_TAB_ALBUMS: { + GL_CHECK_VAL(ad->albuminfo.current_album, -1); + gl_cluster *album = ad->albuminfo.current_album; + GL_CHECK_VAL(album->cluster, -1); + title = _gl_get_i18n_album_name(album); + if (album->cluster->type == GL_STORE_T_ALL) { + title = GL_ALBUM_ALL_NAME; + } else if (album->cluster->type == GL_STORE_T_PHONE || + album->cluster->type == GL_STORE_T_MMC) { + if (_gl_data_is_root_path(album->cluster->path)) { + /* check root case */ + title = GL_ALBUM_PHOME_ROOT_NAME; + } else if (ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { + /* launch by appcontrol */ + if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_IMAGE) + title = GL_ALBUM_IMAGES_NAME; + else if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_VIDEO) + title = GL_ALBUM_VIDEOS_NAME; + else + title = GL_ALBUM_ALL_NAME; + } + } + break; + } + case GL_CTRL_TAB_TAGS: { + Evas_Object *btn = NULL; + btn = elm_object_item_part_content_get(ad->gridinfo.nf_it, + GL_NAVIFRAME_TITLE_RIGHT_BTN); + if (btn) + elm_object_text_set(btn, GL_STR_ADD); + gl_tag *gtag = ad->taginfo.current_tag; + if (gtag && gtag->tag && + gtag->tag->_id == GL_TAG_FAVORITES_ID) { + GL_FREEIF(gtag->tag->tag_name); + gtag->tag->tag_name = strdup(GL_TAG_FAVORITES_NAME); + title = gtag->tag->tag_name; + } + break; + } + default: + gl_dbgE("Error tab mode!"); + return -1; + } + + _gl_ui_set_btns_text(ad->gridinfo.nf_it, GL_STR_EDIT, btn_text2); + + if (title) { + elm_object_item_text_set(ad->gridinfo.nf_it, title); + } + + return 0; +} + +static int __gl_lang_update_all_albums_name(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *album = NULL; + Elm_Object_Item *first_it = NULL; + Elm_Object_Item *next_it = NULL; + Elm_Object_Item *last_it = NULL; + Evas_Object *album_view = NULL; + + if (gl_get_view_mode(ad) == GL_VIEW_ALBUMS) + album_view = ad->albuminfo.albums_view; + else if (gl_get_view_mode(ad) == GL_VIEW_ALBUMS_EDIT) + album_view = ad->ctrlinfo.ctrlbar_edit_view; + GL_CHECK_VAL(album_view, -1); + + first_it = elm_gengrid_first_item_get(album_view); + last_it = elm_gengrid_last_item_get(album_view); + while(first_it) { + album = (gl_cluster *)elm_object_item_data_get(first_it); + if (album == NULL) { + gl_dbgE("Invalid item data!"); + continue; + } + if (!g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) { + GL_FREEIF(album->cluster->display_name); + album->cluster->display_name = strdup(GL_ALBUM_ALL_NAME); + elm_gengrid_item_update(first_it); + } else if (_gl_data_is_default_album(GL_ALBUM_DEFAULT_NAME, album->cluster) || + _gl_data_is_default_album(GL_ALBUM_DOWNLOAD_NAME, album->cluster) || + _gl_data_is_root_path(album->cluster->path)) { + elm_gengrid_item_update(first_it); + } + if (last_it == first_it) { + gl_dbg("Update done!"); + break; + } else { + next_it = elm_gengrid_item_next_get(first_it); + first_it = next_it; + } + album = NULL; + } + return 0; +} + +int _gl_lang_update_thumb_edit_button(void *data, Elm_Object_Item *nf_it) +{ + GL_CHECK_VAL(nf_it, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + char *btn_text = NULL; + char *btn_text2 = NULL; + + btn_text = GL_STR_SHARE; + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_ALBUMS) + btn_text2 = GL_STR_DELETE; + else + btn_text2 = GL_STR_REMOVE; + + _gl_ui_set_btns_text(nf_it, btn_text, btn_text2); + return 0; +} + +int _gl_lang_update(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + + /* Remove ctxpopup */ + _gl_ctxpopup_del(data); + + __gl_lang_update_albums(data); + switch (view_mode) { + case GL_VIEW_ALBUMS: + break; + case GL_VIEW_ALBUMS_EDIT: + _gl_albums_edit_update_lang(data); + break; + case GL_VIEW_ALBUMS_RENAME: + _gl_albums_edit_update_lang(data); + _gl_albums_rename_update_lang(data); + break; + case GL_VIEW_ALBUMS_SELECT: + _gl_tags_update_lang(data); + __gl_lang_update_thumb(data); + _gl_albums_sel_update_lang(data); + break; + case GL_VIEW_TAGS: + _gl_tags_update_lang(data); + _gl_albums_rename_update_lang(data); + break; + case GL_VIEW_TAGS_EDIT: + _gl_tags_edit_update_lang(data); + break; + case GL_VIEW_THUMBS: + __gl_lang_update_thumb(data); + break; + case GL_VIEW_THUMBS_EDIT: + __gl_lang_update_thumb(data); + _gl_thumbs_edit_update_lang(data); + break; + case GL_VIEW_THUMBS_SELECT: + _gl_tags_update_lang(data); + __gl_lang_update_thumb(data); + _gl_albums_sel_update_lang(data); + _gl_thumbs_sel_update_lang(data); + break; + default: + gl_dbgW("Other view_mode[%d]", view_mode); + } + + return 0; +} + diff --git a/src/util/gl-thread-util.c b/src/util/gl-thread-util.c new file mode 100755 index 0000000..a0dfd8e --- /dev/null +++ b/src/util/gl-thread-util.c @@ -0,0 +1,658 @@ +/* + * Copyright (c) 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 "gl-thread-util.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-debug.h" +#include "gl-data.h" +#include "gl-popup.h" +#include "gl-progressbar.h" +#include "gl-strings.h" + +#define GALLERY_MAGIC_MAIN_CONTEXT (0x1983cdaf) +#define GALLERY_MAGIC_DETAIL_LIST_ITEM (0x1977abcd) +#define GALLERY_MAGIC_PIPE_DATA (0x0716ffcc) + +#define GALLERY_MAGIC unsigned int __magic +#define GALLERY_MAGIC_SET(d, m) (d)->__magic = (m) +#define GALLERY_MAGIC_CHECK(d, m) ((d) && ((d)->__magic == (m))) + +typedef struct +{ + GALLERY_MAGIC; + int finished_cnt; + int state; /* 0: operation is over; 1: operation is in process */ + int popup_op; +} gl_thread_pipe_data; + + +static pid_t +_gl_thread_gettid(void) +{ + return syscall(__NR_gettid); +} + +static int _gl_thread_operate_medias(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int ret = -1; + + switch (ad->maininfo.medias_op_type) { + case GL_MEDIA_OP_DELETE: + gl_dbg("Delete!"); + ret = gl_del_selected(data); + break; + case GL_MEDIA_OP_MOVE: + gl_dbg("Move!"); + ret = gl_move_selected(data); + break; + case GL_MEDIA_OP_ADD_TAG: + gl_dbg("Add tag to media!"); + ret = gl_add_tag_to_selected(data); + break; + case GL_MEDIA_OP_REMOVE_TAG: + gl_dbg("Remove tag from media!"); + ret = gl_remove_tag_from_selected(data); + break; +#ifdef _USE_ROTATE_BG + case GL_MEDIA_OP_ROTATING_LEFT: + case GL_MEDIA_OP_ROTATING_RIGHT: + gl_dbg("Rotate!"); + ret = _gl_rotate_selected(data, ad->maininfo.medias_op_type); + break; +#endif + default: + gl_dbgE("Unknow media operation mode!"); + break; + } + + if (ret < 0) { + gl_dbgE("Operation failed!"); + return -1; + } + + return 0; +} + +static int +_gl_thread_update_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + switch (ad->maininfo.medias_op_type) { + case GL_MEDIA_OP_DELETE: + gl_dbg("Delete!"); + gl_update_del_view(data); + break; + case GL_MEDIA_OP_MOVE: + gl_dbg("Move!"); + gl_update_move_view(data); + break; + case GL_MEDIA_OP_ADD_TAG: + gl_dbg("Add tag to media!"); + gl_update_add_tag_view(data); + break; + case GL_MEDIA_OP_REMOVE_TAG: + gl_dbg("Remove tag from media!"); + gl_update_remove_tag_view(data); + break; +#ifdef _USE_ROTATE_BG + case GL_MEDIA_OP_ROTATING_LEFT: + case GL_MEDIA_OP_ROTATING_RIGHT: + gl_dbg("Rotate!"); + _gl_update_rotate_view(data); + break; +#endif + default: + gl_dbgE("Unknow media operation mode!"); + break; + } + + return 0; +} + +static void * +_gl_thread_data_thread(void *data) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + int cancel_flag = 0; + + gl_dbg("@@@@@@@@@@ :::: Child thread ID = %d :::: @@@@@@@@@@", _gl_thread_gettid()); + /* Media movement/deleting operation/add tag/remove tag */ + _gl_thread_operate_medias(data); + /* send finish signal */ + gl_thread_pipe_data pipe_data; + memset(&pipe_data, 0x00, sizeof(gl_thread_pipe_data)); + GALLERY_MAGIC_SET(&pipe_data, GALLERY_MAGIC_PIPE_DATA); + /* Set over state */ + pipe_data.state = 0; + gl_thread_get_cancel_state(ad, &cancel_flag); + + ecore_pipe_write(ad->pbarinfo.sync_pipe, &pipe_data, sizeof(gl_thread_pipe_data)); + + gl_dbg("@@@@@@@@@@ :::: Child thread done :::: @@@@@@@@@@"); + + return (void *)0; +} + +static Eina_Bool _gl_thread_del_pbar_idler_cb(void *data) +{ + gl_dbg("Delete progressbar..."); + GL_CHECK_CANCEL(data); + gl_appdata *ad = (gl_appdata *)data; + /* Reset pb_cancel */ + gl_thread_set_cancel_state(ad, GL_PB_CANCEL_NONE); + /* Operation done, destroy progressbar */ + gl_pb_del_pbar(ad); + + /* Destroy lock */ + gl_thread_destroy_lock(ad); + + if (ad->pbarinfo.del_pbar_idler) { + ecore_idler_del(ad->pbarinfo.del_pbar_idler); + ad->pbarinfo.del_pbar_idler = NULL; + } + return ECORE_CALLBACK_CANCEL; +} + +static void _gl_thread_pipe_cb(void *data, void *buffer, unsigned int nbyte) +{ + gl_dbg(":::::::::: Main thread ID = %d ::::::::::", _gl_thread_gettid()); + GL_CHECK(data); + GL_CHECK(buffer); + gl_appdata *ad = (gl_appdata *)data; + gl_thread_pipe_data *p_pipe_data = (gl_thread_pipe_data *) buffer; + gl_dbg("Pipe state is %d", p_pipe_data->state); + + if (!GALLERY_MAGIC_CHECK(p_pipe_data, GALLERY_MAGIC_PIPE_DATA)) { + gl_dbgE("##### :: Check p_pipe_data Magic failed :: #####"); + return; + } + + int cancel_flag = false; + gl_thread_get_cancel_state(ad, &cancel_flag); + + if (p_pipe_data->popup_op) + { + if (p_pipe_data->state) + { + /* Check cancel_flag */ + if (cancel_flag != GL_PB_CANCEL_NORMAL) { + gl_dbgE("Failed to kill thread, try again!"); + gl_thread_emit_next_signal(ad); + return; + } + + char msg[GL_FILE_PATH_LEN_MAX] = { 0, }; + gl_item *cur_gitem = NULL; + /* Get selected media */ + _gl_data_get_item_by_index(ad, + p_pipe_data->finished_cnt, + true, &cur_gitem); + GL_CHECK(cur_gitem); + GL_CHECK(cur_gitem->item); + GL_CHECK(cur_gitem->item->display_name); + + if (p_pipe_data->popup_op == GL_POPUP_OP_SAME_ALBUM) + snprintf(msg, sizeof(msg), + "Cannot move %s to the same album!", + cur_gitem->item->display_name); + else if (p_pipe_data->popup_op == GL_POPUP_OP_DUPLICATED_NAME) + snprintf(msg, sizeof(msg), + "%s is duplicated, rename it!", + cur_gitem->item->display_name); + else if (p_pipe_data->popup_op == GL_POPUP_OP_PROTECTED_FILE) + snprintf(msg, sizeof(msg), + "Cannot removed protected file %s!", + cur_gitem->item->display_name); + gl_dbg("Popup description: %s", msg); + gl_popup_create_popup(ad, GL_POPUP_NOBUT_MOV_DEL, msg); + } + else if (ad->popupinfo.popup) + { + /* + * If p_pipe_data->state is equal to 0, + * it means thread should be destoryed. + */ + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + } + } + + /* Update progressbar state */ + int all_cnt = 0; + all_cnt = _gl_data_selected_list_count(ad); + + if (p_pipe_data->state) { + /* Check cancel_flag */ + if (cancel_flag != GL_PB_CANCEL_NORMAL) { + gl_dbgE("Failed to kill thread, try again!"); + gl_thread_emit_next_signal(ad); + return; + } + /* 1. Moving/deleting is in porcess */ + gl_pb_refresh_thread_pbar(ad, p_pipe_data->finished_cnt, all_cnt); + gl_dbg("@@@ finished/all = %d/%d, updating progressbar @@@", + p_pipe_data->finished_cnt, all_cnt); + /* Emit signal to notice child thread handle next media */ + gl_dbg("Emit next signal..."); + gl_thread_emit_next_signal(ad); + } else { + /* 2. Moving/deleting is over, show finished count */ + gl_dbg("@@@ finished: %d, updating progressbar @@@", + ad->pbarinfo.finished_cnt); + gl_pb_refresh_thread_pbar(ad, ad->pbarinfo.finished_cnt, + ad->pbarinfo.finished_cnt); + ad->pbarinfo.finished_cnt = 0; + gl_dbg("@@@@@@@ :::: Pipe close && Update view :::: @@@@@@@"); + int cancel_flag = false; + gl_thread_get_cancel_state(ad, &cancel_flag); + + /* Use idler to delete progressbar to refresh status totally */ + if (ad->pbarinfo.del_pbar_idler) { + ecore_idler_del(ad->pbarinfo.del_pbar_idler); + ad->pbarinfo.del_pbar_idler = NULL; + } + Ecore_Idler *idler= NULL; + + idler = ecore_idler_add(_gl_thread_del_pbar_idler_cb, + ad); + ad->pbarinfo.del_pbar_idler = idler; + + int mmc_state = ad->maininfo.mmc_state; + int op_type = ad->maininfo.medias_op_type; + gl_dbg("MMC state: %d, OP type: %d.", mmc_state, op_type); + /* Operate medias related to MMC while moving medias */ + if (mmc_state == GL_MMC_STATE_REMOVED_MOVING) { + ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED; + + /** + * 1, Places: Add tag; + * 2, Tags: Add tag/remove tag; + * 3, Albums: Move/Delete/Add tag. + * + * Case 1: Source folder/tag/marker does exist, update view. + * Case 2: Source folder is MMC, and it vanished. + */ + gl_cluster *cur_album = ad->albuminfo.current_album; + if (cur_album && cur_album->cluster && + cur_album->cluster->type == GL_STORE_T_MMC) { + gl_dbgW("MMC removed, change to albums view!"); + gl_pop_to_ctrlbar_ly(ad, true); + } else { + /* Update albums list when change to normal view */ + if (op_type == GL_MEDIA_OP_ADD_TAG) + ad->albuminfo.update_albums_list = true; + _gl_thread_update_view(ad); + } + } else { + /* Operated files on MMC, reset MMC state */ + if (mmc_state == GL_MMC_STATE_ADDED_MOVING) { + ad->maininfo.mmc_state = GL_MMC_STATE_ADDED; + } else if (mmc_state == GL_MMC_STATE_ADDING_MOVING) { + ad->maininfo.mmc_state = GL_MMC_STATE_ADDED; + /* Update albums list when change to normal view */ + if (op_type == GL_MEDIA_OP_ADD_TAG) + ad->albuminfo.update_albums_list = true; + } + /* Refresh view */ + _gl_thread_update_view(ad); + } + + /* Free Ecore_Pipe object created */ + if (ad->pbarinfo.sync_pipe) { + ecore_pipe_del(ad->pbarinfo.sync_pipe); + ad->pbarinfo.sync_pipe = NULL; + } + + /* Set medias_op_type none to stop refreshing view*/ + ad->maininfo.medias_op_type = GL_MEDIA_OP_NONE; + } +} + +/******************************************************* +** Prototype : gl_thread_emit_next_signal +** Description : Emit signal to notice child thread handle next media. +** Input : void *data +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +int +gl_thread_emit_next_signal(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + pthread_mutex_lock(&(ad->pbarinfo.refresh_lock)); + gl_dbg("refresh_flag: %d.", ad->pbarinfo.refresh_flag); + if (ad->pbarinfo.refresh_flag == 0) + { + ad->pbarinfo.refresh_flag = 1; + pthread_cond_signal(&(ad->pbarinfo.refresh_cond)); + } + pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock)); + + return 0; +} + +/******************************************************* +** Prototype : gl_thread_wait_next_signal +** Description : Wait start signal to handle next media. +** Input : void *data +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +int +gl_thread_wait_next_signal(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + pthread_mutex_lock(&(ad->pbarinfo.refresh_lock)); + gl_dbg("refresh_flag: %d.", ad->pbarinfo.refresh_flag); + while (ad->pbarinfo.refresh_flag == 0) + { + gl_dbg("Thread waiting..."); + pthread_cond_wait(&(ad->pbarinfo.refresh_cond), &(ad->pbarinfo.refresh_lock)); + } + ad->pbarinfo.refresh_flag = 0; + pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock)); + + return 0; +} + +/******************************************************* +** Prototype : gl_thread_set_cancel_state +** Description : Set the value of cancel flag. +** Input : void *data +** Input : int val +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +int +gl_thread_set_cancel_state(void *data, int val) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + pthread_mutex_lock(&(ad->pbarinfo.pbar_lock)); + ad->pbarinfo.pbar_cancel = val; + pthread_mutex_unlock(&(ad->pbarinfo.pbar_lock)); + + return 0; +} + +/******************************************************* +** Prototype : gl_thread_get_cancel_state +** Description : Get the value of cancel flag. +** Input : void *data +** Output : int* val +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +int +gl_thread_get_cancel_state(void *data, int *val) +{ + GL_CHECK_VAL(val, -1); + gl_appdata *ad = (gl_appdata *)data; + + pthread_mutex_lock(&(ad->pbarinfo.pbar_lock)); + *val = ad->pbarinfo.pbar_cancel; + pthread_mutex_unlock(&(ad->pbarinfo.pbar_lock)); + + return 0; +} + + +/******************************************************* +** Prototype : gl_thread_write_pipe +** Description : Write date to pipe in order to make progressbar refreshed +** Input : void *data +** Input : int finished_cnt +** Input : int popup_op +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +void +gl_thread_write_pipe(void *data, int finished_cnt, int popup_op) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int cancel_flag = false; + + gl_dbg("Wait next signal..."); + gl_thread_wait_next_signal(ad); + + gl_thread_pipe_data pipe_data; + memset(&pipe_data, 0x00, sizeof(gl_thread_pipe_data)); + GALLERY_MAGIC_SET(&pipe_data, GALLERY_MAGIC_PIPE_DATA); + + pipe_data.state = 1; + pipe_data.finished_cnt = finished_cnt; + pipe_data.popup_op = popup_op; + + gl_thread_get_cancel_state(ad, &cancel_flag); + + if (cancel_flag == GL_PB_CANCEL_BUTTON || + cancel_flag == GL_PB_CANCEL_MMC || + cancel_flag == GL_PB_CANCEL_ERROR || + cancel_flag == GL_PB_CANCEL_RESET) + { + //send cancel signal through pipe + pipe_data.finished_cnt = -1; + /* Set over state */ + pipe_data.state = 0; + ecore_pipe_write(ad->pbarinfo.sync_pipe, &pipe_data, sizeof(gl_thread_pipe_data)); + //exit the child thread + if (cancel_flag == GL_PB_CANCEL_BUTTON) + { + gl_dbg("Cancel button tapped, child thread exit!"); + } + else if (cancel_flag == GL_PB_CANCEL_MMC) + { + gl_dbg("MMC removed, child thread exit!"); + } + else if (cancel_flag == GL_PB_CANCEL_ERROR) + { + gl_dbg("Error happened, child thread exit!"); + } + else if (cancel_flag == GL_PB_CANCEL_RESET) { + gl_dbg("Reset gallery, child thread exit!"); + } + + pthread_exit((void *)1); + } + else + { + gl_dbg("Writing pipe..."); + ecore_pipe_write(ad->pbarinfo.sync_pipe, &pipe_data, sizeof(gl_thread_pipe_data)); + } +} + +/******************************************************* +** Prototype : gl_thread_gen_data_thread +** Description : Create child thread for moving or deleting medias +** Input : void *data +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +int +gl_thread_gen_data_thread(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + pthread_t tid; + pthread_attr_t attr; + int ret = -1; + + gl_dbg("Creating child thread."); + //add pipe for update progressbar status + ad->pbarinfo.sync_pipe = ecore_pipe_add(_gl_thread_pipe_cb, ad); + //initialize thread attributes + ret = pthread_attr_init(&attr); + if (ret == 0) + { + ret = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + if (ret == 0) + { + //create child thread + ret = pthread_create(&tid, &attr, _gl_thread_data_thread, ad); + if (ret != 0) + { + gl_dbgE("[Error] ##### :: pthread_create failed :: #####"); + pthread_attr_destroy(&attr); + return -1; + } + } + } + + gl_dbg("\n\n[Done] @@@@@@@@@@ :::: pthread_create successfull :::: @@@@@@@@@@\n"); + pthread_attr_destroy(&attr); + + return 0; +} + +/******************************************************* +** Prototype : gl_thread_destroy_lock +** Description : Destroy mutex lock. +** Input : void *data +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +int +gl_thread_destroy_lock(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("@@@@@@@@@@ :::: Destroy MUTEX :::: @@@@@@@@@@"); + + /** + * The variable below was accessed without holding a guarding lock. + * In a multithreaded environment, this can lead to a race condition. + * Add lock to prevent from RC. + */ + pthread_mutex_lock(&(ad->pbarinfo.refresh_lock)); + ad->pbarinfo.refresh_flag = 0; + pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock)); + + pthread_cond_destroy(&(ad->pbarinfo.refresh_cond)); + pthread_mutex_destroy(&(ad->pbarinfo.pbar_lock)); + pthread_mutex_destroy(&(ad->pbarinfo.refresh_lock)); + + return 0; +} + +/******************************************************* +** Prototype : gl_thread_init_lock +** Description : Initialize mutex lock +** Input : void *data +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +int +gl_thread_init_lock(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("@@@@@@@@@@ :::: Initialize MUTEX :::: @@@@@@@@@@"); + + pthread_mutex_init(&(ad->pbarinfo.pbar_lock), NULL); + pthread_mutex_init(&(ad->pbarinfo.refresh_lock), NULL); + pthread_cond_init(&(ad->pbarinfo.refresh_cond), NULL); + + /** + * The variable below was accessed without holding a guarding lock. + * In a multithreaded environment, this can lead to a race condition. + * Add lock to prevent from RC. + */ + pthread_mutex_lock(&(ad->pbarinfo.refresh_lock)); + ad->pbarinfo.refresh_flag = 0; + pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock)); + + return 0; +} diff --git a/src/util/gl-ui-util.c b/src/util/gl-ui-util.c new file mode 100755 index 0000000..216614e --- /dev/null +++ b/src/util/gl-ui-util.c @@ -0,0 +1,1101 @@ +/* + * Copyright (c) 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 "gl-fs.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-ext-ug-load.h" +#include "gl-ext-exec.h" +#include "gl-button.h" +#include "gl-thumbs.h" +#include "gl-controlbar.h" +#include "gl-albums.h" +#include "gl-debug.h" +#include "gl-data.h" +#include "gl-tags.h" +#include "gl-thread-util.h" +#include "gl-popup.h" +#include "gl-ctxpopup.h" +#include "gl-progressbar.h" +#include "gl-albums-sel.h" +#include "gl-albums-new.h" +#include "gl-albums-edit.h" +#include "gl-thumbs-edit.h" +#include "gl-strings.h" +#include "gl-icons.h" +#include "gl-notify.h" + +#define GL_SELALL_TIMER_INT 0.5 + +/** + * Launch camera + */ +static void __gl_ui_camera_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_dbg(""); + _gl_ext_load_camera(); +} + +/* Use timer to prevent lockup when click select-all frequently */ +static Eina_Bool __gl_ui_selall_timer_cb(void *data) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + if (ad->selectedinfo.selall_timer) { + ecore_timer_del(ad->selectedinfo.selall_timer); + ad->selectedinfo.selall_timer = NULL; + } + return ECORE_CALLBACK_CANCEL; +} + +/* Select-all checkbox selected/deselected */ +static void _gl_ui_selall_check_changed(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d.", view_mode); + + if (ad->selectedinfo.selall_timer) { + gl_dbgW("Wait a sec!"); + elm_check_state_set(obj, ad->selectedinfo.ck_state); + return; + } + + ad->selectedinfo.selall_timer = ecore_timer_add(GL_SELALL_TIMER_INT, + __gl_ui_selall_timer_cb, + data); + int i = 0; + int item_cnt = 0; + int sel_all_cnt = 0; + Eina_Bool state = EINA_FALSE; + state = elm_check_state_get(obj); + gl_dbg("Checkbox state: %d.", state); + ad->selectedinfo.ck_state = state; + + if (view_mode == GL_VIEW_TAGS_EDIT) { + item_cnt = _gl_data_get_tag_count_all(ad); + sel_all_cnt = item_cnt - 1; /* minus favorites tag */ + gl_tag *gtag = NULL; + + for (i = 0; i < item_cnt; i++) { + _gl_data_get_tag_by_index(ad, >ag, i); + if (!gtag || !gtag->tag) + continue; + + if (gtag->checked == state || + gtag->tag->_id == GL_TAG_FAVORITES_ID) + continue; + + gtag->checked = state; + if (state == EINA_TRUE) + _gl_data_tags_selected_list_append(ad, gtag); + else + _gl_data_tags_selected_list_remove(ad, gtag); + } + + /* Update all realized items */ + elm_genlist_realized_items_update(ad->ctrlinfo.ctrlbar_edit_view); + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + gl_cluster *album = NULL; + Elm_Object_Item *first_it = NULL; + Elm_Object_Item *next_it = NULL; + Elm_Object_Item *last_it = NULL; + first_it = elm_gengrid_first_item_get(ad->ctrlinfo.ctrlbar_edit_view); + last_it = elm_gengrid_last_item_get(ad->ctrlinfo.ctrlbar_edit_view); + while(first_it) { + /* Get data */ + item_cnt++; + album = (gl_cluster *)elm_object_item_data_get(first_it); + if (album == NULL) { + gl_dbgE("Invalid item data!"); + continue; + } + + if (album->checked == state){ + /* Get next item */ + next_it = elm_gengrid_item_next_get(first_it); + first_it = next_it; + album = NULL; + continue; + } + + /* Update checkbox state */ + album->checked = state; + /* Update selected list */ + if (state == EINA_TRUE) + _gl_data_albums_selected_list_append(ad, album); + else + _gl_data_albums_selected_list_remove(ad, album); + /* Update UI */ + /* elm_gengrid_item_update(first_it); */ + + if (last_it == first_it) { + gl_dbg("Update done!"); + break; + } else { + next_it = elm_gengrid_item_next_get(first_it); + first_it = next_it; + } + album = NULL; + } + /* Update all realized items */ + elm_gengrid_realized_items_update(ad->ctrlinfo.ctrlbar_edit_view); + /* Update selected album count */ + sel_all_cnt = item_cnt; + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + /* Get all medias count of current album */ + gl_item *gitem = NULL; + item_cnt = ad->maininfo.medias_cnt; + sel_all_cnt = item_cnt; + for (i = 0; i < item_cnt; i++) { + _gl_data_get_item_by_index(ad, i + 1, false, &gitem); + GL_CHECK(gitem); + GL_CHECK(gitem->item); + + if (gitem->checked == state) + continue; + + gitem->checked = state; + /* elm_gengrid_item_update(gitem->elm_item); */ + + if (state == EINA_TRUE) + _gl_data_selected_list_append(ad, gitem); + else + _gl_data_selected_list_remove(ad, gitem); + } + /* Update all realized items */ + elm_gengrid_realized_items_update(ad->gridinfo.select_view); + } else { + /* Get all medias count of current album */ + item_cnt = ad->maininfo.medias_cnt; + sel_all_cnt = item_cnt; + int grid_mode = ad->gridinfo.view_mode; + media_content_type_e file_type = MEDIA_CONTENT_TYPE_IMAGE; + if (view_mode == GL_VIEW_THUMBS_EDIT) { + if (grid_mode == GL_THUMB_IMAGES) { + file_type = MEDIA_CONTENT_TYPE_IMAGE; + sel_all_cnt = 0; + } else if (grid_mode == GL_THUMB_VIDEOS) { + file_type = MEDIA_CONTENT_TYPE_VIDEO; + sel_all_cnt = 0; + } + } + gl_dbg("grid_mode=%d", grid_mode); + gl_item *gitem = NULL; + for (i = 0; i < item_cnt; i++) { + _gl_data_get_item_by_index(ad, i + 1, false, &gitem); + GL_CHECK(gitem); + GL_CHECK(gitem->item); + + if (gitem->checked == state && grid_mode == GL_THUMB_ALL) + continue; + + if (view_mode == GL_VIEW_THUMBS_EDIT) { + if ((grid_mode == GL_THUMB_IMAGES) || + (grid_mode == GL_THUMB_VIDEOS)) { + if (gitem->item->type != file_type) + continue; + + sel_all_cnt++; + if (gitem->checked == state) + continue; + } + } + gitem->checked = state; + + if (state == EINA_TRUE) + _gl_data_selected_list_append(ad, gitem); + else + _gl_data_selected_list_remove(ad, gitem); + + } + /* Update all realized items */ + elm_gengrid_realized_items_update(ad->gridinfo.navi_content_edit_view); + } + + /* Recreate selection info for both cases */ + if (state == EINA_FALSE) + sel_all_cnt = 0; + + if (view_mode == GL_VIEW_TAGS_EDIT || + view_mode == GL_VIEW_ALBUMS_EDIT) { + _gl_notify_create_selinfo(ad, ad->ctrlinfo.ctrlbar_edit_ly, + ad->ctrlinfo.nf_it_edit, item_cnt, + sel_all_cnt, false); + if (view_mode == GL_VIEW_TAGS_EDIT) + gl_tag_unset_rename(ad); + } else if (view_mode == GL_VIEW_THUMBS_SELECT){ + _gl_notify_create_selinfo(ad, ad->gridinfo.select_view_ly, + ad->gridinfo.nf_it_select, item_cnt, + sel_all_cnt, false); + } else { + _gl_notify_create_selinfo(ad, ad->gridinfo.navi_content_edit_ly, + ad->gridinfo.nf_it_edit, item_cnt, + sel_all_cnt, false); + } +} + +/* Select-all background click, selected/deselected checkbox */ +static void _gl_ui_selall_bg_click_cb(void *data, Evas_Object *o, + const char *emission, + const char *source) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + Evas_Object *ly = NULL; + gl_dbg("view_mode: %d.", view_mode); + + if (ad->selectedinfo.selall_timer) { + gl_dbgW("Wait a sec!"); + return; + } + + ly = _gl_ui_get_view_layout(data, view_mode); + GL_CHECK(ly); + + Evas_Object *check = elm_object_part_content_get(ly, "selectall_check"); + if (check) { + Eina_Bool new_state = EINA_FALSE; + Eina_Bool ck_state = elm_check_state_get(check); + /* uncheck->check */ + if (ck_state == EINA_FALSE) + new_state = EINA_TRUE; + + elm_check_state_set(check, new_state); + + _gl_ui_selall_check_changed(ad, check, NULL); + } else { + gl_dbgE("Get select all checkbox object failed!"); + } +} + +void _gl_ui_edit_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + if (ad->uginfo.ug_called_by_me || ad->gridinfo.grid_append_idler) { + /** + * Prevent changed to edit view in wrong way. + * 1. When invoke imageviewer UG; + * 2. First show thumbnails view, use idler to append other medias. + */ + gl_dbg("UG invoked or appending gridview."); + return; + } + _gl_ctxpopup_del(data); + + int view_mode = gl_get_view_mode(data); + gl_dbg("mode: %d", view_mode); + if (view_mode == GL_VIEW_ALBUMS) { + _gl_albums_edit_create_view(data); + } else if (view_mode == GL_VIEW_THUMBS) { + _gl_thumbs_edit_create_view(data); + } +} + +static void __gl_ui_add_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me) { + gl_dbgW("UG or APP is already loaded!"); + return; + } + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_THUMBS) { + /* Clear selected list */ + _gl_notify_destroy_selinfo(ad); + /* Clear thumbnails edit view */ + + _gl_albums_sel_create_view(data); + } else { + gl_dbgE("Wrong view mode!"); + } +} + +Evas_Object *_gl_ui_get_view_layout(void *data, int view_mode) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *view_ly = NULL; + + gl_dbg("view_mode: %d", view_mode); + switch (view_mode) { + case GL_VIEW_ALBUMS_EDIT: + case GL_VIEW_TAGS_EDIT: + view_ly = ad->ctrlinfo.ctrlbar_edit_ly; + break; + case GL_VIEW_THUMBS_EDIT: + view_ly = ad->gridinfo.navi_content_edit_ly; + break; + case GL_VIEW_THUMBS_SELECT: + view_ly = ad->gridinfo.select_view_ly; + break; + default: + gl_dbgE("Wrong view!"); + return NULL; + } + + return view_ly; +} + +/** +* Update checkbox state in select-all widget +*/ +int _gl_ui_update_selall(void *data, int all_cnt, int selected_cnt) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_item *gitem = NULL; + int _all_cnt = 0; + int db_all_cnt = 0; + media_content_type_e file_type = MEDIA_CONTENT_TYPE_IMAGE; + int view_mode = gl_get_view_mode(ad); + Evas_Object *ly = NULL; + + if (view_mode == GL_VIEW_THUMBS_EDIT) { + /* Get all medias count */ + db_all_cnt = ad->maininfo.medias_cnt; + int grid_mode = ad->gridinfo.view_mode; + if (grid_mode == GL_THUMB_ALL) { + _all_cnt = db_all_cnt; + } else { + /* Get all count in diff segments */ + if (grid_mode == GL_THUMB_IMAGES) + file_type = MEDIA_CONTENT_TYPE_IMAGE; + else if (grid_mode == GL_THUMB_VIDEOS) + file_type = MEDIA_CONTENT_TYPE_VIDEO; + + for (i = 1; i <= db_all_cnt; i++) { + _gl_data_get_item_by_index(ad, i, false, &gitem); + if (gitem && gitem->item && + (gitem->item->type == file_type)) + _all_cnt++; + } + } + ly = ad->gridinfo.navi_content_edit_ly; + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + /* Get all medias count */ + _all_cnt = ad->maininfo.medias_cnt; + ly = ad->gridinfo.select_view_ly; + } else if (view_mode == GL_VIEW_TAGS_EDIT) { + db_all_cnt = _gl_data_get_tag_count_all(ad); + /* Minus favorites tag, it's excluded in edit view . */ + _all_cnt = db_all_cnt - 1; + ly = ad->ctrlinfo.ctrlbar_edit_ly; + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + _all_cnt = ad->albuminfo.albums_cnt; + ly = ad->ctrlinfo.ctrlbar_edit_ly; + } else { + gl_dbg("Wrong view mode!"); + return 0; + } + + /** + * Set checkbox state + * except in albums edit view and selectioninfo view + */ + gl_dbg("selected_cnt/_all_cnt = %d/%d", selected_cnt, _all_cnt); + Evas_Object *check = NULL; + Eina_Bool state = EINA_FALSE; + /* Set checkbox checked/unchecked */ + if (selected_cnt == _all_cnt) + state = EINA_TRUE; + else + state = EINA_FALSE; + + check = elm_object_part_content_get(ly, "selectall_check"); + if (check) + elm_check_state_set(check, state); + return 0; +} + +static void __gl_ui_albums_more_btn_cb(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg("more button clicked"); + /* Add 'Edit' + 'Add web album' */ + GL_CHECK(data); + _gl_ctxpopup_create_albums(data, obj); +} + +static void __gl_ui_thumbs_more_btn_cb(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg("more button clicked"); + /* Add 'Add to home' */ + GL_CHECK(data); + _gl_ctxpopup_create_thumbs(data, obj); +} + +/* pause gallery and change view to background after tap Back button in albums view */ +static void __gl_ui_lower_to_bg_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK(ad->maininfo.win); + gl_dbgW("Lower Gallery to background!"); + elm_win_lower(ad->maininfo.win); +} + +static void __gl_ui_trans_finished_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbgW("view_mode: %d", view_mode); + evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, + __gl_ui_trans_finished_cb); + + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_THUMBS) { + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_ALBUMS) + elm_gengrid_clear(ad->albuminfo.albums_view); + else if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) + elm_genlist_clear(ad->taginfo.tags_view); + } else { + gl_dbgE("Wrong view mode!"); + } +} + +static void __gl_ui_show_title_toolbar(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_dbg("elm,state,sip,shown"); + return; +} + +static void __gl_ui_hide_title_toolbar(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_dbg("elm,state,sip,hidden"); + return; +} + +void _gl_ui_slideshow_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + _gl_ctxpopup_del(data); + _gl_slideshow(data); +} + +/** + * Use naviframe api to push albums view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_ui_push_view_albums(void *data, Evas_Object *parent, + Evas_Object *obj) +{ + gl_dbg("GL_NAVI_ALBUMS"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + Evas_Object *end_btn = NULL; + + /** + * add End button in navigation var first view in galery + * with style "naviframe/back_btn/gallery" + * so after tap this button,gallery is paused + * but change view to background + */ + GL_CHECK_VAL(ad->maininfo.win, -1); + end_btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_PRE, + __gl_ui_lower_to_bg_cb, ad); + GL_CHECK_VAL(end_btn, -1); + /* Push view to stack */ + gl_dbg_launch(" elm_naviframe_item_push:start"); + nf_it = elm_naviframe_item_push(parent, NULL, end_btn, NULL, obj, + GL_NF_ANI_TABBAR); + elm_naviframe_item_title_visible_set(nf_it, EINA_FALSE); + gl_dbg_launch(" elm_naviframe_item_push:end"); + ad->ctrlinfo.nf_it = nf_it; + + /* add buttons */ + _gl_ui_add_btns_albums(ad, GL_UI_ALBUMS_FIRST); + return 0; +} + +/** + * Use naviframe api to push thumbnails view to stack. + * @param obj is the content to be pushed. + */ +static int __gl_ui_push_view_thumbs(void *data, Evas_Object *parent, + Evas_Object *obj, char *title) +{ + gl_dbg("GL_NAVI_THUMBS"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *nf_it = NULL; + bool b_add_slideshow = false; + bool b_add_more = false; + + _gl_ctrl_show_tabbar(ad, false); + + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, + __gl_ui_trans_finished_cb, ad); + /* Push to stack with basic transition */ + nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, + NULL); + ad->gridinfo.nf_it = nf_it; + + Evas_Object *btn = NULL; + /* Add Edit button */ + btn = _gl_but_create_but(parent, NULL, GL_STR_EDIT, + GL_BUTTON_STYLE_NAVI_TOOLBAR_LEFT, + _gl_ui_edit_cb, data); + GL_CHECK_VAL(btn, -1); + ad->gridinfo.edit_btn = btn; + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, btn); + + gl_dbg("tab_mode: %d", ad->ctrlinfo.tab_mode); + switch (ad->ctrlinfo.tab_mode) { + case GL_CTRL_TAB_ALBUMS: + b_add_slideshow = true; + b_add_more = true; + break; + case GL_CTRL_TAB_TAGS: + b_add_slideshow = true; + b_add_more = true; + _gl_ui_show_add_btn(ad); + break; + default: + gl_dbgE("Wrong tab mode!"); + return -1; + } + + if (b_add_slideshow) { + /* Add slide show button */ + gl_dbg("Add slideshow button"); + btn = _gl_but_create_but(parent, NULL, GL_STR_SLIDESHOW, + GL_BUTTON_STYLE_NAVI_TOOLBAR_RIGHT, + _gl_ui_slideshow_cb, ad); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN2, btn); + ad->gridinfo.slideshow_btn = btn; + if(ad->maininfo.medias_cnt <= 0) + _gl_ui_disable_slideshow(ad, true); + } + + if (b_add_more) { + /* More */ + btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_MORE, + __gl_ui_thumbs_more_btn_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_MORE, btn); + if (ad->maininfo.medias_cnt <= 0) + _gl_ui_disable_btn(btn); + } + + if (ad->maininfo.medias_cnt <= 0) + _gl_ui_disable_btn(ad->gridinfo.edit_btn); + return 0; +} + +int _gl_ui_disable_slideshow(void *data, bool b_disable) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d, b_disable: %d", view_mode, b_disable); + + if (view_mode == GL_VIEW_THUMBS) + elm_object_disabled_set(ad->gridinfo.slideshow_btn, b_disable); + else if (view_mode == GL_VIEW_THUMBS_EDIT) + ad->gridinfo.b_slideshow_disable = b_disable; + return 0; +} + +/* + * @param b_add, true: add 'Add' button, unset 'Add' button otherwise. + */ +int _gl_ui_show_add_btn(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *add_btn = NULL; + bool b_disable = false; + int err = -1; + int item_cnt = 0; + err = _gl_data_get_item_cnt(ad, GL_ALBUM_ALL_ID, false, GL_STORE_T_ALL, + &item_cnt); + if (err != 0 || item_cnt == 0) { + gl_dbg("None local albums, disable button."); + /* Disable button */ + b_disable = true; + } + gl_dbg("b_disable: %d", b_disable); + add_btn = elm_object_item_part_content_get(ad->gridinfo.nf_it, + GL_NAVIFRAME_TITLE_RIGHT_BTN); + if (add_btn) { + elm_object_disabled_set(add_btn, b_disable); + return 0; + } + add_btn = _gl_but_create_but(ad->maininfo.naviframe, GL_CBAR_ICON_ADD, + NULL, GL_BUTTON_STYLE_NAVI_TITLE_PLUS, + __gl_ui_add_cb, ad); + GL_CHECK_VAL(add_btn, -1); + elm_object_disabled_set(add_btn, b_disable); + elm_object_item_part_content_set(ad->gridinfo.nf_it, + GL_NAVIFRAME_TITLE_RIGHT_BTN, add_btn); + return 0; +} + +int _gl_ui_clear_btns(void *data) +{ + GL_CHECK_VAL(data, -1); + Evas_Object *btn = NULL; + gl_dbg(""); + + /* Remove more and camera */ + btn = _gl_ui_get_btn(data, NULL, GL_NAVIFRAME_MORE); + if (btn) { + evas_object_del(btn); + btn = NULL; + } + btn = _gl_ui_get_btn(data, NULL, GL_NAVIFRAME_BTN1); + if (btn) { + evas_object_del(btn); + btn = NULL; + } + btn = _gl_ui_get_btn(data, NULL, GL_NAVIFRAME_BTN2); + if (btn) { + evas_object_del(btn); + btn = NULL; + } + return 0; +} + +/** + * When push albums view for the first time, albums list is empty. + * After albums list got from DB then update edit item state. + * @param bool b_first, true, push albums view for the first time, enable edit item. + */ +int _gl_ui_add_btns_albums(void *data, int type) +{ + gl_dbg("type: %d", type); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + GL_CHECK_VAL(ad->ctrlinfo.nf_it, -1); + Evas_Object *parent = ad->maininfo.naviframe; + Elm_Object_Item *nf_it = ad->ctrlinfo.nf_it; + Evas_Object *btn = NULL; + + /* Remove btns */ + _gl_ui_clear_btns(data); + /* More */ + btn = _gl_but_create_but(parent, NULL, NULL, + GL_BUTTON_STYLE_NAVI_MORE, + __gl_ui_albums_more_btn_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_MORE, btn); + /* Camera */ + btn = _gl_but_create_but(parent, NULL, GL_STR_CAMERA, + GL_BUTTON_STYLE_NAVI_TOOLBAR, + __gl_ui_camera_cb, data); + GL_CHECK_VAL(btn, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_BTN1, btn); + + /* Disable items in exit mode */ + if ((!gl_check_gallery_empty(ad) && + ad->albuminfo.cluster_list->edit_cnt) || + (type == GL_UI_ALBUMS_FIRST)) { + ad->albuminfo.b_edit_disable = false; + } else { + ad->albuminfo.b_edit_disable = true; + } + + return 0; +} + +int gl_ui_create_title_and_push(void *data, Evas_Object *parent, + Evas_Object *obj, gl_navi_mode mode, char *title) +{ + gl_dbg_launch(" gl_ui_create_title_and_push:start"); + GL_CHECK_VAL(obj, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + + if (mode == GL_NAVI_ALBUMS) + __gl_ui_push_view_albums(data, parent, obj); + else if (mode == GL_NAVI_THUMBS) + __gl_ui_push_view_thumbs(data, parent, obj, title); + gl_dbg("Done"); + gl_dbg_launch(" gl_ui_create_title_and_push:end"); + return 0; +} + +Evas_Object * +gl_ui_load_edj(Evas_Object * parent, const char *file, const char *group) +{ + Evas_Object *eo = NULL; + int r = 0; + + eo = elm_layout_add(parent); + if (eo) + { + r = elm_layout_file_set(eo, file, group); + if (!r) + { + evas_object_del(eo); + return NULL; + } + + evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL); + } + + return eo; +} + +/* Remove selection and edit view then pop to normal thumbnail view */ +int _gl_ui_pop_to_thumb(void *data) +{ + GL_CHECK_VAL(data, -1); + /* Delete edit view and update thumbnail view */ + _gl_thumbs_edit_pop_view(data); + return 0; +} + +/** +* Update checkbox state and add click signal to Select-all widget. +* Show arrow button in thumbnails/list edit mode. +*/ +int gl_ui_show_selall(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + Eina_Bool ck_state = EINA_FALSE; + Evas_Object *view_ly = NULL; + char *sig = GL_SIGNAL_VIEW_SELALL_SHOW; + + gl_dbg("view_mode: %d.", view_mode); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + view_ly = ad->gridinfo.navi_content_edit_ly; + if (ad->maininfo.medias_cnt == _gl_data_selected_list_count(ad)) + ck_state = EINA_TRUE; + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + view_ly = ad->gridinfo.select_view_ly; + } else if (view_mode == GL_VIEW_TAGS_EDIT) { + /* in Tags view */ + view_ly = ad->ctrlinfo.ctrlbar_edit_ly; + int cnt_all = _gl_data_get_tag_count_all(ad); + /* Check hidden item: "favorites" tag */ + if (cnt_all == _gl_data_get_tags_selected_cnt(ad) + 1) + ck_state = EINA_TRUE; + sig = GL_SIGNAL_VIEW_SELALL_TAG; + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + /* in Albums view */ + view_ly = ad->ctrlinfo.ctrlbar_edit_ly; + if (ad->albuminfo.albums_cnt == _gl_data_get_albums_selected_cnt(ad)) + ck_state = EINA_TRUE; + } else { + gl_dbgE("Wrong view!"); + return -1; + } + + const char *text = NULL; + text = edje_object_part_text_get(_EDJ(view_ly), "selectall_text"); + if (text == NULL || g_strcmp0(text, GL_STR_SELECT_ALL)) + edje_object_part_text_set(_EDJ(view_ly), "selectall_text", + GL_STR_SELECT_ALL); + + Evas_Object *old_check = NULL; + old_check = elm_object_part_content_unset(view_ly, "selectall_check"); + if (old_check) + evas_object_del(old_check); + + Evas_Object *check = elm_check_add(view_ly); + evas_object_propagate_events_set(check, EINA_FALSE); + elm_check_state_set(check, ck_state); + + elm_object_part_content_set(view_ly, "selectall_check", check); + evas_object_smart_callback_add(check, "changed", + _gl_ui_selall_check_changed, ad); + edje_object_signal_emit(_EDJ(view_ly), sig, "elm"); + + /* Add signal to select-all bg */ + edje_object_signal_callback_del(_EDJ(view_ly), "elm,action,click", + "selectall_bg", + _gl_ui_selall_bg_click_cb); + edje_object_signal_callback_add(_EDJ(view_ly), "elm,action,click", + "selectall_bg", + _gl_ui_selall_bg_click_cb, ad); + + return 0; +} + +/* Update checkbox state of Select-all and selectioninfo */ +int gl_ui_update_select_widgets(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Update checkbox state of Select-all */ + gl_ui_show_selall(ad); + /* Update selectioninfo */ + int cnt = 0; + int sel_cnt = 0; + Evas_Object *layout = NULL; + Elm_Object_Item *nf_it = NULL; + + cnt = ad->maininfo.medias_cnt; + sel_cnt = _gl_data_selected_list_count(ad); + layout = ad->gridinfo.navi_content_edit_ly; + nf_it = ad->gridinfo.nf_it_edit; + _gl_notify_create_selinfo(ad, layout, nf_it , cnt, sel_cnt, false); + return 0; +} + +Evas_Object *gl_ui_create_main_ly(Evas_Object *parent) +{ + gl_dbg_launch(" gl_ui_create_main_ly:start"); + GL_CHECK_NULL(parent); + Evas_Object *layout = NULL; + + layout = elm_layout_add(parent); + GL_CHECK_NULL(layout); + + /* Apply the layout style */ + gl_dbg_launch(" elm_layout_theme_set:start"); + + const char *profile = elm_config_profile_get(); + if (!g_strcmp0(profile, "mobile")) { + elm_layout_theme_set(layout, "layout", "application", "default"); + } else if (!g_strcmp0(profile,"extension")) { + elm_layout_theme_set(layout, "layout", "application", + "noindicator"); + } + + gl_dbg_launch(" elm_layout_theme_set:end"); + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_show(layout); + gl_dbg_launch(" gl_ui_create_main_ly:end"); + + return layout; +} + +Evas_Object *gl_ui_create_naviframe(Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + Evas_Object *navi_bar = NULL; + gl_dbg_launch(" gl_ui_create_naviframe:start"); + + navi_bar = elm_naviframe_add(parent); + gl_dbg("elm_naviframe_add:done"); + evas_object_show(navi_bar); + gl_dbg_launch(" gl_ui_create_naviframe:end"); + + return navi_bar; +} + +int gl_ui_set_navi_title_visible(void *data, bool b_visible) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Elm_Object_Item *it = NULL; + it = elm_naviframe_top_item_get(ad->maininfo.naviframe); + GL_CHECK_VAL(it, -1); + /* Hide title from animation */ + elm_naviframe_item_title_visible_set(it, b_visible); + return 0; +} + +int _gl_ui_add_conform_cbs(Evas_Object *naviframe) +{ + GL_CHECK_VAL(naviframe, -1); + Evas_Object *conform = NULL; + + /* Get conformant */ + conform = (Evas_Object *)evas_object_data_get(naviframe, + GL_NAVIFRAME_OBJ_DATA_KEY); + GL_CHECK_VAL(conform, -1); + + evas_object_smart_callback_add(conform, GL_IMF_ON, + __gl_ui_show_title_toolbar, naviframe); + evas_object_smart_callback_add(conform, GL_IMF_OFF, + __gl_ui_hide_title_toolbar, naviframe); + return 0; +} + +int _gl_ui_del_conform_cbs(Evas_Object *naviframe) +{ + GL_CHECK_VAL(naviframe, -1); + Evas_Object *conform = NULL; + + /* Get conformant */ + conform = (Evas_Object *)evas_object_data_get(naviframe, + GL_NAVIFRAME_OBJ_DATA_KEY); + GL_CHECK_VAL(conform, -1); + + evas_object_smart_callback_del(conform, GL_IMF_ON, + __gl_ui_show_title_toolbar); + evas_object_smart_callback_del(conform, GL_IMF_OFF, + __gl_ui_hide_title_toolbar); + return 0; +} + +int _gl_ui_disable_btn(Evas_Object *btn) +{ + if (btn) + elm_object_disabled_set(btn, EINA_TRUE); + return 0; +} + +int _gl_ui_enable_btn(Evas_Object *btn) +{ + if(btn) + elm_object_disabled_set(btn, EINA_FALSE); + return 0; +} + +/* Set each button(more/btn1/btn2) as each state respectively */ +int _gl_ui_disable_each_btn(Elm_Object_Item *nf_it, bool b_more, bool b_btn1, + bool b_btn2) +{ + GL_CHECK_VAL(nf_it, -1); + Evas_Object *btn = NULL; + gl_dbg("more/btn1/btn2 state: %d/%d/%d", b_more, b_btn1, b_btn2); + btn = elm_object_item_part_content_get(nf_it, GL_NAVIFRAME_MORE); + if (btn) + elm_object_disabled_set(btn, b_more); + btn = elm_object_item_part_content_get(nf_it, GL_NAVIFRAME_BTN1); + if (btn) + elm_object_disabled_set(btn, b_btn1); + btn = elm_object_item_part_content_get(nf_it, GL_NAVIFRAME_BTN2); + if (btn) + elm_object_disabled_set(btn, b_btn2); + return 0; +} + +int _gl_ui_set_btns_text(Elm_Object_Item *nf_it, char *btn_text, + char *btn_text2) +{ + GL_CHECK_VAL(nf_it, -1); + + Evas_Object *btn = NULL; + if (btn_text) { + btn = elm_object_item_part_content_get(nf_it, GL_NAVIFRAME_BTN1); + if (btn) + elm_object_text_set(btn, btn_text); + } + if (btn_text2) { + btn = elm_object_item_part_content_get(nf_it, GL_NAVIFRAME_BTN2); + if (btn) + elm_object_text_set(btn, btn_text2); + } + return 0; +} + +/* Set all buttons(more/btn1/btn2) as same state */ +int _gl_ui_disable_btns(Elm_Object_Item *nf_it, bool b_disable) +{ + return _gl_ui_disable_each_btn(nf_it, b_disable, b_disable, b_disable); +} + +/* Get button*/ +Evas_Object *_gl_ui_get_btn(void *data, Elm_Object_Item *nf_it, + const char *part) +{ + Elm_Object_Item *_nf_it = nf_it; + + if (_nf_it == NULL) { + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + _nf_it = elm_naviframe_top_item_get(ad->maininfo.naviframe); + GL_CHECK_NULL(_nf_it); + } + + return elm_object_item_part_content_get(_nf_it, part); +} + +int _gl_ui_reset_scroller_pos(Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + evas_object_data_set(obj, "prev_scroller_x", (void *)0); + evas_object_data_set(obj, "prev_scroller_y", (void *)0); + evas_object_data_set(obj, "prev_scroller_w", (void *)0); + evas_object_data_set(obj, "prev_scroller_h", (void *)0); + return 0; +} + +int _gl_ui_del_scroller_pos(Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + evas_object_data_del(obj, "prev_scroller_x"); + evas_object_data_del(obj, "prev_scroller_y"); + evas_object_data_del(obj, "prev_scroller_w"); + evas_object_data_del(obj, "prev_scroller_h"); + return 0; +} + +int _gl_ui_save_scroller_pos(Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + Evas_Coord x = 0; + Evas_Coord y = 0; + Evas_Coord w = 0; + Evas_Coord h = 0; + + elm_scroller_region_get(obj, &x, &y, &w, &h); + gl_dbg("(%dx%d), (%dx%d)", x, y, w, h); + evas_object_data_set(obj, "prev_scroller_x", (void *)x); + evas_object_data_set(obj, "prev_scroller_y", (void *)y); + evas_object_data_set(obj, "prev_scroller_w", (void *)w); + evas_object_data_set(obj, "prev_scroller_h", (void *)h); + return 0; +} + +int _gl_ui_restore_scroller_pos(Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + Evas_Coord x = 0; + Evas_Coord y = 0; + Evas_Coord w = 0; + Evas_Coord h = 0; + + x = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_x"); + y = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_y"); + w = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_w"); + h = (Evas_Coord)evas_object_data_get(obj, "prev_scroller_h"); + gl_dbg("(%dx%d), (%dx%d)", x, y, w, h); + if (w > 0 && h > 0) + elm_scroller_region_show(obj, x, y, w, h); + return 0; +} + diff --git a/src/util/gl-util.c b/src/util/gl-util.c new file mode 100755 index 0000000..e157a87 --- /dev/null +++ b/src/util/gl-util.c @@ -0,0 +1,2546 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gallery.h" +#include "gl-albums.h" +#include "gl-thumbs.h" +#include "gl-util.h" +#include "gl-ui-util.h" +#include "gl-controlbar.h" +#include "gl-tags.h" +#include "gl-thread-util.h" +#include "gl-popup.h" +#include "gl-ctxpopup.h" +#include "gl-progressbar.h" +#include "gl-ext-ug-load.h" +#include "gl-ext-exec.h" +#include "gl-tags-new.h" +#include "gl-albums-sel.h" +#include "gl-albums-edit.h" +#include "gl-thumbs-sel.h" +#include "gl-drm.h" +#include "gl-nocontents.h" +#include "gl-notify.h" +#include "gl-editfield.h" +#include "gl-strings.h" +#include "gl-icons.h" +#include "gl-data-type.h" +#include "gl-fs.h" +#ifdef _USE_ROTATE_BG +#include "gl-exif.h" +#endif + +#define GL_FILE_COPY_BUF_MAX 16384 +/* Time for displaying progressbar UI compeletely */ +#define GL_TIMER_INTERVAL_PBAR_SHOWED 0.5 +#define GL_TIMER_INTERVAL_VIBRATION 0.5 +#define GL_VIBRATION_DEVICE 0 +#define GL_VIBRATION_DURATION 500 +#ifdef _USE_ROTATE_BG +#define GL_ROTATE_DELAY 0.25 +#endif + +static int __gl_refresh_albums_list(void *data, bool b_path, bool b_select); + +/* Use timer to show progressbar totally before write pipe */ +static Eina_Bool _gl_start_thread_op_timer_cb(void *data) +{ + gl_dbg("Emit START signal..."); + GL_CHECK_CANCEL(data); + gl_appdata *ad = (gl_appdata *)data; + /* Emit signal to notice child thread to handle next item. */ + gl_thread_emit_next_signal(ad); + if (ad->pbarinfo.start_thread_timer) { + ecore_timer_del(ad->pbarinfo.start_thread_timer); + ad->pbarinfo.start_thread_timer = NULL; + } + return ECORE_CALLBACK_CANCEL; +} + +/** +* Use thread to move/delete/add tag to/remove tag from medias +* for displaying progrssabar UI +*/ +int _gl_use_thread_operate_medias(void *data, char *pbar_title, int all_cnt, + int op_type) +{ + gl_dbg("all_cnt: %d, op_type: %d.", all_cnt, op_type); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Initialize thread mutex lock */ + gl_thread_init_lock(ad); + /* Make progressbar */ + gl_pb_make_thread_pbar(ad, ad->maininfo.win, pbar_title); + /* Set pb_cancel, indicates thread operation is beginning */ + gl_thread_set_cancel_state(ad, GL_PB_CANCEL_NORMAL); + /* Initialize progressbar */ + gl_pb_refresh_thread_pbar(ad, 0, all_cnt); + /* Use timer to emit next signal to show progressbarbar totally */ + if (ad->pbarinfo.start_thread_timer) { + ecore_timer_del(ad->pbarinfo.start_thread_timer); + ad->pbarinfo.start_thread_timer = NULL; + } + Ecore_Timer *timer = NULL; + timer = ecore_timer_add(GL_TIMER_INTERVAL_PBAR_SHOWED, + _gl_start_thread_op_timer_cb, ad); + ad->pbarinfo.start_thread_timer = timer; + /* Set media operation type */ + ad->maininfo.medias_op_type = op_type; + /* Generate child thread */ + gl_thread_gen_data_thread(ad); + return 0; +} + +/* +* remove selected items(media) from some tag. +*/ +static int _gl_remove_tag_items(void *data, gl_tag * cur_tag) +{ + gl_dbg(""); + GL_CHECK_VAL(cur_tag, -1); + GL_CHECK_VAL(cur_tag->tag, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Get all selected medias count */ + int cnt = _gl_data_selected_list_count(ad); + if (cnt == 0) { + gl_dbg("No items selected, return!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return -1; + } + + gl_dbg("Remove tag[%s] from medias.", cur_tag->tag->tag_name); + /* Check MMC state for cancel operation */ + gl_check_mmc_state(ad, NULL); + gl_dbg("MMC state: %d.", ad->maininfo.mmc_state); + _gl_use_thread_operate_medias(ad, GL_STR_REMOVE, cnt, + GL_MEDIA_OP_REMOVE_TAG); + return 0; +} + +static void _gl_db_update_noti_cb(keynode_t *key, void *data) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbgW("VCONFKEY_FILEMANAGER_DB_STATUS changed!"); + int mmc_state = -1; + + vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc_state); + + if (mmc_state == -1) { + gl_dbgE("Error when check MMC Status"); + return; + } + + if (mmc_state == VCONFKEY_SYSMAN_MMC_MOUNTED) { + gl_dbg("mmc_state[%d] : VCONFKEY_SYSMAN_MMC_MOUNTED", mmc_state); + if (ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED) + ad->maininfo.mmc_state = GL_MMC_STATE_ADDING_MOVING; + else + ad->maininfo.mmc_state = GL_MMC_STATE_ADDED; + + gl_update_view(ad, GL_UPDATE_VIEW_MMC_ADDED); + /* Remove ctxpopup */ + _gl_ctxpopup_del(ad); + } else if (mmc_state == VCONFKEY_SYSMAN_MMC_REMOVED || + mmc_state == VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED) { + gl_dbg("mmc_state[%d] : VCONFKEY_SYSMAN_MMC_REMOVED", mmc_state); + if (ad->maininfo.mmc_state == GL_MMC_STATE_ADDED_MOVING) { + /* + * Set pb_cancel status, + * indicates MMC removed while moving or deleting. + */ + gl_thread_set_cancel_state(ad, GL_PB_CANCEL_MMC); + /* MMC moved while moving or deleting */ + ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED_MOVING; + } else if (ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED_MOVING) { + gl_dbgW("View updated on GL_MMC_STATE_ADDED_MOVING"); + return; + } else { + /* MMC is extracted */ + ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED; + } + + gl_update_view(ad, GL_UPDATE_VIEW_MMC_REMOVED); + /* Remove ctxpopup */ + _gl_ctxpopup_del(ad); + } +} + +/** +* @param: b_update_albums_list +* True: Update albums list and medias list, then update normal view. +* False: Get new medias for current view from DB +* then update view to synchronize data with Myfile. +* Use case: +* Update edit gridview/listview. +*/ +static int _gl_update_thumb_items(void *data, bool b_update_albums_list) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + bool b_edit_m = false; + + gl_dbg("view_mode: %d, b_update_albums_list: %d.", view_mode, + b_update_albums_list); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + gl_dbg("Edit view."); + b_edit_m = true; + } + + /** + * 1, Update albums list and medias_elist, + * 2, Update medias_elist. + */ + if (b_update_albums_list) + gl_refresh_albums_list(ad); + else + _gl_data_update_item_list(ad); + + if (ad->maininfo.medias_cnt == 0) { + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_dbgW("It's s empty tag!"); + /* Remove invalid widgets */ + gl_del_invalid_widgets(ad, GL_INVALID_NEW_ENTRY_NOC); + /* Show nocontents */ + _gl_nocontents_show(ad); + return 0; + } + /* All items deleted, change to albms view */ + gl_pop_to_ctrlbar_ly(ad, !b_update_albums_list); + } else { + if (_gl_nocontents_show(ad)) { + gl_dbg("none video/image, show nocontents"); + /* Remove invalid widgets */ + gl_del_invalid_widgets(ad, GL_INVALID_NEW_ENTRY_NOC); + } else if (view_mode == GL_VIEW_THUMBS) { + _gl_thumbs_update_view(ad); + } else if (view_mode == GL_VIEW_THUMBS_EDIT) { + _gl_thumbs_show_edit_view(ad); + } + + /* Normal view, return */ + if (!b_edit_m) + return 0; + + /* Get selected medias count */ + int sel_cnt = _gl_data_selected_list_count(ad); + /* Remove invalid widgets */ + if (sel_cnt == 0) + gl_del_invalid_widgets(ad, GL_INVALID_NEW_ENTRY); + + /* Display selectioninfo */ + _gl_notify_create_selinfo(ad, ad->gridinfo.navi_content_edit_ly, + ad->gridinfo.nf_it_edit, + ad->maininfo.medias_cnt, sel_cnt, + true); + + /** + * Update albums list when change to normal view. + * Maybe some empty albums exist. + */ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_ALBUMS && + !b_update_albums_list) { + gl_dbg("Update albums list when cancelled."); + ad->albuminfo.update_albums_list = true; + } + } + + return 0; +} + +/* Update in select thunb view for Tags */ +static int _gl_update_select_thumb_items(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + + gl_dbg("view_mode: %d", view_mode); + if (view_mode != GL_VIEW_THUMBS_SELECT) { + gl_dbg("Not in Select view."); + return -1; + } + +#ifdef _USE_ROTATE_BG + __gl_refresh_albums_list(data, false, true); +#else + /* Checkme: albums list is not updated */ + _gl_data_update_item_list_without_tag(ad, ad->albuminfo.current_album, + _gl_tags_get_current_tag_name(ad)); +#endif + + if (ad->maininfo.medias_cnt == 0) { + if (ad->gridinfo.select_view) { + _gl_thumbs_clear_cbs(ad->gridinfo.select_view); + ad->gridinfo.select_view = NULL; + } + ad->gridinfo.select_view_ly = NULL; + int err = -1; + int item_cnt = 0; + err = _gl_data_get_item_cnt(ad, GL_ALBUM_ALL_ID, false, + GL_STORE_T_ALL, &item_cnt); + /* Destroy select albums view */ + if (err != 0 || item_cnt == 0) { + gl_dbg("None local albums."); + _gl_albums_sel_pop_view(ad); + } else { + gl_dbg("Empty album."); + _gl_thumbs_sel_pop_view(ad); + } + return 0; + } else { + _gl_thumbs_show_edit_view(ad); + + /* Get selected medias count */ + int sel_cnt = _gl_data_selected_list_count(ad); + /* Remove invalid widgets */ + if (sel_cnt == 0) + gl_del_invalid_widgets(ad, GL_INVALID_NEW_ENTRY); + + /* Display selectioninfo */ + _gl_notify_create_selinfo(ad, ad->gridinfo.select_view_ly, + ad->gridinfo.nf_it_select, + ad->maininfo.medias_cnt, sel_cnt, + true); + } + + return 0; +} + +/* Check if there is any MMC file contained in select_medias_elist */ +static bool _gl_check_mmc_file_selected(void *data) +{ + gl_dbg(""); + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + gl_item *gitem = NULL; + int i = 0; + int on_mmc = -1; + int cnt = _gl_data_selected_list_count(ad); + for (i = 0; i < cnt; i++) { + gitem = NULL; + on_mmc = -1; + + gitem = _gl_data_selected_list_get_nth(ad, i); + /* File on MMC is selected */ + if (gitem && gitem->item && gitem->item->file_url) { + on_mmc = strncmp(GL_ROOT_PATH_MMC, + gitem->item->file_url, + strlen(GL_ROOT_PATH_MMC)); + if (on_mmc == 0) + return true;; + } + } + return false; +} + +/* Stop vibrate device */ +static int _gl_stop_vibration(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->entryinfo.device_handle, -1); + GL_CHECK_VAL(ad->entryinfo.effect_handle, -1); + int ret = -1; + + if (ad->entryinfo.haptic_handle >= 0) { + ret = haptic_stop_effect(*(ad->entryinfo.device_handle), + *(ad->entryinfo.effect_handle)); + if (ret != 0) + gl_dbgE("haptic_stop_effect failed[%d]!", ret); + + ad->entryinfo.haptic_handle = -1; + } + GL_FREEIF(ad->entryinfo.device_handle); + GL_FREEIF(ad->entryinfo.effect_handle); + + return 0; +} + +static Eina_Bool _gl_vibration_timer_cb(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + _gl_stop_vibration(data); + + if (ad->entryinfo.vibration_timer) { + ecore_timer_del(ad->entryinfo.vibration_timer); + ad->entryinfo.vibration_timer = NULL; + } + return ECORE_CALLBACK_CANCEL; +} + +/* Move thumbnail and file */ +static Eina_Bool __gl_file_mv(gl_item *gitem, const char *src, const char *dst) +{ + GL_CHECK_FALSE(src); + GL_CHECK_FALSE(dst); + GL_CHECK_FALSE(gitem); + /* Move thumb first */ + if (_gl_fs_move(src, dst)) { + if (_gl_local_data_move_media(gitem->item, dst) < 0) { + gl_dbgE("Move media thumbnail failed!"); + return EINA_FALSE; + } + return EINA_TRUE; + } + return EINA_FALSE; +} + +#ifdef _USE_ROTATE_BG +/* b_path == true, Use saved folder path to check cluster uuid + * b_select == true, Update albums in select view for tag adding + */ +static int __gl_refresh_albums_list(void *data, bool b_path, bool b_select) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *current_album = ad->albuminfo.current_album; + char *uuid = NULL; + gl_cluster *current = NULL; + bool b_get_cur_album = false; + /* Albums list would be update, reset flag */ + ad->albuminfo.update_albums_list = false; + + uuid = calloc(1, GL_MTYPE_ITEN_ID_LEN_MAX); + GL_CHECK_VAL(uuid, -1); + + /* Save cluster ID to set new current_album from new albums list */ + if (current_album && current_album->cluster && + current_album->cluster->uuid) { + g_strlcpy(uuid, current_album->cluster->uuid, + GL_MTYPE_ITEN_ID_LEN_MAX); + b_get_cur_album = true; + } else { + gl_dbg("None album selected, current album is unavailable."); + } + + _gl_data_get_cluster_list(ad); + /* need to reset current album */ + ad->albuminfo.current_album = NULL; + + if (b_get_cur_album) { + if (b_path) { + gl_dbg("Path: %s", ad->albuminfo.dest_folder); + if (strlen(ad->albuminfo.dest_folder) > 0 && + GL_FILE_EXISTS(ad->albuminfo.dest_folder)) { + gl_dbgW("Cluster record updated!"); + _gl_data_get_cluster_by_path(ad, + ad->albuminfo.dest_folder, + ¤t); + } else { + gl_dbgE("Invalid folder path!"); + _gl_data_get_cluster_by_id(ad, uuid, ¤t); + } + } else { + _gl_data_get_cluster_by_id(ad, uuid, ¤t); + } + + if(current && current->cluster) { + ad->albuminfo.current_album = current; + gl_dbg("Reset current album: %s", + current->cluster->display_name); + if (b_select) + _gl_data_update_item_list_without_tag(ad, + current, + _gl_tags_get_current_tag_name(ad)); + else + _gl_data_update_item_list(ad); + } else { + /* Clear items list if current album doesn't exist */ + if (ad->selectedinfo.medias_elist) + _gl_data_selected_list_finalize(ad); + _gl_data_clear_default_item_list(ad); + ad->maininfo.medias_cnt = 0; + } + } + + GL_FREEIF(uuid); + return 0; +} + +#endif + +int gl_get_entry_text(Evas_Object * entry, char *entry_text, int len_max) +{ + gl_dbg(""); + GL_CHECK_VAL(entry_text, -1); + GL_CHECK_VAL(entry, -1); + + memset(entry_text, 0x00, len_max); + + char *entry_str = (char *)elm_entry_entry_get(entry); + if (entry_str) + { + if (strlen(entry_str) == 0) + { + gl_dbg("Entry string is empty!"); + } + else + { + char *entry_utf8 = elm_entry_markup_to_utf8(entry_str); // changes user input to utf-8 encoding format + if (entry_utf8 == NULL) + { + gl_dbgE("Make entry string to UTF8 failed!"); + return -1; + } + else if (strlen(entry_utf8) == 0) + { + gl_dbg("Entry text is empty!"); + } + else + { + g_strlcpy(entry_text, entry_utf8, len_max); + entry_text[len_max - 1] = '\0'; + } + + GL_FREE(entry_utf8); + } + } + else + { + gl_dbgE("Get entry string failed!"); + return -1; + } + + return 0; +} + +/** +* Change utf8 string to markup, then set it as entry text. +* To fix special character "&" issue, to convert "&" to "&". f.e. +* Myfiles->rename folder to AB&C->Gallery/Rename ->displayed as "AB" +*/ +int gl_set_entry_text(Evas_Object *entry, char *entry_text) +{ + GL_CHECK_VAL(entry, -1); + char *entry_makeup = NULL; + gl_dbg("Entry UTF8 text: %s.", entry_text); + + if (entry_text) { + entry_makeup = elm_entry_utf8_to_markup(entry_text); + if (entry_makeup == NULL) { + gl_dbgE("Make utf8 string to makeup failed!"); + return -1; + } + gl_dbg("Entry makeup text: %s.", entry_makeup); + } + /* Empty string set if entry_makeup is NULL */ + elm_entry_entry_set(entry, entry_makeup); + + GL_FREEIF(entry_makeup); + return 0; +} + +/** +* Check album name is valid and remove unuseful characters +* 1) not only includes space; +* 2) contains invalid character; +* 3) it's empty. +* +* @param b_new +* true: add a new album ; false: rename a album. +* @param b_enter +* true: Enter key pressed ; false: Button Done clicked. +* +*/ +int _gl_get_valid_album_name(void *data, char* album_name, bool b_new, + bool b_enter) +{ + GL_CHECK_VAL(album_name, -1); + GL_CHECK_VAL(data, -1); + gl_appdata* ad = (gl_appdata*)data; + int mode = 0; + gl_dbg("Input album name: %s", album_name); + char *popup_desc; + popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, sizeof(char)); + if (popup_desc == NULL) { + gl_dbg("memory allocation fail"); + return -1; + } + /* Check album name length */ + if (strlen(album_name) == 0) { + gl_dbgW("Inserted text is empty!"); + if (b_enter) { + gl_dbg("Enter key pressed."); + goto INVALID_ALBUM_NAME; + } + + if (b_new) + mode = GL_POPUP_ALBUM_NEW_EMPTY; + else + mode = GL_POPUP_ALBUM_RENAME_EMPTY; + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_ENTRY_IS_EMPTY, GL_STR_RETRY_Q); + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, mode, popup_desc); + goto INVALID_ALBUM_NAME; + } + gl_dbg("Inserted album name: %s, length: %d", album_name, strlen(album_name)); + + /* Removes leading and trailing whitespace */ + g_strstrip((gchar*)album_name); + if (strlen(album_name) == 0) { + gl_dbgW("Album name includes only space!"); + if (b_enter) { + gl_dbg("Enter key pressed."); + goto INVALID_ALBUM_NAME; + } + + if (b_new) + mode = GL_POPUP_ALBUM_NEW_EMPTY; + else + mode = GL_POPUP_ALBUM_RENAME_EMPTY; + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_INVALID_INPUT_PARAMETER, GL_STR_RETRY_Q); + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, mode, popup_desc); + goto INVALID_ALBUM_NAME; + } + + /* Check if there is any invalid character in string */ + if (_gl_fs_validate_name(album_name) == false) { + gl_dbgW("Album name includes invalid character!"); + if (b_new) + mode = GL_POPUP_ALBUM_NEW_INVALID; + else + mode = GL_POPUP_ALBUM_RENAME_INVALID; + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_INVALID_INPUT_PARAMETER, GL_STR_RETRY_Q); + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, mode, popup_desc); + goto INVALID_ALBUM_NAME; + } + + GL_FREE(popup_desc); + + return 0; + + INVALID_ALBUM_NAME: + GL_FREE(popup_desc); + return -1; +} + +/* * +* In case of system folder, the displayed name should be translated into system language +* +* @param album +* check album display name for getting proper translation +* +* @return +* the translated album display name +*/ +char *_gl_get_i18n_album_name(gl_cluster *album) +{ + GL_CHECK_NULL(album); + GL_CHECK_NULL(album->cluster); + + if(_gl_data_is_default_album(GL_ALBUM_DEFAULT_NAME, album->cluster)) { + /* system folder name: Camera */ + return GL_STR_CAMERA; + } else if(_gl_data_is_default_album(GL_ALBUM_DOWNLOAD_NAME, album->cluster)) { + /* system folder name: Downloads */ + return GL_STR_DOWNLOADS; + } else if(!g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) { + GL_FREEIF(album->cluster->display_name); + album->cluster->display_name = strdup(GL_ALBUM_ALL_NAME); + return album->cluster->display_name; + } else { + /* if the folder is not a system folder, return itself */ + return album->cluster->display_name; + } +} + +/** +* Check tag name is valid and remove unuseful characters +* 1) not only includes space; +* 2) it's empty. +* +* @param b_new +* true: add a new tag ; false: rename a tag. +* +* @param b_enter +* true: Enter key pressed ; false: Button Done clicked. +*/ +int _gl_get_valid_tag_name(void *data, char* tag_name, bool b_new, bool b_enter) +{ + GL_CHECK_VAL(tag_name, -1); + GL_CHECK_VAL(data, -1); + gl_appdata* ad = (gl_appdata*)data; + int mode = 0; + gl_dbg("Input tag name: %s", tag_name); + char *popup_desc; + popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, sizeof(char)); + if (popup_desc == NULL) { + gl_dbg("memory allocation fail"); + return -1; + } + + /* Check tag name length */ + if (strlen(tag_name) == 0) { + gl_dbgW("Inserted text is empty!"); + if (b_enter) { + gl_dbg("Enter key pressed."); + goto INVALID_TAG_NAME; + } + + if (b_new) { + mode = GL_POPUP_TAG_NEW_EMPTY; + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_ENTRY_IS_EMPTY, GL_STR_RETRY_Q); + } else { + mode = GL_POPUP_TAG_RENAEM_EMPTY; + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s", + GL_STR_ENTRY_IS_EMPTY); + } + + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, mode, popup_desc); + goto INVALID_TAG_NAME; + } + gl_dbg("Inserted tag name: %s, length: %d", tag_name, strlen(tag_name)); + + /* Removes leading and trailing whitespace */ + g_strstrip((gchar*)tag_name); + if (strlen(tag_name) == 0) { + gl_dbgW("Tag name includes only space!"); + if (b_enter) { + gl_dbg("Enter key pressed."); + goto INVALID_TAG_NAME; + } + + if (b_new) { + mode = GL_POPUP_TAG_NEW_EMPTY; + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.
%s", + GL_STR_ENTRY_IS_EMPTY, GL_STR_RETRY_Q); + } else { + mode = GL_POPUP_TAG_RENAEM_EMPTY; + snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s", + GL_STR_ENTRY_IS_EMPTY); + + } + + popup_desc[strlen(popup_desc)] = '\0'; + gl_popup_create_popup(ad, mode, popup_desc); + goto INVALID_TAG_NAME; + } + + GL_FREE(popup_desc); + return 0; + + INVALID_TAG_NAME: + GL_FREE(popup_desc); + return -1; +} + +int gl_get_selected_files_path_str(void *data, gchar sep_c, char **path_str, + int *sel_cnt) +{ + GL_CHECK_VAL(path_str, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->selectedinfo.medias_elist, -1); + GString *selected_path_list = g_string_new(NULL); + gl_item *current = NULL; + int selected_item_cnt = 0; + Eina_List *l = NULL; + + EINA_LIST_FOREACH(ad->selectedinfo.medias_elist, l, current) { + if (current == NULL || current->item == NULL) { + if (selected_path_list) { + g_string_free(selected_path_list, true); + selected_path_list = NULL; + } + return -1; + } + + if (strstr(selected_path_list->str, current->item->file_url)) { + gl_dbgW("Already appended!"); + } else { + selected_item_cnt++; + g_string_append(selected_path_list, + current->item->file_url); + g_string_append_c(selected_path_list, sep_c); + } + + } + gl_dbg("Selected items count: %d.", selected_item_cnt); + if (sel_cnt) + *sel_cnt = selected_item_cnt; + int len = strlen(selected_path_list->str); + g_string_truncate(selected_path_list, len - 1); + /** + * Frees the memory allocated for the GString. + * If free_segment is true it also frees the character data. + * If it's false, the caller gains ownership of the buffer + * and must free it after use with g_free(). + */ + *path_str = g_string_free(selected_path_list, false); + GL_CHECK_VAL(*path_str, -1); + gl_dbg("Total string:\n\n\t>>@@:> %s <:@@<<\n", *path_str); + return 0; +} + +int gl_make_new_album(const char *name) +{ + gl_dbg(""); + char path[GL_DIR_PATH_LEN_MAX] = { 0, }; + char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + + if (_gl_fs_get_default_folder(dir_path) != 0) { + gl_dbg("FAIL to get dir path"); + return -1; + } + + snprintf(path, GL_DIR_PATH_LEN_MAX, "%s/%s", dir_path, name); + path[strlen(path)] = '\0'; + gl_dbg("Making %s directory", path); + + _gl_fs_mkdir(dir_path); + _gl_fs_mkdir(path); + return 0; +} + +/* Used for loal medias, thumbnail was moved to new dest first, then rename file */ +int _gl_move_media_thumb(gl_item * gitem, char *new_dir_name, + bool is_full_path, int *popup_op) +{ + gl_dbg("Move media item START>>>"); + char new_path[GL_FILE_PATH_LEN_MAX] = { 0, }; + char ext[GL_FILE_EXT_LEN_MAX] = { 0, }; + char new_path_noext[GL_FILE_PATH_LEN_MAX] = { 0, }; + char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + if (gitem == NULL || gitem->item == NULL || gitem->item->uuid == NULL || + popup_op == NULL) + { + gl_dbg("gitem == NULL || gitem->item == NULL"); + return -1; + } + + *popup_op = GL_POPUP_OP_NONE; + + if (is_full_path) + { + if (!gitem->item->file_url || + !strlen(gitem->item->file_url) || + !gitem->item->display_name) + { + gl_dbg("file url or name is error."); + return -1; + } + snprintf(new_path, sizeof(new_path), "%s/%s", + new_dir_name, (char *)(gitem->item->display_name)); + gl_dbg("New path : %s", new_path); + + if (!g_strcmp0(new_path, gitem->item->file_url)) //do not need to move. ("All" album case) + { + //create popup in pipe callback + *popup_op = GL_POPUP_OP_SAME_ALBUM; + gl_dbg("File already in destination, do not need to move, just return..."); + /* + snprintf(msg, sizeof(msg), "Cann't move %s to the same album!", gitem->item->display_name); + gl_popup_create_popup(ad, GL_POPUP_NOBUT_MOV_DEL, msg); + */ + + return 0; + } + else if (ecore_file_exists(new_path)) // return true if file exists, rename new file. + { + _gl_fs_get_ext(new_path, ext, new_path_noext); + char *final_path = NULL; + final_path = _gl_fs_get_unique_full_path(new_path_noext, ext); + if (final_path == NULL) + return -1; + gl_dbg("Created unique path: %s", final_path); + memset(new_path, 0x00, GL_FILE_PATH_LEN_MAX); + g_strlcpy(new_path, final_path, GL_FILE_PATH_LEN_MAX); + GL_FREE(final_path); + //create popup in pipe callback + *popup_op = GL_POPUP_OP_DUPLICATED_NAME; + /*memset(msg, 0x00, GL_FILE_PATH_LEN_MAX); + snprintf(msg, sizeof(msg), "%s is duplicated, rename it!", gitem->item->display_name); + gl_popup_create_popup(ad, GL_POPUP_NOBUT_MOV_DEL, msg); + */ + } + } + else + { + if (_gl_fs_get_default_folder(dir_path) != 0) + { + gl_dbg("FAIL to get dir path!"); + return -1; + } + snprintf(new_path, GL_FILE_PATH_LEN_MAX, "%s/%s/%s", + dir_path, new_dir_name, (char *)(gitem->item->display_name)); + } + + new_path[strlen(new_path)] = '\0'; + + // stop using "rename" when moving from mmc to phone for correct db update. + if (!__gl_file_mv(gitem, gitem->item->file_url, new_path)) + { + gl_dbg("Move media item OVER<<<"); + return -1; + } + else + { + gl_dbg("Move media item OVER<<<"); + return 0; + } +} + +/* Used for move file to new dest */ +int _gl_move_media(gl_item *gitem, char *new_dir_name, bool is_full_path) +{ + gl_dbg("Move media START>>>"); + char new_path[GL_FILE_PATH_LEN_MAX] = { 0, }; + char ext[GL_FILE_EXT_LEN_MAX] = { 0, }; + char new_path_noext[GL_FILE_PATH_LEN_MAX] = { 0, }; + char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + if (!gitem || !gitem->item) { + gl_dbgE("Invalid gitem!"); + return -1; + } + + if (is_full_path) { + if (!gitem->item->file_url || !strlen(gitem->item->file_url) || + !gitem->item->display_name) { + gl_dbgE("file url or name is invalid!"); + return -1; + } + snprintf(new_path, sizeof(new_path), "%s/%s", + new_dir_name, (char *)(gitem->item->display_name)); + gl_dbg("New path : %s", new_path); + + if (!g_strcmp0(new_path, gitem->item->file_url)) { + gl_dbgW("File exists!"); + return 0; + } else if (ecore_file_exists(new_path)) { + _gl_fs_get_ext(new_path, ext, new_path_noext); + char *final_path = NULL; + final_path = _gl_fs_get_unique_full_path(new_path_noext, ext); + if (final_path == NULL) + return -1; + gl_dbg("Created unique path: %s", final_path); + memset(new_path, 0x00, GL_FILE_PATH_LEN_MAX); + g_strlcpy(new_path, final_path, GL_FILE_PATH_LEN_MAX); + GL_FREE(final_path); + } + } else { + if (_gl_fs_get_default_folder(dir_path) != 0) { + gl_dbgE("FAIL to get dir path!"); + return -1; + } + snprintf(new_path, GL_FILE_PATH_LEN_MAX, "%s/%s/%s", dir_path, + new_dir_name, (char *)(gitem->item->display_name)); + } + + new_path[strlen(new_path)] = '\0'; + + if (!_gl_fs_move(gitem->item->file_url, new_path)) { + gl_dbg("Move media OVER<<<"); + return -1; + } else { + gl_dbg("Move media OVER<<<"); + return 0; + } +} + +/** +* Check if there is any media in Gallery. +* +* False returned if none medias exist, other return True. +*/ +bool gl_check_gallery_empty(void* data) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->albuminfo.cluster_list == NULL) { + gl_dbgE("ad->albuminfo.cluster_list is empty!"); + return true; + } + + Eina_List *clist = ad->albuminfo.cluster_list->clist; + if (clist == NULL) { + gl_dbgW("Albums list is invalid!"); + return true; + } + + int len = eina_list_count(clist); + if (len == 0) { + gl_dbgW("Albums list is empty!"); + return true; + } + return false; +} + +bool gl_is_image_valid(void *data, char *filepath) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_FALSE(filepath); + + Evas_Object *image = NULL; + int width = 0; + int height = 0; + Evas *evas = NULL; + + evas = evas_object_evas_get(ad->maininfo.win); + GL_CHECK_FALSE(evas); + + image = evas_object_image_add(evas); + GL_CHECK_FALSE(image); + + evas_object_image_filled_set(image, 0); + evas_object_image_load_scale_down_set(image, 0); + evas_object_image_file_set(image, filepath, NULL); + evas_object_image_size_get(image, &width, &height); + if(image) { + evas_object_del(image); + image = NULL; + } + + if (width <= 0 || height <= 0) { + gl_dbg("Cannot load file : %s", filepath); + return false; + } + + return true; +} + +bool gl_is_rotation_locked(void) +{ + gl_dbg_launch(" gl_is_rotation_locked:start"); + int lock = -1; + + if (!vconf_get_bool(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, &lock)) + { + gl_dbg("Rotation locked state[%d].", lock); + gl_dbg_launch(" gl_is_rotation_locked:end"); + return lock; + } + else + { + gl_dbgE("Get rotation lock state failed!"); + gl_dbg_launch(" gl_is_rotation_locked:end"); + return false; + } +} + +/* +* Check MMC state(Inserted/Removed) for Move/Delete/Add tag/Remove. +*/ +int gl_check_mmc_state(void *data, char *dest_folder) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* MMC hasn't been inserted */ + if (ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED) + return 0; + + int on_mmc = -1; + /** + * 1, Places: Add tag; + * 2, Tags: Add tag/remove tag; + * 3, Albums: Move/Delete/Add tag. + */ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + if (_gl_check_mmc_file_selected(ad)) + goto ON_MMC; + } else { + /* Move files to MMC album */ + if (dest_folder) { + on_mmc = strncmp(GL_ROOT_PATH_MMC, dest_folder, + strlen(GL_ROOT_PATH_MMC)); + if (on_mmc == 0) + goto ON_MMC; + } + + gl_cluster *cur_album = ad->albuminfo.current_album; + char src_folder_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + GL_CHECK_VAL(cur_album, -1); + GL_CHECK_VAL(cur_album->cluster, -1); + /* Move files from MMC album */ + GL_CHECK_VAL(cur_album->cluster->uuid, -1); + g_strlcpy(src_folder_path, cur_album->cluster->path, + GL_DIR_PATH_LEN_MAX); + on_mmc = strncmp(GL_ROOT_PATH_MMC, src_folder_path, + strlen(GL_ROOT_PATH_MMC)); + /* Check MMC files selected in album [All albums] */ + if (on_mmc == 0) { + goto ON_MMC; + } else if (cur_album->cluster->type == GL_STORE_T_ALL) { + gl_dbg("In album [All albums]."); + if (_gl_check_mmc_file_selected(ad)) + goto ON_MMC; + } + } + return 0; + + ON_MMC: + gl_dbgW("Operate medias on MMC!"); + ad->maininfo.mmc_state = GL_MMC_STATE_ADDED_MOVING; + return 0; +} + +int gl_reg_db_update_noti(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int error_code = -1; + int mmc_state = -1; + + vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc_state); + /* Save the init status of MMC */ + if (mmc_state == VCONFKEY_SYSMAN_MMC_MOUNTED) + { + gl_dbg("###### :::::: MMC loaded! :::::: ######"); + ad->maininfo.mmc_state = GL_MMC_STATE_ADDED; + } + else if (mmc_state == VCONFKEY_SYSMAN_MMC_REMOVED || + mmc_state == VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED) + { + gl_dbg("###### :::::: MMC removed! :::::: ######"); + ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED; + } + + gl_dbg("Enable the noti handle for DB update status!"); + /* Set DB update status callback */ + error_code = vconf_notify_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS, + _gl_db_update_noti_cb, ad); + if (error_code == -1) { + gl_dbgE("vconf_notify_key_changed for DB_STATUS failed!"); + return -1; + } + + return 0; +} + +int gl_dereg_db_update_noti(void) +{ + int error_code = -1; + + gl_dbg("Disable the noti handle for DB update status!"); + error_code = vconf_ignore_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS, + _gl_db_update_noti_cb); + if (error_code == -1) { + gl_dbgE("vconf_ignore_key_changed for DB_STATUS failed!"); + return -1; + } + + return 0; +} + +/* +* Get view mode of app +*/ +int gl_get_view_mode(void *data) +{ + GL_CHECK_VAL(data, GL_VIEW_NONE); + gl_appdata *ad = (gl_appdata *)data; + return ad->maininfo.view_mode; +} + +/* +* Set view mode of app +*/ +int gl_set_view_mode(void *data, int mode) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + ad->maininfo.view_mode = mode; + return 0; +} + +int gl_del_invalid_widgets(void *data, int invalid_m) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + if (ad->popupinfo.popup) { + /* Remove popup */ + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + } else if (ad->uginfo.ug_called_by_me) { + /* Destroy UG */ + gl_dbg("Destroy UG!"); + if (ad->uginfo.ug_called_by_me) { + ug_destroy(ad->uginfo.ug_called_by_me); + ad->uginfo.ug_called_by_me = NULL; + ad->uginfo.ug_type = -1; + } + if (ad->uginfo.gallery_ug_called_by_me) { + ug_destroy(ad->uginfo.gallery_ug_called_by_me); + ad->uginfo.gallery_ug_called_by_me = NULL; + } + } + + switch (invalid_m) { + case GL_INVALID_NEW_ENTRY: + case GL_INVALID_NEW_ENTRY_NOC: + if (ad->entryinfo.entry_mode == GL_ENTRY_NEW_ALBUM || + ad->entryinfo.entry_mode == GL_ENTRY_NEW_TAG) { + gl_dbg("Destroy New album/tag view!"); + if (invalid_m == GL_INVALID_NEW_ENTRY) { + gl_dbg("Pop to nf_it_edit"); + elm_naviframe_item_pop_to(ad->gridinfo.nf_it_edit); + } + _gl_editfield_destroy_imf(ad); + Evas_Object *edit_ly = NULL; + edit_ly = ad->gridinfo.navi_content_edit_ly; + edje_object_signal_emit(_EDJ(edit_ly), + GL_SIGNAL_VIEW_EDIT, "elm"); + } + break; + case GL_INVALID_NEW_TAG_VIDEO: + if (ad->entryinfo.entry_mode == GL_ENTRY_NEW_TAG) { + gl_dbg("Destroy New tag view!"); + elm_naviframe_item_pop_to(ad->gridinfo.nf_it); + _gl_editfield_destroy_imf(ad); + } + break; + default: + ad->entryinfo.entry_mode = GL_ENTRY_NONE; + break; + } + return 0; +} + +int gl_del_medias(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + /* Get all selected medias count */ + int cnt = _gl_data_selected_list_count(ad); + /* Check MMC state for cancel operation */ + gl_check_mmc_state(ad, NULL); + gl_dbg("MMC state: %d.", ad->maininfo.mmc_state); + _gl_use_thread_operate_medias(ad, GL_STR_DELETING, cnt, + GL_MEDIA_OP_DELETE); + + return 0; +} + +/* 'Delete medias' is available in Albums view */ +int gl_del_selected(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + /* Get all selected medias count */ + int cnt = _gl_data_selected_list_count(ad); + gl_item *gitem = NULL; + int i = 0; + int popup_op = GL_POPUP_OP_NONE; + + /* Removed media from selected_media_elist */ + for (i = 1; i <= cnt; i++) { + _gl_data_get_item_by_index(ad, i, true, &gitem); + if (gitem != NULL && gitem->item != NULL) + _gl_data_remove_item(gitem); + else + gl_dbgE("Invalid item!"); + + gl_dbg("Write pipe, make progressbar updated!"); + gl_thread_write_pipe(ad, i, popup_op); + gitem = NULL; + } + + return 0; +} + +int _gl_update_operation_view(void *data, const char *noti_str) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("String: %s", noti_str); + + if (ad->maininfo.medias_cnt > 0) { + /* Deleting process done, change to normal view */ + _gl_ui_pop_to_thumb(ad); + + if (gl_get_view_mode(ad) == GL_VIEW_THUMBS) + _gl_nocontents_show(ad); + + /* Add notification */ + _gl_notify_create_notiinfo(ad, noti_str); + } else { + gl_dbgW("Empty album, change to Albums view!"); + gl_albums_comeback_from_view(ad); + elm_naviframe_item_pop_to(ad->ctrlinfo.nf_it); + + if (gl_check_gallery_empty(ad)) { + _gl_ctrl_disable_btn(ad, true, GL_NAVI_ALBUMS); + gl_ctrl_disable_ctrlbar(ad, true); + } else if (ad->albuminfo.cluster_list->edit_cnt == 0) { + _gl_ctrl_disable_btn(ad, true, GL_NAVI_ALBUMS); + } + + _gl_notify_destroy_selinfo(ad); + /* Add notification */ + _gl_notify_create_notiinfo(ad, noti_str); + } + return 0; +} + +/* Update view after deleting process done */ +int gl_update_del_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + _gl_data_selected_list_finalize(ad); + + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d.", view_mode); + gl_refresh_albums_list(ad); + + _gl_update_operation_view(ad, GL_STR_DELETED); + + return 0; +} + +int gl_remove_album(void *data, gl_cluster * album_item) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int res = -1; + char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + + if (album_item == NULL || album_item->cluster == NULL || + album_item->cluster->uuid == NULL) { + gl_dbgE("Invalid album!"); + return -1; + } + + gl_dbg("Remove album: %s, id=%s", album_item->cluster->display_name, + album_item->cluster->uuid); + + /* get folder path of album */ + if (album_item->cluster->path && + strlen(album_item->cluster->path) > 0) { + gl_dbg("Folder fullpath: %s", dir_path); + g_strlcpy(dir_path, album_item->cluster->path, + GL_DIR_PATH_LEN_MAX); + } else { + gl_dbgE("Get folder fullpath failed[%d]!", res); + return -1; + } + /* remove all items in the album from file system and db */ + _gl_data_get_item_list(ad, GL_CATEGORY_FOLDER, album_item, + GL_GET_ALL_RECORDS, GL_GET_ALL_RECORDS); + + gl_item *gitem = NULL; + int i = 0; + /* Get all medias count of current album */ + int cnt = ad->maininfo.medias_cnt; + gl_dbg("cnt: %d", cnt); + /* Remove files, _gl_local_data_delete_album would delete medias record */ + for (i = cnt; i >= 1; i--) { + _gl_data_get_item_by_index(ad, i, false, &gitem); + if (gitem && gitem->item && gitem->item->file_url) { + if (!ecore_file_unlink(gitem->item->file_url)) + gl_dbgE("ecore_file_unlink failed!"); + } + } + + /* remove album from db*/ + res = _gl_local_data_delete_album(album_item->cluster->uuid); + if (res != 0) + gl_dbgE("_gl_local_data_delete_album failed[%d]!", res); + + /* remove album from file system */ + if (ecore_file_rmdir(dir_path) == EINA_FALSE) { + gl_dbg("ecore_file_rmdir failed!"); + return -1; + } + + return 0; +} + +int gl_del_albums(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *album_item = NULL; + int cnt = _gl_data_get_albums_selected_cnt(ad); + int i = 0; + int ret = -1; + gl_dbg(""); + // delete albums + + Eina_List *selected_list = ad->albuminfo.selected_albums_elist; + if ((selected_list == NULL) || (eina_list_count(selected_list) == 0)) + { + gl_dbg("zero length, return!"); + return -1; + } + else + { + gl_dbg("cnt= %d, list length=%d", cnt, eina_list_count(selected_list)); + } + for (i = 0; i < cnt; i++) + { + album_item = eina_list_nth(selected_list, i); + + if (album_item && album_item->cluster && + album_item->cluster->uuid) { + gl_dbg("Delete album: %s, id=%s", + album_item->cluster->display_name, + album_item->cluster->uuid); + ret = gl_remove_album(ad, album_item); + if (ret < 0) + { + gl_dbg("gl_remove_album failed, error=%d", ret); + //return -1; + } + } + } + + // update the albums view + _gl_albums_edit_pop_view(ad); + + //add notification + _gl_notify_create_notiinfo(ad, GL_STR_DELETED); + return 0; +} + +int gl_refresh_albums_list(void *data) +{ +#ifdef _USE_ROTATE_BG + return __gl_refresh_albums_list(data, false, false); +#else + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_cluster *old_current_album = ad->albuminfo.current_album; + char cluster_id[GL_MTYPE_ITEN_ID_LEN_MAX] = { 0, }; + gl_cluster *current = NULL; + bool b_get_cur_album = false; + /* Albums list would be update, reset flag */ + ad->albuminfo.update_albums_list = false; + + /* Save cluster ID to set new current_album from new albums list */ + if (old_current_album && old_current_album->cluster && + old_current_album->cluster->uuid) { + g_strlcpy(cluster_id, old_current_album->cluster->uuid, + GL_MTYPE_ITEN_ID_LEN_MAX); + b_get_cur_album = true; + } else { + gl_dbg("None album selected, current album is unavailable."); + } + + _gl_data_get_cluster_list(ad); + /* need to reset current album */ + ad->albuminfo.current_album = NULL; + + if (b_get_cur_album) { + _gl_data_get_cluster_by_id(ad, cluster_id, ¤t); + if(current && current->cluster) { + ad->albuminfo.current_album = current; + gl_dbg("Reset current album: %s", + current->cluster->display_name); + _gl_data_update_item_list(ad); + return 0; + } else { + /* Clear items list if current album doesn't exist */ + if (ad->selectedinfo.medias_elist) + _gl_data_selected_list_finalize(ad); + _gl_data_clear_default_item_list(ad); + ad->maininfo.medias_cnt = 0; + } + } + + return 0; +#endif +} + +/** +* Move files under root album [/opt/media or /opt/storage/sdcard] to a newly created album. +* Used in 'Rename' album case. +*/ +int +gl_move_root_album(void* data, gl_cluster* cur_album, char* dest_path) +{ + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(cur_album, -1); + GL_CHECK_VAL(cur_album->cluster, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Get all medias of current album */ + _gl_data_get_item_list(ad, GL_CATEGORY_FOLDER, cur_album, + GL_GET_ALL_RECORDS, GL_GET_ALL_RECORDS); + + Eina_List* tmp_elist = NULL; + gl_item* gitem = NULL; + int popup_op = GL_POPUP_OP_NONE; + GL_CHECK_VAL(ad->maininfo.medias_elist, -1); + + /* Move medias of album to dest folder */ + EINA_LIST_FOREACH(ad->maininfo.medias_elist, tmp_elist, gitem) + { + if (gitem && gitem->item) + { + gl_dbg("Move [%s]", gitem->item->file_url); + if (_gl_move_media_thumb(gitem, dest_path, true, &popup_op) != 0) + gl_dbgW("Failed to move this item"); + + gitem = NULL; + } + else + { + gl_dbgE("Invalid item!"); + _gl_data_clear_default_item_list(ad); + return -1; + } + } + + /* Free item list */ + _gl_data_clear_default_item_list(ad); + + return 0; +} + +/* 'Move medias' is only available in tab Albums */ +int gl_move_selected(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + /* Get selected medias count */ + int cnt = _gl_data_selected_list_count(ad); + gl_item *gitem = NULL; + int popup_op = GL_POPUP_OP_NONE; + + for (i = 1; i <= cnt; i++) + { + _gl_data_get_item_by_index(ad, i, true, &gitem); + if (gitem && gitem->item) + { + gl_dbg("Selected [%s]", gitem->item->file_url); + if (_gl_move_media_thumb(gitem, ad->albuminfo.dest_folder, true, &popup_op) != 0) + gl_dbg("Failed to move this item"); + + gl_dbg("File Moved:::::::%d/%d-->try to update progressbar", i, cnt); + } + else + { + gl_dbg("Invalid item!"); + } + + gl_dbg("Write pipe, make progressbar updated!"); + gl_thread_write_pipe(ad, i, popup_op); + + popup_op = GL_POPUP_OP_NONE; + } + + return 0; +} + +int gl_move_to_album(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + char folder_fullpath[GL_DIR_PATH_LEN_MAX] = { 0, }; + char default_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + gl_cluster *cur_album = ad->albuminfo.current_album; + int cnt = _gl_data_selected_list_count(ad); + + /** + * 'move_album_id == NULL' is new album case, + * other move/save to some existed album. + */ + if (ad->albuminfo.path == NULL) { + gl_dbg("---Popup list item: New album---"); + ad->albuminfo.move_new_album = true; + + if (gl_make_new_album(ad->albuminfo.new_album_name) != 0) + { + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_SAME_NAME_ALREADY_IN_USE); + gl_dbgE("Failed to make a new directory!"); + gl_ui_update_select_widgets(ad); + return -1; + } + if (_gl_fs_get_default_folder(default_path) != 0) + { + gl_dbgE("Failed to get default images path!"); + gl_ui_update_select_widgets(ad); + return -1; + } + snprintf(folder_fullpath, GL_DIR_PATH_LEN_MAX, "%s/%s", + default_path, ad->albuminfo.new_album_name); + } else { + ad->albuminfo.move_new_album = false; + g_strlcpy(folder_fullpath, ad->albuminfo.path, + GL_DIR_PATH_LEN_MAX); + GL_FREE(ad->albuminfo.path); + } + + if (cur_album == NULL || cur_album->cluster == NULL) + { + gl_dbgE("[Error] Current album is NULL!"); + gl_ui_update_select_widgets(ad); + return -1; + } + + memset(ad->albuminfo.dest_folder, 0x00, GL_DIR_PATH_LEN_MAX); + g_strlcpy(ad->albuminfo.dest_folder, folder_fullpath, GL_DIR_PATH_LEN_MAX); + /* Check MMC state for cancel operation */ + gl_check_mmc_state(ad, folder_fullpath); + gl_dbg("MMC state: %d.", ad->maininfo.mmc_state); + _gl_use_thread_operate_medias(ad, GL_STR_MOVING, cnt, + GL_MEDIA_OP_MOVE); + return 0; +} + +/* Update view after moving process done */ +int gl_update_move_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d", view_mode); + _gl_data_selected_list_finalize(ad); + _gl_notify_destroy_selinfo(ad); + /* Update albums list and items list */ + gl_refresh_albums_list(ad); + + _gl_update_operation_view(ad, GL_STR_MOVED); + + return 0; +} + +int _gl_get_selected_paths(void *data, gchar sep_c, char **path_str, + int *sel_cnt) +{ + GL_CHECK_VAL(path_str, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_m = gl_get_view_mode(data); + gl_dbg("view_m: %d", view_m); + + if (view_m == GL_VIEW_ALBUMS_EDIT) { + gl_dbg("Albums"); + if (ad->albuminfo.selected_albums_elist == NULL) { + gl_dbgE("Invalid selected_albums_elist!"); + return -1; + } + /* Get file string */ + _gl_data_get_albums_selected_files_path_str(ad, sep_c, path_str, + sel_cnt); + } else if (view_m == GL_VIEW_TAGS_EDIT) { + gl_dbg("Tags"); + /* Get file string */ + _gl_data_get_tags_selected_files_path_str(ad, sep_c, path_str, + sel_cnt); + } else { + gl_dbg("Normal files"); + gl_get_selected_files_path_str(ad, sep_c, path_str, sel_cnt); + } + return 0; +} + +/* Load selected item for Share album's content */ +int _gl_share_load(void *data, const char *label) +{ + GL_CHECK_VAL(label, -1); + GL_CHECK_VAL(data, GL_UG_FAIL); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("label : %s ", label); + + if (!g_strcmp0(label, GL_SHARE_MESSAGE)) { + gl_ext_load_ug(data, GL_UG_MSG); + } else if (!g_strcmp0(label, GL_SHARE_EMAIL)) { + gl_ext_load_ug(data, GL_UG_EMAIL); + } else if (!g_strcmp0(label, GL_SHARE_BLUETOOTH)) { + gl_ext_load_ug(data, GL_UG_BT); + if (ad->entryinfo.imf_entry) + elm_object_focus_set(ad->entryinfo.imf_entry, + EINA_FALSE); + } else { + gl_dbgE("Wrong UG name!"); + return -1; + } + return 0; +} + +int gl_share_select_item(void *data, const char *label) +{ + GL_CHECK_VAL(label, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("label : %s ", label); + int cnt = 0; + + cnt = _gl_data_selected_list_count(ad); + + gl_dbg("Selected item(s) count: %d.", cnt); + if (cnt < 1) { + gl_dbgE("None items selected!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return -1; + } + + if (!g_strcmp0(label, GL_SHARE_MESSAGE)) { + gl_ext_load_ug(ad, GL_UG_MSG); + } else if (!g_strcmp0(label, GL_SHARE_EMAIL)) { + gl_ext_load_ug(ad, GL_UG_EMAIL); + } else if (!g_strcmp0(label, GL_SHARE_BLUETOOTH)) { + gl_ext_load_ug(ad, GL_UG_BT); + } + + return 0; +} + +/* +* add selected medias to some tag +*/ +int gl_add_to_tag(void *data, const char *tagname) +{ + GL_CHECK_VAL(tagname, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_m = gl_get_view_mode(ad); + + if ((view_m != GL_VIEW_THUMBS_SELECT) && + ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_dbg("Add new tag: %s.", tagname); + /* Add an emtpy tag in tags list view */ + int ret = -1; + ret = _gl_local_data_add_tag(tagname, NULL); + if (ret != 0) + gl_dbgW("_gl_local_data_add_tag failed!"); + + /* Hide title from animation */ + gl_ui_set_navi_title_visible(ad, EINA_FALSE); + elm_naviframe_item_pop(ad->maininfo.naviframe); + /* Recover the previous UI */ + gl_ctrl_rotate_ctrlbar(ad, GL_VIEW_ALBUMS_EDIT); + gl_tag_update_view(ad); + _gl_ctrl_disable_btn(ad, false, GL_NAVI_TAGS); + + /* Add notification */ + _gl_notify_create_notiinfo(ad, GL_STR_ADDED); + + } else { + /* Get all selected medias count */ + int cnt = _gl_data_selected_list_count(ad); + if (cnt == 0) { + gl_dbg("No items selected, return!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + ad->taginfo.b_favor_tag = false; + return -1; + } + + gl_dbg("Add tag[%s] to medias.", tagname); + g_strlcpy(ad->taginfo.new_tag_name, tagname, + sizeof(ad->taginfo.new_tag_name)); + + /* Check MMC state for cancel operation */ + gl_check_mmc_state(ad, NULL); + gl_dbg("MMC state: %d.", ad->maininfo.mmc_state); + _gl_use_thread_operate_medias(ad, GL_STR_ADD_TAG, cnt, + GL_MEDIA_OP_ADD_TAG); + } + + return 0; +} + +int gl_add_tag_to_selected(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int ret = -1; + int cnt = 0; + gl_item *gitem = NULL; + int i = 0; + int popup_op = GL_POPUP_OP_NONE; + gl_tag *gtag = ad->taginfo.current_tag; + + cnt = _gl_data_selected_list_count(ad); + + if ((gl_get_view_mode(ad) != GL_VIEW_THUMBS_SELECT) && + ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS && gtag && gtag->tag && + gtag->tag->tag_name && + !g_strcmp0(gtag->tag->tag_name, ad->taginfo.new_tag_name)) { + gl_dbgW("Already add current tag to medias!"); + /* To operate one item to show progressbar popup completely */ + cnt = 1; + } + + for (i = 0; i < cnt; i++) { + gitem = _gl_data_selected_list_get_nth(ad, i); + if (gitem && gitem->item) { + if (ad->taginfo.b_favor_tag) { + if (!gitem->item->favorite) { + ret = _gl_local_data_set_favorite(gitem->item, + true); + /* Data not updated from DB, need to set favor */ + if (ret == -1) + gl_dbgW("db_update_favorite failed!"); + else + gitem->item->favorite = true; + } + } else { + /* Add tag to media */ + ret = _gl_local_data_add_tag(ad->taginfo.new_tag_name, + gitem->item->uuid); + if (ret != 0) + gl_dbgW("_gl_local_data_add_tag failed!"); + } + + gl_dbg("Write pipe, make progressbar updated!"); + gl_thread_write_pipe(ad, i+1, popup_op); + + gitem = NULL; + popup_op = GL_POPUP_OP_NONE; + } + } + return 0; +} + +int gl_update_add_tag_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_m = gl_get_view_mode(ad); + gl_dbg("view_m: %d", view_m); + + /* Update items list */ + if (view_m == GL_VIEW_THUMBS_SELECT) { + /* Pop to tags thumbnail view */ + elm_naviframe_item_pop_to(ad->gridinfo.nf_it); + + if (ad->gridinfo.select_view) { + _gl_thumbs_clear_cbs(ad->gridinfo.select_view); + ad->gridinfo.select_view = NULL; + } + ad->gridinfo.select_view_ly = NULL; + ad->gridinfo.nf_it_select = NULL; + + ad->albuminfo.select_view = NULL; + ad->albuminfo.select_view_ly = NULL; + ad->albuminfo.nf_it_select = NULL; + + GL_CHECK_VAL(ad->taginfo.current_tag, -1); + /* Clear selected list */ + _gl_data_selected_list_finalize(ad); + + /* Restore view mode */ + gl_set_view_mode(ad, GL_VIEW_THUMBS); + + _gl_update_thumb_items(ad, false); + } else { + /* Check is it a new tag */ + bool res = _gl_data_is_in_tag_list(ad, ad->taginfo.new_tag_name); + memset(ad->taginfo.new_tag_name, 0x00, + sizeof(ad->taginfo.new_tag_name)); + /* Update tag list in tags view if new tag added */ + if (!res && ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_dbg("New tag added in tags view, update tags list."); + _gl_data_update_tag_list(ad, NULL); + } + + /* Change to normal view */ + _gl_ui_pop_to_thumb(ad); + } + + ad->taginfo.b_favor_tag = false; + /* Add notification */ + _gl_notify_create_notiinfo(ad, GL_STR_ADDED); + return 0; +} + +/* +* In thumbnails view, after tap "Add tag", +* show UI for adding a new tag or just add tag in background. +* Create a new tag, and add selected items to it. +*/ +int gl_add_tag(void *data, gl_tag * gtag) +{ + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(gtag->tag, -1); + GL_CHECK_VAL(gtag->tag->tag_name, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + ad->taginfo.b_favor_tag = false; + + /* add items to favorites */ + if (gtag->tag->_id == GL_TAG_FAVORITES_ID) + ad->taginfo.b_favor_tag = true; + gl_add_to_tag(ad, gtag->tag->tag_name); + + return 0; +} + +int gl_remove_tag_items(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->taginfo.current_tag, -1); + GL_CHECK_VAL(ad->taginfo.current_tag->tag, -1); + + _gl_remove_tag_items(data, ad->taginfo.current_tag); + + return 0; +} + +int gl_remove_tag_from_selected(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int cnt = _gl_data_selected_list_count(ad); + int i = 0; + gl_item *gitem = NULL; + int ret = -1; + int popup_op = GL_POPUP_OP_NONE; + gl_tag * cur_tag = ad->taginfo.current_tag; + + if (!cur_tag || !cur_tag->tag) { + gl_dbgE("Null tag"); + return -1; + } + + for (i = 0; i < cnt; i++) { + gitem = _gl_data_selected_list_get_nth(ad, i); + if (gitem && gitem->item && gitem->item->uuid) { + if (cur_tag->tag->_id == GL_TAG_FAVORITES_ID) { + if (gitem->item->favorite) + _gl_local_data_set_favorite(gitem->item, + false); + } else { + ret = _gl_local_data_remove_tag(cur_tag->tag, + gitem->item->uuid); + if (ret != 0) + gl_dbgW("_gl_local_data_remove_tag failed!"); + } + } else { + gl_dbgE("Invalid item!"); + } + + gl_dbg("Write pipe, make progressbar updated!"); + gl_thread_write_pipe(ad, i+1, popup_op); + + gitem = NULL; + popup_op = GL_POPUP_OP_NONE; + } + return 0; +} + +int gl_update_remove_tag_view(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_tag * cur_tag = ad->taginfo.current_tag; + + if (!cur_tag || !cur_tag->tag) { + gl_dbgE("Null tag"); + return -1; + } + + /* Destroy selection info */ + _gl_notify_destroy_selinfo(ad); + _gl_data_selected_list_finalize(ad); + + /* Update item list */ + if (cur_tag->tag->_id == GL_TAG_FAVORITES_ID) + _gl_data_get_item_list(ad, GL_CATEGORY_FAVORITES, NULL, + GL_GET_ALL_RECORDS, GL_GET_ALL_RECORDS); + else + _gl_data_get_item_list_tagname(ad, cur_tag->tag->_id, true, + NULL); + + if (ad->maininfo.medias_cnt == 0) { + gl_dbg("All items removed, change to tags view"); + _gl_tag_comeback_from_view(ad); + + elm_naviframe_item_pop_to(ad->ctrlinfo.nf_it); + /* Only favorites tag, so disable edit button */ + if (_gl_data_get_tag_count_all(ad) <= 1) + _gl_ctrl_disable_btn(ad, true, GL_NAVI_TAGS); + } else { + if (_gl_nocontents_show(ad)) { + gl_dbg("none video/image, show nocontents"); + /* Add notification */ + _gl_notify_create_notiinfo(ad, GL_STR_REMOVED); + return -1; + } + _gl_thumbs_show_edit_view(ad); + + gl_ui_show_selall(ad); + edje_object_signal_emit(_EDJ(ad->gridinfo.navi_content_edit_ly), + GL_SIGNAL_VIEW_EDIT, "elm"); + _gl_ctrl_disable_btns(ad, ad->gridinfo.nf_it_edit, true); + } + /* Add notification */ + _gl_notify_create_notiinfo(ad, GL_STR_REMOVED); + + return 0; +} + +#ifdef _USE_ROTATE_BG + +int _gl_delay(double sec) +{ + gl_dbg("Start"); + struct timeval tv; + unsigned int start_t = 0; + unsigned int end_t = 0; + unsigned int delay_t = (unsigned int)(sec * GL_TIME_USEC_PER_SEC); + + gettimeofday(&tv, NULL); + start_t = tv.tv_sec * GL_TIME_USEC_PER_SEC + tv.tv_usec; + + for(end_t = start_t; end_t - start_t < delay_t;) { + gettimeofday(&tv, NULL); + end_t = tv.tv_sec * GL_TIME_USEC_PER_SEC + tv.tv_usec; + } + + gl_dbg("End"); + return 0; +} + +int _gl_rotate_images(void *data, bool b_left) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + /* Get all selected medias count */ + int cnt = _gl_data_selected_list_count(ad); + /* Check MMC state for cancel operation */ + gl_check_mmc_state(ad, NULL); + gl_dbg("MMC state: %d.", ad->maininfo.mmc_state); + /* Rotate left */ + int op_type = GL_MEDIA_OP_ROTATING_LEFT; + /* Rotate right */ + if (!b_left) + op_type = GL_MEDIA_OP_ROTATING_RIGHT; + _gl_use_thread_operate_medias(ad, GL_STR_ROTATING, cnt, op_type); + + return 0; +} + +int _gl_rotate_selected(void *data, int op_type) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + /* Get all selected medias count */ + int cnt = _gl_data_selected_list_count(ad); + gl_item *gitem = NULL; + int i = 0; + int popup_op = GL_POPUP_OP_NONE; + unsigned int orient = GL_ORIENTATION_ROT_ERR; + unsigned int new_orient = GL_ORIENTATION_ROT_ERR; + int ret = -1; + bool b_left = false; + + if (op_type == GL_MEDIA_OP_ROTATING_LEFT) + b_left = true; + + gl_cluster *current_album = ad->albuminfo.current_album; + /* Save cluster path to set new current_album from new albums list */ + if (current_album && current_album->cluster && + current_album->cluster->path && + strlen(current_album->cluster->path)) + g_strlcpy(ad->albuminfo.dest_folder, + current_album->cluster->path, GL_DIR_PATH_LEN_MAX); + else + gl_dbgE("Invalid folder path!"); + + /* Removed media from selected_media_elist */ + for (i = 1; i <= cnt; i++) { + _gl_data_get_item_by_index(ad, i, true, &gitem); + if (gitem != NULL && gitem->item != NULL && + gitem->item->file_url && + gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE && + GL_FILE_EXISTS(gitem->item->file_url)) { + /* Save orient in file */ + ret = _gl_exif_get_orientation(gitem->item->file_url, + &orient); + if (ret == 0) { + new_orient = _gl_exif_get_rotated_orientation(orient, + b_left); + _gl_exif_set_orientation(gitem->item->file_url, + new_orient); + /* Update thumbnail */ + media_info_refresh_metadata_to_db(gitem->item->uuid); + } + } else { + gl_dbgE("Invalid item!"); + } + + /* Add some delay for last two images to wait for thumb updated */ + if (i > cnt - 2) + _gl_delay(GL_ROTATE_DELAY); + + if (i == cnt) { + gl_dbgW("Last image rotated!"); + /* Add another delay for last thumb */ + _gl_delay(GL_ROTATE_DELAY); + } + gl_dbg("Write pipe, make progressbar updated!"); + gl_thread_write_pipe(ad, i, popup_op); + gitem = NULL; + } + /* Clear selected list */ + _gl_data_selected_list_finalize(data); + return 0; +} + +/* Update view after deleting process done */ +int _gl_update_rotate_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + _gl_data_selected_list_finalize(ad); + + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d.", view_mode); + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) + _gl_data_update_item_list(ad); + else + __gl_refresh_albums_list(ad, false, false); + + memset(ad->albuminfo.dest_folder, 0x00, GL_DIR_PATH_LEN_MAX); + + _gl_update_operation_view(ad, GL_STR_ROTATED); + + return 0; +} + +#endif + +int _gl_slideshow(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_item *cur_item = NULL; + media_content_type_e type = MEDIA_CONTENT_TYPE_OTHERS; + + if (ad->gridinfo.view_mode == GL_THUMB_VIDEOS) + type = MEDIA_CONTENT_TYPE_VIDEO; + else if (ad->gridinfo.view_mode == GL_THUMB_IMAGES) + type = MEDIA_CONTENT_TYPE_IMAGE; + + bool b_selected = false; + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_THUMBS_EDIT) + b_selected = true; + + _gl_data_get_first_item(ad, type, &cur_item, b_selected); + GL_CHECK_VAL(cur_item, -1); + if (b_selected) + gl_ext_load_iv_ug(ad, cur_item, GL_UG_IV_SLIDESHOW_SELECTED); + else + gl_ext_load_iv_ug(ad, cur_item, GL_UG_IV_SLIDESHOW); + return 0; +} + +Eina_Bool gl_update_view(void *data, int mode) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d", view_mode); + if (mode == GL_UPDATE_VIEW_NONE) { + gl_dbg("Don't need to update"); + return EINA_FALSE; + } + + if (view_mode == GL_VIEW_ALBUMS || + view_mode == GL_VIEW_ALBUMS_EDIT || + view_mode == GL_VIEW_ALBUMS_RENAME) { + /* Albums list should be updated first */ + gl_albums_update_view(ad); + } else if (view_mode == GL_VIEW_TAGS || + view_mode == GL_VIEW_TAGS_EDIT) { + /* Update genlist changed to tab Tags */ + gl_tag_update_view(data); + } else if (view_mode == GL_VIEW_THUMBS) { + /* Albums list should be updated first in tab Albums*/ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + _gl_update_thumb_items(ad, false); + return EINA_TRUE; + } + + gl_cluster *cur_album = ad->albuminfo.current_album; + + /* MMC removed, change to albums view if in mmc album */ + if (mode == GL_UPDATE_VIEW_MMC_REMOVED && cur_album && + cur_album->cluster && + cur_album->cluster->type == GL_STORE_T_MMC) { + gl_dbgW("MMC removed, change to albums view!"); + gl_pop_to_ctrlbar_ly(ad, true); + return EINA_TRUE; + } + + /* Albums list should be updated first */ + _gl_update_thumb_items(ad, true); + } else if (view_mode == GL_VIEW_THUMBS_EDIT) { + /* Check thread operation case */ + if (ad->pbarinfo.sync_pipe) { + gl_dbgW("Thread operation is in process!"); + return EINA_TRUE; + } + + /* Albums list should be updated first in tab Albums*/ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + _gl_update_thumb_items(ad, false); + return EINA_TRUE; + } + + gl_cluster *cur_album = ad->albuminfo.current_album; + /* MMC removed, change to albums view if in mmc album */ + if (mode == GL_UPDATE_VIEW_MMC_REMOVED && cur_album && + cur_album->cluster && + cur_album->cluster->type == GL_STORE_T_MMC) { + gl_dbgW("MMC removed, change to albums view!"); + gl_pop_to_ctrlbar_ly(ad, true); + return EINA_TRUE; + } + + /* Albums list should be updated first */ + _gl_update_thumb_items(ad, true); + return EINA_TRUE; + } else if (view_mode == GL_VIEW_ALBUMS_SELECT) { + gl_albums_update_view(ad); + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + _gl_update_select_thumb_items(ad); + } + return EINA_TRUE; +} + +/** +* Parse medias type and count of selected items, +* and set different type for share items. +*/ +int gl_get_share_mode(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int share_mode = GL_SHARE_NONE; + int image_cnt = 0; + int video_cnt = 0; + int sel_cnt = 0; + int view_m = gl_get_view_mode(ad); + if (view_m == GL_VIEW_ALBUMS_EDIT) { + GL_CHECK_VAL(ad->albuminfo.selected_albums_elist, -1); + gl_cluster *cur_album = NULL; + cur_album = eina_list_nth(ad->albuminfo.selected_albums_elist, 0); + GL_CHECK_VAL(cur_album, -1); + GL_CHECK_VAL(cur_album->cluster, -1); + sel_cnt = ad->selectedinfo.sel_cnt; + } else if (view_m == GL_VIEW_TAGS_EDIT) { + sel_cnt = ad->selectedinfo.sel_cnt; + } else if (view_m == GL_VIEW_ALBUMS) { + sel_cnt = ad->selectedinfo.sel_cnt; + } else { + GL_CHECK_VAL(ad->selectedinfo.medias_elist, -1); + sel_cnt = eina_list_count(ad->selectedinfo.medias_elist); + } + image_cnt = ad->selectedinfo.images_cnt; + if(image_cnt > sel_cnt) { + gl_dbgE("Images count is wrong!"); + return -1; + } + + video_cnt = sel_cnt - image_cnt; + gl_dbg("Selected items count: %d, image count: %d, video count: %d.", + sel_cnt, image_cnt, video_cnt); + + if (ad->selectedinfo.drms_cnt) { + share_mode = GL_SHARE_DRM; + } else if (image_cnt && video_cnt) { + share_mode = GL_SHARE_IMAGE_VIDEO; + } else if (image_cnt) { + if (ad->selectedinfo.jpeg_cnt == sel_cnt) { + if (image_cnt == 1) + share_mode = GL_SHARE_IMAGE_ONE_JPEG; + else + share_mode = GL_SHARE_IMAGE_MULTI_JPEG; + } else { + if (image_cnt == 1) + share_mode = GL_SHARE_IMAGE_ONE; + else + share_mode = GL_SHARE_IMAGE_MULTI; + } + } else if (video_cnt) { + if (video_cnt == 1) { + share_mode = GL_SHARE_VIDEO_ONE; + } else { + share_mode = GL_SHARE_VIDEO_MULTI; + } + } else { + gl_dbgE("Error: no video and image!"); + return -1; + } + gl_dbg("share_mode is %d.", share_mode); + + return share_mode; +} + +int _gl_destroy_ctrl_edit_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->ctrlinfo.ctrlbar_edit_ly) { + evas_object_del(ad->ctrlinfo.ctrlbar_edit_ly); + ad->ctrlinfo.ctrlbar_edit_view = NULL; + ad->ctrlinfo.ctrlbar_edit_ly = NULL; + } + return 0; +} + +int _gl_destroy_thumbs_edit_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->gridinfo.navi_content_edit_ly) { + _gl_thumbs_clear_cbs(ad->gridinfo.navi_content_edit_view); + evas_object_del(ad->gridinfo.navi_content_edit_ly); + ad->gridinfo.navi_content_edit_view = NULL; + ad->gridinfo.navi_content_edit_ly = NULL; + } + return 0; +} + +int gl_destroy_thumbs_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d.", view_mode); + + gl_del_invalid_widgets(ad, GL_INVALID_NONE); + + if(ad->gridinfo.navi_content_edit_view) { + _gl_destroy_thumbs_edit_view(ad); + _gl_data_selected_list_finalize(ad); + } else { + _gl_thumbs_del_append_idler(ad); + } + _gl_notify_destroy_selinfo(ad); + /* destroy imf */ + _gl_editfield_destroy_imf(ad); + + _gl_thumbs_delete_view(ad); + + ad->albuminfo.current_album = NULL; + ad->taginfo.current_tag = NULL; + + /* Pop to controlbar layout */ + elm_naviframe_item_pop_to(ad->ctrlinfo.nf_it); + + if (view_mode == GL_VIEW_THUMBS_SELECT) { + if (ad->gridinfo.select_view) { + _gl_thumbs_clear_cbs(ad->gridinfo.select_view); + ad->gridinfo.select_view = NULL; + } + ad->gridinfo.select_view_ly = NULL; + ad->gridinfo.nf_it_select = NULL; + + ad->albuminfo.select_view = NULL; + ad->albuminfo.select_view_ly = NULL; + ad->albuminfo.nf_it_select = NULL; + } + return 0; +} + +/** +* b_update_albums_list +* True: Update albums list. False: Albums list already updated. +* +* It's in thumbnails view, video list view, or selectioinfo view. +* Destroy invalid widegets or UGs. +* Pop current invalid view to controlbar layout, +*/ +int gl_pop_to_ctrlbar_ly(void *data, bool b_update_albums_list) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("b_update_albums_list: %d", b_update_albums_list); + + /* Destroy thumbnails/video_list view then pop to ctrlbar_ly */ + gl_destroy_thumbs_view(ad); + + /* Update albums list */ + if (b_update_albums_list) + gl_refresh_albums_list(ad); + + if (gl_check_gallery_empty(ad)) { + /* None albums exist, Change to albums view. */ + gl_dbgW("Empty Gallery, change to Albums view."); + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + /* Change to Albums tab. */ + gl_dbg("Not in Albums tab."); + Elm_Object_Item *first_it = NULL; + Evas_Object *ctrlbar = ad->ctrlinfo.ctrlbar; + first_it = elm_toolbar_first_item_get(ctrlbar); + GL_CHECK_VAL(first_it, -1); + elm_toolbar_item_selected_set(first_it, EINA_TRUE); + return 0; + } + gl_albums_comeback_from_view(ad); + /* None albums, disable edit button/controlbar */ + _gl_ctrl_disable_btn(ad, true, GL_NAVI_ALBUMS); + gl_ctrl_disable_ctrlbar(ad, true); + } else if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + /* Change to tags view */ + gl_dbg("Change to Tags view."); + _gl_tag_comeback_from_view(ad); + /* Only favorites tag exists, disable edit button */ + if (_gl_data_get_tag_count_all(ad) <= 1) + _gl_ctrl_disable_btn(ad, true, GL_NAVI_TAGS); + } else { + /* Change to albums view. */ + gl_dbg("Change to Albums view."); + gl_albums_comeback_from_view(ad); + /* None editable albums, disable edit button */ + if (ad->albuminfo.cluster_list->edit_cnt == 0) + _gl_ctrl_disable_btn(ad, true, GL_NAVI_ALBUMS); + } + return 0; +} + +/* Vibrate device */ +int gl_play_vibration(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + haptic_device_h *device_handle = NULL; + haptic_effect_h *effect_handle = NULL; + int ret = -1; + + if (ad->entryinfo.haptic_handle >= 0) { + gl_dbg("Remove previous haptic handle."); + _gl_stop_vibration(ad); + } + device_handle = (haptic_device_h *)malloc(sizeof(haptic_device_h)); + if (device_handle == NULL) { + gl_dbgE("malloc fail"); + return -1; + } + ret = haptic_open(HAPTIC_DEVICE_ALL,device_handle); + if (ret != HAPTIC_ERROR_NONE) { + gl_dbgE("haptic_open failed[%d]!", ret); + GL_FREEIF(device_handle); + return -1; + } + + if (ad->entryinfo.vibration_timer) { + ecore_timer_del(ad->entryinfo.vibration_timer); + ad->entryinfo.vibration_timer = NULL; + } + Ecore_Timer *vibration_timer = NULL; + vibration_timer = ecore_timer_add(GL_TIMER_INTERVAL_VIBRATION, + _gl_vibration_timer_cb, data); + ad->entryinfo.vibration_timer = vibration_timer; + + effect_handle = (haptic_effect_h *)malloc(sizeof(haptic_effect_h)); + if (effect_handle == NULL) { + gl_dbgE("effect_handle malloc fail"); + GL_FREEIF(device_handle); + return -1; + } + ret = haptic_vibrate_monotone(*device_handle, + GL_VIBRATION_DURATION, effect_handle); + if (ret != HAPTIC_ERROR_NONE) { + gl_dbgE("haptic_vibrate_monotone failed[%d]!", ret); + GL_FREEIF(device_handle); + GL_FREEIF(effect_handle); + return -1; + } + + ad->entryinfo.device_handle = device_handle; + ad->entryinfo.effect_handle = effect_handle; + ad->entryinfo.haptic_handle = GL_VIBRATION_DEVICE; + + return 0; +} + +/* Change int to char * of video duration, caller need to free the allocated memory */ +char *_gl_get_duration_string(unsigned int v_dur) +{ + char *dur_str = calloc(1, GL_FILE_PATH_LEN_MAX); + GL_CHECK_NULL(dur_str); + if (v_dur > 0) { + int duration = floor(v_dur / GL_TIME_MSEC_PER_SEC); + int dur_hr = 0; + int dur_min = 0; + int dur_sec = 0; + int tmp = 0; + + if (duration >= GL_TIME_SEC_PER_HOUR) { + dur_sec = duration % GL_TIME_SEC_PER_MIN; + tmp = floor(duration / GL_TIME_SEC_PER_MIN); + dur_min = tmp % GL_TIME_MIN_PER_HOUR; + dur_hr = floor(tmp / GL_TIME_MIN_PER_HOUR); + } else if (duration >= GL_TIME_SEC_PER_MIN) { + dur_hr = 0; + dur_min = floor(duration / GL_TIME_SEC_PER_MIN); + dur_sec = duration % GL_TIME_SEC_PER_MIN; + } else { + dur_hr = 0; + dur_min = 0; + dur_sec = duration % GL_TIME_SEC_PER_MIN; + } + + snprintf(dur_str, GL_FILE_PATH_LEN_MAX, "%02d:%02d:%02d", + dur_hr, dur_min, dur_sec); + } else { + snprintf(dur_str, GL_FILE_PATH_LEN_MAX, "00:00:00"); + } + dur_str[strlen(dur_str)] = '\0'; + return dur_str; +} + +gl_icon_type _gl_get_icon_type(gl_item *git) +{ + if (git == NULL || git->item == NULL || git->item->file_url == NULL) { + gl_dbgE("Invalid item :%p", git); + return GL_ICON_CORRUPTED_FILE; + } + /* Is it DRM file? Has a valid RO? */ + if(gl_drm_is_drm_file(git->item->file_url) && + gl_drm_check_valid_ro(git->item->file_url, gl_drm_get_permtype(git->item->type)) == false) { + return GL_ICON_EXPIRED_DRM; + } + + return GL_ICON_NORMAL; +} + diff --git a/src/widget/gl-button.c b/src/widget/gl-button.c new file mode 100755 index 0000000..cb3457f --- /dev/null +++ b/src/widget/gl-button.c @@ -0,0 +1,94 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-ui-util.h" +#include "gl-button.h" +#include "gl-strings.h" + +#define GL_BTN_POPUP "popup_button/default" + +/******************************************************* +** Prototype : _gl_but_create_but +** Description : Create button +** Input : Evas_Object *parent +** Input : const char *icon +** Input : const char *text +** Input : const char *style +** Input : But_Smart_Cb cb_func +** Input : const void *data +** Output : None +** Return Value : +** Calls : +** Called By : +** +** History : +** 1.Date : 2011/06/10 +** Author : Samsung +** Modification : Created function +** +*********************************************************/ +Evas_Object *_gl_but_create_but(Evas_Object *parent, const char *icon, + const char *text, const char *style, + But_Smart_Cb cb_func, const void *data) +{ + Evas_Object *btn = NULL; + GL_CHECK_NULL(parent); + + btn = elm_button_add(parent); + GL_CHECK_NULL(btn); + elm_object_focus_allow_set(btn, EINA_FALSE); + + if (style) + elm_object_style_set(btn, style); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + + if (icon) { + gl_dbg("Button icon: %s", icon); + Evas_Object *ic = NULL; + ic = elm_icon_add(btn); + GL_CHECK_NULL(ic); + elm_image_file_set(ic, icon, NULL); + elm_image_aspect_fixed_set(ic, EINA_TRUE); + elm_image_fill_outside_set(ic, EINA_TRUE); + evas_object_size_hint_aspect_set(ic, + EVAS_ASPECT_CONTROL_VERTICAL, + 1, 1); + evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, + EVAS_HINT_FILL); + evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); + elm_object_content_set(btn, ic); + } + + if (text) { + gl_dbg("Button text: %s", text); + elm_object_text_set(btn, text); + } + + if (cb_func) + evas_object_smart_callback_add(btn, "clicked", cb_func, data); + + return btn; +} + +Evas_Object *_gl_but_create_but_popup(Evas_Object *parent, const char *text, + But_Smart_Cb cb_func, const void *data) +{ + return _gl_but_create_but(parent, NULL, text, GL_BTN_POPUP, cb_func, data); +} + diff --git a/src/widget/gl-controlbar.c b/src/widget/gl-controlbar.c new file mode 100755 index 0000000..04017ce --- /dev/null +++ b/src/widget/gl-controlbar.c @@ -0,0 +1,723 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-controlbar.h" +#include "gl-albums.h" +#include "gl-thumbs.h" +#include "gl-data.h" +#include "gl-tags.h" +#include "gl-strings.h" +#include "gl-icons.h" +#include "gl-notify.h" +#include "gl-progressbar.h" +#include "gl-ctxpopup.h" + +#define GL_CTRL_STYLE_TABBAR "tabbar" +#define GL_CTRL_STYLE_TABBAR_LAND "tabbar/item_horizontal" + +#define GL_CTRL_SEG_STYLE "gallery/default" +/* (144x3) */ +#define GL_SEGMENT_WIDTH_MIN_INC (396*elm_config_scale_get()) + +static int __gl_ctrl_reset_btn(void *data, int grid_mode) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + bool is_zero = false; + gl_dbg("changed between tool tab(all/image/video)"); + if (grid_mode == GL_THUMB_VIDEOS) + is_zero = _gl_data_is_item_cnt_zero(ad, MEDIA_CONTENT_TYPE_VIDEO); + else if (grid_mode == GL_THUMB_IMAGES) + is_zero = _gl_data_is_item_cnt_zero(ad, MEDIA_CONTENT_TYPE_IMAGE); + + /* none items, disable 'edit' button */ + if (is_zero) { + _gl_ui_disable_btn(ad->gridinfo.edit_btn); + _gl_ui_disable_slideshow(ad, true); + } else { + _gl_ui_enable_btn(ad->gridinfo.edit_btn); + _gl_ui_disable_slideshow(ad, false); + } + return 0; +} + +void _gl_ctrl_segment_change_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->gridinfo.grid_append_idler) { + gl_dbgW("UG invoked or appending gridview!"); + return; + } + + const char *label = NULL; + label = elm_object_item_text_get((Elm_Object_Item *)event_info); + GL_CHECK(label); + gl_dbg("label: %s", label); + _gl_ctxpopup_del(data); + + int old_m = ad->gridinfo.view_mode; + + if (!g_strcmp0(label, GL_STR_ALL)) { + gl_dbg("Creating all-media view"); + ad->gridinfo.view_mode = GL_THUMB_ALL; + } else if (!g_strcmp0(label, GL_STR_IMAGES)) { + gl_dbg("Creating image view"); + ad->gridinfo.view_mode = GL_THUMB_IMAGES; + } else if (!g_strcmp0(label, GL_STR_VIDEOS)) { + gl_dbg("Creating video view"); + ad->gridinfo.view_mode = GL_THUMB_VIDEOS; + } else { + gl_dbgE("Wrong label!"); + return; + } + + if (ad->gridinfo.view_mode == old_m) { + gl_dbgW("Already showed!"); + return; + } + + if (ad->gridinfo.all_grid_view == NULL) + ad->gridinfo.all_grid_view = _gl_thumbs_add_grid(ad, + ad->gridinfo.navi_content_ly, + ad->gridinfo.view_mode, + false); + else + _gl_thumbs_update_view(ad); + + elm_object_part_content_unset(ad->gridinfo.navi_content_ly, + "elm.swallow.view"); + evas_object_show(ad->gridinfo.all_grid_view); + elm_object_part_content_set(ad->gridinfo.navi_content_ly, + "elm.swallow.view", + ad->gridinfo.all_grid_view); + + __gl_ctrl_reset_btn(ad, ad->gridinfo.view_mode); + gl_set_view_mode(ad, GL_VIEW_THUMBS); +} + +/* Pop naviframe item when show albums/tags edit view */ +static int _gl_ctrl_popup_edit_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.nf_it, -1); + + elm_naviframe_item_pop_to(ad->ctrlinfo.nf_it); + ad->ctrlinfo.nf_it_edit = NULL; + return 0; +} + +static int __gl_ctrl_reset_albums(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + + if (view_mode == GL_VIEW_ALBUMS_EDIT) { + /* Destroy data */ + _gl_data_finalize_albums_selected_list(ad); + /* Refresh albums list */ + _gl_data_get_cluster_list(ad); + } + + return 0; +} + +static int __gl_ctrl_reset_tags(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + + /* Destroy data */ + if (view_mode == GL_VIEW_TAGS_EDIT) + _gl_data_finalize_tags_selected_list(ad); + + if (ad->taginfo.tags_view) + gl_tag_unset_rename(ad); + ad->taginfo.current_tag = NULL; + + return 0; +} + +static int __gl_ctrl_reset_previous_tab(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + switch (ad->ctrlinfo.tab_mode) { + case GL_CTRL_TAB_ALBUMS: + __gl_ctrl_reset_albums(ad); + break; + case GL_CTRL_TAB_TAGS: + __gl_ctrl_reset_tags(ad); + break; + default: + gl_dbgE("Wrong tabbar mode!"); + return -1; + } + + /* Delete layout and edit view */ + _gl_destroy_ctrl_edit_view(ad); + /* Delete naviframe item */ + _gl_ctrl_popup_edit_view(ad); + + /* Hide previous view */ + Evas_Object *pre_view = NULL; + pre_view = elm_object_part_content_unset(ad->ctrlinfo.ctrlbar_view_ly, + "contents"); + evas_object_hide(pre_view); + + return 0; +} + +static int __gl_ctrl_remake_btns(void *data, gl_ctrl_tab_mode mode) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Reset some flags */ + ad->albuminfo.b_edit_disable = false; + ad->taginfo.b_edit_disable = false; + + switch (mode) { + case GL_CTRL_TAB_ALBUMS: + gl_dbg("GL_CTRL_TAB_ALBUMS"); + /* add items */ + _gl_ui_add_btns_albums(ad, GL_UI_ALBUMS_REMAKE); + break; + case GL_CTRL_TAB_TAGS: + gl_dbg("GL_CTRL_TAB_TAGS"); + _gl_tags_add_btns(ad); + break; + default: + gl_dbgE("Error mode!"); + return -1; + } + gl_dbg("Done"); + + return 0; +} + +static void _gl_ctrl_view_change_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d, tab_mode: %d", view_mode, ad->ctrlinfo.tab_mode); + Elm_Object_Item *it = elm_toolbar_selected_item_get(obj); + GL_CHECK(it); + const char *selected_label = elm_object_item_text_get(it); + GL_CHECK(selected_label); + gl_dbg("Tab %s selected.", selected_label); + _gl_ctxpopup_del(data); + + if (!g_strcmp0(selected_label, GL_STR_CTRL_ITEM_ALBUMS)) { + gl_dbg("Albums"); + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_ALBUMS) { + gl_dbg("Already in Albums Tab."); + return; + } + __gl_ctrl_reset_previous_tab(ad); + gl_set_view_mode(ad, GL_VIEW_ALBUMS); + + _gl_data_get_cluster_list(ad); + gl_albums_update_items(ad); + + if (ad->albuminfo.albums_nocontents) { + gl_ctrl_disable_ctrlbar(ad, true); + } else { + evas_object_show(ad->albuminfo.albums_view); + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_view_ly, + "contents", + ad->albuminfo.albums_view); + } + + ad->ctrlinfo.tab_mode = GL_CTRL_TAB_ALBUMS; + + __gl_ctrl_remake_btns(ad, GL_CTRL_TAB_ALBUMS); + } else if (!g_strcmp0(selected_label, GL_STR_CTRL_ITEM_TAGS)) { + gl_dbg("Tags"); + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_dbg("Already in Tags Tab."); + return; + } + + __gl_ctrl_reset_previous_tab(ad); + gl_set_view_mode(ad, GL_VIEW_TAGS); + + if (ad->taginfo.tags_view) + gl_tag_update_view(ad); + else + ad->taginfo.tags_view = gl_tag_create_view(ad, + ad->ctrlinfo.ctrlbar_view_ly); + evas_object_show(ad->taginfo.tags_view); + elm_object_part_content_set(ad->ctrlinfo.ctrlbar_view_ly, + "contents", ad->taginfo.tags_view); + + ad->taginfo.current_tag = NULL; + ad->ctrlinfo.tab_mode = GL_CTRL_TAB_TAGS; + + __gl_ctrl_remake_btns(ad, GL_CTRL_TAB_TAGS); + } +} + +static int __gl_ctrl_disable_btn(void *data, int mode) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (mode == GL_NAVI_ALBUMS) { + gl_dbg("GL_NAVI_ALBUMS"); + /* disable 'edit' button */ + ad->albuminfo.b_edit_disable = true; + } else if (mode == GL_NAVI_TAGS) { + gl_dbg("GL_NAVI_TAGS"); + /* disable 'edit' button */ + ad->taginfo.b_edit_disable = true; + }else if (mode == GL_NAVI_THUMBS) { + gl_dbg("GL_NAVI_THUMBS"); + /* disable 'edit' button */ + _gl_ui_disable_btn(ad->gridinfo.edit_btn); + _gl_ui_disable_btn(ad->gridinfo.slideshow_btn); + /* Check title button */ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) + _gl_ui_show_add_btn(ad); + } else { + gl_dbgE("Unkonw mode"); + return -1; + } + return 0; +} + +static int __gl_ctrl_enable_btn(void *data, int mode) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("mode: %d", mode); + + if (mode == GL_NAVI_ALBUMS) { + gl_dbg("GL_NAVI_ALBUMS"); + /* enable 'edit' item */ + if (!gl_check_gallery_empty(ad) && + ad->albuminfo.cluster_list->edit_cnt) { + ad->albuminfo.b_edit_disable = false; + } else { + ad->albuminfo.b_edit_disable = true; + } + } else if (mode == GL_NAVI_THUMBS) { + gl_dbg("GL_NAVI_THUMBS"); + /* enable 'Edit' button */ + _gl_ui_enable_btn(ad->gridinfo.edit_btn); + /* Check more button */ + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + Evas_Object *more_btn = NULL; + more_btn = _gl_ui_get_btn(ad, NULL, GL_NAVIFRAME_MORE); + if (ad->maininfo.medias_cnt) + _gl_ui_enable_btn(more_btn); + else + _gl_ui_disable_btn(more_btn); + /* Check "+" button */ + _gl_ui_show_add_btn(ad); + } + + if (ad->maininfo.medias_cnt) + _gl_ui_disable_slideshow(ad, false); + else + _gl_ui_disable_slideshow(ad, true); + } else if (mode == GL_NAVI_TAGS) { + gl_dbg("GL_NAVI_TAGS"); + /* enable 'edit' button not only favorites tag */ + if (_gl_data_get_tag_count_all(ad) > 1) + ad->taginfo.b_edit_disable = false; + else + ad->taginfo.b_edit_disable = true; + } else { + gl_dbgE("Unkonw mode"); + return -1; + } + + return 0; +} + +/* Enable all buttons except for some special cases */ +static int __gl_ctrl_enable_btns(gl_appdata *ad, Elm_Object_Item *nf_it) +{ + gl_dbg(""); + GL_CHECK_VAL(ad, -1); + GL_CHECK_VAL(nf_it, -1); + bool b_disable_del = false; + bool b_disable_share = false; + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_ALBUMS_EDIT) { + GL_CHECK_VAL(ad->albuminfo.selected_albums_elist, -1); + int sel_cnt = 0; + sel_cnt = _gl_data_get_albums_selected_cnt(ad); + + gl_cluster *album_item = NULL; + int i = 0; + for (i = 0; i < sel_cnt; i++) { + if (b_disable_del && b_disable_share) + break; + album_item = eina_list_nth(ad->albuminfo.selected_albums_elist, + i); + if (album_item == NULL || album_item->cluster == NULL || + album_item->cluster->uuid == NULL) { + gl_dbgE("Invlaid album item!"); + continue; + } + /* All albums couldn't be deleted, so disable Delete item */ + if (album_item->cluster->type == GL_STORE_T_ALL) { + gl_dbg("All albums, disable Delete item."); + b_disable_del = true; + /* Disable share*/ + if (sel_cnt > 1) + b_disable_share = true; + } + album_item = NULL; + } + } + int share_m = gl_get_share_mode(ad); + if ((view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_ALBUMS_EDIT || + view_mode == GL_VIEW_TAGS_EDIT) && share_m == GL_SHARE_DRM) { + gl_dbgW("Selected item is DRM file!"); + b_disable_share = true; + } + + /* more-share-delete */ + _gl_ui_disable_each_btn(nf_it, false, b_disable_share, b_disable_del); + return 0; +} + +Evas_Object * +gl_ctrl_create_ctrlbar_view(Evas_Object * parent) +{ + gl_dbg(""); + GL_CHECK_NULL(parent); + + Evas_Object *layout = NULL; + layout = gl_ui_load_edj(parent, GL_EDJ_FILE, GL_GRP_CONTROLBAR); + GL_CHECK_NULL(layout); + evas_object_show(layout); + + return layout; +} + +Evas_Object *gl_ctrl_create_ctrlbar_ly(Evas_Object *parent) +{ + gl_dbg(""); + gl_dbg_launch(" gl_ctrl_create_ctrlbar_ly:start"); + GL_CHECK_NULL(parent); + Evas_Object *layout = NULL; + layout = gl_ui_load_edj(parent, GL_EDJ_FILE, GL_GRP_CONTROLBAR_LY); + GL_CHECK_NULL(layout); + evas_object_show(layout); + + gl_dbg_launch(" gl_ctrl_create_ctrlbar_ly:end"); + + return layout; +} + +Evas_Object *gl_ctrl_create_ctrlbar(void *data, int mode) +{ + gl_dbg_launch(" gl_ctrl_create_ctrlbar:start"); + gl_dbg("mode: %d", mode); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *cbar = NULL; + Elm_Object_Item *item[GL_CTRL_TAB_CNT]; + + if (ad->ctrlinfo.ctrlbar != NULL) { + gl_dbg("Remove the existed control bar"); + evas_object_del(ad->ctrlinfo.ctrlbar); + ad->ctrlinfo.ctrlbar = NULL; + } + + gl_dbg_launch(" elm_toolbar_add:start"); + cbar = elm_toolbar_add(ad->ctrlinfo.ctrlbar_ly); + gl_dbg_launch(" elm_toolbar_add:end"); + GL_CHECK_NULL(cbar); + gl_dbg("elm_toolbar_add:done"); + elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND); + elm_toolbar_transverse_expanded_set(cbar, EINA_TRUE); + + if (mode != GL_CTRL_TAB_ALBUMS) { + ad->ctrlinfo.tab_mode = -1; + gl_dbgW("Set tab_mode as -1!"); + } + + if (mode == GL_CTRL_TAB_ALBUMS || mode == GL_CTRL_TAB_TAGS) { + int rotate_mode = ad->maininfo.rotate_mode; + ad->ctrlinfo.rotate_mode = rotate_mode; + gl_dbg("Rotate_mode is %d", rotate_mode); + if ((rotate_mode == APP_DEVICE_ORIENTATION_270) || + (rotate_mode == APP_DEVICE_ORIENTATION_90)) { + elm_object_style_set(cbar, GL_CTRL_STYLE_TABBAR_LAND); + } else { + elm_object_style_set(cbar, GL_CTRL_STYLE_TABBAR); + } + + gl_dbg_launch(" elm_toolbar_item_append:start"); + item[GL_CTRL_TAB_ALBUMS] = elm_toolbar_item_append(cbar, + GL_CTRL_ICON_ALBUMS, + GL_STR_CTRL_ITEM_ALBUMS, + _gl_ctrl_view_change_cb, + ad); + item[GL_CTRL_TAB_TAGS] = elm_toolbar_item_append(cbar, + GL_CTRL_ICON_TAGS, + GL_STR_CTRL_ITEM_TAGS, + _gl_ctrl_view_change_cb, + ad); + gl_dbg_launch(" elm_toolbar_item_append:end"); + gl_dbg("elm_toolbar_item_append:done"); + elm_toolbar_select_mode_set(cbar, ELM_OBJECT_SELECT_MODE_ALWAYS); + + if (ad->albuminfo.gallery_launched == true) { + if (gl_check_gallery_empty(ad)) { + /** + * disable control bar when none album exists. + * or file system is unmounted. + */ + gl_dbg("Disable tabbar items"); + int i = 0; + for (i = 0; i < GL_CTRL_TAB_CNT; i++) + elm_object_item_disabled_set(item[i], + EINA_TRUE); + } + + elm_toolbar_item_selected_set(item[mode], EINA_TRUE); + } + } + gl_dbg_launch(" gl_ctrl_create_ctrlbar:end"); + + return cbar; +} + +//disable/enable controlbar tab event. +int +gl_ctrl_disable_tab_event(void *data, bool disabled) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.ctrlbar, -1); + gl_dbgE("TODO: Check me"); + + if (gl_get_view_mode(ad) == GL_VIEW_ALBUMS) + { + /*if (disabled) + { + evas_object_smart_callback_del(ad->ctrlinfo.ctrlbar, + "view,change,before", + _gl_ctrl_view_change_cb); + } + else + { + evas_object_smart_callback_add(ad->ctrlinfo.ctrlbar, + "view,change,before", + _gl_ctrl_view_change_cb, ad); + }*/ + } + + return 0; +} + +/* Select new tab, view changed callback would be invoked */ +int _gl_ctrl_sel_tabbar_item(void *data, const char *aul_type) +{ + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(aul_type, -1); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *cbar_it = NULL; + cbar_it = elm_toolbar_first_item_get(ad->ctrlinfo.ctrlbar); + const char *text = NULL; + int len = strlen(aul_type); + bool b_found = false; + const char *tab_i18n_text = NULL; + gl_dbg("AUL type: %s", aul_type); + + if (strncasecmp(aul_type, GL_AUL_ALBUM, len) == 0) + tab_i18n_text = GL_STR_CTRL_ITEM_ALBUMS; + else if (strncasecmp(aul_type, GL_AUL_TAG, len) == 0) + tab_i18n_text = GL_STR_CTRL_ITEM_TAGS; + else + gl_dbgE("Wrong type!"); + GL_CHECK_VAL(tab_i18n_text, -1); + + /* Get item to be selected */ + while (cbar_it) { + text = elm_object_item_text_get(cbar_it); + if (!strncasecmp(text, tab_i18n_text, len)) { + b_found = true; + break; + } + + cbar_it = elm_toolbar_item_next_get(cbar_it); + } + + if (b_found && cbar_it) { + elm_toolbar_item_selected_set(cbar_it, EINA_TRUE); + return 0; + } else { + gl_dbgE("Failed to get tabbar item!"); + return -1; + } +} + +int _gl_ctrl_show_tabbar(void *data, bool b_show) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.ctrlbar_ly, -1); + GL_CHECK_VAL(ad->ctrlinfo.ctrlbar_view_ly, -1); + int rotate_mode = ad->maininfo.rotate_mode; + gl_dbg("Tabbar show: %d, rotate_mode: %d", b_show, rotate_mode); + Evas_Object *view_ly = ad->ctrlinfo.ctrlbar_view_ly; + + if (gl_get_view_mode(ad) == GL_VIEW_ALBUMS_RENAME || + gl_get_view_mode(ad) == GL_VIEW_ALBUMS_EDIT) { + gl_dbg("Rename album, set edit layout"); + view_ly = ad->ctrlinfo.ctrlbar_edit_ly; + } + + if (b_show) { + if ((rotate_mode == APP_DEVICE_ORIENTATION_270) || + (rotate_mode == APP_DEVICE_ORIENTATION_90)) { + edje_object_signal_emit(_EDJ(view_ly), + GL_SIGNAL_VIEW_TABBAR_BG_HIDE, + "elm"); + edje_object_signal_emit(_EDJ(ad->ctrlinfo.ctrlbar_ly), + GL_SIGNAL_VIEW_TABBAR_LAND, + "elm"); + } else { + edje_object_signal_emit(_EDJ(view_ly), + GL_SIGNAL_VIEW_TABBAR_BG_HIDE, + "elm"); + edje_object_signal_emit(_EDJ(ad->ctrlinfo.ctrlbar_ly), + GL_SIGNAL_VIEW_TABBAR_DEFAULT, + "elm"); + } + } else { + if ((rotate_mode == APP_DEVICE_ORIENTATION_270) || + (rotate_mode == APP_DEVICE_ORIENTATION_90)) { + edje_object_signal_emit(_EDJ(view_ly), + GL_SIGNAL_VIEW_TABBAR_BG_SHOW_LAND, + "elm"); + edje_object_signal_emit(_EDJ(ad->ctrlinfo.ctrlbar_ly), + "elm,tabbar,state,hide", "elm"); + } else { + edje_object_signal_emit(_EDJ(view_ly), + GL_SIGNAL_VIEW_TABBAR_BG_SHOW_PORT, + "elm"); + edje_object_signal_emit(_EDJ(ad->ctrlinfo.ctrlbar_ly), + "elm,tabbar,state,hide", "elm"); + } + } + return 0; +} + +bool gl_ctrl_rotate_ctrlbar(void *data, int mode) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + int view_mode = 0; + + /* Rotate top tabbar */ + if (mode) + view_mode = mode; + else + view_mode = gl_get_view_mode(ad); + gl_dbg("view mode: %d.", view_mode); + + bool b_show_tabbar = true; + + if (view_mode == GL_VIEW_ALBUMS || view_mode == GL_VIEW_ALBUMS_EDIT || + view_mode == GL_VIEW_TAGS || view_mode == GL_VIEW_TAGS_EDIT) { + int rotate_mode = ad->maininfo.rotate_mode; + if (view_mode == GL_VIEW_TAGS && + (ad->entryinfo.entry_mode == GL_ENTRY_NEW_TAG || + ad->entryinfo.entry_mode == GL_ENTRY_RENAME_TAG)) { + /* New tag view, return */ + gl_dbg("Add an empty tag."); + return 0; + } + char *cbar_style = GL_CTRL_STYLE_TABBAR; + if (rotate_mode == APP_DEVICE_ORIENTATION_270 || + rotate_mode == APP_DEVICE_ORIENTATION_90) { + gl_dbg("Landscape, small mode."); + /* set horizontal style: icon+text */ + cbar_style = GL_CTRL_STYLE_TABBAR_LAND; + } + elm_object_style_set(ad->ctrlinfo.ctrlbar, cbar_style); + + if (b_show_tabbar) + _gl_ctrl_show_tabbar(ad, b_show_tabbar); + } + + return true; +} + +//disable/enable controlbar items. +int gl_ctrl_disable_ctrlbar(void *data, bool disabled) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->ctrlinfo.ctrlbar, -1); + gl_dbg("Controlbar items disabled: %d.", disabled); + + if (disabled) + elm_toolbar_select_mode_set(ad->ctrlinfo.ctrlbar, + ELM_OBJECT_SELECT_MODE_NONE); + else + elm_toolbar_select_mode_set(ad->ctrlinfo.ctrlbar, + ELM_OBJECT_SELECT_MODE_ALWAYS); + return 0; +} + +int _gl_ctrl_disable_btn(void *data, bool disabled, int mode) +{ + GL_CHECK_VAL(data, -1); + gl_dbg("Title button disabled: %d.", disabled); + if (disabled) + __gl_ctrl_disable_btn(data, mode); + else + __gl_ctrl_enable_btn(data, mode); + + return 0; +} + +int _gl_ctrl_disable_btns(void *data, Elm_Object_Item *nf_it, bool b_disable) +{ + gl_dbg("b_disable: %d", b_disable); + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(nf_it, -1); + + if (!b_disable) + __gl_ctrl_enable_btns(data, nf_it); + else + _gl_ui_disable_btns(nf_it, true); + return 0; +} + diff --git a/src/widget/gl-ctxpopup.c b/src/widget/gl-ctxpopup.c new file mode 100755 index 0000000..41f7115 --- /dev/null +++ b/src/widget/gl-ctxpopup.c @@ -0,0 +1,401 @@ +/* + * Copyright (c) 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 "gallery.h" +#include "gl-ctxpopup.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-debug.h" +#include "gl-strings.h" +#include "gl-button.h" +#include "gl-controlbar.h" +#include "gl-thumbs.h" +#include "gl-tags-edit.h" +#include "gl-tags-new.h" +#include "gl-albums-new.h" +#include "gl-albums-edit.h" + +#define GL_CTXPOPUP_OBJ_DATA_KEY "gl_ctxpopup_data_key" + +static void __gl_ctxpopup_hide_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + + evas_object_del(obj); + ad->maininfo.ctxpopup = NULL; + gl_dbg(""); +} + +static int __gl_ctxpopup_show(void *data, Evas_Object *btn, Evas_Object *ctxpopup) +{ + GL_CHECK_VAL(ctxpopup, -1); + GL_CHECK_VAL(btn, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int x_position = 0; + int y_position = 0; + int w = 0; + int h = 0; + + elm_ctxpopup_direction_priority_set(ctxpopup, ELM_CTXPOPUP_DIRECTION_UP, + ELM_CTXPOPUP_DIRECTION_LEFT, + ELM_CTXPOPUP_DIRECTION_RIGHT, + ELM_CTXPOPUP_DIRECTION_DOWN); + + evas_object_geometry_get(btn, &x_position, &y_position, &w, &h); + if (g_strcmp0(elm_object_style_get(btn), GL_BUTTON_STYLE_NAVI_MORE) == 0) { + evas_object_move(ctxpopup, x_position+w/3, y_position + h/2); + } else { + if (ad->maininfo.rotate_mode == APP_DEVICE_ORIENTATION_90 || + ad->maininfo.rotate_mode == APP_DEVICE_ORIENTATION_270) + evas_object_move(ctxpopup, x_position+w*3/4, + y_position + h/2); + else + evas_object_move(ctxpopup, x_position+w/2, + y_position + h/2); + } + gl_dbg("(%d, %d) - (%d, %d)", x_position, y_position, w, h); + + evas_object_show(ctxpopup); + ad->maininfo.ctxpopup = ctxpopup; + evas_object_smart_callback_add(ctxpopup, "dismissed", + __gl_ctxpopup_hide_cb, data); + return 0; +} + +static void __gl_ctxpopup_share_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(event_info); + GL_CHECK(data); + const char *label = NULL; + + label = elm_object_item_text_get((Elm_Object_Item *)event_info); + GL_CHECK(label); + gl_dbg("label: %s", label); + _gl_ctxpopup_del(data); + + int view_mode = gl_get_view_mode(data); + if (view_mode == GL_VIEW_ALBUMS_EDIT) + _gl_albums_edit_share(data, label); + else if (view_mode == GL_VIEW_TAGS_EDIT) + _gl_tags_edit_share(data, label); + else + gl_share_select_item(data, label); +} + +static void __gl_ctxpopup_move_cb(void *data, Evas_Object *obj, + void *event_info) +{ + gl_dbg(""); + /* Get 'ad' via 'GL_CTXPOPUP_OBJ_DATA_KEY' */ + GL_CHECK(obj); + gl_appdata *ad = NULL; + ad = (gl_appdata *)evas_object_data_get(obj, GL_CTXPOPUP_OBJ_DATA_KEY); + GL_CHECK(ad); + _gl_ctxpopup_del(ad); + + GL_FREEIF(ad->albuminfo.path); + /** + * 'data == NULL' is new album case, + * other move/save to some existed album. + */ + if (data) { + ad->albuminfo.path = strdup((char *)data); + gl_dbg("Dest album path: %s", ad->albuminfo.path); + gl_move_to_album(ad); + } else { + _gl_albums_new_create_view(ad); + } +} + +static void __gl_ctxpopup_addtag_cb(void *data, Evas_Object *obj, + void *event_info) +{ + /* Get 'ad' via 'GL_CTXPOPUP_OBJ_DATA_KEY' */ + GL_CHECK(obj); + gl_appdata *ad = NULL; + ad = (gl_appdata *)evas_object_data_get(obj, GL_CTXPOPUP_OBJ_DATA_KEY); + GL_CHECK(ad); + _gl_ctxpopup_del(ad); + + /** + * 'data == NULL' is new tag case, other add to exist tag + */ + if (data) + gl_add_tag(ad, data); + else + _gl_tags_new_create_view(ad); +} + +static int __gl_ctxpopup_create_move(void *data, Evas_Object *btn, + Evas_Smart_Cb it_cb) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + int i = 0; + Eina_List *album_list = NULL; + int all_count = 0; + const char *label = NULL; + gl_cluster *album_item = NULL; + gl_cluster *current_album = ad->albuminfo.current_album; + + Evas_Object *ctxpopup = elm_ctxpopup_add(ad->maininfo.naviframe); + GL_CHECK_VAL(ctxpopup, -1); + + evas_object_data_set(ctxpopup, GL_CTXPOPUP_OBJ_DATA_KEY, data); + + elm_ctxpopup_item_append(ctxpopup, GL_STR_CREATE_ALBUM, NULL, it_cb, + NULL); + + if (ad->albuminfo.cluster_list && ad->albuminfo.cluster_list->clist) { + album_list = ad->albuminfo.cluster_list->clist; + all_count = eina_list_count(album_list); + } else { + gl_dbgE("cluster list is NULL"); + return -1; + } + + for (i = 0; i < all_count; i++) { + album_item = eina_list_nth(album_list, i); + GL_CHECK_VAL(album_item, -1); + GL_CHECK_VAL(album_item->cluster, -1); + GL_CHECK_VAL(album_item->cluster->display_name, -1); + + /* places view->grid view, current album doesn't exist. */ + GL_CHECK_VAL(album_item->cluster->uuid, -1); + if ((current_album && current_album->cluster && + album_item->cluster->uuid && + g_strcmp0(album_item->cluster->uuid, current_album->cluster->uuid)) && + (album_item->cluster->type == GL_STORE_T_MMC || + album_item->cluster->type == GL_STORE_T_PHONE)) { + if (_gl_data_is_root_path(album_item->cluster->path)) { + /* "root" case, set display name as "No Name" */ + label = GL_ALBUM_PHOME_ROOT_NAME; + } else if (strlen(album_item->cluster->display_name)) { + label = _gl_get_i18n_album_name(album_item); + } else { + gl_dbgE("Album name is wrong!"); + label = GL_ALBUM_PHOME_ROOT_NAME; + } + elm_ctxpopup_item_append(ctxpopup, label, NULL, it_cb, + album_item->cluster->path); + } + } + + Evas_Object *_btn = btn; + if (_btn == NULL) + _btn = _gl_ui_get_btn(data, NULL, GL_NAVIFRAME_MORE); + return __gl_ctxpopup_show(data, _btn, ctxpopup); +} + +int _gl_ctxpopup_create(void *data, Evas_Object *but, ctx_append_cb append_cb) +{ + gl_dbg(""); + GL_CHECK_VAL(append_cb, -1); + GL_CHECK_VAL(but, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + + Evas_Object *ctxpopup = elm_ctxpopup_add(ad->maininfo.naviframe); + GL_CHECK_VAL(ctxpopup, -1); + + /* Append items */ + append_cb(data, ctxpopup); + + return __gl_ctxpopup_show(data, but, ctxpopup); +} + +int _gl_ctxpopup_del(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + if (ad->maininfo.ctxpopup) { + evas_object_data_del(ad->maininfo.ctxpopup, + GL_CTXPOPUP_OBJ_DATA_KEY); + /* Remove callback frist */ + evas_object_smart_callback_del(ad->maininfo.ctxpopup, + "dismissed", + __gl_ctxpopup_hide_cb); + evas_object_del(ad->maininfo.ctxpopup); + ad->maininfo.ctxpopup = NULL; + gl_dbg("Ctxpopup removed"); + } + return 0; +} + +int _gl_ctxpopup_create_albums(void *data, Evas_Object *but) +{ + gl_dbg(""); + GL_CHECK_VAL(but, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + + Evas_Object *ctxpopup = elm_ctxpopup_add(ad->maininfo.naviframe); + GL_CHECK_VAL(ctxpopup, -1); + + /* Show edit item */ + if (!ad->albuminfo.b_edit_disable) + elm_ctxpopup_item_append(ctxpopup, GL_STR_EDIT, NULL, + _gl_ui_edit_cb, data); + return __gl_ctxpopup_show(data, but, ctxpopup); +} + +int _gl_ctxpopup_create_thumbs(void *data, Evas_Object *but) +{ + gl_dbg(""); + GL_CHECK_VAL(but, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + + Evas_Object *ctxpopup = elm_ctxpopup_add(ad->maininfo.naviframe); + GL_CHECK_VAL(ctxpopup, -1); + + /* Add All/Images/Videos of local album and tag */ + elm_ctxpopup_item_append(ctxpopup, GL_STR_ALL, NULL, + _gl_ctrl_segment_change_cb, data); + elm_ctxpopup_item_append(ctxpopup, GL_STR_IMAGES, NULL, + _gl_ctrl_segment_change_cb, data); + elm_ctxpopup_item_append(ctxpopup, GL_STR_VIDEOS, NULL, + _gl_ctrl_segment_change_cb, data); + + return __gl_ctxpopup_show(data, but, ctxpopup); +} + +int _gl_ctxpopup_create_share(void *data, Evas_Object *but) +{ + gl_dbg(""); + GL_CHECK_VAL(but, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + const char *lb = NULL; + int i = 0; + + gl_popup_share_tbl popup_share_tbl[GL_POPUP_SHARE_NUM] = { + {GL_POPUP_SHARE_MESSAGE, GL_SHARE_MESSAGE}, + {GL_POPUP_SHARE_EMAIL, GL_SHARE_EMAIL}, + {GL_POPUP_SHARE_BT, GL_SHARE_BLUETOOTH}, + }; + + /** + * If there is any DRM file selected, + * Share option is unavailable. + */ + int share_mode = gl_get_share_mode(ad); + if (share_mode < 0 || share_mode == GL_SHARE_NONE || + share_mode == GL_SHARE_DRM) { + gl_dbgE("Share mode is wrong!"); + return -1; + } + + Evas_Object *ctxpopup = elm_ctxpopup_add(ad->maininfo.naviframe); + GL_CHECK_VAL(ctxpopup, -1); + + int view_mode = gl_get_view_mode(ad); + /* Share albums */ + if (view_mode == GL_VIEW_ALBUMS_EDIT || + view_mode == GL_VIEW_TAGS_EDIT) { + for (i = 0; i < GL_POPUP_SHARE_NUM; i++) { + lb = popup_share_tbl[i].label; + if (g_strcmp0(lb, GL_SHARE_MESSAGE) && + g_strcmp0(lb, GL_SHARE_EMAIL) && + g_strcmp0(lb, GL_SHARE_BLUETOOTH)) + continue; + + elm_ctxpopup_item_append(ctxpopup, (void *)lb, NULL, + __gl_ctxpopup_share_cb, data); + } + return __gl_ctxpopup_show(data, but, ctxpopup); + } + + for (i = 0; i < GL_POPUP_SHARE_NUM; i++) { + lb = popup_share_tbl[i].label; + if (lb == NULL || strlen(lb) == 0) + continue; + elm_ctxpopup_item_append(ctxpopup, (void *)lb, NULL, + __gl_ctxpopup_share_cb, data); + } + return __gl_ctxpopup_show(data, but, ctxpopup); +} + +int _gl_ctxpopup_create_move(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + return __gl_ctxpopup_create_move(data, NULL, __gl_ctxpopup_move_cb); +} + +int _gl_ctxpopup_create_addtag(void *data) +{ + gl_dbg(""); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Eina_List *tags_elist = NULL; + + Evas_Object *ctxpopup = elm_ctxpopup_add(ad->maininfo.naviframe); + GL_CHECK_VAL(ctxpopup, -1); + + evas_object_data_set(ctxpopup, GL_CTXPOPUP_OBJ_DATA_KEY, data); + + /* normal case, get tags list from media-svc. */ + if (ad->ctrlinfo.tab_mode != GL_CTRL_TAB_TAGS) + _gl_data_get_tag_list(ad, &tags_elist); + /* tags view case, just return tags list already got. */ + else + tags_elist = ad->taginfo.tags_elist; + + /* "New tag" item */ + elm_ctxpopup_item_append(ctxpopup, GL_STR_CREATE_TAG, NULL, + __gl_ctxpopup_addtag_cb, NULL); + + if (tags_elist) { + Eina_List *tmp_elist = NULL; + gl_tag *gtag = NULL; + gl_tag *cur_tag = ad->taginfo.current_tag; + EINA_LIST_FOREACH(tags_elist, tmp_elist, gtag) { + GL_CHECK_VAL(gtag, -1); + GL_CHECK_VAL(gtag->tag, -1); + + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS && + cur_tag && cur_tag->tag && + (cur_tag->tag->_id == gtag->tag->_id)) { + gl_dbg("Skipping current tag"); + /*skip current tag in tags view case */ + continue; + } else { + /* normal tag item. */ + elm_ctxpopup_item_append(ctxpopup, + gtag->tag->tag_name, + NULL, + __gl_ctxpopup_addtag_cb, + gtag); + } + } + } + + Evas_Object *btn= _gl_ui_get_btn(data, NULL, GL_NAVIFRAME_MORE); + return __gl_ctxpopup_show(data, btn, ctxpopup); +} + diff --git a/src/widget/gl-editfield.c b/src/widget/gl-editfield.c new file mode 100755 index 0000000..34bce73 --- /dev/null +++ b/src/widget/gl-editfield.c @@ -0,0 +1,502 @@ +/* + * Copyright (c) 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 "gl-editfield.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-popup.h" +#include "gl-tags.h" +#include "gl-tags-new.h" +#include "gl-tags-rename.h" +#include "gl-albums-new.h" +#include "gl-albums-rename.h" +#include "gl-data.h" +#include "gl-strings.h" +#include "gl-debug.h" + +/* The maximun length reached callback */ +static void __gl_editfield_maxlen_reached_cb(void *data, Evas_Object *obj, + void *event_info) +{ + gl_dbg("Entry maximum length reached, vibrate device."); + GL_CHECK(data); + /* Vibrate device if maximum length reached */ + gl_play_vibration(data); +} + +static void __gl_editfield_focused_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + if (!elm_entry_is_empty(obj)) { + gl_dbg("Show eraser."); + elm_object_signal_emit(data, "elm,state,eraser,show", "elm"); + } +} + +static void __gl_editfield_unfocused_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_dbg("Hide eraser."); + elm_object_signal_emit(data, "elm,state,eraser,hide", "elm"); +} + +static void __gl_editfield_eraser_clicked_cb(void *data, Evas_Object *obj, + const char *emission, + const char *source) +{ + GL_CHECK(data); + gl_dbg("Clear emtry after eraser clicked."); + elm_entry_entry_set(data, ""); +} + +static void __gl_editfield_bg_clicked_cb(void *data, Evas_Object *obj, + const char *emission, + const char *source) +{ + GL_CHECK(data); + gl_dbg(""); + elm_object_focus_set(data, EINA_TRUE); +} + +/* +* Callback registered to signal 'changed' of entry. +* It would get the entry string and check whether it's different +* with original string or not, if so, enable 'Done' button, other disable it. +*/ +static void __gl_editfield_space_check_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK(ad->entryinfo.editfield); + + /* Show/hide eraser */ + if (elm_object_focus_get(ad->entryinfo.editfield)) { + if (elm_entry_is_empty(obj)) { + gl_dbg("Hide eraser."); + elm_object_signal_emit(ad->entryinfo.editfield, + "elm,state,eraser,hide", "elm"); + } else { + gl_dbg("Show eraser."); + elm_object_signal_emit(ad->entryinfo.editfield, + "elm,state,eraser,show", "elm"); + } + } + + int view_mode = gl_get_view_mode(ad); + /* There is not done item in tags view */ + if ((view_mode == GL_VIEW_TAGS && + ad->entryinfo.entry_mode != GL_ENTRY_NEW_TAG) || + view_mode == GL_VIEW_TAGS_EDIT) + return; + + GL_CHECK(ad->entryinfo.done_btn); + const char *entry_str = NULL; + + /* Get entry string. */ + entry_str = elm_entry_entry_get(obj); + GL_CHECK(entry_str); + /** + * Changes entry string to utf-8 encoding format, + * other some special characters cannot be showed correctly. + */ + char *entry_utf8 = elm_entry_markup_to_utf8(entry_str); + GL_CHECK(entry_utf8); + /** + * Removes leading and trailing whitespace + * to avoid showing popup when new name is only composed by space + * or avoid showing popup in the case when after trip leading and trailing space, + * new name is same as existing name + */ + g_strstrip((gchar*)entry_utf8); + GL_CHECK(entry_utf8); + gl_dbg("New entry string without space: [%s]", entry_utf8); + + bool b_disabled = false; + /** + * If entry string is empty, disable 'Done' button, + * including create album/tag and rename album/tag. + */ + if (!strlen(entry_utf8)) { + gl_dbg("Entry string is empty!"); + b_disabled = true; + } + + gl_dbg("En/Disable Done button[%d]", b_disabled); + elm_object_disabled_set(ad->entryinfo.done_btn, b_disabled); + + /* Free string got from elm_entry_markup_to_utf8() */ + GL_FREEIF(entry_utf8); +} + + +/* +* make a new tag +*/ +static void __gl_editfield_new_tag_enter_cb(void *data, Evas_Object *obj, + void *event_info) +{ + gl_dbg(""); + GL_CHECK(data); + /* Unfocus to hide cursor */ + _gl_editfield_hide_imf(data); + _gl_tags_new_process(data, true); +} + +/* +* change tag name +*/ +static void __gl_editfield_rename_tag_enter_cb(void *data, Evas_Object *obj, + void *event_info) +{ + gl_dbg(""); + GL_CHECK(data); + /* Unfocus to hide cursor */ + _gl_editfield_hide_imf(data); + _gl_tags_rename_process(data); + + /* Show selectioninfo if needed */ + if (_gl_data_get_tags_selected_cnt(data) > 0) { + gl_appdata *ad = (gl_appdata *)data; + edje_object_signal_emit(_EDJ(ad->ctrlinfo.ctrlbar_edit_ly), + GL_SIGNAL_VIEW_MOVEUP, "elm"); + } +} + +/* +* make a new album +*/ +static void __gl_editfield_new_album_enter_cb(void *data, Evas_Object *obj, + void *event_info) +{ + gl_dbg(""); + GL_CHECK(data); + /* Unfocus to hide cursor */ + _gl_editfield_hide_imf(data); + _gl_albums_new_process(data, true); +} + +/* +* change album album +*/ +static void __gl_editfield_rename_album_enter_cb(void *data, Evas_Object * obj, + void *event_info) +{ + gl_dbg(""); + GL_CHECK(data); + /* Unfocus to hide cursor */ + _gl_editfield_hide_imf(data); + _gl_albums_rename_process(data, true); +} + +static int __gl_editfield_set_entry(void *data, Evas_Object *layout, + Evas_Object *entry, char *default_label) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + static Elm_Entry_Filter_Limit_Size limit_filter_data; + + switch (ad->entryinfo.entry_mode) { + case GL_ENTRY_NEW_ALBUM: + /* New album, Album name, the length is limited to 255 Chars*/ + limit_filter_data.max_char_count = GL_ENTRY_STR_CHAR_MAX; + limit_filter_data.max_byte_count = 0; + evas_object_smart_callback_add(entry, "activated", + __gl_editfield_new_album_enter_cb, + ad); + break; + case GL_ENTRY_RENAME_ALBUM: + /* Rename album, Album name, the length is limited to 255 Chars*/ + limit_filter_data.max_char_count = GL_ENTRY_STR_CHAR_MAX; + limit_filter_data.max_byte_count = 0; + evas_object_smart_callback_add(entry, "activated", + __gl_editfield_rename_album_enter_cb, + ad); + break; + case GL_ENTRY_NEW_TAG: + case GL_ENTRY_RENAME_TAG: + /* New tag, Tag name, the length is limited to 255 Bytes */ + limit_filter_data.max_char_count = 0; + limit_filter_data.max_byte_count = GL_ENTRY_STR_LEN_MAX; + if (ad->entryinfo.entry_mode == GL_ENTRY_NEW_TAG) + evas_object_smart_callback_add(entry, "activated", + __gl_editfield_new_tag_enter_cb, + ad); + else + evas_object_smart_callback_add(entry, "activated", + __gl_editfield_rename_tag_enter_cb, + ad); + break; + default: + gl_dbgW("Wrong entry mode!"); + return -1; + } + + elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, + &limit_filter_data); + + if (gl_set_entry_text(entry, default_label) != 0) { + gl_dbgE("gl_set_entry_text failed!"); + return -1; + } + elm_entry_cursor_end_set(entry); + + gl_dbg("view mode=%d", gl_get_view_mode(ad)); + evas_object_smart_callback_add(entry, "maxlength,reached", + __gl_editfield_maxlen_reached_cb, ad); + + /* Add space check callback */ + evas_object_smart_callback_add(entry, "changed", + __gl_editfield_space_check_cb, ad); + evas_object_smart_callback_add(entry, "preedit,changed", + __gl_editfield_space_check_cb, ad); + evas_object_smart_callback_add(entry, "focused", + __gl_editfield_focused_cb, layout); + evas_object_smart_callback_add(entry, "unfocused", + __gl_editfield_unfocused_cb, layout); + elm_object_signal_callback_add(layout, "elm,eraser,clicked", "elm", + __gl_editfield_eraser_clicked_cb, entry); + elm_object_signal_callback_add(layout, "elm,bg,clicked", "elm", + __gl_editfield_bg_clicked_cb, entry); + return 0; +} + +Evas_Object *_gl_editfield_create(void *data, Evas_Object *parent, + char *default_label) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_NULL(parent); + Evas_Object *layout = NULL; + Evas_Object *entry_layout = NULL; + Evas_Object *entry = NULL; + + layout = elm_layout_add(parent); + GL_CHECK_NULL(layout); + elm_layout_theme_set(layout, "layout", "application", "searchbar_base"); + elm_object_signal_emit(layout, "elm,state,show,searchbar", "elm"); + + entry_layout = elm_layout_add(layout); + if (entry_layout == NULL) { + evas_object_del(layout); + return NULL; + } + /* Customized theme */ + elm_layout_theme_set(entry_layout, "layout", "searchbar", "gallery"); + elm_object_part_content_set(layout, "searchbar", entry_layout); + + entry = elm_entry_add(entry_layout); + if (entry == NULL) { + evas_object_del(entry_layout); + return NULL; + } + + elm_entry_scrollable_set(entry, EINA_TRUE); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT); + elm_object_part_content_set(entry_layout, "elm.swallow.content", entry); + elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NORMAL); + evas_object_size_hint_weight_set(entry_layout, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(entry_layout, EVAS_HINT_FILL, + EVAS_HINT_FILL); + ad->entryinfo.imf_entry = entry; + ad->entryinfo.imf_context = elm_entry_imf_context_get(ad->entryinfo.imf_entry); + ad->entryinfo.haptic_handle = -1; + ad->entryinfo.editfield = entry_layout; + /* Set callback */ + __gl_editfield_set_entry(ad, entry_layout, entry, default_label); + evas_object_show(entry_layout); + + return layout; +} + +/* Add editfield to genlist item */ +Evas_Object *_gl_editfield_create_genlist(void *data, Evas_Object *parent, + char *label) +{ + GL_CHECK_NULL(label); + GL_CHECK_NULL(parent); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + Evas_Object *editfield_ly = NULL; + Evas_Object *entry = NULL; + + _gl_editfield_destroy_imf(ad); + + editfield_ly = elm_layout_add(parent); + GL_CHECK_NULL(editfield_ly); + elm_layout_theme_set(editfield_ly, "layout", "editfield", "default"); + evas_object_size_hint_weight_set(editfield_ly, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(editfield_ly, EVAS_HINT_FILL, + EVAS_HINT_FILL); + + entry = elm_entry_add(editfield_ly); + if (entry == NULL) { + gl_dbgE("elm_entry_add failed!"); + evas_object_del(editfield_ly); + return NULL; + } + elm_entry_scrollable_set(entry, EINA_TRUE); + elm_entry_single_line_set(entry, EINA_TRUE); + elm_entry_cnp_mode_set(entry, ELM_CNP_MODE_PLAINTEXT); + /* Set entry to editfield layout */ + elm_object_part_content_set(editfield_ly, "elm.swallow.content", entry); + + if (gl_set_entry_text(entry, label) != 0) { + gl_dbgE("gl_set_entry_text failed!"); + evas_object_del(editfield_ly); + return NULL; + } + + static Elm_Entry_Filter_Limit_Size limit_filter_data; + limit_filter_data.max_char_count = 0; + /* Tag name, the length is limited to 255 Bytes */ + limit_filter_data.max_byte_count = GL_ENTRY_STR_LEN_MAX; + elm_entry_markup_filter_append(entry, elm_entry_filter_limit_size, + &limit_filter_data); + evas_object_smart_callback_add(entry, "maxlength,reached", + __gl_editfield_maxlen_reached_cb, ad); + evas_object_smart_callback_add(entry, "activated", + __gl_editfield_rename_tag_enter_cb, ad); + /* Add space check callback */ + evas_object_smart_callback_add(entry, "changed", + __gl_editfield_space_check_cb, ad); + evas_object_smart_callback_add(entry, "preedit,changed", + __gl_editfield_space_check_cb, ad); + evas_object_smart_callback_add(entry, "focused", + __gl_editfield_focused_cb, editfield_ly); + evas_object_smart_callback_add(entry, "unfocused", + __gl_editfield_unfocused_cb, + editfield_ly); + elm_object_signal_callback_add(editfield_ly, "elm,eraser,clicked", "elm", + __gl_editfield_eraser_clicked_cb, entry); + + /** + * Do not unset rename mode on unfocused event + *otherwise clipboard does not work properly + */ + ad->entryinfo.imf_entry = entry; + ad->entryinfo.imf_context = elm_entry_imf_context_get(entry); + ad->entryinfo.editfield = editfield_ly; + ad->entryinfo.haptic_handle = -1; + + _gl_editfield_show_imf(data); + elm_entry_cursor_end_set(entry); + + /* Hide selectioninfo if needed */ + edje_object_signal_emit(_EDJ(ad->ctrlinfo.ctrlbar_edit_ly), + GL_SIGNAL_VIEW_EDIT, "elm"); + + return editfield_ly; +} + +/* Hide input panel and entry cursor */ +int _gl_editfield_hide_imf(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata* ad = (gl_appdata*)data; + gl_dbg(""); + + if (ad->entryinfo.imf_context) + ecore_imf_context_input_panel_hide(ad->entryinfo.imf_context); + /* Unfocus to hide cursor */ + if (ad->entryinfo.imf_entry) + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_FALSE); + + return 0; +} + +/* Show input panel and entry cursor */ +int _gl_editfield_show_imf(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata* ad = (gl_appdata*)data; + gl_dbg(""); + + if (ad->entryinfo.imf_entry) { + evas_object_show(ad->entryinfo.imf_entry); + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_TRUE); + } + if (ad->entryinfo.imf_context) + ecore_imf_context_input_panel_show(ad->entryinfo.imf_context); + return 0; +} + +int _gl_editfield_destroy_imf(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + /* Remove callbacks */ + _gl_ui_del_conform_cbs(ad->maininfo.naviframe); + + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode = %d", view_mode); + + if (ad->entryinfo.imf_entry) { + evas_object_smart_callback_del(ad->entryinfo.imf_entry, + "maxlength,reached", + __gl_editfield_maxlen_reached_cb); + if (ad->entryinfo.entry_mode == GL_ENTRY_NEW_ALBUM) + evas_object_smart_callback_del(ad->entryinfo.imf_entry, + "activated", + __gl_editfield_new_album_enter_cb); + else if (ad->entryinfo.entry_mode == GL_ENTRY_NEW_TAG) + evas_object_smart_callback_del(ad->entryinfo.imf_entry, + "activated", + __gl_editfield_new_tag_enter_cb); + else if (ad->entryinfo.entry_mode == GL_ENTRY_RENAME_TAG) + evas_object_smart_callback_del(ad->entryinfo.imf_entry, + "activated", + __gl_editfield_rename_tag_enter_cb); + else if (ad->entryinfo.entry_mode == GL_ENTRY_RENAME_ALBUM) + evas_object_smart_callback_del(ad->entryinfo.imf_entry, + "activated", + __gl_editfield_rename_album_enter_cb); + + evas_object_smart_callback_del(ad->entryinfo.imf_entry, + "changed", + __gl_editfield_space_check_cb); + evas_object_smart_callback_del(ad->entryinfo.imf_entry, + "preedit,changed", + __gl_editfield_space_check_cb); + } + ad->entryinfo.entry_mode = GL_ENTRY_NONE; + + if (ad->entryinfo.imf_context) + ecore_imf_context_input_panel_hide(ad->entryinfo.imf_context); + if (ad->entryinfo.editfield) { + evas_object_del(ad->entryinfo.editfield); + ad->entryinfo.editfield = NULL; + } + + ad->entryinfo.imf_entry = NULL; + ad->entryinfo.imf_context = NULL; + ad->entryinfo.done_btn = NULL; + ad->entryinfo.nf_it = NULL; + + return 0; +} + diff --git a/src/widget/gl-nocontents.c b/src/widget/gl-nocontents.c new file mode 100755 index 0000000..1d13fbe --- /dev/null +++ b/src/widget/gl-nocontents.c @@ -0,0 +1,211 @@ +/* + * Copyright (c) 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 "gl-nocontents.h" +#include "gl-thumbs.h" +#include "gl-thumbs-edit.h" +#include "gl-controlbar.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-strings.h" +#include "gl-debug.h" + +/** + * Create Nocontents. + */ +Evas_Object *_gl_nocontents_create(void *data) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *noc_lay = NULL; + char label_str[GL_POPUP_DESC_LEN_MAX] = { 0, }; + bool is_favor_tag = false; + + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_tag *cur_tag = ad->taginfo.current_tag; + if (cur_tag && cur_tag->tag && + cur_tag->tag->_id == GL_TAG_FAVORITES_ID) + is_favor_tag = true; + } + + int grid_mode = ad->gridinfo.view_mode; + switch (grid_mode) { + case GL_THUMB_ALL: + if (is_favor_tag) + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_FAVOR_ITEMS)); + else + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_ITEMS)); + break; + case GL_THUMB_VIDEOS: + if (is_favor_tag) + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_FAVOR_VIDEOS)); + else + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_VIDEOS)); + break; + case GL_THUMB_IMAGES: + if (is_favor_tag) + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_FAVOR_IMAGES)); + else + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_IMAGES)); + break; + case GL_THUMB_ALBUMS: + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_ALBUMS)); + break; + default: + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_CONTENTS)); + break; + } + + gl_dbg("Nocontents label: %s", label_str); + /* Full view nocontents */ + noc_lay = elm_layout_add(ad->maininfo.naviframe); + GL_CHECK_NULL(noc_lay); + elm_layout_theme_set(noc_lay, "layout", "nocontents", "gallery"); + elm_object_part_text_set(noc_lay, GL_NOCONTENTS_TEXT, label_str); + + return noc_lay; +} + +/** + * Update label of Nocontents. + */ +bool _gl_nocontents_update_label(Evas_Object *noc, const char *new_label) +{ + GL_CHECK_VAL(new_label, -1); + GL_CHECK_VAL(noc, -1); + const char *label = NULL; + + label = elm_object_part_text_get(noc, GL_NOCONTENTS_TEXT); + GL_CHECK_VAL(label, -1); + gl_dbg("Nocontents label: %s", label); + /* Update label if they're different */ + if (g_strcmp0(label, GL_STR_NO_ALBUMS)) { + gl_dbgW("Update nocontents label!"); + elm_object_part_text_set(noc, GL_NOCONTENTS_TEXT, new_label); + return true; + } + return false; +} + +/** + * Show Nocontents in All/Images/Videos segment. + */ +bool _gl_nocontents_show(void *data) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + bool b_video_exist = false; + bool b_image_exist = false; + int grid_mode = ad->gridinfo.view_mode; + gl_item *gitem = NULL; + int i = 0; + bool ret = false; + int view_mode = gl_get_view_mode(ad); + /* Get all medias count of current album */ + int cnt = ad->maininfo.medias_cnt; + + if (cnt == 0) { + if (ad->ctrlinfo.tab_mode == GL_CTRL_TAB_TAGS) { + gl_dbg("None files, show nocontents."); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + gl_dbg("In edit mode, change to normal view."); + _gl_thumbs_edit_pop_view(ad); + } + /* Clear invalid objects if needed */ + _gl_thumbs_delete_view(ad); + /* Reset flags */ + ad->gridinfo.view_mode = GL_THUMB_ALL; + /* Create nocontents widget */ + Evas_Object *noc = NULL; + noc = _gl_nocontents_create(ad); + if (ad->gridinfo.all_grid_view) { + evas_object_del(ad->gridinfo.all_grid_view); + ad->gridinfo.all_grid_view = NULL; + } + ad->gridinfo.all_grid_view = noc; + ad->gridinfo.all_grid_nocontents = noc; + elm_object_part_content_unset(ad->gridinfo.navi_content_ly, + "elm.swallow.view"); + evas_object_show(ad->gridinfo.all_grid_view); + elm_object_part_content_set(ad->gridinfo.navi_content_ly, + "elm.swallow.view", + ad->gridinfo.all_grid_view); + _gl_ctrl_disable_btn(ad, true, GL_NAVI_THUMBS); + } + } else if (grid_mode == GL_THUMB_VIDEOS || + grid_mode == GL_THUMB_IMAGES) { + /* check in video or image segment. */ + for (i = 1; i <= cnt; i++) { + _gl_data_get_item_by_index(ad, i, false, &gitem); + if (gitem == NULL || gitem->item == NULL) { + gl_dbgE("gitem == NULL || gitem->item == NULL"); + continue; + } + + if (grid_mode == GL_THUMB_VIDEOS && !b_video_exist && + gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) { + b_video_exist = true; + break; + } else if (grid_mode == GL_THUMB_IMAGES && + !b_image_exist && + gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) { + b_image_exist = true; + break; + } + + } + + gl_dbg("video file exists->%d, image file exists->%d", + b_video_exist, b_image_exist); + if ((grid_mode == GL_THUMB_IMAGES && !b_image_exist) || + (grid_mode == GL_THUMB_VIDEOS && !b_video_exist)) { + if (view_mode == GL_VIEW_THUMBS_EDIT) { + gl_dbg("In edit mode, change to normal view."); + _gl_thumbs_edit_pop_view(ad); + } + + if (ad->gridinfo.all_grid_view) { + evas_object_del(ad->gridinfo.all_grid_view); + ad->gridinfo.all_grid_view = NULL; + ad->gridinfo.all_grid_nocontents = NULL; + } + gl_dbg("None image files, show nocontents..."); + Evas_Object *noc = _gl_nocontents_create(ad); + + ad->gridinfo.all_grid_view = noc; + ad->gridinfo.all_grid_nocontents = noc; + + elm_object_part_content_unset(ad->gridinfo.navi_content_ly, + "elm.swallow.view"); + evas_object_hide(ad->gridinfo.all_grid_view); + elm_object_part_content_set(ad->gridinfo.navi_content_ly, + "elm.swallow.view", + noc); + _gl_ctrl_disable_btn(ad, true, GL_NAVI_THUMBS); + ret = true; + } + } + + return ret; +} diff --git a/src/widget/gl-notify.c b/src/widget/gl-notify.c new file mode 100755 index 0000000..778184d --- /dev/null +++ b/src/widget/gl-notify.c @@ -0,0 +1,196 @@ +/* + * Copyright (c) 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 "gl-notify.h" +#include "gl-thumbs.h" +#include "gl-controlbar.h" +#include "gl-thread-util.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-strings.h" +#include "gl-debug.h" +#include "gl-ext-exec.h" + +/** +* Create a new notify widget +* b_selinfo, True: Create selectioninfo, False: Create notificationinfo. +*/ +static int __gl_notify_add(void *data, Evas_Object *parent) +{ + gl_dbg(""); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + _gl_notify_destroy_selinfo(ad); + + ad->popupinfo.selinfo_ly = elm_layout_add(parent); + GL_CHECK_VAL(ad->popupinfo.selinfo_ly, -1); + evas_object_size_hint_weight_set(ad->popupinfo.selinfo_ly, + EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ad->popupinfo.selinfo_ly, + EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_layout_theme_set(ad->popupinfo.selinfo_ly, "standard", + "selectioninfo", "center_text"); + + /* Set the content of the notify widget */ + elm_object_part_content_set(parent, "elm.swallow.selinfo", + ad->popupinfo.selinfo_ly); + return 0; +} + +int _gl_notify_create_notiinfo(void *data, const char *text) +{ + GL_CHECK_VAL(text, -1); + int ret = notification_status_message_post(text); + if (ret != 0) + gl_dbgE("status_message_post()... [0x%x]!", ret); + return ret; +} + +/** +* Update selectioinfo widget and view related to it +*/ +static int _gl_notify_update_layout(void *data, Evas_Object *parent, int sel_cnt) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + const char *v_emis = NULL; + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d", view_mode); + + if (sel_cnt > 0) { + if (view_mode == GL_VIEW_THUMBS_EDIT) { + v_emis = GL_SIGNAL_VIEW_MOVEUP; + } else if (view_mode == GL_VIEW_THUMBS_SELECT || + view_mode == GL_VIEW_TAGS_EDIT || + view_mode == GL_VIEW_ALBUMS_EDIT) { + v_emis = GL_SIGNAL_VIEW_MOVEUP; + } else { + gl_dbgW("Skip mode!"); + return -1; + } + } else { + /* Restore view while selectioninfo vanished. */ + if (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_THUMBS_SELECT || + view_mode == GL_VIEW_TAGS_EDIT || + view_mode == GL_VIEW_ALBUMS_EDIT) { + v_emis = GL_SIGNAL_VIEW_EDIT; + } else { + gl_dbgW("Skip mode!"); + return -1; + } + } + edje_object_signal_emit(_EDJ(parent), v_emis, "elm"); + return 0; +} + +/** +* Add new notify widget, select-all widget and set view state. +* +* b_update, if true, update text only, other recreate notify widget +*/ +int _gl_notify_create_selinfo(void *data, Evas_Object *parent, + Elm_Object_Item *nf_it, int all_cnt, + int selected_cnt, bool b_update) +{ + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(nf_it, -1); + gl_appdata *ad = (gl_appdata *)data; + char text[GL_POPUP_DESC_LEN_MAX] = { 0, }; + int view_mode = gl_get_view_mode(ad); + + gl_dbg("selected_cnt/all_cnt = %d/%d", selected_cnt, all_cnt); + if (selected_cnt > all_cnt) { + _gl_notify_destroy_selinfo(ad); + gl_dbgE("selected_cnt > all_cnt!"); + return -1; + } + + /* Create new notify widget */ + if (b_update == false) + __gl_notify_add(ad, parent); + + /* Update state of checkbox in select-all widget */ + _gl_ui_update_selall(ad, all_cnt, selected_cnt); + + /* Reuse old notify widget in update case */ + GL_CHECK_VAL(ad->popupinfo.selinfo_ly, -1); + + /* Update notify widget and view related to it */ + _gl_notify_update_layout(ad, parent, selected_cnt); + + if (selected_cnt > 0) { + /* Enable/Disable control bar buttons */ + _gl_ctrl_disable_btns(ad, nf_it, false); + /* Add Space */ + snprintf(text, sizeof(text), "%s (%d)", GL_STR_SELECTED, + selected_cnt); + /* Set the text for notify */ + edje_object_part_text_set(_EDJ(ad->popupinfo.selinfo_ly), + "elm.text", text); + + _gl_ui_disable_slideshow(ad, false); + } else if (view_mode == GL_VIEW_THUMBS_SELECT) { + /* Disable control bar buttons */ + _gl_ctrl_disable_btns(ad, nf_it, true); + } else { + /* Disable control bar buttons */ + _gl_ctrl_disable_btns(ad, nf_it, true); + _gl_notify_destroy_selinfo(ad); + _gl_ui_disable_slideshow(ad, true); + } + + return 0; +} + +int _gl_notify_destroy_selinfo(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + if (ad->popupinfo.selinfo_ly) { + evas_object_del(ad->popupinfo.selinfo_ly); + ad->popupinfo.selinfo_ly = NULL; + } + return 0; +} + +int _gl_notify_update_lang(void *data, int cnt, int view_mode) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *view_ly = NULL; + + view_ly = _gl_ui_get_view_layout(data, view_mode); + /*Select all*/ + if (view_ly) + edje_object_part_text_set(_EDJ(view_ly), "selectall_text", + GL_STR_SELECT_ALL); + /*Reset text for select info*/ + if (ad->popupinfo.selinfo_ly) { + char text[GL_POPUP_DESC_LEN_MAX] = {0}; + snprintf(text, sizeof(text), "%s (%d)", GL_STR_SELECTED, cnt); + edje_object_part_text_set(_EDJ(ad->popupinfo.selinfo_ly), + "elm.text", text); + } + + return 0; +} + diff --git a/src/widget/gl-popup.c b/src/widget/gl-popup.c new file mode 100755 index 0000000..a35c2c8 --- /dev/null +++ b/src/widget/gl-popup.c @@ -0,0 +1,314 @@ +/* + * Copyright (c) 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 "gallery.h" +#include "gl-popup.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-debug.h" +#include "gl-tags.h" +#include "gl-tags-new.h" +#include "gl-albums-new.h" +#include "gl-albums-rename.h" +#include "gl-progressbar.h" +#include "gl-strings.h" +#include "gl-button.h" +#include "gl-editfield.h" + +#define GL_POPUP_TIMEOUT_1S 1.0 +#define GL_POPUP_TIMEOUT_2S 2.0 +#define GL_POPUP_TIMEOUT_3S 3.0 + +/* Delete popup contents */ +static int __gl_popup_clear_content(Evas_Object *popup) +{ + GL_CHECK_VAL(popup, -1); + gl_dbg(""); + + Evas_Object *content = elm_object_content_get(popup); + GL_CHECK_VAL(content, -1); + Eina_List *chidren = elm_box_children_get(content); + GL_CHECK_VAL(chidren, -1); + Evas_Object *genlist = eina_list_nth(chidren, 0); + GL_CHECK_VAL(genlist, -1); + elm_genlist_clear(genlist); + elm_box_clear(content); + return 0; +} + +static Eina_Bool __gl_popup_timeout_cb(void *data) +{ + GL_CHECK_FALSE(data); + gl_appdata *ad = (gl_appdata *)data; + if (ad->popupinfo.del_timer) { + ecore_timer_del(ad->popupinfo.del_timer); + ad->popupinfo.del_timer = NULL; + } + + GL_IF_DEL_OBJ(ad->popupinfo.popup); + return ECORE_CALLBACK_CANCEL; +} + +static int __gl_popup_add_timer(void *data, double to_inc) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + if (ad->popupinfo.del_timer) { + ecore_timer_del(ad->popupinfo.del_timer); + ad->popupinfo.del_timer = NULL; + } + + ad->popupinfo.del_timer = ecore_timer_add(to_inc, __gl_popup_timeout_cb, + data); + return 0; +} + +static void __gl_popup_del_resp_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + const char *text = NULL; + + text = elm_object_text_get(obj); + GL_CHECK(text); + gl_dbg("Button: %s, mode: %d", text, ad->popupinfo.popup_mode); + + if (!g_strcmp0(text, GL_STR_DELETE)) { + if (ad->popupinfo.popup_mode == GL_POPUP_ALBUM_DELETE) + gl_del_albums(ad); + } + + GL_IF_DEL_OBJ(ad->popupinfo.popup); +} + +static void _gl_popup_del_tag_resp_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(obj); + GL_CHECK(data); + gl_tag *gtag = (gl_tag *)data; + GL_CHECK(gtag->ad); + gl_appdata *ad = (gl_appdata *)gtag->ad; + const char *text = NULL; + + text = elm_object_text_get(obj); + GL_CHECK(text); + gl_dbg("Button: %s", text); + + if (!g_strcmp0(text, GL_STR_DELETE)) + _gl_tags_del(data); + + GL_IF_DEL_OBJ(ad->popupinfo.popup); +} + +static void _gl_popup_resp_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + int mode = ad->popupinfo.popup_mode; + const char *text = NULL; + + text = elm_object_text_get(obj); + GL_CHECK(text); + gl_dbg("Button: %s, mode: %d", text, mode); + + if (mode == GL_POPUP_ALBUM_NEW_EMPTY || + mode == GL_POPUP_ALBUM_NEW_DUPLICATE || + mode == GL_POPUP_ALBUM_NEW_INVALID) { + if (!g_strcmp0(text, GL_STR_YES) || + !g_strcmp0(text, GL_STR_OK)) { + ad->entryinfo.entry_mode = GL_ENTRY_NEW_ALBUM; + _gl_editfield_show_imf(ad); + } else if (!g_strcmp0(text, GL_STR_NO) || + !g_strcmp0(text, GL_STR_CANCEL)) { + _gl_editfield_hide_imf(ad); + _gl_albums_new_pop_view(ad); + } + } else if (mode == GL_POPUP_ALBUM_RENAME_EMPTY || + mode == GL_POPUP_ALBUM_RENAME_DUPLICATE || + mode == GL_POPUP_ALBUM_RENAME_INVALID) { + if (!g_strcmp0(text, GL_STR_YES) || + !g_strcmp0(text, GL_STR_OK)) { + _gl_editfield_show_imf(ad); + } else if (!g_strcmp0(text, GL_STR_NO) || + !g_strcmp0(text, GL_STR_CANCEL)) { + _gl_editfield_hide_imf(ad); + _gl_albums_rename_pop_view(ad); + } + } else if (mode == GL_POPUP_TAG_NEW_EMPTY) { + if (!g_strcmp0(text, GL_STR_YES) || + !g_strcmp0(text, GL_STR_OK)) { + ad->entryinfo.entry_mode = GL_ENTRY_NEW_TAG; + _gl_editfield_show_imf(ad); + } else if (!g_strcmp0(text, GL_STR_NO) || + !g_strcmp0(text, GL_STR_CANCEL)) { + _gl_editfield_hide_imf(ad); + _gl_tags_new_pop_view(ad); + } + } else if (mode == GL_POPUP_NOBUT_APPEXIT) { + if (ad->popupinfo.popup) { + __gl_popup_clear_content(ad->popupinfo.popup); + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + } + elm_exit(); + return; + } + GL_IF_DEL_OBJ(ad->pbarinfo.pbar_popup); + GL_IF_DEL_OBJ(ad->popupinfo.popup); +} + +int gl_popup_create_albums_del_popup(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->popupinfo.popup != NULL) { + gl_dbg("The existed popup is deleted"); + evas_object_del(ad->popupinfo.popup); + } + + Evas_Object *popup = elm_popup_add(ad->maininfo.win); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + Evas_Object *btn1 = NULL; + Evas_Object *btn2 = NULL; + btn1 = _gl_but_create_but_popup(popup, GL_STR_DELETE, + __gl_popup_del_resp_cb, data); + btn2 = _gl_but_create_but_popup(popup, GL_STR_CANCEL, + __gl_popup_del_resp_cb, data); + elm_object_part_content_set(popup, "button1", btn1); + elm_object_part_content_set(popup, "button2", btn2); + + elm_object_text_set(popup, GL_STR_DELETE_COMFIRMATION); + + evas_object_show(popup); + ad->popupinfo.popup = popup; + ad->popupinfo.popup_mode = GL_POPUP_ALBUM_DELETE; + return 0; +} + +int gl_popup_create_tag_del_popup(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_tag *gtag = (gl_tag *)data; + GL_CHECK_VAL(gtag->ad, -1); + gl_appdata *ad = (gl_appdata *)gtag->ad; + gl_dbg(""); + + if (ad->popupinfo.popup) { + gl_dbg("Remove the existed popup."); + evas_object_del(ad->popupinfo.popup); + } + + Evas_Object *popup = NULL; + popup = elm_popup_add(ad->maininfo.win); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + + Evas_Object *btn1 = NULL; + Evas_Object *btn2 = NULL; + btn1 = _gl_but_create_but_popup(popup, GL_STR_DELETE, + _gl_popup_del_tag_resp_cb, data); + btn2 = _gl_but_create_but_popup(popup, GL_STR_CANCEL, + _gl_popup_del_tag_resp_cb, data); + elm_object_part_content_set(popup, "button1", btn1); + elm_object_part_content_set(popup, "button2", btn2); + + elm_object_text_set(popup, GL_STR_DELETE_COMFIRMATION); + + evas_object_show(popup); + ad->popupinfo.popup = popup; + ad->popupinfo.popup_mode = GL_POPUP_TAG_DELETE; + + return 0; +} + +int gl_popup_create_popup(void *data, gl_popup_mode mode, char *desc) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + + if (ad->popupinfo.popup) { + gl_dbg("The existed popup is deleted"); + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + } + + /** + * Pogressbar is showed during moving or deleting medias, + * don't delete it while show popup. + */ + if (mode != GL_POPUP_NOBUT_MOV_DEL) + gl_pb_del_pbar(ad); + + Evas_Object *popup = elm_popup_add(ad->maininfo.win); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_object_text_set(popup, desc); + Evas_Object *btn1 = NULL; + Evas_Object *btn2 = NULL; + + switch (mode) { + case GL_POPUP_NOBUT: + case GL_POPUP_NOBUT_APPEXIT: + __gl_popup_add_timer(ad, GL_POPUP_TIMEOUT_3S); + break; + case GL_POPUP_NOBUT_MOV_DEL: + __gl_popup_add_timer(ad, GL_POPUP_TIMEOUT_1S); + break; + case GL_POPUP_ALBUM_NEW_EMPTY: + case GL_POPUP_ALBUM_NEW_DUPLICATE: + case GL_POPUP_ALBUM_NEW_INVALID: + case GL_POPUP_ALBUM_RENAME_EMPTY: + case GL_POPUP_ALBUM_RENAME_DUPLICATE: + case GL_POPUP_ALBUM_RENAME_INVALID: + case GL_POPUP_TAG_NEW_EMPTY: + btn1 = _gl_but_create_but_popup(popup, GL_STR_YES, + _gl_popup_resp_cb, data); + elm_object_part_content_set(popup, "button1", btn1); + btn2 = _gl_but_create_but_popup(popup, GL_STR_NO, + _gl_popup_resp_cb, data); + elm_object_part_content_set(popup, "button2", btn2); + gl_dbg("Hide Entry cursor and IMF"); + _gl_editfield_hide_imf(ad); + break; + case GL_POPUP_TAG_RENAEM_EMPTY: + case GL_POPUP_TAG_RENAME_DUPLICATE: + __gl_popup_add_timer(ad, GL_POPUP_TIMEOUT_2S); + gl_dbg("Hide Entry cursor and IMF"); + _gl_editfield_hide_imf(ad); + break; + default: + gl_dbgE("Other popup mode..."); + break; + } + + evas_object_show(popup); + + /* Focus popup and IMF hide */ + elm_object_focus_set(popup, EINA_TRUE); + + ad->popupinfo.popup = popup; + ad->popupinfo.popup_mode = mode; + + return 0; +} + diff --git a/src/widget/gl-progressbar.c b/src/widget/gl-progressbar.c new file mode 100755 index 0000000..16140d6 --- /dev/null +++ b/src/widget/gl-progressbar.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 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 "gallery.h" +#include "gl-progressbar.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-debug.h" +#include "gl-albums.h" +#include "gl-controlbar.h" +#include "gl-thread-util.h" +#include "gl-strings.h" +#include "gl-button.h" + +#define GL_PROGRESSBAR_STYLE_PROGRESS "list_progress" +#define GL_LABEL_STYLE_DEFAULT GL_CHECKBOX_STYLE_DEFAULT + +static void +_gl_pb_cancel_thread_pbar_cb(void *data, Evas_Object * obj, void *event_info) +{ + gl_dbg(""); + //set cancel false value + gl_thread_set_cancel_state(data, GL_PB_CANCEL_BUTTON); + //delete progressbar + gl_pb_del_pbar(data); +} + +int gl_pb_make_thread_pbar(void *data, Evas_Object * parent, char *title) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *popup = NULL; + Evas_Object *progressbar = NULL; + Evas_Object *box = NULL; + Evas_Object *label = NULL; + + gl_pb_del_pbar(ad); + + popup = elm_popup_add(parent); + elm_object_part_text_set(popup, GL_POPUP_TEXT, title); + + label = elm_label_add(popup); + elm_object_style_set(label, GL_LABEL_STYLE_DEFAULT); + elm_object_text_set(label, GL_STR_EMPTY); + evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_show(label); + + progressbar = elm_progressbar_add(popup); + elm_object_style_set(progressbar, GL_PROGRESSBAR_STYLE_PROGRESS); + elm_progressbar_unit_format_set(progressbar, NULL); + elm_progressbar_value_set(progressbar, 0.0); + evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, + EVAS_HINT_FILL); + evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_show(progressbar); + + box = elm_box_add(popup); + evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_box_horizontal_set(box, EINA_FALSE); + elm_box_homogeneous_set(box, EINA_TRUE); + elm_box_pack_end(box, progressbar); + elm_box_pack_end(box, label); + evas_object_show(box); + + elm_object_content_set(popup, box); + Evas_Object *btn1 = NULL; + btn1 = _gl_but_create_but_popup(popup, GL_STR_CANCEL, + _gl_pb_cancel_thread_pbar_cb, data); + elm_object_part_content_set(popup, "button1", btn1); + + evas_object_show(popup); + + ad->pbarinfo.pbar_popup = popup; + ad->pbarinfo.pbar = progressbar; + ad->pbarinfo.status_label = label; + ad->pbarinfo.finished_cnt = 0; + + return 0; +} + +int +gl_pb_refresh_thread_pbar(void *data, int cur_cnt, int total_cnt) +{ + GL_CHECK_VAL(data, -1); + char status_info[GL_POPUP_DESC_LEN_MAX] = { 0, }; + double percent = 0.0; + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->pbarinfo.pbar, -1); + GL_CHECK_VAL(ad->pbarinfo.status_label, -1); + + snprintf(status_info, sizeof(status_info), + GL_FONT_STYLE_POP_S"%d/%d"GL_FONT_STYLE_POP_E, cur_cnt, + total_cnt); + /* Save medias count already operated */ + ad->pbarinfo.finished_cnt = cur_cnt; + elm_object_text_set(ad->pbarinfo.status_label, status_info); + evas_object_show(ad->pbarinfo.status_label); + + percent = (double)cur_cnt / (double)total_cnt; + elm_progressbar_value_set(ad->pbarinfo.pbar, percent); + + return 0; +} + +int +gl_pb_del_pbar(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("destroy progressbar"); + + if (ad->pbarinfo.pbar_popup) + { + evas_object_del(ad->pbarinfo.pbar_popup); + ad->pbarinfo.pbar_popup = NULL; + ad->pbarinfo.pbar = NULL; + ad->pbarinfo.status_label = NULL; + ad->pbarinfo.finished_cnt = 0; + } + + return 0; +} + diff --git a/src/widget/gl-rotate-bg.c b/src/widget/gl-rotate-bg.c new file mode 100755 index 0000000..f9a3786 --- /dev/null +++ b/src/widget/gl-rotate-bg.c @@ -0,0 +1,394 @@ +/* + * Copyright (c) 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. + */ + +#ifdef _USE_ROTATE_BG + +#include "gl-rotate-bg.h" +#include "gl-exif.h" +#include "gl-debug.h" +#include "gl-icons.h" + +#define GL_ROTATE_BG_DATA_KEY "gl_bg_data" +#define GL_ROTATE_BG_GROUP "gl_bg_layout" + +typedef struct _gl_bg { + Evas_Object *base; + Evas_Object *img; + char *file; +} gl_bg; + +static int __gl_rotate_bg_image_rotate_180(Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + unsigned int *data = NULL; + unsigned int *data2 = NULL; + unsigned int *to = NULL; + unsigned int *from = NULL; + int x = 0; + int hw = 0; + int iw = 0; + int ih = 0; + + evas_object_image_size_get(obj, &iw, &ih); + int size = iw * ih * sizeof(unsigned int); + + /* EINA_FALSE for reading */ + data = evas_object_image_data_get(obj, EINA_FALSE); + /* memcpy */ + data2 = calloc(1, size); + GL_CHECK_VAL(data2, -1); + memcpy(data2, data, size); + + data = evas_object_image_data_get(obj, EINA_TRUE); + + hw = iw * ih; + x = hw; + to = data; + from = data2 + hw - 1; + for (; --x >= 0;) { + *to = *from; + to++; + from--; + } + +#if 0 /* Failed to rotate icon created from original file */ + hw = iw * ih; + x = (hw / 2); + p1 = data; + p2 = data + hw - 1; + for (; --x > 0;) { + tmp = *p1; + *p1 = *p2; + *p2 = tmp; + p1++; + p2--; + } +#endif + + GL_FREE(data2); + + evas_object_image_data_set(obj, data); + evas_object_image_data_update_add(obj, 0, 0, iw, ih); + return 0; +} + +static int __gl_rotate_bg_image_rotate_90(Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + unsigned int *data = NULL; + unsigned int *data2 = NULL; + unsigned int *to = NULL; + unsigned int *from = NULL; + int x = 0; + int y = 0; + int w = 0; + int hw = 0; + int iw = 0; + int ih = 0; + + evas_object_image_size_get(obj, &iw, &ih); + int size = iw * ih * sizeof(unsigned int); + + /* EINA_FALSE for reading */ + data = evas_object_image_data_get(obj, EINA_FALSE); + /* memcpy */ + data2 = calloc(1, size); + GL_CHECK_VAL(data2, -1); + memcpy(data2, data, size); + + /* set width, height */ + w = ih; + ih = iw; + iw = w; + hw = w * ih; + + /* set width, height to image obj */ + evas_object_image_size_set(obj, iw, ih); + data = evas_object_image_data_get(obj, EINA_TRUE); + to = data + w - 1; + hw = -hw - 1; + from = data2; + + for (x = iw; --x >= 0;) { + for (y = ih; --y >= 0;) { + *to = *from; + from++; + to += w; + } + + to += hw; + } + + GL_FREE(data2); + + evas_object_image_data_set(obj, data); + evas_object_image_data_update_add(obj, 0, 0, iw, ih); + return 0; +} + +static int __gl_rotate_bg_image_rotate_270(Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + unsigned int *data = NULL; + unsigned int *data2 = NULL; + unsigned int *to = NULL; + unsigned int *from = NULL; + int x = 0; + int y = 0; + int w = 0; + int hw = 0; + int iw = 0; + int ih = 0; + + evas_object_image_size_get(obj, &iw, &ih); + int size = iw * ih * sizeof(unsigned int); + + /* EINA_FALSE for reading */ + data = evas_object_image_data_get(obj, EINA_FALSE); + /* memcpy */ + data2 = calloc(1, size); + GL_CHECK_VAL(data2, -1); + memcpy(data2, data, size); + + /* set width, height */ + w = ih; + ih = iw; + iw = w; + hw = w * ih; + + /* set width, height to image obj */ + evas_object_image_size_set(obj, iw, ih); + data = evas_object_image_data_get(obj, EINA_TRUE); + + to = data + hw - w; + w = -w; + hw = hw + 1; + from = data2; + + for (x = iw; --x >= 0;) { + for (y = ih; --y >= 0;) { + *to = *from; + from++; + to += w; + } + + to += hw; + } + + GL_FREE(data2); + + evas_object_image_data_set(obj, data); + evas_object_image_data_update_add(obj, 0, 0, iw, ih); + return 0; +} + +/* check its orientation */ +int __gl_rotate_bg_rotate_image(Evas_Object *obj, unsigned int orient) +{ + switch (orient){ + case GL_ORIENTATION_ROT_90: + __gl_rotate_bg_image_rotate_90(obj); + break; + case GL_ORIENTATION_ROT_180: + __gl_rotate_bg_image_rotate_180(obj); + break; + case GL_ORIENTATION_ROT_270: + __gl_rotate_bg_image_rotate_270(obj); + break; + default: + break; + } + + return 0; +} + +static void __gl_rotate_bg_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + if (data) { + gl_bg *bg_data = (gl_bg *)data; + GL_FREEIF(bg_data->file); + GL_FREE(data); + } +} + +static void __gl_rotate_bg_custom_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_bg *bg_data = (gl_bg *)data; + Evas_Coord bx = 0; + Evas_Coord by = 0; + Evas_Coord bw = 0; + Evas_Coord bh = 0; + Evas_Coord iw = 0; + Evas_Coord ih = 0; + Evas_Coord fx = 0; + Evas_Coord fy = 0; + Evas_Coord fw = 0; + Evas_Coord fh = 0; + Evas_Coord nx = 0; + Evas_Coord ny = 0; + Evas_Coord nw = 0; + Evas_Coord nh = 0; + + if ((!bg_data->img) || (!bg_data->base)) { + gl_dbgE("Invalid object!"); + return; + } + /* grab image size */ + evas_object_image_size_get(bg_data->img, &iw, &ih); + if ((iw < 1) || (ih < 1)) { + gl_dbgE("(iw < 1) || (ih < 1)!"); + return; + } + + /* grab base object dimensions */ + evas_object_geometry_get(bg_data->base, &bx, &by, &bw, &bh); + + /* set some defaults */ + nx = bx; + ny = by; + nw = bw; + nh = bh; + + + fw = bw; + fh = ((ih * fw) / iw); + if (fh < bh) { + fh = bh; + fw = ((iw * fh) / ih); + } + fx = ((bw - fw) / 2); + fy = ((bh - fh) / 2); + + evas_object_move(bg_data->img, nx, ny); + evas_object_resize(bg_data->img, nw, nh); + evas_object_image_fill_set(bg_data->img, fx, fy, fw, fh); +} + +Evas_Object *_gl_rotate_bg_add_layout(Evas_Object *parent, const char *file, const char *group) +{ + Evas_Object *eo = NULL; + int r = 0; + + eo = elm_layout_add(parent); + if (eo) { + r = elm_layout_file_set(eo, file, group); + if (!r) { + evas_object_del(eo); + return NULL; + } + + evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL); + } + + return eo; +} + +Evas_Object *_gl_rotate_bg_add(Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + + gl_bg *bg_data = (gl_bg *)calloc(1, sizeof(gl_bg)); + GL_CHECK_NULL(bg_data); + + Evas_Object *base = NULL; + base = _gl_rotate_bg_add_layout(parent, GL_EDJ_FILE, + GL_ROTATE_BG_GROUP); + if (base == NULL) { + GL_FREE(bg_data); + return NULL; + } + + bg_data->base= base; + evas_object_event_callback_add(base, EVAS_CALLBACK_RESIZE, + __gl_rotate_bg_custom_resize, bg_data); + evas_object_event_callback_add(base, EVAS_CALLBACK_DEL, + __gl_rotate_bg_delete_cb, bg_data); + + evas_object_data_set(base, GL_ROTATE_BG_DATA_KEY, bg_data); + return base; +} + +int _gl_rotate_bg_set_file(Evas_Object *bg, const char *file, int w, int h) +{ + GL_CHECK_VAL(file, -1); + GL_CHECK_VAL(bg, -1); + + gl_bg *bg_data = evas_object_data_get(bg, GL_ROTATE_BG_DATA_KEY); + GL_CHECK_VAL(bg_data, -1); + + Evas_Object *image_obj = NULL; + image_obj = evas_object_image_add(evas_object_evas_get(bg)); + evas_object_repeat_events_set(image_obj, EINA_TRUE); + bg_data->img = image_obj; + bg_data->file = strdup(file); + elm_object_part_content_set(bg, "elm.swallow.image", image_obj); + evas_object_image_load_size_set(image_obj, w, h); + evas_object_image_file_set(image_obj, file, NULL); + evas_object_image_preload(image_obj, EINA_FALSE); + return 0; +} + +int _gl_rotate_bg_rotate_image(Evas_Object *bg, unsigned int orient) +{ + GL_CHECK_VAL(bg, -1); + + gl_bg *bg_data = evas_object_data_get(bg, GL_ROTATE_BG_DATA_KEY); + GL_CHECK_VAL(bg_data, -1); + + if (bg_data->file && g_strcmp0(bg_data->file, GL_DEFAULT_THUMB_ICON)) + __gl_rotate_bg_rotate_image(bg_data->img, orient); + else + __gl_rotate_bg_rotate_image(bg_data->img, GL_ORIENTATION_ROT_0); + __gl_rotate_bg_custom_resize(bg_data, NULL, NULL, NULL); + return 0; +} + +int _gl_rotate_bg_add_image(Evas_Object *bg, int w, int h) +{ + GL_CHECK_VAL(bg, -1); + + gl_bg *bg_data = evas_object_data_get(bg, GL_ROTATE_BG_DATA_KEY); + GL_CHECK_VAL(bg_data, -1); + + Evas_Object *image_obj = NULL; + image_obj = evas_object_image_add(evas_object_evas_get(bg)); + evas_object_image_size_set(image_obj, w, h); + evas_object_image_fill_set(image_obj, 0, 0, w, h); + evas_object_repeat_events_set(image_obj, EINA_TRUE); + bg_data->img = image_obj; + elm_object_part_content_set(bg, "elm.swallow.image", image_obj); + evas_object_image_load_size_set(image_obj, w, h); + return 0; +} + +int _gl_rotate_bg_set_image_file(Evas_Object *bg, const char *file) +{ + GL_CHECK_VAL(bg, -1); + + gl_bg *bg_data = evas_object_data_get(bg, GL_ROTATE_BG_DATA_KEY); + GL_CHECK_VAL(bg_data, -1); + GL_CHECK_VAL(bg_data->img, -1); + + evas_object_image_file_set(bg_data->img, file, NULL); + evas_object_image_preload(bg_data->img, EINA_FALSE); + + __gl_rotate_bg_custom_resize(bg_data, NULL, NULL, NULL); + return 0; +} + +#endif diff --git a/src/widget/gl-thumb.c b/src/widget/gl-thumb.c new file mode 100755 index 0000000..e45e3f9 --- /dev/null +++ b/src/widget/gl-thumb.c @@ -0,0 +1,252 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-util.h" +#include "gl-drm.h" +#include "gl-strings.h" +#include "gl-icons.h" +#ifdef _USE_ROTATE_BG +#include "gl-rotate-bg.h" +#include "gl-exif.h" +#endif + +#define GL_GRID_ICON_SIZE 175 + +#define GL_PHOTOFRAME_STYLE_VIDEO_FAVOR_BOOKMARK "default_layout_video_favor_bookmark" +#define GL_PHOTOFRAME_STYLE_VIDEO_BOOKMARK "default_layout_video_bookmark" +#define GL_PHOTOFRAME_STYLE_VIDEO_FAVOR "default_layout_video_favor" +#define GL_PHOTOFRAME_STYLE_VIDEO "default_layout_video" +#define GL_PHOTOFRAME_STYLE_FAVOR "default_layout_favor" +#define GL_PHOTOFRAME_STYLE_DEFAULT "default_layout" + +Evas_Object *_gl_thumb_show_part_icon_image(Evas_Object *obj, char *path, + unsigned int orient, bool b_favor, + bool is_expired_drm, int item_size) +{ + GL_CHECK_NULL(obj); + + Evas_Object *layout = elm_layout_add(obj); + GL_CHECK_NULL(layout); + +#ifdef _USE_ROTATE_BG + Evas_Object *bg = _gl_rotate_bg_add(layout); +#else + Evas_Object *bg = elm_bg_add(layout); +#endif + if (bg == NULL) { + evas_object_del(layout); + return NULL; + } + +#ifdef _USE_ROTATE_BG + _gl_rotate_bg_set_file(bg, path, item_size, item_size); + _gl_rotate_bg_rotate_image(bg, orient); +#else + elm_bg_file_set(bg, path, NULL); + elm_bg_load_size_set(bg, item_size, item_size); + evas_object_size_hint_max_set(bg, item_size, item_size); + evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + 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); +#endif + + // TODO: Need to check the expired drm icon file... + /* Expired drm icon */ + if (is_expired_drm) { + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_FAVOR); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + + Evas_Object *icon = elm_icon_add(layout); + GL_ICON_SET_FILE(icon, GL_LOCK_ICON); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + } else if (b_favor) { + /* Set favourites icon */ + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_FAVOR); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + + Evas_Object *icon = elm_icon_add(layout); + GL_ICON_SET_FILE(icon, GL_THUMB_FAVOR_ICON); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + } else { + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_DEFAULT); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + } + + evas_object_show(layout); + return layout; +} + +Evas_Object *_gl_thumb_show_part_icon_video(Evas_Object *obj, char *path, + unsigned int v_dur, int bk_len, + bool b_favor, bool is_expired_drm, + int item_size) +{ + GL_CHECK_NULL(obj); + + Evas_Object *layout = elm_layout_add(obj); + GL_CHECK_NULL(layout); + +#ifdef _USE_ROTATE_BG + Evas_Object *bg = _gl_rotate_bg_add(layout); +#else + Evas_Object *bg = elm_bg_add(layout); +#endif + if (bg == NULL) { + evas_object_del(layout); + return NULL; + } + +#ifdef _USE_ROTATE_BG + _gl_rotate_bg_set_file(bg, path, item_size, item_size); + _gl_rotate_bg_rotate_image(bg, GL_ORIENTATION_ROT_0); +#else + elm_bg_file_set(bg, path, NULL); + elm_bg_load_size_set(bg, item_size, item_size); + evas_object_size_hint_max_set(bg, item_size, item_size); + evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + 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); +#endif + + if (bk_len && b_favor) + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_VIDEO_FAVOR_BOOKMARK); + else if (bk_len) + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_VIDEO_BOOKMARK); + else if (is_expired_drm || b_favor) + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_VIDEO_FAVOR); + else + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_VIDEO); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + + // TODO: Need to check the expired drm icon file... + /* Expired drm icon */ + if (is_expired_drm) { + Evas_Object *icon = elm_icon_add(layout); + GL_ICON_SET_FILE(icon, GL_LOCK_ICON); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + /* Set favourites icon */ + } else if (b_favor) { + Evas_Object *icon = elm_icon_add(layout); + GL_ICON_SET_FILE(icon, GL_THUMB_FAVOR_ICON); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + } + + if (bk_len) { + Evas_Object *icon = elm_icon_add(layout); + GL_ICON_SET_FILE(icon, GL_THUMB_BOOKMARK); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.bookmarkicon", + icon); + } + + char *dur_str = _gl_get_duration_string(v_dur); + GL_CHECK_NULL(dur_str); + elm_object_part_text_set(layout, GL_GRID_TEXT, dur_str); + GL_FREE(dur_str); + + evas_object_show(layout); + return layout; +} + +Evas_Object *_gl_thumb_show_part_checkbox(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, const void *data) +{ + GL_CHECK_NULL(func); + GL_CHECK_NULL(obj); + Evas_Object *ck = NULL; + + ck = elm_check_add(obj); + GL_CHECK_NULL(ck); + elm_object_style_set(ck, GL_CHECKBOX_STYLE_GRID); + evas_object_propagate_events_set(ck, EINA_FALSE); + + elm_check_state_set(ck, checked); + + evas_object_smart_callback_add(ck, "changed", func, data); + + evas_object_show(ck); + return ck; +} + +Evas_Object *_gl_thumb_add_gengrid(Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + Evas_Object *grid = elm_gengrid_add(parent); + GL_CHECK_NULL(grid); + elm_gengrid_align_set(grid, 0.5, 0.0); + elm_gengrid_horizontal_set(grid, EINA_FALSE); + elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE); + elm_gengrid_multi_select_set(grid, EINA_TRUE); + + evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + + return grid; +} + +/* Update all gengrid item, class callback would be called again */ +int _gl_thumb_update_gengrid(Evas_Object *view) +{ + GL_CHECK_VAL(view, -1); + + Elm_Object_Item *_first_it = NULL; + _first_it = elm_gengrid_first_item_get(view); + while(_first_it) { + elm_gengrid_item_update(_first_it); + _first_it = elm_gengrid_item_next_get(_first_it); + } + + return 0; +} + +int _gl_thumb_set_size(void *data, Evas_Object *view, int count, int *size) +{ + GL_CHECK_VAL(view, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int _size = (int)(GL_GRID_ICON_SIZE * ad->maininfo.win_scale); + int _w = (int)(GL_GRID_ITEM_SIZE_W * ad->maininfo.win_scale); + int _h = (int)(GL_GRID_ITEM_SIZE_H * ad->maininfo.win_scale); + + if (count <= GL_GRID_ITEM_ZOOM_LEVEL_02_CNT) { + _size *= GL_GRID_ITEM_ZOOM_LEVEL_02; + _w *= GL_GRID_ITEM_ZOOM_LEVEL_02; + _h *= GL_GRID_ITEM_ZOOM_LEVEL_02; + } + + elm_gengrid_item_size_set(view, _w, _h); + gl_dbg("Thumb width: %d, height: %d, size: %d", _w, _h, _size); + if (size) + *size = _size; + return 0; +} + diff --git a/src/widget/gl-tile.c b/src/widget/gl-tile.c new file mode 100755 index 0000000..89897d1 --- /dev/null +++ b/src/widget/gl-tile.c @@ -0,0 +1,250 @@ +/* + * Copyright (c) 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 "gl-debug.h" +#include "gl-tile.h" +#include "gl-util.h" +#include "gl-button.h" +#include "gallery.h" +#include "gl-icons.h" +#ifdef _USE_ROTATE_BG +#include "gl-rotate-bg.h" +#endif + +/* Album color level and alpha value */ +#define GL_TILE_TEXT_COLOR_CNT 6 +#define GL_TILE_TEXT_COLOR_ALPHA 255 +/* Width and height of album item (208+28, 210+15) */ +#define GL_TILE_ITEM_WIDTH 358 +#define GL_TILE_ITEM_HEIGHT 360 + +#define GL_CHECKBOX_STYLE_ALBUM "gallery/album" +#define GL_CHECKBOX_STYLE_ALBUM_GRID "gallery/album/grid" +#define GL_GENGRID_STYLE_ALBUM "unclipped" + +typedef struct _gl_tile_color { + int r; + int g; + int b; +} gl_tile_color; + +static gl_tile_color bg_color[] = { + {50, 50, 50}, + {78, 74, 64}, + {49, 125, 174}, + {165, 53, 53}, + {71, 128, 11}, + {56, 78, 116}, + {25, 25, 25}, +}; + +Evas_Object *__gl_tile_add_1_icon_bg(Evas_Object *obj, int len, double scale, + bg_file_set_cb func, void **data) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(func); + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG + bg = _gl_rotate_bg_add(obj); +#else + bg = elm_bg_add(obj); +#endif + GL_CHECK_NULL(bg); + + int wid = 0; + int hei = 0; + + wid = (int)(GL_TILER_ICON_S * scale); + if (len == 1) + hei = wid; + else + hei = (int)(GL_TILE_2X_GRID_S * scale); + +#ifdef _USE_ROTATE_BG + _gl_rotate_bg_add_image(bg, wid, hei); +#else + elm_bg_load_size_set(bg, wid, hei); +#endif + + func(bg, data[0]); + + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bg, 0.5, 0.5); + evas_object_show(bg); + + return bg; +} + +Evas_Object *_gl_tile_show_part_icon(Evas_Object *obj, const char *part, + int length, double scale, + bg_file_set_cb func, void **data) +{ + GL_CHECK_NULL(part); + GL_CHECK_NULL(strlen(part)); + GL_CHECK_NULL(obj); + + if (!g_strcmp0(part, GT_TILE_ONLYICON)) { + Evas_Object *bg = NULL; + bg = __gl_tile_add_1_icon_bg(obj, GL_TILE_THUMB_1, scale, func, + data); + return bg; + } + return NULL; +} + +Evas_Object *_gl_tile_show_part_label(Evas_Object *obj, int index, + bool b_default) +{ + GL_CHECK_NULL(obj); + + Evas *evas = evas_object_evas_get(obj); + GL_CHECK_NULL(evas); + Evas_Object *bg = NULL; + bg = evas_object_rectangle_add(evas); + GL_CHECK_NULL(bg); + + int j = 0; + if (b_default) + j = GL_TILE_TEXT_COLOR_CNT; + else + j = index % GL_TILE_TEXT_COLOR_CNT; + evas_object_color_set(bg, bg_color[j].r, bg_color[j].g, bg_color[j].b, + GL_TILE_TEXT_COLOR_ALPHA); + + 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); + evas_object_show(bg); + return bg; +} + +Evas_Object *_gl_tile_show_part_checkbox_grid(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, + const void *data) +{ + GL_CHECK_NULL(func); + GL_CHECK_NULL(obj); + Evas_Object *ck = NULL; + + ck = elm_check_add(obj); + GL_CHECK_NULL(ck); + elm_object_style_set(ck, GL_CHECKBOX_STYLE_ALBUM_GRID); + evas_object_repeat_events_set(ck, EINA_TRUE); + elm_check_state_set(ck, checked); + evas_object_smart_callback_add(ck, "changed", func, data); + evas_object_show(ck); + return ck; +} + +Evas_Object *_gl_tile_show_part_checkbox(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, const void *data) +{ + GL_CHECK_NULL(func); + GL_CHECK_NULL(obj); + Evas_Object *ck = NULL; + + ck = elm_check_add(obj); + GL_CHECK_NULL(ck); + elm_object_style_set(ck, GL_CHECKBOX_STYLE_ALBUM); + evas_object_propagate_events_set(ck, EINA_FALSE); + elm_check_state_set(ck, checked); + evas_object_smart_callback_add(ck, "changed", func, data); + evas_object_show(ck); + return ck; +} + +Evas_Object *_gl_tile_show_part_rename(Evas_Object *obj, Evas_Smart_Cb func, + const void *data) +{ + GL_CHECK_NULL(func); + GL_CHECK_NULL(obj); + Evas_Object *btn = NULL; + btn = _gl_but_create_but(obj, NULL, NULL, GL_BUTTON_STYLE_RENAME, func, + data); + GL_CHECK_NULL(btn); + evas_object_propagate_events_set(btn, EINA_FALSE); + return btn; +} + +int _gl_tile_get_mtime(time_t *mtime1, time_t *mtime2, char *buf, int max_len) +{ + char *date1 = (char *)calloc(1, GL_DATE_INFO_LEN_MAX); + GL_CHECK_VAL(date1, -1); + char *date2 = (char *)calloc(1, GL_DATE_INFO_LEN_MAX); + if (date2 == NULL) + goto GL_TILE_ERROR; + char *date3 = (char *)calloc(1, GL_DATE_INFO_LEN_MAX); + if (date3 == NULL) + goto GL_TILE_ERROR; + + struct tm t1; + memset(&t1, 0x00, sizeof(struct tm)); + localtime_r(mtime1, &t1); + strftime(date1, GL_DATE_INFO_LEN_MAX, "%Y.%m.%d", &t1); + strftime(date3, GL_DATE_INFO_LEN_MAX, "%Y.%m", &t1); + + struct tm t2; + memset(&t2, 0x00, sizeof(struct tm)); + localtime_r(mtime2, &t2); + strftime(date2, GL_DATE_INFO_LEN_MAX, "%Y.%m.%d", &t2); + + if (!g_strcmp0(date1, date2)) { + g_strlcpy(buf, date1, max_len); + } else { + strftime(date2, GL_DATE_INFO_LEN_MAX, "%Y.%m", &t2); + snprintf(buf, max_len, "%s - %s", date2, date3); + } + + GL_FREEIF(date1); + GL_FREEIF(date2); + GL_FREEIF(date3); + return 0; + + GL_TILE_ERROR: + + GL_FREEIF(date1); + GL_FREEIF(date2); + GL_FREEIF(date3); + return -1; +} + +Evas_Object *_gl_tile_add_gengrid(void *data, Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + + Evas_Object *grid = elm_gengrid_add(parent); + elm_object_style_set(grid, GL_GENGRID_STYLE_ALBUM); + + double scale_factor = ad->maininfo.win_scale; + gl_dbg("Own scale: %f, elm_config_scale_get =%f", scale_factor, + elm_config_scale_get()); + elm_gengrid_item_size_set(grid, (int)(GL_TILE_ITEM_WIDTH * scale_factor), + (int)(GL_TILE_ITEM_HEIGHT * scale_factor)); + elm_gengrid_align_set(grid, 0.5, 0.0); + + /* Vertical scrolling. */ + elm_gengrid_horizontal_set(grid, EINA_FALSE); + elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE); + + elm_gengrid_multi_select_set(grid, EINA_TRUE); + + evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + return grid; +} + diff --git a/ug-gallery-efl.manifest b/ug-gallery-efl.manifest new file mode 100755 index 0000000..97e8c31 --- /dev/null +++ b/ug-gallery-efl.manifest @@ -0,0 +1,5 @@ + + + + + diff --git a/ug.gallery-efl.include b/ug.gallery-efl.include new file mode 100755 index 0000000..52b2eb4 --- /dev/null +++ b/ug.gallery-efl.include @@ -0,0 +1,39 @@ +# all permissions +$1 system::vconf rwxat +$1 system::home rwxat +$1 system::media rwxat +$1 system::homedir rwxat +$1 pulseaudio rwxat +$1 system::share rwxat +$1 sys-assert::core rwxat + +# system +$1 device::app_logging w + +# db +$1 media-data::db rw +$1 ail::db w +$1 org.tizen.gallery::web-media.db rw +$1 org.tizen.gallery::gallery-media.db rw + +# other apps and modules +$1 org.tizen.indicator w +$1 org.tizen.gallery rwa +$1 org.tizen.gallery-service w +$1 org.tizen.contacts rwx +$1 org.tizen.cluster-home w +$1 csc-manager x +$1 media-server rwx +$1 ug-image-viewer-efl rwx +$1 download-provider r +$1 drmfw rw + +# ug +$1 ug.image-viewer-efl include + +# object +org.tizen.cluster-home $1 rx +org.tizen.app-tray $1 rxorg.tizen.app-tray $1 rx + +org.tizen.gallery-service w +context-service $1 rx diff --git a/ug/ug-gallery-efl/CMakeLists.txt b/ug/ug-gallery-efl/CMakeLists.txt new file mode 100755 index 0000000..2bb4ccd --- /dev/null +++ b/ug/ug-gallery-efl/CMakeLists.txt @@ -0,0 +1,102 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(ug-gallery-efl C) + +SET(SRCS src/gallery-efl.c + src/ge-albums.c + src/ge-gridview.c + src/ge-button.c + src/ge-debug.c + src/ge-ui-util.c + src/ge-ext-ug-load.c + src/ge-util.c + src/ge-drm.c + src/ge-data-type.c + src/ge-local-data.c + src/ge-data.c + src/ge-exif.c + src/ge-rotate-bg.c + src/ge-thumb.c + src/ge-tile.c + src/ge-lang.c +) + +SET(GE_EDC_DIR edc) +SET(GE_IMG_DIR edc/images) + +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE "Release") +ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") +MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") + +SET(PREFIX ${CMAKE_INSTALL_PREFIX}) +SET(EXEC_PREFIX "\${prefix}") +SET(LIBDIR "\${prefix}/lib") +SET(INCLUDEDIR "\${prefix}/include") +SET(VERSION 1.0) + +ADD_DEFINITIONS("-D_USE_DLOG_") +ADD_DEFINITIONS("-D_USE_ROTATE_BG_GE") + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) + +INCLUDE(FindPkgConfig) +pkg_check_modules(pkgs REQUIRED + elementary + ecore-imf + ecore-x + eina + evas + edje + vconf + ecore + ecore-file + ecore-input + dlog + glib-2.0 + capi-appfw-application + capi-content-media-content + ui-gadget-1 + drm-client +) + +FOREACH(flag ${pkgs_CFLAGS}) + SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") +ENDFOREACH(flag) + +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fpie") +SET(CMAKE_C_FLAGS_RELEASE "-O2 -fpie") +SET(CMAKE_LDFLAGS "-Wl,-zdefs" ) + +FIND_PROGRAM(UNAME NAMES uname) +EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") +IF("${ARCH}" STREQUAL "arm") + ADD_DEFINITIONS("-DTARGET") + MESSAGE("add -DTARGET") +ENDIF("${ARCH}" STREQUAL "arm") + +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") + +ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) +SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.0.1) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lstdc++ ) + +# EDJE +ADD_CUSTOM_COMMAND(OUTPUT gallery-efl.edj + COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/${GE_IMG_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/res/${GE_EDC_DIR}/gallery-efl.edc + ${CMAKE_BINARY_DIR}/gallery-efl.edj + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/${GE_EDC_DIR}/gallery-efl.edc +) + +ADD_CUSTOM_TARGET(gallery_efl_edj_build DEPENDS gallery-efl.edj) +ADD_DEPENDENCIES(${PROJECT_NAME} gallery_efl_edj_build) + +INSTALL(FILES ${CMAKE_BINARY_DIR}/gallery-efl.edj DESTINATION /usr/ug/res/edje/gallery-efl) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images DESTINATION /usr/ug/res/images/gallery-efl) +INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/ug/lib) + +INSTALL(FILES ${PROJECT_NAME}.xml DESTINATION /usr/share/packages) + diff --git a/ug/ug-gallery-efl/include/gallery-efl.h b/ug/ug-gallery-efl/include/gallery-efl.h new file mode 100755 index 0000000..12690ee --- /dev/null +++ b/ug/ug-gallery-efl/include/gallery-efl.h @@ -0,0 +1,259 @@ +/* + * Copyright (c) 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 __GALLERY_EFL_H__ +#define __GALLERY_EFL_H__ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ge-data-type.h" + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +#define GE_UG_RES_DIR "/usr/ug/res/" +#define GE_IMAGES_DIR GE_UG_RES_DIR"images/gallery-efl/images/" +#define GE_EDJ_DIR GE_UG_RES_DIR"edje/gallery-efl/" +#define GE_EDJ_FILE GE_EDJ_DIR"gallery-efl.edj" + +#define GE_GRP_GRIDVIEW "gallery_efl/gridview" +#define GE_GRP_ALBUMVIEW "gallery_efl/albumview" + +#define GE_CHECKBOX_STYLE_GRID "gallery_efl/grid" + +#define GE_ROOT_PATH_PHONE "/opt/usr/media" +#define GE_ROOT_PATH_MMC "/opt/storage/sdcard" + +#define GE_ALBUM_ALL_ID "GALLERY_ALBUM_ALL_ALBUMS_ID" +/* String length of mtye item id */ +#define GE_MTYPE_ITEN_ID_LEN_MAX 37 + +#define GE_GRID_ITEM_SIZE_W 178 +#define GE_GRID_ITEM_SIZE_H 182 + +#define GE_GRID_ITEM_ZOOM_LEVEL_02 2 +#define GE_GRID_ITEM_ZOOM_LEVEL_02_CNT 6 + +#define GE_ALBUM_COVER_THUMB_NUM 1 +#define GE_ALBUM_COVER_THUMB_NUM_SEC 4 /* Other albums cover have maximum 4 thumbnails */ +#define GE_ALBUM_ITEM_WIDTH 358 +#define GE_ALBUM_ITEM_HEIGHT 360 + +#define GE_SELINFO_TEXT_LEN_MAX 64 +#define GE_ALBUM_DATE_LEN_MAX 256 +#define GE_MAX_BYTES_FOR_CHAR 3 +#define GE_ALBUM_NAME_LEN_MAX (255 * GE_MAX_BYTES_FOR_CHAR + 1) +#define GE_NOCONTENTS_LABEL_LEN_MAX 512 +#define GE_FILE_PATH_LEN_MAX (4095 * GE_MAX_BYTES_FOR_CHAR + 1) + +#define GE_FIRST_VIEW_START_POS 0 +#define GE_FIRST_VIEW_END_POS 47 +#define GE_GET_UNTIL_LAST_RECORD 65536 /* Fixme: Do not use 65536. */ +#define GE_GET_ALL_RECORDS -1 + +#define GE_BUNDLE_LAUNCH_TYPE "launch-type" +#define GE_BUNDLE_FILE_TYPE "file-type" +#define GE_BUNDLE_DRM_TYPE "drm-type" +#define GE_BUNDLE_SETAS_TYPE "setas-type" +#define GE_BUNDLE_CALLERID_SIZE "callerid-size" +#define GE_BUNDLE_CALLERID_PATH "callerid-path" +#define GE_BUNDLE_HOMESCREEN_PATH "homescreen-path" +#define GE_BUNDLE_LOCKSCREEN_PATH "lockscreen-path" +#define GE_LAUNCH_SELECT_ALBUM "select-album" +#define GE_ALBUM_SELECT_RETURN_PATH "folder-path" +#define GE_LAUNCH_SELECT_ONE "select-one" +#define GE_LAUNCH_SELECT_MULTIPLE "select-multiple" +#define GE_LAUNCH_SELECT_SETAS "select-setas" + +#define GE_FILE_TYPE_IMAGE "image" +#define GE_FILE_TYPE_VIDEO "video" +#define GE_FILE_TYPE_ALL "all" +#define GE_FILE_TYPE_DRM_TRUE "true" + +#define GE_SETAS_WALLPAPER "wallpaper" +#define GE_SETAS_CROP_WALLPAPER "crop-wallpaper" +#define GE_SETAS_CALLERID "callerid" + +#define GE_FILE_SELECT_RETURN_COUNT "count" +#define GE_FILE_SELECT_RETURN_PATH "path" + +#define GE_FILE_SELECT_RETURN_QUIT "ug-quit" +#define GE_FILE_SELECT_QUIT_STATE "normal" + +#define GE_SETAS_CALLERID_CROP_IMAGE_PATH "crop-image-path" +#define GE_SETAS_IMAGE_PATH "image-path" + +/*Image viewer UG service parameters*/ +#define GE_IMAGEVIEWER_CALLERID_SIZE "Area size" +#define GE_IMAGEVIEWER_CALLERID_PATH "CallerID path" + +#define GE_IMAGEVIEWER_CROP_IMAGE_PATH "crop_image_path" +#define GE_IMAGEVIEWER_IMAGE_PATH "image_path" + +#define GE_IMAGEVIEWER_HOMESCREEN_PATH "Wallpaper path" +#define GE_IMAGEVIEWER_LOCKSCREEN_PATH "Lockscreen path" +#define GE_IMAGEVIEWER_RETURN_ERROR "Error" +/*Image viewer UG service parameters-End*/ + +#define GE_BUNDLE_SELECTION_MODE "http://tizen.org/appcontrol/data/selection_mode" +#define GE_BUNDLE_SELECTION_MODE_SINGLE "single" +#define GE_BUNDLE_SELECTION_MODE_MULTI "multiple" + +typedef enum { + GE_ALBUM_SELECT_T_NONE, + GE_ALBUM_SELECT_T_ONE, +} ge_album_select_e; + +typedef enum { + GE_FILE_SELECT_T_NONE, + GE_FILE_SELECT_T_ONE, + GE_FILE_SELECT_T_MULTIPLE, + GE_FILE_SELECT_T_SETAS, +} ge_file_select_e; + +typedef enum { + GE_SETAS_T_NONE, + GE_SETAS_T_WALLPAPER, + GE_SETAS_T_CROP_WALLPAPER, + GE_SETAS_T_CALLERID, +} ge_file_select_setas_e; + +typedef enum { + GE_FILE_T_NONE, + GE_FILE_T_IMAGE, + GE_FILE_T_VIDEO, + GE_FILE_T_ALL, +} ge_file_type_e; + +typedef enum view_by_mode_e { + GE_VIEW_ALBUMS, + GE_VIEW_THUMBS, + GE_VIEW_THUMBS_EDIT, +} ge_view_mode; + +typedef enum { + GE_ROTATE_NONE, + GE_ROTATE_PORTRAIT, + GE_ROTATE_PORTRAIT_UPSIDEDOWN, + GE_ROTATE_LANDSCAPE, + GE_ROTATE_LANDSCAPE_UPSIDEDOWN, +} ge_rotate_mode; + +typedef enum { + GE_UPDATE_NONE, + GE_UPDATE_NORMAL, + GE_UPDATE_MMC_REMOVED, + GE_UPDATE_MMC_ADDED, +} ge_update_mode; + +typedef struct _ge_ugdata ge_ugdata; + +typedef struct { + ge_album_s *cluster; + ge_ugdata *ugd; + int index; + + time_t item_mtime; + Elm_Object_Item *griditem; + void *_reserved; +}ge_cluster; + +typedef struct { + Eina_List* clist; +}ge_cluster_list; + +typedef struct _ge_item { + ge_media_s* item; + ge_ugdata* ugd; + Elm_Object_Item *elm_item; + Evas_Object* check_obj; + bool checked; + + void* _reserved; +}ge_item; + +struct _ge_ugdata { + Evas_Object *win; + double win_scale; + Evas_Object *ly_main; + Evas_Object *bg; + Elm_Theme *th; + /* add more variables here */ + Evas_Object *navi_bar; + Evas_Object *albums_view; + Evas_Object *albums_view_ly; + Evas_Object *thumbs_view; + Evas_Object *thumbs_view_ly; + Elm_Object_Item *thumbs_nf_it; + Elm_Object_Item *albums_nf_it; + Evas_Object *thumbs_nocontents; + Ecore_Idler* grid_append_idler; + Evas_Object *nocontents; + Ecore_Event_Handler* event_handler; + Evas_Object *popup; + Ecore_Timer *del_timer; + int popup_mode; + + ge_cluster_list* cluster_list; + ui_gadget_h ug_called_by_me; + ui_gadget_h ug; + service_h service; /*added for "ug_send_result"*/ + /* It's thumbnails icon size, not grid item size */ + int icon_size; + Ecore_Timer *thumbs_clicked_timer; + + int album_select_mode; + int file_select_mode; + int file_type_mode; + int file_select_setas_mode; + bool b_show_drm; + char* file_setas_callid_size; + char* file_setas_callid_path; + char* file_setas_image_path; + char* file_setas_crop_image_path; + char albums_view_title[GE_ALBUM_NAME_LEN_MAX]; + char* file_setas_homescreen_path; + char* file_setas_lockscreen_path; + + Evas_Object *selinfo_ly; + + bool b_inited_view; /* true: show albums view; false: show popup */ +}; + +#define GE_IF_DEL_TIMER(timer) if(timer){ecore_timer_del(timer); timer = NULL;} +#define GE_IF_DEL_IDLER(idler) if(idler){ecore_idler_del(idler); idler = NULL;} +#define GE_IF_DEL_OBJ(obj) if(obj){evas_object_del(obj); obj = NULL;} + +ge_view_mode _ge_get_view_mode(void); +void _ge_set_view_mode(ge_view_mode mode); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + + +#endif /* __GALLERY_EFL_H__ */ + diff --git a/ug/ug-gallery-efl/include/ge-albums.h b/ug/ug-gallery-efl/include/ge-albums.h new file mode 100755 index 0000000..c7fd48e --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-albums.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 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 _GE_ALBUMS_H_ +#define _GE_ALBUMS_H_ + +#include "gallery-efl.h" + +Evas_Object* ge_albums_create_view(ge_ugdata *ugd, Evas_Object* parent); +int ge_albums_sel_album(ge_cluster* album_item); +int ge_albums_update_view(ge_ugdata *ugd); +Evas_Object* ge_albums_create_ly(Evas_Object* parent); +int ge_albums_back_to_view(ge_ugdata *ugd); +int ge_albums_del_callbacks(ge_ugdata *ugd); +int ge_albums_free_cover_thumbs(ge_ugdata *ugd); + +#endif /* _GE_ALBUMS_H_ */ + diff --git a/ug/ug-gallery-efl/include/ge-button.h b/ug/ug-gallery-efl/include/ge-button.h new file mode 100755 index 0000000..ce29570 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-button.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 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 _GE_BUTTON_H_ +#define _GE_BUTTON_H_ + +#include "gallery-efl.h" + +/**< Evas smart objects' "smart callback" function signature */ +typedef void (*But_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); + +Evas_Object *_ge_but_create_but(Evas_Object *parent, Elm_Theme *theme, + const char *icon, const char *text, + const char *style, But_Smart_Cb cb_func, + const void *data); + +#endif /* _GE_BUTTON_H_ */ + diff --git a/ug/ug-gallery-efl/include/ge-data-type.h b/ug/ug-gallery-efl/include/ge-data-type.h new file mode 100755 index 0000000..cb6ea8a --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-data-type.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) 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 _GE_TYPE_H_ +#define _GE_TYPE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define GE_FREEIF(ptr) \ + do { \ + if(ptr != NULL) \ + { \ + free(ptr); \ + ptr = NULL; \ + } \ + } while (0) + +#define GE_FREE(ptr) \ + do { \ + free(ptr); \ + ptr = NULL; \ + } while (0) + +#define GE_TYPE_ALBUM (0x55551) +#define GE_TYPE_MEDIA (0x55553) + +typedef enum +{ + GE_PHONE, /**< Stored only in phone */ + GE_MMC, /**< Stored only in MMC */ + GE_SYSTEM, /**< Stored in ALL*/ +} _ge_store_type_t; + + +typedef struct _ge_album_t ge_album_s; +typedef struct _ge_media_t ge_media_s; +typedef struct _ge_image_t ge_image_s; +typedef struct _ge_video_t ge_video_s; + +struct _ge_album_t { + int gtype; /*self-defination type, when free this struct space, use it*/ + media_folder_h folder_h; /*the handle of operating this folder*/ + char *uuid; /*folder UUID*/ + char *display_name; /*album name*/ + char *path; /*the full path of this folder*/ + int type; /*storage type*/ + time_t mtime; /*modified time*/ + int count; /*the media count in this folder*/ + char *thumb_url; /**< thumbnail full path */ + + void *_reserved; /*reserved*/ +}; + +struct _ge_media_t { + int gtype; /*self-defination type, when free this struct space, use it*/ + media_info_h media_h; /*the handle of operating this media*/ + char *uuid; /*meida id*/ + int type; /*meida type, image or video*/ + char *thumb_url; /*the thumbnail full path of this meida file*/ + char *file_url; /*the full path of this meida file*/ + time_t mtime; /*modified time*/ + char *album_uuid; /*folder UUID*/ + char *display_name; /*item name*/ + bool favorite; /*favorite level*/ + union { + ge_image_s *image_info; /*image information*/ + ge_video_s *video_info; /*video information*/ + }; + void *_reserved; /*reserved*/ +}; + +struct _ge_image_t { + char *media_uuid; /*media uuid*/ + image_meta_h image_h; /*the handle of operating this image*/ + media_content_orientation_e orientation; /*the orientation of this image*/ + void *_reserved; /*reserved*/ +}; + +struct _ge_video_t { + char *media_uuid; /*media uuid*/ + video_meta_h video_h; /*the handle of operating this video*/ + char *title; /*the title of video*/ + time_t last_played_pos; /*the last played position*/ + int duration; /*the duration of this video*/ + int bookmarks; /*whether exist bookmarks*/ + void *_reserved; /*reserved*/ +}; + +int _ge_data_type_new_media(ge_media_s **item); +int _ge_data_type_new_album(ge_album_s **album); + +int _ge_data_type_free_media_list(Eina_List **list); +int _ge_data_type_free_album_list(Eina_List **list); +int _ge_data_type_free_geitem(void **item); + +#endif + diff --git a/ug/ug-gallery-efl/include/ge-data.h b/ug/ug-gallery-efl/include/ge-data.h new file mode 100755 index 0000000..b188310 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-data.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 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 _GE_DB_HANDLER_H_ +#define _GE_DB_HANDLER_H_ + +#include "ge-local-data.h" +#include "gallery-efl.h" + +#ifdef _cplusplus +extern "C" { +#endif + +typedef enum { + GE_SORT_BY_NONE, /**< No Sort */ + GE_SORT_BY_NAME_DESC, /**< Sort by display name descending */ + GE_SORT_BY_NAME_ASC, /**< Sort by display name ascending */ + GE_SORT_BY_DATE_DESC, /**< Sort by modified_date descending */ + GE_SORT_BY_DATE_ASC, /**< Sort by modified_date ascending */ +} ge_sort_type_e; + +int _ge_data_update_items_cnt(ge_ugdata* ugd, ge_cluster *album); +int _ge_data_get_clusters_list(ge_ugdata* ugd); +int _ge_data_free_items_list(void); +int _ge_data_get_items_list(ge_ugdata* ugd, ge_cluster *album, int start_pos, + int end_pos); +int _ge_data_update_items_list(ge_ugdata* ugd, ge_cluster *album); +int _ge_data_get_first_several_items(ge_ugdata* ugd, ge_cluster *album, + ge_item* items[], int *item_count, + media_content_order_e sort_type); +int _ge_data_del_media_id(ge_ugdata* ugd, const char *media_id); +int _ge_data_item_list_remove(ge_item* gitem); +int _ge_data_destroy_item(ge_item* gitem); +int _ge_data_get_item_by_index(ge_item** gitem, int idx); +int _ge_data_get_count_all(void); +int _ge_data_get_selected_item_by_index(ge_item** gitem, int idx); +int _ge_data_selected_list_count(void); +Eina_List* _ge_data_get_selected_list(void); +int _ge_data_selected_list_append(ge_item* gitem); +int _ge_data_selected_list_remove(ge_item* gitem); +int _ge_data_selected_list_finalize(void); +bool _ge_data_is_default_album(const char *match_folder, ge_album_s *mcluster); +bool _ge_data_is_root_path(const char *path); +int _ge_data_create_thumb(ge_item *gitem, media_thumbnail_completed_cb callback, + void *user_data); +int _ge_data_init(ge_ugdata* ugd); +int _ge_data_finalize(ge_ugdata* ugd); + +#ifdef _cplusplus +} +#endif +#endif /* _GE_DB_HANDLER_H_ */ + diff --git a/ug/ug-gallery-efl/include/ge-debug.h b/ug/ug-gallery-efl/include/ge-debug.h new file mode 100755 index 0000000..7e21335 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-debug.h @@ -0,0 +1,126 @@ +/* + * Copyright (c) 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 _GL_DEBUG_H_ +#define _GL_DEBUG_H_ + +#include + +#ifdef _cplusplus +extern "C" { +#endif + +#ifdef LOG_TAG +#undef LOG_TAG +#endif + +#define LOG_TAG "GALLERY-EFL" + +typedef enum { + DEBUG_CRITICAL, + DEBUG_CHECK, + MB_DEBUG_LOG, + DEBUG_MAX +} GlDebugType; + +/* anci c color type */ +#define FONT_COLOR_RESET "\033[0m" +#define FONT_COLOR_RED "\033[31m" +#define FONT_COLOR_GREEN "\033[32m" +#define FONT_COLOR_YELLOW "\033[33m" +#define FONT_COLOR_BLUE "\033[34m" +#define FONT_COLOR_PURPLE "\033[35m" +#define FONT_COLOR_CYAN "\033[36m" +#define FONT_COLOR_GRAY "\033[37m" + +#ifdef _USE_LOG_FILE_ +FILE* g_log_fp; +#endif // _USE_LOG_FILE_ + +#ifdef _USE_LOG_FILE_ + +#define ge_dbg(fmt,arg...) fprintf(g_log_fp, "[%s: %d]" fmt "\n", __FUNCTION__, __LINE__, ##arg) + +#elif defined _USE_DLOG_ + +#define ge_dbg(fmt, arg...) LOGD("[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg) +#define ge_dbgW(fmt, arg...) LOGW(FONT_COLOR_GREEN"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg) +#define ge_dbgE(fmt, arg...) LOGE(FONT_COLOR_RED"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg) + +#elif defined _USE_LOG_CONSOLE_ + +#define ge_dbg(fmt,arg...) fprintf(stdout, "[%s: %d] [%s]" fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg) +#define ge_dbgW(fmt, arg...) fprintf(stdout, "[%s : %d] [%s] " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg) +#define ge_dbgE(fmt, arg...) fprintf(stdout, "[%s : %d] [%s] " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg) + +#else + +#define ge_dbg(fmt,arg...) +#define ge_dbgW(fmt, arg...) +#define ge_dbgE(fmt, arg...) +#endif + +#define ge_warn_if(expr, fmt, arg...) do { \ + if(expr) { \ + ge_dbg("(%s) -> "fmt, #expr, ##arg); \ + } \ + } while (0) +#define ge_ret_if(expr) do { \ + if(expr) { \ + ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \ + return; \ + } \ + } while (0) +#define ge_retv_if(expr, val) do { \ + if(expr) { \ + ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \ + return (val); \ + } \ + } while (0) +#define ge_retm_if(expr, fmt, arg...) do { \ + if(expr) { \ + ge_dbgE(fmt, ##arg); \ + ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \ + return; \ + } \ + } while (0) +#define ge_retvm_if(expr, val, fmt, arg...) do { \ + if(expr) { \ + ge_dbgE(fmt, ##arg); \ + ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \ + return (val); \ + } \ + } while (0) + + +#define GE_CHECK_VAL(expr, val) ge_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!") +#define GE_CHECK_NULL(expr) ge_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!") +#define GE_CHECK_FALSE(expr) ge_retvm_if(!(expr), false, "Invalid parameter, return FALSE!") +#define GE_CHECK_CANCEL(expr) ge_retvm_if(!(expr), ECORE_CALLBACK_CANCEL, "Invalid parameter, return ECORE_CALLBACK_CANCEL!") +#define GE_CHECK(expr) ge_retm_if(!(expr), "Invalid parameter, return!") + + +#include +#include + +void _ge_print_debug_time_ex(long start, long end, const char* func_name, char* time_string); + +#ifdef _cplusplus +} +#endif + +#endif /* _GL_DEBUG_H_ */ + diff --git a/ug/ug-gallery-efl/include/ge-drm.h b/ug/ug-gallery-efl/include/ge-drm.h new file mode 100755 index 0000000..ddf2251 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-drm.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 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 _GE_DRM_H_ +#define _GE_DRM_H_ + +#include +#include + +Eina_Bool ge_drm_check_valid_ro(const char *file_path, + drm_permission_type_e permType); +char* ge_drm_get_file_path(void *item); +Eina_Bool ge_drm_is_drm_file(const char* file_path); +int ge_drm_get_permtype(int gitem_type); + +#endif /* _GE_DRM_H_ */ + diff --git a/ug/ug-gallery-efl/include/ge-exif.h b/ug/ug-gallery-efl/include/ge-exif.h new file mode 100755 index 0000000..6a8dd57 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-exif.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 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. + */ + +#ifdef _USE_ROTATE_BG_GE + +#ifndef _GE_EXIF_H_ +#define _GE_EXIF_H_ + +#include +#include + +#ifdef _cplusplus +extern "C" +{ +#endif + +/* +Orientation - angle +1 - 0 +3 - 180 +6 - 90 +8 - 270 +*/ +typedef enum _GE_orientation_rot_t ge_orientation_rot_e; + +enum _GE_orientation_rot_t { + GE_ORIENTATION_ROT_ERR = 0, + GE_ORIENTATION_ROT_0 = 1, + GE_ORIENTATION_ROT_180 = 3, + GE_ORIENTATION_ROT_90 = 6, + GE_ORIENTATION_ROT_270 = 8, +}; + +int _ge_exif_get_orientation(char *file_path, unsigned int *orientation); + +#ifdef _cplusplus +} +#endif + +#endif /* _GE_EXIF_H_ */ + +#endif + diff --git a/ug/ug-gallery-efl/include/ge-ext-ug-load.h b/ug/ug-gallery-efl/include/ge-ext-ug-load.h new file mode 100755 index 0000000..0b86088 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-ext-ug-load.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 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 _GE_EXT_UG_LOAD_H_ +#define _GE_EXT_UG_LOAD_H_ + +#include +#include "gallery-efl.h" + + +int ge_ext_load_pw_ug(ge_ugdata *ugd, ge_cluster* album_item); +int ge_ext_load_iv_ug(ge_ugdata* ugd); + +#endif /* _GE_EXT_UG_LOAD_H_ */ + diff --git a/ug/ug-gallery-efl/include/ge-gridview.h b/ug/ug-gallery-efl/include/ge-gridview.h new file mode 100755 index 0000000..187bf77 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-gridview.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 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 _GE_GRIDVIEW_H_ +#define _GE_GRIDVIEW_H_ + +#include "gallery-efl.h" + +Evas_Object* ge_grid_create_ly(Evas_Object* parent); +Evas_Object* ge_grid_create_view(ge_ugdata* ugd, Evas_Object* parent); +int ge_grid_clear_view(ge_ugdata *ugd); +int ge_grid_update_view(ge_ugdata *ugd); +int ge_grid_del_callbacks(ge_ugdata *ugd); +int ge_grid_idler_append_thumbs(void* data); + +#endif /* _GE_GRIDVIEW_H_ */ diff --git a/ug/ug-gallery-efl/include/ge-icon.h b/ug/ug-gallery-efl/include/ge-icon.h new file mode 100755 index 0000000..38c6c66 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-icon.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 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 __GE_ICON_H__ +#define __GE_ICON_H__ + +#include "gallery-efl.h" + +#define GE_THUMB_FAVOR_ICON GE_IMAGES_DIR"T01_icon_thumbnail_favorite.png" + +#define GE_LOCK_ICON GE_IMAGES_DIR"T01_icon_lock.png" +#define GE_THUMB_BOOKMARK GE_IMAGES_DIR"T01_icon_thumbnail_bookmark.png" +#define GE_DEFAULT_THUMB_ICON GE_IMAGES_DIR"T01_Nocontents_broken.png" +#define GE_CBAR_ICON_DONE GE_IMAGES_DIR"T01_controlbar_icon_done.png" +#define GE_DB_DEFAULT_THUMB "/opt/usr/data/file-manager-service/.thumb/thumb_default.png" + +#endif + diff --git a/ug/ug-gallery-efl/include/ge-lang.h b/ug/ug-gallery-efl/include/ge-lang.h new file mode 100755 index 0000000..c8c0599 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-lang.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 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 _GE_LANG_H_ +#define _GE_LANG_H_ + +#include "gallery-efl.h" + +#ifdef _cplusplus +extern "C" +{ +#endif + +int _ge_lang_update(ge_ugdata *ugd); + +#ifdef _cplusplus +} +#endif + + +#endif + diff --git a/ug/ug-gallery-efl/include/ge-local-data.h b/ug/ug-gallery-efl/include/ge-local-data.h new file mode 100755 index 0000000..ba08259 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-local-data.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 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 _GE_LOCAL_DATA_H_ +#define _GE_LOCAL_DATA_H_ + +#include "ge-data-type.h" + +/*MEDIA_TYPE 0-image, 1-video, 2-sound, 3-music*/ +#define GE_CONDITION_IMAGE_VIDEO "(MEDIA_TYPE=0 OR MEDIA_TYPE=1)" +#define GE_CONDITION_IMAGE "(MEDIA_TYPE=0)" +#define GE_CONDITION_VIDEO "(MEDIA_TYPE=1)" +/**< 0-not favourite, 1-favourite*/ +#define GE_CONDITION_FAV_IMAGE_VIDEO "((MEDIA_TYPE=0 OR MEDIA_TYPE=1) AND MEDIA_FAVORITE=1)" + +#define GE_CONDITION_DRM " AND "MEDIA_IS_DRM"=0" + +#define CONDITION_LENGTH 200 +#define KEYWORD_LENGTH 20 + +typedef struct _ge_filter_t ge_filter_s; + +struct _ge_filter_t { + char cond[CONDITION_LENGTH]; /*set media type or favorite type, or other query statement*/ + media_content_collation_e collate_type; /*collate type*/ + media_content_order_e sort_type; /*sort type*/ + char sort_keyword[KEYWORD_LENGTH]; /*sort keyword*/ + int offset; /*offset*/ + int count; /*count*/ + bool with_meta; /*whether get image or video info*/ +}; + +int _ge_local_data_connect(void); +int _ge_local_data_disconnect(void); +int _ge_local_data_get_album_list(ge_filter_s *condition, Eina_List **elilst); +int _ge_local_data_get_media_count(const char *cluster_id, ge_filter_s *filter, + int *item_cnt); +int _ge_local_data_get_all_media_count(ge_filter_s *filter, int *item_cnt); +int _ge_local_data_get_media(const char *media_id, ge_media_s **mitem); +int _ge_local_data_get_album_media_list(char *album_id, ge_filter_s *condition, + Eina_List **elist); +int _ge_local_data_get_all_albums_media_list(ge_filter_s *condition, + Eina_List **elist); + +#endif + diff --git a/ug/ug-gallery-efl/include/ge-rotate-bg.h b/ug/ug-gallery-efl/include/ge-rotate-bg.h new file mode 100755 index 0000000..9f7e2af --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-rotate-bg.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 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. + */ + +#ifdef _USE_ROTATE_BG_GE + +#ifndef _GE_ROTATE_BG_H_ +#define _GE_ROTATE_BG_H_ + +#include "gallery-efl.h" + +Evas_Object *_ge_rotate_bg_add(Evas_Object *parent); +int _ge_rotate_bg_set_file(Evas_Object *bg, const char *file, int w, int h); +int _ge_rotate_bg_rotate_image(Evas_Object *bg, unsigned int orient); +int _ge_rotate_bg_add_image(Evas_Object *bg, int w, int h); +int _ge_rotate_bg_set_image_file(Evas_Object *bg, const char *file); + +#endif + +#endif diff --git a/ug/ug-gallery-efl/include/ge-strings.h b/ug/ug-gallery-efl/include/ge-strings.h new file mode 100755 index 0000000..a271372 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-strings.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 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 _GE_STRINGS_H_ +#define _GE_STRINGS_H_ + +#ifdef _cplusplus +extern "C" { +#endif + +#define _GE_GETSYSTEMSTR(ID) dgettext("sys_string", (ID)) +#define _GE_GETLOCALSTR(ID) dgettext("ug-gallery-efl", (ID)) +/* hard code strings */ +#define GE_ALBUM_CAMERA_NAME _("Camera") +#define GE_ALBUM_DOWNLOAD_NAME _("Downloads") +#define GE_TITLE_CHANGE_CALLER_ID _("Change caller ID") +#define GE_POPUP_ONLY_SUPPORT_IMAGE _("Only image is supported!") + +#define GE_STR_CAMERA _GE_GETSYSTEMSTR("IDS_COM_BODY_CAMERA") +#define GE_STR_DOWNLOADS _GE_GETSYSTEMSTR("IDS_COM_BODY_DOWNLOADS") + +#define GE_ALBUM_ALL_NAME _GE_GETLOCALSTR("IDS_MEDIABR_BODY_ALL_ALBUMS") +#define GE_LABEL_NO_ALBUMS _GE_GETLOCALSTR("IDS_MEDIABR_BODY_NO_ALBUMS") +#define GE_ALBUM_ROOT_NAME _GE_GETLOCALSTR("IDS_MEDIABR_POP_NO_NAME") + +/* system strings which are included in sys-string-0 po files */ +#define GE_TITLE_ADD _GE_GETSYSTEMSTR("IDS_COM_SK_ADD") +#define GE_TITLE_ALBUMS _GE_GETSYSTEMSTR("IDS_COM_BODY_ALBUMS") +#define GE_TITLE_IMAGE _GE_GETSYSTEMSTR("IDS_COM_OPT_IMAGE") +#define GE_TITLE_FILE _GE_GETSYSTEMSTR("IDS_COM_POP_FILE") +#define GE_TITLE_IMAGES _GE_GETSYSTEMSTR("IDS_COM_BODY_IMAGES") +#define GE_TITLE_VIDEOS _GE_GETSYSTEMSTR("IDS_COM_BODY_VIDEOS") +#define GE_TITLE_FILES _GE_GETSYSTEMSTR("IDS_COM_OPT_FILES") +#define GE_TITLE_CHANGE_WALLPAPER _GE_GETSYSTEMSTR("IDS_COM_HEADER_CHANGE_WALLPAPER") +#define GE_TITLE_VIDEO _GE_GETSYSTEMSTR("IDS_COM_BODY_VIDEO") +#define GE_LABEL_NO_VIDEOS _GE_GETSYSTEMSTR("IDS_COM_BODY_NO_VIDEOS") +#define GE_SELINFO_SELECTED _GE_GETSYSTEMSTR("IDS_COM_POP_SELECTED") +#define GE_POPUP_NO_FILES_SELECTED _GE_GETSYSTEMSTR("IDS_COM_POP_NO_FILES_SELECTED") +#define GE_STR_OK _GE_GETSYSTEMSTR("IDS_COM_SK_OK") +#define GE_STR_CANCEL _GE_GETSYSTEMSTR("IDS_COM_SK_CANCEL") +#define GE_STR_DONE _GE_GETSYSTEMSTR("IDS_COM_SK_DONE") + +#ifdef _cplusplus +} +#endif +#endif diff --git a/ug/ug-gallery-efl/include/ge-thumb.h b/ug/ug-gallery-efl/include/ge-thumb.h new file mode 100755 index 0000000..e13fcab --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-thumb.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 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 _GE_THUMB_H_ +#define _GE_THUMB_H_ + +Evas_Object *_ge_thumb_show_part_icon_image(Evas_Object *obj, char *path, + unsigned int orient, bool b_favor, + bool is_expired_drm, int item_size); + +Evas_Object *_ge_thumb_show_part_icon_video(Evas_Object *obj, char *path, + unsigned int v_dur, int bk_len, + bool b_favor, bool is_expired_drm, + int item_size); +#endif + diff --git a/ug/ug-gallery-efl/include/ge-tile.h b/ug/ug-gallery-efl/include/ge-tile.h new file mode 100755 index 0000000..7e4717c --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-tile.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 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 _GE_TILE_H_ +#define _GE_TILE_H_ + +#include "ge-data.h" + +#define GE_TILE_THUMB_1 1 + +#define GT_TILE_ONLYICON "elm.swallow.onlyicon" +#define GT_TILE_ICON "elm.swallow.icon" +#define GT_TILE_LABEL "label_bg" + +/* Size of album icon */ +#define GE_TILE_SIZE 318 +/* Size of table padding */ +#define GE_TILE_PAD 3 +/* Pure size of album icon; value: 196 */ +#define GE_TILER_ICON_S (GE_TILE_SIZE - 2 * GE_TILE_PAD) +/** +* Album icon is set by elm_table, +* it's divided into 3x3, 9 grids, each grid size is 64 +*/ +#define GE_TILE_GRID_S 102 +/* value: 130 */ +#define GE_TILE_2X_GRID_S (GE_TILER_ICON_S - GE_TILE_GRID_S - GE_TILE_PAD) + +typedef enum +{ + GE_ICON_NORMAL, + GE_ICON_EXPIRED_DRM, + GE_ICON_CORRUPTED_FILE +}ge_icon_type; + +typedef ge_icon_type (*bg_file_set_cb)(Evas_Object *bg, void *data); + +Evas_Object *_ge_tile_show_part_icon(Evas_Object *obj, const char *part, + int length, double scale, + bg_file_set_cb func, void **data); +Evas_Object *_ge_tile_show_part_label(Evas_Object *obj, int index, + bool b_default); + +#endif + diff --git a/ug/ug-gallery-efl/include/ge-ui-util.h b/ug/ug-gallery-efl/include/ge-ui-util.h new file mode 100755 index 0000000..59588e1 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-ui-util.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 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 _GE_UI_UTIL_H_ +#define _GE_UI_UTIL_H_ + +#include "gallery-efl.h" +#include "ge-icon.h" + +#ifdef _cplusplus +extern "C" { +#endif + +#define _EDJ(o) elm_layout_edje_get(o) + +#define _GE_GET_ICON(_path) \ + ((1 == ecore_file_exists(_path) && (ecore_file_size(_path) > 0)) ? _path : GE_DEFAULT_THUMB_ICON) + +typedef enum { + GE_NAVI_ALBUMS, + GE_NAVI_THUMBS, +} ge_navi_mode_e; + +typedef enum { + GE_POPUP_NOBUT, + GE_POPUP_ONEBUT, + GE_POPUP_TWOBUT, + GE_POPUP_EXIT, +} ge_popup_mode_e; + +int ge_ui_cancel_album_lock(ge_ugdata *ugd); +int ge_ui_set_album_lock(ge_cluster* album); +Evas_Object* ge_ui_create_navibar(ge_ugdata* ugd, Evas_Object* parent); +Evas_Object* ge_ui_create_main_ly(ge_ugdata* ugd, Evas_Object* parent); +int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, + Evas_Object* obj, ge_navi_mode_e mode, + char* title); +void ge_ui_set_rotate_angle(int rotate_mode); +Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *group); +Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd); +int ge_ui_lock_albums(ge_cluster* album_item); +Evas_Object* ge_ui_create_popup(ge_ugdata* ugd, ge_popup_mode_e mode, + char* desc); +int _ge_ui_create_selinfo(ge_ugdata *ugd, Evas_Object *parent); +int ge_ui_destroy_selinfo(ge_ugdata* ugd); +char* _ge_ui_get_translated_album_name(ge_cluster *album); + +#ifdef _cplusplus +} +#endif + +#endif // end of _GE_UI_UTIL_H_ diff --git a/ug/ug-gallery-efl/include/ge-util.h b/ug/ug-gallery-efl/include/ge-util.h new file mode 100755 index 0000000..122ac47 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-util.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 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 _GE_UTIL_H_ +#define _GE_UTIL_H_ + +#include "gallery-efl.h" + +#define GE_FILE_EXISTS(path) \ + (path && (1 == ecore_file_exists(path)) && (ecore_file_size(path) > 0)) + +ge_item* _ge_get_current_item(void); +void _ge_set_current_item(ge_item* gitem); +int ge_reg_db_update_noti(ge_ugdata* ugd); +int ge_dereg_db_update_noti(void); +Eina_Bool ge_update_view(ge_ugdata* ugd, int mode); +int _ge_ug_iv_get(void); +void _ge_ug_iv_set(int ug_iv_state); +ge_cluster* _ge_get_current_album(void); +void _ge_set_current_album(ge_cluster* album_item); +bool _ge_is_image_valid(void *data, char *filepath); +char *_ge_get_duration_string(unsigned int v_dur); +#endif /* _GE_EXT_EXEC_H_ */ + diff --git a/ug/ug-gallery-efl/res/edc/gallery-efl-check.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-check.edc new file mode 100755 index 0000000..88ca679 --- /dev/null +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-check.edc @@ -0,0 +1,381 @@ +/* + * Copyright (c) 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 CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 42 42 + +#define CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC 255 255 255 255 +#define CHECK_DEFAULT_TEXT_PRESSED_COLOR_INC 255 255 255 255 +#define CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC 136 136 136 136 + +//////////////////////////////////////////////////////////////////////////////////////// +// +// check default textblock style +// +/////////////////////////////////////////////////////////////////////////////////////// + styles { + style { name: "check_label_textblock_style"; + base: "font=SLP:style=Roman text_class=slp font_size=32 color=#ffffff wrap=char"; + tag: "br" "\n"; + tag: "ps" "ps"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp"; + tag: "b" "+ font=SLP:style=Bold text_class=slp"; + tag: "whitecolor" "+ color=#ffffff"; + tag: "tab" "\t"; + } + } + +#define CHECK_STATE_DEFAULT 0 +#define CHECK_STATE_VISIBLE 1 +#define CHECK_STATE_DISABLED_VISIBLE 2 +#define CHECK_STATE_DISABLED 3 + +//////////////////////////////////////////////////////////////////////////////// +#define CHECK_STYLE_GRID(style_name, image_grid, width, height) \ + group { name: "elm/check/base/"style_name; \ + images.image: image_grid COMP; \ + parts { \ + part { name: "bg"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + description { state: "pressed" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "icon_bg_img"; \ + type: RECT; \ + mouse_events: 0; \ + scale : 1; \ + description { \ + color: 0 0 0 0; \ + rel1 { relative: GAP_W/W (GAP_H+1)/H;} \ + rel2 { relative: (W-GAP_W)/W 1;} \ + } \ + } \ + part { name: "icon_bg"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + rel1 { relative: 0 0; to: "icon_bg_img"; } \ + rel2 { relative: 1 1; to: "icon_bg_img"; } \ + } \ + } \ + part { name: "bg2"; \ + type: RECT; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "icon_bg"; \ + rel2.to: "icon_bg"; \ + align: 0.5 0.5; \ + min: width height; \ + max: width height; \ + color: 0 0 0 0; \ + } \ + description { state: "pressed" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 0; \ + } \ + } \ + part { name: "selected_bg"; \ + type: RECT; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "icon_bg"; \ + rel2.to: "icon_bg"; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + color: 0 0 0 153; \ + visible: 1; \ + } \ + } \ + part { name: "check"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + rel1.to: "bg2"; \ + rel2.to: "bg2"; \ + visible: 0; \ + image.normal: image_grid; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + description { state: "pressed" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + part { name: "elm.swallow.content"; \ + type: SWALLOW; \ + description { \ + state: "default" 0.0; \ + fixed: 1 0; \ + visible: 0; \ + color: 255 255 255 255; \ + align: 0.0 0.5; \ + rel1 { \ + to_x: "bg2"; \ + relative: 1.0 0.0; \ + offset: 1 1; \ + } \ + rel2 { \ + to_x: "bg2"; \ + relative: 1.0 1.0; \ + offset: 2 -2; \ + } \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + fixed: 1 1; \ + visible: 1; \ + aspect: 1.0 1.0; \ + aspect_preference: VERTICAL; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 128 128 128 128; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + color: 128 128 128 128; \ + fixed: 1 1; \ + visible: 1; \ + aspect: 1.0 1.0; \ + } \ + } \ + part { name: "elm.text"; \ + type: TEXTBLOCK; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + visible: 0; \ + fixed: 0 1; \ + rel1 { \ + relative: 1.0 0.5; \ + offset: 1 1; \ + to_x: "elm.swallow.content"; \ + } \ + rel2 { \ + relative: 1.0 0.5; \ + offset: -2 -2; \ + } \ + color: 255 255 255 255; \ + align: 0.0 0.5; \ + text { \ + style: "check_label_textblock_style"; \ + min: 0 0; \ + } \ + color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \ + } \ + description { state: "visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + text.min: 1 1; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "disabled_visible" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + text.min: 1 1; \ + color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \ + } \ + } \ + part { name: "events"; \ + type: RECT; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "disabler"; \ + type: RECT; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + visible: 0; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + visible: 1; \ + } \ + } \ + } \ + programs { \ + program { name: "click"; \ + signal: "mouse,up,1"; \ + source: "events"; \ + action: SIGNAL_EMIT "elm,action,check,toggle" ""; \ + after: "bg_normal"; \ + } \ + program { name: "bg_normal"; \ + script { \ + set_state(PART:"bg", "default", 0.0); \ + set_state(PART:"bg2", "default", 0.0); \ + } \ + } \ + program { name: "mouseout"; \ + signal: "mouse,out"; \ + source: "events"; \ + after: "bg_check_normal"; \ + } \ + program { name: "bg_check_normal"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "pressed")) \ + set_state(PART:"check", "visible", 0.0); \ + set_state(PART:"bg", "default", 0.0); \ + set_state(PART:"bg2", "default", 0.0); \ + } \ + } \ + program { name: "pressed"; \ + signal: "mouse,down,1"; \ + source: "events"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"check", "pressed", 0.0); \ + set_state(PART:"bg", "pressed", 0.0); \ + set_state(PART:"bg2", "pressed", 0.0); \ + } \ + } \ + program { name: "check_on"; \ + signal: "elm,state,check,on"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "check"; \ + target: "selected_bg"; \ + } \ + program { name: "check_off"; \ + signal: "elm,state,check,off"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "check"; \ + target: "selected_bg"; \ + } \ + program { name: "text_show"; \ + signal: "elm,state,text,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "text_hide"; \ + signal: "elm,state,text,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.text"; \ + } \ + program { name: "icon_show"; \ + signal: "elm,state,icon,visible"; \ + source: "elm"; \ + action: STATE_SET "visible" 0.0; \ + target: "elm.swallow.content"; \ + } \ + program { name: "icon_hide"; \ + signal: "elm,state,icon,hidden"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "elm.swallow.content"; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "disabler"; \ + target: "bg"; \ + target: "bg2"; \ + after: "disable_text"; \ + } \ + program { name: "disable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.text", "disabled", 0.0); \ + get_state(PART:"elm.swallow.content", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \ + else \ + set_state(PART:"elm.swallow.content", "disabled", 0.0); \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"check", "disabled_visible", 0.0); \ + } \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "disabler"; \ + target: "bg"; \ + target: "bg2"; \ + after: "enable_text"; \ + } \ + program { name: "enable_text"; \ + script { \ + new st[31]; \ + new Float:vl; \ + get_state(PART:"elm.text", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"elm.text", "visible", 0.0); \ + else \ + set_state(PART:"elm.text", "default", 0.0); \ + get_state(PART:"elm.swallow.content", st, 30, vl); \ + if (!strcmp(st, "visible")) \ + set_state(PART:"elm.swallow.content", "visible", 0.0); \ + else \ + set_state(PART:"elm.swallow.content", "default", 0.0); \ + get_state(PART:"check", st, 30, vl); \ + if (!strcmp(st, "disabled_visible")) \ + set_state(PART:"check", "visible", 0.0); \ + } \ + } \ + } \ + } + +//////////////////////////////////////////////////////////////////////////////// + CHECK_STYLE_GRID("gallery_efl/grid", GE_EDC_IMAGE_CHECK_GRID, 64, 64) + + +#undef CHECK_STATE_DEFAULT +#undef CHECK_STATE_VISIBLE +#undef CHECK_STATE_DISABLED_VISIBLE +#undef CHECK_STATE_DISABLED diff --git a/ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h b/ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h new file mode 100755 index 0000000..197cd8a --- /dev/null +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 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. + */ + +/* Definition of image path used in edc file */ + +/* gallery-efl-nocontents.edc */ +#define GE_EDC_IMAGE_NOCONTENTS_PIC "T01_Nocontents_picture.png" + +/* gallery-efl-gengrid-item-albums.edc */ +#define GE_EDC_IMAGE_MAIN_FOLDER_BG "T01_main_folder_bg.png" + +/* gallery-efl-gengrid-item-thumbview.edc */ +#define GE_EDC_IMAGE_BUTTON_PLAY "T01_btn_play.png" + +/* gallery-efl-check.edc */ +#define GE_EDC_IMAGE_CHECK_GRID "T01_grid_select_check.png" + diff --git a/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc new file mode 100755 index 0000000..e70aaeb --- /dev/null +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc @@ -0,0 +1,188 @@ +/* + * Copyright (c) 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. + */ + +/* 14 + 334 + 10 */ +#define ALBUM_ITEM_W 358 +/* 26 + 334 */ +#define ALBUM_ITEM_H 360 + +#define ALBUM_W 334 +#define ALBUM_H 334 + +#define ALBUM_GAP_L 12 +#define ALBUM_GAP_R 12 +#define ALBUM_GAP_T 26 + +#define ALBUM_ICON_W 318 +#define ALBUM_ICON_H 318 + +#define ALBUM_ICON_GAP_L 8 +#define ALBUM_ICON_GAP_R 8 +#define ALBUM_ICON_GAP_B 16 +#define ALBUM_ICON_PAD 3 + +#define ALBUM_TEXT_AREA_W 207 +#define ALBUM_TEXT_AREA_H 102 +#define ALBUM_TEXT_GAP_L 4 +#define ALBUM_TEXT_GAP_R 4 +#define ALBUM_TEXT_SNS_X 60 +#define ALBUM_TEXT_NAME_H 32 +#define ALBUM_TEXT_DATE_H 25 +#define ALBUM_PBAR_W 183 +#define ALBUM_PBAR_H 10 +#define ALBUM_PBAR_GAP_L 6 +#define ALBUM_PBAR_GAP_T 8 + +#define ALBUM_SNS_ICON_W 32 +#define ALBUM_SNS_ICON_H 32 + +#define ALBUM_RENAME_BTN_W 64 +#define ALBUM_RENAME_BTN_H 64 + +#define ALBUM_CHECKBOX_W 42 +#define ALBUM_CHECKBOX_H 42 +#define ALBUM_CHECKBOX_GAP_L 1 +#define ALBUM_CHECKBOX_GAP_T 8 +#define ALBUM_ICON_BG_COLOR_INC 190 189 189 255 + +group { + name: "elm/gengrid/item/albums_view/gallery_efl/default"; + data.item: "texts" "elm.text.name elm.text.date elm.text.count"; + data.item: "contents" "elm.swallow.onlyicon elm.swallow.check_bg label_bg"; + images { + image: GE_EDC_IMAGE_MAIN_FOLDER_BG COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + color: 255 0 0 0; + rel1 { relative: 0.0 0.0; } + rel2 { relative: 1.0 1.0; } + } + } + part { name: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + min : ALBUM_W ALBUM_H; + state: "default" 0.0; + image { + normal : GE_EDC_IMAGE_MAIN_FOLDER_BG; + } + rel1 { relative: ALBUM_GAP_L/ALBUM_ITEM_W ALBUM_GAP_T/ALBUM_ITEM_H; to:"bg"; } + rel2 { relative: (ALBUM_ITEM_W-ALBUM_GAP_R-1)/ALBUM_ITEM_W 1.0; to:"bg"; } + } + } + part { name: "icon_bg"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + min : ALBUM_ICON_W ALBUM_ICON_H; + state: "default" 0.0; + color: ALBUM_ICON_BG_COLOR_INC; + rel1 { relative: ALBUM_ICON_GAP_L/ALBUM_ICON_W 0.0; to:"icon_bg_img"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_GAP_R+2)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_GAP_B+2)/ALBUM_ICON_H; to:"icon_bg_img"; } + } + } + part { + name: "elm.swallow.onlyicon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_ICON_PAD/ALBUM_ICON_W) (ALBUM_ICON_PAD/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "label_bg"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_ICON_PAD/ALBUM_ICON_W) (ALBUM_ICON_PAD/ALBUM_ICON_H); offset: 0 0; to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1)/ALBUM_ICON_H); offset: 0 0; to: "icon_bg"; } + } + } + part { + name: "elm.text.date"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W ALBUM_TEXT_NAME_H/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H+ALBUM_TEXT_DATE_H-1)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + color: 190 190 190 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 22; + align: 0.0 0.5; + } + } + } + part { + name: "elm.text.count"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + rel1 { relative: ((ALBUM_TEXT_GAP_L+ALBUM_SNS_ICON_W+1)/ALBUM_TEXT_AREA_W) ALBUM_TEXT_SNS_X/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W 1.0; to: "label_bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 38; + align: 1.0 0.5; + } + } + } + part { + name: "elm.text.name"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: (ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W) 0.0; to: "label_bg"; } + rel2 { relative: (ALBUM_TEXT_AREA_W-ALBUM_TEXT_GAP_L-1)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H-1)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp"; + size: 28; + align: 0.0 0.5; + } + } + } + } +} + diff --git a/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc new file mode 100755 index 0000000..bc62572 --- /dev/null +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc @@ -0,0 +1,931 @@ +/* + * Copyright (c) 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 THUMBNAILS_BG_COLOR 190 189 189 255 + +/* Grid item background size W: 14+158+6; H: 24+158 */ +#define W 178 +#define H 193 +#define GAP_W 2 +#define GAP_H 18 + +/* Favourites icon boundary size */ +#define FAVOR_ICON_W 30 +#define FAVOR_ICON_H 30 + +group { + name: "elm/gengrid/item/thumbnail_view/gallery_efl/default"; + + data.item: "contents" "elm.swallow.icon elm.swallow.end"; + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + color: 0 0 0 0; + rel1 { relative: 0.0 0.0; offset: 0 0;} + rel2 { relative: 1.0 1.0; offset: 0 0;} + } + } + part { + name: "icon_bg"; + type: RECT; + scale : 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 0; + color: 0 0 0 0; + rel1 { relative: 0.0 0.0;to:"bg"; } + rel2 { relative: 1.0 1.0;to:"bg"; } + + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + mouse_events: 1; + description { + state: "default" 0.0; + color: 0 0 0 0; + rel1 { relative: 0.0 0.0; to: "icon_bg"; } + rel2 { relative: 1.0 1.0; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.end"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon"; } + rel2 { relative: 1.0 1.0; to: "elm.swallow.icon"; } + } + } + } + + programs { + program { + name: "movedonw_bg"; + signal: "movedown,bg,show"; + source: "bg"; + action: STATE_SET "move_down" 0.0; + target: "bg"; + } + } +} + + + + +group +{ + name: "elm/gengrid/photoframe/default_layout"; + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + } + + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_favor"; + + parts { + part { + name: "bg"; + type: RECT; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#endif + } + + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video"; + images { + image: GE_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GE_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video_favor"; + images { + image: GE_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "favoricon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (FAVOR_ICON_W*2+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } +#endif + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + rel1 { relative: 1 0; to: "favoricon_bg";} +#else + rel1 { relative: 1 0; to: "elm.videoicon_bg";} +#endif + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GE_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "favoricon_bg"; } + rel2 { relative: 1.0 1.0; to: "favoricon_bg"; } + } + } +#endif + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video_bookmark"; + images { + image: GE_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (FAVOR_ICON_W*2+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } +#endif + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + rel1 { relative: 1 0; to: "bookmarkicon_bg";} +#else + rel1 { relative: 1 0; to: "elm.videoicon_bg";} +#endif + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GE_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.bookmarkicon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "bookmarkicon_bg"; } + rel2 { relative: 1.0 1.0; to: "bookmarkicon_bg"; } + } + } +#endif + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/default_layout_video_favor_bookmark"; + images { + image: GE_EDC_IMAGE_BUTTON_PLAY COMP; + } + + parts { + part { + name: "bg"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + description { + state: "shrink" 0.0; + rel1 { relative: 0.03 0.03;} + rel2 { relative: 0.97 0.97;} + color: 0 0 0 0; + } + } + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: GAP_W/W (GAP_H+1)/H;} + rel2 { relative: (W-GAP_W)/W 1;} + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: GAP_W/W (H-FAVOR_ICON_H+1)/H;} + rel2 { relative: (FAVOR_ICON_W+GAP_W)/W 1;} + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "favoricon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "elm.videoicon_bg";} + rel2 { relative: (FAVOR_ICON_W*2+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 1.0 0.0; + rel1 { relative: 1 0; to: "favoricon_bg";} + rel2 { relative: (FAVOR_ICON_W*3+GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } +#endif + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + color: 0 0 0 130; + align: 0.0 1.0; +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + rel1 { relative: 1 0; to: "bookmarkicon_bg";} +#else + rel1 { relative: 1 0; to: "elm.videoicon_bg";} +#endif + rel2 { relative: (W-GAP_W)/W 1; to_y: "elm.videoicon_bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: 0 0; to: "elm.videoicon_bg";} + rel2 { relative: 1 1; to: "elm.videoicon_bg";} + image.normal: GE_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 1.0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Bold"; + text_class: "slp"; + size: 26; + align: 0.9 0.5; + } + } + } +#ifdef _USE_FAVOR_AND_BOOKMARK_ICON + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "favoricon_bg"; } + rel2 { relative: 1.0 1.0; to: "favoricon_bg"; } + } + } + part { + name: "elm.swallow.bookmarkicon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "bookmarkicon_bg"; } + rel2 { relative: 1.0 1.0; to: "bookmarkicon_bg"; } + } + } +#endif + } + programs { + program { + name: "mouse_down_shrink"; + signal: "mouse,down,shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + //after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "mouse_up_expand"; + signal: "mouse,up,expand"; + source: "bg"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + + program { + name: "shrink"; + signal: "shrink"; + source: "bg"; + action: STATE_SET "shrink" 0.0; + target: "bg"; + after: "expand"; + transition: LINEAR 0.1; + } + program { + name: "expand"; + action: STATE_SET "default" 0.0; + target: "bg"; + transition: LINEAR 0.05; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} + diff --git a/ug/ug-gallery-efl/res/edc/gallery-efl-nocontents.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-nocontents.edc new file mode 100755 index 0000000..93a2d62 --- /dev/null +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-nocontents.edc @@ -0,0 +1,89 @@ +/* + * Copyright (c) 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 NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC 32 +#define NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC 173 170 165 255 + + group { + name: "elm/layout/nocontents/gallery_efl"; + styles{ + style { name: "nocontent_style"; + base: "font=SLP:style=Roman text_class=slp font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=word"; + tag: "br" "\n"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp"; + tag: "b" "+ font=SLP:style=Bold text_class=slp"; + tag: "tab" "\t"; + } + } + images { + image: GE_EDC_IMAGE_NOCONTENTS_PIC COMP; + } + parts { + part { name: "bg"; + scale: 1; + type: RECT; + description { state: "default" 0.0; + visible: 1; + rel1 { relative: 0.0 0.0;} + rel2 { relative: 1.0 1.0;} + color: 0 0 0 0; + } + } + part { name: "nocontents.image"; + description { state: "default" 0.0; + visible: 1; + align: 0.5 0.0; + rel1 { relative: 203/720 296/1016; to: "bg";} + rel2 { relative: (203+314)/720 (296+310)/1016; to: "bg";} + image { + normal: GE_EDC_IMAGE_NOCONTENTS_PIC; + border: 1 1 1 1; + border_scale: 1; + } + aspect: 1.0 1.0; + aspect_preference: BOTH; + } + } + part { name: "middle.padding"; + scale: 1; + type: RECT; + description { state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + rel1 { relative: 0.0 1.0; to_y: "nocontents.image";} + rel2 { relative: 1.0 (296+310+54)/1016; to: "bg";} + } + } + part { name: "elm.text"; + type: TEXTBLOCK; + description { state: "default" 0.0; + fixed: 0 1; + align: 0.5 0.0; + visible: 1; + rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "middle.padding";} + rel2 { relative: 1.0 1.0; to: "bg";} + color: NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC; + text { + style: "nocontent_style"; + align: 0.5 0.5; + min: 0 0; + max: 0 1; + } + } + } + } + } + diff --git a/ug/ug-gallery-efl/res/edc/gallery-efl.edc b/ug/ug-gallery-efl/res/edc/gallery-efl.edc new file mode 100755 index 0000000..1f5891a --- /dev/null +++ b/ug/ug-gallery-efl/res/edc/gallery-efl.edc @@ -0,0 +1,152 @@ +/* + * Copyright (c) 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 FONT_ROM "HelveticaNeue:style=Roman" +#define FONT_MED "HelveticaNeue:style=Medium" +#define SELINFO_H 48 + +#include "gallery-efl-edc-res.h" + +collections { +#include "gallery-efl-gengrid-item-thumbview.edc" +#include "gallery-efl-gengrid-item-albums.edc" +#include "gallery-efl-check.edc" +#include "gallery-efl-nocontents.edc" + + group + { + name: "gallery_efl/gridview"; + + parts { + part { + name: "background"; + type, RECT; + + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; offset: 0 0; } + rel2 { relative: 1.0 1.0; offset: -1 -1; } + color, 0 0 0 0; + } + } + + part { + name: "contents"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "background";} + rel2 { relative: 1.0 1.0; to: "background";} + } + description { + state: "moveup" 0.0; + rel1 { relative: 0.0 0.0; to: "background";} + rel2 { relative: 1.0 0.0; to: "elm.swallow.selinfo"; } + } + + } + part { + name: "elm.swallow.selinfo"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + min: 0 SELINFO_H; // bottom padding size for selectioninfo + fixed: 0 1; + align: 0.5 1.0; + rel1 { relative: 0.0 1.0; } + rel2 { relative: 1.0 1.0; } + visible: 0; + } + description { state: "show" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + + programs { + program { + name: "thumb_view_default"; + signal: "elm,thumb_view,state,default"; + source: "elm"; + script { + set_state(PART:"contents", "default", 0.0); + set_state(PART:"elm.swallow.selinfo", "default", 0.0); + } + } + program { + name: "thumb_view_moveup"; + signal: "elm,thumb_view,state,moveup"; + source: "elm"; + script { + set_state(PART:"contents", "moveup", 0.0); + set_state(PART:"elm.swallow.selinfo", "show", 0.0); + } + } + } + } + + group + { + name: "gallery_efl/albumview"; + + parts { + part { + name: "background"; + type, RECT; + + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; offset: 0 0; } + rel2 { relative: 1.0 1.0; offset: -1 -1; } + color, 0 0 0 0; + } + } + + part { + name: "contents"; + type: SWALLOW; + mouse_events: 1; + scale: 1; + + description { + state: "default" 0.0; + rel1 { relative: 0.0 0.0; to: "background";} + rel2 { relative: 1.0 1.0; to: "background";} + + } + } + } + } + group { name: "ge_bg_layout"; + parts { + part { name: "bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 0 0 0 45; + } + } + part { name: "elm.swallow.image"; + type: SWALLOW; + description { state: "default" 0.0; + } + } + } + } diff --git a/ug/ug-gallery-efl/res/edc/images/T01_Nocontents_picture.png b/ug/ug-gallery-efl/res/edc/images/T01_Nocontents_picture.png new file mode 100755 index 0000000000000000000000000000000000000000..0f984803828306623a3394585b881bb6ce9878f1 GIT binary patch literal 7487 zcmb7ocQl+)wC^Xxj4lyU7$sUV7(|P~FuD+e(W6I?7Nd8fM2%iYMk3KiuOU%_B-$W4 z5zz)g^v;{y`^UZat@qY??~iYt@0_#GKEGYgKKtxfPc&6%DDO}L06?Rrs;C11Byi#< z4kjm#Y=@Zf5*rFPRU;1opknyOkPs5bsLf9uLpcFjqx^cux*)FDL5Yz^yPFEGt z77L*+mS?^8E4=4R_xvJEE|ikX4WI|tJmc^<=Oh7+f~2MS?zVwG0VF;nRA8X(aZZ~M zOVlOZntaw%l8~1qZRn(j>fn$YfSg}~{0BfznIr_0$)gKk$pDL9YpVs|i2z{18@xOM zgkX-c{7C?lR1QWGY!blEU=ytf*h>LrgZeQ_fT0j@!&d!^BrqWW2&oy^ssfb_K-&O4 zRW$&n286VuBklua{(!|-PEH@-WfpKldB;F{n-5370wroHt6I8=OHwJ+1T5eVGBAL# z-WyQ6$#+BC@``1)9IV4P>-K|CQMzBdeE@(>VkAntd+swpiyIgaPpGFg7g+mDetFl* zYT;sOu+&Ws0Orv_Ll^vlHFrX!$U~ej-g0k}*_%;eJr84TtLfzG0PO0N!LHjs-6-Y1 zZkn82T3noX^hMsp^1DIcg;~?p?!~I{MeshIBFb!29JNnhpx2N%*WiXlI zrPa)GqRLqV)#Vvv4+flPZB6HwI)4K=cPA9xBWf@fSr%7?LY2;Nki0GKIq z!BF38WP88>pok5HRw9}A+HdiaQs*oL-7gr>so+>vdNqq$#gq=mUs0gQqR%^@r zpsrJBDw4SKQu!?v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z&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0002VNklw5r`&oI!UMKEa^tP5LNGTTkd1HmeS zU=V}J2M`3ywXARI>cIbYubM4~?4DpmFe8LOr`1)ycDI;`> z5%#}5a4)<>4~x7~eLx3~x1hJ&_>6bF;&{(fC07i4&zNJIMJSRuWkxu{e;&RJ00Y$_ Une5_z9RL6T07*qoM6N<$f(>hgw*UYD literal 0 HcmV?d00001 diff --git a/ug/ug-gallery-efl/res/edc/images/T01_grid_select_check.png b/ug/ug-gallery-efl/res/edc/images/T01_grid_select_check.png new file mode 100755 index 0000000000000000000000000000000000000000..f131f47453e418e646ce4be59f94489eb20df5e3 GIT binary patch literal 4247 zcmV;I5NPj-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#2H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>O0GcGt<1Cx3JTz%+2L?SWZ6nrQY3NU@1;5NYL^?F|og+d`!;E2Uy zF`v)(F7PC9kF>VxEzv6$0Tu~$!1cggz!ROFo$thAu~;DqNMdsrSvJ>6#hMQSG+})K zuo`FscJ%i49xN32U@-U<5C9&M^jns!u~94nEE1|k57x`T0{#8{NAnFnoy~RAv&dIJ zKmq>%e*wRV3%ls|`w!~6uIH;H)^%Oqym|8{z(uL;|F^kHDU&>h(}svCe)~`0S77Yy z*|X<&@812XVHifPgE0)lXlZGA&*t%Sv$=V&!bxqs=s~@7T(<(-_wC#FSsoO>2Y6bZ zxmq-*GF3yf*cvdMgetM3>!bsllOFW;_8tVD1?~sd+8Z0W_ALu_KR^>Gg%>*R*WOc9V& z53;QnLZMK|>-D|{JPx!7k#(s~ab_a{DfOVQukTnU(Q9pOeN$}i7Ad&uGl|};BfwTP zU7`nGulJR7dLZX_JH%Dql+5Oq3<0*%xlXFJR>0rb*!aegBS((sdVW_(0`hi8Nc-=@ z6+*&tAz~GFDTKJAeNCc?S+0IJ$rT{uAQzeg@9x;`Fi^W4ilHITMgZ6juP( zNLnnEZ4DqQF7g)vKc4j|P9993>!UFj^@1k9PXUv1P^sj?!kCluyFx}~A&3UzQZJY? zyAc}!QJM8fv1UH)lFf4pBuj^CF*a55_bDKj>F!RkQlO9oSR`n&LwIZzr76IRddt!= t0dpbB|1eP|piDrSfHDDP0_Jf1I{@8}Bkd6$9hm?C002ovPDHLkV1i%-=^+3B literal 0 HcmV?d00001 diff --git a/ug/ug-gallery-efl/res/edc/images/T01_main_folder_bg.png b/ug/ug-gallery-efl/res/edc/images/T01_main_folder_bg.png new file mode 100755 index 0000000000000000000000000000000000000000..16d1d5965e0d44e55e6c0e015be43729cfd137fc GIT binary patch literal 4436 zcmeHJS2Wy@w*CpxdyQVBMelW#(Q7bbv_uI*L<>=4jA$eBC!!lBBzl=7B8QD=0RW&gH8HRS01~Ue zgOdCYvuSte`zKKanK*_301eCEK>`#M-T(kF}E zbd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/ug-gallery-efl/res/images/T01_Nocontents_broken.png b/ug/ug-gallery-efl/res/images/T01_Nocontents_broken.png new file mode 100755 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~Y6qKB5R2{pD&su*h|`9rI)CwsB5zr}{LvegeOnfFxa8+*mS{q(YUA@_WQk z|KR$Th;kSawWfK@67 zEmnRKz)tOmR0o_N1Jx5xqcs5YM*xkJUcW3bFAO}=F>}%e>Y9M=aSCD-KtKXKGDac< z0GvR;ZkUV94|tme&}g2R$sY^WQtW{4mC8cNw{Xj9gjo>?d*PdziLmjH>(C3*NZCKI z&sG-c_0M7y3zH!KemV*O`AM|*)1Kb=jg!@mk4wd)$({-Cb>ZD{!eE=X+Y?ou$^fwL z6Eb-#BwEiD`WP?N?Y5BT2*=r$IR7;!#tB8P+z90FE}ETs{!1H;g2a}Eh3&1adEI_h zEBh~I!ME_i~-96t}6S~4yT$2RqTokbalZ4A{9I!9+ z_$bVMx;HQYaMI?{^NpVXJJdO1eZu$dm(q<^J`WJ;q?7Cg0JiGfBG51ON<#zypq?KF zs#9S;>tPV;#$)NhUG5>iwv&3R%H7|qN})>hJe0-TPM|tml|OQ`K%a%UnzL=n>HuR|bCj-8C|I0@rgMF%>WP}J)97aBIR+Cf> zGSxk;#%_x`cbNF(i$fKr(M>3Y`#_!6hC0=LCjz!Sv=#|tIrcEr5ceEjLtO1YB8 zW|;BSY-(gz>u1JK>@!~y(n#8fAtaoiF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755 index 0000000..8b4e638 --- /dev/null +++ b/ug/ug-gallery-efl/src/gallery-efl.c @@ -0,0 +1,661 @@ +/* + * Copyright (c) 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 UG_MODULE_API +#define UG_MODULE_API __attribute__ ((visibility("default"))) +#endif + +#include +#include "gallery-efl.h" +#include "ge-debug.h" +#include "ge-albums.h" +#include "ge-gridview.h" +#include "ge-data.h" +#include "ge-ui-util.h" +#include "ge-util.h" +#include "ge-ext-ug-load.h" +#include "ge-strings.h" +#include "ge-lang.h" + +static ge_view_mode g_view_mode = GE_VIEW_ALBUMS; + +#define GE_BG_COLOR_R 248 +#define GE_BG_COLOR_G 246 +#define GE_BG_COLOR_B 239 + +ge_view_mode _ge_get_view_mode(void) +{ + return g_view_mode; +} + +void _ge_set_view_mode(ge_view_mode mode) +{ + g_view_mode = mode; +} + +static int _ge_create_ly_view(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(ugd->navi_bar, -1); + /** + * Init libmedia-info. + * If failed, records couldn't be got from DB, cluster list is emty. + * Show warning message instead of return -1; + */ + if(_ge_data_init(ugd) != 0) + { + ge_dbgW("_ge_data_init failed!"); + } + /** + * Get cluster list from DB. + * If cluster list is empty, GE_DB_FAILED returned, + * "No contents" view would be created and showed. + * Show warning message instead of return -1; + */ + if(_ge_data_get_clusters_list(ugd) != 0) + ge_dbgW("Get clusters list failed!"); + + /* Create layout of albums view */ + ugd->albums_view_ly = ge_albums_create_ly(ugd->navi_bar); + GE_CHECK_VAL(ugd->albums_view_ly, -1); + /* Create albums view */ + ugd->albums_view = ge_albums_create_view(ugd, ugd->albums_view_ly); + GE_CHECK_VAL(ugd->albums_view, -1); + elm_object_part_content_set(ugd->albums_view_ly, "contents", + ugd->albums_view); + + ge_ui_create_title_and_push(ugd, ugd->navi_bar, ugd->albums_view_ly, + GE_NAVI_ALBUMS, ugd->albums_view_title); + return 0; +} + +static Evas_Object *_ge_create_bg(Evas_Object *parent) +{ + ge_dbg(""); + GE_CHECK_NULL(parent); + Evas_Object *bg = NULL; + + bg = elm_bg_add(parent); + /* Show special color of background */ + elm_bg_color_set(bg, GE_BG_COLOR_R, GE_BG_COLOR_G, GE_BG_COLOR_B); + + 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); + evas_object_show(bg); + + return bg; +} + +static int _ge_init_view(ge_ugdata *ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + + /* Base Layout */ + ugd->ly_main = ge_ui_create_main_ly(ugd, ugd->win); + GE_CHECK_VAL(ugd->ly_main, -1); + /* Background */ + ugd->bg = _ge_create_bg(ugd->ly_main); + GE_CHECK_VAL(ugd->bg, -1); + /* Pack bg to swallow */ + elm_object_part_content_set(ugd->ly_main, "elm.swallow.bg", ugd->bg); + + /* Navigation Bar */ + ugd->navi_bar = ge_ui_create_navibar(ugd, ugd->ly_main); + GE_CHECK_VAL(ugd->navi_bar, -1); + + /* Albums view and its layout */ + if(_ge_create_ly_view(ugd) != 0) + { + ge_dbgE("Create albums view and layout failed!"); + return -1; + } + + return 0; +} + +static int _ge_create_view(ge_ugdata *ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + /* Set inited flag as TRUE */ + ugd->b_inited_view = true; + /* Add new theme */ + ugd->th = elm_theme_new(); + GE_CHECK_VAL(ugd->th, -1); + elm_theme_ref_set(ugd->th, NULL); + elm_theme_extension_add(ugd->th, GE_EDJ_FILE); + + /* Initialize gallery ug view */ + if(_ge_init_view(ugd) != 0) + { + ge_dbgE("Initialize view failed!"); + return -1; + } + + /* Register MMC changed callback */ + if(ge_reg_db_update_noti(ugd) != 0) { + ge_dbgE("ge_reg_db_update_noti failed!"); + return -1; + } + + return 0; +} + +static int _ge_close_view(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + + GE_IF_DEL_OBJ(ugd->popup) + + GE_FREEIF(ugd->file_setas_callid_path); + GE_FREEIF(ugd->file_setas_homescreen_path); + GE_FREEIF(ugd->file_setas_lockscreen_path); + GE_FREEIF(ugd->file_setas_callid_size); + GE_FREEIF(ugd->file_setas_image_path); + GE_FREEIF(ugd->file_setas_crop_image_path); + + if(ugd->b_inited_view) { + /* Destroy UG called by me */ + if (ugd->ug_called_by_me) { + ge_dbg("Destroy ug_called_by_me"); + ug_destroy(ugd->ug_called_by_me); + ugd->ug_called_by_me = NULL; + } + + GE_IF_DEL_TIMER(ugd->del_timer) + GE_IF_DEL_TIMER(ugd->thumbs_clicked_timer) + GE_IF_DEL_IDLER(ugd->grid_append_idler) + + ge_dereg_db_update_noti(); + + ge_grid_del_callbacks(ugd); + ge_albums_del_callbacks(ugd); + + GE_IF_DEL_OBJ(ugd->navi_bar) + GE_IF_DEL_OBJ(ugd->bg) + GE_IF_DEL_OBJ(ugd->ly_main) + + ge_albums_free_cover_thumbs(ugd); + + /* Disconnet with libmedia-info */ + _ge_data_finalize(ugd); + if(ugd->th) { + elm_theme_extension_del(ugd->th, GE_EDJ_FILE); + elm_theme_free(ugd->th); + ugd->th = NULL; + } + ugd->b_inited_view = false; + } + + if(ugd->service) { + service_destroy(ugd->service); + ugd->service = NULL; + } + return 0; +} + +static int __ge_parse_param_launch_type_setas(ge_ugdata *ugd, service_h service) +{ + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(service, -1); + char *setas_type = NULL; + char *callerid_size = NULL; + char *callerid_path = NULL; + char *wallpaper_path = NULL; + char *lockscreen_path = NULL; + + service_get_extra_data(service, GE_BUNDLE_SETAS_TYPE, &setas_type); + if(setas_type == NULL) { + ge_dbgW("setas-type NULL"); + return -1; + } + + if (!strcasecmp(setas_type, GE_SETAS_WALLPAPER)) { + ugd->file_select_setas_mode = GE_SETAS_T_WALLPAPER; + g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_WALLPAPER, + GE_ALBUM_NAME_LEN_MAX); + + service_get_extra_data(service, GE_BUNDLE_HOMESCREEN_PATH, + &wallpaper_path); + if (wallpaper_path) { + ge_dbg("path:%s", wallpaper_path); + ugd->file_setas_homescreen_path = wallpaper_path; + } + + service_get_extra_data(service, GE_BUNDLE_LOCKSCREEN_PATH, + &lockscreen_path); + if (lockscreen_path) { + ge_dbg("path:%s", lockscreen_path); + ugd->file_setas_lockscreen_path = lockscreen_path; + } + } else if (!strcasecmp(setas_type, GE_SETAS_CROP_WALLPAPER)) { + ugd->file_select_setas_mode = GE_SETAS_T_CROP_WALLPAPER; + g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_WALLPAPER, + GE_ALBUM_NAME_LEN_MAX); + } else if (!strcasecmp(setas_type, GE_SETAS_CALLERID)) { + ugd->file_select_setas_mode = GE_SETAS_T_CALLERID; + g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_CALLER_ID, + GE_ALBUM_NAME_LEN_MAX); + + service_get_extra_data(service, GE_BUNDLE_CALLERID_SIZE, + &callerid_size); + if (callerid_size) { + ge_dbg("size:%s", callerid_size); + ugd->file_setas_callid_size = callerid_size; + } + + service_get_extra_data(service, GE_BUNDLE_CALLERID_PATH, + &callerid_path); + if (callerid_path) { + ge_dbg("path:%s", callerid_path); + ugd->file_setas_callid_path = callerid_path; + } + } + + GE_FREE(setas_type); + return 0; +} + +static int __ge_parse_param_file_type(ge_ugdata *ugd, service_h service) +{ + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(service, -1); + + char *file_type = NULL; + char file_type_str[GE_ALBUM_NAME_LEN_MAX] = {0,}; + bool b_singular = true; + + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) + b_singular = false; + + /* file-type */ + service_get_extra_data(service, GE_BUNDLE_FILE_TYPE, &file_type); + if(file_type == NULL) { + ge_dbgW("file_type is empty!"); + goto GE_DEFAULT_FILE_TYPE; + } + ge_dbg("file_type: %s", file_type); + + if (!strcasecmp(file_type, GE_FILE_TYPE_IMAGE)) { + ugd->file_type_mode = GE_FILE_T_IMAGE; + if(b_singular) { + g_strlcat(ugd->albums_view_title, GE_TITLE_IMAGE, + sizeof(ugd->albums_view_title)); + } else { + g_strlcat(ugd->albums_view_title, GE_TITLE_IMAGES, + sizeof(ugd->albums_view_title)); + } + + GE_FREE(file_type); + return 0; + } else if (!strcasecmp(file_type, GE_FILE_TYPE_VIDEO)) { + ugd->file_type_mode = GE_FILE_T_VIDEO; + if(b_singular) { + g_strlcat(ugd->albums_view_title, GE_TITLE_VIDEO, + sizeof(ugd->albums_view_title)); + } else { + g_strlcat(ugd->albums_view_title, GE_TITLE_VIDEOS, + sizeof(ugd->albums_view_title)); + } + + GE_FREE(file_type); + return 0; + } + + +GE_DEFAULT_FILE_TYPE: + + ge_dbg("file type is default, set default type(ALL)."); + ugd->file_type_mode = GE_FILE_T_ALL; + if(b_singular) { + g_strlcpy(file_type_str, GE_TITLE_FILE, sizeof(file_type_str)); + } else { + g_strlcpy(file_type_str, GE_TITLE_FILES, sizeof(file_type_str)); + } + + g_strlcat(ugd->albums_view_title, file_type_str, + sizeof(ugd->albums_view_title)); + + return 0; +} + +/* analysis parameters */ +static int _ge_parse_param(ge_ugdata *ugd, service_h service) +{ + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(service, -1); + char *contain_drm = NULL; + char *launch_type = NULL; + char *select_mode = NULL; + + ugd->b_show_drm = false; + service_get_extra_data(service, GE_BUNDLE_DRM_TYPE, &contain_drm); + if (contain_drm) { + if (!strcasecmp(contain_drm, GE_FILE_TYPE_DRM_TRUE)) + ugd->b_show_drm = true; + GE_FREE(contain_drm); + } + + service_get_extra_data(service, GE_BUNDLE_SELECTION_MODE, &select_mode); + if (select_mode) { + if (!strcasecmp(select_mode, GE_BUNDLE_SELECTION_MODE_SINGLE)) + launch_type = strdup(GE_LAUNCH_SELECT_ONE); + else if (!strcasecmp(select_mode, GE_BUNDLE_SELECTION_MODE_MULTI)) + launch_type = strdup(GE_LAUNCH_SELECT_MULTIPLE); + GE_FREE(select_mode); + } + + if (launch_type == NULL) + service_get_extra_data(service, GE_BUNDLE_LAUNCH_TYPE, + &launch_type); + + if (launch_type == NULL) { + ge_dbg("launch-type == NULL"); + return -1; + } + ge_dbg("launch-type [%s]", launch_type); + + if(!strcasecmp(launch_type, GE_LAUNCH_SELECT_ALBUM)) { + ugd->album_select_mode = GE_ALBUM_SELECT_T_ONE; + g_strlcpy(ugd->albums_view_title, GE_TITLE_ALBUMS, + GE_ALBUM_NAME_LEN_MAX); + } else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_SETAS)) { + ugd->file_select_mode = GE_FILE_SELECT_T_SETAS; + __ge_parse_param_launch_type_setas(ugd, service); + /* Checkme: Only image type is offered in SETAS case */ + ugd->file_type_mode = GE_FILE_T_IMAGE; + } else { + g_strlcpy(ugd->albums_view_title, GE_TITLE_ADD, + GE_ALBUM_NAME_LEN_MAX); + g_strlcat(ugd->albums_view_title, " ", GE_ALBUM_NAME_LEN_MAX); + + if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_ONE)) + ugd->file_select_mode = GE_FILE_SELECT_T_ONE; + else if (!strcasecmp(launch_type, GE_LAUNCH_SELECT_MULTIPLE)) + ugd->file_select_mode = GE_FILE_SELECT_T_MULTIPLE; + else + ge_dbgE("Wrong launch type!"); + + __ge_parse_param_file_type(ugd, service); + } + + GE_FREE(launch_type); + return 0; +} + +/** +* @brief +* +* @param ug +* @param mode +* @param data +* @param priv +* +* @return +*/ +static void * _ge_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv) +{ + ge_dbg("Enter..."); + ge_ugdata *ugd = NULL; + GE_CHECK_NULL(priv); + GE_CHECK_NULL(service); + GE_CHECK_NULL(ug); + ge_dbgW("Gallery UG start..."); + + ugd = (ge_ugdata *)priv; + ugd->ug = ug; + /* Get window */ + ugd->win = (Evas_Object *)ug_get_window(); + GE_CHECK_NULL(ugd->win); + /* Bind text domain for internalization */ + bindtextdomain("ug-gallery-efl" , "/usr/ug/res/locale"); + /* Reset inited flag, it would be set as TRUE if albums view created */ + ugd->b_inited_view = false; + /* Set view mode */ + _ge_set_view_mode(GE_VIEW_ALBUMS); + + Ecore_X_Window x_win = ecore_x_window_focus_get(); + GE_CHECK_NULL(x_win); + Ecore_X_Window root_win = ecore_x_window_root_get(x_win); + GE_CHECK_NULL(root_win); + ugd->win_scale = elm_config_scale_get(); + + service_clone(&(ugd->service), service); + + /* Parse parameters passed from parent */ + if(_ge_parse_param(ugd, service) != 0) { + ge_dbgE("Failed to parse parameters!"); + return NULL; + } + + if ((ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) || + (ugd->file_select_mode != GE_FILE_SELECT_T_NONE) || + (ugd->album_select_mode != GE_ALBUM_SELECT_T_NONE)) { + /* create gallery UG */ + if(_ge_create_view(ugd) != 0) { + ge_dbgE("Failed to create Gallery UG view!"); + return NULL; + } + } else { + ge_dbgE("Wrong file_select_mode[%d] or album_select_mode[%d]", + ugd->file_select_mode, ugd->album_select_mode); + } + + return ugd->ly_main; +} + +/** +* @brief +* +* @param ug +* @param data +* @param priv +*/ +static void _ge_start(ui_gadget_h ug, service_h service, void *priv) +{ +} + +/** +* @brief +* +* @param ug +* @param data +* @param priv +*/ +static void _ge_pause(ui_gadget_h ug, service_h service, void *priv) +{ + ge_dbg(""); +} + +/** +* @brief +* +* @param ug +* @param data +* @param priv +*/ +static void _ge_resume(ui_gadget_h ug, service_h service, void *priv) +{ + ge_dbg(""); + GE_CHECK(priv); + ge_ugdata *ugd = (ge_ugdata *)priv; + /*update*/ + if (!_ge_ug_iv_get()) + { + ge_update_view(ugd, GE_UPDATE_NONE); + } +} + +/** +* @brief +* +* @param ug +* @param data +* @param priv +*/ +static void _ge_destroy(ui_gadget_h ug, service_h service, void *priv) +{ + ge_dbgW(""); + GE_CHECK(ug); + GE_CHECK(priv); + ge_ugdata *ugd = (ge_ugdata *)priv; + + _ge_close_view(ugd); + ge_dbgW("End of the gallery UG!"); +} + +/** +* @brief +* +* @param ug +* @param msg +* @param data +* @param priv +*/ +static void _ge_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) +{ + ge_dbg(""); +} + +/** +* @brief +* +* @param ug +* @param event +* @param data +* @param priv +*/ +static void _ge_event(ui_gadget_h ug, enum ug_event event, service_h service, void *priv) +{ + GE_CHECK(priv); + ge_ugdata *ugd = (ge_ugdata *)priv; + int rotate_mode = GE_ROTATE_NONE; + + switch (event) + { + case UG_EVENT_LOW_MEMORY: + ge_dbg("UG_EVENT_LOW_MEMORY"); + break; + + case UG_EVENT_LOW_BATTERY: + ge_dbg("UG_EVENT_LOW_BATTERY"); + break; + + case UG_EVENT_LANG_CHANGE: + ge_dbg("UG_EVENT_LANG_CHANGE"); + _ge_lang_update(ugd); + break; + + case UG_EVENT_ROTATE_PORTRAIT: + ge_dbg("UG_EVENT_ROTATE_PORTRAIT"); + rotate_mode = GE_ROTATE_PORTRAIT; + goto UG_ROTATE_EVENT; + break; + + case UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN: + ge_dbg("UG_EVENT_ROTATE_PORTRAIT_UPSIDEDOWN"); + rotate_mode = GE_ROTATE_PORTRAIT_UPSIDEDOWN; + goto UG_ROTATE_EVENT; + break; + + case UG_EVENT_ROTATE_LANDSCAPE: + ge_dbg("UG_EVENT_ROTATE_LANDSCAPE"); + rotate_mode = GE_ROTATE_LANDSCAPE; + goto UG_ROTATE_EVENT; + break; + + case UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN: + ge_dbg("UG_EVENT_ROTATE_LANDSCAPE_UPSIDEDOWN"); + rotate_mode = GE_ROTATE_LANDSCAPE_UPSIDEDOWN; + goto UG_ROTATE_EVENT; + break; + + default: + break; + } + + return; + +UG_ROTATE_EVENT: + + ge_ui_set_rotate_angle(rotate_mode); +} + +static void _ge_key_event(ui_gadget_h ug, enum ug_key_event event, service_h service, void *priv) +{ + ge_dbg(""); + GE_CHECK(ug); + + switch (event) { + case UG_KEY_EVENT_END: + ge_dbg("Receive key end event"); + ug_destroy_me(ug); + break; + + default: + break; + } +} + +/** +* @brief +* +* @param ops +* +* @return +*/ +UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops) +{ + ge_dbgW("UG_MODULE_INIT"); + ge_ugdata *ugd = NULL; + GE_CHECK_VAL(ops, -1); + + ugd = calloc(1, sizeof(ge_ugdata)); + GE_CHECK_VAL(ugd, -1); + + ops->create = _ge_create; + ops->start = _ge_start; + ops->pause = _ge_pause; + ops->resume = _ge_resume; + ops->destroy = _ge_destroy; + ops->message = _ge_message; + ops->event = _ge_event; + ops->key_event = _ge_key_event; + ops->priv = ugd; + ops->opt = UG_OPT_INDICATOR_ENABLE; + + return 0; +} + +/** +* @brief +* +* @param ops +* +* @return +*/ +UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) +{ + struct ug_data *ugd = NULL; + GE_CHECK(ops); + + ugd = ops->priv; + GE_FREEIF(ugd); + ge_dbgW("UG_MODULE_EXIT"); +} + diff --git a/ug/ug-gallery-efl/src/ge-albums.c b/ug/ug-gallery-efl/src/ge-albums.c new file mode 100755 index 0000000..2765c5d --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-albums.c @@ -0,0 +1,648 @@ +/* + * Copyright (c) 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 "ge-debug.h" +#include "ge-albums.h" +#include "ge-gridview.h" +#include "ge-ui-util.h" +#include "ge-util.h" +#include "ge-drm.h" +#include "ge-data.h" +#include "ge-strings.h" +#include "ge-icon.h" +#include "ge-tile.h" +#include "ge-rotate-bg.h" + +static Elm_Gengrid_Item_Class album_gic; +static int gl_albums_item_cnt; +static ge_item* gl_album_items[GE_ALBUM_COVER_THUMB_NUM]; +static int gl_album_count; + +static void _ge_albums_drag_up(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_drag_right(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_drag_down(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_drag_left(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_drag_stop(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_realized(void *data, Evas_Object *obj, void *event_info) +{ + //ge_dbg(""); +} + +static void _ge_albums_selected(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_unselected(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_clicked(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_albums_longpress(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static Eina_Bool _ge_albums_append_grid_idler(void *data) +{ + GE_CHECK_CANCEL(data); + ge_ugdata* ugd = (ge_ugdata*)data; + + /* Try to get other medias from DB and append them to gridview*/ + int ret = ge_grid_idler_append_thumbs(data); + if(ret != 0) { + ge_dbg("Failed to append grid items!"); + } else { + ge_dbg("Successful to append grid items!"); + } + + /* Remove idler after all items appended */ + GE_IF_DEL_IDLER(ugd->grid_append_idler) + + return ECORE_CALLBACK_CANCEL; +} + +static void __ge_albums_sel_cb(void *data, Evas_Object *obj, void *event_info) +{ + GE_CHECK(data); + ge_cluster *album_item = (ge_cluster*)data; + GE_CHECK(album_item->cluster); + GE_CHECK(album_item->ugd); + ge_ugdata *ugd = album_item->ugd; + if(ugd->ug == NULL) { + ge_dbg("UG already destroyed, return!"); + return; + } + + if (album_item->cluster->count == 0) { + ge_dbgW("Empty album!"); + return; + } + + ge_albums_sel_album(album_item); +} + +static char *__ge_albums_get_text(void *data, Evas_Object *obj, const char *part) +{ + GE_CHECK_NULL(part); + GE_CHECK_NULL(data); + ge_cluster *album_item = (ge_cluster *)data; + GE_CHECK_NULL(album_item->cluster); + GE_CHECK_NULL(album_item->cluster->uuid); + GE_CHECK_NULL(album_item->ugd); + ge_ugdata *ugd = album_item->ugd; + char buf[GE_FILE_PATH_LEN_MAX] = {0,}; + + if (!g_strcmp0(part, "elm.text.name")) + { + GE_CHECK_NULL(album_item->cluster->display_name); + if(_ge_data_is_root_path(album_item->cluster->path)) { + snprintf(buf, sizeof(buf), "%s", GE_ALBUM_ROOT_NAME); + buf[strlen(buf)] = '\0'; + } else if(album_item->cluster->display_name && + strlen(album_item->cluster->display_name)) { + char *new_name = _ge_ui_get_translated_album_name(album_item); + snprintf(buf, sizeof(buf), "%s", new_name); + buf[strlen(buf)] = '\0'; + } + + /* Show blue folder name */ + if (!g_strcmp0(album_item->cluster->uuid, GE_ALBUM_ALL_ID) || + _ge_data_is_default_album(GE_ALBUM_CAMERA_NAME, album_item->cluster)) { + Elm_Object_Item *grid_it = album_item->griditem; + Evas_Object *it_obj = NULL; + it_obj = elm_object_item_widget_get(grid_it); + GE_CHECK_NULL(it_obj); + edje_object_signal_emit(it_obj, "elm,name,show,blue", + "elm"); + edje_object_message_signal_process(it_obj); + } + } + else if (!g_strcmp0(part, "elm.text.date")) + { + struct tm t1; + struct tm t2; + char date1[GE_ALBUM_DATE_LEN_MAX] = {0,}; + char date2[GE_ALBUM_DATE_LEN_MAX] = {0,}; + char date3[GE_ALBUM_DATE_LEN_MAX] = {0,}; + + ge_albums_free_cover_thumbs(ugd); + + int item_count = GE_ALBUM_COVER_THUMB_NUM; + ge_item** items1 = gl_album_items; + + _ge_data_get_first_several_items(ugd, album_item, items1, + &item_count, + MEDIA_CONTENT_ORDER_DESC); + if(item_count <= 0) + { + gl_album_count = 0; + return NULL; + } + + gl_album_count = item_count; + if(items1[0] == NULL || items1[0]->item == NULL) + { + gl_album_count = 0; + return NULL; + } + memcpy(&album_item->item_mtime, &(items1[0]->item->mtime), sizeof(time_t)); + + item_count = 1; + ge_item* items2[1]; + memset(items2, 0x00, item_count * sizeof(int)); + _ge_data_get_first_several_items(ugd, album_item, items2, + &item_count, + MEDIA_CONTENT_ORDER_ASC); + + if(item_count <= 0) + { + return NULL; + } + else + { + memset(&t1, 0x00, sizeof(struct tm)); + localtime_r((time_t *) &(album_item->item_mtime), &t1); + strftime(date1, sizeof(date1), "%Y.%m.%d", &t1); + strftime(date3, sizeof(date3), "%Y.%m", &t1); + + if(items2[0] == NULL || items2[0]->item == NULL) + { + gl_album_count = 0; + return NULL; + } + memset(&t2, 0x00, sizeof(struct tm)); + localtime_r((time_t *) &(items2[0]->item->mtime), &t2); + strftime(date2, sizeof(date2), "%Y.%m.%d", &t2); + + if(!g_strcmp0(date1, date2)) + { + g_strlcpy(buf, date1, sizeof(buf)); + } + else + { + strftime(date2, sizeof(date2), "%Y.%m", &t2); + snprintf(buf, sizeof(buf), "%s - %s", date2, date3); + buf[strlen(buf)] = '\0'; + } + } + + int i = 0; + for(i = 0; i < item_count; i++) + { + _ge_data_destroy_item(items2[i]); + items2[i] = NULL; + } + } + else if (!g_strcmp0(part, "elm.text.count")) + { + _ge_data_update_items_cnt(ugd, album_item); + snprintf(buf, sizeof(buf), "%d", (int)(album_item->cluster->count)); + buf[strlen(buf)] = '\0'; + } + + return strdup(buf); +} + +static ge_icon_type __ge_albums_set_bg_file(Evas_Object *bg, void *data) +{ + ge_item *git = (ge_item *)data; + char *bg_path = GE_DEFAULT_THUMB_ICON; + ge_icon_type ret_val = GE_ICON_CORRUPTED_FILE; + + if (git == NULL || git->item == NULL) { + ge_dbgE("Invalid item :%p", git); + goto GE_ALBUMS_FAILED; + } + + /* Is it DRM file? Has a valid RO? */ + char *path = git->item->file_url; + if(ge_drm_is_drm_file(path) && + !ge_drm_check_valid_ro(path, ge_drm_get_permtype(git->item->type))) { + ret_val = GE_ICON_EXPIRED_DRM; + goto GE_ALBUMS_FAILED; + } + + ret_val= GE_ICON_NORMAL; + bg_path = _GE_GET_ICON(git->item->thumb_url); + + GE_ALBUMS_FAILED: + +#ifdef _USE_ROTATE_BG_GE + _ge_rotate_bg_set_image_file(bg, bg_path); +#else + elm_bg_file_set(bg, bg_path, NULL); +#endif + + return ret_val; +} + +static Evas_Object *__ge_albums_get_content(void *data, Evas_Object *obj, const char *part) +{ + GE_CHECK_NULL(part); + GE_CHECK_NULL(strlen(part)); + GE_CHECK_NULL(data); + ge_cluster *album_item = (ge_cluster *)data; + GE_CHECK_NULL(album_item->cluster); + GE_CHECK_NULL(album_item->ugd); + ge_ugdata *ugd = album_item->ugd; + + GE_CHECK_NULL(album_item->cluster->uuid); + const char *al_id = album_item->cluster->uuid; + ge_dbg(""); + + Evas_Object *_obj = NULL; + if (!g_strcmp0(part, GT_TILE_ONLYICON)) { + _obj = _ge_tile_show_part_icon(obj, part, gl_album_count, + ugd->win_scale, + __ge_albums_set_bg_file, + (void **)gl_album_items); + } else if (!g_strcmp0(part, GT_TILE_LABEL)) { + /** + * for "Camera", its color should be + * 25:25:25 by new gui + */ + bool b_default = false; + if (!g_strcmp0(al_id, GE_ALBUM_ALL_ID) || + _ge_data_is_default_album(GE_ALBUM_CAMERA_NAME, album_item->cluster)) + b_default = true; + _obj = _ge_tile_show_part_label(obj, album_item->index, + b_default); + + if (album_item->cluster->count <= 0) + ge_dbg("Empty album"); + } + return _obj; +} + +static int _ge_albums_create_album(ge_ugdata* ugd, Evas_Object* parent) +{ + ge_dbg(""); + GE_CHECK_VAL(parent, -1); + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(ugd->cluster_list, -1); + int i = 0; + int grid_cnt = 0; + ge_cluster *album_item = NULL; + + album_gic.item_style = "albums_view"; + album_gic.func.text_get = __ge_albums_get_text; + album_gic.func.content_get = __ge_albums_get_content; + + int length = eina_list_count(ugd->cluster_list->clist); + ge_dbg("Albums list length: %d.", length); + + elm_gengrid_clear(parent); + + if(ugd->th) + { + elm_object_theme_set(parent, ugd->th); + } + elm_object_style_set(parent, "gallery_efl/default"); + + for(i = 0; i < length; i++) + { + album_item = eina_list_nth(ugd->cluster_list->clist, i); + GE_CHECK_VAL(album_item, -1); + GE_CHECK_VAL(album_item->cluster, -1); + GE_CHECK_VAL(album_item->cluster->display_name, -1); + album_item->griditem = elm_gengrid_item_append(parent, + &album_gic, + album_item, + __ge_albums_sel_cb, + album_item); + album_item->index = grid_cnt; + grid_cnt++; + ge_dbg("Append [%s], id=%s.", album_item->cluster->display_name, + album_item->cluster->uuid); + } + + gl_albums_item_cnt = grid_cnt; + + if(grid_cnt) + { + return 0; + } + else + { + ge_dbgW("None albums appended to view!"); + return -1; + } +} + +int ge_albums_free_cover_thumbs(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + int i = 0; + + for(i = 0; i < GE_ALBUM_COVER_THUMB_NUM; i++) + { + if(gl_album_items[i]) + { + _ge_data_destroy_item(gl_album_items[i]); + gl_album_items[i] = NULL; + } + } + + return 0; +} + +int ge_albums_back_to_view(ge_ugdata *ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) + { + ge_ui_destroy_selinfo(ugd); + _ge_data_selected_list_finalize(); + } + + GE_IF_DEL_IDLER(ugd->grid_append_idler) + + _ge_set_current_album(NULL); + + ge_albums_update_view(ugd); + ge_grid_clear_view(ugd); + + _ge_set_view_mode(GE_VIEW_ALBUMS); + return 0; +} + +int ge_albums_sel_album(ge_cluster* album_item) +{ + ge_dbg(""); + GE_CHECK_VAL(album_item, -1); + GE_CHECK_VAL(album_item->cluster, -1); + GE_CHECK_VAL(album_item->cluster->uuid, -1); + GE_CHECK_VAL(album_item->ugd, -1); + + if(_ge_get_view_mode() != GE_VIEW_ALBUMS) { + ge_dbgE("Wrong mode!"); + return -1; + } else { + ge_dbg("ViewMode"); + } + + ge_ugdata *ugd = album_item->ugd; + GE_CHECK_VAL(ugd->cluster_list, -1); + GE_CHECK_VAL(ugd->navi_bar, -1); + ge_dbg("Album: %s, id: %s.", album_item->cluster->display_name, + album_item->cluster->uuid); + + if(ugd->album_select_mode == GE_ALBUM_SELECT_T_ONE) { + ge_dbg("One album selected, return album id"); + service_add_extra_data(ugd->service, + GE_ALBUM_SELECT_RETURN_PATH, + album_item->cluster->path); + ge_dbg("return folder-path: %s", album_item->cluster->path); + ug_send_result(ugd->ug, ugd->service); + ug_destroy_me(ugd->ug); + ugd->ug = NULL; + return 0; + } + + /* Set current album */ + _ge_set_current_album(album_item); + /* Remove idler */ + GE_IF_DEL_IDLER(ugd->grid_append_idler) + /* Get album contents from DB */ + _ge_data_get_items_list(ugd, album_item, GE_FIRST_VIEW_START_POS, + GE_FIRST_VIEW_END_POS); + + if(ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) { + ge_dbg("setas mode->thumbnail is view mode"); + _ge_set_view_mode(GE_VIEW_THUMBS); + } else { + ge_dbg("select mode->thumbnail is edit mode"); + _ge_set_view_mode(GE_VIEW_THUMBS_EDIT); + } + + ugd->thumbs_view_ly = ge_grid_create_ly(ugd->navi_bar); + GE_CHECK_VAL(ugd->thumbs_view_ly, -1); + Evas_Object* gv = NULL; + + gv = ge_grid_create_view(ugd, ugd->thumbs_view_ly); + GE_CHECK_VAL(gv, -1); + + elm_object_part_content_set(ugd->thumbs_view_ly, "contents", gv); + ugd->thumbs_view = gv; + if(gv == ugd->nocontents) + { + ugd->thumbs_nocontents = gv; + } + + /* Checkme: clear albums view for animation effect pause issue */ + elm_gengrid_clear(ugd->albums_view); + + if(_ge_get_view_mode() == GE_VIEW_THUMBS) { + /* Check root case */ + if(_ge_data_is_root_path(album_item->cluster->path)) { + ge_ui_create_title_and_push(ugd, ugd->navi_bar, + ugd->thumbs_view_ly, + GE_NAVI_THUMBS, + GE_ALBUM_ROOT_NAME); + } else { + char *new_name = _ge_ui_get_translated_album_name(album_item); + ge_ui_create_title_and_push(ugd, ugd->navi_bar, + ugd->thumbs_view_ly, + GE_NAVI_THUMBS, + new_name); + } + } else { + ge_ui_create_title_and_push(ugd, ugd->navi_bar, + ugd->thumbs_view_ly, + GE_NAVI_THUMBS, + ugd->albums_view_title); + } + + if(_ge_data_get_count_all() == (GE_FIRST_VIEW_END_POS+1)) { + ge_dbg("\n\n>>>>>>>>Use idler to append other medias--Start>>>>>>>>\n"); + ugd->grid_append_idler = ecore_idler_add(_ge_albums_append_grid_idler, ugd); + } + + ge_dbg("Done ge_albums_sel_album"); + return 0; +} + +Evas_Object* ge_albums_create_ly(Evas_Object* parent) +{ + ge_dbg(""); + GE_CHECK_NULL(parent); + Evas_Object* layout = ge_ui_load_edj(parent, GE_EDJ_FILE, GE_GRP_ALBUMVIEW); + GE_CHECK_NULL(layout); + evas_object_show (layout); + + return layout; +} + +int ge_albums_del_callbacks(ge_ugdata* ugd) +{ + GE_CHECK_VAL(ugd, -1); + if(ugd->albums_view) + { + ge_dbg("Delete albums callbacks!"); + evas_object_smart_callback_del(ugd->albums_view, "selected", _ge_albums_selected); + evas_object_smart_callback_del(ugd->albums_view, "unselected", _ge_albums_unselected); + evas_object_smart_callback_del(ugd->albums_view, "clicked", _ge_albums_clicked); + evas_object_smart_callback_del(ugd->albums_view, "longpressed", _ge_albums_longpress); + evas_object_smart_callback_del(ugd->albums_view, "drag,start,up", _ge_albums_drag_up); + evas_object_smart_callback_del(ugd->albums_view, "drag,start,right", _ge_albums_drag_right); + evas_object_smart_callback_del(ugd->albums_view, "drag,start,down", _ge_albums_drag_down); + evas_object_smart_callback_del(ugd->albums_view, "drag,start,left", _ge_albums_drag_left); + evas_object_smart_callback_del(ugd->albums_view, "drag,stop", _ge_albums_drag_stop); + evas_object_smart_callback_del(ugd->albums_view, "realized", _ge_albums_realized); + } + return 0; +} + +Evas_Object* ge_albums_create_view(ge_ugdata* ugd, Evas_Object* parent) +{ + ge_dbg(""); + GE_CHECK_NULL(parent); + GE_CHECK_NULL(ugd); + GE_CHECK_NULL(ugd->cluster_list); + + memset(gl_album_items, 0x00, GE_ALBUM_COVER_THUMB_NUM * sizeof(int)); + gl_album_count = 0; + + if(!ugd->cluster_list->clist || + (eina_list_count(ugd->cluster_list->clist) == 0)) { + ge_dbgW("Clusters list is empty!"); + goto ALBUMS_FAILED; + } + + double scale_factor = ugd->win_scale; + ge_dbg("Own scale facotr: %f, elm_config_scale_get =%f.", scale_factor, elm_config_scale_get()); + + Evas_Object *grid = elm_gengrid_add(parent); + GE_CHECK_NULL(grid); + elm_gengrid_item_size_set(grid, + (int)(GE_ALBUM_ITEM_WIDTH * scale_factor), + (int)(GE_ALBUM_ITEM_HEIGHT * scale_factor)); + elm_gengrid_align_set(grid, 0.5, 0.0); + elm_gengrid_horizontal_set(grid, EINA_FALSE); + elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE); + elm_gengrid_multi_select_set(grid, EINA_TRUE); + evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + if(_ge_albums_create_album(ugd, grid) != 0) + { + ge_dbgW("Failed to append album items!"); + evas_object_del(grid); + grid = NULL; + + goto ALBUMS_FAILED; + } + else + { + evas_object_show (grid); + } + + evas_object_smart_callback_add(grid, "selected", _ge_albums_selected, NULL); + evas_object_smart_callback_add(grid, "unselected", _ge_albums_unselected, NULL); + evas_object_smart_callback_add(grid, "clicked", _ge_albums_clicked, NULL); + evas_object_smart_callback_add(grid, "longpressed", _ge_albums_longpress, NULL); + evas_object_smart_callback_add(grid, "drag,start,up", _ge_albums_drag_up, NULL); + evas_object_smart_callback_add(grid, "drag,start,right", _ge_albums_drag_right, NULL); + evas_object_smart_callback_add(grid, "drag,start,down", _ge_albums_drag_down, NULL); + evas_object_smart_callback_add(grid, "drag,start,left", _ge_albums_drag_left, NULL); + evas_object_smart_callback_add(grid, "drag,stop", _ge_albums_drag_stop, NULL); + evas_object_smart_callback_add(grid, "realized", _ge_albums_realized, NULL); + + return grid; + +ALBUMS_FAILED: + /* Show no contents if none albums exist */ + ge_dbgW("@@@@@@@ To create nocontents view @@@@@@@@"); + ugd->nocontents = ge_ui_create_nocontents(ugd); + ugd->albums_view = ugd->nocontents; + evas_object_show(ugd->nocontents); + + return ugd->nocontents; +} + +int ge_albums_update_view(ge_ugdata *ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(ugd->cluster_list, -1); + /* Changed to show no contents if needed */ + if(!ugd->cluster_list->clist || + (eina_list_count(ugd->cluster_list->clist) == 0)) { + ge_dbgW("Clusters list is empty!"); + goto ALBUMS_FAILED; + } + + if(ugd->nocontents && ugd->nocontents == ugd->albums_view) { + /* It is nocontents, unset it first then create albums view*/ + evas_object_del(ugd->nocontents); + ugd->nocontents = NULL; + + ugd->albums_view = ge_albums_create_view(ugd, ugd->navi_bar); + GE_CHECK_VAL(ugd->albums_view, -1); + elm_object_part_content_set(ugd->albums_view_ly, "contents", + ugd->albums_view); + evas_object_show(ugd->albums_view); + } else { + if(_ge_albums_create_album(ugd, ugd->albums_view) != 0) + goto ALBUMS_FAILED; + } + + return 0; + +ALBUMS_FAILED: + + if(ugd->albums_view && ugd->albums_view != ugd->nocontents) + ge_albums_del_callbacks(ugd); + + evas_object_del(ugd->albums_view); + + ge_dbgW("@@@@@@@ To create nocontents view @@@@@@@@"); + ugd->nocontents = ge_ui_create_nocontents(ugd); + ugd->albums_view = ugd->nocontents; + GE_CHECK_VAL(ugd->albums_view, -1); + evas_object_show(ugd->albums_view); + + elm_object_part_content_set(ugd->albums_view_ly, "contents", + ugd->albums_view); + return -1; +} diff --git a/ug/ug-gallery-efl/src/ge-button.c b/ug/ug-gallery-efl/src/ge-button.c new file mode 100755 index 0000000..e278d19 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-button.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 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 "ge-debug.h" +#include "ge-button.h" + +Evas_Object *_ge_but_create_but(Evas_Object *parent, Elm_Theme *theme, + const char *icon, const char *text, + const char *style, But_Smart_Cb cb_func, + const void *data) +{ + Evas_Object *btn = NULL; + GE_CHECK_NULL(parent); + + btn = elm_button_add(parent); + GE_CHECK_NULL(btn); + elm_object_focus_allow_set(btn, EINA_FALSE); + + if (theme) + elm_object_theme_set(btn, theme); + + if (style) + elm_object_style_set(btn, style); + evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL); + + if (icon) { + ge_dbg("Button icon: %s", icon); + Evas_Object *ic = NULL; + ic = elm_icon_add(btn); + GE_CHECK_NULL(ic); + elm_image_file_set(ic, icon, NULL); + elm_image_aspect_fixed_set(ic, EINA_TRUE); + elm_image_fill_outside_set(ic, EINA_TRUE); + evas_object_size_hint_aspect_set(ic, + EVAS_ASPECT_CONTROL_VERTICAL, + 1, 1); + evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, + EVAS_HINT_FILL); + evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_image_resizable_set(ic, EINA_TRUE, EINA_TRUE); + elm_object_content_set(btn, ic); + } + + if (text) { + ge_dbg("Button text: %s", text); + elm_object_text_set(btn, text); + } + + if (cb_func) + evas_object_smart_callback_add(btn, "clicked", cb_func, data); + + return btn; +} + diff --git a/ug/ug-gallery-efl/src/ge-data-type.c b/ug/ug-gallery-efl/src/ge-data-type.c new file mode 100755 index 0000000..59a81c7 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-data-type.c @@ -0,0 +1,146 @@ +/* + * Copyright (c) 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 "ge-data-type.h" +#include "ge-debug.h" + +int _ge_data_type_new_media(ge_media_s **item) +{ + GE_CHECK_VAL(item, -1); + ge_media_s *tmp_item = (ge_media_s *)calloc(1, sizeof(ge_media_s)); + GE_CHECK_VAL(tmp_item, -1); + tmp_item->gtype = GE_TYPE_MEDIA; + *item = tmp_item; + return 0; +} + +int _ge_data_type_new_album(ge_album_s **album) +{ + GE_CHECK_VAL(album, -1); + ge_album_s *tmp_item = (ge_album_s *)calloc(1, sizeof(ge_album_s)); + GE_CHECK_VAL(tmp_item, -1); + tmp_item->gtype = GE_TYPE_ALBUM; + *album = tmp_item; + return 0; +} + + +static int __ge_data_type_free_media(ge_media_s **item) +{ + GE_CHECK_VAL(item, -1); + GE_CHECK_VAL(*item, -1); + ge_media_s *tmp_item = *item; + + /* For local medias */ + if (tmp_item->media_h) + media_info_destroy(tmp_item->media_h); + + GE_FREEIF(tmp_item->uuid); + GE_FREEIF(tmp_item->thumb_url); + GE_FREEIF(tmp_item->file_url); + GE_FREEIF(tmp_item->album_uuid); + GE_FREEIF(tmp_item->display_name); + + if (MEDIA_CONTENT_TYPE_IMAGE == tmp_item->type && + tmp_item->image_info) { + /* For local medias */ + if (tmp_item->image_info->image_h) + image_meta_destroy(tmp_item->image_info->image_h); + + GE_FREEIF(tmp_item->image_info->media_uuid); + GE_FREE(tmp_item->image_info); + } else if (MEDIA_CONTENT_TYPE_VIDEO == tmp_item->type && + tmp_item->video_info) { + /* For local medias */ + if (tmp_item->video_info->video_h) + video_meta_destroy(tmp_item->video_info->video_h); + + GE_FREEIF(tmp_item->video_info->media_uuid); + GE_FREEIF(tmp_item->video_info->title); + } + + GE_FREE(tmp_item); + *item = NULL; + return 0; +} + +int _ge_data_type_free_media_list(Eina_List **list) +{ + GE_CHECK_VAL(list, -1); + GE_CHECK_VAL(*list, -1); + ge_media_s *item = NULL; + Eina_List *tmp_list = *list; + EINA_LIST_FREE(tmp_list, item) { + if (item) + __ge_data_type_free_media(&item); + } + eina_list_free(*list); + *list = NULL; + return 0; +} + +static int __ge_data_type_free_album(ge_album_s **album) +{ + GE_CHECK_VAL(album, -1); + GE_CHECK_VAL(*album, -1); + ge_album_s *tmp_album = *album; + + GE_FREEIF(tmp_album->uuid); + GE_FREEIF(tmp_album->display_name); + GE_FREEIF(tmp_album->path); + + if (tmp_album->folder_h) + media_folder_destroy(tmp_album->folder_h); + GE_FREE(tmp_album); + *album = NULL; + return 0; +} + +int _ge_data_type_free_album_list(Eina_List **list) +{ + GE_CHECK_VAL(list, -1); + GE_CHECK_VAL(*list, -1); + ge_album_s *item = NULL; + Eina_List *tmp_list = *list; + EINA_LIST_FREE(tmp_list, item) { + if (item) + __ge_data_type_free_album(&item); + } + eina_list_free(*list); + *list = NULL; + return 0; +} + +int _ge_data_type_free_geitem(void **item) +{ + GE_CHECK_VAL(item, -1); + GE_CHECK_VAL(*item, -1); + int ret = -1; + + if(((ge_album_s *)*item)->gtype == GE_TYPE_ALBUM) + ret = __ge_data_type_free_album((ge_album_s **)item); + else if (((ge_media_s *)*item)->gtype == GE_TYPE_MEDIA) + ret = __ge_data_type_free_media((ge_media_s **)item); + + if (ret < 0) + return -1; + else + return 0; +} + + + diff --git a/ug/ug-gallery-efl/src/ge-data.c b/ug/ug-gallery-efl/src/ge-data.c new file mode 100755 index 0000000..8e76e2e --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-data.c @@ -0,0 +1,988 @@ +/* + * Copyright (c) 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 "ge-data.h" +#include "ge-debug.h" +#include "ge-util.h" +#include "ge-drm.h" +#include "ge-strings.h" + +static int ge_all_count = 0; +static Eina_List* ge_db_item_list = NULL; +static Eina_List* ge_item_selected_list = NULL; + +#define ALBUM_ALL_LEN 4 +#define GE_DB_FILE_LEN_MAX 1024 + +/* +* create a gitem +*/ +static ge_item* __ge_data_calloc_geitem(void) +{ + ge_item* gitem = (ge_item*)calloc(1, sizeof(ge_item)); + GE_CHECK_NULL(gitem); + return gitem; +} + +/* +* destroy a ge_item +*/ +static int __ge_data_free_geitem(ge_item* gitem) +{ + if(gitem) { + if(gitem->item) { + _ge_data_type_free_geitem((void **)&(gitem->item)); + gitem->item = NULL; + } + + GE_FREEIF(gitem->_reserved); + GE_FREE(gitem); + } + return 0; +} + +static int __ge_data_free_mtype_items_list(Eina_List **elist) +{ + void *current = NULL; + + if (elist && *elist) { + ge_dbg("Clear Mitems list."); + EINA_LIST_FREE(*elist, current) { + if (current) { + _ge_data_type_free_geitem((void **)¤t); + current = NULL; + } + } + + *elist = NULL; + } + + return 0; +} + +static int __ge_data_free_items_list(void) +{ + ge_item* current = NULL; + + if (ge_db_item_list) { + ge_dbg("Clear items list."); + EINA_LIST_FREE(ge_db_item_list, current) { + __ge_data_free_geitem(current); + current = NULL; + } + } + ge_db_item_list = NULL; + ge_all_count = 0; + return 0; +} + +static int __ge_data_free_cluster(ge_cluster* gcluster) +{ + GE_CHECK_VAL(gcluster, -1); + if(gcluster->cluster) { + _ge_data_type_free_geitem((void **)&(gcluster->cluster)); + gcluster->cluster = NULL; + } + + GE_FREEIF(gcluster->_reserved); + GE_FREE(gcluster); + return 0; +} + +static int __ge_data_free_clusters_list(ge_ugdata* ugd) +{ + GE_CHECK_VAL(ugd, -1); + ge_cluster* current = NULL; + Eina_List* tmp_list = NULL; + + _ge_set_current_album(NULL); + + if(ugd->cluster_list) { + if(ugd->cluster_list->clist) { + ge_dbg("Clear clusters list."); + tmp_list = ugd->cluster_list->clist; + EINA_LIST_FREE(tmp_list, current) { + if(current) + __ge_data_free_cluster(current); + + current = NULL; + } + ugd->cluster_list->clist = NULL; + } + + GE_FREE(ugd->cluster_list); + } + + return 0; +} + +static ge_cluster_list* __ge_data_calloc_clusters_list(void) +{ + ge_cluster_list* clus_list = (ge_cluster_list*)calloc(1, + sizeof(ge_cluster_list)); + GE_CHECK_NULL(clus_list); + return clus_list; +} + +static ge_cluster* __ge_data_calloc_cluster(void) +{ + ge_cluster* gcluster = (ge_cluster*)calloc(1, sizeof(ge_cluster)); + GE_CHECK_NULL(gcluster); + return gcluster; +} + +/* Create 'All' album */ +static ge_cluster* __ge_data_new_cluster_all(ge_ugdata* ugd, int count) +{ + GE_CHECK_NULL(ugd); + ge_cluster* gcluster = __ge_data_calloc_cluster(); + GE_CHECK_NULL(gcluster); + + /* Pass -1 to get a mcluster from libmedia-info, not a real record in DB */ + ge_album_s *cluster = NULL; + _ge_data_type_new_album(&cluster); + if(cluster == NULL) { + GE_FREE(gcluster); + return NULL; + } + + cluster->uuid = strdup(GE_ALBUM_ALL_ID); + cluster->display_name = strdup(GE_ALBUM_ALL_NAME); + cluster->count = count; + cluster->type = GE_PHONE; + gcluster->cluster = cluster; + gcluster->ugd = ugd; + gcluster->index = 0; + + return gcluster; +} + +/* Case 1: Carema shot[0], All[1], ...; Case 2: All[0], ... */ +static int __ge_data_get_clusters_list(ge_ugdata* ugd) +{ + GE_CHECK_VAL(ugd, -1); + int length = 0; + int local_item_cnt = 0; + Eina_List *item_list = NULL; + ge_album_s *f_data = NULL; + ge_cluster *default_album = NULL; + ge_cluster* gcluster = NULL; + int medias_cnt = 0; + int err = -1; + ge_filter_s filter; + + /* Get real albums */ + memset(&filter, 0x00, sizeof(ge_filter_s)); + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + if (!ugd->b_show_drm) + g_strlcat(filter.cond, GE_CONDITION_DRM, + CONDITION_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH); + filter.offset = GE_GET_ALL_RECORDS; + filter.count = GE_GET_ALL_RECORDS; + filter.with_meta = false; + + err = _ge_local_data_get_album_list(&filter, &item_list); + if(err != 0) { + ge_dbgW("No record"); + if (item_list) + __ge_data_free_mtype_items_list(&item_list); + } else { + memset(&filter, 0x00, sizeof(ge_filter_s)); + if (ugd->file_type_mode == GE_FILE_T_IMAGE) + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, + CONDITION_LENGTH); + else if (ugd->file_type_mode == GE_FILE_T_VIDEO) + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, + CONDITION_LENGTH); + else + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + if (!ugd->b_show_drm) + g_strlcat(filter.cond, GE_CONDITION_DRM, + CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_DISPLAY_NAME, + KEYWORD_LENGTH); + filter.offset = GE_GET_ALL_RECORDS; + filter.count = GE_GET_ALL_RECORDS; + filter.with_meta = false; + } + Eina_List* clist = ugd->cluster_list->clist; + EINA_LIST_FREE(item_list, f_data) { + if (f_data == NULL || f_data->uuid == NULL) { + /* Invalid data, next one */ + ge_dbgE("Invalid ge_album_s!"); + continue; + } + ge_dbg("Cluster ID: %s.", f_data->uuid); + if (f_data->count == 0) { + ge_dbgE("The count of album is zero!"); + _ge_data_type_free_geitem((void **)&f_data); + continue; + } + + /* only image is valid in setas mode. */ + if (ugd->file_type_mode == GE_FILE_T_IMAGE || + ugd->file_type_mode == GE_FILE_T_VIDEO) { + err = _ge_local_data_get_media_count(f_data->uuid, + &filter, + &medias_cnt); + if(err == 0) { + f_data->count = medias_cnt; + } else { + f_data->count = 0; + ge_dbgW("minfo_get_cluster_cnt[err:%d]", err); + } + } + if(f_data->count == 0) { + ge_dbgW("local album is empty, skipping it."); + _ge_data_type_free_geitem((void **)&f_data); + continue; + } else { + local_item_cnt += f_data->count; + } + gcluster = __ge_data_calloc_cluster(); + if(gcluster == NULL) { + ge_dbgE("__ge_data_calloc_cluster failed!"); + _ge_data_type_free_geitem((void **)&f_data); + continue; + } + + gcluster->cluster = f_data; + gcluster->ugd = ugd; + length += f_data->count; + + if (_ge_data_is_default_album(GE_ALBUM_CAMERA_NAME, f_data)) { + /** + * Default album: Camera Shot + * Now Camera Shot is located in Phone. + * If user can determine the location of default album, + * here we should get the path and check it's in Phone or MMC. + */ + default_album = gcluster; + clist = eina_list_prepend(clist, gcluster); + } else if (_ge_data_is_default_album(GE_ALBUM_DOWNLOAD_NAME, f_data)) { + if (default_album) + clist = eina_list_append_relative(clist, gcluster, + default_album); + else + clist = eina_list_prepend(clist, gcluster); + } else { + clist = eina_list_append(clist, gcluster); + } + ugd->cluster_list->clist = clist; + } + ge_dbg("Get local clusters list Done[%d]!", local_item_cnt); + if(local_item_cnt) { + /* Create "All" album if any file exists */ + gcluster = __ge_data_new_cluster_all(ugd, local_item_cnt); + GE_CHECK_VAL(gcluster, -1); + + if(default_album) + clist = eina_list_append_relative(clist, gcluster, + default_album); + else + clist= eina_list_prepend(clist, gcluster); + + ugd->cluster_list->clist = clist; + ge_dbg("Cluster All added!"); + } + + return length; +} + +static int __ge_data_get_selected_item_id_list(Eina_List **sel_id_list) +{ + GE_CHECK_VAL(sel_id_list, -1); + GE_CHECK_VAL(ge_item_selected_list, -1); + ge_item *gitem = NULL; + char *item_id = NULL; + + /* Save ID of selected items */ + EINA_LIST_FREE(ge_item_selected_list, gitem) { + if (gitem && gitem->item && gitem->item->uuid) { + item_id = strdup(gitem->item->uuid); + //ge_dbg("Append item ID: %s", item_id); + *sel_id_list = eina_list_append(*sel_id_list, + (void *)item_id); + } + } + + _ge_data_selected_list_finalize(); + return 0; +} + +/* Free list of selected IDs */ +static int __ge_data_free_selected_id_list(Eina_List **sel_id_list) +{ + GE_CHECK_VAL(sel_id_list, -1); + if (*sel_id_list == NULL) { + ge_dbg("sel_id_list is empty!"); + return -1; + } + + void *p_id = NULL; + EINA_LIST_FREE(*sel_id_list, p_id) { + if (p_id == NULL) { + ge_dbgE("Invalid p_id!"); + continue; + } + GE_FREE(p_id); + } + *sel_id_list = NULL; + return 0; +} + +/* Check ID is in the list or not */ +static bool __ge_data_check_selected_id(Eina_List **sel_id_list, const char *id) +{ + GE_CHECK_FALSE(sel_id_list); + GE_CHECK_FALSE(id); + Eina_List *tmp_elist = NULL; + void *p_id = NULL; + + if (eina_list_count(*sel_id_list) == 0) { + ge_dbgE("sel_id_list is empty!"); + return false; + } + + EINA_LIST_FOREACH(*sel_id_list, tmp_elist, p_id) { + if (p_id == NULL) { + ge_dbgE("Invalid p_id!"); + continue; + } + if (g_strcmp0(id, p_id)) { + p_id = NULL; + continue; + } + + *sel_id_list = eina_list_remove(*sel_id_list, p_id); + GE_FREE(p_id); + return true; + } + return false; +} + +int _ge_data_update_items_cnt(ge_ugdata* ugd, ge_cluster *album) +{ + GE_CHECK_VAL(album, -1); + GE_CHECK_VAL(album->cluster, -1); + GE_CHECK_VAL(album->cluster->uuid, -1); + GE_CHECK_VAL(ugd, -1); + int err = -1; + int item_count = 0; + + ge_filter_s filter; + memset(&filter, 0x00, sizeof(ge_filter_s)); + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.offset = GE_GET_ALL_RECORDS; + filter.count = GE_GET_ALL_RECORDS; + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); + filter.with_meta = false; + + if(ugd->file_type_mode == GE_FILE_T_IMAGE) + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + else if(ugd->file_type_mode == GE_FILE_T_VIDEO) + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH); + + if (!ugd->b_show_drm) + g_strlcat(filter.cond, GE_CONDITION_DRM, CONDITION_LENGTH); + + if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { + /* Local album */ + err = _ge_local_data_get_media_count(album->cluster->uuid, + &filter, + &item_count); + } else { + /* "All albums" album */ + ge_dbg("all media count"); + err = _ge_local_data_get_all_media_count(&filter, &item_count); + } + if(err < 0) { + ge_dbgE("Get item count failed(%d)!", err); + return -1; + } + + ge_dbg("cluster media count : old=%d, new=%d", album->cluster->count, + item_count); + album->cluster->count = item_count; + + return 0; +} + +int _ge_data_get_clusters_list(ge_ugdata* ugd) +{ + GE_CHECK_VAL(ugd, -1); + int n_entire_items = 0; + + __ge_data_free_clusters_list(ugd); + + ugd->cluster_list = __ge_data_calloc_clusters_list(); + GE_CHECK_VAL(ugd->cluster_list, -1); + + n_entire_items = __ge_data_get_clusters_list(ugd); + ge_dbg("Total media items count:%d", n_entire_items); + /* if error code is returned, negative value is possible */ + if(n_entire_items <= 0) + return -1; + + return 0; +} + +/* Clear items list */ +int _ge_data_free_items_list(void) +{ + return __ge_data_free_items_list(); +} + +int _ge_data_get_items_list(ge_ugdata* ugd, ge_cluster *album, int start_pos, + int end_pos) +{ + GE_CHECK_VAL(album, -1); + GE_CHECK_VAL(album->cluster, -1); + GE_CHECK_VAL(album->cluster->uuid, -1); + GE_CHECK_VAL(ugd, -1); + Eina_List* itemlist = NULL; + int err = -1; + ge_filter_s filter; + + memset(&filter, 0, sizeof(ge_filter_s)); + ge_dbg("--start_pos[%d], end_pos[%d]--", start_pos, end_pos); + if(ugd->file_type_mode == GE_FILE_T_IMAGE) { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) { + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH); + } else { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + } + if (!ugd->b_show_drm) + g_strlcat(filter.cond, GE_CONDITION_DRM, CONDITION_LENGTH); + + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.offset = start_pos; + filter.count = end_pos - start_pos + 1; + filter.with_meta = true; + + if (start_pos == (GE_FIRST_VIEW_END_POS+1) && + end_pos == GE_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + ge_dbg("Gridview append idler; Keep ge_db_item_list unchanged."); + } else { + /*Clear item list before new one got */ + __ge_data_free_items_list(); + } + + if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { + /* real album */ + ge_dbg("--Real album--"); + err = _ge_local_data_get_album_media_list(album->cluster->uuid, + &filter, + &itemlist); + } else { + /* add "All" album */ + ge_dbg("--Album All--"); + err = _ge_local_data_get_all_albums_media_list(&filter, + &itemlist); + } + + if((err == 0) && (itemlist != NULL)) { + ge_media_s *item = NULL; + ge_item* gitem = NULL; + EINA_LIST_FREE(itemlist, item) + { + if (item == NULL || item->uuid == NULL) { + ge_dbgE("Invalid item!"); + continue; + } + + gitem = __ge_data_calloc_geitem(); + if(gitem == NULL) { + ge_dbgE("__ge_data_calloc_geitem() failed"); + _ge_data_type_free_geitem((void **)&item); + continue; + } + + gitem->item = item; + gitem->ugd = ugd; + ge_db_item_list = eina_list_append(ge_db_item_list, + gitem); + item = NULL; + gitem = NULL; + } + + ge_all_count = eina_list_count(ge_db_item_list); + } else { + /* Free Mitems */ + if (itemlist) + __ge_data_free_mtype_items_list(&itemlist); + + if (start_pos == (GE_FIRST_VIEW_END_POS+1) && + end_pos == GE_GET_UNTIL_LAST_RECORD) { + /* Keep medias_elist and medias_cnt unchanged */ + ge_all_count = eina_list_count(ge_db_item_list); + ge_dbg("Gridview append idler."); + } else { + ge_all_count = 0; + } + } + ge_dbg("DB all count : %d, ge_db_item_list=%p", ge_all_count, + ge_db_item_list); + + return err; +} + +/* Update items list, especially used in thumbnails edit view */ +int _ge_data_update_items_list(ge_ugdata* ugd, ge_cluster *album) +{ + GE_CHECK_VAL(album, -1); + GE_CHECK_VAL(album->cluster, -1); + GE_CHECK_VAL(album->cluster->uuid, -1); + GE_CHECK_VAL(ugd, -1); + Eina_List* itemlist = NULL; + int err = -1; + ge_dbg("Update content of %s", album->cluster->display_name); + int view_mode = _ge_get_view_mode(); + Eina_List *sel_id_list = NULL; + + if (view_mode == GE_VIEW_THUMBS_EDIT && + ugd->file_select_mode != GE_FILE_SELECT_T_ONE) { + ge_dbg("Edit view for multiple selection."); + /* Get ID list of selected items */ + __ge_data_get_selected_item_id_list(&sel_id_list); + } + ge_filter_s filter; + memset(&filter, 0x00, sizeof(ge_filter_s)); + + if(ugd->file_type_mode == GE_FILE_T_IMAGE) { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) { + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH); + } else { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + } + + if (!ugd->b_show_drm) + g_strlcat(filter.cond, GE_CONDITION_DRM, CONDITION_LENGTH); + + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.offset = GE_GET_ALL_RECORDS; + filter.count = GE_GET_ALL_RECORDS; + filter.with_meta = true; + + /*Clear item list before new one got */ + __ge_data_free_items_list(); + + if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { + err = _ge_local_data_get_album_media_list(album->cluster->uuid, + &filter, + &itemlist); + } else { + err = _ge_local_data_get_all_albums_media_list(&filter, + &itemlist); + } + + if ((err != 0) || (itemlist == NULL)) { + ge_dbgE("(err != 0) || (itemlist == NULL)"); + /* Free Mitems */ + if (itemlist) + __ge_data_free_mtype_items_list(&itemlist); + ge_all_count = 0; + return err; + } + + bool b_selected = false; + ge_media_s *item = NULL; + ge_item* gitem = NULL; + EINA_LIST_FREE(itemlist, item) { + if (item == NULL || item->uuid == NULL) { + ge_dbgE("Invalid item!"); + continue; + } + gitem = __ge_data_calloc_geitem(); + if(gitem == NULL) { + ge_dbgE("__ge_data_calloc_geitem() failed"); + _ge_data_type_free_geitem((void **)&item); + continue; + } + + gitem->item = item; + gitem->ugd = ugd; + ge_db_item_list = eina_list_append(ge_db_item_list, gitem); + + if (sel_id_list) { + b_selected = __ge_data_check_selected_id(&sel_id_list, + item->uuid); + if (b_selected) { + b_selected = false; + /* Set checkbox state */ + gitem->checked = true; + /* Append gitem to selected list */ + _ge_data_selected_list_append(gitem); + } + } + + item = NULL; + gitem = NULL; + } + + /* Clear list of selected ID */ + if (sel_id_list) + __ge_data_free_selected_id_list(&sel_id_list); + + ge_all_count = eina_list_count(ge_db_item_list); + ge_dbg("DB all count : %d, ge_db_item_list=%p", ge_all_count, + ge_db_item_list); + + return err; +} + +int _ge_data_get_first_several_items(ge_ugdata* ugd, ge_cluster *album, + ge_item* items[], int *item_count, + media_content_order_e sort_type) +{ + GE_CHECK_VAL(item_count, -1); + GE_CHECK_VAL(items, -1); + GE_CHECK_VAL(album, -1); + GE_CHECK_VAL(album->cluster, -1); + GE_CHECK_VAL(album->cluster->uuid, -1); + GE_CHECK_VAL(ugd, -1); + + Eina_List *item_list = NULL; + int result_cnt = 0; + ge_media_s *item = NULL; + ge_item* gitem = NULL; + int err = -1; + + if (*item_count <= 0) { + ge_dbgE("*item_count <= 0"); + return -1; + } + + ge_filter_s filter; + memset(&filter, 0x00, sizeof(ge_filter_s)); + + if (ugd->file_type_mode == GE_FILE_T_IMAGE) { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) { + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH); + } else { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + } + if (!ugd->b_show_drm) + g_strlcat(filter.cond, GE_CONDITION_DRM, CONDITION_LENGTH); + + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + filter.sort_type = sort_type; + g_strlcpy(filter.sort_keyword, MEDIA_MODIFIED_TIME, KEYWORD_LENGTH); + filter.offset = 0; + filter.count = *item_count; + filter.with_meta = false; + + if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { + /*real album */ + err = _ge_local_data_get_album_media_list(album->cluster->uuid, + &filter, + &item_list); + if (err != 0 || item_list == NULL) { + ge_dbgE("Get albums media list failed[%d]!", err); + goto DB_FAILED; + } + } else { + /* add "All" album */ + err = _ge_local_data_get_all_albums_media_list(&filter, + &item_list); + if (err != 0 || item_list == NULL) { + ge_dbgE("Get all albums media list failed[%d]!", err); + goto DB_FAILED; + } + } + + EINA_LIST_FREE(item_list, item) { + if (item == NULL) { + ge_dbgE("Invalid ge_meida_s!"); + continue; + } + result_cnt++; + if(result_cnt <= *item_count) { + gitem = NULL; + gitem = __ge_data_calloc_geitem(); + if (gitem == NULL) { + ge_dbgE("__ge_data_calloc_geitem failed!"); + _ge_data_type_free_geitem((void **)&item); + result_cnt--; + continue; + } + gitem->item = item; + items[result_cnt-1] = gitem; + } else { + _ge_data_type_free_geitem((void **)&item); + } + item = NULL; + } + + if(*item_count > result_cnt) + *item_count = result_cnt; + + ge_dbg("First %d items of [%s]", *item_count, + album->cluster->display_name); + return *item_count; + + DB_FAILED: + *item_count = 0; + /* Free Mitems */ + if (item_list) + __ge_data_free_mtype_items_list(&item_list); + return -1; +} + +int _ge_data_del_media_id(ge_ugdata* ugd, const char *media_id) +{ + GE_CHECK_VAL(media_id, -1); + int ret = media_info_delete_from_db(media_id); + if(ret != 0) { + ge_dbgE("Delete media failed[%d]!", ret); + return -1; + } + + return 0; +} + +int _ge_data_item_list_remove(ge_item* gitem) +{ + GE_CHECK_VAL(gitem, -1); + GE_CHECK_VAL(gitem->item, -1); + GE_CHECK_VAL(gitem->item->uuid, -1); + ge_item* current = NULL; + Eina_List* l = NULL; + + EINA_LIST_FOREACH(ge_db_item_list, l, current) { + + if (current == NULL || current->item == NULL || + current->item->uuid == NULL) { + ge_dbgE("Invalid gitem!"); + continue; + } + if (!g_strcmp0(current->item->uuid, gitem->item->uuid)) { + ge_db_item_list = eina_list_remove(ge_db_item_list, + current); + ge_all_count--; + __ge_data_free_geitem(current); + current = NULL; + break; + } + } + return 0; +} + +int _ge_data_destroy_item(ge_item * gitem) +{ + GE_CHECK_VAL(gitem, -1); + + __ge_data_free_geitem(gitem); + return 0; +} + +int _ge_data_get_item_by_index(ge_item** gitem, int idx) +{ + GE_CHECK_VAL(gitem, -1); + + if (idx > ge_all_count) { + ge_dbgW("Get item(%d)failed!", idx); + *gitem = NULL; + return -1; + } + + *gitem = eina_list_nth(ge_db_item_list, idx -1); + return 0; +} + +int _ge_data_get_count_all(void) +{ + return ge_all_count; +} + +int _ge_data_get_selected_item_by_index(ge_item** gitem, int idx) +{ + GE_CHECK_VAL(gitem, -1); + + if (idx > _ge_data_selected_list_count()) { + ge_dbgW("Get selected item(%d)failed!", idx); + *gitem = NULL; + return -1; + } + + *gitem = eina_list_nth(ge_item_selected_list, idx -1); + return 0; +} + +int _ge_data_selected_list_count(void) +{ + return eina_list_count(ge_item_selected_list); +} + +Eina_List* _ge_data_get_selected_list(void) +{ + return ge_item_selected_list; +} + +int _ge_data_selected_list_append(ge_item* gitem) +{ + GE_CHECK_VAL(gitem, -1); + + ge_item_selected_list = eina_list_append(ge_item_selected_list, gitem); + return 0; +} + +int _ge_data_selected_list_remove(ge_item* gitem) +{ + GE_CHECK_VAL(gitem, -1); + GE_CHECK_VAL(gitem->item, -1); + GE_CHECK_VAL(gitem->item->uuid, -1); + ge_item* current = NULL; + Eina_List* l = NULL; + + EINA_LIST_FOREACH(ge_item_selected_list, l, current) { + if(current == NULL || current->item == NULL || + current->item->uuid == NULL) { + ge_dbgE("Invald gitem!"); + continue; + } + if(!g_strcmp0(current->item->uuid, gitem->item->uuid)) { + ge_item_selected_list = eina_list_remove(ge_item_selected_list, + current); + break; + } + } + return 0; +} + +int _ge_data_selected_list_finalize(void) +{ + ge_item* gitem = NULL; + + EINA_LIST_FREE(ge_item_selected_list, gitem) { + if(gitem) + gitem->checked = false; + } + + ge_item_selected_list = NULL; + return 0; +} + +/* +* Check it's default album[Camera shot] or not +*/ +bool _ge_data_is_default_album(const char *match_folder, ge_album_s *album) +{ + GE_CHECK_FALSE(album); + GE_CHECK_FALSE(album->display_name); + GE_CHECK_FALSE(match_folder); + int ret = -1; + + /* Name is 'Camera shot' and folder locates in Phone */ + ret = g_strcmp0(album->display_name, match_folder); + if (ret == 0 && album->type == GE_PHONE) { + ge_dbg("Full path: %s", album->path); + /* Get parent directory */ + char *parent_path = ecore_file_dir_get(album->path); + GE_CHECK_FALSE(parent_path); + ge_dbg("Parent path: %s", parent_path); + + /* Parent directory is same as Phone root path, it's default folder */ + ret = g_strcmp0(parent_path, GE_ROOT_PATH_PHONE); + GE_FREE(parent_path); + + if (ret == 0) { + ge_dbgW("Default folder!"); + return true; + } + } + + return false; +} + +bool _ge_data_is_root_path(const char *path) +{ + GE_CHECK_FALSE(path); + + if(!g_strcmp0(GE_ROOT_PATH_PHONE, path) || + !g_strcmp0(GE_ROOT_PATH_MMC, path)) { + ge_dbg("Root path: %s", path); + return true; + } + + return false; +} + +/* Creates a thumbnail image for given the media, asynchronously */ +int _ge_data_create_thumb(ge_item *gitem, media_thumbnail_completed_cb callback, + void *user_data) +{ + GE_CHECK_VAL(gitem, -1); + GE_CHECK_VAL(gitem->item, -1); + GE_CHECK_VAL(gitem->item->media_h, -1); + int ret = -1; + ge_dbg("File[%s]", gitem->item->file_url); + + ret = media_info_create_thumbnail(gitem->item->media_h, callback, + user_data); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Failed to create thumbnail!"); + return -1; + } + return 0; +} + +int _ge_data_init(ge_ugdata* ugd) +{ + ge_dbg("Connect to DB!"); + GE_CHECK_VAL(ugd, -1); + int err = _ge_local_data_connect(); + if (err != 0) { + ge_dbgE("Local connection failed[%d]!", err); + return -1; + } + + return 0; +} + +int _ge_data_finalize(ge_ugdata* ugd) +{ + ge_dbg("Free memory and disconnect with DB!"); + GE_CHECK_VAL(ugd, -1); + __ge_data_free_clusters_list(ugd); + __ge_data_free_items_list(); + + int err = _ge_local_data_disconnect(); + if (err != 0) { + ge_dbgE("Local disconnection failed[%d]!", err); + return -1; + } + return 0; +} + diff --git a/ug/ug-gallery-efl/src/ge-debug.c b/ug/ug-gallery-efl/src/ge-debug.c new file mode 100755 index 0000000..9a14a7c --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-debug.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 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 "ge-debug.h" + +#ifdef _USE_LOG_FILE_ +static char _g_file_path[GE_DB_FILE_LEN_MAX] = { 0, }; +#endif + + diff --git a/ug/ug-gallery-efl/src/ge-drm.c b/ug/ug-gallery-efl/src/ge-drm.c new file mode 100755 index 0000000..a5afb39 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-drm.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 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 "gallery-efl.h" +#include "ge-ui-util.h" +#include "ge-debug.h" +#include "ge-drm.h" +#include "ge-icon.h" + +int ge_drm_get_permtype(int gitem_type) +{ + switch (gitem_type) { + case MEDIA_CONTENT_TYPE_IMAGE: + return DRM_PERMISSION_TYPE_DISPLAY; + case MEDIA_CONTENT_TYPE_VIDEO: + return DRM_PERMISSION_TYPE_PLAY; + default: + return -1; + } +} + +Eina_Bool ge_drm_check_valid_ro(const char *file_path, + drm_permission_type_e permType) +{ + GE_CHECK_FALSE(file_path); + ge_dbg("file_path: %s", file_path); + int ret = -1; + + drm_license_status_e license_status = DRM_LICENSE_STATUS_UNDEFINED; + ret = drm_get_license_status(file_path, permType, &license_status); + if (DRM_RETURN_SUCCESS == ret && + DRM_LICENSE_STATUS_VALID == license_status) { + return EINA_TRUE; + } else { + ge_dbg("No valid ro, return %d", license_status); + return EINA_FALSE; + } +} + +Eina_Bool ge_drm_is_drm_file(const char* file_path) +{ + GE_CHECK_FALSE(file_path); + ge_dbg("file_path: %s.", file_path); + + drm_bool_type_e is_drm_file = DRM_UNKNOWN; + if(drm_is_drm_file(file_path, &is_drm_file) != DRM_RETURN_SUCCESS) { + ge_dbgE("drm_is_drm_file error"); + return EINA_FALSE; + } + + if (DRM_TRUE == is_drm_file) + return EINA_TRUE; + return EINA_FALSE; +} + +char* ge_drm_get_file_path(void *item) +{ + ge_item* gitem = (ge_item *)item; + + if(!gitem || !gitem->item || !gitem->item->file_url) + return NULL; + ge_dbg("filepath: %s", gitem->item->file_url); + + if(ge_drm_is_drm_file(gitem->item->file_url)) + return strdup(GE_DEFAULT_THUMB_ICON); + else + return strdup(gitem->item->file_url); +} + diff --git a/ug/ug-gallery-efl/src/ge-exif.c b/ug/ug-gallery-efl/src/ge-exif.c new file mode 100755 index 0000000..af44eaf --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-exif.c @@ -0,0 +1,1361 @@ +/* + * Copyright (c) 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 +*/ + +#ifdef _USE_ROTATE_BG_GE + +#include +#include +#include +#include +#include "ge-exif.h" +#include "ge-debug.h" +#include "ge-data-type.h" + +#define GE_EXIF_BUF_LEN_MAX 65536L +#define GE_EXIF_BUF_TIME_LEN_MAX 20 +#define GE_EXIF_DEFAULT_YEAR 1900 + +#define GE_EXIF_SOI 0xD8 +#define GE_EXIF_TAG 0xFF +#define GE_EXIF_APP0 0xE0 +#define GE_EXIF_APP1 0xE1 +#define GE_EXIF_JFIF_00 0x00 +#define GE_EXIF_JFIF_01 0x01 +#define GE_EXIF_JFIF_02 0x02 + +#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_BYTE 1 +#define GE_EXIF_IFD_DATA_FORMAT_ASCII_STRINGS 1 +#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_SHORT 2 +#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_LONG 4 +#define GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_RATIONAL 8 +#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_BYTE 1 +#define GE_EXIF_IFD_DATA_FORMAT_UNDEFINED 1 +#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_SHORT 2 +#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_LONG 4 +#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_RATIONAL 8 +#define GE_EXIF_IFD_DATA_FORMAT_SIGNED_FLOAT 4 +#define GE_EXIF_IFD_DATA_FORMAT_DOUBLE_FLOAT 8 + +#define GE_EXI_TMP_JPEG_FILE "/opt/usr/apps/org.tizen.gallery/data/.gallery_tmp_write_exif.jpg" + +/* Write one byte, testing for EOF */ +static int __ge_exif_write_1_byte(FILE *fd, int c) +{ + if (fputc(c, fd) < 0) { + ge_dbgE("fputc failed!"); + return -1; + } + + return 0; +} + +/* Read one byte, testing for EOF */ +static int __ge_exif_read_1_byte(FILE *fd) +{ + int c = 0; + + /* Return next input byte, or EOF if no more */ + c = getc(fd); + if (c == EOF) { + ge_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 __ge_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) { + ge_dbgE("Premature EOF in JPEG file!"); + return -1; + } + + /* Return next input byte, or EOF if no more */ + c2 = getc(fd); + if (c2 == EOF) { + ge_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 __ge_exif_add_header(FILE *fd, unsigned int *orientation) +{ + GE_CHECK_VAL(orientation, -1); + GE_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[] = { + GE_EXIF_TAG, GE_EXIF_SOI, GE_EXIF_TAG, GE_EXIF_APP1 + }; + /* Write File head, check for JPEG SOI + Exif APP1 */ + for (i = 0; i < 4; i++) { + if (__ge_exif_write_1_byte(fd, exif1[i]) < 0) + goto GE_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 (__ge_exif_write_1_byte(fd, exif2[i]) < 0) + goto GE_EXIF_FAILED; + } + + /* Write Exif head -- "Exif" */ + const unsigned char exif3[] = { 0x45, 0x78, 0x69, 0x66, 0x00, 0x00 }; + for (i = 0; i < 6; i++) { + if (__ge_exif_write_1_byte(fd, exif3[i]) < 0) + goto GE_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 (__ge_exif_write_1_byte(fd, exif4[i]) < 0) + goto GE_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 (__ge_exif_write_1_byte(fd, exif5[i]) < 0) + goto GE_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 (__ge_exif_write_1_byte(fd, exif6[i]) < 0) + goto GE_EXIF_FAILED; + } + offset += 2; + + /* Add Orientation Tag in IFD0; 0x0112 */ + const unsigned char exif7[] = { 0x12, 0x01 }; + for (i = 0; i < 2; i++) { + if (__ge_exif_write_1_byte(fd, exif7[i]) < 0) + goto GE_EXIF_FAILED; + } + offset += 2; + + ge_dbg("Write: %d", *orientation); + const unsigned char exif8[] = { 0x03, 0x00, 0x01, 0x00, 0x00, 0x00 }; + for (i = 0; i < 6; i++) { + if (__ge_exif_write_1_byte(fd, exif8[i]) < 0) + goto GE_EXIF_FAILED; + } + offset += 6; + + /* Set the Orientation value */ + if (__ge_exif_write_1_byte(fd, (unsigned char)(*orientation)) < 0) + goto GE_EXIF_FAILED; + + const unsigned char exif9[] = { 0x00, 0x00, 0x00 }; + for (i = 0; i < 3; i++) { + if (__ge_exif_write_1_byte(fd, exif9[i]) < 0) + goto GE_EXIF_FAILED; + } + offset += 4; + + /* Add Data Time Tag in IFD0; 0x0132 */ + const unsigned char exif10[] = { 0x32, 0x01 }; + for (i = 0; i < 2; i++) { + if (__ge_exif_write_1_byte(fd, exif10[i]) < 0) + goto GE_EXIF_FAILED; + } + offset += 2; + + /* Type: strings */ + const unsigned char exif11[] = { 0x02, 0x00 }; + for (i = 0; i < 2; i++) { + if (__ge_exif_write_1_byte(fd, exif11[i]) < 0) + goto GE_EXIF_FAILED; + } + offset += 2; + + /* Data lengh, byte count */ + const unsigned char exif12[] = { 0x14, 0x00, 0x00, 0x00 }; + for (i = 0; i < 4; i++) { + if (__ge_exif_write_1_byte(fd, exif12[i]) < 0) + goto GE_EXIF_FAILED; + } + offset += 8; + + /* 20 bytes larger than 4 bytes, + * so next 4 bytes is data offset start from "II"(0x4949)*/ + + ge_dbg("offset: %2X", offset + 8); + /* Too add data offset, plus 4 bytes self and plus 4 bytes IFD terminator */ + if (__ge_exif_write_1_byte(fd, (unsigned char)(offset + 4)) < 0) + goto GE_EXIF_FAILED; + + const unsigned char exif13[] = { 0x00, 0x00, 0x00 }; + for (i = 0; i < 3; i++) { + if (__ge_exif_write_1_byte(fd, exif13[i]) < 0) + goto GE_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 (__ge_exif_write_1_byte(fd, exif14[i]) < 0) + goto GE_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, GE_EXIF_BUF_TIME_LEN_MAX); + if (time_buf == NULL) { + ge_dbgE("Faild to allocate memory!"); + goto GE_EXIF_FAILED; + } + snprintf(time_buf, GE_EXIF_BUF_TIME_LEN_MAX, + "%04i:%02i:%02i %02i:%02i:%02i", + tm->tm_year + GE_EXIF_DEFAULT_YEAR, tm->tm_mon + 1, + tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); + + ge_dbg("time_buf: %s", time_buf); + if (fwrite(time_buf, 1, GE_EXIF_BUF_TIME_LEN_MAX, fd) != GE_EXIF_BUF_TIME_LEN_MAX) { + ge_dbgW("Write size are diff!"); + goto GE_EXIF_FAILED; + } + + ret = 0; + + GE_EXIF_FAILED: + + ge_dbg("All done"); + GE_FREEIF(time_buf); + return ret; +} + +/* Add exif to jfif , don't have exif */ +static int __ge_exif_add_exif_to_jfif(char *file_path, unsigned int *orientation) +{ + GE_CHECK_VAL(orientation, -1); + GE_CHECK_VAL(file_path, -1); + unsigned char tmp[GE_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + + if ((fd = fopen(file_path, "rb+")) == NULL) { + ge_dbgE("Can't open %s!", file_path); + return -1; + } + + char *tmp_file = GE_EXI_TMP_JPEG_FILE; + FILE *tmp_fd = NULL; + if ((tmp_fd = fopen(tmp_file, "wb+")) == NULL) { + ge_dbgE("Can't open %s!", tmp_file); + goto GE_EXIF_FAILED; + } + + /* Add raw EXIF header data */ + if (__ge_exif_add_header(tmp_fd, orientation) < 0) + goto GE_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, GE_EXIF_BUF_LEN_MAX); + /* Write JPEG image data to tmp file after EXIF header */ + while ((r_size = fread(tmp, 1, sizeof(tmp), fd)) > 0) { + ge_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, tmp_fd) != r_size) + ge_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GE_EXIF_BUF_LEN_MAX); + } + + fclose(fd); + fd = fopen(file_path, "wb"); + if (!fd) { + ge_dbgE("Error creating file %s!", file_path); + goto GE_EXIF_FAILED; + } + + memset(tmp, 0x00, GE_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) { + ge_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, fd) != r_size) + ge_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GE_EXIF_BUF_LEN_MAX); + } + + ret = 0; + + GE_EXIF_FAILED: + + if (fd) + fclose(fd); + if (tmp_fd) + fclose(tmp_fd); + + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + ge_dbgE("Delete file failed"); + + ge_dbg("All done"); + return ret; +} + +/* Add orientation tag to jpegs which have exif tag but do not have orientation tag: include jfif and exif*/ +static int __ge_exif_add_orientation_tag(char *file_path, + unsigned int *orientation){ + + GE_CHECK_VAL(orientation, -1); + GE_CHECK_VAL(file_path, -1); + unsigned char tmp[GE_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, + GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_BYTE, + GE_EXIF_IFD_DATA_FORMAT_ASCII_STRINGS, + GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_SHORT, + GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_LONG, + GE_EXIF_IFD_DATA_FORMAT_UNSIGNED_RATIONAL, + GE_EXIF_IFD_DATA_FORMAT_SIGNED_BYTE, + GE_EXIF_IFD_DATA_FORMAT_UNDEFINED, + GE_EXIF_IFD_DATA_FORMAT_SIGNED_SHORT, + GE_EXIF_IFD_DATA_FORMAT_SIGNED_LONG, + GE_EXIF_IFD_DATA_FORMAT_SIGNED_RATIONAL, + GE_EXIF_IFD_DATA_FORMAT_SIGNED_FLOAT, + GE_EXIF_IFD_DATA_FORMAT_DOUBLE_FLOAT + + }; + + if ((fd = fopen(file_path, "rb+")) == NULL) { + ge_dbgE("Can't open %s!", file_path); + return -1; + } + + char *tmp_file = GE_EXI_TMP_JPEG_FILE; + FILE *tmp_fd = NULL; + if ((tmp_fd = fopen(tmp_file, "wb+")) == NULL) { + ge_dbgE("Can't open %s!", tmp_file); + goto GE_EXIF_FAILED; + } + /* Find APP1 */ + bool b_tag_ff = false; + while(1){ + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + /*copy data from jpeg to tmp_fd (from "FF D8" to " FF E1",because those data we needn't modify)*/ + if (__ge_exif_write_1_byte(tmp_fd, tmp_exif) < 0) + goto GE_EXIF_FAILED; + + tmp[0] = (unsigned char)tmp_exif; + + ge_dbg("- %02X", tmp[0]); + if (!b_tag_ff) { + /* Get first tag */ + if (tmp[0] == GE_EXIF_TAG) { + ge_dbgW("0xFF!"); + b_tag_ff = true; + } + continue; + } + + /* Get APP1 */ + if (tmp[0] == GE_EXIF_APP1) { + ge_dbgW("Exif in APP1!"); + break; + } else { + ge_dbgW("0x%02X!",tmp[0]); + b_tag_ff = false; + } + } + + /* Get the marker parameter length count */ + if (__ge_exif_read_2_bytes(fd, &length) < 0) + goto GE_EXIF_FAILED; + ge_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) { + ge_dbgE("length < 8"); + goto GE_EXIF_FAILED; + } + /*modify the marker parameter length, orientation tag is 12*/ + length += 12; + ge_dbgW("modified length: %d", length); + tmp[0] =( length >> 8 )& 0xff ; + tmp[1] = length & 0xff ; + for(i = 0; i < 2; i++){ + if (__ge_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GE_EXIF_FAILED; + } + + for (i = 0; i < 6; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + ge_dbg("- %02X", tmp[i]); + if (__ge_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GE_EXIF_FAILED; + } + if (tmp[0] == 0x45 && tmp[1] == 0x78 && tmp[2] == 0x69 && tmp[3] == 0x66 && + tmp[4] == 0x00 && tmp[5] == 0x00) { + ge_dbgW("Met Exif!"); + } else { + ge_dbgW("Not met Exif!"); + goto GE_EXIF_FAILED; + } + /* Read Exif body */ + for (i = 0; i < 4; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + tmp[i] = (unsigned char)tmp_exif; + if (__ge_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GE_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) { + ge_dbg("Intel"); + is_motorola = false; + } else if (tmp[0] == 0x4D && tmp[1] == 0x4D && tmp[2] == 0x00 && + tmp[3] == 0x2A) { + ge_dbg("Motorola"); + is_motorola = true; + } else { + goto GE_EXIF_FAILED; + } + + for (i = 0; i < 4; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + ge_dbg("- %02X", tmp[i]); + if (__ge_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GE_EXIF_FAILED; + } + + /* Get first IFD offset (offset to IFD0) , MM-08000000, II-00000008 */ + if (is_motorola) { + if (tmp[0] != 0 && tmp[1] != 0) + goto GE_EXIF_FAILED; + offset = tmp[2]; + offset <<= 8; + offset += tmp[3]; + } else { + if (tmp[3] != 0 && tmp[2] != 0) + goto GE_EXIF_FAILED; + offset = tmp[1]; + offset <<= 8; + offset += tmp[0]; + } + ge_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 = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + ge_dbg("- %02X", tmp[i]); + if (__ge_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GE_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 = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_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]; + } + ge_dbg("tags_cnt: %d", tags_cnt); + /*modify tags num,add orientation tag */ + tags_cnt += 1; + ge_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++) { + ge_dbg("modified- %02X", tmp[i]); + if (__ge_exif_write_1_byte(tmp_fd, tmp[i]) < 0) + goto GE_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] = 0x00; + orientation_tag[10] = 0x00; + orientation_tag[11] = (unsigned char)(*orientation); + + } 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; + } + + while(1){ + if (--tags_cnt == 0) { + break; + } + + /* Every directory entry size is 12 */ + for (i = 0; i < 12; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_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]; + } + ge_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++){ + ge_dbg("orientation_tag- %02X", orientation_tag[j]); + if (__ge_exif_write_1_byte(tmp_fd, orientation_tag[j]) < 0) + goto GE_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]; + } + ge_dbgW("data_type %02X!" , data_type); + ge_dbgW("unit_num %02X!" , unit_num); + if((data_type < 1) ||(data_type > 12)){ + ge_dbgE("Wrong data type!"); + goto GE_EXIF_FAILED; + } + + data_length = ifd_data_format[data_type] * unit_num; + ge_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]; + ge_dbgW("offset_value %02X!" , offset_value); + /*add orientation offset*/ + offset_value += 12; + ge_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; + ge_dbg("tmp[8] %02X!" , tmp[8]); + ge_dbg("tmp[9] %02X!" , tmp[9]); + ge_dbg("tmp[10] %02X!" , tmp[10]); + ge_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]; + ge_dbgW("offset_value %02X!" , offset_value); + /*add orientation offset*/ + offset_value += 12; + ge_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; + ge_dbg("tmp[8] %02X!" , tmp[8]); + ge_dbg("tmp[9] %02X!" , tmp[9]); + ge_dbg("tmp[10] %02X!" , tmp[10]); + ge_dbg("tmp[11] %02X!" , tmp[11]); + + } + + } + + } + for(i = 0; i < 12 ;i++){ + ge_dbg("- %02X", tmp[i]); + if (__ge_exif_write_1_byte(tmp_fd,tmp[i]) < 0) + goto GE_EXIF_FAILED; + + } + memset(tmp, 0x00, 12); + + } + memset(tmp, 0x00, GE_EXIF_BUF_LEN_MAX); + /* Write JPEG image data to tmp file after EXIF header */ + while ((r_size = fread(tmp, 1, sizeof(tmp), fd)) > 0) { + ge_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, tmp_fd) != r_size) + ge_dbgW("Write and read size are diff!"); + + memset(tmp, 0x00, GE_EXIF_BUF_LEN_MAX); + } + fclose(fd); + fd = NULL; + fd = fopen(file_path, "wb"); + if (!fd) { + ge_dbgE("Error creating file %s!", file_path); + goto GE_EXIF_FAILED; + } + + memset(tmp, 0x00, GE_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) { + ge_dbg("r_size: %ld", r_size); + if (fwrite(tmp, 1, r_size, fd) != r_size) + ge_dbgW("Write and read size are diff!"); + memset(tmp, 0x00, GE_EXIF_BUF_LEN_MAX); + } + + ret = 0; + + GE_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)) + ge_dbgE("Delete file failed"); + + ge_dbg("All done"); + return ret; +} + +static int __ge_exif_rw_jfif(FILE *fd, char *file_path, + unsigned int *orientation, bool b_write) +{ + GE_CHECK_VAL(fd, -1); + GE_CHECK_VAL(file_path, -1); + GE_CHECK_VAL(orientation, -1); + unsigned char tmp[GE_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 (__ge_exif_read_2_bytes(fd, &length) < 0) + goto GE_EXIF_FAILED; + ge_dbg("length: %d", length); + + for (i = 0; i < 5; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_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) { + ge_dbgE("Not met Jfif!"); + goto GE_EXIF_FAILED; + } + + for (i = 0; i < 2; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + tmp[i] = (unsigned char)tmp_exif; + } + + /* Check JFIF version */ + if (tmp[0] == 0x01 && tmp[1] == GE_EXIF_JFIF_00) { + ge_dbg("Jfif 1.00"); + } else if (tmp[0] == 0x01 && tmp[1] == GE_EXIF_JFIF_01) { + ge_dbg("Jfif 1.01"); + } else if (tmp[0] == 0x01 && tmp[1] == GE_EXIF_JFIF_02) { + ge_dbg("Jfif 1.02"); + } else { + ge_dbgE("Unknow Jfif version[%d.%d]!", tmp[0], tmp[1]); + goto GE_EXIF_FAILED; + } + + /* Save version */ + /*version = tmp[1]; */ + + /* Find APP1 */ + bool b_tag_ff = false; + while(1) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + tmp[0] = (unsigned char)tmp_exif; + + ge_dbg("- %02X", tmp[0]); + if (!b_tag_ff) { + /* Get first tag */ + if (tmp[0] == GE_EXIF_TAG) { + ge_dbgW("0xFF!"); + b_tag_ff = true; + } + continue; + } + + /* Get APP1 */ + if (tmp[0] == GE_EXIF_APP1) { + ge_dbgW("Exif in APP1!"); + break; + } + + ge_dbgW("No Exif in APP1!"); + + /* Close file */ + fclose(fd); + if (!b_write) { + /* Normal orientation = 0degree = 1 */ + *orientation = 1; + return 0; + } + return __ge_exif_add_exif_to_jfif(file_path, orientation); +#if 0 + if (version == GE_EXIF_JFIF_00) { + return __ge_exif_rw_jfif_1dot00(file_path, orientation); + } else if (version == GE_EXIF_JFIF_01) { + return __ge_exif_rw_jfif_1dot01(file_path, orientation); + } else { + return __ge_exif_rw_jfif_1dot02(file_path, orientation); + } +#endif + } + + /* Find Exif */ + while(1) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + tmp[0] = (unsigned char)tmp_exif; + if (tmp[0] != 0x45) + continue; + + for (i = 0; i < 5; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + ge_dbg("- %02X", tmp[i]); + } + if (tmp[0] == 0x78 && tmp[1] == 0x69 && tmp[2] == 0x66 && + tmp[3] == 0x00 && tmp[4] == 0x00) { + ge_dbgW("Met Exif!"); + break; + } else { + ge_dbgW("Not met Exif!"); + goto GE_EXIF_FAILED; + } + } + + /* Read Exif body */ + for (i = 0; i < 4; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_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) { + ge_dbg("Intel"); + is_motorola = false; + } else if (tmp[0] == 0x4D && tmp[1] == 0x4D && tmp[2] == 0x00 && + tmp[3] == 0x2A) { + ge_dbg("Motorola"); + is_motorola = true; + } else { + goto GE_EXIF_FAILED; + } + + for (i = 0; i < 4; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + tmp[i] = (unsigned char)tmp_exif; + ge_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 GE_EXIF_FAILED; + offset = tmp[2]; + offset <<= 8; + offset += tmp[3]; + } else { + if (tmp[3] != 0 && tmp[2] != 0) + goto GE_EXIF_FAILED; + offset = tmp[1]; + offset <<= 8; + offset += tmp[0]; + } + ge_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 = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_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]; + } + ge_dbg("tags_cnt: %d", tags_cnt); + if (tags_cnt == 0) { + ge_dbgE("tags_cnt == 0 - 2"); + goto GE_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 = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_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) { + ge_dbgW("Found orientation tag!"); + break; + } + if (--tags_cnt == 0) { + ge_dbgW("tags_cnt == 0, no found orientation tag!"); + if (b_write) { + ge_dbgW("to add an orientation tag!"); + fclose(fd); + fd = NULL; + return __ge_exif_add_orientation_tag(file_path, orientation); + + } else{ + /* Normal orientation = 0degree = 1 */ + *orientation = 1; + ret = 0; + } + goto GE_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) { + ge_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) { + ge_dbgE("fseek failed!"); + goto GE_EXIF_FAILED; + } + fwrite(tmp, 1, 10, fd); + } else { + /* Get the Orientation value */ + if (is_motorola) { + if (tmp[8] != 0) { + ge_dbgE("tmp[8] != 0"); + goto GE_EXIF_FAILED; + } + *orientation = (unsigned int)tmp[9]; + } else { + if (tmp[9] != 0) { + ge_dbgE("tmp[9] != 0"); + goto GE_EXIF_FAILED; + } + *orientation = (unsigned int)tmp[8]; + } + if (*orientation > 8) { + ge_dbgE("*orient > 8"); + goto GE_EXIF_FAILED; + } + ge_dbg("Read: %d", *orientation); + } + + ret = 0; + + GE_EXIF_FAILED: + + fclose(fd); + ge_dbg("All done"); + return ret; +} + +static int __ge_exif_rw_orient(char *file_path, unsigned int *orient, bool b_write) +{ + GE_CHECK_VAL(file_path, -1); + ge_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[GE_EXIF_BUF_LEN_MAX] = { 0, }; + FILE *fd = NULL; + int ret = -1; + + if (b_write) { + if ((fd = fopen(file_path, "rb+")) == NULL) { + ge_dbgE("Can't open %s!", file_path); + return -1; + } + } else { + if ((fd = fopen(file_path, "rb")) == NULL) { + ge_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 = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + exif_data[i] = (unsigned char)tmp_exif; + } + + if (exif_data[0] == GE_EXIF_TAG && exif_data[1] == GE_EXIF_SOI) { + ge_dbg("JPEG file"); + } else { + ge_dbgE("Not a JPEG file!"); + goto GE_EXIF_FAILED; + } + + if (exif_data[2] == GE_EXIF_TAG && exif_data[3] == GE_EXIF_APP1) { + ge_dbgW("Exif in APP1!"); + } else if (exif_data[2] == GE_EXIF_TAG && + exif_data[3] == GE_EXIF_APP0) { + ge_dbgW("Jfif in APP0!"); + int ret = __ge_exif_rw_jfif(fd, file_path, orient, b_write); + return ret; + } else { + ge_dbgE("Not a Exif in APP1 or Jiff in APP2[%d]!", exif_data[3]); + goto GE_EXIF_FAILED; + } + + /* Get the marker parameter length count */ + if (__ge_exif_read_2_bytes(fd, &length) < 0) + goto GE_EXIF_FAILED; + ge_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) { + ge_dbgE("length < 8"); + goto GE_EXIF_FAILED; + } + length -= 8; + + /* Length of an IFD entry */ + if (length < 12) { + ge_dbgE("length < 12"); + goto GE_EXIF_FAILED; + } + + /* Read Exif head, check for "Exif" */ + for (i = 0; i < 6; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_EXIF_FAILED; + + exif_data[i] = (unsigned char)tmp_exif; + ge_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) { + ge_dbgE("Not met Exif!"); + goto GE_EXIF_FAILED; + } + + /* Read Exif body */ + for (i = 0; i < length; i++) { + tmp_exif = __ge_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GE_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) { + ge_dbg("Intel"); + is_motorola = false; + } else if (exif_data[0] == 0x4D && exif_data[1] == 0x4D && + exif_data[2] == 0x00 && exif_data[3] == 0x2A) { + ge_dbg("Motorola"); + is_motorola = true; + } else { + goto GE_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 GE_EXIF_FAILED; + offset = exif_data[6]; + offset <<= 8; + offset += exif_data[7]; + } else { + if (exif_data[7] != 0 && exif_data[6] != 0) + goto GE_EXIF_FAILED; + offset = exif_data[5]; + offset <<= 8; + offset += exif_data[4]; + } + /* check end of data segment */ + if (offset > length - 2) { + ge_dbgE("offset > length - 2"); + goto GE_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) { + ge_dbgE("tags_cnt == 0 - 2"); + goto GE_EXIF_FAILED; + } + offset += 2; + + /* check end of data segment */ + if (offset > length - 12) { + ge_dbgE("offset > length - 12"); + goto GE_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) { + ge_dbgW("Found orientation tag!"); + break; + } + if (--tags_cnt == 0) { + ge_dbgW("tags_cnt == 0, no found orientation tag!"); + if (b_write) { + ge_dbgW("to add an orientation tag!"); + fclose(fd); + fd = NULL; + return __ge_exif_add_orientation_tag(file_path, orient); + + } else{ + /* Normal orientation = 0degree = 1 */ + *orient = 1; + ret = 0; + } + goto GE_EXIF_FAILED; + } + + /* Every directory entry size is 12 */ + offset += 12; + } + + if (b_write) { + ge_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) { + ge_dbgE("fseek failed!"); + goto GE_EXIF_FAILED; + } + fwrite(exif_data + 2 + offset, 1, 10, fd); + } else { + /* Get the Orientation value */ + if (is_motorola) { + if (exif_data[offset+8] != 0) { + ge_dbgE("exif_data[offset+8] != 0"); + goto GE_EXIF_FAILED; + } + *orient = (unsigned int)exif_data[offset+9]; + } else { + if (exif_data[offset+9] != 0) { + ge_dbgE("exif_data[offset+9] != 0"); + goto GE_EXIF_FAILED; + } + *orient = (unsigned int)exif_data[offset+8]; + } + if (*orient > 8) { + ge_dbgE("*orient > 8"); + goto GE_EXIF_FAILED; + } + ge_dbg("Read: %d", *orient); + } + + ret = 0; + + GE_EXIF_FAILED: + + fclose(fd); + ge_dbg("All done"); + return ret; +} + +int _ge_exif_get_orientation(char *file_path, unsigned int *orientation) +{ + GE_CHECK_VAL(orientation, -1); + GE_CHECK_VAL(file_path, -1); + ge_dbg("file_path: %s", file_path); + + return __ge_exif_rw_orient(file_path, orientation, false); +} + +#endif + diff --git a/ug/ug-gallery-efl/src/ge-ext-ug-load.c b/ug/ug-gallery-efl/src/ge-ext-ug-load.c new file mode 100755 index 0000000..536edb9 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-ext-ug-load.c @@ -0,0 +1,284 @@ +/* + * Copyright (c) 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 "ge-ext-ug-load.h" +#include "ge-debug.h" +#include "ge-ui-util.h" +#include "ge-util.h" +#include "ge-albums.h" +#include "ge-gridview.h" + +#define GE_IV_UG_NAME "image-viewer-efl" +#define GE_IV_STR_LEN_MAX 32 + +static bool ge_destroy_me = false; + +static void _ge_ext_destroy_me(ge_ugdata *ugd) +{ + ge_dbg(""); + GE_CHECK(ugd); + GE_CHECK(ugd->ug_called_by_me); + GE_CHECK(ugd->ug); + GE_CHECK(ugd->service); + bool send_result = false; + + if (_ge_ug_iv_get()) + { + _ge_ug_iv_set(false); + } + + if(ge_destroy_me == false) + { + ge_dbg("Destroy ug_called_by_me"); + ug_destroy(ugd->ug_called_by_me); + ugd->ug_called_by_me = NULL; + } + if(ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) + { + if(ugd->file_setas_image_path) + { + ge_dbg("GE_SETAS_IMAGE_PATH:%s", ugd->file_setas_image_path); + service_add_extra_data(ugd->service, + GE_SETAS_IMAGE_PATH, + ugd->file_setas_image_path); + + GE_FREE(ugd->file_setas_image_path); + send_result = true; + } + + if(ugd->file_setas_crop_image_path && + (ugd->file_select_setas_mode == GE_SETAS_T_CALLERID || + ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER)) { + ge_dbg("GE_SETAS_CALLERID_CROP_IMAGE_PATH:%s", + ugd->file_setas_crop_image_path); + service_add_extra_data(ugd->service, + GE_SETAS_CALLERID_CROP_IMAGE_PATH, + ugd->file_setas_crop_image_path); + + GE_FREE(ugd->file_setas_crop_image_path); + send_result = true; + } + + if(send_result) + { + ge_dbg("Call ug_send_result() to send result."); + ug_send_result(ugd->ug, ugd->service); + } + } + + if(ge_destroy_me) + { + ge_dbg("Setting is appllied, destroy gallery UG."); + ge_destroy_me = false; + /* Destroy self */ + ug_destroy_me(ugd->ug); + /* ug_called_by_me would be destroyed by ui-gadget */ + ugd->ug_called_by_me = NULL; + } + else + { + ge_dbg("Cancel button tapped, back to thumbnails view."); + } +} + +static void _ge_ext_iv_layout_cb(ui_gadget_h ug, enum ug_mode mode, void* priv) +{ + ge_dbg(""); + GE_CHECK(ug); + + Evas_Object *base = (Evas_Object *) ug_get_layout(ug); + if (!base) { + ge_dbgE("ug_get_layout failed!"); + ug_destroy(ug); + return; + } + + evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + /* Disable effect to avoid BS caused by ui-gadget to + unset ug layout after deleting it */ + ug_disable_effect(ug); + evas_object_show(base); +} + +static void _ge_ext_iv_result_cb(ui_gadget_h ug, service_h result, void *priv) +{ + ge_dbg(""); + GE_CHECK(priv); + GE_CHECK(result); + ge_ugdata *ugd = (ge_ugdata *)priv; + char* path = NULL; + + if(ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) + { + service_get_extra_data(result, GE_IMAGEVIEWER_IMAGE_PATH, &path); + ge_dbg("SETAS_IMAGE_PATH"); + ge_destroy_me = true; + if(path) + { + ge_dbg(":%s", path); + ugd->file_setas_image_path = path; + path = NULL; + } + + if(ugd->file_select_setas_mode == GE_SETAS_T_CALLERID || + ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER) { + service_get_extra_data(result, + GE_IMAGEVIEWER_CROP_IMAGE_PATH, + &path); + ge_dbg("CALLERID_CROP_IMAGE_PATH"); + if(path) + { + ge_dbg(":%s", path); + ugd->file_setas_crop_image_path = path; + } + } + } + + char *error_state = NULL; + service_get_extra_data(result, GE_IMAGEVIEWER_RETURN_ERROR, + &error_state); + if (error_state) + { + ge_dbg("error string : %s", error_state); + + if (!g_strcmp0(error_state, "not_supported_file_type")) { + ge_destroy_me = FALSE; + ge_item* cur_item = _ge_get_current_item(); + if(cur_item == NULL || cur_item->item == NULL || + cur_item->item->file_url == NULL) { + ge_dbgE("current item is NULL"); + GE_FREE(error_state); + return; + } + service_h service; + service_create(&service); + GE_CHECK(service); + service_set_operation(service, SERVICE_OPERATION_VIEW); + service_set_uri(service, cur_item->item->file_url); + service_send_launch_request(service, NULL, NULL); + service_destroy(service); + } + GE_FREE(error_state); + } +} + +static void _ge_ext_iv_destroy_cb(ui_gadget_h ug, void *priv) +{ + ge_dbg(""); + GE_CHECK(priv); + ge_ugdata *ad = (ge_ugdata *) priv; + + _ge_ext_destroy_me(ad); +} + +int ge_ext_load_iv_ug(ge_ugdata* ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + + struct ug_cbs cbs; + ui_gadget_h ug = NULL; + service_h service = NULL; + + if(ugd->ug_called_by_me) + { + ge_dbg("Already exits some UG called by me"); + return -1; + } + + ge_item* cur_item = _ge_get_current_item(); + if(cur_item == NULL || cur_item->item == NULL) + { + ge_dbg("current item is NULL"); + return -1; + } + memset(&cbs,0x00,sizeof(struct ug_cbs)); + cbs.layout_cb = _ge_ext_iv_layout_cb; + cbs.result_cb = _ge_ext_iv_result_cb; + cbs.destroy_cb = _ge_ext_iv_destroy_cb; + cbs.priv = ugd; + + service_create(&service); + GE_CHECK_VAL(service, -1); + + _ge_ug_iv_set(true); + + service_add_extra_data(service, "View Mode", "SETAS" ); + service_add_extra_data(service, "Path", cur_item->item->file_url); + + if(ugd->file_select_setas_mode == GE_SETAS_T_WALLPAPER) { + service_add_extra_data(service, "Setas type", "Wallpaper"); + + if(ugd->file_setas_homescreen_path) + { + ge_dbg("homescreen_path:%s", ugd->file_setas_homescreen_path); + service_add_extra_data(service, GE_IMAGEVIEWER_HOMESCREEN_PATH, ugd->file_setas_homescreen_path); + GE_FREE(ugd->file_setas_homescreen_path); + } + + if(ugd->file_setas_lockscreen_path) + { + ge_dbg("lockscreen_path:%s", ugd->file_setas_lockscreen_path); + service_add_extra_data(service, GE_IMAGEVIEWER_LOCKSCREEN_PATH, ugd->file_setas_lockscreen_path); + GE_FREE(ugd->file_setas_lockscreen_path); + } + } else if(ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER) { + service_add_extra_data(service, "Setas type", "Wallpaper Crop"); + service_add_extra_data(service, "Fixed ratio", "TRUE"); + + int w = 0; + int h = 0; + ecore_x_window_size_get(ecore_x_window_root_first_get(), + &w, &h); + char *reso_str = (char *)calloc(1, GE_IV_STR_LEN_MAX); + if (reso_str == NULL) { + ge_dbgE("Calloc failed!"); + service_destroy(service); + return -1; + } + snprintf(reso_str, GE_IV_STR_LEN_MAX, "%dx%d", w, h); + ge_dbgW("Window Resolution: %dx%d, %s", w, h, reso_str); + service_add_extra_data(service, "Resolution", reso_str); + GE_FREE(reso_str); + } else if(ugd->file_select_setas_mode == GE_SETAS_T_CALLERID) { + service_add_extra_data(service, "Setas type", "CallerID"); + if(ugd->file_setas_callid_size) + { + ge_dbg("callerid_size:%s", ugd->file_setas_callid_size); + service_add_extra_data(service, GE_IMAGEVIEWER_CALLERID_SIZE, ugd->file_setas_callid_size); + GE_FREE(ugd->file_setas_callid_size); + } + + if(ugd->file_setas_callid_path) + { + ge_dbg("callerid_path:%s", ugd->file_setas_callid_path); + service_add_extra_data(service, GE_IMAGEVIEWER_CALLERID_PATH, ugd->file_setas_callid_path); + GE_FREE(ugd->file_setas_callid_path); + } + } + ug = ug_create(ugd->ug, GE_IV_UG_NAME, UG_MODE_FULLVIEW, service, &cbs); + ugd->ug_called_by_me = ug; + service_destroy(service); + if (ug != NULL) { + ge_dbg("Create UG successully"); + return 0; + } else { + ge_dbgE("Create UG failed!"); + return -1; + } +} + diff --git a/ug/ug-gallery-efl/src/ge-gridview.c b/ug/ug-gallery-efl/src/ge-gridview.c new file mode 100755 index 0000000..7d85027 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-gridview.c @@ -0,0 +1,714 @@ +/* + * Copyright (c) 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 "ge-debug.h" +#include "ge-gridview.h" +#include "ge-ui-util.h" +#include "ge-util.h" +#include "ge-ext-ug-load.h" +#include "ge-data.h" +#include "ge-strings.h" +#include "ge-icon.h" +#include "ge-drm.h" +#include "ge-exif.h" +#include "ge-thumb.h" + +/* Icon swallowed to part "elm.swallow.icon" */ +#define GE_GRID_ICON_SIZE 156 +#define GE_ITEM_MOUSE_UP_DISTANCE_X 20 +#define GE_ITEM_MOUSE_UP_DISTANCE_Y 20 +#define GE_GIRD_ICON_CLICK_TIME_DELAY 0.01f + +static Elm_Gengrid_Item_Class gic; +static int ge_grid_item_cnt = 0; + +typedef struct +{ + Evas_Coord x; + Evas_Coord y; + bool b_pressed; +}ge_grid_touch_info; + +static ge_grid_touch_info ge_touch_info; + +static void _ge_grid_drag_up(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_drag_right(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_drag_down(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_drag_left(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_drag_stop(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_selected(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_unselected(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_clicked(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_longpress(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); +} + +static void _ge_grid_sel(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); + GE_CHECK(data); + if (_ge_get_view_mode() != GE_VIEW_THUMBS) { + ge_dbgE("Wrong mode!"); + return; + } else { + ge_dbg("ViewMode"); + } + + ge_item* gitem = (ge_item*)data; + GE_CHECK(gitem->item); + GE_CHECK(gitem->ugd); + ge_ugdata* ugd = gitem->ugd; + + if (gitem->item->file_url == NULL || strlen(gitem->item->file_url) <= 0) { + ge_dbgE("file_url is invalid!"); + return; + } else { + ge_dbg("file_url: %s.", gitem->item->file_url); + } + + if (ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) { + /* imageviewer only supprot image type while setting wallpaper */ + if(gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) { + _ge_set_current_item(gitem); + ge_dbg("Loading UG-IMAGE(VIDEO)-VIEWER"); + ge_ext_load_iv_ug(ugd); + } else if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO && + ugd->popup == NULL) { + ge_ui_create_popup(ugd, GE_POPUP_ONEBUT, + GE_POPUP_ONLY_SUPPORT_IMAGE); + } + + } else if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE || + gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) { + _ge_set_current_item(gitem); + ge_dbg("Loading UG-IMAGE(VIDEO)-VIEWER"); + ge_ext_load_iv_ug(ugd); + } +} + +static void _ge_grid_icon_clicked(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); + GE_CHECK(data); + _ge_grid_sel(data, obj, event_info); +} + +static void _ge_grid_item_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down*)event_info; + if(ev) + { + GE_CHECK(data); + GE_CHECK(obj); + ge_item *gitem = (ge_item *)data; + GE_CHECK(gitem->ugd); + ge_ugdata *ugd = gitem->ugd; + + ge_touch_info.x = ev->output.x; + ge_touch_info.y = ev->output.y; + + if(ugd->ug_called_by_me == NULL) + { + edje_object_signal_emit(_EDJ(obj), "mouse,down,shrink", "bg"); + ge_touch_info.b_pressed = true; + } + } +} +/* +static Eina_Bool _ge_grid_clicked_timer_cb(void *data) +{ + GE_CHECK_CANCEL(data); + ge_item *gitem = (ge_item *)data; + GE_CHECK_CANCEL(gitem->ugd); + ge_ugdata *ugd = gitem->ugd; + + _ge_grid_icon_clicked(data, NULL, NULL); + + GE_IF_DEL_TIMER(ugd->thumbs_clicked_timer) + + return ECORE_CALLBACK_CANCEL; +} +*/ + +static void _ge_grid_shrink_resp_cb(void *data, Evas_Object *obj, const char *emission, const char *source) +{ + ge_dbg(""); + GE_CHECK(obj); + GE_CHECK(data); + ge_item *gitem = (ge_item *)data; + GE_CHECK(gitem->ugd); +/* ge_ugdata *ugd = gitem->ugd; + + ugd->thumbs_clicked_timer = ecore_timer_add(GE_GIRD_ICON_CLICK_TIME_DELAY, _ge_grid_clicked_timer_cb, data); +*/ + _ge_grid_icon_clicked(data, obj, NULL); + + edje_object_signal_callback_del(obj, "shrink,expand,done", "bg", _ge_grid_shrink_resp_cb); +} + +static void _ge_grid_item_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + GE_CHECK(obj); + Evas_Event_Mouse_Up *ev = event_info; + + if(!ev) + { + goto RET_WO_EXEC; + } + + if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD || ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL) + { + goto RET_WO_EXEC; + } + if((abs(ge_touch_info.x - ev->output.x) > GE_ITEM_MOUSE_UP_DISTANCE_X) || (abs(ge_touch_info.y - ev->output.y) > GE_ITEM_MOUSE_UP_DISTANCE_Y)) + { + goto RET_WO_EXEC; + } + + ge_dbg(""); + + if(ge_touch_info.b_pressed) + { + edje_object_signal_emit(_EDJ(obj), "mouse,up,expand", "bg"); + edje_object_signal_callback_add(_EDJ(obj), "shrink,expand,done", "bg", _ge_grid_shrink_resp_cb, data); + ge_touch_info.b_pressed = false; + } + return; + +RET_WO_EXEC: + if(ge_touch_info.b_pressed) + { + edje_object_signal_emit(_EDJ(obj), "mouse,up,expand", "bg"); + ge_touch_info.b_pressed = false; + } +} + +static void _ge_grid_check_changed(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); + GE_CHECK(obj); + GE_CHECK(data); + ge_item *gitem = (ge_item *)data; + GE_CHECK(gitem->item); + GE_CHECK(gitem->item->file_url); + GE_CHECK(gitem->ugd); + ge_ugdata *ugd = gitem->ugd; + GE_CHECK(ugd->service); + + if(_ge_get_view_mode() != GE_VIEW_THUMBS_EDIT) { + ge_dbgE("Wrong view mode!"); + return; + } + + + Eina_Bool checked = elm_check_state_get(obj); + if(checked) { + /* add for one file selection */ + if(ugd->file_select_mode == GE_FILE_SELECT_T_ONE) { + ge_dbg("Service add:%s", gitem->item->file_url); + /* Hide checked state in one file selection */ + elm_check_state_set(obj, false); + + service_add_extra_data(ugd->service, + GE_FILE_SELECT_RETURN_PATH, + gitem->item->file_url); + service_add_extra_data(ugd->service, + SERVICE_DATA_SELECTED, + gitem->item->file_url); + ug_send_result(ugd->ug, ugd->service); + ug_destroy_me(ugd->ug); + return; + } else { + ge_dbg("Append:%s", gitem->item->file_url); + _ge_data_selected_list_append( gitem ); + } + } else if (ugd->file_select_mode != GE_FILE_SELECT_T_ONE) { + ge_dbg("Remove:%s", gitem->item->file_url); + _ge_data_selected_list_remove( gitem ); + } + + if(ugd->file_select_mode != GE_FILE_SELECT_T_ONE) { + gitem->checked = checked; + _ge_ui_create_selinfo(ugd, ugd->thumbs_view_ly); + } +} + +static void __ge_grid_thumb_created_cb(media_content_error_e error, + const char *path, void *user_data) +{ + GE_CHECK(user_data); + ge_item *gitem = (ge_item *)user_data; + GE_CHECK(gitem->item); + + if (GE_FILE_EXISTS(path)) { + ge_dbg("Update item with new thumb path[%s]", path); + /* Update thumb path */ + GE_FREEIF(gitem->item->thumb_url); + gitem->item->thumb_url = strdup(path); + elm_gengrid_item_update(gitem->elm_item); + } else { + ge_dbgE("Invalid thumb path!"); + } +} + +static Evas_Object *__ge_grid_get_content(void *data, Evas_Object *obj, const char *part) +{ + GE_CHECK_NULL(data); + GE_CHECK_NULL(part); + GE_CHECK_NULL(obj); + ge_item *gitem = NULL; + bool is_expired_drm = false; + + if(strlen(part) <= 0) { + ge_dbgE("part length <= 0"); + return NULL; + } + + gitem = (ge_item*)data; + GE_CHECK_NULL(gitem->item); + GE_CHECK_NULL(gitem->ugd); + ge_ugdata *ugd = gitem->ugd; + GE_CHECK_NULL(ugd->thumbs_view); + + if (!g_strcmp0(part, "elm.swallow.icon")) { + Evas_Object *layout = NULL; + char *path = NULL; + char *drm_path = NULL; + unsigned int orient = 0; + + /* Is it DRM file? Has a valid RO? */ + if(ge_drm_is_drm_file(gitem->item->file_url) && + ge_drm_check_valid_ro(gitem->item->file_url, ge_drm_get_permtype(gitem->item->type)) == false) { + path = GE_DEFAULT_THUMB_ICON;; + is_expired_drm = true; + } else if (ge_grid_item_cnt < 2 && + gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE) { + if (!g_strcmp0(GE_DB_DEFAULT_THUMB, gitem->item->thumb_url)) { + path = GE_DEFAULT_THUMB_ICON; + } else { + drm_path = ge_drm_get_file_path(gitem); + path = _GE_GET_ICON(drm_path); + if (_ge_is_image_valid(ugd, path) == false) + path = _GE_GET_ICON(gitem->item->thumb_url); +#ifdef _USE_ROTATE_BG_GE + /* Rotate bg if it's created from original file */ + if (!g_strcmp0(path, gitem->item->file_url)) + _ge_exif_get_orientation(path, &orient); +#endif + } + } else { + /* Use default image */ + if (GE_FILE_EXISTS(gitem->item->thumb_url)) { + path = gitem->item->thumb_url; + } else { + path = GE_DEFAULT_THUMB_ICON; + if (GE_FILE_EXISTS(gitem->item->file_url)) + _ge_data_create_thumb(gitem, + __ge_grid_thumb_created_cb, + gitem); + } + } + + if(gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO){ + unsigned int v_dur = 0; + if (gitem->item->video_info) { + v_dur = gitem->item->video_info->duration; + } + int bk_len = 0; + if (gitem->item->video_info == NULL) + bk_len = 0; + else + bk_len = gitem->item->video_info->bookmarks; + layout = _ge_thumb_show_part_icon_video(obj, path, + v_dur, bk_len, + gitem->item->favorite, + is_expired_drm, + ugd->icon_size); + + } else { + layout = _ge_thumb_show_part_icon_image(obj, path, + orient, + gitem->item->favorite, + is_expired_drm, + ugd->icon_size); + } + GE_FREEIF(drm_path); + + evas_object_event_callback_add(layout, + EVAS_CALLBACK_MOUSE_DOWN, _ge_grid_item_mouse_down, gitem); + evas_object_event_callback_add(layout, + EVAS_CALLBACK_MOUSE_UP, _ge_grid_item_mouse_up, gitem); + + return layout; + } else if (!g_strcmp0(part, "elm.swallow.end") && + (_ge_get_view_mode() == GE_VIEW_THUMBS_EDIT)) { + Evas_Object* ck = NULL; + + ck = elm_check_add(obj); + GE_CHECK_NULL(ck); + elm_object_style_set(ck, GE_CHECKBOX_STYLE_GRID); + evas_object_propagate_events_set(ck, EINA_FALSE); + + gitem->check_obj = ck; + elm_check_state_set(ck, gitem->checked); + + evas_object_smart_callback_add(ck, "changed", + _ge_grid_check_changed, data); + evas_object_show(ck); + + return ck; + } + + return NULL; +} + +static bool _ge_grid_create_thumb(ge_ugdata* ugd, Evas_Object* parent) +{ + ge_dbg(""); + GE_CHECK_FALSE(parent); + GE_CHECK_FALSE(ugd); + int i = 0; + ge_item* gitem = NULL; + int cnt = _ge_data_get_count_all(); + int item_cnt = 0; + ge_dbg("List count : %d", cnt); + + gic.item_style = "thumbnail_view"; + gic.func.text_get = NULL; + gic.func.content_get = __ge_grid_get_content; + + elm_gengrid_clear(parent); + if(ugd->th) + { + elm_object_theme_set(parent, ugd->th); + } + elm_object_style_set(parent, "gallery_efl/default"); + + for(i = 1; i <= cnt; i++) + { + _ge_data_get_item_by_index(&gitem, i); + if(gitem == NULL || gitem->item == NULL || + gitem->item->uuid == NULL) { + ge_dbgE("Invalid gitem, continue..."); + continue; + } + + if(!gitem->item->file_url) + { + _ge_data_del_media_id(ugd, gitem->item->uuid); + _ge_data_item_list_remove(gitem); + --i; + --cnt; + continue; + } + + /*if(_ge_get_view_mode() == GE_VIEW_THUMBS_EDIT) + { + ge_media_s *new_item = NULL; + _ge_local_data_get_media(gitem->item->uuid, &new_item); + if(!new_item) + { + ge_dbg("item or file doesn't exist, remove it..."); + _ge_data_selected_list_remove(gitem); + _ge_data_item_list_remove(gitem); + + if(new_item) + { + _ge_data_type_free_geitem((void **)&new_item); + new_item = NULL; + } + --i; + --cnt; + continue; + } + + if(new_item) + { + _ge_data_type_free_geitem((void **)&new_item); + new_item = NULL; + } + }*/ + + gitem->elm_item = elm_gengrid_item_append(parent, &gic, gitem, _ge_grid_sel, gitem); + gitem->check_obj = NULL; + item_cnt++; + + } + + elm_gengrid_select_mode_set(parent, ELM_OBJECT_SELECT_MODE_NONE); + ge_grid_item_cnt = item_cnt; + if(item_cnt == 0) + { + return EINA_FALSE; + } + else + { + return EINA_TRUE; + } +} + +Evas_Object* ge_grid_create_ly(Evas_Object* parent) +{ + ge_dbg(""); + GE_CHECK_NULL(parent); + Evas_Object* layout = NULL; + + layout = ge_ui_load_edj(parent, GE_EDJ_FILE, GE_GRP_GRIDVIEW); + GE_CHECK_NULL(layout); + evas_object_show (layout); + + return layout; +} + +int ge_grid_del_callbacks(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + if(ugd->thumbs_view) + { + ge_dbg("Delete thumbnails callbacks!"); + evas_object_smart_callback_del(ugd->thumbs_view, "selected", _ge_grid_selected); + evas_object_smart_callback_del(ugd->thumbs_view, "unselected", _ge_grid_unselected); + evas_object_smart_callback_del(ugd->thumbs_view, "clicked", _ge_grid_clicked); + evas_object_smart_callback_del(ugd->thumbs_view, "longpressed", _ge_grid_longpress); + evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,up", _ge_grid_drag_up); + evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,right", _ge_grid_drag_right); + evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,down", _ge_grid_drag_down); + evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,left", _ge_grid_drag_left); + evas_object_smart_callback_del(ugd->thumbs_view, "drag,stop", _ge_grid_drag_stop); + } + return 0; +} + +/* +* When select album, show first (GE_FIRST_VIEW_END_POS+1) medias. +* Then use idler to get other medias from DB and appened +* them to gridview. +* In order to reduce transit time of first show of thumbnails view. +* Cause most of time is spent for getting records from DB, +* so we get first (GE_FIRST_VIEW_END_POS+1) items and show thumbnails view, +* it will accelerate view show. +*/ +int ge_grid_idler_append_thumbs(void* data) +{ + GE_CHECK_VAL(data, -1); + ge_ugdata *ugd = (ge_ugdata *)data; + GE_CHECK_VAL(ugd->thumbs_view, -1); + int i = 0; + int item_cnt = 0; + ge_item* gitem = NULL; + /* Get all medias count of current album */ + int cnt = _ge_data_get_count_all(); + int ret = -1; + ge_cluster* cur_album = _ge_get_current_album(); + GE_CHECK_VAL(cur_album, -1); + GE_CHECK_VAL(cur_album->cluster, -1); + ge_dbg("First view medias count: %d;", cnt); + + if(cnt != (GE_FIRST_VIEW_END_POS+1)) + { + ge_dbg("No any more items, return!"); + return -1; + } + /* Get other items from DB */ + ret = _ge_data_get_items_list(ugd, cur_album, (GE_FIRST_VIEW_END_POS+1), + GE_GET_UNTIL_LAST_RECORD); + ge_dbgW("###Get items list over[%d]###", ret); + if(ret < 0) { + ge_dbg("Get items list failed!"); + return ret; + } + + cnt = _ge_data_get_count_all(); + ge_dbg("Grid view all medias count: %d", cnt); + + + /* From (GL_FIRST_VIEW_END_POS + 2)th item to last one */ + i = GE_FIRST_VIEW_END_POS + 2; + + for(; i <= cnt; i++) + { + _ge_data_get_item_by_index(&gitem, i); + if(gitem == NULL || gitem->item == NULL || + gitem->item->uuid == NULL) { + ge_dbgE("Invalid gitem, continue..."); + continue; + } + + if(!gitem->item->file_url) + { + ge_dbg("file_url is invalid."); + _ge_data_del_media_id(ugd, gitem->item->uuid); + _ge_data_selected_list_remove(gitem); + _ge_data_item_list_remove(gitem); + cnt--; + i--; + gitem = NULL; + continue; + } + + gitem->elm_item = elm_gengrid_item_append(ugd->thumbs_view, &gic, gitem, _ge_grid_sel, gitem); + item_cnt++; + } + + ge_dbg("\n\n<<<<<<<win_scale; + item_w = (int)(GE_GRID_ITEM_SIZE_W * scale_factor); + item_h = (int)(GE_GRID_ITEM_SIZE_H * scale_factor); + icon_size = (int)(GE_GRID_ICON_SIZE * scale_factor); + ge_dbg("Own scale: %f, elm_config_scale_get =%f", scale_factor, elm_config_scale_get()); + + if(!_ge_grid_create_thumb(ugd, grid)) { + evas_object_del(grid); + grid = NULL; + + ugd->nocontents = ge_ui_create_nocontents(ugd); + evas_object_show (ugd->nocontents); + + return ugd->nocontents; + } else { + ge_dbg("ge_grid_item_cnt : %d", ge_grid_item_cnt); + if(ge_grid_item_cnt <= GE_GRID_ITEM_ZOOM_LEVEL_02_CNT) { + item_w *= GE_GRID_ITEM_ZOOM_LEVEL_02; + item_h *= GE_GRID_ITEM_ZOOM_LEVEL_02; + icon_size *= GE_GRID_ITEM_ZOOM_LEVEL_02; + } + + ugd->icon_size = icon_size; + evas_object_show (grid); + } + + + elm_gengrid_item_size_set(grid, item_w, item_h); + ge_dbg("Gengrid item w: %d, h: %d.", item_w, item_h); + elm_gengrid_align_set(grid, 0.5, 0.0); + elm_gengrid_horizontal_set(grid, EINA_FALSE); + elm_scroller_bounce_set(grid, EINA_FALSE, EINA_TRUE); + elm_gengrid_multi_select_set(grid, EINA_TRUE); + + evas_object_smart_callback_add(grid, "selected", _ge_grid_selected, NULL); + evas_object_smart_callback_add(grid, "unselected", _ge_grid_unselected, NULL); + evas_object_smart_callback_add(grid, "clicked", _ge_grid_clicked, NULL); + evas_object_smart_callback_add(grid, "longpressed", _ge_grid_longpress, NULL); + evas_object_smart_callback_add(grid, "drag,start,up", _ge_grid_drag_up, NULL); + evas_object_smart_callback_add(grid, "drag,start,right", _ge_grid_drag_right, NULL); + evas_object_smart_callback_add(grid, "drag,start,down", _ge_grid_drag_down, NULL); + evas_object_smart_callback_add(grid, "drag,start,left", _ge_grid_drag_left, NULL); + evas_object_smart_callback_add(grid, "drag,stop", _ge_grid_drag_stop, NULL); + evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + + return grid; +} + +int ge_grid_clear_view(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + if(ugd->file_select_mode == GE_FILE_SELECT_T_ONE) + service_remove_extra_data(ugd->service, + GE_FILE_SELECT_RETURN_PATH); + + if(ugd->thumbs_view) { + if(ugd->thumbs_nocontents != ugd->thumbs_view) + ge_grid_del_callbacks(ugd); + + evas_object_del(ugd->thumbs_view); + ugd->thumbs_view = NULL; + ugd->thumbs_nocontents = NULL; + ugd->thumbs_nf_it = NULL; + } + + return 0; +} +int ge_grid_update_view(ge_ugdata *ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + if(_ge_grid_create_thumb(ugd, ugd->thumbs_view) == EINA_FALSE) { + ge_grid_del_callbacks(ugd); + } else { + double scale_factor = ugd->win_scale; + int item_w = (int)(GE_GRID_ITEM_SIZE_W * scale_factor); + int item_h = (int)(GE_GRID_ITEM_SIZE_H * scale_factor); + int icon_size = (int)(GE_GRID_ICON_SIZE * scale_factor); + + ge_dbg("ge_grid_item_cnt : %d", ge_grid_item_cnt); + if(ge_grid_item_cnt <= GE_GRID_ITEM_ZOOM_LEVEL_02_CNT) { + item_w *= GE_GRID_ITEM_ZOOM_LEVEL_02; + item_h *= GE_GRID_ITEM_ZOOM_LEVEL_02; + icon_size *= GE_GRID_ITEM_ZOOM_LEVEL_02; + } + + ugd->icon_size = icon_size; + elm_gengrid_item_size_set(ugd->thumbs_view, item_w, item_h); + } + + return 0; +} + diff --git a/ug/ug-gallery-efl/src/ge-lang.c b/ug/ug-gallery-efl/src/ge-lang.c new file mode 100755 index 0000000..b2755f3 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-lang.c @@ -0,0 +1,180 @@ +/* + * Copyright (c) 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 "ge-lang.h" +#include "ge-strings.h" +#include "ge-ui-util.h" +#include "ge-util.h" +#include "ge-debug.h" +#include "ge-data.h" + +static int __ge_lang_get_view_title(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + if (ugd->album_select_mode == GE_ALBUM_SELECT_T_ONE) { + g_strlcpy(ugd->albums_view_title, GE_TITLE_ALBUMS, + GE_ALBUM_NAME_LEN_MAX); + } else { + if (ugd->file_select_mode == GE_FILE_SELECT_T_SETAS) { + if (ugd->file_select_setas_mode == GE_SETAS_T_WALLPAPER) + g_strlcpy(ugd->albums_view_title, + GE_TITLE_CHANGE_WALLPAPER, + GE_ALBUM_NAME_LEN_MAX); + else if (ugd->file_select_setas_mode == GE_SETAS_T_CROP_WALLPAPER) + g_strlcpy(ugd->albums_view_title, + GE_TITLE_CHANGE_WALLPAPER, + GE_ALBUM_NAME_LEN_MAX); + else if (ugd->file_select_setas_mode == GE_SETAS_T_CALLERID) + g_strlcpy(ugd->albums_view_title, + GE_TITLE_CHANGE_CALLER_ID, + GE_ALBUM_NAME_LEN_MAX); + } else { + g_strlcpy(ugd->albums_view_title, GE_TITLE_ADD, + GE_ALBUM_NAME_LEN_MAX); + g_strlcat(ugd->albums_view_title, " ", + GE_ALBUM_NAME_LEN_MAX); + bool b_singular = true; + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) { + b_singular = false; + } + if (ugd->file_type_mode == GE_FILE_T_IMAGE) { + if(b_singular) { + g_strlcat(ugd->albums_view_title, + GE_TITLE_IMAGE, + sizeof(ugd->albums_view_title)); + } else { + g_strlcat(ugd->albums_view_title, + GE_TITLE_IMAGES, + sizeof(ugd->albums_view_title)); + } + } else if (ugd->file_type_mode == GE_FILE_T_VIDEO) { + if(b_singular) { + g_strlcat(ugd->albums_view_title, + GE_TITLE_VIDEO, + sizeof(ugd->albums_view_title)); + } else { + g_strlcat(ugd->albums_view_title, + GE_TITLE_VIDEOS, + sizeof(ugd->albums_view_title)); + } + } else { + if(b_singular) { + g_strlcat(ugd->albums_view_title, + GE_TITLE_FILE, + sizeof(ugd->albums_view_title)); + } else { + g_strlcat(ugd->albums_view_title, + GE_TITLE_FILES, + sizeof(ugd->albums_view_title)); + } + } + } + } + return 0; +} + +static int __ge_lang_update_all_albums_name(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + + ge_cluster *album = NULL; + Elm_Object_Item *first_it = NULL; + Elm_Object_Item *next_it = NULL; + Elm_Object_Item *last_it = NULL; + Evas_Object *grid_view = NULL; + GE_CHECK_VAL(ugd->albums_view, -1); + grid_view = ugd->albums_view; + + first_it = elm_gengrid_first_item_get(grid_view); + last_it = elm_gengrid_last_item_get(grid_view); + while(first_it) { + album = (ge_cluster *)elm_object_item_data_get(first_it); + if (album == NULL) { + ge_dbgE("Invalid item data!"); + continue; + } + if (!g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { + GE_FREEIF(album->cluster->display_name); + album->cluster->display_name = strdup(GE_ALBUM_ALL_NAME); + elm_gengrid_item_update(first_it); + } else if (_ge_data_is_default_album(GE_ALBUM_CAMERA_NAME, album->cluster) || + _ge_data_is_default_album(GE_ALBUM_DOWNLOAD_NAME, album->cluster) || + _ge_data_is_root_path(album->cluster->path)) { + elm_gengrid_item_update(first_it); + } + if (last_it == first_it) { + ge_dbg("Update done!"); + break; + } else { + next_it = elm_gengrid_item_next_get(first_it); + first_it = next_it; + } + album = NULL; + } + return 0; +} + +static int __ge_lang_update_select_info(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(ugd->selinfo_ly, -1); + + int count = 0; + char text[GE_SELINFO_TEXT_LEN_MAX] = {0,}; + + count = _ge_data_selected_list_count(); + if (count <= 0) + return -1; + snprintf(text, sizeof(text), "%s (%d)", GE_SELINFO_SELECTED, count); + text[strlen(text)] = '\0'; + edje_object_part_text_set(_EDJ(ugd->selinfo_ly), "elm.text", text); + return 0; +} + +int _ge_lang_update(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + ge_dbg(""); + if(_ge_get_view_mode() == GE_VIEW_THUMBS) { + if (ugd->thumbs_nf_it) { + ge_cluster *album_item = _ge_get_current_album(); + if(_ge_data_is_root_path(album_item->cluster->path)) { + elm_object_item_text_set(ugd->thumbs_nf_it, + GE_ALBUM_ROOT_NAME); + } else { + char *new_name = _ge_ui_get_translated_album_name(album_item); + elm_object_item_text_set(ugd->thumbs_nf_it, + new_name); + } + __ge_lang_update_select_info(ugd); + } + } else { + __ge_lang_get_view_title(ugd); + + if (_ge_get_view_mode() == GE_VIEW_ALBUMS) { + elm_object_item_text_set(ugd->albums_nf_it, + ugd->albums_view_title); + __ge_lang_update_all_albums_name(ugd); + } else { + elm_object_item_text_set(ugd->thumbs_nf_it, + ugd->albums_view_title); + __ge_lang_update_select_info(ugd); + } + } + + return 0; +} + diff --git a/ug/ug-gallery-efl/src/ge-local-data.c b/ug/ug-gallery-efl/src/ge-local-data.c new file mode 100755 index 0000000..8f4c4bb --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-local-data.c @@ -0,0 +1,612 @@ +/* + * Copyright (c) 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 "ge-local-data.h" +#include "ge-debug.h" + +typedef struct _ge_transfer_data_t ge_transfer_data_s; + +struct _ge_transfer_data_t { + void **userdata; + filter_h filter; + char *album_id; + bool with_meta; +}; + +static int __ge_local_data_create_filter(ge_filter_s *condition, filter_h *filter) +{ + GE_CHECK_VAL(filter, -1); + GE_CHECK_VAL(condition, -1); + int ret = -1; + filter_h tmp_filter = NULL; + + ret = media_filter_create(&tmp_filter); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Fail to create filter!"); + return -1; + } + + if (strlen(condition->cond) > 0) { + ret = media_filter_set_condition(tmp_filter, condition->cond, + condition->collate_type); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Fail to set condition!"); + goto GE_LOCAL_FAILED; + } + } + + if (strlen(condition->sort_keyword) > 0) { + ret = media_filter_set_order(tmp_filter, condition->sort_type, + condition->sort_keyword, + condition->collate_type); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Fail to set order!"); + goto GE_LOCAL_FAILED; + } + } + + ge_dbg("offset: %d, count: %d", condition->offset, condition->count); + if (condition->offset != -1 && condition->count != -1 && + condition->count > 0) { + ret = media_filter_set_offset(tmp_filter, condition->offset, + condition->count); + if(ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Fail to set offset!"); + goto GE_LOCAL_FAILED; + } + } + + *filter = tmp_filter; + return 0; + + GE_LOCAL_FAILED: + + if (tmp_filter) { + media_filter_destroy(tmp_filter); + tmp_filter = NULL; + *filter = NULL; + } + return -1; +} + +static int __ge_local_data_destroy_filter(filter_h filter) +{ + GE_CHECK_VAL(filter, -1); + + if (media_filter_destroy(filter) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Failed to destroy filter!"); + return -1; + } + + return 0; +} + +static bool __ge_local_data_get_album_list_cb(media_folder_h folder, + void *data) +{ + GE_CHECK_FALSE(data); + ge_transfer_data_s *tmp_data = (ge_transfer_data_s *)data; + GE_CHECK_FALSE(tmp_data->userdata); + GE_CHECK_FALSE(tmp_data->filter); + GE_CHECK_FALSE(folder); + + Eina_List **elist = (Eina_List **)(tmp_data->userdata); + ge_album_s *album = NULL; + + album = (ge_album_s *)calloc(1, sizeof(ge_album_s)); + GE_CHECK_FALSE(album); + album->gtype = GE_TYPE_ALBUM; + + if (media_folder_clone(&(album->folder_h), folder) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Clone folder handle error"); + goto GE_LOCAL_FAILED; + } + + if (media_folder_get_folder_id(folder, &(album->uuid)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get folder id error"); + goto GE_LOCAL_FAILED; + } + + if (media_folder_get_modified_time(folder, &(album->mtime)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get modified time error"); + goto GE_LOCAL_FAILED; + } + + if (media_folder_get_storage_type(folder, (media_content_storage_e *)&(album->type)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get storage type error"); + goto GE_LOCAL_FAILED; + } + + if (media_folder_get_name(folder, &(album->display_name)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get folder name error"); + goto GE_LOCAL_FAILED; + } + + if (media_folder_get_path(folder, &(album->path)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get folder name error"); + goto GE_LOCAL_FAILED; + } + + if (media_folder_get_media_count_from_db(album->uuid, tmp_data->filter, &(album->count)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media count error, %d", album->count); + goto GE_LOCAL_FAILED; + } + + *elist = eina_list_append(*elist, album); + + return true; + + GE_LOCAL_FAILED: + + _ge_data_type_free_geitem((void **)(&album)); + return false; +} + +static bool __ge_local_data_get_media_list_cb(media_info_h media, void *data) +{ + GE_CHECK_FALSE(data); + ge_transfer_data_s *tmp_data = (ge_transfer_data_s *)data; + GE_CHECK_FALSE(tmp_data->userdata); + GE_CHECK_FALSE(media); + ge_media_s *item = NULL; + ge_image_s *image_info = NULL; + ge_video_s *video_info = NULL; + image_meta_h image_handle = NULL; + video_meta_h video_handle = NULL; + int ret = -1; + + Eina_List **elist = (Eina_List **)(tmp_data->userdata); + + item = (ge_media_s *)calloc(1, sizeof(ge_media_s)); + GE_CHECK_FALSE(item); + item->gtype = GE_TYPE_MEDIA; + + if (media_info_clone(&(item->media_h), media) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Clone media handle error"); + goto GE_LOCAL_FAILED; + } + + if (media_info_get_media_id(media, &(item->uuid)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media id error"); + goto GE_LOCAL_FAILED; + } + + if (media_info_get_display_name(media, &(item->display_name)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media display name error"); + goto GE_LOCAL_FAILED; + } + if (media_info_get_file_path(media, &(item->file_url)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media file path error"); + goto GE_LOCAL_FAILED; + } + + if (media_info_get_media_type(media, (media_content_type_e *)&(item->type)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media type error"); + goto GE_LOCAL_FAILED; + } + + if (media_info_get_thumbnail_path(media, &(item->thumb_url)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media thumbnail path error"); + goto GE_LOCAL_FAILED; + } + ge_dbg("thumb_url: %s", item->thumb_url); + + if (media_info_get_modified_time(media, &(item->mtime)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media modified time error"); + goto GE_LOCAL_FAILED; + } + + if (media_info_get_favorite(media, &(item->favorite)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media rating error"); + goto GE_LOCAL_FAILED; + } + /* Without meta */ + if (!tmp_data->with_meta) + goto GE_LOCAL_SUCCESS; + + if (item->type == MEDIA_CONTENT_TYPE_IMAGE) { + ret = media_info_get_image(media, &image_handle); + if (ret != MEDIA_CONTENT_ERROR_NONE || image_handle == NULL) { + ge_dbgE("Failed to get image handle[%d]!", ret); + goto GE_LOCAL_FAILED; + } + + image_info = (ge_image_s *)calloc(1, sizeof(ge_image_s)); + if (NULL == image_info){ + ge_dbgE("calloc failed!"); + goto GE_LOCAL_FAILED; + } + item->image_info = image_info; + + if (image_meta_clone(&(image_info->image_h), image_handle) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Clone image handle error"); + goto GE_LOCAL_FAILED; + + } + if (image_meta_get_media_id(image_handle, &(image_info->media_uuid)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get image id error"); + goto GE_LOCAL_FAILED; + } + + if (image_meta_get_orientation(image_handle, &(image_info->orientation)) != 0) { + ge_dbgE("Get image orientation error"); + goto GE_LOCAL_FAILED; + } + + if (image_meta_destroy(image_handle) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Destroy image handle error"); + goto GE_LOCAL_FAILED; + } + } else if (item->type == MEDIA_CONTENT_TYPE_VIDEO) { + ret = media_info_get_video(media, &video_handle); + if (ret != MEDIA_CONTENT_ERROR_NONE || video_handle == NULL) { + ge_dbgE("Failed to get video handle[%d]!", ret); + goto GE_LOCAL_FAILED; + } + + video_info = (ge_video_s *)calloc(1, sizeof(ge_video_s)); + if (NULL == video_info) { + goto GE_LOCAL_FAILED; + } + + item->video_info = video_info; + if (video_meta_clone(&(video_info->video_h), video_handle) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Clone video handle error"); + goto GE_LOCAL_FAILED; + } + if (video_meta_get_media_id(video_handle, &(video_info->media_uuid)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get video id error"); + goto GE_LOCAL_FAILED; + } + if (video_meta_get_title(video_handle, &(video_info->title)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get video title error"); + goto GE_LOCAL_FAILED; + } + if (video_meta_get_duration(video_handle, &(video_info->duration)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get video duration error"); + goto GE_LOCAL_FAILED; + } + if (video_meta_get_played_time(video_handle, &(video_info->last_played_pos)) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get video last played position error"); + goto GE_LOCAL_FAILED; + } + + if (video_meta_destroy(video_handle) != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Destroy video handle error"); + goto GE_LOCAL_FAILED; + } + + /* Get bookmar elist in case of video */ + if (video_info->media_uuid) { + video_info->bookmarks = 0; + int count = 0; + ret = media_info_get_bookmark_count_from_db(video_info->media_uuid, + NULL, + &count); + if (ret != MEDIA_CONTENT_ERROR_NONE) + ge_dbgE("Failed to get bookmark[%d]", ret); + else + video_info->bookmarks = count; + } + } + + GE_LOCAL_SUCCESS: + + if (tmp_data->album_id) + item->album_uuid = strdup(tmp_data->album_id); + else + item->album_uuid = NULL; + + *elist = eina_list_append(*elist, item); + return true; + + GE_LOCAL_FAILED: + + if (image_handle) + image_meta_destroy(image_handle); + if (video_handle) + video_meta_destroy(video_handle); + + _ge_data_type_free_geitem((void **)(&item)); + return false; +} + +int _ge_local_data_connect(void) +{ + int ret = -1; + + ret = media_content_connect(); + if(ret == MEDIA_CONTENT_ERROR_NONE) { + ge_dbg("DB connection is success"); + return 0; + } else { + ge_dbgE("DB connection is failed!"); + return -1; + } +} + +int _ge_local_data_disconnect(void) +{ + int ret = -1; + + ret = media_content_disconnect(); + if(ret == MEDIA_CONTENT_ERROR_NONE) { + ge_dbg("DB disconnection is success"); + return 0; + } else { + ge_dbgE("DB disconnection is failed!"); + return -1; + } +} + +int _ge_local_data_get_album_list(ge_filter_s *condition, Eina_List **elilst) +{ + GE_CHECK_VAL(elilst, -1); + GE_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __ge_local_data_create_filter(condition, &filter); + if (ret != 0) { + ge_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + filter_h media_filter = NULL; + ge_filter_s media_condition; + memset(&media_condition, 0x00, sizeof(ge_filter_s)); + if (strlen(condition->cond)) + g_strlcpy(media_condition.cond, condition->cond, + CONDITION_LENGTH); + memset(condition->cond, 0x00, CONDITION_LENGTH); + media_condition.sort_type = MEDIA_CONTENT_ORDER_DESC; + g_strlcpy(media_condition.sort_keyword, MEDIA_MODIFIED_TIME, + KEYWORD_LENGTH); + media_condition.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; + media_condition.offset = -1; + media_condition.count = -1; + media_condition.with_meta = false; + + ret = __ge_local_data_create_filter(&media_condition, &media_filter); + if (ret != 0) { + __ge_local_data_destroy_filter(filter); + ge_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + ge_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(ge_transfer_data_s)); + tran_data.userdata = (void **)elilst; + tran_data.filter = media_filter; + tran_data.album_id = NULL; + tran_data.with_meta = false; + + ge_dbg("Get folders--start"); + ret = media_folder_foreach_folder_from_db(filter, + __ge_local_data_get_album_list_cb, + &tran_data); + ge_dbg("Get folders--over"); + + __ge_local_data_destroy_filter(media_filter); + __ge_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get folders failed[%d]!", ret); + return -1; + } + + return 0; +} + +int _ge_local_data_get_media_count(const char *cluster_id, ge_filter_s *condition, + int *item_cnt){ + GE_CHECK_VAL(cluster_id, -1); + GE_CHECK_VAL(condition, -1); + GE_CHECK_VAL(item_cnt, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __ge_local_data_create_filter(condition, &filter); + if (ret != 0) { + ge_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + ge_dbg("Get media count--start"); + ret = media_folder_get_media_count_from_db(cluster_id, filter, + item_cnt); + ge_dbg("Get media count--over"); + + __ge_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media count failed[d]!", ret); + return -1; + } + + return 0; +} + +int _ge_local_data_get_all_media_count(ge_filter_s *condtion, int *item_cnt) +{ + GE_CHECK_VAL(condtion, -1); + GE_CHECK_VAL(item_cnt, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __ge_local_data_create_filter(condtion, &filter); + if (ret != 0) { + ge_dbgE("Create filter failed[%d]!", ret); + return -1; + } + + ge_dbg("Get media count--start"); + ret = media_info_get_media_count_from_db(filter, item_cnt); + ge_dbg("Get media count--over"); + + __ge_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media count failed[d]!", ret); + return -1; + } + + return 0; +} + +int _ge_local_data_get_media(const char *media_id, ge_media_s **mitem) +{ + GE_CHECK_VAL(mitem, -1); + + if (media_id == NULL) { + ge_dbg("Create a empty media"); + _ge_data_type_new_media(mitem); + return 0; + } + + int ret = -1; + Eina_List *list = NULL; + ge_media_s *_mitem = NULL; + int i = 0; + + ge_dbg("media id: %s", media_id); + media_info_h media_h = NULL; + + ret = media_info_get_media_from_db(media_id, &media_h); + if (ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get media handle failed[%d]!", ret); + if (media_h) + media_info_destroy(media_h); + return -1; + } + + ge_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(ge_transfer_data_s)); + tran_data.userdata = (void **)&list; + tran_data.filter = NULL; + tran_data.album_id = NULL; + tran_data.with_meta = false; + + ge_dbg("Get media list--start"); + bool b_ret = __ge_local_data_get_media_list_cb(media_h, &tran_data); + ge_dbg("Get media list--over"); + + media_info_destroy(media_h); + + if (b_ret && list) { + *mitem = eina_list_nth(list, 0); + i = 1; + ret = 0; + } else { + ge_dbgE("Failed to get media list!"); + ret = -1; + } + + /* Free other items */ + if (list) { + int len = eina_list_count(list); + ge_dbg("len: %d", len); + + for(; i < len; i++) { + _mitem = eina_list_nth(list, i); + _ge_data_type_free_geitem((void **)(&_mitem)); + } + + eina_list_free(list); + } + + return ret; +} + +int _ge_local_data_get_album_media_list(char *album_id, ge_filter_s *condition, + Eina_List **elist) +{ + GE_CHECK_VAL(elist, -1); + GE_CHECK_VAL(album_id, -1); + GE_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __ge_local_data_create_filter(condition, &filter); + if (ret != 0) { + ge_dbgE("Create filter failed!"); + return -1; + } + + ge_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(ge_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = NULL; + tran_data.album_id = album_id; + tran_data.with_meta = condition->with_meta; + + ge_dbg("Get medias--start"); + ret = media_folder_foreach_media_from_db(album_id, filter, + __ge_local_data_get_media_list_cb, + &tran_data); + ge_dbg("Get medias--over"); + + __ge_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get medias failed[d]!", ret); + return -1; + } + + return 0; +} + +int _ge_local_data_get_all_albums_media_list(ge_filter_s *condition, + Eina_List **elist) +{ + GE_CHECK_VAL(elist, -1); + GE_CHECK_VAL(condition, -1); + int ret = -1; + filter_h filter = NULL; + + ret = __ge_local_data_create_filter(condition, &filter); + if (ret != 0) { + ge_dbgE("Create filter failed!"); + return -1; + } + + ge_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(ge_transfer_data_s)); + tran_data.userdata = (void **)elist; + tran_data.filter = NULL; + tran_data.album_id = NULL; + tran_data.with_meta = condition->with_meta; + + ge_dbg("Get all medias--start"); + ret = media_info_foreach_media_from_db(filter, + __ge_local_data_get_media_list_cb, + &tran_data); + ge_dbg("Get all medias--over"); + + __ge_local_data_destroy_filter(filter); + + if (ret != MEDIA_CONTENT_ERROR_NONE) { + ge_dbgE("Get all medias failed[d]!", ret); + return -1; + } + + return 0; +} + diff --git a/ug/ug-gallery-efl/src/ge-rotate-bg.c b/ug/ug-gallery-efl/src/ge-rotate-bg.c new file mode 100755 index 0000000..cd4585f --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-rotate-bg.c @@ -0,0 +1,396 @@ +/* + * Copyright (c) 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. + */ + +#ifdef _USE_ROTATE_BG_GE + +#include "ge-rotate-bg.h" +#include "ge-exif.h" +#include "ge-debug.h" +#include "ge-icon.h" + +#define GE_ROTATE_BG_DATA_KEY "ge_bg_data" +#define GE_ROTATE_BG_GROUP "ge_bg_layout" + +typedef struct _ge_bg { + Evas_Object *base; + Evas_Object *img; + char *file; +} ge_bg; + +static int __ge_rotate_bg_image_rotate_180(Evas_Object *obj) +{ + GE_CHECK_VAL(obj, -1); + unsigned int *data = NULL; + unsigned int *data2 = NULL; + unsigned int *to = NULL; + unsigned int *from = NULL; + int x = 0; + int hw = 0; + int iw = 0; + int ih = 0; + + evas_object_image_size_get(obj, &iw, &ih); + int size = iw * ih * sizeof(unsigned int); + + /* EINA_FALSE for reading */ + data = evas_object_image_data_get(obj, EINA_FALSE); + /* memcpy */ + data2 = calloc(1, size); + GE_CHECK_VAL(data2, -1); + memcpy(data2, data, size); + + data = evas_object_image_data_get(obj, EINA_TRUE); + + hw = iw * ih; + x = hw; + to = data; + from = data2 + hw - 1; + for (; --x >= 0;) { + *to = *from; + to++; + from--; + } + +#if 0 /* Failed to rotate icon created from original file */ + hw = iw * ih; + x = (hw / 2); + p1 = data; + p2 = data + hw - 1; + for (; --x > 0;) { + tmp = *p1; + *p1 = *p2; + *p2 = tmp; + p1++; + p2--; + } +#endif + + GE_FREE(data2); + + evas_object_image_data_set(obj, data); + evas_object_image_data_update_add(obj, 0, 0, iw, ih); + return 0; +} + +static int __ge_rotate_bg_image_rotate_90(Evas_Object *obj) +{ + GE_CHECK_VAL(obj, -1); + unsigned int *data = NULL; + unsigned int *data2 = NULL; + unsigned int *to = NULL; + unsigned int *from = NULL; + int x = 0; + int y = 0; + int w = 0; + int hw = 0; + int iw = 0; + int ih = 0; + + evas_object_image_size_get(obj, &iw, &ih); + int size = iw * ih * sizeof(unsigned int); + + /* EINA_FALSE for reading */ + data = evas_object_image_data_get(obj, EINA_FALSE); + /* memcpy */ + data2 = calloc(1, size); + GE_CHECK_VAL(data2, -1); + memcpy(data2, data, size); + + /* set width, height */ + w = ih; + ih = iw; + iw = w; + hw = w * ih; + + /* set width, height to image obj */ + evas_object_image_size_set(obj, iw, ih); + data = evas_object_image_data_get(obj, EINA_TRUE); + to = data + w - 1; + hw = -hw - 1; + from = data2; + + for (x = iw; --x >= 0;) { + for (y = ih; --y >= 0;) { + *to = *from; + from++; + to += w; + } + + to += hw; + } + + GE_FREE(data2); + + evas_object_image_data_set(obj, data); + evas_object_image_data_update_add(obj, 0, 0, iw, ih); + return 0; +} + +static int __ge_rotate_bg_image_rotate_270(Evas_Object *obj) +{ + GE_CHECK_VAL(obj, -1); + unsigned int *data = NULL; + unsigned int *data2 = NULL; + unsigned int *to = NULL; + unsigned int *from = NULL; + int x = 0; + int y = 0; + int w = 0; + int hw = 0; + int iw = 0; + int ih = 0; + + evas_object_image_size_get(obj, &iw, &ih); + int size = iw * ih * sizeof(unsigned int); + + /* EINA_FALSE for reading */ + data = evas_object_image_data_get(obj, EINA_FALSE); + /* memcpy */ + data2 = calloc(1, size); + GE_CHECK_VAL(data2, -1); + memcpy(data2, data, size); + + /* set width, height */ + w = ih; + ih = iw; + iw = w; + hw = w * ih; + + /* set width, height to image obj */ + evas_object_image_size_set(obj, iw, ih); + data = evas_object_image_data_get(obj, EINA_TRUE); + + to = data + hw - w; + w = -w; + hw = hw + 1; + from = data2; + + for (x = iw; --x >= 0;) { + for (y = ih; --y >= 0;) { + *to = *from; + from++; + to += w; + } + + to += hw; + } + + GE_FREE(data2); + + evas_object_image_data_set(obj, data); + evas_object_image_data_update_add(obj, 0, 0, iw, ih); + return 0; +} + +/* check its orientation */ +int __ge_rotate_bg_rotate_image(Evas_Object *obj, unsigned int orient) +{ + switch (orient){ + case GE_ORIENTATION_ROT_90: + __ge_rotate_bg_image_rotate_90(obj); + break; + case GE_ORIENTATION_ROT_180: + __ge_rotate_bg_image_rotate_180(obj); + break; + case GE_ORIENTATION_ROT_270: + __ge_rotate_bg_image_rotate_270(obj); + break; + default: + break; + } + + return 0; +} + +static void __ge_rotate_bg_delete_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + if (data) { + ge_bg *bg_data = (ge_bg *)data; + GE_FREEIF(bg_data->file); + GE_FREE(data); + } +} + +static void __ge_rotate_bg_custom_resize(void *data, Evas *e, Evas_Object *obj, void *event_info) +{ + GE_CHECK(data); + ge_bg *bg_data = (ge_bg *)data; + Evas_Coord bx = 0; + Evas_Coord by = 0; + Evas_Coord bw = 0; + Evas_Coord bh = 0; + Evas_Coord iw = 0; + Evas_Coord ih = 0; + Evas_Coord fx = 0; + Evas_Coord fy = 0; + Evas_Coord fw = 0; + Evas_Coord fh = 0; + Evas_Coord nx = 0; + Evas_Coord ny = 0; + Evas_Coord nw = 0; + Evas_Coord nh = 0; + + if ((!bg_data->img) || (!bg_data->base)) { + ge_dbgE("Invalid object!"); + return; + } + /* grab image size */ + evas_object_image_size_get(bg_data->img, &iw, &ih); + if ((iw < 1) || (ih < 1)) { + ge_dbgE("(iw < 1) || (ih < 1)!"); + return; + } + + /* grab base object dimensions */ + evas_object_geometry_get(bg_data->base, &bx, &by, &bw, &bh); + + /* set some defaults */ + nx = bx; + ny = by; + nw = bw; + nh = bh; + + + fw = bw; + fh = ((ih * fw) / iw); + if (fh < bh) { + fh = bh; + fw = ((iw * fh) / ih); + } + fx = ((bw - fw) / 2); + fy = ((bh - fh) / 2); + + evas_object_move(bg_data->img, nx, ny); + evas_object_resize(bg_data->img, nw, nh); + evas_object_image_fill_set(bg_data->img, fx, fy, fw, fh); +} + +Evas_Object *_ge_rotate_bg_add_layout(Evas_Object *parent, const char *file, const char *group) +{ + Evas_Object *eo = NULL; + int r = 0; + + eo = elm_layout_add(parent); + if (eo) { + r = elm_layout_file_set(eo, file, group); + if (!r) { + evas_object_del(eo); + return NULL; + } + + evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL); + } + + return eo; +} + +Evas_Object *_ge_rotate_bg_add(Evas_Object *parent) +{ + GE_CHECK_NULL(parent); + ge_dbg(""); + + ge_bg *bg_data = (ge_bg *)calloc(1, sizeof(ge_bg)); + GE_CHECK_NULL(bg_data); + + Evas_Object *base = NULL; + base = _ge_rotate_bg_add_layout(parent, GE_EDJ_FILE, + GE_ROTATE_BG_GROUP); + if (base == NULL) { + GE_FREE(bg_data); + return NULL; + } + + bg_data->base= base; + evas_object_event_callback_add(base, EVAS_CALLBACK_RESIZE, + __ge_rotate_bg_custom_resize, bg_data); + evas_object_event_callback_add(base, EVAS_CALLBACK_DEL, + __ge_rotate_bg_delete_cb, bg_data); + + evas_object_data_set(base, GE_ROTATE_BG_DATA_KEY, bg_data); + ge_dbg("base %p", base); + return base; +} + +int _ge_rotate_bg_set_file(Evas_Object *bg, const char *file, int w, int h) +{ + GE_CHECK_VAL(file, -1); + GE_CHECK_VAL(bg, -1); + + ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY); + GE_CHECK_VAL(bg_data, -1); + + Evas_Object *image_obj = NULL; + image_obj = evas_object_image_add(evas_object_evas_get(bg)); + evas_object_repeat_events_set(image_obj, EINA_TRUE); + bg_data->img = image_obj; + bg_data->file = strdup(file); + elm_object_part_content_set(bg, "elm.swallow.image", image_obj); + evas_object_image_load_size_set(image_obj, w, h); + evas_object_image_file_set(image_obj, file, NULL); + evas_object_image_preload(image_obj, EINA_FALSE); + return 0; +} + +int _ge_rotate_bg_rotate_image(Evas_Object *bg, unsigned int orient) +{ + GE_CHECK_VAL(bg, -1); + + ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY); + GE_CHECK_VAL(bg_data, -1); + + if (bg_data->file && g_strcmp0(bg_data->file, GE_DEFAULT_THUMB_ICON)) + __ge_rotate_bg_rotate_image(bg_data->img, orient); + else + __ge_rotate_bg_rotate_image(bg_data->img, GE_ORIENTATION_ROT_0); + __ge_rotate_bg_custom_resize(bg_data, NULL, NULL, NULL); + return 0; +} + +int _ge_rotate_bg_add_image(Evas_Object *bg, int w, int h) +{ + GE_CHECK_VAL(bg, -1); + + ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY); + GE_CHECK_VAL(bg_data, -1); + + Evas_Object *image_obj = NULL; + image_obj = evas_object_image_add(evas_object_evas_get(bg)); + evas_object_image_size_set(image_obj, w, h); + evas_object_image_fill_set(image_obj, 0, 0, w, h); + evas_object_repeat_events_set(image_obj, EINA_TRUE); + bg_data->img = image_obj; + elm_object_part_content_set(bg, "elm.swallow.image", image_obj); + evas_object_image_load_size_set(image_obj, w, h); + return 0; +} + +int _ge_rotate_bg_set_image_file(Evas_Object *bg, const char *file) +{ + GE_CHECK_VAL(bg, -1); + + ge_bg *bg_data = evas_object_data_get(bg, GE_ROTATE_BG_DATA_KEY); + GE_CHECK_VAL(bg_data, -1); + GE_CHECK_VAL(bg_data->img, -1); + + evas_object_image_file_set(bg_data->img, file, NULL); + evas_object_image_preload(bg_data->img, EINA_FALSE); + + __ge_rotate_bg_custom_resize(bg_data, NULL, NULL, NULL); + return 0; +} + +#endif diff --git a/ug/ug-gallery-efl/src/ge-thumb.c b/ug/ug-gallery-efl/src/ge-thumb.c new file mode 100755 index 0000000..1a01cd9 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-thumb.c @@ -0,0 +1,181 @@ +/* + * Copyright (c) 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 "ge-debug.h" +#include "ge-util.h" +#include "ge-drm.h" +#include "ge-strings.h" +#include "ge-icon.h" +#ifdef _USE_ROTATE_BG_GE +#include "ge-rotate-bg.h" +#include "ge-exif.h" +#endif + +#define GE_PHOTOFRAME_STYLE_VIDEO_FAVOR_BOOKMARK "default_layout_video_favor_bookmark" +#define GE_PHOTOFRAME_STYLE_VIDEO_BOOKMARK "default_layout_video_bookmark" +#define GE_PHOTOFRAME_STYLE_VIDEO_FAVOR "default_layout_video_favor" +#define GE_PHOTOFRAME_STYLE_VIDEO "default_layout_video" +#define GE_PHOTOFRAME_STYLE_FAVOR "default_layout_favor" +#define GE_PHOTOFRAME_STYLE_DEFAULT "default_layout" + +#define GE_CLASS_GENGRID "gengrid" +#define GE_GRP_PHOTOFRAME "photoframe" +#define GE_GRID_TEXT "elm.text" + +Evas_Object *_ge_thumb_show_part_icon_image(Evas_Object *obj, char *path, + unsigned int orient, bool b_favor, + bool is_expired_drm, int item_size) +{ + GE_CHECK_NULL(obj); + + Evas_Object *layout = elm_layout_add(obj); + GE_CHECK_NULL(layout); + +#ifdef _USE_ROTATE_BG_GE + Evas_Object *bg = _ge_rotate_bg_add(layout); +#else + Evas_Object *bg = elm_bg_add(layout); +#endif + if (bg == NULL) { + evas_object_del(layout); + return NULL; + } + +#ifdef _USE_ROTATE_BG_GE + _ge_rotate_bg_set_file(bg, path, item_size, item_size); + _ge_rotate_bg_rotate_image(bg, orient); +#else + elm_bg_file_set(bg, path, NULL); + elm_bg_load_size_set(bg, item_size, item_size); + evas_object_size_hint_max_set(bg, item_size, item_size); + evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + 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); +#endif + + // TODO: Need to check the expired drm icon file... + /* Expired drm icon */ + if (is_expired_drm) { + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_FAVOR); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + + Evas_Object *icon = elm_icon_add(layout); + elm_image_file_set(icon, GE_LOCK_ICON, NULL); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + } else if (b_favor) { + /* Set favourites icon */ + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_FAVOR); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + + Evas_Object *icon = elm_icon_add(layout); + elm_image_file_set(icon, GE_THUMB_FAVOR_ICON, NULL); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + } else { + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_DEFAULT); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + } + + evas_object_show(layout); + return layout; +} + +Evas_Object *_ge_thumb_show_part_icon_video(Evas_Object *obj, char *path, + unsigned int v_dur, int bk_len, + bool b_favor, bool is_expired_drm, + int item_size) +{ + GE_CHECK_NULL(obj); + + Evas_Object *layout = elm_layout_add(obj); + GE_CHECK_NULL(layout); + +#ifdef _USE_ROTATE_BG_GE + Evas_Object *bg = _ge_rotate_bg_add(layout); +#else + Evas_Object *bg = elm_bg_add(layout); +#endif + if (bg == NULL) { + evas_object_del(layout); + return NULL; + } + +#ifdef _USE_ROTATE_BG_GE + _ge_rotate_bg_set_file(bg, path, item_size, item_size); + _ge_rotate_bg_rotate_image(bg, GE_ORIENTATION_ROT_0); +#else + elm_bg_file_set(bg, path, NULL); + elm_bg_load_size_set(bg, item_size, item_size); + evas_object_size_hint_max_set(bg, item_size, item_size); + evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1); + 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); +#endif + + if (bk_len && b_favor) + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_VIDEO_FAVOR_BOOKMARK); + else if (bk_len) + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_VIDEO_BOOKMARK); + else if (is_expired_drm || b_favor) + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_VIDEO_FAVOR); + else + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_VIDEO); + elm_object_part_content_set(layout, "elm.swallow.icon", bg); + + // TODO: Need to check the expired drm icon file... + /* Expired drm icon */ + if (is_expired_drm) { + Evas_Object *icon = elm_icon_add(layout); + elm_image_file_set(icon, GE_LOCK_ICON, NULL); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + /* Set favourites icon */ + } else if (b_favor) { + Evas_Object *icon = elm_icon_add(layout); + elm_image_file_set(icon, GE_THUMB_FAVOR_ICON, NULL); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + } + + if (bk_len) { + Evas_Object *icon = elm_icon_add(layout); + elm_image_file_set(icon, GE_THUMB_BOOKMARK, NULL); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.bookmarkicon", + icon); + } + + char *dur_str = _ge_get_duration_string(v_dur); + GE_CHECK_NULL(dur_str); + elm_object_part_text_set(layout, GE_GRID_TEXT, dur_str); + GE_FREE(dur_str); + + evas_object_show(layout); + return layout; +} + diff --git a/ug/ug-gallery-efl/src/ge-tile.c b/ug/ug-gallery-efl/src/ge-tile.c new file mode 100755 index 0000000..effba8b --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-tile.c @@ -0,0 +1,125 @@ +/* + * Copyright (c) 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 "ge-debug.h" +#include "ge-tile.h" +#include "ge-button.h" +#include "ge-icon.h" +#ifdef _USE_ROTATE_BG_GE +#include "ge-rotate-bg.h" +#endif + +/* Album color level and alpha value */ +#define GE_TILE_TEXT_COLOR_CNT 6 +#define GE_TILE_TEXT_COLOR_ALPHA 255 + +typedef struct _ge_tile_color { + int r; + int g; + int b; +} ge_tile_color; + +static ge_tile_color bg_color[] = { + {50, 50, 50}, + {78, 74, 64}, + {49, 125, 174}, + {165, 53, 53}, + {71, 128, 11}, + {56, 78, 116}, + {25, 25, 25}, +}; + +Evas_Object *__ge_tile_add_1_icon_bg(Evas_Object *obj, int len, double scale, + bg_file_set_cb func, void **data) +{ + GE_CHECK_NULL(obj); + GE_CHECK_NULL(func); + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG_GE + bg = _ge_rotate_bg_add(obj); +#else + bg = elm_bg_add(obj); +#endif + GE_CHECK_NULL(bg); + + int wid = 0; + int hei = 0; + + wid = (int)(GE_TILER_ICON_S * scale); + if (len == 1) + hei = wid; + else + hei = (int)(GE_TILE_2X_GRID_S * scale); + +#ifdef _USE_ROTATE_BG_GE + _ge_rotate_bg_add_image(bg, wid, hei); +#else + elm_bg_load_size_set(bg, wid, hei); +#endif + + func(bg, data[0]); + + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bg, 0.5, 0.5); + evas_object_show(bg); + + return bg; +} + +Evas_Object *_ge_tile_show_part_icon(Evas_Object *obj, const char *part, + int length, double scale, + bg_file_set_cb func, void **data) +{ + GE_CHECK_NULL(part); + GE_CHECK_NULL(strlen(part)); + GE_CHECK_NULL(obj); + ge_dbg("part is %s", part); + + if (!g_strcmp0(part, GT_TILE_ONLYICON)) { + Evas_Object *bg = NULL; + bg = __ge_tile_add_1_icon_bg(obj, GE_TILE_THUMB_1, scale, func, + data); + return bg; + } + return NULL; +} + +Evas_Object *_ge_tile_show_part_label(Evas_Object *obj, int index, + bool b_default) +{ + GE_CHECK_NULL(obj); + + Evas *evas = evas_object_evas_get(obj); + GE_CHECK_NULL(evas); + Evas_Object *bg = NULL; + bg = evas_object_rectangle_add(evas); + GE_CHECK_NULL(bg); + + int j = 0; + if (b_default) + j = GE_TILE_TEXT_COLOR_CNT; + else + j = index % GE_TILE_TEXT_COLOR_CNT; + evas_object_color_set(bg, bg_color[j].r, bg_color[j].g, bg_color[j].b, + GE_TILE_TEXT_COLOR_ALPHA); + + 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); + evas_object_show(bg); + return bg; +} + diff --git a/ug/ug-gallery-efl/src/ge-ui-util.c b/ug/ug-gallery-efl/src/ge-ui-util.c new file mode 100755 index 0000000..6346913 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-ui-util.c @@ -0,0 +1,561 @@ +/* + * Copyright (c) 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 "ge-ui-util.h" +#include "ge-util.h" +#include "ge-button.h" +#include "ge-gridview.h" +#include "ge-albums.h" +#include "ge-debug.h" +#include "ge-data.h" +#include "ge-strings.h" +#include "ge-icon.h" + +#define GE_FILE_PATH_SEPERATOR ';' + +#define HOME_ALBUM_COVER_NUM 1 +#define VIDEO_SHARE_NUM 1 +#define GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY 3.0 +#define GE_SELINFO_HIDE_TIME_DELAY 3.0 +#define GE_CTRLBAR_STYLE_NAVIFRAME "naviframe" +#define GE_BTN_NAVI_PRE "naviframe/back_btn/default" +#define GE_BTN_NAVI_TOOLBAR "naviframe/toolbar/default" +#define GE_NAVIFRAME_BTN1 "toolbar_button1" +#define GE_BTN_POPUP "popup_button/default" +#define GE_NAVIFRAME_PREB_BTN "prev_btn" +#define GE_TRANS_FINISHED "transition,finished" +///This variable is used only for emulator. +static int g_angle = 0; + +static void _ge_ui_response_cb(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg("event_info: %d", (int)event_info); + GE_CHECK(data); + ge_ugdata *ugd = (ge_ugdata *)data; + ge_dbg("popup mode: %d", ugd->popup_mode); + + evas_object_del(obj); + ugd->popup = NULL; +} + +static Eina_Bool __ge_popup_timeout_cb(void *data) +{ + GE_CHECK_FALSE(data); + ge_ugdata *ugd = (ge_ugdata *)data; + if (ugd->del_timer) { + ecore_timer_del(ugd->del_timer); + ugd->del_timer = NULL; + } + + /* Used for adding shortcut failed */ + if (ugd->popup_mode == GE_POPUP_EXIT) { + ge_dbgW("Terminate me!"); + ug_destroy_me(ugd->ug); + ugd->ug = NULL; + } + + GE_IF_DEL_OBJ(ugd->popup); + return ECORE_CALLBACK_CANCEL; +} + +static int __ge_popup_add_timer(void *data, double to_inc) +{ + GE_CHECK_VAL(data, -1); + ge_ugdata *ugd = (ge_ugdata *)data; + if (ugd->del_timer) { + ecore_timer_del(ugd->del_timer); + ugd->del_timer = NULL; + } + + ugd->del_timer = ecore_timer_add(to_inc, __ge_popup_timeout_cb, data); + return 0; +} + +static void __ge_ui_done_cb(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); + GE_CHECK(data); + ge_ugdata *ugd = (ge_ugdata *)data; + int i = 0; + + elm_object_item_disabled_set((Elm_Object_Item *)event_info, EINA_TRUE); + + if(ugd->file_select_mode) //file selection mode + { + ge_item* sel_item = NULL; + char* filepath_arg = NULL; + int sel_cnt = _ge_data_selected_list_count(); + + if(sel_cnt == 0) + { + ge_dbg("No thumbs selected, return!"); + ge_ui_create_popup(ugd, GE_POPUP_NOBUT, + GE_POPUP_NO_FILES_SELECTED); + return; + } + + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) { + GString* selected_path = g_string_new(NULL); + + for(i = 1; i <= sel_cnt; i++ ) { + _ge_data_get_selected_item_by_index(&sel_item, i); + if(sel_item && sel_item->item) { + ge_dbg("Selected [%s]", sel_item->item->file_url); + g_string_append(selected_path, sel_item->item->file_url); + g_string_append_c(selected_path, + GE_FILE_PATH_SEPERATOR); + } + } + int str_len = strlen(selected_path->str); + ge_dbg("path string length = %d", str_len); + g_string_truncate(selected_path, str_len - 1); + + filepath_arg = g_string_free(selected_path, false); + + char t_str[32] = { 0, }; + eina_convert_itoa(sel_cnt, t_str); + + service_add_extra_data(ugd->service, + GE_FILE_SELECT_RETURN_COUNT, + t_str); + service_add_extra_data(ugd->service, + GE_FILE_SELECT_RETURN_PATH, + filepath_arg); + service_add_extra_data(ugd->service, + SERVICE_DATA_SELECTED, + filepath_arg); + ug_send_result(ugd->ug, ugd->service); + + if(filepath_arg) { + g_free(filepath_arg); + filepath_arg = NULL; + } + } + + _ge_data_selected_list_finalize(); + + ug_destroy_me(ugd->ug); + } +} + +static int __ge_ui_disable_done(ge_ugdata *ugd, bool disabled) +{ + ge_dbg("Disable Done(%d)?", disabled); + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(ugd->thumbs_nf_it, -1); + + Evas_Object *btn = NULL; + btn = elm_object_item_part_content_get(ugd->thumbs_nf_it, + GE_NAVIFRAME_BTN1); + elm_object_disabled_set(btn, disabled); + return 0; +} + +static void __ge_ui_trans_finished_cb(void *data, Evas_Object *obj, void *event_info) +{ + GE_CHECK(data); + ge_ugdata *ugd = (ge_ugdata *)data; + ge_dbgW(""); + evas_object_smart_callback_del(obj, GE_TRANS_FINISHED, + __ge_ui_trans_finished_cb); + + /* Clear previous view after animation finished */ + elm_gengrid_clear(ugd->albums_view); +} + +static void _ge_ui_destroy_me_cb(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); + GE_CHECK(data); + ge_ugdata *ugd = (ge_ugdata *)data; + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", _ge_ui_destroy_me_cb); + + if (_ge_get_view_mode() != GE_VIEW_ALBUMS) { + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) { + ge_ui_destroy_selinfo(ugd); + _ge_data_selected_list_finalize(); + } + ge_grid_clear_view(ugd); + } + + service_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_QUIT, + GE_FILE_SELECT_QUIT_STATE); + ug_send_result(ugd->ug, ugd->service); + + ug_destroy_me(ugd->ug); + ge_dbg("ug_destroy_me"); +} + +static void _ge_ui_back_to_albums_cb(void *data, Evas_Object *obj, void *event_info) +{ + ge_dbg(""); + GE_CHECK(data); + ge_ugdata *ugd = (ge_ugdata *)data; + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + _ge_ui_back_to_albums_cb); + + ge_albums_back_to_view(ugd); +} + +int _ge_ui_get_rotate_angle(void) +{ + return g_angle; +} + +int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object *parent, + Evas_Object *obj, ge_navi_mode_e mode, + char* title) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(parent, -1); + GE_CHECK_VAL(obj, -1); + GE_CHECK_VAL(title, -1); + Elm_Object_Item *nf_it = NULL; + + if (mode == GE_NAVI_ALBUMS) { + ge_dbg("GE_NAVI_ALBUMS"); + /* Add cancel button */ + Evas_Object *cancel_btn = NULL; + cancel_btn = _ge_but_create_but(obj, ugd->th, NULL, GE_STR_OK, + GE_BTN_NAVI_PRE, + _ge_ui_destroy_me_cb, ugd); + GE_CHECK_VAL(cancel_btn, -1); + nf_it = elm_naviframe_item_push(parent, title, cancel_btn, NULL, + obj, NULL); + ugd->albums_nf_it = nf_it; + } else if (mode == GE_NAVI_THUMBS) { + if(ugd->file_select_mode == GE_FILE_SELECT_T_NONE) { + ge_dbgE("file_select_mode == GE_FILE_SELECT_T_NONE!"); + return -1; + } + + ge_dbg("GE_NAVI_THUMBS"); + /* Add transition finished callback */ + evas_object_smart_callback_add(parent, GE_TRANS_FINISHED, + __ge_ui_trans_finished_cb, ugd); + nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, + NULL); + /* Set pre_btn style to back button */ + Evas_Object *back_btn = NULL; + back_btn = elm_object_item_part_content_get(nf_it, + GE_NAVIFRAME_PREB_BTN); + if(ugd->th) + elm_object_theme_set(back_btn, ugd->th); + elm_object_style_set(back_btn, GE_BTN_NAVI_PRE); + evas_object_smart_callback_add(back_btn, "clicked", + _ge_ui_back_to_albums_cb, ugd); + + /** + * Add 'Done' item. + */ + if (ugd->file_select_mode != GE_FILE_SELECT_T_ONE && + (_ge_get_view_mode() == GE_VIEW_THUMBS_EDIT)) { + ge_dbg("Multiple selection, show Done"); + /* Done */ + Evas_Object *btn = NULL; + btn = _ge_but_create_but(parent, ugd->th, NULL, + GE_STR_DONE, + GE_BTN_NAVI_TOOLBAR, + __ge_ui_done_cb, ugd); + GE_CHECK_VAL(btn, -1); + elm_object_disabled_set(btn, true); + elm_object_item_part_content_set(nf_it, + GE_NAVIFRAME_BTN1, + btn); + } + ugd->thumbs_nf_it = nf_it; + } + + return 0; +} + +Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *group) +{ + GE_CHECK_NULL(parent); + GE_CHECK_NULL(file); + GE_CHECK_NULL(group); + Evas_Object *eo; + int r; + + eo = elm_layout_add(parent); + if (eo) + { + r = elm_layout_file_set(eo, file, group); + if (!r) + { + evas_object_del(eo); + return NULL; + } + + evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL); + } + + return eo; +} + +void ge_ui_set_rotate_angle(int rotate_mode) +{ + g_angle = rotate_mode; +} + +Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd) +{ + GE_CHECK_NULL(ugd); + Evas_Object *layout = NULL; + char label_str[GE_NOCONTENTS_LABEL_LEN_MAX] ={0,}; + + if(_ge_get_view_mode() == GE_VIEW_THUMBS || + _ge_get_view_mode() == GE_VIEW_THUMBS_EDIT) { + if(ugd->file_type_mode) { + if (ugd->file_type_mode == GE_FILE_T_IMAGE) + snprintf(label_str, sizeof(label_str), + "%s", + (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_IMAGES"))); + else if (ugd->file_type_mode == GE_FILE_T_VIDEO) + snprintf(label_str, sizeof(label_str), + "%s", + (char*)GE_LABEL_NO_VIDEOS); + else + snprintf(label_str, sizeof(label_str), + "%s", + (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_ITEMS"))); + } else { + snprintf(label_str, sizeof(label_str), "%s", + (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_ITEMS"))); + } + } else if(_ge_get_view_mode() == GE_VIEW_ALBUMS) { + snprintf(label_str, sizeof(label_str), "%s", + (char*)GE_LABEL_NO_ALBUMS); + } else { + ge_dbgE("view mode is error."); + } + + ge_dbg("\nNocontents label: %s", label_str); + /* Full nocontents view layout */ + layout = elm_layout_add(ugd->navi_bar); + GE_CHECK_NULL(layout); + elm_layout_theme_set(layout, "layout", "nocontents", "gallery_efl"); + elm_object_part_text_set(layout, "elm.text", label_str); + + return layout; +} + +Evas_Object* ge_ui_create_main_ly(ge_ugdata* ugd, Evas_Object* parent) +{ + GE_CHECK_NULL(ugd); + GE_CHECK_NULL(parent); + Evas_Object *layout = NULL; + + layout = elm_layout_add(parent); + GE_CHECK_NULL(layout); + + /* Apply the layout style */ + const char *profile = elm_config_profile_get(); + if (!g_strcmp0(profile, "mobile")) { + elm_layout_theme_set(layout, "layout", "application", "default"); + } else if (!g_strcmp0(profile,"extension")) { + elm_layout_theme_set(layout, "layout", "application", "noindicator"); + } + + evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_show(layout); + + return layout; +} + +Evas_Object* ge_ui_create_navibar(ge_ugdata* ugd, Evas_Object* parent) +{ + GE_CHECK_NULL(ugd); + GE_CHECK_NULL(parent); + Evas_Object *navi_bar = NULL; + + navi_bar = elm_naviframe_add(parent); + GE_CHECK_NULL(navi_bar); + + if(ugd->th) + { + elm_object_theme_set(navi_bar, ugd->th); + } + elm_object_part_content_set(parent, "elm.swallow.content", navi_bar); + + evas_object_show(navi_bar); + + return navi_bar; +} + +Evas_Object* ge_ui_create_popup(ge_ugdata* ugd, ge_popup_mode_e mode, + char* desc) +{ + ge_dbg(""); + GE_CHECK_NULL(ugd); + GE_CHECK_NULL(desc); + + if(ugd->popup) + { + ge_dbg("The existed popup is deleted"); + evas_object_del(ugd->popup); + ugd->popup = NULL; + } + + Evas_Object *popup = NULL; + + popup = elm_popup_add(ugd->ly_main); + GE_CHECK_NULL(popup); + evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_object_text_set(popup, desc); + + switch (mode) { + case GE_POPUP_NOBUT: + case GE_POPUP_EXIT: + __ge_popup_add_timer(ugd, GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY); + break; + case GE_POPUP_ONEBUT: + { + Evas_Object *btn = NULL; + btn = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_OK, + GE_BTN_POPUP, _ge_ui_response_cb, ugd); + elm_object_part_content_set(popup, "button1", btn); + break; + } + case GE_POPUP_TWOBUT: + { + Evas_Object *btn1 = NULL; + btn1 = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_OK, + GE_BTN_POPUP, _ge_ui_response_cb, + ugd); + elm_object_part_content_set(popup, "button1", btn1); + Evas_Object *btn2 = NULL; + btn2 = _ge_but_create_but(popup, ugd->th, NULL, GE_STR_CANCEL, + GE_BTN_POPUP, _ge_ui_response_cb, + ugd); + elm_object_part_content_set(popup, "button2", btn2); + break; + } + default: + ge_dbgE("mode is not supported..."); + break; + } + + evas_object_show(popup); + + ugd->popup = popup; + ugd->popup_mode = mode; + + return popup; +} + +int _ge_ui_create_selinfo(ge_ugdata *ugd, Evas_Object *parent) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(parent, -1); + int count = 1; + int all_count = 0; + char text[GE_SELINFO_TEXT_LEN_MAX] = {0,}; + + count = _ge_data_selected_list_count(); + if(count <= 0) { + __ge_ui_disable_done(ugd, true); + if(ugd->file_select_mode == GE_FILE_SELECT_T_MULTIPLE) + ge_ui_destroy_selinfo(ugd); + ge_dbg("@@@[Warning] no item selected@@@"); + return -1; + } + + __ge_ui_disable_done(ugd, false); + + if(ugd->file_select_mode == GE_FILE_SELECT_T_ONE) { + ge_dbgW("In select one mode!"); + return -1; + } + + all_count = _ge_data_get_count_all(); + ge_dbg("New count , all count : %d,%d", count, all_count); + + ge_ui_destroy_selinfo(ugd); + + ugd->selinfo_ly = elm_layout_add(parent); + GE_CHECK_VAL(ugd->selinfo_ly, -1); + evas_object_size_hint_weight_set(ugd->selinfo_ly, + EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ugd->selinfo_ly, EVAS_HINT_FILL, + EVAS_HINT_FILL); + elm_layout_theme_set(ugd->selinfo_ly, "standard", "selectioninfo", + "center_text"); + + /* Set the content of the notify widget */ + elm_object_part_content_set(parent, "elm.swallow.selinfo", + ugd->selinfo_ly); + /* Add Space */ + snprintf(text, sizeof(text), "%s (%d)", GE_SELINFO_SELECTED, count); + text[strlen(text)] = '\0'; + + /* move view up while selection view shown.*/ + edje_object_signal_emit(_EDJ(parent), + "elm,thumb_view,state,moveup", "elm"); + edje_object_part_text_set(_EDJ(ugd->selinfo_ly), "elm.text", text); + return 0; +} + +int ge_ui_destroy_selinfo(ge_ugdata* ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(ugd->thumbs_view_ly, -1); + + /* reset view to default status.*/ + edje_object_signal_emit(_EDJ(ugd->thumbs_view_ly), + "elm,thumb_view,state,default", "elm"); + + if(ugd->selinfo_ly) { + evas_object_del(ugd->selinfo_ly); + ugd->selinfo_ly = NULL; + } + return 0; +} + +/* * +* In case of system folder, the displayed name should be translated into system language +* +* @param name +* check album display name for getting proper translation +* +* @return +* the translated album display name +*/ +char *_ge_ui_get_translated_album_name(ge_cluster *album) +{ + GE_CHECK_NULL(album); + GE_CHECK_NULL(album->cluster); + + if(_ge_data_is_default_album(GE_ALBUM_CAMERA_NAME, album->cluster)) { + /* system folder name: Camera */ + return GE_STR_CAMERA; + } else if(_ge_data_is_default_album(GE_ALBUM_DOWNLOAD_NAME, album->cluster)) { + /* system folder name: Downloads */ + return GE_STR_DOWNLOADS; + } else { + /* if the folder is not a system folder, return itself */ + return album->cluster->display_name; + } +} + diff --git a/ug/ug-gallery-efl/src/ge-util.c b/ug/ug-gallery-efl/src/ge-util.c new file mode 100755 index 0000000..5d0d81b --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-util.c @@ -0,0 +1,308 @@ +/* + * Copyright (c) 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 "ge-debug.h" +#include "ge-albums.h" +#include "ge-gridview.h" +#include "ge-data.h" +#include "ge-util.h" +#include "ge-ui-util.h" +#include "ge-strings.h" +#include "ge-icon.h" +#include "ge-drm.h" + +#define GE_TIME_MSEC_PER_SEC 1000 +#define GE_TIME_SEC_PER_MIN 60 +#define GE_TIME_MIN_PER_HOUR 60 +#define GE_TIME_SEC_PER_HOUR (GE_TIME_MIN_PER_HOUR * GE_TIME_SEC_PER_MIN) + +/* Global evas objects, which is used in the entire application */ +static ge_item* ge_current_mb_item; +static ge_cluster* ge_current_album_item; +static int ge_ug_iv_enter = 0; + +ge_item* _ge_get_current_item(void) +{ + return ge_current_mb_item; +} + +void _ge_set_current_item(ge_item* gitem) +{ + ge_current_mb_item = gitem; +} + +ge_cluster* _ge_get_current_album(void) +{ + return ge_current_album_item; +} + +void _ge_set_current_album(ge_cluster* album_item) +{ + ge_current_album_item = album_item; +} + +int _ge_ug_iv_get(void) +{ + return ge_ug_iv_enter; +} + +void _ge_ug_iv_set(int ug_iv_state) +{ + ge_ug_iv_enter = ug_iv_state; +} + +static int _ge_refresh_albums_list(ge_ugdata *ugd) +{ + GE_CHECK_VAL(ugd, -1); + ge_cluster* old_cur_cluster = _ge_get_current_album(); + char cluster_id[GE_MTYPE_ITEN_ID_LEN_MAX] = { 0, }; + int i = 0; + ge_cluster *current = NULL; + bool b_get_cur_album = false; + + if(old_cur_cluster && old_cur_cluster->cluster && + old_cur_cluster->cluster->uuid) + { + g_strlcpy(cluster_id, old_cur_cluster->cluster->uuid, + GE_MTYPE_ITEN_ID_LEN_MAX); + b_get_cur_album = true; + } + else + { + ge_dbg("None album selected, current album is unavailable\n"); + } + _ge_data_get_clusters_list(ugd); + + GE_CHECK_VAL(ugd->cluster_list, -1); + int length = eina_list_count(ugd->cluster_list->clist); + ge_dbg("album length: %d, current album id: %s", length, cluster_id); + + //need to reset current cluster + _ge_set_current_album(NULL); + if(b_get_cur_album) + { + for (i = 0; i < length; i++) + { + current = eina_list_nth(ugd->cluster_list->clist, i); + if(current && current->cluster && + current->cluster->uuid) { + ge_dbg("current album : %s", current->cluster->display_name); + } else { + ge_dbgE("Current is NULL"); + break; + } + if(!g_strcmp0(current->cluster->uuid, cluster_id)) + { + _ge_data_update_items_list(ugd, current); + _ge_set_current_album(current); + return 0; + } + } + /* Current album was removed, clear items list */ + if (_ge_data_get_selected_list()) + _ge_data_selected_list_finalize(); + _ge_data_free_items_list(); + } + + return -1; +} + +static void _ge_db_update_noti_cb(keynode_t *key, void* data) +{ + ge_dbgW("VCONFKEY_FILEMANAGER_DB_STATUS changed!"); + GE_CHECK(data); + ge_ugdata* ugd = (ge_ugdata*)data; + int mmc_state = -1; + int mode = GE_UPDATE_NONE; + + vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc_state); + if(mmc_state == -1) { + ge_dbgE("vconf_get_int failed!"); + return; + } + + if (mmc_state == VCONFKEY_SYSMAN_MMC_MOUNTED) { + ge_dbg("mmc_state[%d]: VCONFKEY_SYSMAN_MMC_MOUNTED", mmc_state); + mode = GE_UPDATE_MMC_ADDED; + } else if (mmc_state == VCONFKEY_SYSMAN_MMC_REMOVED || + mmc_state == VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED) { + ge_dbg("mmc_state[%d]: VCONFKEY_SYSMAN_MMC_REMOVED", mmc_state); + mode = GE_UPDATE_MMC_REMOVED; + } + + /* Update view */ + ge_update_view(ugd, mode); +} + +Eina_Bool ge_update_view(ge_ugdata* ugd, int mode) +{ + ge_dbg("mode: %d", mode); + GE_CHECK_FALSE(ugd); + int view_mode = _ge_get_view_mode(); + ge_dbg("view_mode: %d", view_mode); + + if (view_mode == GE_VIEW_ALBUMS) { + _ge_refresh_albums_list(ugd); + ge_albums_update_view(ugd); + } else if (view_mode == GE_VIEW_THUMBS) { + _ge_refresh_albums_list(ugd); + if(_ge_get_current_album() == NULL) + { + ge_dbg("current album is empty, back to albums view!"); + ge_albums_back_to_view(ugd); + elm_naviframe_item_pop(ugd->navi_bar); + + return EINA_FALSE; + } + + ge_grid_update_view(ugd); + } else if (view_mode == GE_VIEW_THUMBS_EDIT) { + ge_cluster* cur_album = _ge_get_current_album(); + + /* MMC removed */ + if(mode == GE_UPDATE_MMC_REMOVED && cur_album && + cur_album->cluster && + cur_album->cluster->type == GE_MMC) { + ge_dbgW("MMC album, change to albums view!"); + _ge_refresh_albums_list(ugd); + ge_albums_back_to_view(ugd); + elm_naviframe_item_pop(ugd->navi_bar); + return EINA_FALSE; + } + + /* Update albums list and items list */ + _ge_refresh_albums_list(ugd); + if(_ge_data_get_count_all() <= 0) { + ge_dbgW("current album is empty, back to albums view!"); + ge_albums_back_to_view(ugd); + elm_naviframe_item_pop(ugd->navi_bar); + return EINA_FALSE; + } + + ge_grid_update_view(ugd); + + if(_ge_data_get_count_all() <= 0) { + ge_dbgW("current album is empty, back to albums view!"); + ge_albums_back_to_view(ugd); + elm_naviframe_item_pop(ugd->navi_bar); + return EINA_FALSE; + } + } + + return EINA_TRUE; +} + +int ge_reg_db_update_noti(ge_ugdata* ugd) +{ + ge_dbg(""); + GE_CHECK_VAL(ugd, -1); + int error_code = 0; + + error_code = vconf_notify_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS, + _ge_db_update_noti_cb, ugd); + if(error_code == -1) + ge_dbgE("vconf_notify_key_changed FAIL!"); + + return 0; +} + +int ge_dereg_db_update_noti(void) +{ + ge_dbg(""); + int error_code = -1; + + error_code = vconf_ignore_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS, + _ge_db_update_noti_cb); + if(error_code == -1) + ge_dbgE("vconf_ignore_key_changed FAIL!"); + + return 0; +} + +bool _ge_is_image_valid(void *data, char *filepath) +{ + GE_CHECK_FALSE(data); + ge_ugdata *ugd = (ge_ugdata *)data; + GE_CHECK_FALSE(filepath); + + Evas_Object *image = NULL; + int width = 0; + int height = 0; + Evas *evas = NULL; + + evas = evas_object_evas_get(ugd->win); + GE_CHECK_FALSE(evas); + + image = evas_object_image_add(evas); + GE_CHECK_FALSE(image); + + evas_object_image_filled_set(image, 0); + evas_object_image_load_scale_down_set(image, 0); + evas_object_image_file_set(image, filepath, NULL); + evas_object_image_size_get(image, &width, &height); + if(image) { + evas_object_del(image); + image = NULL; + } + + if (width <= 0 || height <= 0) { + ge_dbg("Cannot load file : %s", filepath); + return false; + } + + return true; +} + +/* Change int to char * of video duration, caller need to free the allocated memory */ +char *_ge_get_duration_string(unsigned int v_dur) +{ + char *dur_str = calloc(1, GE_FILE_PATH_LEN_MAX); + GE_CHECK_NULL(dur_str); + if (v_dur > 0) { + int duration = floor(v_dur / GE_TIME_MSEC_PER_SEC); + int dur_hr = 0; + int dur_min = 0; + int dur_sec = 0; + int tmp = 0; + + if (duration >= GE_TIME_SEC_PER_HOUR) { + dur_sec = duration % GE_TIME_SEC_PER_MIN; + tmp = floor(duration / GE_TIME_SEC_PER_MIN); + dur_min = tmp % GE_TIME_MIN_PER_HOUR; + dur_hr = floor(tmp / GE_TIME_MIN_PER_HOUR); + } else if (duration >= GE_TIME_SEC_PER_MIN) { + dur_hr = 0; + dur_min = floor(duration / GE_TIME_SEC_PER_MIN); + dur_sec = duration % GE_TIME_SEC_PER_MIN; + } else { + dur_hr = 0; + dur_min = 0; + dur_sec = duration % GE_TIME_SEC_PER_MIN; + } + + snprintf(dur_str, GE_FILE_PATH_LEN_MAX, "%02d:%02d:%02d", + dur_hr, dur_min, dur_sec); + } else { + snprintf(dur_str, GE_FILE_PATH_LEN_MAX, "00:00:00"); + } + dur_str[strlen(dur_str)] = '\0'; + return dur_str; +} + diff --git a/ug/ug-gallery-efl/ug-gallery-efl.xml b/ug/ug-gallery-efl/ug-gallery-efl.xml new file mode 100755 index 0000000..f12a725 --- /dev/null +++ b/ug/ug-gallery-efl/ug-gallery-efl.xml @@ -0,0 +1,60 @@ + + + + Jiansong Jin + Gallery application + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- 2.7.4