From: Jiansong Jin Date: Tue, 21 Aug 2012 08:49:32 +0000 (+0900) Subject: initial upload for tizen 2.0 beta X-Git-Tag: 2.0_alpha~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=262276a4d0a663ab844aa7a25eab789ccc9a3144;p=apps%2Fhome%2Fgallery.git initial upload for tizen 2.0 beta Change-Id: I09c3743c2c590bb651ddb6a4588e99f8f7f1c76e --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 83353bc..5b2b3f7 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,23 +2,40 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(gallery C) SET(RSRC_DIR res) -SET(EDC_DIR edc) -SET(IMG_DIR images) -SET(SRCS src/gallery.c +SET(EDC_DIR white_theme/edc) +SET(IMG_DIR white_theme/images) +SET(SOUND_DIR white_theme/sounds) + +SET(SRCS + src/gallery.c src/features/gl-albums.c src/features/gl-gridview.c src/features/gl-listview.c - src/features/gl-controlbar.c - src/features/gl-button.c - src/features/gl-popup.c - src/features/gl-progressbar.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-progressbar.c + src/widget/gl-rotate-bg.c + src/widget/gl-tile.c + src/widget/gl-thumb.c + src/widget/gl-video.c + src/util/gl-debug.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-db-handler.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") @@ -29,7 +46,7 @@ SET(BINDIR "${PREFIX}/bin") SET(RESDIR "${PREFIX}/res") SET(DATADIR "${PREFIX}/data") SET(LOCALEDIR "${RESDIR}/locale") -SET(ICONDIR "${RESDIR}/icons/default/small") +SET(ICONDIR "/opt/share/icons/default/small") SET(EDJDIR "${RESDIR}/edje") IF("${CMAKE_BUILD_TYPE}" STREQUAL "") @@ -38,43 +55,50 @@ 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 - appcore-common - appcore-efl - libmedia-service media-thumbnail - ui-gadget + 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 - appsvc capi-appfw-application - devman_haptic) + capi-appfw-app-manager + capi-system-haptic +) 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}" STREQUAL "arm") +IF("${ARCH}" MATCHES "arm") ADD_DEFINITIONS("-DTARGET") MESSAGE("add -DTARGET") -ENDIF("${ARCH}" STREQUAL "arm") +ENDIF("${ARCH}" MATCHES "arm") ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"") ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"") @@ -87,39 +111,37 @@ ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"") ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"") ADD_DEFINITIONS("-D_USE_DLOG_") +ADD_DEFINITIONS("-D_USE_WIFI") +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} -lm) + +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-black-theme.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${IMG_DIR} - ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${EDC_DIR}/gl-black-theme.edc ${CMAKE_BINARY_DIR}/gl-black-theme.edj - DEPENDS ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${EDC_DIR}/gl-black-theme.edc -) -ADD_CUSTOM_TARGET(edj_build DEPENDS gallery.edj gl-black-theme.edj) + +ADD_CUSTOM_TARGET(edj_build DEPENDS gallery.edj) ADD_DEPENDENCIES(${PROJECT_NAME} edj_build) #ADD_DEPENDENCIES(${PROJECT_NAME} gallery.edj) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) INSTALL(FILES ${CMAKE_BINARY_DIR}/gallery.edj DESTINATION ${EDJDIR}) -INSTALL(FILES ${CMAKE_BINARY_DIR}/gl-black-theme.edj DESTINATION ${EDJDIR}) - -# install desktop file & icon -CONFIGURE_FILE(${PKGNAME}.desktop.in ${PKGNAME}.desktop) -INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.desktop DESTINATION /opt/share/applications) +# install manifest file & icon +INSTALL(FILES ${CMAKE_BINARY_DIR}/${PKGNAME}.xml DESTINATION /opt/share/packages) INSTALL(FILES ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/icon/${PKGNAME}.png DESTINATION ${ICONDIR}) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/enc/conf.enc DESTINATION ${RESDIR}/.decarta) -INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/images DESTINATION ${RESDIR}) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/white_theme/images DESTINATION ${RESDIR}/) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/white_theme/sounds DESTINATION ${RESDIR}/) # install content shortcut uri file INSTALL(FILES ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/gallery.uri DESTINATION /opt/share/miregex ) @@ -130,10 +152,8 @@ INSTALL(DIRECTORY DESTINATION /opt/apps/${PKGNAME}/data) # Share APP mo files with Gallery UG SET(GALLERY_UG_PROJECT_NAME ug-gallery-efl) - # i18n ADD_SUBDIRECTORY(res/po) # UG -ADD_SUBDIRECTORY(libug/libug-gallery-efl) - +ADD_SUBDIRECTORY(ug/ug-gallery-efl) diff --git a/debian/changelog b/debian/changelog deleted file mode 100755 index 615ff15..0000000 --- a/debian/changelog +++ /dev/null @@ -1,6 +0,0 @@ -gallery (1.0.31) unstable; urgency=low - - * Git: pkgs/g/gallery - * Tag: gallery_1.0.31 - - -- Sangjin Han Thu, 27 Dec 2011 13:17:35 +0900 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/control b/debian/control deleted file mode 100755 index 94512fb..0000000 --- a/debian/control +++ /dev/null @@ -1,62 +0,0 @@ -Source: gallery -Section: misc -Priority: extra -Maintainer: Sangjin Han , Jiansong Jin , Jonghyuk Lee , Chaolong Lin , Yongjun Zhao , Tang Feng -Uploaders: Sangjin Han , Jiansong Jin , Changsun Lee -Build-Depends: debhelper (>= 5), - libappcore-efl-dev, - libelm-dev, - libedje-dev, - libevas-dev, - libmedia-service-dev, - libmedia-thumbnail-dev, - dlog-dev, - libui-gadget-dev, - libss-client-dev, - libail-0-dev, - libappsvc-dev, - capi-appfw-application-dev, - libdevman-haptic-dev, -Standards-Version: 0.4.0 - -Package: org.tizen.gallery -Section: misc -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, - libappcore-efl-0, - libelm, - libedje, - libevas, - libmedia-service, - libmedia-thumbnail, - libui-gadget-0, - libss-client-0, - libail-0, - libappsvc-0, - capi-appfw-application, -Description: gallery UX - -Package: org.tizen.gallery-dbg -Section: debug -Architecture: any -Depends: ${misc:Depends}, org.tizen.gallery (= ${Source-Version}) -Description: gallery application(unstripped) - -Package: libug-gallery-efl-0 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, - libappcore-efl-0, - libelm, - libedje, - libevas, - libmedia-service, - libui-gadget-0, -Description: gallery UG - -Package: libug-gallery-efl-dbg -Section: debug -Architecture: any -Depends: ${misc:Depends}, libug-gallery-efl-0 (= ${Source-Version}) -Description: Gallery UG (unstripped) - diff --git a/debian/libug-gallery-efl-0.install.in b/debian/libug-gallery-efl-0.install.in deleted file mode 100755 index 0b036b1..0000000 --- a/debian/libug-gallery-efl-0.install.in +++ /dev/null @@ -1,4 +0,0 @@ -/opt/ug/lib/libug-gallery-efl.so* -/opt/ug/res/edje/gallery-efl/* -/opt/ug/res/images/gallery-efl/* -/opt/ug/res/locale/*/*/ug-gallery*.mo diff --git a/debian/org.tizen.gallery.install.in b/debian/org.tizen.gallery.install.in deleted file mode 100755 index 8e0d4f1..0000000 --- a/debian/org.tizen.gallery.install.in +++ /dev/null @@ -1,14 +0,0 @@ -@PREFIX@/bin/* -@PREFIX@/res/locale/* -@PREFIX@/res/locale/*/*/gallery*.mo -@PREFIX@/res/icons/* -@PREFIX@/res/images/* -@PREFIX@/res/edje/* -@PREFIX@/data -/opt/share/applications/* - -# map -@PREFIX@/res/.decarta/* -# Add to home -/opt/share/miregex/* - diff --git a/debian/org.tizen.gallery.postinst.in b/debian/org.tizen.gallery.postinst.in deleted file mode 100755 index f3176ad..0000000 --- a/debian/org.tizen.gallery.postinst.in +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -if [ ${USER} == "root" ] -then - # 5000 is inhouse user id - # do not use relative path - chown -R 5000:5000 @DATADIR@ -fi diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 66e8a6d..0000000 --- a/debian/rules +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -CFLAGS += -Wall -g -LDFLAGS += -PREFIX += /opt/apps/org.tizen.gallery -RESDIR += /opt/apps/org.tizen.gallery/res -DATADIR += /opt/apps/org.tizen.gallery/data - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif - -LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed -Wl,--hash-style=both - -CMAKE_BUILD_DIR += $(CURDIR)/cmake_build_tmp - -configure: configure-stamp -configure-stamp: - dh_testdir - # Add here commands to configure the package. - mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \ - CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX="$(PREFIX)" - - touch configure-stamp - -build: build-stamp - -build-stamp: configure-stamp - dh_testdir - - # Add here commands to compile the package. - cd $(CMAKE_BUILD_DIR) && $(MAKE) - - for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ - cat $$f > $${f%.in}; \ - sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \ - sed -i -e "s#@RESDIR@#$(RESDIR)#g" $${f%.in}; \ - sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \ - done - - touch $@ - -clean: - dh_testdir - dh_testroot - rm -f build-stamp configure-stamp - - # Add here commands to clean up after the build process. - rm -rf $(CMAKE_BUILD_DIR) - - for f in `find $(CURDIR)/debian/ -name "*.in"`; do \ - rm -f $${f%.in}; \ - done - - dh_clean - -install: build - dh_testdir - dh_testroot -# dh_clean -k - dh_prep - dh_installdirs - - # Add here commands to install the package into debian/wavplayer. - cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot -# dh_installchangelogs -# dh_installdocs - dh_installexamples - dh_install --sourcedir=debian/tmp -# dh_installmenu -# dh_installdebconf -# dh_installlogrotate -# dh_installemacsen -# dh_installpam -# dh_installmime -# dh_python -# dh_installinit -# dh_installcron -# dh_installinfo - dh_installman - dh_link - dh_strip --dbg-package=org.tizen.gallery-dbg --dbg-package=libug-gallery-efl-dbg - dh_compress - dh_fixperms -# dh_perl - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/include/data/gl-data-type.h b/include/data/gl-data-type.h new file mode 100755 index 0000000..5452c47 --- /dev/null +++ b/include/data/gl-data-type.h @@ -0,0 +1,121 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 + +#ifdef _cplusplus +extern "C" +{ +#endif + + +#define FREE_DATA(ptr) \ + do { \ + if(ptr != NULL) \ + { \ + free(ptr); \ + ptr = NULL; \ + } \ + }while(0); + +#define GL_TYPE_ALBUM (0x55551) +#define GL_TYPE_MEDIA (0x55553) + +typedef enum { + GL_PHONE = 0, /**< Stored only in phone */ + GL_MMC, /**< Stored only in MMC */ + GL_SYSTEM, /**< Stored in ALL*/ +} _gl_store_type_t; + + +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; + +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*/ + 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*/ +}; + +int _gl_data_type_new_media(gl_media_s **item); +int _gl_data_type_new_album(gl_album_s **album); +int _gl_data_type_free_media_list(Eina_List **list); +int _gl_data_type_free_album_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..88af0e9 --- /dev/null +++ b/include/data/gl-data-util.h @@ -0,0 +1,53 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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); +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); + +#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..95c8774 --- /dev/null +++ b/include/data/gl-data.h @@ -0,0 +1,146 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 + +#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 +/** +* Get a new mtype item from libmedia-info, +* if ID is NULL, libmedia-info just allocate memory for mtype item, +* then return it, instead of loading record from DB to initialize each field. +*/ +#define GL_NEW_RECORD_ID NULL + +#define GL_JPEG_FILE_EXT "jpg" + +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; + time_t item_mtime; + 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; + void *ad; /* Save ad to prevent use global variable */ + void *_reserved; +} gl_item; + +bool _gl_data_get_cluster_list(void *data); +int _gl_data_update_cluster_list(void *data); +int _gl_data_cluster_list_remove(void *data, gl_cluster *item); +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, 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_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); +int _gl_data_clear_default_item_list(void *data); +int _gl_data_get_first_several_items(gl_cluster *album, gl_item *items[], int *item_count, media_content_order_e sort_type); +gl_item *_gl_data_new_item_mitem(gl_media_s *mitem); +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_item_list_remove(void *data, gl_item *gitem); +int _gl_data_append_item(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); +bool _gl_data_is_albums_selected_list_empty(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); +gl_item *_gl_data_new_gitem(void *data, const char *item_id); +bool _gl_data_is_root_path(void *data, const char *path); +bool _gl_data_is_default_album(const char *match_folder, gl_album_s *album); +int gl_db_free_cluster(gl_cluster *gcluster); +int _gl_data_get_item_by_fullpath(void *data, char *path, gl_media_s **mitem); +int _gl_data_delete_media(void *data, gl_media_s *media_item); + +#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..fb02d2d --- /dev/null +++ b/include/data/gl-local-data.h @@ -0,0 +1,73 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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_IMAGE "(MEDIA_TYPE=0)" +#define GL_CONDITION_VIDEO "(MEDIA_TYPE=1)" + +#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_id(char *media_id, gl_media_s **mitem); +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_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.h b/include/features/gl-albums.h index 4b384fd..cb39782 100755 --- a/include/features/gl-albums.h +++ b/include/features/gl-albums.h @@ -20,6 +20,7 @@ #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_sel_album(gl_cluster * album_item); @@ -27,8 +28,8 @@ 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_del_grid_append_idler(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-gridview.h b/include/features/gl-gridview.h index ed0be71..fa2e3c7 100755 --- a/include/features/gl-gridview.h +++ b/include/features/gl-gridview.h @@ -29,19 +29,21 @@ typedef enum _gl_grid_mode GL_GRID_ALBUMS, } gl_grid_mode; -Evas_Object *gl_grid_create_view(void *data, Evas_Object * parent, gl_grid_mode mode); +Evas_Object *gl_grid_create_layout(void *data, Evas_Object *parent); +Evas_Object *_gl_grid_create_view(void *data, Evas_Object *parent, + gl_grid_mode mode, bool b_use_idler); int gl_grid_change_to_edit(void *data); int gl_grid_change_to_view(void *data); Eina_Bool gl_grid_update_items(void *data); -int gl_grid_update_items_cnt(void *data, int new_cnt); -int gl_grid_set_item_size(void *data, Evas_Object * gridview); +int gl_grid_set_item_size(void *data, Evas_Object *gridview); bool gl_grid_get_view(void *data, Evas_Object **view); int gl_grid_set_nocontents(void *data, Evas_Object *noc); int gl_grid_clear_view(void *data); int gl_grid_idler_append_items(void *data); -void gl_grid_sel_cb(void *data, Evas_Object * obj, void *event_info); -void gl_grid_item_mouse_down(void *data, Evas * e, Evas_Object * obj, void *event_info); -void gl_grid_item_mouse_up(void *data, Evas * e, Evas_Object * obj, void *event_info); - +void gl_grid_sel_cb(void *data, Evas_Object *obj, void *event_info); +void gl_grid_item_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info); +void gl_grid_item_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); +int _gl_grid_update_item_size(void *data, Evas_Object *view); +int _gl_grid_del_append_idler(void *data); #endif /* _GL_GRIDVIEW_H_ */ diff --git a/include/gallery.h b/include/gallery.h index 4ff43f5..36ea6e1 100755 --- a/include/gallery.h +++ b/include/gallery.h @@ -14,134 +14,15 @@ * limitations under the License. */ -/* -* About launching gallery base on appsvc -* -* @ Sample code: -* @code -* #include -* -* static void cb_func(bundle *b, int request_code, -* appsvc_result_val result, void *data) -* { -* if (result == APPSVC_RES_OK) -* { -* const char *path = appsvc_get_data(b, "path"); -* DEBUG("return path of selected files: %s", path); -* } -* } -* -* ... -* { -* int ret = -1; -* bundle *b = NULL; -* -* b = bundle_create(); -* -* appsvc_set_operation(b, APPSVC_OPERATION_PICK); -* appsvc_set_mime(b, GL_MIME_IMAGE_ALL); -* ret = appsvc_run_service(b, 0, cb_func, NULL); -* } -* @endcode -* -* About services provided. -* -* 1. APPSVC_OPERATION_VIEW -* -* (1.1) album ID -* In this case, for the album with the specified id, the thumbnail -* view will be displayed -* -* @ Sample Code (view album ALL ) : -* -* appsvc_set_operation(b, APPSVC_OPERATION_VIEW); -* appsvc_add_data(b, "album-id", "-1"); -* appsvc_run_service(b, 0, cb_func, NULL); -* -* 2. APPSVC_OPERATION_PICK -* -* (2.1) file selection -* In this case, after image(s) tapped, it will be added to list and -* return path(s) strings to caller if done button tapped. -* -* You can decide to select one file or multiple files by : -* appsvc_add_data( b, "launch-type", "select-one"); -* appsvc_add_data( b, "launch-type", "select-multiple"); -* Note that, default "launch-type" is "select-one" even it is not set. -* -* You can decide the file types by -* image only: appsvc_set_mime(b, GL_MIME_IMAGE_ALL); -* video only: appsvc_set_mime(b, GL_MIME_VIDEO_ALL); -* Note that, file-type is optional, the default type is all -* (image and video) even it is not set. -* -* @ Sample Code (slect one image) : -* -* appsvc_set_operation(b, APPSVC_OPERATION_PICK); -* appsvc_set_mime(b, GL_MIME_IMAGE_ALL); -* appsvc_run_service(b, 0, cb_func, NULL); -* -* (2.2) album selection -* In this case, after album tapped, it will return album's id to caller. -* appsvc_add_data(b, "launch-type", "select-album"); -* -* @ Sample code (select one album) : -* -* appsvc_set_operation(b, APPSVC_OPERATION_PICK); -* appsvc_add_data(b, "launch-type", "select-album"); -* appsvc_run_service(b, 0, cb_func, NULL);* -* -* (2.3) image setas -* It's added for wallpaper setting and contact caller ID setting, only -* support image file type. If caller pass "select-setas", after image -* tapped, image viewer would be invoke, then user can apply setting -* in image viewer. -* appsvc_add_data(b, "launch-type", "select-setas"); -* -* 2.3.1)"setas-type" -* And for set-as case, bundle parameter "setas-type" is used to specify -* different kind of setting, there are two set-as types: -* a)"wallpaper" -* This is for wallpaper setting. -* b)"callerid" -* This is for contact caller ID setting. -* And there are another two bundle parameters for callerid, -* both of them are optional , that is: -* b1)"callerid-size" -* It's added to set the size of caller ID, f.e. -* If you want to set the size as 200x200, -* you can set bundler parameter like : -* appsvc_add_data( b, "callerid-size", "200" ); -* b2)"callerid-path" -* It's added to specify the saved path of call -* ID, and note that this is a full path, f.e.. -* You can pass path string like : -* appsvc_add_data( b, "callerid-path", -* "/opt/media/test_folder/test_caller_id_1.jpg"); -* -* @ Sample code ( set caller id ) : -* -* appsvc_set_operation(b, APPSVC_OPERATION_PICK); -* appsvc_set_mime(b, GL_MIME_IMAGE_ALL); -* appsvc_add_data(b, "launch-type", "select-setas"); -* appsvc_add_data(b, "setas-type", "callerid"); -* appsvc_add_data(b, "callerid-size", "200"); -* appsvc_add_data(b, "callerid-path", "/opt/media/test/test1.jpg"); -* appsvc_run_service(b, 0, cb_func, NULL);* -* -*/ - #ifndef _GALLERY_H_ #define _GALLERY_H_ #include #include #include -#include -#include "gl-db-handler.h" -#include - - +#include +#include +#include "gl-data.h" #ifdef _cplusplus extern "C" @@ -173,56 +54,73 @@ extern "C" /******** EDJ File path ********/ #define GL_EDJ_FILE EDJDIR "/" PACKAGE ".edj" -#define GL_BLACK_THEME_EDJ_FILE EDJDIR "/gl-black-theme.edj" - /******** Groups name ********/ #define GL_GRP_VIEW_LAYOUT "gallery/view_layout" #define GL_GRP_SEGMENT "gallery/segment_layout" +#define GL_GRP_GRIDVIEW "gallery/gridview" #define GL_GRP_ENTRY "gallery/entry" #define GL_GRP_PHOTOFRAME "photoframe" /******* Part name ***********/ -#define GE_NAVIFRAME_PREB_BTN "prev_btn" //ELM_NAVIFRAME_ITEM_PREV_BTN -#define GE_NAVIFRAME_TITLE_RIGHT_BTN "title_right_btn" //ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN -#define GE_NAVIFRAME_TITLE_LEFT_BTN "title_left_btn" //ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN -#define GE_NAVIFRAME_CONTROLBAR "controlbar" //ELM_NAVIFRAME_ITEM_CONTROLBAR +#define GL_NAVIFRAME_PREB_BTN "prev_btn" +#define GL_NAVIFRAME_TITLE_RIGHT_BTN "title_right_btn" +#define GL_NAVIFRAME_TITLE_LEFT_BTN "title_left_btn" +#define GL_NAVIFRAME_CONTROLBAR "controlbar" +#ifdef _USE_ROTATE_BG +#define GL_NAVIFRAME_TITLE_MORE_BTN "title_more_btn" +#define GL_NAVIFRAME_OPTIONHEAD "optionheader" +#endif +#define GL_POPUP_TEXT "title,text" +#define GL_NOCONTENTS_TEXT "elm.text" +#define GL_GRID_TEXT "elm.text" +#define GL_NAAVIFRAME_TEXT "elm.text.title" /******** Style name ********/ -#define GL_NOCONTENTS_STYLE "gallery/full" #define GL_CLASS_GENGRID "gengrid" -#define GL_BUTTON_STYLE_RENAME "gallery/rename" -#define GL_BUTTON_STYLE_NAVI_TITLE "naviframe/title/gallery" -#define GL_BUTTON_STYLE_SWEEP "sweep/gallery" +#define GL_BUTTON_STYLE_RENAME "rename" + +#define GL_BUTTON_STYLE_NAVI_MORE "naviframe/more/default" +#define GL_BUTTON_STYLE_NAVI_SLIDESHOW "naviframe/slideshow/gallery" +#define GL_BUTTON_STYLE_NAVI_DONE "naviframe/done/gallery" +#define GL_BUTTON_STYLE_NAVI_CANCEL "naviframe/cancel/gallery" +#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/gallery" +#define GL_BUTTON_STYLE_NAVI_PRE "naviframe/back_btn/default" +#ifdef _USE_ROTATE_BG +#define GL_BUTTON_STYLE_NAVI_CTRL "naviframe_control" +#endif + #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_STYLE_DEFAULT "gallery/default" #define GL_CONTROLBAR_STYLE_NAVI "naviframe" +#define GL_GENLIST_ITEM_STYLE_SWEEP3 "mode/gallery/slide3" + /******** Image path ********/ -#define GL_CAPTURE_IMG_PATH "org.tizen."PACKAGE -#define GL_APP_DEFAULT_ICON_DIR APPDIR"/res/icons/default/small" -#define GL_DEFAULT_ICON GL_APP_DEFAULT_ICON_DIR"/org.tizen.gallery.png" #define GL_DEFAULT_THUMB_ICON IMAGEDIR"T01_Nocontents_broken.png" +#define GL_DB_DEFAULT_THUMB "/opt/data/file-manager-service/.thumb/thumb_default.png" +#define GL_LOCK_ICON IMAGEDIR"T01_icon_lock.png" + #define Gl_VIDEO_PLAY_ICON IMAGEDIR"T01_btn_thumbnail_play.png" #define GL_THUMB_BOOKMARK IMAGEDIR"T01_icon_thumbnail_bookmark.png" #define GL_LIST_BOOKMARK IMAGEDIR"T01_list_icon_bookmark.png" #define GL_CBAR_ICON_EDIT IMAGEDIR"T01_controlbar_icon_edit.png" #define GL_CBAR_ICON_CANCEL IMAGEDIR"T01_controlbar_icon_cancel.png" +#define GL_CBAR_ICON_DONE IMAGEDIR"T01_controlbar_icon_done.png" #define GL_CBAR_ICON_DELETE IMAGEDIR"T01_controlbar_icon_delete.png" +#define GL_CBAR_ICON_SHARE IMAGEDIR"T01_controlbar_icon_share02.png" #define GL_CBAR_ICON_MOVE IMAGEDIR"T01_controlbar_icon_move.png" +#define GL_CBAR_ICON_CAMERA IMAGEDIR"T01_controlbar_icon_camera.png" /******** String ********/ -#define GL_SEPERATOR_BT '?' - /* MIME type */ #define GL_MIME_IMAGE_ALL "image/*" #define GL_MIME_VIDEO_ALL "video/*" @@ -230,8 +128,8 @@ extern "C" /******** Numerical value ********/ /* Window width and height */ -#define GL_WIN_WIDTH 720 // 480 -#define GL_WIN_HEIGHT 1280 // 800 +#define GL_WIN_WIDTH 720 +#define GL_WIN_HEIGHT 1280 /* Specified ID for customed items, which don't exist in DB */ #define GL_ALBUM_ALL_ID "GALLERY_ALBUM_ALL_ALBUMS_ID" @@ -241,11 +139,12 @@ extern "C" #define GL_ALBUM_COVER_THUMB_NUM_SEC 4 /* Size of thumbnails in gridview */ -#define GL_GRID_ITEM_SIZE_W 178//120 +#define GL_GRID_ITEM_SIZE_W 178 #define GL_GRID_ITEM_SIZE_H 182 /* Thumbnail would be enlarged if medias count is less than 7 */ #define GL_GRID_ITEM_ZOOM_LEVEL_01 4 #define GL_GRID_ITEM_ZOOM_LEVEL_02 2 +#define GL_GRID_ITEM_ZOOM_LEVEL_03 (1.35) #define GL_GRID_ITEM_ZOOM_LEVEL_01_CNT 1 #define GL_GRID_ITEM_ZOOM_LEVEL_02_CNT 6 @@ -277,10 +176,10 @@ extern "C" /* 1h=(60x60)s */ #define GL_TIME_SEC_PER_HOUR (GL_TIME_MIN_PER_HOUR * GL_TIME_SEC_PER_MIN) -/* itoa length max */ -#define GL_INTERGER_LEN_MAX 12 // 1(sign) + 10(2^31) + 1(NULL) +/* itoa length max -- 1(sign) + 10(2^31) + 1(NULL) */ +#define GL_INTERGER_LEN_MAX 12 -/* File system related String definition */ +/* File system related String definition */ #define GL_ROOT_PATH_PHONE "/opt/media" #define GL_ROOT_PATH_MMC "/opt/storage/sdcard" #define GL_DEFAULT_PATH_IMAGES "/Images and videos" @@ -295,12 +194,14 @@ typedef enum _gl_aul_launch_type GL_AUL_T_SELECT_IMFT, GL_AUL_T_SELECT_SETAS, GL_AUL_T_SELECT_ALBUM, + /* Launching from live-magazine, show 'All 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; @@ -332,16 +233,11 @@ typedef enum _gl_ctrl_seg_mode GL_CTRL_SEG_CNT } gl_ctrl_seg_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_mode; @@ -350,11 +246,17 @@ typedef enum _gl_entry_mode typedef struct { Elm_Genlist_Item_Class videolic; /* Genlist item class of list view */ - Evas_Object *video_view; - Evas_Object *video_nocontents; - int videos_cnt; /* Media items count append to listview */ + /* Genlist item class of video list view for sweep */ + Elm_Genlist_Item_Class sweeplic; + Evas_Object *videos_view; + Evas_Object *videos_nocontents; + int videos_cnt; /* Media items count append to listview */ + /* Sweep item */ + char *sweep_file_path; /* UUID of item selected for playing */ char *played_uuid; + Evas_Object *share_btn; + Evas_Object *del_btn; } gl_list_info; typedef struct @@ -366,103 +268,113 @@ typedef struct typedef struct { - Elm_Gengrid_Item_Class thumbgic; /* Gengrid item class of thumbnails view */ + Elm_Gengrid_Item_Class thumbgic; /* Gengrid item class of thumbnails view */ Evas_Object *edit_view; Evas_Object *edit_layout; Evas_Object *layout; Evas_Object *all_view; Evas_Object *all_nocontents; - Evas_Object *image_view; - Evas_Object *image_nocontents; - + Evas_Object *images_view; + Evas_Object *images_nocontents; /* edit item */ Elm_Object_Item *edit_it; - /* Naviframe item pushed to stack */ Elm_Object_Item *nf_it; Elm_Object_Item *nf_it_edit; - gl_grid_touch_info touch_info; /* Added for shrink effect while select thumbnail */ + Elm_Object_Item *nf_it_select; + Evas_Object *segment; + 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 *append_idler; /* Use idler to append other medias to gridview */ - /* if album contains more than (GL_FIRST_VIEW_END_POS+1) medias */ - int grid_view_mode; /* Types: gl_grid_mode; */ - /* 1. Indicate grid view mode of thumbnails view */ - /* 2. Set types for creating nocontents view */ - 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 */ + 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 */ + int grid_view_mode; /* Types: gl_grid_mode; */ + /* 1. Indicate grid view mode of thumbnails view */ + /* 2. Set types for creating nocontents view */ + 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 */ + +#ifdef _USE_ROTATE_BG + Evas_Object *more_btn; + Evas_Object *left_btn; + Evas_Object *right_btn; +#endif } gl_grid_info; typedef struct { - bool app_called_by_me; /* Indicates if any application invoked by Gallery */ - struct ui_gadget *ug_called_by_me; + bool app_called_by_me; /* Indicates if any application invoked by Gallery */ + ui_gadget_h ug_called_by_me; + int ug_type; void *ug_login_data; - int sort_type; /* Types: minfo_media_sort_type; pass it to imageviewer */ - struct ui_gadget *gallery_ug_called_by_me; /* The gallery-ug called by Gallery for appsvc */ + 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 appsvc */ } gl_ug_info; - typedef struct { Elm_Gengrid_Item_Class albumgic; /* Gengrid item class of albums view */ Elm_Gengrid_Item_Class albumgic_blue; /* Gengrid item class of albums view */ Evas_Object *layout; /* Albums view layout object */ - Evas_Object *view; /* Albums view object */ - Evas_Object *edit_layout; /* Albums view layout object */ - Evas_Object *edit_view; /* Albums view object */ - Evas_Object *nocontents; /* Nocontents object */ + Evas_Object *view; /* Albums view object */ + Evas_Object *edit_layout; /* Albums view layout object */ + Evas_Object *edit_view; /* Albums view object */ + + Evas_Object *nocontents; /* Nocontents object */ /* Naviframe item pushed to stack */ Elm_Object_Item *nf_it; Elm_Object_Item *nf_it_edit; /* edit item */ Elm_Object_Item *edit_it; - /* State of active segment: all, image or video */ - int seg_mode; - - gl_item *cover_thumbs[GL_ALBUM_COVER_THUMB_NUM]; /* Media items of album cover */ + /* camera item */ + Elm_Object_Item *camera_it; + 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 *move_album_id; + 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; */ + 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 */ - bundle *recv_bundle; /* The bundle received when app_reset */ + 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; - char *aul_album_id; - int aul_contact_id; + 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; } gl_album_info; typedef struct { Evas_Object *editfield; - Evas_Object *imf_ly; Evas_Object *imf_entry; Ecore_IMF_Context *imf_context; - int entry_mode; /* Type: gl_entry_mode; Indicate usage of entry */ + int entry_mode; /* Type: gl_entry_mode; Indicate usage of entry */ /* Button 'Done' in new album view */ Evas_Object *done_btn; + Evas_Object *cancel_btn; + Elm_Object_Item *nf_it; /* Handle for play vibration */ int haptic_handle; /* Timer for closing vibration */ @@ -471,7 +383,7 @@ typedef struct typedef struct { - Elm_Genlist_Item_Class popuplit; /* Genlist item class of list view in popupinfo.popup */ + Elm_Genlist_Item_Class popuplit;/* Genlist item class of list view in popupinfo.popup */ Evas_Object *popup; int popup_mode; char popup_item_label[GL_ALBUM_NAME_LEN_MAX];/* Selected item label of list in popupinfo.popup */ @@ -482,15 +394,18 @@ typedef struct } gl_popup_info; typedef struct { - Eina_List *medias_elist; /* List of all selected medias of a album */ + Eina_List *medias_elist;/* List of all selected medias of a album */ 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; } gl_selected_info; typedef struct { Evas_Object *pbar_popup; Evas_Object *pbar; Evas_Object *status_label; - Ecore_Timer *pbar_timer; /** * After progressbar showed completely, use timer to * emit next signal to write pipe to continue to operate medias. @@ -501,12 +416,12 @@ typedef struct { * 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 */ + 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; @@ -515,39 +430,38 @@ typedef struct { Evas_Object *win; double win_scale; - Evas_Object *ly_main; - Evas_Object *navi_bar; + Evas_Object *main_layout; + Evas_Object *naviframe; Evas_Object *bg; - int view_mode; /* Type: gl_view_mode; Indicate view mode of whole application */ - Ecore_Timer *ums_update_timer; /* Timer handler for update albums view if usb was disconnected in UMS mode */ - int app_exit_mode; + 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; - - MediaSvcHandle *db_handle; /* media svc handle */ - Eina_List *medias_elist; /* List of all medias of a album */ - int medias_cnt; /* Count of all medias of a album */ - int medias_op_type; /* Type: Move or Delete medias */ - int mmc_state; /* MMC state(Inserted, Removed) */ + int all_medias_cnt; + time_t last_mtime; + Eina_List *medias_elist;/* List of all medias of a album */ + int medias_cnt; /* Count of all medias of a album */ + int medias_op_type; /* Type: Move or Delete medias */ + int mmc_state; /* MMC state(Inserted, Removed) */ + int seg_mode; /* State of active segment: all, image or video */ Ecore_Job *rename_album_job; } gl_main_info; - struct _gl_appdata { - gl_main_info maininfo; /* Global variables about global info */ - gl_album_info albuminfo; /* Global variables about albums view */ - gl_grid_info gridinfo; /* Global variables about thumbnails view */ - gl_list_info listinfo; /* Global variables about videos list 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_main_info maininfo; /* Global variables about webalbum */ + gl_album_info albuminfo; /* Global variables about albums view */ + gl_grid_info gridinfo; /* Global variables about thumbnails view */ + gl_list_info listinfo; /* Global variables about videos list 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, const char *cluster_id); +int gallery_reset_app(void *data); #ifdef _cplusplus } diff --git a/include/util/gl-db-handler.h b/include/util/gl-db-handler.h deleted file mode 100755 index f90412d..0000000 --- a/include/util/gl-db-handler.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_DB_HANDLER_H_ -#define _GL_DB_HANDLER_H_ - -#include -#include -#include - -#ifdef _cplusplus -extern "C" -{ -#endif - -#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 /*maybe 2 pages(=48 medias) is better, especially select album then drag up immediately */ -#define GL_GET_UNTIL_LAST_RECORD 65536 /* Fixme: Do not use 65536. */ -#define GL_GET_ALL_RECORDS -1 -#define GL_GET_ONE_RECORDS 1 -#define GL_GET_ALL_RECORDS_ID NULL -/** -* Get a new mtype item from libmedia-info, -* if ID is NULL, libmedia-info just allocate memory for mtype item, -* then return it, instead of loading record from DB to initialize each field. -*/ -#define GL_NEW_RECORD_ID NULL - -enum -{ - GL_DB_SUCCESS, - GL_DB_FAIL, -}; - -enum -{ - GL_RENAME_ALBUM_SUCCESS, - GL_RENAME_ALBUM_INVALIDATE_NAME, - GL_RENAME_ALBUM_DUPLICATED_NAME, - GL_RENAME_ALBUM_FAIL -}; - -enum -{ - GL_DELETE_ALBUM_SUCCESS, - GL_DELETE_ALBUM_FAIL -}; - -typedef struct -{ - Mcluster *cluster; - int index; - time_t item_mtime; - Elm_Object_Item *item; - bool checked; - - void *ad; /* Save ad to prevent use global variable */ - void *_reserved; -} gl_cluster; - -typedef struct -{ - Eina_List *clist; - int cur_pos; - int edit_cnt; -} gl_cluster_list; - -typedef struct _gl_item -{ - Mitem *item; - Elm_Object_Item *elm_item; - Evas_Object *check_obj; - bool checked; - int sequence; - - void *ad; /* Save ad to prevent use global variable */ - void *_reserved; -} gl_item; - -bool gl_db_get_cluster_list(void *data); -int gl_db_update_cluster_list(void *data); -int gl_db_cluster_list_remove(void *data, gl_cluster * item); -int gl_db_add_cluster(void *data, char *cluster_url); -bool gl_db_exists_item(void *data, const char *id); -int gl_db_get_cluster_by_id(void *data, const char *cluster_id, gl_cluster **cluster, int *pos); -int gl_db_get_item_cnt(void *data, const char *cluster_id, int *item_cnt); -int gl_db_update_item_cnt(gl_cluster * album); -int gl_db_update_item_list(void *data); -int gl_db_get_item_list(void *data, - gl_cluster * album, - int start_pos, - int end_pos); -bool gl_db_is_item_cnt_zero(void *data, minfo_file_type type); -int gl_db_clear_item_list(void *data); -int gl_db_get_first_several_items(gl_cluster * album, - gl_item * items[], - int *item_count, - minfo_media_sort_type sort_type); -gl_item *gl_db_new_item_mitem(Mitem * mitem); -int gl_db_destroy_item(gl_item * gitem); -int gl_db_get_item_by_index(void *data, int idx, bool select_mode, gl_item ** gitem); -int gl_db_item_list_remove(void *data, gl_item * gitem); -int gl_db_append_item(void *data, gl_item * gitem); -int gl_db_remove_item(gl_item * gitem); -int gl_db_selected_list_append(void *data, gl_item * gitem); -int gl_db_selected_list_remove(void *data, gl_item * gitem); -gl_item *gl_db_selected_list_get_nth(void *data, int idx); -int gl_db_selected_list_finalize(void *data); -int gl_db_selected_list_count(void *data); -int gl_db_get_albums_selected_cnt(void *data); -bool gl_db_is_albums_selected_list_empty(void *data); -int gl_db_albums_selected_list_append(void *data, gl_cluster * item); -int gl_db_albums_selected_list_remove(void *data, gl_cluster * item); -int gl_db_finalize_albums_selected_list(void *data); -int gl_db_init(void *data); -int gl_db_finalize(void *data); -gl_cluster *gl_db_new_cluster(void); -Mitem *gl_db_new_mitem(void *data, const char *item_id); -Mcluster *gl_db_new_mcluster(void *data, const char *cluster_id); -int gl_db_get_folder_fullpath(void *data, const char *cluster_id, char *path); -bool gl_db_is_root_path(void *data, const char *cluster_id, const char *path); -bool gl_db_is_default_album(void *data, Mcluster *mcluster); -int gl_db_free_cluster(gl_cluster * gcluster); - -#ifdef _cplusplus -} -#endif -#endif /* _GL_DB_HANDLER_H_ */ diff --git a/include/util/gl-debug.h b/include/util/gl-debug.h index 76336f4..6bcc9fa 100755 --- a/include/util/gl-debug.h +++ b/include/util/gl-debug.h @@ -32,7 +32,7 @@ extern "C" #define LOG_TAG "GALLERY" - +#define LOG_TAG_LAUNCH "GALLERY_LAUNCH" /* anci c color type */ #define FONT_COLOR_RESET "\033[0m" @@ -58,6 +58,30 @@ FILE *g_log_fp; #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) @@ -71,9 +95,15 @@ FILE *g_log_fp; #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); diff --git a/include/util/gl-drm.h b/include/util/gl-drm.h new file mode 100755 index 0000000..e3be690 --- /dev/null +++ b/include/util/gl-drm.h @@ -0,0 +1,30 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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..4e2f450 --- /dev/null +++ b/include/util/gl-exif.h @@ -0,0 +1,58 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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, +}; + +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 index b9b5b9b..dc39645 100755 --- a/include/util/gl-ext-exec.h +++ b/include/util/gl-ext-exec.h @@ -30,5 +30,6 @@ typedef enum } 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 index df71afd..e3971dd 100755 --- a/include/util/gl-ext-ug-load.h +++ b/include/util/gl-ext-ug-load.h @@ -18,7 +18,7 @@ #define _GL_EXT_UG_LOAD_H_ #include -#include "gl-db-handler.h" +#include "gl-data.h" typedef enum { @@ -26,7 +26,30 @@ typedef enum GL_UG_SUCCESS } gl_ug_load_status; -int gl_ext_load_iv_ug(void *data, gl_item *cur_item); +typedef enum +{ + GL_UG_MSG, + GL_UG_EMAIL, + GL_UG_BT, +#ifdef _USE_WIFI + GL_UG_WIFI, +#endif + GL_UG_IMAGEVIEWER, + GL_UG_CNT, +} gl_ext_ug_type; + +typedef enum +{ + GL_UG_IV, + /* Same as GL_UG_IV, invoke imageviewer to slideshow */ + GL_UG_IV_SLIDESHOW, + /*Invoke imageviewer to slideshow on local album*/ + GL_UG_IV_SLIDESHOW_LOCAL, + 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 *cur_item, gl_ext_iv_type type); int gl_ext_load_gallery_ug(void *data); int gl_ext_destroy_gallery_ug(void *data); diff --git a/include/features/gl-controlbar.h b/include/util/gl-lang.h similarity index 67% rename from include/features/gl-controlbar.h rename to include/util/gl-lang.h index c2fb8ca..f358b18 100755 --- a/include/features/gl-controlbar.h +++ b/include/util/gl-lang.h @@ -1,27 +1,35 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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" - -Evas_Object *_gl_ctrl_get_toolbar(Elm_Object_Item *nf_it); -Evas_Object *_gl_ctrl_create_segment(void *data, Evas_Object *parent); -Evas_Object *_gl_ctrl_create_toolbar(void *data, Evas_Object *parent); - -#endif /* _GL_CONTROLBAR_H_ */ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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); + +#ifdef _cplusplus +} +#endif + + +#endif + diff --git a/include/util/gl-strings.h b/include/util/gl-strings.h index 2bf9ec1..3c98d54 100755 --- a/include/util/gl-strings.h +++ b/include/util/gl-strings.h @@ -25,37 +25,52 @@ extern "C" /* 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 shots") -#define GL_STR_NEW_ALBUM _("IDS_MEDIABR_TAB4_NEW_ALBUM") +#define GL_ALBUM_DEFAULT_NAME _("Camera") + #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_UNABLE_tO_RENAME _("IDS_MEDIABR_POP_UNABLE_TO_RENAME") #define GL_STR_NO_ALBUMS_SELECTED _("IDS_MEDIABR_POP_NO_ALBUMS_SELECTED") #define GL_STR_SELECT_ALBUM _("IDS_MEDIABR_HEADER_SELECT_ALBUM") #define GL_STR_SELECT_ITEM _("IDS_MEDIABR_HEADER_SELECT_ITEM") #define GL_STR_NO_ALBUMS _("IDS_MEDIABR_BODY_NO_ALBUMS") -#define GL_STR_UNABLE_USE_IN_UMS_MODE _("IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE") + #define GL_STR_EMPTY _("") #define GL_ALBUM_PHOME_ROOT_NAME _("IDS_MEDIABR_POP_NO_NAME") + +#ifdef _USE_ROTATE_BG +#define GL_STR_MORE dgettext("sys_string", "IDS_COM_BODY_MORE") +#define GL_STR_ROTATE_LEFT _("Rotate left") +#define GL_STR_ROTATE_RIGHT _("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_ALBUM _("IDS_MEDIABR_OPT_CREATE_ALBUM") /* system strings which are included in sys-string-0 po files */ #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_BACK dgettext("sys_string", "IDS_COM_SK_BACK") +#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_ALBUMS dgettext("sys_string", "IDS_COM_BODY_ALBUMS") +#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") +#ifdef _USE_WIFI +#define GL_SHARE_WIFI dgettext("sys_string", "IDS_COM_BODY_WI_FI") +#endif #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_BUT_NAME_EDIT dgettext("sys_string", "IDS_COM_BODY_EDIT") -#define GL_BUT_NAME_REMOVE dgettext("sys_string", "IDS_COM_SK_REMOVE") #define GL_CTRL_SEG_ITEM_ALL dgettext("sys_string", "IDS_COM_BODY_ALL") #define GL_CTRL_SEG_ITEM_IMAGES dgettext("sys_string", "IDS_COM_BODY_IMAGES") #define GL_CTRL_SEG_ITEM_VIDEOS dgettext("sys_string", "IDS_COM_BODY_VIDEOS") @@ -66,11 +81,9 @@ extern "C" #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_BUT_NAME_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") diff --git a/include/util/gl-ui-util.h b/include/util/gl-ui-util.h index 1bf81fd..68155d6 100755 --- a/include/util/gl-ui-util.h +++ b/include/util/gl-ui-util.h @@ -17,8 +17,6 @@ #ifndef _GL_UI_UTIL_H_ #define _GL_UI_UTIL_H_ -#include -#include #include "gallery.h" #ifdef _cplusplus @@ -43,45 +41,54 @@ typedef enum typedef enum { - GL_UI_NOTIFY_DELETED, - GL_UI_NOTIFY_REMOVED, - GL_UI_NOTIFY_ADDED, - GL_UI_NOTIFY_MOVED, -} gl_ui_notify_mode; + GL_POPUP_SHARE_MESSAGE, + GL_POPUP_SHARE_EMAIL, + GL_POPUP_SHARE_BT, +#ifdef _USE_WIFI + GL_POPUP_SHARE_WIFI, +#endif + GL_POPUP_SHARE_NUM, +} gl_popup_share_item; + +#ifdef _USE_ROTATE_BG +typedef enum _gl_ui_more_state_t gl_ui_more_state_e; + +enum _gl_ui_more_state_t { + GL_UI_MORE_STATE_OPEN, + GL_UI_MORE_STATE_CLOSE, +}; +#endif -Evas_Object *gl_ui_create_naviframe(Evas_Object * parent); +typedef struct _ctx_share_table +{ + gl_popup_share_item item; + const char *label; +} gl_popup_share_tbl; + +Evas_Object *gl_ui_create_navi_ly(Evas_Object * parent); +Evas_Object *_gl_ui_create_view_ly(Evas_Object *parent); Evas_Object *gl_ui_create_main_ly(Evas_Object * parent); -Evas_Object *gl_ui_create_view_ly(Evas_Object *parent); int gl_ui_create_title_and_push(void *data, Evas_Object *parent, Evas_Object *obj, gl_navi_mode mode, char *title); -int gl_ui_remake_titlebar(void *data, Evas_Object * parent, Evas_Object * obj, gl_navi_mode mode); Evas_Object *gl_ui_load_edj(Evas_Object * parent, const char *file, const char *group); -Evas_Object *gl_ui_create_nocontents_full(void *data); -int gl_ui_create_selinfo(void *data, Evas_Object *parent, Elm_Object_Item *nf_it, - int all_cnt, int selected_cnt, bool b_update); -int gl_ui_destroy_selinfo(void *data); +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_destroy_imf(void *data); int gl_ui_rename_album(gl_cluster * album_item); -int gl_ui_set_album_lock(void *data, gl_cluster * sel_album); -int gl_ui_reset_toolbar_item(void *data, gl_ctrl_seg_mode seg_mode, bool force); -int gl_ui_back_to_normal(void *data); +int _gl_ui_pop_to_thumb(void *data); int gl_ui_move_to_newalbum(void *data); +int _gl_ui_disable_slideshow_btn(void *data, bool b_disable); +#ifdef _USE_ROTATE_BG +int _gl_ui_open_optionheader(void *data, int open); +int _gl_ui_disable_more_btn(void *data, bool b_disable); +#endif +Elm_Object_Item *_gl_ui_append_edit(void *data, Evas_Object *bot_bar); +int _gl_ui_hide_back_button(Elm_Object_Item *nf_it); int gl_ui_edit_cancel(void *data); -int gl_ui_disable_toolbar_item(void *data, bool disabled, gl_navi_mode mode, - bool edit); int gl_ui_cancel_rename_album(void *data); int gl_ui_cancel_new_album(void *data); -bool gl_ui_display_nocontents(void *data); -int gl_ui_disable_cbar_item(Elm_Object_Item *it); -int gl_ui_enable_cbar_item(Elm_Object_Item *it); -int gl_ui_disable_toolbar_items(void *data, Elm_Object_Item *nf_it); -int gl_ui_create_notiinfo(void *data, Evas_Object *parent, - gl_ui_notify_mode n_mode); -int gl_ui_destroy_notiinfo(void *data); -int gl_ui_disable_add_account_btn(void *data, bool b_disable); -int _gl_ui_elm_bg_file_set(Evas_Object *bg, gl_item *git); +int _gl_ui_newalbum_done(void *data, bool b_enter); +int _gl_ui_rename_album_done(void *data, bool b_enter); #ifdef _cplusplus } diff --git a/include/util/gl-util.h b/include/util/gl-util.h index 42277c1..66ac07b 100755 --- a/include/util/gl-util.h +++ b/include/util/gl-util.h @@ -17,9 +17,19 @@ #ifndef _GL_UTIL_H_ #define _GL_UTIL_H_ -#include "gl-db-handler.h" +#include "gl-data.h" #include "gallery.h" +#define GL_FILE_EXISTS(path) \ + ((1 == ecore_file_exists(path)) && (ecore_file_size(path) > 0)) + +#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;} +#define GL_IF_FREE_MEM(mem) if(mem){free(mem); mem = NULL;} +#define GL_FREE_MEM(mem) if(mem){free(mem); mem = NULL;} + + typedef enum { GL_MMC_STATE_NONE, @@ -43,6 +53,10 @@ typedef enum GL_MEDIA_OP_NONE, GL_MEDIA_OP_MOVE, GL_MEDIA_OP_DELETE, +#ifdef _USE_ROTATE_BG + GL_MEDIA_OP_ROTATING_LEFT, + GL_MEDIA_OP_ROTATING_RIGHT, +#endif } gl_media_op_mode; typedef enum @@ -55,6 +69,19 @@ typedef enum 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_RENAME_ALBUM, GL_INVALID_NEW_ENTRY, @@ -70,14 +97,15 @@ 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_del_video(void *data); int gl_update_del_view(void *data); +int _gl_share_select_album(void *data); +int gl_share_select_item(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); -int gl_reg_mass_storage_noti(void *data); -int gl_dereg_mass_storage_noti(void); void gl_set_mmc_notifd(int fd); Eina_Bool gl_update_view(void *data, int mode); int gl_get_default_images_path(char *directory_path); @@ -87,15 +115,23 @@ 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); -int gl_get_mass_storage_state(void *data); +#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 bool gl_validate_album_name(const char *new_name); 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_share_mode(void *data); int gl_del_invalid_widgets(void *data, int invalid_m); +int _gl_destroy_albums_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_thumb(void *data, const char *file_path, char **thumb_path); + +char *_gl_get_duration_string(unsigned int v_dur); +int _gl_get_thumb(void *data, const char *file_path, char **thumb_path); #endif /* _GL_UTIL_H_ */ diff --git a/include/features/gl-button.h b/include/widget/gl-button.h similarity index 92% rename from include/features/gl-button.h rename to include/widget/gl-button.h index bc96a50..75301e3 100755 --- a/include/features/gl-button.h +++ b/include/widget/gl-button.h @@ -25,7 +25,12 @@ typedef enum _gl_but_mode { GL_BUT_DONE, GL_BUT_CANCEL, GL_BUT_DEL, - GL_BUT_RENAME, + GL_BUT_SHARE, +#ifdef _USE_ROTATE_BG + GL_BUT_MORE, + GL_BUT_ROTATE_LEFT, + GL_BUT_ROTATE_RIGHT, +#endif } gl_but_mode; typedef void (*But_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */ @@ -34,3 +39,4 @@ Evas_Object *_gl_but_create_but(Evas_Object *parent, gl_but_mode mode, const cha 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..3ab8e2f --- /dev/null +++ b/include/widget/gl-controlbar.h @@ -0,0 +1,38 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +Evas_Object *_gl_ctrl_get_toolbar(Elm_Object_Item *nf_it); +Evas_Object *_gl_ctrl_create_segment(void *data, Evas_Object *parent); +Evas_Object *_gl_ctrl_create_toolbar(Evas_Object *parent); +int _gl_ctrl_disable_toolbar_item(void *data, bool disabled, int mode, + bool edit); +int _gl_ctrl_disable_item(Elm_Object_Item *it); +int _gl_ctrl_enable_item(Elm_Object_Item *it); +int _gl_ctrl_disable_toolbar_items(void *data, Elm_Object_Item *nf_it, + bool b_disable, bool b_edit); +int _gl_ctrl_disable_share_item(gl_appdata *ad, Elm_Object_Item *nf_it); +int _gl_ctrl_append_object_item(Evas_Object *cbar, Evas_Object *object); +#ifdef _USE_ROTATE_BG +Evas_Object *_gl_ctrl_add_optionheader(Evas_Object *parent); +#endif + +#endif /* _GL_CONTROLBAR_H_ */ diff --git a/include/widget/gl-editfield.h b/include/widget/gl-editfield.h new file mode 100755 index 0000000..3171c65 --- /dev/null +++ b/include/widget/gl-editfield.h @@ -0,0 +1,37 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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); +int _gl_editfield_hide_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..98169cd --- /dev/null +++ b/include/widget/gl-nocontents.h @@ -0,0 +1,35 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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..f1a8cf4 --- /dev/null +++ b/include/widget/gl-notify.h @@ -0,0 +1,40 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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, Evas_Object *parent, + const char *text); +int _gl_notify_destroy_notiinfo(void *data); +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_rotate_selinfo(void *data); + +#ifdef _cplusplus +} +#endif + +#endif // end of _GL_NOTIFY_H_ diff --git a/include/features/gl-popup.h b/include/widget/gl-popup.h similarity index 91% rename from include/features/gl-popup.h rename to include/widget/gl-popup.h index 6aaba5a..fbbfdb4 100755 --- a/include/features/gl-popup.h +++ b/include/widget/gl-popup.h @@ -21,12 +21,7 @@ typedef enum _gl_popup_mode { GL_POPUP_NOBUT, - GL_POPUP_NOBUT_1S, GL_POPUP_NOBUT_MOV_DEL, - GL_POPUP_NOBUT_ENTRY, - GL_POPUP_NOBUT_APPEXIT, - GL_POPUP_ONEBUT, - GL_POPUP_TWOBUT, GL_POPUP_ALBUM_NEW_EMPTY, GL_POPUP_ALBUM_NEW_DUPLICATE, GL_POPUP_ALBUM_NEW_INVALID, @@ -34,10 +29,14 @@ typedef enum _gl_popup_mode { GL_POPUP_ALBUM_RENAME_DUPLICATE, GL_POPUP_ALBUM_RENAME_INVALID, GL_POPUP_ALBUM_DELETE, + GL_POPUP_ALBUM_SHARE, + GL_POPUP_THUMB_SHARE, GL_POPUP_THUMB_MOVE, + GL_POPUP_VIDEO_DELETE, } gl_popup_mode; int gl_popup_create_albums_del_popup(void *data); +int _gl_popup_create_video_del_popup(void *data); int gl_popup_create_popup(void *data, gl_popup_mode mode, char *desc); int gl_popup_create_title_popup(void *data, gl_popup_mode mode, char *title, char *desc); diff --git a/include/features/gl-progressbar.h b/include/widget/gl-progressbar.h similarity index 77% rename from include/features/gl-progressbar.h rename to include/widget/gl-progressbar.h index 0b2edde..2aa879d 100755 --- a/include/features/gl-progressbar.h +++ b/include/widget/gl-progressbar.h @@ -17,11 +17,13 @@ #ifndef _GL_PROGRESSBAR_H_ #define _GL_PROGRESSBAR_H_ -int gl_pb_add_pbar_timer(void *data); +/* 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); -Evas_Object *gl_pb_add_list_pbar(Evas_Object *parent, const double ratio); -Evas_Object *gl_pb_make_pbar(void *data, Evas_Object * parent, char *state); +Evas_Object *_gl_pb_add_list_pbar(Evas_Object *parent, const double ratio); #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..3e9da57 --- /dev/null +++ b/include/widget/gl-rotate-bg.h @@ -0,0 +1,32 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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..a85b5f1 --- /dev/null +++ b/include/widget/gl-thumb.h @@ -0,0 +1,38 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 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 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..5b65fa9 --- /dev/null +++ b/include/widget/gl-tile.h @@ -0,0 +1,86 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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_FIRSTICON "elm.swallow.firsticon" +#define GT_TILE_ICON "elm.swallow.icon" +#define GT_TILE_3ICON1 "elm.swallow.3icon1" +#define GT_TILE_3ICON2 "elm.swallow.3icon2" +#define GT_TILE_4ICON1 GT_TILE_3ICON1 +#define GT_TILE_4ICON3 "elm.swallow.4icon3" +#define GT_TILE_4ICON4 "elm.swallow.4icon4" +#define GT_TILE_5ICON1 "elm.swallow.5icon1" +#define GT_TILE_5ICON2 "elm.swallow.5icon2" +#define GT_TILE_5ICON4 GT_TILE_4ICON3 +#define GT_TILE_5ICON5 GT_TILE_4ICON4 +#define GT_TILE_6ICON1 GT_TILE_5ICON1 +#define GT_TILE_6ICON3 GT_TILE_4ICON3 +#define GT_TILE_6ICON4 "elm.swallow.6icon4" +#define GT_TILE_6ICON5 "elm.swallow.6icon5" +#define GT_TILE_6ICON6 GT_TILE_4ICON4 +#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_VIEW_BLUE "gallery/albums_view_blue" + +/* 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 gl_icon_type (*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/include/widget/gl-video.h b/include/widget/gl-video.h new file mode 100755 index 0000000..ed88114 --- /dev/null +++ b/include/widget/gl-video.h @@ -0,0 +1,50 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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_VIDEO_H_ +#define _GL_VIDEO_H_ + +/* Icon size of video in list view (172-2x2, 128-2x2) */ +#define GL_VIDEO_ICON_WIDTH 168 +#define GL_VIDEO_ICON_HEIGHT 124 + +#define GL_GENLIST_ITEM_STYLE_VIDEO "video_list" +#define GL_GENLIST_ITEM_STYLE_VIDEO_EDIT "video_list_edit" +#define GL_VIDEO_PART_CHECKBOX "elm.swallow.checkbox" +#define GL_VIDEO_PART_ICON "elm.icon" +#define GL_VIDEO_PART_PLAY "elm.videoicon" +#define GL_VIDEO_PART_FAVOR "elm.favourites.icon" +#define GL_VIDEO_PART_BOOKMARK "elm.bookmarkicon" +#define GL_VIDEO_PART_PBAR "elm.progressbar.icon" +#define GL_VIDEO_PART_SLIDE1 "elm.slide.swallow.1" +#define GL_VIDEO_PART_SLIDE2 "elm.slide.swallow.2" +#define GL_VIDEO_PART_SLIDE3 "elm.slide.swallow.3" +#define GL_VIDEO_PART_TITLE "elm.text.title" +#define GL_VIDEO_PART_SLIDE_TITLE "elm.slide.text.1" +#define GL_VIDEO_PART_DURATION "elm.text.duration" + +Evas_Object *_gl_video_show_pbar(Evas_Object *parent, gl_item *gitem); +Evas_Object *_gl_video_show_part_checkbox(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, const void *data); +Evas_Object *_gl_video_show_part_icon(Evas_Object *obj, char *path, int angle, + int item_w, int item_h); +Evas_Object *_gl_video_show_part_play(Evas_Object *obj); +Evas_Object *_gl_video_show_part_favor(Evas_Object *obj, bool is_expired_drm); +Evas_Object *_gl_video_show_part_bookmark(Evas_Object *obj); +Evas_Object *_gl_video_add_genlist(Evas_Object *parent); + +#endif /* _GL_VIDEO_H_ */ + diff --git a/libug/libug-gallery-efl/include/ge-db-handler.h b/libug/libug-gallery-efl/include/ge-db-handler.h deleted file mode 100755 index bd6c5eb..0000000 --- a/libug/libug-gallery-efl/include/ge-db-handler.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "gallery-efl.h" - -#ifdef _cplusplus -extern "C" { -#endif - - -enum { - GE_DB_SUCCESS, - GE_DB_FAIL, - GE_PROTECTED_FILE -}; - - -int ge_db_update_items_cnt(ge_ugdata* ugd, ge_cluster *album); -int ge_db_get_clusters_list(ge_ugdata* ugd); -int ge_db_clear_items_list(void); -int ge_db_get_items_list(ge_ugdata* ugd, ge_cluster *album, int start_pos, int end_pos); -int ge_db_update_items_list(ge_ugdata* ugd, ge_cluster *album); -int ge_db_get_count_all(void); -int ge_db_get_first_several_items(ge_ugdata* ugd, ge_cluster *album, - ge_item* items[], int *item_count, - minfo_media_sort_type sort_type); -int ge_db_destroy_mtype_item(void* item); -int ge_db_destroy_item(ge_item* gitem); -int ge_db_get_item_by_index(ge_item** gitem, int idx); -int ge_db_init(ge_ugdata* ugd); -int ge_db_finalize(ge_ugdata* ugd); -bool ge_db_is_default_album(ge_ugdata* ugd, Mcluster* mcluster); -Mcluster* ge_db_new_mcluster(ge_ugdata* ugd, const char *cluster_id); -Mitem* ge_db_new_mitem(ge_ugdata* ugd, const char *item_id); -bool ge_db_is_root_path(ge_ugdata* ugd, const char *cluster_id, const char *path); -int ge_db_del_media_id(ge_ugdata* ugd, const char *media_id); -int ge_db_get_folder_fullpath(ge_ugdata* ugd, const char *id, char *path); -int ge_db_item_list_remove(ge_item* gitem); -int ge_db_selected_list_count(void); -Eina_List* ge_db_selected_list_get(void); -int ge_db_selected_list_append(ge_item* gitem); -int ge_db_selected_list_remove(ge_item* gitem); -int ge_db_selected_list_finalize(void); -int ge_db_get_selected_item_by_index(ge_item** gitem, int idx); - -#ifdef _cplusplus -} -#endif -#endif /* _GE_DB_HANDLER_H_ */ - diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl-button.edc b/libug/libug-gallery-efl/res/edc/gallery-efl-button.edc deleted file mode 100755 index fdec384..0000000 --- a/libug/libug-gallery-efl/res/edc/gallery-efl-button.edc +++ /dev/null @@ -1,1124 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 BUTTON_STATE_ENABLED 0 -#define BUTTON_STATE_DISABLED 1 - -#define BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC 108 115 118 255 -#define BUTTON_TEXT_STYLE1_TEXT_DISABLED_COLOR_INC 180 180 1 255 - -#define BUTTON_TEXT_NAVIFRAME_NORMAL_COLOR_INC 211 211 211 255 -#define BUTTON_TEXT_NAVIFRAME_PRESSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_NAVIFRAME_FOCUSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_NAVIFRAME_DISABLED_COLOR_INC 193 193 193 255 - -#define BUTTON_TEXT_STYLE1_BG_MIN_INC 100 74 -#define BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC 148 74 -#define BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC 74 74 -#define BUTTON_TEXT_STYLE1_BG_BORDER_INC 5 5 5 5 -#define BUTTON_TEXT_STYLE1_PADDING_MIN_INC 20 5 -#define BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0 -#define BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_STYLE1_FONT_SIZE_INC 32 - -#define BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC 64 64 -#define BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC 64 64 -#define BUTTON_CIRCLE_STYLE_CONTENT_MIN_MAX_INC 35 35 - -#define BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC 106 74 -#define BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC 5 5 5 5 -#define BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC 56 56 - -#define BUTTON_NAVIFRAME_BG_MIN_INC 124 74 -#define BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC 124 74 -#define BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC 74 74 -#define BUTTON_NAVIFRAME_BG_BORDER_INC 5 5 5 5 -#define BUTTON_NAVIFRAME_PADDING_MIN_INC 5 5 -#define BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38 -#define BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0 -#define BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC 38 38 -#define BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC 28 -#define BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC 124 74 - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/style1"; - alias: "elm/button/base/text_only/style1"; - alias: "elm/button/base/center"; - alias: "elm/button/base/icon_and_text/center"; - alias: "elm/button/base/nocontents/search_button"; - images { - image: GE_EDC_IMAGE_BTN_01_NORMAL COMP; - image: GE_EDC_IMAGE_BTN_01_PRESS COMP; - image: GE_EDC_IMAGE_BTN_01_DIM COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - image { - normal: GE_EDC_IMAGE_BTN_01_NORMAL; - border: BUTTON_TEXT_STYLE1_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GE_EDC_IMAGE_BTN_01_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image.normal: GE_EDC_IMAGE_BTN_01_DIM; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GE_EDC_IMAGE_BTN_01_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: BUTTON_TEXT_STYLE1_BG_MIN_INC; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - min: BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - min: 0 0; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "visible" 0.0; - visible: 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC; - max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_after_icon"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 0 0; - visible: 0; - } - description { state: "visible" 0.0; - visible: 0; - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC; - max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - } - description { state: "icononly" 0.0; - min: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC; - max: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC; - text { - font: "HelveticaNeue:style=Medium"; - size: BUTTON_TEXT_STYLE1_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC; - visible: 1; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "disabled_visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_after_icon"; - target: "icon_rect"; - target: "bg"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - program { name: "focused"; - //signal: "elm,action,focus"; - //source: "elm"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - //signal: "elm,action,unfocus"; - //source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - /////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/naviframe/back_btn/gallery_efl"; - alias: "elm/button/base/naviframe/back_btn/default"; - alias: "elm/button/base/naviframe/prev_btn/default"; - alias: "elm/button/base/naviframe/end_btn/default"; - images { - image: GE_EDC_IMAGE_BTN_PREV COMP; - image: GE_EDC_IMAGE_BTN_PREV_PRESS COMP; - image: GE_EDC_IMAGE_PREV COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC; - image { - normal: GE_EDC_IMAGE_BTN_PREV; - border: BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GE_EDC_IMAGE_BTN_PREV_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GE_EDC_IMAGE_BTN_PREV_PRESS; - } - } - part { name: "back_button"; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC; - rel1.to: "button_image"; - rel2.to: "button_image"; - image.normal: GE_EDC_IMAGE_PREV; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - after: "disable_button"; - } - program { name: "disable_button"; - script { - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - after: "enable_button"; - } - program { name: "enable_button"; - script { - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - } - } - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/naviframe/title/gallery_efl"; - alias: "elm/button/base/naviframe/title/default"; - - images { - image: GE_EDC_IMAGE_TITLE_BTN COMP; - image: GE_EDC_IMAGE_TITLE_BTN_PRESS COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC; - max: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC; - image { - normal: GE_EDC_IMAGE_TITLE_BTN; - border: BUTTON_NAVIFRAME_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GE_EDC_IMAGE_TITLE_BTN_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GE_EDC_IMAGE_TITLE_BTN_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_NAVIFRAME_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_BG_MIN_INC; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - min: BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_NAVIFRAME_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - min: 0 0; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "visible" 0.0; - visible: 0; - min: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_after_icon"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 0 0; - visible: 0; - } - description { state: "visible" 0.0; - visible: 0; - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - min: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - } - description { state: "icononly" 0.0; - min: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_TEXT_NAVIFRAME_NORMAL_COLOR_INC; - text { - font: "HelveticaNeue:style=Medium"; - size: BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_NAVIFRAME_PRESSED_COLOR_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: BUTTON_TEXT_NAVIFRAME_DISABLED_COLOR_INC; - visible: 1; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_NAVIFRAME_FOCUSED_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "disabled_visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_after_icon"; - target: "icon_rect"; - target: "bg"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - program { name: "focused"; - //signal: "elm,action,focus"; - //source: "elm"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - //signal: "elm,action,unfocus"; - //source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } -#undef BUTTON_STATE_ENABLED -#undef BUTTON_STATE_DISABLED - diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc b/libug/libug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc deleted file mode 100755 index 24dd248..0000000 --- a/libug/libug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_Y 60 -#define ALBUM_TEXT_NAME_H 32 -#define ALBUM_TEXT_DATE_H 25 - -#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 - - -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.firsticon elm.swallow.icon 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; - 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.swallow.firsticon"; - type: SWALLOW; - mouse_events: 1; - repeat_events: 1; - description { - state: "default" 0.0; - rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } - } - } - part { - name: "elm.swallow.icon"; - 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_TEXT_AREA_H+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: "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; - } - description { - state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - 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: "Helvetica Neue:style=Medium"; - 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+1)/ALBUM_TEXT_AREA_W) ALBUM_TEXT_Y/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: "Helvetica Neue:style=Medium"; - size: 38; - align: 1.0 0.5; - } - } - description { - state: "hide" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { - name: "selected_bg"; - type: RECT; - description { - state: "default" 0.0; - visible: 0; - rel1 { relative: 0.0 0.0; to: "elm.swallow.icon"; } - rel2 { relative: 1.0 1.0; to: "elm.swallow.icon"; } - } - description { - state: "selected" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { - name: "elm.swallow.check_bg"; - type: SWALLOW; - mouse_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_W-ALBUM_ICON_PAD-1)/ALBUM_ICON_W) ((ALBUM_ICON_H-ALBUM_ICON_PAD-1)/ALBUM_ICON_H); offset: 0 0; to: "icon_bg"; } - } - } - 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: "Helvetica Neue:style=Medium"; - size: 28; - align: 0.0 0.5; - } - } - description { - state: "blue" 0.0; - inherit: "default" 0.0; - color: 111 198 235 255; - } - } - } - - programs { - program { - name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "selected_bg"; - } - program { - name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "selected_bg"; - } - program { /* Show blue name */ - name: "show_blue_name"; - signal: "elm,name,show,blue"; - source: "elm"; - script { - set_state(PART:"elm.text.name", "blue", 0.0); - } - } - } -} - diff --git a/libug/libug-gallery-efl/res/images/00_winset_Back_btn_normal.png b/libug/libug-gallery-efl/res/images/00_winset_Back_btn_normal.png deleted file mode 100755 index cb7ca0b..0000000 Binary files a/libug/libug-gallery-efl/res/images/00_winset_Back_btn_normal.png and /dev/null differ diff --git a/libug/libug-gallery-efl/res/images/00_winset_Back_btn_press.png b/libug/libug-gallery-efl/res/images/00_winset_Back_btn_press.png deleted file mode 100755 index 7032b70..0000000 Binary files a/libug/libug-gallery-efl/res/images/00_winset_Back_btn_press.png and /dev/null differ diff --git a/libug/libug-gallery-efl/res/images/T01_thumbs_bg.png b/libug/libug-gallery-efl/res/images/T01_thumbs_bg.png deleted file mode 100644 index c71e2d3..0000000 Binary files a/libug/libug-gallery-efl/res/images/T01_thumbs_bg.png and /dev/null differ diff --git a/libug/libug-gallery-efl/res/images/T01_title_btn.png b/libug/libug-gallery-efl/res/images/T01_title_btn.png deleted file mode 100644 index 0d1fbcf..0000000 Binary files a/libug/libug-gallery-efl/res/images/T01_title_btn.png and /dev/null differ diff --git a/libug/libug-gallery-efl/res/images/T01_title_btn_press.png b/libug/libug-gallery-efl/res/images/T01_title_btn_press.png deleted file mode 100644 index afdecba..0000000 Binary files a/libug/libug-gallery-efl/res/images/T01_title_btn_press.png and /dev/null differ diff --git a/libug/libug-gallery-efl/src/ge-db-handler.c b/libug/libug-gallery-efl/src/ge-db-handler.c deleted file mode 100755 index 8e80195..0000000 --- a/libug/libug-gallery-efl/src/ge-db-handler.c +++ /dev/null @@ -1,1141 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 "ge-db-handler.h" -#include "ge-debug.h" -#include "ge-util.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 - -static int _ge_db_elist_ite_fn(Mitem *item, void *user_data) -{ - Eina_List **list = (Eina_List **)user_data; - *list = eina_list_append(*list, item); - return GE_DB_SUCCESS; -} - -static int _ge_db_cluster_elist_ite_fn(Mcluster *cluster, void *user_data) -{ - Eina_List **list = (Eina_List **)user_data; - *list = eina_list_append(*list, cluster); - return GE_DB_SUCCESS; -} - -/* -* create a gitem -*/ -static ge_item* _ge_db_new_item(void) -{ - ge_item* gitem = (ge_item*)calloc(1, sizeof(ge_item)); - GE_CHECK_NULL(gitem); - return gitem; -} - -/* -* destroy a ge_item -*/ -static int _ge_db_destroy_item(ge_item* gitem) -{ - if(gitem) - { - if(gitem->item) - { - ge_db_destroy_mtype_item(gitem->item); - gitem->item = NULL; - } - - if(gitem->_reserved) - { - free(gitem->_reserved); - gitem->_reserved = NULL; - } - - gitem->elm_item = NULL; - gitem->checked = false; - gitem->check_obj = NULL; - free(gitem); - gitem = NULL; - } - return GE_DB_SUCCESS; -} - -static int _ge_db_clear_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_db_destroy_mtype_item(current); - current = NULL; - } - } - - *elist = NULL; - } - - return GE_DB_SUCCESS; -} - -static int _ge_db_clear_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_db_destroy_item(current); - current = NULL; - } - } - ge_db_item_list = NULL; - ge_all_count = 0; - return GE_DB_SUCCESS; -} - -static int _ge_db_free_cluster(ge_cluster* gcluster) -{ - GE_CHECK_VAL(gcluster, GE_DB_FAIL); - if(gcluster->cluster) - { - ge_db_destroy_mtype_item(gcluster->cluster); - gcluster->cluster = NULL; - } - if(gcluster->_reserved) - { - free(gcluster->_reserved); - gcluster->_reserved = NULL; - } - free(gcluster); - return GE_DB_SUCCESS; -} - -/* Free memory allocated for 'All' album */ -static int _ge_db_free_cluster_all(ge_cluster* gcluster) -{ - GE_CHECK_VAL(gcluster, GE_DB_FAIL); - GE_CHECK_VAL(gcluster->cluster, GE_DB_FAIL); - - if(gcluster->cluster->display_name) - { - free(gcluster->cluster->display_name); - gcluster->cluster->display_name = NULL; - } - - if(gcluster->_reserved) - { - free(gcluster->_reserved); - gcluster->_reserved = NULL; - } - - free(gcluster->cluster); - gcluster->cluster = NULL; - free(gcluster); - return GE_DB_SUCCESS; -} - -static int _ge_db_clear_clusters_list(ge_ugdata* ugd) -{ - GE_CHECK_VAL(ugd, GE_DB_FAIL); - 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) - { - if(current->cluster && - current->cluster->uuid && - !g_strcmp0(current->cluster->uuid, GE_ALBUM_ALL_ID)) - { - _ge_db_free_cluster_all(current); - } - else - { - _ge_db_free_cluster(current); - } - } - current = NULL; - } - ugd->cluster_list->clist = NULL; - } - - free(ugd->cluster_list); - ugd->cluster_list = NULL; - } - - return GE_DB_SUCCESS; -} - -static ge_cluster_list* _ge_db_new_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_db_new_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_db_new_cluster_all(ge_ugdata* ugd, int count) -{ - GE_CHECK_NULL(ugd); - ge_cluster* gcluster = _ge_db_new_cluster(); - GE_CHECK_NULL(gcluster); - - /* Pass -1 to get a mcluster from libmedia-info, not a real record in DB */ - Mcluster* cluster = ge_db_new_mcluster(ugd, NULL); - if(cluster == NULL) - { - free(gcluster); - gcluster = NULL; - return NULL; - } - - cluster->uuid = strdup(GE_ALBUM_ALL_ID); - cluster->display_name = strdup(GE_ALBUM_ALL_NAME); - cluster->count = count; - 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_db_get_clusters_list(ge_ugdata* ugd) -{ - GE_CHECK_VAL(ugd, -1); - int length = 0; - int local_item_cnt = 0; - Eina_List *item_list = NULL; - Mcluster *f_data = NULL; - ge_cluster * default_cluster = NULL; - ge_cluster* gcluster = NULL; - int medias_cnt = 0; - int err = -1; - minfo_cluster_filter filter; - minfo_item_filter item_filter; - - /* Get real albums */ - memset(&filter, 0x00, sizeof(minfo_cluster_filter)); - filter.cluster_type = MINFO_CLUSTER_TYPE_ALL; - filter.sort_type = MINFO_CLUSTER_SORT_BY_NAME_ASC; - filter.start_pos = GE_GET_ALL_RECORDS; - filter.end_pos = GE_GET_ALL_RECORDS; - - err = minfo_get_cluster_list(ugd->db_handle, filter, - _ge_db_cluster_elist_ite_fn, &item_list); - if(err == MB_SVC_ERROR_DB_NO_RECORD) { - ge_dbgE("No record"); - if (item_list) - _ge_db_clear_mtype_items_list(&item_list); - return err; - } else if(err != 0) { - ge_dbgE("minfo_get_cluster_list failed(%d)!", err); - if (item_list) - _ge_db_clear_mtype_items_list(&item_list); - return err; - } - - 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 Mcluster!"); - continue; - } - ge_dbg("Cluster ID: %s.", f_data->uuid); - - /* only image is valid in setas mode. */ - if (ugd->file_type_mode == GE_File_Select_Type_Image || - ugd->file_type_mode == GE_File_Select_Type_Video) { - memset(&item_filter,0x00,sizeof(minfo_item_filter)); - if(ugd->file_type_mode == GE_File_Select_Type_Image) - item_filter.file_type = MINFO_ITEM_IMAGE; - else - item_filter.file_type = MINFO_ITEM_VIDEO; - item_filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - item_filter.start_pos = GE_GET_ALL_RECORDS; - item_filter.end_pos = GE_GET_ALL_RECORDS; - item_filter.with_meta = false; - - err = minfo_get_item_cnt(ugd->db_handle, f_data->uuid, - item_filter, &medias_cnt); - if(err == 0 || err == MB_SVC_ERROR_DB_NO_RECORD) { - f_data->count = medias_cnt; - } else { - ge_dbgW("minfo_get_cluster_cnt[err:%d]", err); - f_data->count = 0; - } - } - - if(f_data->count == 0) { - /* Skip empty album, next one */ - ge_dbgW("local album is empty, skipping it."); - ge_db_destroy_mtype_item(f_data); - continue; - } - - gcluster = _ge_db_new_cluster(); - if(gcluster == NULL) { - ge_dbgE("_ge_db_new_cluster failed!"); - ge_db_destroy_mtype_item(f_data); - continue; - } - - gcluster->cluster = f_data; - gcluster->ugd = ugd; - length += f_data->count; - local_item_cnt += f_data->count; - - if (ge_db_is_default_album(ugd, 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_cluster = gcluster; - 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!"); - if(local_item_cnt) { - /* Create "All" album if any file exists */ - gcluster = _ge_db_new_cluster_all(ugd, local_item_cnt); - GE_CHECK_VAL(gcluster, -1); - - if(default_cluster) - clist = eina_list_append_relative(clist, gcluster, - default_cluster); - else - clist= eina_list_prepend(clist, gcluster); - - ugd->cluster_list->clist = clist; - ge_dbg("Cluster All added!"); - } - - return length; -} - -static int _ge_db_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); - *sel_id_list = eina_list_append(*sel_id_list, - (void *)item_id); - } - } - - ge_db_selected_list_finalize(); - return 0; -} - -/* Free list of selected IDs */ -static int __ge_db_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; - } - free(p_id); - p_id = NULL; - } - *sel_id_list = NULL; - return 0; -} - -/* Check ID is in the list or not */ -static bool _ge_db_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); - free(p_id); - p_id = NULL; - return true; - } - return false; -} - -/* -* get a new cluster from media service by cluster id -*/ -Mcluster* ge_db_new_mcluster(ge_ugdata* ugd, const char *cluster_id) -{ - GE_CHECK_NULL(ugd); - Mcluster* mcluster = NULL; - int ret = minfo_get_cluster(ugd->db_handle, NULL, cluster_id, &mcluster); - if(ret != 0) - { - ge_dbgE("minfo_get_cluster failed(%d)!", ret); - return NULL; - } - - return mcluster; -} -/* -* get a new item from media service by item id -*/ -Mitem* ge_db_new_mitem(ge_ugdata* ugd, const char *item_id) -{ - GE_CHECK_NULL(ugd); - Mitem* mitem = NULL; - /*new API, to use media id to get item. */ - int ret = minfo_get_item_by_id(ugd->db_handle, item_id, &mitem); - if(ret != 0) - { - ge_dbgE("minfo_get_item_by_id failed(%d)!", ret); - return NULL; - } - - return mitem; -} - -int ge_db_update_items_cnt(ge_ugdata* ugd, ge_cluster *album) -{ - GE_CHECK_VAL(album, GE_DB_FAIL); - GE_CHECK_VAL(album->cluster, GE_DB_FAIL); - GE_CHECK_VAL(album->cluster->uuid, GE_DB_FAIL); - GE_CHECK_VAL(ugd, GE_DB_FAIL); - minfo_item_filter filter; - int err = -1; - int item_count = 0; - - memset(&filter,0x00,sizeof(minfo_item_filter)); - if(ugd->file_type_mode == GE_File_Select_Type_Image) - { - filter.file_type = MINFO_ITEM_IMAGE; - } - else if(ugd->file_type_mode == GE_File_Select_Type_Video) - { - filter.file_type = MINFO_ITEM_VIDEO; - } - else - { - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - } - filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - filter.start_pos = GE_GET_ALL_RECORDS; - filter.end_pos = GE_GET_ALL_RECORDS; - filter.with_meta = false; - - if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { - /* real album */ - err = minfo_get_item_cnt(ugd->db_handle, album->cluster->uuid, - filter, &item_count); - if(err < 0) - { - ge_dbg("minfo_get_item_cnt failed(%d)!", err); - return GE_DB_FAIL; - } - } - else// "All" album - { - ge_dbg("all media count"); - /** - * Fixme: Use better API. - * No way to set filter if call minfo_get_all_item_cnt to get all count, - * So get item list firstly, then get all items count. - */ - Eina_List* itemlist = NULL; - err = minfo_get_all_item_list(ugd->db_handle, - MINFO_CLUSTER_TYPE_LOCAL_ALL, - filter, _ge_db_elist_ite_fn, - &itemlist); - - if(err < 0 || itemlist == NULL) { - ge_dbg("minfo_get_all_item_list failed(%d)!", err); - if (itemlist) - _ge_db_clear_mtype_items_list(&itemlist); - return GE_DB_FAIL; - } - - Mitem *item = NULL; - EINA_LIST_FREE(itemlist, item) { - if (item) { - item_count++; - ge_db_destroy_mtype_item(item); - item = NULL; - } - } - } - - ge_dbg("cluster media count : old=%d, new=%d", album->cluster->count, item_count); - album->cluster->count = item_count; - - return GE_DB_SUCCESS; -} - -int ge_db_get_clusters_list(ge_ugdata* ugd) -{ - GE_CHECK_VAL(ugd, GE_DB_FAIL); - int n_entire_items = 0; - - _ge_db_clear_clusters_list(ugd); - - ugd->cluster_list = _ge_db_new_clusters_list(); - n_entire_items = _ge_db_get_clusters_list(ugd); - ge_dbg("Total media items count:%d", n_entire_items); - if(n_entire_items <= 0)//if error code is returned, negative value is possible - { - return GE_DB_FAIL; - } - - return GE_DB_SUCCESS; -} - -/* Clear items list */ -int ge_db_clear_items_list(void) -{ - return _ge_db_clear_items_list(); -} - -int ge_db_get_items_list(ge_ugdata* ugd, ge_cluster *album, int start_pos, int end_pos) -{ - GE_CHECK_VAL(album, GE_DB_FAIL); - GE_CHECK_VAL(album->cluster, GE_DB_FAIL); - GE_CHECK_VAL(album->cluster->uuid, GE_DB_FAIL); - GE_CHECK_VAL(ugd, -1); - Eina_List* itemlist = NULL; - minfo_item_filter filter; - int err = -1; - - ge_dbg("--start_pos[%d], end_pos[%d]--", start_pos, end_pos); - memset(&filter,0x00,sizeof(minfo_item_filter)); - if(ugd->file_type_mode == GE_File_Select_Type_Image) - { - filter.file_type = MINFO_ITEM_IMAGE; - } - else if(ugd->file_type_mode == GE_File_Select_Type_Video) - { - filter.file_type = MINFO_ITEM_VIDEO; - } - else - { - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - } - filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - filter.start_pos = start_pos; - filter.end_pos = end_pos; - 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_db_clear_items_list(); - } - - if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { - /* real album */ - ge_dbg("--Real album--"); - err = minfo_get_item_list(ugd->db_handle, album->cluster->uuid, - filter, _ge_db_elist_ite_fn, &itemlist); - } - else //add "All" album - { - ge_dbg("--Album All--"); - err = minfo_get_all_item_list(ugd->db_handle, - MINFO_CLUSTER_TYPE_LOCAL_ALL, - filter, _ge_db_elist_ite_fn, - &itemlist); - } - - if((err == 0) && (itemlist != NULL)) - { - Mitem *item = NULL; - ge_item* gitem = NULL; - EINA_LIST_FREE(itemlist, item) - { - if (item == NULL || item->uuid == NULL) { - ge_dbgE("Invalid item!"); - continue; - } - - gitem = _ge_db_new_item(); - if(gitem == NULL) { - ge_dbgE("_gl_db_new_item() failed"); - ge_db_destroy_mtype_item(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_db_clear_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_db_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, GE_DB_FAIL); - GE_CHECK_VAL(ugd, -1); - Eina_List* itemlist = NULL; - minfo_item_filter filter; - 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_ThumbnailEdit_Mode && - ugd->file_select_mode != GE_File_Select_One) { - ge_dbg("Edit view for multiple selection."); - /* Get ID list of selected items */ - _ge_db_get_selected_item_id_list(&sel_id_list); - } - - memset(&filter,0x00,sizeof(minfo_item_filter)); - if(ugd->file_type_mode == GE_File_Select_Type_Image) - filter.file_type = MINFO_ITEM_IMAGE; - else if(ugd->file_type_mode == GE_File_Select_Type_Video) - filter.file_type = MINFO_ITEM_VIDEO; - else - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - filter.start_pos = GE_GET_ALL_RECORDS; - filter.end_pos = GE_GET_ALL_RECORDS; - filter.with_meta = true; - - /*Clear item list before new one got */ - _ge_db_clear_items_list(); - - if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) - err = minfo_get_item_list(ugd->db_handle, album->cluster->uuid, - filter, _ge_db_elist_ite_fn, &itemlist); - else - err = minfo_get_all_item_list(ugd->db_handle, - MINFO_CLUSTER_TYPE_LOCAL_ALL, - filter, _ge_db_elist_ite_fn, - &itemlist); - - if ((err != 0) || (itemlist == NULL)) { - ge_dbgE("(err != 0) || (itemlist == NULL)"); - /* Free Mitems */ - if (itemlist) - _ge_db_clear_mtype_items_list(&itemlist); - ge_all_count = 0; - return err; - } - - bool b_selected = false; - Mitem *item = NULL; - ge_item* gitem = NULL; - EINA_LIST_FREE(itemlist, item) { - if (item == NULL || item->uuid == NULL) { - ge_dbgE("Invalid item!"); - continue; - } - gitem = _ge_db_new_item(); - if(gitem == NULL) { - ge_dbgE("_gl_db_new_item() failed"); - ge_db_destroy_mtype_item(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_db_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_db_selected_list_append(gitem); - } - } - - item = NULL; - gitem = NULL; - } - - /* Clear list of selected ID */ - if (sel_id_list) - __ge_db_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_db_get_first_several_items(ge_ugdata* ugd, ge_cluster *album, - ge_item* items[], int *item_count, - minfo_media_sort_type 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); - minfo_item_filter filter; - Eina_List *item_list = NULL; - int result_cnt = 0; - Mitem* item = NULL; - ge_item* gitem = NULL; - int err = -1; - - if(*item_count <= 0) - { - ge_dbgE("*item_count <= 0"); - return -1; - } - memset(&filter,0x00,sizeof(minfo_item_filter)); - if(ugd->file_type_mode == GE_File_Select_Type_Image) - { - filter.file_type = MINFO_ITEM_IMAGE; - } - else if(ugd->file_type_mode == GE_File_Select_Type_Video) - { - filter.file_type = MINFO_ITEM_VIDEO; - } - else - { - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - } - filter.sort_type = sort_type; - filter.start_pos = 0; - filter.end_pos = (*item_count == 1 ? 1 : (*item_count - 1)); - filter.with_meta = false; - - if(g_strcmp0(album->cluster->uuid, GE_ALBUM_ALL_ID)) { - /*real album */ - err = minfo_get_item_list(ugd->db_handle, album->cluster->uuid, - filter, _ge_db_elist_ite_fn, &item_list); - if(err != 0 || item_list == NULL) - { - ge_dbgE("minfo_get_item_list failed(%d)", err); - goto DB_FAILED; - } - } - else //add "All" album - { - err = minfo_get_all_item_list(ugd->db_handle, - MINFO_CLUSTER_TYPE_LOCAL_ALL, - filter, _ge_db_elist_ite_fn, - &item_list); - if(err != 0 || item_list == NULL) - { - ge_dbgE("minfo_get_all_item_list failed(%d)", err); - goto DB_FAILED; - } - } - - EINA_LIST_FREE(item_list, item) { - if (item == NULL) { - ge_dbgE("Invalid Mitem!"); - continue; - } - result_cnt++; - if(result_cnt <= *item_count) { - gitem = NULL; - gitem = _ge_db_new_item(); - if (gitem == NULL) { - ge_dbgE("_ge_db_new_item failed!"); - ge_db_destroy_mtype_item(item); - result_cnt--; - continue; - } - gitem->item = item; - items[result_cnt-1] = gitem; - } else { - ge_db_destroy_mtype_item(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_db_clear_mtype_items_list(&item_list); - return -1; -} - -int ge_db_del_media_id(ge_ugdata* ugd, const char *media_id) -{ - GE_CHECK_VAL(media_id, GE_DB_FAIL); - int ret = minfo_delete_media_id(ugd->db_handle, media_id); - if(ret != 0) - { - ge_dbgE("minfo_delete_media_id failed(%d)!", ret); - return GE_DB_FAIL; - } - - return GE_DB_SUCCESS; -} - -int ge_db_item_list_remove(ge_item* gitem) -{ - GE_CHECK_VAL(gitem, GE_DB_FAIL); - GE_CHECK_VAL(gitem->item, GE_DB_FAIL); - GE_CHECK_VAL(gitem->item->uuid, GE_DB_FAIL); - 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_db_destroy_item(current); - current = NULL; - break; - } - } - return GE_DB_SUCCESS; -} - -int ge_db_destroy_mtype_item(void* item) -{ - GE_CHECK_VAL(item, GE_DB_FAIL); - int ret = minfo_destroy_mtype_item(item); - if(ret != 0) - { - ge_dbgE("minfo_destroy_mtype_item failed(%d)!", ret); - return GE_DB_FAIL; - } - - return GE_DB_SUCCESS; -} - -int ge_db_destroy_item(ge_item * gitem) -{ - GE_CHECK_VAL(gitem, GE_DB_FAIL); - - _ge_db_destroy_item(gitem); - return GE_DB_SUCCESS; -} - -int ge_db_get_item_by_index(ge_item** gitem, int idx) -{ - GE_CHECK_VAL(gitem, GE_DB_FAIL); - - if (idx > ge_all_count) - { - ge_dbg("db_get_item_by_index(%d) is failed\n", idx); - *gitem = NULL; - return GE_DB_FAIL; - } - - *gitem = eina_list_nth(ge_db_item_list, idx -1); - return GE_DB_SUCCESS; -} - -int ge_db_get_count_all(void) -{ - return ge_all_count; -} - -int ge_db_get_selected_item_by_index(ge_item** gitem, int idx) -{ - GE_CHECK_VAL(gitem, GE_DB_FAIL); - - if (idx > ge_db_selected_list_count()) - { - ge_dbg("db_get_item_by_index(%d) is failed\n", idx); - *gitem = NULL; - return GE_DB_FAIL; - } - - *gitem = eina_list_nth(ge_item_selected_list, idx -1); - return GE_DB_SUCCESS; -} - -int ge_db_selected_list_count(void) -{ - return eina_list_count(ge_item_selected_list); -} - -Eina_List* ge_db_selected_list_get(void) -{ - return ge_item_selected_list; -} - -int ge_db_selected_list_append(ge_item* gitem) -{ - GE_CHECK_VAL(gitem, GE_DB_FAIL); - - ge_item_selected_list = eina_list_append(ge_item_selected_list, gitem); - return GE_DB_SUCCESS; -} - -int ge_db_selected_list_remove(ge_item* gitem) -{ - GE_CHECK_VAL(gitem, GE_DB_FAIL); - GE_CHECK_VAL(gitem->item, GE_DB_FAIL); - GE_CHECK_VAL(gitem->item->uuid, GE_DB_FAIL); - 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 GE_DB_SUCCESS; -} - -int ge_db_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 GE_DB_SUCCESS; -} - -/* -* get full path of cluster -*/ -int ge_db_get_folder_fullpath(ge_ugdata* ugd, const char *id, char *path) -{ - GE_CHECK_VAL(ugd, GE_DB_FAIL); - GE_CHECK_VAL(id, GE_DB_FAIL); - GE_CHECK_VAL(path, GE_DB_FAIL); - /*For safety, we should add one more parameter as a size of the output array. */ - return minfo_get_cluster_fullpath_by_id(ugd->db_handle,id, path, - GE_DIR_PATH_LEN_MAX); -} - -/* -* Check it's default album[Camera shot] or not -*/ -bool ge_db_is_default_album(ge_ugdata* ugd, Mcluster* mcluster) -{ - GE_CHECK_VAL(ugd, GE_DB_FAIL); - GE_CHECK_FALSE(mcluster); - GE_CHECK_FALSE(mcluster->display_name); - GE_CHECK_FALSE(mcluster->uuid); - int ret = -1; - - /* Name is 'Camera shot' and folder locates in Phone */ - ret = g_strcmp0(mcluster->display_name, GE_ALBUM_MY_NAME); - if (ret == 0 && mcluster->type == MINFO_PHONE) { - char dir_path[GE_DIR_PATH_LEN_MAX] = { 0, }; - int ret = minfo_get_cluster_fullpath_by_id(ugd->db_handle, - mcluster->uuid, - dir_path, - GE_DIR_PATH_LEN_MAX); - if(ret != 0) { - ge_dbgE("get_cluster_fullpath_by_id failed[%d]!", ret); - return false; - } - ge_dbg("Full path: %s", dir_path); - /* Get parent directory */ - char *parent_path = ecore_file_dir_get(dir_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_MEM(parent_path) - - if (ret == 0) { - ge_dbgW("Default folder!"); - return true; - } - } - - return false; -} - -bool ge_db_is_root_path(ge_ugdata* ugd, const char *cluster_id, const char *path) -{ - int res = 0; - char dir_path[GE_DIR_PATH_LEN_MAX] = { 0, }; - - if(path) { - g_strlcpy(dir_path, path, GE_DIR_PATH_LEN_MAX); - } else { - GE_CHECK_FALSE(cluster_id); - res = minfo_get_cluster_fullpath_by_id(ugd->db_handle, - cluster_id, dir_path, - GE_DIR_PATH_LEN_MAX); - if(res != 0) { - ge_dbgE("minfo_get_cluster_fullpath_by_id failed(%d)!", res); - return false; - } - } - - ge_dbg("Root path[/opt/media or /opt/storage/sdcard]: %s ?", dir_path); - if(!g_strcmp0(GE_ROOT_PATH_PHONE, dir_path) || - !g_strcmp0(GE_ROOT_PATH_MMC, dir_path)) - return true; - - return false; -} - -int ge_db_init(ge_ugdata* ugd) -{ - ge_dbg("Connect to libmedia-info!"); - GE_CHECK_VAL(ugd, GE_DB_FAIL); - MediaSvcHandle *_db_handle = NULL; - - int err = media_svc_connect(&_db_handle); - if (err < 0) { - ge_dbgE("Connect to DB failed!"); - return GE_DB_FAIL; - } - - ugd->db_handle = _db_handle; - return GE_DB_SUCCESS; -} - -int ge_db_finalize(ge_ugdata* ugd) -{ - ge_dbg("Free memory and disconnect with libmedia-info!"); - GE_CHECK_VAL(ugd, GE_DB_FAIL); - _ge_db_clear_clusters_list(ugd); - _ge_db_clear_items_list(); - - int err = media_svc_disconnect(ugd->db_handle); - if (err != 0) - { - ge_dbgE("\n\nDisconnect with libmedia-info failed!!!\n"); - return GE_DB_FAIL; - } - - return GE_DB_SUCCESS; -} - diff --git a/org.tizen.gallery.desktop.in b/org.tizen.gallery.desktop.in index d45088a..26d6ef0 100755 --- a/org.tizen.gallery.desktop.in +++ b/org.tizen.gallery.desktop.in @@ -22,5 +22,5 @@ MimeType=gallery.uri nodisplay=False x-tizen-taskmanage=True x-tizen-multiple=False -x-tizen-svc= http://tizen.org/appsvc/operation/pick|NULL|image/*;http://tizen.org/appsvc/operation/pick|NULL|video/*;http://tizen.org/appsvc/operation/pick|NULL|NULL;http://tizen.org/appsvc/operation/view|NULL|NULL +x-tizen-svc= http://tizen.org/appsvc/operation/pick|NULL|image/*;http://tizen.org/appsvc/operation/pick|NULL|video/*;http://tizen.org/appsvc/operation/pick|NULL|NULL;http://tizen.org/appsvc/operation/view|NULL|NULL;http://tizen.org/appsvc/operation/wallpaper|NULL|NULL x-tizen-removable=false diff --git a/org.tizen.gallery.xml b/org.tizen.gallery.xml new file mode 100755 index 0000000..8dbb27e --- /dev/null +++ b/org.tizen.gallery.xml @@ -0,0 +1,39 @@ + + + + Jiansong Jin + Gallery + + org.tizen.gallery.png + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packaging/org.tizen.gallery.spec b/packaging/org.tizen.gallery.spec index 92f12e8..66ebeee 100755 --- a/packaging/org.tizen.gallery.spec +++ b/packaging/org.tizen.gallery.spec @@ -4,7 +4,7 @@ Name: org.tizen.gallery Summary: org.tizen.gallery UX -Version: 1.0.31 +Version: 1.1.28 Release: 1 Group: Applications License: Flora Software License @@ -12,33 +12,38 @@ Source0: %{name}-%{version}.tar.gz BuildRequires: cmake BuildRequires: gettext-tools BuildRequires: edje-tools -BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(media-thumbnail) +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(evas) -BuildRequires: pkgconfig(libmedia-service) -BuildRequires: pkgconfig(media-thumbnail) -BuildRequires: pkgconfig(ui-gadget) +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(appsvc) -BuildRequires: pkgconfig(devman_haptic) BuildRequires: pkgconfig(capi-appfw-application) +BuildRequires: pkgconfig(capi-appfw-app-manager) +BuildRequires: pkgconfig(capi-system-haptic) %description Description: org.tizen.gallery UX -%package -n libug-gallery-efl +%package -n ug-gallery-efl Summary: gallery UG Group: TO_BE/FILLED_IN -Requires: %{name} = %{version}-%{release} -%description -n libug-gallery-efl +%description -n ug-gallery-efl Description: gallery UG - %prep %setup -q @@ -49,28 +54,34 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_appdir}/org.tizen.gallery make %{?jobs:-j%jobs} %install +rm -rf %{buildroot} %make_install -%find_lang gallery -%find_lang ug-gallery-efl - %post chown -R 5000:5000 %{_appdir}/org.tizen.gallery/data - -%files -f gallery.lang +%postun + +%post -n ug-gallery-efl +mkdir -p /opt/ug/bin/ +ln -sf /usr/bin/ug-client /opt/ug/bin/gallery-efl +%postun -n ug-gallery-efl + +%files -n org.tizen.gallery +%defattr(-,root,root,-) +%{_appdir}/org.tizen.gallery/bin/* +%{_appdir}/org.tizen.gallery/res/locale/* +/opt/share/icons/default/small/* %{_appdir}/org.tizen.gallery/res/images/* -%{_appdir}/org.tizen.gallery/res/.decarta/conf.enc -%{_appdir}/org.tizen.gallery/res/edje/gallery.edj -%{_appdir}/org.tizen.gallery/res/edje/gl-black-theme.edj -%{_appdir}/org.tizen.gallery/res/icons/default/small/org.tizen.gallery.png +%{_appdir}/org.tizen.gallery/res/sounds/* +%{_appdir}/org.tizen.gallery/res/edje/* %{_appdir}/org.tizen.gallery/data -%{_appdir}/org.tizen.gallery/bin/gallery -/opt/share/miregex/gallery.uri -/opt/share/applications/org.tizen.gallery.desktop - - -%files -n libug-gallery-efl -f ug-gallery-efl.lang -%{_ugdir}/res/images/gallery-efl/images/* -%{_ugdir}/res/edje/gallery-efl/gallery-efl.edj -%{_ugdir}/lib/libug-gallery-efl.so.0.0.1 -%{_ugdir}/lib/libug-gallery-efl.so +/opt/share/packages/* +/opt/share/miregex/* + +%files -n ug-gallery-efl +%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 +/opt/share/packages/*.xml diff --git a/res/edc/gallery-edc-res.h b/res/edc/gallery-edc-res.h deleted file mode 100755 index a56bd71..0000000 --- a/res/edc/gallery-edc-res.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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_GRID_EDIT_TEXT_BG "00_grid_edit_text_bg.png" -#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" -/* Fixme: Use custom image, replace it if better image provided by UX */ -#define GALLERY_EDC_IMAGE_THUMBS_BG "T01_thumbs_bg.png" - -/* gl-genlist-item-video.edc */ -#define GALLERY_EDC_IMAGE_VIDEO_LIST_PROGRESS_BG "T01_video_list_progress_bg.png" -#define GALLERY_EDC_IMAGE_VIDEO_LIST_PROGRESS_BAR_RECT "T01_video_list_progress_bar.png" - -/* gl-navigationbar.edc */ -#define GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER "naviframe_optionheader.png" -#define GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW "naviframe_optionheader_arrow.png" - -/* gl-controlbar.edc */ -#define GALLERY_EDC_IMAGE_CONTROL_TOOLBAR_BG "T01_toolbar_bg.png" -#define GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG "T01_control_tabbar_bg.png" -#define GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG_LEFT "00_winset_control_tabbar_bg_left.png" -#define GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG_RIGHT "00_winset_control_tabbar_bg_right.png" -#define GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG_TOP "T01_control_tabbar_bg.png" -#define GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG_H_TOP "T01_control_tabbar_bg_h.png" -#define GALLERY_EDC_IMAGE_TABBAR_PRESS "00_winset_tabbar_press.png" -#define GALLERY_EDC_IMAGE_TABBAR_PRESS_LEFT "00_winset_tabbar_press_left.png" -#define GALLERY_EDC_IMAGE_TABBAR_PRESS_RIGHT "00_winset_tabbar_press_right.png" -#define GALLERY_EDC_IMAGE_TABBAR_PRESS_TOP "00_winset_tabbar_press_top.png" -#define GALLERY_EDC_IMAGE_TOOLBAR_PRESS "T01_toolbar_press.png" -#define GALLERY_EDC_IMAGE_TABBAR_FOCUS "T01_tabbar_focus.png" -#define GALLERY_EDC_IMAGE_TABBAR_FOCUS_LEFT "00_winset_tabbar_focus_left.png" -#define GALLERY_EDC_IMAGE_TABBAR_FOCUS_RIGHT "00_winset_tabbar_focus_right.png" - -/* gl-button.edc */ -#define GALLERY_EDC_IMAGE_OPTION_HEADER_BT "T01_Option_header_bt.png" -#define GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM "T01_Option_header_bt_press.png"//"T01_Option_header_bt_dim.png"//Fixme: use right image -#define GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS "T01_Option_header_bt_press.png" -#define GALLERY_EDC_IMAGE_BTN_PREV "00_winset_Back_btn_normal.png" -#define GALLERY_EDC_IMAGE_BTN_PREV_PRESS "00_winset_Back_btn_press.png" -#define GALLERY_EDC_IMAGE_PREV "00_winset_Back.png" -#define GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_NORMAL "T01_button_circle_bg_normal.png" -#define GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_PRESS "T01_button_circle_bg_normal_press.png" -#define GALLERY_EDC_IMAGE_BUTTON_RENAME "T01_button_rename.png" -#define GALLERY_EDC_IMAGE_BUTTON_RENAME_PRESS "00_button_rename_press.png" -#define GALLERY_EDC_IMAGE_BUTTON_POPUP_NORMAL "00_button_popup_normal.png" -#define GALLERY_EDC_IMAGE_BUTTON_POPUP_PRESS "00_button_popup_press.png" -#define GALLERY_EDC_IMAGE_BUTTON_POPUP_FOCUS "00_button_popup_focus.png" -#define GALLERY_EDC_IMAGE_BUTTON_POPUP_DIM "00_button_popup_dim.png" -#define GALLERY_EDC_IMAGE_BTN_04_NORMAL "00_button_04_normal.png" -#define GALLERY_EDC_IMAGE_BTN_04_PRESS "00_button_04_press.png" -#define GALLERY_EDC_IMAGE_BTN_04_DIM "00_button_04_dim.png" -#define GALLERY_EDC_IMAGE_BTN_TITLE "T01_title_btn.png" -#define GALLERY_EDC_IMAGE_BTN_TITLE_PRESS "T01_title_btn_press.png" -#define GALLERY_EDC_IMAGE_BTN_01_NORMAL "T01_title_btn.png" -#define GALLERY_EDC_IMAGE_BTN_01_PRESS "T01_title_btn_press.png" -#define GALLERY_EDC_IMAGE_BTN_01_DIM "T01_title_btn_press.png" -#define GALLERY_EDC_IMAGE_BTN_SWEEP "00_button_sweep.png" -#define GALLERY_EDC_IMAGE_BTN_SWEEP_PRESS "00_button_sweep_press.png" -#define GALLERY_EDC_IMAGE_BTN_SWEEP_DIM "00_button_sweep_dim.png" -#define GALLERY_EDC_IMAGE_BTN_GRIDVIEW "T01_btn_gridview.png" -#define GALLERY_EDC_IMAGE_BTN_GRIDVIEW_PRESS "T01_btn_gridview_press.png" - -/* gl-segment.edc */ -#define GALLERY_EDC_IMAGE_BTN_SGE_NORMAL "00_winset_btn_sge_normal.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_LEFT "00_winset_btn_sge_normal_left.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_CENTRE "00_winset_btn_sge_normal_centre.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_RIGHT "00_winset_btn_sge_normal_right.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_PRESS_NORMAL "00_winset_btn_sge_press_normal.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_PRESS_01 "00_winset_btn_sge_press_01.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_PRESS_02 "00_winset_btn_sge_press_02.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_PRESS_03 "00_winset_btn_sge_press_03.png" -#define GALLERY_EDC_IMAGE_BTN_SGE_BODY "00_winset_btn_sge_body.png" - -/* gl-entry.edc */ -#define GALLERY_EDC_IMAGE_READER_HANDLER_UP "reader_handler_up.png" -#define GALLERY_EDC_IMAGE_READER_HANDLER_DOWN "reader_handler_down.png" -#define GALLERY_EDC_IMAGE_LONGTAP_BLUE "reader_longtap_blue.png" -#define GALLERY_EDC_IMAGE_MAGNIFIER_NOARROW "magnifier_noarrow.png" -#define GALLERY_EDC_IMAGE_MAGNIFIER_NOARROW_LINE "magnifier_noarrow_line.png" -#define GALLERY_EDC_IMAGE_MAGNIFIER "magnifier.png" -#define GALLERY_EDC_IMAGE_MAGNIFIER_LINE "magnifier_line.png" -#define GALLERY_EDC_IMAGE_MSGBUBBLE_RECEIVE "00_MessageBubble_BG_receive.png" -#define GALLERY_EDC_IMAGE_MSGBUBBLE_SEND "00_MessageBubble_BG_send.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT "copy&paste_Icon_right.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_PRESS "copy&paste_Icon_right_press.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_LEFT "copy&paste_Icon_left.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_PRESS "copy&paste_Icon_left_press.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_TOP "copy&paste_Icon_left_top.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_TOP_PRESS "copy&paste_Icon_left_top_press.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_TOP "copy&paste_Icon_right_top.png" -#define GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_TOP_PRESS "copy&paste_Icon_right_top_press.png" -#define GALLERY_EDC_IMAGE_BT_SM_BASE2 "bt_sm_base2.png" - -/* gl-editfield.edc */ -#define GALLERY_EDC_IMAGE_FIELD_BTN_DELETE "T01_EditField_clear.png" - -/* gl-check.edc */ -#define GALLERY_EDC_IMAGE_CHECK_BG "T01_checkbox.png" -#define GALLERY_EDC_IMAGE_CHECK_ALBUM_BG "T01_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_check.png" -#define GALLERY_EDC_IMAGE_CHECK_GRID "T01_grid_select_check.png" - -/* gl-toolbar.edc */ -#define GALLERY_EDC_IMAGE_SEPARATOR_V "separator_v.png" diff --git a/res/edc/gl-black-theme.edc b/res/edc/gl-black-theme.edc deleted file mode 100755 index 0b30b67..0000000 --- a/res/edc/gl-black-theme.edc +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 INDICATOR_H 27 -#define NAVI_H 67 - -#include "gallery-edc-res.h" - -collections { -#include "gl-naviframe.edc" -#include "gl-toolbar.edc" -} - diff --git a/res/edc/gl-button.edc b/res/edc/gl-button.edc deleted file mode 100755 index e37a614..0000000 --- a/res/edc/gl-button.edc +++ /dev/null @@ -1,3333 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 BUTTON_STATE_ENABLED 0 -#define BUTTON_STATE_DISABLED 1 - -#define BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC 106 106 106 255 -#define BUTTON_TEXT_STYLE1_TEXT_DISABLED_COLOR_INC 180 180 1 255 - -#define BUTTON_TEXT_NAVIFRAME_NORMAL_COLOR_INC 211 211 211 255 -#define BUTTON_TEXT_NAVIFRAME_PRESSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_NAVIFRAME_FOCUSED_COLOR_INC 249 249 249 255 -#define BUTTON_TEXT_NAVIFRAME_DISABLED_COLOR_INC 193 193 193 255 - -#define BUTTON_POPUP_BUTTON_TEXT_NORMAL_COLOR_INC 255 255 255 255 -#define BUTTON_POPUP_BUTTON_TEXT_PRESSED_COLOR_INC 255 255 255 255 -#define BUTTON_POPUP_BUTTON_TEXT_FOCUSED_COLOR_INC 255 255 255 255 -#define BUTTON_POPUP_BUTTON_TEXT_DISABLED_COLOR_INC 204 200 188 255 - -#define BUTTON_SWEEP_BUTTON_TEXT_NORMAL_COLOR_INC 249 249 249 255 -#define BUTTON_SWEEP_BUTTON_TEXT_PRESSED_COLOR_INC 249 249 249 255 -#define BUTTON_SWEEP_BUTTON_TEXT_FOCUSED_COLOR_INC 249 249 249 255 -#define BUTTON_SWEEP_BUTTON_TEXT_DISABLED_COLOR_INC 108 115 118 255 - -#define BUTTON_TEXT_STYLE1_BG_MIN_INC 100 74 -#define BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC 148 74 -#define BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC 74 74 -#define BUTTON_TEXT_STYLE1_BG_BORDER_INC 5 5 5 5 -#define BUTTON_TEXT_STYLE1_PADDING_MIN_INC 20 5 -#define BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0 -#define BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_STYLE1_FONT_SIZE_INC 32 - -#define BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC 64 64 -#define BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC 64 64 -#define BUTTON_CIRCLE_STYLE_CONTENT_MIN_MAX_INC 35 35 - -#define BUTTON_POPUP_BG_NORMAL_MIN_INC 30 74 -#define BUTTON_POPUP_BG_BORDER_INC 5 5 5 5 -#define BUTTON_POPUP_PADDING_MIN_INC 8 5 -#define BUTTON_POPUP_PADDING_ICON_TEXT_VISIBLE_MIN_INC 8 0 -#define BUTTON_POPUP_ICON_ICONONLY_MIN_INC 38 38 -#define BUTTON_POPUP_TEXT_MIN_INC 64 20 -#define BUTTON_POPUP_TEXT_FONT_SIZE_INC 32 - -#define BUTTON_EDIT_STYLE_BG_NORMAL_MIN_MAX_INC 74 74 -#define BUTTON_EDIT_STYLE_IMAGE_NORMAL_MIN_MAX_INC 74 74 -#define BUTTON_EDIT_STYLE_BORDER_INC 8 0 5 5 - -#define BUTTON_SWEEP_BG_NORMAL_MIN_INC 12 60 -#define BUTTON_SWEEP_BG_BORDER_INC 5 5 5 5 -#define BUTTON_SWEEP_PADDING_MIN_INC 5 5 -#define BUTTON_SWEEP_ICON_RECT_MIN_INC 0 28 -#define BUTTON_SWEEP_PADDING_ICON_TEXT_VISIBLE_MIN_INC 5 0 -#define BUTTON_SWEEP_ICONONLY_ICON_MIN_INC 28 28 -#define BUTTON_SWEEP_TEXT_MIN_INC 90 28 -#define BUTTON_SWEEP_FONT_SIZE_INC 32 - -#define BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC 106 74 -#define BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC 5 5 5 5 -#define BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC 56 56 - -#define BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC 249 249 249 255 -#define BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC 249 249 249 255 - -#define BUTTON_NAVIFRAME_CENTER_BG_NORMAL_MIN_INC 22 46 -#define BUTTON_NAVIFRAME_CENTER_BG_NORMAL_BORDER_INC 4 4 4 4 -#define BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC 16 2 -#define BUTTON_NAVIFRAME_CENTER_ICON_RECT_VISIBLE_MIN_SIZE 36 36 -#define BUTTON_NAVIFRAME_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC 6 0 -#define BUTTON_NAVIFRAME_CENTER_PADDING_BEFORE_TEXT_DEFAULT_MIN_INC 6 0 -#define BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC 36 36 -#define BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC 38 38 -#define BUTTON_NAVIFRAME_CENTER_TEXT_FONT_SIZE_INC 32 -#define BUTTON_NAVIFRAME_MULTILINE_TEXT_FONT_SIZE_INC 24 - -#define BUTTON_NAVIFRAME_BG_MIN_INC 124 74 -#define BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC 124 74 -#define BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC 74 74 -#define BUTTON_NAVIFRAME_BG_BORDER_INC 5 5 5 5 -#define BUTTON_NAVIFRAME_PADDING_MIN_INC 5 5 -#define BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38 -#define BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0 -#define BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC 38 38 -#define BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC 38 38 -#define BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC 28 -#define BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC 124 74 - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/style1"; - alias: "elm/button/base/text_only/style1"; - alias: "elm/button/base/center"; - alias: "elm/button/base/icon_and_text/center"; - alias: "elm/button/base/nocontents/search_button"; - images { - image: GALLERY_EDC_IMAGE_BTN_01_NORMAL COMP; - image: GALLERY_EDC_IMAGE_BTN_01_PRESS COMP; - image: GALLERY_EDC_IMAGE_BTN_01_DIM COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - image { - normal: GALLERY_EDC_IMAGE_BTN_01_NORMAL; - border: BUTTON_TEXT_STYLE1_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_01_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_01_DIM; - //image.normal: GALLERY_EDC_IMAGE_BTN_01_NORMAL; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_01_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: BUTTON_TEXT_STYLE1_BG_MIN_INC; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - min: BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - min: 0 0; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "visible" 0.0; - visible: 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC; - max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_after_icon"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 0 0; - visible: 0; - } - description { state: "visible" 0.0; - visible: 0; - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC; - max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - } - description { state: "icononly" 0.0; - min: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC; - max: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC; - text { - font: "HelveticaNeue:style=Medium"; - size: BUTTON_TEXT_STYLE1_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC; - visible: 1; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "disabled_visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_after_icon"; - target: "icon_rect"; - target: "bg"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - program { name: "focused"; - //signal: "elm,action,focus"; - //source: "elm"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - //signal: "elm,action,unfocus"; - //source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/sweep/gallery"; - alias: "elm/button/base/sweep"; - alias: "elm/button/base/text_only/sweep"; - alias: "elm/button/base/searchbar/default"; - images { - image: GALLERY_EDC_IMAGE_BTN_SWEEP COMP; - image: GALLERY_EDC_IMAGE_BTN_SWEEP_PRESS COMP;//focus image is missing, so using press - image: GALLERY_EDC_IMAGE_BTN_SWEEP_DIM COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_SWEEP_BG_NORMAL_MIN_INC; - image { - normal: GALLERY_EDC_IMAGE_BTN_SWEEP; - border: BUTTON_SWEEP_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_SWEEP_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_SWEEP_DIM; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_SWEEP_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_SWEEP_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_SWEEP_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: BUTTON_SWEEP_ICON_RECT_MIN_INC; - fixed: 1 0; - rel1 { - relative: 0.0 1.0; - to_x: "elm.swallow.content"; - to_y: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "elm.swallow.content"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - color: 0 0 0 0; - } - } - part { name: "padding_icon_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 0 0; - color: 0 0 0 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - description { state: "visible" 0.0; //when icon is visible - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: BUTTON_SWEEP_PADDING_ICON_TEXT_VISIBLE_MIN_INC; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - min: BUTTON_SWEEP_ICONONLY_ICON_MIN_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_icon_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_SWEEP_BUTTON_TEXT_NORMAL_COLOR_INC; - text { - font: "HelveticaNeue:style=Medium"; - size: BUTTON_SWEEP_FONT_SIZE_INC; - min: 0 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - min: BUTTON_SWEEP_TEXT_MIN_INC; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_SWEEP_BUTTON_TEXT_PRESSED_COLOR_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: BUTTON_SWEEP_BUTTON_TEXT_DISABLED_COLOR_INC; - visible: 1; - min: BUTTON_SWEEP_TEXT_MIN_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_SWEEP_BUTTON_TEXT_FOCUSED_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "disabled_visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_icon_text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - program { name: "focused"; - //signal: "elm,action,focus"; - //source: "elm"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - //signal: "elm,action,unfocus"; - //source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/popup_button/default"; - alias: "elm/button/base/popup_button/gallery/menustyle"; - alias: "elm/button/base/popup_button/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_BUTTON_POPUP_NORMAL COMP; - image: GALLERY_EDC_IMAGE_BUTTON_POPUP_PRESS COMP; - image: GALLERY_EDC_IMAGE_BUTTON_POPUP_FOCUS COMP; - image: GALLERY_EDC_IMAGE_BUTTON_POPUP_DIM COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_POPUP_BG_NORMAL_MIN_INC; - image { - normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_NORMAL; - border: BUTTON_POPUP_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image { - normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_PRESS; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_DIM; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_FOCUS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2 { - relative: 0.0 0.0; - } - min: BUTTON_POPUP_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - align: 1.0 0.0; - rel1 { - relative: 1.0 1.0; - } - min: BUTTON_POPUP_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "padding_icon_text"; - type: RECT; - scale: 1; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "elm.swallow.content"; - } - rel2 { - to: "elm.swallow.content"; - } - fixed: 1 0; - min: 0 0; - visible: 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - description { state: "visible" 0.0; //when icon is visible - inherit: "default" 0.0; - min: BUTTON_POPUP_PADDING_ICON_TEXT_VISIBLE_MIN_INC; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - fixed: 1 0; - visible: 1; - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - visible: 1; - min: BUTTON_POPUP_ICON_ICONONLY_MIN_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_icon_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_POPUP_BUTTON_TEXT_NORMAL_COLOR_INC; - text { - font: "Helvetica Neue:style=Medium"; - size: BUTTON_POPUP_TEXT_FONT_SIZE_INC; - min: 0 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - min: BUTTON_POPUP_TEXT_MIN_INC; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_POPUP_BUTTON_TEXT_PRESSED_COLOR_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: BUTTON_POPUP_BUTTON_TEXT_DISABLED_COLOR_INC; - visible: 1; - min: BUTTON_POPUP_TEXT_MIN_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_POPUP_BUTTON_TEXT_FOCUSED_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "disabled_visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_icon_text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - program { name: "focused"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////////////// -#define BUTTON_CIRCLE_STYLES(style_name, image_normal, image_press, min_width, min_height) \ - group { name: "elm/button/base/"style_name; \ - images { \ - image: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_NORMAL COMP; \ - image: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_PRESS COMP; \ - image: image_normal COMP; \ - image: image_press COMP; \ - } \ - parts { \ - part { name: "button_image"; \ - scale: 1; \ - description { state: "default" 0.0; \ - min: BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC; \ - max: BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC; \ - image.normal: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_NORMAL; \ - color: 255 255 255 255; \ - } \ - description { \ - state: "clicked" 0.0; \ - inherit: "default" 0.0; \ - image.normal: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_PRESS; \ - } \ - description { \ - state: "disabled" 0.0; \ - inherit: "default" 0.0; \ - color: 255 255 255 128; \ - } \ - } \ - part { name: "button_center_part"; \ - scale: 1; \ - description { state: "default" 0.0; \ - min: BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC; \ - max: BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC; \ - image.normal: image_normal; \ - color: 255 255 255 255; \ - } \ - description { \ - state: "clicked" 0.0; \ - inherit: "default" 0.0; \ - image.normal: image_press; \ - } \ - description { \ - state: "disabled" 0.0; \ - inherit: "default" 0.0; \ - color: 255 255 255 128; \ - } \ - } \ - part { name: "over1"; \ - type: RECT; \ - ignore_flags: ON_HOLD; \ - description { state: "default" 0.0; \ - color: 0 0 0 0; \ - min: min_width min_height; \ - } \ - } \ - part { name: "over2"; \ - 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: "button_click"; \ - signal: "mouse,down,1"; \ - source: "over1"; \ - action: SIGNAL_EMIT "elm,action,press" ""; \ - after: "button_click_anim"; \ - } \ - program { name: "button_click_anim"; \ - action: STATE_SET "clicked" 0.0; \ - target: "button_image"; \ - target: "button_center_part"; \ - } \ - program { name: "button_unclick"; \ - signal: "mouse,up,1"; \ - source: "over2"; \ - action: SIGNAL_EMIT "elm,action,unpress" ""; \ - after: "button_unclick_anim"; \ - } \ - program { name: "button_unclick_anim"; \ - action: STATE_SET "default" 0.0; \ - target: "button_image"; \ - target: "button_center_part"; \ - } \ - program { name: "button_unclick2"; \ - signal: "mouse,clicked,1"; \ - source: "over1"; \ - action: SIGNAL_EMIT "elm,action,click" ""; \ - } \ - program { name: "disable"; \ - signal: "elm,state,disabled"; \ - source: "elm"; \ - action: STATE_SET "disabled" 0.0; \ - target: "disabler"; \ - target: "button_image"; \ - target: "button_center_part"; \ - } \ - program { name: "enable"; \ - signal: "elm,state,enabled"; \ - source: "elm"; \ - action: STATE_SET "default" 0.0; \ - target: "disabler"; \ - target: "button_image"; \ - target: "button_center_part"; \ - } \ - } \ - } - -/////////////////////////////////////////////////////////////////////////////////////// - BUTTON_CIRCLE_STYLES("gallery/rename", GALLERY_EDC_IMAGE_BUTTON_RENAME, GALLERY_EDC_IMAGE_BUTTON_RENAME_PRESS, 40, 40) - - group { name: "elm/button/base/multiline/gallery"; - alias: "elm/button/base/multiline"; - alias: "elm/button/base/text_only/multiline"; - images { - image: GALLERY_EDC_IMAGE_BTN_04_NORMAL COMP; - image: GALLERY_EDC_IMAGE_BTN_04_PRESS COMP; -// image: GALLERY_EDC_IMAGE_BTN_04_DIM COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - styles{ - style { name: "btn_multiline_style"; - base: "font=HelveticaNeue:style=Medium font_size=18 align=center color=#ffffff wrap=mixed"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - } - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: 10 46; - image { - normal: GALLERY_EDC_IMAGE_BTN_04_NORMAL; - border: 4 4 3 3; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_04_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - //image.normal: GALLERY_EDC_IMAGE_BTN_04_DIM; - image.normal: GALLERY_EDC_IMAGE_BTN_04_NORMAL; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_04_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: 2 2; - fixed: 1 1; - visible: 0; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: 2 2; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 1; - min: 0 40; - fixed: 1 0; - rel1 { - relative: 0.0 1.0; - to_x: "elm.swallow.content"; - to_y: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "elm.swallow.content"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - color: 0 0 0 0; - } - } - part { name: "padding_icon_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 0 0; - color: 0 0 0 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - description { state: "visible" 0.0; //when icon is visible - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 5 0; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - min: 40 40; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_icon_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC; - text { - style: "btn_multiline_style"; - min: 0 0; - max: 0 1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 80 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: BUTTON_TEXT_STYLE1_TEXT_DISABLED_COLOR_INC; - visible: 1; - min: 80 0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "disabled_visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_icon_text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - program { name: "focused"; - //signal: "elm,action,focus"; - //source: "elm"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - //signal: "elm,action,unfocus"; - //source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - - /////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/naviframe/back_btn/gallery"; - alias: "elm/button/base/naviframe/back_btn/default"; - alias: "elm/button/base/naviframe/prev_btn/default"; - alias: "elm/button/base/naviframe/end_btn/default"; - images { - image: GALLERY_EDC_IMAGE_BTN_PREV COMP; - image: GALLERY_EDC_IMAGE_BTN_PREV_PRESS COMP; - image: GALLERY_EDC_IMAGE_PREV COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC; - image { - normal: GALLERY_EDC_IMAGE_BTN_PREV; - border: BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_PREV_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_PREV_PRESS; - } - } - part { name: "back_button"; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC; - rel1.to: "button_image"; - rel2.to: "button_image"; - image.normal: GALLERY_EDC_IMAGE_PREV; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - after: "disable_button"; - } - program { name: "disable_button"; - script { - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - after: "enable_button"; - } - program { name: "enable_button"; - script { - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - } - } - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/naviframe_control/gallery"; - alias: "elm/button/base/naviframe_control/default"; - alias: "elm/button/base/naviframe_control/center"; - script { - public button_state = BUTTON_STATE_ENABLED; - } - images { - image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT COMP; - image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM COMP; - image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS COMP; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_MIN_INC; - color: 0 0 0 0; - rel1.offset: 0 0; - rel2.offset: -1 -1; - image { - normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT; - border: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_BORDER_INC; - } - color: 255 255 255 255; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - min: BUTTON_NAVIFRAME_CENTER_ICON_RECT_VISIBLE_MIN_SIZE; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - color: 0 0 0 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_after_icon"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 0 0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: BUTTON_NAVIFRAME_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC; - color: 0 0 0 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - min: BUTTON_NAVIFRAME_CENTER_PADDING_BEFORE_TEXT_DEFAULT_MIN_INC; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - min: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - min: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; - text { - font: "Helvetica Neue:style=Medium"; - size: BUTTON_NAVIFRAME_CENTER_TEXT_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "disabled" 0.0; - color: 255 255 255 127; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - } - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "icon_rect"; - target: "padding_after_icon"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "clipper"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - set_int(button_state, BUTTON_STATE_DISABLED); - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "clicked") || !strcmp(st, "focused")) - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "clipper"; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - set_int(button_state, BUTTON_STATE_ENABLED); - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "clicked") || !strcmp(st, "focused")) - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "focused"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/naviframe_control/multiline/gallery"; - alias: "elm/button/base/naviframe_control/multiline"; - - script { - public button_state = BUTTON_STATE_ENABLED; - } - images { - image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT COMP; - image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM COMP; - image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS COMP; - } - styles{ - style { name: "btn_multiline_naviframe_controlbar_style"; - base: "font=Helvetica Neue:style=Medium font_size="BUTTON_NAVIFRAME_MULTILINE_TEXT_FONT_SIZE_INC" align=center color=#ffffff wrap=mixed"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - } - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_MIN_INC; - rel1.offset: 0 0; - rel2.offset: -1 -1; - image { - normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT; - border: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_BORDER_INC; - } - color: 255 255 255 255; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - min: 0 0; - fixed: 1 0; - rel1 { - relative: 0.0 1.0; - to_x: "elm.swallow.content"; - to_y: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "elm.swallow.content"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - } - part { name: "padding_icon_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - visible: 0; - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2 { - relative: 1.0 1.0; - to: "icon_rect"; - } - fixed: 1 0; - min: 0 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: BUTTON_NAVIFRAME_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2 { - relative: 1.0 1.0; - to: "icon_rect"; - } - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - min: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - } - description { state: "icononly" 0.0; - min: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_icon_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; - text { - style: "btn_multiline_naviframe_controlbar_style"; - min: 0 0; - max: 0 1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 80 0; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - min: 0 0; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "disabled" 0.0; - color: 255 255 255 127; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_icon_text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "clipper"; - target: "disabler"; - after: "disable_text"; - } - program { name: "disable_text"; - script { - new st[31]; - new Float:vl; - set_int(button_state, BUTTON_STATE_DISABLED); - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "clicked") || !strcmp(st, "focused")) - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "clipper"; - target: "disabler"; - after: "enable_text"; - } - program { name: "enable_text"; - script { - new st[31]; - new Float:vl; - set_int(button_state, BUTTON_STATE_ENABLED); - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "clicked") || !strcmp(st, "focused")) - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "focused"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - -/////////////////////////////////////////////////////////////////////////////////////// - group { name: "elm/button/base/naviframe/title/gallery"; - alias: "elm/button/base/naviframe/title/default"; - - images { - image: GALLERY_EDC_IMAGE_BTN_TITLE COMP; - image: GALLERY_EDC_IMAGE_BTN_TITLE_PRESS COMP; - } - script { - public button_state = BUTTON_STATE_ENABLED; - } - parts { - part { name: "button_image"; - scale: 1; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC; - max: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC; - image { - normal: GALLERY_EDC_IMAGE_BTN_TITLE; - border: BUTTON_NAVIFRAME_BG_BORDER_INC; - border_scale: 1; - } - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_TITLE_PRESS; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_BTN_TITLE_PRESS; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: BUTTON_NAVIFRAME_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: BUTTON_NAVIFRAME_BG_MIN_INC; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - min: BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: BUTTON_NAVIFRAME_PADDING_MIN_INC; - fixed: 1 1; - visible: 0; - } - } - part { name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - min: 0 0; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "visible" 0.0; - visible: 0; - min: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC; - fixed: 1 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_after_icon"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: 0 0; - visible: 0; - } - description { state: "visible" 0.0; - visible: 0; - align: 0.0 0.0; - rel1 { - relative: 1.0 0.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 1 0; - min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - min: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - } - description { state: "icononly" 0.0; - min: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC; - max: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - clip_to: "clipper"; - description { state: "default" 0.0; - visible: 0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_TEXT_NAVIFRAME_NORMAL_COLOR_INC; - text { - font: "HelveticaNeue:style=Medium"; - size: BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_NAVIFRAME_PRESSED_COLOR_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - } - description { state: "disabled_visible" 0.0; - inherit: "default" 0.0; - color: BUTTON_TEXT_NAVIFRAME_DISABLED_COLOR_INC; - visible: 1; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_TEXT_NAVIFRAME_FOCUSED_COLOR_INC; - } - } - part { name: "over2"; - type: RECT; - repeat_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "over3"; - type: RECT; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - } - 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: "button_click"; - signal: "mouse,down,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,press" ""; - after: "button_click_anim"; - } - program { name: "button_click_anim"; - action: STATE_SET "clicked" 0.0; - target: "button_image"; - after: "text_clicked"; - } - program { name: "text_clicked"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - set_state(PART:"elm.text", "clicked", 0.0); - } - } - program { name: "button_unpress"; - action: SIGNAL_EMIT "elm,action,unpress" ""; - } - program { name: "button_mouseout_clicked"; - signal: "mouse,up,1"; - source: "over3"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (strcmp(st, "icononly")) - { - emit("elm,action,default,text,set", ""); - set_state(PART:"elm.text", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"button_image", "default", 0.0); - } - after: button_unpress; - } - program { name: "button_unclick3"; - signal: "mouse,clicked,1"; - source: "over2"; - action: SIGNAL_EMIT "elm,action,click" ""; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - if (get_int(button_state) != BUTTON_STATE_DISABLED) - set_state(PART:"elm.text", "visible", 0.0); - else - set_state(PART:"elm.text", "disabled_visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.content", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.content", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - set_state(PART:"bg", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.content", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - set_state(PART:"bg", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.content"; - target: "padding_after_icon"; - target: "icon_rect"; - target: "bg"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - target: "disabler"; - 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); - set_int(button_state, BUTTON_STATE_ENABLED); - } - } - program { name: "focused"; - //signal: "elm,action,focus"; - //source: "elm"; - action: STATE_SET "focused" 0.0; - target: "button_image"; - target: "elm.text"; - } - program { name: "unfocused"; - //signal: "elm,action,unfocus"; - //source: "elm"; - action: STATE_SET "default" 0.0; - target: "button_image"; - after: "unfocus_text"; - } - program { name: "unfocus_text"; - action: STATE_SET "visible" 0.0; - target: "elm.text"; - } - } - } - -#undef BUTTON_STATE_ENABLED -#undef BUTTON_STATE_DISABLED - diff --git a/res/edc/gl-editfield.edc b/res/edc/gl-editfield.edc deleted file mode 100755 index 37d6bc4..0000000 --- a/res/edc/gl-editfield.edc +++ /dev/null @@ -1,318 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ENTRY_TEXT_SIZE_INC 44 - -#define EDITFIELD_GUIDE_TEXT_COLOR_INC 189 189 189 255 // 70 70 70 255 -#define EDITFIELD_DEFAULT_ERASER_MINW_INC 48 -#define EDITFIELD_DEFAULT_ERASER_MINH_INC 48 -#define EDITFIELD_DEFAULT_MINH_INC 112 -#define EDITFIELD_DEFAULT_TOP1_SINGLE_INC 20 -#define EDITFIELD_DEFAULT_TOP2_INC 6 -#define EDITFIELD_DEFAULT_LEFT1_INC 0 -#define EDITFIELD_DEFAULT_LEFT2_INC 0 -#define EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 56 -#define EDITFIELD_DEFAULT_RIGHT2_INC 0 -#define EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC 20 -#define EDITFIELD_DEFAULT_BOTTOM2_SINGLE_INC 32 -#define EDITFIELD_DEFAULT_BOTTOM3_SINGLE_INC 85 - - -group { name: "elm/layout/editfield/gallery"; - images { - image: GALLERY_EDC_IMAGE_FIELD_BTN_DELETE COMP; - } - parts { - part { - name: "base"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - min: 0 EDITFIELD_DEFAULT_MINH_INC; - color: 0 0 0 0; - } - } - part { - name: "top1"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: 0 EDITFIELD_DEFAULT_TOP1_SINGLE_INC; - fixed: 1 1; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 0.0; - align: 0.5 0; - } - } - part { - name: "top2"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: 0 EDITFIELD_DEFAULT_TOP2_INC; - fixed: 1 1; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 0.0; - align: 0.5 0; - } - } - part { - name: "left1"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: EDITFIELD_DEFAULT_LEFT1_INC 0; - fixed: 1 1; - align: 0 0; - rel1.relative : 0.0 0.0; - rel2.relative : 0.0 1.0; - } - } - part { - name: "left2"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: EDITFIELD_DEFAULT_LEFT2_INC 0; - fixed: 1 1; - align: 0 0; - rel1.relative : 0.0 0.0; - rel2.relative : 0.0 1.0; - } - } - part { - name: "right1"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: EDITFIELD_DEFAULT_RIGHT1_ERASER_SHOW_INC 0; - fixed: 1 1; - align: 1 0; - rel1.relative : 1.0 0.0; - rel2.relative : 1.0 1.0; - } - } - part { - name: "right2"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: EDITFIELD_DEFAULT_RIGHT2_INC 0; - fixed: 1 1; - align: 1 0; - rel1.relative : 1.0 0.0; - rel2.relative : 1.0 1.0; - } - } - part { - name: "bottom1"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: 0 EDITFIELD_DEFAULT_BOTTOM1_SINGLE_INC; - fixed: 1 1; - align: 0 1; - rel1.relative: 0.0 1.0; - } - } - part { - name: "bottom2"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: 0 EDITFIELD_DEFAULT_BOTTOM2_SINGLE_INC; - fixed: 0 1; - rel1.relative: 0.0 1.0; - align: 0 1; - } - } - part { - name: "bottom3"; - type: RECT; - scale: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - min: 0 EDITFIELD_DEFAULT_BOTTOM3_SINGLE_INC; - fixed: 0 1; - rel1.relative: 0.0 1.0; - align: 0 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; - } - } - 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_DEFAULT_ERASER_MINW_INC EDITFIELD_DEFAULT_ERASER_MINH_INC; - fixed: 1 1; - align: 1 1; - rel1 { - relative: 0.0 0.0; - to_x : "right2"; - to_y : "bottom2"; - } - rel2 { - relative: 0.0 0.0; - to_x : "right2"; - to_y : "bottom2"; - } - image { - normal: GALLERY_EDC_IMAGE_FIELD_BTN_DELETE; - border: 10 10 10 10; - border_scale: 1; - } - } - description { - state: "elm.eraser.show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "eraser"; - mouse_events: 1; - ignore_flags: ON_HOLD; - description { - state: "default" 0.0; - visible: 0; - color: 0 0 0 0; - rel1 { - relative: 0.0 0.0; - to_x : "eraser_image"; - to_y : "bottom3"; - } - } - 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: "eraser_clicked"; - signal: "mouse,clicked,1"; - source: "eraser"; - action: SIGNAL_EMIT "elm,eraser,clicked" "elm"; - } - } -} \ No newline at end of file diff --git a/res/edc/gl-entry.edc b/res/edc/gl-entry.edc deleted file mode 100755 index e4a3a58..0000000 --- a/res/edc/gl-entry.edc +++ /dev/null @@ -1,4374 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 ENTRY_BLOCK_HANDLE_SOURCE2 "elm/entry/selection/block_handle_right" -#define ENTRY_BLOCK_HANDLE_SOURCE3 "elm/entry/selection/block_handle_left" - -#define ENTRY_TEXT_SIZE_INC 44 -//bg color is black, font color is while -#define ENTRY_TEXT_COLOR_INC "#FFFFFF" -//bg color is white, font color is black -#define ENTRY_TEXT_COLOR_RENAME_INC "#000000" -//cursor color is BLUE -#define ENTRY_CURSOR_COLOR_INC 3 131 238 255 -//bg color is white, font color is black -#define ENTRY_PREEDIT_BACKGROUND_COLOR_INC "#000000" -#define ENTRY_PREEDIT_TEXT_COLOR_INC "#FFFFFF" -//bg color is black, font color is while -#define ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC "#FFFFFF" -#define ENTRY_PREEDIT_TEXT_COLOR_RENAME_INC "#000000" - -#define ENTRY_SELECTION_BG_COLOR 90 123 138 127 // 204 230 224 127 -#define ENTRY_SELECTION_BLOCK_HANDLE_MIN_SIZE 48 67 -#define MAGNIFIER_HEIGHT_FILL 182 -#define MAGNIFIER_HEIGHT_FIXED 108 -#define MAGNIFIER_WIDTH_FIXED 358 - -#define ENTRY_BUBBLE_EX_PAD 15 -#define ENTRY_BUBBLE_IX_PAD 22 -#define ENTRY_BUBBLE_Y_PAD 15 -#define ENTRY_BUBBLE_BOTTOM_PAD 22 -#define ENTRY_BUBBLE_CALLERID_PAD 16 -#define ENTRY_BUBBLE_CALLERID_WIDTH 60 -#define ENTRY_BUBBLE_CALLERID_HEIGHT 60 -#define ENTRY_BUBBLE_DATE_AREA_TEXT_SIZE_INC 26 - -#define GENLIST_PADDING_6_INC 6 -#define GENLIST_PADDING_34_INC 34 -#define GENLIST_PADDING_64_INC 64 -#define GENLIST_SIZE_64_INC 64 -#define GENLIST_PART_FONT_LIST_SUB_TEXT_COLOR_INC 129 129 129 255 -#define GENLIST_FONT_28_INC 44 - -group { name: "elm/entry/base/gallery"; - alias: "elm/entry/base-mixedwrap/gallery"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "entry_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" left_margin=1 right_margin=2 wrap=mixed text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - style { name: "entry_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 left_margin=1 right_margin=2 wrap=mixed text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-charwrap/default"; - alias: "elm/entry/base/char_wrap"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "entry_textblock_char_wrap_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - style { name: "entry_textblock_char_wrap_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_char_wrap_style"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_char_wrap_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - -group { name: "elm/entry/base-nowrap/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_textblock_style"; - min: 1 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base/editfield"; - alias: "elm/entry/base-mixedwrap/editfield"; - alias: "elm/entry/base/editfield/default"; - alias: "elm/entry/base/editfield/lighting"; - alias: "elm/entry/base/editfield/multiline"; - alias: "elm/entry/base/editfield/multiline/default"; - alias: "elm/entry/base/editfield/multiline/lighting"; - alias: "elm/entry/base/editfield/searchbar/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "editfield_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" wrap=mixed left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - style { name: "editfield_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=mixed left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "editfield_textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "editfield_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-charwrap/gallery"; - alias: "elm/entry/base/gallery/char_wrap"; - alias: "elm/entry/base/gallery/default/char_wrap"; - alias: "elm/entry/base/gallery/lighting/char_wrap"; - alias: "elm/entry/base/gallery/multiline/char_wrap"; - alias: "elm/entry/base/gallery/multiline/default/char_wrap"; - alias: "elm/entry/base/gallery/multiline/lighting/char_wrap"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "editfield_textblock_char_wrap_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - style { name: "editfield_textblock_char_wrap_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "editfield_textblock_char_wrap_style"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "editfield_textblock_char_wrap_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-single/gallery"; - alias: "elm/entry/base-single/gallery/default"; - alias: "elm/entry/base-single/gallery/lighting"; - alias: "elm/entry/base-single/gallery/singleline"; - alias: "elm/entry/base-single/gallery/singleline/default"; - alias: "elm/entry/base-single/gallery/singleline/lighting"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "editfield_single_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - style { name: "editfield_single_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "editfield_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "editfield_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-single/editfield/searchbar/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "editfield_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "editfield_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-nowrap/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_textblock_style"; - min: 1 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-single/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "entry_single_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - style { name: "entry_single_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link " "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_style"; - min: 1 1; - max: 0 0; - align: 0.0 0.5; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-single-noedit/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-noedit/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - - group { name: "elm/entry/base-noedit-charwrap/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "entry_textblock_style_charwrap"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style_charwrap"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/base-nowrap-noedit/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_textblock_style"; - min: 1 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/base-password/default"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PASSWORD; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_style"; - repch: "*"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - -group { name: "elm/entry/base-password/popup"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - styles - { - style { name: "entry_single_textblock_popup_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" align=center wrap=mixed ellipsis=1.0"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - style { name: "entry_single_textblock_disabled_popup_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 align=center wrap=mixed ellipsis=1.0"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PASSWORD; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "entry_single_textblock_popup_style"; - repch: "*"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_single_textblock_disabled_popup_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - - group { name: "elm/entry/cursor/default"; - parts { - part { name: "clip2"; - type: RECT; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - rel1.to: "clip"; - rel2.to: "clip"; - visible: 0; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "clip"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "clip2"; - description { state: "default" 0.0; - rel1.offset: -10 0; - rel2.offset: 9 9; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "base"; - mouse_events: 0; - scale: 1; - clip_to: "clip"; - description { state: "default" 0.0; - min: 2 2; - align: 0.5 1.0; - color: 0 0 0 0; - } - } - - part { name: "glow"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "clip2"; - description { state: "default" 0.0; - min: 3 0; - fixed: 1 0; - align: 0.5 0.5; - rel1 { - relative: 0.0 0.0; - offset: 0 2; - } - rel2 { - relative: 0.0 1.0; - offset: 0 -2; - } - color: ENTRY_CURSOR_COLOR_INC; - } - description { state: "hidden" 0.0; - inherit: "default" 0.0; - color: 0 0 0 0; - } - } - } - programs { - program { name: "show"; - action: STATE_SET "hidden" 0.0; - in: 0.6 0.0; - target: "glow"; - after: "show4"; - } - program { name: "show4"; - action: STATE_SET "default" 0.0; - in: 0.6 0.0; - target: "glow"; - after: "show"; - } - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "focused" 0.0; - target: "clip2"; - after: "show4"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "clip2"; - after: "stop_glow"; - } - program { name: "stop_glow"; - action: ACTION_STOP; - target: "show"; - target: "show4"; - } - } - } - - - group { name: "elm/entry/selection/default"; - parts { - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - color: ENTRY_SELECTION_BG_COLOR; - } - } - } - } - - group { name: "elm/entry/selection/block_handle"; - data.item: "position" "BOTH"; - images { - image: GALLERY_EDC_IMAGE_READER_HANDLER_UP COMP; - } - parts { - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.25; - min: 50 80; - color: 0 0 0 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "handle"; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.0; - min: 48 66; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 0.0 0.0; - offset: 0 0; - } - image { - normal: GALLERY_EDC_IMAGE_READER_HANDLER_UP; - border: 0 0 0 0; - } - image.middle: SOLID; - fill.smooth: 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "show" 0.0; - target: "handle"; - target: "bg"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "handle"; - target: "bg"; - } - } - } - - group { name: "elm/entry/selection/block_handle_top"; - data.item: "position" "BOTH"; - images { - image: GALLERY_EDC_IMAGE_READER_HANDLER_DOWN COMP; - } - parts { - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 0.75; - min: 50 80; - color: 0 0 0 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "handle"; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0.5 1.0; - min: 48 66; - rel1 { - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - relative: 0.0 0.0; - offset: 0 0; - } - image { - normal: GALLERY_EDC_IMAGE_READER_HANDLER_DOWN; - border: 0 0 0 0; - } - image.middle: SOLID; - fill.smooth: 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - action: STATE_SET "show" 0.0; - target: "handle"; - target: "bg"; - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "handle"; - target: "bg"; - } - } - } -///////////////////////////////////////////////////////////////////////// - group { name: "elm/entry/selection/block_handle_left"; - data.item: "position" "BOTTOM"; - data.item: "height" "40"; - images { - image: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT COMP; - image: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_PRESS COMP; - image: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_TOP COMP; - image: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_TOP_PRESS COMP; - } - parts { - part { name: "bg"; - type: RECT; - scale: 1; - mouse_events: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 1 0; - min: ENTRY_SELECTION_BLOCK_HANDLE_MIN_SIZE; - color: 0 0 0 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "handle"; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 1 0; - min: ENTRY_SELECTION_BLOCK_HANDLE_MIN_SIZE; - rel1 { - relative: 1.1 0.0; - offset: 0 -2; - to: "bg"; - } - rel2 { - relative: 1.1 0.0; - offset: 0 -2; - to: "bg"; - } - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT; - border: 0 0 0 0; - } - image.middle: SOLID; - fill.smooth: 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "top" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1 1; - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_TOP; - } - } - description { state: "press" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_PRESS; - } - } - description { state: "top_press" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 1 1; - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_LEFT_TOP_PRESS; - } - } - } - } - script { - public handler_ontop; - public handler_pressed; - public handler_focused; - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - script { - set_int(handler_focused, 1); - } - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - script { - set_int(handler_focused, 0); - set_state(PART:"handle", "default", 0.0); - } - } - program { name: "top"; - signal: "elm,state,top"; - source: "elm"; - script { - new pressed; - new focused; - pressed = get_int(handler_pressed); - focused = get_int(handler_focused); - set_int(handler_ontop, 1); - if (focused) - { - if (pressed) - set_state(PART:"handle", "top_press", 0.0); - else - set_state(PART:"handle", "top", 0.0); - } - else - { - set_state(PART:"handle", "default", 0.0); - } - } - } - program { name: "bottom"; - signal: "elm,state,bottom"; - source: "elm"; - script { - new pressed; - new focused; - pressed = get_int(handler_pressed); - focused = get_int(handler_focused); - set_int(handler_ontop, 0); - if (focused) - { - if (pressed) - set_state(PART:"handle", "press", 0.0); - else - set_state(PART:"handle", "show", 0.0); - } - else - { - set_state(PART:"handle", "default", 0.0); - } - } - } - program { name: "pressed"; - signal: "mouse,down,1"; - source: "handle"; - script { - new pos; - pos = get_int(handler_ontop); - set_int(handler_pressed, 1); - if (pos) - set_state(PART:"handle", "top_press", 0.0); - else - set_state(PART:"handle", "press", 0.0); - } - } - program { name: "unpressed"; - signal: "mouse,up,1"; - source: "handle"; - script { - new pos; - pos = get_int(handler_ontop); - set_int(handler_pressed, 0); - if (pos) - set_state(PART:"handle", "top", 0.0); - else - set_state(PART:"handle", "show", 0.0); - } - } - } - } - - group { name: "elm/entry/selection/block_handle_right"; - data.item: "position" "BOTH"; - data.item: "height" "40"; - images { - image: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT COMP; - image: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_PRESS COMP; - image: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_TOP COMP; - image: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_TOP_PRESS COMP; - } - parts { - part { name: "handle"; - mouse_events: 1; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - align: 0 0; - min: ENTRY_SELECTION_BLOCK_HANDLE_MIN_SIZE; - rel1 { - relative: 0.0 0.0; - offset: 0 -2; - } - rel2 { - relative: 0.0 0.0; - offset: 0 -2; - } - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT; - border: 0 0 0 0; - } - image.middle: SOLID; - fill.smooth: 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "top" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0 1; - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_TOP; - } - } - description { state: "press" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_PRESS; - } - } - description { state: "top_press" 0.0; - inherit: "default" 0.0; - visible: 1; - align: 0 1; - image { - normal: GALLERY_EDC_IMAGE_COPY_PASTE_RIGHT_TOP_PRESS; - } - } - } - } - script { - public handler_ontop; - public handler_pressed; - public handler_focused; - } - programs { - program { name: "focused"; - signal: "elm,action,focus"; - source: "elm"; - script { - set_int(handler_focused, 1); - } - } - program { name: "unfocused"; - signal: "elm,action,unfocus"; - source: "elm"; - script { - set_int(handler_focused, 0); - set_state(PART:"handle", "default", 0.0); - } - } - program { name: "top"; - signal: "elm,state,top"; - source: "elm"; - script { - new pressed; - new focused; - pressed = get_int(handler_pressed); - focused = get_int(handler_focused); - set_int(handler_ontop, 1); - if (focused) - { - if (pressed) - set_state(PART:"handle", "top_press", 0.0); - else - set_state(PART:"handle", "top", 0.0); - } - else - { - set_state(PART:"handle", "default", 0.0); - } - } - } - program { name: "bottom"; - signal: "elm,state,bottom"; - source: "elm"; - script { - new pressed; - new focused; - pressed = get_int(handler_pressed); - focused = get_int(handler_focused); - set_int(handler_ontop, 0); - if (focused) - { - if (pressed) - set_state(PART:"handle", "press", 0.0); - else - set_state(PART:"handle", "show", 0.0); - } - else - { - set_state(PART:"handle", "default", 0.0); - } - } - } - program { name: "pressed"; - signal: "mouse,down,1"; - source: "handle"; - script { - new pos; - pos = get_int(handler_ontop); - set_int(handler_pressed, 1); - if (pos) - set_state(PART:"handle", "top_press", 0.0); - else - set_state(PART:"handle", "press", 0.0); - } - } - program { name: "unpressed"; - signal: "mouse,up,1"; - source: "handle"; - script { - new pos; - pos = get_int(handler_ontop); - set_int(handler_pressed, 0); - if (pos) - set_state(PART:"handle", "top", 0.0); - else - set_state(PART:"handle", "show", 0.0); - } - } - } - } - - -///////////////////////////////////////////////////////////////////////// - - group { name: "elm/entry/selection/block_bar"; - images { - image: GALLERY_EDC_IMAGE_LONGTAP_BLUE COMP; - } - parts { - part { name: "bar_bg"; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - image { - normal: GALLERY_EDC_IMAGE_LONGTAP_BLUE; - border: 0 0 0 0; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - } - } - - - - group { name: "elm/entry/anchor/default"; - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 128 0 0 64; - } - } - } - } - - group { name: "elm/entry/preedit/default"; - parts { - part { name: "bg"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - color: 128 128 128 255; - } - } - } - } - - -#define MAGNIFIER_SCALE 1.2 - - group { name: "elm/entry/magnifier/fill-width"; - data.item: "height" MAGNIFIER_HEIGHT_FILL; - data.item: "scale" MAGNIFIER_SCALE; - images { - image: GALLERY_EDC_IMAGE_MAGNIFIER_NOARROW COMP; - image: GALLERY_EDC_IMAGE_MAGNIFIER_NOARROW_LINE COMP; - } - parts { - part { name: "bg"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.5 0.0; - rel1 { offset: -20 -10; } - rel2 { offset: 22 15; } - image { - normal: GALLERY_EDC_IMAGE_MAGNIFIER_NOARROW; - border: 25 25 35 25; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - part { name: "swallow"; - type: SWALLOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1 { - to: "bg"; - offset: 18 18; - } - rel2 { - to: "bg"; - offset: -20 -20; - } - } - } - part { name: "outline"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.0; - rel1 { to: "bg"; offset: 0 0; } - rel2 { to: "bg"; offset: -1 -1; } - image { - normal: GALLERY_EDC_IMAGE_MAGNIFIER_NOARROW_LINE; - border: 25 25 35 25; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - } - } - - - group { name: "elm/entry/magnifier/fixed-size"; - data.item: "height" MAGNIFIER_HEIGHT_FIXED; - data.item: "scale" MAGNIFIER_SCALE; - images { - image: GALLERY_EDC_IMAGE_MAGNIFIER COMP; - image: GALLERY_EDC_IMAGE_MAGNIFIER_LINE COMP; - } - parts { - part { name: "bg"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - min: MAGNIFIER_WIDTH_FIXED MAGNIFIER_HEIGHT_FIXED; - align: 0.5 0.0; - rel1.offset: 0 8; - image { - normal: GALLERY_EDC_IMAGE_MAGNIFIER; - border: 12 14 14 20; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - part { name: "swallow"; - type: SWALLOW; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.0 0.0; - rel1 { - to: "bg"; - offset: 12 14; - } - rel2 { - to: "bg"; - offset: -14 -20; - } - } - } - part { name: "outline"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - align: 0.0 0.0; - rel1 { to: "bg"; offset: 0 0; } - rel2 { to: "bg"; offset: -1 -1; } - image { - normal: GALLERY_EDC_IMAGE_MAGNIFIER_LINE; - border: 12 14 14 20; - } - image.middle: SOLID; - fill.smooth: 0; - } - } - } - } - - group { name: "elm/entry/matchlist/default"; - data.item: "max_height" "230"; - parts { - part { name: "base"; - type: RECT; - scale : 1; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - rel1 { - relative: 0.0 0.0; - offset: 0 20; - } - rel2 { - relative: 1.0 1.0; - offset: 0 20; - } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1 { - to: "base"; - } - rel2 { - to: "base"; - } - } - } - } - } - -/* Entry's bubble style */ - - styles - { - style { name: "entry_bubble_date_area_textblock_style"; - base: "font=SLP:style=Roman font_size="ENTRY_BUBBLE_DATE_AREA_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_INC" left_margin=2 right_margin=2 wrap=mixed text_class_entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=SLP:style=Oblique"; - tag: "b" "+ font=SLP:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=SLP:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_INC" color="ENTRY_PREEDIT_TEXT_COLOR_INC""; - } - } - - group { name: "elm/entry/base/readmessage"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - images { - image: GALLERY_EDC_IMAGE_MSGBUBBLE_RECEIVE COMP; - } - parts { - part { - name: "elm.rect.left.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_EX_PAD 0; - fixed: 1 0; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 0.0 1.0; - } - } - part { - name: "elm.rect.right.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_IX_PAD 0; - fixed: 1 0; - align: 0.0 0.0; - color: 0 0 0 0; - rel1 { relative: 1.0 0.0; to: "elm.text"; } - rel2.to: "elm.text"; - } - } - part { - name: "elm.rect.top.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.bottom.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 1.0; - color: 0 0 0 0; - rel1.relative: 0.0 1.0; - } - } - part { - name: "elm.image.bg"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - rel2.to_x: "elm.rect.right.pad"; - image { - normal: GALLERY_EDC_IMAGE_MSGBUBBLE_RECEIVE; - border: 1 11 7 12; - border_scale: 1; - } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under -// source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.0; - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.top.pad"; } - rel2 { relative: 1.0 0.0; to_y: "elm.rect.bottom.pad"; } - text { - style: "entry_textblock_style"; - min: 0 1; - max: 1 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/base-noedit/readmessage"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - images { - image: GALLERY_EDC_IMAGE_MSGBUBBLE_RECEIVE COMP; - } - parts { - part { - name: "elm.rect.left.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_EX_PAD 0; - fixed: 1 0; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 0.0 1.0; - } - } - part { - name: "elm.rect.right.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_IX_PAD 0; - fixed: 1 0; - align: 0.0 0.0; - color: 0 0 0 0; - rel1 { relative: 1.0 0.0; to: "elm.text"; } - rel2.to: "elm.text"; - } - } - part { - name: "elm.rect.top.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.topleft.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - max: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - fixed: 1 1; - align: 0.0 0.0; - visible: 0; - } - } - part { - name: "elm.rect.bottom.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_BOTTOM_PAD; - fixed: 0 1; - align: 0.0 1.0; - color: 0 0 0 0; - rel1.relative: 0.0 1.0; - } - } - part { - name: "elm.image.bg"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - rel2.to_x: "elm.rect.right.pad"; - image { - normal: GALLERY_EDC_IMAGE_MSGBUBBLE_RECEIVE; - border: 1 11 7 12; - border_scale: 1; - } - } - } - // it's temporary blocked for prepare entry's signal feature - /* - part { - name: "elm.text.subject"; - type: TEXTBLOCK; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.0; - text { - style: "entry_textblock_style"; - min: 0 1; - } - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.top.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.top.pad"; } - } - } - */ - part { - name: "elm.rect.subject.line"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - min: 0 1; - align: 0.0 0.0; - color: 0 0 0 255; - /* - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.text.subject"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.text.subject"; } - */ - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.top.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.top.pad"; } - } - } - part { - name: "elm.swallow.callerid"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; - max: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; - fixed: 1 1; - align: 0.0 0.0; - visible: 0; - rel1 { relative: 1.0 1.0; to: "elm.rect.topleft.pad"; to_y: "elm.rect.topleft.pad"; } - rel2 { relative: 1.0 0.0; to_y: "elm.rect.bottom.pad"; } - } - description { state: "callerid_on" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.rect.callerid.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - max: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - fixed: 1 1; - align: 0.0 0.0; - visible: 0; - rel1 { relative: 1.0 1.0; to: "elm.swallow.callerid"; to_y: "elm.rect.top.pad"; } - rel2 { relative: 1.0 0.0; to_y: "elm.rect.bottom.pad"; } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { - state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.0; - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.subject.line"; } - rel2 { relative: 1.0 1.0; to_y: "elm.rect.subject.line"; } - text { - style: "entry_textblock_style"; - min: 0 1; - max: 1 0; - } - } - description { state: "callerid_on" 0.0; - inherit: "default" 0.0; - rel1 { relative: 1.0 1.0; to_x: "elm.rect.callerid.pad"; to_y: "elm.rect.subject.line"; } - rel2 { relative: 1.0 1.0; to_y: "elm.rect.subject.line"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } - part { - name: "elm.rect.status.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: GENLIST_PADDING_6_INC GENLIST_SIZE_64_INC; - fixed: 1 1; - align: 0.0 1.0; - visible: 0; - rel1 { relative: 1.5 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.bottom.pad"; } - rel2 { relative: 1.0 1.0; to_y: "elm.rect.bottom.pad"; } - } - } - part { - name: "elm.rect.time.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: GENLIST_PADDING_6_INC GENLIST_PADDING_34_INC; - max: GENLIST_PADDING_6_INC GENLIST_PADDING_34_INC; - fixed: 1 1; - align: 0.0 0.0; - visible: 0; - rel1.to: "elm.rect.status.pad"; - rel2 { relative: 1.0 1.0; to_y: "elm.rect.bottom.pad"; } - } - } - part { name: "elm.text.status"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - align: 0.0 1.0; - fixed: 1 1; - text { - font: "SLP:style=Roman"; - size: GENLIST_FONT_28_INC; - min: 1 0; - } - visible: 1; - color: GENLIST_PART_FONT_LIST_SUB_TEXT_COLOR_INC; - rel1 { relative: 0.0 0.0; to_x: "elm.rect.status.pad"; to_y: "elm.rect.status.pad"; } - rel2 { relative: 0.0 0.0; to_x: "elm.rect.status.pad"; to_y: "elm.rect.status.pad"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "elm.text.time"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; - text { - font: "SLP:style=Roman"; - size: GENLIST_FONT_28_INC; - min: 1 0; - } - visible: 1; - color: GENLIST_PART_FONT_LIST_SUB_TEXT_COLOR_INC; - rel1 { relative: 0.0 1.0; to_x: "elm.rect.time.pad"; to_y: "elm.rect.time.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.time.pad"; to_y: "elm.rect.time.pad"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { - name: "elm.swallow.icon1"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - min: GENLIST_PADDING_64_INC GENLIST_PADDING_64_INC; - max: GENLIST_PADDING_64_INC GENLIST_PADDING_64_INC; - fixed: 1 1; - align: 0.0 1.0; - visible: 0; - rel1 { relative: 1.5 0.3; to_x: "elm.rect.right.pad"; to_y: "elm.rect.bottom.pad"; } - rel2 { relative: 1.0 0.3; to_y: "elm.rect.bottom.pad"; } - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.swallow.end"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.text"; } - rel2 { relative: 0.0 0.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.bottom.pad"; } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "go_callerid_on"; - signal: "elm,state,callerid,enabled"; - source: "elm"; - action: STATE_SET "callerid_on" 0.0; - target: "elm.swallow.callerid"; - target: "elm.text"; - } - program { name: "go_callerid_off"; - signal: "elm,state,callerid,disabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.callerid"; - target: "elm.text"; - } - program { name: "go_textstatus_on"; - signal: "elm,state,text,status,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text.time"; - target: "elm.text.status"; - after: "go_contentstatus_off"; - } - program { name: "go_textstatus_off"; - signal: "elm,state,text,status,disbled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text.time"; - target: "elm.text.status"; - } - program { name: "go_contentstatus_on"; - signal: "elm,state,content,status,enabled"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - target: "elm.swallow.icon1"; - after: "go_textstatus_off"; - } - program { name: "go_contentstatus_off"; - signal: "elm,state,content,status,disabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon1"; - } - } - } - - group { name: "elm/entry/base-noedit-charwrap/readmessage"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - images { - image: GALLERY_EDC_IMAGE_MSGBUBBLE_RECEIVE COMP; - } - parts { - part { - name: "elm.rect.left.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_EX_PAD 0; - fixed: 1 0; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 0.0 1.0; - } - } - part { - name: "elm.rect.right.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_IX_PAD 0; - fixed: 1 0; - align: 0.0 0.0; - color: 0 0 0 0; - rel1 { relative: 1.0 0.0; to_x: "elm.text"; } - rel2.to_x: "elm.text"; - } - } - part { - name: "elm.rect.top.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.bottom.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 1.0; - color: 0 0 0 0; - rel1.relative: 0.0 1.0; - } - } - part { - name: "elm.image.bg"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - rel2.to_x: "elm.rect.right.pad"; - image { - normal: GALLERY_EDC_IMAGE_MSGBUBBLE_RECEIVE; - border: 1 20 13 20; - border_scale: 1; - } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.0; - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.top.pad"; } - rel2 { relative: 1.0 0.0; to_y: "elm.rect.bottom.pad"; } - text { - style: "entry_textblock_style_charwrap"; - min: 0 1; - max: 1 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style_charwrap"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/base/sentmessage"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - images { - image: GALLERY_EDC_IMAGE_MSGBUBBLE_SEND COMP; - } - parts { - part { - name: "elm.rect.right.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_EX_PAD 0; - fixed: 1 0; - align: 1.0 0.0; - color: 0 0 0 0; - rel1.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.left.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_IX_PAD 0; - fixed: 1 0; - align: 1.0 0.0; - color: 0 0 0 0; - rel1 { relative: 0.0 0.0; to: "elm.text"; } - rel2 { relative: 0.0 1.0; to: "elm.text"; } - } - } - part { - name: "elm.rect.top.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.bottom.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 1.0; - color: 0 0 0 0; - rel1.relative: 0.0 1.0; - } - } - part { - name: "elm.image.bg"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - rel1.to_x: "elm.rect.left.pad"; - image { - normal: GALLERY_EDC_IMAGE_MSGBUBBLE_SEND; - border: 20 1 13 20; - border_scale: 1; - } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under -// source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 0.0 1.0; to_y: "elm.rect.top.pad";} - rel2 { relative: 0.0 0.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.bottom.pad"; } - text { - style: "entry_textblock_style"; - min: 0 1; - max: 1 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - - group { name: "elm/entry/base-noedit/sentmessage"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - images { - image: GALLERY_EDC_IMAGE_MSGBUBBLE_SEND COMP; - } - parts { - part { - name: "elm.rect.right.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_EX_PAD 0; - fixed: 1 0; - align: 1.0 0.0; - color: 0 0 0 0; - rel1.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.left.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_IX_PAD 0; - fixed: 1 0; - align: 1.0 0.0; - color: 0 0 0 0; - rel1 { relative: 0.0 0.0; to: "elm.text"; } - rel2 { relative: 0.0 1.0; to: "elm.text"; } - } - } - part { - name: "elm.rect.topright.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - max: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - align: 1.0 0.0; - visible: 0; - rel1.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.top.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.bottom.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_BOTTOM_PAD; - fixed: 0 1; - align: 0.0 1.0; - color: 0 0 0 0; - rel1.relative: 0.0 1.0; - } - } - part { - name: "elm.image.bg"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - rel1.to_x: "elm.rect.left.pad"; - image { - normal: GALLERY_EDC_IMAGE_MSGBUBBLE_SEND; - border: 20 1 13 20; - border_scale: 1; - } - } - } - // it's temporary blocked for prepare entry's signal feature - /* - part { - name: "elm.text.subject"; - type: TEXTBLOCK; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.0; - text { - style: "entry_textblock_style"; - min: 0 1; - } - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.top.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.top.pad"; } - } - } - */ - part { - name: "elm.rect.subject.line"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - min: 0 1; - align: 0.0 0.0; - color: 0 0 0 255; - /* - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.text.subject"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.text.subject"; } - */ - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.top.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.top.pad"; } - } - } - part { - name: "elm.swallow.callerid"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; - max: ENTRY_BUBBLE_CALLERID_WIDTH ENTRY_BUBBLE_CALLERID_HEIGHT; - align: 1.0 0.0; - visible: 0; - rel1 { relative: 0.0 1.0; to_x: "elm.rect.topright.pad"; to_y: "elm.rect.topright.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.topright.pad"; to_y: "elm.rect.bottom.pad"; } - } - description { state: "callerid_on" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.rect.callerid.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - max: ENTRY_BUBBLE_CALLERID_PAD ENTRY_BUBBLE_CALLERID_PAD; - align: 1.0 0.0; - visible: 0; - rel1 { relative: 0.0 1.0; to_x: "elm.swallow.callerid"; to_y: "elm.rect.topright.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.swallow.callerid"; to_y: "elm.rect.bottom.pad"; } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { - state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 0.0 1.0; to_y: "elm.rect.subject.line";} - rel2 { relative: 0.0 1.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.subject.line"; } - text { - style: "entry_textblock_style"; - min: 0 1; - max: 1 0; - } - } - description { state: "callerid_on" 0.0; - inherit: "default" 0.0; - rel1 { relative: 0.0 1.0; to_y: "elm.rect.subject.line";} - rel2 { relative: 0.0 1.0; to_x: "elm.rect.callerid.pad"; to_y: "elm.rect.subject.line"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style"; - } - } - } - part { - name: "elm.rect.status.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: GENLIST_PADDING_6_INC GENLIST_SIZE_64_INC; - fixed: 1 1; - align: 1.0 1.0; - visible: 0; - rel1 { relative: -0.8 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.bottom.pad"; } - rel2 { relative: -0.8 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.rect.bottom.pad"; } - } - } - part { - name: "elm.rect.time.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: GENLIST_PADDING_6_INC GENLIST_PADDING_34_INC; - max: GENLIST_PADDING_6_INC GENLIST_PADDING_34_INC; - fixed: 1 1; - align: 0.0 0.0; - visible: 0; - rel1.to: "elm.rect.status.pad"; - rel2 { relative: 0.0 1.0; to_x: "elm.rect.status.pad"; to_y: "elm.rect.bottom.pad"; } - } - } - part { name: "elm.text.status"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - align: 1.0 1.0; - fixed: 1 1; - text { - font: "SLP:style=Roman"; - size: GENLIST_FONT_28_INC; - min: 1 0; - } - visible: 1; - color: GENLIST_PART_FONT_LIST_SUB_TEXT_COLOR_INC; - rel1 { relative: 0.0 0.0; to_x: "elm.rect.status.pad"; to_y: "elm.rect.status.pad"; } - rel2 { relative: 0.0 0.0; to_x: "elm.rect.status.pad"; to_y: "elm.rect.status.pad"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { name: "elm.text.time"; - type: TEXT; - scale: 1; - description { state: "default" 0.0; - align: 1.0 0.0; - fixed: 1 1; - text { - font: "SLP:style=Roman"; - size: GENLIST_FONT_28_INC; - min: 1 0; - } - visible: 1; - color: GENLIST_PART_FONT_LIST_SUB_TEXT_COLOR_INC; - rel1 { relative: 0.0 1.0; to_x: "elm.rect.status.pad"; to_y: "elm.rect.time.pad"; } - rel2 { relative: 0.0 1.0; to_x: "elm.rect.status.pad"; to_y: "elm.rect.time.pad"; } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - } - } - part { - name: "elm.swallow.icon1"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - min: GENLIST_PADDING_64_INC GENLIST_PADDING_64_INC; - max: GENLIST_PADDING_64_INC GENLIST_PADDING_64_INC; - fixed: 1 1; - align: 1.0 1.0; - visible: 0; - rel1 { relative: -0.8 0.3; to_x: "elm.rect.left.pad"; to_y: "elm.rect.bottom.pad"; } - rel2 { relative: -0.8 0.3; to_x: "elm.rect.left.pad"; to_y: "elm.rect.bottom.pad"; } - } - description { state: "enabled" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { - name: "elm.swallow.end"; - type: SWALLOW; - scale: 1; - description { - state: "default" 0.0; - align: 0.0 0.0; - rel1 { relative: 1.0 1.0; to_x: "elm.rect.left.pad"; to_y: "elm.text"; } - rel2 { relative: 0.0 0.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.bottom.pad"; } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - program { name: "go_callerid_on"; - signal: "elm,state,callerid,enabled"; - source: "elm"; - action: STATE_SET "callerid_on" 0.0; - target: "elm.swallow.callerid"; - target: "elm.text"; - } - program { name: "go_callerid_off"; - signal: "elm,state,callerid,disabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.callerid"; - target: "elm.text"; - } - program { name: "go_textstatus_on"; - signal: "elm,state,text,status,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text.time"; - target: "elm.text.status"; - after: "go_contentstatus_off"; - } - program { name: "go_textstatus_off"; - signal: "elm,state,text,status,disbled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text.time"; - target: "elm.text.status"; - } - program { name: "go_contentstatus_on"; - signal: "elm,state,content,status,enabled"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - target: "elm.swallow.icon1"; - after: "go_textstatus_off"; - } - program { name: "go_contentstatus_off"; - signal: "elm,state,content,status,disabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon1"; - } - } - } - - group { name: "elm/entry/base-noedit-charwrap/sentmessage"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - images { - image: GALLERY_EDC_IMAGE_MSGBUBBLE_SEND COMP; - } - parts { - part { - name: "elm.rect.right.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_EX_PAD 0; - fixed: 1 0; - align: 1.0 0.0; - color: 0 0 0 0; - rel1.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.left.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: ENTRY_BUBBLE_IX_PAD 0; - fixed: 1 0; - align: 1.0 0.0; - color: 0 0 0 0; - rel1 { relative: 0.0 0.0; to: "elm.text"; } - rel2 { relative: 0.0 1.0; to: "elm.text"; } - } - } - part { - name: "elm.rect.top.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 0.0; - color: 0 0 0 0; - rel2.relative: 1.0 0.0; - } - } - part { - name: "elm.rect.bottom.pad"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: 0 ENTRY_BUBBLE_Y_PAD; - fixed: 0 1; - align: 0.0 1.0; - color: 0 0 0 0; - rel1.relative: 0.0 1.0; - } - } - part { - name: "elm.image.bg"; - type: IMAGE; - scale: 1; - description { - state: "default" 0.0; - rel1.to_x: "elm.rect.left.pad"; - image { - normal: GALLERY_EDC_IMAGE_MSGBUBBLE_SEND; - border: 20 1 13 20; - border_scale: 1; - } - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 0.0 1.0; to_y: "elm.rect.top.pad";} - rel2 { relative: 0.0 0.0; to_x: "elm.rect.right.pad"; to_y: "elm.rect.bottom.pad"; } - text { - style: "entry_textblock_style_charwrap"; - min: 0 1; - max: 1 0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "entry_textblock_disabled_style_charwrap"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - -group { name: "elm/entry/base/font_color_black"; - alias: "elm/entry/base-mixedwrap/font_color_black"; - alias: "elm/entry/base/font_color_black/default"; - alias: "elm/entry/base/font_color_black/lighting"; - alias: "elm/entry/base/font_color_black/multiline"; - alias: "elm/entry/base/font_color_black/multiline/default"; - alias: "elm/entry/base/font_color_black/multiline/lighting"; - alias: "elm/entry/base/editfield/font_color_black"; - - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - - styles { - style { name: "font_color_black_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#000000FF wrap=mixed left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color=#000000FF"; - tag: "preedit_sel" "+ backing=on backing_color=#000000FF color=#FFFFFFFF"; - } - style { name: "font_color_black_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=mixed left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color=#000000FF"; - tag: "preedit_sel" "+ backing=on backing_color=#000000FF color=#FFFFFFFF"; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "font_color_black_textblock_style"; - min: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "font_color_black_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-noedit/font_color_black"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "font_color_black_textblock_style"; - min: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "font_color_black_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-charwrap/font_color_black"; - alias: "elm/entry/base/font_color_black/char_wrap"; - alias: "elm/entry/base/font_color_black/default/char_wrap"; - alias: "elm/entry/base/font_color_black/lighting/char_wrap"; - alias: "elm/entry/base/font_color_black/multiline/char_wrap"; - alias: "elm/entry/base/font_color_black/multiline/default/char_wrap"; - alias: "elm/entry/base/font_color_black/multiline/lighting/char_wrap"; - alias: "elm/entry/base-charwrap/editfield/font_color_black"; - - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - - styles { - style { name: "font_color_black_textblock_char_wrap_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#000000FF wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color=#000000FF"; - tag: "preedit_sel" "+ backing=on backing_color=#000000FF color=#FFFFFFFF"; - } - style { name: "font_color_black_textblock_char_wrap_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color=#000000FF"; - tag: "preedit_sel" "+ backing=on backing_color=#000000FF color=#FFFFFFFF"; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "font_color_black_textblock_char_wrap_style"; - min: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "font_color_black_textblock_char_wrap_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-single/font_color_black"; - alias: "elm/entry/base-single/font_color_black/default"; - alias: "elm/entry/base-single/font_color_black/lighting"; - alias: "elm/entry/base-single/font_color_black/singleline"; - alias: "elm/entry/base-single/font_color_black/singleline/default"; - alias: "elm/entry/base-single/font_color_black/singleline/lighting"; - alias: "elm/entry/base-single/editfield/font_color_black"; - alias: "elm/entry/base-single/editfield/searchbar/font_color_black"; - - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - - styles { - style { name: "font_color_black_single_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#000000FF wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color=#000000FF"; - tag: "preedit_sel" "+ backing=on backing_color=#000000FF color=#FFFFFFFF"; - } - style { name: "font_color_black_single_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color=#000000FF"; - tag: "preedit_sel" "+ backing=on backing_color=#000000FF color=#FFFFFFFF"; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "font_color_black_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "font_color_black_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-single-noedit/font_color_black"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PLAIN; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "font_color_black_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "font_color_black_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} -group { name: "elm/entry/base-password/font_color_black"; - alias: "elm/entry/base-password/editfield/font_color_black"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: PASSWORD; - select_mode: BLOCK_HANDLE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "font_color_black_single_textblock_style"; - repch: "*"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "font_color_black_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/scroller/entry/default"; - alias : "elm/scroller/entry/editfield"; - alias : "elm/scroller/entry/editfield/searchbar/default"; - data { - item: "focus_highlight" "on"; - } - script { - public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer; - public timer0(val) { - new v; - v = get_int(sbvis_v); - if (v) { - v = get_int(sbalways_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - v = get_int(sbvis_h); - if (v) { - v = get_int(sbalways_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - set_int(sbvis_timer, 0); - return 0; - } - } - images { - image: GALLERY_EDC_IMAGE_BT_SM_BASE2 COMP; - } - parts { - part { name: "bg"; - type: RECT; - description { state: "default" 0.0; - visible: 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "bg"; - rel2.to: "bg"; - } - } - part { name: "contentclipper"; - type: RECT; - mouse_events: 0; - clip_to: "clipper"; - description { state: "default" 0.0; - rel1.to: "elm.swallow.icon"; - rel1.relative: 1.0 0.0; - rel2.to: "elm.swallow.end"; - rel2.relative: 0.0 1.0; - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - rel1 { - to: "bg"; - relative: 0.0 0.0; - } - rel2 { - to: "bg"; - relative: 0.0 1.0; - } - visible: 0; - } - description { state: "visible" 0.0; - fixed: 1 1; - align: 0.0 1.0; - rel1 { - to: "bg"; - relative: 0.0 0.0; - } - rel2 { - to: "bg"; - relative: 0.0 1.0; - } - visible: 1; - } - } - part { name: "elm.swallow.end"; - type: SWALLOW; - clip_to: "clipper"; - description { state: "default" 0.0; - fixed: 1 1; - rel1 { - to: "bg"; - relative: 1.0 0.0; - } - rel2 { - to: "bg"; - relative: 1.0 1.0; - } - visible: 0; - } - description { state: "visible" 0.0; - fixed: 1 1; - align: 1.0 1.0; - rel1 { - to: "bg"; - relative: 1.0 0.0; - } - rel2 { - to: "bg"; - relative: 1.0 1.0; - } - visible: 1; - } - } - part { name: "elm.swallow.content"; - clip_to: "contentclipper"; - type: SWALLOW; - description { state: "default" 0.0; - rel1 { - to: "elm.swallow.icon"; - relative: 1.0 0.0; - } - rel2 { - to: "elm.swallow.end"; - relative: 0.0 1.0; - } - } - } - part { name: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar_clip"; - clip_to: "sb_vbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_vbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 10 17; - align: 1.0 0.0; - rel1 { - relative: 0.0 0.0; - to_y: "elm.swallow.content"; - to_x: "elm.swallow.end"; - } - rel2 { - relative: 0.0 0.0; - to_y: "sb_hbar"; - to_x: "elm.swallow.end"; - } - } - } - part { name: "elm.dragable.vbar"; - clip_to: "sb_vbar_clip"; - mouse_events: 0; - dragable { - x: 0 0 0; - y: 1 1 0; - confine: "sb_vbar"; - } - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - min: 10 17; - max: 10 99999; - rel1 { - relative: 0.5 0.5; - to: "sb_vbar"; - } - rel2 { - relative: 0.5 0.5; - to: "sb_vbar"; - } - image { - normal: GALLERY_EDC_IMAGE_BT_SM_BASE2; - border: 6 6 6 6; - middle: SOLID; - } - } - } - part { name: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar_clip"; - clip_to: "sb_hbar_clip_master"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - } - description { state: "hidden" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "sb_hbar"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - fixed: 1 1; - visible: 0; - min: 17 10; - align: 0.0 1.0; - rel1 { - relative: 0.0 1.0; - to_x: "elm.swallow.content"; - to_y: "elm.swallow.content"; - } - rel2 { - relative: 0.0 1.0; - to_x: "sb_vbar"; - to_y: "elm.swallow.content"; - } - } - } - part { name: "elm.dragable.hbar"; - clip_to: "sb_hbar_clip"; - mouse_events: 0; - dragable { - x: 1 1 0; - y: 0 0 0; - confine: "sb_hbar"; - } - description { state: "default" 0.0; - fixed: 1 1; - min: 17 10; - max: 99999 10; - rel1 { - relative: 0.5 0.5; - to: "sb_hbar"; - } - rel2 { - relative: 0.5 0.5; - to: "sb_hbar"; - } - image { - normal: GALLERY_EDC_IMAGE_BT_SM_BASE2; - border: 4 4 4 4; - middle: SOLID; - } - } - } - } - programs { - program { name: "load"; - signal: "load"; - source: ""; - script { - set_state(PART:"sb_hbar_clip", "hidden", 0.0); - set_state(PART:"sb_vbar_clip", "hidden", 0.0); - set_int(sbvis_h, 0); - set_int(sbvis_v, 0); - set_int(sbalways_v, 0); - set_int(sbalways_h, 0); - set_int(sbvis_timer, 0); - } - } - program { name: "icon_show"; - signal: "elm,action,show,icon"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.icon"; - } - program { name: "icon_hide"; - signal: "elm,action,hide,icon"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - program { name: "end_show"; - signal: "elm,action,show,end"; - source: "elm"; - action: STATE_SET "visible" 0.0; - target: "elm.swallow.end"; - } - program { name: "end_hide"; - signal: "elm,action,hide,end"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.end"; - } - program { name: "vbar_show"; - signal: "elm,action,show,vbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_hide"; - signal: "elm,action,hide,vbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_vbar_clip_master"; - } - program { name: "vbar_show_always"; - signal: "elm,action,show_always,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - set_int(sbalways_v, 1); - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - } - } - program { name: "vbar_show_notalways"; - signal: "elm,action,show_notalways,vbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_v); - if (v) { - set_int(sbalways_v, 0); - v = get_int(sbvis_v); - if (!v) { - emit("do-hide-vbar", ""); - set_int(sbvis_v, 0); - } - } - } - } - program { name: "sb_vbar_show"; - signal: "do-show-vbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - program { name: "sb_vbar_hide"; - signal: "do-hide-vbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_vbar_clip"; - } - - program { name: "hbar_show"; - signal: "elm,action,show,hbar"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_hide"; - signal: "elm,action,hide,hbar"; - source: "elm"; - action: STATE_SET "hidden" 0.0; - target: "sb_hbar_clip_master"; - } - program { name: "hbar_show_always"; - signal: "elm,action,show_always,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - set_int(sbalways_h, 1); - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - } - } - program { name: "hbar_show_notalways"; - signal: "elm,action,show_notalways,hbar"; - source: "elm"; - script { - new v; - v = get_int(sbalways_h); - if (v) { - set_int(sbalways_h, 0); - v = get_int(sbvis_h); - if (!v) { - emit("do-hide-hbar", ""); - set_int(sbvis_h, 0); - } - } - } - } - program { name: "sb_hbar_show"; - signal: "do-show-hbar"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - program { name: "sb_hbar_hide"; - signal: "do-hide-hbar"; - source: ""; - action: STATE_SET "hidden" 0.0; - transition: LINEAR 0.5; - target: "sb_hbar_clip"; - } - - program { name: "scroll"; - signal: "elm,action,scroll"; - source: "elm"; - script { - new v; - v = get_int(sbvis_v); - v |= get_int(sbalways_v); - if (!v) { - emit("do-show-vbar", ""); - set_int(sbvis_v, 1); - } - v = get_int(sbvis_h); - v |= get_int(sbalways_h); - if (!v) { - emit("do-show-hbar", ""); - set_int(sbvis_h, 1); - } - v = get_int(sbvis_timer); - if (v > 0) cancel_timer(v); - v = timer(1.0, "timer0", 0); - set_int(sbvis_timer, v); - } - } - } - } -group { name: "elm/entry/base/gallery/rename"; - alias: "elm/entry/base-mixedwrap/gallery/rename"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "editfield_rename_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_RENAME_INC" left_margin=1 right_margin=2 wrap=mixed text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC" color="ENTRY_PREEDIT_TEXT_COLOR_RENAME_INC""; - } - style { name: "editfield_rename_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 left_margin=1 right_margin=2 wrap=mixed text_class=entry"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC" color="ENTRY_PREEDIT_TEXT_COLOR_RENAME_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "editfield_rename_textblock_style"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "editfield_rename_textblock_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} - -group { name: "elm/entry/base-charwrap/gallery/rename"; - alias: "elm/entry/base/gallery/rename/char_wrap"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "editfield_rename_textblock_char_wrap_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_RENAME_INC" wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC" color="ENTRY_PREEDIT_TEXT_COLOR_RENAME_INC""; - } - style { name: "editfield_rename_textblock_char_wrap_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=char left_margin=1 right_margin=2"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC" color="ENTRY_PREEDIT_TEXT_COLOR_RENAME_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 1; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - //source6: "X"; // anchor over - description { state: "default" 0.0; - fixed: 1 0; - text { - style: "editfield_rename_textblock_char_wrap_style"; - min: 0 1; - align: 0.0 0.0; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "editfield_rename_textblock_char_wrap_disabled_style"; - min: 0 1; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } - } - -////////////////////////////RENAME STYLE/////////////////////////////////// - -group { name: "elm/entry/base-single/gallery/rename"; - alias: "elm/entry/base-single/gallery/rename/default"; - alias: "elm/entry/base-single/gallery/rename/lighting"; - alias: "elm/entry/base-single/gallery/rename/singleline"; - alias: "elm/entry/base-single/gallery/rename/singleline/default"; - alias: "elm/entry/base-single/gallery/rename/singleline/lighting"; - data.item: "default_font_size" "24"; - data.item: "min_font_size" "8"; - data.item: "max_font_size" "60"; - styles { - style { name: "editfield_rename_single_textblock_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color="ENTRY_TEXT_COLOR_RENAME_INC" wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#800 underline=on underline_color=#8008"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC" color="ENTRY_PREEDIT_TEXT_COLOR_RENAME_INC""; - } - style { name: "editfield_rename_single_textblock_disabled_style"; - base: "font=Helvetica Neue:style=Roman font_size="ENTRY_TEXT_SIZE_INC" color=#00000080 wrap=none left_margin=1 right_margin=3"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "tab" "\t"; - tag: "em" "+ font=Helvetica Neue:style=Oblique"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; - tag: "link" "+ color=#00000080 underline=on underline_color=#00000080"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "preedit" "+ underline=on underline_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC""; - tag: "preedit_sel" "+ backing=on backing_color="ENTRY_PREEDIT_BACKGROUND_COLOR_RENAME_INC" color="ENTRY_PREEDIT_TEXT_COLOR_RENAME_INC""; - } - } - data { - item: context_menu_orientation "horizontal"; - } - parts { - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 1; - scale: 1; - entry_mode: EDITABLE; - select_mode: BLOCK_HANDLE; - //cursor_mode: BEFORE; - multiline: 0; - source: "elm/entry/selection/default"; // selection under - source2: ENTRY_BLOCK_HANDLE_SOURCE2; // block handle - source3: ENTRY_BLOCK_HANDLE_SOURCE3; // block handle - source4: "elm/entry/cursor/default"; // cursorover - source5: "elm/entry/anchor/default"; // anchor under - description { state: "default" 0.0; - text { - style: "editfield_rename_single_textblock_style"; - min: 1 1; - max: 0 1; - } - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - text { - style: "editfield_rename_single_textblock_disabled_style"; - } - } - } - } - programs { - program { name: "focus"; - signal: "load"; - source: ""; - action: FOCUS_SET; - target: "elm.text"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - target: "elm.text"; - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text"; - } - } -} diff --git a/res/edc/gl-gengrid-item-thumbview.edc b/res/edc/gl-gengrid-item-thumbview.edc deleted file mode 100755 index e81eee6..0000000 --- a/res/edc/gl-gengrid-item-thumbview.edc +++ /dev/null @@ -1,598 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 182 - -/* Gap between bg and icon */ -#define GAP_BG_L 14 -#define GAP_BG_R 6 -#define GAP_BG_T 24 - -/* Gap between icon and shadow */ -#define GAP_ICON_L 3 -#define GAP_ICON_R 3 -#define GAP_ICON_T 0 -#define GAP_ICON_B 4 - -/* Shadow image size */ -#define SHADOW_W (W-GAP_BG_L-GAP_BG_R+GAP_ICON_L+GAP_ICON_R) -#define SHADOW_H (H-GAP_BG_T+GAP_ICON_B) - -/* Gap between bg and shadow */ -#define GAP_SHADOW_L (GAP_BG_L-GAP_ICON_L) -#define GAP_SHADOW_R (GAP_BG_R-GAP_ICON_R) -#define GAP_SHADOW_T (GAP_BG_T-GAP_ICON_T) -#define GAP_SHADOW_B (0+GAP_ICON_B) - -/* Thumbnail boundary size */ -#define INNER 1 - -/* Bookmark icon boundary size */ -#define BOOKMARK_ICON_W 30 -#define BOOKMARK_ICON_H 38 - -/* Backgroud size for setting play icon position */ -#define PLAY_BG_W (47+64+47) -#define PLAY_BG_H (27+64+28) -#define PLAY_W 64 -#define PLAY_H 64 -#define PLAY_X 47 -#define PLAY_Y 27 - -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"; - - images { - image: GALLERY_EDC_IMAGE_THUMBS_BG COMP; - } - - 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: "icon_bg_img"; - type: IMAGE; - mouse_events: 1; - scale : 1; - description { - state: "default" 0.0; - image { - normal : GALLERY_EDC_IMAGE_THUMBS_BG; - } - rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } - rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } - } - } - part { - name: "icon_bg"; - type: RECT; - description { - state: "default" 0.0; - color: THUMBNAILS_BG_COLOR; - rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } - } - } - - part { - name: "elm.swallow.icon"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } - } - } - } - - 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; - image: GALLERY_EDC_IMAGE_THUMBS_BG 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: "icon_bg_img"; - type: IMAGE; - mouse_events: 1; - scale : 1; - description { - state: "default" 0.0; - image { - normal : GALLERY_EDC_IMAGE_THUMBS_BG; - } - rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } - rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } - } - } - part { - name: "icon_bg"; - type: RECT; - description { - state: "default" 0.0; - color: THUMBNAILS_BG_COLOR; - rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } - } - } - - part { - name: "elm.swallow.icon"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } - } - } - part { - name: "elm.text.bg"; - type: RECT; - mouse_events: 0; - scale : 1; - description { - state: "default" 0.0; - visible: 1; - color: 0 0 0 130; - align: 0.5 1.0; - fixed: 0 1; - rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-BOOKMARK_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } - } - } - part { - name: "elm.videoicon_bg"; - type: RECT; - mouse_events: 0; - repeat_events: 0; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - fixed: 1 0; - rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} - rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} - } - } - part { - name: "elm.swallow.videoicon"; - type: IMAGE; - mouse_events: 0; - repeat_events: 0; - scale: 1; - description { - state: "default" 0.0; - visible: 1; - align: 0.5 0.5; - aspect: 1.0 1.0; - rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} - rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; 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; - fixed: 1 1; - align: 0.5 0.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: "HelveticaNeue:style=Medium"; - size: 26; - align: 0.5 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_bookmark"; - images { - image: GALLERY_EDC_IMAGE_BUTTON_PLAY COMP; - image: GALLERY_EDC_IMAGE_THUMBS_BG 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: "icon_bg_img"; - type: IMAGE; - mouse_events: 1; - scale : 1; - description { - state: "default" 0.0; - image { - normal : GALLERY_EDC_IMAGE_THUMBS_BG; - } - rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } - rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } - } - } - part { - name: "icon_bg"; - type: RECT; - description { - state: "default" 0.0; - color: THUMBNAILS_BG_COLOR; - rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } - } - } - - part { - name: "elm.swallow.icon"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } - } - } - part { - name: "elm.text.bg"; - type: RECT; - mouse_events: 0; - scale : 1; - - description { - state: "default" 0.0; - visible: 1; - color: 0 0 0 130; - min: 0 24; - align: 0.5 1.0; - fixed: 0 1; - rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-BOOKMARK_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } - rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } - } - } - part { - name: "elm.videoicon_bg"; - type: RECT; - mouse_events: 0; - repeat_events: 0; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - fixed: 1 0; - rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} - rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} - } - } - part { - name: "elm.swallow.videoicon"; - type: IMAGE; - mouse_events: 0; - repeat_events: 0; - scale: 1; - description { - state: "default" 0.0; - min: 40 40; - visible: 1; - align: 0.5 0.5; - aspect: 1.0 1.0; - rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} - rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; to: "elm.videoicon_bg";} - image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; - } - } - part { - name: "bookmarkicon_bg"; - type: RECT; - scale: 1; - description { - state: "default" 0.0; - min: BOOKMARK_ICON_W BOOKMARK_ICON_H; - max: BOOKMARK_ICON_W BOOKMARK_ICON_H; - align: 0.0 0.5; - fixed: 1 1; - visible: 0; - rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } - rel2 { relative: 0.0 1.0; to: "elm.text.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"; } - } - } - part { - name: "elm.text"; - type: TEXT; - mouse_events: 1; - repeat_events: 1; - scale: 1; - description { - state: "default" 0.0; - min: 0 20; - fixed: 1 1; - align: 0.5 0.5; - rel1 { relative: 0.9 0.0; to_x: "elm.swallow.bookmarkicon"; to_y: "elm.text.bg"; } - rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } - color: 255 255 255 255; - text { - font: "HelveticaNeue:style=Medium"; - size: 26; - align: 0.5 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"; - } - } -} diff --git a/res/edc/gl-naviframe.edc b/res/edc/gl-naviframe.edc deleted file mode 100755 index 7842673..0000000 --- a/res/edc/gl-naviframe.edc +++ /dev/null @@ -1,4810 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 NAVIFRAME_TITLE_H_INC 100 -#define NAVIFRAME_SEGMENT_TITLE_H_INC 136 -#define NAVIFRAME_OH_OPENED_H_INC 106 -#define NAVIFRAME_OH_CONTENT_H_INC 74 -#define NAVIFRAME_OH_PADDING_INC 16 -#define NAVIFRAME_OH_ARROW_SIZE_INC 19 12 -#define NAVIFRAME_OH_OPENED_DOUBLE_H_INC 196 -#define NAVIFRAME_PREV_BTN_W_INC 124 -#define NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 10 -#define NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC 124 80 -#define NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 144 -#define NAVIFRAME_TEXT_PADDING_INC 144 -#define NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 52 -#define NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 186 -#define NAVIFRAME_TITLE_SEGMENT_H_INC 74 -#define NAVIFRAME_TITLE_SEGMENT_FONT_SIZE_INC 28 -#define NAVIFRAME_TITLE_SEGMENT_TEXT_H_INC 50 -#define NAVIFRAME_TITLE_FONT_SIZE_INC 36 -#define NAVIFRAME_ICON_SIZE_INC 32 32 -#define NAVIFRAME_ICON_PADDING_INC 16 0 -#define NAVIFRAME_CONTROLBAR_BG_COLOR_INC 15 15 15 255 -#define NAVIFRAME_TITLE_TEXT_COLOR_INC 249 249 249 255 -#define NAVIFRAME_TITLE_BG_COLOR_INC 92 92 92 255 -#define NAVIFRAME_OH_BORDER_INC 0 0 4 0 - -#define TOOLBAR_SMALL_HEIGHT_INC 95 // 114 // 102 - -#define NAVIFRAME_VIEW_TRANS_TIME 0.3 - -/////////////////////////////////////////////////////////////////////////// -// Naviframe -/////////////////////////////////////////////////////////////////////////// - group { name:"elm/naviframe/base/gallery/default"; - parts { - part { name: "base"; - description { state: "default" 0.0; - } - } - } - } - group { name:"elm/naviframe/item/basic/gallery/default"; - alias:"elm/naviframe/item/1line/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER COMP; - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW COMP; - } - script { - public oh_show = 0; //optionheader show/hide - public oh_close = 0; //optionheader close/open - public cbar_bg = 0; //Controlbar BG Show call count - public left_btn_visible = 0; //whether left btn is shown - public icon_visible = 0; //whether icon is shown - public right_btn_visible = 0; //whether right btn is shown - public more_btn_visible = 0; //whether more btn is shown - public large_padded_center_align = 0; //large padding based on button size for center align for 1/2 buttons. - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - } - description { state: "left" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; - } - } - part { name: "title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 1 NAVIFRAME_TITLE_H_INC; - align: 0.0 0.0; - fixed: 0 1; - rel1 { relative: 0.0 0.0; to: "base"; } - rel2 { relative: 1.0 0.0; to: "base"; } - color: NAVIFRAME_TITLE_BG_COLOR_INC; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "title_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "optionheader_bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 1 0; - align: 0.5 0; - fixed: 0 1; - rel1.to: "title_bg"; - rel1.relative: 0 1; - rel2.to: "title_bg"; - visible: 0; - image { normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER; - border: NAVIFRAME_OH_BORDER_INC; - } - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 1 NAVIFRAME_OH_OPENED_H_INC; - visible: 1; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "optionheader_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "optionheader_bg"; } - rel2 { to: "optionheader_bg"; } - } - } - part { name: "optionheader_top_padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } - rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "optionheader"; - type: SWALLOW; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_CONTENT_H_INC; - rel1 { relative: 0.0 1.0; to: "optionheader_top_padding"; } - rel2 { relative: 1.0 1.0; to: "optionheader_top_padding"; } - fixed: 0 1; - align: 0.0 0.0; - } - } - part { name: "optionheader_bottom_padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 1.0; to: "optionheader"; } - rel2 { relative: 1.0 1.0; to: "optionheader"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 1.0; - rel1.to_x: "base"; - rel1.to_y: "optionheader_bg"; - rel2.relative: 1.0 0.0; - rel2.to_x: "base"; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "padding_before_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_after_left_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "title_left_btn"; } - rel2 { relative: 1.0 1.0; to: "title_left_btn"; } - visible: 0; - } - } - part { name: "padding_before_more_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_more_btn"; } - rel2 { relative: 0.0 1.0; to: "title_more_btn"; } - visible: 0; - } - } - part { name: "padding_after_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_before_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_right_btn"; } - rel2 { relative: 0.0 1.0; to: "title_right_btn"; } - visible: 0; - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } - rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } - fixed: 1 0; - min: NAVIFRAME_ICON_PADDING_INC; - visible: 0; - } - } - part { name: "padding_center_text1"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - description { state: "icon" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 0; - } - description { state: "icon_left_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 0; - } - } - part { name: "padding_center_text2"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - } - part { name: "elm.text.title"; - type: TEXT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - text { font: "HelveticaNeue:style=Medium"; - size: NAVIFRAME_TITLE_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - align: 0.5 0.5; - } - color: NAVIFRAME_TITLE_TEXT_COLOR_INC; - align: 0.5 0.5; - fixed: 1 0; - rel1 { relative: 1.0 0.0; to: "padding_center_text1"; } - rel2 { relative: 0.0 1.0; to: "padding_center_text2"; } - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - rel1 { relative: 1.0 0.0; to: "padding_after_left_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_more_btn"; } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_ICON_SIZE_INC; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_before_text"; } - rel2 { relative: 0.0 1.0; to: "padding_before_text"; } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - align: 1.0 0.5; - } - } - part { name: "click_event_area"; - ignore_flags: ON_HOLD; - repeat_events: 1; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "title_left_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "padding_before_left_btn"; } - rel2 { relative: 1.0 1.0; to: "padding_before_left_btn"; } - } - } - part { name: "title_right_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - align: 1 0.5; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_after_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_after_right_btn"; } - } - } - part { name: "title_more_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 1 0.5; - rel1 { relative: 0.0 0.0; to: "padding_before_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_right_btn"; } - } - } - part { name: "optionheader_arrow"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: NAVIFRAME_OH_ARROW_SIZE_INC; - max: NAVIFRAME_OH_ARROW_SIZE_INC; - fixed: 1 1; - align: 0.5 0.0; - rel1 { relative: 0.0 1.025; to: "title_more_btn"; } - rel2 { relative: 1.0 1.025; to: "title_more_btn"; } - image.normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW; - color: 255 255 255 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - rel1 { to: "base"; } - rel2 { to: "base"; } - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2.to: "controlbar_bg"; - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "content_new_pushed"; - signal: "elm,state,new,pushed,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_pushed"; - signal: "elm,state,cur,pushed,internal"; - source: ""; - action: STATE_SET "left" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "pushed_finished"; - } - program { name: "content_prev_popped"; - signal: "elm,state,prev,popped,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_popped"; - signal: "elm,state,cur,popped,internal"; - source: ""; - action: STATE_SET "right" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "popped_finished"; - } - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,pushed,internal", ""); - } - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - script { - set_state(PART:"base", "right", 0.0); - emit("elm,state,new,pushed,internal", ""); - } - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - script { - set_state(PART:"base", "left", 0.0); - emit("elm,state,prev,popped,internal", ""); - } - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,popped,internal", ""); - } - } - program { name: "visible"; - signal: "elm,state,visible"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "title_show"; - signal: "elm,state,title,show"; - source: "elm"; - script { - set_state(PART:"title_bg", "default", 0.0); - if (get_int(oh_show) == 1) { - if (get_int(oh_close) == 1) { - emit("elm,state,optionheader,instant_close", ""); - }else { - emit("elm,state,optionheader,instant_open", ""); - } - } - else - set_state(PART:"optionheader_bg", "default", 0.0); - } - } - program { name: "title_hide"; - signal: "elm,state,title,hide"; - source: "elm"; - action: STATE_SET "hide" 0.0; - target: "title_bg"; - target: "optionheader_bg"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "left_btn_show"; - signal: "elm,state,title_left_btn,show"; - source: "elm"; - script { - set_int(left_btn_visible, 1); - if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "visible", 0.0); - if ((get_int(more_btn_visible) == 1) && (get_int(right_btn_visible) == 1)) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - } - } - program { name: "left_btn_hide"; - signal: "elm,state,title_left_btn,hide"; - source: "elm"; - script { - set_int(left_btn_visible, 0); - if ((get_int(more_btn_visible) == 0) && (get_int(right_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_show"; - signal: "elm,state,title_right_btn,show"; - source: "elm"; - script { - set_int(right_btn_visible, 1); - if (get_int(more_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_hide"; - signal: "elm,state,title_right_btn,hide"; - source: "elm"; - script { - set_int(right_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(more_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_show"; - signal: "elm,state,title_more_btn,show"; - source: "elm"; - script { - set_int(more_btn_visible, 1); - if (get_int(right_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_hide"; - signal: "elm,state,title_more_btn,hide"; - source: "elm"; - script { - set_int(more_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(right_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,elm.swallow.icon,show"; - source: "elm"; - script { - set_int(icon_visible, 1); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "icon", 0.0); - } - } - program { name: "icon_hide"; - signal: "elm,state,elm.swallow.icon,hide"; - source: "elm"; - script { - set_int(icon_visible, 0); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bg_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "optionheader_show"; - signal: "elm,state,optionheader,show"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "show", 0.0); - set_state(PART:"optionheader_arrow", "show", 0.0); - set_int(oh_show, 1); - } - } - program { name: "optionheader_hide"; - signal: "elm,state,optionheader,hide"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "default", 0.0); - set_state(PART:"optionheader_arrow", "default", 0.0); - set_int(oh_show, 0); - } - } - program { name: "optionheader_open"; - signal: "elm,state,optionheader,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_open_set"; - } - program { name: "optionheader_close"; - signal: "elm,state,optionheader,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_close_set"; - } - program { name: "optionheader_instant_open"; - signal: "elm,state,optionheader,instant_open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_open_set"; - } - program { name: "optionheader_instant_close"; - signal: "elm,state,optionheader,instant_close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_close_set"; - } - program { name: "optionheader_close_set"; - signal: "elm,state,optionheader,close_set"; - source: ""; - script { - set_int(oh_close, 1); - } - } - program { name: "optionheader_open_set"; - signal: "elm,state,optionheader,open_set"; - source: ""; - script { - set_int(oh_close, 0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } - group { name:"elm/naviframe/item/basic2/gallery/default"; - alias:"elm/naviframe/item/2line/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER COMP; - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW COMP; - } - script { - public oh_show = 0; //optionheader show/hide - public oh_close = 0; //optionheader close/open - public cbar_bg = 0; //Controlbar BG Show call count - public left_btn_visible = 0; //whether left btn is shown - public icon_visible = 0; //whether icon is shown - public right_btn_visible = 0; //whether right btn is shown - public more_btn_visible = 0; //whether more btn is shown - public large_padded_center_align = 0; //large padding based on button size for center align for 1/2 buttons. - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - } - description { state: "left" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; - } - } - part { name: "title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 1 NAVIFRAME_TITLE_H_INC; - align: 0.0 0.0; - fixed: 0 1; - rel1 { relative: 0.0 0.0; to: "base"; } - rel2 { relative: 1.0 0.0; to: "base"; } - color: NAVIFRAME_TITLE_BG_COLOR_INC; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "title_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "optionheader_bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 1 0; - align: 0.5 0; - fixed: 0 1; - rel1.to: "title_bg"; - rel1.relative: 0 1; - rel2.to: "title_bg"; - visible: 0; - image { normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER; - border: NAVIFRAME_OH_BORDER_INC; - } - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 1 NAVIFRAME_OH_OPENED_DOUBLE_H_INC; - visible: 1; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "optionheader_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "optionheader_bg"; } - rel2 { to: "optionheader_bg"; } - } - } - part { name: "optionheader_top_padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } - rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "optionheader"; - type: SWALLOW; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_CONTENT_H_INC; - rel1 { relative: 0.0 1.0; to: "optionheader_top_padding"; } - rel2 { relative: 1.0 1.0; to: "optionheader_top_padding"; } - fixed: 0 1; - align: 0.0 0.0; - } - } - part { name: "optionheader.mid.padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 1.0; to: "optionheader"; } - rel2 { relative: 1.0 1.0; to: "optionheader"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "optionheader2"; - type: SWALLOW; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_CONTENT_H_INC; - rel1 { relative: 0.0 1.0; to: "optionheader.mid.padding";} - rel2 { relative: 1.0 1.0; to: "optionheader.mid.padding";} - fixed: 0 1; - align: 0.0 0.0; - } - } - part { name: "optionheader.bottom.padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 1.0; to: "optionheader2"; } - rel2 { relative: 1.0 1.0; to: "optionheader2"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 1.0; - rel1.to_x: "base"; - rel1.to_y: "optionheader_bg"; - rel2.relative: 1.0 0.0; - rel2.to_x: "base"; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "padding_before_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_after_left_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "title_left_btn"; } - rel2 { relative: 1.0 1.0; to: "title_left_btn"; } - visible: 0; - } - } - part { name: "padding_before_more_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_more_btn"; } - rel2 { relative: 0.0 1.0; to: "title_more_btn"; } - visible: 0; - } - } - part { name: "padding_after_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_before_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_right_btn"; } - rel2 { relative: 0.0 1.0; to: "title_right_btn"; } - visible: 0; - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } - rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } - fixed: 1 0; - min: NAVIFRAME_ICON_PADDING_INC; - visible: 0; - } - } - part { name: "padding_center_text1"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - description { state: "icon" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 0; - } - description { state: "icon_left_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 0; - } - } - part { name: "padding_center_text2"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - } - part { name: "elm.text.title"; - type: TEXT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - text { font: "SLP:style=Medium"; - size: NAVIFRAME_TITLE_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - align: 0.5 0.5; - } - color: NAVIFRAME_TITLE_TEXT_COLOR_INC; - align: 0.5 0.5; - fixed: 1 0; - rel1 { relative: 1.0 0.0; to: "padding_center_text1"; } - rel2 { relative: 0.0 1.0; to: "padding_center_text2"; } - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - rel1 { relative: 1.0 0.0; to: "padding_after_left_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_more_btn"; } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_ICON_SIZE_INC; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_before_text"; } - rel2 { relative: 0.0 1.0; to: "padding_before_text"; } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - align: 1.0 0.5; - } - } - part { name: "click_event_area"; - ignore_flags: ON_HOLD; - repeat_events: 1; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "title_left_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "padding_before_left_btn"; } - rel2 { relative: 1.0 1.0; to: "padding_before_left_btn"; } - } - } - part { name: "title_right_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - align: 1 0.5; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_after_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_after_right_btn"; } - } - } - part { name: "title_more_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 0; - align: 1 0.5; - rel1 { relative: 0.0 0.0; to: "padding_before_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_right_btn"; } - } - } - part { name: "optionheader_arrow"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: NAVIFRAME_OH_ARROW_SIZE_INC; - max: NAVIFRAME_OH_ARROW_SIZE_INC; - fixed: 1 1; - align: 0.5 0.0; - rel1 { relative: 0.0 1.025; to: "title_more_btn"; } - rel2 { relative: 1.0 1.025; to: "title_more_btn"; } - image.normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW; - color: 255 255 255 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - rel1 { to: "base"; } - rel2 { to: "base"; } - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "controlbar_bg"; } - rel2 { to: "controlbar_bg"; } - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "content_new_pushed"; - signal: "elm,state,new,pushed,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_pushed"; - signal: "elm,state,cur,pushed,internal"; - source: ""; - action: STATE_SET "left" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "pushed_finished"; - } - program { name: "content_prev_popped"; - signal: "elm,state,prev,popped,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_popped"; - signal: "elm,state,cur,popped,internal"; - source: ""; - action: STATE_SET "right" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "popped_finished"; - } - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,pushed,internal", ""); - } - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - script { - set_state(PART:"base", "right", 0.0); - emit("elm,state,new,pushed,internal", ""); - } - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - script { - set_state(PART:"base", "left", 0.0); - emit("elm,state,prev,popped,internal", ""); - } - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,popped,internal", ""); - } - } - program { name: "visible"; - signal: "elm,state,visible"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "title_show"; - signal: "elm,state,title,show"; - source: "elm"; - script { - set_state(PART:"title_bg", "default", 0.0); - if (get_int(oh_show) == 1) { - if (get_int(oh_close) == 1) { - emit("elm,state,optionheader,instant_close", ""); - }else { - emit("elm,state,optionheader,instant_open", ""); - } - } - else - set_state(PART:"optionheader_bg", "default", 0.0); - } - } - program { name: "title_hide"; - signal: "elm,state,title,hide"; - source: "elm"; - action: STATE_SET "hide" 0.0; - target: "title_bg"; - target: "optionheader_bg"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "left_btn_show"; - signal: "elm,state,title_left_btn,show"; - source: "elm"; - script { - set_int(left_btn_visible, 1); - if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "visible", 0.0); - if ((get_int(more_btn_visible) == 1) && (get_int(right_btn_visible) == 1)) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - } - } - program { name: "left_btn_hide"; - signal: "elm,state,title_left_btn,hide"; - source: "elm"; - script { - set_int(left_btn_visible, 0); - if ((get_int(more_btn_visible) == 0) && (get_int(right_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_show"; - signal: "elm,state,title_right_btn,show"; - source: "elm"; - script { - set_int(right_btn_visible, 1); - if (get_int(more_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_hide"; - signal: "elm,state,title_right_btn,hide"; - source: "elm"; - script { - set_int(right_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(more_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_show"; - signal: "elm,state,title_more_btn,show"; - source: "elm"; - script { - set_int(more_btn_visible, 1); - if (get_int(right_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_hide"; - signal: "elm,state,title_more_btn,hide"; - source: "elm"; - script { - set_int(more_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(right_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,elm.swallow.icon,show"; - source: "elm"; - script { - set_int(icon_visible, 1); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "icon", 0.0); - } - } - program { name: "icon_hide"; - signal: "elm,state,elm.swallow.icon,hide"; - source: "elm"; - script { - set_int(icon_visible, 0); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bg_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "optionheader_show"; - signal: "elm,state,optionheader,show"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "show", 0.0); - set_state(PART:"optionheader_arrow", "show", 0.0); - set_int(oh_show, 1); - } - } - program { name: "optionheader_hide"; - signal: "elm,state,optionheader,hide"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "default", 0.0); - set_state(PART:"optionheader_arrow", "default", 0.0); - set_int(oh_show, 0); - } - } - program { name: "optionheader_open"; - signal: "elm,state,optionheader,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_open_set"; - } - program { name: "optionheader_close"; - signal: "elm,state,optionheader,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_close_set"; - } - program { name: "optionheader_instant_open"; - signal: "elm,state,optionheader,instant_open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_open_set"; - } - program { name: "optionheader_instant_close"; - signal: "elm,state,optionheader,instant_close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_close_set"; - } - program { name: "optionheader_close_set"; - signal: "elm,state,optionheader,close_set"; - source: ""; - script { - set_int(oh_close, 1); - } - } - program { name: "optionheader_open_set"; - signal: "elm,state,optionheader,open_set"; - source: ""; - script { - set_int(oh_close, 0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } - group { name: "elm/naviframe/item/segment/gallery/default"; - script { - public cbar_bg = 0; //Controlbar BG Show call count - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - } - description { state: "left" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; - } - } - part { name: "title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 1 NAVIFRAME_SEGMENT_TITLE_H_INC; - align: 0.0 0.0; - fixed: 0 1; - rel1 { relative: 0.0 0.0; to: "base"; } - rel2 { relative: 1.0 0.0; to: "base"; } - color: NAVIFRAME_TITLE_BG_COLOR_INC; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "title_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 1.0; - rel1.to_x: "base"; - rel1.to_y: "title_bg"; - rel2.relative: 1.0 0.0; - rel2.to_x: "base"; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "padding_before_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_after_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_left_btn"; } - rel2 { relative: 1.0 1.0; to: "title_left_btn"; } - visible: 0; - } - } - part { name: "padding_after_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_before_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_right_btn"; } - rel2 { relative: 0.0 1.0; to: "title_right_btn"; } - visible: 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } - rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } - fixed: 1 0; - min: NAVIFRAME_ICON_PADDING_INC; - visible: 0; - } - } - part { name: "elm.text.title"; - type: TEXT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - text { font: "SLP:style=Medium"; - size: NAVIFRAME_TITLE_SEGMENT_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - align: 0.5 0.5; - } - min: 0 NAVIFRAME_TITLE_SEGMENT_TEXT_H_INC; - max: 999999 NAVIFRAME_TITLE_SEGMENT_TEXT_H_INC; - fixed: 1 1; - color: NAVIFRAME_TITLE_TEXT_COLOR_INC; - align: 0.5 0; - rel1.to: "padding_before_left_btn"; - rel1.relative: 1 0; - rel2.to: "padding_after_right_btn"; - rel2.relative: 0 1; - } - } - part { name: "click_event_area"; - ignore_flags: ON_HOLD; - repeat_events: 1; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "title_left_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 0 0; - rel1.relative: 1.0 1.0; - rel1.to_x: "padding_before_left_btn"; - rel1.to_y: "elm.text.title"; - rel2.relative: 1.0 1.0; - rel2.to_x: "padding_before_left_btn"; - rel2.to_y: "elm.text.title"; - } - } - part { name: "title_right_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - align: 1 0.0; - fixed: 1 1; - rel1.relative: 0.0 1.0; - rel1.to_x: "padding_after_right_btn"; - rel1.to_y: "elm.text.title"; - rel2.relative: 0.0 1.0; - rel2.to_x: "padding_after_right_btn"; - rel2.to_y: "elm.text.title"; - } - } - part { name: "segment2"; - type: "SWALLOW"; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_TITLE_SEGMENT_H_INC; - max: 999999 NAVIFRAME_TITLE_SEGMENT_H_INC; - fixed: 0 1; - align: 0.5 0; - rel1.to_y: "elm.text.title"; - rel1.to_x: "title_bg"; - rel1.relative: 0.28 1; - rel2.to_y: "elm.text.title"; - rel2.to_x: "title_bg"; - rel2.relative: 0.72 1; - } - } - part { name: "segment3"; - type: "SWALLOW"; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_TITLE_SEGMENT_H_INC; - max: 999999 NAVIFRAME_TITLE_SEGMENT_H_INC; - fixed: 0 1; - align: 0.5 0; - rel1.to_y: "elm.text.title"; - rel1.relative: 0.2 1; - rel1.to_x: "title_bg"; - rel2.to_y: "elm.text.title"; - rel2.to_x: "title_bg"; - rel2.relative: 0.8 1; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - rel1 { to: "base"; } - rel2 { to: "base"; } - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "controlbar_bg"; } - rel2 { to: "controlbar_bg"; } - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "content_new_pushed"; - signal: "elm,state,new,pushed,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_pushed"; - signal: "elm,state,cur,pushed,internal"; - source: ""; - action: STATE_SET "left" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "pushed_finished"; - } - program { name: "content_prev_popped"; - signal: "elm,state,prev,popped,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_popped"; - signal: "elm,state,cur,popped,internal"; - source: ""; - action: STATE_SET "right" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "popped_finished"; - } - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,pushed,internal", ""); - } - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - script { - set_state(PART:"base", "right", 0.0); - emit("elm,state,new,pushed,internal", ""); - } - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - script { - set_state(PART:"base", "left", 0.0); - emit("elm,state,prev,popped,internal", ""); - } - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,popped,internal", ""); - } - } - program { name: "visible"; - signal: "elm,state,visible"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "title_show"; - signal: "elm,state,title,show"; - source: "elm"; - action: STATE_SET "show" 0.0; - target: "title_bg"; - } - program { name: "title_hide"; - signal: "elm,state,title,hide"; - source: "elm"; - action: STATE_SET "hide" 0.0; - target: "title_bg"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bg_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } - group { name: "elm/naviframe/item/tabbar/gallery/default"; - script { - public cbar_bg = 0; //Controlbar BG Show call count - } - parts { - part { name: "base"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - } - description { state: "left" 0.0; - inherit: "default" 0.0; - rel1.relative: -1.0 0.0; - rel2.relative: 0.0 1.0; - } - description { state: "right" 0.0; - inherit: "default" 0.0; - rel1.relative: 1.0 0.0; - rel2.relative: 2.0 1.0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 0.0; - rel1.to: "base"; - rel2.relative: 1.0 0.0; - rel2.to_x: "base"; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - rel1 { to: "base"; } - rel2 { to: "base"; } - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "controlbar_bg"; } - rel2 { to: "controlbar_bg"; } - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "content_new_pushed"; - signal: "elm,state,new,pushed,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_pushed"; - signal: "elm,state,cur,pushed,internal"; - source: ""; - action: STATE_SET "left" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "pushed_finished"; - } - program { name: "content_prev_popped"; - signal: "elm,state,prev,popped,internal"; - source: ""; - action: STATE_SET "default" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "show_finished"; - } - program { name: "content_cur_popped"; - signal: "elm,state,cur,popped,internal"; - source: ""; - action: STATE_SET "right" 0.0; - target: "base"; - transition: DECELERATE NAVIFRAME_VIEW_TRANS_TIME; - after: "popped_finished"; - } - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,pushed,internal", ""); - } - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - script { - set_state(PART:"base", "right", 0.0); - emit("elm,state,new,pushed,internal", ""); - } - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - script { - set_state(PART:"base", "left", 0.0); - emit("elm,state,prev,popped,internal", ""); - } - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - script { - set_state(PART:"base", "default", 0.0); - emit("elm,state,cur,popped,internal", ""); - } - } - program { name: "visible"; - signal: "elm,state,visible"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - action: STATE_SET "show" 0.0; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bg_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } - group { name:"elm/naviframe/item/basic/instant/gallery/default"; - alias:"elm/naviframe/item/1line/instant/gallery/default"; - alias:"elm/naviframe/item/instant/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER COMP; - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW COMP; - } - script { - public oh_show = 0; //optionheader show/hide - public oh_close = 0; //optionheader close/open - public cbar_bg = 0; //Controlbar BG Show call count - public left_btn_visible = 0; //whether left btn is shown - public icon_visible = 0; //whether icon is shown - public right_btn_visible = 0; //whether right btn is shown - public more_btn_visible = 0; //whether more btn is shown - public large_padded_center_align = 0; //large padding based on button size for center align for 1/2 buttons. - } - parts { - part { name: "title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 1 NAVIFRAME_TITLE_H_INC; - align: 0.0 0.0; - fixed: 0 1; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 0.0; } - color: NAVIFRAME_TITLE_BG_COLOR_INC; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "title_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "optionheader_bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 1 0; - align: 0.5 0; - fixed: 0 1; - rel1.to: "title_bg"; - rel1.relative: 0 1; - rel2.to: "title_bg"; - visible: 0; - image { normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER; - border: NAVIFRAME_OH_BORDER_INC; - } - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 1 NAVIFRAME_OH_OPENED_H_INC; - visible: 1; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "optionheader_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "optionheader_bg"; } - rel2 { to: "optionheader_bg"; } - } - } - part { name: "optionheader_top_padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } - rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "optionheader"; - type: SWALLOW; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_CONTENT_H_INC; - rel1 { relative: 0.0 1.0; to: "optionheader_top_padding"; } - rel2 { relative: 1.0 1.0; to: "optionheader_top_padding"; } - fixed: 0 1; - align: 0.0 0.0; - } - } - part { name: "optionheader_bottom_padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 1.0; to: "optionheader"; } - rel2 { relative: 1.0 1.0; to: "optionheader"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 1.0; - rel1.to_y: "optionheader_bg"; - rel2.relative: 1.0 0.0; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "padding_before_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_after_left_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "title_left_btn"; } - rel2 { relative: 1.0 1.0; to: "title_left_btn"; } - visible: 0; - } - } - part { name: "padding_before_more_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_more_btn"; } - rel2 { relative: 0.0 1.0; to: "title_more_btn"; } - visible: 0; - } - } - part { name: "padding_after_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_before_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_right_btn"; } - rel2 { relative: 0.0 1.0; to: "title_right_btn"; } - visible: 0; - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } - rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } - fixed: 1 0; - min: NAVIFRAME_ICON_PADDING_INC; - visible: 0; - } - } - part { name: "padding_center_text1"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - description { state: "icon" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 0; - } - description { state: "icon_left_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 0; - } - } - part { name: "padding_center_text2"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - } - part { name: "elm.text.title"; - type: TEXT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - text { font: "SLP:style=Medium"; - size: NAVIFRAME_TITLE_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - align: 0.5 0.5; - } - color: NAVIFRAME_TITLE_TEXT_COLOR_INC; - align: 0.5 0.5; - fixed: 1 0; - rel1 { relative: 1.0 0.0; to: "padding_center_text1"; } - rel2 { relative: 0.0 1.0; to: "padding_center_text2"; } - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - rel1 { relative: 1.0 0.0; to: "padding_after_left_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_more_btn"; } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_ICON_SIZE_INC; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_before_text"; } - rel2 { relative: 0.0 1.0; to: "padding_before_text"; } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - align: 1.0 0.5; - } - } - part { name: "click_event_area"; - ignore_flags: ON_HOLD; - repeat_events: 1; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "title_left_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "padding_before_left_btn"; } - rel2 { relative: 1.0 1.0; to: "padding_before_left_btn"; } - } - } - part { name: "title_right_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - align: 1 0.5; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_after_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_after_right_btn"; } - } - } - part { name: "title_more_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 1 0.5; - rel1 { relative: 0.0 0.0; to: "padding_before_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_right_btn"; } - } - } - part { name: "optionheader_arrow"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: NAVIFRAME_OH_ARROW_SIZE_INC; - max: NAVIFRAME_OH_ARROW_SIZE_INC; - fixed: 1 1; - align: 0.5 0.0; - rel1 { relative: 0.0 1.025; to: "title_more_btn"; } - rel2 { relative: 1.0 1.025; to: "title_more_btn"; } - image.normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW; - color: 255 255 255 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "controlbar_bg"; } - rel2 { to: "controlbar_bg"; } - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - after: "pushed_finished"; - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - after: "show_finished"; - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - after: "show_finished"; - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - after: "popped_finished"; - } - program { name: "title_show"; - signal: "elm,state,title,show"; - source: "elm"; - script { - set_state(PART:"title_bg", "default", 0.0); - if (get_int(oh_show) == 1) { - if (get_int(oh_close) == 1) { - emit("elm,state,optionheader,instant_close", ""); - }else { - emit("elm,state,optionheader,instant_open", ""); - } - } - else - set_state(PART:"optionheader_bg", "default", 0.0); - } - } - program { name: "title_hide"; - signal: "elm,state,title,hide"; - source: "elm"; - action: STATE_SET "hide" 0.0; - target: "title_bg"; - target: "optionheader_bg"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "left_btn_show"; - signal: "elm,state,title_left_btn,show"; - source: "elm"; - script { - set_int(left_btn_visible, 1); - if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "visible", 0.0); - if ((get_int(more_btn_visible) == 1) && (get_int(right_btn_visible) == 1)) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - } - } - program { name: "left_btn_hide"; - signal: "elm,state,title_left_btn,hide"; - source: "elm"; - script { - set_int(left_btn_visible, 0); - if ((get_int(more_btn_visible) == 0) && (get_int(right_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_show"; - signal: "elm,state,tltle_right_btn,show"; - source: "elm"; - script { - set_int(right_btn_visible, 1); - if (get_int(more_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_hide"; - signal: "elm,state,title_right_btn,hide"; - source: "elm"; - script { - set_int(right_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(more_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_show"; - signal: "elm,state,title_more_btn,show"; - source: "elm"; - script { - set_int(more_btn_visible, 1); - if (get_int(right_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_hide"; - signal: "elm,state,title_more_btn,hide"; - source: "elm"; - script { - set_int(more_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(right_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,elm.swallow.icon,show"; - source: "elm"; - script { - set_int(icon_visible, 1); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "icon", 0.0); - } - } - program { name: "icon_hide"; - signal: "elm,state,elm.swallow.icon,hide"; - source: "elm"; - script { - set_int(icon_visible, 0); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bg_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "optionheader_show"; - signal: "elm,state,optionheader,show"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "show", 0.0); - set_state(PART:"optionheader_arrow", "show", 0.0); - set_int(oh_show, 1); - } - } - program { name: "optionheader_hide"; - signal: "elm,state,optionheader,hide"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "default", 0.0); - set_state(PART:"optionheader_arrow", "default", 0.0); - set_int(oh_show, 0); - } - } - program { name: "optionheader_open"; - signal: "elm,state,optionheader,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_open_set"; - } - program { name: "optionheader_close"; - signal: "elm,state,optionheader,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_close_set"; - } - program { name: "optionheader_instant_open"; - signal: "elm,state,optionheader,instant_open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_open_set"; - } - program { name: "optionheader_instant_close"; - signal: "elm,state,optionheader,instant_close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_close_set"; - } - program { name: "optionheader_close_set"; - signal: "elm,state,optionheader,close_set"; - source: ""; - script { - set_int(oh_close, 1); - } - } - program { name: "optionheader_open_set"; - signal: "elm,state,optionheader,open_set"; - source: ""; - script { - set_int(oh_close, 0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } - group { name:"elm/naviframe/item/basic2/instant/gallery/default"; - alias:"elm/naviframe/item/2line/instant/gallery/default"; - alias:"elm/naviframe/item/instant2/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER COMP; - image: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW COMP; - } - script { - public oh_show = 0; //optionheader show/hide - public oh_close = 0; //optionheader close/open - public cbar_bg = 0; //Controlbar BG Show call count - public left_btn_visible = 0; //whether left btn is shown - public icon_visible = 0; //whether icon is shown - public right_btn_visible = 0; //whether right btn is shown - public more_btn_visible = 0; //whether more btn is shown - public large_padded_center_align = 0; //large padding based on button size for center align for 1/2 buttons. - } - parts { - part { name: "title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 1 NAVIFRAME_TITLE_H_INC; - align: 0.0 0.0; - fixed: 0 1; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 0.0; } - color: NAVIFRAME_TITLE_BG_COLOR_INC; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "title_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "optionheader_bg"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: 1 0; - align: 0.5 0; - fixed: 0 1; - rel1.to: "title_bg"; - rel1.relative: 0 1; - rel2.to: "title_bg"; - visible: 0; - image { normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER; - border: NAVIFRAME_OH_BORDER_INC; - } - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 1 NAVIFRAME_OH_OPENED_DOUBLE_H_INC; - visible: 1; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "optionheader_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "optionheader_bg"; } - rel2 { to: "optionheader_bg"; } - } - } - part { name: "optionheader_top_padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 0.0; to: "optionheader_bg"; } - rel2 { relative: 1.0 0.0; to: "optionheader_bg"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "optionheader"; - type: SWALLOW; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_CONTENT_H_INC; - rel1 { relative: 0.0 1.0; to: "optionheader_top_padding"; } - rel2 { relative: 1.0 1.0; to: "optionheader_top_padding"; } - fixed: 0 1; - align: 0.0 0.0; - } - } - part { name: "optionheader.mid.padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 1.0; to: "optionheader"; } - rel2 { relative: 1.0 1.0; to: "optionheader"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "optionheader2"; - type: SWALLOW; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_CONTENT_H_INC; - rel1 { relative: 0.0 1.0; to: "optionheader.mid.padding";} - rel2 { relative: 1.0 1.0; to: "optionheader.mid.padding";} - fixed: 0 1; - align: 0.0 0.0; - } - } - part { name: "optionheader.bottom.padding"; - type: RECT; - scale: 1; - clip_to: "optionheader_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_OH_PADDING_INC; - rel1 { relative: 0.0 1.0; to: "optionheader2"; } - rel2 { relative: 1.0 1.0; to: "optionheader2"; } - fixed: 0 1; - align: 0.0 0.0; - visible: 0; - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 1.0; - rel1.to_y: "optionheader_bg"; - rel2.relative: 1.0 0.0; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "padding_before_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_after_left_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "title_left_btn"; } - rel2 { relative: 1.0 1.0; to: "title_left_btn"; } - visible: 0; - } - } - part { name: "padding_before_more_btn"; - type: RECT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_more_btn"; } - rel2 { relative: 0.0 1.0; to: "title_more_btn"; } - visible: 0; - } - } - part { name: "padding_after_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_before_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_right_btn"; } - rel2 { relative: 0.0 1.0; to: "title_right_btn"; } - visible: 0; - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } - rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } - fixed: 1 0; - min: NAVIFRAME_ICON_PADDING_INC; - visible: 0; - } - } - part { name: "padding_center_text1"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.0; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - description { state: "icon" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_NO_BUTTON_ICON_PADDING_INC 0; - } - description { state: "icon_left_button" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_ICON_VISIBLE_INC 0; - } - } - part { name: "padding_center_text2"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TEXT_PADDING_INC 0; - } - } - part { name: "elm.text.title"; - type: TEXT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - text { font: "SLP:style=Medium"; - size: NAVIFRAME_TITLE_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - align: 0.5 0.5; - } - color: NAVIFRAME_TITLE_TEXT_COLOR_INC; - align: 0.5 0.5; - fixed: 1 0; - rel1 { relative: 1.0 0.0; to: "padding_center_text1"; } - rel2 { relative: 0.0 1.0; to: "padding_center_text2"; } - } - description { state: "right_and_more_button" 0.0; - inherit: "default" 0.0; - rel1 { relative: 1.0 0.0; to: "padding_after_left_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_more_btn"; } - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_ICON_SIZE_INC; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_before_text"; } - rel2 { relative: 0.0 1.0; to: "padding_before_text"; } - aspect: 1.0 1.0; - aspect_preference: VERTICAL; - align: 1.0 0.5; - } - } - part { name: "click_event_area"; - ignore_flags: ON_HOLD; - repeat_events: 1; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "title_left_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 0 0.5; - rel1 { relative: 1.0 0.0; to: "padding_before_left_btn"; } - rel2 { relative: 1.0 1.0; to: "padding_before_left_btn"; } - } - } - part { name: "title_right_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - align: 1 0.5; - fixed: 1 1; - rel1 { relative: 0.0 0.0; to: "padding_after_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_after_right_btn"; } - } - } - part { name: "title_more_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 0; - align: 1 0.5; - rel1 { relative: 0.0 0.0; to: "padding_before_right_btn"; } - rel2 { relative: 0.0 1.0; to: "padding_before_right_btn"; } - } - } - part { name: "optionheader_arrow"; - type: IMAGE; - scale: 1; - description { state: "default" 0.0; - min: NAVIFRAME_OH_ARROW_SIZE_INC; - max: NAVIFRAME_OH_ARROW_SIZE_INC; - fixed: 1 1; - align: 0.5 0.0; - rel1 { relative: 0.0 1.025; to: "title_more_btn"; } - rel2 { relative: 1.0 1.025; to: "title_more_btn"; } - image.normal: GALLERY_EDC_IMAGE_NAVIFRAME_OPTIONHEADER_ARROW; - color: 255 255 255 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - color: 255 255 255 255; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "controlbar_bg"; } - rel2 { to: "controlbar_bg"; } - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - after: "pushed_finished"; - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - after: "show_finished"; - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - after: "show_finished"; - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - after: "popped_finished"; - } - program { name: "title_show"; - signal: "elm,state,title,show"; - source: "elm"; - script { - set_state(PART:"title_bg", "default", 0.0); - if (get_int(oh_show) == 1) { - if (get_int(oh_close) == 1) { - emit("elm,state,optionheader,instant_close", ""); - }else { - emit("elm,state,optionheader,instant_open", ""); - } - } - else - set_state(PART:"optionheader_bg", "default", 0.0); - } - } - program { name: "title_hide"; - signal: "elm,state,title,hide"; - source: "elm"; - action: STATE_SET "hide" 0.0; - target: "title_bg"; - target: "optionheader_bg"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "left_btn_show"; - signal: "elm,state,title_left_btn,show"; - source: "elm"; - script { - set_int(left_btn_visible, 1); - if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "visible", 0.0); - if ((get_int(more_btn_visible) == 1) && (get_int(right_btn_visible) == 1)) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - } - } - program { name: "left_btn_hide"; - signal: "elm,state,title_left_btn,hide"; - source: "elm"; - script { - set_int(left_btn_visible, 0); - if ((get_int(more_btn_visible) == 0) && (get_int(right_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_show"; - signal: "elm,state,title_right_btn,show"; - source: "elm"; - script { - set_int(right_btn_visible, 1); - if (get_int(more_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "right_btn_hide"; - signal: "elm,state,title_right_btn,hide"; - source: "elm"; - script { - set_int(right_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(more_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_show"; - signal: "elm,state,title_more_btn,show"; - source: "elm"; - script { - set_int(more_btn_visible, 1); - if (get_int(right_btn_visible) == 1) { - set_state(PART:"elm.text.title", "right_and_more_button", 0.0); - set_state(PART:"padding_before_right_btn", "right_and_more_button", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(icon_visible) == 1) && ((get_int(left_btn_visible) == 1) || - (get_int(large_padded_center_align) == 1))) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if ((get_int(left_btn_visible) == 1) || (get_int(large_padded_center_align) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "more_btn_hide"; - signal: "elm,state,title_more_btn,hide"; - source: "elm"; - script { - set_int(more_btn_visible, 0); - set_state(PART:"padding_before_right_btn", "default", 0.0); - if ((get_int(right_btn_visible) == 0) && (get_int(left_btn_visible) == 0)) { - set_state(PART:"padding_center_text2", "default", 0.0); - set_int(large_padded_center_align, 0); - } - else { - set_state(PART:"padding_center_text2", "visible", 0.0); - set_int(large_padded_center_align, 1); - } - if ((get_int(large_padded_center_align) == 1) && (get_int(icon_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else if (get_int(large_padded_center_align) == 1) - set_state(PART:"padding_center_text1", "visible", 0.0); - else if (get_int(icon_visible) == 1) - set_state(PART:"padding_center_text1", "icon", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,elm.swallow.icon,show"; - source: "elm"; - script { - set_int(icon_visible, 1); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "icon_left_button", 0.0); - else - set_state(PART:"padding_center_text1", "icon", 0.0); - } - } - program { name: "icon_hide"; - signal: "elm,state,elm.swallow.icon,hide"; - source: "elm"; - script { - set_int(icon_visible, 0); - if ((get_int(large_padded_center_align) == 1) || (get_int(left_btn_visible) == 1)) - set_state(PART:"padding_center_text1", "visible", 0.0); - else - set_state(PART:"padding_center_text1", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bg_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "optionheader_show"; - signal: "elm,state,optionheader,show"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "show", 0.0); - set_state(PART:"optionheader_arrow", "show", 0.0); - set_int(oh_show, 1); - } - } - program { name: "optionheader_hide"; - signal: "elm,state,optionheader,hide"; - source: "elm"; - script { - set_state(PART:"optionheader_bg", "default", 0.0); - set_state(PART:"optionheader_arrow", "default", 0.0); - set_int(oh_show, 0); - } - } - program { name: "optionheader_open"; - signal: "elm,state,optionheader,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_open_set"; - } - program { name: "optionheader_close"; - signal: "elm,state,optionheader,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - transition: LINEAR 0.2; - after: "optionheader_close_set"; - } - program { name: "optionheader_instant_open"; - signal: "elm,state,optionheader,instant_open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_open_set"; - } - program { name: "optionheader_instant_close"; - signal: "elm,state,optionheader,instant_close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "optionheader_bg"; - target: "optionheader_arrow"; - after: "optionheader_close_set"; - } - program { name: "optionheader_close_set"; - signal: "elm,state,optionheader,close_set"; - source: ""; - script { - set_int(oh_close, 1); - } - } - program { name: "optionheader_open_set"; - signal: "elm,state,optionheader,open_set"; - source: ""; - script { - set_int(oh_close, 0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } - group { name: "elm/naviframe/item/segment/instant/default"; - script { - public cbar_bg = 0; //Controlbar BG Show call count - } - parts { - part { name: "title_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 1 NAVIFRAME_SEGMENT_TITLE_H_INC; - align: 0.0 0.0; - fixed: 0 1; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 0.0; } - color: NAVIFRAME_TITLE_BG_COLOR_INC; - } - description { state: "hide" 0.0; - inherit: "default" 0.0; - min: 0 0; - max: 0 0; - fixed: 1 1; - } - } - part { name: "title_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 1.0; - rel1.to_y: "title_bg"; - rel2.relative: 1.0 0.0; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "padding_before_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_bg"; } - rel2 { relative: 0.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_after_left_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 0.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_left_btn"; } - rel2 { relative: 1.0 1.0; to: "title_left_btn"; } - visible: 0; - } - } - part { name: "padding_after_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 1.0 0.0; to: "title_bg"; } - rel2 { relative: 1.0 1.0; to: "title_bg"; } - visible: 0; - } - } - part { name: "padding_before_right_btn"; - type: RECT; - mouse_events: 0; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to: "title_right_btn"; } - rel2 { relative: 0.0 1.0; to: "title_right_btn"; } - visible: 0; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_FUNC_BTN_PADDING_W_INC 0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - clip_to: "title_clip"; - description { state: "default" 0.0; - align: 1.0 0.5; - rel1 { relative: 0.0 0.0; to_x: "elm.text.title"; to_y: "title_bg"; } - rel2 { relative: 0.0 1.0; to_x: "elm.text.title"; to_y: "title_bg"; } - fixed: 1 0; - min: NAVIFRAME_ICON_PADDING_INC; - visible: 0; - } - } - part { name: "elm.text.title"; - type: TEXT; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - text { font: "SLP:style=Medium"; - size: NAVIFRAME_TITLE_SEGMENT_FONT_SIZE_INC; - min: 0 0; - max: 1 0; - align: 0.5 0.5; - } - min: 0 NAVIFRAME_TITLE_SEGMENT_TEXT_H_INC; - max: 999999 NAVIFRAME_TITLE_SEGMENT_TEXT_H_INC; - fixed: 1 1; - color: NAVIFRAME_TITLE_TEXT_COLOR_INC; - align: 0.5 0; - rel1.to: "padding_before_left_btn"; - rel1.relative: 1 0; - rel2.to: "padding_after_right_btn"; - rel2.relative: 0 1; - } - } - part { name: "click_event_area"; - ignore_flags: ON_HOLD; - repeat_events: 1; - description { state: "default" 0.0; - rel1 { to: "title_bg"; } - rel2 { to: "title_bg"; } - } - } - part { name: "title_left_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - fixed: 1 1; - align: 0 0; - rel1.relative: 1.0 1.0; - rel1.to_x: "padding_before_left_btn"; - rel1.to_y: "elm.text.title"; - rel2.relative: 1.0 1.0; - rel2.to_x: "padding_before_left_btn"; - rel2.to_y: "elm.text.title"; - } - } - part { name: "title_right_btn"; - type: SWALLOW; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - max: NAVIFRAME_TITLE_FUNC_BTN_SIZE_INC; - align: 1 0.0; - fixed: 1 1; - rel1.relative: 0.0 1.0; - rel1.to_x: "padding_after_right_btn"; - rel1.to_y: "elm.text.title"; - rel2.relative: 0.0 1.0; - rel2.to_x: "padding_after_right_btn"; - rel2.to_y: "elm.text.title"; - } - } - part { name: "segment2"; - type: "SWALLOW"; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_TITLE_SEGMENT_H_INC; - max: 999999 NAVIFRAME_TITLE_SEGMENT_H_INC; - fixed: 0 1; - align: 0.5 0; - rel1.to_y: "elm.text.title"; - rel1.relative: 0.28 1; - rel2.to_y: "elm.text.title"; - rel2.relative: 0.72 1; - } - } - part { name: "segment3"; - type: "SWALLOW"; - scale: 1; - clip_to: "title_clip"; - description { state: "default" 0.0; - min: 0 NAVIFRAME_TITLE_SEGMENT_H_INC; - max: 999999 NAVIFRAME_TITLE_SEGMENT_H_INC; - fixed: 0 1; - align: 0.5 0; - rel1.to_y: "elm.text.title"; - rel1.relative: 0.2 1; - rel2.to_y: "elm.text.title"; - rel2.relative: 0.8 1; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "controlbar_bg"; } - rel2 { to: "controlbar_bg"; } - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - after: "pushed_finished"; - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - after: "show_finished"; - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - after: "show_finished"; - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - after: "popped_finished"; - } - program { name: "title_show"; - signal: "elm,state,title,show"; - source: "elm"; - action: STATE_SET "show" 0.0; - target: "title_clip"; - } - program { name: "title_hide"; - signal: "elm,state,title,hide"; - source: "elm"; - action: STATE_SET "hide" 0.0; - target: "title_clip"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - action: STATE_SET "show" 0.0; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bg_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } - group { name: "elm/naviframe/item/tabbar/instant/gallery/default"; - script { - public cbar_bg = 0; //Controlbar BG Show call count - } - parts { - part { name: "elm.swallow.content"; - type: SWALLOW; - scale: 1; - repeat_events: 0; - clip_to: "content_clip"; - description { state: "default" 0.0; - align: 0.0 0.0; - rel1.relative: 0.0 0.0; - rel2.relative: 1.0 0.0; - rel2.to_y: "controlbar_bg"; - } - } - part { name: "content_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1.to: "elm.swallow.content"; - rel2.to: "elm.swallow.content"; - } - } - part { name: "controlbar_bg"; - type: RECT; - scale: 1; - description { state: "default" 0.0; - min: 0 0; - max: 999999 0; - fixed: 0 1; - align: 0.0 1.0; - visible: 0; - color: NAVIFRAME_CONTROLBAR_BG_COLOR_INC; - } - description { state: "show" 0.0; - inherit: "default" 0.0; - min: 0 TOOLBAR_SMALL_HEIGHT_INC; - max: 999999 TOOLBAR_SMALL_HEIGHT_INC; - visible: 1; - } - } - part { name: "controlbar_clip"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - rel1 { to: "controlbar_bg"; } - rel2 { to: "controlbar_bg"; } - } - } - part { name: "elm.prev_btn_bg"; - type: RECT; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - min: 0 0; - fixed: 1 0; - align: 1.0 0.0; - rel1 { relative: 1.0 0.0; to: "controlbar_bg"; } - rel2.to: "controlbar_bg"; - visible: 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: NAVIFRAME_TITLE_PREV_BTN_BG_SIZE_INC 0; - } - } - part { name: "elm.swallow.prev_btn"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - fixed: 1 1; - align: 0.5 0.5; - rel1.to: "elm.prev_btn_bg"; - rel2.to: "elm.prev_btn_bg"; - } - } - part { name: "controlbar"; - type: SWALLOW; - scale: 1; - clip_to: "controlbar_clip"; - description { state: "default" 0.0; - rel1.to: "controlbar_bg"; - rel2 { relative: 0.0 1.0; to: "elm.prev_btn_bg"; } - } - } - } - programs { - program { name: "cur_pushed"; - signal: "elm,state,cur,pushed"; - source: "elm"; - after: "pushed_finished"; - } - program { name: "new_pushed"; - signal: "elm,state,new,pushed"; - source: "elm"; - after: "show_finished"; - } - program { name: "prev_popped"; - signal: "elm,state,prev,popped"; - source: "elm"; - after: "show_finished"; - } - program { name: "cur_popped"; - signal: "elm,state,cur,popped"; - source: "elm"; - after: "popped_finished"; - } - program { name: "prev_btn_show"; - signal: "elm,state,prev_btn,show"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,show", "elm"); - set_state(PART:"elm.prev_btn_bg", "visible", 0.0); - } - } - program { name: "prev_btn_hide"; - signal: "elm,state,prev_btn,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - set_state(PART:"elm.prev_btn_bg", "default", 0.0); - } - } - program { name: "controlbar_show"; - signal: "elm,state,controlbar,show"; - source: "elm"; - action: STATE_SET "show" 0.0; - script { - emit("elm,state,controlbar_bg,show", "elm"); - } - } - program { name: "controlbar_hide"; - signal: "elm,state,controlbar,hide"; - source: "elm"; - script { - emit("elm,state,controlbar_bg,hide", "elm"); - } - } - program { name: "controlbar_bg_show"; - signal: "elm,state,controlbar_bg,show"; - source: "elm"; - script { - set_state(PART:"controlbar_bg", "show", 0.0); - set_int(cbar_bg, get_int(cbar_bg) + 1); - } - } - program { name: "controlbar_bgp_hide"; - signal: "elm,state,controlbar_bg,hide"; - source: "elm"; - script { - set_int(cbar_bg, get_int(cbar_bg) - 1); - if (get_int(cbar_bg) <= 0) - set_state(PART:"controlbar_bg", "default", 0.0); - } - } - program { name: "controlbar_open"; - signal: "elm,state,controlbar,open"; - source: ""; - action: STATE_SET "show" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_close"; - signal: "elm,state,controlbar,close"; - source: ""; - action: STATE_SET "default" 0.0; - target: "controlbar_bg"; - transition: LINEAR 0.2; - } - program { name: "controlbar_instant_open"; - signal: "elm,state,controlbar,instant_open"; - source: ""; - script { - emit("elm,state,prev_btn,show", "elm"); - emit("elm,state,controlbar,show", "elm"); - } - } - program { name: "controlbar_instant_close"; - signal: "elm,state,controlbar,instant_close"; - source: ""; - script { - emit("elm,state,prev_btn,hide", "elm"); - emit("elm,state,controlbar,hide", "elm"); - } - } - program { name: "show_finished"; - action: SIGNAL_EMIT "elm,action,show,finished" ""; - } - program { name: "pushed_finished"; - action: SIGNAL_EMIT "elm,action,pushed,finished" ""; - } - program { name: "popped_finished"; - action: SIGNAL_EMIT "elm,action,popped,finished" ""; - } - program { - name: "title_clicked"; - signal: "mouse,clicked,1"; - source: "click_event_area"; - action: SIGNAL_EMIT "elm,action,title,clicked" ""; - } - } - } diff --git a/res/edc/gl-segment.edc b/res/edc/gl-segment.edc deleted file mode 100755 index c098b2d..0000000 --- a/res/edc/gl-segment.edc +++ /dev/null @@ -1,693 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_NORMAL_INC 144 144 144 255 -#define SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_PRESSED_INC 0 0 0 255 -#define SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_SELECTED_INC 0 0 0 255 -#define SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_DISABLED_INC 144 144 144 255 -#define SEGMENT_CONTROL_ITEM_1PX_LEFT_PADDING_COLOR_INC 43 43 43 255 -#define SEGMENT_CONTROL_ITEM_1PX_RIGHT_PADDING_COLOR_INC 76 76 76 255 - -#define SEGMENT_CONTROL_TEXT_SIZE_INC 28 -#define SEGMENT_CONTROL_TEXT_SIZE_RANGE_MIN_INC 12 -#define SEGMENT_CONTROL_TEXT_SIZE_RANGE_MAX_INC 28 - -//################################################################ -//Segment Control -//################################################################ - -group { name: "elm/segment_control/base/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL COMP; - } -#define SEGMENT_TYPE_SINGLE 1 -#define SEGMENT_TYPE_LEFT 2 -#define SEGMENT_TYPE_MIDDLE 3 -#define SEGMENT_TYPE_RIGHT 4 -#define SEGMENT_STATE_NORMAL 1 -#define SEGMENT_STATE_PRESSED 2 -#define SEGMENT_STATE_SELECTED 3 -#define SEGMENT_STATUS_ENABLED 0 -#define SEGMENT_STATUS_DISABLED 1 - parts { - part { name: "bg"; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - min: 100 40; - rel1.offset: 0 0; - rel2.offset: 0 0; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL; - border: 5 5 5 5; - border_scale: 1; - middle: 1; - } - } - } - } -} -group { name: "elm/segment_control/item/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_LEFT COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_CENTRE COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_RIGHT COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_NORMAL COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_01 COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_02 COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_03 COMP; - image: GALLERY_EDC_IMAGE_BTN_SGE_BODY COMP; - } - parts { - part { name: "base"; - mouse_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - } - } - part { name: "segment"; - scale: 1; - description { state: "default" 0.0; - min: 1 1; - visible: 0; - align: 0.0 0.5; - rel1 { - to: "base"; - relative: 0.0 0.0; - offset: 0 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: 0 0; - } - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL; - border: 5 5 5 5; - border_scale: 1; - middle: 1; - } - } - description { state: "default_single" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL; - border: 5 5 5 5; - } - } - description { state: "default_left" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_LEFT; - border: 5 2 5 5; - } - } - description { state: "default_right" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_RIGHT; - border: 2 5 5 5; - } - } - description { state: "default_middle" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_CENTRE; - border: 0 0 7 7; - } - } - description { state: "pressed_single" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_NORMAL; - border: 2 2 5 5; - } - } - description { state: "pressed_left" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_01; - border: 5 2 5 5; - } - } - description { state: "pressed_right" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_03; - border: 2 5 5 5; - } - } - description { state: "pressed_middle" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_02; - border: 0 0 7 7; - } - } - description { state: "selected_single" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_NORMAL; - border: 5 5 5 5; - } - } - description { state: "selected_left" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_01; - border: 5 2 5 5; - } - } - description { state: "selected_right" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_03; - border: 2 5 5 5; - } - } - description { state: "selected_middle" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_PRESS_02; - border: 0 0 7 7; - } - } - } - part { name: "left_1pxl_padding"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - align: 0.0 0.5; - min: 1 0; - fixed: 1 0; - rel1 { - to: "base"; - relative: 0.0 0.0; - } - rel2 { - to: "base"; - relative: 0.0 1.0; - } - color: SEGMENT_CONTROL_ITEM_1PX_LEFT_PADDING_COLOR_INC; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "right_1pxl_padding"; - type: RECT; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - align: 1.0 0.5; - min: 1 0; - fixed: 1 0; - rel1 { - to: "base"; - relative: 1.0 0.0; - offset: -1 0; - } - rel2 { - to: "base"; - relative: 1.0 1.0; - offset: -1 0; - } - color: SEGMENT_CONTROL_ITEM_1PX_RIGHT_PADDING_COLOR_INC; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - } - part { name: "padding_frame"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - /* Add a padding of 2 pxs in all directions */ - rel1.offset: 2 2; - rel2.offset: -3 -3; - } - } - part { name: "icon.bg"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - fixed: 1 0; - rel1.to: "elm.swallow.icon"; - rel2.to: "elm.swallow.icon"; - } - } - part { name: "padding_icon_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - visible: 0; - align: 0.0 0.0; - rel1 { - to: "icon.bg"; - relative: 1.0 0.0; - } - rel2 { - to: "icon.bg"; - relative: 1.0 1.0; - } - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - description { state: "visible" 0.0; //when icon is visible - inherit: "default" 0.0; - rel2.offset: 2 0; - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.5; - rel1.to: "padding_frame"; - rel2.to: "padding_frame"; - rel2.relative: 0.0 0.0; - aspect: 1.0 1.0; - aspect_preference: BOTH; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 0.3 1.0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - visible: 1; - rel2.relative: 1.0 1.0; - } - } - part { name: "elm.text"; - type: TEXT; - mouse_events: 0; - scale: 1; - description { - state: "default" 0.0; - visible: 0; - fixed: 1 1; - min: 1 1; - rel1 { - to_x: "padding_icon_text"; - relative: 1.0 0.0; - } - rel2.to: "padding_frame"; - color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_NORMAL_INC; - text { - font: "Helvetica Neue:style=Medium"; - ellipsis: 0.0; - fit: 1 1; - size: SEGMENT_CONTROL_TEXT_SIZE_INC; - size_range: SEGMENT_CONTROL_TEXT_SIZE_RANGE_MIN_INC SEGMENT_CONTROL_TEXT_SIZE_RANGE_MAX_INC; - min: 0 1; - } - } - description { state: "normal" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "pressed" 0.0; - inherit: "default" 0.0; - visible: 1; - color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_PRESSED_INC; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_SELECTED_INC; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 1; - color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_DISABLED_INC; - } - } - part { name: "disabler"; - repeat_events: 0; - scale: 1; - description { state: "default" 0.0; - visible: 0; - fixed: 1 1; - min: 1 1; - align: 0.0 0.5; - rel1 { - relative: 0.0 0.0; - to: "segment"; - } - rel2 { - relative: 1.0 1.0; - to: "segment"; - } - color: 255 255 255 150; - } - description { state: "disabled_single" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_BODY; - border: 5 5 5 5; - } - } - description { state: "disabled_left" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_LEFT; - border: 5 2 5 5; - } - } - description { state: "disabled_right" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_RIGHT; - border: 2 5 5 5; - } - } - description { state: "disabled_middle" 0.0; - inherit: "default" 0.0; - visible: 1; - image { - normal: GALLERY_EDC_IMAGE_BTN_SGE_NORMAL_CENTRE; - border: 0 0 7 7; - } - } - } - } - programs { - script { - public seg_type; // Single, Left, Middle, Right. - public seg_state; // Normal/Default, Pressed, Selected. - public seg_status;// Enabled/Default, Disabled - - public update_state() { - new type, state, disabled; - type = get_int(seg_type); - state = get_int(seg_state); - disabled = get_int(seg_status); - - if(state == SEGMENT_STATE_NORMAL) - { - if(type == SEGMENT_TYPE_SINGLE) - { - set_state(PART:"segment", "default_single", 0.0); - set_state(PART:"left_1pxl_padding", "default", 0.0); - set_state(PART:"right_1pxl_padding", "default", 0.0); - } - else if(type == SEGMENT_TYPE_LEFT) - { - set_state(PART:"segment", "default_left", 0.0); - set_state(PART:"left_1pxl_padding", "default", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_MIDDLE) - { - set_state(PART:"segment", "default_middle", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_RIGHT) - { - set_state(PART:"segment", "default_right", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "default", 0.0); - } - set_state(PART:"elm.text", "normal", 0.0); - } - else if(state == SEGMENT_STATE_PRESSED) - { - if(type == SEGMENT_TYPE_SINGLE) - { - set_state(PART:"segment", "pressed_single", 0.0); - set_state(PART:"left_1pxl_padding", "default", 0.0); - set_state(PART:"right_1pxl_padding", "default", 0.0); - } - else if(type == SEGMENT_TYPE_LEFT) - { - set_state(PART:"segment", "pressed_left", 0.0); - set_state(PART:"left_1pxl_padding", "default", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_MIDDLE) - { - set_state(PART:"segment", "pressed_middle", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_RIGHT) - { - set_state(PART:"segment", "pressed_right", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "default", 0.0); - } - set_state(PART:"elm.text", "pressed", 0.0); - } - else if(state == SEGMENT_STATE_SELECTED) - { - if(type == SEGMENT_TYPE_SINGLE) - { - set_state(PART:"segment", "selected_single", 0.0); - set_state(PART:"left_1pxl_padding", "default", 0.0); - set_state(PART:"right_1pxl_padding", "default", 0.0); - } - else if(type == SEGMENT_TYPE_LEFT) - { - set_state(PART:"segment", "selected_left", 0.0); - set_state(PART:"left_1pxl_padding", "default", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_MIDDLE) - { - set_state(PART:"segment", "selected_middle", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_RIGHT) - { - set_state(PART:"segment", "selected_right", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "default", 0.0); - } - set_state(PART:"elm.text", "selected", 0.0); - } - if(disabled == SEGMENT_STATUS_DISABLED) - { - if(type == SEGMENT_TYPE_SINGLE) - { - set_state(PART:"disabler", "disabled_single", 0.0); - } - else if(type == SEGMENT_TYPE_LEFT) - { - set_state(PART:"disabler", "disabled_left", 0.0); - set_state(PART:"left_1pxl_padding", "default", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_MIDDLE) - { - set_state(PART:"disabler", "disabled_middle", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "visible", 0.0); - } - else if(type == SEGMENT_TYPE_RIGHT) - { - set_state(PART:"disabler", "disabled_right", 0.0); - set_state(PART:"left_1pxl_padding", "visible", 0.0); - set_state(PART:"right_1pxl_padding", "default", 0.0); - } - set_state(PART:"elm.text", "disabled", 0.0); - } - else - { - set_state(PART:"disabler", "default", 0.0); - } - } - } - program { - name: "segment_type_s"; - signal: "elm,type,segment,single"; - source: "elm"; - script { - set_int(seg_type, SEGMENT_TYPE_SINGLE); - update_state(); - } - } - program { - name: "segment_type_l"; - signal: "elm,type,segment,left"; - source: "elm"; - script { - set_int(seg_type, SEGMENT_TYPE_LEFT); - update_state(); - } - } - program { - name: "segment_type_m"; - signal: "elm,type,segment,middle"; - source: "elm"; - script { - set_int(seg_type, SEGMENT_TYPE_MIDDLE); - update_state(); - } - } - program { - name: "segment_type_r"; - signal: "elm,type,segment,right"; - source: "elm"; - script { - set_int(seg_type, SEGMENT_TYPE_RIGHT); - update_state(); - } - } - program { - name: "normal_segment"; - signal: "elm,state,segment,normal"; - source: "elm"; - script { - set_int(seg_state, SEGMENT_STATE_NORMAL); - update_state(); - } - } - program { - name: "pressed_segment"; - signal: "elm,state,segment,pressed"; - source: "elm"; - script { - set_int(seg_state, SEGMENT_STATE_PRESSED); - update_state(); - } - } - program { - name: "selected_segment"; - signal: "elm,state,segment,selected"; - source: "elm"; - script { - set_int(seg_state, SEGMENT_STATE_SELECTED); - update_state(); - } - } - program { name: "disable_segment"; - signal: "elm,state,disabled"; - source: "elm"; - script { - set_int(seg_status, SEGMENT_STATUS_DISABLED); - update_state(); - } - } - program { name: "enable_segment"; - signal: "elm,state,enabled"; - source: "elm"; - script { - set_int(seg_status, SEGMENT_STATUS_ENABLED); - update_state(); - } - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.icon", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.icon", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "selected")) - set_state(PART:"elm.text", "selected", 0.0); - else - set_state(PART:"elm.text", "normal", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.icon", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.icon", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if ((!strcmp(st, "normal")) || (!strcmp(st, "selected"))) - { - set_state(PART:"elm.swallow.icon", "visible", 0.0); - set_state(PART:"padding_icon_text", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.icon", "icononly", 0.0); - set_state(PART:"padding_icon_text", "icononly", 0.0); - } - } - } - program { name: "icon_hide"; - signal: "elm,state,icon,hidden"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.swallow.icon"; - } - } -#undef SEGMENT_TYPE_SINGLE -#undef SEGMENT_TYPE_LEFT -#undef SEGMENT_TYPE_MIDDLE -#undef SEGMENT_TYPE_RIGHT -#undef SEGMENT_STATE_NORMAL -#undef SEGMENT_STATE_PRESSED -#undef SEGMENT_STATE_SELECTED -#undef SEGMENT_STATUS_ENABLED -#undef SEGMENT_STATUS_DISABLED -} diff --git a/res/edc/gl-toolbar.edc b/res/edc/gl-toolbar.edc deleted file mode 100755 index 7d144bd..0000000 --- a/res/edc/gl-toolbar.edc +++ /dev/null @@ -1,1744 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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 BUTTON_CONTROLBAR_ITEM_BUTTON_TEXT_SIZE_INC 28 -#define BUTTON_CONTROLBAR_ITEM_BUTTON_TEXTBLOCK_COLOR_INC "#f9f9f9" -#define BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC 56 56 -#define BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC 249 249 249 255 -#define BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC 249 249 249 255 - -#define ITEM_STATE_ENABLED 0 -#define ITEM_STATE_DISABLED 1 - -group { name: "elm/toolbar/base/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_CONTROL_TOOLBAR_BG COMP; - } - parts { - part { name: "base"; - mouse_events: 1; - description { state: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_CONTROL_TOOLBAR_BG; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "base"; - offset: 2 2; - } - rel2 { - to: "base"; - offset: -3 -3; - } - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - } - } - part { name: "event"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - } -} - -group { name: "elm/toolbar/item/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_TOOLBAR_PRESS COMP; - } - styles{ - style { name: "toolbar_style"; - base: "font=SLP:style=Medium font_size="BUTTON_CONTROLBAR_ITEM_BUTTON_TEXT_SIZE_INC" align=center color="BUTTON_CONTROLBAR_ITEM_BUTTON_TEXTBLOCK_COLOR_INC" wrap=mixed ellipsis=1"; - tag: "br" "\n"; - tag: "ps" "ps"; - tag: "hilight" "+ font=SLP:style=Bold"; - tag: "b" "+ font=SLP:style=Bold"; - tag: "tab" "\t"; - } - } - - data.item: "transition_animation_on" "1"; - script { - public item_state = ITEM_STATE_ENABLED; - } - parts { - part { name: "bg"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - image { - normal: GALLERY_EDC_IMAGE_TOOLBAR_PRESS; - border: 3 3 3 3; - } - image.middle: SOLID; - fill.smooth: 0; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: 10 8; - fixed: 1 1; - visible: 1; - color: 0 0 0 0; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: 10 5; - fixed: 1 1; - visible: 1; - color: 0 0 0 0; - } - } - part { - name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: 0 0; - fixed: 0 1; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - align: 0.5 0.0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - fixed: 0 1; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - align: 0.5 0.0; - color: 0 0 0 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_after_icon"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 0.0 1.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 0 1; - min: 0 0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.5 1.0; - rel1 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "elm.text"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_right_bottom"; - to_y: "elm.text"; - } - fixed: 0 1; - min: 0 0; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - clip_to: "elm.icon.clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - fixed: 0 1; - } - description { state: "visible" 0.0; - fixed: 0 1; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_right_bottom"; - to_y: "padding_before_text"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - description { state: "icononly" 0.0; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - } - part { name: "elm.swallow.icon_new"; - type: SWALLOW; - scale: 1; - clip_to: "elm.icon_new.clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - fixed: 0 1; - } - description { state: "visible" 0.0; - fixed: 0 1; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_right_bottom"; - to_y: "padding_before_text"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - description { state: "icononly" 0.0; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "elm.text.clipper"; - description { state: "default" 0.0; - visible: 1; - rel1 { - relative: 1.0 1.0; - to_x: "padding_left_top"; - to_y: "padding_after_icon"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; - fixed: 1 1; - text { - style: "toolbar_style"; - min: 0 1; - max: 0 1; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "elm.text_new"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "elm.text_new.clipper"; - description { state: "default" 0.0; - visible: 1; - rel1 { - relative: 1.0 1.0; - to_x: "padding_left_top"; - to_y: "padding_after_icon"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; - fixed: 1 1; - text { - style: "toolbar_style"; - min: 0 1; - max: 0 1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "elm.text.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "animation" 0.0; - color: 255 255 255 0; - } - description { state: "disabled" 0.0; - color: 255 255 255 153; - } - } - part { name: "elm.text_new.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - description { state: "animation" 0.0; - color: 255 255 255 255; - } - } - part { name: "elm.icon.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "animation" 0.0; - color: 255 255 255 0; - } - description { state: "disabled" 0.0; - color: 255 255 255 153; - } - } - part { name: "elm.icon_new.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - description { state: "animation" 0.0; - color: 255 255 255 255; - } - } - part { name: "event"; - type: RECT; - mouse_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "event2"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - } - programs { - program { name: "pressed"; - signal: "mouse,down,1"; - source: "event"; - script { - if (get_int(item_state) != ITEM_STATE_DISABLED) - set_state(PART:"bg", "selected", 0.0); - } - transition: LINEAR 0.2; - } - program { name: "unpressed"; - signal: "mouse,up,1"; - source: "event2"; - action: STATE_SET "default" 0.0; - target: "bg"; - transition: LINEAR 0.1; - } - program { name: "go"; - signal: "mouse,up,1"; - source: "event"; - action: SIGNAL_EMIT "elm,action,click" "elm"; - } - program { name: "mouse,in"; - signal: "mouse,in"; - source: "event"; - action: SIGNAL_EMIT "elm,mouse,in" "elm"; - } - program { name: "mouse,out"; - signal: "mouse,out"; - source: "event"; - action: SIGNAL_EMIT "elm,mouse,out" "elm"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - 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); - set_state(PART:"elm.text_new", "disabled_visible", 0.0); - } - else - { - set_state(PART:"elm.text", "disabled", 0.0); - set_state(PART:"elm.text_new", "disabled", 0.0); - } - set_state(PART:"elm.text.clipper", "disabled", 0.0); - set_state(PART:"elm.icon.clipper", "disabled", 0.0); - set_int(item_state, ITEM_STATE_DISABLED); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - 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); - set_state(PART:"elm.text_new", "visible", 0.0); - } - else - { - set_state(PART:"elm.text", "default", 0.0); - set_state(PART:"elm.text_new", "default", 0.0); - } - set_state(PART:"elm.text.clipper", "default", 0.0); - set_state(PART:"elm.icon.clipper", "default", 0.0); - set_int(item_state, ITEM_STATE_ENABLED); - } - } - program { name: "label_set,animation,forward"; - signal: "elm,state,label_set,forward"; - source: "elm"; - after: "label_set,animation"; - } - program { name: "label_set,animation,backward"; - signal: "elm,state,label_set,backward"; - source: "elm"; - after: "label_set,animation"; - } - program { name: "label_set,animation"; - signal: "elm,state,label_set"; - source: "elm"; - action: STATE_SET "animation" 0.0; - target: "elm.text.clipper"; - target: "elm.text_new.clipper"; - transition: LINEAR 0.2; - after: "label_set,animation,done"; - } - program { name: "label_set,animation,done"; - action: SIGNAL_EMIT "elm,state,label_set,done" "elm"; - } - program { name: "label,reset"; - signal: "elm,state,label,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text.clipper"; - target: "elm.text_new.clipper"; - } - program { name: "icon_set,animation,forward"; - signal: "elm,state,icon_set,forward"; - source: "elm"; - after: "icon_set,animation"; - } - program { name: "icon_set,animation,backward"; - signal: "elm,state,icon_set,backward"; - source: "elm"; - after: "icon_set,animation"; - } - program { name: "icon_set,animation"; - signal: "elm,state,icon_set"; - source: "elm"; - action: STATE_SET "animation" 0.0; - target: "elm.icon.clipper"; - target: "elm.icon_new.clipper"; - transition: LINEAR 0.2; - after: "icon_set,animation,done"; - } - program { name: "icon_set,animation,done"; - action: SIGNAL_EMIT "elm,state,icon_set,done" "elm"; - } - program { name: "icon,reset"; - signal: "elm,state,icon,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.icon.clipper"; - target: "elm.icon_new.clipper"; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.icon", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.icon", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - } - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.icon", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.icon", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.icon", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.icon", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - } - } - } - } -} - -group { name: "elm/toolbar/item/gallery/item_horizontal"; - inherit: "elm/toolbar/item/gallery/default"; - script { - public item_state = ITEM_STATE_ENABLED; - } - parts { - part { name: "icon_rect"; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - } - description { state: "visible" 0.0; - fixed: 1 0; - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - } - part { name: "padding_after_icon"; - description { state: "default" 0.0; //when only icon or no icon is there - rel1.relative: 1.0 0.0; - fixed: 1 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: 6 0; - } - } - part { name: "padding_before_text"; - description { state: "default" 0.0; //when only icon or no icon is there - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - min: 6 0; - } - } - part { name: "elm.swallow.icon"; - description { state: "default" 0.0; - align: 0.0 0.5; - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - aspect_preference: VERTICAL; - } - } - part { name: "elm.swallow.icon_new"; - description { state: "default" 0.0; - align: 0.0 0.5; - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - aspect_preference: VERTICAL; - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - description { state: "default" 0.0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - text { - style: "toolbar_style"; - min: 1 0; - max: 1 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "elm.text_new"; - type: TEXTBLOCK; - description { state: "default" 0.0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - text { - style: "toolbar_style"; - min: 1 0; - max: 1 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - } -} - -group { name: "elm/toolbar/separator/gallery/default"; - images { - image: GALLERY_EDC_IMAGE_SEPARATOR_V COMP; - } - parts { - part { name: "separator"; // separator group - description { state: "default" 0.0; - min: 2 2; - max: 2 9999; - rel1.offset: 4 4; - rel2.offset: -5 -5; - image { - normal: GALLERY_EDC_IMAGE_SEPARATOR_V; - } - fill { - smooth: 0; - } - } - } - } -} - -group { name: "elm/toolbar/object/gallery/default"; - parts { - part { name: "elm.swallow.object"; // object group - type: SWALLOW; - description { - state: "default" 0.0; - } - } - } -} - -group { name: "elm/toolbar/base/gallery/tabbar"; - images { - image: GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG_TOP COMP; - } - - parts { - part { name: "base"; - mouse_events: 1; - description { state: "default" 0.0; - image.normal: GALLERY_EDC_IMAGE_CONTROL_TABBAR_BG_TOP; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "base"; - offset: 2 2; - } - rel2 { - to: "base"; - offset: -3 -3; - } - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - } - } - part { name: "event"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - } -} - -group { name: "elm/toolbar/item/gallery/tabbar"; - alias: "elm/toolbar/item/gallery/tabbar/item_horizontal"; - images { - image: GALLERY_EDC_IMAGE_TABBAR_FOCUS COMP; - } - - data.item: "transition_animation_on" "1"; - parts { - part { name: "bg"; - mouse_events: 0; - description { state: "default" 0.0; - visible: 0; - color: 255 255 255 0; - image { - normal: GALLERY_EDC_IMAGE_TABBAR_FOCUS; - } - image.middle: SOLID; - fill.smooth: 0; - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - description { state: "disabled" 0.0; - inherit: "default" 0.0; - visible: 0; - color: 255 255 255 0; - } - } - part { name: "padding_left_top"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 0.0 0.0; - rel2.relative: 0.0 0.0; - min: 10 8; - fixed: 1 1; - visible: 1; - color: 0 0 0 0; - } - } - part { name: "padding_right_bottom"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - align: 1.0 1.0; - rel1.relative: 1.0 1.0; - min: 10 5; - fixed: 1 1; - visible: 1; - color: 0 0 0 0; - } - } - part { - name: "icon_rect"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; - min: 0 0; - fixed: 0 1; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - align: 0.5 0.0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - fixed: 0 1; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - align: 0.5 0.0; - color: 0 0 0 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_after_icon"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.0 0.0; - rel1 { - relative: 0.0 1.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 0 1; - min: 0 0; - color: 0 0 0 0; - } - description { state: "visible" 0.0; - align: 0.0 0.0; - rel1 { - relative: 0.0 1.0; - to: "icon_rect"; - } - rel2.to: "icon_rect"; - fixed: 0 1; - min: 0 0; - color: 0 0 0 0; - } - description { state: "icononly" 0.0; - inherit: "default" 0.0; - } - } - part { name: "padding_before_text"; - type: RECT; - scale: 1; - mouse_events: 0; - description { state: "default" 0.0; //when only icon or no icon is there - align: 0.5 1.0; - rel1 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "elm.text"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_right_bottom"; - to_y: "elm.text"; - } - fixed: 0 1; - min: 0 0; - color: 0 0 0 0; - } - } - part { name: "elm.swallow.icon"; - type: SWALLOW; - scale: 1; - clip_to: "elm.icon.clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - fixed: 0 1; - } - description { state: "visible" 0.0; - fixed: 0 1; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_right_bottom"; - to_y: "padding_before_text"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - description { state: "icononly" 0.0; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - } - part { name: "elm.swallow.icon_new"; - type: SWALLOW; - scale: 1; - clip_to: "elm.icon_new.clipper"; - description { state: "default" 0.0; - visible: 0; - align: 0.5 0.0; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 1.0; - to_x: "padding_right_bottom"; - to_y: "padding_left_top"; - } - fixed: 0 1; - } - description { state: "visible" 0.0; - fixed: 0 1; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_right_bottom"; - to_y: "padding_before_text"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - description { state: "icononly" 0.0; - min: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - max: BUTTON_CONTROLBAR_ITEM_BUTTON_ICON_SIZE_INC; - rel1 { - relative: 1.0 1.0; - to: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - aspect: 1.0 1.0; - aspect_preference: HORIZONTAL; - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "elm.text.clipper"; - description { state: "default" 0.0; - visible: 1; - rel1 { - relative: 1.0 1.0; - to_x: "padding_left_top"; - to_y: "padding_after_icon"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; - fixed: 1 1; - text { - style: "toolbar_style"; - min: 0 1; - max: 0 1; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "elm.text_new"; - type: TEXTBLOCK; - mouse_events: 0; - scale: 1; - clip_to: "elm.text_new.clipper"; - description { state: "default" 0.0; - visible: 1; - rel1 { - relative: 1.0 1.0; - to_x: "padding_left_top"; - to_y: "padding_after_icon"; - } - rel2 { - relative: 0.0 0.0; - to: "padding_right_bottom"; - } - color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC; - fixed: 1 1; - text { - style: "toolbar_style"; - min: 0 1; - max: 0 1; - } - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "elm.text.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "animation" 0.0; - color: 255 255 255 0; - } - description { state: "disabled" 0.0; - color: 255 255 255 153; - } - } - part { name: "elm.text_new.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - description { state: "animation" 0.0; - color: 255 255 255 255; - } - } - part { name: "elm.icon.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 255; - } - description { state: "animation" 0.0; - color: 255 255 255 0; - } - description { state: "disabled" 0.0; - color: 255 255 255 153; - } - } - part { name: "elm.icon_new.clipper"; - type: RECT; - description { state: "default" 0.0; - color: 255 255 255 0; - } - description { state: "animation" 0.0; - color: 255 255 255 255; - } - } - part { name: "event"; - type: RECT; - mouse_events: 1; - ignore_flags: ON_HOLD; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - } - programs { - program { name: "go_active"; - signal: "elm,state,selected"; - source: "elm"; - action: STATE_SET "selected" 0.0; - target: "bg"; - transition: LINEAR 0.2; - } - program { name: "go_passive"; - signal: "elm,state,unselected"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "bg"; - transition: LINEAR 0.1; - }/* - program { name: "pressed"; - signal: "mouse,down,1"; - source: "event"; - action: STATE_SET "selected" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.text_new"; - transition: LINEAR 0.2; - } - program { name: "unpressed"; - signal: "mouse,up,1"; - source: "event"; - action: STATE_SET "default" 0.0; - target: "bg"; - target: "elm.text"; - target: "elm.text_new"; - transition: LINEAR 0.1; - }*/ - program { name: "go"; - signal: "mouse,up,1"; - source: "event"; - action: SIGNAL_EMIT "elm,action,click" "elm"; - } - program { name: "mouse,in"; - signal: "mouse,in"; - source: "event"; - action: SIGNAL_EMIT "elm,mouse,in" "elm"; - } - program { name: "mouse,out"; - signal: "mouse,out"; - source: "event"; - action: SIGNAL_EMIT "elm,mouse,out" "elm"; - } - program { name: "disable"; - signal: "elm,state,disabled"; - source: "elm"; - action: STATE_SET "disabled" 0.0; - 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); - set_state(PART:"elm.text_new", "disabled_visible", 0.0); - } - else - { - set_state(PART:"elm.text", "disabled", 0.0); - set_state(PART:"elm.text_new", "disabled", 0.0); - } - set_state(PART:"elm.text.clipper", "disabled", 0.0); - set_state(PART:"elm.icon.clipper", "disabled", 0.0); - } - } - program { name: "enable"; - signal: "elm,state,enabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - 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); - set_state(PART:"elm.text_new", "visible", 0.0); - } - else - { - set_state(PART:"elm.text", "default", 0.0); - set_state(PART:"elm.text_new", "default", 0.0); - } - set_state(PART:"elm.text.clipper", "default", 0.0); - set_state(PART:"elm.icon.clipper", "default", 0.0); - } - } - program { name: "label_set,animation,forward"; - signal: "elm,state,label_set,forward"; - source: "elm"; - after: "label_set,animation"; - } - program { name: "label_set,animation,backward"; - signal: "elm,state,label_set,backward"; - source: "elm"; - after: "label_set,animation"; - } - program { name: "label_set,animation"; - signal: "elm,state,label_set"; - source: "elm"; - action: STATE_SET "animation" 0.0; - target: "elm.text.clipper"; - target: "elm.text_new.clipper"; - transition: LINEAR 0.2; - after: "label_set,animation,done"; - } - program { name: "label_set,animation,done"; - action: SIGNAL_EMIT "elm,state,label_set,done" "elm"; - } - program { name: "label,reset"; - signal: "elm,state,label,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.text.clipper"; - target: "elm.text_new.clipper"; - } - program { name: "icon_set,animation,forward"; - signal: "elm,state,icon_set,forward"; - source: "elm"; - after: "icon_set,animation"; - } - program { name: "icon_set,animation,backward"; - signal: "elm,state,icon_set,backward"; - source: "elm"; - after: "icon_set,animation"; - } - program { name: "icon_set,animation"; - signal: "elm,state,icon_set"; - source: "elm"; - action: STATE_SET "animation" 0.0; - target: "elm.icon.clipper"; - target: "elm.icon_new.clipper"; - transition: LINEAR 0.2; - after: "icon_set,animation,done"; - } - program { name: "icon_set,animation,done"; - action: SIGNAL_EMIT "elm,state,icon_set,done" "elm"; - } - program { name: "icon,reset"; - signal: "elm,state,icon,reset"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "elm.icon.clipper"; - target: "elm.icon_new.clipper"; - } - program { name: "text_show"; - signal: "elm,state,text,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.icon", st, 30, vl); - if (!strcmp(st, "icononly")) - { - set_state(PART:"elm.swallow.icon", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - } - set_state(PART:"elm.text", "visible", 0.0); - } - } - program { name: "text_hide"; - signal: "elm,state,text,hidden"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.swallow.icon", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.icon", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - } - set_state(PART:"elm.text", "default", 0.0); - } - } - program { name: "icon_show"; - signal: "elm,state,icon,visible"; - source: "elm"; - script { - new st[31]; - new Float:vl; - get_state(PART:"elm.text", st, 30, vl); - if (!strcmp(st, "visible")) - { - set_state(PART:"elm.swallow.icon", "visible", 0.0); - set_state(PART:"icon_rect", "visible", 0.0); - set_state(PART:"padding_after_icon", "visible", 0.0); - } - else - { - set_state(PART:"elm.swallow.icon", "icononly", 0.0); - set_state(PART:"icon_rect", "icononly", 0.0); - set_state(PART:"padding_after_icon", "icononly", 0.0); - } - } - } - } -} - -group { name: "elm/toolbar/item/gallery/tabbar/item_horizontal"; - inherit: "elm/toolbar/item/gallery/tabbar"; - script { - public item_state = ITEM_STATE_ENABLED; - } - parts { - part { name: "icon_rect"; - description { state: "default" 0.0; - fixed: 1 0; - align: 0.0 0.5; - } - description { state: "visible" 0.0; - fixed: 1 0; - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - align: 0.0 0.5; - } - } - part { name: "padding_after_icon"; - description { state: "default" 0.0; //when only icon or no icon is there - rel1.relative: 1.0 0.0; - fixed: 1 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - min: 6 0; - } - } - part { name: "padding_before_text"; - description { state: "default" 0.0; //when only icon or no icon is there - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "elm.text"; - to_y: "padding_left_top"; - } - rel2 { - to_x: "elm.text"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - min: 6 0; - } - } - part { name: "elm.swallow.icon"; - description { state: "default" 0.0; - align: 0.0 0.5; - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - aspect_preference: VERTICAL; - } - } - part { name: "elm.swallow.icon_new"; - description { state: "default" 0.0; - align: 0.0 0.5; - rel2 { - relative: 1.0 0.0; - to_x: "padding_left_top"; - to_y: "padding_right_bottom"; - } - fixed: 1 0; - } - description { state: "visible" 0.0; - fixed: 1 0; - align: 1.0 0.5; - rel1 { - relative: 0.0 1.0; - to_x: "padding_before_text"; - to_y: "padding_left_top"; - } - rel2 { - relative: 0.0 0.0; - to_x: "padding_before_text"; - to_y: "padding_right_bottom"; - } - aspect_preference: VERTICAL; - } - description { state: "icononly" 0.0; - aspect_preference: VERTICAL; - } - } - part { name: "elm.text"; - type: TEXTBLOCK; - description { state: "default" 0.0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - text { - style: "toolbar_style"; - min: 1 0; - max: 1 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - part { name: "elm.text_new"; - type: TEXTBLOCK; - description { state: "default" 0.0; - rel1 { - relative: 1.0 1.0; - to_x: "padding_after_icon"; - to_y: "padding_left_top"; - } - text { - style: "toolbar_style"; - min: 1 0; - max: 1 0; - } - } - description { state: "selected" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "visible" 0.0; - inherit: "default" 0.0; - visible: 1; - } - description { state: "clicked" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - description { state: "focused" 0.0; - inherit: "default" 0.0; - visible: 1; - color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC; - } - } - } -} - -group { name: "elm/toolbar/base/naviframe"; - parts { - part { name: "base"; - mouse_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - part { name: "clipper"; - type: RECT; - mouse_events: 0; - description { - state: "default" 0.0; - rel1 { - to: "base"; - offset: 2 2; - } - rel2 { - to: "base"; - offset: -3 -3; - } - } - } - part { name: "elm.swallow.content"; - clip_to: "clipper"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1.to: "clipper"; - rel2.to: "clipper"; - } - } - part { name: "event"; - type: RECT; - mouse_events: 1; - repeat_events: 1; - description { state: "default" 0.0; - color: 0 0 0 0; - } - } - } -} - -group { name: "elm/toolbar/object/naviframe"; - parts { - part { name: "elm.swallow.object"; // object group - type: SWALLOW; - description { - state: "default" 0.0; - rel1.offset: 5 0; - rel2.offset: -6 -1; - } - } - } -} - diff --git a/res/enc/conf.enc b/res/enc/conf.enc deleted file mode 100755 index 986bf67..0000000 Binary files a/res/enc/conf.enc and /dev/null differ diff --git a/res/icon/org.tizen.gallery.png b/res/icon/org.tizen.gallery.png index 1a0c715..a420dd7 100755 Binary files a/res/icon/org.tizen.gallery.png and b/res/icon/org.tizen.gallery.png differ diff --git a/res/images/00_MessageBubble_BG_receive.png b/res/images/00_MessageBubble_BG_receive.png deleted file mode 100755 index 487636f..0000000 Binary files a/res/images/00_MessageBubble_BG_receive.png and /dev/null differ diff --git a/res/images/00_MessageBubble_BG_send.png b/res/images/00_MessageBubble_BG_send.png deleted file mode 100755 index bc30b93..0000000 Binary files a/res/images/00_MessageBubble_BG_send.png and /dev/null differ diff --git a/res/images/00_button_01_normal_dim.png b/res/images/00_button_01_normal_dim.png deleted file mode 100644 index 7bb54fc..0000000 Binary files a/res/images/00_button_01_normal_dim.png and /dev/null differ diff --git a/res/images/00_button_01_normal_press.png b/res/images/00_button_01_normal_press.png deleted file mode 100644 index 829554a..0000000 Binary files a/res/images/00_button_01_normal_press.png and /dev/null differ diff --git a/res/images/00_button_02_normal.png b/res/images/00_button_02_normal.png deleted file mode 100644 index 2d3c75a..0000000 Binary files a/res/images/00_button_02_normal.png and /dev/null differ diff --git a/res/images/00_button_04_dim.png b/res/images/00_button_04_dim.png deleted file mode 100644 index df381ba..0000000 Binary files a/res/images/00_button_04_dim.png and /dev/null differ diff --git a/res/images/00_button_04_normal.png b/res/images/00_button_04_normal.png deleted file mode 100644 index 1709d98..0000000 Binary files a/res/images/00_button_04_normal.png and /dev/null differ diff --git a/res/images/00_button_04_press.png b/res/images/00_button_04_press.png deleted file mode 100644 index 829554a..0000000 Binary files a/res/images/00_button_04_press.png and /dev/null differ diff --git a/res/images/00_button_popup_focus.png b/res/images/00_button_popup_focus.png deleted file mode 100644 index ca979d4..0000000 Binary files a/res/images/00_button_popup_focus.png and /dev/null differ diff --git a/res/images/00_button_popup_normal.png b/res/images/00_button_popup_normal.png deleted file mode 100644 index 79f8a59..0000000 Binary files a/res/images/00_button_popup_normal.png and /dev/null differ diff --git a/res/images/00_button_popup_press.png b/res/images/00_button_popup_press.png deleted file mode 100644 index e691671..0000000 Binary files a/res/images/00_button_popup_press.png and /dev/null differ diff --git a/res/images/00_button_rename_press.png b/res/images/00_button_rename_press.png deleted file mode 100644 index 4a0215c..0000000 Binary files a/res/images/00_button_rename_press.png and /dev/null differ diff --git a/res/images/00_button_sweep.png b/res/images/00_button_sweep.png deleted file mode 100644 index 6d9c78f..0000000 Binary files a/res/images/00_button_sweep.png and /dev/null differ diff --git a/res/images/00_button_sweep_dim.png b/res/images/00_button_sweep_dim.png deleted file mode 100644 index ee06ef6..0000000 Binary files a/res/images/00_button_sweep_dim.png and /dev/null differ diff --git a/res/images/00_button_sweep_press.png b/res/images/00_button_sweep_press.png deleted file mode 100644 index 04a2e9d..0000000 Binary files a/res/images/00_button_sweep_press.png and /dev/null differ diff --git a/res/images/00_check_bg_dim.png b/res/images/00_check_bg_dim.png deleted file mode 100644 index d95649c..0000000 Binary files a/res/images/00_check_bg_dim.png and /dev/null differ diff --git a/res/images/00_grid_edit_text_bg.png b/res/images/00_grid_edit_text_bg.png deleted file mode 100755 index 9d79d1e..0000000 Binary files a/res/images/00_grid_edit_text_bg.png and /dev/null differ diff --git a/res/images/00_winset_Back_btn_normal.png b/res/images/00_winset_Back_btn_normal.png deleted file mode 100755 index cb7ca0b..0000000 Binary files a/res/images/00_winset_Back_btn_normal.png and /dev/null differ diff --git a/res/images/00_winset_Back_btn_press.png b/res/images/00_winset_Back_btn_press.png deleted file mode 100755 index 7032b70..0000000 Binary files a/res/images/00_winset_Back_btn_press.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_body.png b/res/images/00_winset_btn_sge_body.png deleted file mode 100644 index 5be172b..0000000 Binary files a/res/images/00_winset_btn_sge_body.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_normal.png b/res/images/00_winset_btn_sge_normal.png deleted file mode 100644 index 8babbff..0000000 Binary files a/res/images/00_winset_btn_sge_normal.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_normal_centre.png b/res/images/00_winset_btn_sge_normal_centre.png deleted file mode 100644 index 78f6ac0..0000000 Binary files a/res/images/00_winset_btn_sge_normal_centre.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_normal_left.png b/res/images/00_winset_btn_sge_normal_left.png deleted file mode 100644 index 54095be..0000000 Binary files a/res/images/00_winset_btn_sge_normal_left.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_normal_right.png b/res/images/00_winset_btn_sge_normal_right.png deleted file mode 100644 index 670f953..0000000 Binary files a/res/images/00_winset_btn_sge_normal_right.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_press_01.png b/res/images/00_winset_btn_sge_press_01.png deleted file mode 100644 index 845b19f..0000000 Binary files a/res/images/00_winset_btn_sge_press_01.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_press_02.png b/res/images/00_winset_btn_sge_press_02.png deleted file mode 100644 index 5bc86d0..0000000 Binary files a/res/images/00_winset_btn_sge_press_02.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_press_03.png b/res/images/00_winset_btn_sge_press_03.png deleted file mode 100644 index bd0f1bd..0000000 Binary files a/res/images/00_winset_btn_sge_press_03.png and /dev/null differ diff --git a/res/images/00_winset_btn_sge_press_normal.png b/res/images/00_winset_btn_sge_press_normal.png deleted file mode 100644 index 20cd6d4..0000000 Binary files a/res/images/00_winset_btn_sge_press_normal.png and /dev/null differ diff --git a/res/images/00_winset_control_tabbar_bg.png b/res/images/00_winset_control_tabbar_bg.png deleted file mode 100644 index 84d70d6..0000000 Binary files a/res/images/00_winset_control_tabbar_bg.png and /dev/null differ diff --git a/res/images/00_winset_control_tabbar_bg_left.png b/res/images/00_winset_control_tabbar_bg_left.png deleted file mode 100644 index 51a7f80..0000000 Binary files a/res/images/00_winset_control_tabbar_bg_left.png and /dev/null differ diff --git a/res/images/00_winset_control_tabbar_bg_right.png b/res/images/00_winset_control_tabbar_bg_right.png deleted file mode 100644 index 4a08d75..0000000 Binary files a/res/images/00_winset_control_tabbar_bg_right.png and /dev/null differ diff --git a/res/images/00_winset_tabbar_focus_left.png b/res/images/00_winset_tabbar_focus_left.png deleted file mode 100755 index 72217df..0000000 Binary files a/res/images/00_winset_tabbar_focus_left.png and /dev/null differ diff --git a/res/images/00_winset_tabbar_focus_right.png b/res/images/00_winset_tabbar_focus_right.png deleted file mode 100755 index d9400e6..0000000 Binary files a/res/images/00_winset_tabbar_focus_right.png and /dev/null differ diff --git a/res/images/00_winset_tabbar_press.png b/res/images/00_winset_tabbar_press.png deleted file mode 100755 index 002b02c..0000000 Binary files a/res/images/00_winset_tabbar_press.png and /dev/null differ diff --git a/res/images/00_winset_tabbar_press_left.png b/res/images/00_winset_tabbar_press_left.png deleted file mode 100755 index bc0b2f0..0000000 Binary files a/res/images/00_winset_tabbar_press_left.png and /dev/null differ diff --git a/res/images/00_winset_tabbar_press_right.png b/res/images/00_winset_tabbar_press_right.png deleted file mode 100755 index ee617ce..0000000 Binary files a/res/images/00_winset_tabbar_press_right.png and /dev/null differ diff --git a/res/images/00_winset_tabbar_press_top.png b/res/images/00_winset_tabbar_press_top.png deleted file mode 100644 index 28d74b6..0000000 Binary files a/res/images/00_winset_tabbar_press_top.png and /dev/null differ diff --git a/res/images/T01_EditField_clear.png b/res/images/T01_EditField_clear.png deleted file mode 100644 index 8335151..0000000 Binary files a/res/images/T01_EditField_clear.png and /dev/null differ diff --git a/res/images/T01_Option_header_bt.png b/res/images/T01_Option_header_bt.png deleted file mode 100644 index fedede6..0000000 Binary files a/res/images/T01_Option_header_bt.png and /dev/null differ diff --git a/res/images/T01_Option_header_bt_dim.png b/res/images/T01_Option_header_bt_dim.png deleted file mode 100644 index 501d9e8..0000000 Binary files a/res/images/T01_Option_header_bt_dim.png and /dev/null differ diff --git a/res/images/T01_Option_header_bt_press.png b/res/images/T01_Option_header_bt_press.png deleted file mode 100644 index 978107c..0000000 Binary files a/res/images/T01_Option_header_bt_press.png and /dev/null differ diff --git a/res/images/T01_album_checkbox.png b/res/images/T01_album_checkbox.png deleted file mode 100644 index 10b692d..0000000 Binary files a/res/images/T01_album_checkbox.png and /dev/null differ diff --git a/res/images/T01_album_checkbox_check.png b/res/images/T01_album_checkbox_check.png deleted file mode 100644 index 95ef8fa..0000000 Binary files a/res/images/T01_album_checkbox_check.png and /dev/null differ diff --git a/res/images/T01_btn_gridview_press.png b/res/images/T01_btn_gridview_press.png deleted file mode 100644 index c94ae7c..0000000 Binary files a/res/images/T01_btn_gridview_press.png and /dev/null differ diff --git a/res/images/T01_button_circle_bg_normal.png b/res/images/T01_button_circle_bg_normal.png deleted file mode 100644 index b5c5c6c..0000000 Binary files a/res/images/T01_button_circle_bg_normal.png and /dev/null differ diff --git a/res/images/T01_button_circle_bg_normal_press.png b/res/images/T01_button_circle_bg_normal_press.png deleted file mode 100644 index 9ffa194..0000000 Binary files a/res/images/T01_button_circle_bg_normal_press.png and /dev/null differ diff --git a/res/images/T01_button_rename.png b/res/images/T01_button_rename.png deleted file mode 100644 index a30b486..0000000 Binary files a/res/images/T01_button_rename.png and /dev/null differ diff --git a/res/images/T01_check.png b/res/images/T01_check.png deleted file mode 100644 index d5057e4..0000000 Binary files a/res/images/T01_check.png and /dev/null differ diff --git a/res/images/T01_checkbox.png b/res/images/T01_checkbox.png deleted file mode 100644 index 61dc76a..0000000 Binary files a/res/images/T01_checkbox.png and /dev/null differ diff --git a/res/images/T01_control_tabbar_bg.png b/res/images/T01_control_tabbar_bg.png deleted file mode 100644 index 502d4b7..0000000 Binary files a/res/images/T01_control_tabbar_bg.png and /dev/null differ diff --git a/res/images/T01_control_tabbar_bg_h.png b/res/images/T01_control_tabbar_bg_h.png deleted file mode 100644 index b20ca53..0000000 Binary files a/res/images/T01_control_tabbar_bg_h.png and /dev/null differ diff --git a/res/images/T01_list_icon_bookmark.png b/res/images/T01_list_icon_bookmark.png deleted file mode 100755 index 4a85437..0000000 Binary files a/res/images/T01_list_icon_bookmark.png and /dev/null differ diff --git a/res/images/T01_tabbar_focus.png b/res/images/T01_tabbar_focus.png deleted file mode 100644 index 6c46e25..0000000 Binary files a/res/images/T01_tabbar_focus.png and /dev/null differ diff --git a/res/images/T01_title_btn.png b/res/images/T01_title_btn.png deleted file mode 100644 index 20c31f1..0000000 Binary files a/res/images/T01_title_btn.png and /dev/null differ diff --git a/res/images/T01_title_btn_press.png b/res/images/T01_title_btn_press.png deleted file mode 100644 index 49861ed..0000000 Binary files a/res/images/T01_title_btn_press.png and /dev/null differ diff --git a/res/images/T01_toolbar_bg.png b/res/images/T01_toolbar_bg.png deleted file mode 100644 index 63cad45..0000000 Binary files a/res/images/T01_toolbar_bg.png and /dev/null differ diff --git a/res/images/T01_toolbar_press.png b/res/images/T01_toolbar_press.png deleted file mode 100644 index 825785c..0000000 Binary files a/res/images/T01_toolbar_press.png and /dev/null differ diff --git a/res/images/T01_video_list_progress_bg.png b/res/images/T01_video_list_progress_bg.png deleted file mode 100644 index ce1f37a..0000000 Binary files a/res/images/T01_video_list_progress_bg.png and /dev/null differ diff --git a/res/images/bt_sm_base2.png b/res/images/bt_sm_base2.png deleted file mode 100644 index f159648..0000000 Binary files a/res/images/bt_sm_base2.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_left.png b/res/images/copy&paste_Icon_left.png deleted file mode 100755 index ccb6b09..0000000 Binary files a/res/images/copy&paste_Icon_left.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_left_press.png b/res/images/copy&paste_Icon_left_press.png deleted file mode 100755 index 0661a0b..0000000 Binary files a/res/images/copy&paste_Icon_left_press.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_left_top.png b/res/images/copy&paste_Icon_left_top.png deleted file mode 100755 index ebe24a4..0000000 Binary files a/res/images/copy&paste_Icon_left_top.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_left_top_press.png b/res/images/copy&paste_Icon_left_top_press.png deleted file mode 100755 index b715059..0000000 Binary files a/res/images/copy&paste_Icon_left_top_press.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_right.png b/res/images/copy&paste_Icon_right.png deleted file mode 100755 index c658e9e..0000000 Binary files a/res/images/copy&paste_Icon_right.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_right_press.png b/res/images/copy&paste_Icon_right_press.png deleted file mode 100755 index 3e33af7..0000000 Binary files a/res/images/copy&paste_Icon_right_press.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_right_top.png b/res/images/copy&paste_Icon_right_top.png deleted file mode 100755 index 300eebc..0000000 Binary files a/res/images/copy&paste_Icon_right_top.png and /dev/null differ diff --git a/res/images/copy&paste_Icon_right_top_press.png b/res/images/copy&paste_Icon_right_top_press.png deleted file mode 100755 index 1dc1ad1..0000000 Binary files a/res/images/copy&paste_Icon_right_top_press.png and /dev/null differ diff --git a/res/images/gallery_btn_sge_normal.png b/res/images/gallery_btn_sge_normal.png deleted file mode 100644 index 1aaa327..0000000 Binary files a/res/images/gallery_btn_sge_normal.png and /dev/null differ diff --git a/res/images/magnifier.png b/res/images/magnifier.png deleted file mode 100644 index 0547496..0000000 Binary files a/res/images/magnifier.png and /dev/null differ diff --git a/res/images/magnifier_line.png b/res/images/magnifier_line.png deleted file mode 100644 index 14ba52c..0000000 Binary files a/res/images/magnifier_line.png and /dev/null differ diff --git a/res/images/magnifier_noarrow.png b/res/images/magnifier_noarrow.png deleted file mode 100644 index 7cbd2a7..0000000 Binary files a/res/images/magnifier_noarrow.png and /dev/null differ diff --git a/res/images/magnifier_noarrow_line.png b/res/images/magnifier_noarrow_line.png deleted file mode 100644 index fcfdb10..0000000 Binary files a/res/images/magnifier_noarrow_line.png and /dev/null differ diff --git a/res/images/naviframe_optionheader.png b/res/images/naviframe_optionheader.png deleted file mode 100644 index 79a20ff..0000000 Binary files a/res/images/naviframe_optionheader.png and /dev/null differ diff --git a/res/images/naviframe_optionheader_arrow.png b/res/images/naviframe_optionheader_arrow.png deleted file mode 100644 index 5b39fe1..0000000 Binary files a/res/images/naviframe_optionheader_arrow.png and /dev/null differ diff --git a/res/images/reader_handler_down.png b/res/images/reader_handler_down.png deleted file mode 100644 index 8e95761..0000000 Binary files a/res/images/reader_handler_down.png and /dev/null differ diff --git a/res/images/reader_handler_up.png b/res/images/reader_handler_up.png deleted file mode 100644 index 172e2a3..0000000 Binary files a/res/images/reader_handler_up.png and /dev/null differ diff --git a/res/images/reader_longtap_blue.png b/res/images/reader_longtap_blue.png deleted file mode 100644 index 16df225..0000000 Binary files a/res/images/reader_longtap_blue.png and /dev/null differ diff --git a/res/images/separator_v.png b/res/images/separator_v.png deleted file mode 100755 index cd1b018..0000000 Binary files a/res/images/separator_v.png and /dev/null differ diff --git a/res/po/CMakeLists.txt b/res/po/CMakeLists.txt index 2e5ef6d..b1d7e1f 100755 --- a/res/po/CMakeLists.txt +++ b/res/po/CMakeLists.txt @@ -1,9 +1,8 @@ # for i18n -#SET(POFILES en_US.po en_GB.po ja.po ko.po zh_CN.po) -#SET(POFILES en_US.po nl.po de.po zh_HK.po zh_CN.po ru.po ko.po -# zh_TW.po ja.po es.po el.po it.po tr.po pt.po fr.po) -SET(POFILES en.po nl_NL.po de_DE.po zh_HK.po zh_CN.po ru_RU.po ko_KR.po zh_TW.po ja_JP.po es_ES.po el_GR.po it_IT.po tr_TR.po pt_PT.po fr_FR.po) +SET(POFILES ar.po bg.po ca.po cs.po da.po de_DE.po el_GR.po en.po en_US.po es_ES.po fi.po fr_FR.po +he.po hi.po hr.po hu.po id.po it_IT.po ja_JP.po ko_KR.po lt.po lv.po ms.po nl_NL.po no.po pl.po +pt_PT.po ro.po ru_RU.po sk.po sl.po sr.po sv.po th.po tr_TR.po uk.po vi.po zh_CN.po zh_HK.po zh_TW.po) SET(MSGFMT "/usr/bin/msgfmt") diff --git a/res/po/POTFILES.in b/res/po/POTFILES.in index 8af85a8..e8ad1de 100755 --- a/res/po/POTFILES.in +++ b/res/po/POTFILES.in @@ -3,11 +3,26 @@ ../src/features/gl-albums.c ../src/features/gl-gridview.c ../src/features/gl-listview.c -../src/features/gl-controlbar.c -../src/features/gl-button.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-ui-util.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 -../src/util/gl-ta.c src/util/gl-db-handler.c diff --git a/res/po/ar.po b/res/po/ar.po new file mode 100755 index 0000000..b91b7c3 --- /dev/null +++ b/res/po/ar.po @@ -0,0 +1,39 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +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_HEADER_SELECT_ITEM" +msgstr "اختيار عنصر" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "تحديد ألبوم‬" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "كافة الألبومات" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "هل تريد إعادة المحاولة؟" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "نفس الاسم مستخدم مسبقا" + +msgid "IDS_MEDIABR_POP_LOADING_PLEASE_WAIT_ING" +msgstr "يتم التحميل. يرجى الانتظار..." + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "المدخل خالي" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "متغير إدخال غير صحيح" + diff --git a/res/po/bg.po b/res/po/bg.po new file mode 100755 index 0000000..dc68746 --- /dev/null +++ b/res/po/bg.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +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_HEADER_SELECT_ITEM" +msgstr "Изберете елемент" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Избор на албум" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +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 "Невалиден параметър на входа" + diff --git a/res/po/ca.po b/res/po/ca.po new file mode 100755 index 0000000..12dac19 --- /dev/null +++ b/res/po/ca.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Cap àlbum" + +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_HEADER_SELECT_ITEM" +msgstr "Seleccionar element" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Seleccionar àlbum" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Tots els àlbums" + +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" + diff --git a/res/po/cs.po b/res/po/cs.po new file mode 100755 index 0000000..25c09f2 --- /dev/null +++ b/res/po/cs.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Žádná alba" + +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_HEADER_SELECT_ITEM" +msgstr "Vybrat položku" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Vybrat album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "VÅ¡echna alba" + +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" + diff --git a/res/po/da.po b/res/po/da.po new file mode 100755 index 0000000..b15758a --- /dev/null +++ b/res/po/da.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ingen album" + +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_HEADER_SELECT_ITEM" +msgstr "Vælg element" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Vælg album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alle 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" + diff --git a/res/po/de_DE.po b/res/po/de_DE.po index 63585ec..0572190 100755 --- a/res/po/de_DE.po +++ b/res/po/de_DE.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Neues Album" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Keine Alben" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Während der USB-Speichermodus aktiv ist, kann nicht gestartet werden." +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Album erstellen" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Umbenennen nicht möglich" diff --git a/res/po/el_GR.po b/res/po/el_GR.po index 41a630c..2724107 100755 --- a/res/po/el_GR.po +++ b/res/po/el_GR.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Νέο άλμπουμ" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Δεν υπάρχουν άλμπουμ" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Δεν είναι δυνατή η εκκίνηση όταν η λειτουργία αποθήκευσης USB είναι ενεργή" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Δημιουργία άλμπουμ" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Δεν είναι δυνατή η μετονομασία" diff --git a/res/po/en.po b/res/po/en.po index 4648c34..318ebb7 100755 --- a/res/po/en.po +++ b/res/po/en.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "New album" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "No albums" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Unable to start while USB storage mode active" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Create album" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Unable to rename" diff --git a/res/po/en_US.po b/res/po/en_US.po new file mode 100755 index 0000000..318ebb7 --- /dev/null +++ b/res/po/en_US.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "No albums" + +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_HEADER_SELECT_ITEM" +msgstr "Select item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Select album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "All albums" + +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" + diff --git a/res/po/es_ES.po b/res/po/es_ES.po index 4019ae0..6ca2fc6 100755 --- a/res/po/es_ES.po +++ b/res/po/es_ES.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Nuevo álbum" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "No hay álbumes" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "No se puede iniciar cuando está activo el modo de almacenamiento USB" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Crear álbum" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Imposible cambiar el nombre" diff --git a/res/po/fi.po b/res/po/fi.po new file mode 100755 index 0000000..ca26577 --- /dev/null +++ b/res/po/fi.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ei albumeita" + +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_HEADER_SELECT_ITEM" +msgstr "Valitse kohde" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Valitse albumi" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Kaikki albumit" + +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" + diff --git a/res/po/fr_FR.po b/res/po/fr_FR.po index 2368662..ebd380c 100755 --- a/res/po/fr_FR.po +++ b/res/po/fr_FR.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Nouvel album" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Aucun album" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Impossible de démarrer tant que le mode de stockage USB est activé" +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" diff --git a/res/po/he.po b/res/po/he.po new file mode 100755 index 0000000..9f4977e --- /dev/null +++ b/res/po/he.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +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_HEADER_SELECT_ITEM" +msgstr "בחר פריט" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "בחר אלבום" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +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 "פרמטר קלט לא חוקי" + diff --git a/res/po/hi.po b/res/po/hi.po new file mode 100755 index 0000000..e66f26c --- /dev/null +++ b/res/po/hi.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +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_HEADER_SELECT_ITEM" +msgstr "आइटम चुनें" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "एल्बम चुनें" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +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 "अमान्य इनपुट पैरामीटर" + diff --git a/res/po/hr.po b/res/po/hr.po new file mode 100755 index 0000000..9847caf --- /dev/null +++ b/res/po/hr.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nema albuma" + +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_HEADER_SELECT_ITEM" +msgstr "Odaberite stavku" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Odaberi album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Svi albumi" + +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" + diff --git a/res/po/hu.po b/res/po/hu.po new file mode 100755 index 0000000..41d57fe --- /dev/null +++ b/res/po/hu.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nincs album" + +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_HEADER_SELECT_ITEM" +msgstr "Elem kiválasztása" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Album kiválasztása" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Összes album" + +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" + diff --git a/res/po/id.po b/res/po/id.po new file mode 100755 index 0000000..1366860 --- /dev/null +++ b/res/po/id.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Tidak ada album" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Buat album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Gagal menamai ulang" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Tanpa nama" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Tidak ada album yang dipilih" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Pilih item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Pilih album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Semua album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Coba ulang?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Nama yg sama telah digunakan" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Entri kosong" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parameter input tidak berlaku" + diff --git a/res/po/it_IT.po b/res/po/it_IT.po index 88bfe65..1258a13 100755 --- a/res/po/it_IT.po +++ b/res/po/it_IT.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Nuovo album" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Nessun album" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Impossibile avviare se la modalità archiviazione USB è attiva" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Crea album" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Impossibile rinominare" diff --git a/res/po/ja_JP.po b/res/po/ja_JP.po index 32bd2d6..762c093 100755 --- a/res/po/ja_JP.po +++ b/res/po/ja_JP.po @@ -1,14 +1,11 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "新規​アルバム" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "アルバム​が​ありません。" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "ユーザーメモリ(本体)起動中は、開始できません" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "アルバム​作成" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" -msgstr "名前を変更​できません" +msgstr "名前​を​変更​でき​ません。" msgid "IDS_MEDIABR_POP_NO_NAME" msgstr "名前なし" @@ -17,13 +14,13 @@ msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" msgstr "アルバムが選択されていません。" msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" -msgstr "アイテムを選択してください。" +msgstr "アイテム​を​選択​" msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" msgstr " アルバム​を​選択" msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" -msgstr "全アルバム" +msgstr "全​アルバム" msgid "IDS_MEDIABR_POP_RETRY_Q" msgstr "やり直し​ます​か?" @@ -35,5 +32,5 @@ msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" msgstr "未入力​です" msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" -msgstr "入力​パラメーター​が​無効​です" +msgstr "入力パラメータが無効です。" diff --git a/res/po/ko_KR.po b/res/po/ko_KR.po index 867aa68..a559554 100755 --- a/res/po/ko_KR.po +++ b/res/po/ko_KR.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "새 앨범" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "앨범이 없습니다" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "내장 메모리 모드가 실행되어 있을 때는 시작할 수 없습니다" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "앨범 추가" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "이름을 변경할 수 없습니다" @@ -17,7 +14,7 @@ msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" msgstr "선택된 앨범이 없습니다" msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" -msgstr "항목을 선택하세요" +msgstr "항목 선택" msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" msgstr "앨범 선택" diff --git a/res/po/lt.po b/res/po/lt.po new file mode 100755 index 0000000..2aaeb5e --- /dev/null +++ b/res/po/lt.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Albumų nėra" + +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_HEADER_SELECT_ITEM" +msgstr "Pasirinkti elementą" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Pasirinkti albumą" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Visi albumai" + +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" + diff --git a/res/po/lv.po b/res/po/lv.po new file mode 100755 index 0000000..7f8aa53 --- /dev/null +++ b/res/po/lv.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nav albumu" + +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_HEADER_SELECT_ITEM" +msgstr "Izvēlieties vienumu" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Izvēlēties albumu" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Visi albumi" + +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" + diff --git a/res/po/ms.po b/res/po/ms.po new file mode 100755 index 0000000..62723af --- /dev/null +++ b/res/po/ms.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Tiada album" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Cipta album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Tidak boleh menamakan semula" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Tiada nama" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Tiada album dipilih" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Pilih item" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Pilih album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Semua album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Cuba semula?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Nama sama telah digunakan" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Masukan adalah kosong" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Parameter tidak sah" + diff --git a/res/po/nl_NL.po b/res/po/nl_NL.po index 840a5a6..bd1c1a7 100755 --- a/res/po/nl_NL.po +++ b/res/po/nl_NL.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Nieuw album" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Geen albums" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Kan niet starten als USB-opslag actief is" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Album maken" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Kan de naam niet wijzigen" diff --git a/res/po/no.po b/res/po/no.po new file mode 100755 index 0000000..beba087 --- /dev/null +++ b/res/po/no.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ingen album" + +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_HEADER_SELECT_ITEM" +msgstr "Velg objekt" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Velg album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alle 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" + diff --git a/res/po/pl.po b/res/po/pl.po new file mode 100755 index 0000000..4adff6e --- /dev/null +++ b/res/po/pl.po @@ -0,0 +1,37 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Brak albumów" + +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_HEADER_SELECT_ITEM" +msgstr "Wybierz element" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Wybierz album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Wszystkie albumy" + +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" + diff --git a/res/po/pt_PT.po b/res/po/pt_PT.po index f0981a6..14d74b4 100755 --- a/res/po/pt_PT.po +++ b/res/po/pt_PT.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Álbum novo" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Nenhuns álbuns" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Impossível iniciar enquanto o modo de armazenamento USB estiver ativo" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Criar álbum" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Impossível mudar nome" diff --git a/res/po/ro.po b/res/po/ro.po new file mode 100755 index 0000000..7786487 --- /dev/null +++ b/res/po/ro.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nu există albume" + +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_HEADER_SELECT_ITEM" +msgstr "SelectaÅ£i elementul" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Selectare album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Toate albumele" + +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" + diff --git a/res/po/ru_RU.po b/res/po/ru_RU.po index 74ba342..30ea180 100755 --- a/res/po/ru_RU.po +++ b/res/po/ru_RU.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Новый альбом" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Нет альбомов" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "Невозможно начать при включенном режиме съемного диска USB" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Создать альбом" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "Невозможно переименовать" diff --git a/res/po/sk.po b/res/po/sk.po new file mode 100755 index 0000000..2545b1c --- /dev/null +++ b/res/po/sk.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Žiadne albumy" + +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_HEADER_SELECT_ITEM" +msgstr "VybraÅ¥ položku" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "VybraÅ¥ album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "VÅ¡etky albumy" + +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" + diff --git a/res/po/sl.po b/res/po/sl.po new file mode 100755 index 0000000..25011a3 --- /dev/null +++ b/res/po/sl.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Ni albumov" + +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_HEADER_SELECT_ITEM" +msgstr "Izberi predmet" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Izberite album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Vsi albumi" + +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" + diff --git a/res/po/sr.po b/res/po/sr.po new file mode 100755 index 0000000..e9185df --- /dev/null +++ b/res/po/sr.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Nema albuma" + +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_HEADER_SELECT_ITEM" +msgstr "Izaberi objekat" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Izaberi album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Svi albumi" + +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" + diff --git a/res/po/sv.po b/res/po/sv.po new file mode 100755 index 0000000..e60f1b6 --- /dev/null +++ b/res/po/sv.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Inga album" + +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_HEADER_SELECT_ITEM" +msgstr "Välj objekt" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Välj album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Alla 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" + diff --git a/res/po/th.po b/res/po/th.po new file mode 100755 index 0000000..04c99e1 --- /dev/null +++ b/res/po/th.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +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_HEADER_SELECT_ITEM" +msgstr "เลือก​รายการ" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "เลือก​อัลบั้ม" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +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 "พารามิเตอร์​การ​ใส่​ข้อมูล​ไม่​ถูก​ต้อง" + diff --git a/res/po/tr_TR.po b/res/po/tr_TR.po index 935294b..00d7d1a 100755 --- a/res/po/tr_TR.po +++ b/res/po/tr_TR.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "Yeni albüm" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "Albüm yok" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "USB depolama modu etkinken başlatılamıyor" +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." diff --git a/res/po/uk.po b/res/po/uk.po new file mode 100755 index 0000000..7d2048f --- /dev/null +++ b/res/po/uk.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +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_HEADER_SELECT_ITEM" +msgstr "Виберіть елемент" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "Вибір альбому" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +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 "Неправильний вхідний параметр" + 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/vi.po b/res/po/vi.po new file mode 100755 index 0000000..3d9f4ed --- /dev/null +++ b/res/po/vi.po @@ -0,0 +1,36 @@ +msgid "IDS_MEDIABR_BODY_NO_ALBUMS" +msgstr "Không có album" + +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "Tạo album" + +msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" +msgstr "Không thể đổi tên" + +msgid "IDS_MEDIABR_POP_NO_NAME" +msgstr "Không có tên" + +msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" +msgstr "Không album nào được chọn" + +msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" +msgstr "Chọn mục" + +msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" +msgstr "ChoÌ£n album" + +msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" +msgstr "Tất cả album" + +msgid "IDS_MEDIABR_POP_RETRY_Q" +msgstr "Thá»­ lại?" + +msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE" +msgstr "Tên đã được dùng" + +msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY" +msgstr "Mục nhập trống" + +msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER" +msgstr "Tham biến nhập không hợp lệ" + diff --git a/res/po/zh_CN.po b/res/po/zh_CN.po index 10e11da..13c01f3 100755 --- a/res/po/zh_CN.po +++ b/res/po/zh_CN.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "新相册" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "无专辑" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "当USB存储模式启动时,无法启动" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "新建相册" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "无法重命名" @@ -20,7 +17,7 @@ msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" msgstr "选择项目" msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" -msgstr "选择音乐库" +msgstr "选择专辑" msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" msgstr "所有相册" diff --git a/res/po/zh_HK.po b/res/po/zh_HK.po index 5a88279..ec5c2b1 100755 --- a/res/po/zh_HK.po +++ b/res/po/zh_HK.po @@ -1,17 +1,14 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "新相簿" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" msgstr "沒有專輯" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "當 USB 儲存裝置模式啟動時無法開始" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "建立相簿" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "無法重新命名" msgid "IDS_MEDIABR_POP_NO_NAME" -msgstr "沒有姓名" +msgstr "無名稱" msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" msgstr "未選擇專輯" diff --git a/res/po/zh_TW.po b/res/po/zh_TW.po index d1aa4f1..1e56e79 100755 --- a/res/po/zh_TW.po +++ b/res/po/zh_TW.po @@ -1,11 +1,8 @@ -msgid "IDS_MEDIABR_TAB4_NEW_ALBUM" -msgstr "新專輯" - msgid "IDS_MEDIABR_BODY_NO_ALBUMS" -msgstr "無相簿" +msgstr "無專輯" -msgid "IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE" -msgstr "當 USB 儲存模式啟用時無法開始" +msgid "IDS_MEDIABR_OPT_CREATE_ALBUM" +msgstr "建立專輯" msgid "IDS_MEDIABR_POP_UNABLE_TO_RENAME" msgstr "無法重新命名" @@ -14,7 +11,7 @@ msgid "IDS_MEDIABR_POP_NO_NAME" msgstr "無姓名" msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED" -msgstr "未選擇專輯" +msgstr "未選擇相簿" msgid "IDS_MEDIABR_HEADER_SELECT_ITEM" msgstr "選擇項目" @@ -23,7 +20,7 @@ msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM" msgstr "選擇專輯" msgid "IDS_MEDIABR_BODY_ALL_ALBUMS" -msgstr "所有專輯" +msgstr "所有相簿" msgid "IDS_MEDIABR_POP_RETRY_Q" 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..4fa73b5 --- /dev/null +++ b/res/white_theme/edc/gallery-edc-res.h @@ -0,0 +1,42 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" +#define GALLERY_EDC_IMAGE_PINCH_ZOOMOUT "T01_img_pinch_zoomout.png" +/* Fixme: Use custom image, replace it if better image provided by UX */ +#define GALLERY_EDC_IMAGE_THUMBS_BG "T01_thumbs_bg.png" + +/* gl-button.edc */ +#define GALLERY_EDC_IMAGE_TITLE_BTN_BG_PRESS "00_title_btn_bg_press.png" +#define GALLERY_EDC_IMAGE_BTN_SLIDESHOW "T01_controlbar_icon_slideshow.png" +#define GALLERY_EDC_IMAGE_BTN_DONE "T01_controlbar_icon_done.png" +#define GALLERY_EDC_IMAGE_BTN_CANCEL "T01_controlbar_icon_cancel.png" + +#define GALLERY_EDC_SOUND_TOUCH_30MS "S_Touch_30ms.wav" + +/* gl-check.edc */ +#define GALLERY_EDC_IMAGE_CHECK_GRID "T01_grid_select_check.png" +#define GALLERY_EDC_IMAGE_CHECK_PINCH_GRID "00_grid_select_check.png" + diff --git a/res/edc/gallery.edc b/res/white_theme/edc/gallery.edc similarity index 86% rename from res/edc/gallery.edc rename to res/white_theme/edc/gallery.edc index c8f6ede..e6081fe 100755 --- a/res/edc/gallery.edc +++ b/res/white_theme/edc/gallery.edc @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,16 +14,17 @@ * limitations under the License. */ -#define FONT_ROM "HelveticaNeue:style=Roman" -#define FONT_MED "HelveticaNeue:style=Medium" +#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 45 45 45 255 +#define GALLERY_EDC_COLOR_BG 255 255 255 255 #define ENTRY_H 112 #define ENTRY_MAX_W 1280 #define CONTROLBAR_LARGE_HEIGHT_INC 117 #define CONTROLBAR_SMALL_HEIGHT_INC 98 +#define SELECT_ALL_BG_COLOR 215 225 232 255 #include "gallery-edc-res.h" @@ -33,9 +34,6 @@ collections { #include "gl-gengrid-item-thumbview.edc" #include "gl-gengrid-item-albums.edc" #include "gl-button.edc" -#include "gl-segment.edc" -#include "gl-entry.edc" -#include "gl-editfield.edc" #include "gl-check.edc" #include "gl-nocontents.edc" @@ -72,13 +70,13 @@ collections { description { state: "visible" 0.0; inherit: "default" 0.0; - color: 37 37 37 153; + color: SELECT_ALL_BG_COLOR; } description { state: "visible_video" 0.0; inherit: "default" 0.0; min: 0 VIDEO_SELECT_ALL_ITEM_H; - color: 37 37 37 153; + color: SELECT_ALL_BG_COLOR; } } part { @@ -187,9 +185,10 @@ collections { 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: 255 255 255 255; + color: 0 0 0 255; text { - font: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 44; text: ""; align: 0.0 0.5; @@ -247,23 +246,18 @@ collections { rel1 { relative: 0.0 0.0;} rel2 { relative: 1.0 1.0; } } - description { //edit thumbnails view - state: "thumb_edit_default" 0.0; + description { //edit view + state: "edit" 0.0; rel1 { relative: 0.0 1.0; to: "selectall_inner"; } rel2 { relative: 1.0 1.0;} } - description { //move edit thumbnails view up while selectioninfo shown - state: "moveup_view" 0.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.padding.selinfo"; } } - description { //move edit albums view up while selectioninfo shown - state: "moveup_albums_default" 0.0; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 0.0; to: "elm.padding.selinfo"; } - } } } @@ -325,27 +319,19 @@ collections { } } program { - name: "swallow_view_thumb_edit_default"; - signal: "elm,swallow_view,state,thumb_edit_default"; + name: "swallow_view_edit"; + signal: "elm,swallow_view,state,edit"; source: "elm"; script { - set_state(PART:"elm.swallow.view", "thumb_edit_default", 0.0); + set_state(PART:"elm.swallow.view", "edit", 0.0); } } program { - name: "swallow_view_moveup_view"; - signal: "elm,swallow_view,state,moveup_view"; + name: "swallow_view_moveup"; + signal: "elm,swallow_view,state,moveup"; source: "elm"; script { - set_state(PART:"elm.swallow.view", "moveup_view", 0.0); - } - } - program { - name: "swallow_view_moveup_albums_default"; - signal: "elm,swallow_view,state,moveup_albums_default"; - source: "elm"; - script { - set_state(PART:"elm.swallow.view", "moveup_albums_default", 0.0); + set_state(PART:"elm.swallow.view", "moveup", 0.0); } } } @@ -430,6 +416,8 @@ collections { scale: 1; description { state: "default" 0.0; + min: 396 74; + max: 768 74; visible: 0; } } @@ -439,15 +427,29 @@ collections { scale: 1; description { state: "default" 0.0; - //min: 493 74; - min: 460 74; - max: 876 74; - align: 0.0 0.5; + align: 0.5 0.5; rel1 { relative: 0.0 0.0; to: "bg"; } rel2 { relative: 1.0 1.0; to: "bg"; } } } } } + + group { name: "gl_bg_layout"; + parts { + part { name: "bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.image"; + type: SWALLOW; + description { state: "default" 0.0; + } + } + } + } } diff --git a/res/white_theme/edc/gl-button.edc b/res/white_theme/edc/gl-button.edc new file mode 100755 index 0000000..3cddd81 --- /dev/null +++ b/res/white_theme/edc/gl-button.edc @@ -0,0 +1,306 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 BUTTON_STATE_ENABLED 0 +#define BUTTON_STATE_DISABLED 1 + +#define BUTTON_NAVIFRAME_TITLE_TEXT_NORMAL_COLOR_INC 211 211 211 255 +#define BUTTON_NAVIFRAME_TITLE_TEXT_PRESSED_COLOR_INC 249 249 249 255 +#define BUTTON_NAVIFRAME_TITLE_TEXT_FOCUSED_COLOR_INC 249 249 249 255 +#define BUTTON_NAVIFRAME_TITLE_TEXT_DISABLED_COLOR_INC 211 211 211 127 + +#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_NORMAL_MIN_INC 120 72 +#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_PRESSED_MIN_INC 120 72 +#define BUTTON_NAVIFRAME_TITLE_TEXT_BG_PRESSED_BORDER_INC 4 4 4 4 +#define BUTTON_NAVIFRAME_TITLE_TEXT_PADDING_MIN_INC 10 3 +#define BUTTON_NAVIFRAME_TITLE_TEXT_FONT_SIZE_INC 30 +#define BUTTON_NAVIFRAME_TITLE_VISIBLE_ICON_RECT_MIN_MAX_INC 56 56 +#define BUTTON_NAVIFRAME_TITLE_ICONONLY_ICON_MIN_MAX_INC 56 56 +#define BUTTON_NAVIFRAME_TITLE_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0 + +#define BUTTON_NAVIFRAME_MORE_BG_MIN_MAX_INC 120 72 +#define BUTTON_NAVIFRAME_MORE_BG_PRESSED_MIN_MAX_INC 120 72 +#define BUTTON_NAVIFRAME_MORE_BG_PRESSED_BORDER_INC 4 4 4 4 +#define BUTTON_NAVIFRAME_MORE_DEFAULT_IMAGE_MIN_MAX_INC 56 56 +#define BUTTON_NAVIFRAME_MORE_BG_COLOR_INC 41 61 94 255 + + +/////////////////////////////////////////////////////////////////////////////////////// +#define BUTTON_STYLES(style_name, image_normal, image_press, min_width, min_height) \ + group { name: "elm/button/base/"style_name; \ + images { \ + image: image_normal COMP; \ + image: image_press COMP; \ + } \ + parts { \ + part { name: "button_image"; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: min_width min_height; \ + max: min_width min_height; \ + image { \ + normal: image_normal; \ + border: BUTTON_EDIT_STYLE_BORDER_INC; \ + border_scale: 1; \ + } \ + } \ + description { \ + state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + image.normal: image_press; \ + } \ + description { \ + state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + image.normal: image_normal; \ + } \ + } \ + part { name: "button_center_part"; \ + mouse_events: 0; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: min_width min_height; \ + max: min_width min_height; \ + image { \ + normal: image_normal; \ + border: BUTTON_EDIT_STYLE_BORDER_INC; \ + border_scale: 1; \ + } \ + } \ + description { \ + state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + image.normal: image_press; \ + } \ + } \ + part { name: "over1"; \ + type: RECT; \ + repeat_events: 1; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + min: min_width min_height; \ + } \ + } \ + part { name: "over2"; \ + 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: "button_click"; \ + signal: "mouse,down,1"; \ + source: "over1"; \ + action: SIGNAL_EMIT "elm,action,press" ""; \ + after: "button_click_anim"; \ + } \ + program { name: "button_click_anim"; \ + action: STATE_SET "clicked" 0.0; \ + target: "button_image"; \ + target: "button_center_part"; \ + } \ + program { name: "button_unclick"; \ + signal: "mouse,up,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,unpress" ""; \ + after: "button_unclick_anim"; \ + } \ + program { name: "button_unclick_anim"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + target: "button_center_part"; \ + } \ + program { name: "button_unclick2"; \ + signal: "mouse,clicked,1"; \ + source: "over1"; \ + action: SIGNAL_EMIT "elm,action,click" ""; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "disabler"; \ + target: "button_image"; \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "disabler"; \ + target: "button_image"; \ + } \ + } \ + } + + +/////////////////////////////////////////////////////////////////////////////////////// + + sounds { + sample { + name: "touch_sound" AS_IS; + source: GALLERY_EDC_SOUND_TOUCH_30MS; + } + } + + +#define GL_BUTTON_NAVIFRAME_ICON_GALLERY_STYLES(style_name, image_normal) \ + group { name: "elm/button/base/naviframe/"style_name/"gallery"; \ + images { \ + image: image_normal COMP; \ + image: GALLERY_EDC_IMAGE_TITLE_BTN_BG_PRESS COMP; \ + } \ + parts { \ + part { name: "button_image"; \ + scale: 1; \ + description { state: "default" 0.0; \ + min: BUTTON_NAVIFRAME_MORE_BG_MIN_MAX_INC; \ + max: BUTTON_NAVIFRAME_MORE_BG_MIN_MAX_INC; \ + color: 0 0 0 0; \ + } \ + description { state: "clicked" 0.0; \ + min: BUTTON_NAVIFRAME_MORE_BG_PRESSED_MIN_MAX_INC; \ + max: BUTTON_NAVIFRAME_MORE_BG_PRESSED_MIN_MAX_INC; \ + image { \ + normal: GALLERY_EDC_IMAGE_TITLE_BTN_BG_PRESS; \ + border: BUTTON_NAVIFRAME_MORE_BG_PRESSED_BORDER_INC; \ + border_scale: 1; \ + } \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + } \ + description { state: "focused" 0.0; \ + inherit: "default" 0.0; \ + } \ + } \ + part { name: "more_image"; \ + scale: 1; \ + mouse_events: 0; \ + description { state: "default" 0.0; \ + min: BUTTON_NAVIFRAME_MORE_DEFAULT_IMAGE_MIN_MAX_INC; \ + max: BUTTON_NAVIFRAME_MORE_DEFAULT_IMAGE_MIN_MAX_INC; \ + rel1.to: "button_image"; \ + rel2.to: "button_image"; \ + image.normal: image_normal; \ + } \ + description { state: "clicked" 0.0; \ + inherit: "default" 0.0; \ + image.normal: image_normal; \ + } \ + description { state: "disabled" 0.0; \ + inherit: "default" 0.0; \ + color: 255 255 255 127; \ + } \ + } \ + part { name: "over2"; \ + type: RECT; \ + repeat_events: 1; \ + ignore_flags: ON_HOLD; \ + description { state: "default" 0.0; \ + color: 0 0 0 0; \ + } \ + } \ + part { name: "over3"; \ + 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: "button_click"; \ + signal: "mouse,down,1"; \ + source: "over2"; \ + action: SIGNAL_EMIT "elm,action,press" ""; \ + after: "button_click_anim"; \ + } \ + program { name: "button_click_anim"; \ + action: STATE_SET "clicked" 0.0; \ + target: "button_image"; \ + target: "more_image"; \ + } \ + program { name: "button_unclick"; \ + signal: "mouse,up,1"; \ + source: "over3"; \ + action: SIGNAL_EMIT "elm,action,unpress" ""; \ + after: "button_unclick_anim"; \ + } \ + program { name: "button_unclick_anim"; \ + action: STATE_SET "default" 0.0; \ + target: "button_image"; \ + target: "more_image"; \ + } \ + program { name: "touch_snd"; \ + signal: "mouse,clicked,1"; \ + source: "over2"; \ + action: PLAY_SAMPLE "touch_sound" 1.0; \ + after: button_unclick3; \ + } \ + program { name: "button_unclick3"; \ + action: SIGNAL_EMIT "elm,action,click" ""; \ + } \ + program { name: "disable"; \ + signal: "elm,state,disabled"; \ + source: "elm"; \ + action: STATE_SET "disabled" 0.0; \ + target: "disabler"; \ + target: "button_image"; \ + target: "more_image"; \ + } \ + program { name: "enable"; \ + signal: "elm,state,enabled"; \ + source: "elm"; \ + action: STATE_SET "default" 0.0; \ + target: "disabler"; \ + target: "button_image"; \ + target: "more_image"; \ + } \ + } \ + } + +////////////////////////////////////////////////////// + GL_BUTTON_NAVIFRAME_ICON_GALLERY_STYLES("slideshow", GALLERY_EDC_IMAGE_BTN_SLIDESHOW) + GL_BUTTON_NAVIFRAME_ICON_GALLERY_STYLES("done", GALLERY_EDC_IMAGE_BTN_DONE) + GL_BUTTON_NAVIFRAME_ICON_GALLERY_STYLES("cancel", GALLERY_EDC_IMAGE_BTN_CANCEL) + +#undef BUTTON_STATE_ENABLED +#undef BUTTON_STATE_DISABLED + diff --git a/res/edc/gl-check.edc b/res/white_theme/edc/gl-check.edc similarity index 68% rename from res/edc/gl-check.edc rename to res/white_theme/edc/gl-check.edc index b637229..ca15329 100755 --- a/res/edc/gl-check.edc +++ b/res/white_theme/edc/gl-check.edc @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,7 +14,7 @@ * limitations under the License. */ -#define CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 42 42 +#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 @@ -27,11 +27,11 @@ /////////////////////////////////////////////////////////////////////////////////////// styles { style { name: "check_label_textblock_style"; - base: "font=HelveticaNeue:style=Roman font_size=32 color=#ffffff wrap=char"; + base: "font=SLP:style=Roman text_class=slp_roman font_size=32 color=#ffffff wrap=char"; tag: "br" "\n"; tag: "ps" "ps"; - tag: "hilight" "+ font=HelveticaNeue:style=Bold"; - tag: "b" "+ font=HelveticaNeue:style=Bold"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp_bold"; + tag: "b" "+ font=SLP:style=Bold text_class=slp_bold"; tag: "whitecolor" "+ color=#ffffff"; tag: "tab" "\t"; } @@ -42,287 +42,6 @@ #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_BG_CHECKING, 42, 42) //////////////////////////////////////////////////////////////////////////////// #define CHECK_STYLE_GRID(style_name, image_grid, width, height) \ 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..151d1a9 --- /dev/null +++ b/res/white_theme/edc/gl-gengrid-item-albums.edc @@ -0,0 +1,683 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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.firsticon elm.swallow.3icon1 elm.swallow.3icon2 elm.swallow.4icon3 elm.swallow.4icon4 elm.swallow.5icon1 elm.swallow.5icon2 elm.swallow.6icon4 elm.swallow.6icon5 elm.swallow.icon elm.swallow.onlyicon elm.swallow.end elm.swallow.snsicon elm.swallow.progressbar 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: "elm.swallow.firsticon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.3icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.3icon2"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+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: "elm.swallow.4icon3"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.4icon4"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+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: "elm.swallow.5icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.5icon2"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon4"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon5"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.icon"; + 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_TEXT_AREA_H+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: "elm.swallow.snsicon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + max: ALBUM_SNS_ICON_W ALBUM_SNS_ICON_H; + fixed: 1 0; + rel1 { relative: (ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W) ALBUM_TEXT_SNS_X/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_SNS_ICON_W+ALBUM_TEXT_GAP_L)/ALBUM_TEXT_AREA_W 1.0; to: "label_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.swallow.progressbar"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: ALBUM_PBAR_GAP_L/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H+ALBUM_PBAR_GAP_T)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_PBAR_GAP_L+ALBUM_PBAR_W)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H+ALBUM_PBAR_GAP_T+ALBUM_PBAR_H)/ALBUM_TEXT_AREA_H; to: "label_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_medium"; + 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_medium"; + 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_medium"; + 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; + //color: 255 0 0 255; + 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"; } + } + } + } +} + +group { + name: "elm/gengrid/item/gallery/albums_view_blue/default"; + + data.item: "texts" "elm.text.name elm.text.date elm.text.count"; + data.item: "contents" "elm.swallow.firsticon elm.swallow.3icon1 elm.swallow.3icon2 elm.swallow.4icon3 elm.swallow.4icon4 elm.swallow.5icon1 elm.swallow.5icon2 elm.swallow.6icon4 elm.swallow.6icon5 elm.swallow.icon elm.swallow.onlyicon elm.swallow.end elm.swallow.snsicon elm.swallow.progressbar 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: "elm.swallow.firsticon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.3icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.3icon2"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+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: "elm.swallow.4icon3"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.4icon4"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+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: "elm.swallow.5icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.5icon2"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon4"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon5"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.icon"; + 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_TEXT_AREA_H+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: "elm.swallow.snsicon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + max: ALBUM_SNS_ICON_W ALBUM_SNS_ICON_H; + fixed: 1 0; + rel1 { relative: (ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W) ALBUM_TEXT_SNS_X/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_SNS_ICON_W+ALBUM_TEXT_GAP_L)/ALBUM_TEXT_AREA_W 1.0; to: "label_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.swallow.progressbar"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + rel1 { relative: ALBUM_PBAR_GAP_L/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H+ALBUM_PBAR_GAP_T)/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_PBAR_GAP_L+ALBUM_PBAR_W)/ALBUM_TEXT_AREA_W (ALBUM_TEXT_NAME_H+ALBUM_PBAR_GAP_T+ALBUM_PBAR_H)/ALBUM_TEXT_AREA_H; to: "label_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_medium"; + 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_medium"; + 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: 111 198 235 255; + text { + font: "SLP:style=Medium"; + text_class: "slp_medium"; + 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"; } //-->GUI_v0.2_110309 + } + } + 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_GAP_L-ALBUM_CHECKBOX_GAP_L)/ALBUM_ITEM_W (ALBUM_GAP_T-ALBUM_CHECKBOX_GAP_T)/ALBUM_ITEM_H; to:"bg"; } + rel2 { relative: (ALBUM_GAP_L+ALBUM_CHECKBOX_W)/ALBUM_ITEM_W (ALBUM_GAP_T-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..681c483 --- /dev/null +++ b/res/white_theme/edc/gl-gengrid-item-thumbview.edc @@ -0,0 +1,1372 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 182 + +/* Gap between bg and icon */ +#define GAP_BG_L 14 +#define GAP_BG_R 6 +#define GAP_BG_T 24 + +/* Gap between icon and shadow */ +#define GAP_ICON_L 3 +#define GAP_ICON_R 3 +#define GAP_ICON_T 0 +#define GAP_ICON_B 4 + +/* Shadow image size */ +#define SHADOW_W (W-GAP_BG_L-GAP_BG_R+GAP_ICON_L+GAP_ICON_R) +#define SHADOW_H (H-GAP_BG_T+GAP_ICON_B) + +/* Gap between bg and shadow */ +#define GAP_SHADOW_L (GAP_BG_L-GAP_ICON_L) +#define GAP_SHADOW_R (GAP_BG_R-GAP_ICON_R) +#define GAP_SHADOW_T (GAP_BG_T-GAP_ICON_T) +#define GAP_SHADOW_B (0+GAP_ICON_B) + +/* Thumbnail boundary size */ +#define INNER 1 + +/* Favourites icon boundary size */ +#define FAVOR_ICON_W 36 +#define FAVOR_ICON_H 38 + +/* Bookmark icon boundary size */ +#define BOOKMARK_ICON_W 30 +#define BOOKMARK_ICON_H 38 + +/* Backgroud size for setting play icon position */ +#define PLAY_BG_W (47+64+47) +#define PLAY_BG_H (27+64+28) +#define PLAY_W 64 +#define PLAY_H 64 +#define PLAY_X 47 +#define PLAY_Y 27 + +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"; + + images { + image: GALLERY_EDC_IMAGE_THUMBS_BG COMP; + } + + 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_THUMBS_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + } + + 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"; + + images { + image: GALLERY_EDC_IMAGE_THUMBS_BG COMP; + } + + 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_THUMBS_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.favoricon.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + + description { + state: "default" 0.0; + max: FAVOR_ICON_W FAVOR_ICON_H; + visible: 1; + color: 0 0 0 130; + align: 0.0 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (GAP_ICON_L+INNER+FAVOR_ICON_W+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + max: FAVOR_ICON_W FAVOR_ICON_H; + align: 0.0 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "elm.favoricon.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.favoricon.bg"; } + } + } + } + + 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; + image: GALLERY_EDC_IMAGE_THUMBS_BG 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_THUMBS_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 130; + align: 0.5 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} + rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} + rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; 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; + fixed: 1 1; + align: 0.5 0.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=Medium"; + text_class: "slp_medium"; + size: 26; + align: 0.5 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; + image: GALLERY_EDC_IMAGE_THUMBS_BG 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_THUMBS_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 130; + min: 0 24; + align: 0.5 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } + } + + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} + rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} + rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; to: "elm.videoicon_bg";} + image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "favoricon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + align: 0.0 0.5; + fixed: 1 1; + visible: 0; + min: FAVOR_ICON_W FAVOR_ICON_H; + max: FAVOR_ICON_W FAVOR_ICON_H; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 0.0 1.0; to: "elm.text.bg"; } + } + } + 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.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 20; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.9 0.0; to_x: "elm.swallow.favoricon"; to_y: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp_medium"; + size: 26; + align: 0.5 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_bookmark"; + images { + image: GALLERY_EDC_IMAGE_BUTTON_PLAY COMP; + image: GALLERY_EDC_IMAGE_THUMBS_BG 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_THUMBS_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 130; + min: 0 24; + align: 0.5 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} + rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 40 40; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} + rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; to: "elm.videoicon_bg";} + image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: BOOKMARK_ICON_W BOOKMARK_ICON_H; + max: BOOKMARK_ICON_W BOOKMARK_ICON_H; + align: 0.0 0.5; + fixed: 1 1; + visible: 0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 0.0 1.0; to: "elm.text.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"; } + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 20; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.9 0.0; to_x: "elm.swallow.bookmarkicon"; to_y: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp_medium"; + size: 26; + align: 0.5 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_bookmark"; + images { + image: GALLERY_EDC_IMAGE_BUTTON_PLAY COMP; + image: GALLERY_EDC_IMAGE_THUMBS_BG 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GALLERY_EDC_IMAGE_THUMBS_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 130; + min: 0 24; + align: 0.5 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} + rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 40 40; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} + rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; to: "elm.videoicon_bg";} + image.normal: GALLERY_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "favoricon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: FAVOR_ICON_W FAVOR_ICON_H; + max: FAVOR_ICON_W FAVOR_ICON_H; + align: 0.0 0.5; + fixed: 1 1; + visible: 0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 0.0 1.0; to: "elm.text.bg"; } + } + } + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "favoricon_bg"; } + rel2 { relative: 1.0 1.0; to: "favoricon_bg"; } + } + } + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: BOOKMARK_ICON_W BOOKMARK_ICON_H; + max: BOOKMARK_ICON_W BOOKMARK_ICON_H; + align: 0.0 1.0; + fixed: 1 1; + visible: 0; + rel1 { relative: 0.8 0.0; to: "favoricon_bg"; } + rel2 { relative: 0.8 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"; } + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 20; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.9 0.0; to_x: "elm.swallow.bookmarkicon"; to_y: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp_medium"; + size: 26; + align: 0.5 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"; + } + } +} + + +#define ZOOMED_W 116 //6+104+6 +#define ZOOMED_H 110 //6+104 + +#define ZOOMED_GAP_L 6 +#define ZOOMED_GAP_R 6 +#define ZOOMED_GAP_T 6 +#define ZOOMED_GAP_B 0 + +#define ZOOMED_BG_W (ZOOMED_W-ZOOMED_GAP_L-ZOOMED_GAP_R) +#define ZOOMED_BG_H (ZOOMED_H-ZOOMED_GAP_T-ZOOMED_GAP_B) + +#define ZOOMED_INNER 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: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: ZOOMED_GAP_L/ZOOMED_W ZOOMED_GAP_T/ZOOMED_H; to: "bg"; } + rel2 { relative: (ZOOMED_W-ZOOMED_GAP_R)/ZOOMED_W (ZOOMED_H-ZOOMED_GAP_B)/ZOOMED_H; to: "bg"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (ZOOMED_INNER)/ZOOMED_BG_W (ZOOMED_INNER)/ZOOMED_BG_H; to: "icon_bg"; } + rel2 { relative: (ZOOMED_BG_W-ZOOMED_INNER+1)/ZOOMED_BG_W (ZOOMED_BG_H-ZOOMED_INNER+1)/ZOOMED_BG_H; to: "icon_bg"; } + } + } + } + + 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"; + } + } +} + +group +{ + name: "elm/gengrid/photoframe/zoomed_default_layout_video"; + images { + image: GALLERY_EDC_IMAGE_PINCH_ZOOMOUT 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: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: (ZOOMED_GAP_L)/ZOOMED_W (ZOOMED_GAP_T)/ZOOMED_H; to: "bg"; } + rel2 { relative: (ZOOMED_W-ZOOMED_GAP_R)/ZOOMED_W (ZOOMED_H-ZOOMED_GAP_B)/ZOOMED_H; to: "bg"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (ZOOMED_INNER)/ZOOMED_BG_W (ZOOMED_INNER)/ZOOMED_BG_H; to: "icon_bg"; } + rel2 { relative: (ZOOMED_BG_W-ZOOMED_INNER+1)/ZOOMED_BG_W (ZOOMED_BG_H-ZOOMED_INNER+1)/ZOOMED_BG_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + max: 42 42; + visible: 1; + align: 0.5 0.5; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} + rel2 { relative: 1.0 1.0; to: "elm.swallow.icon";} + image.normal: GALLERY_EDC_IMAGE_PINCH_ZOOMOUT; + } + } + } + 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.1; + after: "shrink,expand,done,icon"; + } + program { + name: "shrink,expand,done,icon"; + action: SIGNAL_EMIT "shrink,expand,done" "bg"; + } + } +} diff --git a/res/edc/gl-genlist-item-video.edc b/res/white_theme/edc/gl-genlist-item-video.edc similarity index 92% rename from res/edc/gl-genlist-item-video.edc rename to res/white_theme/edc/gl-genlist-item-video.edc index 914f136..b72ad21 100755 --- a/res/edc/gl-genlist-item-video.edc +++ b/res/white_theme/edc/gl-genlist-item-video.edc @@ -14,10 +14,10 @@ * limitations under the License. */ -#define GENLIST_PART_BOTTOM_LINE_COLOR_VIDEO 82 82 82 255 -#define GENLIST_PART_BG_SELECTED_COLOR_INC 50 65 74 255 -#define GENLIST_PART_BG_UNSELECTED_COLOR_INC 0 0 0 0 -#define GENLIST_PART_BOTTOM_LINE_INC 65 65 65 255 +#define GENLIST_PART_BOTTOM_LINE_COLOR_VIDEO 169 169 169 255 +#define GENLIST_PART_BG_SELECTED_COLOR_INC 42 137 194 255 +#define GENLIST_PART_BG_UNSELECTED_COLOR_INC 249 249 249 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_BASE( param_item_height ) \ @@ -128,9 +128,9 @@ } \ } -#define VIDEO_COLOR_GAP 239 239 239 127 -#define VIDEO_COLOR_DURATION 204 204 204 255 -#define VIDEO_COLOR_TITLE 255 255 255 255 +#define VIDEO_COLOR_GAP 190 189 189 255 +#define VIDEO_COLOR_DURATION 124 124 124 255 +#define VIDEO_COLOR_TITLE 0 0 0 255 #define VIDEO_FONT_TITLE 44 #define VIDEO_FONT_DURATION 32 @@ -154,6 +154,8 @@ #define VIDEO_PROGRESSBAR_W 64 #define VIDEO_PLAY_H 38 #define VIDEO_PLAY_W 38 +#define VIDEO_FAVOR_H 38 +#define VIDEO_FAVOR_W 36 #define VIDEO_CHECKBOX_W 42 #define VIDEO_CHECKBOX_H 42 @@ -162,12 +164,12 @@ group { name: "elm/genlist/item/video_list/gallery/default"; alias: "elm/genlist/item_compress/video_list/gallery/default"; alias: "elm/genlist/item_compress_odd/video_list/gallery/default"; - //data.item: "stacking" "above"; - //data.item: "selectraise" "on"; + data.item: "stacking" "above"; + data.item: "selectraise" "on"; data.item: "texts" "elm.text.title elm.text.duration"; - data.item: "contents" "elm.icon elm.videoicon elm.bookmarkicon elm.progressbar_icon"; + data.item: "contents" "elm.icon elm.videoicon elm.bookmarkicon elm.favourites.icon elm.progressbar.icon"; - //data.item: "treesize" "20"; + data.item: "treesize" "20"; parts { GENLIST_PART_BASE( VIDEO_ITEM_H ) GENLIST_PART_BG_IMAGE @@ -246,6 +248,18 @@ group { name: "elm/genlist/item/video_list/gallery/default"; rel2 { relative: 1.0 1.0; to: "elm.icon"; } } } + part { name: "elm.favourites.icon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + max: VIDEO_FAVOR_W VIDEO_FAVOR_H; + align: 0.98 0.0; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "elm.icon"; } + rel2 { relative: 1.0 1.0; to: "elm.icon"; } + } + } part { name: "elm.padding.bookmark.top"; type: RECT; scale: 1; @@ -318,7 +332,8 @@ group { name: "elm/genlist/item/video_list/gallery/default"; } color: VIDEO_COLOR_TITLE; text { - font: "Helvetica Neue:style=Roman"; + font: "SLP:style=Roman"; + text_class: "slp_roman"; size: VIDEO_FONT_TITLE; min: 0 1; align: 0.0 0.5; @@ -347,7 +362,8 @@ group { name: "elm/genlist/item/video_list/gallery/default"; } color: VIDEO_COLOR_DURATION; text { - font: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: VIDEO_FONT_DURATION; min: 0 1; align: 0.0 0.5; @@ -393,7 +409,7 @@ group { name: "elm/genlist/item/video_list_edit/gallery/default"; //data.item: "stacking" "above"; //data.item: "selectraise" "on"; data.item: "texts" "elm.text.title elm.text.duration"; - data.item: "contents" "elm.swallow.checkbox elm.icon elm.videoicon elm.bookmarkicon elm.progressbar_icon"; + data.item: "contents" "elm.swallow.checkbox elm.icon elm.videoicon elm.bookmarkicon elm.favourites.icon elm.progressbar.icon"; //data.item: "treesize" "20"; parts { @@ -515,6 +531,18 @@ group { name: "elm/genlist/item/video_list_edit/gallery/default"; rel2 { relative: 1.0 1.0; to: "elm.icon"; } } } + part { name: "elm.favourites.icon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + max: VIDEO_FAVOR_W VIDEO_FAVOR_H; + align: 0.98 0.0; + color: 0 0 0 0; + rel1 { relative: 0.0 0.0; to: "elm.icon"; } + rel2 { relative: 1.0 1.0; to: "elm.icon"; } + } + } part { name: "elm.padding.bookmark.top"; type: RECT; scale: 1; @@ -587,7 +615,8 @@ group { name: "elm/genlist/item/video_list_edit/gallery/default"; } color: VIDEO_COLOR_TITLE; text { - font: "Helvetica Neue:style=Roman"; + font: "SLP:style=Roman"; + text_class: "slp_roman"; size: VIDEO_FONT_TITLE; min: 0 1; align: 0.0 0.5; @@ -616,7 +645,8 @@ group { name: "elm/genlist/item/video_list_edit/gallery/default"; } color: VIDEO_COLOR_DURATION; text { - font: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: VIDEO_FONT_DURATION; min: 0 1; align: 0.0 0.5; diff --git a/res/edc/gl-nocontents.edc b/res/white_theme/edc/gl-nocontents.edc similarity index 90% rename from res/edc/gl-nocontents.edc rename to res/white_theme/edc/gl-nocontents.edc index 8b99731..c5c5f49 100755 --- a/res/edc/gl-nocontents.edc +++ b/res/white_theme/edc/gl-nocontents.edc @@ -21,10 +21,10 @@ name: "elm/layout/nocontents/gallery"; styles{ style { name: "nocontent_style"; - base: "font=Helvetica Neue:style=Roman font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=word"; + base: "font=SLP:style=Roman text_class=slp_roman font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=word"; tag: "br" "\n"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp_bold"; + tag: "b" "+ font=SLP:style=Bold text_class=slp_bold"; tag: "tab" "\t"; } } diff --git a/res/edc/gl-selection-notification.edc b/res/white_theme/edc/gl-selection-notification.edc similarity index 80% rename from res/edc/gl-selection-notification.edc rename to res/white_theme/edc/gl-selection-notification.edc index 509800c..03672bc 100755 --- a/res/edc/gl-selection-notification.edc +++ b/res/white_theme/edc/gl-selection-notification.edc @@ -16,10 +16,14 @@ //including selection info and notification of delete/move/remove/add... #define SELINFO_PORT_W 720 +#define SELINFO_LAND_W 1280 #define SELINFO_H 48 -#define SELINFO_TOP_LINE_COLOR 56 56 56 255 +#define SELINFO_TOP_LINE_COLOR 215 225 232 255 +#define SELINFO_COLOR 215 225 232 255 +#define SELINFO_TEXT_COLOR 77 77 77 255 #define SELINFO_TOP_LINE_H 2 #define SELINFO_PAD_L 14 +#define SELINFO_PAD_B 0 group { @@ -42,21 +46,21 @@ } } part { - name: "base"; - type: RECT; - mouse_events: 1; - scale : 1; - description { - state: "default" 0.0; - min: 0 SELINFO_H; - fixed: 0 1; - align: 0.5 0.0; - rel1 { relative: 0.0 0.0; to: "bg"; } - rel2 { relative: 1.0 1.0; to: "bg"; } - color: GALLERY_EDC_COLOR_THEME_GRAY; - } - } - part { name: "top_line"; + name: "base"; + type: RECT; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + min: 0 SELINFO_H; + fixed: 0 1; + align: 0.5 0.0; + rel1 { relative: 0.0 0.0; to: "bg"; } + rel2 { relative: 1.0 0.258; to: "bg"; } + color: SELINFO_COLOR; + } + } + part { name: "top_line"; type: RECT; scale : 1; description { @@ -92,12 +96,13 @@ align: 0.0 0.5; rel1 { relative: 1.0 0.0; to_x: "left_padding"; to_y: "base"; } rel2 { relative: 1.0 1.0; to: "base"; } - color: 255 255 255 255; + color:SELINFO_TEXT_COLOR; text { - font: "Helvetica Neue:style=Medium"; + font: "SLP:style=Bold"; + text_class: "slp_bold"; size: 32; text: ""; - align: 0.5 0.5; + align: 0.0 0.5; } } } diff --git a/res/images/00_grid_select_check.png b/res/white_theme/images/00_grid_select_check.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/00_grid_select_check.png rename to res/white_theme/images/00_grid_select_check.png diff --git a/res/images/00_button_popup_dim.png b/res/white_theme/images/00_title_btn_bg_press.png old mode 100644 new mode 100755 similarity index 93% rename from res/images/00_button_popup_dim.png rename to res/white_theme/images/00_title_btn_bg_press.png index d29bf72..90a71c7 Binary files a/res/images/00_button_popup_dim.png and b/res/white_theme/images/00_title_btn_bg_press.png differ diff --git a/res/images/T01_video_list_progress_bar.png b/res/white_theme/images/01_list_group_title_bg.png old mode 100644 new mode 100755 similarity index 95% rename from res/images/T01_video_list_progress_bar.png rename to res/white_theme/images/01_list_group_title_bg.png index cc9c1bc..83447f7 Binary files a/res/images/T01_video_list_progress_bar.png and b/res/white_theme/images/01_list_group_title_bg.png differ diff --git a/res/images/T01_Nocontents_broken.png b/res/white_theme/images/T01_Nocontents_broken.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_Nocontents_broken.png rename to res/white_theme/images/T01_Nocontents_broken.png diff --git a/res/images/T01_Nocontents_picture.png b/res/white_theme/images/T01_Nocontents_picture.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_Nocontents_picture.png rename to res/white_theme/images/T01_Nocontents_picture.png diff --git a/res/images/T01_btn_play.png b/res/white_theme/images/T01_btn_play.png similarity index 100% rename from res/images/T01_btn_play.png rename to res/white_theme/images/T01_btn_play.png diff --git a/res/images/T01_btn_thumbnail_play.png b/res/white_theme/images/T01_btn_thumbnail_play.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_btn_thumbnail_play.png rename to res/white_theme/images/T01_btn_thumbnail_play.png diff --git a/res/images/00_winset_Back.png b/res/white_theme/images/T01_controlbar_icon_back.png similarity index 83% rename from res/images/00_winset_Back.png rename to res/white_theme/images/T01_controlbar_icon_back.png index 780e24e..d708747 100755 Binary files a/res/images/00_winset_Back.png and b/res/white_theme/images/T01_controlbar_icon_back.png differ diff --git a/res/white_theme/images/T01_controlbar_icon_camera.png b/res/white_theme/images/T01_controlbar_icon_camera.png new file mode 100755 index 0000000..234a611 Binary files /dev/null and b/res/white_theme/images/T01_controlbar_icon_camera.png differ diff --git a/res/images/T01_controlbar_icon_cancel.png b/res/white_theme/images/T01_controlbar_icon_cancel.png old mode 100644 new mode 100755 similarity index 84% rename from res/images/T01_controlbar_icon_cancel.png rename to res/white_theme/images/T01_controlbar_icon_cancel.png index cef573e..5cb7824 Binary files a/res/images/T01_controlbar_icon_cancel.png and b/res/white_theme/images/T01_controlbar_icon_cancel.png differ diff --git a/res/images/T01_controlbar_icon_delete.png b/res/white_theme/images/T01_controlbar_icon_delete.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_controlbar_icon_delete.png rename to res/white_theme/images/T01_controlbar_icon_delete.png diff --git a/res/white_theme/images/T01_controlbar_icon_done.png b/res/white_theme/images/T01_controlbar_icon_done.png new file mode 100755 index 0000000..48483a5 Binary files /dev/null and b/res/white_theme/images/T01_controlbar_icon_done.png differ diff --git a/res/images/T01_controlbar_icon_edit.png b/res/white_theme/images/T01_controlbar_icon_edit.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_controlbar_icon_edit.png rename to res/white_theme/images/T01_controlbar_icon_edit.png diff --git a/res/images/T01_controlbar_icon_move.png b/res/white_theme/images/T01_controlbar_icon_move.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_controlbar_icon_move.png rename to res/white_theme/images/T01_controlbar_icon_move.png diff --git a/res/white_theme/images/T01_controlbar_icon_share02.png b/res/white_theme/images/T01_controlbar_icon_share02.png new file mode 100755 index 0000000..f21b00c Binary files /dev/null and b/res/white_theme/images/T01_controlbar_icon_share02.png differ diff --git a/libug/libug-gallery-efl/res/images/00_winset_Back.png b/res/white_theme/images/T01_controlbar_icon_slideshow.png similarity index 84% rename from libug/libug-gallery-efl/res/images/00_winset_Back.png rename to res/white_theme/images/T01_controlbar_icon_slideshow.png index 780e24e..79c2ebd 100755 Binary files a/libug/libug-gallery-efl/res/images/00_winset_Back.png and b/res/white_theme/images/T01_controlbar_icon_slideshow.png differ diff --git a/res/images/T01_grid_select_check.png b/res/white_theme/images/T01_grid_select_check.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_grid_select_check.png rename to res/white_theme/images/T01_grid_select_check.png diff --git a/libug/libug-gallery-efl/res/images/T01_icon_lock.png b/res/white_theme/images/T01_icon_lock.png similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_icon_lock.png rename to res/white_theme/images/T01_icon_lock.png diff --git a/res/images/T01_icon_thumbnail_bookmark.png b/res/white_theme/images/T01_icon_thumbnail_bookmark.png similarity index 100% rename from res/images/T01_icon_thumbnail_bookmark.png rename to res/white_theme/images/T01_icon_thumbnail_bookmark.png diff --git a/res/white_theme/images/T01_img_pinch_zoomout.png b/res/white_theme/images/T01_img_pinch_zoomout.png new file mode 100755 index 0000000..0f3bfd2 Binary files /dev/null and b/res/white_theme/images/T01_img_pinch_zoomout.png differ diff --git a/res/images/T01_btn_gridview.png b/res/white_theme/images/T01_list_icon_bookmark.png old mode 100644 new mode 100755 similarity index 52% rename from res/images/T01_btn_gridview.png rename to res/white_theme/images/T01_list_icon_bookmark.png index 86784bc..06fa9ac Binary files a/res/images/T01_btn_gridview.png and b/res/white_theme/images/T01_list_icon_bookmark.png differ diff --git a/res/images/T01_main_folder_bg.png b/res/white_theme/images/T01_main_folder_bg.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_main_folder_bg.png rename to res/white_theme/images/T01_main_folder_bg.png diff --git a/res/images/00_button_01_normal.png b/res/white_theme/images/T01_thumbs_bg.png old mode 100644 new mode 100755 similarity index 84% rename from res/images/00_button_01_normal.png rename to res/white_theme/images/T01_thumbs_bg.png index fd06c1c..14adbb1 Binary files a/res/images/00_button_01_normal.png and b/res/white_theme/images/T01_thumbs_bg.png differ diff --git a/res/images/gallery_list_icon_bookmark.png b/res/white_theme/images/gallery_list_icon_bookmark.png similarity index 100% rename from res/images/gallery_list_icon_bookmark.png rename to res/white_theme/images/gallery_list_icon_bookmark.png diff --git a/res/white_theme/sounds/S_Touch_30ms.wav b/res/white_theme/sounds/S_Touch_30ms.wav new file mode 100755 index 0000000..99ba74d Binary files /dev/null and b/res/white_theme/sounds/S_Touch_30ms.wav differ diff --git a/src/data/gl-data-type.c b/src/data/gl-data-type.c new file mode 100755 index 0000000..8e2a1e2 --- /dev/null +++ b/src/data/gl-data-type.c @@ -0,0 +1,145 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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_media(gl_media_s **item) +{ + GL_CHECK_VAL(item, -1); + gl_media_s *tmp_item = (gl_media_s *)calloc(1, sizeof(gl_media_s)); + GL_CHECK_VAL(tmp_item, -1); + tmp_item->gtype = GL_TYPE_MEDIA; + *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); + + FREE_DATA(tmp_item->uuid); + FREE_DATA(tmp_item->thumb_url); + FREE_DATA(tmp_item->file_url); + FREE_DATA(tmp_item->album_uuid); + FREE_DATA(tmp_item->display_name); + FREE_DATA(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); + + FREE_DATA(tmp_item->image_info->media_uuid); + 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); + + FREE_DATA(tmp_item->video_info->media_uuid); + FREE_DATA(tmp_item->video_info->title); + } + + free(tmp_item); + *item = NULL; + return 0; +} + +int _gl_data_type_free_media_list(Eina_List **list) +{ + GL_CHECK_VAL(list, -1); + GL_CHECK_VAL(*list, -1); + gl_media_s *item = NULL; + Eina_List *tmp_list = *list; + EINA_LIST_FREE(tmp_list, item) { + if (item) + __gl_data_type_free_media(&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; + + FREE_DATA(tmp_album->uuid); + FREE_DATA(tmp_album->display_name); + FREE_DATA(tmp_album->path); + + if (tmp_album->folder_h) + media_folder_destroy(tmp_album->folder_h); + free(tmp_album); + *album = NULL; + return 0; +} + +int _gl_data_type_free_album_list(Eina_List **list) +{ + GL_CHECK_VAL(list, -1); + GL_CHECK_VAL(*list, -1); + gl_album_s *item = NULL; + Eina_List *tmp_list = *list; + EINA_LIST_FREE(tmp_list, item) { + if (item) + __gl_data_type_free_album(&item); + } + eina_list_free(*list); + *list = 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_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..3cc208f --- /dev/null +++ b/src/data/gl-data-util.c @@ -0,0 +1,354 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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; + } + + if (gitem->_reserved) { + free(gitem->_reserved); + gitem->_reserved = NULL; + } + + free(gitem); + gitem = NULL; + + 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; + } + + if (gcluster->_reserved) { + free(gcluster->_reserved); + gcluster->_reserved = NULL; + } + + 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) { + free(gcluster); + gcluster = NULL; + return NULL; + } + + mcluster->uuid = strdup(GL_ALBUM_ALL_ID); + mcluster->count = count; + 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; +} + +/* 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); + free(p_id); + p_id = NULL; + 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; + } + free(p_id); + p_id = NULL; + } + *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_DEFAULT; + 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 (!g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) { + gl_dbg("All albums."); + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + } else { + err = _gl_local_data_get_album_media_list(&filter, + album->cluster->uuid, + &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; + } + + _sel_cnt++; + if (album->cluster->type == GL_PHONE || + album->cluster->type == GL_MMC) { + 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 */ + _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; +} + diff --git a/src/data/gl-data.c b/src/data/gl-data.c new file mode 100755 index 0000000..faa2e8a --- /dev/null +++ b/src/data/gl-data.c @@ -0,0 +1,1548 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +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) { + free(ad->albuminfo.cluster_list); + ad->albuminfo.cluster_list = NULL; + } + } + + 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, 0, CONDITION_LENGTH); + filter.sort_type = MEDIA_CONTENT_ORDER_ASC; + g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_DEFAULT; + 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); + return -1; + } + + 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_MMC) { + gl_dbgW("MMC was unmounted, skip MMC album!"); + _gl_data_type_free_glitem((void **)&f_data); + continue; + } + + if (f_data->count == 0) { + //append the newly created cluster to list. + if (!g_strcmp0(f_data->uuid, new_mc_id)) { + gl_dbg("empty local album, but it's newly created..."); + } else { + 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 { + 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_DEFAULT; + 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; +} + +/* get a new gitem by mitem id*/ +gl_item *_gl_data_new_gitem(void *data, const char *item_id) +{ + GL_CHECK_NULL(data); + + gl_item *gitem = _gl_data_util_calloc_gitem(); + GL_CHECK_NULL(gitem); + + _gl_local_data_get_media_by_id((char *)item_id, &(gitem->item)); + if (gitem->item == NULL) { + _gl_data_util_free_gitem(gitem); + return NULL; + } + return gitem; +} + +gl_item *_gl_data_new_item_mitem(gl_media_s *mitem) +{ + gl_item *gitem = _gl_data_util_calloc_gitem(); + GL_CHECK_NULL(gitem); + gitem->item = mitem; + + return gitem; +} + +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_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); + gl_dbg("cluster-length:%d", n_entire_items); + + if (n_entire_items <= 0) + return false; + + 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_cluster_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; + + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); + GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, -1); + Eina_List *cluster_list = ad->albuminfo.cluster_list->clist; + EINA_LIST_FOREACH(cluster_list, l, current) { + if (current == NULL || current->cluster == NULL || + current->cluster->uuid == NULL) { + gl_dbgE("Invalid album item!"); + continue; + } + + if (!g_strcmp0(current->cluster->uuid, item->cluster->uuid)) { + ad->albuminfo.cluster_list->clist = eina_list_remove(ad->albuminfo.cluster_list->clist, + current); + _gl_data_util_free_gcluster(current); + break; + } + current = NULL; + } + + 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; +} + +/* +* append album to albums_selected_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; +} + +/** +* Get medias count of album +*/ +int _gl_data_get_item_cnt(void *data, const char *cluster_id, 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.", cluster_id); + + 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_DEFAULT; + filter.offset = GL_GET_ALL_RECORDS; + filter.count = GL_GET_ALL_RECORDS; + filter.with_meta = false; + + if (cluster_id && g_strcmp0(cluster_id, GL_ALBUM_ALL_ID)) { + /*It's normal album*/ + err = _gl_local_data_get_media_count(cluster_id, &filter, + item_cnt); + } else if (cluster_id && !g_strcmp0(cluster_id, GL_ALBUM_ALL_ID)) { + /* 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, + 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_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; + + 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_DEFAULT; + filter.offset = start_pos; + filter.count = end_pos - start_pos + 1; + filter.with_meta = true; + + /* get file-type from service when launched by appsvc */ + 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); + } + } + + 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); + /* Real album */ + if (g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) { + 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 { + gl_dbg(""); + /*Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + } + gl_dbg(""); + err = _gl_local_data_get_album_media_list(&filter, + album->cluster->uuid, + &itemlist); + } + else { + //add "All" album + 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); + } + + gl_dbg("Error code: %d", err); + gl_dbg("itemlist: %p", itemlist); + 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; + 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("maininfo.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; maininfo.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("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; + 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.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_VIDEOLIST_EDIT) { + 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); + } + + + 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); + + ad->uginfo.sort_type = filter.sort_type; + /* Clear item list before new one got */ + _gl_data_clear_default_item_list(ad); + + if (!g_strcmp0(cur_album->cluster->uuid, GL_ALBUM_ALL_ID)) { + gl_dbg("All albums medias"); + err = _gl_local_data_get_all_albums_media_list(&filter, + &itemlist); + } else { + gl_dbg("Normal album medias"); + err = _gl_local_data_get_album_media_list(&filter, + cur_album->cluster->uuid, + &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; + + /* 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_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); + 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)); + 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.offset = GL_FIRST_VIEW_START_POS; + filter.count = *item_count; + filter.with_meta = false; + + if (g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) //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 { + //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; + items[result_cnt-1] = gitem; + } else { + _gl_data_type_free_glitem((void **)&item); + } + item = NULL; + } + + if(*item_count > result_cnt) + *item_count = result_cnt; + } + + 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) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int i = 0; + gl_item *gitem = NULL; + + if (type == MEDIA_CONTENT_TYPE_IMAGE || + type == MEDIA_CONTENT_TYPE_VIDEO) { + _gl_data_get_item_by_index(ad, 1, false, &gitem); + *fitem = gitem; + return 0; + } + + /* 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 && 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_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)); + free(error_msg); + error_msg = NULL; + return -1; + } + + return 0; +} + +/* Append gl_item to medias_elist. using only in webalbum*/ +int _gl_data_append_item(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; + + ad->maininfo.medias_elist = eina_list_append(ad->maininfo.medias_elist, gitem); + ad->maininfo.medias_cnt = eina_list_count(ad->maininfo.medias_elist); + + 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)) + 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) + 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(void *data, const char *path) +{ + GL_CHECK_FALSE(path); + GL_CHECK_FALSE(data); + + 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; + } + + return true; +} + +/** + * If 'All albums' selected for share, only append files contained in 'All albums'; + */ +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.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 (!g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) { + 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 { + err = _gl_local_data_get_album_media_list(&filter, + album->cluster->uuid, + &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; + } + + 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 (!g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) { + 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_is_albums_selected_list_empty(void *data) +{ + 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) { + continue; + } else { + if (current->cluster->count) { + return false; + } + } + } + + return true; +} + +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.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, GL_PHONE, + &cnt); + if (err != 0) + goto DB_NEED_UPDATE; + + /* Compare medias count */ + if (cnt != ad->maininfo.all_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 (!g_strcmp0(cur_album->cluster->uuid, GL_ALBUM_ALL_ID)) + err = _gl_local_data_get_all_albums_media_list(&filter, + &item_list); + else + err = _gl_local_data_get_album_media_list(&filter, + cur_album->cluster->uuid, + &item_list); + 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, + 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); + + int err = _gl_local_data_disconnect(); + if (err != 0) + gl_dbgE("Disconnect with media-content DB failed!"); + + return err; +} + +int _gl_data_get_item_by_fullpath(void *data, char *path, gl_media_s **mitem) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.medias_elist, -1); + Eina_List *tmp_list = NULL; + gl_item *current = NULL; + EINA_LIST_FOREACH(ad->maininfo.medias_elist, tmp_list, current) { + if (NULL == current || NULL == current->item || + NULL == current->item->file_url) { + continue; + } + if (!g_strcmp0(current->item->file_url, path)) { + *mitem = current->item; + return 0; + } + } + + return -1; +} + +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; +} + diff --git a/src/data/gl-local-data.c b/src/data/gl-local-data.c new file mode 100755 index 0000000..64480f5 --- /dev/null +++ b/src/data/gl-local-data.c @@ -0,0 +1,811 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +typedef struct _gl_transfer_data_t gl_transfer_data_s; + +struct _gl_transfer_data_t { + void **userdata; + filter_h filter; + char *album_id; + 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(*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; + } + + /* 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; +} + +/* 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_DEFAULT; + 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_DEFAULT; + 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_id(char *media_id, gl_media_s **mitem) +{ + GL_CHECK_VAL(mitem, -1); + + if (media_id == NULL) { + gl_dbg("Create a empty media"); + _gl_data_type_new_media(mitem); + return 0; + } + + int ret = -1; + Eina_List *list = NULL; + gl_media_s *_mitem = NULL; + media_info_h media_h = NULL; + int i = 0; + gl_dbg("media id: %s", media_id); + + ret = media_info_get_media_from_db(media_id, &media_h); + if (ret != MEDIA_CONTENT_ERROR_NONE || media_h == NULL) { + gl_dbgE("Failed to get media handle[%d]!", ret); + return -1; + } + + gl_transfer_data_s tran_data; + memset(&tran_data, 0x00, sizeof(gl_transfer_data_s)); + tran_data.userdata = (void **)&list; + tran_data.filter = NULL; + tran_data.album_id = NULL; + tran_data.with_meta = false; + + bool b_ret = __gl_local_data_get_media_list_cb(media_h, &tran_data); + + media_info_destroy(media_h); + + if (b_ret && list) { + *mitem = eina_list_nth(list, 0); + i = 1; + ret = 0; + } else { + gl_dbgE("Failed to get media list!"); + ret = -1; + } + + /* 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_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.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 medias--start"); + ret = media_info_foreach_media_from_db(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_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_DEFAULT; + 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); + 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_media_to_db(mitem->media_h, dst) != MEDIA_CONTENT_ERROR_NONE) { + gl_dbgE("Move media thumbnail failed!"); + return -1; + } + + gl_dbgW("Checkme: use correct api!"); + return 0; +} + diff --git a/src/features/gl-albums.c b/src/features/gl-albums.c index b923ea8..99a018a 100755 --- a/src/features/gl-albums.c +++ b/src/features/gl-albums.c @@ -14,8 +14,6 @@ * limitations under the License. */ -#include -#include #include "gl-debug.h" #include "gl-albums.h" #include "gl-gridview.h" @@ -23,109 +21,23 @@ #include "gl-controlbar.h" #include "gl-ui-util.h" #include "gl-util.h" +#include "gl-drm.h" #include "gl-button.h" -#include "gl-db-handler.h" +#include "gl-data.h" #include "gl-popup.h" #include "gl-progressbar.h" +#include "gl-tile.h" #include "gl-strings.h" - -/* Width and height of album item */ -#define GL_ALBUM_ITEM_WIDTH 358 -#define GL_ALBUM_ITEM_HEIGHT 360 - -#define GL_ALBUM_COVER_THUMB_1 1 -#define GL_ALBUM_COVER_THUMB_2 2 -#define GL_ALBUM_COVER_THUMB_3 3 - -/* Size of album icon */ -#define GL_COVER_SIZE 318 -/* Size of table padding */ -#define GL_COVER_PAD 3 -#define GL_COVER_PAD_1 2 -/* Pure size of album icon; value: 196 */ -#define GL_COVER_ICON_S (GL_COVER_SIZE - 2 * GL_COVER_PAD) -/** -* Album icon is set by elm_table, -* it's divided into 3x3, 9 grids, each grid size is 64 -*/ -#define GL_COVER_GRID_S 102 -/* value: 130 */ -#define GL_COVER_2X_GRID_S (GL_COVER_ICON_S - GL_COVER_GRID_S - GL_COVER_PAD) - -/* Album color level and alpha value */ -#define GL_ALBUM_TEXT_COLOR_CNT 6 -#define GL_ALBUM_TEXT_COLOR_ALPHA 255 - -#define GL_CHECKBOX_STYLE_ALBUM "gallery/album" -#define GL_CHECKBOX_STYLE_ALBUM_GRID "gallery/album/grid" -#define GL_GENGRID_STYLE_ALBUM "unclipped" -#define GL_ALBUM_CHECKBOX "elm.swallow.end" -#define GL_ALBUM_CHECKBOX_GRID "elm.swallow.check_grid" -#define GL_ALBUM_RENAME "elm.swallow.rename" -#define GL_GENGRID_STYLE_ALBUM_VIEW "gallery/albums_view" -#define GL_GENGRID_STYLE_ALBUM_VIEW_BLUE "gallery/albums_view_blue" - - -struct gl_color { - int r; - int g; - int b; -}; - -/** -* Album "All albums", "Camera shots" -* bg color is 25:25:25 -*/ -static struct gl_color bg_color[] = { - {50, 50, 50}, - {78, 74, 64}, - {206, 108, 1}, - {157, 35, 39}, - {20, 60, 128}, - {84, 109, 49}, - {25, 25, 25}, -}; - -static void _gl_albums_drag_up(void *data, Evas_Object *obj, void *event_info) -{ -} - -static void _gl_albums_drag_right(void *data, Evas_Object *obj, - void *event_info) -{ -} - -static void _gl_albums_drag_down(void *data, Evas_Object *obj, void *event_info) -{ -} - -static void _gl_albums_drag_left(void *data, Evas_Object *obj, void *event_info) -{ -} - -static void _gl_albums_drag_stop(void *data, Evas_Object *obj, void *event_info) -{ -} +#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) { -} - -static void _gl_albums_selected(void *data, Evas_Object *obj, void *event_info) -{ -} - -static void _gl_albums_unselected(void *data, Evas_Object *obj, - void *event_info) -{ -} - -static void _gl_albums_clicked(void *data, Evas_Object *obj, void *event_info) -{ -} - -static void _gl_albums_longpress(void *data, Evas_Object *obj, void *event_info) -{ + gl_dbg_launch(" realized"); } static void _gl_albums_comeback_from_view_cb(void *data, @@ -134,35 +46,21 @@ static void _gl_albums_comeback_from_view_cb(void *data, 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); + /* Reset aul launch flag if change to albums view */ ad->albuminfo.aul_launch_by_mime = false; ad->albuminfo.aul_launch_type = GL_AUL_T_NONE; - gl_albums_del_grid_append_idler(ad); - gl_albums_comeback_from_view(ad); - - gl_ui_disable_toolbar_item(ad, false, GL_NAVI_ALBUMS, false); -} - -static Eina_Bool _gl_albums_append_grid_idler(void *data) -{ - GL_CHECK_CANCEL(data); - - /* Try to get other medias from DB and append them to gridview */ - int ret = gl_grid_idler_append_items(data); - if (ret < 0) { - gl_dbg("Failed to append grid items!"); - /* Maybe all medias were already showed */ - if (ret == MB_SVC_ERROR_DB_NO_RECORD) - gl_dbg("No any more records!"); - } else { - gl_dbg("Successful to append grid items!"); - } + if (_gl_data_check_update(ad, true)) + gl_refresh_albums_list(ad); - /* Remove idler after all items appended */ - gl_albums_del_grid_append_idler(data); + gl_albums_comeback_from_view(ad); - return ECORE_CALLBACK_CANCEL; + _gl_ctrl_disable_toolbar_item(ad, false, GL_NAVI_ALBUMS, false); } /** @@ -197,28 +95,27 @@ static int _gl_albums_update_check_state(void *data, Evas_Object *ck = NULL; if (b_ck_box == false) ck = elm_object_item_part_content_get(album_item->item, - GL_ALBUM_CHECKBOX); + GL_TILE_CHECKBOX); else ck = elm_object_item_part_content_get(album_item->item, - GL_ALBUM_CHECKBOX_GRID); + 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_db_albums_selected_list_append(ad, album_item); + _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_db_albums_selected_list_remove(ad, album_item); + _gl_data_albums_selected_list_remove(ad, album_item); } /* Display selectioninfo */ - int cnt = gl_db_get_albums_selected_cnt(ad); - gl_ui_create_selinfo(ad, ad->albuminfo.edit_layout, - ad->albuminfo.nf_it_edit, ad->albuminfo.albums_cnt, - cnt, false); - + int cnt = _gl_data_get_albums_selected_cnt(ad); + _gl_notify_create_selinfo(ad, ad->albuminfo.edit_layout, + ad->albuminfo.nf_it_edit, + ad->albuminfo.albums_cnt, cnt, false); return 0; } @@ -235,6 +132,8 @@ static void _gl_albums_check_changed(void *data, Evas_Object *obj, if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_EDIT) { gl_dbgE("Wrong view mode!"); return; + } else { + /* gl_dbg("EditMode"); */ } /* Checkbox selected, b_ck_box=true */ @@ -254,16 +153,14 @@ static void _gl_albums_check_grid_changed(void *data, Evas_Object *obj, 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 normal icon */ -static void __gl_albums_sel_cb(void *data,Evas_Object *obj, void *event_info) +/* Callback of album item selection */ +static void __gl_albums_sel_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(event_info); GL_CHECK(data); @@ -280,18 +177,17 @@ static void __gl_albums_sel_cb(void *data,Evas_Object *obj, void *event_info) 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;"); + gl_dbgW("Empty album, return!"); return; } gl_albums_sel_album(album_item); } } -static void __gl_rename_album_job_cb(void *userdata) +static void __gl_albums_rename_job_cb(void *userdata) { GL_CHECK(userdata); - gl_cluster *album_item = (gl_cluster *)userdata; - gl_ui_rename_album(album_item); + gl_ui_rename_album(userdata); return; } @@ -312,17 +208,18 @@ static void _gl_albums_rename_btn_cb(void *data, Evas_Object *obj, /* Album cover selected, b_ck_box=false, deselect checkbox */ Evas_Object *ck = NULL; ck = elm_object_item_part_content_get(album_item->item, - GL_ALBUM_CHECKBOX); + GL_TILE_CHECKBOX); _gl_albums_update_check_state(ad, album_item, ck, false); 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_rename_album_job_cb,album_item); + ad->maininfo.rename_album_job = ecore_job_add(__gl_albums_rename_job_cb, + album_item); } -char *_gl_albums_get_text(void *data, Evas_Object *obj, const char *part) +static char *__gl_albums_get_text(void *data, Evas_Object *obj, const char *part) { GL_CHECK_NULL(part); GL_CHECK_NULL(strlen(part)); @@ -335,93 +232,73 @@ char *_gl_albums_get_text(void *data, Evas_Object *obj, const char *part) gl_appdata *ad = (gl_appdata *)album_item->ad; char buf[GL_ALBUM_NAME_LEN_MAX] = { 0, }; - if (!strcmp(part, "elm.text.name")) { + if (!g_strcmp0(part, "elm.text.name")) { + gl_dbg_launch(" text.name"); gl_dbg("text.name"); - if (album_item->cluster->display_name && - strlen(album_item->cluster->display_name)) + if (_gl_data_is_root_path(ad, 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)) snprintf(buf, sizeof(buf), "%s", (char *)(album_item->cluster->display_name)); - else if (gl_db_is_root_path(ad, album_item->cluster->uuid, NULL)) - snprintf(buf, sizeof(buf), GL_ALBUM_PHOME_ROOT_NAME); else gl_dbgE("Album name[%s] is wrong!", album_item->cluster->display_name); - } else if (!strcmp(part, "elm.text.date")) { - struct tm t1; - struct tm t2; - char date1[GL_DATE_INFO_LEN_MAX] = { 0, }; - char date2[GL_DATE_INFO_LEN_MAX] = { 0, }; - char date3[GL_DATE_INFO_LEN_MAX] = { 0, }; + } 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_db_get_first_several_items(album_item, - items1, &item_count, - MINFO_MEDIA_SORT_BY_DATE_DESC); - + _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; - } + { + 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; - } - memcpy(&album_item->item_mtime, - &(items1[0]->item->mtime), sizeof(time_t)); - - item_count = 1; - gl_item *items2[1]; - int sort_t = MINFO_MEDIA_SORT_BY_DATE_ASC; - memset(items2, 0x00, item_count * sizeof(int)); - gl_db_get_first_several_items(album_item, - items2, &item_count, - sort_t); - - if (item_count <= 0) { - gl_dbg("Empty album..."); - 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_dbgE("Invalid items2[0]."); + 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; } - memset(&t2, 0x00, sizeof(struct tm)); - localtime_r((time_t *)&(items2[0]->item->mtime), - &t2); - strftime(date2, sizeof(date2), "%Y.%m.%d", &t2); + memcpy(&album_item->item_mtime, + &(items1[0]->item->mtime), sizeof(time_t)); + + 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 (!strcmp(date1, date2)) { - g_strlcpy(buf, date1, sizeof(buf)); - } else { - strftime(date2, sizeof(date2), "%Y.%m", - &t2); - snprintf(buf, sizeof(buf), "%s - %s", - date2, date3); + 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 *)&(album_item->item_mtime), + (time_t *)&(items2[0]->item->mtime), + buf, GL_ALBUM_NAME_LEN_MAX); - for (i = 0; i < item_count; i++) { - gl_db_destroy_item(items2[i]); - items2[i] = NULL; + for (i = 0; i < item_count; i++) { + _gl_data_destroy_item(items2[i]); + items2[i] = NULL; + } } - } else if (!strcmp(part, "elm.text.count")) { - gl_db_update_item_cnt(album_item); + } else if (!g_strcmp0(part, "elm.text.count")) { + _gl_data_update_item_cnt(album_item); snprintf(buf, sizeof(buf), "%d", (int)(album_item->cluster->count)); } @@ -430,209 +307,40 @@ char *_gl_albums_get_text(void *data, Evas_Object *obj, const char *part) } -static Evas_Object *_gl_albums_add_1_icon_bg(Evas_Object *obj, gl_item *git, - int wid, int hei) -{ - GL_CHECK_NULL(obj); - Evas_Object *bg = elm_bg_add(obj); - GL_CHECK_NULL(bg); - elm_bg_load_size_set(bg, wid, hei); - - _gl_ui_elm_bg_file_set(bg, git); - - 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; -} - -static Evas_Object *_gl_albums_add_1st_icon_bg(Evas_Object *obj, gl_item *git, - int wid, int hei) +static gl_icon_type __gl_albums_set_bg_file(Evas_Object *bg, void *data) { - GL_CHECK_NULL(obj); - Evas_Object *bg = elm_bg_add(obj); - GL_CHECK_NULL(bg); - elm_bg_load_size_set(bg, wid, hei); - - _gl_ui_elm_bg_file_set(bg, git); - - evas_object_size_hint_min_set(bg, wid, hei); - 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); - evas_object_show(bg); - return bg; -} + gl_item *git = (gl_item *)data; + char *bg_path = GL_DEFAULT_THUMB_ICON; + gl_icon_type ret_val = GL_ICON_CORRUPTED_FILE; -static Evas_Object *_gl_albums_add_3_icon_bg(Evas_Object *obj, gl_item **items, - int length, double scale) -{ - GL_CHECK_NULL(obj); - gl_item *git = NULL; - int i = 0; - int r1 = 0; - int wid = 0; - int hei = 0; - Evas_Object *bg = NULL; - int tp_val = 0; - Evas_Object *tb = elm_table_add(obj); - GL_CHECK_NULL(tb); - elm_table_padding_set(tb, GL_COVER_PAD * scale, GL_COVER_PAD * scale); - - r1 = 1; - for (i = 1; i < length; i++) { - git = items[i]; - bg = elm_bg_add(tb); - GL_CHECK_NULL(bg); - if (i == 1) { - wid = (int)(GL_COVER_2X_GRID_S * scale); - hei = wid; - } else { - wid = (int)(GL_COVER_GRID_S * scale); - hei = (int)(GL_COVER_2X_GRID_S * scale); - } - elm_bg_load_size_set(bg, wid, hei); - evas_object_size_hint_min_set(bg, wid, hei); - elm_table_padding_set(tb, GL_COVER_PAD_1 * scale, - GL_COVER_PAD_1 * scale); - - _gl_ui_elm_bg_file_set(bg, git); - - 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); - if (i == 1) { - elm_table_pack(tb, bg, 0, 0, 2, 2); - } else { - tp_val = EVAS_ASPECT_CONTROL_VERTICAL; - evas_object_size_hint_aspect_set(bg, tp_val, 1, 1); - elm_table_pack(tb, bg, 2, 0, 1, 2); - } - evas_object_show(bg); + if (git == NULL || git->item == NULL) { + gl_dbgE("Invalid item :%p", git); + goto GL_ALBUMS_FAILED; } - return tb; -} - -static Evas_Object *_gl_albums_add_4_icon_bg(Evas_Object *obj, gl_item **items, - int length, double scale) -{ - GL_CHECK_NULL(obj); - gl_item *git = NULL; - int i = 0; - int r1 = 0; - int wid = 0; - int hei = 0; - Evas_Object *bg = NULL; - - Evas_Object *tb = elm_table_add(obj); - GL_CHECK_NULL(tb); - elm_table_padding_set(tb, GL_COVER_PAD * scale, GL_COVER_PAD * scale); - elm_table_padding_set(tb, GL_COVER_PAD_1 * scale, - GL_COVER_PAD_1 * scale); - r1 = 1; - for (i = 1; i < length; i++) { - git = items[i]; - bg = elm_bg_add(tb); - GL_CHECK_NULL(bg); - if (i == 1) { - wid = (int)(GL_COVER_2X_GRID_S * scale); - hei = wid; - } else { - wid = (int)(GL_COVER_GRID_S * scale); - hei = wid; - } - elm_bg_load_size_set(bg, wid, hei); - evas_object_size_hint_min_set(bg, wid, hei); - - _gl_ui_elm_bg_file_set(bg, git); - - 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); - if (i == 1) - elm_table_pack(tb, bg, 0, 0, 2, 2); - else if (i == 2) - elm_table_pack(tb, bg, 2, 0, 1, 1); - else if (i == 3) - elm_table_pack(tb, bg, 2, 1, 1, 1); - evas_object_show(bg); + /* Is it DRM file? Has a valid RO? */ + char *path = git->item->file_url; + if(gl_drm_is_drm_file(path) && + !gl_drm_check_valid_ro(path, gl_drm_get_permtype(git->item->type))) { + ret_val = GL_ICON_EXPIRED_DRM; + goto GL_ALBUMS_FAILED; } - return tb; -} + ret_val= GL_ICON_NORMAL; + bg_path = _GETICON(git->item->thumb_url); -static Evas_Object *_gl_albums_add_7_icon_bg(Evas_Object *obj, gl_cluster *album, - gl_item **items, int length, int idx, - double scale) -{ - GL_CHECK_NULL(album); - GL_CHECK_NULL(album->cluster); - GL_CHECK_NULL(album->cluster->uuid); - GL_CHECK_NULL(obj); - gl_item *git = NULL; - int i = 0; - int j = 0; - int wid = 0; - int hei = 0; - Evas_Object *bg = NULL; - - Evas_Object *tb = elm_table_add(obj); - GL_CHECK_NULL(tb); - elm_table_padding_set(tb, GL_COVER_PAD * scale, GL_COVER_PAD * scale); - - wid = (int)(GL_COVER_GRID_S * scale); - hei = wid; - - for (i = 1; i < GL_ALBUM_COVER_THUMB_NUM; i++) { - if (i < length) { - git = items[i]; - bg = elm_bg_add(tb); - GL_CHECK_NULL(bg); - elm_bg_load_size_set(bg, wid, hei); - _gl_ui_elm_bg_file_set(bg, git); - } else { - Evas *evas = evas_object_evas_get(obj); - GL_CHECK_NULL(evas); - bg = evas_object_rectangle_add(evas); - GL_CHECK_NULL(bg); - if (!g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID) || - gl_db_is_default_album(album->ad, album->cluster)) - j = GL_ALBUM_TEXT_COLOR_CNT; - else - j = idx % GL_ALBUM_TEXT_COLOR_CNT; - evas_object_color_set(bg, bg_color[j].r, bg_color[j].g, - bg_color[j].b, - GL_ALBUM_TEXT_COLOR_ALPHA); - } + GL_ALBUMS_FAILED: - 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); - elm_table_pack(tb, bg, (int)((i - 1) % 3), (int)((i - 1) / 3), - 1, 1); - evas_object_show(bg); - } +#ifdef _USE_ROTATE_BG + _gl_rotate_bg_set_image_file(bg, bg_path); +#else + elm_bg_file_set(bg, bg_path, NULL); +#endif - return tb; + return ret_val; } -Evas_Object *_gl_albums_get_content(void *data, Evas_Object *obj, const char *part) +static Evas_Object *__gl_albums_get_content(void *data, Evas_Object *obj, const char *part) { GL_CHECK_NULL(part); GL_CHECK_NULL(strlen(part)); @@ -641,186 +349,70 @@ Evas_Object *_gl_albums_get_content(void *data, Evas_Object *obj, const char *pa GL_CHECK_NULL(album_item->cluster); GL_CHECK_NULL(album_item->ad); gl_appdata *ad = (gl_appdata *)album_item->ad; - double scale = ad->maininfo.win_scale; GL_CHECK_NULL(album_item->cluster->uuid); const char *al_id = album_item->cluster->uuid; int view_mode = gl_get_view_mode(ad); - int idx = album_item->index; - int j = 0; - - if ((!strcmp(part, "elm.swallow.firsticon")) || - (!strcmp(part, "elm.swallow.icon")) || - (!strcmp(part, "elm.swallow.onlyicon"))) { - if (view_mode != GL_VIEW_ALBUMS && - view_mode != GL_VIEW_ALBUMS_EDIT) - return NULL; - - gl_item **items = ad->albuminfo.cover_thumbs; - int len = ad->albuminfo.album_medias_cnt; - if (len <= 0) { - gl_dbg("Empty local album."); - return NULL; - } - - Evas_Object *bg = NULL; - int wid = 0; - int hei = 0; - gl_item *gl_it = NULL; - if (!strcmp(part, "elm.swallow.onlyicon")) { - if (len != GL_ALBUM_COVER_THUMB_1) { - return NULL; - } else { - wid = (int)(GL_COVER_ICON_S * scale); - hei = wid; - gl_it = items[0]; - bg = _gl_albums_add_1_icon_bg(obj, gl_it, wid, - hei); - return bg; - } - } - - if (!strcmp(part, "elm.swallow.firsticon")) { - gl_dbg("firsticon"); - if (len <= GL_ALBUM_COVER_THUMB_1) { - return NULL; - } else { - wid = (int)(GL_COVER_GRID_S * scale); - hei = wid; - gl_it = items[0]; - bg = _gl_albums_add_1st_icon_bg(obj, gl_it, wid, - hei); - - return bg; - } - } - - if (!strcmp(part, "elm.swallow.icon")) { - gl_dbg("icon"); - Evas_Object *tb = NULL; - if (len == GL_ALBUM_COVER_THUMB_1) { - return NULL; - } else if (len == GL_ALBUM_COVER_THUMB_2) { - wid = (int)(GL_COVER_ICON_S * scale); - hei = (int)(GL_COVER_2X_GRID_S * scale); - gl_it = items[1]; - bg = _gl_albums_add_1_icon_bg(obj, gl_it, wid, - hei); - return bg; - } else if (len == GL_ALBUM_COVER_THUMB_3) { - tb = _gl_albums_add_3_icon_bg(obj, items, len, - scale); - } else if (len < GL_ALBUM_COVER_THUMB_NUM) { - len = GL_ALBUM_COVER_THUMB_NUM_SEC; - tb = _gl_albums_add_4_icon_bg(obj, items, len, - scale); - } else { - /** - * Set 7 grid for 'All' album - * and 'Camera shots'. - */ - Mcluster *mclu = album_item->cluster; - bool is_def = false; - is_def = gl_db_is_default_album(ad, mclu); - - if (!g_strcmp0(al_id, GL_ALBUM_ALL_ID) || - is_def) { - tb = _gl_albums_add_7_icon_bg(obj, - album_item, - items, - len, - idx, - scale); - } else { - int al_len = 0; - al_len = GL_ALBUM_COVER_THUMB_NUM_SEC; - tb = _gl_albums_add_4_icon_bg(obj, - items, - al_len, - scale); - } - } - evas_object_show(tb); - return tb; - } - } else if (!strcmp(part, "label_bg")) { - 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); + if (view_mode != GL_VIEW_ALBUMS && + view_mode != GL_VIEW_ALBUMS_EDIT) + return NULL; + + Evas_Object *_obj = NULL; + if ((!g_strcmp0(part, GT_TILE_FIRSTICON)) || + (!g_strcmp0(part, GT_TILE_ONLYICON)) || + (!g_strcmp0(part, GT_TILE_ICON)) +#ifdef _USE_ROTATE_BG + || (!g_strcmp0(part, GT_TILE_3ICON1)) || + (!g_strcmp0(part, GT_TILE_3ICON2)) || + (!g_strcmp0(part, GT_TILE_4ICON3)) || + (!g_strcmp0(part, GT_TILE_4ICON4)) || + (!g_strcmp0(part, GT_TILE_5ICON1)) || + (!g_strcmp0(part, GT_TILE_5ICON2)) || + (!g_strcmp0(part, GT_TILE_6ICON4)) || + (!g_strcmp0(part, GT_TILE_6ICON5)) +#endif + ) { + _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 + * for "All albums" and "Camera shots", their colors should be * 25:25:25 by new gui */ + bool b_default = false; if (!g_strcmp0(al_id, GL_ALBUM_ALL_ID) || - gl_db_is_default_album(ad, album_item->cluster)) - j = GL_ALBUM_TEXT_COLOR_CNT; - else - j = idx % GL_ALBUM_TEXT_COLOR_CNT; - evas_object_color_set(bg, bg_color[j].r, bg_color[j].g, - bg_color[j].b, - GL_ALBUM_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; - } else if (!strcmp(part, GL_ALBUM_CHECKBOX_GRID) && + _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) { - 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, album_item->checked); - evas_object_smart_callback_add(ck, "changed", - _gl_albums_check_grid_changed, - data); - evas_object_show(ck); - return ck; - } else if (!strcmp(part, GL_ALBUM_CHECKBOX) && + _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) { - 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, album_item->checked); - evas_object_smart_callback_add(ck, "changed", - _gl_albums_check_changed, - data); - evas_object_show(ck); - return ck; - } else if (!strcmp(part, GL_ALBUM_RENAME) && + _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 albums', - * and 'Camera shot'[default album] - */ if (!g_strcmp0(al_id, GL_ALBUM_ALL_ID) || - gl_db_is_default_album(ad, album_item->cluster)) + _gl_data_is_default_album(GL_ALBUM_DEFAULT_NAME, album_item->cluster)) return NULL; - Evas_Object *btn = NULL; - btn = _gl_but_create_but(obj, GL_BUT_NONE, - GL_BUTTON_STYLE_RENAME); - GL_CHECK_NULL(btn); - evas_object_propagate_events_set(btn, EINA_FALSE); - evas_object_smart_callback_add(btn, "clicked", - _gl_albums_rename_btn_cb, data); - return btn; + _obj = _gl_tile_show_part_rename(obj, _gl_albums_rename_btn_cb, + data); } - return NULL; + + return _obj; } static int _gl_albums_create_items(void *data, Evas_Object *parent) @@ -838,12 +430,12 @@ static int _gl_albums_create_items(void *data, Evas_Object *parent) elm_gengrid_clear(parent); 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; + ad->albuminfo.albumgic.func.text_get = __gl_albums_get_text; + ad->albuminfo.albumgic.func.content_get = __gl_albums_get_content; /* Show blue folder name */ ad->albuminfo.albumgic_blue.item_style = GL_GENGRID_STYLE_ALBUM_VIEW_BLUE; - ad->albuminfo.albumgic_blue.func.text_get = _gl_albums_get_text; - ad->albuminfo.albumgic_blue.func.content_get = _gl_albums_get_content; + ad->albuminfo.albumgic_blue.func.text_get = __gl_albums_get_text; + ad->albuminfo.albumgic_blue.func.content_get = __gl_albums_get_content; GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, -1); @@ -855,6 +447,7 @@ static int _gl_albums_create_items(void *data, Evas_Object *parent) Elm_Gengrid_Item_Class *pgic_blue = &(ad->albuminfo.albumgic_blue); 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); @@ -863,15 +456,14 @@ static int _gl_albums_create_items(void *data, Evas_Object *parent) GL_CHECK_VAL(album_item->cluster->uuid, -1); al_id = album_item->cluster->uuid; - if (view_mode == GL_VIEW_ALBUMS_EDIT) { - if (!g_strcmp0(al_id, GL_ALBUM_ALL_ID) ) + if (!g_strcmp0(al_id, GL_ALBUM_ALL_ID)) continue; } /* Show blue folder name */ if (!g_strcmp0(album_item->cluster->uuid, GL_ALBUM_ALL_ID) || - gl_db_is_default_album(ad, album_item->cluster)) + _gl_data_is_default_album(GL_ALBUM_DEFAULT_NAME, album_item->cluster)) album_item->item = elm_gengrid_item_append(parent, pgic_blue, album_item, @@ -887,8 +479,30 @@ static int _gl_albums_create_items(void *data, Evas_Object *parent) gl_dbg("Append[%s], id=%s.", album_item->cluster->display_name, al_id); } + gl_dbg_launch(" for:elm_gengrid_item_append:end"); ad->albuminfo.albums_cnt = item_cnt; + 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_ui_edit_cancel(ad); + } return 0; } @@ -904,34 +518,29 @@ int gl_albums_sel_album(gl_cluster *album_item) GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, -1); int view_mode = gl_get_view_mode(ad); - if (view_mode != GL_VIEW_ALBUMS) { - gl_dbgE("Wrong view mode!"); - return -1; + if (view_mode == GL_VIEW_ALBUMS) { + gl_dbg("View mode!"); } else { - gl_dbg("ViewMode"); + gl_dbgW("Wrong view mode"); + return -1; } Evas_Object *layout = NULL; char *al_na = album_item->cluster->display_name; - Evas_Object *navi = ad->maininfo.navi_bar; - gl_dbg("current %s album, id=%s, cluster_index=%d", - al_na, album_item->cluster->uuid, album_item->index); + Evas_Object *navi = ad->maininfo.naviframe; + gl_dbg("current %s album, id=%s", al_na, album_item->cluster->uuid); + ad->albuminfo.current_album = album_item; - /* Remove idler */ - gl_albums_del_grid_append_idler(ad); - gl_db_get_item_list(ad, album_item, GL_FIRST_VIEW_START_POS, - GL_FIRST_VIEW_END_POS); + _gl_data_get_item_list(ad, album_item, GL_FIRST_VIEW_START_POS, + GL_FIRST_VIEW_END_POS); gl_set_view_mode(ad, GL_VIEW_THUMBS); - /* Save the index of current selected album */ - ad->albuminfo.cluster_list->cur_pos = album_item->index; - gl_dbg("Album index: %d", album_item->index); - layout = gl_ui_create_view_ly(navi); + layout = _gl_ui_create_view_ly(navi); 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); - Evas_Object *gv = gl_grid_create_view(ad, navi, GL_GRID_ALL); + Evas_Object *gv = _gl_grid_create_view(ad, layout, GL_GRID_ALL, true); elm_object_part_content_set(layout, "elm.swallow.view", gv); ad->gridinfo.all_view = gv; ad->gridinfo.layout = layout; @@ -943,37 +552,49 @@ int gl_albums_sel_album(gl_cluster *album_item) return -1; } - gl_navi_mode mode = GL_NAVI_THUMBS; - /* check root case */ - if (gl_db_is_root_path(ad, album_item->cluster->uuid, NULL)) + if (_gl_data_is_root_path(ad, 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 appsvc */ + 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 + al_na = GL_ALBUM_ALL_NAME; + } - /* Clear view */ + /* Checkme: clear albums view for animation effect pause issue */ elm_gengrid_clear(ad->albuminfo.view); - gl_ui_create_title_and_push(ad, navi, layout, mode, al_na); + gl_ui_create_title_and_push(ad, navi, layout, GL_NAVI_THUMBS, al_na); gl_dbg("albums_view 0x%x cleared", ad->albuminfo.view); Evas_Object *bk_btn = NULL; bk_btn = elm_object_item_part_content_get(ad->gridinfo.nf_it, - GE_NAVIFRAME_PREB_BTN); + GL_NAVIFRAME_PREB_BTN); elm_object_style_set(bk_btn, GL_BUTTON_STYLE_NAVI_PRE); evas_object_smart_callback_add(bk_btn, "clicked", _gl_albums_comeback_from_view_cb, ad); - edje_object_signal_emit(_EDJ(layout), "elm,swallow_view,state,default", - "elm"); + edje_object_signal_emit(_EDJ(layout), + "elm,swallow_view,state,thumb_default", "elm"); gl_dbg("Done albums selected"); + return 0; +} - if (ad->maininfo.medias_cnt == (GL_FIRST_VIEW_END_POS + 1)) { - gl_dbg("\n\n\tIdler to append other medias--Start\n"); - Ecore_Idler *ap_idl = NULL; - ap_idl = ecore_idler_add(_gl_albums_append_grid_idler, ad); - ad->gridinfo.append_idler = ap_idl; - } +Evas_Object *_gl_albums_add_gengrid(void *data, Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + GL_CHECK_NULL(data); - return 0; + Evas_Object *grid = _gl_tile_add_gengrid(data, parent); + evas_object_smart_callback_add(grid, "realized", _gl_albums_realized, + data); + evas_object_show(grid); + return grid; } Evas_Object *gl_albums_create_view(void *data, Evas_Object *parent) @@ -983,77 +604,41 @@ Evas_Object *gl_albums_create_view(void *data, Evas_Object *parent) 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 = 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_ALBUM_ITEM_WIDTH * scale_factor), - (int)(GL_ALBUM_ITEM_HEIGHT * scale_factor)); - - elm_gengrid_align_set(grid, 0.5, 0.0); - - /* Vertical scrolling. */ - elm_gengrid_horizontal_set(grid, EINA_FALSE); - elm_gengrid_bounce_set(grid, EINA_FALSE, EINA_TRUE); - elm_gengrid_multi_select_set(grid, EINA_TRUE); - - evas_object_smart_callback_add(grid, "selected", _gl_albums_selected, - NULL); - evas_object_smart_callback_add(grid, "unselected", - _gl_albums_unselected, NULL); - evas_object_smart_callback_add(grid, "clicked", _gl_albums_clicked, - NULL); - evas_object_smart_callback_add(grid, "longpressed", - _gl_albums_longpress, NULL); - evas_object_smart_callback_add(grid, "drag,start,up", - _gl_albums_drag_up, NULL); - evas_object_smart_callback_add(grid, "drag,start,right", - _gl_albums_drag_right, NULL); - evas_object_smart_callback_add(grid, "drag,start,down", - _gl_albums_drag_down, NULL); - evas_object_smart_callback_add(grid, "drag,start,left", - _gl_albums_drag_left, NULL); - evas_object_smart_callback_add(grid, "drag,stop", _gl_albums_drag_stop, - NULL); - evas_object_smart_callback_add(grid, "realized", _gl_albums_realized, - NULL); + Evas_Object *grid = _gl_albums_add_gengrid(data, parent); + GL_CHECK_NULL(grid); - evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); + 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); - gl_get_mass_storage_state(ad); - if (ad->maininfo.app_exit_mode == GL_APP_EXIT_NONE) { - if (ad->maininfo.view_mode != GL_VIEW_THUMBS) - _gl_albums_create_items(ad, grid); - } /* show no contents none album exists */ - if (ad->maininfo.app_exit_mode || - gl_check_gallery_empty(ad)) { + if (gl_check_gallery_empty(ad)) { evas_object_del(grid); grid = NULL; /* Set the grid view mode for creating nocontents view */ ad->gridinfo.grid_view_mode = GL_GRID_ALBUMS; - Evas_Object *noc = gl_ui_create_nocontents_full(ad); + Evas_Object *noc = _gl_nocontents_create(ad); evas_object_show(noc); ad->albuminfo.nocontents = noc; return noc; } else { ad->albuminfo.nocontents = NULL; - evas_object_show(grid); } gl_dbg("gl_albums_create_view:done"); + gl_dbg_launch(" gl_albums_create_view:end"); return grid; } @@ -1065,7 +650,9 @@ int gl_albums_comeback_from_view(void *data) GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - gl_ui_destroy_notiinfo(ad); + _gl_notify_destroy_notiinfo(ad); + + gl_set_view_mode(ad, GL_VIEW_ALBUMS); gl_grid_clear_view(ad); gl_list_clear_view(ad); @@ -1073,10 +660,7 @@ int gl_albums_comeback_from_view(void *data) ad->albuminfo.current_album = NULL; gl_albums_update_items(ad); - evas_object_show(ad->albuminfo.view); - - gl_set_view_mode(ad, GL_VIEW_ALBUMS); - ad->albuminfo.seg_mode = GL_CTRL_SEG_ALL; + ad->maininfo.seg_mode = GL_CTRL_SEG_ALL; return 0; } @@ -1089,6 +673,7 @@ int gl_albums_change_to_view(void *data) GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); gl_dbg(""); + ad->albuminfo.albums_cnt = 0; GL_CHECK_VAL(ad->albuminfo.view, -1); gl_set_view_mode(ad, GL_VIEW_ALBUMS); /* changed to show no contents if needed */ @@ -1098,17 +683,17 @@ int gl_albums_change_to_view(void *data) /* Set the grid view mode for creating nocontents view */ ad->gridinfo.grid_view_mode = GL_GRID_ALBUMS; - Evas_Object *noc = gl_ui_create_nocontents_full(ad); + Evas_Object *noc = _gl_nocontents_create(ad); ad->albuminfo.nocontents = noc; ad->albuminfo.view = noc; evas_object_show(noc); Evas_Object *old_view = NULL; old_view = elm_object_part_content_unset(ad->albuminfo.layout, - "elm.swallow.view"); + "elm.swallow.view"); evas_object_del(old_view); elm_object_part_content_set(ad->albuminfo.layout, - "elm.swallow.view", noc); + "elm.swallow.view", noc); } else { _gl_albums_create_items(ad, ad->albuminfo.view); } @@ -1123,28 +708,35 @@ int gl_albums_update_items(void *data) 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.grid_view_mode = GL_GRID_ALBUMS; - evas_object_del(ad->albuminfo.view); - Evas_Object *noc = gl_ui_create_nocontents_full(ad); + Evas_Object *noc = _gl_nocontents_create(ad); ad->albuminfo.nocontents = noc; ad->albuminfo.view = noc; evas_object_show(noc); Evas_Object *old_view = NULL; old_view = elm_object_part_content_unset(ad->albuminfo.layout, - "elm.swallow.view"); + "elm.swallow.view"); evas_object_del(old_view); - elm_object_part_content_set(ad->albuminfo.layout, "elm.swallow.view", - noc); + elm_object_part_content_set(ad->albuminfo.layout, + "elm.swallow.view", noc); } else { if (view_mode == GL_VIEW_ALBUMS_EDIT) { _gl_albums_create_items(ad, ad->albuminfo.edit_view); + /* Display selectioninfo */ + int cnt = _gl_data_get_albums_selected_cnt(ad); + _gl_notify_create_selinfo(ad, + ad->albuminfo.edit_layout, + ad->albuminfo.nf_it_edit, + ad->albuminfo.albums_cnt, cnt, + true); } else { if (ad->albuminfo.nocontents) { /** @@ -1174,10 +766,9 @@ int gl_albums_update_view(void *data) 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 mass storage state */ - gl_get_mass_storage_state(ad); /* Update albums list*/ gl_refresh_albums_list(ad); @@ -1186,23 +777,23 @@ int gl_albums_update_view(void *data) } else if (!gl_check_gallery_empty(ad)) { _gl_albums_create_items(ad, ad->albuminfo.view); if (ad->albuminfo.cluster_list->edit_cnt) - gl_ui_disable_toolbar_item(ad, false, - GL_NAVI_ALBUMS, - false); + _gl_ctrl_disable_toolbar_item(ad, false, + GL_NAVI_ALBUMS, + false); else - gl_ui_disable_toolbar_item(ad, true, - GL_NAVI_ALBUMS, - true); + _gl_ctrl_disable_toolbar_item(ad, true, + GL_NAVI_ALBUMS, + true); } else { gl_dbg("View is empty."); gl_albums_update_items(ad); - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - true); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + true); } } else if (view_mode == GL_VIEW_ALBUMS_EDIT || view_mode == GL_VIEW_ALBUMS_RENAME) { - if (gl_db_update_cluster_list(ad) != GL_DB_SUCCESS) { - gl_dbgE("gl_db_update_cluster_list failed!"); + if (_gl_data_update_cluster_list(ad) != 0) { + gl_dbgE("_gl_data_update_cluster_list failed!"); return -1; } @@ -1214,10 +805,10 @@ int gl_albums_update_view(void *data) gl_dbg("Edit view is empty, back to albums view"); gl_ui_edit_cancel(ad); - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - true); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + true); } else { - int sel_cnt = gl_db_get_albums_selected_cnt(ad); + int sel_cnt = _gl_data_get_albums_selected_cnt(ad); int invalid_m = GL_INVALID_NONE; /* Album selected for rename was deleted */ if (view_mode == GL_VIEW_ALBUMS_RENAME) { @@ -1227,8 +818,10 @@ int gl_albums_update_view(void *data) /* Remove invalid widgets */ gl_del_invalid_widgets(ad, invalid_m); /* Disable control bar buttons */ - gl_ui_disable_toolbar_items(ad, - ad->albuminfo.nf_it_edit); + _gl_ctrl_disable_toolbar_items(ad, + ad->albuminfo.nf_it_edit, + true, + true); if (sel_cnt == 0) /* Reset view mode */ gl_set_view_mode(ad, @@ -1238,8 +831,9 @@ int gl_albums_update_view(void *data) /* If none albums selected */ gl_dbgW("None albums selected!"); /* Disable control bar buttons */ - gl_ui_disable_toolbar_items(ad, - ad->albuminfo.nf_it_edit); + _gl_ctrl_disable_toolbar_items(ad, + ad->albuminfo.nf_it_edit, + true, true); /* Remove invalid widgets */ gl_del_invalid_widgets(ad, invalid_m); /* Reset view mode */ @@ -1250,6 +844,12 @@ int gl_albums_update_view(void *data) Evas_Object *edit_view = ad->albuminfo.edit_view; if (gl_get_view_mode(ad) == GL_VIEW_ALBUMS_EDIT) { _gl_albums_create_items(ad, edit_view); + /* Display selectioninfo */ + _gl_notify_create_selinfo(ad, + ad->albuminfo.edit_layout, + ad->albuminfo.nf_it_edit, + ad->albuminfo.albums_cnt, + sel_cnt, true); } else { /* Cluster list updated, clear view */ elm_gengrid_clear(edit_view); @@ -1261,49 +861,40 @@ int gl_albums_update_view(void *data) /** * Remove nocontents view and show albums view. -* gallery is empty->home key tapped +* 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 *layout_inner = NULL; + Evas_Object *view = NULL; gl_dbg(""); if (ad->albuminfo.nocontents && !gl_check_gallery_empty(ad)) { gl_dbg("Remove nocontents view then create albums view."); - evas_object_del(ad->albuminfo.nocontents); ad->albuminfo.nocontents = NULL; - layout_inner = gl_albums_create_view(ad, ad->maininfo.navi_bar); - - Evas_Object *old_view = NULL; - old_view = elm_object_part_content_unset(ad->albuminfo.layout, - "elm.swallow.view"); - evas_object_del(old_view); - elm_object_part_content_set(ad->albuminfo.layout, "elm.swallow.view", - layout_inner); - evas_object_show(layout_inner); - ad->albuminfo.view = layout_inner; - - gl_ui_disable_toolbar_item(ad, false, GL_NAVI_ALBUMS, false); + view = gl_albums_create_view(ad, ad->maininfo.naviframe); + elm_object_part_content_set(ad->albuminfo.layout, + "elm.swallow.view", view); + evas_object_show(view); + ad->albuminfo.view = view; + + _gl_ctrl_disable_toolbar_item(ad, false, GL_NAVI_ALBUMS, false); + } else if (ad->albuminfo.nocontents) { + gl_dbg("Gallery is empty!"); + bool b_update = false; + b_update = _gl_nocontents_update_label(ad->albuminfo.nocontents, + GL_STR_NO_ALBUMS); + /* Update toolbar state */ + if (b_update) + _gl_ctrl_disable_toolbar_item(ad, false, + GL_NAVI_ALBUMS, + false); } else { - gl_dbg("Nocontents was removed or Gallery is empty!"); - } - - return 0; -} - -int gl_albums_del_grid_append_idler(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - - if (ad->gridinfo.append_idler) { - ecore_idler_del(ad->gridinfo.append_idler); - ad->gridinfo.append_idler = NULL; + gl_dbg("Nocontents was removed!"); } return 0; @@ -1318,7 +909,7 @@ int gl_albums_free_cover_thumbs(void *data) for (i = 0; i < GL_ALBUM_COVER_THUMB_NUM; i++) { if (ad->albuminfo.cover_thumbs[i]) { - gl_db_destroy_item(ad->albuminfo.cover_thumbs[i]); + _gl_data_destroy_item(ad->albuminfo.cover_thumbs[i]); ad->albuminfo.cover_thumbs[i] = NULL; } } @@ -1333,14 +924,57 @@ int gl_albums_free_data(void *data) GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - gl_albums_del_grid_append_idler(data); - gl_albums_free_cover_thumbs(data); - if (ad->albuminfo.move_album_id) { - free(ad->albuminfo.move_album_id); - ad->albuminfo.move_album_id = NULL; + if (ad->albuminfo.path) { + free(ad->albuminfo.path); + ad->albuminfo.path = NULL; } 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); + + 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, + 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 || + view_mode == GL_VIEW_VIDEOLIST_EDIT) { + gl_del_invalid_widgets(ad, GL_INVALID_NONE); + /* Set flag to update albums list */ + ad->albuminfo.update_albums_list = true; + gl_ui_edit_cancel(ad); + } else { + gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); + } + + return -1; + } + } + + __gl_albums_reset_view(ad); + + return 0; +} + diff --git a/src/features/gl-controlbar.c b/src/features/gl-controlbar.c deleted file mode 100755 index d9728d1..0000000 --- a/src/features/gl-controlbar.c +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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-gridview.h" -#include "gl-listview.h" -#include "gl-db-handler.h" -#include "gl-strings.h" - -#define GL_CTRL_STYLE_TOOLBAR "gallery/default" -#define GL_CTRL_SEG_STYLE "gallery/default" -#define GL_SEGMENT_WIDTH_MIN_INC (433*elm_config_scale_get()) //(143+2+143+2+143) - -static void -_gl_ctrl_segment_change_cb(void *data, Evas_Object * obj, void *event_info) -{ - GL_CHECK(data); - gl_appdata *ad = (gl_appdata *)data; - Elm_Object_Item *seg_it = NULL; - gl_dbg(""); - - if (ad->uginfo.ug_called_by_me || - ad->gridinfo.append_idler) - { - gl_dbg("UG invoked or appending gridview."); - seg_it = elm_segment_control_item_get(obj, ad->albuminfo.seg_mode); - GL_CHECK(seg_it); - elm_segment_control_item_selected_set(seg_it, EINA_TRUE); - return; - } - - int idx = 0; - seg_it = elm_segment_control_item_selected_get(obj); - GL_CHECK(seg_it); - idx = elm_segment_control_item_index_get(seg_it); - if (idx == 0) - { - gl_dbg("Creating all-media view"); - ad->albuminfo.seg_mode = GL_CTRL_SEG_ALL; - gl_ui_reset_toolbar_item(ad, GL_CTRL_SEG_ALL, false); - - if (ad->gridinfo.all_view == NULL) - { - Evas_Object *grid = gl_grid_create_view(ad, - ad->maininfo.navi_bar, GL_GRID_ALL); - ad->gridinfo.all_view = grid; - } else { - /* just update the data */ - ad->gridinfo.grid_view_mode = GL_GRID_ALL; - gl_grid_update_items(ad); - } - - elm_object_part_content_unset(ad->gridinfo.layout, - "elm.swallow.view"); - evas_object_hide(ad->listinfo.video_view); - evas_object_hide(ad->gridinfo.image_view); - - evas_object_show(ad->gridinfo.all_view); - elm_object_part_content_set(ad->gridinfo.layout, - "elm.swallow.view", ad->gridinfo.all_view); - gl_set_view_mode(ad, GL_VIEW_THUMBS); - } - else if (idx == 1) - { - gl_dbg("Creating image view"); - ad->albuminfo.seg_mode = GL_CTRL_SEG_IMAGES; - gl_ui_reset_toolbar_item(ad, GL_CTRL_SEG_IMAGES, false); - - if(ad->listinfo.video_nocontents) - gl_list_clear_view(ad); - - if (ad->gridinfo.image_view == NULL) - { - Evas_Object *grid = gl_grid_create_view(ad, - ad->maininfo.navi_bar, GL_GRID_IMAGES); - ad->gridinfo.image_view = grid; - } else { - /* just update the data */ - ad->gridinfo.grid_view_mode = GL_GRID_IMAGES; - gl_grid_update_items(ad); - } - - elm_object_part_content_unset(ad->gridinfo.layout, "elm.swallow.view"); - evas_object_hide(ad->listinfo.video_view); - evas_object_hide(ad->gridinfo.all_view); - - evas_object_show(ad->gridinfo.image_view); - elm_object_part_content_set(ad->gridinfo.layout, - "elm.swallow.view", ad->gridinfo.image_view); - gl_set_view_mode(ad, GL_VIEW_THUMBS); - } - else if (idx == 2) - { - ad->albuminfo.seg_mode = GL_CTRL_SEG_VIDEOS; - gl_ui_reset_toolbar_item(ad, GL_CTRL_SEG_VIDEOS, false); - - gl_dbg("Creating video list"); - - /* Set the grid view mode for creating nocontents view */ - ad->gridinfo.grid_view_mode = GL_GRID_VIDEOS; - gl_set_view_mode(ad, GL_VIEW_VIDEOLIST); - - if(ad->gridinfo.image_nocontents) - { - evas_object_del(ad->gridinfo.image_view); - ad->gridinfo.image_nocontents = NULL; - ad->gridinfo.image_view = NULL; - } - - if (ad->listinfo.video_view == NULL) { - Evas_Object *list_view = gl_list_create_view(ad, ad->maininfo.navi_bar); - ad->listinfo.video_view = list_view; - } else { - /* just update the data */ - gl_list_update_view(ad); - } - - elm_object_part_content_unset(ad->gridinfo.layout, "elm.swallow.view"); - evas_object_hide(ad->gridinfo.all_view); - evas_object_hide(ad->gridinfo.image_view); - - evas_object_show(ad->listinfo.video_view); - elm_object_part_content_set(ad->gridinfo.layout, - "elm.swallow.view", ad->listinfo.video_view); - } - -} - -Evas_Object *_gl_ctrl_get_toolbar(Elm_Object_Item *nf_it) -{ - GL_CHECK_NULL(nf_it); - gl_dbg(""); - Evas_Object *obj = NULL; - - obj = elm_object_item_part_content_get(nf_it, GE_NAVIFRAME_CONTROLBAR); - if (obj) - return obj; - else - gl_dbgE("Title object is NULL!"); - - return NULL; -} - -Evas_Object *_gl_ctrl_create_toolbar(void *data, Evas_Object *parent) -{ - GL_CHECK_NULL(parent); - GL_CHECK_NULL(data); - Evas_Object *cbar = NULL; - cbar = elm_toolbar_add(parent); - GL_CHECK_NULL(cbar); - elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND); - elm_toolbar_homogeneous_set(cbar, EINA_FALSE); - elm_object_style_set(cbar, GL_CTRL_STYLE_TOOLBAR); - return cbar; -} - -/* create segment control in thumbnail view */ -Evas_Object *_gl_ctrl_create_segment(void *data, Evas_Object *parent) -{ - gl_dbg(""); - GL_CHECK_NULL(parent); - GL_CHECK_NULL(data); - gl_appdata *ad = (gl_appdata *)data; - Elm_Object_Item *seg_item[GL_CTRL_SEG_CNT]; - Evas_Object *segment = NULL; - - /** - * Stop creating segment bar when launched by appsvc with - * specified file-type ( image or video ) only. - */ - if (ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM && - (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_IMAGE || - ad->albuminfo.aul_file_type == GL_AUL_FILE_T_VIDEO)) { - gl_dbgW("Segment bar not created when launched by appsvc."); - return NULL; - } - - Evas_Object *layout = elm_layout_add(parent); - GL_CHECK_NULL(layout); - evas_object_size_hint_min_set(layout, GL_SEGMENT_WIDTH_MIN_INC, 0); - elm_layout_file_set(layout, GL_EDJ_FILE, GL_GRP_SEGMENT); - 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); - - segment = elm_segment_control_add(layout); - GL_CHECK_NULL(segment); - elm_object_style_set(segment, GL_CTRL_SEG_STYLE); - seg_item[0] = elm_segment_control_item_add(segment, NULL, - GL_CTRL_SEG_ITEM_ALL); - seg_item[1] = elm_segment_control_item_add(segment, NULL, - GL_CTRL_SEG_ITEM_IMAGES); - seg_item[2] = elm_segment_control_item_add(segment, NULL, - GL_CTRL_SEG_ITEM_VIDEOS); - - if (ad->albuminfo.seg_mode > GL_CTRL_SEG_VIDEOS) { - gl_dbgE("seg_mode > GL_CTRL_SEG_VIDEOS"); - return NULL; - } - elm_segment_control_item_selected_set(seg_item[ad->albuminfo.seg_mode], - EINA_TRUE); - - elm_object_part_content_set(layout, "segment", segment); - evas_object_show(layout); - - evas_object_smart_callback_add(segment, "changed", - _gl_ctrl_segment_change_cb, ad); - return layout; -} diff --git a/src/features/gl-gridview.c b/src/features/gl-gridview.c index e9b7ff7..8b1ca97 100755 --- a/src/features/gl-gridview.c +++ b/src/features/gl-gridview.c @@ -18,66 +18,23 @@ #include "gl-gridview.h" #include "gl-ui-util.h" #include "gl-util.h" +#include "gl-drm.h" #include "gl-albums.h" -#include "gl-db-handler.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-thumb.h" +#ifdef _USE_ROTATE_BG +#include "gl-exif.h" +#endif /* Icon swallowed to part "elm.swallow.icon" */ -#define GL_GRID_ICON_SIZE 156 #define GL_GRID_TOUCH_RANGE 20 -#define GL_PHOTOFRAME_STYLE_VIDEO_BOOKMARK "default_layout_video_bookmark" -#define GL_PHOTOFRAME_STYLE_VIDEO "default_layout_video" -#define GL_PHOTOFRAME_STYLE_DEFAULT "default_layout" -#define GL_GENGRID_ITEM_STYLE_THUMBNAIL "gallery/thumbnail_view" - - -static void -_gl_grid_drag_up(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_drag_right(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_drag_down(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_drag_left(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_drag_stop(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_selected(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_unselected(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_clicked(void *data, Evas_Object * obj, void *event_info) -{ -} - -static void -_gl_grid_longpress(void *data, Evas_Object * obj, void *event_info) -{ -} - static void _gl_grid_sel_icon(void *data) { @@ -86,7 +43,7 @@ _gl_grid_sel_icon(void *data) } static void -_gl_grid_item_check_changed(void *data, Evas_Object * obj, void *event_info) +_gl_grid_item_check_changed(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(obj); GL_CHECK(data); @@ -94,45 +51,52 @@ _gl_grid_item_check_changed(void *data, Evas_Object * obj, void *event_info) 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) + if (view_mode == GL_VIEW_THUMBS_EDIT) { + view_ly = ad->gridinfo.edit_layout; + nf_it = ad->gridinfo.nf_it_edit; + } else { return; + } + Eina_Bool checked = elm_check_state_get(obj); gitem->checked = checked; if (checked) { gl_dbg("Append:%s", gitem->item->file_url); - gl_db_selected_list_append(ad, gitem); + _gl_data_selected_list_append(ad, gitem); } else { gl_dbg("Remove:%s", gitem->item->file_url); - gl_db_selected_list_remove(ad, gitem); + _gl_data_selected_list_remove(ad, gitem); } /* Display selectioninfo */ - int cnt = gl_db_selected_list_count(ad); - gl_ui_create_selinfo(ad, ad->gridinfo.edit_layout, - ad->gridinfo.nf_it_edit, ad->gridinfo.thumbs_cnt, - cnt, false); + int cnt = _gl_data_selected_list_count(ad); + _gl_notify_create_selinfo(ad, view_ly, nf_it, ad->gridinfo.thumbs_cnt, + cnt, false); } static void -_gl_grid_shrink_resp_cb(void *data, Evas_Object * obj, +_gl_grid_shrink_resp_cb(void *data, Evas_Object *obj, const char *emission, const char *source) { GL_CHECK(data); gl_dbg(""); _gl_grid_sel_icon(data); - edje_object_signal_callback_del(obj, "shrink,expand,done", "bg", - _gl_grid_shrink_resp_cb); + + edje_object_signal_callback_del(obj, + "shrink,expand,done", "bg", _gl_grid_shrink_resp_cb); + } -Evas_Object * -_gl_grid_get_content(void *data, Evas_Object * obj, const char *part) +static Evas_Object *__gl_grid_get_content(void *data, Evas_Object *obj, const char *part) { GL_CHECK_NULL(part); GL_CHECK_NULL(strlen(part)); @@ -143,146 +107,88 @@ _gl_grid_get_content(void *data, Evas_Object * obj, const char *part) 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 (!strcmp(part, "elm.swallow.icon")) - { - Evas_Object *layout = elm_layout_add(obj); - GL_CHECK_NULL(layout); - Evas_Object *bg = elm_bg_add(obj); - GL_CHECK_NULL(bg); - elm_bg_load_size_set(bg, item_size, item_size); - - int all_cnt = ad->maininfo.medias_cnt; - - /* Only one photo in a album */ + if (!g_strcmp0(part, GL_THUMB_ICON)) { + Evas_Object *layout = NULL; char *path = NULL; - if (all_cnt < 2 && gitem->item->type == MINFO_ITEM_IMAGE) { - path = _GETICON(gitem->item->file_url); - if (gl_is_image_valid(ad, path) == false) - path = _GETICON(gitem->item->thumb_url); - elm_bg_file_set(bg, path, NULL); - } else { - path = _gl_get_thumb(ad, gitem->item->file_url, - &gitem->item->thumb_url); - if (path) { - elm_bg_file_set(bg, path, NULL); - free(path); - path = NULL; + char *drm_path = NULL; + unsigned int orient = 0; + + /* Is it DRM file? Has a valid RO? */ + if(gl_drm_is_drm_file(gitem->item->file_url) && + gl_drm_check_valid_ro(gitem->item->file_url, + gl_drm_get_permtype(gitem->item->type)) == false) { + path = GL_DEFAULT_THUMB_ICON; + is_expired_drm = true; + } 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 { - elm_bg_file_set(bg, gitem->item->thumb_url, - NULL); + char *drm_path = gl_drm_get_file_path(gitem); + path = _GETICON(drm_path); + if (gl_is_image_valid(ad, path) == false) + path = _GETICON(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 { + int ret = -1; + ret = _gl_get_thumb(ad, gitem->item->file_url, + &gitem->item->thumb_url); + /* Use default image */ + if (ret < 0) + path = GL_DEFAULT_THUMB_ICON; + else + path = gitem->item->thumb_url; } - 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); - - if (gitem->item->type == MINFO_ITEM_VIDEO) - { + 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; - // Set bookmark icon. - if (gitem->item->meta_info == NULL || - gitem->item->meta_info->video_info == NULL) - { + if (gitem->item->video_info == NULL) bk_len = 0; - } else - { - bk_len = g_list_length(gitem->item->meta_info->video_info->bookmarks); - } - if (bk_len) - { - elm_layout_theme_set(layout, GL_CLASS_GENGRID, - GL_GRP_PHOTOFRAME, GL_PHOTOFRAME_STYLE_VIDEO_BOOKMARK); - } - 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); - - if (bk_len) - { - Evas_Object *icon = elm_icon_add(obj); - elm_icon_file_set(icon, GL_THUMB_BOOKMARK, NULL); - evas_object_show(icon); - elm_object_part_content_set(layout, "elm.swallow.bookmarkicon", icon); - } - - // Set duration text - /* Running time of the video */ - if (gitem->item->meta_info && - gitem->item->meta_info->video_info) - { - char ret_str[GL_FILE_PATH_LEN_MAX] = { 0, }; - unsigned int v_dur = gitem->item->meta_info->video_info->duration; - 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(ret_str, sizeof(ret_str), - "%02d:%02d:%02d", dur_hr, dur_min, dur_sec); - ret_str[strlen(ret_str)] = '\0'; - elm_object_part_text_set(layout, "elm.text", ret_str); - } + bk_len = gitem->item->video_info->bookmarks; + layout = _gl_thumb_show_part_icon_video(obj, path, + v_dur, bk_len, + is_expired_drm, + item_size); + } else { + layout = _gl_thumb_show_part_icon_image(obj, path, + orient, + is_expired_drm, + item_size); } - 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); + + if(drm_path) { + free(drm_path); + drm_path = NULL; } - evas_object_show(layout); evas_object_event_callback_add(layout, EVAS_CALLBACK_MOUSE_DOWN, gl_grid_item_mouse_down, gitem); evas_object_event_callback_add(layout, EVAS_CALLBACK_MOUSE_UP, gl_grid_item_mouse_up, gitem); + return layout; - } - else if (!strcmp(part, "elm.swallow.end") && - (view_mode == GL_VIEW_THUMBS_EDIT)) - { + } else if (!g_strcmp0(part, GL_THUMB_CHECKBOX) && + view_mode == GL_VIEW_THUMBS_EDIT) { Evas_Object *ck = NULL; - - ck = elm_check_add(obj); + ck = _gl_thumb_show_part_checkbox(obj, gitem->checked, + _gl_grid_item_check_changed, + data); GL_CHECK_NULL(ck); - elm_object_style_set(ck, GL_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", - _gl_grid_item_check_changed, data); - evas_object_show(ck); - return ck; } @@ -290,7 +196,7 @@ _gl_grid_get_content(void *data, Evas_Object * obj, const char *part) } static bool -_gl_grid_create_items(void *data, Evas_Object * parent) +_gl_grid_create_items(void *data, Evas_Object *parent) { GL_CHECK_FALSE(data); gl_appdata *ad = (gl_appdata *)data; @@ -304,12 +210,12 @@ _gl_grid_create_items(void *data, Evas_Object * parent) ad->gridinfo.thumbgic.item_style = GL_GENGRID_ITEM_STYLE_THUMBNAIL; ad->gridinfo.thumbgic.func.text_get = NULL; - ad->gridinfo.thumbgic.func.content_get = _gl_grid_get_content; + ad->gridinfo.thumbgic.func.content_get = __gl_grid_get_content; elm_gengrid_clear(parent); for (i = 1; i <= cnt; i++) { - gl_db_get_item_by_index(ad, i, false, &gitem); + _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..."); @@ -319,14 +225,13 @@ _gl_grid_create_items(void *data, Evas_Object * parent) if (!gitem->item->file_url) { gl_dbg("file_url is invalid."); - ret = minfo_delete_media_id(ad->maininfo.db_handle, - gitem->item->uuid); - if (ret < 0) + ret = _gl_data_delete_media(ad, gitem->item); + if (ret != 0) { continue; } - gl_db_selected_list_remove(ad, gitem); - gl_db_item_list_remove(ad, gitem); + _gl_data_selected_list_remove(ad, gitem); + _gl_data_item_list_remove(ad, gitem); cnt--; i--; gitem = NULL; @@ -334,10 +239,13 @@ _gl_grid_create_items(void *data, Evas_Object * parent) } if (ad->gridinfo.back_to_normal) + { gitem->checked = false; + //gitem->check_obj = NULL; + } if (ad->gridinfo.grid_view_mode == GL_GRID_IMAGES && - gitem->item->type != MINFO_ITEM_IMAGE) + gitem->item->type != MEDIA_CONTENT_TYPE_IMAGE) continue; gitem->elm_item = elm_gengrid_item_append(parent, @@ -350,6 +258,7 @@ _gl_grid_create_items(void *data, Evas_Object * parent) } + /* Disable grid item selection callback */ elm_gengrid_select_mode_set(parent, ELM_OBJECT_SELECT_MODE_NONE); ad->gridinfo.thumbs_cnt = item_cnt; @@ -366,8 +275,8 @@ _gl_grid_create_items(void *data, Evas_Object * parent) } void -gl_grid_item_mouse_down(void *data, Evas * e, - Evas_Object * obj, void *event_info) +gl_grid_item_mouse_down(void *data, Evas *e, + Evas_Object *obj, void *event_info) { GL_CHECK(obj); GL_CHECK(event_info); @@ -377,19 +286,19 @@ gl_grid_item_mouse_down(void *data, Evas * e, gl_appdata *ad = (gl_appdata *)gitem->ad; Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info; - ad->gridinfo.touch_info.x = ev->output.x; - ad->gridinfo.touch_info.y = ev->output.y; + ad->gridinfo.grid_touch_info.x = ev->output.x; + ad->gridinfo.grid_touch_info.y = ev->output.y; if (ad->uginfo.ug_called_by_me == NULL) { edje_object_signal_emit(_EDJ(obj), "mouse,down,shrink", "bg"); - ad->gridinfo.touch_info.b_pressed = true; + ad->gridinfo.grid_touch_info.b_pressed = true; } } void -gl_grid_item_mouse_up(void *data, Evas * e, - Evas_Object * obj, void *event_info) +gl_grid_item_mouse_up(void *data, Evas *e, + Evas_Object *obj, void *event_info) { GL_CHECK(data); gl_item *gitem = (gl_item *) data; @@ -407,54 +316,31 @@ gl_grid_item_mouse_up(void *data, Evas * e, { goto RET_WO_EXEC; } - if ((abs(ad->gridinfo.touch_info.x - ev->output.x) > GL_GRID_TOUCH_RANGE) || - (abs(ad->gridinfo.touch_info.y - ev->output.y) > GL_GRID_TOUCH_RANGE)) + 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(""); - if (ad->gridinfo.touch_info.b_pressed) + if (ad->gridinfo.grid_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", _gl_grid_shrink_resp_cb, data); - ad->gridinfo.touch_info.b_pressed = false; + ad->gridinfo.grid_touch_info.b_pressed = false; } return; RET_WO_EXEC: - if (ad->gridinfo.touch_info.b_pressed) + if (ad->gridinfo.grid_touch_info.b_pressed) { edje_object_signal_emit(_EDJ(obj), "mouse,up,expand", "bg"); - ad->gridinfo.touch_info.b_pressed = false; + ad->gridinfo.grid_touch_info.b_pressed = false; } } -static int -_gl_grid_set_view_property(Evas_Object * gv) -{ - elm_gengrid_align_set(gv, 0.5, 0.0); - // vertical scrolling - elm_gengrid_horizontal_set(gv, EINA_FALSE); - elm_gengrid_bounce_set(gv, EINA_FALSE, EINA_TRUE); - elm_gengrid_multi_select_set(gv, EINA_TRUE); - - evas_object_smart_callback_add(gv, "selected", _gl_grid_selected, NULL); - evas_object_smart_callback_add(gv, "unselected", _gl_grid_unselected, NULL); - evas_object_smart_callback_add(gv, "clicked", _gl_grid_clicked, NULL); - evas_object_smart_callback_add(gv, "longpressed", _gl_grid_longpress, NULL); - evas_object_smart_callback_add(gv, "drag,start,up", _gl_grid_drag_up, NULL); - evas_object_smart_callback_add(gv, "drag,start,right", _gl_grid_drag_right, NULL); - evas_object_smart_callback_add(gv, "drag,start,down", _gl_grid_drag_down, NULL); - evas_object_smart_callback_add(gv, "drag,start,left", _gl_grid_drag_left, NULL); - evas_object_smart_callback_add(gv, "drag,stop", _gl_grid_drag_stop, NULL); - evas_object_size_hint_weight_set(gv, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - - return 0; -} - /* * Set new view to all/image_grid_view. * @@ -475,7 +361,7 @@ static int _gl_grid_set_view(void *data, Evas_Object *view, bool b_noc) gl_grid_set_nocontents(ad, NULL); break; case GL_GRID_IMAGES: - ad->gridinfo.image_view = view; + ad->gridinfo.images_view = view; if (b_noc) gl_grid_set_nocontents(ad, view); else @@ -489,7 +375,7 @@ static int _gl_grid_set_view(void *data, Evas_Object *view, bool b_noc) } void -gl_grid_sel_cb(void *data, Evas_Object * obj, void *event_info) +gl_grid_sel_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(data); gl_item *gitem = (gl_item *) data; @@ -502,15 +388,20 @@ gl_grid_sel_cb(void *data, Evas_Object * obj, void *event_info) gl_dbg(""); if (view_mode != GL_VIEW_THUMBS) + { + //gl_dbg("EditMode.. now return."); return; + } else + { gl_dbg("ViewMode"); + } - if (gitem->item->type == MINFO_ITEM_IMAGE || - gitem->item->type == MINFO_ITEM_VIDEO) + if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE || + gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) { gl_dbg("Loading UG-IMAGE(VIDEO)-VIEWER"); - gl_ext_load_iv_ug(ad, gitem); + gl_ext_load_iv_ug(ad, gitem, GL_UG_IV); } } @@ -545,13 +436,11 @@ gl_grid_idler_append_items(void *data) return -1; } /* Get other items from DB */ - ret = gl_db_get_item_list(ad, ad->albuminfo.current_album, - (GL_FIRST_VIEW_END_POS + 1), - GL_GET_UNTIL_LAST_RECORD); - gl_dbg("\n\n############gl_db_get_item_list Error code: %d#################\n", ret); - if (ret < 0) - { - gl_dbg("gl_db_get_item_list ERROR, return!"); + ret = _gl_data_get_item_list(ad, 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; } @@ -570,7 +459,7 @@ gl_grid_idler_append_items(void *data) for (; i <= cnt; i++) { - gl_db_get_item_by_index(ad, i, false, &gitem); + _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..."); @@ -580,9 +469,9 @@ gl_grid_idler_append_items(void *data) if (!gitem->item->file_url) { gl_dbg("file_url is invalid."); - minfo_delete_media_id(ad->maininfo.db_handle, gitem->item->uuid); - gl_db_selected_list_remove(ad, gitem); - gl_db_item_list_remove(ad, gitem); + _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; @@ -590,7 +479,7 @@ gl_grid_idler_append_items(void *data) } if (ad->gridinfo.grid_view_mode == GL_GRID_IMAGES && - gitem->item->type != MINFO_ITEM_IMAGE) + gitem->item->type != MEDIA_CONTENT_TYPE_IMAGE) continue; gitem->elm_item = elm_gengrid_item_append(ad->gridinfo.all_view, @@ -602,7 +491,7 @@ gl_grid_idler_append_items(void *data) gitem->sequence = item_cnt + GL_FIRST_VIEW_END_POS + 1; } - gl_dbg("\n\n<<<<<<<maininfo.naviframe, GL_EDJ_FILE, + GL_GRP_GRIDVIEW); + evas_object_show(layout); + + return layout; +} + +Evas_Object *_gl_grid_create_view(void *data, Evas_Object *parent, + gl_grid_mode mode, bool b_use_idler) { GL_CHECK_NULL(parent); GL_CHECK_NULL(data); gl_appdata *ad = (gl_appdata *)data; Evas_Object *grid = NULL; - int icon_size = 0; - int item_w = 0; - int item_h = 0; ad->gridinfo.grid_view_mode = mode; - grid = elm_gengrid_add(ad->maininfo.navi_bar); - double scale_factor = ad->maininfo.win_scale; - gl_dbg("Own scale: %f, elm_config_scale_get =%f", scale_factor, elm_config_scale_get()); - icon_size = (int)(GL_GRID_ICON_SIZE * scale_factor); - item_w = (int)(GL_GRID_ITEM_SIZE_W * scale_factor); - item_h = (int)(GL_GRID_ITEM_SIZE_H * scale_factor); + grid = _gl_thumb_add_gengrid(parent); if (!_gl_grid_create_items(ad, grid)) { evas_object_del(grid); grid = NULL; - Evas_Object *noc = gl_ui_create_nocontents_full(ad); + Evas_Object *noc = _gl_nocontents_create(ad); gl_grid_set_nocontents(ad, noc); evas_object_show(noc); return noc; - } else { - gl_dbg("gl_grid_item_cnt : %d", ad->gridinfo.thumbs_cnt); - if (ad->gridinfo.thumbs_cnt == GL_GRID_ITEM_ZOOM_LEVEL_01_CNT) { - icon_size *= GL_GRID_ITEM_ZOOM_LEVEL_01; - item_w *= GL_GRID_ITEM_ZOOM_LEVEL_01; - item_h *= GL_GRID_ITEM_ZOOM_LEVEL_01; - } else if (ad->gridinfo.thumbs_cnt <= GL_GRID_ITEM_ZOOM_LEVEL_02_CNT) { - icon_size *= GL_GRID_ITEM_ZOOM_LEVEL_02; - item_w *= GL_GRID_ITEM_ZOOM_LEVEL_02; - item_h *= GL_GRID_ITEM_ZOOM_LEVEL_02; - } - - ad->gridinfo.icon_size = icon_size; - gl_grid_set_nocontents(ad, NULL); - evas_object_show(grid); } - elm_gengrid_item_size_set(grid, item_w, item_h); - gl_dbg("Gengrid item width: %d, height: %d, icon size: %d.", item_w, - item_h, icon_size); + gl_dbg("thumbs_cnt : %d", ad->gridinfo.thumbs_cnt); + gl_grid_set_item_size(ad, grid); + + evas_object_show(grid); - _gl_grid_set_view_property(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_grid_del_append_idler(ad); + /* Add idler */ + ad->gridinfo.grid_append_idler = ecore_idler_add(__gl_grid_append_items_idler_cb, + ad); + } return grid; } @@ -670,18 +580,20 @@ gl_grid_change_to_edit(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - GL_CHECK_VAL(ad->gridinfo.edit_view, -1); - gl_dbg(""); 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) - { - gl_dbg("Error: not in edit mode"); + if (view_mode == GL_VIEW_THUMBS_EDIT) { + view = ad->gridinfo.edit_view; + } else { + gl_dbgE("Wrong view mode!"); return -1; } + GL_CHECK_VAL(view, -1); - b_ret = _gl_grid_create_items(ad, ad->gridinfo.edit_view); + b_ret = _gl_grid_create_items(ad, view); gl_grid_set_item_size(ad, NULL); if (!b_ret) { @@ -697,23 +609,28 @@ gl_grid_change_to_view(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - gl_dbg(""); int gridview_mode = ad->gridinfo.grid_view_mode; bool b_ret = false; + gl_dbg("gridview_mode: %d", gridview_mode); if (ad->gridinfo.all_view == NULL - && ad->gridinfo.image_view == NULL) + && ad->gridinfo.images_view == NULL) { gl_dbg("Error : Any gridview doesn't exist"); return -1; } - ad->gridinfo.back_to_normal = true; // back from edit mode, save state. + /* Come back from edit mode, save state */ + ad->gridinfo.back_to_normal = true; if (gridview_mode == GL_GRID_ALL) + { b_ret = _gl_grid_create_items(ad, ad->gridinfo.all_view); + } else if (gridview_mode == GL_GRID_IMAGES) - b_ret = _gl_grid_create_items(ad, ad->gridinfo.image_view); + { + b_ret = _gl_grid_create_items(ad, ad->gridinfo.images_view); + } gl_grid_set_item_size(ad, NULL); if (!b_ret) { @@ -744,8 +661,8 @@ bool gl_grid_get_view(void *data, Evas_Object **view) b_view = true; break; case GL_GRID_IMAGES: - gv = ad->gridinfo.image_view; - if (gv && ad->gridinfo.image_nocontents == NULL) + gv = ad->gridinfo.images_view; + if (gv && ad->gridinfo.images_nocontents == NULL) b_view = true; break; default: @@ -775,7 +692,7 @@ int gl_grid_set_nocontents(void *data, Evas_Object *noc) ad->gridinfo.all_nocontents = noc; break; case GL_GRID_IMAGES: - ad->gridinfo.image_nocontents = noc; + ad->gridinfo.images_nocontents = noc; break; default: break; @@ -784,24 +701,10 @@ int gl_grid_set_nocontents(void *data, Evas_Object *noc) return 0; } -int gl_grid_update_items_cnt(void *data, int new_cnt) +int gl_grid_set_item_size(void *data, Evas_Object *gridview) { 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; -} - -int gl_grid_set_item_size(void *data, Evas_Object * gridview) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - int icon_size = (int)(GL_GRID_ICON_SIZE * ad->maininfo.win_scale); - int item_w = (int)(GL_GRID_ITEM_SIZE_W * ad->maininfo.win_scale); - int item_h = (int)(GL_GRID_ITEM_SIZE_H * ad->maininfo.win_scale); int cnt = 0; Evas_Object *gv = NULL; int view_mode = gl_get_view_mode(ad); @@ -830,21 +733,7 @@ int gl_grid_set_item_size(void *data, Evas_Object * gridview) ad->gridinfo.updated_thumbs_cnt = 0; } - if (cnt == GL_GRID_ITEM_ZOOM_LEVEL_01_CNT) { - icon_size *= GL_GRID_ITEM_ZOOM_LEVEL_01; - item_w *= GL_GRID_ITEM_ZOOM_LEVEL_01; - item_h *= GL_GRID_ITEM_ZOOM_LEVEL_01; - } else if (cnt <= GL_GRID_ITEM_ZOOM_LEVEL_02_CNT) { - icon_size *= GL_GRID_ITEM_ZOOM_LEVEL_02; - item_w *= GL_GRID_ITEM_ZOOM_LEVEL_02; - item_h *= GL_GRID_ITEM_ZOOM_LEVEL_02; - } - - ad->gridinfo.icon_size = icon_size; - elm_gengrid_item_size_set(gv, item_w, item_h); - gl_dbg("Gengrid item width: %d, height: %d, icon size: %d.", item_w, - item_h, icon_size); - return 0; + return _gl_thumb_set_size(ad, gv, cnt, &(ad->gridinfo.icon_size)); } Eina_Bool @@ -876,13 +765,14 @@ gl_grid_update_items(void *data) evas_object_hide(gv); evas_object_del(gv); _gl_grid_set_view(ad, NULL, false); - Evas_Object *noc = gl_ui_create_nocontents_full(ad); + Evas_Object *noc = _gl_nocontents_create(ad); evas_object_show(noc); _gl_grid_set_view(ad, noc, true); - elm_object_part_content_unset(ad->gridinfo.layout, "elm.swallow.view"); - elm_object_part_content_set(ad->gridinfo.layout, "elm.swallow.view", - noc); + elm_object_part_content_unset(ad->gridinfo.layout, + "elm.swallow.view"); + elm_object_part_content_set(ad->gridinfo.layout, + "elm.swallow.view", noc); } else { @@ -899,24 +789,28 @@ gl_grid_update_items(void *data) int view_m = ad->gridinfo.grid_view_mode; Evas_Object *view = NULL; - view = gl_grid_create_view(ad, ad->maininfo.navi_bar, view_m); + view = _gl_grid_create_view(ad, ad->gridinfo.layout, + view_m, false); if ((view_m == GL_GRID_IMAGES && - ad->gridinfo.image_nocontents) || + ad->gridinfo.images_nocontents) || (view_m == GL_GRID_ALL && ad->gridinfo.all_nocontents)) b_noc = true; /* No nocotents removed, gridview created, enable edit button */ - if (!b_noc) - gl_ui_disable_toolbar_item(ad, false, - GL_NAVI_THUMBS, - false); - else + if (!b_noc) { + _gl_ctrl_disable_toolbar_item(ad, false, + GL_NAVI_THUMBS, + false); + } else { b_noc = true; + } _gl_grid_set_view(ad, view, b_noc); - elm_object_part_content_unset(ad->gridinfo.layout, "elm.swallow.view"); - elm_object_part_content_set(ad->gridinfo.layout, "elm.swallow.view", view); + elm_object_part_content_unset(ad->gridinfo.layout, + "elm.swallow.view"); + elm_object_part_content_set(ad->gridinfo.layout, + "elm.swallow.view", view); } return res; @@ -927,23 +821,75 @@ gl_grid_clear_view(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; + ad->gridinfo.segment = NULL; - if (ad->gridinfo.all_view != NULL) - { + /* Destroy idler */ + _gl_grid_del_append_idler(data); + + if (ad->gridinfo.all_view != NULL) { evas_object_del(ad->gridinfo.all_view); ad->gridinfo.all_view = NULL; } - if (ad->gridinfo.image_view != NULL) - { - evas_object_del(ad->gridinfo.image_view); - ad->gridinfo.image_view = NULL; + if (ad->gridinfo.images_view != NULL) { + evas_object_del(ad->gridinfo.images_view); + ad->gridinfo.images_view = NULL; } - ad->gridinfo.all_nocontents = NULL; - ad->gridinfo.image_nocontents = NULL; - + ad->gridinfo.images_nocontents = NULL; ad->gridinfo.edit_it = NULL; return 0; } + +/* Update griditem size */ +int _gl_grid_update_item_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.edit_view; + } else { + b_view = gl_grid_get_view(ad, &_view); + } + + if (!b_view || !_view) { + gl_dbgE("gridview is invalid!"); + return -1; + } + } + + gl_grid_set_item_size(data, _view); + + _gl_thumb_update_gengrid(_view); + + return 0; +} + +int _gl_grid_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/features/gl-listview.c b/src/features/gl-listview.c index 732eedb..135c778 100755 --- a/src/features/gl-listview.c +++ b/src/features/gl-listview.c @@ -21,18 +21,18 @@ #include "gl-listview.h" #include "gl-ext-ug-load.h" #include "gl-ext-exec.h" -#include "gl-db-handler.h" +#include "gl-data.h" +#include "gl-drm.h" +#include "gl-controlbar.h" +#include "gl-button.h" +#include "gl-nocontents.h" +#include "gl-notify.h" #include "gl-progressbar.h" +#include "gl-video.h" +#include "gl-strings.h" +#include "gl-popup.h" -/* Icon size of video in list view */ -#define GL_VIDEO_ICON_WIDTH 168 -#define GL_VIDEO_ICON_HEIGHT 124 - -#define GL_GENLIST_ITEM_STYLE_VIDEO "video_list" -#define GL_GENLIST_ITEM_STYLE_VIDEO_EDIT "video_list_edit" - -static void -_gl_list_item_check_changed(void *data, Evas_Object * obj, void *event_info) +static void __gl_list_item_check_changed(void *data, Evas_Object * obj, void *event_info) { GL_CHECK(obj); GL_CHECK(data); @@ -60,112 +60,72 @@ _gl_list_item_check_changed(void *data, Evas_Object * obj, void *event_info) if (checked) { gl_dbg("Append:%s", gitem->item->file_url); - gl_db_selected_list_append(ad, gitem); + _gl_data_selected_list_append(ad, gitem); } else { gl_dbg("Remove:%s", gitem->item->file_url); - gl_db_selected_list_remove(ad, gitem); + _gl_data_selected_list_remove(ad, gitem); } - cnt = gl_db_selected_list_count(ad); + cnt = _gl_data_selected_list_count(ad); /* Display selectioninfo */ - gl_ui_create_selinfo(ad, ad->gridinfo.edit_layout, - ad->gridinfo.nf_it_edit, ad->listinfo.videos_cnt, - cnt, false); + _gl_notify_create_selinfo(ad, ad->gridinfo.edit_layout, + ad->gridinfo.nf_it_edit, + ad->listinfo.videos_cnt, cnt, false); } -static Evas_Object *__gl_list_show_pbar(Evas_Object *parent, gl_item *gitem) +static void __gl_list_share_cb(void *data, Evas_Object *obj, void *event_info) { - GL_CHECK_NULL(parent); - GL_CHECK_NULL(gitem); - GL_CHECK_NULL(gitem->item); - GL_CHECK_NULL(gitem->item->meta_info); - GL_CHECK_NULL(gitem->item->meta_info->video_info); - - if (gitem->item->meta_info->video_info->last_played_pos == 0) - return NULL; - - unsigned int last_pos = gitem->item->meta_info->video_info->last_played_pos; - unsigned int v_dur = gitem->item->meta_info->video_info->duration; - double ratio = ((double)last_pos) / ((double)v_dur); - gl_dbg("Last play position ratio: %f.", ratio); + gl_dbg(""); + GL_CHECK(data); + gl_item *gitem = (gl_item *)data; + GL_CHECK(gitem->ad); + gl_popup_create_title_popup(gitem->ad, GL_POPUP_THUMB_SHARE, + GL_STR_SHARE, NULL); +} - return gl_pb_add_list_pbar(parent, ratio); +static void __gl_list_del_cb(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg(""); + GL_CHECK(data); + _gl_popup_create_video_del_popup(data); } -static char * -_gl_list_text_get(void *data, Evas_Object * obj, const char *part) +static char *__gl_list_get_text(void *data, Evas_Object *obj, const char *part) { GL_CHECK_NULL(part); GL_CHECK_NULL(data); gl_item *gitem = (gl_item *) data; GL_CHECK_NULL(gitem->item); GL_CHECK_NULL(gitem->ad); - char ret_str[GL_FILE_PATH_LEN_MAX] = { 0, }; - if (!strcmp(part, "elm.text.title")) - { - if (gitem->item->display_name) - { + if (!g_strcmp0(part, GL_VIDEO_PART_TITLE) || + !g_strcmp0(part, GL_VIDEO_PART_SLIDE_TITLE)) { + if (gitem->item->display_name) { return strdup(gitem->item->display_name); - } - else - { - gl_dbg("gitem->item->display_name, addr=%p", gitem->item->display_name); + } else { + gl_dbgE("Invalid name!"); return NULL; } - } - else if (!strcmp(part, "elm.text.duration")) - { + } else if (!g_strcmp0(part, GL_VIDEO_PART_DURATION)) { /* Running time of the video */ - if (gitem->item->meta_info == NULL || - gitem->item->meta_info->video_info == NULL) - { - gl_dbg("meta info is NULL"); - return NULL; - } - - unsigned int v_dur = gitem->item->meta_info->video_info->duration; - 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; + unsigned int v_dur = 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; + if (gitem->item->video_info == NULL) { + } else { + v_dur = gitem->item->video_info->duration; } - snprintf(ret_str, GL_FILE_PATH_LEN_MAX, - "%02d:%02d:%02d", dur_hr, dur_min, dur_sec); - ret_str[strlen(ret_str)] = '\0'; - - return strdup(ret_str); + char *dur_str = _gl_get_duration_string(v_dur); + return dur_str; } return NULL; } -static Evas_Object * -_gl_list_content_get(void *data, Evas_Object * obj, const char *part) +static Evas_Object *__gl_list_get_content(void *data, Evas_Object *obj, const char *part) { GL_CHECK_NULL(obj); GL_CHECK_NULL(part); @@ -174,100 +134,191 @@ _gl_list_content_get(void *data, Evas_Object * obj, const char *part) GL_CHECK_NULL(gitem->item); GL_CHECK_NULL(gitem->ad); gl_appdata *ad = (gl_appdata *)gitem->ad; - Evas_Object *image = NULL; + bool is_expired_drm = false; - if (!strcmp(part, "elm.swallow.checkbox")) - { + if (!g_strcmp0(part, GL_VIDEO_PART_CHECKBOX)) { Evas_Object *ck = NULL; - - if (gl_get_view_mode(ad) == GL_VIEW_VIDEOLIST_EDIT) - { - ck = elm_check_add(obj); - GL_CHECK_NULL(ck); - elm_object_style_set(ck, GL_CHECKBOX_STYLE_DEFAULT); - 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", - _gl_list_item_check_changed, data); - evas_object_show(ck); - } - + ck = _gl_video_show_part_checkbox(obj, gitem->checked, + __gl_list_item_check_changed, + data); + gitem->check_obj = ck; return ck; - } - else if (!strcmp(part, "elm.icon")) - { - Evas *evas = evas_object_evas_get(obj); - GL_CHECK_NULL(evas); - image = evas_object_image_add(evas); - GL_CHECK_NULL(image); - evas_object_image_load_size_set(image, - GL_VIDEO_ICON_WIDTH, GL_VIDEO_ICON_HEIGHT); - evas_object_image_fill_set(image, 0, 0, - GL_VIDEO_ICON_WIDTH, GL_VIDEO_ICON_HEIGHT); + } else if (!g_strcmp0(part, GL_VIDEO_PART_ICON)) { + /* Is it DRM file? Has a valid RO? */ char *path = NULL; - path = _gl_get_thumb(ad, gitem->item->file_url, - &gitem->item->thumb_url); - if (path) { - evas_object_image_file_set(image, path, NULL); - free(path); - path = NULL; + if(gl_drm_is_drm_file(gitem->item->file_url) && + gl_drm_check_valid_ro(gitem->item->file_url, gl_drm_get_permtype(gitem->item->type)) == false) { + path = GL_DEFAULT_THUMB_ICON; + is_expired_drm = true; } else { - evas_object_image_file_set(image, gitem->item->thumb_url, - NULL); + path = _GETICON(gitem->item->thumb_url); } - return image; - } - else if (!strcmp(part, "elm.bookmarkicon")) // add bookmark icon - { - if (gitem->item->type == MINFO_ITEM_VIDEO) - { - int bk_len = 0; - if (gitem->item->meta_info == NULL || - gitem->item->meta_info->video_info == NULL) - { - bk_len = 0; - } - else - { - bk_len = g_list_length(gitem->item->meta_info->video_info->bookmarks); - } - gl_dbg("%s is video, containing %d bookmark(s)", gitem->item->file_url, bk_len); - if (bk_len) - { - Evas_Object *icon = elm_icon_add(obj); - GL_CHECK_NULL(icon); - elm_icon_file_set(icon, GL_LIST_BOOKMARK, NULL); - evas_object_show(icon); - return icon; - } - return NULL; + Evas_Object *bg = NULL; + bg = _gl_video_show_part_icon(obj, path, 0, GL_VIDEO_ICON_WIDTH, + GL_VIDEO_ICON_HEIGHT); + return bg; + } else if (!g_strcmp0(part, GL_VIDEO_PART_PLAY)) { + Evas_Object *icon = NULL; + icon = _gl_video_show_part_play(obj); + return icon; + } else if (!g_strcmp0(part, GL_VIDEO_PART_BOOKMARK)) { + Evas_Object *icon = NULL; + int bk_len = 0; + if (gitem->item->video_info) + bk_len = gitem->item->video_info->bookmarks; + + gl_dbg("%s has %d bookmark(s)", gitem->item->file_url, bk_len); + if (bk_len) { + icon = _gl_video_show_part_bookmark(obj); } - else - { - return NULL; + return icon; + } else if (!g_strcmp0(part, GL_VIDEO_PART_PBAR)) { + return _gl_video_show_pbar(obj, gitem); + } else if (!g_strcmp0(part, GL_VIDEO_PART_SLIDE1)) { + Evas_Object *share_btn = NULL; + share_btn = _gl_but_create_but(obj, GL_BUT_SHARE, + GL_BUTTON_STYLE_SWEEP); + GL_CHECK_NULL(share_btn); + evas_object_smart_callback_add(share_btn, "clicked", + __gl_list_share_cb, data); + + if (ad->listinfo.sweep_file_path) { + free(ad->listinfo.sweep_file_path); + ad->listinfo.sweep_file_path = NULL; } - } else if (!g_strcmp0(part, "elm.progressbar.icon")) { - return __gl_list_show_pbar(obj, gitem); + /* Save sweep item */ + if (gitem->item->file_url) + ad->listinfo.sweep_file_path = strdup(gitem->item->file_url); + ad->listinfo.share_btn = share_btn; + return share_btn; + } else if (!g_strcmp0(part, GL_VIDEO_PART_SLIDE3)) { + Evas_Object *del_btn = NULL; + del_btn = _gl_but_create_but(obj, GL_BUT_DEL, + GL_BUTTON_STYLE_SWEEP_DELETE); + GL_CHECK_NULL(del_btn); + evas_object_smart_callback_add(del_btn, "clicked", + __gl_list_del_cb, data); + ad->listinfo.del_btn = del_btn; + return del_btn; } return NULL; } -static void -_gl_list_del(void *data, Evas_Object * obj) +static void __gl_list_del(void *data, Evas_Object *obj) { gl_dbg(""); } -static void -_gl_list_genlist_sel(void *data, Evas_Object * obj, void *event_info) +static void __gl_list_genlist_sel(void *data, Evas_Object * obj, void *event_info) { gl_dbg(""); } +static void __gl_list_flick_left_cb(void *data, Evas_Object *obj, void *event_info) +{ + elm_object_scroll_freeze_push(obj); +} + +static void __gl_list_flick_right_cb(void *data, Evas_Object *obj, void *event_info) +{ + elm_object_scroll_freeze_push(obj); +} + +static void __gl_list_flick_stop_cb(void *data, Evas_Object *obj, void *event_info) +{ + elm_object_scroll_freeze_pop(obj); +} + +static void __gl_list_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; + /* Disable sweep if in wrong view mode */ + if (gl_get_view_mode(ad) != GL_VIEW_VIDEOLIST) { + gl_dbgE("Wrong view mode!"); + return; + } + /* Finish other swept item */ + Elm_Object_Item *it = NULL; + it = (Elm_Object_Item *)elm_genlist_decorated_item_get(obj); + if (it) { + 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_list_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; + /* Disable sweep if in wrong view mode */ + if (gl_get_view_mode(ad) != GL_VIEW_VIDEOLIST) { + gl_dbgE("Wrong view mode!"); + return; + } + if (ad->listinfo.sweep_file_path) { + free(ad->listinfo.sweep_file_path); + ad->listinfo.sweep_file_path = NULL; + } + /* 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_list_cancel_sweep(void *data, Evas_Object *obj, void *event_info) +{ + gl_dbg(""); + GL_CHECK(obj); + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + if (ad->listinfo.sweep_file_path) { + free(ad->listinfo.sweep_file_path); + ad->listinfo.sweep_file_path = NULL; + } + /* 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 int __gl_list_add_sweep_cbs(void *data, Evas_Object *obj) +{ + GL_CHECK_VAL(obj, -1); + /* Stop flicking(up/down direction) when sweep list item*/ + evas_object_smart_callback_add(obj, "drag,start,left", + __gl_list_flick_left_cb, data); + evas_object_smart_callback_add(obj, "drag,start,right", + __gl_list_flick_right_cb, data); + evas_object_smart_callback_add(obj, "drag,stop", + __gl_list_flick_stop_cb, data); + /* Add callback for sweeping */ + evas_object_smart_callback_add(obj, "drag,start,right", + __gl_list_set_sweep, data); + evas_object_smart_callback_add(obj, "drag,start,left", + __gl_list_unset_sweep, data); + evas_object_smart_callback_add(obj, "drag,start,up", + __gl_list_cancel_sweep, data); + evas_object_smart_callback_add(obj, "drag,start,down", + __gl_list_cancel_sweep, data); + return 0; +} + static void _gl_list_sel(void *data, Evas_Object * obj, void *event_info) { @@ -286,14 +337,6 @@ _gl_list_sel(void *data, Evas_Object * obj, void *event_info) elm_genlist_item_selected_set(gen_item, EINA_FALSE); } - if (data == NULL) - { - gl_dbgE("Callabck data is NULL!"); - return; - } - - int cnt = 0; - if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { if (gitem->check_obj == NULL) @@ -308,22 +351,31 @@ _gl_list_sel(void *data, Evas_Object * obj, void *event_info) if (gitem->checked) { gl_dbg("Append:%s", gitem->item->file_url); - gl_db_selected_list_append(ad, gitem); + _gl_data_selected_list_append(ad, gitem); } else { gl_dbg("Remove:%s", gitem->item->file_url); - gl_db_selected_list_remove(ad, gitem); + _gl_data_selected_list_remove(ad, gitem); } - cnt = gl_db_selected_list_count(ad); + int cnt = _gl_data_selected_list_count(ad); /* Display selectioninfo */ - gl_ui_create_selinfo(ad, ad->gridinfo.edit_layout, - ad->gridinfo.nf_it_edit, - ad->listinfo.videos_cnt, cnt, false); + _gl_notify_create_selinfo(ad, ad->gridinfo.edit_layout, + ad->gridinfo.nf_it_edit, + ad->listinfo.videos_cnt, cnt, false); } else { + /* Finish other swept item */ + Elm_Object_Item *it = NULL; + it = (Elm_Object_Item *)elm_genlist_decorated_item_get(obj); + if (it) { + gl_dbg("Reset previous sweeped item first."); + elm_genlist_item_decorate_mode_set(it, "slide", EINA_FALSE); + elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DEFAULT); + } + GL_CHECK(gitem->item->uuid); if (ad->listinfo.played_uuid) { free(ad->listinfo.played_uuid); @@ -354,27 +406,32 @@ _gl_list_update_view(void *data, Evas_Object * obj, void *event_info) int i = 0; gl_item *gitem = NULL; bool it_showed = false; + Elm_Genlist_Item_Class *plic = NULL; + if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { + plic = &(ad->listinfo.videolic); + ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO_EDIT; + } else { + ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO; + plic = &(ad->listinfo.sweeplic); + } - for (i = 1; i <= cnt; i++) - { - gl_db_get_item_by_index(ad, i, false, &gitem); - if (gitem == NULL || gitem->item == NULL) - { - gl_dbg("gitem == NULL || gitem->item == NULL"); + 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 (gitem->item->type == MINFO_ITEM_VIDEO) - { + if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) { gl_dbg("%s inserted", gitem->item->file_url); - gitem->elm_item = elm_genlist_item_append(genlist, - &(ad->listinfo.videolic), - (void *)gitem, - NULL, - ELM_GENLIST_ITEM_NONE, - _gl_list_sel, - gitem); + gitem->elm_item = elm_genlist_item_append(genlist, plic, + (void *)gitem, + NULL, + ELM_GENLIST_ITEM_NONE, + _gl_list_sel, + gitem); item_cnt++; - if (!it_showed && ad->listinfo.played_uuid && + gitem->sequence = item_cnt; + if (ad->listinfo.played_uuid && !it_showed && !g_strcmp0(ad->listinfo.played_uuid, gitem->item->uuid)) { it_showed = true; /*Move played item to middle position of view */ @@ -389,60 +446,65 @@ _gl_list_update_view(void *data, Evas_Object * obj, void *event_info) ad->listinfo.played_uuid = NULL; } + if (ad->listinfo.sweep_file_path) { + if (ecore_file_exists(ad->listinfo.sweep_file_path) && + (ecore_file_size(ad->listinfo.sweep_file_path) > 0)) { + if (ad->popupinfo.popup) { + /* Remove popup */ + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + } + } + free(ad->listinfo.sweep_file_path); + ad->listinfo.sweep_file_path = NULL; + } + ad->listinfo.videos_cnt = item_cnt; - if (item_cnt > 0) - { - evas_object_smart_callback_add(genlist, - "selected", _gl_list_genlist_sel, NULL); + if (item_cnt > 0) { + evas_object_smart_callback_add(genlist, "selected", + __gl_list_genlist_sel, NULL); - if (view_mode != GL_VIEW_VIDEOLIST_EDIT) - { - if (ad->listinfo.video_nocontents) + if (view_mode != GL_VIEW_VIDEOLIST_EDIT) { + if (ad->listinfo.videos_nocontents) { - evas_object_hide(ad->listinfo.video_nocontents); + evas_object_hide(ad->listinfo.videos_nocontents); gl_list_clear_view(ad); } - ad->listinfo.video_view = genlist; - } - else - { + ad->listinfo.videos_view = genlist; + } else { ad->gridinfo.edit_view = genlist; } - } - else - { + } else { evas_object_del(genlist); - if (view_mode == GL_VIEW_VIDEOLIST_EDIT) - { + if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { ad->gridinfo.edit_view = NULL; ad->gridinfo.edit_layout = NULL; - elm_naviframe_item_pop(ad->maininfo.navi_bar); + elm_naviframe_item_pop(ad->maininfo.naviframe); } - if (ad->listinfo.video_nocontents) - { + if (ad->listinfo.videos_nocontents) { gl_dbg("Nocontents view already created..."); return; } - else - { - if (ad->listinfo.video_view) - { - evas_object_hide(ad->listinfo.video_view); - gl_list_clear_view(ad); - } - - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_THUMBS, false); - Evas_Object *noc = gl_ui_create_nocontents_full(ad); - evas_object_show(noc); - ad->listinfo.video_view = noc; - ad->listinfo.video_nocontents = noc; - elm_object_part_content_unset(ad->gridinfo.layout, "elm.swallow.view"); - elm_object_part_content_set(ad->gridinfo.layout, "elm.swallow.view", - ad->listinfo.video_view); + if (ad->listinfo.videos_view) { + evas_object_hide(ad->listinfo.videos_view); + gl_list_clear_view(ad); } + + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_THUMBS, + false); + Evas_Object *noc = _gl_nocontents_create(ad); + evas_object_show(noc); + ad->listinfo.videos_view = noc; + ad->listinfo.videos_nocontents = noc; + + elm_object_part_content_unset(ad->gridinfo.layout, + "elm.swallow.view"); + elm_object_part_content_set(ad->gridinfo.layout, + "elm.swallow.view", + ad->listinfo.videos_view); } } @@ -450,10 +512,16 @@ int _gl_list_clear_data(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; + if (ad->listinfo.played_uuid) { free(ad->listinfo.played_uuid); ad->listinfo.played_uuid = NULL; } + + if (ad->listinfo.sweep_file_path) { + free(ad->listinfo.sweep_file_path); + ad->listinfo.sweep_file_path = NULL; + } return 0; } @@ -469,89 +537,91 @@ gl_list_create_view(void *data, Evas_Object * parent) int cnt = ad->maininfo.medias_cnt; int view_mode = gl_get_view_mode(ad); int i = 0; + Elm_Genlist_Item_Class *plic = NULL; gl_dbg("view mode=%d", view_mode); - if (view_mode == GL_VIEW_VIDEOLIST_EDIT) - { + if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO_EDIT; - } - else - { + plic = &(ad->listinfo.videolic); + } else { ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO; + /* Sweep class */ + ad->listinfo.sweeplic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO; + ad->listinfo.sweeplic.decorate_item_style = GL_GENLIST_ITEM_STYLE_SWEEP3; + ad->listinfo.sweeplic.func.text_get = __gl_list_get_text; + ad->listinfo.sweeplic.func.content_get = __gl_list_get_content; + plic = &(ad->listinfo.sweeplic); } - ad->listinfo.videolic.func.text_get = _gl_list_text_get; - ad->listinfo.videolic.func.content_get = _gl_list_content_get; - ad->listinfo.videolic.func.del = _gl_list_del; - genlist = elm_genlist_add(parent); - if (view_mode == GL_VIEW_VIDEOLIST) - { - elm_genlist_homogeneous_set(genlist, EINA_TRUE); - } + ad->listinfo.videolic.func.text_get = __gl_list_get_text; + ad->listinfo.videolic.func.content_get = __gl_list_get_content; + ad->listinfo.videolic.func.del = __gl_list_del; - 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); - for (i = 1; i <= cnt; i++) - { - gl_db_get_item_by_index(ad, i, false, &gitem); + genlist = _gl_video_add_genlist(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; } - if (gitem->item->type == MINFO_ITEM_VIDEO) - { + + if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) { gl_dbg("%s inserted", gitem->item->file_url); - gitem->elm_item = elm_genlist_item_append(genlist, - &(ad->listinfo.videolic), - (void *)gitem, - NULL, - ELM_GENLIST_ITEM_NONE, - _gl_list_sel, - gitem); + gitem->elm_item = elm_genlist_item_append(genlist, plic, + (void *)gitem, + NULL, + ELM_GENLIST_ITEM_NONE, + _gl_list_sel, + gitem); item_cnt++; + gitem->sequence = item_cnt; } } ad->listinfo.videos_cnt = item_cnt; + if (item_cnt > 0) { + if (view_mode == GL_VIEW_VIDEOLIST) + __gl_list_add_sweep_cbs(ad, genlist); - evas_object_smart_callback_add(genlist, - "update,viedolist", _gl_list_update_view, ad); - - if (item_cnt > 0) - { - evas_object_smart_callback_add(genlist, - "selected", _gl_list_genlist_sel, ad); - ad->listinfo.video_nocontents = NULL; + evas_object_smart_callback_add(genlist, "selected", + __gl_list_genlist_sel, ad); + ad->listinfo.videos_nocontents = NULL; return genlist; } - else - { - evas_object_del(genlist); - genlist = NULL; - Evas_Object *noc = gl_ui_create_nocontents_full(ad); - evas_object_show(noc); - ad->listinfo.video_nocontents = noc; - return noc; - } + /* There are none video files, show nocontents */ + evas_object_del(genlist); + genlist = NULL; + + Evas_Object *noc = _gl_nocontents_create(ad); + evas_object_show(noc); + ad->listinfo.videos_nocontents = noc; + return noc; } int gl_list_clear_view(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; + ad->listinfo.share_btn = NULL; + ad->listinfo.del_btn = NULL; if (ad->listinfo.played_uuid) { free(ad->listinfo.played_uuid); ad->listinfo.played_uuid = NULL; } - if (ad->listinfo.video_view) { - evas_object_del(ad->listinfo.video_view); - ad->listinfo.video_view = NULL; - ad->listinfo.video_nocontents = NULL; + if (ad->listinfo.sweep_file_path) { + free(ad->listinfo.sweep_file_path); + ad->listinfo.sweep_file_path = NULL; + } + + if (ad->listinfo.videos_view) { + evas_object_del(ad->listinfo.videos_view); + ad->listinfo.videos_view = NULL; + ad->listinfo.videos_nocontents = NULL; } return 0; @@ -563,31 +633,31 @@ int gl_list_update_view(void *data) GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - if (ad->listinfo.video_view == NULL || - ad->listinfo.video_nocontents) { + if (ad->listinfo.videos_view == NULL || + ad->listinfo.videos_nocontents) { gl_dbgW("Remove list nocontents view!"); - if (ad->listinfo.video_nocontents) { - evas_object_hide(ad->listinfo.video_nocontents); + if (ad->listinfo.videos_nocontents) { + evas_object_hide(ad->listinfo.videos_nocontents); gl_list_clear_view(ad); } Evas_Object *list_view = NULL; - list_view = gl_list_create_view(ad, ad->maininfo.navi_bar); - ad->listinfo.video_view = list_view; + list_view = gl_list_create_view(ad, ad->maininfo.naviframe); + ad->listinfo.videos_view = list_view; /* Enable edit button if it's not nocontents view */ - if (ad->listinfo.video_nocontents == NULL) - gl_ui_disable_toolbar_item(ad, false, GL_NAVI_THUMBS, - false); + if (ad->listinfo.videos_nocontents == NULL) + _gl_ctrl_disable_toolbar_item(ad, false, GL_NAVI_THUMBS, + false); elm_object_part_content_unset(ad->gridinfo.layout, - "elm.swallow.view"); - evas_object_show(ad->listinfo.video_view); + "elm.swallow.view"); + evas_object_show(ad->listinfo.videos_view); elm_object_part_content_set(ad->gridinfo.layout, - "elm.swallow.view", - ad->listinfo.video_view); + "elm.swallow.view", + ad->listinfo.videos_view); } else { - _gl_list_update_view(ad, ad->listinfo.video_view, NULL); + _gl_list_update_view(ad, ad->listinfo.videos_view, NULL); } return 0; @@ -598,38 +668,32 @@ int gl_list_change_to_edit(void *data) GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; gl_dbg(""); - gl_set_view_mode(ad, GL_VIEW_VIDEOLIST_EDIT); - ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO_EDIT; - _gl_list_update_view(ad, ad->gridinfo.edit_view, NULL); - return 0; } -int -gl_list_change_to_view(void *data) +int gl_list_change_to_view(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; gl_dbg(""); - if (ad->uginfo.ug_called_by_me == NULL && ad->listinfo.video_view == NULL) + if (ad->uginfo.ug_called_by_me == NULL && ad->listinfo.videos_view == NULL) { //special process when cancel edit after hide effect in _gl_ext_destroy_ug() - ad->listinfo.video_view = gl_list_create_view(ad, ad->maininfo.navi_bar); - evas_object_show(ad->listinfo.video_view); + ad->listinfo.videos_view = gl_list_create_view(ad, ad->maininfo.naviframe); + evas_object_show(ad->listinfo.videos_view); elm_object_part_content_set(ad->gridinfo.layout, - "elm.swallow.view", - ad->listinfo.video_view); + "elm.swallow.view", + ad->listinfo.videos_view); } else { gl_set_view_mode(ad, GL_VIEW_VIDEOLIST); - ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO; - - _gl_list_update_view(ad, ad->listinfo.video_view, NULL); + _gl_list_update_view(ad, ad->listinfo.videos_view, NULL); } return 0; } + diff --git a/src/gallery.c b/src/gallery.c index 085c90f..103b8c8 100755 --- a/src/gallery.c +++ b/src/gallery.c @@ -14,12 +14,7 @@ * limitations under the License. */ -#include #include -#include -#include -#include -#include #include "gallery.h" #include "gl-debug.h" #include "gl-albums.h" @@ -27,27 +22,23 @@ #include "gl-listview.h" #include "gl-controlbar.h" #include "gl-ui-util.h" +#include "gl-lang.h" #include "gl-util.h" -#include "gl-db-handler.h" +#include "gl-data.h" #include "gl-ext-ug-load.h" #include "gl-ext-exec.h" #include "gl-popup.h" #include "gl-progressbar.h" +#include "gl-notify.h" #include "gl-thread-util.h" #include "gl-strings.h" -#define GL_BG_COLOR_DEFAULT 45 -#define GL_BG_ALPHA_DEFAULT 255 -#define GL_WIN_ROTATE_DEG_0 0 -#define GL_WIN_ROTATE_DEG_90 90 -#define GL_WIN_ROTATE_DEG_180 180 -#define GL_WIN_ROTATE_DEG_270 270 +#define GL_BG_COLOR_DEFAULT 255 #define GL_BD_LAUNCH_TYPE "launch-type" #define GL_BD_ALBUM_ID "album-id" #define GL_BD_FILE_TYPE "file-type" -#define GL_BD_CONTACT_ID "contact" #define GL_BD_SETAS_TYPE "setas-type" #define GL_BD_CALLERID_SIZE "callerid-size" #define GL_BD_CALLERID_PATH "callerid-path" @@ -57,7 +48,6 @@ #define GL_BD_SELECT_ONE "select-one" #define GL_BD_SELECT_MULTIPLE "select-multiple" #define GL_BD_SELECT_SETAS "select-setas" -#define GL_BD_SELECT_IMFT "select-imft" #define GL_BD_FILE_TYPE_IMAGE "image" #define GL_BD_FILE_TYPE_VIDEO "video" #define GL_BD_FILE_TYPE_ALL "all" @@ -66,6 +56,7 @@ #define GL_MIME_SEP ":" #define GL_MIME_TYPE_GALLERY "gallery.uri" +#define GL_SERVICE_OPERATION_WALLPAPER "http://tizen.org/appsvc/operation/wallpaper" struct text_part { char *part; @@ -73,8 +64,8 @@ struct text_part { }; static struct text_part main_txt[] = { - {N_("txt_title"), N_("Application template"),}, - {N_("txt_mesg"), N_("Click to exit"),}, + {"txt_title", "Application template",}, + {"txt_mesg", "Click to exit",}, }; /* User-defined function */ @@ -98,116 +89,168 @@ static int _gallery_update_ts(Evas_Object *eo, struct text_part *tp, int size) 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)); + tp[i].msgid); } } return 0; } -static int _gallery_lang_changed_cb(void *data) +static void _gallery_lang_changed_cb(void *data) { - GL_CHECK_VAL(data, -1); + GL_CHECK(data); gl_appdata *ad = (gl_appdata *)data; - GL_CHECK_VAL(ad->maininfo.ly_main, -1); + GL_CHECK(ad->maininfo.main_layout); - _gallery_update_ts(elm_layout_edje_get(ad->maininfo.ly_main), + _gallery_update_ts(elm_layout_edje_get(ad->maininfo.main_layout), main_txt, sizeof(main_txt) / sizeof(main_txt[0])); - - return 0; + _gl_lang_update(data); } -static int _gallery_low_battery_cb(void *data) +static void _gallery_low_battery_cb(void *data) { gl_dbg(""); - return 1; + + /* ug_send_event(UG_EVENT_LOW_BATTERY); */ + /* 0 : default handler, 1:user handler */ +} + +void _gallery_rotation_cb(app_device_orientation_e m, void *data) +{ + GL_CHECK(data); + gl_dbg("Appcore Rotation mode: %d", m); + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK(ad->maininfo.win); + enum ug_event evt = UG_EVENT_NONE; + + ad->maininfo.rotate_mode = m; + + ug_send_event(evt); + + elm_win_rotation_with_resize_set(ad->maininfo.win, m); + + int view_mode = gl_get_view_mode(ad); + if (ad->uginfo.ug_called_by_me) { + /* when ug invoked, just return. */ + if (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_VIDEOLIST_EDIT) { + _gl_notify_rotate_selinfo(ad); + } else if (view_mode == GL_VIEW_ALBUMS) { + _gl_notify_rotate_selinfo(ad); + } + return; + } + + _gl_notify_rotate_selinfo(ad); } 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; - int w = 0; - int h = 0;; + 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) { + elm_win_autodel_set(eo, EINA_TRUE); elm_win_title_set(eo, name); - elm_win_borderless_set(eo, EINA_TRUE); evas_object_smart_callback_add(eo, "delete,request", _gallery_win_del_cb, ad); - ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, - &h); - double wscale = (double)(((double)w) / ((double)GL_WIN_WIDTH)); - ad->maininfo.win_scale = wscale; - gl_dbg("main window size: (%d, %d), scale: %f", w, h, - ad->maininfo.win_scale); - evas_object_resize(eo, w, h); + ad->maininfo.win_scale = elm_scale_get(); + gl_dbg("main window scale: %f", ad->maininfo.win_scale); } gl_dbg("_gallery_create_win:done"); + gl_dbg_launch(" _gallery_create_win:end"); return eo; } 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"); elm_bg_color_set(bg, GL_BG_COLOR_DEFAULT, GL_BG_COLOR_DEFAULT, GL_BG_COLOR_DEFAULT); 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; } 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.navi_bar, -1); - /* Create albums view layout */ - Evas_Object *layout = gl_ui_create_view_ly(ad->maininfo.navi_bar); - GL_CHECK_VAL(layout, -1); + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + + Evas_Object *layout = _gl_ui_create_view_ly(ad->maininfo.naviframe); ad->albuminfo.layout = layout; + edje_object_signal_emit(_EDJ(layout), "elm,swallow_view,state,default", "elm"); - /* Check mass storage mode */ - gl_get_mass_storage_state(ad); - /* Push albums view to stack */ - gl_ui_create_title_and_push(ad, ad->maininfo.navi_bar, + + gl_ui_create_title_and_push(ad, ad->maininfo.naviframe, ad->albuminfo.layout, GL_NAVI_ALBUMS, - GL_STR_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_CHECK_FALSE(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"); if (ad->albuminfo.aul_launch_by_mime || ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { - gl_dbgW("\tIdler: From livepanel, gallery is launched!"); + gl_dbgW("\tIdler: From livebox, gallery is launched!"); } else { - gl_dbgW("\tIdler: Gallery is launched!"); + gl_dbgW("\tIdler: gallery is launched!"); /* Initialize libmedia-info */ - gl_db_init(ad); - gl_dbg("minfo_init:done"); - + _gl_data_init(); + gl_dbg("DB initialization:done"); /* Get cluster list from libmedia-info */ - gl_db_get_cluster_list(ad); + 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_db_get_cluster_list:done"); + gl_dbg("_gl_data_get_cluster_list:done"); /* Set view mode */ gl_set_view_mode(ad, GL_VIEW_ALBUMS); /** @@ -216,106 +259,108 @@ static Eina_Bool _gallery_create_albums_idler_cb(void *data) */ if (gl_check_gallery_empty(ad) || ad->albuminfo.cluster_list->edit_cnt == 0) - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - false); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + false); + /* Update albums view, append items */ + gl_albums_update_items(ad); } - GL_CHECK_FALSE(ad->albuminfo.layout); - Evas_Object *layout_inner = NULL; - /* Create albums view */ - layout_inner = gl_albums_create_view(ad, ad->albuminfo.layout); - GL_CHECK_FALSE(layout_inner); - elm_object_part_content_set(ad->albuminfo.layout, "elm.swallow.view", - layout_inner); - ad->albuminfo.view = layout_inner; - - ad->albuminfo.gallery_launched = true; gl_dbg("_gallery_create_albums_idler_cb:done"); - ad->albuminfo.create_albums_idler = NULL; + 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; } static int _gallery_init_view(gl_appdata *ad) { + gl_dbg_launch(" _gallery_init_view:start"); gl_dbg(""); GL_CHECK_VAL(ad, -1); /* Base Layout */ - ad->maininfo.ly_main = gl_ui_create_main_ly(ad->maininfo.win); - GL_CHECK_VAL(ad->maininfo.ly_main, -1); - gl_dbg("gl_ui_create_main_ly: done"); + ad->maininfo.main_layout = gl_ui_create_main_ly(ad->maininfo.win); + GL_CHECK_VAL(ad->maininfo.main_layout, -1); /* Background. */ - ad->maininfo.bg = _gallery_create_bg(ad->maininfo.ly_main); + ad->maininfo.bg = _gallery_create_bg(ad->maininfo.main_layout); GL_CHECK_VAL(ad->maininfo.bg, -1); /* Pack bg to swallow */ - elm_object_part_content_set(ad->maininfo.ly_main, "elm.swallow.bg", - ad->maininfo.bg); - + elm_object_part_content_set(ad->maininfo.main_layout, "elm.swallow.bg", + ad->maininfo.bg); /* Indicator */ elm_win_indicator_mode_set(ad->maininfo.win, ELM_WIN_INDICATOR_SHOW); + gl_dbg("gl_ui_create_main_ly: done"); /* Navigation Bar */ - ad->maininfo.navi_bar = gl_ui_create_naviframe(ad->maininfo.ly_main); - GL_CHECK_VAL(ad->maininfo.navi_bar, -1); - gl_dbg("gl_ui_create_naviframe: done"); + ad->maininfo.naviframe = gl_ui_create_navi_ly(ad->maininfo.main_layout); + GL_CHECK_VAL(ad->maininfo.naviframe, -1); - elm_object_part_content_set(ad->maininfo.ly_main, "elm.swallow.content", - ad->maininfo.navi_bar); + elm_object_part_content_set(ad->maininfo.main_layout, "elm.swallow.content", + ad->maininfo.naviframe); - /* Navigation Bar Item with a List */ + if (gl_is_rotation_locked()) { + gl_dbg("Rotation is in locked state!"); + } else { + int mode = APP_DEVICE_ORIENTATION_0; + mode = app_get_device_orientation(); + ad->maininfo.rotate_mode = mode; + } + + /* Albums view layout */ _gallery_create_view_ly(ad); + /* Add albums view and append nothing */ + Evas_Object *layout_inner = NULL; + layout_inner = _gl_albums_add_gengrid(ad, ad->albuminfo.layout); + GL_CHECK_FALSE(layout_inner); + elm_object_part_content_set(ad->albuminfo.layout, "elm.swallow.view", + layout_inner); + ad->albuminfo.view = layout_inner; + ad->albuminfo.gallery_launched = true; + + gl_dbg_launch(" _gallery_init_view:end"); + return 0; } -static int _gallery_create(void *data) +static bool _gallery_create(void *data) { + gl_dbg_launch("create:start"); gl_dbgW("==Create=="); - GL_CHECK_VAL(data, -1); + GL_CHECK_FALSE(data); gl_appdata *ad = (gl_appdata *)data; ad->maininfo.reentrant = TRUE; Evas_Object *win = NULL; - int r = -1; elm_theme_extension_add(NULL, GL_EDJ_FILE); - /* Make custom theme for navibar and controlbar. */ - elm_theme_extension_add(NULL, GL_BLACK_THEME_EDJ_FILE); - - /* init internationalization */ - r = appcore_set_i18n(PACKAGE, LOCALEDIR); - if (r) { - gl_dbgE("appcore_set_i18n failed"); - return -1; - } - gl_dbg("appcore_set_i18n:done"); /* create window */ win = _gallery_create_win(ad, PACKAGE); - GL_CHECK_VAL(win, -1); + GL_CHECK_FALSE(win); ad->maininfo.win = win; /* initialize gallery view */ if (_gallery_init_view(ad) != 0) { gl_dbgE("_gallery_init_view failed"); - return -1; + return false; } + 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"); - - /* add system event callback */ - appcore_set_event_callback(APPCORE_EVENT_LANG_CHANGE, - _gallery_lang_changed_cb, ad); - appcore_set_event_callback(APPCORE_EVENT_LOW_BATTERY, - _gallery_low_battery_cb, NULL); - - /* Register callbacks of DB update and UMS */ + /* Register callbacks of DB update */ gl_dbg("system event cb:done"); + + gl_dbg_launch(" register callbacks:start"); gl_reg_db_update_noti(ad); - gl_reg_mass_storage_noti(ad); + gl_dbg_launch(" register callbacks:end"); if (ad->albuminfo.create_albums_idler == NULL) { /* Use idler to load albums view */ @@ -325,11 +370,9 @@ static int _gallery_create(void *data) gl_dbg("create_albums_idler added: 0x%x", ad->albuminfo.create_albums_idler); } - /* Launch Gallery at the first time */ - gl_dbg("Set view mode as GL_VIEW_ALBUMS"); - gl_set_view_mode(ad, GL_VIEW_ALBUMS); - return 0; + gl_dbg_launch("create:end"); + return true; } static int _gallery_close_app(void *data) @@ -337,16 +380,24 @@ static int _gallery_close_app(void *data) GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - /* Destroy timer for UMS update */ - if (ad->maininfo.ums_update_timer) { - ecore_timer_del(ad->maininfo.ums_update_timer); - ad->maininfo.ums_update_timer = NULL; + 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_grid_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); @@ -377,10 +428,8 @@ static int _gallery_close_app(void *data) /* Clear data in video list view */ _gl_list_clear_data(ad); /* delete notification. */ - gl_ui_destroy_notiinfo(ad); + _gl_notify_destroy_notiinfo(ad); - /* Mass storage callback unregister. */ - gl_dereg_mass_storage_noti(); /* DB update callback unregister. */ gl_dereg_db_update_noti(); @@ -391,26 +440,25 @@ static int _gallery_close_app(void *data) gl_albums_free_data(data); - /* disconnet with libmedia-info */ - gl_db_finalize(ad); + /* disconnect with db */ + _gl_data_finalize(ad); gl_dbgW("==Exit, bye~ =="); return 0; } -static int _gallery_terminate(void *data) +static void _gallery_terminate(void *data) { gl_dbgW("==Terminate=="); - GL_CHECK_VAL(data, -1); - - return _gallery_close_app(data); + GL_CHECK(data); + _gallery_close_app(data); } -static int _gallery_pause(void *data) +static void _gallery_pause(void *data) { gl_dbgW("==Pause=="); - GL_CHECK_VAL(data, -1); + GL_CHECK(data); gl_appdata *ad = (gl_appdata *)data; ad->maininfo.reentrant = TRUE; @@ -418,21 +466,48 @@ static int _gallery_pause(void *data) /* For select appsvc, destory ug when HOME key is pressed */ gl_ext_destroy_gallery_ug(ad); +} +/* auto rotate view after resume if disabling/re-enabling rotate device */ +static int __gallery_resume_update_rotation_mode(gl_appdata *ad) +{ + GL_CHECK_VAL(ad, -1); + int display_mode = -1; + int device_mode = APP_DEVICE_ORIENTATION_0; + + /** + * display_mode is view mode, e.x. view is portrait normal + * device_mode is target mode, e.x. device is portrait normal + */ + display_mode = elm_win_rotation_get(ad->maininfo.win); + device_mode = app_get_device_orientation(); + gl_dbg("display_mode is %d, device_mode is %d", display_mode, + device_mode); + + /** + * disable rotate when view isn't portrait normal, then after resume, + * rotate view to portrait + */ + if (gl_is_rotation_locked() && + (display_mode != APP_DEVICE_ORIENTATION_0)) + _gallery_rotation_cb(APP_DEVICE_ORIENTATION_0, (void*)ad); + /** + * re-enable rotate when device isn't in portrait normal + * and view is in portrait normal, then after resume, + * rotate view by device_mode + */ + else if (!gl_is_rotation_locked() && (device_mode != display_mode)) + _gallery_rotation_cb(device_mode, (void*)ad); return 0; } -static int _gallery_resume(void *data) +static void _gallery_resume(void *data) { + gl_dbg_launch("resume:start"); gl_dbgW("==Resume=="); - GL_CHECK_VAL(data, -1); + GL_CHECK(data); gl_appdata *ad = (gl_appdata *)data; - if (ad->maininfo.app_exit_mode) { - gl_dbgW("Mass storage mounted"); - return 0; - } - ug_resume(); /* Video palyer was close when pause Gallery */ ad->uginfo.app_called_by_me = false; @@ -440,7 +515,8 @@ static int _gallery_resume(void *data) /* Show cursor and IMF if not popup showed */ if (ad->entryinfo.editfield && ad->popupinfo.popup == NULL) { gl_dbg("Show Entry cursor and IMF."); - elm_object_focus_set(ad->entryinfo.imf_entry, TRUE); + evas_object_show(ad->entryinfo.imf_entry); + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_TRUE); Ecore_IMF_Context *imf = ad->entryinfo.imf_context; ecore_imf_context_input_panel_show(imf); } @@ -448,19 +524,24 @@ static int _gallery_resume(void *data) /* Update view */ gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); - return 0; + __gallery_resume_update_rotation_mode(ad); + + gl_dbg_launch("resume:done"); } -static int _gallery_reset_app(void *data, const char *cluster_id) +static int __gallery_reset_app(void *data, const char *cluster_id, + const char *aul_type) { - GL_CHECK_VAL(cluster_id, -1); 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(""); - /* Checkme: UMS update case: ad->maininfo.ums_update_timer */ + 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!"); @@ -469,69 +550,34 @@ static int _gallery_reset_app(void *data, const char *cluster_id) return -1; } - if (view_mode == GL_VIEW_ALBUMS_EDIT || - view_mode == GL_VIEW_ALBUMS_RENAME) { - gl_dbg("Edit albums view."); - gl_del_invalid_widgets(ad, GL_INVALID_NONE); - gl_ui_edit_cancel(ad); - } else if (view_mode == GL_VIEW_ALBUMS) { - gl_dbg("Albums view."); - } else if (view_mode != GL_VIEW_NONE) { - gl_cluster *album = NULL; - album = ad->albuminfo.current_album; - GL_CHECK_VAL(album, -1); - GL_CHECK_VAL(album->cluster, -1); - - bool b_cur_album_exists = false; - if (album->cluster->uuid && - !g_strcmp0(album->cluster->uuid, cluster_id)) { - int its_cnt = 0; - int ret = GL_DB_FAIL; - ret = gl_db_get_item_cnt(ad, cluster_id, &its_cnt); - if (ret != GL_DB_SUCCESS || 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 || - view_mode == GL_VIEW_VIDEOLIST_EDIT) { - gl_del_invalid_widgets(ad, GL_INVALID_NONE); - /* Set flag to update albums list */ - ad->albuminfo.update_albums_list = true; - gl_ui_edit_cancel(ad); - } else { - gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); - } - elm_win_activate(ad->maininfo.win); - return 0; - } else { - gl_dbg("Change to albums view."); - gl_destroy_thumbs_view(ad); - gl_refresh_albums_list(ad); - gl_albums_comeback_from_view(ad); - } - - gl_ui_destroy_notiinfo(ad); + if (view_mode == GL_VIEW_NONE) { + /* First launch gallery then show shortcut album*/ + _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); + } else { + gl_dbg("In Albums tab"); + if (_gl_albums_reset_view(ad, cluster_id, aul_type) < 0) + goto GALLERY_RESET_FAILED; } - else { - /* gallery is launched first time , doesn't resume. */ - /* init libmedia-info */ - gl_db_init(ad); - gl_dbg("minfo_init:done"); - gl_db_get_cluster_list(ad); - GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); - gl_dbg("gl_db_get_cluster_list:done"); + /* 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; } - gl_set_view_mode(ad, GL_VIEW_ALBUMS); elm_win_activate(ad->maininfo.win); - return 0; + + GALLERY_RESET_FAILED: + + elm_win_activate(ad->maininfo.win); + return -1; } /* init appsvc launch related global variables */ @@ -544,16 +590,20 @@ static int _gallery_init_app_svc(void *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; - if(ad->albuminfo.aul_album_id) { - free(ad->albuminfo.aul_album_id); - ad->albuminfo.aul_album_id = NULL; + if(ad->albuminfo.aul_id) { + free(ad->albuminfo.aul_id); + ad->albuminfo.aul_id = NULL; + } + if(ad->albuminfo.aul_type) { + free(ad->albuminfo.aul_type); + ad->albuminfo.aul_type = NULL; } - ad->albuminfo.aul_contact_id = -1; + ad->albuminfo.aul_launch_by_mime = false; - if(ad->albuminfo.recv_bundle) { - bundle_free(ad->albuminfo.recv_bundle); - ad->albuminfo.recv_bundle = NULL; + if(ad->albuminfo.recv_service) { + service_destroy(ad->albuminfo.recv_service); + ad->albuminfo.recv_service = NULL; } if(ad->albuminfo.aul_callid_size) { @@ -575,19 +625,19 @@ static int _gallery_init_app_svc(void *data) return 0; } -static int _gallery_parse_launch_type(bundle *b, void *data) +static int _gallery_parse_launch_type(service_h service, void *data) { - GL_CHECK_VAL(b, -1); + GL_CHECK_VAL(service, -1); GL_CHECK_VAL(data, -1); - gl_dbg(""); gl_appdata *ad = (gl_appdata *)data; gl_aul_launch_type launch_type = GL_AUL_T_NONE; - const char *launch_type_str = NULL; - const char *setas_type_str = NULL; + char *launch_type_str = NULL; + char *setas_type_str = NULL; + gl_dbg(""); /* get launch-type */ - launch_type_str = appsvc_get_data(b, GL_BD_LAUNCH_TYPE); + 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; @@ -599,114 +649,106 @@ static int _gallery_parse_launch_type(bundle *b, void *data) 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)) { + } 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)) { + } 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_IMFT)) { - - launch_type = GL_AUL_T_SELECT_IMFT; - - const char *contact_id_str = NULL; - /* get contact id */ - contact_id_str = appsvc_get_data(b, GL_BD_CONTACT_ID); - if (contact_id_str) - { - gl_dbg("contact: %s", contact_id_str); - ad->albuminfo.aul_contact_id = atoi(contact_id_str); - } - } - else if(!strcasecmp(launch_type_str, GL_BD_SELECT_SETAS)) { - + } else if(!strcasecmp(launch_type_str, GL_BD_SELECT_SETAS)) { launch_type = GL_AUL_T_SELECT_SETAS; /* get setas-type */ - setas_type_str = appsvc_get_data(b, GL_BD_SETAS_TYPE); - if(setas_type_str == NULL) + service_get_extra_data(service, GL_BD_SETAS_TYPE, &setas_type_str); + if(setas_type_str == NULL) { + GL_FREE_MEM(launch_type_str); return 0; + } gl_dbg("setas-type: %s", setas_type_str); gl_aul_setas_type setas_type = GL_AUL_SETAS_T_NONE; - const char *path = NULL; - const char *size = NULL; + 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 */ - path = appsvc_get_data(b, GL_BD_HOMESCREEN_PATH); + service_get_extra_data(service, GL_BD_HOMESCREEN_PATH, + &path); if (path) { gl_dbg("homescreen-path: %s", path); - ad->albuminfo.aul_homescreen_path = strdup(path); + ad->albuminfo.aul_homescreen_path = path; + path = NULL; } /* get lockscreen-path */ - path = appsvc_get_data(b, GL_BD_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 = strdup(path); + ad->albuminfo.aul_lockscreen_path = path; + path = NULL; } - } - else if (!strcasecmp(setas_type_str, GL_BD_SETAS_CALLERID)) { + } else if (!strcasecmp(setas_type_str, GL_BD_SETAS_CALLERID)) { setas_type = GL_AUL_SETAS_T_CALLER_ID; /* get callerid-size */ - size = appsvc_get_data(b, GL_BD_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 = strdup(size); + ad->albuminfo.aul_callid_size = size; } /* get callerid-path */ - path = appsvc_get_data(b, GL_BD_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 = strdup(path); + ad->albuminfo.aul_callid_path = path; } } ad->albuminfo.aul_setas_type = setas_type; + GL_FREE_MEM(setas_type_str); } ad->albuminfo.aul_launch_type = launch_type; + GL_FREE_MEM(launch_type_str); return 0; } /* analysis parameters */ -static int _gallery_parse_param(bundle *b, void *data) +static int _gallery_parse_param(service_h service, void *data) { - GL_CHECK_VAL(b, -1); + GL_CHECK_VAL(service, -1); GL_CHECK_VAL(data, -1); gl_dbg(""); gl_appdata *ad = (gl_appdata *)data; - const char *operation = NULL; - const char *uri = NULL; - const char *mime = NULL; + char *operation = NULL; + char *uri = NULL; + char *mime = NULL; /* init */ _gallery_init_app_svc(ad); - /* save current bundle */ - ad->albuminfo.recv_bundle = bundle_dup(b); + /* save current service handle */ + service_clone(&ad->albuminfo.recv_service, service); - operation = appsvc_get_operation(b); + service_get_operation(service, &operation); + gl_dbg("operation: %s", operation); - /* Just for backward compatibility - Need to migrate to appsvc */ - if(operation == NULL) { - /* get album-id when launched by shortcut */ - const char *mime_type_str = NULL; - mime_type_str = bundle_get_val(b, AUL_K_MIME_TYPE); - if(mime_type_str == NULL) + if(!strcasecmp(operation, SERVICE_OPERATION_DEFAULT)) { + char *mime_type_str = NULL; + service_get_mime(service, &mime_type_str); + if(mime_type_str == NULL) { + gl_dbg("mime_type NULL"); return -1; + } gl_dbg("mime_type: %s", mime_type_str); - if(!strcmp(mime_type_str, GL_MIME_TYPE_GALLERY)) { + if(!g_strcmp0(mime_type_str, GL_MIME_TYPE_GALLERY)) { char *content = NULL; - content = strdup(bundle_get_val(b, AUL_K_MIME_CONTENT)); GL_CHECK_VAL(content, -1); gl_dbg("content: %s", content); @@ -717,87 +759,111 @@ static int _gallery_parse_param(bundle *b, void *data) content = NULL; szID = strtok_r(NULL, GL_MIME_SEP, &str_buf); GL_CHECK_VAL(szID, -1); - ad->albuminfo.aul_album_id = strdup(szID); + ad->albuminfo.aul_id = strdup(szID); ad->albuminfo.aul_launch_by_mime = true; - gl_dbg("album_id: %s", ad->albuminfo.aul_album_id); + gl_dbg("album_id: %s", ad->albuminfo.aul_id); } return 0; } - gl_dbg("operation: %s", operation); - - uri = appsvc_get_uri(b); - if(uri) + 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_MIME_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_MIME_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; + } /* OPERATION_VIEW */ - if(!strcasecmp(operation, APPSVC_OPERATION_VIEW)) { + if(!strcasecmp(operation, SERVICE_OPERATION_VIEW)) { /* ug destroy */ gl_ext_destroy_gallery_ug(ad); ad->albuminfo.aul_launch_type = GL_AUL_T_VIEW_ALBUM; - /* get file-type from bundle */ - const char *file_type_str = NULL; + /* get file-type from service */ + char *file_type_str = NULL; ad->albuminfo.aul_file_type = GL_AUL_FILE_T_ALL; /* default */ - file_type_str = appsvc_get_data(b, GL_BD_FILE_TYPE); + 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 (!strcmp(file_type_str, GL_BD_FILE_TYPE_IMAGE)) { + if (!g_strcmp0(file_type_str, GL_BD_FILE_TYPE_IMAGE)) { ad->albuminfo.aul_file_type = GL_AUL_FILE_T_IMAGE; - } else if (!strcmp(file_type_str, GL_BD_FILE_TYPE_VIDEO)) { + } else if (!g_strcmp0(file_type_str, GL_BD_FILE_TYPE_VIDEO)) { ad->albuminfo.aul_file_type = GL_AUL_FILE_T_VIDEO; } + GL_FREE_MEM(file_type_str); } - - const char *album_id_str = NULL; /* get album-id */ - album_id_str = appsvc_get_data(b, GL_BD_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_album_id = strdup(album_id_str); + ad->albuminfo.aul_id = album_id_str; } else { gl_dbg("album-id is invalid, set to default (ALL)"); - ad->albuminfo.aul_album_id = strdup(GL_ALBUM_ALL_ID); + ad->albuminfo.aul_id = strdup(GL_ALBUM_ALL_ID); } - } - /* OPERATION_PICK */ - else if(!strcasecmp(operation, APPSVC_OPERATION_PICK)) { + } 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 */ - mime = appsvc_get_mime(b); + service_get_mime(service, &mime); if(mime) { gl_dbg("mime: %s", mime); - if (!strcmp(mime, GL_MIME_IMAGE_ALL)) { + if (!g_strcmp0(mime, GL_MIME_IMAGE_ALL)) { ad->albuminfo.aul_file_type = GL_AUL_FILE_T_IMAGE; - } else if (!strcmp(mime, GL_MIME_VIDEO_ALL)) { + } else if (!g_strcmp0(mime, GL_MIME_VIDEO_ALL)) { ad->albuminfo.aul_file_type = GL_AUL_FILE_T_VIDEO; } } - _gallery_parse_launch_type(b, ad); + _gallery_parse_launch_type(service, ad); + } else if (!strcasecmp(operation, GL_SERVICE_OPERATION_WALLPAPER)) { + ad->albuminfo.aul_file_type = GL_AUL_FILE_T_IMAGE; + ad->albuminfo.aul_launch_type = GL_AUL_T_SELECT_SETAS; + ad->albuminfo.aul_setas_type = GL_AUL_SETAS_T_CROP_WALLPAPER; + + 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 int _gallery_reset(bundle *b, void *data) +static void _gallery_reset(service_h service, void *data) { gl_dbgW("==Reset=="); - GL_CHECK_VAL(data, -1); + GL_CHECK(data); gl_appdata *ad = (gl_appdata *)data; - GL_CHECK_VAL(ad->maininfo.win, -1); - int ret = -1; + GL_CHECK(ad->maininfo.win); - if (ad->maininfo.reentrant) + if (ad->maininfo.reentrant) { ad->maininfo.reentrant = FALSE; - else { + } else { gl_dbgW("Gallery reentrant is not allowed, return!"); - return 0; + return; } /* Destroy gallery ug */ @@ -808,59 +874,94 @@ static int _gallery_reset(bundle *b, void *data) } /* Parse parameters */ - if(_gallery_parse_param(b, data) != 0) - { + if(_gallery_parse_param(service, data) != 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 @@*/ - gl_dbg(""); + 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_dbgE("Failed to parse parameters!"); } + /* Rotate window if it's not APP_DEVICE_ORIENTATION_0 mode */ + if (!gl_is_rotation_locked()) { + int mode = APP_DEVICE_ORIENTATION_0; + mode = app_get_device_orientation(); + if (mode != APP_DEVICE_ORIENTATION_0) { + gl_dbg("Rotation window!"); + _gallery_rotation_cb(mode, ad); + } + } elm_win_activate(ad->maininfo.win); - return -1; + return; } if (ad->albuminfo.aul_launch_by_mime || ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { /*@@ 2. Launch Gallery from shortcut @@*/ - ret = _gallery_reset_app(data, ad->albuminfo.aul_album_id); + __gallery_reset_app(data, ad->albuminfo.aul_id, + ad->albuminfo.aul_type); } else { /*@@ 3. Load Gallery UG @@*/ gl_dbg("Start loading Gallery UG"); - gl_ext_load_gallery_ug(ad); - - elm_win_activate(ad->maininfo.win); + 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; + } + } } - - return ret; } -int gallery_reset_app(void *data, const char *cluster_id) +int gallery_reset_app(void *data) { GL_CHECK_VAL(data, -1); - GL_CHECK_VAL(cluster_id, -1); - gl_dbg("Reset gallery, selected cluster ID: %s.", cluster_id); - return _gallery_reset_app(data, cluster_id); + 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; - struct appcore_ops ops = { - .create = _gallery_create, - .terminate = _gallery_terminate, - .pause = _gallery_pause, - .resume = _gallery_resume, - .reset = _gallery_reset, - }; + + 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 = _gallery_rotation_cb; + event_callback.language_changed = _gallery_lang_changed_cb; + event_callback.region_format_changed = NULL; memset(&gl_ad, 0x00, sizeof(gl_appdata)); - ops.data = &gl_ad; - ret = appcore_efl_main(PACKAGE, &argc, &argv, &ops); + ret = app_efl_main(&argc, &argv, &event_callback, &gl_ad); + gl_dbg_launch("main:done"); return ret; } + diff --git a/src/util/gl-db-handler.c b/src/util/gl-db-handler.c deleted file mode 100755 index 8d06884..0000000 --- a/src/util/gl-db-handler.c +++ /dev/null @@ -1,1727 +0,0 @@ -/* - * Copyright 2012 Samsung Electronics Co., Ltd - * - * Licensed under the Flora License, Version 1.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.tizenopensource.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT 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-db-handler.h" -#include "gl-controlbar.h" -#include "gallery.h" -#include "gl-debug.h" -#include "gl-util.h" -#include "gl-strings.h" - -static bool -_gl_db_get_file_dir_names(const char *file_path, - char *filename, char *dir_name, char *dir_path) -{ - gl_dbg(""); - 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); // , i +1 changed to , 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; -} - -static int _gl_db_elist_ite_fn(Mitem *item, void *user_data) -{ - Eina_List **list = (Eina_List **)user_data; - *list = eina_list_append(*list, item); - - return 0; -} - -static int _gl_db_cluster_elist_ite_fn(Mcluster *cluster, void *user_data) -{ - Eina_List **list = (Eina_List **)user_data; - *list = eina_list_append(*list, cluster); - - return 0; -} - -/* -* create a gl_item -*/ -static gl_item * -_gl_db_new_item(void) -{ - // new a gl_item - gl_item *gitem = (gl_item *) malloc(sizeof(gl_item)); - GL_CHECK_NULL(gitem); - memset(gitem, 0x00, sizeof(gl_item)); - - //initialize gitem - gitem->ad = NULL; - gitem->checked = false; - gitem->check_obj = NULL; - gitem->elm_item = NULL; - gitem->item = NULL; - gitem->_reserved = NULL; - - return gitem; -} - -/* -* destroy a gl_item -*/ -static int -_gl_db_destroy_item(gl_item * gitem) -{ - GL_CHECK_VAL(gitem, GL_DB_FAIL); - if (gitem->item) - { - minfo_destroy_mtype_item(gitem->item); - gitem->item = NULL; - } - - if (gitem->_reserved) - { - free(gitem->_reserved); - gitem->_reserved = NULL; - } - - gitem->checked = false; - gitem->check_obj = NULL; - gitem->elm_item = NULL; - - free(gitem); - gitem = NULL; - - return GL_DB_SUCCESS; -} - -/* Clear eina_list got from DB */ -static int _gl_db_clear_mtype_items_list(Eina_List **elist) -{ - void *current = NULL; - - if (elist && *elist) { - gl_dbg("Clear Mtype items list."); - EINA_LIST_FREE(*elist, current) { - if (current) { - minfo_destroy_mtype_item(current); - current = NULL; - } - } - - *elist = NULL; - } - - return GL_DB_SUCCESS; -} - -static int -_gl_db_clear_item_list(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - gl_item *current = NULL; - if (ad->maininfo.medias_elist) - { - Eina_List *item_list = ad->maininfo.medias_elist; - EINA_LIST_FREE(item_list, current) - { - _gl_db_destroy_item(current); - current = NULL; - } - ad->maininfo.medias_elist = NULL; - } - - return GL_DB_SUCCESS; -} - -int -_gl_db_free_cluster_all(gl_cluster* gcluster) -{ - GL_CHECK_VAL(gcluster, GL_DB_FAIL); - GL_CHECK_VAL(gcluster->cluster, GL_DB_FAIL); - - if(gcluster->cluster->display_name) - { - free(gcluster->cluster->display_name); - gcluster->cluster->display_name = NULL; - } - - if(gcluster->_reserved) - { - free(gcluster->_reserved); - gcluster->_reserved = NULL; - } - - free(gcluster->cluster); - gcluster->cluster = NULL; - free(gcluster); - return GL_DB_SUCCESS; -} - -int -_gl_db_free_cluster(gl_cluster * gcluster) -{ - GL_CHECK_VAL(gcluster, GL_DB_FAIL); - if (gcluster->cluster) - { - minfo_destroy_mtype_item(gcluster->cluster); - gcluster->cluster = NULL; - } - if (gcluster->_reserved) - { - free(gcluster->_reserved); - gcluster->_reserved = NULL; - } - free(gcluster); - return GL_DB_SUCCESS; -} - -static int -_gl_db_clear_cluster_list(void *data, bool b_force) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - gl_cluster *current = NULL; - Eina_List *tmp_list = NULL; - - // 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_db_free_cluster(current); - current = NULL; - } - } - ad->albuminfo.cluster_list->clist = NULL; - } - - if (b_force) { - free(ad->albuminfo.cluster_list); - ad->albuminfo.cluster_list = NULL; - } - } - - return GL_DB_SUCCESS; -} - -static gl_cluster *_gl_db_new_cluster_all(void *data, int all_item_cnt) -{ - gl_dbg(""); - GL_CHECK_NULL(data); - gl_cluster *gcluster = NULL; - Mcluster *mcluster = NULL; - - gcluster = gl_db_new_cluster(); - GL_CHECK_NULL(gcluster); - - mcluster = gl_db_new_mcluster(data, GL_NEW_RECORD_ID); - if (mcluster == NULL) { - free(gcluster); - gcluster = NULL; - return NULL; - } - mcluster->uuid = strdup(GL_ALBUM_ALL_ID); - mcluster->count = all_item_cnt; - mcluster->display_name = strdup(GL_ALBUM_ALL_NAME); - gcluster->ad = data; - gcluster->cluster = mcluster; - return gcluster; -} - - - -static gl_cluster_list * -_gl_db_new_cluster_list(void) -{ - gl_cluster_list *clus_list = (gl_cluster_list *) malloc(sizeof(gl_cluster_list)); - GL_CHECK_NULL(clus_list); - memset(clus_list, 0x00, sizeof(gl_cluster_list)); - clus_list->clist = NULL; - clus_list->cur_pos = 0; - - return clus_list; -} - -static int _gl_db_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_cluster *gcluster = NULL; - char *item_id = NULL; - - if (ad->albuminfo.selected_albums_elist == NULL) - return 0; - - /* 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); - } - } - gl_db_finalize_albums_selected_list(ad); - return 0; -} - -/** -* Some issue about using ecore_file_exists(gitem->item->file_url), -* if user rename file in Myfile, file_url changed. -*/ -static int _gl_db_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); - } - } - - gl_db_selected_list_finalize(ad); - return 0; -} - -/* Check ID is in the list or not */ -static bool _gl_db_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); - free(p_id); - p_id = NULL; - return true; - } - return false; -} - -/* Free list of selected IDs */ -static int __gl_db_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; - } - free(p_id); - p_id = NULL; - } - *sel_id_list = NULL; - return 0; -} - -static int _gl_db_get_cluster_list(void *data, bool b_update) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - int length = 0; - int local_item_cnt = 0; - Eina_List *item_list = NULL; - Mcluster *f_data = NULL; - gl_cluster *default_cluster = NULL; - int err = -1; - int edit_album_cnt = 0; - minfo_cluster_filter filter; - Mcluster *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, }; - - 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_db_get_selected_cluster_id_list(ad, &sel_id_list); - /* Clear cluster list */ - _gl_db_clear_cluster_list(ad, false); - } - - memset(&filter,0x00,sizeof(minfo_cluster_filter)); - //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 Mcluster from DB via folder full path(URL). - err = minfo_get_cluster(ad->maininfo.db_handle, - ad->albuminfo.dest_folder, NULL, &new_mc); - if (err < 0) - { - gl_dbgE("minfo_get_cluster fail: %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 Mcluster, url: %s.", ad->albuminfo.dest_folder); - g_strlcpy(new_mc_id, new_mc->uuid, - GL_MTYPE_ITEN_ID_LEN_MAX); - minfo_destroy_mtype_item(new_mc); - } - } - - //get real albums - filter.cluster_type = MINFO_CLUSTER_TYPE_ALL; - filter.sort_type = MINFO_CLUSTER_SORT_BY_NAME_ASC; - filter.start_pos = GL_GET_ALL_RECORDS; - filter.end_pos = GL_GET_ALL_RECORDS; - - err = minfo_get_cluster_list(ad->maininfo.db_handle, filter, - _gl_db_cluster_elist_ite_fn, &item_list); - if (err == MB_SVC_ERROR_DB_NO_RECORD) - { - gl_dbg("No record!"); - ad->albuminfo.cluster_list->clist = NULL; - if (item_list) - _gl_db_clear_mtype_items_list(&item_list); - /* Continue to add AllShare album */ - } - else if (err < 0) - { - gl_dbg("Failed to get cluster list!"); - if (item_list) - _gl_db_clear_mtype_items_list(&item_list); - /* Continue to add AllShare album */ - } - - gl_cluster *gcluster = NULL; - EINA_LIST_FREE(item_list, f_data) { - if (f_data == NULL || f_data->uuid == NULL) { - gl_dbgE("Invalid Mcluster!"); - continue; - } - gl_dbg("folder id: %s.", f_data->uuid); - - /** - * There are Phone and other filters in libmedia-info, - * but they are seperated, if we want to get phone - * only we can use is MINFO_CLUSTER_TYPE_ALL, - * and add condition checking to skip MMC albums. - * - * 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 == MINFO_MMC) { - gl_dbgW("MMC was unmounted, skip MMC album!"); - minfo_destroy_mtype_item(f_data); - continue; - } - - if (f_data->count == 0) { - /* append the newly created cluster to list */ - if (!g_strcmp0(f_data->uuid, new_mc_id)) { - gl_dbg("empty local album, but it's newly created..."); - } else { - gl_dbg("empty local album, skipping it..."); - minfo_destroy_mtype_item(f_data); - continue; - } - } - local_item_cnt += f_data->count; - - gcluster = NULL; - gcluster = gl_db_new_cluster(); - if (gcluster == NULL) { - gl_dbgE("gl_db_new_cluster failed!"); - minfo_destroy_mtype_item(f_data); - continue; - } - - gcluster->ad = ad; - gcluster->cluster = f_data; - length += f_data->count; - - if (gl_db_is_default_album(ad, 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_cluster = gcluster; - 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_db_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_db_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) - __gl_db_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 (local_item_cnt) { - /* Create "All albums" album if any local file exists */ - gcluster = _gl_db_new_cluster_all(ad, local_item_cnt); - if (gcluster == NULL) { - gl_dbgE("_gl_db_new_cluster_all failed!"); - _gl_db_clear_cluster_list(ad, false); - return -1; - } - - if (default_cluster) - ad->albuminfo.cluster_list->clist = eina_list_append_relative(ad->albuminfo.cluster_list->clist, - gcluster, default_cluster); - else - ad->albuminfo.cluster_list->clist = eina_list_prepend(ad->albuminfo.cluster_list->clist, - gcluster); - - default_cluster = gcluster; - } - - gl_dbg("Cluster Done."); - return length; -} - -/* -* get a new item from media service by item id -*/ -Mitem *gl_db_new_mitem(void *data, const char *item_id) -{ - GL_CHECK_NULL(data); - Mitem *mitem = NULL; - gl_appdata *ad = (gl_appdata *)data; - /*new API, to use media id to get item. */ - minfo_get_item_by_id(ad->maininfo.db_handle, item_id, &mitem); - - return mitem; -} - -gl_item * -gl_db_new_item_mitem(Mitem * mitem) -{ - gl_item *gitem = _gl_db_new_item(); - GL_CHECK_NULL(gitem); - gitem->item = mitem; - - return gitem; -} - -/* -* get a new cluster from media service by cluster id -*/ -Mcluster *gl_db_new_mcluster(void *data, const char *cluster_id) -{ - gl_dbg("cluster_id=%s", cluster_id); - GL_CHECK_NULL(data); - gl_appdata *ad = (gl_appdata *)data; - Mcluster *mcluster = NULL; - int ret = -1; - ret = minfo_get_cluster(ad->maininfo.db_handle, NULL, cluster_id, &mcluster); - if (ret != 0) - { - gl_dbgE("minfo_get_cluster failed (ret=%d)", ret); - if (mcluster) - { - minfo_destroy_mtype_item(mcluster); - } - - return NULL; - } - - return mcluster; -} - -gl_cluster * -gl_db_new_cluster(void) -{ - gl_cluster *gcluster = (gl_cluster *) malloc(sizeof(gl_cluster)); - GL_CHECK_NULL(gcluster); - memset(gcluster, 0x00, sizeof(gl_cluster)); - gcluster->cluster = NULL; - gcluster->index = 0; - gcluster->item = NULL; - gcluster->checked = false; - gcluster->ad = NULL; - gcluster->_reserved = NULL; - - return gcluster; -} - -int -gl_db_clear_item_list(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - _gl_db_clear_item_list(data); - - return GL_DB_SUCCESS; -} - -int -gl_db_free_cluster(gl_cluster * gcluster) -{ - GL_CHECK_VAL(gcluster, GL_DB_FAIL); - - if (gcluster->cluster && gcluster->cluster->uuid && - !g_strcmp0(gcluster->cluster->uuid, GL_ALBUM_ALL_ID)) - { - _gl_db_free_cluster_all(gcluster); - } - else - { - _gl_db_free_cluster(gcluster); - } - - return GL_DB_SUCCESS; -} - -bool -gl_db_get_cluster_list(void *data) -{ - GL_CHECK_FALSE(data); - gl_appdata *ad = (gl_appdata *)data; - int n_entire_items = 0; - - _gl_db_clear_cluster_list(ad, true); - - ad->albuminfo.cluster_list = _gl_db_new_cluster_list(); - GL_CHECK_FALSE(ad->albuminfo.cluster_list); - n_entire_items = _gl_db_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_db_update_cluster_list(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - int len = 0; - - len = _gl_db_get_cluster_list(ad, true); - gl_dbg("Cluster list length: %d.", len); - if (len <= 0) - return GL_DB_FAIL; - - return GL_DB_SUCCESS; -} - -int -gl_db_cluster_list_remove(void *data, gl_cluster * item) -{ - GL_CHECK_VAL(item, GL_DB_FAIL); - GL_CHECK_VAL(item->cluster, GL_DB_FAIL); - GL_CHECK_VAL(item->cluster->uuid, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - gl_cluster *current = NULL; - Eina_List *l = NULL; - - GL_CHECK_VAL(ad->albuminfo.cluster_list, GL_DB_FAIL); - GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, GL_DB_FAIL); - Eina_List *cluster_list = ad->albuminfo.cluster_list->clist; - EINA_LIST_FOREACH(cluster_list, l, current) - { - if (current == NULL || current->cluster == NULL || - current->cluster->uuid == NULL) { - gl_dbgE("Invalid album item!"); - continue; - } - - if (!g_strcmp0(current->cluster->uuid, item->cluster->uuid)) - { - ad->albuminfo.cluster_list->clist = eina_list_remove(ad->albuminfo.cluster_list->clist, - current); - gl_db_free_cluster(current); - break; - } - current = NULL; - } - - return GL_DB_SUCCESS; -} - -int gl_db_get_cluster_by_id(void *data, const char *cluster_id, gl_cluster **cluster, int *pos) -{ - GL_CHECK_VAL(data, -1); - GL_CHECK_VAL(pos, -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; - *pos = 0; - - 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_dbg("cluster is NULL"); - break; - } - - if (!g_strcmp0(current->cluster->uuid, cluster_id)) { - *pos = i; - *cluster = current; - gl_dbg("Find album: %s", current->cluster->display_name); - return 0; - } - } - return 0; -} - -//add a new cluster whose url is 'cluster_url'. -int -gl_db_add_cluster(void *data, char *cluster_url) -{ - GL_CHECK_VAL(cluster_url, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - int ret = -1; - - char cluster_id[GL_MTYPE_ITEN_ID_LEN_MAX] = { 0, }; - ret = minfo_add_cluster(ad->maininfo.db_handle, cluster_url, cluster_id, - GL_MTYPE_ITEN_ID_LEN_MAX); - if (ret < 0) - { - gl_dbgE("minfo_add_cluster failed, ret: %d", ret); - } - return GL_DB_SUCCESS; -} - -/* Get new record from DB to check mitem exists or was already removed */ -bool gl_db_exists_item(void *data, const char *id) -{ - GL_CHECK_NULL(data); - GL_CHECK_FALSE(id); - gl_appdata *ad = (gl_appdata *)data; - Mitem *new_item = gl_db_new_mitem(ad, id); - if (new_item == NULL) { - gl_dbgW("Mitem doesn't exist!"); - return false; - } else { - minfo_destroy_mtype_item(new_item); - new_item = NULL; - return true; - } -} - -/** -* Get medias count of album. -*/ -int gl_db_get_item_cnt(void *data, const char *cluster_id, int *item_cnt) -{ - GL_CHECK_VAL(item_cnt, GL_DB_FAIL); - GL_CHECK_VAL(cluster_id, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - int err = -1; - gl_dbg("cluster_id: %s.", cluster_id); - - if (g_strcmp0(cluster_id, GL_ALBUM_ALL_ID)) { - /* It's normal album */ - minfo_item_filter filter; - memset(&filter, 0x00, sizeof(minfo_item_filter)); - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - filter.start_pos = GL_GET_ALL_RECORDS; - filter.end_pos = GL_GET_ALL_RECORDS; - filter.with_meta = false; - - err = minfo_get_item_cnt(ad->maininfo.db_handle, cluster_id, - filter, item_cnt); - } else { - /* All albums */ - gl_dbg("All albums media count."); - gl_dbg("All albums media count."); - err = minfo_get_all_item_count(ad->maininfo.db_handle, - MINFO_CLUSTER_TYPE_LOCAL_ALL, - MINFO_ITEM_ALL, - MINFO_MEDIA_FAV_ALL, item_cnt); - } - - if (err < 0) { - gl_dbg("Failed to get item count[err: %d]!", err); - return GL_DB_FAIL; - } - - gl_dbg("Item count: %d.", *item_cnt); - return GL_DB_SUCCESS; -} - -int gl_db_update_item_cnt(gl_cluster * album) -{ - GL_CHECK_VAL(album, GL_DB_FAIL); - GL_CHECK_VAL(album->cluster, GL_DB_FAIL); - int item_count = 0; - int err = GL_DB_FAIL; - GL_CHECK_VAL(album->cluster->uuid, GL_DB_FAIL); - err = gl_db_get_item_cnt(album->ad, album->cluster->uuid, &item_count); - if (err != GL_DB_SUCCESS) { - gl_dbg("gl_db_get_item_cnt failed!"); - album->cluster->count = 0; - return GL_DB_FAIL; - } - - gl_dbg("Media count: old=%d, new=%d", album->cluster->count, - item_count); - album->cluster->count = item_count; - - return GL_DB_SUCCESS; -} - -int -gl_db_get_item_list(void *data, - gl_cluster * album, - int start_pos, - int end_pos) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - Eina_List *itemlist = NULL; - minfo_item_filter filter; - int err = -1; - minfo_file_type file_type; - - file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; /* default */ - /* get file-type from bundle when launched by appsvc */ - if (ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) { - if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_IMAGE) { - file_type = MINFO_ITEM_IMAGE; - } else if (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_VIDEO) { - file_type = MINFO_ITEM_VIDEO; - } - } - - memset(&filter,0x00,sizeof(minfo_item_filter)); - GL_CHECK_VAL(album, GL_DB_FAIL); - GL_CHECK_VAL(album->cluster, GL_DB_FAIL); - 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, GL_DB_FAIL); - /* Real album */ - if (g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID)) - { - filter.file_type = file_type; - filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - filter.start_pos = start_pos; - filter.end_pos = end_pos; - filter.with_meta = true; - - 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_db_clear_item_list(ad); - } - - err = minfo_get_item_list(ad->maininfo.db_handle, - album->cluster->uuid, filter, - _gl_db_elist_ite_fn, &itemlist); - } - else //add "All" album - { - gl_dbg("db_get_item_list--all media\n"); - filter.file_type = file_type; - filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - filter.start_pos = start_pos; - filter.end_pos = end_pos; - filter.with_meta = true; - - 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_db_clear_item_list(ad); - } - - err = minfo_get_all_item_list(ad->maininfo.db_handle, - MINFO_CLUSTER_TYPE_LOCAL_ALL, filter, - _gl_db_elist_ite_fn, - &itemlist); - } - - gl_dbg("Error code: %d", err); - if ((err == 0) && (itemlist != NULL)) - { - Mitem *item = NULL; - gl_item *gitem = NULL; - EINA_LIST_FREE(itemlist, item) - { - if (item == NULL || item->uuid == NULL) { - gl_dbgE("Invalid item!"); - continue; - } - - gitem = _gl_db_new_item(); - if (gitem == NULL) { - gl_dbgE("_gl_db_new_item failed!"); - minfo_destroy_mtype_item(gitem); - continue; - } - - gitem->ad = ad; - gitem->item = item; - 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_db_clear_mtype_items_list(&itemlist); - } - - gl_dbg("DB all count : %d", ad->maininfo.medias_cnt); - return err; -} - -int gl_db_update_item_list(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - Eina_List *itemlist = NULL; - minfo_item_filter filter; - int err = -1; - int view_mode = gl_get_view_mode(ad); - Eina_List *sel_id_list = NULL; - gl_item *gitem = NULL; - - memset(&filter, 0x00, sizeof(minfo_item_filter)); - - if (view_mode == GL_VIEW_THUMBS_EDIT || - view_mode == GL_VIEW_VIDEOLIST_EDIT) { - gl_dbg("Edit view."); - /* Get ID list of selected items */ - _gl_db_get_selected_item_id_list(ad, &sel_id_list); - } - - 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); - - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - filter.sort_type = MINFO_MEDIA_SORT_BY_DATE_DESC; - filter.start_pos = GL_GET_ALL_RECORDS; - filter.end_pos = GL_GET_ALL_RECORDS; - filter.with_meta = true; - - ad->uginfo.sort_type = filter.sort_type; - /* Clear item list before new one got */ - _gl_db_clear_item_list(ad); - - if (!g_strcmp0(cur_album->cluster->uuid, GL_ALBUM_ALL_ID)) { - gl_dbg("All albums medias"); - int cluster_t = MINFO_CLUSTER_TYPE_LOCAL_ALL; - err = minfo_get_all_item_list(ad->maininfo.db_handle, - cluster_t, filter, - _gl_db_elist_ite_fn, - &itemlist); - } else { - gl_dbg("Normal album medias"); - err = minfo_get_item_list(ad->maininfo.db_handle, - cur_album->cluster->uuid, - filter, _gl_db_elist_ite_fn, - &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_db_clear_mtype_items_list(&itemlist); - - return err; - } - - bool b_selected = false; - Mitem *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_db_new_item(); - if (gitem == NULL) { - gl_dbgE("_gl_db_new_item failed!"); - minfo_destroy_mtype_item(gitem); - continue; - } - gitem->ad = ad; - gitem->item = item; - /* 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_db_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_db_selected_list_append(ad, gitem); - } - } - } - - /* Clear list of selected ID */ - if (sel_id_list) - __gl_db_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_db_get_first_several_items(gl_cluster * album, - gl_item * items[], int *item_count, - minfo_media_sort_type sort_type) -{ - GL_CHECK_VAL(items, GL_DB_FAIL); - GL_CHECK_VAL(item_count, GL_DB_FAIL); - GL_CHECK_VAL(album, GL_DB_FAIL); - GL_CHECK_VAL(album->cluster, GL_DB_FAIL); - GL_CHECK_VAL(album->cluster->uuid, GL_DB_FAIL); - GL_CHECK_VAL(album->ad, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)album->ad; - minfo_item_filter filter; - Eina_List *item_list = NULL; - int result_cnt = 0; - Mitem *item = NULL; - gl_item *gitem = NULL; - int err = -1; - - if (*item_count <= 0) - { - return 0; - } - memset(&filter,0x00,sizeof(minfo_item_filter)); - if (g_strcmp0(album->cluster->uuid, GL_ALBUM_ALL_ID) ) //real album - { - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - filter.sort_type = sort_type; - filter.start_pos = GL_FIRST_VIEW_START_POS; - filter.end_pos = (*item_count == 1 ? 1 : (*item_count - 1)); - filter.with_meta = false; - - err = minfo_get_item_list(ad->maininfo.db_handle, - album->cluster->uuid, filter, - _gl_db_elist_ite_fn, &item_list); - if (err != 0 || item_list == NULL) { - gl_dbgE("minfo_get_item_list failed : err=%d", err); - *item_count = 0; - if (item_list) - _gl_db_clear_mtype_items_list(&item_list); - return GL_DB_FAIL; - } - - EINA_LIST_FREE(item_list, item) { - if (item == NULL) { - gl_dbgE("Invalid Mitem!"); - continue; - } - result_cnt++; - if(result_cnt <= *item_count) { - gitem = NULL; - gitem = _gl_db_new_item(); - if (gitem == NULL) { - gl_dbgE("_gl_db_new_item failed!"); - minfo_destroy_mtype_item(gitem); - result_cnt--; - continue; - } - gitem->item = item; - gitem->ad = ad; - items[result_cnt-1] = gitem; - } else { - minfo_destroy_mtype_item(item); - } - item = NULL; - } - - if(*item_count > result_cnt) - *item_count = result_cnt; - } - else //add "All" album - { - gl_dbg("db_get_item_list--all media\n"); - filter.file_type = MINFO_ITEM_IMAGE | MINFO_ITEM_VIDEO; - filter.sort_type = sort_type; - - filter.start_pos = GL_FIRST_VIEW_START_POS; - filter.end_pos = (*item_count == 1 ? 1 : (*item_count - 1)); - filter.with_meta = false; - - //use new api to get all local files, mmc status checking would be done in new apis - err = minfo_get_all_item_list(ad->maininfo.db_handle, - MINFO_CLUSTER_TYPE_LOCAL_ALL, - filter, _gl_db_elist_ite_fn, - &item_list); - if (err != 0 || item_list == NULL) { - gl_dbgE("minfo_get_item_list fails : err=%d", err); - *item_count = 0; - if (item_list) - _gl_db_clear_mtype_items_list(&item_list); - - return GL_DB_FAIL; - } - - EINA_LIST_FREE(item_list, item) { - if (item == NULL) { - gl_dbgE("Invalid Mitem!"); - continue; - } - result_cnt++; - if(result_cnt <= *item_count) { - gitem = NULL; - gitem = _gl_db_new_item(); - if (gitem == NULL) { - gl_dbgE("_gl_db_new_item failed!"); - minfo_destroy_mtype_item(gitem); - result_cnt--; - continue; - } - gitem->item = item; - gitem->ad = ad; - items[result_cnt-1] = gitem; - } else { - minfo_destroy_mtype_item(item); - } - item = NULL; - } - - if(*item_count > result_cnt) - *item_count = result_cnt; - } - - if (*item_count) - { - gl_dbg("first %d items for this album(%s)", - *item_count, album->cluster->display_name); - } - - return GL_DB_SUCCESS; -} - -bool -gl_db_is_item_cnt_zero(void *data, minfo_file_type type) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - 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_db_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_db_destroy_item(gl_item * gitem) -{ - GL_CHECK_VAL(gitem, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item, GL_DB_FAIL); - _gl_db_destroy_item(gitem); - return GL_DB_SUCCESS; -} - -/** -* select_mode: true, get item from selected_media_elist; false, get item from media_elist. -*/ -int -gl_db_get_item_by_index(void *data, int idx, bool select_mode, gl_item ** gitem) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - 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); - *gitem = NULL; - return GL_DB_FAIL; - } - - *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 GL_DB_SUCCESS; -} - -int -gl_db_item_list_remove(void *data, gl_item * gitem) -{ - GL_CHECK_VAL(gitem, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item->uuid, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - 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_db_destroy_item(current); - break; - } - current = NULL; - } - - return 0; -} - -/* Remove file from DB and file system */ -int gl_db_remove_item(gl_item * gitem) -{ - GL_CHECK_VAL(gitem, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item->uuid, GL_DB_FAIL); - GL_CHECK_VAL(gitem->ad, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)gitem->ad; - int ret = -1; - - if (!gitem->item->file_url) { - gl_dbgW("Invalid file_url!"); - ret = minfo_delete_media_id(ad->maininfo.db_handle, gitem->item->uuid); - if (ret != 0) { - gl_dbgE("minfo_delete_media_id failed[%d]!", ret); - return GL_DB_FAIL; - } else { - return GL_DB_SUCCESS; - } - } - gl_dbg("Remove file: %s.", gitem->item->file_url); - /* Delete record from DB then delete media from file system */ - ret = minfo_delete_media(ad->maininfo.db_handle, gitem->item->file_url); - if (ret != 0) { - gl_dbgE("minfo_delete_media failed[%d]!", ret); - return GL_DB_FAIL; - } - - if (!ecore_file_unlink(gitem->item->file_url)) { - gl_dbgE("ecore_file_unlink failed!"); - return GL_DB_FAIL; - } - return GL_DB_SUCCESS; -} - -/* Append gl_item to medias_elist */ -int -gl_db_append_item(void *data, gl_item * gitem) -{ - GL_CHECK_VAL(gitem, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - - gitem->ad = ad; - ad->maininfo.medias_elist = eina_list_append(ad->maininfo.medias_elist, gitem); - ad->maininfo.medias_cnt++; - - return 0; -} - -gl_item * -gl_db_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_db_selected_list_append(void *data, gl_item * gitem) -{ - GL_CHECK_VAL(gitem, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - - /* Update selected images count */ - if (gitem->item->type == MINFO_ITEM_IMAGE) - ad->selectedinfo.images_cnt++; - - Eina_List *sel_list = ad->selectedinfo.medias_elist; - sel_list = eina_list_append(sel_list, gitem); - ad->selectedinfo.medias_elist = sel_list; - return GL_DB_SUCCESS; -} - -int -gl_db_selected_list_remove(void *data, gl_item * gitem) -{ - GL_CHECK_VAL(gitem, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item, GL_DB_FAIL); - GL_CHECK_VAL(gitem->item->uuid, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - 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 == MINFO_ITEM_IMAGE && - ad->selectedinfo.images_cnt > 0) - ad->selectedinfo.images_cnt--; - - sel_list = eina_list_remove(sel_list, current); - ad->selectedinfo.medias_elist = sel_list; - break; - } - current = NULL; - } - return GL_DB_SUCCESS; -} - -int -gl_db_selected_list_finalize(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - 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; - return GL_DB_SUCCESS; -} - -int -gl_db_selected_list_count(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - - return eina_list_count(ad->selectedinfo.medias_elist); -} - -/* -* get full path of cluster -*/ -int gl_db_get_folder_fullpath(void *data, const char *cluster_id, char *path) -{ - GL_CHECK_VAL(path, GL_DB_FAIL); - GL_CHECK_VAL(cluster_id, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - /*For safety, add one more parameter as a size of the output array */ - return minfo_get_cluster_fullpath_by_id(ad->maininfo.db_handle, - cluster_id, path, GL_DIR_PATH_LEN_MAX); -} - -/* -* Check it's default album[Camera shot] or not -*/ -bool -gl_db_is_default_album(void *data, Mcluster* mcluster) -{ - GL_CHECK_FALSE(mcluster); - GL_CHECK_FALSE(mcluster->display_name); - GL_CHECK_FALSE(mcluster->uuid); - - /* Name is 'Camera shot and' folder locates in Phone */ - if (!strcmp(mcluster->display_name, GL_ALBUM_DEFAULT_NAME) && - mcluster->type == MINFO_PHONE) - { - char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; - char parent_path[GL_DIR_PATH_LEN_MAX] = { 0, }; - - int ret = gl_db_get_folder_fullpath(data, mcluster->uuid, dir_path); - if(ret != 0) - { - gl_dbgE("gl_db_get_folder_fullpath failed[%d]!", ret); - return false; - } - gl_dbg("Full path: %s", dir_path); - - _gl_db_get_file_dir_names(dir_path, NULL, NULL, parent_path); - gl_dbg("Parent path: %s.", parent_path); - - /* And parent folder is Phone root path, it's default folder */ - return (strcmp(parent_path, GL_ROOT_PATH_PHONE) == 0); - } - - return false; -} - -bool gl_db_is_root_path(void *data, const char *cluster_id, const char *path) -{ - int res = 0; - char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; - - if (path) - { - g_strlcpy(dir_path, path, GL_DIR_PATH_LEN_MAX); - } - else - { - if (cluster_id == NULL || strlen(cluster_id) <= 0) { - gl_dbgE("Invalid cluster_id!"); - return false; - } - res = gl_db_get_folder_fullpath(data, cluster_id, dir_path); - if (res < 0) - { - gl_dbg("get folder fullpath failed(%d), return!", res); - return false; - } - } - - if (!g_strcmp0(GL_ROOT_PATH_PHONE, dir_path) || - !g_strcmp0(GL_ROOT_PATH_MMC, dir_path)) { - gl_dbg("Root path: %s.", dir_path); - return true; - } - - return false; -} - -int -gl_db_get_albums_selected_cnt(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - - return eina_list_count(ad->albuminfo.selected_albums_elist); -} - -int -gl_db_albums_selected_list_append(void *data, gl_cluster * item) -{ - GL_CHECK_VAL(item, GL_DB_FAIL); - GL_CHECK_VAL(item->cluster, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - ad->albuminfo.selected_albums_elist = eina_list_append(ad->albuminfo.selected_albums_elist, item); - - return GL_DB_SUCCESS; -} - -int -gl_db_albums_selected_list_remove(void *data, gl_cluster * item) -{ - GL_CHECK_VAL(item, GL_DB_FAIL); - GL_CHECK_VAL(item->cluster, GL_DB_FAIL); - GL_CHECK_VAL(item->cluster->uuid, GL_DB_FAIL); - GL_CHECK_VAL(data, GL_DB_FAIL); - 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)) - { - ad->albuminfo.selected_albums_elist = eina_list_remove(ad->albuminfo.selected_albums_elist, current); - break; - } - current = NULL; - } - - return GL_DB_SUCCESS; -} - -int -gl_db_finalize_albums_selected_list(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - 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->albuminfo.selected_albums_elist = NULL; - return GL_DB_SUCCESS; -} - -bool -gl_db_is_albums_selected_list_empty(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - 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) - { - continue; - } - else - { - if (current->cluster->count) - { - return false; - } - } - } - - return true; -} - -int -gl_db_init(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - MediaSvcHandle *_db_handle = NULL; - - int err = media_svc_connect(&_db_handle); - if (err < 0) { - gl_dbgE("Connect to DB failed!"); - return GL_DB_FAIL; - } - - ad->maininfo.db_handle = _db_handle; - return GL_DB_SUCCESS; -} - -int -gl_db_finalize(void *data) -{ - GL_CHECK_VAL(data, GL_DB_FAIL); - gl_appdata *ad = (gl_appdata *)data; - - _gl_db_clear_cluster_list(ad, true); - _gl_db_clear_item_list(ad); - - int err = media_svc_disconnect(ad->maininfo.db_handle); - if (err < 0) { - gl_dbgE("Disconnect with DB failed!"); - return GL_DB_FAIL; - } - - return GL_DB_SUCCESS; -} diff --git a/src/util/gl-debug.c b/src/util/gl-debug.c new file mode 100755 index 0000000..5c2220b --- /dev/null +++ b/src/util/gl-debug.c @@ -0,0 +1,141 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 + diff --git a/src/util/gl-drm.c b/src/util/gl-drm.c new file mode 100755 index 0000000..7727865 --- /dev/null +++ b/src/util/gl-drm.c @@ -0,0 +1,82 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +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..92f4aa2 --- /dev/null +++ b/src/util/gl-exif.c @@ -0,0 +1,1132 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +#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_EXI_TMP_JPEG_FILE "/opt/media/.gallery_tmp_write_exif.jpg" + +/* Write one byte, testing for EOF */ +static int __gl_exif_write_1_byte(FILE *fd, int c) +{ + if (fputc(c, fd) < 0) { + gl_dbgE("fputc failed!"); + return -1; + } + + return 0; +} + +/* Read one byte, testing for EOF */ +static int __gl_exif_read_1_byte(FILE *fd) +{ + int c = 0; + + /* Return next input byte, or EOF if no more */ + c = getc(fd); + if (c == EOF) { + gl_dbgE("Premature EOF in JPEG file!"); + return -1; + } + + return c; +} + +/* Read 2 bytes, convert to unsigned int */ +/* All 2-byte quantities in JPEG markers are MSB first */ +static int __gl_exif_read_2_bytes(FILE *fd, unsigned int *len) +{ + int c1 = 0; + int c2 = 0; + + /* Return next input byte, or EOF if no more */ + c1 = getc(fd); + if (c1 == EOF) { + gl_dbgE("Premature EOF in JPEG file!"); + return -1; + } + + /* Return next input byte, or EOF if no more */ + c2 = getc(fd); + if (c2 == EOF) { + gl_dbgE("Premature EOF in JPEG file!"); + return -1; + } + + if (len) + *len = (((unsigned int)c1) << 8) + ((unsigned int)c2); + + return 0; +} + +/* Add raw exif tag and data */ +static int __gl_exif_add_header(FILE *fd, unsigned int *orientation) +{ + GL_CHECK_VAL(orientation, -1); + GL_CHECK_VAL(fd, -1); + int i = 0; + int ret = -1; + char *time_buf = NULL; + unsigned int offset = 0; + + /* raw EXIF header data */ + const unsigned char exif1[] = { + GL_EXIF_TAG, GL_EXIF_SOI, GL_EXIF_TAG, GL_EXIF_APP1 + }; + /* Write File head, check for JPEG SOI + Exif APP1 */ + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif1[i]) < 0) + goto GL_EXIF_FAILED; + } + /* SET the marker parameter length count */ + /* Length includes itself, so must be at least 2 + Following Exif data length must be at least 6; 30+36 bytes*/ + const unsigned char exif2[] = { 0x00, 0x42 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif2[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Write Exif head -- "Exif" */ + const unsigned char exif3[] = { 0x45, 0x78, 0x69, 0x66, 0x00, 0x00 }; + for (i = 0; i < 6; i++) { + if (__gl_exif_write_1_byte(fd, exif3[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Set byte order and Tag Mark , "II(0x4949)" */ + const unsigned char exif4[] = { 0x49, 0x49, 0x2A, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif4[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 4; + + /* Set first IFD offset (offset to IFD0) , II-08000000 */ + const unsigned char exif5[] = { 0x08, 0x00, 0x00, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif5[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 4; + + /* IFD: Image File Directory */ + /* Set the number of directory entries contained in this IFD, - EEEE ; + * 2 entry: orientation, data time */ + const unsigned char exif6[] = { 0x02, 0x00 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif6[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + /* Add Orientation Tag in IFD0; 0x0112 */ + const unsigned char exif7[] = { 0x12, 0x01 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif7[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + gl_dbg("Write: %d", *orientation); + const unsigned char exif8[] = { 0x03, 0x00, 0x01, 0x00, 0x00, 0x00 }; + for (i = 0; i < 6; i++) { + if (__gl_exif_write_1_byte(fd, exif8[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 6; + + /* Set the Orientation value */ + if (__gl_exif_write_1_byte(fd, (unsigned char)(*orientation)) < 0) + goto GL_EXIF_FAILED; + + const unsigned char exif9[] = { 0x00, 0x00, 0x00 }; + for (i = 0; i < 3; i++) { + if (__gl_exif_write_1_byte(fd, exif9[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 4; + + /* Add Data Time Tag in IFD0; 0x0132 */ + const unsigned char exif10[] = { 0x32, 0x01 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif10[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + /* Type: strings */ + const unsigned char exif11[] = { 0x02, 0x00 }; + for (i = 0; i < 2; i++) { + if (__gl_exif_write_1_byte(fd, exif11[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 2; + + /* Data lengh, byte count */ + const unsigned char exif12[] = { 0x14, 0x00, 0x00, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif12[i]) < 0) + goto GL_EXIF_FAILED; + } + offset += 8; + + /* 20 bytes larger than 4 bytes, + * so next 4 bytes is data offset start from "II"(0x4949)*/ + + gl_dbg("offset: %2X", offset + 8); + /* Too add data offset, plus 4 bytes self and plus 4 bytes IFD terminator */ + if (__gl_exif_write_1_byte(fd, (unsigned char)(offset + 4)) < 0) + goto GL_EXIF_FAILED; + + const unsigned char exif13[] = { 0x00, 0x00, 0x00 }; + for (i = 0; i < 3; i++) { + if (__gl_exif_write_1_byte(fd, exif13[i]) < 0) + goto GL_EXIF_FAILED; + } + + /*After last directory entry, there is a 4bytes of data('LLLLLLLL' at the chart), + * it means an offset to next IFD. If its value is '0x00000000', + * it means this is the last IFD and there is no linked IFD */ + const unsigned char exif14[] = { 0x00, 0x00, 0x00, 0x00 }; + for (i = 0; i < 4; i++) { + if (__gl_exif_write_1_byte(fd, exif14[i]) < 0) + goto GL_EXIF_FAILED; + } + + /* Date Time of image was last modified. + * Data format is "YYYY:MM:DD HH:MM:SS"+0x00, total 20bytes + */ + time_t t; + struct tm tms; + struct tm *tm; + + t = time (NULL); + tm = localtime_r(&t, &tms); + + time_buf = (char *)calloc(1, GL_EXIF_BUF_TIME_LEN_MAX); + if (time_buf == NULL) { + gl_dbgE("Faild to allocate memory!"); + goto GL_EXIF_FAILED; + } + snprintf(time_buf, GL_EXIF_BUF_TIME_LEN_MAX, + "%04i:%02i:%02i %02i:%02i:%02i", + tm->tm_year + GL_EXIF_DEFAULT_YEAR, tm->tm_mon + 1, + tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); + + gl_dbg("time_buf: %s", time_buf); + if (fwrite(time_buf, 1, GL_EXIF_BUF_TIME_LEN_MAX, fd) != GL_EXIF_BUF_TIME_LEN_MAX) { + gl_dbgW("Write size are diff!"); + goto GL_EXIF_FAILED; + } + + ret = 0; + + GL_EXIF_FAILED: + + gl_dbg("All done"); + if (time_buf) + free(time_buf); + return ret; +} + +/* Add exif to jfif 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; + } + + /* Remove header of JFIF from 0 to first 0xFF */ + 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) { + if (tmp[0] == GL_EXIF_TAG) { + gl_dbgW("0xFF!"); + b_tag_ff = true; + } + /* Move back 1 byte */ + fseek(fd, -1, SEEK_CUR); + break; + } + } + + /* Add raw EXIF header data */ + if (__gl_exif_add_header(tmp_fd, orientation) < 0) + goto GL_EXIF_FAILED; + + size_t r_size = 0; + 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); + + if (tmp_file) { + /* 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); + + if (tmp_file) { + /* 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; + } + + /* Copy header of JFIF from 0 to first 0xFF */ + 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) { + if (tmp[0] == GL_EXIF_TAG) { + gl_dbgW("0xFF!"); + b_tag_ff = true; + } + /* Move back 1 byte */ + fseek(fd, -1, SEEK_CUR); + break; + } + + if (__gl_exif_write_1_byte(tmp_fd, tmp[0]) < 0) + 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; + 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); + + if (tmp_file) { + /* 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 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); + } + } + + /* Find Exif */ + while(1) { + tmp_exif = __gl_exif_read_1_byte(fd); + if (tmp_exif < 0) + goto GL_EXIF_FAILED; + + tmp[0] = (unsigned char)tmp_exif; + if (tmp[0] != 0x45) + continue; + + 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; + gl_dbg("- %02X", tmp[i]); + } + if (tmp[0] == 0x78 && tmp[1] == 0x69 && tmp[2] == 0x66 && + tmp[3] == 0x00 && tmp[4] == 0x00) { + gl_dbgW("Met Exif!"); + break; + } 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; + } + + /* 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[4] != 0 && tmp[5] != 0) + goto GL_EXIF_FAILED; + offset = tmp[6]; + offset <<= 8; + offset += tmp[7]; + } else { + if (tmp[7] != 0 && tmp[6] != 0) + goto GL_EXIF_FAILED; + offset = tmp[5]; + offset <<= 8; + offset += tmp[4]; + } + 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 - 2"); + 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_dbgE("tags_cnt == 0"); + 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 */ + fseek(fd, -12, SEEK_CUR); + 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; +} + +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_dbgE("tags_cnt == 0"); + 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); + + fseek(fd, jfif_offset + (4 + 2 + 6 + 2) + offset, SEEK_SET); + 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); + rotated_orientataion = GL_ORIENTATION_ROT_ERR; + 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 index 02a32ee..e579627 100755 --- a/src/util/gl-ext-exec.c +++ b/src/util/gl-ext-exec.c @@ -14,16 +14,22 @@ * limitations under the License. */ + #include -#include +#include +#include +#include +#include "gl-drm.h" #include "gl-ext-exec.h" #include "gl-debug.h" #include "gallery.h" -#include "gl-db-handler.h" +#include "gl-data.h" #include "gl-util.h" - +#include "gl-popup.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" @@ -36,21 +42,10 @@ #define GL_ARGV_VIDEO_LAUNCH_APP "launching_application" #define GL_ARGV_VIDEO_LAUNCH_GALLERY "gallery" -#define GL_ARGV_LAUNCH_TYPE "launch-type" -#define GL_ARGV_LAUNCH_SEND "send" -#define GL_ARGV_LAUNCH_FT_WITH_CONTACT "ft-with-contact" - -#define GL_ARGV_FT_FILE "file" #define GL_ARGV_PATH "path" -#define GL_ARGV_FT_CONTACT "contact" - -#define GL_SEPERATOR_EMOLINK GL_SEPERATOR_BT -#define GL_SEPERATOR_FT ';' - //refer to imageviewer -static int -_gl_ext_launch_video_player(void *data, service_h service) +static int __gl_ext_launch_video_player(void *data, service_h service) { GL_CHECK_VAL(service, -1); GL_CHECK_VAL(data, -1); @@ -61,14 +56,23 @@ _gl_ext_launch_video_player(void *data, service_h service) 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); + /* Albums view */ gl_cluster *cur_cluster = ad->albuminfo.current_album; - if (cur_cluster && cur_cluster->cluster) - { + if (cur_cluster && cur_cluster->cluster) { gl_dbg("Album: %s", cur_cluster->cluster->display_name); - if (!g_strcmp0(cur_cluster->cluster->uuid, GL_ALBUM_ALL_ID)) - { + if (!g_strcmp0(cur_cluster->cluster->uuid, GL_ALBUM_ALL_ID)) { gl_dbg("All album"); service_add_extra_data(service, GL_ARGV_VIDEO_LIST_TYPE, @@ -79,10 +83,11 @@ _gl_ext_launch_video_player(void *data, service_h service) service_add_extra_data(service, GL_ARGV_VIDEO_LAUNCH_APP, GL_ARGV_VIDEO_LAUNCH_GALLERY); - } - else if (cur_cluster->cluster->type == MINFO_PHONE || - cur_cluster->cluster->type == MINFO_MMC) - { + service_add_extra_data(service, + GL_ARGV_VIDEO_START_POS, + last_pos_str); + } else if (cur_cluster->cluster->type == GL_PHONE || + cur_cluster->cluster->type == GL_MMC) { gl_dbg("Real album"); service_add_extra_data(service, GL_ARGV_VIDEO_LIST_TYPE, @@ -93,36 +98,46 @@ _gl_ext_launch_video_player(void *data, service_h service) service_add_extra_data(service, GL_ARGV_VIDEO_LAUNCH_APP, GL_ARGV_VIDEO_LAUNCH_GALLERY); - } - else - { + service_add_extra_data(service, + GL_ARGV_VIDEO_START_POS, + last_pos_str); + } else { gl_dbgE("Wrong type!"); } - } - else - { + } else { /* Fixme: return or not? */ gl_dbgE("Invalid current album, return?"); } - service_add_extra_data(service, GL_ARGV_PATH, video_path); - service_set_operation(service, SERVICE_OPERATION_VIEW); - service_set_package(service, GL_APP_PKG_VIDEOPLAYER); - if (service_send_launch_request(service, NULL, NULL) == SERVICE_ERROR_NONE) + + 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) +static int __gl_ext_compose_exec_cmd(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) - { + switch (type) { case GL_APP_VIDEOPLAYER: GL_CHECK_VAL(path, -1); *pkg_name = GL_APP_PKG_VIDEOPLAYER; @@ -134,38 +149,39 @@ _gl_ext_compose_exec_cmd(void *data, gl_ext_app_type type, return 0; } -int -gl_ext_exec(void *data, gl_ext_app_type type) +int gl_ext_exec(void *data, gl_ext_app_type type) { - GL_CHECK_VAL(data, GL_LAUNCH_FAIL); + GL_CHECK_VAL(data, -1); gl_item *gitem = (gl_item *)data; - GL_CHECK_VAL(gitem->ad, GL_LAUNCH_FAIL); + GL_CHECK_VAL(gitem->ad, -1); gl_appdata *ad = (gl_appdata *)gitem->ad; - GL_CHECK_VAL(gitem->item, GL_LAUNCH_FAIL); - GL_CHECK_VAL(gitem->item->file_url, GL_LAUNCH_FAIL); + 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_dbg("APP launched, return."); + if (ad->uginfo.app_called_by_me) { + gl_dbgE("APP launched, return!"); return GL_LAUNCH_FAIL; } - _gl_ext_compose_exec_cmd(ad, type, path, &pkg_name); - GL_CHECK_VAL(gitem->item->file_url, GL_LAUNCH_FAIL); - service_create(&service); GL_CHECK_VAL(service, GL_LAUNCH_FAIL); + __gl_ext_compose_exec_cmd(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) { + if (__gl_ext_launch_video_player(data, service) != 0) { service_destroy(service); return GL_LAUNCH_FAIL; } @@ -188,3 +204,46 @@ gl_ext_exec(void *data, gl_ext_app_type type) 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"); + service_h service = NULL; + + service_create(&service); + GL_CHECK_VAL(service, GL_LAUNCH_FAIL); + + service_set_operation(service, SERVICE_OPERATION_DEFAULT); + service_set_package(service, GL_APP_PKG_CAMERA); + + int ret = service_send_launch_request(service, NULL, NULL); + if (ret != SERVICE_ERROR_NONE) { + gl_dbgE("service_send_launch_request failed[%d]!", ret); + service_destroy(service); + return GL_LAUNCH_FAIL; + } + + ret = service_destroy(service); + if (ret != SERVICE_ERROR_NONE) + return GL_LAUNCH_SUCCESS; + else + return GL_LAUNCH_FAIL; + } + + 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 index e441cf5..b9a261f 100755 --- a/src/util/gl-ext-ug-load.c +++ b/src/util/gl-ext-ug-load.c @@ -16,7 +16,6 @@ #include #include -#include #include "gl-ext-ug-load.h" #include "gl-debug.h" #include "gl-ui-util.h" @@ -27,17 +26,37 @@ #include "gallery.h" #include "gl-popup.h" #include "gl-strings.h" +#include "gl-controlbar.h" -#define GL_EXT_STR_BUNDLE_LEN 48 - +#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' + +#ifdef _USE_WIFI +#define GL_UG_PKG_WIFI "fileshare-efl" +#define GL_SEPERATOR_WIFI '|' +#endif + +#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_SEPERATOR_BT '?' + #define GL_ARGV_IV_VIEW_MODE "View Mode" #define GL_ARGV_IV_VIEW_GALLERY "GALLERY" -#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_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_MEDIA_TYPE "Media type" @@ -45,11 +64,13 @@ #define GL_ARGV_IV_MEDIA_IMAGE "Image" #define GL_ARGV_IV_MEDIA_VIDEO "Video" #define GL_ARGV_IV_ALBUM_INDEX "Album index" -#define GL_ARGV_IV_SORT_BY "Sort By" +#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_IV_SLIDESHOW "Slideshow" +#define GL_ARGV_IV_TRUE "TRUE" #define GL_ARGV_LAUNCH_TYPE "launch-type" #define GL_ARGV_FILE_TYPE "file-type" @@ -60,19 +81,17 @@ #define GL_ARGV_LOCKSCREEN_PATH "lockscreen-path" #define GL_ARGV_SETAS_WALLPALER "wallpaper" -#define GL_ARGV_SETAS_CALLERID "callerid" +#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_IMFT "select-imft" -#define GL_ARGV_SELECT_RETURN_ALBUM "album-id" #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_CROP_PATH "crop-image-path" #define GE_ARGV_SETAS_RETURN_PATH "image-path" -#define GL_ARGV_IMFT_CONTACT "contact" #define GL_ARGV_FILE_TYPE_IMAGE "image" #define GL_ARGV_FILE_TYPE_VIDEO "video" #define GL_ARGV_FILE_TYPE_ALL "all" @@ -85,21 +104,23 @@ static void __gl_ext_destroy_ug(void *data) int view_mode = gl_get_view_mode(ad); gl_dbg("View mode: %d", view_mode); - gl_list_clear_view(ad); + ug_destroy(ad->uginfo.ug_called_by_me); + ad->uginfo.ug_called_by_me = NULL; + /* Clear type first */ + ad->uginfo.ug_type = -1; /** - * view_mode is set as GL_VIEW_THUMBS in gridview, + * If 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 (view_mode == GL_VIEW_THUMBS) { + gl_dbg("cur_album"); gl_update_view(ad, GL_UPDATE_VIEW_NORMAL); - - ug_destroy(ad->uginfo.ug_called_by_me); - ad->uginfo.ug_called_by_me = NULL; + } } void -_gl_ext_ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv) +_gl_ext_ug_layout_cb(ui_gadget_h ug, enum ug_mode mode, void *priv) { gl_dbg(""); GL_CHECK(ug); @@ -133,7 +154,13 @@ _gl_ext_ug_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void *priv) } void -_gl_ext_ug_destroy_cb(struct ui_gadget *ug, void *priv) +_gl_ext_ug_result_cb(ui_gadget_h ug, service_h result, void *priv) +{ + gl_dbg(""); +} + +void +_gl_ext_ug_destroy_cb(ui_gadget_h ug, void *priv) { GL_CHECK(priv); gl_appdata *ad = (gl_appdata *)priv; @@ -144,21 +171,21 @@ _gl_ext_ug_destroy_cb(struct ui_gadget *ug, void *priv) GL_CHECK(ad->uginfo.ug_called_by_me); __gl_ext_destroy_ug(ad); } else { - GL_CHECK(ad->uginfo.gallery_ug_called_by_me); - gl_dbg("Pause Gallery App."); - elm_win_lower(ad->maininfo.win); - + 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(ad->uginfo.gallery_ug_called_by_me); + ug_destroy(ug); ad->uginfo.gallery_ug_called_by_me = NULL; + + elm_win_lower(ad->maininfo.win); + gl_dbg("Pause Gallery App."); } } /* Invoke Imageviewer UG */ -int gl_ext_load_iv_ug(void *data, gl_item *cur_item) +int gl_ext_load_iv_ug(void *data, gl_item *cur_item, gl_ext_iv_type type) { GL_CHECK_VAL(cur_item, GL_UG_FAIL); GL_CHECK_VAL(cur_item->item, GL_UG_FAIL); @@ -167,42 +194,47 @@ int gl_ext_load_iv_ug(void *data, gl_item *cur_item) GL_CHECK_VAL(ad->maininfo.win, GL_UG_FAIL); Evas_Object *win = ad->maininfo.win; struct ug_cbs cbs; - struct ui_gadget *ug = NULL; - bundle *param = NULL; + ui_gadget_h ug = NULL; + service_h service = NULL; const char *album_id = NULL; gl_dbg(""); if (ad->uginfo.ug_called_by_me) { - gl_dbg("Already exits some UG called by me"); + gl_dbg("Already exits some UG called by me, type(%d)", type); return GL_UG_FAIL; } + + ad->uginfo.ug_type = GL_UG_IMAGEVIEWER; + memset(&cbs, 0x00, sizeof(struct ug_cbs)); int view_mode = gl_get_view_mode(ad); cbs.layout_cb = _gl_ext_ug_layout_cb; - cbs.result_cb = NULL; + cbs.result_cb = _gl_ext_ug_result_cb; cbs.destroy_cb = _gl_ext_ug_destroy_cb; cbs.priv = ad; - param = bundle_create(); - GL_CHECK_VAL(param, GL_UG_FAIL); + service_create(&service); + GL_CHECK_VAL(service, GL_UG_FAIL); UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE); gl_cluster *cur_album = ad->albuminfo.current_album; - GL_CHECK_VAL(cur_album, GL_UG_FAIL); - GL_CHECK_VAL(cur_album->cluster, GL_UG_FAIL); - GL_CHECK_VAL(cur_album->cluster->uuid, GL_UG_FAIL); - /* Local file */ - bundle_add(param, GL_ARGV_IV_VIEW_MODE, - GL_ARGV_IV_VIEW_GALLERY); - bundle_add(param, GL_ARGV_IV_PATH, cur_item->item->file_url); + /* 2.0, Local file */ + if (GL_UG_IV_SLIDESHOW_LOCAL == 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); + service_add_extra_data(service, GL_ARGV_IV_PATH, + cur_item->item->file_url); char sequence_str[GL_INTERGER_LEN_MAX] = { 0, }; eina_convert_itoa(cur_item->sequence, sequence_str); gl_dbg("sequence : %s", sequence_str); - bundle_add(param, GL_ARGV_IV_INDEX, sequence_str); + service_add_extra_data(service, GL_ARGV_IV_INDEX, sequence_str); int grid_view_m = ad->gridinfo.grid_view_mode; @@ -210,157 +242,409 @@ int gl_ext_load_iv_ug(void *data, gl_item *cur_item) case GL_VIEW_THUMBS: /* Type according to different seg. */ if (grid_view_m == GL_CTRL_SEG_IMAGES) { - bundle_add(param, GL_ARGV_IV_MEDIA_TYPE, - GL_ARGV_IV_MEDIA_IMAGE); + service_add_extra_data(service, + GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_IMAGE); gl_dbg("Media type: Image"); } else if (grid_view_m == GL_CTRL_SEG_VIDEOS) { - bundle_add(param, GL_ARGV_IV_MEDIA_TYPE, - GL_ARGV_IV_MEDIA_VIDEO); + service_add_extra_data(service, + GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_VIDEO); gl_dbg("Media type: Video"); } else { - bundle_add(param, GL_ARGV_IV_MEDIA_TYPE, - GL_ARGV_IV_MEDIA_ALL); + service_add_extra_data(service, + GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_ALL); gl_dbg("Media type: All"); } break; case GL_VIEW_VIDEOLIST: - bundle_add(param, GL_ARGV_IV_MEDIA_TYPE, - GL_ARGV_IV_MEDIA_VIDEO); + service_add_extra_data(service, + GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_VIDEO); gl_dbg("Media type: Video"); break; default: - bundle_add(param, GL_ARGV_IV_MEDIA_TYPE, - GL_ARGV_IV_MEDIA_ALL); + service_add_extra_data(service, + GL_ARGV_IV_MEDIA_TYPE, + GL_ARGV_IV_MEDIA_ALL); gl_dbg("Media type: All"); break; } - if (!g_strcmp0(cur_album->cluster->uuid, GL_ALBUM_ALL_ID)) { - /* 1.1, 'All' album->thumbnails view */ - bundle_add(param, GL_ARGV_IV_VIEW_BY, - GL_ARGV_IV_VIEW_BY_ALL); + if (cur_album && cur_album->cluster && + cur_album->cluster->uuid && + !g_strcmp0(cur_album->cluster->uuid, GL_ALBUM_ALL_ID)) { + /* 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 { - /* 1.2, Other albums->thumbnails view */ - bundle_add(param, GL_ARGV_IV_VIEW_BY, - GL_ARGV_IV_VIEW_BY_FOLER); + } 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"); } /* Pass album ID */ - album_id = cur_album->cluster->uuid; - gl_dbg("album_id is %s!", album_id); - bundle_add(param, GL_ARGV_IV_ALBUM_INDEX, album_id); + if (cur_album && + cur_album->cluster && cur_album->cluster->uuid) { + album_id = cur_album->cluster->uuid; + gl_dbg("album_id is %s!", album_id); + service_add_extra_data(service, GL_ARGV_IV_ALBUM_INDEX, + album_id); + } /* Sort by type */ int sort_type = ad->uginfo.sort_type; switch (sort_type) { - case MINFO_MEDIA_SORT_BY_NAME_DESC: + case GL_SORT_BY_NAME_DESC: /* Sort by display name descending */ - bundle_add(param, GL_ARGV_IV_SORT_BY, - GL_ARGV_IV_SORT_NAMEDESC); + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_NAMEDESC); gl_dbg("Name descending"); break; - case MINFO_MEDIA_SORT_BY_NAME_ASC: + case GL_SORT_BY_NAME_ASC: /* Sort by display name ascending */ - bundle_add(param, GL_ARGV_IV_SORT_BY, - GL_ARGV_IV_SORT_NAME); + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_NAME); gl_dbg("Name ascending"); break; - case MINFO_MEDIA_SORT_BY_DATE_DESC: + case GL_SORT_BY_DATE_DESC: /* Sort by modified_date descending */ - bundle_add(param, GL_ARGV_IV_SORT_BY, - GL_ARGV_IV_SORT_DATEDESC); + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_DATEDESC); gl_dbg("Date descending"); break; - case MINFO_MEDIA_SORT_BY_DATE_ASC: + case GL_SORT_BY_DATE_ASC: /* Sort by modified_date ascending */ - bundle_add(param, GL_ARGV_IV_SORT_BY, - GL_ARGV_IV_SORT_DATE); + service_add_extra_data(service, GL_ARGV_IV_SORT_BY, + GL_ARGV_IV_SORT_DATE); gl_dbg("Date ascending"); break; default: - /* No Sort, use MINFO_MEDIA_SORT_BY_NAME_ASC */ - bundle_add(param, GL_ARGV_IV_SORT_BY, - GL_ARGV_IV_SORT_NAME); + /* 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; } - ug = ug_create(NULL, GL_UG_PKG_IV, UG_MODE_FULLVIEW, param, &cbs); + if (type == GL_UG_IV_SLIDESHOW) { + gl_dbg("Enable Slideshow mode"); + service_add_extra_data(service, GL_ARGV_IV_SLIDESHOW, + GL_ARGV_IV_TRUE); + } + + 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; + gl_cluster *cur_album = NULL; + 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 called by me, 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); + + switch (type) + { + case GL_UG_MSG: + { + if (view_m == GL_VIEW_ALBUMS_EDIT) { + gl_dbg("Share albums..."); + GL_CHECK_VAL(ad->albuminfo.selected_albums_elist, -1); + cur_album = eina_list_nth(ad->albuminfo.selected_albums_elist, 0); + /* Get file string */ + _gl_data_get_albums_selected_files_path_str(ad, + GL_SEPERATOR_MAIL, + &filepath_arg, + NULL); + } else if (view_m == GL_VIEW_VIDEOLIST) { + GL_CHECK_VAL(ad->listinfo.sweep_file_path, -1); + filepath_arg = g_strdup(ad->listinfo.sweep_file_path); + } else { + cur_album = ad->albuminfo.current_album; + gl_get_selected_files_path_str(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: + { + if (view_m == GL_VIEW_ALBUMS_EDIT) { + gl_dbg("Share albums..."); + GL_CHECK_VAL(ad->albuminfo.selected_albums_elist, -1); + cur_album = eina_list_nth(ad->albuminfo.selected_albums_elist, 0); + /* Get file string */ + _gl_data_get_albums_selected_files_path_str(ad, + GL_SEPERATOR_MAIL, + &filepath_arg, + NULL); + } else if (view_m == GL_VIEW_VIDEOLIST) { + GL_CHECK_VAL(ad->listinfo.sweep_file_path, -1); + filepath_arg = g_strdup(ad->listinfo.sweep_file_path); + } else { + cur_album = ad->albuminfo.current_album; + gl_get_selected_files_path_str(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: + { + int sel_cnt = 0; + char count_arg[GL_EXT_STR_COUNT_LEN] = { 0, }; + if (view_m == GL_VIEW_ALBUMS_EDIT) { + gl_dbg("Share albums..."); + /* Get file string */ + _gl_data_get_albums_selected_files_path_str(ad, + GL_SEPERATOR_BT, + &filepath_arg, + &sel_cnt); + } else if (view_m == GL_VIEW_VIDEOLIST) { + GL_CHECK_VAL(ad->listinfo.sweep_file_path, -1); + filepath_arg = g_strdup(ad->listinfo.sweep_file_path); + } else { + gl_get_selected_files_path_str(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; + } +#ifdef _USE_WIFI + case GL_UG_WIFI: + { + int sel_cnt = 0; + char count_arg[GL_EXT_STR_COUNT_LEN] = { 0, }; + if (view_m == GL_VIEW_ALBUMS_EDIT) { + gl_dbg("Share albums..."); + /* Get file string */ + _gl_data_get_albums_selected_files_path_str(ad, + GL_SEPERATOR_WIFI, + &filepath_arg, + &sel_cnt); + } else if (view_m == GL_VIEW_VIDEOLIST) { + GL_CHECK_VAL(ad->listinfo.sweep_file_path, -1); + filepath_arg = g_strdup(ad->listinfo.sweep_file_path); + } else { + gl_get_selected_files_path_str(ad, + GL_SEPERATOR_WIFI, + &filepath_arg, + &sel_cnt); + } + if(filepath_arg == NULL) + goto EXT_UG_FAILED; + + 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_WIFI, UG_MODE_FULLVIEW, + service, &cbs); + break; + } +#endif + 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; - bundle_free(param); + service_destroy(service); if (ug) { 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; } void -_gl_ext_gallery_ug_result_cb(struct ui_gadget *ug, bundle * result, void *priv) +_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(""); - /* Send result to caller */ - const char *ret = NULL; - bundle *aul_result = NULL; - appsvc_create_result_bundle(ad->albuminfo.recv_bundle, &aul_result); + if (service_create(&reply) != SERVICE_ERROR_NONE) { + gl_dbgE("service_create failed!"); + return; + } + GL_CHECK(reply); - switch(ad->albuminfo.aul_launch_type) - { + switch(ad->albuminfo.aul_launch_type) { case GL_AUL_T_SELECT_ALBUM: - ret = bundle_get_val(result, GL_ARGV_SELECT_RETURN_FOLDER_PATH); - if(ret) - { - gl_dbg("return folder-path: %s", ret); - appsvc_add_data(aul_result, APPSVC_DATA_SELECTED, ret); + 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_MEM(ret_str); + b_reply = true; } break; case GL_AUL_T_SELECT_ONE: - ret = bundle_get_val(result, GL_ARGV_SELECT_RETURN_PATH); - if(ret) - { - gl_dbg("return path: %s", ret); - appsvc_add_data(aul_result, APPSVC_DATA_SELECTED, ret); + 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_MEM(ret_str); + b_reply = true; } break; case GL_AUL_T_SELECT_MULTIPLE: - ret = bundle_get_val(result, GL_ARGV_SELECT_RETURN_COUNT); - if(ret) - { - gl_dbg("return count: %s", ret); - appsvc_add_data(aul_result, GL_ARGV_SELECT_RETURN_COUNT, ret); + 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_MEM(ret_str); + b_reply = true; } - ret = bundle_get_val(result, GL_ARGV_SELECT_RETURN_PATH); - if(ret) - { - gl_dbg("return path: %s", ret); - appsvc_add_data(aul_result, APPSVC_DATA_SELECTED, ret); + 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_MEM(ret_str); + b_reply = true; } break; case GL_AUL_T_SELECT_SETAS: - ret = bundle_get_val(result, GE_ARGV_SETAS_RETURN_PATH); - if(ret) - { - gl_dbg("return image-path: %s", ret); - appsvc_add_data(aul_result, GE_ARGV_SETAS_RETURN_PATH, ret); + service_get_extra_data(result, GE_ARGV_SETAS_RETURN_PATH, + &ret_str); + if(ret_str) { + gl_dbg("return image-path: %s", ret_str); + service_add_extra_data(reply, GE_ARGV_SETAS_RETURN_PATH, + ret_str); + GL_FREE_MEM(ret_str); + b_reply = true; } - ret = bundle_get_val(result, GL_ARGV_SETAS_RETURN_CROP_PATH); - if(ret && ad->albuminfo.aul_setas_type == GL_AUL_SETAS_T_CALLER_ID) - { - gl_dbg("return image-path: %s", ret); - appsvc_add_data(aul_result, GL_ARGV_SETAS_RETURN_CROP_PATH, ret); + 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_MEM(ret_str); + b_reply = true; } break; @@ -368,12 +652,19 @@ _gl_ext_gallery_ug_result_cb(struct ui_gadget *ug, bundle * result, void *priv) break; } - if(ret) - appsvc_send_result(aul_result, APPSVC_RES_OK); - else - appsvc_send_result(aul_result, APPSVC_RES_CANCEL); + /* 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); + } - bundle_free(aul_result); + service_destroy(reply); + if (service_ret != SERVICE_ERROR_NONE) + gl_dbgE("service_reply_to_launch_request failed!"); } int @@ -382,14 +673,13 @@ gl_ext_load_gallery_ug(void *data) GL_CHECK_VAL(data, GL_UG_FAIL); gl_appdata *ad = (gl_appdata *)data; struct ug_cbs cbs; - struct ui_gadget *ug = NULL; - bundle *param = NULL; + 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; - char bd_str[GL_EXT_STR_BUNDLE_LEN] = { 0, }; if (ad->uginfo.gallery_ug_called_by_me) { @@ -405,11 +695,8 @@ gl_ext_load_gallery_ug(void *data) cbs.destroy_cb = _gl_ext_ug_destroy_cb; cbs.priv = ad; - param = bundle_create(); - if (!param) - { - return GL_UG_FAIL; - } + service_create(&service); + GL_CHECK_VAL(service, GL_UG_FAIL); UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE); @@ -419,72 +706,81 @@ gl_ext_load_gallery_ug(void *data) switch (launch_type) { case GL_AUL_T_SELECT_ONE: - bundle_add(param, GL_ARGV_LAUNCH_TYPE, GL_ARGV_SELECT_ONE); + service_add_extra_data(service, GL_ARGV_LAUNCH_TYPE, + GL_ARGV_SELECT_ONE); break; - case GL_AUL_T_SELECT_MULTIPLE: - bundle_add(param, GL_ARGV_LAUNCH_TYPE, GL_ARGV_SELECT_MULTIPLE); + service_add_extra_data(service, GL_ARGV_LAUNCH_TYPE, + GL_ARGV_SELECT_MULTIPLE); break; - - case GL_AUL_T_SELECT_IMFT: - bundle_add(param, GL_ARGV_LAUNCH_TYPE, GL_ARGV_SELECT_IMFT); - - snprintf(bd_str, sizeof(bd_str), "%d", ad->albuminfo.aul_contact_id); - bundle_add(param, GL_ARGV_IMFT_CONTACT, bd_str); - break; - case GL_AUL_T_SELECT_SETAS: - bundle_add(param, GL_ARGV_LAUNCH_TYPE, GL_ARGV_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: - bundle_add(param, GL_ARGV_SETAS_TYPE, GL_ARGV_SETAS_WALLPALER); + 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 + 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); - bundle_add(param, GL_ARGV_HOMESCREEN_PATH, 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); - bundle_add(param, GL_ARGV_LOCKSCREEN_PATH, val); + service_add_extra_data(service, + GL_ARGV_LOCKSCREEN_PATH, + val); } break; - case GL_AUL_SETAS_T_CALLER_ID: - bundle_add(param, GL_ARGV_SETAS_TYPE, GL_ARGV_SETAS_CALLERID); + 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); - bundle_add(param, GL_ARGV_CALLERID_SIZE, 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); - bundle_add(param, GL_ARGV_CALLERID_PATH, val); + service_add_extra_data(service, + GL_ARGV_CALLERID_PATH, + val); } break; - default: - bundle_free(param); + service_destroy(service); return GL_UG_FAIL; } break; case GL_AUL_T_SELECT_ALBUM: - bundle_add(param, GL_ARGV_LAUNCH_TYPE, GL_ARGV_SELECT_ALBUM); + service_add_extra_data(service, GL_ARGV_LAUNCH_TYPE, + GL_ARGV_SELECT_ALBUM); break; - default: - bundle_free(param); + service_destroy(service); return GL_UG_FAIL; } @@ -494,24 +790,24 @@ gl_ext_load_gallery_ug(void *data) switch (file_type) { case GL_AUL_FILE_T_IMAGE: - bundle_add(param, GL_ARGV_FILE_TYPE, GL_ARGV_FILE_TYPE_IMAGE); + service_add_extra_data(service, GL_ARGV_FILE_TYPE, + GL_ARGV_FILE_TYPE_IMAGE); break; - case GL_AUL_FILE_T_VIDEO: - bundle_add(param, GL_ARGV_FILE_TYPE, GL_ARGV_FILE_TYPE_VIDEO); + service_add_extra_data(service, GL_ARGV_FILE_TYPE, + GL_ARGV_FILE_TYPE_VIDEO); break; - case GL_AUL_FILE_T_ALL: - bundle_add(param, GL_ARGV_FILE_TYPE, GL_ARGV_FILE_TYPE_ALL); + service_add_extra_data(service, GL_ARGV_FILE_TYPE, + GL_ARGV_FILE_TYPE_ALL); break; - default: - bundle_free(param); + service_destroy(service); return GL_UG_FAIL; } - ug = ug_create(NULL, GL_UG_PKG_GALLERY, UG_MODE_FULLVIEW, param, &cbs); - bundle_free(param); + 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; @@ -539,10 +835,12 @@ gl_ext_destroy_gallery_ug(void *data) /* For select appsvc, 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->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); } return GL_UG_SUCCESS; } + diff --git a/src/util/gl-lang.c b/src/util/gl-lang.c new file mode 100755 index 0000000..c8588ad --- /dev/null +++ b/src/util/gl-lang.c @@ -0,0 +1,206 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-lang.h" +#include "gl-strings.h" +#include "gl-popup.h" +#include "gl-debug.h" +#include "gl-ui-util.h" +#include "gl-util.h" +#include "gl-progressbar.h" + +static int __gl_lang_update_albums(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->albuminfo.nf_it) + elm_object_item_text_set(ad->albuminfo.nf_it, + GL_STR_CTRL_ITEM_ALBUMS); + return 0; +} + +static int __gl_lang_update_albums_edit(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + if (ad->albuminfo.edit_layout) + edje_object_part_text_set(_EDJ(ad->albuminfo.edit_layout), + "selectall_text", + GL_STR_SELECT_ALL); + 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_ALBUM_SHARE) + gl_popup_create_title_popup(ad, GL_POPUP_ALBUM_SHARE, + GL_STR_SHARE, NULL); + else if (ad->popupinfo.popup_mode == GL_POPUP_NOBUT) + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_ALBUMS_SELECTED); + } + return 0; +} + +static int __gl_lang_update_rename(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->entryinfo.done_btn) + elm_object_text_set(ad->entryinfo.done_btn, GL_STR_DONE); + if (ad->entryinfo.cancel_btn) + elm_object_text_set(ad->entryinfo.cancel_btn, GL_STR_CANCEL); + if (ad->entryinfo.nf_it) + elm_object_item_text_set(ad->entryinfo.nf_it, + GL_STR_CHNAGE_NAME); + + return 0; +} + +static int __gl_lang_update_thumb(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + char *al_na = NULL; + Evas_Object *segment = ad->gridinfo.segment; + if (ad->gridinfo.nf_it) { + gl_cluster *album_item = ad->albuminfo.current_album; + al_na = album_item->cluster->display_name; + if (!g_strcmp0(album_item->cluster->uuid, GL_ALBUM_ALL_ID)) { + al_na = GL_ALBUM_ALL_NAME; + } + if (album_item->cluster->type == GL_PHONE || + album_item->cluster->type == GL_MMC) { + if (_gl_data_is_root_path(ad, 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 appsvc */ + 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 + al_na = GL_ALBUM_ALL_NAME; + } + } + elm_object_item_text_set(ad->gridinfo.nf_it, al_na); + + if (ad->listinfo.share_btn) + elm_object_text_set(ad->listinfo.share_btn, + GL_STR_SHARE); + if (ad->listinfo.del_btn) + elm_object_text_set(ad->listinfo.del_btn, + GL_STR_DELETE); + } + Elm_Object_Item *it = NULL; + if (segment) { + if ((it = elm_segment_control_item_get(segment, 0)) != NULL) + elm_object_item_text_set(it, GL_CTRL_SEG_ITEM_ALL); + if ((it = elm_segment_control_item_get(segment, 1)) != NULL) + elm_object_item_text_set(it, GL_CTRL_SEG_ITEM_IMAGES); + if ((it = elm_segment_control_item_get(segment, 2)) != NULL) + elm_object_item_text_set(it, GL_CTRL_SEG_ITEM_VIDEOS); + } + return 0; +} + +static int __gl_lang_update_thumb_edit(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->gridinfo.edit_layout) + edje_object_part_text_set(_EDJ(ad->gridinfo.edit_layout), + "selectall_text", + GL_STR_SELECT_ALL); + if (ad->gridinfo.nf_it_edit) + elm_object_item_text_set(ad->gridinfo.nf_it_edit, + GL_STR_SELECT_ALBUM); + 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_THUMB_SHARE) + gl_popup_create_title_popup(ad, GL_POPUP_THUMB_SHARE, + GL_STR_SHARE, NULL); + else if (ad->popupinfo.popup_mode == GL_POPUP_THUMB_MOVE) + gl_popup_create_title_popup(ad, GL_POPUP_THUMB_MOVE, + GL_STR_MOVE, NULL); + } + + + if (ad->popupinfo.selinfo_ly) { + char text[GL_POPUP_DESC_LEN_MAX] = {0}; + int cnt = _gl_data_selected_list_count(ad); + snprintf(text, sizeof(text), "%s (%d)", GL_STR_SELECTED, cnt); + edje_object_part_text_set(_EDJ(ad->popupinfo.selinfo_ly), + "elm.text", text); + } + + if (ad->entryinfo.done_btn) + elm_object_text_set(ad->entryinfo.done_btn, GL_STR_DONE); + if (ad->entryinfo.cancel_btn) + elm_object_text_set(ad->entryinfo.cancel_btn, GL_STR_CANCEL); + 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); + } +#ifdef _USE_ROTATE_BG + if (ad->gridinfo.more_btn) + elm_object_text_set(ad->gridinfo.more_btn, GL_STR_MORE); + if (ad->gridinfo.left_btn) + elm_object_text_set(ad->gridinfo.left_btn, GL_STR_ROTATE_LEFT); + if (ad->gridinfo.right_btn) + elm_object_text_set(ad->gridinfo.right_btn, GL_STR_ROTATE_RIGHT); +#endif + 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); + + __gl_lang_update_albums(data); + switch (view_mode) { + case GL_VIEW_ALBUMS_EDIT: + __gl_lang_update_albums_edit(data); + break; + case GL_VIEW_ALBUMS_RENAME: + __gl_lang_update_albums_edit(data); + __gl_lang_update_rename(data); + break; + case GL_VIEW_THUMBS: + case GL_VIEW_VIDEOLIST: + __gl_lang_update_thumb(data); + break; + case GL_VIEW_THUMBS_EDIT: + case GL_VIEW_VIDEOLIST_EDIT: + __gl_lang_update_thumb(data); + __gl_lang_update_thumb_edit(data); + break; + default: + gl_dbgE("other view_mode"); + } + + return 0; +} + + diff --git a/src/util/gl-thread-util.c b/src/util/gl-thread-util.c index d8fab29..78f40f8 100755 --- a/src/util/gl-thread-util.c +++ b/src/util/gl-thread-util.c @@ -18,14 +18,12 @@ #include #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-db-handler.h" +#include "gl-data.h" #include "gl-popup.h" #include "gl-progressbar.h" #include "gl-strings.h" @@ -68,6 +66,13 @@ static int _gl_thread_operate_medias(void *data) gl_dbg("Move!"); ret = gl_move_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; @@ -96,6 +101,13 @@ _gl_thread_update_view(void *data) gl_dbg("Move!"); gl_update_move_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; @@ -112,12 +124,8 @@ _gl_thread_data_thread(void *data) int cancel_flag = 0; gl_dbg("@@@@@@@@@@ :::: Child thread ID = %d :::: @@@@@@@@@@", _gl_thread_gettid()); - //Different thread, need to initialize libmedia-info. - gl_db_init(ad); - /* Media movement/deleting operation */ _gl_thread_operate_medias(data); - /* send finish signal */ gl_thread_pipe_data pipe_data; memset(&pipe_data, 0x00, sizeof(gl_thread_pipe_data)); @@ -181,29 +189,29 @@ _gl_thread_pipe_cb(void *data, void *buffer, unsigned int nbyte) gl_thread_emit_next_signal(ad); return; } + char msg[GL_FILE_PATH_LEN_MAX] = { 0, }; gl_item *cur_gitem = NULL; /* Get selected media */ - gl_db_get_item_by_index(ad, p_pipe_data->finished_cnt, true, &cur_gitem); + _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!", + 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!", + 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!", + 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); } @@ -219,7 +227,8 @@ _gl_thread_pipe_cb(void *data, void *buffer, unsigned int nbyte) } /* Update progressbar state */ - int all_cnt = gl_db_selected_list_count(ad); + int all_cnt = 0; + all_cnt = _gl_data_selected_list_count(ad); if (p_pipe_data->state) { /* Check cancel_flag */ @@ -277,7 +286,7 @@ _gl_thread_pipe_cb(void *data, void *buffer, unsigned int nbyte) */ gl_cluster *cur_album = ad->albuminfo.current_album; if (cur_album && cur_album->cluster && - cur_album->cluster->type == MINFO_MMC) { + cur_album->cluster->type == GL_MMC) { gl_dbgW("MMC removed, change to albums view!"); gl_pop_to_ctrlbar_ly(ad, true); } else { @@ -285,9 +294,8 @@ _gl_thread_pipe_cb(void *data, void *buffer, unsigned int nbyte) } } 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) + if (mmc_state == GL_MMC_STATE_ADDED_MOVING || + mmc_state == GL_MMC_STATE_ADDING_MOVING) ad->maininfo.mmc_state = GL_MMC_STATE_ADDED; /* Refresh view */ _gl_thread_update_view(ad); @@ -301,10 +309,10 @@ _gl_thread_pipe_cb(void *data, void *buffer, unsigned int nbyte) if (b_reset) { /* Free selected list */ - gl_db_selected_list_finalize(ad); + _gl_data_selected_list_finalize(ad); gl_dbgW("Thread cancellation is over, reset gallery!"); /* Continue remake gallery */ - gallery_reset_app(ad, ad->albuminfo.aul_album_id); + gallery_reset_app(ad); } else { /* Set medias_op_type none to stop refreshing view*/ ad->maininfo.medias_op_type = GL_MEDIA_OP_NONE; diff --git a/src/util/gl-ui-util.c b/src/util/gl-ui-util.c index dbf4e46..0dbd0d1 100755 --- a/src/util/gl-ui-util.c +++ b/src/util/gl-ui-util.c @@ -14,8 +14,6 @@ * limitations under the License. */ -#include -#include #include #include #include @@ -29,140 +27,23 @@ #include "gl-albums.h" #include "gl-listview.h" #include "gl-debug.h" -#include "gl-db-handler.h" +#include "gl-data.h" #include "gl-thread-util.h" #include "gl-popup.h" #include "gl-progressbar.h" #include "gl-strings.h" +#include "gl-drm.h" +#include "gl-nocontents.h" +#include "gl-notify.h" +#include "gl-editfield.h" -#define GL_CBAR_OCCUPIED_SEGMENT 4 - -#define GL_EDITFIELD_STYLE_DEFAULT GL_CHECKBOX_STYLE_DEFAULT -#define GL_ENTRY_STYLE_DEFAULT GL_CHECKBOX_STYLE_DEFAULT -#define GL_NAVIBAR_STYLE_DEFAULT GL_CHECKBOX_STYLE_DEFAULT #define GL_TRANS_FINISHED "transition,finished" -static void _gl_ui_newalbum_cancel_cb(void *data, Evas_Object * obj, - void *event_info); -void __gl_ui_entry_space_check_cb(void *data, Evas_Object *obj, void *event_info); -void __gl_ui_entry_maxlen_reached_cb(void *data, Evas_Object *obj, void *event_info); -static void __gl_editfield_focused_cb(void *data, Evas_Object *obj, void *event_info); -static void __gl_editfield_unfocused_cb(void *data, Evas_Object *obj, void *event_info); -static void __gl_editfield_eraser_clicked_cb(void *data, Evas_Object *obj, const char *emission, const char *source); - -static Evas_Object * -_gl_ui_create_editfield(void *data, Evas_Object * parent, char *default_label) -{ - GL_CHECK_NULL(data); - gl_appdata *ad = (gl_appdata *)data; - gl_dbg(""); - Evas_Object *editfield_ly = NULL; - Evas_Object *lay = NULL; - Evas_Object *entry = NULL; - static Elm_Entry_Filter_Limit_Size limit_filter_data; - - lay = elm_layout_add(parent); - GL_CHECK_NULL(lay); - evas_object_size_hint_weight_set(lay, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_layout_file_set(lay, GL_EDJ_FILE, GL_GRP_ENTRY); - - /* Single line with no title */ - editfield_ly = elm_layout_add(lay); - if (editfield_ly == NULL) { - gl_dbgE("elm_editfield_add failed!"); - evas_object_del(lay); - return NULL; - } - elm_layout_theme_set(editfield_ly, "layout", "editfield", "gallery"); - evas_object_size_hint_weight_set(editfield_ly, 1, 1); - evas_object_size_hint_align_set(editfield_ly, 1, 0.5); - /* Set editfield layout to view layout */ - elm_object_part_content_set(lay, "entry_part", editfield_ly); - - entry = elm_entry_add(editfield_ly); - if (entry == NULL) { - gl_dbgE("elm_entry_add failed!"); - evas_object_del(lay); - return NULL; - } - elm_object_style_set(entry, GL_ENTRY_STYLE_DEFAULT); - elm_entry_scrollable_set(entry, EINA_TRUE); - elm_entry_single_line_set(entry, EINA_TRUE); - /* Set entry to editfield layout */ - elm_object_part_content_set(editfield_ly, "elm.swallow.content", entry); - - /* 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; - 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!"); - evas_object_del(lay); - return NULL; - } - - ad->entryinfo.imf_entry = entry; - ad->entryinfo.imf_context = elm_entry_imf_context_get(ad->entryinfo.imf_entry); - - gl_dbg("view mode=%d", gl_get_view_mode(ad)); - evas_object_smart_callback_add(entry, "maxlength,reached", - __gl_ui_entry_maxlen_reached_cb, ad); - - /* Add space check callback */ - evas_object_smart_callback_add(entry, "changed", - __gl_ui_entry_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); - - ad->entryinfo.editfield = editfield_ly; - - return lay; -} - -static void -_gl_ui_selinfo_destroy_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_dbg(""); - gl_ui_destroy_selinfo(ad); - - if (view_mode == GL_VIEW_ALBUMS_EDIT) - { - edje_object_signal_emit(_EDJ(ad->albuminfo.edit_layout), - "elm,swallow_view,state,default", "elm"); - } else if (view_mode == GL_VIEW_THUMBS_EDIT || - view_mode == GL_VIEW_VIDEOLIST_EDIT) { - edje_object_signal_emit(_EDJ(ad->gridinfo.edit_layout), - "elm,swallow_view,state,thumb_edit_default", - "elm"); - } else { - gl_dbgE("Wrong view mode!"); - } -} - -/* Hide input panel and entry cursor */ -static int _gl_ui_hide_imf_input_panel(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata* ad = (gl_appdata*)data; - - if (ad->entryinfo.imf_context) - ecore_imf_context_input_panel_hide(ad->entryinfo.imf_context); - /* Unfocus to hide cursor */ - elm_object_focus_set(ad->entryinfo.imf_entry, FALSE); - - return 0; -} +#ifdef _USE_ROTATE_BG +static int __gl_ui_add_more_btn(void *data, Elm_Object_Item *nf_it, + Evas_Object *parent); +/*static int __gl_ui_remove_more_btn(Elm_Object_Item *nf_it);*/ +#endif /** * Check album name is valid and remove unuseful characters @@ -196,7 +77,6 @@ static int _gl_ui_get_valid_album_name(void *data, char* album_name, if (b_enter) { gl_dbg("Enter key pressed."); goto INVALID_ALBUM_NAME; - return -1; } if (b_new) @@ -254,18 +134,70 @@ static int _gl_ui_get_valid_album_name(void *data, char* album_name, return -1; } +#ifdef _RENAME_ALBUM_SENSITIVE +static bool __gl_ui_check_album_name_case(char *dir) +{ + GL_CHECK_FALSE(dir); + 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 (strcasecmp(dir_name, dest_filename) == 0) { + gl_dbg("Have same name directory"); + ret = true; + break; + } + free(dir_name); + } + } + return ret; +} +#endif + +static int _gl_ui_cancel_newalbum(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 */ -static int _gl_ui_newalbum_done(void *data, bool b_enter) +int _gl_ui_newalbum_done(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.imf_entry == NULL) { - gl_dbgE("Entry is NULL"); + if (ad->entryinfo.editfield == NULL) { + gl_dbgE("Edit filed is NULL"); goto NEW_ALBUM_FAILED; } @@ -284,7 +216,7 @@ static int _gl_ui_newalbum_done(void *data, bool b_enter) /* Get valid name */ if (_gl_ui_get_valid_album_name(ad, album_name, true, b_enter) != 0) { if (b_enter) - _gl_ui_hide_imf_input_panel(ad); + _gl_editfield_hide_imf(ad); return -1; } gl_dbg("Valid album name: %s", album_name); @@ -303,15 +235,21 @@ static int _gl_ui_newalbum_done(void *data, bool b_enter) snprintf(path, GL_DIR_PATH_LEN_MAX, "%s/%s", dir_path, album_name); path[strlen(path)] = '\0'; gl_dbg("New dir path: %s", path); - +#ifdef _RENAME_ALBUM_SENSITIVE + bool res = __gl_ui_check_album_name_case(path); + gl_dbg("__gl_ui_check_album_name_case : %d", res); + if (res) +#else int res = ecore_file_dir_is_empty(path); - gl_dbg("ecore_file_dir_is_empty return value: %d", res); /** * If dir is empty, 1 is returned, * if it contains at least 1 file, 0 is returned. * On failure, -1 is returned. */ - if (res == 0) { + gl_dbg("ecore_file_dir_is_empty return value: %d", res); + if (res == 0) +#endif + { char *popup_desc; popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, sizeof(char)); if (popup_desc == NULL) { @@ -333,68 +271,81 @@ static int _gl_ui_newalbum_done(void *data, bool b_enter) char* new_album = ad->albuminfo.new_album_name; g_strlcpy(new_album, album_name, GL_ALBUM_NAME_LEN_MAX); new_album[GL_ALBUM_NAME_LEN_MAX - 1] = '\0'; - gl_ui_destroy_imf(ad); - /* Move files to dest album */ + _gl_editfield_destroy_imf(ad); + + /* Move/Save files to dest album */ gl_move_to_album(ad); return 0; NEW_ALBUM_FAILED: - _gl_ui_newalbum_cancel_cb(ad, NULL, NULL); + _gl_ui_cancel_newalbum(ad); return -1; } -static void _gl_ui_newalbum_enter_cb(void *data, Evas_Object * obj, void *event_info) +static void _gl_ui_newalbum_done_cb(void *data, Evas_Object *obj, void *event_info) { gl_dbg(""); - GL_CHECK(data); - gl_appdata *ad = (gl_appdata *)data; - /* Unfocus to hide cursor */ - elm_object_focus_set(ad->entryinfo.imf_entry, FALSE); + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", _gl_ui_newalbum_done_cb); - _gl_ui_newalbum_done(data, true); + _gl_ui_newalbum_done(data, false); } -static void _gl_ui_newalbum_done_cb(void *data, Evas_Object * obj, void *event_info) +static void _gl_ui_newalbum_cancel_cb(void *data, Evas_Object *obj, void *event_info) { + GL_CHECK(data); gl_dbg(""); - _gl_ui_newalbum_done(data, false); + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + _gl_ui_newalbum_cancel_cb); + + _gl_ui_cancel_newalbum(data); } -static void -_gl_ui_newalbum_cancel_cb(void *data, Evas_Object * obj, void *event_info) +/** + * Launch camera + */ +static void __gl_ui_camera_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(data); - gl_appdata *ad = (gl_appdata *)data; gl_dbg(""); - - elm_naviframe_item_pop(ad->maininfo.navi_bar); - gl_ui_destroy_imf(ad); - gl_ui_update_select_widgets(ad); + _gl_ext_load_camera(); } -static void __gl_ui_rename_album_cancel_cb(void *data, Evas_Object * obj, void *event_info) +static int __gl_ui_cancel_rename_album(void *data) { - GL_CHECK(data); + GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - GL_CHECK(ad->maininfo.navi_bar); + GL_CHECK_VAL(ad->maininfo.naviframe, -1); gl_dbg(""); ad->albuminfo.selected_album = NULL; gl_set_view_mode(ad, GL_VIEW_ALBUMS_EDIT); /* manually popup view after rename album */ - elm_naviframe_item_pop(ad->maininfo.navi_bar); - /* Recover the previous UI */ - gl_ui_destroy_imf(ad); + elm_naviframe_item_pop(ad->maininfo.naviframe); + _gl_editfield_destroy_imf(ad); + /* Update edit view */ gl_albums_update_items(ad); - return; + return 0; +} + +static void __gl_ui_rename_album_cancel_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + __gl_ui_rename_album_cancel_cb); + + __gl_ui_cancel_rename_album(data); } /* * @param b_enter * True: Enter key on Keyboard pressed, False: Button Done clicked */ -static int __gl_ui_rename_album_done(void *data, bool b_enter) +int _gl_ui_rename_album_done(void *data, bool b_enter) { gl_dbg("b_enter: %d", b_enter); GL_CHECK_VAL(data, -1); @@ -402,7 +353,7 @@ static int __gl_ui_rename_album_done(void *data, bool b_enter) bool b_root_path = false; gl_cluster *album_item = NULL; - if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_RENAME) { + if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_RENAME) { gl_dbgE("View mode is wrong!"); goto RENAME_FAILED; } @@ -427,20 +378,18 @@ static int __gl_ui_rename_album_done(void *data, bool b_enter) /* Get valid name */ if (_gl_ui_get_valid_album_name(ad, etxt, false, b_enter) != 0) { if (b_enter) - _gl_ui_hide_imf_input_panel(ad); + _gl_editfield_hide_imf(ad); return -1; } gl_dbg("Valid album name: %s", etxt); /* Get src folder path */ - char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; - ret = gl_db_get_folder_fullpath(ad, album_item->cluster->uuid, dir_path); - if (ret < 0) { - gl_dbgE("gl_db_get_folder_fullpath failed(%d)!", ret); - goto RENAME_FAILED; - } else { - gl_dbg("Src folder: %s", dir_path); - if (gl_db_is_root_path(ad, NULL, dir_path)) { + char src_dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + if (album_item->cluster->path) { + g_strlcpy(src_dir_path, album_item->cluster->path, + GL_DIR_PATH_LEN_MAX); + gl_dbg("Src folder: %s", src_dir_path); + if (_gl_data_is_root_path(ad, src_dir_path)) { /** * Root path, couldn't rename root path, * make the new dest folder @@ -449,47 +398,53 @@ static int __gl_ui_rename_album_done(void *data, bool b_enter) 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 temp_dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + char dest_dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; if (b_root_path) { /* Get default images path, make dest foler under it */ - memset(dir_path, 0x00, GL_DIR_PATH_LEN_MAX); - if (gl_get_default_images_path(dir_path) != 0) { + char default_dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; + if (gl_get_default_images_path(default_dir_path) != 0) { gl_dbgW("Failed to get default images path!"); goto RENAME_FAILED; } - snprintf(temp_dir_path, GL_DIR_PATH_LEN_MAX, "%s/%s", dir_path, etxt); - temp_dir_path[strlen(temp_dir_path)] = '\0'; + snprintf(dest_dir_path, GL_DIR_PATH_LEN_MAX, "%s/%s", + default_dir_path, etxt); + dest_dir_path[strlen(dest_dir_path)] = '\0'; } else { int length = 0; int i = 0; - memcpy(temp_dir_path, dir_path, GL_DIR_PATH_LEN_MAX); - length = strlen(dir_path); + memcpy(dest_dir_path, src_dir_path, GL_DIR_PATH_LEN_MAX); + length = strlen(src_dir_path); for (i = length; i >= 0; i--) { - if (temp_dir_path[i] == '/') { + if (dest_dir_path[i] == '/') { gl_dbg("length=%d, i=%d", length, i); /* Path like "/root/abc/" */ if (i == length - 1) continue; - memcpy(&temp_dir_path[i + 1], etxt, + memcpy(&dest_dir_path[i + 1], etxt, strlen(etxt)); - temp_dir_path[i + 1+ strlen(etxt)] = '\0'; + dest_dir_path[i + 1+ strlen(etxt)] = '\0'; break; } } } - gl_dbg("Dest folder: %s", temp_dir_path); - /* Get selected folder path for rename */ - char rename_dir_path[GL_DIR_PATH_LEN_MAX] = { 0, }; - gl_db_get_folder_fullpath(ad, album_item->cluster->uuid, rename_dir_path); - if (!g_strcmp0(rename_dir_path, temp_dir_path)) { + gl_dbg("Dest folder: %s", dest_dir_path); +#ifdef _RENAME_ALBUM_SENSITIVE + if (!strcasecmp(src_dir_path, dest_dir_path)) +#else + if (!g_strcmp0(src_dir_path, dest_dir_path)) +#endif + { gl_dbgW("Same as current name!"); goto RENAME_FAILED; } @@ -499,7 +454,13 @@ static int __gl_ui_rename_album_done(void *data, bool b_enter) * if it contains at least 1 file, 0 is returned. * On failure, -1 is returned. */ - if (ecore_file_dir_is_empty(temp_dir_path) == 0) { +#ifdef _RENAME_ALBUM_SENSITIVE + if (__gl_ui_check_album_name_case(dest_dir_path)) +#else + if (ecore_file_dir_is_empty(dest_dir_path) == 0 || + ecore_file_dir_is_empty(dest_dir_path) == 1) +#endif + { char *popup_desc; popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, sizeof(char)); if (popup_desc == NULL) { @@ -529,21 +490,21 @@ static int __gl_ui_rename_album_done(void *data, bool b_enter) */ if (gl_make_new_album(etxt) != 0) { gl_popup_create_popup(ad, GL_POPUP_NOBUT, - GL_STR_UNABLE_TO_RENAME); + 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, temp_dir_path) != 0) { + if (gl_move_root_album(ad, album_item, dest_dir_path) != 0) { gl_dbg("gl_move_root_album failed!"); gl_popup_create_popup(ad, GL_POPUP_NOBUT, - GL_STR_UNABLE_TO_RENAME); + GL_STR_UNABLE_tO_RENAME); goto RENAME_FAILED; } else { gl_dbg("New album added, update albums list."); ad->albuminfo.selected_album = NULL; - gl_db_update_cluster_list(ad); + _gl_data_update_cluster_list(ad); } } else { /** @@ -551,10 +512,10 @@ static int __gl_ui_rename_album_done(void *data, bool b_enter) * * Update album record in DB. */ - ret = minfo_update_cluster_name(ad->maininfo.db_handle, - album_item->cluster->uuid, etxt); + media_folder_set_name(album_item->cluster->folder_h, etxt); + ret = media_folder_update_to_db(album_item->cluster->folder_h); if (ret < 0) { - gl_dbg("minfo_update_cluster_name failed (%d)!", ret); + gl_dbg("media_folder_set_name failed (%d)!", ret); goto RENAME_FAILED; } @@ -563,129 +524,35 @@ static int __gl_ui_rename_album_done(void *data, bool b_enter) * for some special name, DB update success, but file mv failed. * So, do this first. */ - if (ecore_file_mv(dir_path, temp_dir_path) == EINA_FALSE) { - gl_dbgE("ecore_file_mv failed!"); - gl_popup_create_popup(ad, GL_POPUP_NOBUT, - GL_STR_UNABLE_TO_RENAME); + if (ecore_file_exists(src_dir_path)) { + if (!ecore_file_mv(src_dir_path, dest_dir_path)) + gl_dbg("ecore_file_mv failed!"); + } else { + gl_dbgW("Source folder path doesn't exist!"); } } /* Update memory */ - if (!b_root_path) - g_strlcpy(album_item->cluster->display_name, etxt, - GL_FILE_NAME_LEN_MAX); - __gl_ui_rename_album_cancel_cb(ad, NULL, NULL); + if (!b_root_path) { + FREE_DATA(album_item->cluster->display_name); + album_item->cluster->display_name = strdup(etxt); + } + __gl_ui_cancel_rename_album(ad); return 0; RENAME_FAILED: - __gl_ui_rename_album_cancel_cb(ad, NULL, NULL); + __gl_ui_cancel_rename_album(ad); return -1; } -static void __gl_ui_rename_album_enter_cb(void *data, Evas_Object * obj, void *event_info) -{ - gl_dbg(""); - GL_CHECK(data); - gl_appdata *ad = (gl_appdata *)data; - /* Unfocus to hide cursor */ - elm_object_focus_set(ad->entryinfo.imf_entry, FALSE); - - __gl_ui_rename_album_done(data, true); -} - -static void __gl_ui_rename_album_done_cb(void *data, Evas_Object * obj, void *event_info) +static void __gl_ui_rename_album_done_cb(void *data, Evas_Object *obj, void *event_info) { gl_dbg(""); - __gl_ui_rename_album_done(data, false); -} - -static bool -_gl_ui_display_nocontents(void *data) -{ - GL_CHECK_FALSE(data); - gl_appdata *ad = (gl_appdata *)data; - bool is_video_file_existing = false; - bool is_image_file_existing = false; - int grid_view_mode = ad->gridinfo.grid_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 (grid_view_mode == GL_CTRL_SEG_VIDEOS || - grid_view_mode == GL_CTRL_SEG_IMAGES) /*only check in video or image segment. */ - { - for (i = 1; i <= cnt; i++) - { - gl_db_get_item_by_index(ad, i, false, &gitem); - if (gitem == NULL || gitem->item == NULL) - { - gl_dbg("gitem == NULL || gitem->item == NULL"); - continue; - } - - if (grid_view_mode == GL_CTRL_SEG_VIDEOS && - !is_video_file_existing && - gitem->item->type == MINFO_ITEM_VIDEO) - { - is_video_file_existing = true; - break; - } - else if (grid_view_mode == GL_CTRL_SEG_IMAGES - && !is_image_file_existing && - gitem->item->type == MINFO_ITEM_IMAGE) - { - is_image_file_existing = true; - break; - } - - } - - gl_dbg("video file exists->%d, image file exists->%d", - is_video_file_existing, is_image_file_existing); - if (grid_view_mode == GL_CTRL_SEG_VIDEOS && !is_video_file_existing) - { - if (view_mode == GL_VIEW_VIDEOLIST_EDIT) - { - gl_dbg("In edit mode, back to normal view."); - gl_ui_edit_cancel(ad); - } - - gl_dbg("None video files, show nocontents..."); - ret = true; - } - else if (grid_view_mode == GL_CTRL_SEG_IMAGES && !is_image_file_existing) - { - if (view_mode == GL_VIEW_THUMBS_EDIT) - { - gl_dbg("In edit mode, back to normal view."); - gl_ui_edit_cancel(ad); - } - - gl_dbg("None image files, show nocontents..."); - Evas_Object *noc = gl_ui_create_nocontents_full(ad); - if (ad->gridinfo.image_view) - { - evas_object_del(ad->gridinfo.image_view); - ad->gridinfo.image_view = NULL; - } - ad->gridinfo.image_view = noc; - ad->gridinfo.image_nocontents = noc; - elm_object_part_content_unset(ad->gridinfo.layout, "elm.swallow.view"); - evas_object_hide(ad->listinfo.video_view); - evas_object_hide(ad->gridinfo.all_view); - evas_object_show(ad->gridinfo.image_view); - elm_object_part_content_set(ad->gridinfo.layout, - "elm.swallow.view", ad->gridinfo.image_view); - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_THUMBS, false); - ret = true; - } - } - return ret; + /* Delete callback when it is clicked to prevent it is called for many times */ + evas_object_smart_callback_del(obj, "clicked", + __gl_ui_rename_album_done_cb); + _gl_ui_rename_album_done(data, false); } - /* Select-all checkbox selected/deselected */ static void _gl_ui_selall_check_changed(void *data, Evas_Object *obj, void *event_info) @@ -703,46 +570,98 @@ static void _gl_ui_selall_check_changed(void *data, Evas_Object *obj, Eina_Bool state = EINA_FALSE; state = elm_check_state_get(obj); gl_dbg("Checkbox state: %d.", state); - /* Get all medias count of current album */ - item_cnt = ad->maininfo.medias_cnt; - sel_all_cnt = item_cnt; - gl_ctrl_seg_mode seg_mode = ad->albuminfo.seg_mode; - minfo_file_type file_type = MINFO_ITEM_NONE; - if (view_mode == GL_VIEW_THUMBS_EDIT) - { - if (seg_mode == GL_CTRL_SEG_IMAGES) + + 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->albuminfo.edit_view); + last_it = elm_gengrid_last_item_get(ad->albuminfo.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; + } + /* 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); + /* Update selected album count */ + sel_all_cnt++; + + 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; + } + } else { + /* Get all medias count of current album */ + item_cnt = ad->maininfo.medias_cnt; + sel_all_cnt = item_cnt; + gl_ctrl_seg_mode seg_mode = ad->maininfo.seg_mode; + media_content_type_e file_type = MEDIA_CONTENT_TYPE_IMAGE; + if (view_mode == GL_VIEW_THUMBS_EDIT) { - file_type = MINFO_ITEM_IMAGE; - sel_all_cnt = 0; + if (seg_mode == GL_CTRL_SEG_IMAGES) + { + file_type = MEDIA_CONTENT_TYPE_IMAGE; + sel_all_cnt = 0; + } + else if (seg_mode == GL_CTRL_SEG_VIDEOS) + { + file_type = MEDIA_CONTENT_TYPE_VIDEO; + sel_all_cnt = 0; + } } - else if (seg_mode == GL_CTRL_SEG_VIDEOS) + else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { - file_type = MINFO_ITEM_VIDEO; + file_type = MEDIA_CONTENT_TYPE_VIDEO; sel_all_cnt = 0; } - } - else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) - { - file_type = MINFO_ITEM_VIDEO; - sel_all_cnt = 0; - } - gl_dbg("seg_mode=%d", seg_mode); - for (i = 0; i < item_cnt; i++) - { - gl_db_get_item_by_index(ad, i + 1, false, ¤t); - GL_CHECK(current); - GL_CHECK(current->item); - - if (current->checked == state && seg_mode == GL_CTRL_SEG_ALL) + gl_dbg("seg_mode=%d", seg_mode); + for (i = 0; i < item_cnt; i++) { - continue; - } + _gl_data_get_item_by_index(ad, i + 1, false, ¤t); + GL_CHECK(current); + GL_CHECK(current->item); - if (view_mode == GL_VIEW_THUMBS_EDIT) - { - if ((seg_mode == GL_CTRL_SEG_IMAGES) || - (seg_mode == GL_CTRL_SEG_VIDEOS)) + if (current->checked == state && seg_mode == GL_CTRL_SEG_ALL) + { + continue; + } + + if (view_mode == GL_VIEW_THUMBS_EDIT) + { + if ((seg_mode == GL_CTRL_SEG_IMAGES) || + (seg_mode == GL_CTRL_SEG_VIDEOS)) + { + if (current->item->type != file_type) + { + continue; + } + + sel_all_cnt++; + if (current->checked == state) + { + continue; + } + } + } + else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { if (current->item->type != file_type) { @@ -755,31 +674,18 @@ static void _gl_ui_selall_check_changed(void *data, Evas_Object *obj, continue; } } - } - else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) - { - if (current->item->type != file_type) - { - continue; - } - - sel_all_cnt++; - if (current->checked == state) - { - continue; - } - } - current->checked = state; + current->checked = state; - if (view_mode == GL_VIEW_THUMBS_EDIT) - elm_gengrid_item_update(current->elm_item); + if (view_mode == GL_VIEW_THUMBS_EDIT) + elm_gengrid_item_update(current->elm_item); - if (state == EINA_TRUE) - gl_db_selected_list_append(ad, current); - else - gl_db_selected_list_remove(ad, current); + if (state == EINA_TRUE) + _gl_data_selected_list_append(ad, current); + else + _gl_data_selected_list_remove(ad, current); + } } /* Update all realized items */ @@ -789,9 +695,16 @@ static void _gl_ui_selall_check_changed(void *data, Evas_Object *obj, /* Recreate selection info for both cases */ if (state == EINA_FALSE) sel_all_cnt = 0; - gl_ui_create_selinfo(ad, ad->gridinfo.edit_layout, - ad->gridinfo.nf_it_edit, item_cnt, - sel_all_cnt, false); + + if (view_mode == GL_VIEW_ALBUMS_EDIT) { + _gl_notify_create_selinfo(ad, ad->albuminfo.edit_layout, + ad->albuminfo.nf_it_edit, item_cnt, + sel_all_cnt, false); + } else { + _gl_notify_create_selinfo(ad, ad->gridinfo.edit_layout, + ad->gridinfo.nf_it_edit, item_cnt, + sel_all_cnt, false); + } } /* Select-all background click, selected/deselected checkbox */ @@ -808,6 +721,9 @@ static void _gl_ui_selall_bg_click_cb(void *data, Evas_Object *o, if (view_mode == GL_VIEW_THUMBS_EDIT || view_mode == GL_VIEW_VIDEOLIST_EDIT) { ly = ad->gridinfo.edit_layout; + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + /* in Albums view */ + ly = ad->albuminfo.edit_layout; } else { gl_dbgE("Wrong view!"); return; @@ -829,53 +745,47 @@ static void _gl_ui_selall_bg_click_cb(void *data, Evas_Object *o, } } - -static void -_gl_ui_edit_cancel_cb(void *data, Evas_Object * obj, void *event_info) +static int __gl_ui_cancel_edit(void *data) { - GL_CHECK(data); + GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; int view_mode = gl_get_view_mode(ad); gl_dbg(""); if (view_mode == GL_VIEW_ALBUMS_EDIT) { - if (ad->albuminfo.edit_view) - { - evas_object_del(ad->albuminfo.edit_view); - ad->albuminfo.edit_view = NULL; - ad->albuminfo.edit_layout = NULL; - } + _gl_destroy_albums_edit_view(ad); - gl_db_finalize_albums_selected_list(ad); + _gl_data_finalize_albums_selected_list(ad); /** * after back to albums view from albums edit view, * option header should be defaultly closed */ - gl_db_get_cluster_list(ad); - GL_CHECK(ad->albuminfo.cluster_list); + _gl_data_get_cluster_list(ad); + GL_CHECK_VAL(ad->albuminfo.cluster_list, -1); gl_albums_change_to_view(ad); - gl_ui_destroy_selinfo(ad); + _gl_notify_destroy_selinfo(ad); if (gl_check_gallery_empty(ad)) { - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - false); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + false); } else { if (ad->albuminfo.cluster_list->edit_cnt == 0) { gl_dbg("None editable albums, disable items."); - gl_ui_disable_toolbar_item(ad, true, - GL_NAVI_ALBUMS, - false); + _gl_ctrl_disable_toolbar_item(ad, true, + GL_NAVI_ALBUMS, + false); } } } else if (view_mode == GL_VIEW_THUMBS_EDIT) { _gl_destroy_thumbs_edit_view(ad); - gl_db_selected_list_finalize(ad); + _gl_data_selected_list_finalize(ad); gl_set_view_mode(ad, GL_VIEW_THUMBS); + if (ad->albuminfo.update_albums_list) { /* @@ -886,13 +796,12 @@ _gl_ui_edit_cancel_cb(void *data, Evas_Object * obj, void *event_info) } gl_grid_change_to_view(ad); - gl_ui_destroy_selinfo(ad); - } - else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) - { + _gl_notify_destroy_selinfo(ad); + } else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { _gl_destroy_thumbs_edit_view(ad); - gl_db_selected_list_finalize(ad); + _gl_data_selected_list_finalize(ad); gl_set_view_mode(ad, GL_VIEW_VIDEOLIST); + if (ad->albuminfo.update_albums_list) { /* @@ -903,8 +812,9 @@ _gl_ui_edit_cancel_cb(void *data, Evas_Object * obj, void *event_info) } gl_list_change_to_view(ad); - gl_ui_destroy_selinfo(ad); + _gl_notify_destroy_selinfo(ad); } + return 0; } /* callback after user tap Cancel button in option header in edit view */ @@ -913,100 +823,174 @@ static void __gl_ui_click_cancel_edit_cb(void *data, Evas_Object *obj, void *eve GL_CHECK(data); GL_CHECK(obj); gl_appdata *ad = (gl_appdata *)data; - elm_naviframe_item_pop(ad->maininfo.navi_bar); - _gl_ui_edit_cancel_cb(data, obj, event_info); + + /* Disable item when it is clicked to prevent it is called for many times */ + _gl_ctrl_disable_item((Elm_Object_Item *)event_info); + + elm_naviframe_item_pop(ad->maininfo.naviframe); + +#ifdef _USE_ROTATE_BG + ad->gridinfo.left_btn = NULL; + ad->gridinfo.right_btn = NULL; + ad->gridinfo.more_btn = NULL; +#endif + __gl_ui_cancel_edit(data); return; } -static void -_gl_ui_edit_cb(void *data, Evas_Object * obj, void *event_info) +static 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.append_idler) - { + 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."); + gl_dbgW("UG invoked or appending gridview!"); return; } int view_mode = gl_get_view_mode(ad); 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 */ + if (view_mode == GL_VIEW_THUMBS_EDIT) { /** * Happen in quickly tap edit button, * it will invoke _gl_ui_edit_cb several time * and push some unuseful views. */ - gl_dbg("Already in edit mode, return."); + gl_dbgW("Already in edit mode, return!"); return; } - gl_ui_destroy_notiinfo(ad); + _gl_notify_destroy_notiinfo(ad); - if (view_mode == GL_VIEW_ALBUMS) - { + Evas_Object *layout = NULL; + Evas_Object *view = NULL; + + if (view_mode == GL_VIEW_ALBUMS) { gl_set_view_mode(ad, GL_VIEW_ALBUMS_EDIT); - ad->albuminfo.edit_layout = gl_ui_create_view_ly(ad->maininfo.navi_bar); - ad->albuminfo.edit_view = gl_albums_create_view(ad, ad->albuminfo.edit_layout); - elm_object_part_content_set(ad->albuminfo.edit_layout, - "elm.swallow.view", - ad->albuminfo.edit_view); - edje_object_signal_emit(_EDJ(ad->albuminfo.edit_layout), - "elm,swallow_view,state,default", "elm"); - gl_ui_create_title_and_push(ad, ad->maininfo.navi_bar, - ad->albuminfo.edit_layout, + layout = _gl_ui_create_view_ly(ad->maininfo.naviframe); + GL_CHECK(layout); + 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->albuminfo.edit_layout = layout; + + view = gl_albums_create_view(ad, layout); + ad->albuminfo.edit_view = view; + + edje_object_signal_emit(_EDJ(layout), + "elm,swallow_view,state,edit", "elm"); + + gl_ui_create_title_and_push(ad, ad->maininfo.naviframe, layout, GL_NAVI_ALBUMS_EDIT, GL_STR_SELECT_ALBUM); + + elm_object_part_content_set(layout, "elm.swallow.view", view); + /* Display 'Select all' widget */ + gl_ui_show_selall(ad); + + gl_dbg("Done"); return; } - else if (view_mode == GL_VIEW_THUMBS) - { + + layout = _gl_ui_create_view_ly(ad->maininfo.naviframe); + GL_CHECK(layout); + 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.edit_layout = layout; + + if (view_mode == GL_VIEW_THUMBS) { gl_set_view_mode(ad, GL_VIEW_THUMBS_EDIT); if (ad->gridinfo.grid_view_mode == GL_GRID_ALL) - ad->gridinfo.edit_view = gl_grid_create_view(ad, - ad->maininfo.navi_bar, - GL_GRID_ALL); + view = _gl_grid_create_view(ad, layout, + GL_GRID_ALL, + false); else - ad->gridinfo.edit_view = gl_grid_create_view(ad, - ad->maininfo.navi_bar, - GL_GRID_IMAGES); - } - else if (view_mode == GL_VIEW_VIDEOLIST) - { + view = _gl_grid_create_view(ad, layout, + GL_GRID_IMAGES, + false); + } else if (view_mode == GL_VIEW_VIDEOLIST) { gl_set_view_mode(ad, GL_VIEW_VIDEOLIST_EDIT); - ad->gridinfo.edit_view = gl_list_create_view(ad, ad->maininfo.navi_bar); + view = gl_list_create_view(ad, layout); + } + + if (view == NULL) { + gl_dbgE("View creation failed!"); + evas_object_del(layout); + ad->gridinfo.edit_layout = NULL; + return; } - ad->gridinfo.edit_layout = gl_ui_create_view_ly(ad->maininfo.navi_bar); - evas_object_size_hint_weight_set(ad->gridinfo.edit_layout, - EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ad->gridinfo.edit_layout, - EVAS_HINT_FILL, EVAS_HINT_FILL); + ad->gridinfo.edit_view = view; + + elm_object_part_content_set(layout, "elm.swallow.view", view); - elm_object_part_content_set(ad->gridinfo.edit_layout, - "elm.swallow.view", ad->gridinfo.edit_view); - gl_ui_create_title_and_push(ad, ad->maininfo.navi_bar, - ad->gridinfo.edit_layout, + gl_ui_create_title_and_push(ad, ad->maininfo.naviframe, layout, GL_NAVI_THUMBS_EDIT, GL_STR_SELECT_ITEM); - edje_object_signal_emit(_EDJ(ad->gridinfo.edit_layout), - "elm,swallow_view,state,thumb_edit_default", + edje_object_signal_emit(_EDJ(layout), "elm,swallow_view,state,edit", "elm"); gl_ui_show_selall(ad); gl_dbg("Done"); } -/* move media to album in edit view */ -int gl_ui_move_media_to_album(gl_appdata *ad) +static void _gl_ui_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_dbg("UG or APP is already loaded, return."); + return; + } + + int view_mode = gl_get_view_mode(ad); + int cnt = 0; + if ((view_mode == GL_VIEW_THUMBS_EDIT) || + (view_mode == GL_VIEW_VIDEOLIST_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; + } + + gl_popup_create_title_popup(ad, GL_POPUP_THUMB_SHARE, + GL_STR_SHARE, NULL); + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + cnt = _gl_data_get_albums_selected_cnt(ad); + if (cnt == 0) { + gl_dbg("No albums selected, return!"); + 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_dbg("No thumbs selected, return!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_FILES_SELECTED); + return; + } + + gl_popup_create_title_popup(ad, GL_POPUP_ALBUM_SHARE, + GL_STR_SHARE, NULL); + } else { + gl_dbgE("Unknow mode!"); + } +} + +/* move media to album in edit view */ +int gl_ui_move_media_to_album(gl_appdata *ad) { GL_CHECK_VAL(ad, -1); int view_mode = gl_get_view_mode(ad); @@ -1022,7 +1006,7 @@ int gl_ui_move_media_to_album(gl_appdata *ad) (view_mode == GL_VIEW_VIDEOLIST_EDIT)) { - int cnt = gl_db_selected_list_count(ad); + int cnt = _gl_data_selected_list_count(ad); if (cnt == 0) { gl_dbg("No thumbs selected, return!"); @@ -1042,8 +1026,7 @@ int gl_ui_move_media_to_album(gl_appdata *ad) } } -static void -_gl_ui_medias_del_cb(void *data, Evas_Object * obj, void *event_info) +static void _gl_ui_medias_del_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(data); gl_appdata *ad = (gl_appdata *)data; @@ -1057,9 +1040,8 @@ _gl_ui_medias_del_cb(void *data, Evas_Object * obj, void *event_info) int view_mode = gl_get_view_mode(ad); if ((view_mode == GL_VIEW_THUMBS_EDIT) || - (view_mode == GL_VIEW_VIDEOLIST_EDIT)) - { - int cnt = gl_db_selected_list_count(ad); + (view_mode == GL_VIEW_VIDEOLIST_EDIT)) { + int cnt = _gl_data_selected_list_count(ad); if (cnt == 0) { gl_dbg("No thumbs selected, return!"); @@ -1068,15 +1050,12 @@ _gl_ui_medias_del_cb(void *data, Evas_Object * obj, void *event_info) } gl_del_medias(ad); - } - else - { - gl_dbg("Unknow mode!"); + } else { + gl_dbgW("Unknow mode!"); } } -static void -_gl_ui_albums_del_cb(void *data, Evas_Object * obj, void *event_info) +static void _gl_ui_albums_del_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(data); gl_appdata *ad = (gl_appdata *)data; @@ -1084,7 +1063,7 @@ _gl_ui_albums_del_cb(void *data, Evas_Object * obj, void *event_info) if ((gl_get_view_mode(ad) == GL_VIEW_ALBUMS_EDIT)) { - int cnt = gl_db_get_albums_selected_cnt(ad); + int cnt = _gl_data_get_albums_selected_cnt(ad); if (cnt == 0) { gl_dbg("No albums selected, return!"); @@ -1100,82 +1079,10 @@ _gl_ui_albums_del_cb(void *data, Evas_Object * obj, void *event_info) } } -static void -_gl_ui_notiinfo_destroy_cb(void *data, Evas_Object * obj, void *event_info) -{ - GL_CHECK(data); - gl_appdata *ad = (gl_appdata *)data; - gl_dbg(""); - - gl_ui_destroy_notiinfo(ad); -} - -static int _gl_ui_enable_toolbar_items(gl_appdata *ad, Elm_Object_Item *nf_it) -{ - GL_CHECK_VAL(ad, -1); - GL_CHECK_VAL(nf_it, -1); - - Elm_Object_Item *cbar_it = NULL; - Evas_Object *ctlbar = _gl_ctrl_get_toolbar(nf_it); - GL_CHECK_VAL(ctlbar, -1); - cbar_it = elm_toolbar_first_item_get(ctlbar); - while (cbar_it) { - gl_ui_enable_cbar_item(cbar_it); - cbar_it = elm_toolbar_item_next_get(cbar_it); - } - - return 0; -} - -static int _gl_ui_disable_toolbar_item(void *data, gl_navi_mode mode, bool edit) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - - if (mode == GL_NAVI_ALBUMS) { - gl_dbg("GL_NAVI_ALBUMS"); - /* disable 'edit' item */ - gl_ui_disable_cbar_item(ad->albuminfo.edit_it); - }else if (mode == GL_NAVI_THUMBS) { - gl_dbg("GL_NAVI_THUMBS"); - /* disable 'edit' item */ - gl_ui_disable_cbar_item(ad->gridinfo.edit_it); - } else { - gl_dbgE("Unkonw mode"); - return -1; - } - return 0; -} - -static int _gl_ui_enable_toolbar_item(void *data, gl_navi_mode 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) - gl_ui_enable_cbar_item(ad->albuminfo.edit_it); - else - gl_ui_disable_cbar_item(ad->albuminfo.edit_it); - } else if (mode == GL_NAVI_THUMBS) { - gl_dbg("GL_NAVI_THUMBS"); - /* enable 'edit' item */ - gl_ui_enable_cbar_item(ad->gridinfo.edit_it); - } else { - gl_dbgE("Unkonw mode"); - return -1; - } - - return 0; -} - /** * Update checkbox state in select-all widget */ -static int _gl_ui_update_selall(void *data, int all_cnt, int selected_cnt) +int _gl_ui_update_selall(void *data, int all_cnt, int selected_cnt) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; @@ -1184,31 +1091,36 @@ static int _gl_ui_update_selall(void *data, int all_cnt, int selected_cnt) int _all_cnt = 0; int db_all_cnt = 0; gl_ctrl_seg_mode ctl_seg = GL_CTRL_SEG_ALL; - minfo_file_type file_type = MINFO_ITEM_NONE; + 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 || view_mode == GL_VIEW_VIDEOLIST_EDIT) { /* Get all medias count */ db_all_cnt = ad->maininfo.medias_cnt; - ctl_seg = ad->albuminfo.seg_mode; + ctl_seg = ad->maininfo.seg_mode; if (ctl_seg == GL_CTRL_SEG_ALL) { _all_cnt = db_all_cnt; } else { /* Get all count in diff segments */ if (ctl_seg == GL_CTRL_SEG_IMAGES) - file_type = MINFO_ITEM_IMAGE; + file_type = MEDIA_CONTENT_TYPE_IMAGE; else if (ctl_seg == GL_CTRL_SEG_VIDEOS) - file_type = MINFO_ITEM_VIDEO; + file_type = MEDIA_CONTENT_TYPE_VIDEO; for (i = 1; i <= db_all_cnt; i++) { - gl_db_get_item_by_index(ad, i, false, - &gitem); + _gl_data_get_item_by_index(ad, i, false, &gitem); if (gitem && gitem->item && (gitem->item->type == file_type)) _all_cnt++; } } + + ly = ad->gridinfo.edit_layout; + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + _all_cnt = ad->albuminfo.albums_cnt; + ly = ad->albuminfo.edit_layout; } else { gl_dbg("Wrong view mode!"); return 0; @@ -1219,160 +1131,165 @@ static int _gl_ui_update_selall(void *data, int all_cnt, int selected_cnt) * except in albums edit view and selectioninfo view */ gl_dbg("selected_cnt/_all_cnt = %d/%d", selected_cnt, _all_cnt); - Evas_Object *ly = NULL; Evas_Object *check = NULL; Eina_Bool state = EINA_FALSE; - - if (selected_cnt == _all_cnt) { - /* Set checkbox checked */ + /* Set checkbox checked/unchecked */ + if (selected_cnt == _all_cnt) state = EINA_TRUE; - } else { - /* Set checkbox unchecked */ + else state = EINA_FALSE; - } - ly = ad->gridinfo.edit_layout; check = elm_object_part_content_get(ly, "selectall_check"); if (check) elm_check_state_set(check, state); - else - return -1; + return 0; +} +int _gl_ui_hide_back_button(Elm_Object_Item *nf_it) +{ + GL_CHECK_VAL(nf_it, -1); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_PREB_BTN, NULL); return 0; } -/** -* Update selectioinfo widget and view related to it -*/ -static int _gl_ui_update_view_selinfo(void *data, int selected_cnt) +static void __gl_ui_move_cb(void *data, Evas_Object *obj, void *event_info) { - GL_CHECK_VAL(data, -1); + GL_CHECK(data); + gl_ui_move_media_to_album(data); + return; +} + +/* pause gallery and change view to background after tap Back button in albums view */ +static void __gl_ui_change_to_background_cb(void *data, Evas_Object * obj, void *event_info) +{ + GL_CHECK(data); gl_appdata *ad = (gl_appdata *)data; - Evas_Object *sel_edj = NULL; - const char *emis = NULL; - Evas_Object *v_edj = NULL; - const char *v_emis = NULL; - int view_mode = gl_get_view_mode(ad); + GL_CHECK(ad->maininfo.win); - sel_edj = _EDJ(ad->popupinfo.selinfo_ly); - - if (selected_cnt > 0) { - if (view_mode == GL_VIEW_THUMBS_EDIT || - view_mode == GL_VIEW_VIDEOLIST_EDIT) { - v_edj = _EDJ(ad->gridinfo.edit_layout); - v_emis = "elm,swallow_view,state,moveup_view"; - } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { - emis = "elm,selectioninfo,portrait"; - v_emis = "elm,swallow_view,state,moveup_albums_default"; - v_edj = _EDJ(ad->albuminfo.edit_layout); - } - /* Set selectioninfo widget style */ - edje_object_signal_emit(sel_edj, emis, "elm"); - /* Move view up while selectioninfo shown. */ - edje_object_signal_emit(v_edj, v_emis, "elm"); - } else { - if (view_mode == GL_VIEW_THUMBS_EDIT || - view_mode == GL_VIEW_VIDEOLIST_EDIT) { - v_edj = _EDJ(ad->gridinfo.edit_layout); - v_emis = "elm,swallow_view,state,thumb_edit_default"; - } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { - v_edj = _EDJ(ad->albuminfo.edit_layout); - v_emis = "elm,swallow_view,state,default"; - } - /* Restore view while selectioninfo vanished. */ - edje_object_signal_emit(v_edj, v_emis, "elm"); - } - return 0; + gl_dbg("Back button clicked, change view to background."); + Evas_Object *win = (Evas_Object *) (ad->maininfo.win); + + /*Fix core dump. When gallery is launching , quick click back button before + *album items show, occur core dump. So before pause gallery, set text_get + *and content_get to NULL to stop show album items + */ + ad->albuminfo.albumgic.func.text_get = NULL; + ad->albuminfo.albumgic.func.content_get = NULL; + + ad->albuminfo.albumgic_blue.func.text_get = NULL; + ad->albuminfo.albumgic_blue.func.content_get = NULL; + + elm_win_lower(win); + + return; } /** -* Create a new notify widget -* b_selinfo, True: Create selectioninfo, False: Create notificationinfo. -*/ -static int _gl_ui_add_notify(void *data, Evas_Object *parent, bool b_selinfo) + * When push albums view for the first time, albums list is empty. + * After albums list got from DB then update edit item state. + */ +static int __gl_ui_add_toolbar_items_albums(void *data, Evas_Object *bot_bar) { - gl_dbg("b_selinfo: %d.", b_selinfo); - GL_CHECK_VAL(parent, -1); + gl_dbg(""); + GL_CHECK_VAL(bot_bar, -1); GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *edit_it = NULL; + Elm_Object_Item *camera_it = NULL; - if (b_selinfo) - gl_ui_destroy_selinfo(ad); - else - gl_ui_destroy_notiinfo(ad); + /* add 'Camera' item */ + camera_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_CAMERA, + NULL, __gl_ui_camera_cb, ad); + ad->albuminfo.camera_it = camera_it; + + _gl_ctrl_append_object_item(bot_bar, NULL); + /* add edit item */ + edit_it = _gl_ui_append_edit(ad, bot_bar); + _gl_ctrl_enable_item(edit_it); + + ad->albuminfo.edit_it = edit_it; + + _gl_ctrl_append_object_item(bot_bar, NULL); + + _gl_ctrl_enable_item(edit_it); - ad->popupinfo.selinfo = elm_notify_add(parent); - elm_notify_orient_set(ad->popupinfo.selinfo, - ELM_NOTIFY_ORIENT_BOTTOM); - evas_object_size_hint_weight_set(ad->popupinfo.selinfo, - EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(ad->popupinfo.selinfo, - EVAS_HINT_FILL, - EVAS_HINT_FILL); - - ad->popupinfo.selinfo_ly = elm_layout_add(parent); - /* Set custom theme to notify layout */ - elm_layout_theme_set(ad->popupinfo.selinfo_ly, "standard", - "selectioninfo", - "selectioninfo_viewer"); - - 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); - /* Set the content of the notify widget */ - elm_object_content_set(ad->popupinfo.selinfo, - ad->popupinfo.selinfo_ly); - - if (!b_selinfo) { - /* Add callbacks for notificationinfo */ - evas_object_smart_callback_add(ad->popupinfo.selinfo, - "timeout", - _gl_ui_notiinfo_destroy_cb, - ad); - elm_notify_timeout_set(ad->popupinfo.selinfo, 2); - } else { - /* Add callbacks for selectioninfo */ - evas_object_smart_callback_add(ad->popupinfo.selinfo, - "timeout", - _gl_ui_selinfo_destroy_cb, ad); - elm_notify_timeout_set(ad->popupinfo.selinfo, 3); - } return 0; } -static void __gl_ui_move_cb(void *data, Evas_Object *obj, void *event_info) +#ifdef _USE_ROTATE_BG +static void __gl_ui_rotate_left_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(data); - gl_ui_move_media_to_album(data); - return; + _gl_rotate_images(data, true); } -/* pause gallery and change view to background after tap Back button in albums view */ -static void __gl_ui_change_to_background_cb(void *data, Evas_Object * obj, void *event_info) +static void __gl_ui_rotate_right_cb(void *data, Evas_Object *obj, void *event_info) { - gl_dbg("Back button clicked, change view to background."); GL_CHECK(data); - Evas_Object *win = (Evas_Object *) data; - elm_win_lower(win); - return; + _gl_rotate_images(data, false); } -static int __gl_ui_append_object_item(Evas_Object *cbar, Evas_Object *object) +static Evas_Object *__gl_ui_add_optionheader(void *data, Evas_Object *parent) { - Elm_Object_Item *item = elm_toolbar_item_append(cbar, NULL, NULL, NULL, - NULL); - if (object) - elm_object_item_part_content_set(item, "object", object); - else + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *oh = NULL; + oh = _gl_ctrl_add_optionheader(parent); + + /* OptionHeader Button left */ + Evas_Object *btn = NULL; + btn = _gl_but_create_but(oh, GL_BUT_ROTATE_LEFT, + GL_BUTTON_STYLE_NAVI_CTRL); + evas_object_smart_callback_add(btn, "clicked", __gl_ui_rotate_left_cb, + data); + _gl_ctrl_append_object_item(oh, btn); + ad->gridinfo.left_btn = btn; + + /* OptionHeader Button right */ + btn = _gl_but_create_but(oh, GL_BUT_ROTATE_RIGHT, + GL_BUTTON_STYLE_NAVI_CTRL); + evas_object_smart_callback_add(btn, "clicked", __gl_ui_rotate_right_cb, + data); + _gl_ctrl_append_object_item(oh, btn); + ad->gridinfo.right_btn= btn; + + return oh; +} +static void __gl_ui_more_btn_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + Elm_Object_Item *nf_it = (Elm_Object_Item *)data; + _gl_ui_open_optionheader(data, !(int)elm_object_item_data_get(nf_it)); +} - elm_object_item_disabled_set(item, EINA_TRUE); +static int __gl_ui_add_more_btn(void *data, Elm_Object_Item *nf_it, Evas_Object *parent) +{ + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(nf_it, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *more_btn = NULL; + + more_btn = _gl_but_create_but(parent, GL_BUT_NONE, + GL_BUTTON_STYLE_NAVI_MORE); + evas_object_smart_callback_add(more_btn, "clicked", __gl_ui_more_btn_cb, + nf_it); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_MORE_BTN, + more_btn); + ad->gridinfo.more_btn = more_btn; + elm_object_disabled_set(more_btn, true); + + Evas_Object *optionheader = __gl_ui_add_optionheader(data, parent); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_OPTIONHEAD, + optionheader); + elm_object_item_signal_emit(nf_it, + "elm,state,optionheader,instant_close", ""); + elm_object_item_data_set(nf_it, (void *)GL_UI_MORE_STATE_CLOSE); return 0; } +#endif + static void __gl_ui_trans_finished_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(data); @@ -1382,23 +1299,60 @@ static void __gl_ui_trans_finished_cb(void *data, Evas_Object *obj, void *event_ evas_object_smart_callback_del(obj, GL_TRANS_FINISHED, __gl_ui_trans_finished_cb); - if (view_mode == GL_VIEW_ALBUMS_EDIT) { + /* Clear previous view after animation finished */ + if (view_mode == GL_VIEW_THUMBS) { elm_gengrid_clear(ad->albuminfo.view); - } else if (view_mode == GL_VIEW_ALBUMS_RENAME) { - elm_gengrid_clear(ad->albuminfo.edit_view); } else if (view_mode == GL_VIEW_THUMBS_EDIT) { if (ad->entryinfo.entry_mode != GL_ENTRY_NONE) return; - if (ad->albuminfo.seg_mode == GL_CTRL_SEG_ALL) + if (ad->maininfo.seg_mode == GL_CTRL_SEG_ALL) elm_gengrid_clear(ad->gridinfo.all_view); - else if (ad->albuminfo.seg_mode == GL_CTRL_SEG_IMAGES) - elm_gengrid_clear(ad->gridinfo.image_view); + else if (ad->maininfo.seg_mode == GL_CTRL_SEG_IMAGES) + elm_gengrid_clear(ad->gridinfo.images_view); } else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { if (ad->entryinfo.entry_mode != GL_ENTRY_NONE) return; - elm_genlist_clear(ad->listinfo.video_view); + elm_genlist_clear(ad->listinfo.videos_view); + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + elm_gengrid_clear(ad->albuminfo.view); + } else if (view_mode == GL_VIEW_ALBUMS_RENAME) { + elm_gengrid_clear(ad->albuminfo.edit_view); } } +static void __gl_ui_slideshow_btn_cb(void *data, Evas_Object *obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + gl_item *cur_item = NULL; + + media_content_type_e type = MEDIA_CONTENT_TYPE_IMAGE; + + if (ad->maininfo.seg_mode == GL_CTRL_SEG_VIDEOS) + type = MEDIA_CONTENT_TYPE_VIDEO; + else if (ad->maininfo.seg_mode == GL_CTRL_SEG_IMAGES) + type = MEDIA_CONTENT_TYPE_IMAGE; + + _gl_data_get_first_item(ad, type, &cur_item); + GL_CHECK(cur_item); + gl_ext_load_iv_ug(ad, cur_item, GL_UG_IV_SLIDESHOW_LOCAL); +} + +static int __gl_ui_add_slideshow_btn(void *data, Elm_Object_Item *nf_it, Evas_Object *parent) +{ + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(nf_it, -1); + GL_CHECK_VAL(data, -1); + Evas_Object *slideshow_btn = NULL; + + slideshow_btn = _gl_but_create_but(parent, GL_BUT_NONE, + GL_BUTTON_STYLE_NAVI_SLIDESHOW); + GL_CHECK_VAL(slideshow_btn, -1); + evas_object_smart_callback_add(slideshow_btn, "clicked", + __gl_ui_slideshow_btn_cb, data); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_RIGHT_BTN, + slideshow_btn); + return 0; +} /** * Use naviframe api to push albums view to stack. @@ -1413,45 +1367,37 @@ static int __gl_ui_push_view_albums(void *data, Evas_Object *parent, GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; Elm_Object_Item *nf_it = NULL; - Elm_Object_Item *edit_it = NULL; - Elm_Object_Item *add_it = NULL; Evas_Object *end_btn = NULL; Evas_Object *bot_bar = NULL; /* create tool controlbar downside */ - bot_bar = _gl_ctrl_create_toolbar(ad, obj); + bot_bar = _gl_ctrl_create_toolbar(obj); GL_CHECK_VAL(bot_bar, -1); - /* add edit item */ - edit_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_EDIT, NULL, - _gl_ui_edit_cb, ad); - ad->albuminfo.edit_it = edit_it; - gl_ui_enable_cbar_item(edit_it); - __gl_ui_append_object_item(bot_bar, NULL); - __gl_ui_append_object_item(bot_bar, NULL); + + /* add items */ + __gl_ui_add_toolbar_items_albums(ad, bot_bar); /** * 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(obj, GL_BUT_NONE, GL_BUTTON_STYLE_NAVI_PRE); + end_btn = _gl_but_create_but(parent, GL_BUT_NONE, + GL_BUTTON_STYLE_NAVI_PRE); evas_object_smart_callback_add(end_btn, "clicked", __gl_ui_change_to_background_cb, - ad->maininfo.win); - - /* Disable items in exit mode */ - if (ad->maininfo.app_exit_mode) { - gl_ui_disable_cbar_item(edit_it); - gl_ui_disable_cbar_item(add_it); - } + ad); /* Push view to stack */ - nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, NULL); + gl_dbg_launch(" elm_naviframe_item_push:start"); + nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, + NULL); + gl_dbg_launch(" elm_naviframe_item_push:end"); ad->albuminfo.nf_it = nf_it; + /* Set tool controlbar to bottom */ - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR, - bot_bar); + elm_object_item_part_content_set(ad->albuminfo.nf_it, + GL_NAVIFRAME_CONTROLBAR, bot_bar); return 0; } @@ -1468,36 +1414,39 @@ static int __gl_ui_push_view_albums_edit(void *data, Evas_Object *parent, GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; Elm_Object_Item *nf_it = NULL; - Elm_Object_Item *cancel_it = NULL; + Elm_Object_Item *share_it = NULL; Elm_Object_Item *del_it = NULL; + Elm_Object_Item *cancel_it = NULL; Evas_Object *bot_bar = NULL; /* create tool controlbar downside */ - bot_bar = _gl_ctrl_create_toolbar(ad, obj); + bot_bar = _gl_ctrl_create_toolbar(obj); GL_CHECK_VAL(bot_bar, -1); - /* Add delete item */ del_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_DELETE, NULL, _gl_ui_albums_del_cb, ad); - gl_ui_disable_cbar_item(del_it); - __gl_ui_append_object_item(bot_bar, NULL); - __gl_ui_append_object_item(bot_bar, NULL); - - /* use Cancel button */ + _gl_ctrl_append_object_item(bot_bar, NULL); + + /* Add 'Share' item */ + share_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_SHARE, NULL, + _gl_ui_share_cb, ad); + _gl_ctrl_append_object_item(bot_bar, NULL); + _gl_ctrl_disable_item(share_it); + /* Add 'Cancel' item */ cancel_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_CANCEL, NULL, __gl_ui_click_cancel_edit_cb, ad); + _gl_ctrl_disable_item(del_it); + /* Add transition finished callback */ evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, __gl_ui_trans_finished_cb, ad); /* Push to stack */ - nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, - obj, NULL); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_PREB_BTN, NULL); - + nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, + NULL); ad->albuminfo.nf_it_edit = nf_it; + _gl_ui_hide_back_button(nf_it); /* Set tool bar to bottom */ - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR, - bot_bar); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_CONTROLBAR, bot_bar); return 0; } @@ -1519,36 +1468,37 @@ static int __gl_ui_push_view_thumbs(void *data, Evas_Object *parent, Evas_Object *segment = NULL; /* create tool controlbar downside */ - bot_bar = _gl_ctrl_create_toolbar(ad, obj); + bot_bar = _gl_ctrl_create_toolbar(obj); GL_CHECK_VAL(bot_bar, -1); /* add 'Back' item */ if (ad->maininfo.medias_cnt) { /* add 'Edit' item */ - edit_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_EDIT, - NULL, _gl_ui_edit_cb, ad); + edit_it = _gl_ui_append_edit(ad, bot_bar); ad->gridinfo.edit_it = edit_it; /* add segment */ segment = _gl_ctrl_create_segment(ad, bot_bar); - if(segment) - __gl_ui_append_object_item(bot_bar, segment); + _gl_ctrl_append_object_item(bot_bar, segment); } -#if 1 - nf_it = elm_naviframe_top_item_get(parent); - /* For the instant transition, use the xxx_insert_after API */ - nf_it = elm_naviframe_item_insert_after(parent, nf_it, title, - NULL, NULL, obj, NULL); -#else - /* Push to stack */ - nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, NULL); -#endif + /* 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; /* Set tool bar to bottom */ - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR, - bot_bar); + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_CONTROLBAR, bot_bar); + + if (ad->maininfo.medias_cnt) { + /* Add slide show button */ + gl_dbg("Add slideshow button"); + __gl_ui_add_slideshow_btn(ad, nf_it, parent); + } return 0; } - /** * Use naviframe api to push thumbnails eidt view to stack. * @param obj is the content to be pushed. @@ -1563,35 +1513,65 @@ static int __gl_ui_push_view_thumbs_edit(void *data, Evas_Object *parent, gl_appdata *ad = (gl_appdata *)data; Elm_Object_Item *nf_it = NULL; Elm_Object_Item *del_it = NULL; + Elm_Object_Item *share_it = NULL; Elm_Object_Item *move_it = NULL; Elm_Object_Item *cancel_it = NULL; Evas_Object *bot_bar = NULL; - +#ifdef _USE_ROTATE_BG + bool b_add_more_btn = false; +#endif /* create tool controlbar downside */ - bot_bar = _gl_ctrl_create_toolbar(ad, obj); + bot_bar = _gl_ctrl_create_toolbar(obj); GL_CHECK_VAL(bot_bar, -1); + +#ifdef _USE_ROTATE_BG + /* Add button is available in all/images segment */ + if (ad->maininfo.seg_mode != GL_CTRL_SEG_VIDEOS) + b_add_more_btn = true; +#endif /* Add 'Delete' item */ - del_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_DELETE, NULL, - _gl_ui_medias_del_cb, ad); - gl_ui_disable_cbar_item(del_it); - /* Add 'Move' item */ - move_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_MOVE, NULL, - __gl_ui_move_cb, ad); - gl_ui_disable_cbar_item(move_it); - /* use Cancel button */ - cancel_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_CANCEL, NULL, - __gl_ui_click_cancel_edit_cb, ad); + del_it = elm_toolbar_item_append(bot_bar, + GL_CBAR_ICON_DELETE, + NULL, + _gl_ui_medias_del_cb, + ad); + _gl_ctrl_disable_item(del_it); + + /* Add 'Share' item */ + share_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_SHARE, + NULL, _gl_ui_share_cb, ad); + _gl_ctrl_disable_item(share_it); + + move_it = elm_toolbar_item_append(bot_bar, + GL_CBAR_ICON_MOVE, + NULL, + __gl_ui_move_cb, + ad); + _gl_ctrl_disable_item(move_it); + + /* Add 'Cancel' item */ + cancel_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_CANCEL, + NULL, + __gl_ui_click_cancel_edit_cb, + ad); + /* Add transition finished callback */ evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, __gl_ui_trans_finished_cb, ad); /* Push to stack */ - nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, - NULL); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_PREB_BTN, NULL); - + nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, NULL); ad->gridinfo.nf_it_edit = nf_it; + _gl_ui_hide_back_button(nf_it); + +#ifdef _USE_ROTATE_BG + if (b_add_more_btn) { + gl_dbg("Add more button"); + __gl_ui_add_more_btn(ad, nf_it, parent); + } +#endif + /* Set tool bar to bottom */ - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR, + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_CONTROLBAR, bot_bar); return 0; @@ -1617,24 +1597,26 @@ static int __gl_ui_push_view_albums_rename(void *data, Evas_Object *parent, evas_object_smart_callback_add(parent, GL_TRANS_FINISHED, __gl_ui_trans_finished_cb, ad); nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, NULL); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_PREB_BTN, NULL); + _gl_ui_hide_back_button(nf_it); /* Add 'Cancel' button */ - cancel_btn = _gl_but_create_but(obj, GL_BUT_CANCEL, - GL_BUTTON_STYLE_NAVI_TITLE); + cancel_btn = _gl_but_create_but(parent, GL_BUT_NONE, + GL_BUTTON_STYLE_NAVI_CANCEL); GL_CHECK_VAL(cancel_btn, -1); evas_object_smart_callback_add(cancel_btn, "clicked", __gl_ui_rename_album_cancel_cb, ad); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_TITLE_RIGHT_BTN, + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_RIGHT_BTN, cancel_btn); + ad->entryinfo.cancel_btn = cancel_btn; /* Add 'Done' button */ - done_btn = _gl_but_create_but(obj, GL_BUT_DONE, - GL_BUTTON_STYLE_NAVI_TITLE); + done_btn = _gl_but_create_but(parent, GL_BUT_NONE, + GL_BUTTON_STYLE_NAVI_DONE); GL_CHECK_VAL(done_btn, -1); evas_object_smart_callback_add(done_btn, "clicked", __gl_ui_rename_album_done_cb, ad); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_TITLE_LEFT_BTN, + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_LEFT_BTN, done_btn); ad->entryinfo.done_btn = done_btn; + ad->entryinfo.nf_it = nf_it; return 0; } @@ -1655,216 +1637,110 @@ static int __gl_ui_push_view_albums_new(void *data, Evas_Object *parent, Evas_Object *cancel_btn = NULL; nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj, NULL); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_PREB_BTN, NULL); + ad->entryinfo.nf_it = nf_it; + _gl_ui_hide_back_button(nf_it); /* Add 'Cancel' button */ - cancel_btn = _gl_but_create_but(obj, GL_BUT_CANCEL, - GL_BUTTON_STYLE_NAVI_TITLE); + cancel_btn = _gl_but_create_but(parent, GL_BUT_NONE, + GL_BUTTON_STYLE_NAVI_CANCEL); GL_CHECK_VAL(cancel_btn, -1); evas_object_smart_callback_add(cancel_btn, "clicked", _gl_ui_newalbum_cancel_cb, ad); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_TITLE_RIGHT_BTN, + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_RIGHT_BTN, cancel_btn); + ad->entryinfo.cancel_btn = cancel_btn; /* Add 'Done' button */ - done_btn = _gl_but_create_but(obj, GL_BUT_DONE, - GL_BUTTON_STYLE_NAVI_TITLE); + done_btn = _gl_but_create_but(parent, GL_BUT_NONE, + GL_BUTTON_STYLE_NAVI_DONE); GL_CHECK_VAL(done_btn, -1); evas_object_smart_callback_add(done_btn, "clicked", _gl_ui_newalbum_done_cb, ad); - elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_TITLE_LEFT_BTN, + elm_object_item_part_content_set(nf_it, GL_NAVIFRAME_TITLE_LEFT_BTN, done_btn); ad->entryinfo.done_btn = done_btn; return 0; } -int gl_ui_reset_toolbar_item(void *data, gl_ctrl_seg_mode seg_mode, bool force) +int _gl_ui_disable_slideshow_btn(void *data, bool b_disable) { 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 (seg_mode == GL_CTRL_SEG_VIDEOS) - is_zero = gl_db_is_item_cnt_zero(ad, MINFO_ITEM_VIDEO); - else if (seg_mode == GL_CTRL_SEG_IMAGES) - is_zero = gl_db_is_item_cnt_zero(ad, MINFO_ITEM_IMAGE); - - Elm_Object_Item *ctl_it = NULL; - ctl_it = ad->gridinfo.edit_it; - /* none items, disable 'edit' item */ - if (is_zero) { - gl_ui_disable_cbar_item(ctl_it); - } else { - gl_ui_enable_cbar_item(ctl_it); - } + GL_CHECK_VAL(ad->gridinfo.nf_it, -1); + Evas_Object *slideshow_btn = NULL; + slideshow_btn = elm_object_item_part_content_get(ad->gridinfo.nf_it, + GL_NAVIFRAME_TITLE_RIGHT_BTN); + if (slideshow_btn); + elm_object_disabled_set(slideshow_btn, b_disable); return 0; } -int gl_ui_disable_toolbar_item(void *data, bool disabled, gl_navi_mode mode, - bool edit) +#ifdef _USE_ROTATE_BG +int _gl_ui_open_optionheader(void *data, int open) { GL_CHECK_VAL(data, -1); - gl_dbg("Title button disabled: %d.", disabled); - if (disabled) - _gl_ui_disable_toolbar_item(data, mode, edit); - else - _gl_ui_enable_toolbar_item(data, mode); - - return 0; -} - -int gl_ui_disable_cbar_item(Elm_Object_Item *it) -{ - if (it) - elm_object_item_disabled_set(it, EINA_TRUE); - return 0; -} - -int gl_ui_enable_cbar_item(Elm_Object_Item *it) -{ - if(it) - elm_object_item_disabled_set(it, EINA_FALSE); + Elm_Object_Item *nf_it = (Elm_Object_Item *)data; + if (open == GL_UI_MORE_STATE_OPEN) { + elm_object_item_signal_emit(nf_it, "elm,state,optionheader,open", + ""); + elm_object_item_data_set(nf_it, (void *)(GL_UI_MORE_STATE_OPEN)); + } else { + elm_object_item_signal_emit(nf_it, + "elm,state,optionheader,close", ""); + elm_object_item_data_set(nf_it, (void *)(GL_UI_MORE_STATE_CLOSE)); + } return 0; } -int gl_ui_disable_toolbar_items(void *data, Elm_Object_Item *nf_it) +int _gl_ui_disable_more_btn(void *data, bool b_disable) { + gl_dbg("b_disable: %d", b_disable); GL_CHECK_VAL(data, -1); - GL_CHECK_VAL(nf_it, -1); - - Elm_Object_Item *cbar_it = NULL; - Evas_Object *ctlbar = _gl_ctrl_get_toolbar(nf_it); - cbar_it = elm_toolbar_last_item_get(ctlbar); - GL_CHECK_VAL(cbar_it, -1); - cbar_it = elm_toolbar_item_prev_get(cbar_it); - while (cbar_it) { - gl_ui_disable_cbar_item(cbar_it); - cbar_it = elm_toolbar_item_prev_get(cbar_it); - } - + gl_appdata *ad = (gl_appdata *)data; + GL_CHECK_VAL(ad->maininfo.naviframe, -1); + Evas_Object *_more_btn = NULL; + Elm_Object_Item *nf_it = NULL; + nf_it = elm_naviframe_top_item_get(ad->maininfo.naviframe); + _more_btn = elm_object_item_part_content_get(nf_it, + GL_NAVIFRAME_TITLE_MORE_BTN); + if (_more_btn) + elm_object_disabled_set(_more_btn, b_disable); + /* Close optionheader manually */ + if (b_disable) + _gl_ui_open_optionheader(nf_it, GL_UI_MORE_STATE_CLOSE); return 0; } +#endif -/* The maximun length reached callback */ -void __gl_ui_entry_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, ""); -} - -/* -* 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. -*/ -void __gl_ui_entry_space_check_cb(void *data, Evas_Object *obj, void *event_info) +/* Append 'Edit' item to toolbar */ +Elm_Object_Item *_gl_ui_append_edit(void *data, Evas_Object *bot_bar) { - gl_appdata *ad = (gl_appdata *)data; - GL_CHECK(ad); - GL_CHECK(ad->entryinfo.editfield); - GL_CHECK(ad->entryinfo.done_btn); - const char *entry_str = NULL; - - /* Show/hide eraser */ - if (elm_object_focus_get(ad->entryinfo.editfield)) { - if (elm_entry_is_empty(obj)) { - gl_dbg("Show eraser."); - elm_object_signal_emit(ad->entryinfo.editfield, - "elm,state,eraser,hide", "elm"); - } else { - gl_dbg("Hide eraser."); - elm_object_signal_emit(ad->entryinfo.editfield, - "elm,state,eraser,show", "elm"); - } - } - - /* Get entry string. */ - GL_CHECK(ad->entryinfo.imf_entry); - entry_str = elm_entry_entry_get(ad->entryinfo.imf_entry); - 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 and rename album. - */ - 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() */ - if (entry_utf8) { - free(entry_utf8); - entry_utf8 = NULL; - } + GL_CHECK_NULL(bot_bar); + GL_CHECK_NULL(data); + Elm_Object_Item *edit_it = NULL; + edit_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_EDIT, + NULL, _gl_ui_edit_cb, data); + return edit_it; } int gl_ui_cancel_rename_album(void *data) { GL_CHECK_VAL(data, -1); gl_dbg(""); - __gl_ui_rename_album_cancel_cb(data, NULL, NULL); + __gl_ui_cancel_rename_album(data); return 0; } -int -gl_ui_cancel_new_album(void *data) +int gl_ui_cancel_new_album(void *data) { GL_CHECK_VAL(data, -1); gl_dbg(""); - _gl_ui_newalbum_cancel_cb(data, NULL, NULL); + _gl_ui_cancel_newalbum(data); return 0; } -int -gl_ui_move_to_newalbum(void *data) +int gl_ui_move_to_newalbum(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; @@ -1872,18 +1748,16 @@ gl_ui_move_to_newalbum(void *data) gl_dbg(""); ad->entryinfo.entry_mode = GL_ENTRY_NEW_ALBUM; - editfield_ly = gl_ui_create_view_ly(ad->maininfo.navi_bar); - Evas_Object *entry_ly = _gl_ui_create_editfield(ad, editfield_ly, NULL); - evas_object_smart_callback_add(ad->entryinfo.imf_entry, "activated", - _gl_ui_newalbum_enter_cb, ad); + editfield_ly = _gl_ui_create_view_ly(ad->maininfo.naviframe); + Evas_Object *entry_ly = _gl_editfield_create(ad, editfield_ly, NULL); elm_object_part_content_set(editfield_ly, "elm.swallow.view", entry_ly); - edje_object_signal_emit(_EDJ(editfield_ly), - "elm,swallow_view,state,default", "elm"); - ad->entryinfo.imf_ly = NULL; - gl_ui_create_title_and_push(ad, ad->maininfo.navi_bar, editfield_ly, - GL_NAVI_ALBUMS_NEW, GL_STR_NEW_ALBUM); - elm_entry_cursor_line_end_set(ad->entryinfo.imf_entry); - elm_object_focus_set(ad->entryinfo.imf_entry, TRUE); + + gl_ui_create_title_and_push(ad, ad->maininfo.naviframe, editfield_ly, + GL_NAVI_ALBUMS_NEW, GL_STR_CREATE_ALBUM); + + elm_entry_cursor_end_set(ad->entryinfo.imf_entry); + evas_object_show(ad->entryinfo.imf_entry); + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_TRUE); ecore_imf_context_input_panel_show(ad->entryinfo.imf_context); return 0; @@ -1900,6 +1774,7 @@ int gl_ui_rename_album(gl_cluster *album_item) Evas_Object *editfield_ly = NULL; Evas_Object *entry_ly = NULL; gl_dbg(""); + if(ad->maininfo.rename_album_job) { ecore_job_del(ad->maininfo.rename_album_job); ad->maininfo.rename_album_job = NULL; @@ -1914,19 +1789,19 @@ int gl_ui_rename_album(gl_cluster *album_item) gl_set_view_mode(ad, GL_VIEW_ALBUMS_RENAME); - editfield_ly = gl_ui_create_view_ly(ad->maininfo.navi_bar); - entry_ly = _gl_ui_create_editfield(ad, editfield_ly, - album_item->cluster->display_name); - evas_object_smart_callback_add(ad->entryinfo.imf_entry, "activated", - __gl_ui_rename_album_enter_cb, ad); + ad->entryinfo.entry_mode = GL_ENTRY_RENAME_ALBUM; + + editfield_ly = _gl_ui_create_view_ly(ad->maininfo.naviframe); + entry_ly = _gl_editfield_create(ad, editfield_ly, + album_item->cluster->display_name); elm_object_part_content_set(editfield_ly, "elm.swallow.view", entry_ly); - edje_object_signal_emit(_EDJ(editfield_ly), - "elm,swallow_view,state,default", "elm"); - ad->entryinfo.imf_ly = NULL; - gl_ui_create_title_and_push(ad, ad->maininfo.navi_bar, editfield_ly, + + gl_ui_create_title_and_push(ad, ad->maininfo.naviframe, editfield_ly, GL_NAVI_ALBUMS_RENAME, GL_STR_CHNAGE_NAME); - elm_entry_cursor_line_end_set(ad->entryinfo.imf_entry); - elm_object_focus_set(ad->entryinfo.editfield, TRUE); + + elm_entry_cursor_end_set(ad->entryinfo.imf_entry); + evas_object_show(ad->entryinfo.imf_entry); + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_TRUE); ecore_imf_context_input_panel_show(ad->entryinfo.imf_context); return 0; } @@ -1934,6 +1809,7 @@ int gl_ui_rename_album(gl_cluster *album_item) 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); @@ -1951,18 +1827,10 @@ int gl_ui_create_title_and_push(void *data, Evas_Object *parent, else if (mode == GL_NAVI_ALBUMS_NEW) __gl_ui_push_view_albums_new(data, parent, obj, title); gl_dbg("Done"); + gl_dbg_launch(" gl_ui_create_title_and_push:end"); return 0; } -bool -gl_ui_display_nocontents(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - - return _gl_ui_display_nocontents(ad); -} - Evas_Object * gl_ui_load_edj(Evas_Object * parent, const char *file, const char *group) { @@ -2005,144 +1873,20 @@ int gl_ui_edit_cancel(void *data) nf_it = ad->gridinfo.nf_it; } elm_naviframe_item_pop_to(nf_it); - _gl_ui_edit_cancel_cb(ad, NULL, NULL); + __gl_ui_cancel_edit(ad); return 0; } -/* Back to normal thumbnail view */ -int gl_ui_back_to_normal(void *data) +/* Remove selection and edit view then pop to normal thumbnail view */ +int _gl_ui_pop_to_thumb(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - _gl_destroy_thumbs_edit_view(ad); + /* Delete edit view and update thumbnail view */ + __gl_ui_cancel_edit(ad); + /* Delete invlid naviframe items */ elm_naviframe_item_pop_to(ad->gridinfo.nf_it); - _gl_ui_edit_cancel_cb(ad, NULL, NULL); - - return 0; -} - -Evas_Object *gl_ui_create_nocontents_full(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, }; - - if (ad->maininfo.app_exit_mode == GL_APP_EXIT_NONE) { - int grid_mode = ad->gridinfo.grid_view_mode; - switch (grid_mode) { - case GL_GRID_ALL: - snprintf(label_str, sizeof(label_str), "%s", - (char *)(GL_STR_NO_ITEMS)); - break; - case GL_GRID_VIDEOS: - snprintf(label_str, sizeof(label_str), "%s", - (char *)(GL_STR_NO_VIDEOS)); - break; - case GL_GRID_IMAGES: - snprintf(label_str, sizeof(label_str), "%s", - (char *)(GL_STR_NO_IMAGES)); - break; - case GL_GRID_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; - } - } else { - /* It's in Usb Mass Storage mode */ - snprintf(label_str, sizeof(label_str), "%s
%s", - (char *)(GL_STR_NO_CONTENTS), - (char *)(GL_STR_UNABLE_USE_IN_UMS_MODE)); - } - - gl_dbg("Nocontents label: %s", label_str); - /* Full view nocontents */ - noc_lay = elm_layout_add(ad->maininfo.navi_bar); - GL_CHECK_NULL(noc_lay); - elm_object_part_text_set(noc_lay, "elm.text", label_str); - elm_layout_theme_set(noc_lay, "layout", "nocontents", "gallery"); - - return noc_lay; -} - -/** -* Add new notify widget, select-all widget and set view state. -* -* b_update, if true, update text only, other recreate notify widget -*/ -int gl_ui_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, }; - - gl_dbg("selected_cnt/all_cnt = %d/%d", selected_cnt, all_cnt); - if (selected_cnt > all_cnt) { - gl_ui_destroy_selinfo(ad); - gl_dbgE("selected_cnt > all_cnt!"); - return -1; - } - - /* Create new notify widget */ - if (b_update == false) - _gl_ui_add_notify(ad, parent, true); - - /* Reuse old notify widget in update case */ - GL_CHECK_VAL(ad->popupinfo.selinfo, -1); - GL_CHECK_VAL(ad->popupinfo.selinfo_ly, -1); - - /* Update state of checkbox in select-all widget */ - _gl_ui_update_selall(ad, all_cnt, selected_cnt); - - /* Update notify widget and view related to it */ - _gl_ui_update_view_selinfo(ad, selected_cnt); - - if (selected_cnt > 0) { - /* Enable/Disable control bar buttons */ - _gl_ui_enable_toolbar_items(ad, nf_it); - 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); - evas_object_show(ad->popupinfo.selinfo); - } else { - /* Disable control bar buttons */ - gl_ui_disable_toolbar_items(ad, nf_it); - gl_ui_destroy_selinfo(ad); - } - - return 0; -} - -int -gl_ui_destroy_selinfo(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - gl_dbg(""); - /* The selectioninfo_ly was filled in selectioninfo, so delete selectioninfo_ly first. */ - if (ad->popupinfo.selinfo_ly) - { - evas_object_del(ad->popupinfo.selinfo_ly); - ad->popupinfo.selinfo_ly = NULL; - } - - if (ad->popupinfo.selinfo) - { - evas_object_smart_callback_del(ad->popupinfo.selinfo, - "timeout", _gl_ui_selinfo_destroy_cb); - evas_object_del(ad->popupinfo.selinfo); - ad->popupinfo.selinfo = NULL; - } return 0; } @@ -2164,10 +1908,17 @@ int gl_ui_show_selall(void *data) if (view_mode == GL_VIEW_THUMBS_EDIT || view_mode == GL_VIEW_VIDEOLIST_EDIT) { view_ly = ad->gridinfo.edit_layout; - if (ad->maininfo.medias_cnt == gl_db_selected_list_count(ad)) + if (ad->maininfo.medias_cnt == _gl_data_selected_list_count(ad)) ck_state = EINA_TRUE; if (view_mode == GL_VIEW_VIDEOLIST_EDIT) sig = "selectall_show_video"; + } else if (view_mode == GL_VIEW_ALBUMS_EDIT) { + /* in Albums view */ + view_ly = ad->albuminfo.edit_layout; + int sel_all = _gl_data_get_albums_selected_cnt(ad); + int cnt_all = ad->albuminfo.albums_cnt; + if (cnt_all == sel_all) + ck_state = EINA_TRUE; } else { gl_dbgE("Wrong view!"); return -1; @@ -2185,7 +1936,6 @@ int gl_ui_show_selall(void *data) evas_object_del(old_check); Evas_Object *check = elm_check_add(view_ly); - elm_object_style_set(check, GL_CHECKBOX_STYLE_DEFAULT); evas_object_propagate_events_set(check, EINA_FALSE); elm_check_state_set(check, ck_state); @@ -2210,154 +1960,63 @@ 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 = ad->maininfo.medias_cnt; - int sel_cnt = gl_db_selected_list_count(ad); - gl_ui_create_selinfo(ad, ad->gridinfo.edit_layout, - ad->gridinfo.nf_it_edit, cnt, sel_cnt, false); - return 0; -} - -int gl_ui_create_notiinfo(void *data, Evas_Object *parent, - gl_ui_notify_mode n_mode) -{ - GL_CHECK_VAL(parent, -1); - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - const char *text = NULL; - gl_dbg(""); - - _gl_ui_add_notify(ad, parent, false); - GL_CHECK_VAL(ad->popupinfo.selinfo, -1); - GL_CHECK_VAL(ad->popupinfo.selinfo_ly, -1); - - edje_object_signal_emit(_EDJ(ad->popupinfo.selinfo_ly), - "elm,selectioninfo,portrait", "elm"); - - switch (n_mode) { - case GL_UI_NOTIFY_DELETED: - text = GL_STR_DELETED; - break; - case GL_UI_NOTIFY_REMOVED: - text = GL_STR_REMOVED; - break; - case GL_UI_NOTIFY_ADDED: - text = GL_STR_ADDED; - break; - case GL_UI_NOTIFY_MOVED: - text = GL_STR_MOVED; - break; - default: - gl_dbgE("GL_UI_NOTIFY_xxx, Error mode!"); - break; - } - - edje_object_part_text_set(_EDJ(ad->popupinfo.selinfo_ly), "elm.text", - text); - evas_object_show(ad->popupinfo.selinfo); - - return 0; -} - -int -gl_ui_destroy_notiinfo(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - gl_dbg(""); - /* The selectioninfo_ly was filled in selectioninfo, so delete selectioninfo_ly first. */ - if (ad->popupinfo.selinfo_ly) - { - evas_object_del(ad->popupinfo.selinfo_ly); - ad->popupinfo.selinfo_ly = NULL; - } - - if (ad->popupinfo.selinfo) - { - evas_object_smart_callback_del(ad->popupinfo.selinfo, - "timeout", _gl_ui_notiinfo_destroy_cb); - evas_object_del(ad->popupinfo.selinfo); - ad->popupinfo.selinfo = NULL; - } - - return 0; -} - -int gl_ui_destroy_imf(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 (ad->entryinfo.imf_entry) { - evas_object_smart_callback_del(ad->entryinfo.imf_entry, - "maxlength,reached", - __gl_ui_entry_maxlen_reached_cb); - if (ad->entryinfo.entry_mode == GL_ENTRY_NEW_ALBUM) - evas_object_smart_callback_del(ad->entryinfo.imf_entry, - "activated", - _gl_ui_newalbum_enter_cb); - else - evas_object_smart_callback_del(ad->entryinfo.imf_entry, - "changed", - __gl_ui_entry_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_hide(ad->entryinfo.editfield); - - if (ad->entryinfo.imf_ly) { - evas_object_del(ad->entryinfo.imf_ly); - ad->entryinfo.imf_ly = NULL; - } - - ad->entryinfo.imf_entry = NULL; - ad->entryinfo.imf_context = NULL; - ad->entryinfo.editfield = NULL; - + int sel_cnt = _gl_data_selected_list_count(ad); + _gl_notify_create_selinfo(ad, ad->gridinfo.edit_layout, + ad->gridinfo.nf_it_edit, 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); - elm_layout_theme_set(layout, "layout", "application", "default"); + /* 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); elm_win_resize_object_add(parent, layout); evas_object_show(layout); + gl_dbg_launch(" gl_ui_create_main_ly:end"); return layout; } -Evas_Object *gl_ui_create_naviframe(Evas_Object *parent) +Evas_Object *gl_ui_create_navi_ly(Evas_Object *parent) { GL_CHECK_NULL(parent); Evas_Object *navi_bar = NULL; + gl_dbg_launch(" gl_ui_create_navi_ly:start"); navi_bar = elm_naviframe_add(parent); gl_dbg("elm_naviframe_add:done"); - /* Use custom style to set bg color black(0 0 0 255). */ - elm_object_style_set(navi_bar, GL_NAVIBAR_STYLE_DEFAULT); + evas_object_show(navi_bar); gl_dbg("elm_object_style_set: done"); + gl_dbg_launch(" gl_ui_create_navi_ly:end"); return navi_bar; } -Evas_Object *gl_ui_create_view_ly(Evas_Object *parent) +Evas_Object *_gl_ui_create_view_ly(Evas_Object *parent) { gl_dbg(""); GL_CHECK_NULL(parent); @@ -2370,24 +2029,3 @@ Evas_Object *gl_ui_create_view_ly(Evas_Object *parent) return layout; } -int _gl_ui_elm_bg_file_set(Evas_Object *bg, gl_item *git) -{ - if (git == NULL || git->item == NULL || git->ad == NULL) { - gl_dbgE("Invalid item :%p", git); - elm_bg_file_set(bg, GL_DEFAULT_THUMB_ICON, NULL); - return -1; - } - - char *path = NULL; - path = _gl_get_thumb(git->ad, git->item->file_url, - &git->item->thumb_url); - if (path) { - elm_bg_file_set(bg, path, NULL); - free(path); - path = NULL; - } else { - elm_bg_file_set(bg, git->item->thumb_url, NULL); - } - - return 0; -} diff --git a/src/util/gl-util.c b/src/util/gl-util.c index 6eed77f..f39dbb3 100755 --- a/src/util/gl-util.c +++ b/src/util/gl-util.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "gl-debug.h" #include "gallery.h" @@ -34,15 +34,26 @@ #include "gl-progressbar.h" #include "gl-ext-ug-load.h" #include "gl-ext-exec.h" +#include "gl-drm.h" +#include "gl-nocontents.h" +#include "gl-notify.h" +#include "gl-editfield.h" #include "gl-strings.h" +#include "gl-data-type.h" +#ifdef _USE_ROTATE_BG +#include "gl-exif.h" +#endif #define GL_FILE_COPY_BUF_MAX 16384 #define GL_CREATE_DIR_MASK_DEFAULT 0775 -#define GL_DESKTOP_CONTENT_LEN_MAX 128 /* Time for displaying progressbar UI compeletely */ #define GL_TIMER_INTERVAL_PBAR_SHOWED 0.5 -#define GL_TIMER_INTERVAL_UMS_UPDATE 2.0 #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 /* Use timer to show progressbar totally before write pipe */ static Eina_Bool _gl_start_thread_op_timer_cb(void *data) @@ -116,16 +127,6 @@ static void _gl_db_update_noti_cb(keynode_t *key, void *data) else ad->maininfo.mmc_state = GL_MMC_STATE_ADDED; - if (ad->maininfo.ums_update_timer) { - /** - * MMC noti callback also would be invoked - * if USB disconnected in UMS mode, - * Return to prevent from refreshing view twice. - */ - gl_dbgW("View would be update in _gl_ums_update_timer_cb."); - return; - } - gl_update_view(ad, GL_UPDATE_VIEW_MMC_ADDED); /* Update popup content after albums list updated */ @@ -157,16 +158,6 @@ static void _gl_db_update_noti_cb(keynode_t *key, void *data) ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED; } - if (ad->maininfo.ums_update_timer) { - /** - * MMC noti callback also would be invoked - * if USB disconnected in UMS mode, - * Return to prevent from refreshing view twice. - */ - gl_dbgW("View would be update in _gl_ums_update_timer_cb."); - return; - } - gl_update_view(ad, GL_UPDATE_VIEW_MMC_REMOVED); /* Update popup content after albums list updated */ @@ -178,140 +169,6 @@ static void _gl_db_update_noti_cb(keynode_t *key, void *data) } } -static Eina_Bool -_gl_ums_update_timer_cb(void *data) -{ - gl_dbg("Timer callback invoked, try to update view."); - GL_CHECK_CANCEL(data); - gl_appdata *ad = (gl_appdata *)data; - - gl_update_view(data, GL_UPDATE_VIEW_NORMAL); - - if (ad->maininfo.ums_update_timer) { - ecore_timer_del(ad->maininfo.ums_update_timer); - ad->maininfo.ums_update_timer = NULL; - } - return ECORE_CALLBACK_CANCEL; -} - -static void -_gl_mass_storage_noti_cb(keynode_t * key, void *data) -{ - GL_CHECK(data); - gl_appdata *ad = (gl_appdata *)data; - int mass_storage_state = -1; - gl_dbg(""); - - vconf_get_int(VCONFKEY_USB_STORAGE_STATUS, &mass_storage_state); - if (mass_storage_state == -1) - { - gl_dbgE("Error when check MASS STORAGE Status"); - return; - } - - if (mass_storage_state == VCONFKEY_USB_STORAGE_STATUS_UMS_ON || - mass_storage_state == VCONFKEY_USB_STORAGE_STATUS_UMS_MMC_ON) - { - /* Close app. */ - gl_dbg("VCONFKEY_USB_STORAGE_STATUS_UMS(_MMC)_ON"); - elm_exit(); - } - else if (mass_storage_state == VCONFKEY_USB_STORAGE_STATUS_OFF) - { - /** - * Update view in 2 seconds, - * media-server scan file system and insert records to DB, - * it takes some time. - */ - gl_dbg("VCONFKEY_USB_STORAGE_STATUS_OFF,update view in 2secs."); - if (ad->maininfo.ums_update_timer) { - ecore_timer_del(ad->maininfo.ums_update_timer); - ad->maininfo.ums_update_timer = NULL; - } - Ecore_Timer *ums_timer = NULL; - ums_timer = ecore_timer_add(GL_TIMER_INTERVAL_UMS_UPDATE, - _gl_ums_update_timer_cb, data); - ad->maininfo.ums_update_timer = ums_timer; - } -} - -/* -* Display nocontents view in image or video segment. -*/ -static int -_gl_display_iv_nocontents(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - bool is_image_file_existing = false; - int grid_view_mode = ad->gridinfo.grid_view_mode; - int cnt = 0; - gl_item *gitem = NULL; - int i = 0; - - if (grid_view_mode == GL_CTRL_SEG_VIDEOS) - { - gl_dbg("list view, already created nocontents in update function"); - return 0; - } - - - /* Get all medias count of current gridview */ - cnt = ad->maininfo.medias_cnt; - - if (grid_view_mode == GL_CTRL_SEG_IMAGES) //only check in image segment. - { - for (i = 1; i <= cnt; i++) - { - gl_db_get_item_by_index(ad, i, false, &gitem); - if (gitem == NULL || gitem->item == NULL) - { - gl_dbg("gitem == NULL || gitem->item == NULL"); - continue; - } - - if (!is_image_file_existing && gitem->item->type == MINFO_ITEM_IMAGE) - { - is_image_file_existing = true; - break; - } - } - - gl_dbg("image file exists->%d", is_image_file_existing); - if (grid_view_mode == GL_CTRL_SEG_IMAGES && !is_image_file_existing) - { - if (ad->gridinfo.image_nocontents) - { - gl_dbg("(image_grid_view)nocontents already exists..."); - } - else - { - gl_dbg("None image files, show nocontents..."); - Evas_Object *noc = gl_ui_create_nocontents_full(ad); - /** - * delete image_grid_view before assign nocontents to image_grid_view, - * other when back to albums view, it's frozen. - */ - if (ad->gridinfo.image_view) - { - evas_object_del(ad->gridinfo.image_view); - ad->gridinfo.image_view = NULL; - } - ad->gridinfo.image_view = noc; - ad->gridinfo.image_nocontents = noc; - elm_object_part_content_unset(ad->gridinfo.layout, "elm.swallow.view"); - evas_object_hide(ad->listinfo.video_view); - evas_object_hide(ad->gridinfo.all_view); - evas_object_show(ad->gridinfo.image_view); - elm_object_part_content_set(ad->gridinfo.layout, - "elm.swallow.view", ad->gridinfo.image_view); - } - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_THUMBS, false); - } - } - - return 0; -} /** * @param: b_update_albums_list @@ -336,6 +193,13 @@ static int _gl_update_thumb_items(void *data, bool b_update_albums_list) b_edit_m = true; } + if (view_mode == GL_VIEW_VIDEOLIST && + ad->listinfo.played_uuid == NULL && + _gl_data_check_update(ad, false) == false) { + gl_dbg("Nothing changed."); + return 0; + } + /** * 1, Update albums list and medias_elist, * 2, Update medias_elist. @@ -343,7 +207,7 @@ static int _gl_update_thumb_items(void *data, bool b_update_albums_list) if (b_update_albums_list) gl_refresh_albums_list(ad); else - gl_db_update_item_list(ad); + _gl_data_update_item_list(ad); if (ad->maininfo.medias_cnt == 0) { /* All items deleted, change to albms view */ @@ -351,7 +215,7 @@ static int _gl_update_thumb_items(void *data, bool b_update_albums_list) } else { if (view_mode == GL_VIEW_VIDEOLIST) { gl_list_update_view(ad); - } else if (gl_ui_display_nocontents(ad)) { + } 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); @@ -359,7 +223,7 @@ static int _gl_update_thumb_items(void *data, bool b_update_albums_list) gl_grid_update_items(ad); } else if (view_mode == GL_VIEW_THUMBS_EDIT) { gl_grid_change_to_edit(ad); - } else { + } else if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { gl_list_change_to_edit(ad); } @@ -367,9 +231,16 @@ static int _gl_update_thumb_items(void *data, bool b_update_albums_list) if (!b_edit_m) return 0; - /* Remove invalid widgets if none medias selected */ - if (gl_db_selected_list_count(ad) == 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.edit_layout, + ad->gridinfo.nf_it_edit, + ad->maininfo.medias_cnt, sel_cnt, + true); /** * Update albums list when change to normal view. @@ -422,12 +293,12 @@ static bool _gl_check_mmc_file_selected(void *data) gl_item *gitem = NULL; int i = 0; int on_mmc = -1; - int cnt = gl_db_selected_list_count(ad); + int cnt = _gl_data_selected_list_count(ad); for (i = 0; i < cnt; i++) { gitem = NULL; on_mmc = -1; - gitem = gl_db_selected_list_get_nth(ad, i); + 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, @@ -448,15 +319,15 @@ static int _gl_stop_vibration(void *data) gl_appdata *ad = (gl_appdata *)data; int ret = -1; - if (ad->entryinfo.haptic_handle > 0) { - ret = device_haptic_stop_play(ad->entryinfo.haptic_handle); + if (ad->entryinfo.haptic_handle >= 0) { + ret = haptic_stop_device(GL_VIBRATION_DEVICE); if (ret != 0) - gl_dbgE("device_haptic_stop_play failed[%d]!", ret); + gl_dbgE("haptic_stop_device failed[%d]!", ret); - ret = device_haptic_close(ad->entryinfo.haptic_handle); - if (ret != 0) - gl_dbgE("device_haptic_close failed[%d]!", ret); - ad->entryinfo.haptic_handle = 0; + ret = haptic_deinitialize(); + if (ret != HAPTIC_ERROR_NONE) + gl_dbgE("haptic_deinitialize failed[%d]!", ret); + ad->entryinfo.haptic_handle = -1; } return 0; @@ -477,76 +348,11 @@ static Eina_Bool _gl_vibration_timer_cb(void *data) return ECORE_CALLBACK_CANCEL; } -/* copy of function "ecore_file_cp" from the file "ecore_file.c" for lock debugging */ -/** - * Copy a file - * @param src The name of the source file - * @param dst The name of the destination file - * @return EINA_TRUE on success, EINA_FALSE on failure - */ -Eina_Bool -gl_file_cp(const char *src, const char *dst) -{ - GL_CHECK_FALSE(src); - GL_CHECK_FALSE(dst); - gl_dbg("src: %s", src); - gl_dbg("dest: %s", dst); - - FILE *f1, *f2; - char buf[GL_FILE_COPY_BUF_MAX] = { 0, }; - char realpath1[GL_FILE_PATH_LEN_MAX] = { 0, }; - char realpath2[GL_FILE_PATH_LEN_MAX] = { 0, }; - size_t num; - Eina_Bool ret = EINA_TRUE; - - if (!realpath(src, realpath1)) - { - gl_dbg("src path is not real, return!"); - return EINA_FALSE; - } - if (realpath(dst, realpath2) && !strcmp(realpath1, realpath2)) - { - gl_dbg("dst path is not real, return!"); - return EINA_FALSE; - } - - f1 = fopen(src, "rb"); - if (!f1) - { - gl_dbg("Can't open src file, return!"); - return EINA_FALSE; - } - f2 = fopen(dst, "wb+"); - if (!f2) - { - gl_dbg("Can't open dst file, return!"); - fclose(f1); - return EINA_FALSE; - } - while ((num = fread(buf, 1, sizeof(buf), f1)) > 0) - { - if (num > sizeof(buf)) - { - fclose(f1); - fclose(f2); - return EINA_FALSE; - } - if (fwrite(buf, 1, num, f2) != num) - { - gl_dbg("fwrite failed, return"); - ret = EINA_FALSE; - } - } - fclose(f1); - fclose(f2); - return ret; -} - /* 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-service DB asynchronously. +* 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. @@ -556,17 +362,17 @@ gl_file_cp(const char *src, const char *dst) /* * stop using "rename" when moving from mmc to phone for correct db update. */ -Eina_Bool gl_file_mv(void *data, const char *src, const char *dst, int type) +static Eina_Bool __gl_file_mv(gl_item *gitem, const char *src, const char *dst, int type) { GL_CHECK_FALSE(src); GL_CHECK_FALSE(dst); - int ret = -1; - gl_appdata *ad = (gl_appdata *)data; - gl_dbg("\n\tSrc: %s\n\t Dest: %s", src, dst); + GL_CHECK_FALSE(gitem); + + gl_dbg("\n\tSrc: %s\n\tDest: %s", src, dst); /* Move thumb first */ - if ((ret = minfo_move_media(ad->maininfo.db_handle, src, dst, type)) < 0) { - gl_dbgE("Move media thumbnail failed[%d]!", ret); + if (_gl_local_data_move_media(gitem->item, dst) < 0) { + gl_dbgE("Move media thumbnail failed!"); return EINA_FALSE; } @@ -619,6 +425,145 @@ Eina_Bool gl_file_mv(void *data, const char *src, const char *dst, int type) return EINA_TRUE; } +#ifdef _USE_ROTATE_BG +/* b_path == true, Use saved folder path to check cluster uuid */ +static int __gl_refresh_albums_list(void *data, bool b_path) +{ + 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); + _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; + } + } + + if (uuid) + free(uuid); + return 0; +} + +#endif + +static char *__gl_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!"); + free(final_path); + final_path = NULL; + 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_validate_album_name(const char *new_name) { @@ -655,6 +600,7 @@ gl_get_entry_text(Evas_Object * entry, char *entry_text, int len_max) if (strlen(entry_str) == 0) { gl_dbg("Entry string is empty!"); + //free(entry_str); } else { @@ -749,7 +695,7 @@ int gl_get_selected_files_path_str(void *data, gchar sep_c, char **path_str, int GL_CHECK_VAL(path_str, -1); GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - GL_CHECK_VAL(ad->selectedinfo.medias_elist, GL_UG_FAIL); + 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; @@ -857,24 +803,36 @@ gl_move_media_item(gl_item * gitem, char *new_dir_name, bool is_full_path, int * new_dir_name, (char *)(gitem->item->display_name)); gl_dbg("New path : %s", new_path); - if (!strcmp(new_path, gitem->item->file_url)) //do not need to move. ("All" album case) + 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 -1; } else if (ecore_file_exists(new_path)) // return true if file exists, rename new file. { - //add item id to set different file path _gl_get_file_ext(new_path, ext, new_path_noext); + char *final_path = NULL; + final_path = __gl_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); - /* Checkme: Use numeric to replace string */ - snprintf(new_path, sizeof(new_path), "%s_%s.%s", - new_path_noext, gitem->item->uuid, ext); - gl_dbg("Different file has same path, create new one : %s", new_path); + g_strlcpy(new_path, final_path, GL_FILE_PATH_LEN_MAX); + free(final_path); + final_path = NULL; //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 @@ -891,8 +849,7 @@ gl_move_media_item(gl_item * gitem, char *new_dir_name, bool is_full_path, int * new_path[strlen(new_path)] = '\0'; // stop using "rename" when moving from mmc to phone for correct db update. - if (gl_file_mv(gitem->ad, gitem->item->file_url, new_path, - gitem->item->type) == EINA_FALSE) + if (!__gl_file_mv(gitem, gitem->item->file_url, new_path, gitem->item->type)) { gl_dbg("Move media item OVER<<<"); return -1; @@ -915,7 +872,7 @@ bool gl_check_gallery_empty(void* data) gl_appdata *ad = (gl_appdata *)data; if (ad->albuminfo.cluster_list == NULL) { - gl_dbgE("ad->albuminfo.cluster_list == NULL"); + gl_dbgE("ad->albuminfo.cluster_list is empty!"); return true; } @@ -930,6 +887,7 @@ bool gl_check_gallery_empty(void* data) gl_dbgW("Albums list is empty!"); return true; } + return false; } @@ -970,22 +928,25 @@ bool gl_is_image_valid(void *data, char *filepath) bool gl_is_rotation_locked(void) { + gl_dbg_launch(" gl_is_rotation_locked:start"); int lock = -1; if (!vconf_get_bool(VCONFKEY_SETAPPL_ROTATE_LOCK_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. +* Check MMC state(Inserted/Removed) for Move/Delete */ int gl_check_mmc_state(void *data, char *dest_folder) @@ -998,9 +959,7 @@ gl_check_mmc_state(void *data, char *dest_folder) return 0; int on_mmc = -1; - /** - * Albums: Move/Delete. - */ + /* Move files to MMC album */ if (dest_folder) { on_mmc = strncmp(GL_ROOT_PATH_MMC, dest_folder, @@ -1015,8 +974,8 @@ gl_check_mmc_state(void *data, char *dest_folder) GL_CHECK_VAL(cur_album->cluster, -1); /* Move files from MMC album */ GL_CHECK_VAL(cur_album->cluster->uuid, -1); - gl_db_get_folder_fullpath(ad, cur_album->cluster->uuid, - src_folder_path); + 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] */ @@ -1027,6 +986,7 @@ gl_check_mmc_state(void *data, char *dest_folder) if (_gl_check_mmc_file_selected(ad)) goto ON_MMC; } + return 0; ON_MMC: @@ -1083,72 +1043,10 @@ int gl_dereg_db_update_noti(void) return 0; } -int -gl_reg_mass_storage_noti(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - int error_code = -1; - gl_dbg("Enable the noti handle for Mass storage Status!\n"); - - error_code = vconf_notify_key_changed(VCONFKEY_USB_STORAGE_STATUS, - _gl_mass_storage_noti_cb, ad); - if (error_code == -1) - { - gl_dbgE("vconf_notify_key_changed for VCONFKEY_FILEMANAGER_MMC_STATUS FAIL!"); - } - - return 0; -} - -int -gl_dereg_mass_storage_noti(void) -{ - int error_code = -1; - gl_dbg("Disable the noti handle for Mass storage Status!\n"); - - error_code = vconf_ignore_key_changed(VCONFKEY_USB_STORAGE_STATUS, - _gl_mass_storage_noti_cb); - if (error_code == -1) - { - gl_dbgE("_gl_mass_storage_noti_cb free for VCONFKEY_FILEMANAGER_MMC_STATUS FAIL!"); - } - - return 0; -} - -//mass storage check -int -gl_get_mass_storage_state(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - int mass_storage_state = -1; - int exit_mode = GL_APP_EXIT_NONE; - gl_dbg(""); - - if (!vconf_get_int(VCONFKEY_USB_STORAGE_STATUS, &mass_storage_state)) - { - gl_dbg("current mass_storage status : %d", mass_storage_state); - if (mass_storage_state == VCONFKEY_USB_STORAGE_STATUS_UMS_ON || - mass_storage_state == VCONFKEY_USB_STORAGE_STATUS_UMS_MMC_ON) - { - gl_dbg("mmc_state[%d] : VCONFKEY_USB_STORAGE_STATUS_UMS_ON or VCONFKEY_USB_STORAGE_STATUS_UMS_MMC_ON", mass_storage_state); - // mass storage mode activated - exit_mode = GL_APP_EXIT_MASS_STORAGE; - } - } - - ad->maininfo.app_exit_mode = exit_mode; - - return 0; -} - /* * Get view mode of app */ -int -gl_get_view_mode(void *data) +int gl_get_view_mode(void *data) { GL_CHECK_VAL(data, GL_VIEW_NONE); gl_appdata *ad = (gl_appdata *)data; @@ -1158,12 +1056,13 @@ gl_get_view_mode(void *data) /* * Set view mode of app */ -int -gl_set_view_mode(void *data, int mode) +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; } @@ -1182,6 +1081,7 @@ int gl_del_invalid_widgets(void *data, int invalid_m) 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); @@ -1193,21 +1093,23 @@ int gl_del_invalid_widgets(void *data, int invalid_m) case GL_INVALID_RENAME_ALBUM: /* gl_ui_edit_cancel pop navigationbar */ gl_dbgW("Destroy Rename album view!"); - elm_naviframe_item_pop(ad->maininfo.navi_bar); + elm_naviframe_item_pop(ad->maininfo.naviframe); gl_set_view_mode(ad, GL_VIEW_ALBUMS_EDIT); - gl_ui_destroy_imf(ad); + _gl_editfield_destroy_imf(ad); break; case GL_INVALID_NEW_ENTRY: case GL_INVALID_NEW_ENTRY_NOC: if (ad->entryinfo.entry_mode == GL_ENTRY_NEW_ALBUM) { - gl_dbg("Destroy New album!"); - if (invalid_m == GL_INVALID_NEW_ENTRY) - elm_naviframe_item_pop(ad->maininfo.navi_bar); - gl_ui_destroy_imf(ad); + gl_dbg("Destroy New album 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.edit_layout; const char *sig = NULL; - sig = "elm,swallow_view,state,thumb_edit_default"; + sig = "elm,swallow_view,state,edit"; edje_object_signal_emit(_EDJ(edit_ly), sig, "elm"); } break; @@ -1218,14 +1120,13 @@ int gl_del_invalid_widgets(void *data, int invalid_m) return 0; } -int -gl_del_medias(void *data) +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_db_selected_list_count(ad); + 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); @@ -1235,22 +1136,22 @@ gl_del_medias(void *data) return 0; } -/* Delete medias */ +/* '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_db_selected_list_count(ad); + 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_db_get_item_by_index(ad, i, true, &gitem); + _gl_data_get_item_by_index(ad, i, true, &gitem); if (gitem != NULL && gitem->item != NULL) - gl_db_remove_item(gitem); + _gl_data_remove_item(gitem); else gl_dbgE("Invalid item!"); @@ -1262,52 +1163,113 @@ int gl_del_selected(void *data) 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, ad->gridinfo.layout, + noti_str); + } else { + gl_dbgW("Empty album, change to Albums view!"); + gl_albums_comeback_from_view(ad); + elm_naviframe_item_pop_to(ad->albuminfo.nf_it); + + if (gl_check_gallery_empty(ad)) { + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + true); + } else if (ad->albuminfo.cluster_list->edit_cnt == 0) { + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + true); + } + + _gl_notify_destroy_selinfo(ad); + /* Add notification */ + _gl_notify_create_notiinfo(ad, ad->albuminfo.layout, + 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_db_selected_list_finalize(ad); + _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); - if (ad->maininfo.medias_cnt > 0) { - /* Deleting process done, change to normal view */ - gl_ui_edit_cancel(ad); + _gl_update_operation_view(ad, GL_STR_DELETED); + + return 0; +} + +/* Delete video file */ +int _gl_del_video(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_item *gitem = (gl_item *) data; + GL_CHECK_VAL(gitem->ad, -1); + gl_appdata *ad = (gl_appdata *)gitem->ad; + + /* Mode item */ + Elm_Object_Item *it = NULL; + it = (Elm_Object_Item *)elm_genlist_decorated_item_get(ad->listinfo.videos_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 (ad->listinfo.sweep_file_path) { + free(ad->listinfo.sweep_file_path); + ad->listinfo.sweep_file_path = NULL; + } - if (view_mode == GL_VIEW_THUMBS_EDIT) - _gl_display_iv_nocontents(ad); + /* Destroy it and remove its record from DB */ + _gl_data_remove_item(gitem); + int view_mode = gl_get_view_mode(ad); + gl_dbg("view_mode: %d.", view_mode); + gl_refresh_albums_list(ad); + + if (ad->maininfo.medias_cnt > 0) { + gl_list_update_view(ad); /* Add notification */ - gl_ui_create_notiinfo(ad, ad->gridinfo.layout, - GL_UI_NOTIFY_DELETED); + _gl_notify_create_notiinfo(ad, ad->gridinfo.layout, + GL_STR_DELETED); } else { gl_dbgW("Empty album, change to Albums view!"); gl_albums_comeback_from_view(ad); elm_naviframe_item_pop_to(ad->albuminfo.nf_it); if (gl_check_gallery_empty(ad)) { - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - true); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + true); } else if (ad->albuminfo.cluster_list->edit_cnt == 0) { - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - true); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + true); } - gl_ui_destroy_selinfo(ad); - /* Add notification */ - gl_ui_create_notiinfo(ad, ad->albuminfo.layout, - GL_UI_NOTIFY_DELETED); + _gl_notify_create_notiinfo(ad, ad->albuminfo.layout, + GL_STR_DELETED); } return 0; } -int -gl_remove_album(void *data, gl_cluster * album_item) +int gl_remove_album(void *data, gl_cluster * album_item) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; @@ -1317,70 +1279,60 @@ gl_remove_album(void *data, gl_cluster * album_item) if (album_item == NULL || album_item->cluster == NULL || album_item->cluster->uuid == NULL) { gl_dbgE("Invalid album!"); - return GL_DB_FAIL; + return -1; } - gl_dbg("Remove album: %s, id=%s, cluster_index=%d", - album_item->cluster->display_name, album_item->cluster->uuid, - album_item->index); - // get folder path of album - res = gl_db_get_folder_fullpath(ad, album_item->cluster->uuid, dir_path); - if (res < 0) - { - gl_dbg("get folder fullpath failed, error=%d", res); - return GL_DB_FAIL; - } - else - { - gl_dbg("folder fullpath: %s", dir_path); - } - // remove all items in the album from file system and db - gl_db_get_item_list(ad, album_item, GL_GET_ALL_RECORDS, - GL_GET_UNTIL_LAST_RECORD); - if (ad->albuminfo.cluster_list) - { - ad->albuminfo.cluster_list->cur_pos = album_item->index; + 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, 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, minfo_delete_cluster would delete medias record */ + /* Remove files, _gl_local_data_delete_album would delete medias record */ for (i = cnt; i >= 1; i--) { - gl_db_get_item_by_index(ad, i, false, &gitem); + _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 = minfo_delete_cluster(ad->maininfo.db_handle, - album_item->cluster->uuid); - if (res < 0) - { - gl_dbg("minfo_delete_cluster failed, error=%d", res); - } + /* 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) - { + /* remove album from file system */ + if (ecore_file_rmdir(dir_path) == EINA_FALSE) { gl_dbg("ecore_file_rmdir failed!"); - return GL_DB_FAIL; + return -1; } - return GL_DB_SUCCESS; + return 0; } -int -gl_del_albums(void *data) +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_db_get_albums_selected_cnt(ad); + int cnt = _gl_data_get_albums_selected_cnt(ad); int i = 0; int ret = -1; gl_dbg(""); @@ -1402,13 +1354,15 @@ gl_del_albums(void *data) if (album_item && album_item->cluster && album_item->cluster->uuid) { - gl_dbg("Delete album: %s, id=%s, cluster_index=%d", + gl_dbg("Delete album: %s, id=%s", album_item->cluster->display_name, - album_item->cluster->uuid, album_item->index); + 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; } } } @@ -1417,18 +1371,20 @@ gl_del_albums(void *data) gl_ui_edit_cancel(ad); //add notification - gl_ui_create_notiinfo(ad, ad->albuminfo.layout, - GL_UI_NOTIFY_DELETED); + _gl_notify_create_notiinfo(ad, ad->albuminfo.layout, + GL_STR_DELETED); return 0; } int gl_refresh_albums_list(void *data) { +#ifdef _USE_ROTATE_BG + return __gl_refresh_albums_list(data, 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, }; - int i = 0; gl_cluster *current = NULL; bool b_get_cur_album = false; /* Albums list would be update, reset flag */ @@ -1444,30 +1400,29 @@ int gl_refresh_albums_list(void *data) gl_dbg("None album selected, current album is unavailable."); } - gl_db_get_cluster_list(ad); + _gl_data_get_cluster_list(ad); /* need to reset current album */ ad->albuminfo.current_album = NULL; - ad->albuminfo.cluster_list->cur_pos = 0; if (b_get_cur_album) { - gl_db_get_cluster_by_id(ad, cluster_id, ¤t, &i); + _gl_data_get_cluster_by_id(ad, cluster_id, ¤t); if(current && current->cluster) { - ad->albuminfo.cluster_list->cur_pos = i; ad->albuminfo.current_album = current; gl_dbg("Reset current album: %s", current->cluster->display_name); - gl_db_update_item_list(ad); + _gl_data_update_item_list(ad); return 0; } else { /* Clear items list if current album doesn't exist */ if (ad->selectedinfo.medias_elist) - gl_db_selected_list_finalize(ad); - gl_db_clear_item_list(ad); + _gl_data_selected_list_finalize(ad); + _gl_data_clear_default_item_list(ad); ad->maininfo.medias_cnt = 0; } } return 0; +#endif } /** @@ -1483,8 +1438,8 @@ gl_move_root_album(void* data, gl_cluster* cur_album, char* dest_path) gl_appdata *ad = (gl_appdata *)data; /* Get all medias of current album */ - gl_db_get_item_list(ad, cur_album, GL_GET_ALL_RECORDS, - GL_GET_ALL_RECORDS); + _gl_data_get_item_list(ad, cur_album, GL_GET_ALL_RECORDS, + GL_GET_ALL_RECORDS); Eina_List* tmp_elist = NULL; gl_item* gitem = NULL; @@ -1507,13 +1462,13 @@ gl_move_root_album(void* data, gl_cluster* cur_album, char* dest_path) else { gl_dbgE("Invalid item!"); - gl_db_clear_item_list(ad); + _gl_data_clear_default_item_list(ad); return -1; } } /* Free item list */ - gl_db_clear_item_list(ad); + _gl_data_clear_default_item_list(ad); return 0; } @@ -1525,13 +1480,13 @@ int gl_move_selected(void *data) gl_appdata *ad = (gl_appdata *)data; int i = 0; /* Get selected medias count */ - int cnt = gl_db_selected_list_count(ad); + 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_db_get_item_by_index(ad, i, true, &gitem); + _gl_data_get_item_by_index(ad, i, true, &gitem); if (gitem && gitem->item) { gl_dbg("Selected [%s]", gitem->item->file_url); @@ -1562,13 +1517,13 @@ int gl_move_to_album(void *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_db_selected_list_count(ad); + 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.move_album_id == NULL) { + if (ad->albuminfo.path == NULL) { gl_dbg("---Popup list item: New album---"); ad->albuminfo.move_new_album = true; @@ -1588,14 +1543,12 @@ int gl_move_to_album(void *data) } snprintf(folder_fullpath, GL_DIR_PATH_LEN_MAX, "%s/%s", default_path, ad->albuminfo.new_album_name); - /* add cluster record, sometimes it cannot be got while refresh cluster list. */ - gl_db_add_cluster(ad, folder_fullpath); } else { ad->albuminfo.move_new_album = false; - gl_db_get_folder_fullpath(ad, ad->albuminfo.move_album_id, - folder_fullpath); - free(ad->albuminfo.move_album_id); - ad->albuminfo.move_album_id = NULL; + g_strlcpy(folder_fullpath, ad->albuminfo.path, + GL_DIR_PATH_LEN_MAX); + free(ad->albuminfo.path); + ad->albuminfo.path = NULL; } if (cur_album == NULL || cur_album->cluster == NULL) @@ -1622,45 +1575,252 @@ int gl_update_move_view(void *data) gl_appdata *ad = (gl_appdata *)data; int view_mode = gl_get_view_mode(ad); gl_dbg("view_mode: %d", view_mode); - gl_db_selected_list_finalize(ad); - gl_ui_destroy_selinfo(ad); + _gl_data_selected_list_finalize(ad); + _gl_notify_destroy_selinfo(ad); /* Update albums list and items list */ gl_refresh_albums_list(ad); - if (ad->maininfo.medias_cnt > 0) { - gl_ui_back_to_normal(ad); + _gl_update_operation_view(ad, GL_STR_MOVED); - /* Nocontents view created when update video list */ - if (view_mode != GL_VIEW_VIDEOLIST) - gl_ui_display_nocontents(ad); + return 0; +} - /* Add notification */ - gl_ui_create_notiinfo(ad, ad->gridinfo.layout, - GL_UI_NOTIFY_MOVED); +/* Share album's content */ +int _gl_share_select_album(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + char *label = ad->popupinfo.popup_item_label; + gl_dbg("label : %s ", label); + + int cnt = _gl_data_get_albums_selected_cnt(ad); + gl_dbg("Selected album(s) count: %d.", cnt); + if (cnt < 1) { + gl_dbgE("None album selected!"); + gl_popup_create_popup(ad, GL_POPUP_NOBUT, + GL_STR_NO_ALBUMS_SELECTED); + return -1; + } + if (_gl_data_is_albums_selected_empty(ad)) { + gl_dbgE("None thumb 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); } else { - gl_dbgW("Empty current album, change to albums view!"); - /* No file exists after moving done, change to albums view */ - gl_albums_comeback_from_view(ad); - elm_naviframe_item_pop_to(ad->albuminfo.nf_it); + gl_dbgE("Wrong UG name!"); + return -1; + } + return 0; +} - if (gl_check_gallery_empty(ad)) { - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - true); - } else if (ad->albuminfo.cluster_list->edit_cnt == 0) { - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - true); +int gl_share_select_item(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + char *label = ad->popupinfo.popup_item_label; + gl_dbg("label : %s ", label); + int cnt = 0; + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_VIDEOLIST) + cnt = 1; + else + 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); + } +#ifdef _USE_WIFI + else if (!g_strcmp0(label, GL_SHARE_WIFI)) { + gl_ext_load_ug(ad, GL_UG_WIFI); + } +#endif + else { + gl_dbgE("Wrong UG name!"); + return -1; + } + + 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; + gl_media_s *new_item= 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); + + /* Delete old record */ + ret = _gl_data_delete_media(ad, gitem->item); + if (ret != 0) + gl_dbgE("media_info_delete_from_db failed[%d]!", + ret); + + _gl_exif_set_orientation(gitem->item->file_url, + new_orient); + + /* Add new record */ + ret = _gl_local_data_add_media(gitem->item->file_url, + NULL); + if (ret != 0) + gl_dbgE("Add media failed[%d]!", ret); + /* Get handle via file_url */ + new_item = NULL; + _gl_local_data_get_media_by_path(gitem->item->file_url, + &new_item); + } } else { - gl_ui_disable_toolbar_item(ad, false, GL_NAVI_ALBUMS, - false); + gl_dbgE("Invalid item!"); } - /* Add notification */ - gl_ui_create_notiinfo(ad, ad->albuminfo.layout, - GL_UI_NOTIFY_MOVED); + + /* Add some delay for last two images to wait for thumb updated */ + if (i > cnt - 2) + _gl_delay(GL_ROTATE_DELAY); + + /* Check new thumb of last image */ + if (i == cnt) { + gl_dbgW("Last image rotated, check thumb!"); + /* Fetch thumbnail from media-service */ + char *thumb = calloc(1, GL_FILE_PATH_LEN_MAX); + GL_CHECK_VAL(thumb, -1); + + if (new_item && new_item->media_h) + _gl_local_data_get_thumb(new_item, &thumb); + gl_dbg("Thumbnail[%s]", thumb); + /* Add another delay if thumb is invalid */ + if (!GL_FILE_EXISTS(thumb)) + _gl_delay(GL_ROTATE_DELAY); + } + + /* Free gl_media_s item */ + if (new_item) + _gl_data_type_free_glitem((void **)(&new_item)); + + gl_dbg("Write pipe, make progressbar updated!"); + gl_thread_write_pipe(ad, i, popup_op); + gitem = NULL; } 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); + __gl_refresh_albums_list(ad, true); + + memset(ad->albuminfo.dest_folder, 0x00, GL_DIR_PATH_LEN_MAX); + + _gl_update_operation_view(ad, GL_STR_ROTATED); + + return 0; +} + +#endif + Eina_Bool gl_update_view(void *data, int mode) { GL_CHECK_FALSE(data); @@ -1671,12 +1831,6 @@ Eina_Bool gl_update_view(void *data, int mode) gl_dbg("Don't need to update"); return EINA_FALSE; } - /* reset internationalization */ - int r = appcore_set_i18n(PACKAGE, LOCALEDIR); - if (r) { - gl_dbgE("appcore_set_i18n failed!"); - return EINA_FALSE; - } if (view_mode == GL_VIEW_ALBUMS || view_mode == GL_VIEW_ALBUMS_EDIT || @@ -1686,11 +1840,10 @@ Eina_Bool gl_update_view(void *data, int mode) } else if (view_mode == GL_VIEW_THUMBS || view_mode == GL_VIEW_VIDEOLIST) { 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 == MINFO_MMC) { + cur_album->cluster->type == GL_MMC) { gl_dbgW("MMC removed, change to albums view!"); gl_pop_to_ctrlbar_ly(ad, true); return EINA_TRUE; @@ -1710,7 +1863,7 @@ Eina_Bool gl_update_view(void *data, int mode) /* 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 == MINFO_MMC) { + cur_album->cluster->type == GL_MMC) { gl_dbgW("MMC removed, change to albums view!"); gl_pop_to_ctrlbar_ly(ad, true); return EINA_TRUE; @@ -1723,14 +1876,98 @@ Eina_Bool gl_update_view(void *data, int mode) 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_VIDEOLIST) { + return GL_SHARE_VIDEO_ONE; + } 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_albums_edit_view(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (ad->albuminfo.edit_layout) { + evas_object_del(ad->albuminfo.edit_layout); + ad->albuminfo.edit_view = NULL; + ad->albuminfo.edit_layout = NULL; + } + return 0; +} + int _gl_destroy_thumbs_edit_view(void *data) { GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; - GL_CHECK_VAL(ad->gridinfo.edit_view, -1); - evas_object_del(ad->gridinfo.edit_view); - ad->gridinfo.edit_view = NULL; - ad->gridinfo.edit_layout = NULL; + + if (ad->gridinfo.edit_layout) { + evas_object_del(ad->gridinfo.edit_layout); + ad->gridinfo.edit_view = NULL; + ad->gridinfo.edit_layout = NULL; + } return 0; } @@ -1745,19 +1982,19 @@ int gl_destroy_thumbs_view(void *data) if(ad->gridinfo.edit_view) { _gl_destroy_thumbs_edit_view(ad); - gl_db_selected_list_finalize(ad); + _gl_data_selected_list_finalize(ad); } else { - gl_albums_del_grid_append_idler(ad); + _gl_grid_del_append_idler(ad); } - gl_ui_destroy_selinfo(ad); + _gl_notify_destroy_selinfo(ad); /* destroy imf */ - gl_ui_destroy_imf(ad); + _gl_editfield_destroy_imf(ad); gl_grid_clear_view(ad); gl_list_clear_view(ad); ad->albuminfo.current_album = NULL; - ad->albuminfo.seg_mode = GL_CTRL_SEG_ALL; + ad->maininfo.seg_mode = GL_CTRL_SEG_ALL; /* Pop to controlbar layout */ elm_naviframe_item_pop_to(ad->albuminfo.nf_it); @@ -1772,7 +2009,7 @@ int gl_destroy_thumbs_view(void *data) * It's in thumbnails view, video list view, or selectioinfo view. * Destroy invalid widegets or UGs. * Pop current invalid view to controlbar layout, -* to show Albums view. +* to show Albums view */ int gl_pop_to_ctrlbar_ly(void *data, bool b_update_albums_list) { @@ -1788,19 +2025,17 @@ int gl_pop_to_ctrlbar_ly(void *data, bool 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."); gl_albums_comeback_from_view(ad); /* None albums, disable edit button/controlbar */ - gl_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, true); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, true); } 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_ui_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, - true); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_ALBUMS, + true); } return 0; } @@ -1812,19 +2047,17 @@ int gl_play_vibration(void *data) GL_CHECK_VAL(data, -1); gl_appdata *ad = (gl_appdata *)data; int ret = -1; - int effectvibe_pattern = EFFCTVIBE_NOTIFICATION; - if (ad->entryinfo.haptic_handle > 0) { + if (ad->entryinfo.haptic_handle >= 0) { gl_dbg("Remove previous haptic handle."); _gl_stop_vibration(ad); } - ret = device_haptic_open(DEV_IDX_0, 0); - if (ad->entryinfo.haptic_handle < 0) { - gl_dbgE("device_haptic_open failed[%d]!", ret); + ret = haptic_initialize(); + if (ret != HAPTIC_ERROR_NONE) { + gl_dbgE("haptic_initialize failed[%d]!", ret); return -1; } - ad->entryinfo.haptic_handle = ret; if (ad->entryinfo.vibration_timer) { ecore_timer_del(ad->entryinfo.vibration_timer); @@ -1834,59 +2067,87 @@ int gl_play_vibration(void *data) vibration_timer = ecore_timer_add(GL_TIMER_INTERVAL_VIBRATION, _gl_vibration_timer_cb, data); ad->entryinfo.vibration_timer = vibration_timer; - - ret = device_haptic_play_pattern(ad->entryinfo.haptic_handle, - effectvibe_pattern, 1, - HAPTIC_FEEDBACK_LEVEL_5); - - if (ret != 0) { - gl_dbgE("device_haptic_play_pattern failed[%d]!", ret); + ret = haptic_vibrate_monotone(GL_VIBRATION_DEVICE, + GL_VIBRATION_DURATION, HAPTIC_LEVEL_AUTO); + if (ret != HAPTIC_ERROR_NONE) { + gl_dbgE("haptic_play_pattern failed[%d]!", ret); return -1; } + ad->entryinfo.haptic_handle = GL_VIBRATION_DEVICE; return 0; } -char *_gl_get_thumb(void *data, const char *file_path, char **thumb_path) +/* 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; +} + +/* Fetch thumbnail from media-service, if it's invalid, generate new one */ +int _gl_get_thumb(void *data, const char *file_path, char **thumb_path) { - GL_CHECK_NULL(thumb_path); + GL_CHECK_VAL(thumb_path, -1); + GL_CHECK_VAL(file_path, -1); + GL_CHECK_VAL(data, -1); + /* Return if thumbnail is valid */ if (*thumb_path && ecore_file_exists(*thumb_path) && (ecore_file_size(*thumb_path) > 0)) { - return NULL; - } else if (*thumb_path) { + return 0; + } + + /* Free allocated memory first */ + if (*thumb_path) { gl_dbgW("Wrong thumb path[%s]", *thumb_path); free(*thumb_path); *thumb_path = NULL; } + gl_dbg("File[%s]", file_path); char *new_path = calloc(1, GL_FILE_PATH_LEN_MAX); - GL_CHECK_NULL(new_path); - if (data == NULL || file_path == NULL) { - snprintf(new_path, GL_FILE_PATH_LEN_MAX, "%s", - GL_DEFAULT_THUMB_ICON); - return new_path; - } + GL_CHECK_VAL(new_path, -1); - gl_appdata *ad = (gl_appdata *)data; - minfo_get_thumb_path(ad->maininfo.db_handle, file_path, new_path, - GL_FILE_PATH_LEN_MAX); - gl_dbgW("New path[%s]", new_path); - if (ecore_file_exists(new_path) && (ecore_file_size(new_path) > 0)) { - *thumb_path = new_path; - return NULL; - } else { - int ret = -1; - ret = thumbnail_request_from_db(file_path, new_path, - GL_FILE_PATH_LEN_MAX); - if (ret < 0) { - memset(new_path, 0x00, GL_FILE_PATH_LEN_MAX); - snprintf(new_path, GL_FILE_PATH_LEN_MAX, "%s", - GL_DEFAULT_THUMB_ICON); - return new_path; - } else { - *thumb_path = new_path; - gl_dbgW("New path[%s]", new_path); - return NULL; - } + /* Generate thumbnail via thumbnail-service */ + int ret = -1; + ret = thumbnail_request_from_db(file_path, new_path, + GL_FILE_PATH_LEN_MAX); + if (ret < 0) { + gl_dbgE("thumbnail_request_from_db failed!"); + return -1; } + + *thumb_path = new_path; + gl_dbg("Request thumbnail[%s]", new_path); + return 0; } + diff --git a/src/features/gl-button.c b/src/widget/gl-button.c similarity index 80% rename from src/features/gl-button.c rename to src/widget/gl-button.c index ae177da..c1c91aa 100755 --- a/src/features/gl-button.c +++ b/src/widget/gl-button.c @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -42,7 +42,7 @@ *********************************************************/ Evas_Object *_gl_but_create_but(Evas_Object *parent, gl_but_mode mode, const char *style) { - gl_dbg("button mode: %d", mode); + gl_dbg("Button mode: %d", mode); Evas_Object *btn = NULL; btn = elm_button_add(parent); @@ -53,14 +53,33 @@ Evas_Object *_gl_but_create_but(Evas_Object *parent, gl_but_mode mode, const cha EVAS_HINT_EXPAND); evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.5); - if (mode == GL_BUT_DEL) + switch (mode) { + case GL_BUT_DEL: elm_object_text_set(btn, GL_BUT_NAME_DELETE); - else if (mode == GL_BUT_CANCEL) + break; + case GL_BUT_CANCEL: elm_object_text_set(btn, GL_BUT_NAME_CANCEL); - else if (mode == GL_BUT_DONE) + break; + case GL_BUT_DONE: elm_object_text_set(btn, GL_BUT_NAME_DONE); - else if (mode == GL_BUT_RENAME) - elm_object_text_set(btn, GL_BUT_NAME_RENAME); + break; + case GL_BUT_SHARE: + elm_object_text_set(btn, GL_STR_SHARE); + break; +#ifdef _USE_ROTATE_BG + case GL_BUT_MORE: + elm_object_text_set(btn, GL_STR_MORE); + break; + case GL_BUT_ROTATE_LEFT: + elm_object_text_set(btn, GL_STR_ROTATE_LEFT); + break; + case GL_BUT_ROTATE_RIGHT: + elm_object_text_set(btn, GL_STR_ROTATE_RIGHT); + break; +#endif + default: + break; + } evas_object_show(btn); return btn; @@ -81,4 +100,5 @@ Evas_Object *_gl_but_create_but_popup(Evas_Object *parent, const char *text, But evas_object_smart_callback_add(btn, "clicked", cb_func, data); return btn; -} \ No newline at end of file +} + diff --git a/src/widget/gl-controlbar.c b/src/widget/gl-controlbar.c new file mode 100755 index 0000000..25318fb --- /dev/null +++ b/src/widget/gl-controlbar.c @@ -0,0 +1,523 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-gridview.h" +#include "gl-listview.h" +#include "gl-data.h" +#include "gl-strings.h" +#include "gl-notify.h" +#include "gl-progressbar.h" + +#define GL_CTRL_SEG_STYLE "gallery/default" + +#define GL_SEGMENT_WIDTH_MIN_INC (396*elm_config_scale_get()) + +static int __gl_ctrl_reset_toolbar_item(void *data, int seg_mode, bool force) +{ + 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 (seg_mode == GL_CTRL_SEG_VIDEOS) + is_zero = _gl_data_is_item_cnt_zero(ad, MEDIA_CONTENT_TYPE_VIDEO); + else if (seg_mode == GL_CTRL_SEG_IMAGES) + is_zero = _gl_data_is_item_cnt_zero(ad, MEDIA_CONTENT_TYPE_IMAGE); + + /* none items, disable 'edit' item */ + if (is_zero) { + _gl_ctrl_disable_item(ad->gridinfo.edit_it); + _gl_ui_disable_slideshow_btn(ad, true); + } else { + _gl_ctrl_enable_item(ad->gridinfo.edit_it); + _gl_ui_disable_slideshow_btn(ad, false); + } + + return 0; +} + +static void +_gl_ctrl_segment_change_cb(void *data, Evas_Object * obj, void *event_info) +{ + GL_CHECK(data); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *seg_it = NULL; + gl_dbg(""); + + if (ad->uginfo.ug_called_by_me || ad->gridinfo.grid_append_idler) { + gl_dbg("UG invoked or appending gridview."); + seg_it = elm_segment_control_item_get(obj, ad->maininfo.seg_mode); + GL_CHECK(seg_it); + elm_segment_control_item_selected_set(seg_it, EINA_TRUE); + return; + } + + int idx = 0; + seg_it = elm_segment_control_item_selected_get(obj); + GL_CHECK(seg_it); + idx = elm_segment_control_item_index_get(seg_it); + + if (idx == 0) + { + gl_dbg("Creating all-media view"); + ad->maininfo.seg_mode = GL_CTRL_SEG_ALL; + __gl_ctrl_reset_toolbar_item(ad, GL_CTRL_SEG_ALL, false); + + if (ad->gridinfo.all_view == NULL) { + Evas_Object *grid = _gl_grid_create_view(ad, + ad->gridinfo.layout, + GL_GRID_ALL, + false); + ad->gridinfo.all_view = grid; + } else { + /* just update the data */ + ad->gridinfo.grid_view_mode = GL_GRID_ALL; + gl_grid_update_items(ad); + } + + elm_object_part_content_unset(ad->gridinfo.layout, + "elm.swallow.view"); + evas_object_hide(ad->listinfo.videos_view); + evas_object_hide(ad->gridinfo.images_view); + + evas_object_show(ad->gridinfo.all_view); + elm_object_part_content_set(ad->gridinfo.layout, + "elm.swallow.view", + ad->gridinfo.all_view); + gl_set_view_mode(ad, GL_VIEW_THUMBS); + } + else if (idx == 1) + { + gl_dbg("Creating image view"); + ad->maininfo.seg_mode = GL_CTRL_SEG_IMAGES; + __gl_ctrl_reset_toolbar_item(ad, GL_CTRL_SEG_IMAGES, false); + + if(ad->listinfo.videos_nocontents) + gl_list_clear_view(ad); + + if (ad->gridinfo.images_view == NULL) + { + Evas_Object *grid = _gl_grid_create_view(ad, + ad->gridinfo.layout, + GL_GRID_IMAGES, + false); + ad->gridinfo.images_view = grid; + } else { + /* just update the data */ + ad->gridinfo.grid_view_mode = GL_GRID_IMAGES; + gl_grid_update_items(ad); + } + + elm_object_part_content_unset(ad->gridinfo.layout, + "elm.swallow.view"); + evas_object_hide(ad->listinfo.videos_view); + evas_object_hide(ad->gridinfo.all_view); + + evas_object_show(ad->gridinfo.images_view); + elm_object_part_content_set(ad->gridinfo.layout, + "elm.swallow.view", + ad->gridinfo.images_view); + gl_set_view_mode(ad, GL_VIEW_THUMBS); + } + else if (idx == 2) + { + ad->maininfo.seg_mode = GL_CTRL_SEG_VIDEOS; + __gl_ctrl_reset_toolbar_item(ad, GL_CTRL_SEG_VIDEOS, false); + + gl_dbg("Creating video list"); + + /* Set the grid view mode for creating nocontents view */ + ad->gridinfo.grid_view_mode = GL_GRID_VIDEOS; + gl_set_view_mode(ad, GL_VIEW_VIDEOLIST); + + if(ad->gridinfo.images_nocontents) + { + evas_object_del(ad->gridinfo.images_view); + ad->gridinfo.images_nocontents = NULL; + ad->gridinfo.images_view = NULL; + } + + if (ad->listinfo.videos_view == NULL) { + Evas_Object *list_view = gl_list_create_view(ad, ad->maininfo.naviframe); + ad->listinfo.videos_view = list_view; + } else { + /* just update the data */ + gl_list_update_view(ad); + } + + elm_object_part_content_unset(ad->gridinfo.layout, + "elm.swallow.view"); + evas_object_hide(ad->gridinfo.all_view); + evas_object_hide(ad->gridinfo.images_view); + + evas_object_show(ad->listinfo.videos_view); + elm_object_part_content_set(ad->gridinfo.layout, + "elm.swallow.view", + ad->listinfo.videos_view); + } + +} + +static int __gl_ctrl_disable_toolbar_item(void *data, int mode, bool edit) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (mode == GL_NAVI_ALBUMS) { + gl_dbg("GL_NAVI_ALBUMS"); + /* disable 'edit' item */ + _gl_ctrl_disable_item(ad->albuminfo.edit_it); + } else if (mode == GL_NAVI_THUMBS) { + gl_dbg("GL_NAVI_THUMBS"); + + /* disable 'edit' item */ + _gl_ctrl_disable_item(ad->gridinfo.edit_it); + } else { + gl_dbgE("Unkonw mode"); + return -1; + } + + return 0; +} + +static int __gl_ctrl_enable_toolbar_item(void *data, int mode) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg("mode: %d", mode); + Evas_Object *bot_bar = NULL; + + 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) { + _gl_ctrl_enable_item(ad->albuminfo.edit_it); + } else { + _gl_ctrl_disable_item(ad->albuminfo.edit_it); + } + + /* Enable 'Camera' item in UMS off mode */ + _gl_ctrl_enable_item(ad->albuminfo.camera_it); + } else if (mode == GL_NAVI_THUMBS) { + gl_dbg("GL_NAVI_THUMBS"); + bot_bar = _gl_ctrl_get_toolbar(ad->gridinfo.nf_it); + if (ad->gridinfo.edit_it == NULL) { + Elm_Object_Item *edit_it = NULL; + Evas_Object *segment = NULL; + /* add 'Edit' item */ + edit_it = _gl_ui_append_edit(ad, bot_bar); + ad->gridinfo.edit_it = edit_it; + /* add segment */ + segment = _gl_ctrl_create_segment(ad, bot_bar); + _gl_ctrl_append_object_item(bot_bar, segment); + } else { + + /* enable 'edit' item */ + _gl_ctrl_enable_item(ad->gridinfo.edit_it); + } + + if (ad->maininfo.medias_cnt) + _gl_ui_disable_slideshow_btn(ad, false); + else + _gl_ui_disable_slideshow_btn(ad, true); + } else { + gl_dbgE("Unkonw mode"); + return -1; + } + + return 0; +} + +static int __gl_ctrl_enable_toolbar_items(gl_appdata *ad, Elm_Object_Item *nf_it) +{ + gl_dbg(""); + GL_CHECK_VAL(ad, -1); + GL_CHECK_VAL(nf_it, -1); + Elm_Object_Item *cbar_it = NULL; + bool b_disable_add = false; + bool b_disable_del = false; + bool b_disable_share = false; + Evas_Object *ctlbar = _gl_ctrl_get_toolbar(nf_it); + GL_CHECK_VAL(ctlbar, -1); + Elm_Object_Item *del_it = NULL; + Elm_Object_Item *share_it = NULL; + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_ALBUMS_EDIT) { + /* |Delete|Share|Add to home|Cancel| */ + del_it = elm_toolbar_first_item_get(ctlbar); + /* After 'Delete' item got, get 'Share' item */ + share_it = elm_toolbar_item_next_get(del_it); + + GL_CHECK_VAL(ad->albuminfo.selected_albums_elist, -1); + int sel_cnt = 0; + sel_cnt = _gl_data_get_albums_selected_cnt(ad); + + b_disable_add = true; + + gl_cluster *album_item = NULL; + int i = 0; + int local_cnt = 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; + } + if (!b_disable_share) { + local_cnt++; + } + /* All albums couldn't be deleted, so disable Delete item */ + if (!g_strcmp0(album_item->cluster->uuid, GL_ALBUM_ALL_ID)) { + gl_dbg("All albums, disable Delete item."); + b_disable_del = true; + /* Disable share*/ + if (sel_cnt > 1) + b_disable_share = true; + } + album_item = NULL; + } + } + + Elm_Object_Item *next_it = NULL; + next_it = elm_toolbar_first_item_get(ctlbar); + while (next_it) { + cbar_it = next_it; + next_it = elm_toolbar_item_next_get(next_it); + if ((b_disable_del && del_it && (cbar_it == del_it)) || + (b_disable_share && share_it && (cbar_it == share_it))) { + gl_dbg("Dim item..."); + _gl_ctrl_disable_item(cbar_it); + continue; + } + + if (elm_toolbar_item_icon_object_get(cbar_it)) + _gl_ctrl_enable_item(cbar_it); + else + gl_dbgW("Empty item, skip!"); + } + return 0; +} + +Evas_Object *_gl_ctrl_get_toolbar(Elm_Object_Item *nf_it) +{ + GL_CHECK_NULL(nf_it); + gl_dbg(""); + Evas_Object *obj = NULL; + + obj = elm_object_item_part_content_get(nf_it, "controlbar"); + if (obj) + return obj; + else + gl_dbgE("Title object is NULL!"); + + return NULL; +} + +Evas_Object *_gl_ctrl_create_toolbar(Evas_Object *parent) +{ + GL_CHECK_NULL(parent); + Evas_Object *cbar = NULL; + + cbar = elm_toolbar_add(parent); + GL_CHECK_NULL(cbar); + elm_toolbar_shrink_mode_set(cbar, ELM_TOOLBAR_SHRINK_EXPAND); + elm_toolbar_homogeneous_set(cbar, EINA_FALSE); + return cbar; +} + +/* create segment control in thumbnail view */ +Evas_Object *_gl_ctrl_create_segment(void *data, Evas_Object *parent) +{ + gl_dbg(""); + GL_CHECK_NULL(parent); + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + Elm_Object_Item *seg_item[GL_CTRL_SEG_CNT]; + Evas_Object *segment = NULL; + + /** + * Stop creating segment bar when launched by appsvc with + * specified file-type ( image or video ) only. + */ + if (ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM && + (ad->albuminfo.aul_file_type == GL_AUL_FILE_T_IMAGE || + ad->albuminfo.aul_file_type == GL_AUL_FILE_T_VIDEO)) { + gl_dbgW("Segment bar not created when launched by appsvc!"); + return NULL; + } + + Evas_Object *layout = elm_layout_add(parent); + GL_CHECK_NULL(layout); + evas_object_size_hint_min_set(layout, GL_SEGMENT_WIDTH_MIN_INC, 0); + elm_layout_file_set(layout, GL_EDJ_FILE, GL_GRP_SEGMENT); + 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); + + segment = elm_segment_control_add(layout); + GL_CHECK_NULL(segment); + seg_item[0] = elm_segment_control_item_add(segment, NULL, + GL_CTRL_SEG_ITEM_ALL); + seg_item[1] = elm_segment_control_item_add(segment, NULL, + GL_CTRL_SEG_ITEM_IMAGES); + seg_item[2] = elm_segment_control_item_add(segment, NULL, + GL_CTRL_SEG_ITEM_VIDEOS); + + if (ad->maininfo.seg_mode > GL_CTRL_SEG_VIDEOS) { + gl_dbgE("seg_mode > GL_CTRL_SEG_VIDEOS"); + return NULL; + } + elm_segment_control_item_selected_set(seg_item[ad->maininfo.seg_mode], + EINA_TRUE); + + elm_object_part_content_set(layout, "segment", segment); + ad->gridinfo.segment = segment; + evas_object_show(layout); + + evas_object_smart_callback_add(segment, "changed", + _gl_ctrl_segment_change_cb, ad); + return layout; +} + +int _gl_ctrl_disable_toolbar_item(void *data, bool disabled, int mode, + bool edit) +{ + GL_CHECK_VAL(data, -1); + gl_dbg("Title button disabled: %d.", disabled); + if (disabled) + __gl_ctrl_disable_toolbar_item(data, mode, edit); + else + __gl_ctrl_enable_toolbar_item(data, mode); + + return 0; +} + +int _gl_ctrl_disable_item(Elm_Object_Item *it) +{ + if (it) + elm_object_item_disabled_set(it, EINA_TRUE); + return 0; +} + +int _gl_ctrl_enable_item(Elm_Object_Item *it) +{ + if(it) + elm_object_item_disabled_set(it, EINA_FALSE); + return 0; +} + +int _gl_ctrl_disable_toolbar_items(void *data, Elm_Object_Item *nf_it, + bool b_disable, bool b_edit) +{ + gl_dbg("b_disable: %d, b_edit: %d", b_disable, b_edit); + GL_CHECK_VAL(data, -1); + GL_CHECK_VAL(nf_it, -1); + + if (!b_disable) { + __gl_ctrl_enable_toolbar_items(data, nf_it); + return 0; + } + + Elm_Object_Item *cbar_it = NULL; + Elm_Object_Item *next_it = NULL; + Evas_Object *ctlbar = _gl_ctrl_get_toolbar(nf_it); + /* |xxx|xxx|xxx|Cancel| */ + next_it = elm_toolbar_first_item_get(ctlbar); + Elm_Object_Item *cancel_it = NULL; + if (b_edit) + cancel_it = elm_toolbar_last_item_get(ctlbar); + + while (next_it) { + cbar_it = next_it; + next_it = elm_toolbar_item_next_get(next_it); + /* Skip Cancel item */ + if (cancel_it && cancel_it == cbar_it) + continue; + _gl_ctrl_disable_item(cbar_it); + } + return 0; +} + +/* Disable share item if DRM files selected */ +int _gl_ctrl_disable_share_item(gl_appdata *ad, Elm_Object_Item *nf_it) +{ + gl_dbg(""); + GL_CHECK_VAL(ad, -1); + GL_CHECK_VAL(nf_it, -1); + Elm_Object_Item *cbar_it = NULL; + Evas_Object *ctlbar = _gl_ctrl_get_toolbar(nf_it); + GL_CHECK_VAL(ctlbar, -1); + cbar_it = elm_toolbar_first_item_get(ctlbar); + int view_mode = gl_get_view_mode(ad); + Elm_Object_Item *share_it = NULL; + if (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_VIDEOLIST_EDIT || + view_mode == GL_VIEW_ALBUMS_EDIT) { + /*|Delete|Share|....*/ + cbar_it = elm_toolbar_first_item_get(ctlbar); + /* After 'Delete' item got, get 'Share' item */ + share_it = elm_toolbar_item_next_get(cbar_it); + } + while (cbar_it) { + if (share_it && (cbar_it == share_it)) { + gl_dbg("Disable [Share] item."); + _gl_ctrl_disable_item(cbar_it); + break; + } + cbar_it = elm_toolbar_item_next_get(cbar_it); + } + + return 0; +} + +int _gl_ctrl_append_object_item(Evas_Object *cbar, Evas_Object *object) +{ + Elm_Object_Item *item = NULL; + item = elm_toolbar_item_append(cbar, NULL, NULL, NULL, NULL); + if (object) + elm_object_item_part_content_set(item, "object", object); + else + _gl_ctrl_disable_item(item); + return 0; +} + +#ifdef _USE_ROTATE_BG +/* Add OptionHeader */ +Evas_Object *_gl_ctrl_add_optionheader(Evas_Object *parent) +{ + Evas_Object *toolbar = elm_toolbar_add(parent); + if (!toolbar) { + gl_dbgE("Failed to add toolbar!"); + return NULL; + } + + elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); + elm_object_style_set(toolbar, GL_CONTROLBAR_STYLE_NAVI); + return toolbar; +} +#endif + diff --git a/src/widget/gl-editfield.c b/src/widget/gl-editfield.c new file mode 100755 index 0000000..cf235ab --- /dev/null +++ b/src/widget/gl-editfield.c @@ -0,0 +1,310 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-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, ""); +} + +/* +* 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"); + } + } + + 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 and rename album + */ + 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() */ + if (entry_utf8) { + free(entry_utf8); + entry_utf8 = NULL; + } +} + +/* +* 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); + gl_appdata *ad = (gl_appdata *)data; + /* Unfocus to hide cursor */ + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_FALSE); + + _gl_ui_newalbum_done(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); + gl_appdata *ad = (gl_appdata *)data; + /* Unfocus to hide cursor */ + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_FALSE); + + _gl_ui_rename_album_done(data, true); +} + +Evas_Object *_gl_editfield_create(void *data, Evas_Object *parent, + char *default_label) +{ + GL_CHECK_NULL(data); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + Evas_Object *editfield_ly = NULL; + Evas_Object *lay = NULL; + Evas_Object *entry = NULL; + static Elm_Entry_Filter_Limit_Size limit_filter_data; + + lay = elm_layout_add(parent); + GL_CHECK_NULL(lay); + evas_object_size_hint_weight_set(lay, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + elm_layout_file_set(lay, GL_EDJ_FILE, GL_GRP_ENTRY); + + /* Single line with no title */ + editfield_ly = elm_layout_add(lay); + if (editfield_ly == NULL) { + gl_dbgE("elm_layout_add failed!"); + evas_object_del(lay); + return NULL; + } + elm_layout_theme_set(editfield_ly, "layout", "editfield", "gallery"); + evas_object_size_hint_weight_set(editfield_ly, 1, 1); + evas_object_size_hint_align_set(editfield_ly, 1, 0.5); + /* Set editfield layout to view layout */ + elm_object_part_content_set(lay, "entry_part", editfield_ly); + + entry = elm_entry_add(editfield_ly); + if (entry == NULL) { + gl_dbgE("elm_entry_add failed!"); + evas_object_del(lay); + return NULL; + } + elm_entry_scrollable_set(entry, EINA_TRUE); + elm_entry_single_line_set(entry, EINA_TRUE); + /* Set entry to editfield layout */ + elm_object_part_content_set(editfield_ly, "elm.swallow.content", entry); + + if (ad->entryinfo.entry_mode == 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); + } else if (ad->entryinfo.entry_mode == 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); + } else { + gl_dbgW("Wrong entry mode!"); + } + 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!"); + evas_object_del(lay); + return NULL; + } + + ad->entryinfo.imf_entry = entry; + ad->entryinfo.imf_context = elm_entry_imf_context_get(ad->entryinfo.imf_entry); + ad->entryinfo.haptic_handle = -1; + + 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, 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); + + ad->entryinfo.editfield = editfield_ly; + + return lay; +} + +/* Hide input panel and entry cursor */ +int _gl_editfield_hide_imf(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata* ad = (gl_appdata*)data; + + if (ad->entryinfo.imf_context) + ecore_imf_context_input_panel_hide(ad->entryinfo.imf_context); + /* Unfocus to hide cursor */ + elm_object_focus_set(ad->entryinfo.imf_entry, EINA_FALSE); + + return 0; +} + +int _gl_editfield_destroy_imf(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + ad->entryinfo.cancel_btn = NULL; + ad->entryinfo.done_btn = NULL; + ad->entryinfo.nf_it = NULL; + + 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_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_hide(ad->entryinfo.editfield); + + ad->entryinfo.imf_entry = NULL; + ad->entryinfo.imf_context = NULL; + ad->entryinfo.editfield = NULL; + ad->entryinfo.done_btn = NULL; + + return 0; +} diff --git a/src/widget/gl-nocontents.c b/src/widget/gl-nocontents.c new file mode 100755 index 0000000..7c9523a --- /dev/null +++ b/src/widget/gl-nocontents.c @@ -0,0 +1,171 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-gridview.h" +#include "gl-listview.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, }; + + int grid_mode = ad->gridinfo.grid_view_mode; + switch (grid_mode) { + case GL_GRID_ALL: + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_ITEMS)); + break; + case GL_GRID_VIDEOS: + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_VIDEOS)); + break; + case GL_GRID_IMAGES: + snprintf(label_str, sizeof(label_str), "%s", + (char *)(GL_STR_NO_IMAGES)); + break; + case GL_GRID_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_object_part_text_set(noc_lay, GL_NOCONTENTS_TEXT, label_str); + elm_layout_theme_set(noc_lay, "layout", "nocontents", "gallery"); + + 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 seg_mode = ad->maininfo.seg_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 (seg_mode == GL_CTRL_SEG_VIDEOS || + seg_mode == GL_CTRL_SEG_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 (seg_mode == GL_CTRL_SEG_VIDEOS && !b_video_exist && + gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO) { + b_video_exist = true; + break; + } else if (seg_mode == GL_CTRL_SEG_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 (seg_mode == GL_CTRL_SEG_VIDEOS && !b_video_exist) { + if (view_mode == GL_VIEW_VIDEOLIST_EDIT) { + gl_dbg("In edit mode, change to normal view."); + gl_ui_edit_cancel(ad); + } + + gl_dbg("None video files, show nocontents..."); + ret = true; + } else if (seg_mode == GL_CTRL_SEG_IMAGES && !b_image_exist) { + if (view_mode == GL_VIEW_THUMBS_EDIT) { + gl_dbg("In edit mode, change to normal view."); + gl_ui_edit_cancel(ad); + } + + gl_dbg("None image files, show nocontents..."); + Evas_Object *noc = _gl_nocontents_create(ad); + if (ad->gridinfo.images_view) { + evas_object_del(ad->gridinfo.images_view); + ad->gridinfo.images_view = NULL; + } + ad->gridinfo.images_view = noc; + ad->gridinfo.images_nocontents = noc; + elm_object_part_content_unset(ad->gridinfo.layout, + "elm.swallow.view"); + evas_object_hide(ad->listinfo.videos_view); + evas_object_hide(ad->gridinfo.all_view); + evas_object_show(ad->gridinfo.images_view); + elm_object_part_content_set(ad->gridinfo.layout, + "elm.swallow.view", + ad->gridinfo.images_view); + _gl_ctrl_disable_toolbar_item(ad, true, GL_NAVI_THUMBS, + false); + ret = true; + } + } + + return ret; +} + diff --git a/src/widget/gl-notify.c b/src/widget/gl-notify.c new file mode 100755 index 0000000..2e0f152 --- /dev/null +++ b/src/widget/gl-notify.c @@ -0,0 +1,354 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-notify.h" +#include "gl-gridview.h" +#include "gl-listview.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" + +static void __gl_notify_notiinfo_destroy_cb(void *data, Evas_Object *obj, + void *event_info) +{ + GL_CHECK(data); + gl_dbg(""); + _gl_notify_destroy_notiinfo(data); +} + +static void __gl_notify_selinfo_destroy_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_dbg(""); + _gl_notify_destroy_selinfo(ad); + + /* restore view while selectioninfo vanished */ + if (view_mode == GL_VIEW_ALBUMS_EDIT || + view_mode == GL_VIEW_ALBUMS_RENAME) + edje_object_signal_emit(_EDJ(ad->albuminfo.edit_layout), + "elm,swallow_view,state,edit", "elm"); +} + +/** +* Create a new notify widget +* b_selinfo, True: Create selectioninfo, False: Create notificationinfo. +*/ +static int __gl_notify_add(void *data, Evas_Object *parent, bool b_selinfo) +{ + gl_dbg("b_selinfo: %d.", b_selinfo); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + + if (b_selinfo) + _gl_notify_destroy_selinfo(ad); + else + _gl_notify_destroy_notiinfo(ad); + + ad->popupinfo.selinfo = elm_notify_add(parent); + elm_notify_orient_set(ad->popupinfo.selinfo, + ELM_NOTIFY_ORIENT_BOTTOM); + evas_object_size_hint_weight_set(ad->popupinfo.selinfo, + EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(ad->popupinfo.selinfo, + EVAS_HINT_FILL, + EVAS_HINT_FILL); + + ad->popupinfo.selinfo_ly = elm_layout_add(parent); + GL_CHECK_VAL(ad->popupinfo.selinfo_ly, -1); + /* Set custom theme to notify layout */ + elm_layout_theme_set(ad->popupinfo.selinfo_ly, "standard", + "selectioninfo", "selectioninfo_viewer"); + + 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); + /* Set the content of the notify widget */ + elm_object_content_set(ad->popupinfo.selinfo, ad->popupinfo.selinfo_ly); + + if (!b_selinfo) { + /* Add callbacks for notificationinfo */ + evas_object_smart_callback_add(ad->popupinfo.selinfo, + "timeout", + __gl_notify_notiinfo_destroy_cb, + ad); + elm_notify_timeout_set(ad->popupinfo.selinfo, 2); + } + return 0; +} + +int _gl_notify_create_notiinfo(void *data, Evas_Object *parent, + const char *text) +{ + GL_CHECK_VAL(text, -1); + GL_CHECK_VAL(parent, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int rotate_mode = 0; + gl_dbg("text: %s", text); + + __gl_notify_add(ad, parent, false); + GL_CHECK_VAL(ad->popupinfo.selinfo, -1); + GL_CHECK_VAL(ad->popupinfo.selinfo_ly, -1); + + rotate_mode = ad->maininfo.rotate_mode; + gl_dbg("rotate_mode = %d", rotate_mode); + /* Use different theme of seelctioninfo for different rotation */ + if ((rotate_mode == APP_DEVICE_ORIENTATION_270) || + (rotate_mode == APP_DEVICE_ORIENTATION_90)) { + /* move it upside controlbar */ + edje_object_signal_emit(_EDJ(ad->popupinfo.selinfo_ly), + "elm,selectioninfo,landscape", "elm"); + } else { + /* move it upside controlbar */ + edje_object_signal_emit(_EDJ(ad->popupinfo.selinfo_ly), + "elm,selectioninfo,portrait", "elm"); + } + + edje_object_part_text_set(_EDJ(ad->popupinfo.selinfo_ly), "elm.text", + text); + evas_object_show(ad->popupinfo.selinfo); + + return 0; +} + +int _gl_notify_destroy_notiinfo(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + /* The selectioninfo_ly was filled into selectioninfo, delete selectioninfo_ly first */ + if (ad->popupinfo.selinfo_ly) { + evas_object_del(ad->popupinfo.selinfo_ly); + ad->popupinfo.selinfo_ly = NULL; + } + + if (ad->popupinfo.selinfo) { + evas_object_smart_callback_del(ad->popupinfo.selinfo, + "timeout", + __gl_notify_notiinfo_destroy_cb); + evas_object_del(ad->popupinfo.selinfo); + ad->popupinfo.selinfo = NULL; + } + return 0; +} + +/** +* Update selectioinfo widget and view related to it +*/ +static int _gl_notify_update_view_selinfo(void *data, int selected_cnt) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + Evas_Object *sel_edj = NULL; + const char *emis = NULL; + Evas_Object *v_edj = NULL; + const char *v_emis = NULL; + int view_mode = gl_get_view_mode(ad); + int rotate_mode = ad->maininfo.rotate_mode; + gl_dbg("rotate_mode is %d", rotate_mode); + + sel_edj = _EDJ(ad->popupinfo.selinfo_ly); + + if (selected_cnt > 0) { + /* Use different theme of seelctioninfo for different rotation */ + if ((rotate_mode == APP_DEVICE_ORIENTATION_270) || + (rotate_mode == APP_DEVICE_ORIENTATION_90)) + emis = "elm,selectioninfo,landscape"; + else + emis = "elm,selectioninfo,portrait"; + v_emis = "elm,swallow_view,state,moveup"; + + if (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_VIDEOLIST_EDIT) + v_edj = _EDJ(ad->gridinfo.edit_layout); + else if (view_mode == GL_VIEW_ALBUMS_EDIT) + v_edj = _EDJ(ad->albuminfo.edit_layout); + + /* Set selectioninfo widget style */ + edje_object_signal_emit(sel_edj, emis, "elm"); + /* Move view up while selectioninfo shown. */ + edje_object_signal_emit(v_edj, v_emis, "elm"); + } else { + if (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_VIDEOLIST_EDIT) + v_edj = _EDJ(ad->gridinfo.edit_layout); + else if (view_mode == GL_VIEW_ALBUMS_EDIT) + v_edj = _EDJ(ad->albuminfo.edit_layout); + + v_emis = "elm,swallow_view,state,edit"; + + /* Restore view while selectioninfo vanished. */ + edje_object_signal_emit(v_edj, 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, true); + + /* 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, -1); + GL_CHECK_VAL(ad->popupinfo.selinfo_ly, -1); + + /* Update notify widget and view related to it */ + _gl_notify_update_view_selinfo(ad, selected_cnt); + + if (selected_cnt > 0) { + int share_m = gl_get_share_mode(ad); + /* Enable/Disable control bar buttons */ + _gl_ctrl_disable_toolbar_items(ad, nf_it, false, true); + if ((view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_VIDEOLIST_EDIT || + view_mode == GL_VIEW_ALBUMS_EDIT) && + share_m == GL_SHARE_DRM) { + gl_dbgW("Selected item is DRM file!"); + _gl_ctrl_disable_share_item(ad, nf_it); + } +#ifdef _USE_ROTATE_BG + if (share_m == GL_SHARE_IMAGE_ONE_JPEG || + share_m == GL_SHARE_IMAGE_MULTI_JPEG) + _gl_ui_disable_more_btn(ad, false); + else + _gl_ui_disable_more_btn(ad, true); +#endif + /* 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); + + evas_object_show(ad->popupinfo.selinfo); + } else { + /* Disable control bar buttons */ + _gl_ctrl_disable_toolbar_items(ad, nf_it, true, true); + _gl_notify_destroy_selinfo(ad); +#ifdef _USE_ROTATE_BG + _gl_ui_disable_more_btn(ad, true); +#endif + } + + return 0; +} + +int _gl_notify_destroy_selinfo(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + gl_dbg(""); + /* The selectioninfo_ly was filled into selectioninfo, delete selectioninfo_ly first */ + if (ad->popupinfo.selinfo_ly) { + evas_object_del(ad->popupinfo.selinfo_ly); + ad->popupinfo.selinfo_ly = NULL; + } + + if (ad->popupinfo.selinfo) { + evas_object_smart_callback_del(ad->popupinfo.selinfo, + "timeout", + __gl_notify_selinfo_destroy_cb); + evas_object_del(ad->popupinfo.selinfo); + ad->popupinfo.selinfo = NULL; + } + return 0; +} + +/* After rotate, exchange and display different theme of selectioninfo */ +int _gl_notify_rotate_selinfo(void *data) +{ + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + int pbar_cancel = false; + + gl_thread_get_cancel_state(ad, &pbar_cancel); + if (pbar_cancel) { + gl_dbg("Moving or deleting is in process, return;"); + return -1; + } + + if(ad->popupinfo.selinfo == NULL) + return -1; + + Evas_Object *v_edj = NULL; + const char *v_emis = NULL; + const char *sel_emis = NULL; + Evas_Object *sel_edj = _EDJ(ad->popupinfo.selinfo_ly); + int rotate_mode = ad->maininfo.rotate_mode; + int view_mode = gl_get_view_mode(ad); + + /* Use different theme of seelctioninfo for different rotation */ + if ((rotate_mode == APP_DEVICE_ORIENTATION_270) || + (rotate_mode == APP_DEVICE_ORIENTATION_90)) + sel_emis = "elm,selectioninfo,landscape"; + else + sel_emis = "elm,selectioninfo,portrait"; + + gl_dbg("view_mode:s %d, rotate_mode: %d", view_mode, + rotate_mode); + + v_emis = "elm,swallow_view,state,moveup"; + + if (view_mode == GL_VIEW_THUMBS_EDIT || + view_mode == GL_VIEW_VIDEOLIST_EDIT || + view_mode == GL_VIEW_THUMBS || view_mode == GL_VIEW_VIDEOLIST) + v_edj = _EDJ(ad->gridinfo.edit_layout); + else if (view_mode == GL_VIEW_ALBUMS_EDIT || + view_mode == GL_VIEW_ALBUMS) + v_edj = _EDJ(ad->albuminfo.edit_layout); + + edje_object_signal_emit(sel_edj, sel_emis, "elm"); + if (v_edj) + edje_object_signal_emit(v_edj, v_emis, "elm"); + + return 0; +} + diff --git a/src/features/gl-popup.c b/src/widget/gl-popup.c similarity index 68% rename from src/features/gl-popup.c rename to src/widget/gl-popup.c index 735b3de..fd9645d 100755 --- a/src/features/gl-popup.c +++ b/src/widget/gl-popup.c @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include "gallery.h" #include "gl-popup.h" #include "gl-ui-util.h" @@ -27,8 +26,6 @@ #define GL_POPUP_OBJ_DATA_KEY "popup_list_data" #define GL_GENLIST_ITEM_STYLE_1TEXT "1text" -#define GL_GENLIST_ITEM_STYLE_1TEXT_1ICON "1text.1icon" -#define GL_GENLIST_ITEM_STYLE_1TEXT_1ICON_2 "1text.1icon.2" #define GL_POPUP_STYLE_MIN_MENUSTYLE "min_menustyle" #define GL_POPUP_MENUSTYLE_WIDTH (614*elm_config_scale_get()) @@ -36,7 +33,6 @@ #define GL_POPUP_MENUSTYLE_HEIGHT_MAX (408*elm_config_scale_get()) #define GL_POPUP_TIMEOUT_1S 1.0 -#define GL_POPUP_TIMEOUT_2S 2.0 #define GL_POPUP_TIMEOUT_3S 3.0 static Eina_Bool __gl_popup_timeout_cb(void *data) @@ -81,7 +77,7 @@ static void __gl_popup_del_resp_cb(void *data, Evas_Object *obj, GL_CHECK(text); gl_dbg("Button: %s, mode: %d", text, ad->popupinfo.popup_mode); - if (!g_strcmp0(text, GL_STR_YES)) { + if (!g_strcmp0(text, GL_STR_DELETE)) { if (ad->popupinfo.popup_mode == GL_POPUP_ALBUM_DELETE) gl_del_albums(ad); } @@ -101,12 +97,35 @@ static void _gl_popup_move_to_album(void *data) * 'move_album_id == NULL' is new album case, * other move/save to some existed album. */ - if (ad->albuminfo.move_album_id) + if (ad->albuminfo.path) gl_move_to_album(ad); else gl_ui_move_to_newalbum(ad); } +static void __gl_popup_del_video_resp_cb(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; + 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_del_video(data); + + if (ad->popupinfo.popup) { + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + } +} + static void _gl_popup_resp_cb(void *data, Evas_Object *obj, void *event_info) { GL_CHECK(data); @@ -149,54 +168,50 @@ static void _gl_popup_resp_cb(void *data, Evas_Object *obj, void *event_info) ecore_imf_context_input_panel_hide(imf); gl_ui_cancel_rename_album(ad); } - } else if (mode == GL_POPUP_NOBUT_APPEXIT) { - if (ad->popupinfo.popup) { - evas_object_del(ad->popupinfo.popup); - ad->popupinfo.popup = NULL; - } - elm_exit(); - return; - } else if (mode == GL_POPUP_NOBUT_ENTRY) { - evas_object_show(ad->entryinfo.imf_entry); - elm_object_focus_set(ad->entryinfo.imf_entry, EINA_TRUE); - ecore_imf_context_input_panel_show(imf); } + if (ad->pbarinfo.pbar_popup) { + evas_object_del(ad->pbarinfo.pbar_popup); + ad->pbarinfo.pbar_popup = NULL; + } if (ad->popupinfo.popup) { evas_object_del(ad->popupinfo.popup); ad->popupinfo.popup = NULL; } } - -static char * -_gl_popup_list_get_text(void *data, Evas_Object * obj, const char *part) +static char *__gl_popup_list_get_text(void *data, Evas_Object *obj, const char *part) { GL_CHECK_NULL(obj); GL_CHECK_NULL(data); /* Get 'ad' via 'popup_list_data' */ gl_appdata *ad = (gl_appdata *)evas_object_data_get(obj, GL_POPUP_OBJ_DATA_KEY); GL_CHECK_NULL(ad); + //gl_dbg(""); int mode = ad->popupinfo.popup_mode; const char *label = NULL; /** - * Use index for album move, + * Use index for album move , * mainly for showing 'New album' */ int idx = 0; - if (!strcmp(part, "elm.text")) + if (!g_strcmp0(part, "elm.text")) { switch (mode) { + case GL_POPUP_THUMB_SHARE: + case GL_POPUP_ALBUM_SHARE: + label = (char *)data; + break; case GL_POPUP_THUMB_MOVE: idx = (int)data; - /* 1, Prevent pass NULL data */ + /* 1, Prevent pass NULL data; */ idx -= 2; if (idx == -1) { - label = GL_STR_NEW_ALBUM; //add "New album" item. + label = GL_STR_CREATE_ALBUM; //add "New album" item. } else { @@ -220,7 +235,7 @@ _gl_popup_list_get_text(void *data, Evas_Object * obj, const char *part) { label = album_item->cluster->display_name; } - else if (gl_db_is_root_path(ad, album_item->cluster->uuid, NULL)) //"root" case, set display name as "No Name" + else if (_gl_data_is_root_path(ad, album_item->cluster->path)) //"root" case, set display name as "No Name" { label = GL_ALBUM_PHOME_ROOT_NAME; } @@ -253,15 +268,7 @@ _gl_popup_list_get_text(void *data, Evas_Object * obj, const char *part) } } -static Evas_Object * -_gl_popup_list_get_icon(void *data, Evas_Object * obj, const char *part) -{ - gl_dbg(""); - return NULL; -} - -static Evas_Object * -_gl_popup_create_list(void *data, Evas_Object * parent, const char *item_type) +static Evas_Object *__gl_popup_create_list(void *data, Evas_Object *parent, const char *item_type) { GL_CHECK_NULL(parent); GL_CHECK_NULL(data); @@ -276,8 +283,8 @@ _gl_popup_create_list(void *data, Evas_Object * parent, const char *item_type) { ad->popupinfo.popuplit.item_style = GL_GENLIST_ITEM_STYLE_1TEXT; } - ad->popupinfo.popuplit.func.text_get = _gl_popup_list_get_text; - ad->popupinfo.popuplit.func.content_get = _gl_popup_list_get_icon; + ad->popupinfo.popuplit.func.text_get = __gl_popup_list_get_text; + ad->popupinfo.popuplit.func.content_get = NULL; ad->popupinfo.popuplit.func.state_get = NULL; ad->popupinfo.popuplit.func.del = NULL; @@ -295,7 +302,7 @@ static void _gl_popup_move_cb(void *data, Evas_Object * obj, void *event_info) { gl_dbg(""); - Elm_Object_Item *item = (Elm_Object_Item *) event_info; + Elm_Object_Item *item = (Elm_Object_Item *)event_info; if (item) { elm_genlist_item_selected_set(item, EINA_FALSE); @@ -305,13 +312,14 @@ _gl_popup_move_cb(void *data, Evas_Object * obj, void *event_info) GL_CHECK(obj); gl_appdata *ad = (gl_appdata *)evas_object_data_get(obj, GL_POPUP_OBJ_DATA_KEY); GL_CHECK(ad); - if (ad->albuminfo.move_album_id) { - free(ad->albuminfo.move_album_id); - ad->albuminfo.move_album_id = NULL; + if (ad->albuminfo.path) { + free(ad->albuminfo.path); + ad->albuminfo.path = NULL; } if (data) - ad->albuminfo.move_album_id = strdup((char *)data); - gl_dbg("Dest album id: %s", ad->albuminfo.move_album_id); + ad->albuminfo.path = strdup((char *)data); + + gl_dbg("Dest album path: %s", ad->albuminfo.path); if (ad->popupinfo.popup) { evas_object_del(ad->popupinfo.popup); @@ -321,6 +329,93 @@ _gl_popup_move_cb(void *data, Evas_Object * obj, void *event_info) _gl_popup_move_to_album(ad); } +static void +_gl_popup_share_cb(void *data, Evas_Object * obj, void *event_info) +{ + GL_CHECK(data); + /* Get 'ad' via 'GL_POPUP_OBJ_DATA_KEY' */ + GL_CHECK(obj); + gl_appdata *ad = (gl_appdata *)evas_object_data_get(obj, GL_POPUP_OBJ_DATA_KEY); + GL_CHECK(ad); + gl_dbg(""); + + g_strlcpy(ad->popupinfo.popup_item_label, (char *)data, GL_ALBUM_NAME_LEN_MAX); + + if (ad->popupinfo.popup) { + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + } + + int view_mode = gl_get_view_mode(ad); + if (view_mode == GL_VIEW_ALBUMS_EDIT) + _gl_share_select_album(ad); + else + gl_share_select_item(ad); +} + +/* Append items to list in popup for 'Share' */ +static int _gl_popup_append_share_items(void *data, Evas_Object *genlist) +{ + gl_dbg(""); + GL_CHECK_VAL(genlist, -1); + GL_CHECK_VAL(data, -1); + gl_appdata *ad = (gl_appdata *)data; + const char *lb = NULL; + int i = 0; + int item_cnt = 0; + Elm_Genlist_Item_Class *plit = &(ad->popupinfo.popuplit); + + 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}, +#ifdef _USE_WIFI + {GL_POPUP_SHARE_WIFI, GL_SHARE_WIFI}, +#endif + }; + + /** + * 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; + } + + int view_mode = gl_get_view_mode(ad); + /* Share albums */ + if (view_mode == GL_VIEW_ALBUMS_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_genlist_item_append(genlist, plit, (void *)lb, NULL, + ELM_GENLIST_ITEM_NONE, + _gl_popup_share_cb, (void *)lb); + item_cnt++; + } + return item_cnt; + } + + for (i = 0; i < GL_POPUP_SHARE_NUM; i++) { + lb = popup_share_tbl[i].label; + if (lb == NULL || strlen(lb) == 0) + continue; + elm_genlist_item_append(genlist, plit, (void *)lb, NULL, + ELM_GENLIST_ITEM_NONE, + _gl_popup_share_cb, (void *)lb); + item_cnt++; + } + return item_cnt; +} + /* Append items to list in popup for 'Move' */ static int _gl_popup_append_move_items(void *data, Evas_Object *genlist) { @@ -336,9 +431,6 @@ static int _gl_popup_append_move_items(void *data, Evas_Object *genlist) gl_cluster *album_item = NULL; Elm_Genlist_Item_Class *plit = &(ad->popupinfo.popuplit); gl_cluster *current_album = ad->albuminfo.current_album; - GL_CHECK_VAL(current_album, -1); - GL_CHECK_VAL(current_album->cluster, -1); - GL_CHECK_VAL(current_album->cluster->uuid, -1); idx++; elm_genlist_item_append(genlist, plit, (void *)idx, NULL, @@ -361,8 +453,11 @@ static int _gl_popup_append_move_items(void *data, Evas_Object *genlist) GL_CHECK_VAL(album_item->cluster->display_name, -1); idx++; + GL_CHECK_VAL(album_item->cluster->uuid, -1); - if (g_strcmp0(album_item->cluster->uuid, current_album->cluster->uuid)) { + if (current_album && current_album->cluster && + album_item->cluster->uuid && + g_strcmp0(album_item->cluster->uuid, current_album->cluster->uuid)) { /* so guaranty 'All' album is the first genlist item. */ if (!g_strcmp0(album_item->cluster->uuid, GL_ALBUM_ALL_ID)) gl_dbg("Met All album, get next."); @@ -371,7 +466,7 @@ static int _gl_popup_append_move_items(void *data, Evas_Object *genlist) (void *)idx, NULL, ELM_GENLIST_ITEM_NONE, _gl_popup_move_cb, - album_item->cluster->uuid); + album_item->cluster->path); item_cnt++; } } @@ -393,22 +488,59 @@ int gl_popup_create_albums_del_popup(void *data) 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, GL_STR_DELETE_COMFIRMATION); Evas_Object *btn1 = NULL; Evas_Object *btn2 = NULL; - btn1 = _gl_but_create_but_popup(popup, GL_STR_YES, + 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_NO, + 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_video_del_popup(void *data) +{ + 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_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_video_resp_cb, data); + btn2 = _gl_but_create_but_popup(popup, GL_STR_CANCEL, + __gl_popup_del_video_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_VIDEO_DELETE; + + return 0; +} + static Evas_Object *_gl_popup_set_box(Evas_Object *parent, Evas_Object *genlist, int item_cnt) { @@ -452,14 +584,30 @@ gl_popup_create_title_popup(void *data, gl_popup_mode mode, char *title, char *d Evas_Object *btn1 = NULL; switch (mode) { + case GL_POPUP_ALBUM_SHARE: + case GL_POPUP_THUMB_SHARE: + elm_object_style_set(popup, GL_POPUP_STYLE_MIN_MENUSTYLE); + elm_object_part_text_set(popup, GL_POPUP_TEXT, title); + btn1 = _gl_but_create_but_popup(popup, GL_STR_CLOSE, + _gl_popup_resp_cb, data); + elm_object_part_content_set(popup, "button1", btn1); + + genlist = __gl_popup_create_list(ad, popup, NULL); + if ((g_cnt = _gl_popup_append_share_items(ad, genlist)) < 0) { + gl_dbgE("_gl_popup_append_share_items failed!"); + goto POPUP_FAILED; + } + box = _gl_popup_set_box(popup, genlist, g_cnt); + elm_object_content_set(popup, box); + break; case GL_POPUP_THUMB_MOVE: elm_object_style_set(popup, GL_POPUP_STYLE_MIN_MENUSTYLE); - elm_object_part_text_set(popup, "title,text", title); + elm_object_part_text_set(popup, GL_POPUP_TEXT, title); btn1 = _gl_but_create_but_popup(popup, GL_STR_CANCEL, _gl_popup_resp_cb, data); elm_object_part_content_set(popup, "button1", btn1); - genlist = _gl_popup_create_list(ad, popup, NULL); + genlist = __gl_popup_create_list(ad, popup, NULL); if ((g_cnt = _gl_popup_append_move_items(ad, genlist)) < 0) { gl_dbgE("_gl_popup_append_move_items failed!"); goto POPUP_FAILED; @@ -510,26 +658,10 @@ int gl_popup_create_popup(void *data, gl_popup_mode mode, char *desc) switch (mode) { case GL_POPUP_NOBUT: - case GL_POPUP_NOBUT_APPEXIT: - case GL_POPUP_NOBUT_ENTRY: __gl_popup_add_timer(ad, GL_POPUP_TIMEOUT_3S); break; - case GL_POPUP_NOBUT_1S: case GL_POPUP_NOBUT_MOV_DEL: - __gl_popup_add_timer(ad, GL_POPUP_TIMEOUT_3S); - break; - case GL_POPUP_ONEBUT: - btn1 = _gl_but_create_but_popup(popup, GL_STR_OK, - _gl_popup_resp_cb, data); - elm_object_part_content_set(popup, "button1", btn1); - break; - case GL_POPUP_TWOBUT: - btn1 = _gl_but_create_but_popup(popup, GL_STR_OK, - _gl_popup_resp_cb, data); - elm_object_part_content_set(popup, "button1", btn1); - btn2 = _gl_but_create_but_popup(popup, GL_STR_CANCEL, - _gl_popup_resp_cb, data); - elm_object_part_content_set(popup, "button2", btn2); + __gl_popup_add_timer(ad, GL_POPUP_TIMEOUT_1S); break; case GL_POPUP_ALBUM_NEW_EMPTY: case GL_POPUP_ALBUM_NEW_DUPLICATE: @@ -551,10 +683,6 @@ int gl_popup_create_popup(void *data, gl_popup_mode mode, char *desc) evas_object_show(popup); - /* Focus popup and IMF hide */ - if (mode == GL_POPUP_NOBUT_ENTRY) - elm_object_focus_set(popup, TRUE); - ad->popupinfo.popup = popup; ad->popupinfo.popup_mode = mode; @@ -588,6 +716,20 @@ int gl_popup_update_content(void *data, gl_popup_mode mode) default: break; } - + if (cnt > 0) { + if (cnt < 4) + evas_object_size_hint_min_set(content, + GL_POPUP_MENUSTYLE_WIDTH, + GL_POPUP_MENUSTYLE_HEIGHT(cnt)); + else + evas_object_size_hint_min_set(content, + GL_POPUP_MENUSTYLE_WIDTH, + GL_POPUP_MENUSTYLE_HEIGHT_MAX); + } else { + evas_object_del(ad->popupinfo.popup); + ad->popupinfo.popup = NULL; + ad->popupinfo.popup_mode = 0; + } return 0; } + diff --git a/src/features/gl-progressbar.c b/src/widget/gl-progressbar.c similarity index 54% rename from src/features/gl-progressbar.c rename to src/widget/gl-progressbar.c index 1b918b5..c89e5af 100755 --- a/src/features/gl-progressbar.c +++ b/src/widget/gl-progressbar.c @@ -20,19 +20,12 @@ #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_ALBUMS_PBAR_BG_COLOR_VAL 48 -#define GL_PBAR_STATUS_LEN_MAX 128 - -#define GL_LABEL_STYLE_DEFAULT GL_CHECKBOX_STYLE_DEFAULT -#define GL_PROGRESSBAR_STYLE_PROGRESS "gallery/list_progress" -#define GL_PROGRESSBAR_STYLE_PROCESS "list_process" -/* Font style for show label of popup */ -#define GL_FONT_STYLE_POP_S "" -#define GL_FONT_STYLE_POP_E "" +#define GL_PROGRESSBAR_STYLE_PROGRESS "list_progress" static void _gl_pb_cancel_thread_pbar_cb(void *data, Evas_Object * obj, void *event_info) @@ -44,29 +37,6 @@ _gl_pb_cancel_thread_pbar_cb(void *data, Evas_Object * obj, void *event_info) gl_pb_del_pbar(data); } - -static Eina_Bool -_gl_pb_pbar_timer_cb(void *data) -{ - gl_dbg("Timeout, destroy progressbar and timer."); - gl_appdata *ad = (gl_appdata *)data; - if (ad->pbarinfo.pbar_popup != NULL) - { - evas_object_del(ad->pbarinfo.pbar_popup); - ad->pbarinfo.pbar_popup = NULL; - ad->pbarinfo.pbar = NULL; - ad->pbarinfo.status_label = NULL; - } - - if (ad->pbarinfo.pbar_timer != NULL) - { - ecore_timer_del(ad->pbarinfo.pbar_timer); - ad->pbarinfo.pbar_timer = NULL; - } - - return ECORE_CALLBACK_CANCEL; -} - int gl_pb_make_thread_pbar(void *data, Evas_Object * parent, char *title) { GL_CHECK_VAL(data, -1); @@ -79,7 +49,9 @@ int gl_pb_make_thread_pbar(void *data, Evas_Object * parent, char *title) gl_pb_del_pbar(ad); popup = elm_popup_add(parent); - elm_object_part_text_set(popup, "title,text", title); + GL_CHECK_VAL(popup, -1); + + elm_object_part_text_set(popup, GL_POPUP_TEXT, title); label = elm_label_add(popup); elm_object_text_set(label, GL_STR_EMPTY); @@ -88,6 +60,7 @@ int gl_pb_make_thread_pbar(void *data, Evas_Object * parent, char *title) 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, @@ -106,7 +79,6 @@ int gl_pb_make_thread_pbar(void *data, Evas_Object * parent, char *title) 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); @@ -146,17 +118,6 @@ gl_pb_refresh_thread_pbar(void *data, int cur_cnt, int total_cnt) return 0; } -/* Use timer to destroy progressbar */ -int -gl_pb_add_pbar_timer(void *data) -{ - GL_CHECK_VAL(data, -1); - gl_appdata *ad = (gl_appdata *)data; - ad->pbarinfo.pbar_timer = ecore_timer_add(1, _gl_pb_pbar_timer_cb, data); - - return 0; -} - int gl_pb_del_pbar(void *data) { @@ -172,17 +133,12 @@ gl_pb_del_pbar(void *data) ad->pbarinfo.status_label = NULL; ad->pbarinfo.finished_cnt = 0; } - if (ad->pbarinfo.pbar_timer) - { - ecore_timer_del(ad->pbarinfo.pbar_timer); - ad->pbarinfo.pbar_timer = NULL; - } return 0; } /* Add list_progress style progressbar */ -Evas_Object *gl_pb_add_list_pbar(Evas_Object *parent, const double ratio) +Evas_Object *_gl_pb_add_list_pbar(Evas_Object *parent, const double ratio) { GL_CHECK_NULL(parent); @@ -198,68 +154,3 @@ Evas_Object *gl_pb_add_list_pbar(Evas_Object *parent, const double ratio) return pbar; } -Evas_Object *gl_pb_make_pbar(void *data, Evas_Object *parent, char *state) -{ - GL_CHECK_NULL(data); - gl_appdata *ad = (gl_appdata *)data; - gl_dbg("Make progressbar, state:%s", state); - char label_str[GL_POPUP_DESC_LEN_MAX] = { 0, }; - - if (ad->pbarinfo.pbar_popup) { - if (ad->pbarinfo.pbar_timer) { - gl_dbg("Del pbar timer in update case!"); - ecore_timer_del(ad->pbarinfo.pbar_timer); - ad->pbarinfo.pbar_timer = NULL; - } - gl_dbg("Progressbar already created, update its label."); - snprintf(label_str, sizeof(label_str), - GL_FONT_STYLE_POP_S"%s"GL_FONT_STYLE_POP_E, state); - elm_object_text_set(ad->pbarinfo.status_label, label_str); - return ad->pbarinfo.pbar_popup; - } - gl_pb_del_pbar(ad); - Evas_Object *popup = NULL; - Evas_Object *progressbar = NULL; - Evas_Object *box = NULL; - Evas_Object *label = NULL; - - popup = elm_popup_add(parent); - - label = elm_label_add(popup); - snprintf(label_str, sizeof(label_str), - GL_FONT_STYLE_POP_S"%s"GL_FONT_STYLE_POP_E, state); - elm_object_text_set(label, label_str); - elm_label_line_wrap_set(label, ELM_WRAP_MIXED); - evas_object_size_hint_align_set(label, EVAS_HINT_FILL, 0.5); - 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_PROCESS); - elm_progressbar_unit_format_set(progressbar, NULL); - elm_progressbar_pulse(progressbar, EINA_TRUE); - evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL, 0.5); - 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_TRUE); - 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_show(popup); - - ad->pbarinfo.pbar_popup = popup; - ad->pbarinfo.pbar = progressbar; - ad->pbarinfo.status_label = label; - - return popup; -} - diff --git a/src/widget/gl-rotate-bg.c b/src/widget/gl-rotate-bg.c new file mode 100755 index 0000000..f3fa9cd --- /dev/null +++ b/src/widget/gl-rotate-bg.c @@ -0,0 +1,391 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +#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 + + if (data2) + 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; + } + + if (data2) + 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; + } + + if (data2) + 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; + if (bg_data->file) + free(bg_data->file); + 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); + 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..2bb8e7e --- /dev/null +++ b/src/widget/gl-thumb.c @@ -0,0 +1,234 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" +#ifdef _USE_ROTATE_BG +#include "gl-rotate-bg.h" +#include "gl-exif.h" +#endif + +#define GL_GRID_ICON_SIZE 156 +#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 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); + elm_icon_file_set(icon, GL_LOCK_ICON, NULL); + 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 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) + elm_layout_theme_set(layout, GL_CLASS_GENGRID, GL_GRP_PHOTOFRAME, + GL_PHOTOFRAME_STYLE_VIDEO_BOOKMARK); + else if (is_expired_drm) + 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); + elm_icon_file_set(icon, GL_LOCK_ICON, NULL); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + /* Set favourites icon */ + } + + if (bk_len) { + Evas_Object *icon = elm_icon_add(layout); + elm_icon_file_set(icon, GL_THUMB_BOOKMARK, NULL); + 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); + 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_gengrid_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_01_CNT) { + _size *= GL_GRID_ITEM_ZOOM_LEVEL_01; + _w *= GL_GRID_ITEM_ZOOM_LEVEL_01; + _h *= GL_GRID_ITEM_ZOOM_LEVEL_01; + } else 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..385cb67 --- /dev/null +++ b/src/widget/gl-tile.c @@ -0,0 +1,805 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-button.h" +#include "gallery.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}, +}; + +int __gl_tile_get_1st_icon_item_idx(int count, int *idx) +{ + int _idx = 0; + if (count == GL_TILE_THUMB_2 || + count == GL_ALBUM_COVER_THUMB_NUM_SEC) + _idx = 1; + else if (count == GL_TILE_THUMB_3) + _idx = 2; + else if (count > GL_ALBUM_COVER_THUMB_NUM_SEC){ + if (count == GL_TILE_THUMB_5) + _idx = 2; + else if (count == GL_TILE_THUMB_6) + _idx = 1; + else + _idx = 0; + } + *idx = _idx; + return 0; +} + +static Evas_Object *__gl_tile_add_3_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG + if (!g_strcmp0(part, GT_TILE_3ICON1)) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = wid; + i = 0; + } else if (!g_strcmp0(part, GT_TILE_3ICON2)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = (int)(GL_TILE_2X_GRID_S * scale); + i = 1; + } else { + return NULL; + } + + bg = _gl_rotate_bg_add(obj); + GL_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _gl_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + int tp_val = 0; + Evas_Object *tb = elm_table_add(obj); + GL_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GL_TILE_PAD * scale, GL_TILE_PAD * scale); + + for (i = 0; i < length - 1; i++) { + bg = elm_bg_add(tb); + GL_CHECK_NULL(bg); + if (i == 0) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = wid; + } else { + wid = (int)(GL_TILE_GRID_S * scale); + hei = (int)(GL_TILE_2X_GRID_S * scale); + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + elm_table_padding_set(tb, GL_TILE_PAD_2 * scale, + GL_TILE_PAD_2 * scale); + + func(bg, data[i]); + + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bg, 0.0, 1.0); + if (i != 0) { + tp_val = EVAS_ASPECT_CONTROL_VERTICAL; + evas_object_size_hint_aspect_set(bg, tp_val, 1, 1); + } + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 2); + else + elm_table_pack(tb, bg, 2, 0, 1, 2); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__gl_tile_add_4_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG + if (!g_strcmp0(part, GT_TILE_4ICON1)) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = wid; + i = 0; + } else if (!g_strcmp0(part, GT_TILE_4ICON3)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 2; + } else if (!g_strcmp0(part, GT_TILE_4ICON4)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 3; + } else { + return NULL; + } + + bg = _gl_rotate_bg_add(obj); + GL_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _gl_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + Evas_Object *tb = elm_table_add(obj); + GL_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GL_TILE_PAD_2 * scale, + GL_TILE_PAD_2 * scale); + for (i = 0; i < length; i++) { + if (i == 1) + continue; + + bg = elm_bg_add(tb); + GL_CHECK_NULL(bg); + if (i == 0) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = wid; + } else { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + + func(bg, data[i]); + + 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, 0.0, 1.0); + + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 2); + else if (i == 2) + elm_table_pack(tb, bg, 2, 0, 1, 1); + else if (i == 3) + elm_table_pack(tb, bg, 2, 1, 1, 1); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__gl_tile_add_5_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG + if (!g_strcmp0(part, GT_TILE_5ICON1)) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = (int)(GL_TILE_GRID_S * scale); + i = 0; + } else if (!g_strcmp0(part, GT_TILE_5ICON2)) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = (int)(GL_TILE_GRID_S * scale); + i = 1; + } else if (!g_strcmp0(part, GT_TILE_5ICON4)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 3; + } else if (!g_strcmp0(part, GT_TILE_5ICON5)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 4; + } else { + return NULL; + } + + bg = _gl_rotate_bg_add(obj); + GL_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _gl_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + Evas_Object *tb = elm_table_add(obj); + GL_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GL_TILE_PAD_2 * scale, + GL_TILE_PAD_2 * scale); + for (i = 0; i < length; i++) { + if (i == 2) + continue; + + bg = elm_bg_add(tb); + GL_CHECK_NULL(bg); + if (i == 0 || i == 1) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = (int)(GL_TILE_GRID_S * scale); + } else { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + + func(bg, data[i]); + + 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, 0.5, 1.0); + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 1); + else if (i == 1) + elm_table_pack(tb, bg, 0, 1, 2, 1); + else if (i == 3) + elm_table_pack(tb, bg, 2, 0, 1, 1); + else if (i == 4) + elm_table_pack(tb, bg, 2, 1, 1, 1); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__gl_tile_add_6_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG + if (!g_strcmp0(part, GT_TILE_6ICON1)) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = (int)(GL_TILE_GRID_S * scale); + i = 0; + } else if (!g_strcmp0(part, GT_TILE_6ICON3)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 2; + } else if (!g_strcmp0(part, GT_TILE_6ICON4)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 3; + } else if (!g_strcmp0(part, GT_TILE_6ICON5)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 4; + } else if (!g_strcmp0(part, GT_TILE_6ICON6)) { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + i = 5; + } else { + return NULL; + } + + bg = _gl_rotate_bg_add(obj); + GL_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _gl_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + Evas_Object *tb = elm_table_add(obj); + GL_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GL_TILE_PAD_2 * scale, + GL_TILE_PAD_2 * scale); + for (i = 0; i < length; i++) { + if (i == 1) + continue; + + bg = elm_bg_add(tb); + GL_CHECK_NULL(bg); + if (i == 0) { + wid = (int)(GL_TILE_2X_GRID_S * scale); + hei = (int)(GL_TILE_GRID_S * scale); + } else { + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + if (i == 0) + evas_object_size_hint_max_set(bg, wid, hei); + + func(bg, data[i]); + + 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, 0.0, 1.0); + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 1); + else if (i == 2) + elm_table_pack(tb, bg, 2, 0, 1, 1); + else if (i == 3) + elm_table_pack(tb, bg, 0, 1, 1, 1); + else if (i == 4) + elm_table_pack(tb, bg, 1, 1, 1, 1); + else if (i == 5) + elm_table_pack(tb, bg, 2, 1, 1, 1); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__gl_tile_add_7_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data) +{ + GL_CHECK_NULL(obj); + GL_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + + Evas_Object *tb = elm_table_add(obj); + GL_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_TRUE); + elm_table_padding_set(tb, GL_TILE_PAD * scale, GL_TILE_PAD * scale); + + wid = (int)(GL_TILE_GRID_S * scale); + hei = wid; + + for (i = 1; i < length; i++) { +#ifdef _USE_ROTATE_BG + bg = _gl_rotate_bg_add(tb); +#else + bg = elm_bg_add(tb); +#endif + GL_CHECK_NULL(bg); + +#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[i]); + + 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); + elm_table_pack(tb, bg, (int)((i - 1) % 3), (int)((i - 1) / 3), + 1, 1); + evas_object_show(bg); + } + + return tb; +} + +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_add_1st_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 = (int)(GL_TILE_GRID_S * scale); + int hei = wid; + +#ifdef _USE_ROTATE_BG + _gl_rotate_bg_add_image(bg, wid, hei); +#else + elm_bg_load_size_set(bg, wid, hei); +#endif + + int idx = 0; + __gl_tile_get_1st_icon_item_idx(len, &idx); + func(bg, data[idx]); + + evas_object_size_hint_min_set(bg, wid, hei); + 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); + evas_object_show(bg); + return bg; +} + +Evas_Object *__gl_tile_add_icon(Evas_Object *obj, int len, double scale, + bg_file_set_cb func, void **data, + const char *part) +{ + Evas_Object *icon = NULL; + + switch(len) { + case GL_TILE_THUMB_1: + return NULL; + case GL_TILE_THUMB_2: + icon = __gl_tile_add_1_icon_bg(obj, len, scale, func, data); + return icon; + case GL_TILE_THUMB_3: + icon = __gl_tile_add_3_icon_bg(obj, len, scale, func, data, part); + break; + case GL_ALBUM_COVER_THUMB_NUM_SEC: + icon = __gl_tile_add_4_icon_bg(obj, len, scale, func, data, part); + break; + case GL_TILE_THUMB_5: + icon = __gl_tile_add_5_icon_bg(obj, len, scale, func, data, part); + break; + case GL_TILE_THUMB_6: + icon = __gl_tile_add_6_icon_bg(obj, len, scale, func, data, part); + break; + default: + icon = __gl_tile_add_7_icon_bg(obj, len, scale, func, data); + break; + } + + if (icon) + evas_object_show(icon); + return icon; +} + +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)) { + if (length != GL_TILE_THUMB_1) + return NULL; + + Evas_Object *bg = NULL; + bg = __gl_tile_add_1_icon_bg(obj, length, scale, func, data); + return bg; + } else if (!g_strcmp0(part, GT_TILE_FIRSTICON)) { + if (length <= GL_TILE_THUMB_1) + return NULL; + + Evas_Object *bg = NULL; + bg = __gl_tile_add_1st_icon_bg(obj, length, scale, func, data); + return bg; + } else +#ifdef _USE_ROTATE_BG + if ((!g_strcmp0(part, GT_TILE_3ICON1)) || + (!g_strcmp0(part, GT_TILE_3ICON2)) || + (!g_strcmp0(part, GT_TILE_4ICON3)) || + (!g_strcmp0(part, GT_TILE_4ICON4)) || + (!g_strcmp0(part, GT_TILE_5ICON1)) || + (!g_strcmp0(part, GT_TILE_5ICON2)) || + (!g_strcmp0(part, GT_TILE_6ICON4)) || + (!g_strcmp0(part, GT_TILE_6ICON5))) { + if (length <= GL_TILE_THUMB_2 || length > GL_TILE_THUMB_6) + return NULL; + + Evas_Object *tb = NULL; + tb = __gl_tile_add_icon(obj, length, scale, func, data, part); + return tb; + } else if (!g_strcmp0(part, GT_TILE_ICON)) { + Evas_Object *tb = NULL; + + if (length == GL_TILE_THUMB_2) + tb = __gl_tile_add_1_icon_bg(obj, length, scale, func, + data); + else if (length >= GL_ALBUM_COVER_THUMB_NUM) + tb = __gl_tile_add_7_icon_bg(obj, length, scale, func, + data); + if (tb) + evas_object_show(tb); + return tb; + } +#else + if (!g_strcmp0(part, GT_TILE_ICON)) { + if (length <= 0) + return NULL; + + Evas_Object *tb = NULL; + tb = __gl_tile_add_icon(obj, length, scale, func, data); + return tb; + } +#endif + 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, GL_BUT_NONE, GL_BUTTON_STYLE_RENAME); + GL_CHECK_NULL(btn); + evas_object_propagate_events_set(btn, EINA_FALSE); + evas_object_smart_callback_add(btn, "clicked", func, data); + 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); + } + + if (date1) + free(date1); + if (date2) + free(date2); + if (date3) + free(date3); + return 0; + + GL_TILE_ERROR: + + if (date1) + free(date1); + if (date2) + free(date2); + if (date3) + free(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_gengrid_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/src/widget/gl-video.c b/src/widget/gl-video.c new file mode 100755 index 0000000..68f6fd2 --- /dev/null +++ b/src/widget/gl-video.c @@ -0,0 +1,118 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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-drm.h" +#include "gl-strings.h" +#include "gl-progressbar.h" +#ifdef _USE_ROTATE_BG +#include "gl-rotate-bg.h" +#endif + + +Evas_Object *_gl_video_show_pbar(Evas_Object *parent, gl_item *gitem) +{ + GL_CHECK_NULL(parent); + GL_CHECK_NULL(gitem); + GL_CHECK_NULL(gitem->item); + GL_CHECK_NULL(gitem->item->video_info); + + if (gitem->item->video_info->last_played_pos == 0) + return NULL; + + unsigned int last_pos = gitem->item->video_info->last_played_pos; + unsigned int v_dur = gitem->item->video_info->duration; + double ratio = ((double)last_pos) / ((double)v_dur); + gl_dbg("Last play position ratio: %f.", ratio); + + return _gl_pb_add_list_pbar(parent, ratio); +} + +Evas_Object *_gl_video_show_part_checkbox(Evas_Object *obj, bool checked, + Evas_Smart_Cb func, const void *data) +{ + Evas_Object *ck = elm_check_add(obj); + GL_CHECK_NULL(ck); + + 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_video_show_part_icon(Evas_Object *obj, char *path, int angle, + int item_w, int item_h) +{ + + Evas_Object *bg = elm_bg_add(obj); + GL_CHECK_NULL(bg); + + elm_bg_file_set(bg, path, NULL); + elm_bg_load_size_set(bg, item_w, item_h); + evas_object_size_hint_max_set(bg, item_w, item_h); + 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; +} + +Evas_Object *_gl_video_show_part_play(Evas_Object *obj) +{ + Evas_Object *icon = elm_icon_add(obj); + GL_CHECK_NULL(icon); + elm_icon_file_set(icon, Gl_VIDEO_PLAY_ICON, NULL); + evas_object_show(icon); + return icon; +} + +Evas_Object *_gl_video_show_part_favor(Evas_Object *obj, bool is_expired_drm) +{ + Evas_Object *icon = elm_icon_add(obj); + GL_CHECK_NULL(icon); + /* TODO: Need to check the expired drm icon file... */ + /* Expired drm file */ + if (is_expired_drm) + elm_icon_file_set(icon, GL_LOCK_ICON, NULL); + + evas_object_show(icon); + return icon; +} + +Evas_Object *_gl_video_show_part_bookmark(Evas_Object *obj) +{ + Evas_Object *icon = elm_icon_add(obj); + GL_CHECK_NULL(icon); + elm_icon_file_set(icon, GL_LIST_BOOKMARK, NULL); + evas_object_show(icon); + return icon; +} + +Evas_Object *_gl_video_add_genlist(Evas_Object *parent) +{ + Evas_Object *genlist = elm_genlist_add(parent); + GL_CHECK_NULL(genlist); + 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); + + return genlist; +} + diff --git a/libug/libug-gallery-efl/CMakeLists.txt b/ug/ug-gallery-efl/CMakeLists.txt similarity index 70% rename from libug/libug-gallery-efl/CMakeLists.txt rename to ug/ug-gallery-efl/CMakeLists.txt index 62c7a0b..281c218 100755 --- a/libug/libug-gallery-efl/CMakeLists.txt +++ b/ug/ug-gallery-efl/CMakeLists.txt @@ -9,7 +9,15 @@ SET(SRCS src/gallery-efl.c src/ge-ui-util.c src/ge-ext-ug-load.c src/ge-util.c - src/ge-db-handler.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 +) IF("${CMAKE_BUILD_TYPE}" STREQUAL "") SET(CMAKE_BUILD_TYPE "Release") @@ -23,12 +31,30 @@ 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 appcore-common appcore-efl libmedia-service -ui-gadget secure-storage) +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 + media-thumbnail + drm-client +) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") @@ -46,12 +72,12 @@ IF("${ARCH}" STREQUAL "arm") MESSAGE("add -DTARGET") ENDIF("${ARCH}" STREQUAL "arm") -#SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") 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}) + +TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lstdc++ ) # EDJE ADD_CUSTOM_COMMAND(OUTPUT gallery-efl.edj @@ -61,26 +87,17 @@ ADD_CUSTOM_COMMAND(OUTPUT gallery-efl.edj DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edc/gallery-efl.edc ) -#ADD_CUSTOM_COMMAND(OUTPUT gallery-efl-effect.edj -# COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/images -# ${CMAKE_CURRENT_SOURCE_DIR}/res/edc/gallery-efl-effect.edc -# ${CMAKE_BINARY_DIR}/gallery-efl-effect.edj -# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/res/edc/gallery-efl.edc -#) - - -#ADD_DEPENDENCIES(${PROJECT_NAME} gallery-efl.edj) -#ADD_CUSTOM_TARGET(gallery_efl_edj_build DEPENDS gallery-efl.edj gallery-efl-effect.edj) 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 /opt/ug/res/edje/gallery-efl) -#INSTALL(FILES ${CMAKE_BINARY_DIR}/gallery-efl-effect.edj DESTINATION -#/opt/ug/res/edje/gallery-efl) - - INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images DESTINATION /opt/ug/res/images/gallery-efl) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /opt/ug/lib) + +#CONFIGURE_FILE(${PROJECT_NAME}.desktop.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop) +#INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION /opt/share/applications) +INSTALL(FILES ${PROJECT_NAME}.xml DESTINATION /opt/share/packages) + diff --git a/libug/libug-gallery-efl/include/gallery-efl.h b/ug/ug-gallery-efl/include/gallery-efl.h similarity index 63% rename from libug/libug-gallery-efl/include/gallery-efl.h rename to ug/ug-gallery-efl/include/gallery-efl.h index 4a6429d..06c7b6b 100755 --- a/libug/libug-gallery-efl/include/gallery-efl.h +++ b/ug/ug-gallery-efl/include/gallery-efl.h @@ -14,70 +14,6 @@ * limitations under the License. */ -/* -* About invoking gallery UG view. F.E. -* -* struct ug_cbs cbs = {0, }; -* bundle* param = NULL; -* -* cbs.layout_cb = test_ug_layout_cb; -* cbs.result_cb = test_ug_return_cb; -* cbs.destroy_cb = test_ug_closed_cb; -* -* param = bundle_create(); -* -* bundle_add( param, "launch-type", "select-one" ); -* bundle_add( param, "return-type", "vconf"); -* bundle_add( param, "file-type", "all" ); -* -* struct ui_gadget *ext_ug = ug_create( NULL, "gallery-efl", UG_MODE_FULLVIEW, param, &cbs ); -* -* -* -* About parameter. -* (1)"select-setas" -* It's added for wallpaper setting and contact caller ID setting. -* If caller pass "select-setas", after image tapped, image viewer would be invoke, then user can -* apply setting in image viewer. -* It's unnecessary to pass parameter of return-type in set-as case.. -* -* A)"setas-type" -* And for set-as case, bundle parameter "setas-type" is used to specify different kind of setting, there are two set-as types: -* a)"wallpaper" -* This is for wallpaper setting. -* b)"callerid" -* This is for contact caller ID setting. -* And there are another two bundle parameters for callerid, both of them are optional , that is: -* b1)"callerid-size" -* It's added to set the size of caller ID, f.e. -* If you want to set the size as 200x200, you can set bundler parameter like : -* bundle_add( param, "callerid-size", "200" ); -* b2)"callerid-path" -* It's added to specify the saved path of call ID, and note that this is a full path, f.e.. -* You can pass path string like : -* bundle_add( param, "callerid-path", "/opt/media/test_folder/test_caller_id_1.jpg"); -* -* B) comand -* Launching ug comand: ug-launcher -F -n gallery-efl -d "launch-type,select-setas" -d "file-type,image" -d "setas-type,wallpaper" -* Launching ug comand: ug-launcher -F -n gallery-efl -d "launch-type,select-setas" -d "file-type,image" -d "setas-type,callerid" \ -* -d "callerid-size,200" -d "callerid-path,/opt/media/test_folder/test_caller_id_1.jpg" -* -* (2)"select-one" and "select-multiple" -* In this case, after image(s) tapped, it will be added to list and return path(s) to caller if done button tapped. -* Note that, caller must pass return-type, ug will return path(s) strings of selected image(s). -* -* Launching ug comand: ug-launcher -F -n gallery-efl -d "launch-type,select-one" -d "return-type,vconf" -d "file-type,all" -* ug-launcher -F -n gallery-efl -d "launch-type,select-multiple" -d "return-type,vconf" -d "file-type,all" -* -* Note that, file-type is optional while select-type is select-one or select-multiple. -* -* (3)"file-type" -* User can set file type via parameter "file-type", there are "image", "video" and "all", here, "all" including image and video. -* But for now in imageviewer, wallpaper setting only support image type. -* -*/ - - #ifndef __GALLERY_EFL_H__ #define __GALLERY_EFL_H__ @@ -85,23 +21,17 @@ #include #include #include -#include -#include -#include #include -#include #include #include #include +#include +#include "ge-data-type.h" #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -#define GALLERY_RES_DIR "/opt/apps/org.tizen.gallery/res/" -#define GALLERY_ICON_DIR GALLERY_RES_DIR"icons/default/small/" -#define GALLERY_EDJ_DIR GALLERY_RES_DIR"edje/" -#define GALLERY_BLACK_EDJ_FILE GALLERY_EDJ_DIR"gl-black-theme.edj" #define GE_UG_RES_DIR "/opt/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/" @@ -109,17 +39,19 @@ extern "C" { #define GE_GRP_GRIDVIEW "gallery_efl/gridview" #define GE_GRP_ALBUMVIEW "gallery_efl/albumview" -#define GE_GRP_NOCONTENTS "gallery_efl/nocontents" -#define GE_CBAR_STYLE_DEFAULT "gallery/default" -#define GE_NAVIFRAME_STYLE_DEFAULT "gallery/default" +#define GE_CBAR_STYLE_DEFAULT "gallery_efl/default" +#define GE_NAVIFRAME_STYLE_DEFAULT "gallery_efl/default" #define GE_CHECKBOX_STYLE_GRID "gallery_efl/grid" -#define DEFAULT_ICON GALLERY_ICON_DIR"org.tizen.gallery.png" #define GE_LOCK_ICON GE_IMAGES_DIR"T01_icon_lock.png" +#define GE_THUMB_FAVOR_ICON GE_IMAGES_DIR"T01_icon_thumbnail_favorite.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_SNS_ICON_PICASA GE_IMAGES_DIR"T01_Picasa.png" +#define GE_SNS_ICON_FACEBOOK GE_IMAGES_DIR"T01_Facebook.png" +#define GE_DB_DEFAULT_THUMB "/opt/data/file-manager-service/.thumb/thumb_default.png" #define GE_ROOT_PATH_PHONE "/opt/media" #define GE_ROOT_PATH_MMC "/opt/storage/sdcard" @@ -148,9 +80,9 @@ extern "C" { #define GE_ALBUM_ITEM_HEIGHT 360 #define GE_COVER_SIZE 318 #define GE_COVER_PAD 3 -#define GE_COVER_ICON_S (GE_COVER_SIZE - 2 * GE_COVER_PAD) +#define GE_COVER_ICON_S (GE_COVER_SIZE - 2 * GE_COVER_PAD) //196 #define GE_COVER_GRID_S 102 -#define GE_COVER_2X_GRID_S (GE_COVER_ICON_S - GE_COVER_GRID_S - GE_COVER_PAD) +#define GE_COVER_2X_GRID_S (GE_COVER_ICON_S - GE_COVER_GRID_S - GE_COVER_PAD) //130 #define GE_SELINFO_TEXT_LEN_MAX 64 #define GE_ALBUM_DATE_LEN_MAX 256 @@ -194,6 +126,7 @@ extern "C" { #define GE_FILE_SELECT_TYPE_ALL "all" #define GE_FILE_SELECT_SETAS_WALLPALER "wallpaper" +#define GE_FILE_SELECT_SETAS_CROP_WALLPALER "crop-wallpaper" #define GE_FILE_SELECT_SETAS_CALLERID "callerid" #define GE_FILE_SELECT_RETURN_COUNT "count" @@ -205,7 +138,7 @@ extern "C" { #define GE_SETAS_CALLERID_CROP_IMAGE_PATH "crop-image-path" #define GE_SETAS_IMAGE_PATH "image-path" -/*Image viewer UG bundle parameters*/ +/*Image viewer UG service parameters*/ #define GE_IMAGEVIEWER_CALLERID_SIZE "Area size" #define GE_IMAGEVIEWER_CALLERID_PATH "CallerID path" @@ -215,7 +148,7 @@ extern "C" { #define GE_IMAGEVIEWER_HOMESCREEN_PATH "Wallpaper path" #define GE_IMAGEVIEWER_LOCKSCREEN_PATH "Lockscreen path" #define GE_IMAGEVIEWER_RETURN_ERROR "Error" -/*Image viewer UG bundle parameters-End*/ +/*Image viewer UG service parameters-End*/ typedef enum { GE_Album_Select_None, @@ -227,12 +160,12 @@ typedef enum { GE_File_Select_One, GE_File_Select_Multiple, GE_File_Select_Setas, - GE_File_Select_Imft, } ge_file_select; typedef enum { GE_File_Select_Setas_None, GE_File_Select_Setas_Wallpaper, + GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER, GE_File_Select_Setas_CallerID, } ge_file_select_setas; @@ -250,10 +183,13 @@ typedef enum view_by_mode_e GE_ThumbnailEdit_Mode, } ge_view_mode; -typedef enum _ge_ug_exit_mode { - GE_UG_EXIT_NONE, - GE_UG_EXIT_MASS_STORAGE, -} ge_ug_exit_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, @@ -262,38 +198,41 @@ typedef enum { GE_UPDATE_MMC_ADDED, }ge_update_mode; +typedef enum +{ + GE_ALBUM_SNS_NONE, + GE_ALBUM_SNS_PICASA, + GE_ALBUM_SNS_FACEBOOK, +}ge_album_sns_type; + typedef struct _ge_ugdata ge_ugdata; typedef struct { - Mcluster* cluster; - ge_ugdata* ugd; + ge_album_s *cluster; + ge_ugdata *ugd; int index; time_t item_mtime; Elm_Object_Item *griditem; - void* _reserved; + void *_reserved; }ge_cluster; typedef struct { Eina_List* clist; - int cur_pos; }ge_cluster_list; -typedef struct _gl_item { - Mitem* item; +typedef struct _ge_item { + ge_media_s* item; ge_ugdata* ugd; Elm_Object_Item *elm_item; Evas_Object* check_obj; - bool checked; - char* drm_filepath; + bool checked; void* _reserved; }ge_item; struct _ge_ugdata { Evas_Object *win; - int win_w; - int win_h; double win_scale; Evas_Object *ly_main; Evas_Object *bg; @@ -314,11 +253,10 @@ struct _ge_ugdata { Ecore_Timer *del_timer; int popup_mode; - MediaSvcHandle *db_handle; ge_cluster_list* cluster_list; - struct ui_gadget *ug_called_by_me; - struct ui_gadget *ug; - bundle *bundle; /*added for "ug_send_result"*/ + 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; @@ -326,7 +264,6 @@ struct _ge_ugdata { int album_select_mode; int file_select_mode; int file_type_mode; - int file_select_contact_id; int file_select_setas_mode; char* file_setas_callid_size; char* file_setas_callid_path; @@ -339,16 +276,14 @@ struct _ge_ugdata { Evas_Object *selectioninfo_ly; Evas_Object *selectioninfo; - int ug_exit_mode; bool b_inited_view; /* true: show albums view; false: show popup */ - /* Update view in timer if UMS OFF */ - Ecore_Timer *ums_update_timer; }; -#define GE_DEL_TIMER(timer) if(timer){ecore_timer_del(timer); timer = NULL;} -#define GE_DEL_IDLER(idler) if(idler){ecore_idler_del(idler); idler = NULL;} -#define GE_DEL_OBJ(obj) if(obj){evas_object_del(obj); obj = NULL;} +#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;} +#define GE_IF_FREE_MEM(mem) if(mem){free(mem); mem = NULL;} #define GE_FREE_MEM(mem) if(mem){free(mem); mem = NULL;} diff --git a/libug/libug-gallery-efl/include/ge-albums.h b/ug/ug-gallery-efl/include/ge-albums.h similarity index 100% rename from libug/libug-gallery-efl/include/ge-albums.h rename to ug/ug-gallery-efl/include/ge-albums.h diff --git a/libug/libug-gallery-efl/include/ge-button.h b/ug/ug-gallery-efl/include/ge-button.h similarity index 91% rename from libug/libug-gallery-efl/include/ge-button.h rename to ug/ug-gallery-efl/include/ge-button.h index a5abcb5..5cdce15 100755 --- a/libug/libug-gallery-efl/include/ge-button.h +++ b/ug/ug-gallery-efl/include/ge-button.h @@ -27,7 +27,6 @@ typedef enum _ge_but_mode { typedef void (*But_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */ -Evas_Object *ge_but_create_title_but(ge_ugdata *ugd, Evas_Object *parent, ge_but_mode mode); Evas_Object *_ge_but_create_but(Evas_Object *parent, ge_but_mode mode, 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..48816df --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-data-type.h @@ -0,0 +1,109 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 + +#define FREE_DATA(ptr) \ + do { \ + if(ptr != NULL) \ + { \ + 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*/ + + 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..55b3abf --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-data.h @@ -0,0 +1,64 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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_init(ge_ugdata* ugd); +int _ge_data_finalize(ge_ugdata* ugd); + +#ifdef _cplusplus +} +#endif +#endif /* _GE_DB_HANDLER_H_ */ + diff --git a/libug/libug-gallery-efl/include/ge-debug.h b/ug/ug-gallery-efl/include/ge-debug.h similarity index 100% rename from libug/libug-gallery-efl/include/ge-debug.h rename to ug/ug-gallery-efl/include/ge-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..cf43c57 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-drm.h @@ -0,0 +1,30 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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..060470d --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-exif.h @@ -0,0 +1,65 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/libug/libug-gallery-efl/include/ge-ext-ug-load.h b/ug/ug-gallery-efl/include/ge-ext-ug-load.h similarity index 92% rename from libug/libug-gallery-efl/include/ge-ext-ug-load.h rename to ug/ug-gallery-efl/include/ge-ext-ug-load.h index a81b388..32b3c69 100755 --- a/libug/libug-gallery-efl/include/ge-ext-ug-load.h +++ b/ug/ug-gallery-efl/include/ge-ext-ug-load.h @@ -21,6 +21,7 @@ #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/libug/libug-gallery-efl/include/ge-gridview.h b/ug/ug-gallery-efl/include/ge-gridview.h similarity index 100% rename from libug/libug-gallery-efl/include/ge-gridview.h rename to ug/ug-gallery-efl/include/ge-gridview.h 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..4fa8e85 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-local-data.h @@ -0,0 +1,57 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 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..5ab0592 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-rotate-bg.h @@ -0,0 +1,41 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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/libug/libug-gallery-efl/include/ge-strings.h b/ug/ug-gallery-efl/include/ge-strings.h similarity index 82% rename from libug/libug-gallery-efl/include/ge-strings.h rename to ug/ug-gallery-efl/include/ge-strings.h index be5bfbd..1533b17 100755 --- a/libug/libug-gallery-efl/include/ge-strings.h +++ b/ug/ug-gallery-efl/include/ge-strings.h @@ -24,19 +24,13 @@ extern "C" { #define _GE_GETSYSTEMSTR(ID) dgettext("sys_string", (ID)) #define _GE_GETLOCALSTR(ID) dgettext("ug-gallery-efl", (ID)) /* hard code strings */ -#define GE_ALBUM_ALL_NAME _GE_GETLOCALSTR("IDS_MEDIABR_BODY_ALL_ALBUMS") -#define GE_ALBUM_MY_NAME "Camera shots" +#define GE_ALBUM_MY_NAME _("Camera") #define GE_TITLE_CHANGE_CALLER_ID _("Change caller ID") -/** -* when IDS_MEDIABR_BODY_NO_ALBUMS is added to po file, -* we can use _("IDS_MEDIABR_BODY_NO_ALBUMS") -* instead -*/ -#define GE_LABEL_NO_ALBUMS _GE_GETLOCALSTR("IDS_MEDIABR_BODY_NO_ALBUMS") #define GE_POPUP_ONLY_SUPPORT_IMAGE _("Only image is supported!") -#define GE_ALBUM_ROOT_NAME _GE_GETLOCALSTR("IDS_MEDIABR_POP_NO_NAME") -#define GE_UNABLE_USE_IN_UMS_MODE _GE_GETLOCALSTR("IDS_MEDIABR_BODY_UNABLE_TO_START_WHILE_USB_STORAGE_MODE_ACTIVE") +#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_ADD") 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..06d498c --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-thumb.h @@ -0,0 +1,37 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 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 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..1c2ebe6 --- /dev/null +++ b/ug/ug-gallery-efl/include/ge-tile.h @@ -0,0 +1,86 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 GE_TILE_THUMB_2 2 +#define GE_TILE_THUMB_3 3 +#define GE_TILE_THUMB_5 5 +#define GE_TILE_THUMB_6 6 + +#define GT_TILE_ONLYICON "elm.swallow.onlyicon" +#define GT_TILE_FIRSTICON "elm.swallow.firsticon" +#define GT_TILE_ICON "elm.swallow.icon" +#define GT_TILE_3ICON1 "elm.swallow.3icon1" +#define GT_TILE_3ICON2 "elm.swallow.3icon2" +#define GT_TILE_4ICON1 GT_TILE_3ICON1 +#define GT_TILE_4ICON3 "elm.swallow.4icon3" +#define GT_TILE_4ICON4 "elm.swallow.4icon4" +#define GT_TILE_5ICON1 "elm.swallow.5icon1" +#define GT_TILE_5ICON2 "elm.swallow.5icon2" +#define GT_TILE_5ICON4 GT_TILE_4ICON3 +#define GT_TILE_5ICON5 GT_TILE_4ICON4 +#define GT_TILE_6ICON1 GT_TILE_5ICON1 +#define GT_TILE_6ICON3 GT_TILE_4ICON3 +#define GT_TILE_6ICON4 "elm.swallow.6icon4" +#define GT_TILE_6ICON5 "elm.swallow.6icon5" +#define GT_TILE_6ICON6 GT_TILE_4ICON4 +#define GT_TILE_LABEL "label_bg" + +/* Size of album icon */ +#define GE_TILE_SIZE 318 +/* Size of table padding */ +#define GE_TILE_PAD 3 +#define GE_TILE_PAD_2 2 +/* 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/libug/libug-gallery-efl/include/ge-ui-util.h b/ug/ug-gallery-efl/include/ge-ui-util.h similarity index 88% rename from libug/libug-gallery-efl/include/ge-ui-util.h rename to ug/ug-gallery-efl/include/ge-ui-util.h index a3ed15b..34ce69e 100755 --- a/libug/libug-gallery-efl/include/ge-ui-util.h +++ b/ug/ug-gallery-efl/include/ge-ui-util.h @@ -17,7 +17,6 @@ #ifndef _GE_UI_UTIL_H_ #define _GE_UI_UTIL_H_ -#include #include "gallery-efl.h" #ifdef _cplusplus @@ -41,16 +40,21 @@ typedef enum { GE_Popup_UgExit, }GE_PopupMode; +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, NaviTitleMode 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_PopupMode mode, char* desc); int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent); int ge_ui_destroy_selinfo(ge_ugdata* ugd); +int ge_ui_rotate_selinfo(ge_ugdata* ugd); #ifdef _cplusplus diff --git a/libug/libug-gallery-efl/include/ge-util.h b/ug/ug-gallery-efl/include/ge-util.h similarity index 86% rename from libug/libug-gallery-efl/include/ge-util.h rename to ug/ug-gallery-efl/include/ge-util.h index 7df218d..9eb4ba4 100755 --- a/libug/libug-gallery-efl/include/ge-util.h +++ b/ug/ug-gallery-efl/include/ge-util.h @@ -23,14 +23,13 @@ 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); -int ge_reg_ums_noti(ge_ugdata* ugd); -int ge_dereg_ums_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); -int ge_get_ums_state(ge_ugdata* ugd); - +bool _ge_is_image_valid(void *data, char *filepath); +int _ge_get_thumb(const char *file_path, char **thumb_path); +char *_ge_get_duration_string(unsigned int v_dur); #endif /* _GE_EXT_EXEC_H_ */ diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl-check.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-check.edc similarity index 65% rename from libug/libug-gallery-efl/res/edc/gallery-efl-check.edc rename to ug/ug-gallery-efl/res/edc/gallery-efl-check.edc index 038e506..629ce79 100755 --- a/libug/libug-gallery-efl/res/edc/gallery-efl-check.edc +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-check.edc @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -27,11 +27,11 @@ /////////////////////////////////////////////////////////////////////////////////////// styles { style { name: "check_label_textblock_style"; - base: "font=HelveticaNeue:style=Roman font_size=32 color=#ffffff wrap=char"; + base: "font=SLP:style=Roman text_class=slp_roman font_size=32 color=#ffffff wrap=char"; tag: "br" "\n"; tag: "ps" "ps"; - tag: "hilight" "+ font=HelveticaNeue:style=Bold"; - tag: "b" "+ font=HelveticaNeue:style=Bold"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp_bold"; + tag: "b" "+ font=SLP:style=Bold text_class=slp_bold"; tag: "whitecolor" "+ color=#ffffff"; tag: "tab" "\t"; } @@ -44,30 +44,19 @@ //////////////////////////////////////////////////////////////////////////////// #define CHECK_STYLE_GRID(style_name, image_grid, width, height) \ - group { \ - name: "elm/check/base/"style_name; \ - images { \ - image: image_grid COMP; \ - } \ + group { name: "elm/check/base/"style_name; \ + images.image: image_grid COMP; \ parts { \ - part { \ - name: "bg"; \ + part { name: "bg"; \ type: RECT; \ - mouse_events: 1; \ scale: 1; \ - description { \ - state: "default" 0.0; \ - rel1.relative: 0.0 0.0; \ - rel2.relative: 1.0 1.0; \ + description { state: "default" 0.0; \ color: 0 0 0 0; \ - visible: 1; \ } \ - description { \ - state: "pressed" 0.0; \ + description { state: "pressed" 0.0; \ inherit: "default" 0.0; \ } \ - description { \ - state: "disabled" 0.0; \ + description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ visible: 0; \ } \ @@ -82,88 +71,72 @@ rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } \ } \ } \ - part { \ - name: "icon_bg"; \ + part { name: "icon_bg"; \ type: RECT; \ - description { \ - state: "default" 0.0; \ + description { state: "default" 0.0; \ color: 0 0 0 0; \ rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } \ rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } \ } \ } \ - part { \ - name: "bg2"; \ + part { name: "bg2"; \ type: RECT; \ mouse_events: 0; \ scale: 1; \ - description { \ - state: "default" 0.0; \ + 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; \ - visible: 1; \ } \ - description { \ - state: "pressed" 0.0; \ + description { state: "pressed" 0.0; \ inherit: "default" 0.0; \ } \ - description { \ - state: "disabled" 0.0; \ + description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ visible: 0; \ } \ } \ - part { \ - name: "selected_bg"; \ + part { name: "selected_bg"; \ type: RECT; \ scale: 1; \ - description { \ - state: "default" 0.0; \ + 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; \ + description { state: "visible" 0.0; \ inherit: "default" 0.0; \ color: 0 0 0 153; \ visible: 1; \ } \ } \ - part { \ - name: "check"; \ + part { name: "check"; \ mouse_events: 0; \ scale: 1; \ - description { \ - state: "default" 0.0; \ + description { state: "default" 0.0; \ rel1.to: "bg2"; \ rel2.to: "bg2"; \ visible: 0; \ image.normal: image_grid; \ } \ - description { \ - state: "visible" 0.0; \ + description { state: "visible" 0.0; \ inherit: "default" 0.0; \ visible: 1; \ } \ - description { \ - state: "pressed" 0.0; \ + description { state: "pressed" 0.0; \ inherit: "default" 0.0; \ visible: 1; \ } \ - description { \ - state: "disabled_visible" 0.0; \ + description { state: "disabled_visible" 0.0; \ inherit: "default" 0.0; \ visible: 1; \ } \ } \ - part { \ - name: "elm.swallow.content"; \ + part { name: "elm.swallow.content"; \ type: SWALLOW; \ description { \ state: "default" 0.0; \ @@ -171,28 +144,29 @@ visible: 0; \ color: 255 255 255 255; \ align: 0.0 0.5; \ - rel1.to_x: "bg2"; \ - rel1.relative: 1.0 0.0; \ - rel1.offset: 1 1; \ - rel2.to_x: "bg2"; \ - rel2.relative: 1.0 1.0; \ - rel2.offset: 2 -2; \ + 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; \ + 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; \ + description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ color: 128 128 128 128; \ } \ - description { \ - state: "disabled_visible" 0.0; \ + description { state: "disabled_visible" 0.0; \ inherit: "default" 0.0; \ color: 128 128 128 128; \ fixed: 1 1; \ @@ -200,17 +174,22 @@ aspect: 1.0 1.0; \ } \ } \ - part { \ - name: "elm.text"; \ + part { name: "elm.text"; \ type: TEXTBLOCK; \ mouse_events: 0; \ scale: 1; \ - description { \ - state: "default" 0.0; \ + 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; } \ + 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 { \ @@ -219,83 +198,70 @@ } \ color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \ } \ - description { \ - state: "visible" 0.0; \ + description { state: "visible" 0.0; \ inherit: "default" 0.0; \ visible: 1; \ text.min: 1 1; \ } \ - description { \ - state: "disabled" 0.0; \ + description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ } \ - description { \ - state: "disabled_visible" 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"; \ + part { name: "events"; \ type: RECT; \ ignore_flags: ON_HOLD; \ - description { \ - state: "default" 0.0; \ + description { state: "default" 0.0; \ color: 0 0 0 0; \ } \ } \ - part { \ - name: "disabler"; \ + part { name: "disabler"; \ type: RECT; \ - description { \ - state: "default" 0.0; \ + description { state: "default" 0.0; \ color: 0 0 0 0; \ visible: 0; \ } \ - description { \ - state: "disabled" 0.0; \ + description { state: "disabled" 0.0; \ inherit: "default" 0.0; \ visible: 1; \ } \ } \ } \ programs { \ - program { \ - name: "click"; \ + program { name: "click"; \ signal: "mouse,up,1"; \ source: "events"; \ action: SIGNAL_EMIT "elm,action,check,toggle" ""; \ after: "bg_normal"; \ } \ - program { \ - name: "bg_normal"; \ + program { name: "bg_normal"; \ script { \ set_state(PART:"bg", "default", 0.0); \ set_state(PART:"bg2", "default", 0.0); \ - } \ } \ - program { \ - name: "mouseout"; \ + } \ + program { name: "mouseout"; \ signal: "mouse,out"; \ source: "events"; \ after: "bg_check_normal"; \ } \ - program { \ - name: "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:"check", "visible", 0.0); \ set_state(PART:"bg", "default", 0.0); \ set_state(PART:"bg2", "default", 0.0); \ } \ } \ - program { \ - name: "pressed"; \ + program { name: "pressed"; \ signal: "mouse,down,1"; \ source: "events"; \ script { \ @@ -303,57 +269,50 @@ new Float:vl; \ get_state(PART:"check", st, 30, vl); \ if (!strcmp(st, "visible")) \ - set_state(PART:"check", "pressed", 0.0); \ + 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"; \ + program { name: "check_on"; \ signal: "elm,state,check,on"; \ source: "elm"; \ - action: STATE_SET "visible" 0.0; \ + action: STATE_SET "visible" 0.0; \ target: "check"; \ target: "selected_bg"; \ } \ - program { \ - name: "check_off"; \ + program { name: "check_off"; \ signal: "elm,state,check,off"; \ source: "elm"; \ - action: STATE_SET "default" 0.0; \ + action: STATE_SET "default" 0.0; \ target: "check"; \ target: "selected_bg"; \ } \ - program { \ - name: "text_show"; \ + program { name: "text_show"; \ signal: "elm,state,text,visible"; \ source: "elm"; \ - action: STATE_SET "visible" 0.0; \ + action: STATE_SET "visible" 0.0; \ target: "elm.text"; \ } \ - program { \ - name: "text_hide"; \ + program { name: "text_hide"; \ signal: "elm,state,text,hidden"; \ source: "elm"; \ - action: STATE_SET "default" 0.0; \ + action: STATE_SET "default" 0.0; \ target: "elm.text"; \ } \ - program { \ - name: "icon_show"; \ + program { name: "icon_show"; \ signal: "elm,state,icon,visible"; \ source: "elm"; \ - action: STATE_SET "visible" 0.0; \ + action: STATE_SET "visible" 0.0; \ target: "elm.swallow.content"; \ } \ - program { \ - name: "icon_hide"; \ + program { name: "icon_hide"; \ signal: "elm,state,icon,hidden"; \ source: "elm"; \ - action: STATE_SET "default" 0.0; \ + action: STATE_SET "default" 0.0; \ target: "elm.swallow.content"; \ } \ - program { \ - name: "disable"; \ + program { name: "disable"; \ signal: "elm,state,disabled"; \ source: "elm"; \ action: STATE_SET "disabled" 0.0; \ @@ -361,29 +320,27 @@ target: "bg"; \ target: "bg2"; \ after: "disable_text"; \ - } \ - program { \ - name: "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); \ + set_state(PART:"elm.text", "disabled_visible", 0.0); \ else \ - set_state(PART:"elm.text", "disabled", 0.0); \ + 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); \ + set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \ else \ - set_state(PART:"elm.swallow.content", "disabled", 0.0); \ + 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_state(PART:"check", "disabled_visible", 0.0); \ } \ } \ - program { \ - name: "enable"; \ + program { name: "enable"; \ signal: "elm,state,enabled"; \ source: "elm"; \ action: STATE_SET "default" 0.0; \ @@ -392,24 +349,23 @@ target: "bg2"; \ after: "enable_text"; \ } \ - program { \ - name: "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); \ + set_state(PART:"elm.text", "visible", 0.0); \ else \ - set_state(PART:"elm.text", "default", 0.0); \ + 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); \ + set_state(PART:"elm.swallow.content", "visible", 0.0); \ else \ - set_state(PART:"elm.swallow.content", "default", 0.0); \ + 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_state(PART:"check", "visible", 0.0); \ } \ } \ } \ diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl-edc-res.h b/ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h similarity index 69% rename from libug/libug-gallery-efl/res/edc/gallery-efl-edc-res.h rename to ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h index 122c47f..70d60fa 100755 --- a/libug/libug-gallery-efl/res/edc/gallery-efl-edc-res.h +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-edc-res.h @@ -26,15 +26,6 @@ #define GE_EDC_IMAGE_BUTTON_PLAY "T01_btn_play.png" #define GE_EDC_IMAGE_THUMB_BG "T01_thumbs_bg.png" -/* gallery-efl-button.edc */ -#define GE_EDC_IMAGE_BTN_PREV "00_winset_Back_btn_normal.png" -#define GE_EDC_IMAGE_BTN_PREV_PRESS "00_winset_Back_btn_press.png" -#define GE_EDC_IMAGE_PREV "00_winset_Back.png" -#define GE_EDC_IMAGE_TITLE_BTN "T01_title_btn.png" -#define GE_EDC_IMAGE_TITLE_BTN_PRESS "T01_title_btn_press.png" -#define GE_EDC_IMAGE_BTN_01_NORMAL "T01_title_btn.png" -#define GE_EDC_IMAGE_BTN_01_PRESS "T01_title_btn_press.png" -#define GE_EDC_IMAGE_BTN_01_DIM "T01_title_btn_press.png" - /* gallery-efl-check.edc */ #define GE_EDC_IMAGE_CHECK_GRID "T01_grid_select_check.png" + diff --git a/res/edc/gl-gengrid-item-albums.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc similarity index 50% rename from res/edc/gl-gengrid-item-albums.edc rename to ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc index bbf6ea9..1790a69 100755 --- a/res/edc/gl-gengrid-item-albums.edc +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-albums.edc @@ -38,9 +38,16 @@ #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_TEXT_Y 60 +#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 @@ -49,16 +56,16 @@ #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/gallery/albums_view/default"; + 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.firsticon elm.swallow.icon elm.swallow.onlyicon elm.swallow.end elm.swallow.check_grid label_bg elm.swallow.rename"; + data.item: "contents" "elm.swallow.firsticon elm.swallow.3icon1 elm.swallow.3icon2 elm.swallow.4icon3 elm.swallow.4icon4 elm.swallow.5icon1 elm.swallow.5icon2 elm.swallow.6icon4 elm.swallow.6icon5 elm.swallow.icon elm.swallow.onlyicon elm.swallow.snsicon elm.swallow.lock elm.swallow.check_bg elm.swallow.lockicon label_bg"; images { - image: GALLERY_EDC_IMAGE_MAIN_FOLDER_BG COMP; + image: GE_EDC_IMAGE_MAIN_FOLDER_BG COMP; } parts { @@ -80,7 +87,7 @@ group { min : ALBUM_W ALBUM_H; state: "default" 0.0; image { - normal : GALLERY_EDC_IMAGE_MAIN_FOLDER_BG; + 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"; } @@ -93,6 +100,7 @@ group { 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"; } } @@ -131,6 +139,94 @@ group { } } part { + name: "elm.swallow.3icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.3icon2"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+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: "elm.swallow.4icon3"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.4icon4"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+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: "elm.swallow.5icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.5icon2"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon4"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon5"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { name: "elm.swallow.icon"; type: SWALLOW; mouse_events: 1; @@ -142,6 +238,19 @@ group { } } part { + name: "elm.swallow.snsicon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + max: ALBUM_SNS_ICON_W ALBUM_SNS_ICON_H; + fixed: 1 0; + rel1 { relative: (ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W) ALBUM_TEXT_SNS_X/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_SNS_ICON_W+ALBUM_TEXT_GAP_L)/ALBUM_TEXT_AREA_W 1.0; to: "label_bg"; } + } + } + part { name: "elm.text.date"; type: TEXT; mouse_events: 1; @@ -153,7 +262,8 @@ group { 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: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 22; align: 0.0 0.5; } @@ -168,11 +278,12 @@ group { description { state: "default" 0.0; visible: 1; - rel1 { relative: ((ALBUM_TEXT_GAP_L+1)/ALBUM_TEXT_AREA_W) ALBUM_TEXT_Y/ALBUM_TEXT_AREA_H; to: "label_bg"; } + 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: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 38; align: 1.0 0.5; } @@ -190,56 +301,24 @@ group { 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: "Helvetica Neue:style=Medium"; - size: 28; - align: 0.0 0.5; + font: "SLP:style=Medium"; + text_class: "slp_medium"; + 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"; } //-->GUI_v0.2_110309 - } - } - 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_GAP_L-ALBUM_CHECKBOX_GAP_L)/ALBUM_ITEM_W (ALBUM_GAP_T-ALBUM_CHECKBOX_GAP_T)/ALBUM_ITEM_H; to:"bg"; } - rel2 { relative: (ALBUM_GAP_L+ALBUM_CHECKBOX_W)/ALBUM_ITEM_W (ALBUM_GAP_T-ALBUM_CHECKBOX_GAP_T+ALBUM_CHECKBOX_H+1)/ALBUM_ITEM_H; to:"bg"; } - } - } } } group { - name: "elm/gengrid/item/gallery/albums_view_blue/default"; + name: "elm/gengrid/item/albums_view_blue/gallery_efl/default"; data.item: "texts" "elm.text.name elm.text.date elm.text.count"; - data.item: "contents" "elm.swallow.firsticon elm.swallow.icon elm.swallow.onlyicon elm.swallow.end elm.swallow.check_grid label_bg elm.swallow.rename"; + data.item: "contents" "elm.swallow.firsticon elm.swallow.3icon1 elm.swallow.3icon2 elm.swallow.4icon3 elm.swallow.4icon4 elm.swallow.5icon1 elm.swallow.5icon2 elm.swallow.6icon4 elm.swallow.6icon5 elm.swallow.icon elm.swallow.onlyicon elm.swallow.snsicon elm.swallow.lock elm.swallow.check_bg elm.swallow.lockicon label_bg"; images { - image: GALLERY_EDC_IMAGE_MAIN_FOLDER_BG COMP; + image: GE_EDC_IMAGE_MAIN_FOLDER_BG COMP; } parts { @@ -261,7 +340,7 @@ group { min : ALBUM_W ALBUM_H; state: "default" 0.0; image { - normal : GALLERY_EDC_IMAGE_MAIN_FOLDER_BG; + 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"; } @@ -274,6 +353,7 @@ group { 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"; } } @@ -294,7 +374,7 @@ group { type: SWALLOW; mouse_events: 1; repeat_events: 1; - description { + 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"; } @@ -312,6 +392,94 @@ group { } } part { + name: "elm.swallow.3icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.3icon2"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+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: "elm.swallow.4icon3"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: (ALBUM_ICON_W-ALBUM_ICON_PAD)/ALBUM_ICON_W ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.4icon4"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+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: "elm.swallow.5icon1"; + 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_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + } + } + part { + name: "elm.swallow.5icon2"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon4"; + 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_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { + name: "elm.swallow.6icon5"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + rel1 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H-1+ALBUM_ICON_PAD)/ALBUM_ICON_W) ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_H+ALBUM_TEXT_AREA_H+ALBUM_ICON_PAD+ALBUM_ICON_PAD)/ALBUM_ICON_H); to: "icon_bg"; } + rel2 { relative: ((ALBUM_ICON_PAD+ALBUM_TEXT_AREA_W-1)/ALBUM_ICON_W) (ALBUM_ICON_H-ALBUM_ICON_PAD)/ALBUM_ICON_H; to: "icon_bg"; } + } + } + part { name: "elm.swallow.icon"; type: SWALLOW; mouse_events: 1; @@ -323,6 +491,19 @@ group { } } part { + name: "elm.swallow.snsicon"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 1; + description { + state: "default" 0.0; + max: ALBUM_SNS_ICON_W ALBUM_SNS_ICON_H; + fixed: 1 0; + rel1 { relative: (ALBUM_TEXT_GAP_L/ALBUM_TEXT_AREA_W) ALBUM_TEXT_SNS_X/ALBUM_TEXT_AREA_H; to: "label_bg"; } + rel2 { relative: (ALBUM_SNS_ICON_W+ALBUM_TEXT_GAP_L)/ALBUM_TEXT_AREA_W 1.0; to: "label_bg"; } + } + } + part { name: "elm.text.date"; type: TEXT; mouse_events: 1; @@ -334,7 +515,8 @@ group { 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: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 22; align: 0.0 0.5; } @@ -349,11 +531,12 @@ group { description { state: "default" 0.0; visible: 1; - rel1 { relative: ((ALBUM_TEXT_GAP_L+1)/ALBUM_TEXT_AREA_W) ALBUM_TEXT_Y/ALBUM_TEXT_AREA_H; to: "label_bg"; } + 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: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 38; align: 1.0 0.5; } @@ -371,44 +554,12 @@ group { 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: 111 198 235 255; text { - font: "Helvetica Neue:style=Medium"; - size: 28; - align: 0.0 0.5; + font: "SLP:style=Medium"; + text_class: "slp_medium"; + 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"; } //-->GUI_v0.2_110309 - } - } - 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_GAP_L-ALBUM_CHECKBOX_GAP_L)/ALBUM_ITEM_W (ALBUM_GAP_T-ALBUM_CHECKBOX_GAP_T)/ALBUM_ITEM_H; to:"bg"; } - rel2 { relative: (ALBUM_GAP_L+ALBUM_CHECKBOX_W)/ALBUM_ITEM_W (ALBUM_GAP_T-ALBUM_CHECKBOX_GAP_T+ALBUM_CHECKBOX_H+1)/ALBUM_ITEM_H; to:"bg"; } - } - } } } diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc similarity index 50% rename from libug/libug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc rename to ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc index a0d981a..0e9c002 100755 --- a/libug/libug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-gengrid-item-thumbview.edc @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -44,6 +44,10 @@ /* Thumbnail boundary size */ #define INNER 1 +/* Favourites icon boundary size */ +#define FAVOR_ICON_W 36 +#define FAVOR_ICON_H 38 + /* Bookmark icon boundary size */ #define BOOKMARK_ICON_W 30 #define BOOKMARK_ICON_H 38 @@ -230,6 +234,139 @@ group group { + name: "elm/gengrid/photoframe/default_layout_favor"; + + images { + image: GE_EDC_IMAGE_THUMB_BG COMP; + } + + 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GE_EDC_IMAGE_THUMB_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.favoricon.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + + description { + state: "default" 0.0; + max: FAVOR_ICON_W FAVOR_ICON_H; + visible: 1; + color: 0 0 0 130; + align: 0.0 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (GAP_ICON_L+INNER+FAVOR_ICON_W+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + max: FAVOR_ICON_W FAVOR_ICON_H; + align: 0.0 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "elm.favoricon.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.favoricon.bg"; } + } + } + } + + 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; @@ -298,7 +435,7 @@ group color: 0 0 0 130; align: 0.5 1.0; fixed: 0 1; - rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-BOOKMARK_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } } } @@ -347,7 +484,8 @@ group rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } color: 255 255 255 255; text { - font: "HelveticaNeue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 26; align: 0.5 0.5; } @@ -399,7 +537,7 @@ group group { - name: "elm/gengrid/photoframe/default_layout_video_bookmark"; + name: "elm/gengrid/photoframe/default_layout_video_favor"; images { image: GE_EDC_IMAGE_BUTTON_PLAY COMP; image: GE_EDC_IMAGE_THUMB_BG COMP; @@ -469,9 +607,10 @@ group min: 0 24; align: 0.5 1.0; fixed: 0 1; - rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-BOOKMARK_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } } + } part { name: "elm.videoicon_bg"; @@ -496,7 +635,6 @@ group scale: 1; description { state: "default" 0.0; - min: 40 40; visible: 1; align: 0.5 0.5; aspect: 1.0 1.0; @@ -506,30 +644,29 @@ group } } part { - name: "bookmarkicon_bg"; + name: "favoricon_bg"; type: RECT; scale: 1; description { state: "default" 0.0; - min: BOOKMARK_ICON_W BOOKMARK_ICON_H; - max: BOOKMARK_ICON_W BOOKMARK_ICON_H; align: 0.0 0.5; fixed: 1 1; visible: 0; + min: FAVOR_ICON_W FAVOR_ICON_H; + max: FAVOR_ICON_W FAVOR_ICON_H; rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } rel2 { relative: 0.0 1.0; to: "elm.text.bg"; } } } part { - name: "elm.swallow.bookmarkicon"; + name: "elm.swallow.favoricon"; 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"; } + rel1 { relative: 0.0 0.0; to: "favoricon_bg"; } + rel2 { relative: 1.0 1.0; to: "favoricon_bg"; } } } part { @@ -543,11 +680,12 @@ group min: 0 20; fixed: 1 1; align: 0.5 0.5; - rel1 { relative: 0.9 0.0; to_x: "elm.swallow.bookmarkicon"; to_y: "elm.text.bg"; } + rel1 { relative: 0.9 0.0; to_x: "elm.swallow.favoricon"; to_y: "elm.text.bg"; } rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } color: 255 255 255 255; text { - font: "HelveticaNeue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 26; align: 0.5 0.5; } @@ -596,3 +734,433 @@ group } } } + +group +{ + name: "elm/gengrid/photoframe/default_layout_video_bookmark"; + images { + image: GE_EDC_IMAGE_BUTTON_PLAY COMP; + image: GE_EDC_IMAGE_THUMB_BG 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GE_EDC_IMAGE_THUMB_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 130; + min: 0 24; + align: 0.5 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} + rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 40 40; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} + rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; to: "elm.videoicon_bg";} + image.normal: GE_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: BOOKMARK_ICON_W BOOKMARK_ICON_H; + max: BOOKMARK_ICON_W BOOKMARK_ICON_H; + align: 0.0 0.5; + fixed: 1 1; + visible: 0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 0.0 1.0; to: "elm.text.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"; } + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 20; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.9 0.0; to_x: "elm.swallow.bookmarkicon"; to_y: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp_medium"; + size: 26; + align: 0.5 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_bookmark"; + images { + image: GE_EDC_IMAGE_BUTTON_PLAY COMP; + image: GE_EDC_IMAGE_THUMB_BG 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: "icon_bg_img"; + type: IMAGE; + mouse_events: 1; + scale : 1; + description { + state: "default" 0.0; + image { + normal : GE_EDC_IMAGE_THUMB_BG; + } + rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } + rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } + } + } + part { + name: "icon_bg"; + type: RECT; + description { + state: "default" 0.0; + color: THUMBNAILS_BG_COLOR; + rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + + part { + name: "elm.swallow.icon"; + type: SWALLOW; + description { + state: "default" 0.0; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (GAP_ICON_T+INNER+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.text.bg"; + type: RECT; + mouse_events: 0; + scale : 1; + + description { + state: "default" 0.0; + visible: 1; + color: 0 0 0 130; + min: 0 24; + align: 0.5 1.0; + fixed: 0 1; + rel1 { relative: (GAP_ICON_L+INNER+0.5)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER-FAVOR_ICON_H+1)/SHADOW_H; to: "icon_bg_img"; } + rel2 { relative: (SHADOW_W-GAP_ICON_R-INNER+1)/SHADOW_W (SHADOW_H-GAP_ICON_B-INNER+1+0.5)/SHADOW_H; to: "icon_bg_img"; } + } + } + part { + name: "elm.videoicon_bg"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + align: 0.5 0.0; + fixed: 1 0; + rel1 { relative: 0.0 0.0; to: "elm.swallow.icon";} + rel2 { relative: 1.0 0.0; to_x: "elm.swallow.icon"; to_y: "elm.text.bg";} + } + } + part { + name: "elm.swallow.videoicon"; + type: IMAGE; + mouse_events: 0; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + min: 40 40; + visible: 1; + align: 0.5 0.5; + aspect: 1.0 1.0; + rel1 { relative: PLAY_X/PLAY_BG_W PLAY_Y/PLAY_BG_H; to: "elm.videoicon_bg";} + rel2 { relative: (PLAY_X+PLAY_W)/PLAY_BG_W (PLAY_Y+PLAY_H)/PLAY_BG_H; to: "elm.videoicon_bg";} + image.normal: GE_EDC_IMAGE_BUTTON_PLAY; + } + } + part { + name: "favoricon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: FAVOR_ICON_W FAVOR_ICON_H; + max: FAVOR_ICON_W FAVOR_ICON_H; + align: 0.0 0.5; + fixed: 1 1; + visible: 0; + rel1 { relative: 0.0 0.0; to: "elm.text.bg"; } + rel2 { relative: 0.0 1.0; to: "elm.text.bg"; } + } + } + part { + name: "elm.swallow.favoricon"; + type: SWALLOW; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + visible: 1; + rel1 { relative: 0.0 0.0; to: "favoricon_bg"; } + rel2 { relative: 1.0 1.0; to: "favoricon_bg"; } + } + } + part { + name: "bookmarkicon_bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: BOOKMARK_ICON_W BOOKMARK_ICON_H; + max: BOOKMARK_ICON_W BOOKMARK_ICON_H; + align: 0.0 1.0; + fixed: 1 1; + visible: 0; + rel1 { relative: 0.8 0.0; to: "favoricon_bg"; } + rel2 { relative: 0.8 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"; } + } + } + part { + name: "elm.text"; + type: TEXT; + mouse_events: 1; + repeat_events: 1; + scale: 1; + description { + state: "default" 0.0; + min: 0 20; + fixed: 1 1; + align: 0.5 0.5; + rel1 { relative: 0.9 0.0; to_x: "elm.swallow.bookmarkicon"; to_y: "elm.text.bg"; } + rel2 { relative: 1.0 1.0; to: "elm.text.bg"; } + color: 255 255 255 255; + text { + font: "SLP:style=Medium"; + text_class: "slp_medium"; + size: 26; + align: 0.5 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"; + } + } +} + diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl-nocontents.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-nocontents.edc similarity index 89% rename from libug/libug-gallery-efl/res/edc/gallery-efl-nocontents.edc rename to ug/ug-gallery-efl/res/edc/gallery-efl-nocontents.edc index 82718d3..3f7d7c0 100755 --- a/libug/libug-gallery-efl/res/edc/gallery-efl-nocontents.edc +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-nocontents.edc @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -21,10 +21,10 @@ name: "elm/layout/nocontents/gallery_efl"; styles{ style { name: "nocontent_style"; - base: "font=Helvetica Neue:style=Roman font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=word"; + base: "font=SLP:style=Roman text_class=slp_roman font_size="NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC" align=center color=#ffffff wrap=word"; tag: "br" "\n"; - tag: "hilight" "+ font=Helvetica Neue:style=Bold"; - tag: "b" "+ font=Helvetica Neue:style=Bold"; + tag: "hilight" "+ font=SLP:style=Bold text_class=slp_bold"; + tag: "b" "+ font=SLP:style=Bold text_class=slp_bold"; tag: "tab" "\t"; } } diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl-selection-info.edc b/ug/ug-gallery-efl/res/edc/gallery-efl-selection-info.edc similarity index 75% rename from libug/libug-gallery-efl/res/edc/gallery-efl-selection-info.edc rename to ug/ug-gallery-efl/res/edc/gallery-efl-selection-info.edc index a575104..43e501a 100755 --- a/libug/libug-gallery-efl/res/edc/gallery-efl-selection-info.edc +++ b/ug/ug-gallery-efl/res/edc/gallery-efl-selection-info.edc @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.tizenopensource.org/license + * http://www.tizenopensource.org/license * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,12 +15,13 @@ */ #define SELINFO_PORT_W 720 +#define SELINFO_LAND_W 1200 #define SELINFO_H 48 -#define SELINFO_TOP_LINE_COLOR 56 56 56 255 +#define SELINFO_TOP_LINE_COLOR 215 225 232 255 #define SELINFO_TOP_LINE_H 2 #define SELINFO_PAD_L 14 -#define GE_EDC_COLOR_THEME_GRAY 91 91 91 255 +#define GE_EDC_COLOR_THEME_GRAY 215 225 232 255 group { @@ -44,6 +45,15 @@ group color: GE_EDC_COLOR_THEME_GRAY; } + description {//landscape + state: "landscape" 0.0; + min: SELINFO_LAND_W SELINFO_H; + fixed: 1 1; + align: 0.5 1.0; + rel1.relative: 0.5 1.0; + rel2.relative: 0.5 1.0; + color: GE_EDC_COLOR_THEME_GRAY; + } } part { name: "top_line"; type: RECT; @@ -81,12 +91,13 @@ group align: 0.0 0.5; rel1 { relative: 1.0 0.0; to_x: "left_padding"; to_y: "bg"; } rel2 { relative: 1.0 1.0; to: "bg"; } - color: 255 255 255 255; + color: 0 0 0 255; text { - font: "Helvetica Neue:style=Medium"; + font: "SLP:style=Medium"; + text_class: "slp_medium"; size: 32; text: ""; - align: 0.5 0.5; + align: 0.0 0.5; } } } @@ -102,6 +113,15 @@ group } } + program {//landscape selection + name: "selectioninfo_landscape"; + signal: "elm,selectioninfo,ug_landscape"; + source: "elm"; + script { + set_state(PART:"bg", "landscape", 0.0); + } + + } } } diff --git a/libug/libug-gallery-efl/res/edc/gallery-efl.edc b/ug/ug-gallery-efl/res/edc/gallery-efl.edc similarity index 90% rename from libug/libug-gallery-efl/res/edc/gallery-efl.edc rename to ug/ug-gallery-efl/res/edc/gallery-efl.edc index 86b84f9..aaa6d15 100755 --- a/libug/libug-gallery-efl/res/edc/gallery-efl.edc +++ b/ug/ug-gallery-efl/res/edc/gallery-efl.edc @@ -23,7 +23,6 @@ collections { #include "gallery-efl-gengrid-item-thumbview.edc" #include "gallery-efl-gengrid-item-albums.edc" #include "gallery-efl-selection-info.edc" -#include "gallery-efl-button.edc" #include "gallery-efl-check.edc" #include "gallery-efl-nocontents.edc" @@ -130,4 +129,19 @@ collections { } } } -} + group { name: "ge_bg_layout"; + parts { + part { name: "bg"; + type: RECT; + mouse_events: 0; + description { state: "default" 0.0; + color: 255 255 255 255; + } + } + part { name: "elm.swallow.image"; + type: SWALLOW; + description { state: "default" 0.0; + } + } + } + } diff --git a/libug/libug-gallery-efl/res/images/T01_Nocontents_broken.png b/ug/ug-gallery-efl/res/images/T01_Nocontents_broken.png similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_Nocontents_broken.png rename to ug/ug-gallery-efl/res/images/T01_Nocontents_broken.png diff --git a/libug/libug-gallery-efl/res/images/T01_Nocontents_picture.png b/ug/ug-gallery-efl/res/images/T01_Nocontents_picture.png old mode 100644 new mode 100755 similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_Nocontents_picture.png rename to ug/ug-gallery-efl/res/images/T01_Nocontents_picture.png diff --git a/libug/libug-gallery-efl/res/images/T01_btn_play.png b/ug/ug-gallery-efl/res/images/T01_btn_play.png old mode 100644 new mode 100755 similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_btn_play.png rename to ug/ug-gallery-efl/res/images/T01_btn_play.png diff --git a/libug/libug-gallery-efl/res/images/T01_controlbar_icon_done.png b/ug/ug-gallery-efl/res/images/T01_controlbar_icon_done.png similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_controlbar_icon_done.png rename to ug/ug-gallery-efl/res/images/T01_controlbar_icon_done.png diff --git a/libug/libug-gallery-efl/res/images/T01_grid_select_check.png b/ug/ug-gallery-efl/res/images/T01_grid_select_check.png old mode 100644 new mode 100755 similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_grid_select_check.png rename to ug/ug-gallery-efl/res/images/T01_grid_select_check.png diff --git a/ug/ug-gallery-efl/res/images/T01_icon_lock.png b/ug/ug-gallery-efl/res/images/T01_icon_lock.png new file mode 100755 index 0000000..44c98da Binary files /dev/null and b/ug/ug-gallery-efl/res/images/T01_icon_lock.png differ diff --git a/libug/libug-gallery-efl/res/images/T01_icon_thumbnail_bookmark.png b/ug/ug-gallery-efl/res/images/T01_icon_thumbnail_bookmark.png old mode 100644 new mode 100755 similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_icon_thumbnail_bookmark.png rename to ug/ug-gallery-efl/res/images/T01_icon_thumbnail_bookmark.png diff --git a/libug/libug-gallery-efl/res/images/T01_main_folder_bg.png b/ug/ug-gallery-efl/res/images/T01_main_folder_bg.png old mode 100644 new mode 100755 similarity index 100% rename from libug/libug-gallery-efl/res/images/T01_main_folder_bg.png rename to ug/ug-gallery-efl/res/images/T01_main_folder_bg.png diff --git a/res/images/T01_thumbs_bg.png b/ug/ug-gallery-efl/res/images/T01_thumbs_bg.png old mode 100644 new mode 100755 similarity index 100% rename from res/images/T01_thumbs_bg.png rename to ug/ug-gallery-efl/res/images/T01_thumbs_bg.png diff --git a/libug/libug-gallery-efl/src/gallery-efl.c b/ug/ug-gallery-efl/src/gallery-efl.c similarity index 63% rename from libug/libug-gallery-efl/src/gallery-efl.c rename to ug/ug-gallery-efl/src/gallery-efl.c index 0215aa7..f5fbcc5 100755 --- a/libug/libug-gallery-efl/src/gallery-efl.c +++ b/ug/ug-gallery-efl/src/gallery-efl.c @@ -19,19 +19,18 @@ #endif #include -#include #include "gallery-efl.h" #include "ge-debug.h" #include "ge-albums.h" #include "ge-gridview.h" -#include "ge-db-handler.h" +#include "ge-data.h" #include "ge-ui-util.h" #include "ge-util.h" #include "ge-ext-ug-load.h" #include "ge-strings.h" static ge_view_mode g_view_mode = GE_AlbumsView_Mode; -#define GE_BG_COLOR_DEFAULT 45 +#define GE_BG_COLOR_DEFAULT 255 #define GE_BG_ALPHA_DEFAULT 255 @@ -49,38 +48,35 @@ 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_db_init(ugd) != GE_DB_SUCCESS) + if(_ge_data_init(ugd) != 0) { - ge_dbgW("ge_db_init failed!"); + 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_db_get_clusters_list(ugd) != GE_DB_SUCCESS) - { - ge_dbgW("ge_db_get_clusters_list failed!"); - } + 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, AlbumsView_Title, ugd->albums_view_title); - _ge_set_view_mode( GE_AlbumsView_Mode ); + 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, + AlbumsView_Title, ugd->albums_view_title); return 0; } @@ -95,9 +91,10 @@ static Evas_Object *_ge_create_bg(Evas_Object *parent) elm_bg_color_set(bg, GE_BG_COLOR_DEFAULT, GE_BG_COLOR_DEFAULT, GE_BG_COLOR_DEFAULT); - evas_object_size_hint_weight_set(bg, - EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + 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); return bg; @@ -111,7 +108,6 @@ static int _ge_init_view(ge_ugdata *ugd) /* 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); @@ -136,7 +132,6 @@ 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 */ @@ -144,7 +139,6 @@ static int _ge_create_view(ge_ugdata *ugd) GE_CHECK_VAL(ugd->th, -1); elm_theme_ref_set(ugd->th, NULL); elm_theme_extension_add(ugd->th, GE_EDJ_FILE); - elm_theme_extension_add(ugd->th, GALLERY_BLACK_EDJ_FILE); /* Initialize gallery ug view */ if(_ge_init_view(ugd) != 0) @@ -153,15 +147,11 @@ static int _ge_create_view(ge_ugdata *ugd) return -1; } - /* Register MMC and UMS changed callback */ + /* Register MMC changed callback */ if(ge_reg_db_update_noti(ugd) != 0) { ge_dbgE("ge_reg_db_update_noti failed!"); return -1; } - if(ge_reg_ums_noti(ugd) != 0) { - ge_dbgE("ge_reg_ums_noti failed!"); - return -1; - } return 0; } @@ -170,153 +160,167 @@ static int _ge_close_view(ge_ugdata *ugd) { GE_CHECK_VAL(ugd, -1); - GE_DEL_OBJ(ugd->popup) + GE_IF_DEL_OBJ(ugd->popup) - GE_FREE_MEM(ugd->file_setas_callid_path) - GE_FREE_MEM(ugd->file_setas_homescreen_path) - GE_FREE_MEM(ugd->file_setas_lockscreen_path) - GE_FREE_MEM(ugd->file_setas_callid_size) - GE_FREE_MEM(ugd->file_setas_image_path) - GE_FREE_MEM(ugd->file_setas_crop_image_path) + GE_IF_FREE_MEM(ugd->file_setas_callid_path) + GE_IF_FREE_MEM(ugd->file_setas_homescreen_path) + GE_IF_FREE_MEM(ugd->file_setas_lockscreen_path) + GE_IF_FREE_MEM(ugd->file_setas_callid_size) + GE_IF_FREE_MEM(ugd->file_setas_image_path) + GE_IF_FREE_MEM(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_DEL_TIMER(ugd->ums_update_timer) - GE_DEL_TIMER(ugd->del_timer) - GE_DEL_TIMER(ugd->thumbs_clicked_timer) - GE_DEL_IDLER(ugd->grid_append_idler) + 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_dereg_ums_noti(); ge_grid_del_callbacks(ugd); ge_albums_del_callbacks(ugd); - GE_DEL_OBJ(ugd->navi_bar) - GE_DEL_OBJ(ugd->bg) - GE_DEL_OBJ(ugd->ly_main) + 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_db_finalize(ugd); + _ge_data_finalize(ugd); if(ugd->th) { elm_theme_extension_del(ugd->th, GE_EDJ_FILE); - elm_theme_extension_del(ugd->th, - GALLERY_BLACK_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 void __ge_parse_param_launch_type_setas(ge_ugdata *ugd, bundle *data) +static int __ge_parse_param_launch_type_setas(ge_ugdata *ugd, service_h service) { - GE_CHECK(ugd); - GE_CHECK(data); - bundle* b = data; - - const char *setas_type = NULL; - const char *callerid_size = NULL; - const char *callerid_path = NULL; - const char *wallpaper_path = NULL; - const char *lockscreen_path = NULL; - - setas_type = bundle_get_val(b, GE_BUNDLE_SETAS_TYPE); + 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_dbg("setas-type NULL"); - return; + ge_dbgW("setas-type NULL"); + return -1; } if (!strcasecmp(setas_type, GE_FILE_SELECT_SETAS_WALLPALER)) { ugd->file_select_setas_mode = GE_File_Select_Setas_Wallpaper; g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_WALLPAPER, - GE_ALBUM_NAME_LEN_MAX); + GE_ALBUM_NAME_LEN_MAX); - wallpaper_path = bundle_get_val(b, GE_BUNDLE_HOMESCREEN_PATH); + 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 = strdup(wallpaper_path); + ugd->file_setas_homescreen_path = wallpaper_path; } - lockscreen_path = bundle_get_val(b, GE_BUNDLE_LOCKSCREEN_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 = strdup(lockscreen_path); + ugd->file_setas_lockscreen_path = lockscreen_path; } - } else if (!strcasecmp(setas_type, GE_FILE_SELECT_SETAS_CALLERID)) - { + } else if (!strcasecmp(setas_type, GE_FILE_SELECT_SETAS_CROP_WALLPALER)) { + ugd->file_select_setas_mode = GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER; + g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_WALLPAPER, + GE_ALBUM_NAME_LEN_MAX); + } else if (!strcasecmp(setas_type, GE_FILE_SELECT_SETAS_CALLERID)) { ugd->file_select_setas_mode = GE_File_Select_Setas_CallerID; g_strlcpy(ugd->albums_view_title, GE_TITLE_CHANGE_CALLER_ID, - GE_ALBUM_NAME_LEN_MAX); + GE_ALBUM_NAME_LEN_MAX); - callerid_size = bundle_get_val(b, GE_BUNDLE_CALLERID_SIZE); + 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 = strdup(callerid_size); + ugd->file_setas_callid_size = callerid_size; } - callerid_path = bundle_get_val(b, GE_BUNDLE_CALLERID_PATH); + 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 = strdup(callerid_path); + ugd->file_setas_callid_path = callerid_path; } } + + GE_FREE_MEM(setas_type); + return 0; } -static void __ge_parse_param_file_type(ge_ugdata *ugd, bundle *data) +static int __ge_parse_param_file_type(ge_ugdata *ugd, service_h service) { - GE_CHECK(ugd); - GE_CHECK(data); - bundle* b = data; + GE_CHECK_VAL(ugd, -1); + GE_CHECK_VAL(service, -1); - const char *file_type = NULL; + 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_Multiple) || - (ugd->file_select_mode == GE_File_Select_Imft)) { + if(ugd->file_select_mode == GE_File_Select_Multiple) b_singular = false; - } /* file-type */ - file_type = bundle_get_val(b, GE_BUNDLE_FILE_TYPE); - if(file_type == NULL) - goto DEFAULT_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_SELECT_TYPE_IMAGE)) { ugd->file_type_mode = GE_File_Select_Type_Image; if(b_singular) { g_strlcat(ugd->albums_view_title, GE_TITLE_IMAGE, - sizeof(ugd->albums_view_title)); + sizeof(ugd->albums_view_title)); } else { g_strlcat(ugd->albums_view_title, GE_TITLE_IMAGES, - sizeof(ugd->albums_view_title)); + sizeof(ugd->albums_view_title)); } - return; + GE_FREE_MEM(file_type); + return 0; } else if (!strcasecmp(file_type, GE_FILE_SELECT_TYPE_VIDEO)) { ugd->file_type_mode = GE_File_Select_Type_Video; if(b_singular) { g_strlcat(ugd->albums_view_title, GE_TITLE_VIDEO, - sizeof(ugd->albums_view_title)); + sizeof(ugd->albums_view_title)); } else { g_strlcat(ugd->albums_view_title, GE_TITLE_VIDEOS, - sizeof(ugd->albums_view_title)); + sizeof(ugd->albums_view_title)); } - return; + + GE_FREE_MEM(file_type); + return 0; } -DEFAULT_FILE_TYPE: + +GE_DEFAULT_FILE_TYPE: + ge_dbg("file type is default, set default type(ALL)."); ugd->file_type_mode = GE_File_Select_Type_All; if(b_singular) { @@ -328,64 +332,48 @@ DEFAULT_FILE_TYPE: g_strlcat(ugd->albums_view_title, file_type_str, sizeof(ugd->albums_view_title)); - return; + return 0; } /* analysis parameters */ -static int _ge_parse_param(ge_ugdata *ugd, bundle *data) +static int _ge_parse_param(ge_ugdata *ugd, service_h service) { GE_CHECK_VAL(ugd, -1); - GE_CHECK_VAL(data, -1); - bundle* b = data; - const char *launch_type = NULL; + GE_CHECK_VAL(service, -1); + char *launch_type = NULL; - launch_type = bundle_get_val(b, GE_BUNDLE_LAUNCH_TYPE); + 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_ALBUM_SELECT_ONE)) - { + if(!strcasecmp(launch_type, GE_ALBUM_SELECT_ONE)) { ugd->album_select_mode = GE_Album_Select_One; g_strlcpy(ugd->albums_view_title, GE_TITLE_ALBUMS, - GE_ALBUM_NAME_LEN_MAX); + GE_ALBUM_NAME_LEN_MAX); } else if (!strcasecmp(launch_type, GE_FILE_SELECT_SETAS)) { ugd->file_select_mode = GE_File_Select_Setas; - __ge_parse_param_launch_type_setas(ugd, data); + __ge_parse_param_launch_type_setas(ugd, service); /* Checkme: Only image type is offered in SETAS case */ ugd->file_type_mode = GE_File_Select_Type_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); + GE_ALBUM_NAME_LEN_MAX); + g_strlcat(ugd->albums_view_title, " ", GE_ALBUM_NAME_LEN_MAX); - if (!strcasecmp(launch_type, GE_FILE_SELECT_ONE)) { + if (!strcasecmp(launch_type, GE_FILE_SELECT_ONE)) ugd->file_select_mode = GE_File_Select_One; - } else if (!strcasecmp(launch_type, GE_FILE_SELECT_MULTIPLE)) { + else if (!strcasecmp(launch_type, GE_FILE_SELECT_MULTIPLE)) ugd->file_select_mode = GE_File_Select_Multiple; - } else if (!strcasecmp(launch_type, GE_FILE_SELECT_IMFT)) { - ugd->file_select_mode = GE_File_Select_Imft; - - const char *contact_id = NULL; - contact_id = bundle_get_val(b, "contact"); - if (contact_id) { - ugd->file_select_contact_id = atoi(contact_id); - } else { - ugd->file_select_mode = GE_File_Select_None; - ugd->file_select_contact_id = -1; - ge_dbg("Invalid args"); - return -1; - } - - ge_dbg("contact_id: %d", ugd->file_select_contact_id); - } - - __ge_parse_param_file_type(ugd, data); + else + ge_dbgE("Wrong launch type!"); + __ge_parse_param_file_type(ugd, service); } + GE_FREE_MEM(launch_type); return 0; } @@ -399,16 +387,14 @@ static int _ge_parse_param(ge_ugdata *ugd, bundle *data) * * @return */ -static void * _ge_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, void *priv) +static void * _ge_create(ui_gadget_h ug, enum ug_mode mode, service_h service, void *priv) { ge_dbg("Enter..."); Evas_Object *parent = NULL; ge_ugdata *ugd = NULL; - int w = 0; - int h = 0; GE_CHECK_NULL(priv); - GE_CHECK_NULL(data); + GE_CHECK_NULL(service); GE_CHECK_NULL(ug); ge_dbgW("Gallery UG start..."); @@ -422,8 +408,6 @@ static void * _ge_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, bindtextdomain("ug-gallery-efl" , "/opt/ug/res/locale"); /* Reset inited flag, it would be set as TRUE if albums view created */ ugd->b_inited_view = false; - /* Get UMS state */ - ge_get_ums_state(ugd); /* Set view mode */ _ge_set_view_mode(GE_AlbumsView_Mode); @@ -431,14 +415,12 @@ static void * _ge_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, GE_CHECK_NULL(x_win); Ecore_X_Window root_win = ecore_x_window_root_get(x_win); GE_CHECK_NULL(root_win); - ecore_x_window_size_get(root_win, &w, &h); - ge_dbg("x_window_w : %d, x_window_h: %d.", w, h); - ugd->win_w = w; - ugd->win_h = h; - ugd->win_scale = (double)(((double)w)/((double)GE_BASE_WIN_WIDTH)); - ugd->bundle = data; + ugd->win_scale = elm_scale_get(); + + service_clone(&(ugd->service), service); + /* Parse parameters passed from parent */ - if(_ge_parse_param(ugd, data) != 0) { + if(_ge_parse_param(ugd, service) != 0) { ge_dbgE("Failed to parse parameters!"); return NULL; } @@ -466,7 +448,7 @@ static void * _ge_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, * @param data * @param priv */ -static void _ge_start(struct ui_gadget *ug, bundle *data, void *priv) +static void _ge_start(ui_gadget_h ug, service_h service, void *priv) { } @@ -477,7 +459,7 @@ static void _ge_start(struct ui_gadget *ug, bundle *data, void *priv) * @param data * @param priv */ -static void _ge_pause(struct ui_gadget *ug, bundle *data, void *priv) +static void _ge_pause(ui_gadget_h ug, service_h service, void *priv) { ge_dbg(""); } @@ -489,7 +471,7 @@ static void _ge_pause(struct ui_gadget *ug, bundle *data, void *priv) * @param data * @param priv */ -static void _ge_resume(struct ui_gadget *ug, bundle *data, void *priv) +static void _ge_resume(ui_gadget_h ug, service_h service, void *priv) { ge_dbg(""); GE_CHECK(priv); @@ -508,7 +490,7 @@ static void _ge_resume(struct ui_gadget *ug, bundle *data, void *priv) * @param data * @param priv */ -static void _ge_destroy(struct ui_gadget *ug, bundle *data, void *priv) +static void _ge_destroy(ui_gadget_h ug, service_h service, void *priv) { ge_dbgW(""); GE_CHECK(ug); @@ -527,7 +509,7 @@ static void _ge_destroy(struct ui_gadget *ug, bundle *data, void *priv) * @param data * @param priv */ -static void _ge_message(struct ui_gadget *ug, bundle *msg, bundle *data, void *priv) +static void _ge_message(ui_gadget_h ug, service_h msg, service_h service, void *priv) { ge_dbg(""); } @@ -540,9 +522,11 @@ static void _ge_message(struct ui_gadget *ug, bundle *msg, bundle *data, void *p * @param data * @param priv */ -static void _ge_event(struct ui_gadget *ug, enum ug_event event, bundle *data, void *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) { @@ -557,28 +541,62 @@ static void _ge_event(struct ui_gadget *ug, enum ug_event event, bundle *data, v case UG_EVENT_LANG_CHANGE: ge_dbg("UG_EVENT_LANG_CHANGE"); 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); + + if((ugd->file_select_mode == GE_File_Select_Multiple) && + (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) + { + ge_ui_rotate_selinfo(ugd); + } } -static void _ge_key_event(struct ui_gadget *ug, enum ug_key_event event, bundle *data, void *priv) +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; - } + switch (event) { + case UG_KEY_EVENT_END: + ge_dbg("Receive key end event"); + ug_destroy_me(ug); + break; + + default: + break; + } } /** @@ -629,5 +647,6 @@ UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops) free(ugd); ugd = NULL; } + ge_dbgW("UG_MODULE_EXIT"); } diff --git a/libug/libug-gallery-efl/src/ge-albums.c b/ug/ug-gallery-efl/src/ge-albums.c similarity index 51% rename from libug/libug-gallery-efl/src/ge-albums.c rename to ug/ug-gallery-efl/src/ge-albums.c index 8e9033f..af5f01c 100755 --- a/libug/libug-gallery-efl/src/ge-albums.c +++ b/ug/ug-gallery-efl/src/ge-albums.c @@ -19,38 +19,18 @@ #include "ge-gridview.h" #include "ge-ui-util.h" #include "ge-util.h" -#include "ge-db-handler.h" +#include "ge-drm.h" +#include "ge-data.h" #include "ge-strings.h" +#include "ge-tile.h" +#include "ge-rotate-bg.h" static Elm_Gengrid_Item_Class album_gic; +static Elm_Gengrid_Item_Class album_gic_blue; static int gl_albums_item_cnt; static ge_item* gl_album_items[GE_ALBUM_COVER_THUMB_NUM]; static int gl_album_count; -struct ge_color { - int r; - int g; - int b; -}; - -/* Size of table padding */ -#define GE_COVER_PAD 3 -#define GE_COVER_PAD_2 2 - -#define GE_ALBUM_TEXT_COLOR_ALPHA 255 -#define GE_BG_COLOR_CNT 6 -static struct ge_color ge_bg_color[] = -{ - {50, 50, 50}, - {78, 74, 64}, - {206, 108, 1}, - {157, 35, 39}, - {20, 60, 128}, - {84, 109, 49}, - {25, 25, 25}, -}; - - static void _ge_albums_drag_up(void *data, Evas_Object *obj, void *event_info) { ge_dbg(""); @@ -78,7 +58,7 @@ static void _ge_albums_drag_stop(void *data, Evas_Object *obj, void *event_info) static void _ge_albums_realized(void *data, Evas_Object *obj, void *event_info) { - ge_dbg(""); + //ge_dbg(""); } static void _ge_albums_selected(void *data, Evas_Object *obj, void *event_info) @@ -108,22 +88,14 @@ static Eina_Bool _ge_albums_append_grid_idler(void *data) /* Try to get other medias from DB and append them to gridview*/ int ret = ge_grid_idler_append_thumbs(data); - if(ret < 0) - { + if(ret != 0) { ge_dbg("Failed to append grid items!"); - if(ret == MB_SVC_ERROR_DB_NO_RECORD) - { - /* Maybe all medias were already showed */ - ge_dbg("No any more records!"); - } - } - else - { + } else { ge_dbg("Successful to append grid items!"); } /* Remove idler after all items appended */ - GE_DEL_IDLER(ugd->grid_append_idler) + GE_IF_DEL_IDLER(ugd->grid_append_idler) return ECORE_CALLBACK_CANCEL; } @@ -155,7 +127,7 @@ static void __ge_albums_sel_cb(void *data, Evas_Object *obj, void *event_info) ge_albums_sel_album(album_item); } -char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part) +static char *__ge_albums_get_text(void *data, Evas_Object *obj, const char *part) { GE_CHECK_NULL(part); GE_CHECK_NULL(data); @@ -166,30 +138,30 @@ char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part) ge_ugdata *ugd = album_item->ugd; char buf[GE_FILE_PATH_LEN_MAX] = {0,}; - if (!strcmp(part, "elm.text.name")) + if (!g_strcmp0(part, "elm.text.name")) { GE_CHECK_NULL(album_item->cluster->display_name); - if(strlen(album_item->cluster->display_name)) { - snprintf(buf, sizeof(buf), "%s", (char*)(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(ge_db_is_root_path(ugd, album_item->cluster->uuid, NULL)) { - snprintf(buf, sizeof(buf), GE_ALBUM_ROOT_NAME); + } else if(strlen(album_item->cluster->display_name)) { + snprintf(buf, sizeof(buf), "%s", (char*)(album_item->cluster->display_name)); buf[strlen(buf)] = '\0'; } + /* Show blue folder name */ if (!g_strcmp0(album_item->cluster->uuid, GE_ALBUM_ALL_ID) || - ge_db_is_default_album(ugd, album_item->cluster)) { + _ge_data_is_default_album(GE_ALBUM_MY_NAME, album_item->cluster)) { Elm_Object_Item *grid_it = album_item->griditem; - const Evas_Object *con_it_obj = NULL; - con_it_obj = elm_object_item_widget_get(grid_it); - GE_CHECK_NULL(con_it_obj); - Evas_Object *it_obj = (Evas_Object *)con_it_obj; + 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 (!strcmp(part, "elm.text.date")) + else if (!g_strcmp0(part, "elm.text.date")) { struct tm t1; struct tm t2; @@ -202,7 +174,9 @@ char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part) int item_count = GE_ALBUM_COVER_THUMB_NUM; ge_item** items1 = gl_album_items; - ge_db_get_first_several_items(ugd, album_item, items1, &item_count, MINFO_MEDIA_SORT_BY_DATE_DESC); + _ge_data_get_first_several_items(ugd, album_item, items1, + &item_count, + MEDIA_CONTENT_ORDER_DESC); if(item_count <= 0) { gl_album_count = 0; @@ -220,7 +194,9 @@ char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part) item_count = 1; ge_item* items2[1]; memset(items2, 0x00, item_count * sizeof(int)); - ge_db_get_first_several_items(ugd, album_item, items2, &item_count, MINFO_MEDIA_SORT_BY_DATE_ASC); + _ge_data_get_first_several_items(ugd, album_item, items2, + &item_count, + MEDIA_CONTENT_ORDER_ASC); if(item_count <= 0) { @@ -242,7 +218,7 @@ char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part) localtime_r((time_t *) &(items2[0]->item->mtime), &t2); strftime(date2, sizeof(date2), "%Y.%m.%d", &t2); - if(!strcmp(date1, date2)) + if(!g_strcmp0(date1, date2)) { g_strlcpy(buf, date1, sizeof(buf)); } @@ -257,13 +233,13 @@ char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part) int i = 0; for(i = 0; i < item_count; i++) { - ge_db_destroy_item(items2[i]); + _ge_data_destroy_item(items2[i]); items2[i] = NULL; } } - else if (!strcmp(part, "elm.text.count")) + else if (!g_strcmp0(part, "elm.text.count")) { - ge_db_update_items_cnt(ugd, album_item); + _ge_data_update_items_cnt(ugd, album_item); snprintf(buf, sizeof(buf), "%d", (int)(album_item->cluster->count)); buf[strlen(buf)] = '\0'; } @@ -271,373 +247,88 @@ char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part) return strdup(buf); } -Evas_Object * _ge_albums_get_content(void *data, Evas_Object *obj, const char *part) +static ge_icon_type __ge_albums_set_bg_file(Evas_Object *bg, void *data) { - GE_CHECK_NULL(part); - GE_CHECK_NULL(obj); - GE_CHECK_NULL(data); - if(strlen(part) <= 0) - { - ge_dbgE("part length <= 0"); - return NULL; + 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; } - 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; - double scale_factor = ugd->win_scale; - int i = 0; - int j =0; - int r1 = 0; + /* 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; + } - if((!strcmp(part, "elm.swallow.firsticon")) || - (!strcmp(part, "elm.swallow.icon")) || - (!strcmp(part, "elm.swallow.onlyicon"))) - { - if(_ge_get_view_mode() != GE_AlbumsView_Mode) - { - ge_dbgE("View mode is wrong!"); - return NULL; - } + ret_val= GE_ICON_NORMAL; + bg_path = _GETICON(git->item->thumb_url); - ge_item **items = gl_album_items; - int item_count = gl_album_count; - int length = item_count; - Evas_Object* bg = NULL; + GE_ALBUMS_FAILED: - if(!strcmp(part, "elm.swallow.onlyicon")) - { - /* Part for album contains only one media */ - if(length != 1) - { - return NULL; - } - else - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - elm_bg_load_size_set(bg, - (int)(GE_COVER_ICON_S * scale_factor), - (int)(GE_COVER_ICON_S * scale_factor)); - - if(items[0] && (items[0])->item) - { - elm_bg_file_set(bg, _GETICON((items[0])->item->thumb_url), NULL); - } - - 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; - } - } +#ifdef _USE_ROTATE_BG_GE + _ge_rotate_bg_set_image_file(bg, bg_path); +#else + elm_bg_file_set(bg, bg_path, NULL); +#endif - if(!strcmp(part, "elm.swallow.firsticon")) - { - ge_dbg("firsticon"); - if(length <= 1) - { - return NULL; - } - else - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - elm_bg_load_size_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_GRID_S * scale_factor)); - if(items[0] && (items[0])->item) - { - elm_bg_file_set(bg, _GETICON((items[0])->item->thumb_url), NULL); - } - } + return ret_val; +} - evas_object_size_hint_max_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_GRID_S * scale_factor)); - 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); - evas_object_show(bg); - return bg; - } +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; - if(!strcmp(part, "elm.swallow.icon")) - { - ge_dbg("icon"); - Evas_Object * tb = NULL; + GE_CHECK_NULL(album_item->cluster->uuid); + const char *al_id = album_item->cluster->uuid; + ge_dbg(""); - if(length <= 0) - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - elm_bg_load_size_set(bg, - (int)(GE_COVER_ICON_S * scale_factor), - (int)(GE_COVER_ICON_S * scale_factor)); - elm_bg_file_set(bg, GE_DEFAULT_THUMB_ICON, NULL); - 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; - } - else if(length == 1) - { - return NULL; - } - else if(length == 2) - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - elm_bg_load_size_set(bg, - (int)(GE_COVER_ICON_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - - if(items[1] && (items[1])->item) - { - elm_bg_file_set(bg, _GETICON((items[1])->item->thumb_url), NULL); - } - - 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; - } - else if(length == 3) - { - tb = elm_table_add(obj); - GE_CHECK_NULL(tb); - elm_table_padding_set(tb, - GE_COVER_PAD * scale_factor, - GE_COVER_PAD * scale_factor); - r1 = 1; - for(i = 1; i < length; i++) - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - if(i==1) - { - elm_bg_load_size_set(bg, - (int)(GE_COVER_2X_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - evas_object_size_hint_min_set(bg, - (int)(GE_COVER_2X_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - } - else - { - elm_bg_load_size_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - evas_object_size_hint_min_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - } - - elm_table_padding_set(tb, - GE_COVER_PAD_2 * scale_factor, - GE_COVER_PAD_2 * scale_factor); - - if(items[i] && (items[i])->item) - { - elm_bg_file_set(bg, _GETICON((items[i])->item->thumb_url), NULL); - } - - if(i==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); - elm_table_pack(tb, bg, 0, 0, 2, 2); - } - else - { - 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); - elm_table_pack(tb, bg, 2, 0, 1, 2); - } - evas_object_show(bg); - } - } - else if(length < GE_ALBUM_COVER_THUMB_NUM) - { - length = GE_ALBUM_COVER_THUMB_NUM_SEC; - tb = elm_table_add(obj); - GE_CHECK_NULL(tb); - elm_table_padding_set(tb, - GE_COVER_PAD * scale_factor, - GE_COVER_PAD * scale_factor); - elm_table_padding_set(tb, - GE_COVER_PAD_2 * scale_factor, - GE_COVER_PAD_2 * scale_factor); - r1 = 1; - for(i = 1; i < length; i++) - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - if(i == 1) - { - elm_bg_load_size_set(bg, - (int)(GE_COVER_2X_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - evas_object_size_hint_min_set(bg, - (int)(GE_COVER_2X_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - } - else - { - elm_bg_load_size_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_GRID_S * scale_factor)); - evas_object_size_hint_min_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_GRID_S * scale_factor)); - } - - if(items[i] && (items[i])->item) - { - elm_bg_file_set(bg, _GETICON((items[i])->item->thumb_url), NULL); - } - - 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); - - if(i == 1) - elm_table_pack(tb, bg, 0, 0, 2, 2); - else if(i == 2) - elm_table_pack(tb, bg, 2, 0, 1, 1); - else if(i == 3) - elm_table_pack(tb, bg, 2, 1, 1, 1); - evas_object_show(bg); - } - } - else - { - tb = elm_table_add(obj); - GE_CHECK_NULL(tb); - elm_table_padding_set(tb, - GE_COVER_PAD * scale_factor, - GE_COVER_PAD * scale_factor); - - if((!strcmp(album_item->cluster->display_name, GE_ALBUM_ALL_NAME)) || - (!strcmp(album_item->cluster->display_name, GE_ALBUM_MY_NAME))) - { - for(i = 1; i < GE_ALBUM_COVER_THUMB_NUM; i++) - { - if(i < item_count) - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - elm_bg_load_size_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_GRID_S * scale_factor)); - - if(items[i] && (items[i])->item) - { - elm_bg_file_set(bg, _GETICON((items[i])->item->thumb_url), NULL); - } - } - else - { - bg = evas_object_rectangle_add(evas_object_evas_get(obj)); - - if (!g_strcmp0(album_item->cluster->uuid, GE_ALBUM_ALL_ID) || - ge_db_is_default_album(ugd, album_item->cluster)) - j = GE_BG_COLOR_CNT; - else - j = (album_item->index) % GE_BG_COLOR_CNT; - evas_object_color_set(bg, ge_bg_color[j].r, - ge_bg_color[j].g, ge_bg_color[j].b, - GE_ALBUM_TEXT_COLOR_ALPHA); - } - - 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); - - elm_table_pack(tb, bg, (int)((i-1)%3), (int)((i-1)/3), 1, 1); - - evas_object_show(bg); - } - } - else - { - elm_table_padding_set(tb, - GE_COVER_PAD_2 * scale_factor, - GE_COVER_PAD_2 * scale_factor); - r1= 1; - for(i = 1; i < GE_ALBUM_COVER_THUMB_NUM_SEC; i++) - { - bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - if(i == 1) - { - elm_bg_load_size_set(bg, - (int)(GE_COVER_2X_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - evas_object_size_hint_min_set(bg, - (int)(GE_COVER_2X_GRID_S * scale_factor), - (int)(GE_COVER_2X_GRID_S * scale_factor)); - } - else - { - elm_bg_load_size_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_GRID_S * scale_factor)); - evas_object_size_hint_min_set(bg, - (int)(GE_COVER_GRID_S * scale_factor), - (int)(GE_COVER_GRID_S * scale_factor)); - } - - if(items[i] && (items[i])->item) - { - elm_bg_file_set(bg, _GETICON((items[i])->item->thumb_url), NULL); - } - - 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); - - if(i == 1) - elm_table_pack(tb, bg, 0, 0, 2, 2); - else if(i == 2) - elm_table_pack(tb, bg, 2, 0, 1, 1); - else if( i == 3) - elm_table_pack(tb, bg, 2, 1, 1, 1); - evas_object_show(bg); - } - } - } - evas_object_show(tb); - return tb; - } - } - else if (!strcmp(part, "label_bg")) - { - Evas_Object *bg = evas_object_rectangle_add(evas_object_evas_get(obj)); - GE_CHECK_NULL(bg); + Evas_Object *_obj = NULL; + if ((!g_strcmp0(part, GT_TILE_FIRSTICON)) || + (!g_strcmp0(part, GT_TILE_ONLYICON)) || + (!g_strcmp0(part, GT_TILE_ICON)) +#ifdef _USE_ROTATE_BG_GE + || (!g_strcmp0(part, GT_TILE_3ICON1)) || + (!g_strcmp0(part, GT_TILE_3ICON2)) || + (!g_strcmp0(part, GT_TILE_4ICON3)) || + (!g_strcmp0(part, GT_TILE_4ICON4)) || + (!g_strcmp0(part, GT_TILE_5ICON1)) || + (!g_strcmp0(part, GT_TILE_5ICON2)) || + (!g_strcmp0(part, GT_TILE_6ICON4)) || + (!g_strcmp0(part, GT_TILE_6ICON5)) +#endif + ) { + _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 "All" their colors should be + * for "Camera", its color should be * 25:25:25 by new gui */ - if (!g_strcmp0(album_item->cluster->uuid, GE_ALBUM_ALL_ID) || - ge_db_is_default_album(ugd, album_item->cluster)) - j = GE_BG_COLOR_CNT; - else - j = (album_item->index) % GE_BG_COLOR_CNT; - evas_object_color_set(bg, ge_bg_color[j].r, - ge_bg_color[j].g, ge_bg_color[j].b, - GE_ALBUM_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; + bool b_default = false; + if (!g_strcmp0(al_id, GE_ALBUM_ALL_ID) || + _ge_data_is_default_album(GE_ALBUM_MY_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 NULL; + return _obj; } static int _ge_albums_create_album(ge_ugdata* ugd, Evas_Object* parent) @@ -651,8 +342,13 @@ static int _ge_albums_create_album(ge_ugdata* ugd, Evas_Object* parent) 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; + album_gic.func.text_get = __ge_albums_get_text; + album_gic.func.content_get = __ge_albums_get_content; + + album_gic_blue.item_style = "albums_view_blue"; + album_gic_blue.func.text_get = __ge_albums_get_text; + album_gic_blue.func.content_get = __ge_albums_get_content; + int length = eina_list_count(ugd->cluster_list->clist); ge_dbg("Albums list length: %d.", length); @@ -672,14 +368,22 @@ static int _ge_albums_create_album(ge_ugdata* ugd, Evas_Object* parent) 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); + /* Show blue folder name */ + if (!g_strcmp0(album_item->cluster->uuid, GE_ALBUM_ALL_ID) || + _ge_data_is_default_album(GE_ALBUM_MY_NAME, album_item->cluster)) + album_item->griditem = elm_gengrid_item_append(parent, + &album_gic_blue, + album_item, + __ge_albums_sel_cb, + album_item); + else + 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); } @@ -706,7 +410,7 @@ int ge_albums_free_cover_thumbs(ge_ugdata *ugd) { if(gl_album_items[i]) { - ge_db_destroy_item(gl_album_items[i]); + _ge_data_destroy_item(gl_album_items[i]); gl_album_items[i] = NULL; } } @@ -722,10 +426,10 @@ int ge_albums_back_to_view(ge_ugdata *ugd) if(ugd->file_select_mode == GE_File_Select_Multiple) { ge_ui_destroy_selinfo(ugd); - ge_db_selected_list_finalize(); + _ge_data_selected_list_finalize(); } - GE_DEL_IDLER(ugd->grid_append_idler) + GE_IF_DEL_IDLER(ugd->grid_append_idler) ge_albums_update_view(ugd); ge_grid_clear_view(ugd); @@ -755,21 +459,21 @@ int ge_albums_sel_album(ge_cluster* album_item) 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, cluster_index: %d.", - album_item->cluster->display_name, album_item->cluster->uuid, - album_item->index); + ge_dbg("Album: %s, id: %s.", album_item->cluster->display_name, + album_item->cluster->uuid); if(ugd->album_select_mode == GE_Album_Select_One) { ge_dbg("One album selected, return album id and destroy the ug!"); char folder_path[GE_DIR_PATH_LEN_MAX] = { 0, }; - ge_db_get_folder_fullpath(ugd, album_item->cluster->uuid, - folder_path); - bundle_del(ugd->bundle, GE_ALBUM_SELECT_RETURN_PATH); - bundle_add(ugd->bundle, GE_ALBUM_SELECT_RETURN_PATH, folder_path); + g_strlcpy(folder_path, album_item->cluster->path, + GE_DIR_PATH_LEN_MAX); + service_add_extra_data(ugd->service, + GE_ALBUM_SELECT_RETURN_PATH, + folder_path); ge_dbg("return folder-path: %s", folder_path); - ug_send_result(ugd->ug, ugd->bundle); + ug_send_result(ugd->ug, ugd->service); ug_destroy_me(ugd->ug); ugd->ug = NULL; return 0; @@ -778,9 +482,10 @@ int ge_albums_sel_album(ge_cluster* album_item) /* Set current album */ _ge_set_current_album(album_item); /* Remove idler */ - GE_DEL_IDLER(ugd->grid_append_idler) + GE_IF_DEL_IDLER(ugd->grid_append_idler) /* Get album contents from DB */ - ge_db_get_items_list(ugd, album_item, GE_FIRST_VIEW_START_POS, GE_FIRST_VIEW_END_POS); + _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_Setas) { @@ -793,9 +498,6 @@ int ge_albums_sel_album(ge_cluster* album_item) _ge_set_view_mode(GE_ThumbnailEdit_Mode); } - ugd->cluster_list->cur_pos = album_item->index; //save the index of current selected album - ge_dbg("\n\nIndex is %d\n",album_item->index); - ugd->thumbs_view_ly = ge_grid_create_ly(ugd->navi_bar); GE_CHECK_VAL(ugd->thumbs_view_ly, -1); Evas_Object* gv = NULL; @@ -810,13 +512,13 @@ int ge_albums_sel_album(ge_cluster* album_item) ugd->thumbs_nocontents = gv; } - /* Clear view */ + /* Checkme: clear albums view for animation effect pause issue */ elm_gengrid_clear(ugd->albums_view); if(_ge_get_view_mode() == GE_ThumbnailView_Mode) { /* Check root case */ - if(ge_db_is_root_path(ugd, album_item->cluster->uuid, NULL)) + if(_ge_data_is_root_path(album_item->cluster->path)) { ge_ui_create_title_and_push(ugd, ugd->navi_bar, ugd->thumbs_view_ly, ThumbnailView_Title, GE_ALBUM_ROOT_NAME); @@ -833,7 +535,7 @@ int ge_albums_sel_album(ge_cluster* album_item) ugd->thumbs_view_ly, ThumbnailView_Title, ugd->albums_view_title); } - if(ge_db_get_count_all() == (GE_FIRST_VIEW_END_POS+1)) + 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); @@ -884,10 +586,9 @@ Evas_Object* ge_albums_create_view(ge_ugdata* ugd, Evas_Object* parent) memset(gl_album_items, 0x00, GE_ALBUM_COVER_THUMB_NUM * sizeof(int)); gl_album_count = 0; - ge_get_ums_state(ugd); - if(ugd->ug_exit_mode || !ugd->cluster_list->clist || + if(!ugd->cluster_list->clist || (eina_list_count(ugd->cluster_list->clist) == 0)) { - ge_dbgW("It's UMS mode or clusters list is empty!"); + ge_dbgW("Clusters list is empty!"); goto ALBUMS_FAILED; } @@ -936,7 +637,7 @@ ALBUMS_FAILED: ge_dbgW("@@@@@@@ To create nocontents view @@@@@@@@"); ugd->nocontents = ge_ui_create_nocontents(ugd); ugd->albums_view = ugd->nocontents; - evas_object_show (ugd->nocontents); + evas_object_show(ugd->nocontents); return ugd->nocontents; } @@ -947,10 +648,9 @@ int ge_albums_update_view(ge_ugdata *ugd) GE_CHECK_VAL(ugd, -1); GE_CHECK_VAL(ugd->cluster_list, -1); /* Changed to show no contents if needed */ - ge_get_ums_state(ugd); - if(ugd->ug_exit_mode || !ugd->cluster_list->clist || + if(!ugd->cluster_list->clist || (eina_list_count(ugd->cluster_list->clist) == 0)) { - ge_dbgW("It's UMS mode or clusters list is empty!"); + ge_dbgW("Clusters list is empty!"); goto ALBUMS_FAILED; } @@ -962,7 +662,7 @@ int ge_albums_update_view(ge_ugdata *ugd) 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); + ugd->albums_view); evas_object_show(ugd->albums_view); } else { if(_ge_albums_create_album(ugd, ugd->albums_view) != 0) @@ -984,7 +684,7 @@ ALBUMS_FAILED: 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); + elm_object_part_content_set(ugd->albums_view_ly, "contents", + ugd->albums_view); return -1; } - diff --git a/libug/libug-gallery-efl/src/ge-button.c b/ug/ug-gallery-efl/src/ge-button.c similarity index 61% rename from libug/libug-gallery-efl/src/ge-button.c rename to ug/ug-gallery-efl/src/ge-button.c index 52e6255..cd7905f 100755 --- a/libug/libug-gallery-efl/src/ge-button.c +++ b/ug/ug-gallery-efl/src/ge-button.c @@ -20,43 +20,6 @@ #include "ge-button.h" #include "ge-strings.h" -#define GE_BTN_NF_TITLE "naviframe/title/gallery_efl" - -Evas_Object *ge_but_create_title_but(ge_ugdata *ugd, Evas_Object *parent, ge_but_mode mode) -{ - ge_dbg("Button mode: %d", mode); - Evas_Object* btn = NULL; - GE_CHECK_NULL(ugd); - GE_CHECK_NULL(parent); - - btn = elm_button_add(parent); - GE_CHECK_NULL(btn); - if(ugd->th) - elm_object_theme_set(btn, ugd->th); - - elm_object_style_set(btn, GE_BTN_NF_TITLE); - evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, 0.5); - - switch (mode) { - case GE_BUT_DONE: - elm_object_text_set(btn, - (char*)_GE_GETSYSTEMSTR("IDS_COM_SK_DONE")); - break; - case GE_BUT_CANCEL: - elm_object_text_set(btn, - (char*)_GE_GETSYSTEMSTR("IDS_COM_SK_CANCEL")); - break; - default: - break; - } - - evas_object_show(btn); - - return btn; -} - Evas_Object *_ge_but_create_but(Evas_Object *parent, ge_but_mode mode, But_Smart_Cb cb_func, const void *data) { ge_dbg("Button mode: %d", mode); @@ -84,4 +47,3 @@ Evas_Object *_ge_but_create_but(Evas_Object *parent, ge_but_mode mode, But_Smart 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..b94c7f2 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-data-type.c @@ -0,0 +1,146 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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); + + FREE_DATA(tmp_item->uuid); + FREE_DATA(tmp_item->thumb_url); + FREE_DATA(tmp_item->file_url); + FREE_DATA(tmp_item->album_uuid); + FREE_DATA(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); + + FREE_DATA(tmp_item->image_info->media_uuid); + 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); + + FREE_DATA(tmp_item->video_info->media_uuid); + FREE_DATA(tmp_item->video_info->title); + } + + 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; + + FREE_DATA(tmp_album->uuid); + FREE_DATA(tmp_album->display_name); + FREE_DATA(tmp_album->path); + + if (tmp_album->folder_h) + media_folder_destroy(tmp_album->folder_h); + 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..ea553e8 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-data.c @@ -0,0 +1,954 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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; + } + + if(gitem->_reserved) { + free(gitem->_reserved); + gitem->_reserved = NULL; + } + + 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; + } + + if(gcluster->_reserved) { + free(gcluster->_reserved); + gcluster->_reserved = NULL; + } + 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; + } + + free(ugd->cluster_list); + ugd->cluster_list = NULL; + } + + 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) { + free(gcluster); + gcluster = NULL; + 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); + filter.collate_type = MEDIA_CONTENT_COLLATE_DEFAULT; + 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); + return err; + } + + 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); + + /* only image is valid in setas mode. */ + if (ugd->file_type_mode == GE_File_Select_Type_Image || + ugd->file_type_mode == GE_File_Select_Type_Video) { + memset(&filter,0x00,sizeof(ge_filter_s)); + if(ugd->file_type_mode == GE_File_Select_Type_Image) + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, + CONDITION_LENGTH); + else + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, + 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; + + 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_MY_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 { + 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; + } + free(p_id); + p_id = NULL; + } + *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); + free(p_id); + p_id = NULL; + 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_DEFAULT; + 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_Select_Type_Image) + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + else if(ugd->file_type_mode == GE_File_Select_Type_Video) + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, 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_Select_Type_Image) { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + } else if (ugd->file_type_mode == GE_File_Select_Type_Video) { + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH); + } else { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + } + + filter.collate_type = MEDIA_CONTENT_COLLATE_DEFAULT; + 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_ThumbnailEdit_Mode && + ugd->file_select_mode != GE_File_Select_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_Select_Type_Image) { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + } else if (ugd->file_type_mode == GE_File_Select_Type_Video) { + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH); + } else { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + } + + filter.collate_type = MEDIA_CONTENT_COLLATE_DEFAULT; + 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_Select_Type_Image) { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE, CONDITION_LENGTH); + } else if (ugd->file_type_mode == GE_File_Select_Type_Video) { + g_strlcpy(filter.cond, GE_CONDITION_VIDEO, CONDITION_LENGTH); + } else { + g_strlcpy(filter.cond, GE_CONDITION_IMAGE_VIDEO, + CONDITION_LENGTH); + } + + filter.collate_type = MEDIA_CONTENT_COLLATE_DEFAULT; + 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_IF_FREE_MEM(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; +} + +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/libug/libug-gallery-efl/src/ge-debug.c b/ug/ug-gallery-efl/src/ge-debug.c similarity index 100% rename from libug/libug-gallery-efl/src/ge-debug.c rename to ug/ug-gallery-efl/src/ge-debug.c 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..ad4064c --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-drm.c @@ -0,0 +1,83 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +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..4c6bc50 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-exif.c @@ -0,0 +1,1089 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +#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_EXI_TMP_JPEG_FILE "/opt/media/.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"); + if (time_buf) + free(time_buf); + return ret; +} + +/* Add exif to jfif 1.00, to add exif for some cases */ +static int __ge_exif_rw_jfif_1dot00(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; + + 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; + } + + /* Remove header of JFIF from 0 to first 0xFF */ + 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) { + if (tmp[0] == GE_EXIF_TAG) { + ge_dbgW("0xFF!"); + b_tag_ff = true; + } + /* Move back 1 byte */ + fseek(fd, -1, SEEK_CUR); + break; + } + } + + /* Add raw EXIF header data */ + if (__ge_exif_add_header(tmp_fd, orientation) < 0) + goto GE_EXIF_FAILED; + + size_t r_size = 0; + memset(tmp, 0x00, GE_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) { + 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); + + if (tmp_file) { + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + ge_dbgE("Delete file failed"); + } + + ge_dbg("All done"); + return ret; +} + +/* Add exif to jfif 1.01, older version, don't have exif */ +static int __ge_exif_rw_jfif_1dot01(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); + + if (tmp_file) { + /* Delete tmp file */ + if (!ecore_file_unlink(tmp_file)) + ge_dbgE("Delete file failed"); + } + + ge_dbg("All done"); + return ret; +} + +/* Add exif to jfif 1.02, to add exif for some cases */ +static int __ge_exif_rw_jfif_1dot02(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; + + 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; + } + + /* Copy header of JFIF from 0 to first 0xFF */ + 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) { + if (tmp[0] == GE_EXIF_TAG) { + ge_dbgW("0xFF!"); + b_tag_ff = true; + } + /* Move back 1 byte */ + fseek(fd, -1, SEEK_CUR); + break; + } + + if (__ge_exif_write_1_byte(tmp_fd, tmp[0]) < 0) + 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; + memset(tmp, 0x00, GE_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) { + 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); + + if (tmp_file) { + /* 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; + } + + 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); + } + } + + /* 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[4] != 0 && tmp[5] != 0) + goto GE_EXIF_FAILED; + offset = tmp[6]; + offset <<= 8; + offset += tmp[7]; + } else { + if (tmp[7] != 0 && tmp[6] != 0) + goto GE_EXIF_FAILED; + offset = tmp[5]; + offset <<= 8; + offset += tmp[4]; + } + 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_dbgE("tags_cnt == 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 */ + fseek(fd, -12, SEEK_CUR); + 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_dbgE("tags_cnt == 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); + + fseek(fd, jfif_offset + (4 + 2 + 6 + 2) + offset, SEEK_SET); + 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/libug/libug-gallery-efl/src/ge-ext-ug-load.c b/ug/ug-gallery-efl/src/ge-ext-ug-load.c similarity index 58% rename from libug/libug-gallery-efl/src/ge-ext-ug-load.c rename to ug/ug-gallery-efl/src/ge-ext-ug-load.c index 72b6090..3672628 100755 --- a/libug/libug-gallery-efl/src/ge-ext-ug-load.c +++ b/ug/ug-gallery-efl/src/ge-ext-ug-load.c @@ -14,7 +14,7 @@ * limitations under the License. */ -#include +#include #include "ge-ext-ug-load.h" #include "ge-debug.h" #include "ge-ui-util.h" @@ -23,6 +23,7 @@ #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; @@ -32,7 +33,7 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) GE_CHECK(ugd); GE_CHECK(ugd->ug_called_by_me); GE_CHECK(ugd->ug); - GE_CHECK(ugd->bundle); + GE_CHECK(ugd->service); bool send_result = false; if (_ge_ug_iv_get()) @@ -42,6 +43,7 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) 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; } @@ -50,7 +52,9 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) if(ugd->file_setas_image_path) { ge_dbg("GE_SETAS_IMAGE_PATH:%s", ugd->file_setas_image_path); - bundle_add(ugd->bundle, GE_SETAS_IMAGE_PATH, ugd->file_setas_image_path); + service_add_extra_data(ugd->service, + GE_SETAS_IMAGE_PATH, + ugd->file_setas_image_path); free(ugd->file_setas_image_path); ugd->file_setas_image_path = NULL; @@ -58,10 +62,13 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) } if(ugd->file_setas_crop_image_path && - ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID) - { - ge_dbg("GE_SETAS_CALLERID_CROP_IMAGE_PATH:%s", ugd->file_setas_crop_image_path); - bundle_add(ugd->bundle, GE_SETAS_CALLERID_CROP_IMAGE_PATH, ugd->file_setas_crop_image_path); + (ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID || + ugd->file_select_setas_mode == GE_FILE_SELECT_SETAS_MODE_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); free(ugd->file_setas_crop_image_path); ugd->file_setas_crop_image_path = NULL; @@ -71,15 +78,17 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) if(send_result) { ge_dbg("Call ug_send_result() to send result."); - ug_send_result(ugd->ug, ugd->bundle); + ug_send_result(ugd->ug, ugd->service); } } if(ge_destroy_me) { - ge_dbg("Seting is appllied, destroy gallery UG."); + ge_dbg("Setting is appllied, destroy gallery UG."); ge_destroy_me = false; - ug_destroy_me(ugd->ug);//close selection ug + /* Destroy self */ + ug_destroy_me(ugd->ug); + /* ug_called_by_me would be destroyed by ui-gadget */ ugd->ug_called_by_me = NULL; } else @@ -88,15 +97,15 @@ static void _ge_ext_destroy_me(ge_ugdata *ugd) } } -static void _ge_ext_iv_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void* priv) +static void _ge_ext_iv_layout_cb(ui_gadget_h ug, enum ug_mode mode, void* priv) { ge_dbg(""); GE_CHECK(priv); GE_CHECK(ug); Evas_Object *base = (Evas_Object *) ug_get_layout(ug); - if (!base) - { + if (!base) { + ge_dbgE("ug_get_layout failed!"); ug_destroy(ug); return; } @@ -105,41 +114,49 @@ static void _ge_ext_iv_layout_cb(struct ui_gadget *ug, enum ug_mode mode, void* evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(ugd->win, base); + /* 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(struct ui_gadget *ug, bundle *result, void *priv) +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; - const char* path = NULL; + char* path = NULL; if(ugd->file_select_mode == GE_File_Select_Setas) { - path = bundle_get_val(result, GE_IMAGEVIEWER_IMAGE_PATH); + 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 = strdup(path); + ugd->file_setas_image_path = path; + path = NULL; } - if(ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID) - { - path = bundle_get_val(result, GE_IMAGEVIEWER_CROP_IMAGE_PATH); + if(ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID || + ugd->file_select_setas_mode == GE_FILE_SELECT_SETAS_MODE_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 = strdup(path); + ugd->file_setas_crop_image_path = path; } } } - const char *error_state = bundle_get_val(result, GE_IMAGEVIEWER_RETURN_ERROR); + 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); @@ -150,6 +167,7 @@ static void _ge_ext_iv_result_cb(struct ui_gadget *ug, bundle *result, void *pri if(cur_item == NULL || cur_item->item == NULL || cur_item->item->file_url == NULL) { ge_dbgE("current item is NULL"); + GE_FREE_MEM(error_state); return; } service_h service; @@ -160,10 +178,11 @@ static void _ge_ext_iv_result_cb(struct ui_gadget *ug, bundle *result, void *pri service_send_launch_request(service, NULL, NULL); service_destroy(service); } + GE_FREE_MEM(error_state); } } -static void _ge_ext_iv_destroy_cb(struct ui_gadget *ug, void *priv) +static void _ge_ext_iv_destroy_cb(ui_gadget_h ug, void *priv) { ge_dbg(""); GE_CHECK(priv); @@ -178,8 +197,8 @@ int ge_ext_load_iv_ug(ge_ugdata* ugd) GE_CHECK_VAL(ugd, -1); struct ug_cbs cbs; - struct ui_gadget* ug = NULL; - bundle* param = NULL; + ui_gadget_h ug = NULL; + service_h service = NULL; if(ugd->ug_called_by_me) { @@ -199,22 +218,21 @@ int ge_ext_load_iv_ug(ge_ugdata* ugd) cbs.destroy_cb = _ge_ext_iv_destroy_cb; cbs.priv = ugd; - param = bundle_create(); - GE_CHECK_VAL(param, -1); + service_create(&service); + GE_CHECK_VAL(service, -1); _ge_ug_iv_set(true); - bundle_add(param, "View Mode", "SETAS" ); - bundle_add(param, "Path", cur_item->item->file_url); + 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_File_Select_Setas_Wallpaper) - { - bundle_add(param, "Setas type", "Wallpaper"); + if(ugd->file_select_setas_mode == GE_File_Select_Setas_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); - bundle_add(param, GE_IMAGEVIEWER_HOMESCREEN_PATH, ugd->file_setas_homescreen_path); + service_add_extra_data(service, GE_IMAGEVIEWER_HOMESCREEN_PATH, ugd->file_setas_homescreen_path); free(ugd->file_setas_homescreen_path); ugd->file_setas_homescreen_path = NULL; } @@ -222,18 +240,31 @@ int ge_ext_load_iv_ug(ge_ugdata* ugd) if(ugd->file_setas_lockscreen_path) { ge_dbg("lockscreen_path:%s", ugd->file_setas_lockscreen_path); - bundle_add(param, GE_IMAGEVIEWER_LOCKSCREEN_PATH, ugd->file_setas_lockscreen_path); + service_add_extra_data(service, GE_IMAGEVIEWER_LOCKSCREEN_PATH, ugd->file_setas_lockscreen_path); free(ugd->file_setas_lockscreen_path); ugd->file_setas_lockscreen_path = NULL; } - } - else if(ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID) - { - bundle_add(param, "Setas type", "CallerID"); + } else if(ugd->file_select_setas_mode == GE_FILE_SELECT_SETAS_MODE_CROP_WALLPAPER) { + service_add_extra_data(service, "Setas type", "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); + GE_CHECK_VAL(reso_str, -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); + free(reso_str); + reso_str = NULL; + } else if(ugd->file_select_setas_mode == GE_File_Select_Setas_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); - bundle_add(param, GE_IMAGEVIEWER_CALLERID_SIZE, ugd->file_setas_callid_size); + service_add_extra_data(service, GE_IMAGEVIEWER_CALLERID_SIZE, ugd->file_setas_callid_size); free(ugd->file_setas_callid_size); ugd->file_setas_callid_size = NULL; } @@ -241,14 +272,14 @@ int ge_ext_load_iv_ug(ge_ugdata* ugd) if(ugd->file_setas_callid_path) { ge_dbg("callerid_path:%s", ugd->file_setas_callid_path); - bundle_add(param, GE_IMAGEVIEWER_CALLERID_PATH, ugd->file_setas_callid_path); + service_add_extra_data(service, GE_IMAGEVIEWER_CALLERID_PATH, ugd->file_setas_callid_path); free(ugd->file_setas_callid_path); ugd->file_setas_callid_path = NULL; } } - ug = ug_create(ugd->ug, GE_IV_UG_NAME, UG_MODE_FULLVIEW, param, &cbs); + ug = ug_create(ugd->ug, GE_IV_UG_NAME, UG_MODE_FULLVIEW, service, &cbs); ugd->ug_called_by_me = ug; - bundle_free(param); + service_destroy(service); return 0; } diff --git a/libug/libug-gallery-efl/src/ge-gridview.c b/ug/ug-gallery-efl/src/ge-gridview.c similarity index 71% rename from libug/libug-gallery-efl/src/ge-gridview.c rename to ug/ug-gallery-efl/src/ge-gridview.c index e2e6e81..2000eb6 100755 --- a/libug/libug-gallery-efl/src/ge-gridview.c +++ b/ug/ug-gallery-efl/src/ge-gridview.c @@ -19,8 +19,11 @@ #include "ge-ui-util.h" #include "ge-util.h" #include "ge-ext-ug-load.h" -#include "ge-db-handler.h" +#include "ge-data.h" #include "ge-strings.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 @@ -89,13 +92,10 @@ static void _ge_grid_sel(void *data, Evas_Object *obj, void *event_info) { ge_dbg(""); GE_CHECK(data); - if(_ge_get_view_mode() != GE_ThumbnailView_Mode) - { + if (_ge_get_view_mode() != GE_ThumbnailView_Mode) { //ge_dbgE("EditMode.. now return."); return; - } - else - { + } else { ge_dbg("ViewMode"); } @@ -104,32 +104,26 @@ static void _ge_grid_sel(void *data, Evas_Object *obj, void *event_info) GE_CHECK(gitem->ugd); ge_ugdata* ugd = gitem->ugd; - if(gitem->item->file_url == NULL || strlen(gitem->item->file_url) <= 0) - { + if (gitem->item->file_url == NULL || strlen(gitem->item->file_url) <= 0) { ge_dbgE("file_url is invalid!"); return; - } - else - { + } else { ge_dbg("file_url: %s.", gitem->item->file_url); } - if(ugd->file_select_mode == GE_File_Select_Setas)//imageviewer only supprot image type while setting wallpaper - { - if(gitem->item->type == MINFO_ITEM_IMAGE) - { + if (ugd->file_select_mode == GE_File_Select_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 == MINFO_ITEM_VIDEO && ugd->popup == NULL) - { + } else if (gitem->item->type == MEDIA_CONTENT_TYPE_VIDEO && + ugd->popup == NULL) { ge_ui_create_popup(ugd, GE_Popup_OneButton, GE_POPUP_ONLY_SUPPORT_IMAGE); } - } - else if(gitem->item->type == MINFO_ITEM_IMAGE || gitem->item->type == MINFO_ITEM_VIDEO) - { + } 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); @@ -164,6 +158,21 @@ static void _ge_grid_item_mouse_down(void *data, Evas *e, Evas_Object *obj, void } } } +/* +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) { @@ -172,6 +181,10 @@ static void _ge_grid_shrink_resp_cb(void *data, Evas_Object *obj, const char *em 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); @@ -224,34 +237,43 @@ static void _ge_grid_check_changed(void *data, Evas_Object *obj, void *event_inf 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_ThumbnailEdit_Mode) + { + //ge_dbgE("ViewMode.. now return."); return; + } + else + { + //ge_dbg("EditMode"); + } Eina_Bool checked = elm_check_state_get(obj); if(checked) { if(ugd->file_select_mode == GE_File_Select_One) // add for one file selection { - ge_dbg("Bundle add:%s", gitem->item->file_url); + ge_dbg("Service add:%s", gitem->item->file_url); /* Hide checked state in one file selection */ elm_check_state_set(obj, false); - bundle_del(ugd->bundle, GE_FILE_SELECT_RETURN_PATH); - bundle_add(ugd->bundle, GE_FILE_SELECT_RETURN_PATH, gitem->item->file_url); - ug_send_result(ugd->ug, ugd->bundle); + service_add_extra_data(ugd->service, + GE_FILE_SELECT_RETURN_PATH, + gitem->item->file_url); + ug_send_result(ugd->ug, ugd->service); ug_destroy_me(ugd->ug); } else { ge_dbg("Append:%s", gitem->item->file_url); - ge_db_selected_list_append( gitem ); + _ge_data_selected_list_append( gitem ); } } else if(ugd->file_select_mode != GE_File_Select_One) { ge_dbg("Remove:%s", gitem->item->file_url); - ge_db_selected_list_remove( gitem ); + _ge_data_selected_list_remove( gitem ); } if(ugd->file_select_mode != GE_File_Select_One) @@ -261,15 +283,15 @@ static void _ge_grid_check_changed(void *data, Evas_Object *obj, void *event_inf } } -Evas_Object *_ge_grid_get_content(void *data, Evas_Object *obj, const char *part) +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) - { + if(strlen(part) <= 0) { ge_dbgE("part length <= 0"); return NULL; } @@ -278,120 +300,79 @@ Evas_Object *_ge_grid_get_content(void *data, Evas_Object *obj, const char *part GE_CHECK_NULL(gitem->item); GE_CHECK_NULL(gitem->ugd); ge_ugdata *ugd = gitem->ugd; - - if (!strcmp(part, "elm.swallow.icon")) - { - Evas_Object *layout = elm_layout_add(obj); - GE_CHECK_NULL(layout); - Evas_Object *bg = elm_bg_add(obj); - GE_CHECK_NULL(bg); - elm_bg_load_size_set(bg, ugd->icon_size, ugd->icon_size); - - elm_bg_file_set(bg, _GETICON(gitem->item->thumb_url), NULL); - evas_object_size_hint_max_set(bg, ugd->icon_size, - ugd->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); - - if(gitem->item->type == MINFO_ITEM_VIDEO) - { - int bk_len = 0; - - if(ugd->th) - { - elm_object_theme_set(layout, ugd->th); - } - elm_layout_theme_set(layout, "gengrid", "photoframe", "default_layout_video"); - elm_object_part_content_set(layout, "elm.swallow.icon", bg); - - // Set bookmark icon. - if(gitem->item->meta_info == NULL || gitem->item->meta_info->video_info == NULL) - { - bk_len = 0; + 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 { + char *drm_path = ge_drm_get_file_path(gitem); + path = _GETICON(drm_path); + if (_ge_is_image_valid(ugd, path) == false) + path = _GETICON(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 { + int ret = -1; + ret = _ge_get_thumb(gitem->item->file_url, + &gitem->item->thumb_url); + /* Use default image */ + if (ret < 0) + path = GE_DEFAULT_THUMB_ICON; else - { - bk_len = g_list_length(gitem->item->meta_info->video_info->bookmarks); - } + path = gitem->item->thumb_url; + } - if(bk_len) - { - elm_layout_theme_set(layout, "gengrid", "photoframe", "default_layout_video_bookmark"); + 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 - { - elm_layout_theme_set(layout, "gengrid", "photoframe", "default_layout_video"); - } - elm_object_part_content_set(layout, "elm.swallow.icon", bg); - - /* Set bookmark icon */ - if(bk_len) - { - Evas_Object *icon = elm_icon_add(obj); - GE_CHECK_NULL(icon); - elm_icon_file_set(icon, GE_THUMB_BOOKMARK, NULL); - evas_object_show(icon); - elm_object_part_content_set(layout, "elm.swallow.bookmarkicon", icon); - } - - /* Running time of the video */ - if(gitem->item->meta_info && gitem->item->meta_info->video_info) - { - char ret_str[GE_VIDEO_DURATION_MAX]={0,}; - /* Convert time unit form millisecond to second */ - int duration = floor((gitem->item->meta_info->video_info->duration) / GE_TIME_SECOND_MILLISECOND); - int dur_hr = 0; - int dur_min = 0; - int dur_sec = 0; - int tmp = 0; - - if(duration >= GE_TIME_HOUR_SECOND) - { - /* It's equal or greater than 1 hour */ - dur_sec = duration % GE_TIME_MINUTE_SECOND; - tmp = floor(duration / GE_TIME_MINUTE_SECOND); - dur_min = tmp % GE_TIME_HOUR_MINUTE; - dur_hr = floor(tmp / GE_TIME_HOUR_MINUTE); - } - else if(duration >= GE_TIME_MINUTE_SECOND) - { - /* It's equal or greater than 1 minute */ - dur_hr = 0; - dur_min = floor(duration / GE_TIME_MINUTE_SECOND); - dur_sec = duration % GE_TIME_MINUTE_SECOND; - } - else - { - dur_hr = 0; - dur_min = 0; - dur_sec = duration % GE_TIME_MINUTE_SECOND; - } - - snprintf(ret_str, sizeof(ret_str), "%02d:%02d:%02d", dur_hr, dur_min, dur_sec); - ret_str[strlen(ret_str)] = '\0'; - elm_object_part_text_set(layout, "elm.text", ret_str); - } + bk_len = gitem->item->video_info->bookmarks; + layout = _ge_thumb_show_part_icon_video(obj, path, + v_dur, bk_len, + is_expired_drm, + ugd->icon_size); + + } else { + layout = _ge_thumb_show_part_icon_image(obj, path, + orient, + is_expired_drm, + ugd->icon_size); } - else - { - if(ugd->th) - { - elm_object_theme_set(layout, ugd->th); - } - - elm_layout_theme_set(layout, "gengrid", "photoframe", "default_layout"); - elm_object_part_content_set(layout, "elm.swallow.icon", bg); + if(drm_path) { + free(drm_path); + drm_path = NULL; } - 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); - evas_object_show(layout); + 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 (!strcmp(part, "elm.swallow.end") && (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) - { + } else if (!g_strcmp0(part, "elm.swallow.end") && + (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) { Evas_Object* ck = NULL; ck = elm_check_add(obj); @@ -402,7 +383,8 @@ Evas_Object *_ge_grid_get_content(void *data, Evas_Object *obj, const char *part 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_smart_callback_add(ck, "changed", + _ge_grid_check_changed, data); evas_object_show(ck); return ck; @@ -418,13 +400,13 @@ static bool _ge_grid_create_thumb(ge_ugdata* ugd, Evas_Object* parent) GE_CHECK_FALSE(ugd); int i = 0; ge_item* gitem = NULL; - int cnt = ge_db_get_count_all(); + 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; + gic.func.content_get = __ge_grid_get_content; elm_gengrid_clear(parent); if(ugd->th) @@ -435,7 +417,7 @@ static bool _ge_grid_create_thumb(ge_ugdata* ugd, Evas_Object* parent) for(i = 1; i <= cnt; i++) { - ge_db_get_item_by_index(&gitem, i); + _ge_data_get_item_by_index(&gitem, i); if(gitem == NULL || gitem->item == NULL || gitem->item->uuid == NULL) { ge_dbgE("Invalid gitem, continue..."); @@ -444,25 +426,26 @@ static bool _ge_grid_create_thumb(ge_ugdata* ugd, Evas_Object* parent) if(!gitem->item->file_url) { - ge_db_del_media_id(ugd, gitem->item->uuid); - ge_db_item_list_remove(gitem); + _ge_data_del_media_id(ugd, gitem->item->uuid); + _ge_data_item_list_remove(gitem); --i; --cnt; continue; } - if(_ge_get_view_mode() == GE_ThumbnailEdit_Mode) + /*if(_ge_get_view_mode() == GE_ThumbnailEdit_Mode) { - Mitem* new_item = ge_db_new_mitem(ugd, gitem->item->uuid); - if(!new_item || !ecore_file_exists(gitem->item->file_url)) + 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_db_selected_list_remove(gitem); - ge_db_item_list_remove(gitem); + _ge_data_selected_list_remove(gitem); + _ge_data_item_list_remove(gitem); if(new_item) { - ge_db_destroy_mtype_item(new_item); + _ge_data_type_free_geitem((void **)&new_item); new_item = NULL; } --i; @@ -472,10 +455,10 @@ static bool _ge_grid_create_thumb(ge_ugdata* ugd, Evas_Object* parent) if(new_item) { - ge_db_destroy_mtype_item(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; @@ -545,7 +528,7 @@ int ge_grid_idler_append_thumbs(void* data) int item_cnt = 0; ge_item* gitem = NULL; /* Get all medias count of current album */ - int cnt = ge_db_get_count_all(); + int cnt = _ge_data_get_count_all(); int ret = -1; ge_cluster* cur_album = _ge_get_current_album(); GE_CHECK_VAL(cur_album, -1); @@ -558,15 +541,15 @@ int ge_grid_idler_append_thumbs(void* data) return -1; } /* Get other items from DB */ - ret = ge_db_get_items_list(ugd, cur_album, (GE_FIRST_VIEW_END_POS+1), GE_GET_UNTIL_LAST_RECORD); - ge_dbg("\n\n############ge_db_get_items_list Error code: %d#################\n", ret); - if(ret < 0) - { - ge_dbg("ge_db_get_items_list ERROR, return!"); + 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_db_get_count_all(); + cnt = _ge_data_get_count_all(); ge_dbg("Grid view all medias count: %d", cnt); @@ -575,7 +558,7 @@ int ge_grid_idler_append_thumbs(void* data) for(; i <= cnt; i++) { - ge_db_get_item_by_index(&gitem, i); + _ge_data_get_item_by_index(&gitem, i); if(gitem == NULL || gitem->item == NULL || gitem->item->uuid == NULL) { ge_dbgE("Invalid gitem, continue..."); @@ -585,9 +568,9 @@ int ge_grid_idler_append_thumbs(void* data) if(!gitem->item->file_url) { ge_dbg("file_url is invalid."); - ge_db_del_media_id(ugd, gitem->item->uuid); - ge_db_selected_list_remove(gitem); - ge_db_item_list_remove(gitem); + _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; @@ -611,7 +594,7 @@ int ge_grid_idler_append_thumbs(void* data) } } -Evas_Object* ge_grid_create_view(ge_ugdata* ugd, Evas_Object *parent) +Evas_Object* ge_grid_create_view(ge_ugdata* ugd, Evas_Object* parent) { ge_dbg(""); GE_CHECK_NULL(parent); @@ -678,7 +661,8 @@ int ge_grid_clear_view(ge_ugdata *ugd) GE_CHECK_VAL(ugd, -1); if(ugd->file_select_mode == GE_File_Select_One) { - bundle_del(ugd->bundle, GE_FILE_SELECT_RETURN_PATH); + service_remove_extra_data(ugd->service, + GE_FILE_SELECT_RETURN_PATH); } if(ugd->thumbs_view) 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..9d2f196 --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-local-data.c @@ -0,0 +1,604 @@ +/* + * Copyright 2012 Samsung Electronics Co., Ltd + * + * Licensed under the Flora License, Version 1.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.tizenopensource.org/license + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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(*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; + } + + /* 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)); + g_strlcpy(media_condition.cond, GE_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_DEFAULT; + 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); + 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..f7fa8ef --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-rotate-bg.c @@ -0,0 +1,403 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" + +#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 + + if (data2) + 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; + } + + if (data2) + 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; + } + + if (data2) + 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; + if (bg_data->file) + free(bg_data->file); + 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); + GE_CHECK_NULL(base); + 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..24afc9b --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-thumb.c @@ -0,0 +1,168 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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" +#ifdef _USE_ROTATE_BG_GE +#include "ge-rotate-bg.h" +#include "ge-exif.h" +#endif + +#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 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_icon_file_set(icon, GE_LOCK_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 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) + elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME, + GE_PHOTOFRAME_STYLE_VIDEO_BOOKMARK); + else if (is_expired_drm) + 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_icon_file_set(icon, GE_LOCK_ICON, NULL); + evas_object_show(icon); + elm_object_part_content_set(layout, "elm.swallow.favoricon", + icon); + /* Set favourites icon */ + } + + if (bk_len) { + Evas_Object *icon = elm_icon_add(layout); + elm_icon_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); + 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..ef22ddb --- /dev/null +++ b/ug/ug-gallery-efl/src/ge-tile.c @@ -0,0 +1,684 @@ +/* + * ug-gallery-efl + * + * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved. + * + * Contact: Sangjin Han , + * Jiansong Jin , + * Jonghyuk Lee , + * Chaolong Lin , + * Yongjun Zhao + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 "gallery.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}, +}; + +int __ge_tile_get_1st_icon_item_idx(int count, int *idx) +{ + int _idx = 0; + if (count == GE_TILE_THUMB_2 || + count == GE_ALBUM_COVER_THUMB_NUM_SEC) + _idx = 1; + else if (count == GE_TILE_THUMB_3) + _idx = 2; + else if (count > GE_ALBUM_COVER_THUMB_NUM_SEC){ + if (count == GE_TILE_THUMB_5) + _idx = 2; + else if (count == GE_TILE_THUMB_6) + _idx = 1; + else + _idx = 0; + } + *idx = _idx; + return 0; +} + +static Evas_Object *__ge_tile_add_3_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GE_CHECK_NULL(obj); + GE_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG_GE + if (!g_strcmp0(part, GT_TILE_3ICON1)) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = wid; + i = 0; + } else if (!g_strcmp0(part, GT_TILE_3ICON2)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = (int)(GE_TILE_2X_GRID_S * scale); + i = 1; + } else { + return NULL; + } + + bg = _ge_rotate_bg_add(obj); + GE_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _ge_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + int tp_val = 0; + Evas_Object *tb = elm_table_add(obj); + GE_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GE_TILE_PAD * scale, GE_TILE_PAD * scale); + + for (i = 0; i < length - 1; i++) { + bg = elm_bg_add(tb); + GE_CHECK_NULL(bg); + if (i == 0) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = wid; + } else { + wid = (int)(GE_TILE_GRID_S * scale); + hei = (int)(GE_TILE_2X_GRID_S * scale); + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + elm_table_padding_set(tb, GE_TILE_PAD_2 * scale, + GE_TILE_PAD_2 * scale); + + func(bg, data[i]); + + evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, + EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(bg, 0.0, 1.0); + if (i != 0) { + tp_val = EVAS_ASPECT_CONTROL_VERTICAL; + evas_object_size_hint_aspect_set(bg, tp_val, 1, 1); + } + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 2); + else + elm_table_pack(tb, bg, 2, 0, 1, 2); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__ge_tile_add_4_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GE_CHECK_NULL(obj); + GE_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG_GE + if (!g_strcmp0(part, GT_TILE_4ICON1)) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = wid; + i = 0; + } else if (!g_strcmp0(part, GT_TILE_4ICON3)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 2; + } else if (!g_strcmp0(part, GT_TILE_4ICON4)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 3; + } else { + return NULL; + } + + bg = _ge_rotate_bg_add(obj); + GE_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _ge_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + Evas_Object *tb = elm_table_add(obj); + GE_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GE_TILE_PAD_2 * scale, + GE_TILE_PAD_2 * scale); + for (i = 0; i < length; i++) { + if (i == 1) + continue; + + bg = elm_bg_add(tb); + GE_CHECK_NULL(bg); + if (i == 0) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = wid; + } else { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + + func(bg, data[i]); + + 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, 0.0, 1.0); + + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 2); + else if (i == 2) + elm_table_pack(tb, bg, 2, 0, 1, 1); + else if (i == 3) + elm_table_pack(tb, bg, 2, 1, 1, 1); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__ge_tile_add_5_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GE_CHECK_NULL(obj); + GE_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG_GE + if (!g_strcmp0(part, GT_TILE_5ICON1)) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = (int)(GE_TILE_GRID_S * scale); + i = 0; + } else if (!g_strcmp0(part, GT_TILE_5ICON2)) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = (int)(GE_TILE_GRID_S * scale); + i = 1; + } else if (!g_strcmp0(part, GT_TILE_5ICON4)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 3; + } else if (!g_strcmp0(part, GT_TILE_5ICON5)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 4; + } else { + return NULL; + } + + bg = _ge_rotate_bg_add(obj); + GE_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _ge_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + Evas_Object *tb = elm_table_add(obj); + GE_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GE_TILE_PAD_2 * scale, + GE_TILE_PAD_2 * scale); + for (i = 0; i < length; i++) { + if (i == 2) + continue; + + bg = elm_bg_add(tb); + GE_CHECK_NULL(bg); + if (i == 0 || i == 1) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = (int)(GE_TILE_GRID_S * scale); + } else { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + + func(bg, data[i]); + + 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, 0.5, 1.0); + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 1); + else if (i == 1) + elm_table_pack(tb, bg, 0, 1, 2, 1); + else if (i == 3) + elm_table_pack(tb, bg, 2, 0, 1, 1); + else if (i == 4) + elm_table_pack(tb, bg, 2, 1, 1, 1); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__ge_tile_add_6_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data, const char *part) +{ + GE_CHECK_NULL(obj); + GE_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + +#ifdef _USE_ROTATE_BG_GE + if (!g_strcmp0(part, GT_TILE_6ICON1)) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = (int)(GE_TILE_GRID_S * scale); + i = 0; + } else if (!g_strcmp0(part, GT_TILE_6ICON3)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 2; + } else if (!g_strcmp0(part, GT_TILE_6ICON4)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 3; + } else if (!g_strcmp0(part, GT_TILE_6ICON5)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 4; + } else if (!g_strcmp0(part, GT_TILE_6ICON6)) { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + i = 5; + } else { + return NULL; + } + + bg = _ge_rotate_bg_add(obj); + GE_CHECK_NULL(bg); + + evas_object_size_hint_min_set(bg, wid, hei); + evas_object_size_hint_max_set(bg, wid, hei); + 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); + + _ge_rotate_bg_add_image(bg, wid, hei); + + func(bg, data[i]); + + return bg; +#else + Evas_Object *tb = elm_table_add(obj); + GE_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_FALSE); + elm_table_padding_set(tb, GE_TILE_PAD_2 * scale, + GE_TILE_PAD_2 * scale); + for (i = 0; i < length; i++) { + if (i == 1) + continue; + + bg = elm_bg_add(tb); + GE_CHECK_NULL(bg); + if (i == 0) { + wid = (int)(GE_TILE_2X_GRID_S * scale); + hei = (int)(GE_TILE_GRID_S * scale); + } else { + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + } + + elm_bg_load_size_set(bg, wid, hei); + evas_object_size_hint_min_set(bg, wid, hei); + if (i == 0) + evas_object_size_hint_max_set(bg, wid, hei); + + func(bg, data[i]); + + 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, 0.0, 1.0); + if (i == 0) + elm_table_pack(tb, bg, 0, 0, 2, 1); + else if (i == 2) + elm_table_pack(tb, bg, 2, 0, 1, 1); + else if (i == 3) + elm_table_pack(tb, bg, 0, 1, 1, 1); + else if (i == 4) + elm_table_pack(tb, bg, 1, 1, 1, 1); + else if (i == 5) + elm_table_pack(tb, bg, 2, 1, 1, 1); + evas_object_show(bg); + } + + return tb; +#endif +} + +static Evas_Object *__ge_tile_add_7_icon_bg(Evas_Object *obj, int length, + double scale, bg_file_set_cb func, + void **data) +{ + GE_CHECK_NULL(obj); + GE_CHECK_NULL(func); + int i = 0; + int wid = 0; + int hei = 0; + Evas_Object *bg = NULL; + + Evas_Object *tb = elm_table_add(obj); + GE_CHECK_NULL(tb); + elm_table_homogeneous_set(tb, EINA_TRUE); + elm_table_padding_set(tb, GE_TILE_PAD * scale, GE_TILE_PAD * scale); + + wid = (int)(GE_TILE_GRID_S * scale); + hei = wid; + + for (i = 1; i < length; i++) { +#ifdef _USE_ROTATE_BG_GE + bg = _ge_rotate_bg_add(tb); +#else + bg = elm_bg_add(tb); +#endif + GE_CHECK_NULL(bg); + +#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[i]); + + 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); + elm_table_pack(tb, bg, (int)((i - 1) % 3), (int)((i - 1) / 3), + 1, 1); + evas_object_show(bg); + } + + return tb; +} + +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_add_1st_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 = (int)(GE_TILE_GRID_S * scale); + int hei = wid; + +#ifdef _USE_ROTATE_BG_GE + _ge_rotate_bg_add_image(bg, wid, hei); +#else + elm_bg_load_size_set(bg, wid, hei); +#endif + + int idx = 0; + __ge_tile_get_1st_icon_item_idx(len, &idx); + func(bg, data[idx]); + + evas_object_size_hint_min_set(bg, wid, hei); + 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); + evas_object_show(bg); + return bg; +} + +Evas_Object *__ge_tile_add_icon(Evas_Object *obj, int len, double scale, + bg_file_set_cb func, void **data, + const char *part) +{ + Evas_Object *icon = NULL; + + switch(len) { + case GE_TILE_THUMB_1: + return NULL; + case GE_TILE_THUMB_2: + icon = __ge_tile_add_1_icon_bg(obj, len, scale, func, data); + return icon; + case GE_TILE_THUMB_3: + icon = __ge_tile_add_3_icon_bg(obj, len, scale, func, data, part); + break; + case GE_ALBUM_COVER_THUMB_NUM_SEC: + icon = __ge_tile_add_4_icon_bg(obj, len, scale, func, data, part); + break; + case GE_TILE_THUMB_5: + icon = __ge_tile_add_5_icon_bg(obj, len, scale, func, data, part); + break; + case GE_TILE_THUMB_6: + icon = __ge_tile_add_6_icon_bg(obj, len, scale, func, data, part); + break; + default: + icon = __ge_tile_add_7_icon_bg(obj, len, scale, func, data); + break; + } + + if (icon) + evas_object_show(icon); + return icon; +} + +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)) { + if (length != GE_TILE_THUMB_1) + return NULL; + + Evas_Object *bg = NULL; + bg = __ge_tile_add_1_icon_bg(obj, length, scale, func, data); + return bg; + } else if (!g_strcmp0(part, GT_TILE_FIRSTICON)) { + if (length <= GE_TILE_THUMB_1) + return NULL; + + Evas_Object *bg = NULL; + bg = __ge_tile_add_1st_icon_bg(obj, length, scale, func, data); + return bg; + } else +#ifdef _USE_ROTATE_BG_GE + if ((!g_strcmp0(part, GT_TILE_3ICON1)) || + (!g_strcmp0(part, GT_TILE_3ICON2)) || + (!g_strcmp0(part, GT_TILE_4ICON3)) || + (!g_strcmp0(part, GT_TILE_4ICON4)) || + (!g_strcmp0(part, GT_TILE_5ICON1)) || + (!g_strcmp0(part, GT_TILE_5ICON2)) || + (!g_strcmp0(part, GT_TILE_6ICON4)) || + (!g_strcmp0(part, GT_TILE_6ICON5))) { + if (length <= GE_TILE_THUMB_2 || length > GE_TILE_THUMB_6) + return NULL; + + Evas_Object *tb = NULL; + tb = __ge_tile_add_icon(obj, length, scale, func, data, part); + return tb; + } else if (!g_strcmp0(part, GT_TILE_ICON)) { + Evas_Object *tb = NULL; + + if (length == GE_TILE_THUMB_2) + tb = __ge_tile_add_1_icon_bg(obj, length, scale, func, + data); + else if (length >= GE_ALBUM_COVER_THUMB_NUM) + tb = __ge_tile_add_7_icon_bg(obj, length, scale, func, + data); + if (tb) + evas_object_show(tb); + return tb; + } +#else + if (!g_strcmp0(part, GT_TILE_ICON)) { + if (length <= 0) + return NULL; + + Evas_Object *tb = NULL; + tb = __ge_tile_add_icon(obj, length, scale, func, data); + return tb; + } +#endif + 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/libug/libug-gallery-efl/src/ge-ui-util.c b/ug/ug-gallery-efl/src/ge-ui-util.c similarity index 74% rename from libug/libug-gallery-efl/src/ge-ui-util.c rename to ug/ug-gallery-efl/src/ge-ui-util.c index 79b89a5..6a6fe41 100755 --- a/libug/libug-gallery-efl/src/ge-ui-util.c +++ b/ug/ug-gallery-efl/src/ge-ui-util.c @@ -16,22 +16,25 @@ #include "ge-ui-util.h" #include "ge-util.h" -#include "ge-ext-ug-load.h" #include "ge-button.h" #include "ge-gridview.h" #include "ge-albums.h" #include "ge-debug.h" -#include "ge-db-handler.h" +#include "ge-data.h" #include "ge-strings.h" #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_BUTTON_STYLE_NAVIBAR_PRE "naviframe/back_btn/gallery_efl" -#define GE_NAVIFRAME_PREB_BTN "prev_btn" //ELM_NAVIFRAME_ITEM_PREV_BTN -#define GE_NAVIFRAME_CONTROLBAR "controlbar" //ELM_NAVIFRAME_ITEM_CONTROLBAR +#define GE_BUTTON_STYLE_NAVIBAR_PRE "naviframe/back_btn/default" +#define GE_NAVIFRAME_PREB_BTN "prev_btn" +#define GE_NAVIFRAME_CONTROLBAR "controlbar" +#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) { @@ -45,7 +48,7 @@ static void _ge_ui_response_cb(void *data, Evas_Object *obj, void *event_info) ug_destroy_me(ugd->ug); } - evas_object_del(ugd->popup); + evas_object_del(obj); ugd->popup = NULL; } @@ -83,13 +86,15 @@ 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; + 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_db_selected_list_count(); + int sel_cnt = _ge_data_selected_list_count(); if(sel_cnt == 0) { @@ -98,15 +103,12 @@ static void __ge_ui_done_cb(void *data, Evas_Object *obj, void *event_info) return; } - if(ugd->file_select_mode == GE_File_Select_Multiple) - { + if(ugd->file_select_mode == GE_File_Select_Multiple) { GString* selected_path = g_string_new(NULL); - for( i = 1; i <= sel_cnt; i++ ) - { - ge_db_get_selected_item_by_index(&sel_item, i); - if(sel_item && sel_item->item) - { + 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, ';'); @@ -118,21 +120,24 @@ static void __ge_ui_done_cb(void *data, Evas_Object *obj, void *event_info) filepath_arg = g_string_free(selected_path, false); - char t_str[32] = {0,}; + char t_str[32] = { 0, }; eina_convert_itoa(sel_cnt, t_str); - bundle_add(ugd->bundle, GE_FILE_SELECT_RETURN_COUNT, t_str); - bundle_add(ugd->bundle, GE_FILE_SELECT_RETURN_PATH, filepath_arg); - ug_send_result(ugd->ug, ugd->bundle); + 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); + ug_send_result(ugd->ug, ugd->service); - if(filepath_arg) - { + if(filepath_arg) { g_free(filepath_arg); filepath_arg = NULL; } } - ge_db_selected_list_finalize(); + _ge_data_selected_list_finalize(); ug_destroy_me(ugd->ug); } @@ -153,8 +158,7 @@ static int __ge_ui_disable_done_item(ge_ugdata *ugd, bool disabled) GE_CHECK_VAL(ugd->thumbs_nf_it, -1); Evas_Object *cbar = NULL; - cbar = elm_object_item_part_content_get(ugd->thumbs_nf_it, - GE_NAVIFRAME_CONTROLBAR); + cbar = elm_object_item_part_content_get(ugd->thumbs_nf_it, "controlbar"); GE_CHECK_VAL(cbar, -1); Elm_Object_Item *cbar_it = NULL; cbar_it = elm_toolbar_first_item_get(cbar); @@ -173,24 +177,40 @@ static int __ge_ui_append_object_item(Evas_Object *cbar, Evas_Object *object) 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_AlbumsView_Mode) { if(ugd->file_select_mode == GE_File_Select_Multiple) { ge_ui_destroy_selinfo(ugd); - ge_db_selected_list_finalize(); + _ge_data_selected_list_finalize(); } ge_grid_clear_view(ugd); } - bundle_add(ugd->bundle, GE_FILE_SELECT_RETURN_QUIT, GE_FILE_SELECT_QUIT_STATE); - ug_send_result(ugd->ug, ugd->bundle); + 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) @@ -198,10 +218,18 @@ static void _ge_ui_back_to_albums_cb(void *data, Evas_Object *obj, void *event_i 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, NaviTitleMode mode, char* title) @@ -233,15 +261,11 @@ int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, } ge_dbg("ThumbnailView_Title"); -#if 1 - nf_it = elm_naviframe_top_item_get(parent); - /* For the instant transition, use the xxx_insert_after API */ - nf_it = elm_naviframe_item_insert_after(parent, nf_it, title, - NULL, NULL, obj, NULL); -#else + /* 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); -#endif /* Set pre_btn style to back button */ Evas_Object *back_btn = NULL; back_btn = elm_object_item_part_content_get(nf_it, @@ -260,16 +284,15 @@ int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, ge_dbg("Multiple selection, show Done"); /* create tool controlbar downside */ Evas_Object *bot_bar = NULL; - bot_bar = elm_toolbar_add(parent); + bot_bar = elm_toolbar_add(obj); GE_CHECK_VAL(bot_bar, -1); elm_toolbar_shrink_mode_set(bot_bar, ELM_TOOLBAR_SHRINK_EXPAND); - elm_toolbar_homogeneous_set(bot_bar, EINA_FALSE); - elm_object_style_set(bot_bar, GE_CBAR_STYLE_DEFAULT); /* add 'Done' item */ Elm_Object_Item *done_it = NULL; done_it = elm_toolbar_item_append(bot_bar, GE_CBAR_ICON_DONE, - NULL, __ge_ui_done_cb, + NULL, + __ge_ui_done_cb, ugd); elm_object_item_disabled_set(done_it, EINA_TRUE); /* add empty item */ @@ -277,8 +300,7 @@ int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent, __ge_ui_append_object_item(bot_bar, NULL); __ge_ui_append_object_item(bot_bar, NULL); /* Set tool bar to bottom */ - elm_object_item_part_content_set(nf_it, - GE_NAVIFRAME_CONTROLBAR, + elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR, bot_bar); } ugd->thumbs_nf_it = nf_it; @@ -312,46 +334,41 @@ Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *g 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,}; - /* Full nocontents view layout */ - layout = elm_layout_add (ugd->navi_bar); - GE_CHECK_NULL(layout); - elm_layout_file_set (layout, GE_EDJ_FILE, GE_GRP_NOCONTENTS); - evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, - EVAS_HINT_EXPAND); - - if(ugd->ug_exit_mode == GE_UG_EXIT_NONE) { - if(_ge_get_view_mode() == GE_ThumbnailView_Mode || - _ge_get_view_mode() == GE_ThumbnailEdit_Mode) { - if(ugd->file_type_mode) { - if (ugd->file_type_mode == GE_File_Select_Type_Image) - snprintf(label_str, sizeof(label_str), "%s", - (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_IMAGES"))); - else if (ugd->file_type_mode == GE_File_Select_Type_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", + if(_ge_get_view_mode() == GE_ThumbnailView_Mode || + _ge_get_view_mode() == GE_ThumbnailEdit_Mode) { + if(ugd->file_type_mode) { + if (ugd->file_type_mode == GE_File_Select_Type_Image) + snprintf(label_str, sizeof(label_str), + "%s", + (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_IMAGES"))); + else if (ugd->file_type_mode == GE_File_Select_Type_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 if(_ge_get_view_mode() == GE_AlbumsView_Mode) { - snprintf(label_str, sizeof(label_str), "%s", - (char*)GE_LABEL_NO_ALBUMS); } else { - ge_dbgE("view mode is error."); + snprintf(label_str, sizeof(label_str), "%s", + (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_ITEMS"))); } + } else if(_ge_get_view_mode() == GE_AlbumsView_Mode) { + snprintf(label_str, sizeof(label_str), "%s", + (char*)GE_LABEL_NO_ALBUMS); } else { - snprintf(label_str, sizeof(label_str), "%s
%s", - (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_CONTENTS")), - (char*)GE_UNABLE_USE_IN_UMS_MODE); + ge_dbgE("view mode is error."); } ge_dbg("\nNocontents label: %s", label_str); @@ -373,7 +390,14 @@ Evas_Object* ge_ui_create_main_ly(ge_ugdata* ugd, Evas_Object* parent) layout = elm_layout_add(parent); GE_CHECK_NULL(layout); - elm_layout_theme_set(layout, "layout", "application", "default"); + /* 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); elm_win_resize_object_add(parent, layout); @@ -395,7 +419,6 @@ Evas_Object* ge_ui_create_navibar(ge_ugdata* ugd, Evas_Object* parent) { elm_object_theme_set(navi_bar, ugd->th); } - elm_object_style_set(navi_bar, GE_NAVIFRAME_STYLE_DEFAULT); elm_object_part_content_set(parent, "elm.swallow.content", navi_bar); evas_object_show(navi_bar); @@ -461,6 +484,27 @@ Evas_Object *ge_ui_create_popup(ge_ugdata* ugd, GE_PopupMode mode, char* desc) return popup; } +int ge_ui_rotate_selinfo(ge_ugdata* ugd) +{ + GE_CHECK_VAL(ugd, -1); + if (ugd->selectioninfo && ugd->selectioninfo_ly) + { + ge_dbg("selectioninfo rotation."); + int rotate_angle = _ge_ui_get_rotate_angle(); + if ((rotate_angle == GE_ROTATE_LANDSCAPE) || + (rotate_angle == GE_ROTATE_LANDSCAPE_UPSIDEDOWN)) + { + edje_object_signal_emit(_EDJ(ugd->selectioninfo_ly), "elm,selectioninfo,ug_landscape", "elm"); + } + else + { + edje_object_signal_emit(_EDJ(ugd->selectioninfo_ly), "elm,selectioninfo,ug_portrait", "elm"); + } + } + + return 0; +} + int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent) { ge_dbg(""); @@ -470,7 +514,7 @@ int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent) int all_count = 0; char text[GE_SELINFO_TEXT_LEN_MAX] = {0,}; - count = ge_db_selected_list_count(); + count = _ge_data_selected_list_count(); if(count <= 0) { __ge_ui_disable_done_item(ugd, true); @@ -489,7 +533,7 @@ int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent) return -1; } - all_count = ge_db_get_count_all(); + all_count = _ge_data_get_count_all(); ge_dbg("New count , all count : %d,%d", count, all_count); ge_ui_destroy_selinfo(ugd); @@ -510,11 +554,18 @@ int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent) } elm_layout_theme_set(ugd->selectioninfo_ly, "standard", "selectioninfo", "ug_selectioninfo_viewer"); + int rotate_angle = _ge_ui_get_rotate_angle(); + if ((rotate_angle == GE_ROTATE_LANDSCAPE) || + (rotate_angle == GE_ROTATE_LANDSCAPE_UPSIDEDOWN)) + { + edje_object_signal_emit(_EDJ(ugd->selectioninfo_ly), "elm,selectioninfo,ug_landscape", "elm"); + } + evas_object_size_hint_weight_set(ugd->selectioninfo_ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(ugd->selectioninfo_ly, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_object_content_set(ugd->selectioninfo,ugd->selectioninfo_ly); - /* Add Space */ + /* Add Space to fix H0100131538 */ snprintf(text, sizeof(text), "%s (%d)", GE_SELINFO_SELECTED, count); text[strlen(text)] = '\0'; diff --git a/libug/libug-gallery-efl/src/ge-util.c b/ug/ug-gallery-efl/src/ge-util.c similarity index 63% rename from libug/libug-gallery-efl/src/ge-util.c rename to ug/ug-gallery-efl/src/ge-util.c index 92b7ab9..a7d9fda 100755 --- a/libug/libug-gallery-efl/src/ge-util.c +++ b/ug/ug-gallery-efl/src/ge-util.c @@ -15,18 +15,23 @@ */ #include +#include +#include #include +#include #include "ge-debug.h" #include "ge-albums.h" #include "ge-gridview.h" -#include "ge-db-handler.h" +#include "ge-data.h" #include "ge-util.h" #include "ge-ui-util.h" -#define GE_TIMER_INTERVAL_UMS_UPDATE 2.0 +#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; @@ -81,7 +86,7 @@ static int _ge_refresh_albums_list(ge_ugdata *ugd) { ge_dbg("None album selected, current album is unavailable\n"); } - ge_db_get_clusters_list(ugd); + _ge_data_get_clusters_list(ugd); GE_CHECK_VAL(ugd->cluster_list, -1); int length = eina_list_count(ugd->cluster_list->clist); @@ -103,16 +108,15 @@ static int _ge_refresh_albums_list(ge_ugdata *ugd) } if(!g_strcmp0(current->cluster->uuid, cluster_id)) { - ge_db_update_items_list(ugd, current); - ugd->cluster_list->cur_pos = i; + _ge_data_update_items_list(ugd, current); _ge_set_current_album(current); return 0; } } /* Current album was removed, clear items list */ - if (ge_db_selected_list_get()) - ge_db_selected_list_finalize(); - ge_db_clear_items_list(); + if (_ge_data_get_selected_list()) + _ge_data_selected_list_finalize(); + _ge_data_free_items_list(); } return -1; @@ -141,68 +145,10 @@ static void _ge_db_update_noti_cb(keynode_t *key, void* data) mode = GE_UPDATE_MMC_REMOVED; } - if (ugd->ums_update_timer) { - /** - * MMC noti callback also would be invoked - * if USB disconnected in UMS mode, - * Return to prevent from refreshing view twice. - */ - ge_dbgW("View would be update in _ge_ums_update_timer_cb."); - return; - } /* Update view */ ge_update_view(ugd, mode); } -static Eina_Bool _ge_ums_update_timer_cb(void *data) -{ - ge_dbg("Timer callback invoked, try to update view."); - GE_CHECK_CANCEL(data); - ge_ugdata* ugd = (ge_ugdata*)data; - - ge_update_view(ugd, GE_UPDATE_NORMAL); - - GE_DEL_TIMER(ugd->ums_update_timer) - - return ECORE_CALLBACK_CANCEL; -} - -static void _ge_ums_noti_cb(keynode_t *key, void* data) -{ - ge_dbg(""); - int ums_mode = -1; - ge_ugdata* ugd = (ge_ugdata*)data; - GE_CHECK(ugd); - GE_CHECK(ugd->ug); - - vconf_get_int(VCONFKEY_USB_STORAGE_STATUS, &ums_mode); - if (ums_mode == -1) { - ge_dbgE("Error when check MASS STORAGE Status"); - return; - } - - if (ums_mode == VCONFKEY_USB_STORAGE_STATUS_UMS_ON || - ums_mode == VCONFKEY_USB_STORAGE_STATUS_UMS_MMC_ON) { - ge_dbg("VCONFKEY_USB_STORAGE_STATUS_UMS_ON"); - /* Destroy UG if UMS on */ - ugd->ug_exit_mode = GE_UG_EXIT_MASS_STORAGE; - ug_destroy_me(ugd->ug); - } else if (ums_mode == VCONFKEY_USB_STORAGE_STATUS_OFF) { - ge_dbg("VCONFKEY_USB_STORAGE_STATUS_OFF,update view in 2secs."); - /** - * Update view in 2 seconds, - * media-server scan file system and insert records to DB, - * it takes some time. - */ - ugd->ug_exit_mode = GE_UG_EXIT_NONE; - Ecore_Timer *ums_timer = NULL; - GE_DEL_TIMER(ugd->ums_update_timer) - ums_timer = ecore_timer_add(GE_TIMER_INTERVAL_UMS_UPDATE, - _ge_ums_update_timer_cb, data); - ugd->ums_update_timer = ums_timer; - } -} - Eina_Bool ge_update_view(ge_ugdata* ugd, int mode) { ge_dbg("mode: %d", mode); @@ -236,7 +182,7 @@ Eina_Bool ge_update_view(ge_ugdata* ugd, int mode) /* MMC removed */ if(mode == GE_UPDATE_MMC_REMOVED && cur_album && cur_album->cluster && - cur_album->cluster->type == MINFO_MMC) { + 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); @@ -246,7 +192,7 @@ Eina_Bool ge_update_view(ge_ugdata* ugd, int mode) /* Update albums list and items list */ _ge_refresh_albums_list(ugd); - if(ge_db_get_count_all() <= 0) { + 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); @@ -255,7 +201,7 @@ Eina_Bool ge_update_view(ge_ugdata* ugd, int mode) ge_grid_update_view(ugd); - if(ge_db_get_count_all() <= 0) { + 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); @@ -293,51 +239,109 @@ int ge_dereg_db_update_noti(void) return 0; } -int ge_reg_ums_noti(ge_ugdata* ugd) +bool _ge_is_image_valid(void *data, char *filepath) { - GE_CHECK_VAL(ugd, -1); - int error_code = 0; + 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; + } - error_code = vconf_notify_key_changed(VCONFKEY_USB_STORAGE_STATUS, - _ge_ums_noti_cb, ugd); - if(error_code == -1) { - ge_dbgE("vconf_notify_key_changed FAIL!"); + if (width <= 0 || height <= 0) { + ge_dbg("Cannot load file : %s", filepath); + return false; } - return 0; + return true; } -int ge_dereg_ums_noti(void) +/* Fetch thumbnail from media-service, if it's invalid, generate new one */ +int _ge_get_thumb(const char *file_path, char **thumb_path) { - int error_code = -1; + GE_CHECK_VAL(thumb_path, -1); + GE_CHECK_VAL(file_path, -1); + /* Return if thumbnail is valid */ + if (*thumb_path && ecore_file_exists(*thumb_path) && + (ecore_file_size(*thumb_path) > 0)) { + return 0; + } - error_code = vconf_ignore_key_changed(VCONFKEY_USB_STORAGE_STATUS, - _ge_ums_noti_cb); - if (error_code == -1) - ge_dbgE("_gl_vconf_loaded_mass_storage_noti_cb FAIL!"); + /* Free allocated memory first */ + if (*thumb_path) { + ge_dbgW("Wrong thumb path[%s]", *thumb_path); + free(*thumb_path); + *thumb_path = NULL; + } + ge_dbg("File[%s]", file_path); + + char *new_path = calloc(1, GE_FILE_PATH_LEN_MAX); + GE_CHECK_VAL(new_path, -1); + + /* Generate thumbnail via thumbnail-service */ + int ret = -1; + ret = thumbnail_request_from_db(file_path, new_path, + GE_FILE_PATH_LEN_MAX); + if (ret < 0) { + ge_dbgE("thumbnail_request_from_db failed!"); + return -1; + } + *thumb_path = new_path; + ge_dbg("Request thumbnail[%s]", new_path); return 0; } -int ge_get_ums_state(ge_ugdata* ugd) +/* Change int to char * of video duration, caller need to free the allocated memory */ +char *_ge_get_duration_string(unsigned int v_dur) { - ge_dbg(""); - GE_CHECK_VAL(ugd, -1); - int ums_mode = -1; - int exit_mode = GE_UG_EXIT_NONE; - - if(!vconf_get_int(VCONFKEY_USB_STORAGE_STATUS, &ums_mode)) { - ge_dbg("UMS mode: %d.", ums_mode); - if(ums_mode == VCONFKEY_USB_STORAGE_STATUS_UMS_ON || - ums_mode == VCONFKEY_USB_STORAGE_STATUS_UMS_MMC_ON) { - ge_dbgW("ums_mode[%d]: UMS_ON", ums_mode); - /* Usb mass storage mode activated */ - exit_mode = GE_UG_EXIT_MASS_STORAGE; + 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; } - } - ugd->ug_exit_mode = exit_mode; - return 0; + 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.desktop.in b/ug/ug-gallery-efl/ug-gallery-efl.desktop.in new file mode 100755 index 0000000..00ada74 --- /dev/null +++ b/ug/ug-gallery-efl/ug-gallery-efl.desktop.in @@ -0,0 +1,11 @@ +Name=gallery-efl +Exec=/opt/ug/bin/gallery-efl +Icon= +Type=Application +Version=1.1.25 +NoDisplay=true +X-TIZEN-Multiple=true +X-TIZEN-TaskManage=false +X-TIZEN-Removable=false +X-TIZEN-SVC=http://tizen.org/appsvc/operation/test|NULL|NULL + 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..f27e299 --- /dev/null +++ b/ug/ug-gallery-efl/ug-gallery-efl.xml @@ -0,0 +1,32 @@ + + + + Jiansong Jin + Gallery application + + + + + + + + + + + + + + + + + + + + + + + + + + +