--- /dev/null
+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
+ 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/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-thread-util.c
+)
+
+SET(VENDOR "tizen")
+SET(PACKAGE ${PROJECT_NAME})
+SET(PKGNAME "org.${VENDOR}.gallery")
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(BINDIR "${PREFIX}/bin")
+SET(RESDIR "${PREFIX}/res")
+SET(DATADIR "${PREFIX}/data")
+SET(LOCALEDIR "${RESDIR}/locale")
+SET(ICONDIR "${RESDIR}/icons/default/small")
+SET(EDJDIR "${RESDIR}/edje")
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/util)
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/features)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+ appcore-common
+ appcore-efl
+ libmedia-service
+ media-thumbnail
+ ui-gadget
+ ecore-imf
+ ecore-x
+ eina
+ evas
+ edje
+ ecore
+ ecore-file
+ ecore-input
+ gthread-2.0
+ appsvc
+ capi-appfw-application
+ devman_haptic)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fpie")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -fpie")
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
+ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
+ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
+ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
+ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
+ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
+ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
+ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
+ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
+
+ADD_DEFINITIONS("-D_USE_DLOG_")
+
+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)
+
+ADD_CUSTOM_COMMAND(OUTPUT gallery.edj
+ COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/${IMG_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_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(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 content shortcut uri file
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/${RSRC_DIR}/gallery.uri DESTINATION /opt/share/miregex )
+
+# install application HOME directory
+#INSTALL(DIRECTORY DESTINATION /opt/apps/org.tizen.gallery/data)
+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)
+
--- /dev/null
+1. make the build directory
+
+ ex)
+
+ $ mkdir build
+
+
+2. change the working directory to the build directory
+
+ ex)
+
+ $ cd build
+
+
+3. run 'cmake'
+
+ $ cmake ${SOURCE_DIR} -DCMAKE_INSTALL_PREFIX=/opt/apps/@@PKGNAME@@
+
+ ex)
+
+ $ cmake .. -DCMAKE_INSTALL_PREFIX=/opt/apps/@@PKGNAME@@
+
+ or
+
+ $ cmake ..
+
+
+4. make & make install
+
+ ex)
+
+ $ make -j 2 && make install
+
--- /dev/null
+Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
\ No newline at end of file
--- /dev/null
+gallery (1.0.31) unstable; urgency=low
+
+ * Git: pkgs/g/gallery
+ * Tag: gallery_1.0.31
+
+ -- Sangjin Han <sjhan.han@samsung.com> Thu, 27 Dec 2011 13:17:35 +0900
--- /dev/null
+Source: gallery
+Section: misc
+Priority: extra
+Maintainer: Sangjin Han <sjhan.han@samsung.com>, Jiansong Jin <jiansong.jin@samsung.com>, Jonghyuk Lee <jhyuk47.lee@samsung.com>, Chaolong Lin <chaolong.lin@samsung.com>, Yongjun Zhao <yj123.zhao@samsung.com>, Tang Feng <feng.tang@samsung.com>
+Uploaders: Sangjin Han <sjhan.han@samsung.com>, Jiansong Jin <jiansong.jin@samsung.com>, Changsun Lee <cs78.lee@samsung.com>
+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)
+
--- /dev/null
+/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
--- /dev/null
+@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/*
+
--- /dev/null
+#!/bin/sh
+
+if [ ${USER} == "root" ]
+then
+ # 5000 is inhouse user id
+ # do not use relative path
+ chown -R 5000:5000 @DATADIR@
+fi
--- /dev/null
+#!/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
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_ALBUMS_H_
+#define _GL_ALBUMS_H_
+
+#include <Elementary.h>
+#include "gallery.h"
+
+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);
+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);
+
+#endif /* _GL_ALBUMS_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_BUTTON_H_
+#define _GL_BUTTON_H_
+
+#include <Elementary.h>
+#include "gallery.h"
+
+typedef enum _gl_but_mode {
+ GL_BUT_NONE,
+ GL_BUT_DONE,
+ GL_BUT_CANCEL,
+ GL_BUT_DEL,
+ GL_BUT_RENAME,
+} gl_but_mode;
+
+typedef void (*But_Smart_Cb) (void *data, Evas_Object *obj, void *event_info); /**< Evas smart objects' "smart callback" function signature */
+
+Evas_Object *_gl_but_create_but(Evas_Object *parent, gl_but_mode mode, const char *style);
+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_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_CONTROLBAR_H_
+#define _GL_CONTROLBAR_H_
+
+#include <Elementary.h>
+#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_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_GRIDVIEW_H_
+#define _GL_GRIDVIEW_H_
+
+#include <Elementary.h>
+#include "gallery.h"
+
+
+typedef enum _gl_grid_mode
+{
+ GL_GRID_ALL,
+ GL_GRID_IMAGES,
+ GL_GRID_VIDEOS,
+ GL_GRID_ALBUMS,
+} gl_grid_mode;
+
+Evas_Object *gl_grid_create_view(void *data, Evas_Object * parent, gl_grid_mode mode);
+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);
+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);
+
+
+#endif /* _GL_GRIDVIEW_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_LISTVIEW_H_
+#define _GL_LISTVIEW_H_
+
+#include <Elementary.h>
+#include "gallery.h"
+
+Evas_Object *gl_list_create_view(void *data, Evas_Object * parent);
+int gl_list_update_view(void *data);
+int gl_list_change_to_edit(void *data);
+int gl_list_change_to_view(void *data);
+int gl_list_clear_view(void *data);
+int _gl_list_clear_data(void *data);
+
+#endif /* _GL_LISTVIEW_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_POPUP_H_
+#define _GL_POPUP_H_
+
+#define GL_POPUP_STRING_MAX 256
+
+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,
+ GL_POPUP_ALBUM_RENAME_EMPTY,
+ GL_POPUP_ALBUM_RENAME_DUPLICATE,
+ GL_POPUP_ALBUM_RENAME_INVALID,
+ GL_POPUP_ALBUM_DELETE,
+ GL_POPUP_THUMB_MOVE,
+} gl_popup_mode;
+
+int gl_popup_create_albums_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);
+int gl_popup_update_content(void *data, gl_popup_mode mode);
+
+#endif /* _GL_POPUP_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_PROGRESSBAR_H_
+#define _GL_PROGRESSBAR_H_
+
+int gl_pb_add_pbar_timer(void *data);
+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);
+
+#endif /* _GL_PROGRESSBAR_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+/*
+* About launching gallery base on appsvc
+*
+* @ Sample code:
+* @code
+* #include <appsvc.h>
+*
+* 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 <Elementary.h>
+#include <Ecore_X.h>
+#include <pthread.h>
+#include <bundle.h>
+#include "gl-db-handler.h"
+#include <appcore-common.h>
+
+
+
+#ifdef _cplusplus
+extern "C"
+{
+#endif
+
+#if !defined(APPDIR)
+# define APPDIR "/opt/apps/org.tizen.gallery"
+#endif
+
+#if !defined(PACKAGE)
+# define PACKAGE "gallery"
+#endif
+
+#if !defined(LOCALEDIR)
+# define LOCALEDIR APPDIR"/res/locale"
+#endif
+
+#if !defined(EDJDIR)
+# define EDJDIR APPDIR"/res/edje"
+#endif
+
+#if !defined(IMAGEDIR)
+# define IMAGEDIR APPDIR"/res/images/"
+#endif
+
+#define PKGNAME_GALLERY "org.tizen.gallery"
+
+/******** EDJ File path ********/
+
+#define GL_EDJ_FILE EDJDIR "/" PACKAGE ".edj"
+#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_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
+
+/******** 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"
+/* Button object style of previous button of naviframe */
+#define GL_BUTTON_STYLE_NAVI_PRE "naviframe/back_btn/gallery"
+#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_CONTROLBAR_STYLE_NAVI "naviframe"
+
+/******** 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_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_DELETE IMAGEDIR"T01_controlbar_icon_delete.png"
+#define GL_CBAR_ICON_MOVE IMAGEDIR"T01_controlbar_icon_move.png"
+
+/******** String ********/
+
+#define GL_SEPERATOR_BT '?'
+
+/* MIME type */
+#define GL_MIME_IMAGE_ALL "image/*"
+#define GL_MIME_VIDEO_ALL "video/*"
+
+/******** Numerical value ********/
+
+/* Window width and height */
+#define GL_WIN_WIDTH 720 // 480
+#define GL_WIN_HEIGHT 1280 // 800
+
+/* Specified ID for customed items, which don't exist in DB */
+#define GL_ALBUM_ALL_ID "GALLERY_ALBUM_ALL_ALBUMS_ID"
+/* There are 7 thumbnails of 'Camera shots' and 'All' cover, but 4 for normal albums */
+#define GL_ALBUM_COVER_THUMB_NUM 7
+/* Normal albums cover have maximum 4 thumbnails */
+#define GL_ALBUM_COVER_THUMB_NUM_SEC 4
+
+/* Size of thumbnails in gridview */
+#define GL_GRID_ITEM_SIZE_W 178//120
+#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_01_CNT 1
+#define GL_GRID_ITEM_ZOOM_LEVEL_02_CNT 6
+
+/* String length of mtye item id */
+#define GL_MTYPE_ITEN_ID_LEN_MAX 37
+
+/* String length of album name */
+#define GL_ALBUM_NAME_LEN_MAX GL_FILE_NAME_LEN_MAX
+
+#define GL_DATE_INFO_LEN_MAX 256
+#define GL_POPUP_DESC_LEN_MAX 256
+#define GL_EXT_STR_COUNT_LEN 20
+
+/* Maximum number of entry string, 255 Chars of album name (linux system) */
+#define GL_ENTRY_STR_CHAR_MAX 255
+
+/* 1900 */
+#define GL_DEFAULT_YEAR 1900
+/* 1s=1000ms */
+#define GL_TIME_MSEC_PER_SEC 1000
+/*1s = 1000000us*/
+#define GL_TIME_USEC_PER_SEC 1000000L
+/* 1ms=1000us */
+#define GL_TIME_USEC_PER_MSEC 1000
+/* 1min=60s */
+#define GL_TIME_SEC_PER_MIN 60
+/* 1h=60min */
+#define GL_TIME_MIN_PER_HOUR 60
+/* 1h=(60x60)s */
+#define GL_TIME_SEC_PER_HOUR (GL_TIME_MIN_PER_HOUR * GL_TIME_SEC_PER_MIN)
+
+/* itoa length max */
+#define GL_INTERGER_LEN_MAX 12 // 1(sign) + 10(2^31) + 1(NULL)
+
+/* 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"
+
+/******** Enumeration ********/
+
+typedef enum _gl_aul_launch_type
+{
+ GL_AUL_T_NONE,
+ GL_AUL_T_SELECT_ONE,
+ GL_AUL_T_SELECT_MULTIPLE,
+ GL_AUL_T_SELECT_IMFT,
+ GL_AUL_T_SELECT_SETAS,
+ GL_AUL_T_SELECT_ALBUM,
+ GL_AUL_T_VIEW_ALBUM,
+} gl_aul_launch_type;
+
+typedef enum {
+ GL_AUL_SETAS_T_NONE,
+ GL_AUL_SETAS_T_WALLPAPER,
+ GL_AUL_SETAS_T_CALLER_ID,
+} gl_aul_setas_type;
+
+typedef enum _gl_aul_file_type
+{
+ GL_AUL_FILE_T_NONE,
+ GL_AUL_FILE_T_IMAGE,
+ GL_AUL_FILE_T_VIDEO,
+ GL_AUL_FILE_T_ALL,
+} gl_aul_file_type;
+
+typedef enum _gl_view_mode
+{
+ GL_VIEW_NONE,
+ GL_VIEW_ALBUMS,
+ GL_VIEW_ALBUMS_EDIT,
+ GL_VIEW_ALBUMS_RENAME,
+ GL_VIEW_THUMBS,
+ GL_VIEW_THUMBS_EDIT,
+ GL_VIEW_VIDEOLIST,
+ GL_VIEW_VIDEOLIST_EDIT,
+} gl_view_mode;
+
+typedef enum _gl_ctrl_seg_mode
+{
+ GL_CTRL_SEG_ALL,
+ GL_CTRL_SEG_IMAGES,
+ GL_CTRL_SEG_VIDEOS,
+ 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_mode;
+
+
+/******** Structure ********/
+
+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 */
+ /* UUID of item selected for playing */
+ char *played_uuid;
+} gl_list_info;
+
+typedef struct
+{
+ Evas_Coord x;
+ Evas_Coord y;
+ bool b_pressed;
+} gl_grid_touch_info;
+
+typedef struct
+{
+ Elm_Gengrid_Item_Class thumbgic; /* Gengrid item class of thumbnails view */
+ Evas_Object *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;
+
+ /* 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 */
+ /* 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 */
+} gl_grid_info;
+
+typedef struct
+{
+ bool app_called_by_me; /* Indicates if any application invoked by Gallery */
+ struct ui_gadget *ug_called_by_me;
+ 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 */
+} gl_ug_info;
+
+
+typedef struct
+{
+ Elm_Gengrid_Item_Class albumgic; /* 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 */
+ /* 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 */
+ 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 new_album_name[GL_ALBUM_NAME_LEN_MAX];
+ Eina_List *selected_albums_elist; /* List of all selected albums */
+ gl_cluster_list *cluster_list; /* List of all albums */
+ int albums_cnt; /* Albums count appended to gridview */
+ int album_medias_cnt; /* Media items count of a album, it is showed in album cover */
+ bool update_albums_list; /* Flag indicate to update albums list when back to normal view. */
+ /* 1. MMC Inserted/Removed in thumbnails edit mode; */
+ char dest_folder[GL_DIR_PATH_LEN_MAX]; /* The full path of destination album of movement */
+ bool move_new_album; /* True: move medias to album newly created, */
+ /* False: move to album already created */
+ /* Variables below are related to gallery launching */
+ bundle *recv_bundle; /* The bundle received when app_reset */
+ bool gallery_launched;
+ 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_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 */
+} 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 */
+ /* Button 'Done' in new album view */
+ Evas_Object *done_btn;
+ /* Handle for play vibration */
+ int haptic_handle;
+ /* Timer for closing vibration */
+ Ecore_Timer *vibration_timer;
+} gl_entry_info;
+
+typedef struct
+{
+ Elm_Genlist_Item_Class popuplit; /* Genlist item class of list view in popupinfo.popup */
+ Evas_Object *popup;
+ int popup_mode;
+ char popup_item_label[GL_ALBUM_NAME_LEN_MAX];/* Selected item label of list in popupinfo.popup */
+ /* Selectioninfo popup */
+ Evas_Object *selinfo;
+ Evas_Object *selinfo_ly;
+ Ecore_Timer *del_timer;
+} gl_popup_info;
+
+typedef struct {
+ Eina_List *medias_elist; /* List of all selected medias of a album */
+ int images_cnt; /* Images count selected */
+} 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.
+ */
+ Ecore_Timer *start_thread_timer;
+ /**
+ * After thread operation done, use idler to
+ * delete progressbar after it's showed completely(status is 100%).
+ */
+ Ecore_Idler *del_pbar_idler;
+ Ecore_Pipe *sync_pipe; /* Pipe for communication between main and child thread */
+ pthread_mutex_t pbar_lock; /* Lock for state of 'Cancel' button */
+ pthread_mutex_t refresh_lock; /* Lock for progressbar refreshing */
+ pthread_cond_t refresh_cond; /* Condition for progressbar refreshing */
+ int refresh_flag; /* Indicates progressbar updated or not while moving or deleting */
+ int pbar_cancel; /* State of 'Cancel' button on progressbar popup */
+ /* Medias count already operated */
+ int finished_cnt;
+} gl_pbar_info;
+
+typedef struct
+{
+ Evas_Object *win;
+ double win_scale;
+ Evas_Object *ly_main;
+ Evas_Object *navi_bar;
+ 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;
+ 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) */
+ 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_selected_info selectedinfo; /* Global variables about files selected */
+};
+
+typedef struct _gl_appdata gl_appdata;
+
+int gallery_reset_app(void *data, const char *cluster_id);
+
+#ifdef _cplusplus
+}
+#endif
+
+#endif /* _GALLERY_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_DB_HANDLER_H_
+#define _GL_DB_HANDLER_H_
+
+#include <eina_list.h>
+#include <visual-svc.h>
+#include <Elementary.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 /*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;
+ Evas_Object *check_obj;
+ 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_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_DEBUG_H_
+#define _GL_DEBUG_H_
+
+#include <dlog.h>
+#include <assert.h>
+#include <stdio.h>
+
+#ifdef _cplusplus
+extern "C"
+{
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+
+#define LOG_TAG "GALLERY"
+
+
+/* anci c color type */
+#define FONT_COLOR_RESET "\033[0m"
+#define FONT_COLOR_RED "\033[31m"
+#define FONT_COLOR_GREEN "\033[32m"
+#define FONT_COLOR_YELLOW "\033[33m"
+#define FONT_COLOR_BLUE "\033[34m"
+#define FONT_COLOR_PURPLE "\033[35m"
+#define FONT_COLOR_CYAN "\033[36m"
+#define FONT_COLOR_GRAY "\033[37m"
+
+#ifdef _USE_LOG_FILE_
+FILE *g_log_fp;
+#endif // _USE_LOG_FILE_
+
+#ifdef _USE_LOG_FILE_
+
+#define gl_dbg(fmt,arg...) fprintf(g_log_fp, "[%s: %d]" fmt "\n", __FUNCTION__, __LINE__, ##arg)
+
+#elif defined _USE_DLOG_
+
+#define gl_dbg(fmt, arg...) LOGD("[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#define gl_dbgW(fmt, arg...) LOGW(FONT_COLOR_GREEN"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg)
+#define gl_dbgE(fmt, arg...) LOGE(FONT_COLOR_RED"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg)
+
+#elif defined _USE_LOG_CONSOLE_
+
+#define gl_dbg(fmt,arg...) fprintf(stdout, "[%s: %d]" fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#define gl_dbgW(fmt, arg...) fprintf(stdout, "[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#define gl_dbgE(fmt, arg...) fprintf(stdout, "[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg)
+
+#else
+
+#define gl_dbg(fmt,arg...)
+#define gl_dbgW(fmt, arg...)
+#define gl_dbgE(fmt, arg...)
+#endif
+
+#include <time.h>
+#include <sys/time.h>
+
+void gl_print_debug_time_ex(long start, long end, const char *func_name, char *time_string);
+
+
+
+#define gl_retm_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ gl_dbgE(fmt, ##arg); \
+ gl_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+} while (0)
+
+#define gl_retvm_if(expr, val, fmt, arg...) do { \
+ if(expr) { \
+ gl_dbgE(fmt, ##arg); \
+ gl_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+} while (0)
+
+#define GL_CHECK_EXCEP(expr) do { \
+ if(!(expr)) { \
+ gl_dbgE("Critical ERROR ########################################## Check below item.");\
+ goto gl_exception;\
+ } \
+} while (0)
+
+#define GL_CHECK_VAL(expr, val) gl_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!")
+#define GL_CHECK_NULL(expr) gl_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!")
+#define GL_CHECK_FALSE(expr) gl_retvm_if(!(expr), false, "Invalid parameter, return FALSE!")
+#define GL_CHECK_CANCEL(expr) gl_retvm_if(!(expr), ECORE_CALLBACK_CANCEL, "Invalid parameter, return ECORE_CALLBACK_CANCEL!")
+#define GL_CHECK(expr) gl_retm_if(!(expr), "Invalid parameter, return!")
+
+#define gl_assert(expr) do { \
+ if(!(expr)) { \
+ gl_dbgE("Critical ERROR ########################################## Check below item.");\
+ assert(false); \
+ } \
+} while (0)
+
+#ifdef _cplusplus
+}
+#endif
+
+#endif /* _GL_DEBUG_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_EXT_EXEC_H_
+#define _GL_EXT_EXEC_H_
+
+typedef enum
+{
+ GL_LAUNCH_FAIL,
+ GL_LAUNCH_SUCCESS
+} gl_launch_status;
+
+typedef enum
+{
+ GL_APP_NONE = -1,
+ GL_APP_VIDEOPLAYER,
+} gl_ext_app_type;
+
+int gl_ext_exec(void *data, gl_ext_app_type type);
+
+#endif /* _GL_EXT_EXEC_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_EXT_UG_LOAD_H_
+#define _GL_EXT_UG_LOAD_H_
+
+#include <ui-gadget.h>
+#include "gl-db-handler.h"
+
+typedef enum
+{
+ GL_UG_FAIL,
+ GL_UG_SUCCESS
+} gl_ug_load_status;
+
+int gl_ext_load_iv_ug(void *data, gl_item *cur_item);
+int gl_ext_load_gallery_ug(void *data);
+int gl_ext_destroy_gallery_ug(void *data);
+
+#endif /* _GL_EXT_UG_LOAD_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+/* This header file includes all multi language strings which need display */
+#ifndef _GL_STRINGS_H_
+#define _GL_STRINGS_H_
+
+#ifdef _cplusplus
+extern "C"
+{
+#endif
+
+/* hard code strings and already translated strings in gallery po files */
+#define GL_ALBUM_ALL_NAME _("IDS_MEDIABR_BODY_ALL_ALBUMS")
+#define GL_ALBUM_DEFAULT_NAME _("Camera shots")
+#define GL_STR_NEW_ALBUM _("IDS_MEDIABR_TAB4_NEW_ALBUM")
+#define GL_STR_INVALID_INPUT_PARAMETER _("IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER")
+#define GL_STR_ENTRY_IS_EMPTY _("IDS_MEDIABR_POP_ENTRY_IS_EMPTY")
+#define GL_STR_SAME_NAME_ALREADY_IN_USE _("IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE")
+#define GL_STR_UNABLE_TO_RENAME _("IDS_MEDIABR_POP_UNABLE_TO_RENAME")
+#define GL_STR_NO_ALBUMS_SELECTED _("IDS_MEDIABR_POP_NO_ALBUMS_SELECTED")
+#define GL_STR_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")
+#define GL_STR_RETRY_Q _("IDS_MEDIABR_POP_RETRY_Q")
+
+/* 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_CANCEL dgettext("sys_string", "IDS_COM_SK_CANCEL")
+#define GL_STR_BACK dgettext("sys_string", "IDS_COM_SK_BACK")
+#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_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")
+#define GL_STR_YES dgettext("sys_string", "IDS_COM_SK_YES")
+#define GL_STR_NO dgettext("sys_string", "IDS_COM_SK_NO")
+#define GL_STR_DELETE_COMFIRMATION dgettext("sys_string", "IDS_COM_POP_DELETE_Q")
+#define GL_STR_OK dgettext("sys_string", "IDS_COM_SK_OK")
+#define GL_STR_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")
+
+#ifdef _cplusplus
+}
+#endif
+#endif
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_THREAD_UTIL_H_
+#define _GL_THREAD_UTIL_H_
+typedef enum
+{
+ GL_PB_CANCEL_NONE, /* Initial state */
+ GL_PB_CANCEL_NORMAL, /* Moving or deleting is in process */
+ GL_PB_CANCEL_BUTTON, /* Cancel button tapped while moving or deleting */
+ GL_PB_CANCEL_MMC, /* MMC removed, src album or dest album vanished while moving or deleting */
+ GL_PB_CANCEL_ERROR, /* Error happened while moving or deleting */
+ GL_PB_CANCEL_RESET, /* Reset gallery while moving or deleting */
+} gl_pb_cancel_mode;
+
+int gl_thread_emit_next_signal(void *data);
+int gl_thread_wait_next_signal(void *data);
+int gl_thread_set_cancel_state(void *data, int val);
+int gl_thread_get_cancel_state(void *data, int *val);
+void gl_thread_write_pipe(void *data, int finished_cnt, int popup_op);
+int gl_thread_gen_data_thread(void *data);
+int gl_thread_destroy_lock(void *data);
+int gl_thread_init_lock(void *data);
+
+#endif /* _GL_THREAD_UTIL_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_UI_UTIL_H_
+#define _GL_UI_UTIL_H_
+
+#include <Elementary.h>
+#include <appcore-efl.h>
+#include "gallery.h"
+
+#ifdef _cplusplus
+extern "C"
+{
+#endif
+
+#define _EDJ(o) elm_layout_edje_get(o)
+#define _GETICON(_path) \
+ ((1 == ecore_file_exists(_path) && (ecore_file_size(_path) > 0)) ? _path : GL_DEFAULT_THUMB_ICON)
+
+
+typedef enum
+{
+ GL_NAVI_ALBUMS,
+ GL_NAVI_ALBUMS_EDIT,
+ GL_NAVI_ALBUMS_RENAME,
+ GL_NAVI_ALBUMS_NEW,
+ GL_NAVI_THUMBS,
+ GL_NAVI_THUMBS_EDIT,
+} gl_navi_mode;
+
+typedef enum
+{
+ GL_UI_NOTIFY_DELETED,
+ GL_UI_NOTIFY_REMOVED,
+ GL_UI_NOTIFY_ADDED,
+ GL_UI_NOTIFY_MOVED,
+} gl_ui_notify_mode;
+
+Evas_Object *gl_ui_create_naviframe(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_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_move_to_newalbum(void *data);
+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);
+
+#ifdef _cplusplus
+}
+#endif
+
+#endif // end of _GL_UI_UTIL_H_
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_UTIL_H_
+#define _GL_UTIL_H_
+
+#include "gl-db-handler.h"
+#include "gallery.h"
+
+typedef enum
+{
+ GL_MMC_STATE_NONE,
+ GL_MMC_STATE_ADDED,
+ GL_MMC_STATE_ADDED_MOVING, /* Move medias to MMC or from MMC */
+ GL_MMC_STATE_ADDING_MOVING, /* Insert MMC while operate medias */
+ GL_MMC_STATE_REMOVED,
+ GL_MMC_STATE_REMOVED_MOVING, /* Remove MMC while move medias to MMC or from MMC */
+} gl_mmc_state_mode;
+
+typedef enum
+{
+ GL_UPDATE_VIEW_NONE,
+ GL_UPDATE_VIEW_NORMAL,
+ GL_UPDATE_VIEW_MMC_REMOVED, /* Update view when MMC removed */
+ GL_UPDATE_VIEW_MMC_ADDED, /* Update view when MMC inserted */
+} gl_update_view_mode;
+
+typedef enum
+{
+ GL_MEDIA_OP_NONE,
+ GL_MEDIA_OP_MOVE,
+ GL_MEDIA_OP_DELETE,
+} gl_media_op_mode;
+
+typedef enum
+{
+ GL_POPUP_OP_NONE,
+ GL_POPUP_OP_SAME_ALBUM,
+ GL_POPUP_OP_DUPLICATED_NAME,
+ GL_POPUP_OP_PROTECTED_FILE,
+} gl_popup_op_mode;
+
+typedef enum
+{
+ GL_INVALID_NONE,
+ GL_INVALID_RENAME_ALBUM,
+ GL_INVALID_NEW_ENTRY,
+ GL_INVALID_NEW_ENTRY_NOC, /* Show nocontents view */
+} gl_invalid_mode;
+
+int gl_get_view_mode(void *data);
+int gl_set_view_mode(void *data, int mode);
+int gl_move_media_item(gl_item * gitem, char *new_dir_name, bool is_full_path, int *popup_op);
+int gl_move_selected(void *data);
+int gl_move_to_album(void *data);
+int gl_move_root_album(void* data, gl_cluster* cur_album, char* dest_path);
+int gl_update_move_view(void *data);
+int gl_del_medias(void *data);
+int gl_del_selected(void *data);
+int gl_update_del_view(void *data);
+int gl_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);
+int gl_get_selected_files_path_str(void *data, gchar sep_c, char **path_str, int *sel_cnt);
+int gl_make_dir(const char *dir_full_path);
+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);
+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_del_invalid_widgets(void *data, int invalid_m);
+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);
+
+#endif /* _GL_UTIL_H_ */
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(ug-gallery-efl C)
+
+SET(SRCS src/gallery-efl.c
+ src/ge-albums.c
+ src/ge-gridview.c
+ src/ge-button.c
+ src/ge-debug.c
+ src/ge-ui-util.c
+ src/ge-ext-ug-load.c
+ src/ge-util.c
+ src/ge-db-handler.c )
+
+IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+ SET(CMAKE_BUILD_TYPE "Release")
+ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
+MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
+
+SET(PREFIX ${CMAKE_INSTALL_PREFIX})
+SET(EXEC_PREFIX "\${prefix}")
+SET(LIBDIR "\${prefix}/lib")
+SET(INCLUDEDIR "\${prefix}/include")
+SET(VERSION 1.0)
+
+ADD_DEFINITIONS("-D_USE_DLOG_")
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED appcore-common appcore-efl libmedia-service
+ui-gadget secure-storage)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fpie")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -fpie")
+SET(CMAKE_LDFLAGS "-Wl,-zdefs" )
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
+IF("${ARCH}" STREQUAL "arm")
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("add -DTARGET")
+ENDIF("${ARCH}" STREQUAL "arm")
+
+#SET(CMAKE_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})
+
+# EDJE
+ADD_CUSTOM_COMMAND(OUTPUT gallery-efl.edj
+ COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/res/images
+ ${CMAKE_CURRENT_SOURCE_DIR}/res/edc/gallery-efl.edc
+ ${CMAKE_BINARY_DIR}/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)
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+/*
+* 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__
+
+
+#include <glib.h>
+#include <Elementary.h>
+#include <stdio.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <bundle.h>
+#include <ui-gadget-module.h>
+#include <visual-svc.h>
+#include <Eina.h>
+#include <Ecore_X.h>
+#include <Ethumb.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/"
+#define GE_EDJ_FILE GE_EDJ_DIR"gallery-efl.edj"
+
+#define GE_GRP_GRIDVIEW "gallery_efl/gridview"
+#define GE_GRP_ALBUMVIEW "gallery_efl/albumview"
+#define GE_GRP_NOCONTENTS "gallery_efl/nocontents"
+
+#define GE_CBAR_STYLE_DEFAULT "gallery/default"
+#define GE_NAVIFRAME_STYLE_DEFAULT "gallery/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_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_ROOT_PATH_PHONE "/opt/media"
+#define GE_ROOT_PATH_MMC "/opt/storage/sdcard"
+
+#define GE_ALBUM_ALL_ID "GALLERY_ALBUM_ALL_ALBUMS_ID"
+/* String length of mtye item id */
+#define GE_MTYPE_ITEN_ID_LEN_MAX 37
+
+#define GE_BASE_WIN_WIDTH 720
+#define GE_BASE_WIN_HEIGHT 1280
+
+#define GE_GRID_ITEM_SIZE_W 178
+#define GE_GRID_ITEM_SIZE_H 182
+
+#define GE_GRID_ITEM_ZOOM_LEVEL_01 4
+#define GE_GRID_ITEM_ZOOM_LEVEL_02 2
+#define GE_GRID_ITEM_ZOOM_LEVEL_01_CNT 1
+#define GE_GRID_ITEM_ZOOM_LEVEL_02_CNT 6
+
+#define GE_LIST_ICON_WIDTH 133
+#define GE_LIST_ICON_HEIGHT 100
+
+#define GE_ALBUM_COVER_THUMB_NUM 7 /* There are 7 thumbnails of 'Camera shots' and 'All' cover*/
+#define GE_ALBUM_COVER_THUMB_NUM_SEC 4 /* Other albums cover have maximum 4 thumbnails */
+#define GE_ALBUM_ITEM_WIDTH 358
+#define GE_ALBUM_ITEM_HEIGHT 360
+#define GE_COVER_SIZE 318
+#define GE_COVER_PAD 3
+#define GE_COVER_ICON_S (GE_COVER_SIZE - 2 * GE_COVER_PAD)
+#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_SELINFO_TEXT_LEN_MAX 64
+#define GE_ALBUM_DATE_LEN_MAX 256
+#define GE_MAX_BYTES_FOR_CHAR 3
+#define GE_ALBUM_NAME_LEN_MAX (255 * GE_MAX_BYTES_FOR_CHAR + 1)
+#define GE_VIDEO_DURATION_MAX 256
+#define GE_NOCONTENTS_LABEL_LEN_MAX 512
+#define GE_FILE_PATH_LEN_MAX (4095 * GE_MAX_BYTES_FOR_CHAR + 1)
+#define GE_DIR_PATH_LEN_MAX GE_FILE_PATH_LEN_MAX
+
+#define GE_TIME_SECOND_MILLISECOND 1000 // 1s=1000ms
+#define GE_TIME_USEC_PER_SEC 1000000L
+#define GE_TIME_MINUTE_SECOND 60 // 1min=60s
+#define GE_TIME_HOUR_MINUTE 60 // 1h=60min
+#define GE_TIME_HOUR_SECOND (GE_TIME_HOUR_MINUTE * GE_TIME_MINUTE_SECOND) // 1h=(60x60)s
+
+#define GE_FIRST_VIEW_START_POS 0
+#define GE_FIRST_VIEW_END_POS 47
+#define GE_GET_UNTIL_LAST_RECORD 65536 /* Fixme: Do not use 65536. */
+#define GE_GET_ALL_RECORDS -1
+
+#define GE_BUNDLE_LAUNCH_TYPE "launch-type"
+#define GE_BUNDLE_FILE_TYPE "file-type"
+#define GE_BUNDLE_SETAS_TYPE "setas-type"
+#define GE_BUNDLE_CALLERID_SIZE "callerid-size"
+#define GE_BUNDLE_CALLERID_PATH "callerid-path"
+#define GE_BUNDLE_HOMESCREEN_PATH "homescreen-path"
+#define GE_BUNDLE_LOCKSCREEN_PATH "lockscreen-path"
+
+#define GE_ALBUM_SELECT_ONE "select-album"
+#define GE_ALBUM_SELECT_RETURN_ID "album-id"
+#define GE_ALBUM_SELECT_RETURN_PATH "folder-path"
+
+#define GE_FILE_SELECT_ONE "select-one"
+#define GE_FILE_SELECT_MULTIPLE "select-multiple"
+#define GE_FILE_SELECT_SETAS "select-setas"
+#define GE_FILE_SELECT_IMFT "select-imft"
+
+#define GE_FILE_SELECT_TYPE_IMAGE "image"
+#define GE_FILE_SELECT_TYPE_VIDEO "video"
+#define GE_FILE_SELECT_TYPE_ALL "all"
+
+#define GE_FILE_SELECT_SETAS_WALLPALER "wallpaper"
+#define GE_FILE_SELECT_SETAS_CALLERID "callerid"
+
+#define GE_FILE_SELECT_RETURN_COUNT "count"
+#define GE_FILE_SELECT_RETURN_PATH "path"
+
+#define GE_FILE_SELECT_RETURN_QUIT "ug-quit"
+#define GE_FILE_SELECT_QUIT_STATE "normal"
+
+#define GE_SETAS_CALLERID_CROP_IMAGE_PATH "crop-image-path"
+#define GE_SETAS_IMAGE_PATH "image-path"
+
+/*Image viewer UG bundle parameters*/
+#define GE_IMAGEVIEWER_CALLERID_SIZE "Area size"
+#define GE_IMAGEVIEWER_CALLERID_PATH "CallerID path"
+
+#define GE_IMAGEVIEWER_CROP_IMAGE_PATH "crop_image_path"
+#define GE_IMAGEVIEWER_IMAGE_PATH "image_path"
+
+#define GE_IMAGEVIEWER_HOMESCREEN_PATH "Wallpaper path"
+#define GE_IMAGEVIEWER_LOCKSCREEN_PATH "Lockscreen path"
+#define GE_IMAGEVIEWER_RETURN_ERROR "Error"
+/*Image viewer UG bundle parameters-End*/
+
+typedef enum {
+ GE_Album_Select_None,
+ GE_Album_Select_One,
+} ge_album_select;
+
+typedef enum {
+ GE_File_Select_None,
+ 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_CallerID,
+} ge_file_select_setas;
+
+typedef enum {
+ GE_File_Select_Type_None,
+ GE_File_Select_Type_Image,
+ GE_File_Select_Type_Video,
+ GE_File_Select_Type_All,
+} ge_file_type;
+
+typedef enum view_by_mode_e
+{
+ GE_AlbumsView_Mode,
+ GE_ThumbnailView_Mode,
+ 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_UPDATE_NONE,
+ GE_UPDATE_NORMAL,
+ GE_UPDATE_MMC_REMOVED,
+ GE_UPDATE_MMC_ADDED,
+}ge_update_mode;
+
+typedef struct _ge_ugdata ge_ugdata;
+
+typedef struct {
+ Mcluster* cluster;
+ ge_ugdata* ugd;
+ int index;
+
+ time_t item_mtime;
+ Elm_Object_Item *griditem;
+ void* _reserved;
+}ge_cluster;
+
+typedef struct {
+ Eina_List* clist;
+ int cur_pos;
+}ge_cluster_list;
+
+typedef struct _gl_item {
+ Mitem* item;
+ ge_ugdata* ugd;
+ Elm_Object_Item *elm_item;
+ Evas_Object* check_obj;
+ bool checked;
+ char* drm_filepath;
+
+ 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;
+ Elm_Theme *th;
+ /* add more variables here */
+ Evas_Object *navi_bar;
+
+ Evas_Object *albums_view;
+ Evas_Object *albums_view_ly;
+ Evas_Object *thumbs_view;
+ Evas_Object *thumbs_view_ly;
+ Elm_Object_Item *thumbs_nf_it;
+ Evas_Object *thumbs_nocontents;
+ Ecore_Idler* grid_append_idler;
+ Evas_Object *nocontents;
+ Ecore_Event_Handler* event_handler;
+ Evas_Object *popup;
+ Ecore_Timer *del_timer;
+ int popup_mode;
+
+ 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"*/
+ /* It's thumbnails icon size, not grid item size */
+ int icon_size;
+ Ecore_Timer *thumbs_clicked_timer;
+
+ int album_select_mode;
+ int file_select_mode;
+ int file_type_mode;
+ int file_select_contact_id;
+ int file_select_setas_mode;
+ char* file_setas_callid_size;
+ char* file_setas_callid_path;
+ char* file_setas_image_path;
+ char* file_setas_crop_image_path;
+ char albums_view_title[GE_ALBUM_NAME_LEN_MAX];
+ char* file_setas_homescreen_path;
+ char* file_setas_lockscreen_path;
+
+ Evas_Object *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_FREE_MEM(mem) if(mem){free(mem); mem = NULL;}
+
+
+ge_view_mode _ge_get_view_mode(void);
+void _ge_set_view_mode(ge_view_mode mode);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __GALLERY_EFL_H__ */
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GE_ALBUMS_H_
+#define _GE_ALBUMS_H_
+
+#include "gallery-efl.h"
+
+Evas_Object* ge_albums_create_view(ge_ugdata *ugd, Evas_Object* parent);
+int ge_albums_sel_album(ge_cluster* album_item);
+int ge_albums_update_view(ge_ugdata *ugd);
+Evas_Object* ge_albums_create_ly(Evas_Object* parent);
+int ge_albums_back_to_view(ge_ugdata *ugd);
+int ge_albums_del_callbacks(ge_ugdata *ugd);
+int ge_albums_free_cover_thumbs(ge_ugdata *ugd);
+
+#endif /* _GE_ALBUMS_H_ */
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GE_BUTTON_H_
+#define _GE_BUTTON_H_
+
+#include "gallery-efl.h"
+
+typedef enum _ge_but_mode {
+ GE_BUT_CANCEL,
+ GE_BUT_OK,
+ GE_BUT_DONE,
+} 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_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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_ */
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GL_DEBUG_H_
+#define _GL_DEBUG_H_
+
+#include <dlog.h>
+
+#ifdef _cplusplus
+extern "C" {
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "GALLERY-EFL"
+
+typedef enum {
+ DEBUG_CRITICAL,
+ DEBUG_CHECK,
+ MB_DEBUG_LOG,
+ DEBUG_MAX
+} GlDebugType;
+
+/* anci c color type */
+#define FONT_COLOR_RESET "\033[0m"
+#define FONT_COLOR_RED "\033[31m"
+#define FONT_COLOR_GREEN "\033[32m"
+#define FONT_COLOR_YELLOW "\033[33m"
+#define FONT_COLOR_BLUE "\033[34m"
+#define FONT_COLOR_PURPLE "\033[35m"
+#define FONT_COLOR_CYAN "\033[36m"
+#define FONT_COLOR_GRAY "\033[37m"
+
+#ifdef _USE_LOG_FILE_
+FILE* g_log_fp;
+#endif // _USE_LOG_FILE_
+
+#ifdef _USE_LOG_FILE_
+
+#define ge_dbg(fmt,arg...) fprintf(g_log_fp, "[%s: %d]" fmt "\n", __FUNCTION__, __LINE__, ##arg)
+
+#elif defined _USE_DLOG_
+
+#define ge_dbg(fmt, arg...) LOGD("[%s : %d] " fmt "\n", __FUNCTION__, __LINE__, ##arg)
+#define ge_dbgW(fmt, arg...) LOGW(FONT_COLOR_GREEN"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg)
+#define ge_dbgE(fmt, arg...) LOGE(FONT_COLOR_RED"[%s : %d] " fmt "\n"FONT_COLOR_RESET, __FUNCTION__, __LINE__, ##arg)
+
+#elif defined _USE_LOG_CONSOLE_
+
+#define ge_dbg(fmt,arg...) fprintf(stdout, "[%s: %d] [%s]" fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg)
+#define ge_dbgW(fmt, arg...) fprintf(stdout, "[%s : %d] [%s] " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg)
+#define ge_dbgE(fmt, arg...) fprintf(stdout, "[%s : %d] [%s] " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ##arg)
+
+#else
+
+#define ge_dbg(fmt,arg...)
+#define ge_dbgW(fmt, arg...)
+#define ge_dbgE(fmt, arg...)
+#endif
+
+#define ge_warn_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ ge_dbg("(%s) -> "fmt, #expr, ##arg); \
+ } \
+ } while (0)
+#define ge_ret_if(expr) do { \
+ if(expr) { \
+ ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+ } while (0)
+#define ge_retv_if(expr, val) do { \
+ if(expr) { \
+ ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+ } while (0)
+#define ge_retm_if(expr, fmt, arg...) do { \
+ if(expr) { \
+ ge_dbgE(fmt, ##arg); \
+ ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return; \
+ } \
+ } while (0)
+#define ge_retvm_if(expr, val, fmt, arg...) do { \
+ if(expr) { \
+ ge_dbgE(fmt, ##arg); \
+ ge_dbgE("(%s) -> %s() return", #expr, __FUNCTION__); \
+ return (val); \
+ } \
+ } while (0)
+
+
+#define GE_CHECK_VAL(expr, val) ge_retvm_if(!(expr), val, "Invalid parameter, return ERROR code!")
+#define GE_CHECK_NULL(expr) ge_retvm_if(!(expr), NULL, "Invalid parameter, return NULL!")
+#define GE_CHECK_FALSE(expr) ge_retvm_if(!(expr), false, "Invalid parameter, return FALSE!")
+#define GE_CHECK_CANCEL(expr) ge_retvm_if(!(expr), ECORE_CALLBACK_CANCEL, "Invalid parameter, return ECORE_CALLBACK_CANCEL!")
+#define GE_CHECK(expr) ge_retm_if(!(expr), "Invalid parameter, return!")
+
+
+#include <time.h>
+#include <sys/time.h>
+
+void _ge_print_debug_time_ex(long start, long end, const char* func_name, char* time_string);
+
+#ifdef _cplusplus
+}
+#endif
+
+#endif /* _GL_DEBUG_H_ */
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GE_EXT_UG_LOAD_H_
+#define _GE_EXT_UG_LOAD_H_
+
+#include <ui-gadget.h>
+#include "gallery-efl.h"
+
+
+int ge_ext_load_iv_ug(ge_ugdata* ugd);
+
+#endif /* _GE_EXT_UG_LOAD_H_ */
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GE_GRIDVIEW_H_
+#define _GE_GRIDVIEW_H_
+
+#include "gallery-efl.h"
+
+Evas_Object* ge_grid_create_ly(Evas_Object* parent);
+Evas_Object* ge_grid_create_view(ge_ugdata* ugd, Evas_Object* parent);
+int ge_grid_clear_view(ge_ugdata *ugd);
+int ge_grid_update_view(ge_ugdata *ugd);
+int ge_grid_del_callbacks(ge_ugdata *ugd);
+int ge_grid_idler_append_thumbs(void* data);
+
+#endif /* _GE_GRIDVIEW_H_ */
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GE_STRINGS_H_
+#define _GE_STRINGS_H_
+
+#ifdef _cplusplus
+extern "C" {
+#endif
+
+#define _GE_GETSYSTEMSTR(ID) dgettext("sys_string", (ID))
+#define _GE_GETLOCALSTR(ID) dgettext("ug-gallery-efl", (ID))
+/* hard code strings */
+#define GE_ALBUM_ALL_NAME _GE_GETLOCALSTR("IDS_MEDIABR_BODY_ALL_ALBUMS")
+#define GE_ALBUM_MY_NAME "Camera shots"
+#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")
+
+/* system strings which are included in sys-string-0 po files */
+#define GE_TITLE_ADD _GE_GETSYSTEMSTR("IDS_COM_ADD")
+#define GE_TITLE_ALBUMS _GE_GETSYSTEMSTR("IDS_COM_BODY_ALBUMS")
+#define GE_TITLE_IMAGE _GE_GETSYSTEMSTR("IDS_COM_OPT_IMAGE")
+#define GE_TITLE_FILE _GE_GETSYSTEMSTR("IDS_COM_POP_FILE")
+#define GE_TITLE_IMAGES _GE_GETSYSTEMSTR("IDS_COM_BODY_IMAGES")
+#define GE_TITLE_VIDEOS _GE_GETSYSTEMSTR("IDS_COM_BODY_VIDEOS")
+#define GE_TITLE_FILES _GE_GETSYSTEMSTR("IDS_COM_OPT_FILES")
+#define GE_TITLE_CHANGE_WALLPAPER _GE_GETSYSTEMSTR("IDS_COM_HEADER_CHANGE_WALLPAPER")
+#define GE_TITLE_VIDEO _GE_GETSYSTEMSTR("IDS_COM_BODY_VIDEO")
+#define GE_LABEL_NO_VIDEOS _GE_GETSYSTEMSTR("IDS_COM_BODY_NO_VIDEOS")
+#define GE_SELINFO_SELECTED _GE_GETSYSTEMSTR("IDS_COM_POP_SELECTED")
+#define GE_POPUP_NO_FILES_SELECTED _GE_GETSYSTEMSTR("IDS_COM_POP_NO_FILES_SELECTED")
+
+#ifdef _cplusplus
+}
+#endif
+#endif
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GE_UI_UTIL_H_
+#define _GE_UI_UTIL_H_
+
+#include <appcore-efl.h>
+#include "gallery-efl.h"
+
+#ifdef _cplusplus
+extern "C" {
+#endif
+
+#define _EDJ(o) elm_layout_edje_get(o)
+
+#define _GETICON(_path) \
+ ((1 == ecore_file_exists(_path) && (ecore_file_size(_path) > 0)) ? _path : GE_DEFAULT_THUMB_ICON)
+
+typedef enum {
+ AlbumsView_Title,
+ ThumbnailView_Title,
+}NaviTitleMode;
+
+typedef enum {
+ GE_Popup_NoButton,
+ GE_Popup_OneButton,
+ GE_Popup_TwoButton,
+ GE_Popup_UgExit,
+}GE_PopupMode;
+
+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);
+Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *group);
+Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd);
+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);
+
+
+#ifdef _cplusplus
+}
+#endif
+
+#endif // end of _GE_UI_UTIL_H_
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef _GE_UTIL_H_
+#define _GE_UTIL_H_
+
+#include "gallery-efl.h"
+
+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);
+
+#endif /* _GE_EXT_EXEC_H_ */
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#define CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 42 42
+
+#define CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC 255 255 255 255
+#define CHECK_DEFAULT_TEXT_PRESSED_COLOR_INC 255 255 255 255
+#define CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC 136 136 136 136
+
+////////////////////////////////////////////////////////////////////////////////////////
+//
+// check default textblock style
+//
+///////////////////////////////////////////////////////////////////////////////////////
+ styles {
+ style { name: "check_label_textblock_style";
+ base: "font=HelveticaNeue:style=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: "whitecolor" "+ color=#ffffff";
+ tag: "tab" "\t";
+ }
+ }
+
+#define CHECK_STATE_DEFAULT 0
+#define CHECK_STATE_VISIBLE 1
+#define CHECK_STATE_DISABLED_VISIBLE 2
+#define CHECK_STATE_DISABLED 3
+
+////////////////////////////////////////////////////////////////////////////////
+#define CHECK_STYLE_GRID(style_name, image_grid, width, height) \
+ group { \
+ name: "elm/check/base/"style_name; \
+ images { \
+ image: image_grid COMP; \
+ } \
+ parts { \
+ part { \
+ name: "bg"; \
+ type: RECT; \
+ mouse_events: 1; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ rel1.relative: 0.0 0.0; \
+ rel2.relative: 1.0 1.0; \
+ color: 0 0 0 0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "pressed" 0.0; \
+ inherit: "default" 0.0; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 0; \
+ } \
+ } \
+ part { name: "icon_bg_img"; \
+ type: RECT; \
+ mouse_events: 0; \
+ scale : 1; \
+ description { \
+ color: 0 0 0 0; \
+ rel1 { relative: GAP_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: 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"; \
+ type: RECT; \
+ mouse_events: 0; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ rel1.to: "icon_bg"; \
+ rel2.to: "icon_bg"; \
+ align: 0.5 0.5; \
+ min: width height; \
+ max: width height; \
+ color: 0 0 0 0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "pressed" 0.0; \
+ inherit: "default" 0.0; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 0; \
+ } \
+ } \
+ part { \
+ name: "selected_bg"; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ rel1.to: "icon_bg"; \
+ rel2.to: "icon_bg"; \
+ color: 0 0 0 0; \
+ visible: 0; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ color: 0 0 0 153; \
+ visible: 1; \
+ } \
+ } \
+ part { \
+ name: "check"; \
+ mouse_events: 0; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ rel1.to: "bg2"; \
+ rel2.to: "bg2"; \
+ visible: 0; \
+ image.normal: image_grid; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "pressed" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "disabled_visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ } \
+ part { \
+ name: "elm.swallow.content"; \
+ type: SWALLOW; \
+ description { \
+ state: "default" 0.0; \
+ fixed: 1 0; \
+ visible: 0; \
+ color: 255 255 255 255; \
+ align: 0.0 0.5; \
+ rel1.to_x: "bg2"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.offset: 1 1; \
+ rel2.to_x: "bg2"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.offset: 2 -2; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ fixed: 1 1; \
+ visible: 1; \
+ aspect: 1.0 1.0; \
+ aspect_preference: VERTICAL; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ color: 128 128 128 128; \
+ } \
+ description { \
+ state: "disabled_visible" 0.0; \
+ inherit: "default" 0.0; \
+ color: 128 128 128 128; \
+ fixed: 1 1; \
+ visible: 1; \
+ aspect: 1.0 1.0; \
+ } \
+ } \
+ part { \
+ name: "elm.text"; \
+ type: TEXTBLOCK; \
+ mouse_events: 0; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ visible: 0; \
+ fixed: 0 1; \
+ rel1 { relative: 1.0 0.5; offset: 1 1; to_x: "elm.swallow.content"; } \
+ rel2 { relative: 1.0 0.5; offset: -2 -2; } \
+ color: 255 255 255 255; \
+ align: 0.0 0.5; \
+ text { \
+ style: "check_label_textblock_style"; \
+ min: 0 0; \
+ } \
+ color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ text.min: 1 1; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ } \
+ description { \
+ state: "disabled_visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ text.min: 1 1; \
+ color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
+ } \
+ } \
+ part { \
+ name: "events"; \
+ type: RECT; \
+ ignore_flags: ON_HOLD; \
+ description { \
+ state: "default" 0.0; \
+ color: 0 0 0 0; \
+ } \
+ } \
+ part { \
+ name: "disabler"; \
+ type: RECT; \
+ description { \
+ state: "default" 0.0; \
+ color: 0 0 0 0; \
+ visible: 0; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ } \
+ } \
+ programs { \
+ program { \
+ name: "click"; \
+ signal: "mouse,up,1"; \
+ source: "events"; \
+ action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
+ after: "bg_normal"; \
+ } \
+ program { \
+ name: "bg_normal"; \
+ script { \
+ set_state(PART:"bg", "default", 0.0); \
+ set_state(PART:"bg2", "default", 0.0); \
+ } \
+ } \
+ program { \
+ name: "mouseout"; \
+ signal: "mouse,out"; \
+ source: "events"; \
+ after: "bg_check_normal"; \
+ } \
+ program { \
+ name: "bg_check_normal"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "pressed")) \
+ set_state(PART:"check", "visible", 0.0); \
+ set_state(PART:"bg", "default", 0.0); \
+ set_state(PART:"bg2", "default", 0.0); \
+ } \
+ } \
+ program { \
+ name: "pressed"; \
+ signal: "mouse,down,1"; \
+ source: "events"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"check", "pressed", 0.0); \
+ set_state(PART:"bg", "pressed", 0.0); \
+ set_state(PART:"bg2", "pressed", 0.0); \
+ } \
+ } \
+ program { \
+ name: "check_on"; \
+ signal: "elm,state,check,on"; \
+ source: "elm"; \
+ action: STATE_SET "visible" 0.0; \
+ target: "check"; \
+ target: "selected_bg"; \
+ } \
+ program { \
+ name: "check_off"; \
+ signal: "elm,state,check,off"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "check"; \
+ target: "selected_bg"; \
+ } \
+ program { \
+ name: "text_show"; \
+ signal: "elm,state,text,visible"; \
+ source: "elm"; \
+ action: STATE_SET "visible" 0.0; \
+ target: "elm.text"; \
+ } \
+ program { \
+ name: "text_hide"; \
+ signal: "elm,state,text,hidden"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "elm.text"; \
+ } \
+ program { \
+ name: "icon_show"; \
+ signal: "elm,state,icon,visible"; \
+ source: "elm"; \
+ action: STATE_SET "visible" 0.0; \
+ target: "elm.swallow.content"; \
+ } \
+ program { \
+ name: "icon_hide"; \
+ signal: "elm,state,icon,hidden"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "elm.swallow.content"; \
+ } \
+ program { \
+ name: "disable"; \
+ signal: "elm,state,disabled"; \
+ source: "elm"; \
+ action: STATE_SET "disabled" 0.0; \
+ target: "disabler"; \
+ target: "bg"; \
+ target: "bg2"; \
+ after: "disable_text"; \
+ } \
+ program { \
+ name: "disable_text"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"elm.text", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"elm.text", "disabled_visible", 0.0); \
+ else \
+ set_state(PART:"elm.text", "disabled", 0.0); \
+ get_state(PART:"elm.swallow.content", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
+ else \
+ set_state(PART:"elm.swallow.content", "disabled", 0.0); \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"check", "disabled_visible", 0.0); \
+ } \
+ } \
+ program { \
+ name: "enable"; \
+ signal: "elm,state,enabled"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "disabler"; \
+ target: "bg"; \
+ target: "bg2"; \
+ after: "enable_text"; \
+ } \
+ program { \
+ name: "enable_text"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"elm.text", st, 30, vl); \
+ if (!strcmp(st, "disabled_visible")) \
+ set_state(PART:"elm.text", "visible", 0.0); \
+ else \
+ set_state(PART:"elm.text", "default", 0.0); \
+ get_state(PART:"elm.swallow.content", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"elm.swallow.content", "visible", 0.0); \
+ else \
+ set_state(PART:"elm.swallow.content", "default", 0.0); \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "disabled_visible")) \
+ set_state(PART:"check", "visible", 0.0); \
+ } \
+ } \
+ } \
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+ CHECK_STYLE_GRID("gallery_efl/grid", GE_EDC_IMAGE_CHECK_GRID, 64, 64)
+
+
+#undef CHECK_STATE_DEFAULT
+#undef CHECK_STATE_VISIBLE
+#undef CHECK_STATE_DISABLED_VISIBLE
+#undef CHECK_STATE_DISABLED
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+/* Definition of image path used in edc file */
+
+/* gallery-efl-nocontents.edc */
+#define GE_EDC_IMAGE_NOCONTENTS_PIC "T01_Nocontents_picture.png"
+
+/* gallery-efl-gengrid-item-albums.edc */
+#define GE_EDC_IMAGE_MAIN_FOLDER_BG "T01_main_folder_bg.png"
+
+/* gallery-efl-gengrid-item-thumbview.edc */
+#define GE_EDC_IMAGE_BUTTON_PLAY "T01_btn_play.png"
+#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"
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+/* 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);
+ }
+ }
+ }
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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/thumbnail_view/gallery_efl/default";
+
+ data.item: "contents" "elm.swallow.icon elm.swallow.end";
+
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1 { relative: 0.0 0.0; offset: 0 0;}
+ rel2 { relative: 1.0 1.0; offset: 0 0;}
+ }
+ }
+ part {
+ name: "icon_bg";
+ type: RECT;
+ scale : 1;
+
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ visible: 0;
+ color: 0 0 0 0;
+ rel1 { relative: 0.0 0.0;to:"bg"; }
+ rel2 { relative: 1.0 1.0;to:"bg"; }
+
+ }
+ }
+
+ part {
+ name: "elm.swallow.icon";
+ type: SWALLOW;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ rel1 { relative: 0.0 0.0; to: "icon_bg"; }
+ rel2 { relative: 1.0 1.0; to: "icon_bg"; }
+ }
+ }
+ part {
+ name: "elm.swallow.end";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; to: "elm.swallow.icon"; }
+ rel2 { relative: 1.0 1.0; to: "elm.swallow.icon"; }
+ }
+ }
+ }
+
+ programs {
+ program {
+ name: "movedonw_bg";
+ signal: "movedown,bg,show";
+ source: "bg";
+ action: STATE_SET "move_down" 0.0;
+ target: "bg";
+ }
+ }
+}
+
+
+
+
+group
+{
+ name: "elm/gengrid/photoframe/default_layout";
+
+ 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"; }
+ }
+ }
+ }
+
+ 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;
+ 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;
+ 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: GE_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: 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-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: 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: "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";
+ }
+ }
+}
--- /dev/null
+/*
+ * libug-gallery-efl
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Sangjin Han <sjhan.han@samsung.com>,
+ * Jiansong Jin <jiansong.jin@samsung.com>,
+ * Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ * Chaolong Lin <chaolong.lin@samsung.com>,
+ * Yongjun Zhao <yj123.zhao@samsung.com>
+ *
+ * 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.
+ *
+ */
+
+#define NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC 32
+#define NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC 173 170 165 255
+
+ group {
+ name: "elm/layout/nocontents/gallery_efl";
+ styles{
+ style { name: "nocontent_style";
+ base: "font=Helvetica Neue:style=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: "tab" "\t";
+ }
+ }
+ images {
+ image: GE_EDC_IMAGE_NOCONTENTS_PIC COMP;
+ }
+ parts {
+ part { name: "bg";
+ scale: 1;
+ type: RECT;
+ description { state: "default" 0.0;
+ visible: 1;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 1.0 1.0;}
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "nocontents.image";
+ description { state: "default" 0.0;
+ visible: 1;
+ align: 0.5 0.0;
+ rel1 { relative: 203/720 296/1016; to: "bg";}
+ rel2 { relative: (203+314)/720 (296+310)/1016; to: "bg";}
+ image {
+ normal: GE_EDC_IMAGE_NOCONTENTS_PIC;
+ border: 1 1 1 1;
+ border_scale: 1;
+ }
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ }
+ }
+ part { name: "middle.padding";
+ scale: 1;
+ type: RECT;
+ description { state: "default" 0.0;
+ visible: 0;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 1.0; to_y: "nocontents.image";}
+ rel2 { relative: 1.0 (296+310+54)/1016; to: "bg";}
+ }
+ }
+ part { name: "elm.text";
+ type: TEXTBLOCK;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ visible: 1;
+ rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "middle.padding";}
+ rel2 { relative: 1.0 1.0; to: "bg";}
+ color: NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC;
+ text {
+ style: "nocontent_style";
+ align: 0.5 0.5;
+ min: 0 0;
+ max: 0 1;
+ }
+ }
+ }
+ }
+ }
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#define SELINFO_PORT_W 720
+#define SELINFO_H 48
+#define SELINFO_TOP_LINE_COLOR 56 56 56 255
+#define SELINFO_TOP_LINE_H 2
+#define SELINFO_PAD_L 14
+
+#define GE_EDC_COLOR_THEME_GRAY 91 91 91 255
+
+group
+{
+ name: "elm/standard/selectioninfo/ug_selectioninfo_viewer";
+
+
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 1;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: SELINFO_PORT_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;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: 0 SELINFO_TOP_LINE_H;
+ fixed: 1 0;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 0.0; to: "bg"; }
+ rel2 { relative: 1.0 SELINFO_TOP_LINE_H/SELINFO_H; to: "bg"; }
+ color: SELINFO_TOP_LINE_COLOR;
+ }
+ }
+ part { name: "left_padding";
+ type: RECT;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: SELINFO_PAD_L SELINFO_H;
+ fixed: 1 1;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 0.0; to: "bg"; }
+ rel2 { relative: 0.0 1.0; to: "bg"; }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 0.0; to_x: "left_padding"; to_y: "bg"; }
+ rel2 { relative: 1.0 1.0; to: "bg"; }
+ color: 255 255 255 255;
+ text {
+ font: "Helvetica Neue:style=Medium";
+ size: 32;
+ text: "";
+ align: 0.5 0.5;
+ }
+ }
+ }
+ }
+
+ programs {
+ program {//default selection
+ name: "selectioninfo_portrait";
+ signal: "elm,selectioninfo,ug_portrait";
+ source: "elm";
+ script {
+ set_state(PART:"bg", "default", 0.0);
+ }
+
+ }
+ }
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#define FONT_ROM "HelveticaNeue:style=Roman"
+#define FONT_MED "HelveticaNeue:style=Medium"
+
+#include "gallery-efl-edc-res.h"
+
+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"
+
+ group
+ {
+ name: "gallery_efl/gridview";
+
+ parts {
+ part {
+ name: "background";
+ type, RECT;
+
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; offset: 0 0; }
+ rel2 { relative: 1.0 1.0; offset: -1 -1; }
+ color, 0 0 0 0;
+ }
+ }
+
+ part {
+ name: "contents";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; to: "background";}
+ rel2 { relative: 1.0 1.0; to: "background";}
+ }
+ description {
+ state: "moveup" 0.0;
+ rel1 { relative: 0.0 0.0; to: "background";}
+ rel2 { relative: 1.0 0.0; to: "elm.padding.selinfo"; }
+ }
+
+ }
+ part {
+ name: "elm.padding.selinfo";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 SELINFO_H; // bottom padding size for selectioninfo
+ fixed: 0 1;
+ align: 0.5 1.0;
+ rel1 { relative: 0.0 1.0; }
+ rel2 { relative: 1.0 1.0; }
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ }
+ }
+
+ programs {
+ program {
+ name: "thumb_view_default";
+ signal: "elm,thumb_view,state,default";
+ source: "elm";
+ script {
+ set_state(PART:"contents", "default", 0.0);
+ }
+ }
+ program {
+ name: "thumb_view_moveup";
+ signal: "elm,thumb_view,state,moveup";
+ source: "elm";
+ script {
+ set_state(PART:"contents", "moveup", 0.0);
+ }
+ }
+ }
+ }
+
+ group
+ {
+ name: "gallery_efl/albumview";
+
+ parts {
+ part {
+ name: "background";
+ type, RECT;
+
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; offset: 0 0; }
+ rel2 { relative: 1.0 1.0; offset: -1 -1; }
+ color, 0 0 0 0;
+ }
+ }
+
+ part {
+ name: "contents";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; to: "background";}
+ rel2 { relative: 1.0 1.0; to: "background";}
+
+ }
+ }
+ }
+ }
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#ifndef UG_MODULE_API
+#define UG_MODULE_API __attribute__ ((visibility("default")))
+#endif
+
+#include <Evas.h>
+#include <aul.h>
+#include "gallery-efl.h"
+#include "ge-debug.h"
+#include "ge-albums.h"
+#include "ge-gridview.h"
+#include "ge-db-handler.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_ALPHA_DEFAULT 255
+
+
+ge_view_mode _ge_get_view_mode(void)
+{
+ return g_view_mode;
+}
+
+void _ge_set_view_mode(ge_view_mode mode)
+{
+ g_view_mode = mode;
+}
+
+static int _ge_create_ly_view(ge_ugdata *ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+ GE_CHECK_VAL(ugd->navi_bar, -1);
+
+ /**
+ * Init libmedia-info.
+ * If failed, records couldn't be got from DB, cluster list is emty.
+ * Show warning message instead of return -1;
+ */
+ if(ge_db_init(ugd) != GE_DB_SUCCESS)
+ {
+ ge_dbgW("ge_db_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!");
+ }
+ /* 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 );
+
+ return 0;
+}
+
+static Evas_Object *_ge_create_bg(Evas_Object *parent)
+{
+ ge_dbg("");
+ GE_CHECK_NULL(parent);
+ Evas_Object *bg = NULL;
+
+ bg = elm_bg_add(parent);
+ /* Show special color(48,48,48,255) of background */
+ 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_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(bg);
+
+ return bg;
+}
+
+static int _ge_init_view(ge_ugdata *ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+
+ /* Base Layout */
+ ugd->ly_main = ge_ui_create_main_ly(ugd, ugd->win);
+ GE_CHECK_VAL(ugd->ly_main, -1);
+
+ /* Background */
+ ugd->bg = _ge_create_bg(ugd->ly_main);
+ GE_CHECK_VAL(ugd->bg, -1);
+ /* Pack bg to swallow */
+ elm_object_part_content_set(ugd->ly_main, "elm.swallow.bg", ugd->bg);
+
+ /* Navigation Bar */
+ ugd->navi_bar = ge_ui_create_navibar(ugd, ugd->ly_main);
+ GE_CHECK_VAL(ugd->navi_bar, -1);
+
+ /* Albums view and its layout */
+ if(_ge_create_ly_view(ugd) != 0)
+ {
+ ge_dbgE("Create albums view and layout failed!");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int _ge_create_view(ge_ugdata *ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+
+ /* Set inited flag as TRUE */
+ ugd->b_inited_view = true;
+ /* Add new theme */
+ ugd->th = elm_theme_new();
+ GE_CHECK_VAL(ugd->th, -1);
+ elm_theme_ref_set(ugd->th, NULL);
+ elm_theme_extension_add(ugd->th, GE_EDJ_FILE);
+ elm_theme_extension_add(ugd->th, GALLERY_BLACK_EDJ_FILE);
+
+ /* Initialize gallery ug view */
+ if(_ge_init_view(ugd) != 0)
+ {
+ ge_dbgE("Initialize view failed!");
+ return -1;
+ }
+
+ /* Register MMC and UMS 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;
+}
+
+static int _ge_close_view(ge_ugdata *ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+
+ GE_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)
+
+ if(ugd->b_inited_view) {
+ /* Destroy UG called by me */
+ if (ugd->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_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_albums_free_cover_thumbs(ugd);
+
+ /* Disconnet with libmedia-info */
+ ge_db_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;
+ }
+
+ return 0;
+}
+
+static void __ge_parse_param_launch_type_setas(ge_ugdata *ugd, bundle *data)
+{
+ 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);
+ if(setas_type == NULL) {
+ ge_dbg("setas-type NULL");
+ return;
+ }
+
+ 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);
+
+ wallpaper_path = bundle_get_val(b, GE_BUNDLE_HOMESCREEN_PATH);
+ if (wallpaper_path) {
+ ge_dbg("path:%s", wallpaper_path);
+ ugd->file_setas_homescreen_path = strdup(wallpaper_path);
+ }
+
+ lockscreen_path = bundle_get_val(b, GE_BUNDLE_LOCKSCREEN_PATH);
+ if (lockscreen_path) {
+ ge_dbg("path:%s", lockscreen_path);
+ ugd->file_setas_lockscreen_path = strdup(lockscreen_path);
+ }
+ } 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);
+
+ callerid_size = bundle_get_val(b, GE_BUNDLE_CALLERID_SIZE);
+ if (callerid_size) {
+ ge_dbg("size:%s", callerid_size);
+ ugd->file_setas_callid_size = strdup(callerid_size);
+ }
+
+ callerid_path = bundle_get_val(b, GE_BUNDLE_CALLERID_PATH);
+ if (callerid_path) {
+ ge_dbg("path:%s", callerid_path);
+ ugd->file_setas_callid_path = strdup(callerid_path);
+ }
+ }
+}
+
+static void __ge_parse_param_file_type(ge_ugdata *ugd, bundle *data)
+{
+ GE_CHECK(ugd);
+ GE_CHECK(data);
+ bundle* b = data;
+
+ const 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)) {
+ b_singular = false;
+ }
+
+ /* file-type */
+ file_type = bundle_get_val(b, GE_BUNDLE_FILE_TYPE);
+ if(file_type == NULL)
+ goto DEFAULT_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));
+ } else {
+ g_strlcat(ugd->albums_view_title, GE_TITLE_IMAGES,
+ sizeof(ugd->albums_view_title));
+ }
+ return;
+
+ } 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));
+ } else {
+ g_strlcat(ugd->albums_view_title, GE_TITLE_VIDEOS,
+ sizeof(ugd->albums_view_title));
+ }
+ return;
+ }
+
+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) {
+ g_strlcpy(file_type_str, GE_TITLE_FILE, sizeof(file_type_str));
+ } else {
+ g_strlcpy(file_type_str, GE_TITLE_FILES, sizeof(file_type_str));
+ }
+
+ g_strlcat(ugd->albums_view_title, file_type_str,
+ sizeof(ugd->albums_view_title));
+
+ return;
+}
+
+/* analysis parameters */
+static int _ge_parse_param(ge_ugdata *ugd, bundle *data)
+{
+ GE_CHECK_VAL(ugd, -1);
+ GE_CHECK_VAL(data, -1);
+ bundle* b = data;
+ const char *launch_type = NULL;
+
+ launch_type = bundle_get_val(b, GE_BUNDLE_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))
+ {
+ ugd->album_select_mode = GE_Album_Select_One;
+ g_strlcpy(ugd->albums_view_title, GE_TITLE_ALBUMS,
+ 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);
+ /* 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);
+
+ 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)) {
+ 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);
+
+ }
+
+ return 0;
+}
+
+/**
+* @brief
+*
+* @param ug
+* @param mode
+* @param data
+* @param priv
+*
+* @return
+*/
+static void * _ge_create(struct ui_gadget *ug, enum ug_mode mode, bundle *data, 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(ug);
+ ge_dbgW("Gallery UG start...");
+
+ ugd = (ge_ugdata *)priv;
+ ugd->ug = ug;
+ /* Get window */
+ parent = (Evas_Object *)ug_get_window();
+ GE_CHECK_NULL(parent);
+ ugd->win = parent;
+ /* Bind text domain for internalization */
+ 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);
+
+ Ecore_X_Window x_win = ecore_x_window_focus_get();
+ GE_CHECK_NULL(x_win);
+ Ecore_X_Window root_win = ecore_x_window_root_get(x_win);
+ GE_CHECK_NULL(root_win);
+ 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;
+ /* Parse parameters passed from parent */
+ if(_ge_parse_param(ugd, data) != 0) {
+ ge_dbgE("Failed to parse parameters!");
+ return NULL;
+ }
+
+ if ((ugd->file_select_mode == GE_File_Select_Setas) ||
+ (ugd->file_select_mode != GE_File_Select_None) ||
+ (ugd->album_select_mode != GE_Album_Select_None)) {
+ /* create gallery UG */
+ if(_ge_create_view(ugd) != 0) {
+ ge_dbgE("Failed to create Gallery UG view!");
+ return NULL;
+ }
+ } else {
+ ge_dbgE("Wrong file_select_mode[%d] or album_select_mode[%d]",
+ ugd->file_select_mode, ugd->album_select_mode);
+ }
+
+ return ugd->ly_main;
+}
+
+/**
+* @brief
+*
+* @param ug
+* @param data
+* @param priv
+*/
+static void _ge_start(struct ui_gadget *ug, bundle *data, void *priv)
+{
+}
+
+/**
+* @brief
+*
+* @param ug
+* @param data
+* @param priv
+*/
+static void _ge_pause(struct ui_gadget *ug, bundle *data, void *priv)
+{
+ ge_dbg("");
+}
+
+/**
+* @brief
+*
+* @param ug
+* @param data
+* @param priv
+*/
+static void _ge_resume(struct ui_gadget *ug, bundle *data, void *priv)
+{
+ ge_dbg("");
+ GE_CHECK(priv);
+ ge_ugdata *ugd = (ge_ugdata *)priv;
+ /*update*/
+ if (!_ge_ug_iv_get())
+ {
+ ge_update_view(ugd, GE_UPDATE_NONE);
+ }
+}
+
+/**
+* @brief
+*
+* @param ug
+* @param data
+* @param priv
+*/
+static void _ge_destroy(struct ui_gadget *ug, bundle *data, void *priv)
+{
+ ge_dbgW("");
+ GE_CHECK(ug);
+ GE_CHECK(priv);
+ ge_ugdata *ugd = (ge_ugdata *)priv;
+
+ _ge_close_view(ugd);
+ ge_dbgW("End of the gallery UG!");
+}
+
+/**
+* @brief
+*
+* @param ug
+* @param msg
+* @param data
+* @param priv
+*/
+static void _ge_message(struct ui_gadget *ug, bundle *msg, bundle *data, void *priv)
+{
+ ge_dbg("");
+}
+
+/**
+* @brief
+*
+* @param ug
+* @param event
+* @param data
+* @param priv
+*/
+static void _ge_event(struct ui_gadget *ug, enum ug_event event, bundle *data, void *priv)
+{
+ GE_CHECK(priv);
+
+ switch (event)
+ {
+ case UG_EVENT_LOW_MEMORY:
+ ge_dbg("UG_EVENT_LOW_MEMORY");
+ break;
+
+ case UG_EVENT_LOW_BATTERY:
+ ge_dbg("UG_EVENT_LOW_BATTERY");
+ break;
+
+ case UG_EVENT_LANG_CHANGE:
+ ge_dbg("UG_EVENT_LANG_CHANGE");
+ break;
+ default:
+ break;
+ }
+
+ return;
+}
+
+static void _ge_key_event(struct ui_gadget *ug, enum ug_key_event event, bundle *data, void *priv)
+{
+ ge_dbg("");
+ GE_CHECK(ug);
+
+ switch (event)
+ {
+ case UG_KEY_EVENT_END:
+ ge_dbg("Receive key end event");
+ ug_destroy_me(ug);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/**
+* @brief
+*
+* @param ops
+*
+* @return
+*/
+UG_MODULE_API int UG_MODULE_INIT(struct ug_module_ops *ops)
+{
+ ge_dbgW("UG_MODULE_INIT");
+ ge_ugdata *ugd = NULL;
+ GE_CHECK_VAL(ops, -1);
+
+ ugd = calloc(1, sizeof(ge_ugdata));
+ GE_CHECK_VAL(ugd, -1);
+
+ ops->create = _ge_create;
+ ops->start = _ge_start;
+ ops->pause = _ge_pause;
+ ops->resume = _ge_resume;
+ ops->destroy = _ge_destroy;
+ ops->message = _ge_message;
+ ops->event = _ge_event;
+ ops->key_event = _ge_key_event;
+ ops->priv = ugd;
+ ops->opt = UG_OPT_INDICATOR_ENABLE;
+
+ return 0;
+}
+
+/**
+* @brief
+*
+* @param ops
+*
+* @return
+*/
+UG_MODULE_API void UG_MODULE_EXIT(struct ug_module_ops *ops)
+{
+ struct ug_data *ugd = NULL;
+ GE_CHECK(ops);
+
+ ugd = ops->priv;
+ if (ugd)
+ {
+ free(ugd);
+ ugd = NULL;
+ }
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include "ge-debug.h"
+#include "ge-albums.h"
+#include "ge-gridview.h"
+#include "ge-ui-util.h"
+#include "ge-util.h"
+#include "ge-db-handler.h"
+#include "ge-strings.h"
+
+static Elm_Gengrid_Item_Class album_gic;
+static int gl_albums_item_cnt;
+static ge_item* gl_album_items[GE_ALBUM_COVER_THUMB_NUM];
+static int gl_album_count;
+
+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("");
+}
+
+static void _ge_albums_drag_right(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_drag_down(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_drag_left(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_drag_stop(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_realized(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_selected(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_unselected(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_albums_longpress(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static Eina_Bool _ge_albums_append_grid_idler(void *data)
+{
+ GE_CHECK_CANCEL(data);
+ ge_ugdata* ugd = (ge_ugdata*)data;
+
+ /* Try to get other medias from DB and append them to gridview*/
+ int ret = ge_grid_idler_append_thumbs(data);
+ if(ret < 0)
+ {
+ ge_dbg("Failed to append grid items!");
+ if(ret == MB_SVC_ERROR_DB_NO_RECORD)
+ {
+ /* Maybe all medias were already showed */
+ ge_dbg("No any more records!");
+ }
+ }
+ else
+ {
+ ge_dbg("Successful to append grid items!");
+ }
+
+ /* Remove idler after all items appended */
+ GE_DEL_IDLER(ugd->grid_append_idler)
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void __ge_albums_sel_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ GE_CHECK(data);
+ GE_CHECK(event_info);
+ Evas_Event_Mouse_Up *ev = event_info;
+
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ return;
+
+ ge_dbg("");
+ ge_cluster *album_item = (ge_cluster*)data;
+ GE_CHECK(album_item->cluster);
+ GE_CHECK(album_item->ugd);
+ ge_ugdata *ugd = album_item->ugd;
+ if(ugd->ug == NULL) {
+ ge_dbg("UG already destroyed, return!");
+ return;
+ }
+
+ if (album_item->cluster->count == 0) {
+ ge_dbgW("Empty album, return;");
+ return;
+ }
+
+ ge_albums_sel_album(album_item);
+}
+
+char * _ge_albums_get_text(void *data, Evas_Object *obj, const char *part)
+{
+ GE_CHECK_NULL(part);
+ GE_CHECK_NULL(data);
+ ge_cluster *album_item = (ge_cluster *)data;
+ GE_CHECK_NULL(album_item->cluster);
+ GE_CHECK_NULL(album_item->cluster->uuid);
+ GE_CHECK_NULL(album_item->ugd);
+ ge_ugdata *ugd = album_item->ugd;
+ char buf[GE_FILE_PATH_LEN_MAX] = {0,};
+
+ if (!strcmp(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));
+ 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);
+ 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)) {
+ 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;
+ 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"))
+ {
+ struct tm t1;
+ struct tm t2;
+ char date1[GE_ALBUM_DATE_LEN_MAX] = {0,};
+ char date2[GE_ALBUM_DATE_LEN_MAX] = {0,};
+ char date3[GE_ALBUM_DATE_LEN_MAX] = {0,};
+
+ ge_albums_free_cover_thumbs(ugd);
+
+ int item_count = GE_ALBUM_COVER_THUMB_NUM;
+ ge_item** items1 = gl_album_items;
+
+ ge_db_get_first_several_items(ugd, album_item, items1, &item_count, MINFO_MEDIA_SORT_BY_DATE_DESC);
+ if(item_count <= 0)
+ {
+ gl_album_count = 0;
+ return NULL;
+ }
+
+ gl_album_count = item_count;
+ if(items1[0] == NULL || items1[0]->item == NULL)
+ {
+ gl_album_count = 0;
+ return NULL;
+ }
+ memcpy(&album_item->item_mtime, &(items1[0]->item->mtime), sizeof(time_t));
+
+ item_count = 1;
+ ge_item* items2[1];
+ memset(items2, 0x00, item_count * sizeof(int));
+ ge_db_get_first_several_items(ugd, album_item, items2, &item_count, MINFO_MEDIA_SORT_BY_DATE_ASC);
+
+ if(item_count <= 0)
+ {
+ return NULL;
+ }
+ else
+ {
+ memset(&t1, 0x00, sizeof(struct tm));
+ localtime_r((time_t *) &(album_item->item_mtime), &t1);
+ strftime(date1, sizeof(date1), "%Y.%m.%d", &t1);
+ strftime(date3, sizeof(date3), "%Y.%m", &t1);
+
+ if(items2[0] == NULL || items2[0]->item == NULL)
+ {
+ gl_album_count = 0;
+ return NULL;
+ }
+ memset(&t2, 0x00, sizeof(struct tm));
+ localtime_r((time_t *) &(items2[0]->item->mtime), &t2);
+ strftime(date2, sizeof(date2), "%Y.%m.%d", &t2);
+
+ if(!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);
+ buf[strlen(buf)] = '\0';
+ }
+ }
+
+ int i = 0;
+ for(i = 0; i < item_count; i++)
+ {
+ ge_db_destroy_item(items2[i]);
+ items2[i] = NULL;
+ }
+ }
+ else if (!strcmp(part, "elm.text.count"))
+ {
+ ge_db_update_items_cnt(ugd, album_item);
+ snprintf(buf, sizeof(buf), "%d", (int)(album_item->cluster->count));
+ buf[strlen(buf)] = '\0';
+ }
+
+ return strdup(buf);
+}
+
+Evas_Object * _ge_albums_get_content(void *data, Evas_Object *obj, const char *part)
+{
+ GE_CHECK_NULL(part);
+ GE_CHECK_NULL(obj);
+ GE_CHECK_NULL(data);
+ if(strlen(part) <= 0)
+ {
+ ge_dbgE("part length <= 0");
+ return NULL;
+ }
+
+ 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;
+
+ 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;
+ }
+
+ ge_item **items = gl_album_items;
+ int item_count = gl_album_count;
+ int length = item_count;
+ Evas_Object* bg = NULL;
+
+ 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;
+ }
+ }
+
+ 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);
+ }
+ }
+
+ 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;
+ }
+
+ if(!strcmp(part, "elm.swallow.icon"))
+ {
+ ge_dbg("icon");
+ Evas_Object * tb = NULL;
+
+ 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);
+ /**
+ * for "All" their colors 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;
+ }
+
+ return NULL;
+}
+
+static int _ge_albums_create_album(ge_ugdata* ugd, Evas_Object* parent)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(parent, -1);
+ GE_CHECK_VAL(ugd, -1);
+ GE_CHECK_VAL(ugd->cluster_list, -1);
+ int i = 0;
+ int grid_cnt = 0;
+ ge_cluster *album_item = NULL;
+
+ album_gic.item_style = "albums_view";
+ album_gic.func.text_get = _ge_albums_get_text;
+ album_gic.func.content_get = _ge_albums_get_content;
+
+ int length = eina_list_count(ugd->cluster_list->clist);
+ ge_dbg("Albums list length: %d.", length);
+
+ elm_gengrid_clear(parent);
+
+ if(ugd->th)
+ {
+ elm_object_theme_set(parent, ugd->th);
+ }
+ elm_object_style_set(parent, "gallery_efl/default");
+
+ for(i = 0; i < length; i++)
+ {
+ album_item = eina_list_nth(ugd->cluster_list->clist, i);
+ GE_CHECK_VAL(album_item, -1);
+ GE_CHECK_VAL(album_item->cluster, -1);
+ GE_CHECK_VAL(album_item->cluster->display_name, -1);
+
+ album_item->griditem = elm_gengrid_item_append(parent,
+ &album_gic,
+ album_item,
+ __ge_albums_sel_cb,
+ album_item);
+ album_item->index = grid_cnt;
+ grid_cnt++;
+
+ ge_dbg("Append [%s], id=%s.", album_item->cluster->display_name,
+ album_item->cluster->uuid);
+ }
+
+ gl_albums_item_cnt = grid_cnt;
+
+ if(grid_cnt)
+ {
+ return 0;
+ }
+ else
+ {
+ ge_dbgW("None albums appended to view!");
+ return -1;
+ }
+}
+
+int ge_albums_free_cover_thumbs(ge_ugdata *ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+ int i = 0;
+
+ for(i = 0; i < GE_ALBUM_COVER_THUMB_NUM; i++)
+ {
+ if(gl_album_items[i])
+ {
+ ge_db_destroy_item(gl_album_items[i]);
+ gl_album_items[i] = NULL;
+ }
+ }
+
+ return 0;
+}
+
+int ge_albums_back_to_view(ge_ugdata *ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+
+ if(ugd->file_select_mode == GE_File_Select_Multiple)
+ {
+ ge_ui_destroy_selinfo(ugd);
+ ge_db_selected_list_finalize();
+ }
+
+ GE_DEL_IDLER(ugd->grid_append_idler)
+
+ ge_albums_update_view(ugd);
+ ge_grid_clear_view(ugd);
+
+ _ge_set_view_mode(GE_AlbumsView_Mode);
+ return 0;
+}
+
+int ge_albums_sel_album(ge_cluster* album_item)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(album_item, -1);
+ GE_CHECK_VAL(album_item->cluster, -1);
+ GE_CHECK_VAL(album_item->cluster->uuid, -1);
+ GE_CHECK_VAL(album_item->ugd, -1);
+
+ if(_ge_get_view_mode() != GE_AlbumsView_Mode)
+ {
+ ge_dbgE("error mode.. now return!");
+ return -1;
+ }
+ else
+ {
+ ge_dbg("ViewMode");
+ }
+
+ ge_ugdata *ugd = album_item->ugd;
+ GE_CHECK_VAL(ugd->cluster_list, -1);
+ GE_CHECK_VAL(ugd->navi_bar, -1);
+ ge_dbg("Album: %s, id: %s, cluster_index: %d.",
+ album_item->cluster->display_name, album_item->cluster->uuid,
+ album_item->index);
+
+ 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);
+ ge_dbg("return folder-path: %s", folder_path);
+ ug_send_result(ugd->ug, ugd->bundle);
+ ug_destroy_me(ugd->ug);
+ ugd->ug = NULL;
+ return 0;
+ }
+
+ /* Set current album */
+ _ge_set_current_album(album_item);
+ /* Remove idler */
+ GE_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);
+
+ if(ugd->file_select_mode == GE_File_Select_Setas)
+ {
+ ge_dbg("setas mode->thumbnail is view mode");
+ _ge_set_view_mode(GE_ThumbnailView_Mode);
+ }
+ else
+ {
+ ge_dbg("select mode->thumbnail is edit mode");
+ _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;
+
+ gv = ge_grid_create_view(ugd, ugd->thumbs_view_ly);
+ GE_CHECK_VAL(gv, -1);
+
+ elm_object_part_content_set(ugd->thumbs_view_ly, "contents", gv);
+ ugd->thumbs_view = gv;
+ if(gv == ugd->nocontents)
+ {
+ ugd->thumbs_nocontents = gv;
+ }
+
+ if(_ge_get_view_mode() == GE_ThumbnailView_Mode)
+ {
+ /* Check root case */
+ if(ge_db_is_root_path(ugd, album_item->cluster->uuid, NULL))
+ {
+ ge_ui_create_title_and_push(ugd, ugd->navi_bar,
+ ugd->thumbs_view_ly, ThumbnailView_Title, GE_ALBUM_ROOT_NAME);
+ }
+ else
+ {
+ ge_ui_create_title_and_push(ugd, ugd->navi_bar,
+ ugd->thumbs_view_ly, ThumbnailView_Title, album_item->cluster->display_name);
+ }
+ }
+ else
+ {
+ ge_ui_create_title_and_push(ugd, ugd->navi_bar,
+ ugd->thumbs_view_ly, ThumbnailView_Title, ugd->albums_view_title);
+ }
+
+ if(ge_db_get_count_all() == (GE_FIRST_VIEW_END_POS+1))
+ {
+ ge_dbg("\n\n>>>>>>>>Use idler to append other medias--Start>>>>>>>>\n");
+ ugd->grid_append_idler = ecore_idler_add(_ge_albums_append_grid_idler, ugd);
+ }
+
+ ge_dbg("Done ge_albums_sel_album");
+ return 0;
+}
+
+Evas_Object* ge_albums_create_ly(Evas_Object* parent)
+{
+ ge_dbg("");
+ GE_CHECK_NULL(parent);
+ Evas_Object* layout = ge_ui_load_edj(parent, GE_EDJ_FILE, GE_GRP_ALBUMVIEW);
+ GE_CHECK_NULL(layout);
+ evas_object_show (layout);
+
+ return layout;
+}
+
+int ge_albums_del_callbacks(ge_ugdata* ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+ if(ugd->albums_view)
+ {
+ ge_dbg("Delete albums callbacks!");
+ evas_object_smart_callback_del(ugd->albums_view, "selected", _ge_albums_selected);
+ evas_object_smart_callback_del(ugd->albums_view, "unselected", _ge_albums_unselected);
+ evas_object_smart_callback_del(ugd->albums_view, "clicked", _ge_albums_clicked);
+ evas_object_smart_callback_del(ugd->albums_view, "longpressed", _ge_albums_longpress);
+ evas_object_smart_callback_del(ugd->albums_view, "drag,start,up", _ge_albums_drag_up);
+ evas_object_smart_callback_del(ugd->albums_view, "drag,start,right", _ge_albums_drag_right);
+ evas_object_smart_callback_del(ugd->albums_view, "drag,start,down", _ge_albums_drag_down);
+ evas_object_smart_callback_del(ugd->albums_view, "drag,start,left", _ge_albums_drag_left);
+ evas_object_smart_callback_del(ugd->albums_view, "drag,stop", _ge_albums_drag_stop);
+ evas_object_smart_callback_del(ugd->albums_view, "realized", _ge_albums_realized);
+ }
+ return 0;
+}
+
+Evas_Object* ge_albums_create_view(ge_ugdata* ugd, Evas_Object* parent)
+{
+ ge_dbg("");
+ GE_CHECK_NULL(parent);
+ GE_CHECK_NULL(ugd);
+ GE_CHECK_NULL(ugd->cluster_list);
+
+ memset(gl_album_items, 0x00, GE_ALBUM_COVER_THUMB_NUM * sizeof(int));
+ gl_album_count = 0;
+
+ ge_get_ums_state(ugd);
+ if(ugd->ug_exit_mode || !ugd->cluster_list->clist ||
+ (eina_list_count(ugd->cluster_list->clist) == 0)) {
+ ge_dbgW("It's UMS mode or clusters list is empty!");
+ goto ALBUMS_FAILED;
+ }
+
+ double scale_factor = ugd->win_scale;
+ ge_dbg("Own scale facotr: %f, elm_config_scale_get =%f.", scale_factor, elm_config_scale_get());
+
+ Evas_Object *grid = elm_gengrid_add(parent);
+ GE_CHECK_NULL(grid);
+ elm_gengrid_item_size_set(grid,
+ (int)(GE_ALBUM_ITEM_WIDTH * scale_factor),
+ (int)(GE_ALBUM_ITEM_HEIGHT * scale_factor));
+ elm_gengrid_align_set(grid, 0.5, 0.0);
+ elm_gengrid_horizontal_set(grid, EINA_FALSE);
+ elm_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);
+
+ if(_ge_albums_create_album(ugd, grid) != 0)
+ {
+ ge_dbgW("Failed to append album items!");
+ evas_object_del(grid);
+ grid = NULL;
+
+ goto ALBUMS_FAILED;
+ }
+ else
+ {
+ evas_object_show (grid);
+ }
+
+ evas_object_smart_callback_add(grid, "selected", _ge_albums_selected, NULL);
+ evas_object_smart_callback_add(grid, "unselected", _ge_albums_unselected, NULL);
+ evas_object_smart_callback_add(grid, "clicked", _ge_albums_clicked, NULL);
+ evas_object_smart_callback_add(grid, "longpressed", _ge_albums_longpress, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,up", _ge_albums_drag_up, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,right", _ge_albums_drag_right, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,down", _ge_albums_drag_down, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,left", _ge_albums_drag_left, NULL);
+ evas_object_smart_callback_add(grid, "drag,stop", _ge_albums_drag_stop, NULL);
+ evas_object_smart_callback_add(grid, "realized", _ge_albums_realized, NULL);
+
+ return grid;
+
+ALBUMS_FAILED:
+ /* Show no contents if none albums exist */
+ ge_dbgW("@@@@@@@ To create nocontents view @@@@@@@@");
+ ugd->nocontents = ge_ui_create_nocontents(ugd);
+ ugd->albums_view = ugd->nocontents;
+ evas_object_show (ugd->nocontents);
+
+ return ugd->nocontents;
+}
+
+int ge_albums_update_view(ge_ugdata *ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+ GE_CHECK_VAL(ugd->cluster_list, -1);
+ /* Changed to show no contents if needed */
+ ge_get_ums_state(ugd);
+ if(ugd->ug_exit_mode || !ugd->cluster_list->clist ||
+ (eina_list_count(ugd->cluster_list->clist) == 0)) {
+ ge_dbgW("It's UMS mode or clusters list is empty!");
+ goto ALBUMS_FAILED;
+ }
+
+ if(ugd->nocontents && ugd->nocontents == ugd->albums_view) {
+ /* It is nocontents, unset it first then create albums view*/
+ evas_object_del(ugd->nocontents);
+ ugd->nocontents = NULL;
+
+ ugd->albums_view = ge_albums_create_view(ugd, ugd->navi_bar);
+ GE_CHECK_VAL(ugd->albums_view, -1);
+ elm_object_part_content_set(ugd->albums_view_ly, "contents",
+ ugd->albums_view);
+ evas_object_show(ugd->albums_view);
+ } else {
+ if(_ge_albums_create_album(ugd, ugd->albums_view) != 0)
+ goto ALBUMS_FAILED;
+ }
+
+ return 0;
+
+ALBUMS_FAILED:
+
+ if(ugd->albums_view && ugd->albums_view != ugd->nocontents)
+ ge_albums_del_callbacks(ugd);
+
+ evas_object_del(ugd->albums_view);
+
+ ge_dbgW("@@@@@@@ To create nocontents view @@@@@@@@");
+ ugd->nocontents = ge_ui_create_nocontents(ugd);
+ ugd->albums_view = ugd->nocontents;
+ GE_CHECK_VAL(ugd->albums_view, -1);
+ evas_object_show(ugd->albums_view);
+
+ elm_object_part_content_set(ugd->albums_view_ly, "contents", ugd->albums_view);
+ return -1;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include "ge-debug.h"
+#include "ge-ui-util.h"
+#include "ge-util.h"
+#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);
+ Evas_Object *btn = NULL;
+ GE_CHECK_NULL(parent);
+
+ btn = elm_button_add(parent);
+ GE_CHECK_NULL(btn);
+
+ switch (mode) {
+ case GE_BUT_OK:
+ elm_object_text_set(btn,
+ (char*)_GE_GETSYSTEMSTR("IDS_COM_SK_OK"));
+ break;
+ case GE_BUT_CANCEL:
+ elm_object_text_set(btn,
+ (char*)_GE_GETSYSTEMSTR("IDS_COM_SK_CANCEL"));
+ break;
+ default:
+ break;
+ }
+
+ if (cb_func)
+ evas_object_smart_callback_add(btn, "clicked", cb_func, data);
+
+ return btn;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <media-svc.h>
+#include <visual-svc.h>
+#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;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include "ge-debug.h"
+
+#ifdef _USE_LOG_FILE_
+static char _g_file_path[GE_DB_FILE_LEN_MAX] = { 0, };
+#endif
+
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <app_service.h>
+#include "ge-ext-ug-load.h"
+#include "ge-debug.h"
+#include "ge-ui-util.h"
+#include "ge-util.h"
+#include "ge-albums.h"
+#include "ge-gridview.h"
+
+#define GE_IV_UG_NAME "image-viewer-efl"
+
+static bool ge_destroy_me = false;
+
+static void _ge_ext_destroy_me(ge_ugdata *ugd)
+{
+ ge_dbg("");
+ GE_CHECK(ugd);
+ GE_CHECK(ugd->ug_called_by_me);
+ GE_CHECK(ugd->ug);
+ GE_CHECK(ugd->bundle);
+ bool send_result = false;
+
+ if (_ge_ug_iv_get())
+ {
+ _ge_ug_iv_set(false);
+ }
+
+ if(ge_destroy_me == false)
+ {
+ ug_destroy(ugd->ug_called_by_me);
+ ugd->ug_called_by_me = NULL;
+ }
+ if(ugd->file_select_mode == GE_File_Select_Setas)
+ {
+ 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);
+
+ free(ugd->file_setas_image_path);
+ ugd->file_setas_image_path = NULL;
+ send_result = true;
+ }
+
+ 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);
+
+ free(ugd->file_setas_crop_image_path);
+ ugd->file_setas_crop_image_path = NULL;
+ send_result = true;
+ }
+
+ if(send_result)
+ {
+ ge_dbg("Call ug_send_result() to send result.");
+ ug_send_result(ugd->ug, ugd->bundle);
+ }
+ }
+
+ if(ge_destroy_me)
+ {
+ ge_dbg("Seting is appllied, destroy gallery UG.");
+ ge_destroy_me = false;
+ ug_destroy_me(ugd->ug);//close selection ug
+ ugd->ug_called_by_me = NULL;
+ }
+ else
+ {
+ ge_dbg("Cancel button tapped, back to thumbnails view.");
+ }
+}
+
+static void _ge_ext_iv_layout_cb(struct ui_gadget *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)
+ {
+ ug_destroy(ug);
+ return;
+ }
+
+ ge_ugdata *ugd = (ge_ugdata *)priv;
+
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(ugd->win, base);
+ evas_object_show(base);
+}
+
+static void _ge_ext_iv_result_cb(struct ui_gadget *ug, bundle *result, void *priv)
+{
+ ge_dbg("");
+ GE_CHECK(priv);
+ GE_CHECK(result);
+ ge_ugdata *ugd = (ge_ugdata *)priv;
+ const char* path = NULL;
+
+ if(ugd->file_select_mode == GE_File_Select_Setas)
+ {
+ path = bundle_get_val(result, GE_IMAGEVIEWER_IMAGE_PATH);
+ ge_dbg("SETAS_IMAGE_PATH");
+ ge_destroy_me = true;
+ if(path)
+ {
+ ge_dbg(":%s", path);
+ ugd->file_setas_image_path = strdup(path);
+ }
+
+ if(ugd->file_select_setas_mode == GE_File_Select_Setas_CallerID)
+ {
+ path = bundle_get_val(result, GE_IMAGEVIEWER_CROP_IMAGE_PATH);
+ ge_dbg("CALLERID_CROP_IMAGE_PATH");
+ if(path)
+ {
+ ge_dbg(":%s", path);
+ ugd->file_setas_crop_image_path = strdup(path);
+ }
+ }
+ }
+
+ const char *error_state = bundle_get_val(result, GE_IMAGEVIEWER_RETURN_ERROR);
+ if (error_state)
+ {
+ ge_dbg("error string : %s", error_state);
+
+ if (!g_strcmp0(error_state, "not_supported_file_type")) {
+ ge_destroy_me = FALSE;
+ ge_item* cur_item = _ge_get_current_item();
+ if(cur_item == NULL || cur_item->item == NULL ||
+ cur_item->item->file_url == NULL) {
+ ge_dbgE("current item is NULL");
+ return;
+ }
+ service_h service;
+ service_create(&service);
+ GE_CHECK(service);
+ service_set_operation(service, SERVICE_OPERATION_VIEW);
+ service_set_uri(service, cur_item->item->file_url);
+ service_send_launch_request(service, NULL, NULL);
+ service_destroy(service);
+ }
+ }
+}
+
+static void _ge_ext_iv_destroy_cb(struct ui_gadget *ug, void *priv)
+{
+ ge_dbg("");
+ GE_CHECK(priv);
+ ge_ugdata *ad = (ge_ugdata *) priv;
+
+ _ge_ext_destroy_me(ad);
+}
+
+int ge_ext_load_iv_ug(ge_ugdata* ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+
+ struct ug_cbs cbs;
+ struct ui_gadget* ug = NULL;
+ bundle* param = NULL;
+
+ if(ugd->ug_called_by_me)
+ {
+ ge_dbg("Already exits some UG called by me");
+ return -1;
+ }
+
+ ge_item* cur_item = _ge_get_current_item();
+ if(cur_item == NULL || cur_item->item == NULL)
+ {
+ ge_dbg("current item is NULL");
+ return -1;
+ }
+ memset(&cbs,0x00,sizeof(struct ug_cbs));
+ cbs.layout_cb = _ge_ext_iv_layout_cb;
+ cbs.result_cb = _ge_ext_iv_result_cb;
+ cbs.destroy_cb = _ge_ext_iv_destroy_cb;
+ cbs.priv = ugd;
+
+ param = bundle_create();
+ GE_CHECK_VAL(param, -1);
+
+ _ge_ug_iv_set(true);
+
+ bundle_add(param, "View Mode", "SETAS" );
+ bundle_add(param, "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_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);
+ free(ugd->file_setas_homescreen_path);
+ ugd->file_setas_homescreen_path = NULL;
+ }
+
+ 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);
+ 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");
+ 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);
+ free(ugd->file_setas_callid_size);
+ ugd->file_setas_callid_size = NULL;
+ }
+
+ 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);
+ 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);
+ ugd->ug_called_by_me = ug;
+ bundle_free(param);
+
+ return 0;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include "ge-debug.h"
+#include "ge-gridview.h"
+#include "ge-ui-util.h"
+#include "ge-util.h"
+#include "ge-ext-ug-load.h"
+#include "ge-db-handler.h"
+#include "ge-strings.h"
+
+/* Icon swallowed to part "elm.swallow.icon" */
+#define GE_GRID_ICON_SIZE 156
+#define GE_ITEM_MOUSE_UP_DISTANCE_X 20
+#define GE_ITEM_MOUSE_UP_DISTANCE_Y 20
+#define GE_GIRD_ICON_CLICK_TIME_DELAY 0.01f
+
+static Elm_Gengrid_Item_Class gic;
+static int ge_grid_item_cnt = 0;
+
+typedef struct
+{
+ Evas_Coord x;
+ Evas_Coord y;
+ bool b_pressed;
+}ge_grid_touch_info;
+
+static ge_grid_touch_info ge_touch_info;
+
+static void _ge_grid_drag_up(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_drag_right(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_drag_down(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_drag_left(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_drag_stop(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_selected(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_unselected(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_longpress(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+}
+
+static void _ge_grid_sel(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+ GE_CHECK(data);
+ if(_ge_get_view_mode() != GE_ThumbnailView_Mode)
+ {
+ //ge_dbgE("EditMode.. now return.");
+ return;
+ }
+ else
+ {
+ ge_dbg("ViewMode");
+ }
+
+ ge_item* gitem = (ge_item*)data;
+ GE_CHECK(gitem->item);
+ GE_CHECK(gitem->ugd);
+ ge_ugdata* ugd = gitem->ugd;
+
+ if(gitem->item->file_url == NULL || strlen(gitem->item->file_url) <= 0)
+ {
+ ge_dbgE("file_url is invalid!");
+ return;
+ }
+ else
+ {
+ ge_dbg("file_url: %s.", gitem->item->file_url);
+ }
+
+ if(ugd->file_select_mode == GE_File_Select_Setas)//imageviewer only supprot image type while setting wallpaper
+ {
+ if(gitem->item->type == MINFO_ITEM_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)
+ {
+ 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)
+ {
+ _ge_set_current_item(gitem);
+ ge_dbg("Loading UG-IMAGE(VIDEO)-VIEWER");
+ ge_ext_load_iv_ug(ugd);
+ }
+}
+
+static void _ge_grid_icon_clicked(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+ GE_CHECK(data);
+ _ge_grid_sel(data, obj, event_info);
+}
+
+static void _ge_grid_item_mouse_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down*)event_info;
+ if(ev)
+ {
+ GE_CHECK(data);
+ GE_CHECK(obj);
+ ge_item *gitem = (ge_item *)data;
+ GE_CHECK(gitem->ugd);
+ ge_ugdata *ugd = gitem->ugd;
+
+ ge_touch_info.x = ev->output.x;
+ ge_touch_info.y = ev->output.y;
+
+ if(ugd->ug_called_by_me == NULL)
+ {
+ edje_object_signal_emit(_EDJ(obj), "mouse,down,shrink", "bg");
+ ge_touch_info.b_pressed = true;
+ }
+ }
+}
+
+static void _ge_grid_shrink_resp_cb(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ ge_dbg("");
+ GE_CHECK(obj);
+ GE_CHECK(data);
+ ge_item *gitem = (ge_item *)data;
+ GE_CHECK(gitem->ugd);
+ _ge_grid_icon_clicked(data, obj, NULL);
+
+ edje_object_signal_callback_del(obj, "shrink,expand,done", "bg", _ge_grid_shrink_resp_cb);
+}
+
+static void _ge_grid_item_mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ GE_CHECK(obj);
+ Evas_Event_Mouse_Up *ev = event_info;
+
+ if(!ev)
+ {
+ goto RET_WO_EXEC;
+ }
+
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD || ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL)
+ {
+ goto RET_WO_EXEC;
+ }
+ if((abs(ge_touch_info.x - ev->output.x) > GE_ITEM_MOUSE_UP_DISTANCE_X) || (abs(ge_touch_info.y - ev->output.y) > GE_ITEM_MOUSE_UP_DISTANCE_Y))
+ {
+ goto RET_WO_EXEC;
+ }
+
+ ge_dbg("");
+
+ if(ge_touch_info.b_pressed)
+ {
+ edje_object_signal_emit(_EDJ(obj), "mouse,up,expand", "bg");
+ edje_object_signal_callback_add(_EDJ(obj), "shrink,expand,done", "bg", _ge_grid_shrink_resp_cb, data);
+ ge_touch_info.b_pressed = false;
+ }
+ return;
+
+RET_WO_EXEC:
+ if(ge_touch_info.b_pressed)
+ {
+ edje_object_signal_emit(_EDJ(obj), "mouse,up,expand", "bg");
+ ge_touch_info.b_pressed = false;
+ }
+}
+
+static void _ge_grid_check_changed(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+ GE_CHECK(obj);
+ GE_CHECK(data);
+ ge_item *gitem = (ge_item *)data;
+ GE_CHECK(gitem->item);
+ GE_CHECK(gitem->item->file_url);
+ GE_CHECK(gitem->ugd);
+ ge_ugdata *ugd = gitem->ugd;
+
+ if(_ge_get_view_mode() != GE_ThumbnailEdit_Mode)
+ return;
+
+ 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);
+ /* 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);
+ ug_destroy_me(ugd->ug);
+ }
+ else
+ {
+ ge_dbg("Append:%s", gitem->item->file_url);
+ ge_db_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 );
+ }
+
+ if(ugd->file_select_mode != GE_File_Select_One)
+ {
+ gitem->checked = checked;
+ ge_ui_create_selinfo(ugd, ugd->thumbs_view_ly);
+ }
+}
+
+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;
+
+ if(strlen(part) <= 0)
+ {
+ ge_dbgE("part length <= 0");
+ return NULL;
+ }
+
+ gitem = (ge_item*)data;
+ GE_CHECK_NULL(gitem->item);
+ GE_CHECK_NULL(gitem->ugd);
+ ge_ugdata *ugd = gitem->ugd;
+
+ 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;
+ }
+ else
+ {
+ bk_len = g_list_length(gitem->item->meta_info->video_info->bookmarks);
+ }
+
+ if(bk_len)
+ {
+ elm_layout_theme_set(layout, "gengrid", "photoframe", "default_layout_video_bookmark");
+ }
+ 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);
+ }
+ }
+ 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);
+ }
+
+ 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);
+
+ return layout;
+ }
+ else if (!strcmp(part, "elm.swallow.end") && (_ge_get_view_mode() == GE_ThumbnailEdit_Mode))
+ {
+ Evas_Object* ck = NULL;
+
+ ck = elm_check_add(obj);
+ GE_CHECK_NULL(ck);
+ elm_object_style_set(ck, GE_CHECKBOX_STYLE_GRID);
+ evas_object_propagate_events_set(ck, 0);
+
+ gitem->check_obj = ck;
+ elm_check_state_set(ck, gitem->checked);
+
+ evas_object_smart_callback_add(ck, "changed", _ge_grid_check_changed, data);
+ evas_object_show(ck);
+
+ return ck;
+ }
+
+ return NULL;
+}
+
+static bool _ge_grid_create_thumb(ge_ugdata* ugd, Evas_Object* parent)
+{
+ ge_dbg("");
+ GE_CHECK_FALSE(parent);
+ GE_CHECK_FALSE(ugd);
+ int i = 0;
+ ge_item* gitem = NULL;
+ int cnt = ge_db_get_count_all();
+ int item_cnt = 0;
+ ge_dbg("List count : %d", cnt);
+
+ gic.item_style = "thumbnail_view";
+ gic.func.text_get = NULL;
+ gic.func.content_get = _ge_grid_get_content;
+
+ elm_gengrid_clear(parent);
+ if(ugd->th)
+ {
+ elm_object_theme_set(parent, ugd->th);
+ }
+ elm_object_style_set(parent, "gallery_efl/default");
+
+ for(i = 1; i <= cnt; i++)
+ {
+ ge_db_get_item_by_index(&gitem, i);
+ if(gitem == NULL || gitem->item == NULL ||
+ gitem->item->uuid == NULL) {
+ ge_dbgE("Invalid gitem, continue...");
+ continue;
+ }
+
+ if(!gitem->item->file_url)
+ {
+ ge_db_del_media_id(ugd, gitem->item->uuid);
+ ge_db_item_list_remove(gitem);
+ --i;
+ --cnt;
+ continue;
+ }
+
+ 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_dbg("item or file doesn't exist, remove it...");
+ ge_db_selected_list_remove(gitem);
+ ge_db_item_list_remove(gitem);
+
+ if(new_item)
+ {
+ ge_db_destroy_mtype_item(new_item);
+ new_item = NULL;
+ }
+ --i;
+ --cnt;
+ continue;
+ }
+
+ if(new_item)
+ {
+ ge_db_destroy_mtype_item(new_item);
+ new_item = NULL;
+ }
+ }
+
+ gitem->elm_item = elm_gengrid_item_append(parent, &gic, gitem, _ge_grid_sel, gitem);
+ gitem->check_obj = NULL;
+ item_cnt++;
+
+ }
+
+ elm_gengrid_select_mode_set(parent, ELM_OBJECT_SELECT_MODE_NONE);
+ ge_grid_item_cnt = item_cnt;
+ if(item_cnt == 0)
+ {
+ return EINA_FALSE;
+ }
+ else
+ {
+ return EINA_TRUE;
+ }
+}
+
+Evas_Object* ge_grid_create_ly(Evas_Object* parent)
+{
+ ge_dbg("");
+ GE_CHECK_NULL(parent);
+ Evas_Object* layout = NULL;
+
+ layout = ge_ui_load_edj(parent, GE_EDJ_FILE, GE_GRP_GRIDVIEW);
+ GE_CHECK_NULL(layout);
+ evas_object_show (layout);
+
+ return layout;
+}
+
+int ge_grid_del_callbacks(ge_ugdata *ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+ if(ugd->thumbs_view)
+ {
+ ge_dbg("Delete thumbnails callbacks!");
+ evas_object_smart_callback_del(ugd->thumbs_view, "selected", _ge_grid_selected);
+ evas_object_smart_callback_del(ugd->thumbs_view, "unselected", _ge_grid_unselected);
+ evas_object_smart_callback_del(ugd->thumbs_view, "clicked", _ge_grid_clicked);
+ evas_object_smart_callback_del(ugd->thumbs_view, "longpressed", _ge_grid_longpress);
+ evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,up", _ge_grid_drag_up);
+ evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,right", _ge_grid_drag_right);
+ evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,down", _ge_grid_drag_down);
+ evas_object_smart_callback_del(ugd->thumbs_view, "drag,start,left", _ge_grid_drag_left);
+ evas_object_smart_callback_del(ugd->thumbs_view, "drag,stop", _ge_grid_drag_stop);
+ }
+ return 0;
+}
+
+/*
+* When select album, show first (GE_FIRST_VIEW_END_POS+1) medias.
+* Then use idler to get other medias from DB and appened
+* them to gridview.
+* In order to reduce transit time of first show of thumbnails view.
+* Cause most of time is spent for getting records from DB,
+* so we get first (GE_FIRST_VIEW_END_POS+1) items and show thumbnails view,
+* it will accelerate view show.
+*/
+int ge_grid_idler_append_thumbs(void* data)
+{
+ GE_CHECK_VAL(data, -1);
+ ge_ugdata *ugd = (ge_ugdata *)data;
+ GE_CHECK_VAL(ugd->thumbs_view, -1);
+ int i = 0;
+ int item_cnt = 0;
+ ge_item* gitem = NULL;
+ /* Get all medias count of current album */
+ int cnt = ge_db_get_count_all();
+ int ret = -1;
+ ge_cluster* cur_album = _ge_get_current_album();
+ GE_CHECK_VAL(cur_album, -1);
+ GE_CHECK_VAL(cur_album->cluster, -1);
+ ge_dbg("First view medias count: %d;", cnt);
+
+ if(cnt != (GE_FIRST_VIEW_END_POS+1))
+ {
+ ge_dbg("No any more items, return!");
+ return -1;
+ }
+ /* Get other items from DB */
+ ret = ge_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!");
+ return ret;
+ }
+
+ cnt = ge_db_get_count_all();
+ ge_dbg("Grid view all medias count: %d", cnt);
+
+
+ /* From (GL_FIRST_VIEW_END_POS + 2)th item to last one */
+ i = GE_FIRST_VIEW_END_POS + 2;
+
+ for(; i <= cnt; i++)
+ {
+ ge_db_get_item_by_index(&gitem, i);
+ if(gitem == NULL || gitem->item == NULL ||
+ gitem->item->uuid == NULL) {
+ ge_dbgE("Invalid gitem, continue...");
+ continue;
+ }
+
+ if(!gitem->item->file_url)
+ {
+ ge_dbg("file_url is invalid.");
+ ge_db_del_media_id(ugd, gitem->item->uuid);
+ ge_db_selected_list_remove(gitem);
+ ge_db_item_list_remove(gitem);
+ cnt--;
+ i--;
+ gitem = NULL;
+ continue;
+ }
+
+ gitem->elm_item = elm_gengrid_item_append(ugd->thumbs_view, &gic, gitem, _ge_grid_sel, gitem);
+ item_cnt++;
+ }
+
+ ge_dbg("\n\n<<<<<<<<Use idler to append other medias--Done<<<<<<<<<\n");
+ if(item_cnt == 0)
+ {
+ return -1;
+ }
+ else
+ {
+ ge_grid_item_cnt = item_cnt + GE_FIRST_VIEW_END_POS + 1;
+ ge_dbg("All count appended: %d", ge_grid_item_cnt);
+ return 0;
+ }
+}
+
+Evas_Object* ge_grid_create_view(ge_ugdata* ugd, Evas_Object *parent)
+{
+ ge_dbg("");
+ GE_CHECK_NULL(parent);
+ GE_CHECK_NULL(ugd);
+ int item_w = 0;
+ int item_h = 0;
+ int icon_size = 0;
+ Evas_Object *grid = elm_gengrid_add(parent);
+ GE_CHECK_NULL(grid);
+ double scale_factor = ugd->win_scale;
+ item_w = (int)(GE_GRID_ITEM_SIZE_W * scale_factor);
+ item_h = (int)(GE_GRID_ITEM_SIZE_H * scale_factor);
+ icon_size = (int)(GE_GRID_ICON_SIZE * scale_factor);
+ ge_dbg("Own scale: %f, elm_config_scale_get =%f", scale_factor, elm_config_scale_get());
+
+ if(!_ge_grid_create_thumb(ugd, grid)) {
+ evas_object_del(grid);
+ grid = NULL;
+
+ ugd->nocontents = ge_ui_create_nocontents(ugd);
+ evas_object_show (ugd->nocontents);
+
+ return ugd->nocontents;
+ } else {
+ ge_dbg("ge_grid_item_cnt : %d", ge_grid_item_cnt);
+ if(ge_grid_item_cnt == GE_GRID_ITEM_ZOOM_LEVEL_01_CNT) {
+ item_w *= GE_GRID_ITEM_ZOOM_LEVEL_01;
+ item_h *= GE_GRID_ITEM_ZOOM_LEVEL_01;
+ icon_size *= GE_GRID_ITEM_ZOOM_LEVEL_01;
+ } else if(ge_grid_item_cnt <= GE_GRID_ITEM_ZOOM_LEVEL_02_CNT) {
+ item_w *= GE_GRID_ITEM_ZOOM_LEVEL_02;
+ item_h *= GE_GRID_ITEM_ZOOM_LEVEL_02;
+ icon_size *= GE_GRID_ITEM_ZOOM_LEVEL_02;
+ }
+
+ ugd->icon_size = icon_size;
+ evas_object_show (grid);
+ }
+
+
+ elm_gengrid_item_size_set(grid, item_w, item_h);
+ ge_dbg("Gengrid item w: %d, h: %d.", item_w, item_h);
+ elm_gengrid_align_set(grid, 0.5, 0.0);
+ elm_gengrid_horizontal_set(grid, EINA_FALSE);
+ elm_gengrid_bounce_set(grid, EINA_FALSE, EINA_TRUE);
+ elm_gengrid_multi_select_set(grid, EINA_TRUE);
+
+ evas_object_smart_callback_add(grid, "selected", _ge_grid_selected, NULL);
+ evas_object_smart_callback_add(grid, "unselected", _ge_grid_unselected, NULL);
+ evas_object_smart_callback_add(grid, "clicked", _ge_grid_clicked, NULL);
+ evas_object_smart_callback_add(grid, "longpressed", _ge_grid_longpress, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,up", _ge_grid_drag_up, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,right", _ge_grid_drag_right, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,down", _ge_grid_drag_down, NULL);
+ evas_object_smart_callback_add(grid, "drag,start,left", _ge_grid_drag_left, NULL);
+ evas_object_smart_callback_add(grid, "drag,stop", _ge_grid_drag_stop, NULL);
+ evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ return grid;
+}
+
+int ge_grid_clear_view(ge_ugdata *ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+ if(ugd->file_select_mode == GE_File_Select_One)
+ {
+ bundle_del(ugd->bundle, GE_FILE_SELECT_RETURN_PATH);
+ }
+
+ if(ugd->thumbs_view)
+ {
+ if(ugd->thumbs_nocontents != ugd->thumbs_view)
+ ge_grid_del_callbacks(ugd);
+
+ evas_object_del(ugd->thumbs_view);
+ ugd->thumbs_view = NULL;
+ ugd->thumbs_nocontents = NULL;
+ ugd->thumbs_nf_it = NULL;
+ }
+
+ return 0;
+}
+int ge_grid_update_view(ge_ugdata *ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+ if(_ge_grid_create_thumb(ugd, ugd->thumbs_view) == EINA_FALSE) {
+ ge_grid_del_callbacks(ugd);
+ } else {
+ double scale_factor = ugd->win_scale;
+ int item_w = (int)(GE_GRID_ITEM_SIZE_W * scale_factor);
+ int item_h = (int)(GE_GRID_ITEM_SIZE_H * scale_factor);
+ int icon_size = (int)(GE_GRID_ICON_SIZE * scale_factor);
+
+ ge_dbg("ge_grid_item_cnt : %d", ge_grid_item_cnt);
+ if(ge_grid_item_cnt == GE_GRID_ITEM_ZOOM_LEVEL_01_CNT) {
+ item_w *= GE_GRID_ITEM_ZOOM_LEVEL_01;
+ item_h *= GE_GRID_ITEM_ZOOM_LEVEL_01;
+ icon_size *= GE_GRID_ITEM_ZOOM_LEVEL_01;
+ } else if(ge_grid_item_cnt <= GE_GRID_ITEM_ZOOM_LEVEL_02_CNT) {
+ item_w *= GE_GRID_ITEM_ZOOM_LEVEL_02;
+ item_h *= GE_GRID_ITEM_ZOOM_LEVEL_02;
+ icon_size *= GE_GRID_ITEM_ZOOM_LEVEL_02;
+ }
+
+ ugd->icon_size = icon_size;
+ elm_gengrid_item_size_set(ugd->thumbs_view, item_w, item_h);
+ }
+
+ return 0;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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-strings.h"
+
+
+#define HOME_ALBUM_COVER_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
+
+static void _ge_ui_response_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("event_info: %d", (int)event_info);
+ GE_CHECK(data);
+ ge_ugdata *ugd = (ge_ugdata *)data;
+ ge_dbg("popup mode: %d", ugd->popup_mode);
+
+ if(ugd->popup_mode == GE_Popup_UgExit)
+ {
+ ug_destroy_me(ugd->ug);
+ }
+
+ evas_object_del(ugd->popup);
+ ugd->popup = NULL;
+}
+
+static Eina_Bool __ge_popup_timeout_cb(void *data)
+{
+ GE_CHECK_FALSE(data);
+ ge_ugdata *ugd = (ge_ugdata *)data;
+ if (ugd->del_timer) {
+ ecore_timer_del(ugd->del_timer);
+ ugd->del_timer = NULL;
+ }
+
+ if (ugd->popup) {
+ evas_object_del(ugd->popup);
+ ugd->popup = NULL;
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int __ge_popup_add_timer(void *data, double to_inc)
+{
+ GE_CHECK_VAL(data, -1);
+ ge_ugdata *ugd = (ge_ugdata *)data;
+ if (ugd->del_timer) {
+ ecore_timer_del(ugd->del_timer);
+ ugd->del_timer = NULL;
+ }
+
+ ugd->del_timer = ecore_timer_add(to_inc, __ge_popup_timeout_cb, data);
+ return 0;
+}
+
+static void __ge_ui_done_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+ GE_CHECK(data);
+ ge_ugdata *ugd = (ge_ugdata *)data;
+ int i;
+
+ 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();
+
+ if(sel_cnt == 0)
+ {
+ ge_dbg("No thumbs selected, return!");
+ ge_ui_create_popup(ugd, GE_Popup_NoButton, GE_POPUP_NO_FILES_SELECTED);
+ return;
+ }
+
+ 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)
+ {
+ 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, ';');
+ }
+ }
+ int str_len = strlen(selected_path->str);
+ ge_dbg("path string length = %d", str_len);
+ g_string_truncate(selected_path, str_len - 1);
+
+ filepath_arg = g_string_free(selected_path, false);
+
+ char t_str[32] = {0,};
+ eina_convert_itoa(sel_cnt, t_str);
+
+ 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);
+
+ if(filepath_arg)
+ {
+ g_free(filepath_arg);
+ filepath_arg = NULL;
+ }
+ }
+
+ ge_db_selected_list_finalize();
+
+ ug_destroy_me(ugd->ug);
+ }
+}
+
+static void _ge_ui_selinfo_destroy_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ GE_CHECK(data);
+ ge_ugdata *ad = (ge_ugdata *)data;
+
+ ge_ui_destroy_selinfo(ad);
+}
+
+static int __ge_ui_disable_done_item(ge_ugdata *ugd, bool disabled)
+{
+ ge_dbg("Disable Done item(%d)?", disabled);
+ GE_CHECK_VAL(ugd, -1);
+ 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);
+ GE_CHECK_VAL(cbar, -1);
+ Elm_Object_Item *cbar_it = NULL;
+ cbar_it = elm_toolbar_first_item_get(cbar);
+ GE_CHECK_VAL(cbar_it, -1);
+ elm_object_item_disabled_set(cbar_it, disabled);
+ return 0;
+}
+
+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;
+
+ 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_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);
+
+ ug_destroy_me(ugd->ug);
+}
+
+static void _ge_ui_back_to_albums_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ ge_dbg("");
+ GE_CHECK(data);
+ ge_ugdata *ugd = (ge_ugdata *)data;
+
+ ge_albums_back_to_view(ugd);
+}
+
+int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent,
+ Evas_Object* obj, NaviTitleMode mode,
+ char* title)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+ GE_CHECK_VAL(parent, -1);
+ GE_CHECK_VAL(obj, -1);
+ GE_CHECK_VAL(title, -1);
+ Elm_Object_Item *nf_it = NULL;
+
+ if (mode == AlbumsView_Title) {
+ ge_dbg("AlbumsView_Title");
+ /* Add cancel button */
+ Evas_Object *cancel_btn = NULL;
+ cancel_btn = elm_button_add(obj);
+ GE_CHECK_VAL(cancel_btn, -1);
+ if(ugd->th)
+ elm_object_theme_set(cancel_btn, ugd->th);
+ elm_object_style_set(cancel_btn, GE_BUTTON_STYLE_NAVIBAR_PRE);
+ evas_object_smart_callback_add(cancel_btn, "clicked",
+ _ge_ui_destroy_me_cb, ugd);
+ nf_it = elm_naviframe_item_push(parent, title, cancel_btn, NULL,
+ obj, NULL);
+ } else if(mode == ThumbnailView_Title) {
+ if(ugd->file_select_mode == GE_File_Select_None) {
+ ge_dbgE("file_select_mode == GE_File_Select_None!");
+ return -1;
+ }
+
+ ge_dbg("ThumbnailView_Title");
+ nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj,
+ NULL);
+ /* Set pre_btn style to back button */
+ Evas_Object *back_btn = NULL;
+ back_btn = elm_object_item_part_content_get(nf_it,
+ GE_NAVIFRAME_PREB_BTN);
+ if(ugd->th)
+ elm_object_theme_set(back_btn, ugd->th);
+ elm_object_style_set(back_btn, GE_BUTTON_STYLE_NAVIBAR_PRE);
+ evas_object_smart_callback_add(back_btn, "clicked",
+ _ge_ui_back_to_albums_cb, ugd);
+
+ /**
+ * Add 'Done' item.
+ */
+ if ((ugd->file_select_mode != GE_File_Select_One) &&
+ (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) {
+ ge_dbg("Multiple selection, show Done");
+ /* create tool controlbar downside */
+ Evas_Object *bot_bar = NULL;
+ bot_bar = elm_toolbar_add(parent);
+ 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,
+ ugd);
+ elm_object_item_disabled_set(done_it, EINA_TRUE);
+ /* add empty item */
+ done_it = elm_toolbar_item_append(bot_bar, NULL, NULL,
+ NULL, NULL);
+ elm_object_item_disabled_set(done_it, EINA_TRUE);
+ done_it = elm_toolbar_item_append(bot_bar, NULL, NULL, NULL,
+ NULL);
+ elm_object_item_disabled_set(done_it, EINA_TRUE);
+ done_it = elm_toolbar_item_append(bot_bar, NULL, NULL, NULL,
+ NULL);
+ elm_object_item_disabled_set(done_it, EINA_TRUE);
+ /* Set tool bar to bottom */
+ elm_object_item_part_content_set(nf_it,
+ GE_NAVIFRAME_CONTROLBAR,
+ bot_bar);
+ }
+ ugd->thumbs_nf_it = nf_it;
+ }
+
+ return 0;
+}
+
+Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *group)
+{
+ GE_CHECK_NULL(parent);
+ GE_CHECK_NULL(file);
+ GE_CHECK_NULL(group);
+ Evas_Object *eo;
+ int r;
+
+ eo = elm_layout_add(parent);
+ if (eo)
+ {
+ r = elm_layout_file_set(eo, file, group);
+ if (!r)
+ {
+ evas_object_del(eo);
+ return NULL;
+ }
+
+ evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ }
+
+ return eo;
+}
+
+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",
+ (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.");
+ }
+ } else {
+ snprintf(label_str, sizeof(label_str), "%s<br>%s",
+ (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_CONTENTS")),
+ (char*)GE_UNABLE_USE_IN_UMS_MODE);
+ }
+
+ ge_dbg("\nNocontents label: %s", label_str);
+ /* Full nocontents view layout */
+ layout = elm_layout_add(ugd->navi_bar);
+ GE_CHECK_NULL(layout);
+ elm_object_part_text_set(layout, "elm.text", label_str);
+ elm_layout_theme_set(layout, "layout", "nocontents", "gallery_efl");
+
+ return layout;
+}
+
+Evas_Object* ge_ui_create_main_ly(ge_ugdata* ugd, Evas_Object* parent)
+{
+ GE_CHECK_NULL(ugd);
+ GE_CHECK_NULL(parent);
+ Evas_Object *layout = NULL;
+
+ layout = elm_layout_add(parent);
+ GE_CHECK_NULL(layout);
+
+ elm_layout_theme_set(layout, "layout", "application", "default");
+ evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(parent, layout);
+ evas_object_show(layout);
+
+ return layout;
+}
+
+Evas_Object* ge_ui_create_navibar(ge_ugdata* ugd, Evas_Object* parent)
+{
+ GE_CHECK_NULL(ugd);
+ GE_CHECK_NULL(parent);
+ Evas_Object *navi_bar = NULL;
+
+ navi_bar = elm_naviframe_add(parent);
+ GE_CHECK_NULL(navi_bar);
+
+ if(ugd->th)
+ {
+ elm_object_theme_set(navi_bar, ugd->th);
+ }
+ elm_object_style_set(navi_bar, GE_NAVIFRAME_STYLE_DEFAULT);
+ elm_object_part_content_set(parent, "elm.swallow.content", navi_bar);
+
+ evas_object_show(navi_bar);
+
+ return navi_bar;
+}
+
+Evas_Object *ge_ui_create_popup(ge_ugdata* ugd, GE_PopupMode mode, char* desc)
+{
+ ge_dbg("");
+ GE_CHECK_NULL(ugd);
+ GE_CHECK_NULL(desc);
+
+ if(ugd->popup)
+ {
+ ge_dbg("The existed popup is deleted");
+ evas_object_del(ugd->popup);
+ ugd->popup = NULL;
+ }
+
+ Evas_Object *popup = NULL;
+
+ popup = elm_popup_add(ugd->ly_main);
+ GE_CHECK_NULL(popup);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(popup, desc);
+
+ switch (mode) {
+ case GE_Popup_NoButton:
+ case GE_Popup_UgExit:
+ __ge_popup_add_timer(ugd, GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY);
+ break;
+ case GE_Popup_OneButton:
+ {
+ Evas_Object *btn = NULL;
+ btn = _ge_but_create_but(popup, GE_BUT_OK, _ge_ui_response_cb,
+ ugd);
+ elm_object_part_content_set(popup, "button1", btn);
+ break;
+ }
+ case GE_Popup_TwoButton:
+ {
+ Evas_Object *btn1 = NULL;
+ btn1 = _ge_but_create_but(popup, GE_BUT_OK, _ge_ui_response_cb,
+ ugd);
+ elm_object_part_content_set(popup, "button1", btn1);
+ Evas_Object *btn2 = NULL;
+ btn2 = _ge_but_create_but(popup, GE_BUT_CANCEL,
+ _ge_ui_response_cb, ugd);
+ elm_object_part_content_set(popup, "button2", btn2);
+ break;
+ }
+ default:
+ ge_dbgE("mode is not supported...");
+ break;
+ }
+
+ evas_object_show(popup);
+
+ ugd->popup = popup;
+ ugd->popup_mode = mode;
+
+ return popup;
+}
+
+int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+ GE_CHECK_VAL(parent, -1);
+ int count = 1;
+ int all_count = 0;
+ char text[GE_SELINFO_TEXT_LEN_MAX] = {0,};
+
+ count = ge_db_selected_list_count();
+ if(count <= 0)
+ {
+ __ge_ui_disable_done_item(ugd, true);
+ if(ugd->file_select_mode == GE_File_Select_Multiple)
+ {
+ ge_ui_destroy_selinfo(ugd);
+ }
+ ge_dbg("@@@[Warning] no item selected@@@");
+ return -1;
+ }
+
+ __ge_ui_disable_done_item(ugd, false);
+
+ if(ugd->file_select_mode == GE_File_Select_One)
+ {
+ return -1;
+ }
+
+ all_count = ge_db_get_count_all();
+ ge_dbg("New count , all count : %d,%d", count, all_count);
+
+ ge_ui_destroy_selinfo(ugd);
+ ugd->selectioninfo = elm_notify_add(parent);
+ GE_CHECK_VAL(ugd->selectioninfo, -1);
+ elm_notify_orient_set(ugd->selectioninfo, ELM_NOTIFY_ORIENT_BOTTOM);
+ evas_object_size_hint_weight_set(ugd->selectioninfo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(ugd->selectioninfo, EVAS_HINT_FILL, EVAS_HINT_FILL);
+
+ evas_object_smart_callback_add(ugd->selectioninfo, "timeout", _ge_ui_selinfo_destroy_cb, ugd);
+ elm_notify_timeout_set(ugd->selectioninfo, GE_SELINFO_HIDE_TIME_DELAY);
+
+ ugd->selectioninfo_ly = elm_layout_add(parent);
+ GE_CHECK_VAL(ugd->selectioninfo_ly, -1);
+ if(ugd->th)
+ {
+ elm_object_theme_set(ugd->selectioninfo_ly, ugd->th);
+ }
+ elm_layout_theme_set(ugd->selectioninfo_ly, "standard", "selectioninfo", "ug_selectioninfo_viewer");
+
+ 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 */
+ snprintf(text, sizeof(text), "%s (%d)", GE_SELINFO_SELECTED, count);
+ text[strlen(text)] = '\0';
+
+ edje_object_signal_emit(_EDJ(ugd->thumbs_view_ly), "elm,thumb_view,state,moveup", "elm");/* move view up while selection view shown.*/
+ edje_object_part_text_set(_EDJ(ugd->selectioninfo_ly), "elm.text", text);
+ evas_object_show(ugd->selectioninfo);
+
+ return 0;
+}
+
+int ge_ui_destroy_selinfo(ge_ugdata* ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+ GE_CHECK_VAL(ugd->thumbs_view_ly, -1);
+
+ edje_object_signal_emit(_EDJ(ugd->thumbs_view_ly), "elm,thumb_view,state,default", "elm");/* reset view to default status.*/
+ if(ugd->file_select_mode != GE_File_Select_One && ugd->selectioninfo)
+ {
+ evas_object_smart_callback_del(ugd->selectioninfo, "timeout", _ge_ui_selinfo_destroy_cb);
+ }
+
+ if(ugd->selectioninfo_ly)
+ {
+ evas_object_del(ugd->selectioninfo_ly);
+ ugd->selectioninfo_ly = NULL;
+ }
+
+ if(ugd->selectioninfo)
+ {
+ evas_object_del(ugd->selectioninfo);
+ ugd->selectioninfo = NULL;
+ }
+
+ return 0;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of libug-gallery-efl
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <sys/stat.h>
+#include <errno.h>
+#include "ge-debug.h"
+#include "ge-albums.h"
+#include "ge-gridview.h"
+#include "ge-db-handler.h"
+#include "ge-util.h"
+#include "ge-ui-util.h"
+
+#define GE_TIMER_INTERVAL_UMS_UPDATE 2.0
+
+/* Global evas objects, which is used in the entire application */
+
+static ge_item* ge_current_mb_item;
+static ge_cluster* ge_current_album_item;
+static int ge_ug_iv_enter = 0;
+
+ge_item* _ge_get_current_item(void)
+{
+ return ge_current_mb_item;
+}
+
+void _ge_set_current_item(ge_item* gitem)
+{
+ ge_current_mb_item = gitem;
+}
+
+ge_cluster* _ge_get_current_album(void)
+{
+ return ge_current_album_item;
+}
+
+void _ge_set_current_album(ge_cluster* album_item)
+{
+ ge_current_album_item = album_item;
+}
+
+int _ge_ug_iv_get(void)
+{
+ return ge_ug_iv_enter;
+}
+
+void _ge_ug_iv_set(int ug_iv_state)
+{
+ ge_ug_iv_enter = ug_iv_state;
+}
+
+static int _ge_refresh_albums_list(ge_ugdata *ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+ ge_cluster* old_cur_cluster = _ge_get_current_album();
+ char cluster_id[GE_MTYPE_ITEN_ID_LEN_MAX] = { 0, };
+ int i = 0;
+ ge_cluster *current = NULL;
+ bool b_get_cur_album = false;
+
+ if(old_cur_cluster && old_cur_cluster->cluster &&
+ old_cur_cluster->cluster->uuid)
+ {
+ g_strlcpy(cluster_id, old_cur_cluster->cluster->uuid,
+ GE_MTYPE_ITEN_ID_LEN_MAX);
+ b_get_cur_album = true;
+ }
+ else
+ {
+ ge_dbg("None album selected, current album is unavailable\n");
+ }
+ ge_db_get_clusters_list(ugd);
+
+ GE_CHECK_VAL(ugd->cluster_list, -1);
+ int length = eina_list_count(ugd->cluster_list->clist);
+ ge_dbg("album length: %d, current album id: %s", length, cluster_id);
+
+ //need to reset current cluster
+ _ge_set_current_album(NULL);
+ if(b_get_cur_album)
+ {
+ for (i = 0; i < length; i++)
+ {
+ current = eina_list_nth(ugd->cluster_list->clist, i);
+ if(current && current->cluster &&
+ current->cluster->uuid) {
+ ge_dbg("current album : %s", current->cluster->display_name);
+ } else {
+ ge_dbgE("Current is NULL");
+ break;
+ }
+ if(!g_strcmp0(current->cluster->uuid, cluster_id))
+ {
+ ge_db_update_items_list(ugd, current);
+ ugd->cluster_list->cur_pos = i;
+ _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();
+ }
+
+ return -1;
+}
+
+static void _ge_db_update_noti_cb(keynode_t *key, void* data)
+{
+ ge_dbgW("VCONFKEY_FILEMANAGER_DB_STATUS changed!");
+ GE_CHECK(data);
+ ge_ugdata* ugd = (ge_ugdata*)data;
+ int mmc_state = -1;
+ int mode = GE_UPDATE_NONE;
+
+ vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc_state);
+ if(mmc_state == -1) {
+ ge_dbgE("vconf_get_int failed!");
+ return;
+ }
+
+ if (mmc_state == VCONFKEY_SYSMAN_MMC_MOUNTED) {
+ ge_dbg("mmc_state[%d]: VCONFKEY_SYSMAN_MMC_MOUNTED", mmc_state);
+ mode = GE_UPDATE_MMC_ADDED;
+ } else if (mmc_state == VCONFKEY_SYSMAN_MMC_REMOVED ||
+ mmc_state == VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED) {
+ ge_dbg("mmc_state[%d]: VCONFKEY_SYSMAN_MMC_REMOVED", mmc_state);
+ mode = GE_UPDATE_MMC_REMOVED;
+ }
+
+ 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);
+ GE_CHECK_FALSE(ugd);
+ int view_mode = _ge_get_view_mode();
+ ge_dbg("view_mode: %d", view_mode);
+
+ if (view_mode == GE_AlbumsView_Mode)
+ {
+ _ge_refresh_albums_list(ugd);
+ ge_albums_update_view(ugd);
+ }
+ else if (view_mode == GE_ThumbnailView_Mode)
+ {
+ _ge_refresh_albums_list(ugd);
+ if(_ge_get_current_album() == NULL)
+ {
+ ge_dbg("current album is empty, back to albums view!");
+ ge_albums_back_to_view(ugd);
+ elm_naviframe_item_pop(ugd->navi_bar);
+
+ return EINA_FALSE;
+ }
+
+ ge_grid_update_view(ugd);
+ }
+ else if (view_mode == GE_ThumbnailEdit_Mode)
+ {
+ ge_cluster* cur_album = _ge_get_current_album();
+
+ /* MMC removed */
+ if(mode == GE_UPDATE_MMC_REMOVED && cur_album &&
+ cur_album->cluster &&
+ cur_album->cluster->type == MINFO_MMC) {
+ ge_dbgW("MMC album, change to albums view!");
+ _ge_refresh_albums_list(ugd);
+ ge_albums_back_to_view(ugd);
+ elm_naviframe_item_pop(ugd->navi_bar);
+ return EINA_FALSE;
+ }
+
+ /* Update albums list and items list */
+ _ge_refresh_albums_list(ugd);
+ if(ge_db_get_count_all() <= 0) {
+ ge_dbgW("current album is empty, back to albums view!");
+ ge_albums_back_to_view(ugd);
+ elm_naviframe_item_pop(ugd->navi_bar);
+ return EINA_FALSE;
+ }
+
+ ge_grid_update_view(ugd);
+
+ if(ge_db_get_count_all() <= 0) {
+ ge_dbgW("current album is empty, back to albums view!");
+ ge_albums_back_to_view(ugd);
+ elm_naviframe_item_pop(ugd->navi_bar);
+ return EINA_FALSE;
+ }
+ }
+
+ return EINA_TRUE;
+}
+
+int ge_reg_db_update_noti(ge_ugdata* ugd)
+{
+ ge_dbg("");
+ GE_CHECK_VAL(ugd, -1);
+ int error_code = 0;
+
+ error_code = vconf_notify_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS,
+ _ge_db_update_noti_cb, ugd);
+ if(error_code == -1)
+ ge_dbgE("vconf_notify_key_changed FAIL!");
+
+ return 0;
+}
+
+int ge_dereg_db_update_noti(void)
+{
+ ge_dbg("");
+ int error_code = -1;
+
+ error_code = vconf_ignore_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS,
+ _ge_db_update_noti_cb);
+ if(error_code == -1)
+ ge_dbgE("vconf_ignore_key_changed FAIL!");
+
+ return 0;
+}
+
+int ge_reg_ums_noti(ge_ugdata* ugd)
+{
+ GE_CHECK_VAL(ugd, -1);
+ int error_code = 0;
+
+ 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!");
+ }
+
+ return 0;
+}
+
+int ge_dereg_ums_noti(void)
+{
+ int error_code = -1;
+
+ 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!");
+
+ return 0;
+}
+
+int ge_get_ums_state(ge_ugdata* ugd)
+{
+ 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;
+ }
+ }
+
+ ugd->ug_exit_mode = exit_mode;
+ return 0;
+}
+
+
--- /dev/null
+Name=Gallery
+Name[en_US] = Gallery
+Name[nl_NL] = Galerij
+Name[de_DE] = Galerie
+Name[zh_HK] = 媒體
+Name[zh_CN] = 相册
+Name[ru_RU] = Галерея
+Name[zh_TW] = 相簿
+Name[ja_JP] = ギャラリー
+Name[es_ES] = Galeria
+Name[el_GR] = Συλλογή
+Name[it_IT] = Galleria
+Name[tr_TR] = Galeri
+Name[pt_PT] = Galeria
+Name[fr_FR] = Galerie
+Name[ko_KR] = 갤러리
+Exec=/opt/apps/org.tizen.gallery/bin/gallery
+Icon=org.tizen.gallery.png
+Type=Application
+Version=0.3.0-1
+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-removable=false
--- /dev/null
+%define _optdir /opt
+%define _appdir %{_optdir}/apps
+%define _ugdir %{_optdir}/ug
+
+Name: org.tizen.gallery
+Summary: org.tizen.gallery UX
+Version: 1.0.31
+Release: 1
+Group: Applications
+License: Samsung Proprietary License
+Source0: %{name}-%{version}.tar.gz
+BuildRequires: cmake
+BuildRequires: gettext-tools
+BuildRequires: edje-tools
+BuildRequires: pkgconfig(appcore-efl)
+BuildRequires: pkgconfig(elementary)
+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(gthread-2.0)
+BuildRequires: pkgconfig(appsvc)
+BuildRequires: pkgconfig(devman_haptic)
+BuildRequires: pkgconfig(capi-appfw-application)
+
+%description
+Description: org.tizen.gallery UX
+
+
+%package -n libug-gallery-efl
+Summary: gallery UG
+Group: TO_BE/FILLED_IN
+Requires: %{name} = %{version}-%{release}
+
+%description -n libug-gallery-efl
+Description: gallery UG
+
+
+%prep
+%setup -q
+
+%build
+
+cmake . -DCMAKE_INSTALL_PREFIX=%{_appdir}/org.tizen.gallery
+
+make %{?jobs:-j%jobs}
+
+%install
+%make_install
+
+%find_lang gallery
+%find_lang ug-gallery-efl
+
+%post
+chown -R 5000:5000 %{_appdir}/org.tizen.gallery/data
+
+%files -f gallery.lang
+%{_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/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
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+/* 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"
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#define FONT_ROM "HelveticaNeue:style=Roman"
+#define FONT_MED "HelveticaNeue: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 ENTRY_H 112
+#define ENTRY_MAX_W 1280
+#define CONTROLBAR_LARGE_HEIGHT_INC 117
+#define CONTROLBAR_SMALL_HEIGHT_INC 98
+
+#include "gallery-edc-res.h"
+
+collections {
+#include "gl-selection-notification.edc"
+#include "gl-genlist-item-video.edc"
+#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"
+
+ group {
+ name: "gallery/view_layout";
+ parts {
+ part {
+ name: "background";
+ type, RECT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; offset: 0 0; }
+ rel2 { relative: 1.0 1.0; offset: -1 -1; }
+ color, 0 0 0 0 ;
+ }
+
+ }
+
+ part {
+ name: "selectall_bg";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 112;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 0.0; to: "background"; }
+ rel2 { relative: 1.0 0.0; to: "background"; }
+ color: 0 0 0 0;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 37 37 37 153;
+ }
+ description {
+ state: "visible_video" 0.0;
+ inherit: "default" 0.0;
+ min: 0 VIDEO_SELECT_ALL_ITEM_H;
+ color: 37 37 37 153;
+ }
+ }
+ part {
+ name: "selectall_bottom_line";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 2;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 1.0; to: "selectall_bg"; }
+ rel2 { relative: 1.0 0.0; to: "background"; }
+ color: 0 0 0 0;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: GENLIST_PART_BOTTOM_LINE_COLOR_VIDEO;
+ }
+ description {
+ state: "visible_video" 0.0;
+ inherit: "default" 0.0;
+ color: GENLIST_PART_BOTTOM_LINE_COLOR_VIDEO;
+
+ }
+ }
+ part {
+ name: "selectall_check_leftpadding";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 16 0;
+ fixed: 1 0;
+ align: 0.0 0.0;
+
+ color: 0 0 0 255;
+ visible: 0;
+ rel1 { relative: 0.0 0.0; to: "selectall_bg"; }
+ rel2 { relative: 0.0 1.0; to: "selectall_bg"; }
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+
+ }
+
+ }
+
+ part {
+ name: "selectall_check";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ fixed: 1 1;
+ min: 42 42;
+ rel1 { relative: 1.0 0.0; to: "selectall_check_leftpadding"; }
+ rel2 { relative: 1.0 1.0; to: "selectall_check_leftpadding"; }
+ visible : 0;
+
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+
+ }
+
+ part {
+ name: "selectall_check_rightpadding";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 16 0;
+ fixed: 1 0;
+ align: 0.0 0.0;
+ color: 0 0 0 0;
+ rel1 { relative: 1.0 0.0; to: "selectall_check"; }
+ rel2 { relative: 1.0 1.0; to: "selectall_check"; }
+ visible: 0;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+
+ }
+
+ part {
+ name: "selectall_text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 0.0; to: "selectall_check_rightpadding"; }
+ rel2 { relative: 1.0 1.0; to: "selectall_bg"; }
+ color: 255 255 255 255;
+ text {
+ font: "Helvetica Neue:style=Medium";
+ size: 44;
+ text: "";
+ align: 0.0 0.5;
+ }
+ visible: 0;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+
+ part {
+ name: "selectall_inner";
+ type: RECT;
+ mouse_events: 0;
+ scale: 1;
+
+ description {
+ state: "defalut" 0.0;
+ min: 0 1;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 1.0; to: "selectall_bg"; }
+ rel2 { relative: 1.0 1.0; to: "selectall_bottom_line"; }
+ color: 90 90 90 0;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ }
+ }
+ part {
+ name: "elm.padding.selinfo";
+ type: RECT;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ min: 0 SELINFO_H; // bottom padding size for selectioninfo
+ fixed: 0 1;
+ align: 0.5 1.0;
+ rel1 { relative: 0.0 1.0; }
+ rel2 { relative: 1.0 1.0; }
+ color: 0 0 0 0;
+ visible: 0;
+ }
+ }
+ part {
+ name: "elm.swallow.view";
+ type: SWALLOW;
+ mouse_events: 1;
+ description {
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 1.0 1.0; }
+ }
+ description { //edit thumbnails view
+ state: "thumb_edit_default" 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;
+ 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"; }
+ }
+ }
+ }
+
+ programs
+ {
+ program {
+ name: "selectall_show_after";
+ action: STATE_SET "visible" 0.0;
+ target: "selectall_check_leftpadding";
+ target: "selectall_check";
+ target: "selectall_check_rightpadding";
+ target: "selectall_text";
+ target: "selectall_inner";
+ }
+ program {
+ name: "selectall_show";
+ signal: "selectall_show";
+ source: "elm";
+ action: STATE_SET "visible" 0.0;
+ target: "selectall_bg";
+ target: "selectall_bottom_line";
+ after: "selectall_show_after";
+ }
+ program {
+ name: "selectall_show_video";
+ signal: "selectall_show_video";
+ source: "elm";
+ action: STATE_SET "visible_video" 0.0;
+ target: "selectall_bg";
+ target: "selectall_bottom_line";
+ after: "selectall_show_after";
+ }
+ program {
+ name: "selectall_hide";
+ signal: "selectall_hide";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "selectall_bg";
+ target: "selectall_bottom_line";
+ target: "selectall_check_leftpadding";
+ target: "selectall_check";
+ target: "selectall_check_rightpadding";
+ target: "selectall_text";
+ target: "selectall_inner";
+ }
+ //emit signal to set checkbox state in .c codes
+ program { name: "selectall_bg_click2";
+ signal: "mouse,clicked,1";
+ source: "selectall_bg";
+ action: SIGNAL_EMIT "elm,action,click" "selectall_bg";
+ }
+
+ program {
+ name: "swallow_view_default";
+ signal: "elm,swallow_view,state,default";
+ source: "elm";
+ script {
+ set_state(PART:"elm.swallow.view", "default", 0.0);
+ }
+ }
+ program {
+ name: "swallow_view_thumb_edit_default";
+ signal: "elm,swallow_view,state,thumb_edit_default";
+ source: "elm";
+ script {
+ set_state(PART:"elm.swallow.view", "thumb_edit_default", 0.0);
+ }
+ }
+ program {
+ name: "swallow_view_moveup_view";
+ signal: "elm,swallow_view,state,moveup_view";
+ 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);
+ }
+ }
+ }
+
+ }
+
+//edit field layout
+ group {
+ name: "gallery/entry";
+ parts{
+ part {
+ name: "bg";
+ type: RECT;
+ mouse_events: 1;
+ scale:1;
+
+ description {
+ state: "default" 0.0;
+ color: GALLERY_EDC_COLOR_BG;
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 1.0;
+ }
+ }
+ part {
+ name: "bg_entry";
+ type: RECT;
+ mouse_events: 0;
+ scale:1;
+
+ description {
+ state: "default" 0.0;
+ min: 0 ENTRY_H;//0 112 //0 76
+ max: ENTRY_MAX_W ENTRY_H;//1280 112 //800 76
+ fixed:1 1;
+ rel1 { relative: 0.0 0.0; to: "bg";}
+ rel2 { relative: 1.0 0.0; to: "bg"; offset: 0 ENTRY_H;} //112 64
+ color: 0 0 0 0; //Fixme, set bg transparent.
+ //color: 255 255 255 255;
+ align: 0 0;
+ }
+ }
+ part {
+ name: "botton_line";
+ type: RECT;
+ mouse_events: 0;
+ scale:1;
+
+ description {
+ min : 0 1; //minimum size for gap filler
+ fixed: 1 1;
+ state: "default" 0.0;
+ rel1 { relative: 0.0 1.0; to: "bg_entry";}
+ rel2 { relative: 1.0 1.0; to: "bg_entry"; offset: 0 1;}
+ color: 82 82 82 255;
+ align: 0 0;
+ }
+ }
+ part {
+ name: "entry_part";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale:1;
+
+ description {
+ min : 0 56; //minimum size for gap filler
+ max: 5000 56;
+ fixed: 1 1;
+ state: "default" 0.0;
+ rel1 { relative: 0.0 0.0; to: "bg_entry"; offset: 10 0;}
+ rel2 { relative: 1.0 (56/76); to: "bg_entry"; offset: -12 0;}
+ align: 0 0;
+ }
+ }
+ }
+ }
+
+ group { name: "gallery/segment_layout";
+ parts {
+ part { name: "bg";
+ type: RECT;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ }
+ }
+ part { name: "segment";
+ type: SWALLOW;
+ mouse_events: 1;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ //min: 493 74;
+ min: 460 74;
+ max: 876 74;
+ align: 0.0 0.5;
+ rel1 { relative: 0.0 0.0; to: "bg"; }
+ rel2 { relative: 1.0 1.0; to: "bg"; }
+ }
+ }
+ }
+ }
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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"
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#define CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 42 42
+
+#define CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC 255 255 255 255
+#define CHECK_DEFAULT_TEXT_PRESSED_COLOR_INC 255 255 255 255
+#define CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC 136 136 136 136
+
+////////////////////////////////////////////////////////////////////////////////////////
+//
+// check default textblock style
+//
+///////////////////////////////////////////////////////////////////////////////////////
+ styles {
+ style { name: "check_label_textblock_style";
+ base: "font=HelveticaNeue:style=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: "whitecolor" "+ color=#ffffff";
+ tag: "tab" "\t";
+ }
+ }
+
+#define CHECK_STATE_DEFAULT 0
+#define CHECK_STATE_VISIBLE 1
+#define CHECK_STATE_DISABLED_VISIBLE 2
+#define CHECK_STATE_DISABLED 3
+
+////////////////////////////////////////////////////////////////////////////////
+#define CHECK_STYLE_DEFAULT(style_name, image_bg, image_checking, min_width, min_height) \
+ group { name: "elm/check/base/"style_name; \
+ images { \
+ image: image_bg COMP; \
+ image: GALLERY_EDC_IMAGE_CHECK_BG_DIM COMP; \
+ image: image_checking COMP; \
+ } \
+ script { \
+ public check_state = CHECK_STATE_DEFAULT; \
+ } \
+ parts { \
+ part { name: "back_bg"; \
+ type: RECT; \
+ mouse_events: 1; \
+ 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; \
+ visible: 1; \
+ 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"; } \
+ align: 0.5 0.5; \
+ visible: 1; \
+ 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"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.offset: 1 1; \
+ rel2.to_x: "bg"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.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) \
+ group { \
+ name: "elm/check/base/"style_name; \
+ images { \
+ image: image_grid COMP; \
+ } \
+ parts { \
+ 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; \
+ color: 0 0 0 0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "pressed" 0.0; \
+ inherit: "default" 0.0; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 0; \
+ } \
+ } \
+ part { name: "icon_bg_img"; \
+ type: RECT; \
+ mouse_events: 0; \
+ scale : 1; \
+ description { \
+ color: 0 0 0 0; \
+ rel1 { relative: GAP_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: 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"; \
+ type: RECT; \
+ mouse_events: 0; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ rel1.to: "icon_bg"; \
+ rel2.to: "icon_bg"; \
+ align: 0.5 0.5; \
+ min: width height; \
+ max: width height; \
+ color: 0 0 0 0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "pressed" 0.0; \
+ inherit: "default" 0.0; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 0; \
+ } \
+ } \
+ part { \
+ name: "selected_bg"; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ rel1.to: "icon_bg"; \
+ rel2.to: "icon_bg"; \
+ color: 0 0 0 0; \
+ visible: 0; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ color: 0 0 0 153; \
+ visible: 1; \
+ } \
+ } \
+ part { \
+ name: "check"; \
+ mouse_events: 0; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ rel1.to: "bg2"; \
+ rel2.to: "bg2"; \
+ visible: 0; \
+ image.normal: image_grid; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "pressed" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ description { \
+ state: "disabled_visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ } \
+ part { \
+ name: "elm.swallow.content"; \
+ type: SWALLOW; \
+ description { \
+ state: "default" 0.0; \
+ fixed: 1 0; \
+ visible: 0; \
+ color: 255 255 255 255; \
+ align: 0.0 0.5; \
+ rel1.to_x: "bg2"; \
+ rel1.relative: 1.0 0.0; \
+ rel1.offset: 1 1; \
+ rel2.to_x: "bg2"; \
+ rel2.relative: 1.0 1.0; \
+ rel2.offset: 2 -2; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ fixed: 1 1; \
+ visible: 1; \
+ aspect: 1.0 1.0; \
+ aspect_preference: VERTICAL; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ color: 128 128 128 128; \
+ } \
+ description { \
+ state: "disabled_visible" 0.0; \
+ inherit: "default" 0.0; \
+ color: 128 128 128 128; \
+ fixed: 1 1; \
+ visible: 1; \
+ aspect: 1.0 1.0; \
+ } \
+ } \
+ part { \
+ name: "elm.text"; \
+ type: TEXTBLOCK; \
+ mouse_events: 0; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ visible: 0; \
+ fixed: 0 1; \
+ rel1 { relative: 1.0 0.5; offset: 1 1; to_x: "elm.swallow.content"; } \
+ rel2 { relative: 1.0 0.5; offset: -2 -2; } \
+ color: 255 255 255 255; \
+ align: 0.0 0.5; \
+ text { \
+ style: "check_label_textblock_style"; \
+ min: 0 0; \
+ } \
+ color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
+ } \
+ description { \
+ state: "visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ text.min: 1 1; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ } \
+ description { \
+ state: "disabled_visible" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ text.min: 1 1; \
+ color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
+ } \
+ } \
+ part { \
+ name: "events"; \
+ type: RECT; \
+ ignore_flags: ON_HOLD; \
+ description { \
+ state: "default" 0.0; \
+ color: 0 0 0 0; \
+ } \
+ } \
+ part { \
+ name: "disabler"; \
+ type: RECT; \
+ description { \
+ state: "default" 0.0; \
+ color: 0 0 0 0; \
+ visible: 0; \
+ } \
+ description { \
+ state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ visible: 1; \
+ } \
+ } \
+ } \
+ programs { \
+ program { \
+ name: "click"; \
+ signal: "mouse,up,1"; \
+ source: "events"; \
+ action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
+ after: "bg_normal"; \
+ } \
+ program { \
+ name: "bg_normal"; \
+ script { \
+ set_state(PART:"bg", "default", 0.0); \
+ set_state(PART:"bg2", "default", 0.0); \
+ } \
+ } \
+ program { \
+ name: "mouseout"; \
+ signal: "mouse,out"; \
+ source: "events"; \
+ after: "bg_check_normal"; \
+ } \
+ program { \
+ name: "bg_check_normal"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "pressed")) \
+ set_state(PART:"check", "visible", 0.0); \
+ set_state(PART:"bg", "default", 0.0); \
+ set_state(PART:"bg2", "default", 0.0); \
+ } \
+ } \
+ program { \
+ name: "pressed"; \
+ signal: "mouse,down,1"; \
+ source: "events"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"check", "pressed", 0.0); \
+ set_state(PART:"bg", "pressed", 0.0); \
+ set_state(PART:"bg2", "pressed", 0.0); \
+ } \
+ } \
+ program { \
+ name: "check_on"; \
+ signal: "elm,state,check,on"; \
+ source: "elm"; \
+ action: STATE_SET "visible" 0.0; \
+ target: "check"; \
+ target: "selected_bg"; \
+ } \
+ program { \
+ name: "check_off"; \
+ signal: "elm,state,check,off"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "check"; \
+ target: "selected_bg"; \
+ } \
+ program { \
+ name: "text_show"; \
+ signal: "elm,state,text,visible"; \
+ source: "elm"; \
+ action: STATE_SET "visible" 0.0; \
+ target: "elm.text"; \
+ } \
+ program { \
+ name: "text_hide"; \
+ signal: "elm,state,text,hidden"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "elm.text"; \
+ } \
+ program { \
+ name: "icon_show"; \
+ signal: "elm,state,icon,visible"; \
+ source: "elm"; \
+ action: STATE_SET "visible" 0.0; \
+ target: "elm.swallow.content"; \
+ } \
+ program { \
+ name: "icon_hide"; \
+ signal: "elm,state,icon,hidden"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "elm.swallow.content"; \
+ } \
+ program { \
+ name: "disable"; \
+ signal: "elm,state,disabled"; \
+ source: "elm"; \
+ action: STATE_SET "disabled" 0.0; \
+ target: "disabler"; \
+ target: "bg"; \
+ target: "bg2"; \
+ after: "disable_text"; \
+ } \
+ program { \
+ name: "disable_text"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"elm.text", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"elm.text", "disabled_visible", 0.0); \
+ else \
+ set_state(PART:"elm.text", "disabled", 0.0); \
+ get_state(PART:"elm.swallow.content", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
+ else \
+ set_state(PART:"elm.swallow.content", "disabled", 0.0); \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"check", "disabled_visible", 0.0); \
+ } \
+ } \
+ program { \
+ name: "enable"; \
+ signal: "elm,state,enabled"; \
+ source: "elm"; \
+ action: STATE_SET "default" 0.0; \
+ target: "disabler"; \
+ target: "bg"; \
+ target: "bg2"; \
+ after: "enable_text"; \
+ } \
+ program { \
+ name: "enable_text"; \
+ script { \
+ new st[31]; \
+ new Float:vl; \
+ get_state(PART:"elm.text", st, 30, vl); \
+ if (!strcmp(st, "disabled_visible")) \
+ set_state(PART:"elm.text", "visible", 0.0); \
+ else \
+ set_state(PART:"elm.text", "default", 0.0); \
+ get_state(PART:"elm.swallow.content", st, 30, vl); \
+ if (!strcmp(st, "visible")) \
+ set_state(PART:"elm.swallow.content", "visible", 0.0); \
+ else \
+ set_state(PART:"elm.swallow.content", "default", 0.0); \
+ get_state(PART:"check", st, 30, vl); \
+ if (!strcmp(st, "disabled_visible")) \
+ set_state(PART:"check", "visible", 0.0); \
+ } \
+ } \
+ } \
+ }
+
+////////////////////////////////////////////////////////////////////////////////
+ CHECK_STYLE_GRID("gallery/grid", GALLERY_EDC_IMAGE_CHECK_GRID, 64, 64)
+
+#undef CHECK_STATE_DEFAULT
+#undef CHECK_STATE_VISIBLE
+#undef CHECK_STATE_DISABLED_VISIBLE
+#undef CHECK_STATE_DISABLED
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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";
+ }
+ }
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+/* 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_NAME_H 32
+#define ALBUM_TEXT_DATE_H 25
+#define ALBUM_TEXT_Y 60
+
+#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/gallery/albums_view/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_bg 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;
+ 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;
+ }
+ }
+ 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 { /* Set album cover dimmed if album selected */
+ name: "elm.checkbox.cover_dim";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ max: ALBUM_ICON_W ALBUM_ICON_H;
+ rel1 { relative: 0.0 0.0; to: "icon_bg"; }
+ rel2 { relative: 1.0 1.0; to: "icon_bg"; offset: 0 1; }
+ color: 0 0 0 153;
+ }
+ description {
+ state: "show" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ }
+ }
+ 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"; }
+ }
+ }
+ }
+
+ 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 {
+ name: "show_text_bg";
+ signal: "show,text,bg";
+ source: "edit_text_bg";
+ script {
+ set_state(PART:"edit_text_bg", "show", 0.0);
+ }
+ }
+ program { /* Show dimmed cover */
+ name: "cover_dim";
+ signal: "elm,checkbox,cover_dim,show";
+ source: "elm";
+ script {
+ set_state(PART:"elm.checkbox.cover_dim", "show", 0.0);
+ }
+ }
+ program { /* Hide dimmed cover */
+ name: "cover_normal";
+ signal: "elm,checkbox,cover_dim,hide";
+ source: "elm";
+ script {
+ set_state(PART:"elm.checkbox.cover_dim", "default", 0.0);
+ }
+ }
+ 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);
+ }
+ }
+ }
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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";
+ }
+ }
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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_DISCLIP_COLOR_INC 255 255 255 110 // alpha was 64
+
+#define GENLIST_PART_BASE( param_item_height ) \
+ part { name: "base"; \
+ type: RECT; \
+ repeat_events: 1; \
+ scale: 1; \
+ description { state: "default" 0.0; \
+ min: 0 param_item_height; \
+ color: 0 0 0 0; \
+ } \
+ }
+
+#define GENLIST_PART_BG_IMAGE \
+ part { name: "bg_image"; \
+ type: RECT; \
+ clip_to: "disclip"; \
+ mouse_events: 0; \
+ description { state: "default" 0.0; \
+ color: GENLIST_PART_BG_UNSELECTED_COLOR_INC; \
+ } \
+ description { state: "selected" 0.0; \
+ inherit: "default" 0.0; \
+ color: GENLIST_PART_BG_SELECTED_COLOR_INC; \
+ } \
+ }
+
+#define GENLIST_PART_PADDING_TOP( param_padding_size ) \
+ part { name: "elm.padding.top"; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: 0 param_padding_size; \
+ fixed: 0 1; \
+ visible: 0; \
+ rel2.relative: 1.0 0.0; \
+ align: 0.0 0.0; \
+ } \
+ }
+
+#define GENLIST_PART_PADDING_BOTTOM( param_padding_size ) \
+ part { name: "elm.padding.bottom"; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: 0 param_padding_size; \
+ fixed: 0 1; \
+ visible: 0; \
+ rel1.relative: 0.0 1.0; \
+ align: 0.0 1.0; \
+ } \
+ }
+
+#define GENLIST_PART_PADDING_LEFT( param_padding_size ) \
+ part { name: "elm.padding.left"; \
+ type: RECT; \
+ scale: 1; \
+ description { \
+ state: "default" 0.0; \
+ min: param_padding_size 0; \
+ fixed: 1 0; \
+ visible: 0; \
+ rel2.relative: 0.0 1.0; \
+ align: 0.0 0.0; \
+ } \
+ }
+
+#define GENLIST_PART_PADDING_RIGHT( param_padding_size ) \
+ part { name: "elm.padding.right"; \
+ type: RECT; \
+ scale: 1; \
+ description { state: "default" 0.0; \
+ min: param_padding_size 0; \
+ fixed: 1 0; \
+ visible: 0; \
+ rel1.relative: 1.0 0.0; \
+ align: 1.0 0.0; \
+ } \
+ }
+
+#define GENLIST_PART_DISCLIP \
+ part { name: "disclip"; \
+ type: RECT; \
+ description { state: "default" 0.0; \
+ } \
+ description { state: "disabled" 0.0; \
+ inherit: "default" 0.0; \
+ color: GENLIST_PART_DISCLIP_COLOR_INC; \
+ } \
+ }
+
+#define GENLIST_PART_BOTTOM_LINE_VIDEO \
+ part { name: "bottom_line"; \
+ type: RECT; \
+ clip_to: "disclip"; \
+ mouse_events: 0; \
+ description { state: "default" 0.0; \
+ min: 0 1; \
+ fixed: 0 1; \
+ visible: 1; \
+ color: GENLIST_PART_BOTTOM_LINE_COLOR_VIDEO; \
+ rel1 { \
+ relative: 0.0 1.0; \
+ offset: 0 -1; \
+ } \
+ } \
+ }
+
+#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_FONT_TITLE 44
+#define VIDEO_FONT_DURATION 32
+
+#define VIDEO_SELECT_ALL_ITEM_H 150
+#define VIDEO_ITEM_H 160
+#define VIDEO_PAD_T 22
+#define VIDEO_PAD_B 32
+#define VIDEO_PAD_L 16
+#define VIDEO_PAD_R 16
+#define VIDEO_PAD_ICON_R 16
+#define VIDEO_PAD_ICON_L 16
+#define VIDEO_PAD_BOOKMARK_T 28
+#define VIDEO_BG_H 128
+#define VIDEO_BG_W 172
+#define VIDEO_GAP 2
+#define VIDEO_TITLE_H 64
+#define VIDEO_DURATION_H 48
+#define VIDEO_BOOKMARK_H 64
+#define VIDEO_BOOKMARK_W 64
+#define VIDEO_PROGRESSBAR_H 17
+#define VIDEO_PROGRESSBAR_W 64
+#define VIDEO_PLAY_H 38
+#define VIDEO_PLAY_W 38
+#define VIDEO_CHECKBOX_W 42
+#define VIDEO_CHECKBOX_H 42
+
+group { name: "elm/genlist/item/video_list/gallery/default";
+ alias: "elm/genlist/item_odd/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: "texts" "elm.text.title elm.text.duration";
+ data.item: "contents" "elm.icon elm.videoicon elm.bookmarkicon elm.progressbar_icon";
+
+ //data.item: "treesize" "20";
+ parts {
+ GENLIST_PART_BASE( VIDEO_ITEM_H )
+ GENLIST_PART_BG_IMAGE
+ GENLIST_PART_BOTTOM_LINE_VIDEO
+ GENLIST_PART_PADDING_TOP( VIDEO_PAD_T )
+ GENLIST_PART_PADDING_BOTTOM( VIDEO_PAD_B )
+ GENLIST_PART_PADDING_LEFT( VIDEO_PAD_L )
+ GENLIST_PART_PADDING_RIGHT( VIDEO_PAD_R )
+
+ part { name: "elm.padding.icon.right";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: VIDEO_PAD_ICON_R 0;
+ fixed: 1 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "elm.icon";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_x: "elm.icon";
+ }
+ color: 0 0 0 0;
+ align: 0.0 0.0;
+ }
+ }
+ part { name: "icon_bg";
+ clip_to: "disclip";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: VIDEO_BG_W VIDEO_BG_H;
+ max: VIDEO_BG_W VIDEO_BG_H;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ color: VIDEO_COLOR_GAP;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "elm.padding.left";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_x: "elm.padding.left";
+ }
+ }
+ }
+ part { name: "elm.icon";
+ clip_to: "disclip";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ rel1 {
+ relative: (VIDEO_GAP)/VIDEO_BG_W (VIDEO_GAP)/VIDEO_BG_H;
+ to: "icon_bg";
+ }
+ rel2 {
+ relative: (VIDEO_BG_W-VIDEO_GAP+1)/VIDEO_BG_W (VIDEO_BG_H-VIDEO_GAP+1)/VIDEO_BG_H;
+ to: "icon_bg";
+ }
+ }
+ }
+ part {
+ name: "elm.videoicon";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ max: VIDEO_PLAY_W VIDEO_PLAY_H;
+ align: 0.95 0.95;
+ 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;
+ description {
+ state: "default" 0.0;
+ min: 0 VIDEO_PAD_BOOKMARK_T;
+ fixed: 0 1;
+ visible: 0;
+ rel2.relative: 1.0 0.0;
+ align: 0.0 0.0;
+ }
+ }
+ part { name: "elm.bookmarkicon";
+ clip_to: "disclip";
+ scale: 1;
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: VIDEO_BOOKMARK_W VIDEO_BOOKMARK_H;
+ fixed: 1 1;
+ align: 1.0 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ to_x: "elm.padding.right";
+ to_y: "elm.padding.bookmark.top";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to_x: "elm.padding.right";
+ }
+ }
+ }
+ part { name: "elm.progressbar.icon";
+ clip_to: "disclip";
+ scale: 1;
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: VIDEO_PROGRESSBAR_W VIDEO_PROGRESSBAR_H;
+ fixed: 0 1;
+ align: 1.0 1.0;
+ rel1 {
+ relative: 0.0 1.0;
+ to_x: "elm.bookmarkicon";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to_x: "elm.bookmarkicon";
+ to_y: "elm.padding.bottom";
+ }
+ }
+ }
+ part { name: "elm.text.title";
+ clip_to: "disclip";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 VIDEO_TITLE_H;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to_x: "elm.padding.icon.right";
+ to_y: "elm.padding.top";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to_x: "elm.bookmarkicon";
+ to_y: "elm.padding.top";
+ }
+ color: VIDEO_COLOR_TITLE;
+ text {
+ font: "Helvetica Neue:style=Roman";
+ size: VIDEO_FONT_TITLE;
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part { name: "elm.text.duration";
+ clip_to: "disclip";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 VIDEO_DURATION_H;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to_x: "elm.padding.icon.right";
+ to_y: "elm.text.title";
+ }
+ rel2 {
+ relative: 0 1;
+ offset: 0 0;
+ to_x: "elm.padding.right";
+ to_y: "elm.text.title";
+ }
+ color: VIDEO_COLOR_DURATION;
+ text {
+ font: "Helvetica Neue:style=Medium";
+ size: VIDEO_FONT_DURATION;
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+
+ GENLIST_PART_DISCLIP
+ }
+ programs {
+ program { name: "go_active";
+ signal: "elm,state,selected";
+ source: "elm";
+ action: STATE_SET "selected" 0.0;
+ target: "bg_image";
+ }
+ program { name: "go_passive";
+ signal: "elm,state,unselected";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "bg_image";
+ transition: LINEAR 0.1;
+ }
+ program { name: "go_disabled";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "disclip";
+ }
+ program { name: "go_enabled";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "disclip";
+ }
+ }
+}
+
+
+group { name: "elm/genlist/item/video_list_edit/gallery/default";
+ alias: "elm/genlist/item_odd/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: "treesize" "20";
+ parts {
+ GENLIST_PART_BASE( VIDEO_ITEM_H )
+ GENLIST_PART_BG_IMAGE
+ GENLIST_PART_BOTTOM_LINE_VIDEO
+ GENLIST_PART_PADDING_TOP( VIDEO_PAD_T )
+ GENLIST_PART_PADDING_BOTTOM( VIDEO_PAD_B )
+ GENLIST_PART_PADDING_LEFT( VIDEO_PAD_L )
+ GENLIST_PART_PADDING_RIGHT( VIDEO_PAD_R )
+
+//checkbox
+ part { name: "elm.swallow.checkbox";
+ clip_to: "disclip";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: VIDEO_CHECKBOX_W VIDEO_CHECKBOX_H;
+ max: VIDEO_CHECKBOX_W VIDEO_CHECKBOX_H;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "elm.padding.left";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_x: "elm.padding.left";
+ }
+ }
+ }
+ part { name: "elm.padding.icon.left";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: VIDEO_PAD_ICON_L 0;
+ fixed: 1 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "elm.swallow.checkbox";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_x: "elm.swallow.checkbox";
+ }
+ color: 0 0 0 0;
+ align: 0.0 0.0;
+ }
+ }
+ part { name: "elm.padding.icon.right";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: VIDEO_PAD_ICON_R 0;
+ fixed: 1 0;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "elm.icon";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_x: "elm.icon";
+ }
+ color: 0 0 0 0;
+ align: 0.0 0.0;
+ }
+ }
+ part { name: "icon_bg";
+ clip_to: "disclip";
+ type: RECT;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: VIDEO_BG_W VIDEO_BG_H;
+ max: VIDEO_BG_W VIDEO_BG_H;
+ fixed: 1 1;
+ align: 0.0 0.5;
+ color: VIDEO_COLOR_GAP;
+ rel1 {
+ relative: 1.0 0.0;
+ to_x: "elm.padding.icon.left";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_x: "elm.padding.icon.left";
+ }
+ }
+ }
+ part { name: "elm.icon";
+ clip_to: "disclip";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ fixed: 1 1;
+ align: 0.5 0.5;
+ rel1 {
+ relative: (VIDEO_GAP)/VIDEO_BG_W (VIDEO_GAP)/VIDEO_BG_H;
+ to: "icon_bg";
+ }
+ rel2 {
+ relative: (VIDEO_BG_W-VIDEO_GAP+1)/VIDEO_BG_W (VIDEO_BG_H-VIDEO_GAP+1)/VIDEO_BG_H;
+ to: "icon_bg";
+ }
+ }
+ }
+ part {
+ name: "elm.videoicon";
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ max: VIDEO_PLAY_W VIDEO_PLAY_H;
+ align: 0.95 0.95;
+ 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;
+ description {
+ state: "default" 0.0;
+ min: 0 VIDEO_PAD_BOOKMARK_T;
+ fixed: 0 1;
+ visible: 0;
+ rel2.relative: 1.0 0.0;
+ align: 0.0 0.0;
+ }
+ }
+ part { name: "elm.bookmarkicon";
+ clip_to: "disclip";
+ scale: 1;
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: VIDEO_BOOKMARK_W VIDEO_BOOKMARK_H;
+ fixed: 1 1;
+ align: 1.0 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ to_x: "elm.padding.right";
+ to_y: "elm.padding.bookmark.top";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ to_x: "elm.padding.right";
+ }
+ }
+ }
+ part { name: "elm.progressbar.icon";
+ clip_to: "disclip";
+ scale: 1;
+ type: SWALLOW;
+ description { state: "default" 0.0;
+ min: VIDEO_PROGRESSBAR_W VIDEO_PROGRESSBAR_H;
+ fixed: 0 1;
+ align: 1.0 1.0;
+ rel1 {
+ relative: 0.0 1.0;
+ to_x: "elm.bookmarkicon";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ to_x: "elm.bookmarkicon";
+ to_y: "elm.padding.bottom";
+ }
+ }
+ }
+ part { name: "elm.text.title";
+ clip_to: "disclip";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 VIDEO_TITLE_H;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to_x: "elm.padding.icon.right";
+ to_y: "elm.padding.top";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to_x: "elm.bookmarkicon";
+ to_y: "elm.padding.top";
+ }
+ color: VIDEO_COLOR_TITLE;
+ text {
+ font: "Helvetica Neue:style=Roman";
+ size: VIDEO_FONT_TITLE;
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part { name: "elm.text.duration";
+ clip_to: "disclip";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description { state: "default" 0.0;
+ min: 0 VIDEO_DURATION_H;
+ fixed: 0 1;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ to_x: "elm.padding.icon.right";
+ to_y: "elm.text.title";
+ }
+ rel2 {
+ relative: 0 1;
+ offset: 0 0;
+ to_x: "elm.padding.right";
+ to_y: "elm.text.title";
+ }
+ color: VIDEO_COLOR_DURATION;
+ text {
+ font: "Helvetica Neue:style=Medium";
+ size: VIDEO_FONT_DURATION;
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+
+ GENLIST_PART_DISCLIP
+ }
+ programs {
+ program { name: "go_active";
+ signal: "elm,state,selected";
+ source: "elm";
+ action: STATE_SET "selected" 0.0;
+ target: "bg_image";
+ }
+ program { name: "go_passive";
+ signal: "elm,state,unselected";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "bg_image";
+ transition: LINEAR 0.1;
+ }
+ program { name: "go_disabled";
+ signal: "elm,state,disabled";
+ source: "elm";
+ action: STATE_SET "disabled" 0.0;
+ target: "disclip";
+ }
+ program { name: "go_enabled";
+ signal: "elm,state,enabled";
+ source: "elm";
+ action: STATE_SET "default" 0.0;
+ target: "disclip";
+ }
+ }
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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" "";
+ }
+ }
+ }
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#define NOCONTENT_TEXT_BLOCK_TEXT_SIZE_INC 32
+#define NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC 173 170 165 255
+
+ group {
+ name: "elm/layout/nocontents/gallery";
+ styles{
+ style { name: "nocontent_style";
+ base: "font=Helvetica Neue:style=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: "tab" "\t";
+ }
+ }
+ images {
+ image: GALLERY_EDC_IMAGE_NOCONTENTS_PIC COMP;
+ }
+ parts {
+ part { name: "bg";
+ scale: 1;
+ type: RECT;
+ description { state: "default" 0.0;
+ visible: 1;
+ rel1 { relative: 0.0 0.0;}
+ rel2 { relative: 1.0 1.0;}
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "nocontents.image";
+ description { state: "default" 0.0;
+ visible: 1;
+ align: 0.5 0.0;
+ rel1 { relative: 203/720 296/1016; to: "bg";}
+ rel2 { relative: (203+314)/720 (296+310)/1016; to: "bg";}
+ image {
+ normal: GALLERY_EDC_IMAGE_NOCONTENTS_PIC;
+ border: 1 1 1 1;
+ border_scale: 1;
+ }
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ }
+ }
+ part { name: "middle.padding";
+ scale: 1;
+ type: RECT;
+ description { state: "default" 0.0;
+ visible: 0;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 1.0; to_y: "nocontents.image";}
+ rel2 { relative: 1.0 (296+310+54)/1016; to: "bg";}
+ }
+ }
+ part { name: "elm.text";
+ type: TEXTBLOCK;
+ description { state: "default" 0.0;
+ fixed: 0 1;
+ align: 0.5 0.0;
+ visible: 1;
+ rel1 { relative: 0.0 1.0; to_x: "bg"; to_y: "middle.padding";}
+ rel2 { relative: 1.0 1.0; to: "bg";}
+ color: NOCONTENT_TEXT_BLOCK_STYLE_COLOR_INC;
+ text {
+ style: "nocontent_style";
+ align: 0.5 0.5;
+ min: 0 0;
+ max: 0 1;
+ }
+ }
+ }
+ }
+ }
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+//including selection info and notification of delete/move/remove/add...
+#define SELINFO_PORT_W 720
+#define SELINFO_H 48
+#define SELINFO_TOP_LINE_COLOR 56 56 56 255
+#define SELINFO_TOP_LINE_H 2
+#define SELINFO_PAD_L 14
+
+ group
+ {
+ name: "elm/standard/selectioninfo/selectioninfo_viewer";
+ parts {
+ part {
+ name: "bg";
+ type: RECT;
+ mouse_events: 1;
+ repeat_events: 1;
+ scale : 1;
+ description {//default, portrait
+ state: "default" 0.0;
+ min: SELINFO_PORT_W SELINFO_H;
+ fixed: 1 1;
+ align: 0.5 1.0;
+ rel1.relative: 0.5 1.0;
+ rel2.relative: 0.5 1.0;
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "base";
+ type: RECT;
+ mouse_events: 1;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: 0 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";
+ type: RECT;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: 0 SELINFO_TOP_LINE_H;
+ fixed: 1 0;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 0.0; to: "base"; }
+ rel2 { relative: 1.0 SELINFO_TOP_LINE_H/SELINFO_H; to: "base"; }
+ color: SELINFO_TOP_LINE_COLOR;
+ }
+ }
+ part { name: "left_padding";
+ type: RECT;
+ scale : 1;
+ description {
+ state: "default" 0.0;
+ min: SELINFO_PAD_L SELINFO_H;
+ fixed: 1 1;
+ align: 0.5 0.0;
+ rel1 { relative: 0.0 0.0; to: "base"; }
+ rel2 { relative: 0.0 1.0; to: "base"; }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "elm.text";
+ type: TEXT;
+ mouse_events: 0;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ rel1 { relative: 1.0 0.0; to_x: "left_padding"; to_y: "base"; }
+ rel2 { relative: 1.0 1.0; to: "base"; }
+ color: 255 255 255 255;
+ text {
+ font: "Helvetica Neue:style=Medium";
+ size: 32;
+ text: "";
+ align: 0.5 0.5;
+ }
+ }
+ }
+ }
+
+ programs {
+ program {//default selection
+ name: "selectioninfo_portrait";
+ signal: "elm,selectioninfo,portrait";
+ source: "elm";
+ script {
+ set_state(PART:"bg", "default", 0.0);
+ set_state(PART:"base", "default", 0.0);
+ }
+
+ }
+ }
+ }
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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;
+ }
+ }
+ }
+}
+
--- /dev/null
+(^( )*gallery:)([a-zA-Z0-9]+)
+Gallery Album Shortcut Internal
--- /dev/null
+# 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(MSGFMT "/usr/bin/msgfmt")
+
+FOREACH(pofile ${POFILES})
+ SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile})
+ MESSAGE("PO: ${pofile}")
+ GET_FILENAME_COMPONENT(absPofile ${pofile} ABSOLUTE)
+ GET_FILENAME_COMPONENT(lang ${absPofile} NAME_WE)
+ SET(moFile ${CMAKE_CURRENT_BINARY_DIR}/${lang}.mo)
+ ADD_CUSTOM_COMMAND(
+ OUTPUT ${moFile}
+ COMMAND ${MSGFMT} -o ${moFile} ${absPofile}
+ DEPENDS ${absPofile}
+ )
+ INSTALL(FILES ${moFile}
+ DESTINATION res/locale/${lang}/LC_MESSAGES RENAME ${PROJECT_NAME}.mo)
+#Share mo files with Gallery UG.
+ INSTALL(FILES ${moFile}
+ DESTINATION /opt/ug/res/locale/${lang}/LC_MESSAGES RENAME ${GALLERY_UG_PROJECT_NAME}.mo)
+ SET(moFiles ${moFiles} ${moFile})
+ENDFOREACH(pofile)
+
+MESSAGE(".mo files: ${moFiles}")
+ADD_CUSTOM_TARGET(po ALL DEPENDS ${moFiles})
--- /dev/null
+# List of source files containing translatable strings.
+../src/gallery.c
+../src/features/gl-albums.c
+../src/features/gl-gridview.c
+../src/features/gl-listview.c
+../src/features/gl-controlbar.c
+../src/features/gl-button.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-ta.c src/util/gl-db-handler.c
--- /dev/null
+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_POP_UNABLE_TO_RENAME"
+msgstr "Umbenennen nicht möglich"
+
+msgid "IDS_MEDIABR_POP_NO_NAME"
+msgstr "Kein Name"
+
+msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED"
+msgstr "Keine Alben ausgewählt."
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ITEM"
+msgstr "Element auswählen"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM"
+msgstr "Album auswählen"
+
+msgid "IDS_MEDIABR_BODY_ALL_ALBUMS"
+msgstr "Alle Alben"
+
+msgid "IDS_MEDIABR_POP_RETRY_Q"
+msgstr "Erneut versuchen?"
+
+msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE"
+msgstr "Derselbe Name wird bereits verwendet"
+
+msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY"
+msgstr "Eintrag ist leer"
+
+msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER"
+msgstr "Ungültiger Eingabeparameter"
+
--- /dev/null
+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_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 "Μη έγκυρη παράμετρος δεδομένων εισόδου"
+
--- /dev/null
+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_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"
+
--- /dev/null
+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_POP_UNABLE_TO_RENAME"
+msgstr "Imposible cambiar el nombre"
+
+msgid "IDS_MEDIABR_POP_NO_NAME"
+msgstr "Sin nombre"
+
+msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED"
+msgstr "No hay álbumes seleccionados"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ITEM"
+msgstr "Seleccionar elemento"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM"
+msgstr "Seleccionar álbum"
+
+msgid "IDS_MEDIABR_BODY_ALL_ALBUMS"
+msgstr "Todos los álbumes"
+
+msgid "IDS_MEDIABR_POP_RETRY_Q"
+msgstr "¿Volver a intentar?"
+
+msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE"
+msgstr "El mismo nombre ya está en uso"
+
+msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY"
+msgstr "Entrada vacía"
+
+msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER"
+msgstr "Parámetro de entrada no válido"
+
--- /dev/null
+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_POP_UNABLE_TO_RENAME"
+msgstr "Impossible de renommer l'élément"
+
+msgid "IDS_MEDIABR_POP_NO_NAME"
+msgstr "Aucun nom"
+
+msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED"
+msgstr "Aucun album sélectionné"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ITEM"
+msgstr "Sélectionner un élément"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM"
+msgstr "Sélectionner un album"
+
+msgid "IDS_MEDIABR_BODY_ALL_ALBUMS"
+msgstr "Tous les albums"
+
+msgid "IDS_MEDIABR_POP_RETRY_Q"
+msgstr "Réessayer ?"
+
+msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE"
+msgstr "Nom déjà utilisé"
+
+msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY"
+msgstr "Entrée vide"
+
+msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER"
+msgstr "Paramètre d'entrée non valide"
+
--- /dev/null
+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_POP_UNABLE_TO_RENAME"
+msgstr "Impossibile rinominare"
+
+msgid "IDS_MEDIABR_POP_NO_NAME"
+msgstr "Nessun nome"
+
+msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED"
+msgstr "Nessun album selezionato"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ITEM"
+msgstr "Seleziona elemento"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM"
+msgstr "Seleziona album"
+
+msgid "IDS_MEDIABR_BODY_ALL_ALBUMS"
+msgstr "Tutti gli album"
+
+msgid "IDS_MEDIABR_POP_RETRY_Q"
+msgstr "Riprovare?"
+
+msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE"
+msgstr "Stesso nome già in uso"
+
+msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY"
+msgstr "Voce vuota"
+
+msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER"
+msgstr "Parametro inserimento non valido"
+
--- /dev/null
+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_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 "入力パラメーターが無効です"
+
--- /dev/null
+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_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 "사용할 수 없는 입력값입니다"
+
--- /dev/null
+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_POP_UNABLE_TO_RENAME"
+msgstr "Kan de naam niet wijzigen"
+
+msgid "IDS_MEDIABR_POP_NO_NAME"
+msgstr "Geen naam"
+
+msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED"
+msgstr "Geen albums geselecteerd"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ITEM"
+msgstr "Item selecteren"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM"
+msgstr "Album selecteren"
+
+msgid "IDS_MEDIABR_BODY_ALL_ALBUMS"
+msgstr "Alle albums"
+
+msgid "IDS_MEDIABR_POP_RETRY_Q"
+msgstr "Opnieuw?"
+
+msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE"
+msgstr "Naam is al in gebruik"
+
+msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY"
+msgstr "Geen gegevens"
+
+msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER"
+msgstr "Ongeldige invoerparameter"
+
--- /dev/null
+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_POP_UNABLE_TO_RENAME"
+msgstr "Impossível mudar nome"
+
+msgid "IDS_MEDIABR_POP_NO_NAME"
+msgstr "Sem nome"
+
+msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED"
+msgstr "Nenhuns álbuns seleccionados"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ITEM"
+msgstr "Seleccionar item"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM"
+msgstr "Seleccionar álbum"
+
+msgid "IDS_MEDIABR_BODY_ALL_ALBUMS"
+msgstr "Todos os álbuns"
+
+msgid "IDS_MEDIABR_POP_RETRY_Q"
+msgstr "Tentar novamente?"
+
+msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE"
+msgstr "Já está a ser utilizado o mesmo nome"
+
+msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY"
+msgstr "Entrada vazia"
+
+msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER"
+msgstr "Parâmetro de entrada inválido"
+
--- /dev/null
+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_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 "Неверные параметры ввода"
+
--- /dev/null
+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_POP_UNABLE_TO_RENAME"
+msgstr "Yeniden adlandırılamıyor. Dosya kullanımda."
+
+msgid "IDS_MEDIABR_POP_NO_NAME"
+msgstr "İsim yok"
+
+msgid "IDS_MEDIABR_POP_NO_ALBUMS_SELECTED"
+msgstr "Albüm seçilmedi"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ITEM"
+msgstr "Öğe seç"
+
+msgid "IDS_MEDIABR_HEADER_SELECT_ALBUM"
+msgstr "Albüm seç"
+
+msgid "IDS_MEDIABR_BODY_ALL_ALBUMS"
+msgstr "Tüm albümler"
+
+msgid "IDS_MEDIABR_POP_RETRY_Q"
+msgstr "Tekrar denensin mi?"
+
+msgid "IDS_MEDIABR_POP_SAME_NAME_ALREADY_IN_USE"
+msgstr "İsim zaten kullanımda"
+
+msgid "IDS_MEDIABR_POP_ENTRY_IS_EMPTY"
+msgstr "Girdi yok"
+
+msgid "IDS_MEDIABR_POP_INVALID_INPUT_PARAMETER"
+msgstr "Geçersiz giriş parametresi"
+
--- /dev/null
+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_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 "输入参数无效"
+
--- /dev/null
+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_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 "輸入參數無效"
+
--- /dev/null
+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_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 "輸入參數無效"
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <vconf.h>
+#include <vconf-keys.h>
+#include "gl-debug.h"
+#include "gl-albums.h"
+#include "gl-gridview.h"
+#include "gl-listview.h"
+#include "gl-controlbar.h"
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-button.h"
+#include "gl-db-handler.h"
+#include "gl-popup.h"
+#include "gl-progressbar.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_GENGRID_STYLE_ALBUM "unclipped"
+
+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)
+{
+}
+
+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)
+{
+}
+
+static void _gl_albums_comeback_from_view_cb(void *data,
+ Evas_Object *obj, void *event_info)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+ /* 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!");
+ }
+
+ /* Remove idler after all items appended */
+ gl_albums_del_grid_append_idler(data);
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
+/**
+* @Brif Update checkbox state and album cover and update selectioninfo.
+*
+* @Param data gl_appdata.
+* @Param album_item album item.
+* @Param check_obj object of checkbox.
+* @Param b_ck_box true: Checkbox selection, false: album cover selection.
+*/
+static int _gl_albums_update_check_state(void *data,
+ gl_cluster *album_item,
+ Evas_Object *check_obj, bool b_ck_box)
+{
+ GL_CHECK_VAL(album_item, -1);
+ GL_CHECK_VAL(album_item->cluster, -1);
+ GL_CHECK_VAL(album_item->cluster->uuid, -1);
+ GL_CHECK_VAL(check_obj, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("Select checkbox[1]/album_cover[0]: %d.", b_ck_box);
+
+ /* Update state of checkbox */
+ album_item->checked = !album_item->checked;
+ gl_dbg("album (%s) check state: %d",
+ album_item->cluster->display_name, album_item->checked);
+
+ /**
+ * If album cover selected, update checkbox icon manually,
+ * If checkbox selected, its icon is updated by system automatically.
+ */
+ if (b_ck_box == false)
+ elm_check_state_set(check_obj, album_item->checked);
+
+ if (album_item->checked) {
+ /* Show album dimmed cover if album checked */
+ elm_object_item_signal_emit(album_item->item,
+ "elm,checkbox,cover_dim,show",
+ "elm");
+ gl_dbg("Append:%s, id:%s", album_item->cluster->display_name,
+ album_item->cluster->uuid);
+ gl_db_albums_selected_list_append(ad, album_item);
+ } else {
+ /* Hide album dimmed cover if album unchecked */
+ elm_object_item_signal_emit(album_item->item,
+ "elm,checkbox,cover_dim,hide",
+ "elm");
+ gl_dbg("Remove:%s, id:%s", album_item->cluster->display_name,
+ album_item->cluster->uuid);
+ gl_db_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);
+
+ return 0;
+}
+
+static void _gl_albums_check_changed(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ GL_CHECK(obj);
+ GL_CHECK(data);
+ gl_cluster *album_item = (gl_cluster *)data;
+ GL_CHECK(album_item->ad);
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+ gl_dbg("");
+
+ if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_EDIT) {
+ gl_dbgE("Wrong view mode!");
+ return;
+ }
+
+ /* Checkbox selected, b_ck_box=true */
+ _gl_albums_update_check_state(ad, album_item, obj, true);
+}
+
+/* Callback of normal icon */
+static void __gl_albums_sel_cb(void *data,Evas_Object *obj, void *event_info)
+{
+ GL_CHECK(event_info);
+ GL_CHECK(data);
+ gl_cluster *album_item = (gl_cluster *)data;
+ GL_CHECK(album_item->cluster);
+ GL_CHECK(album_item->ad);
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+ Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *)event_info;
+
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ return;
+
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("view mode: %d.", view_mode);
+ if (view_mode != GL_VIEW_ALBUMS_EDIT) {
+ if (album_item->cluster->count == 0) {
+ gl_dbgW("Empty album, return;");
+ return;
+ }
+ gl_albums_sel_album(album_item);
+ }
+}
+
+static void _gl_albums_check_mouse_up_cb(void *data, Evas *e,
+ Evas_Object *obj, void *event_info)
+{
+ GL_CHECK(event_info);
+ GL_CHECK(data);
+ gl_cluster *album_item = (gl_cluster *)data;
+ GL_CHECK(album_item->ad);
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+ Evas_Event_Mouse_Up *ev = (Evas_Event_Mouse_Up *)event_info;
+
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
+ return;
+
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("view mode: %d.", view_mode);
+
+ if (view_mode == GL_VIEW_ALBUMS_EDIT) {
+ GL_CHECK(album_item->check_obj);
+ /* Album cover selected, b_ck_box=false */
+ _gl_albums_update_check_state(ad, album_item,
+ album_item->check_obj, false);
+ }
+}
+
+static void __gl_rename_album_job_cb(void *userdata)
+{
+ GL_CHECK(userdata);
+ gl_cluster *album_item = (gl_cluster *)userdata;
+ gl_ui_rename_album(album_item);
+ return;
+}
+
+static void _gl_albums_rename_btn_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ gl_dbg("");
+ GL_CHECK(data);
+ gl_cluster *album_item = (gl_cluster *)data;
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+
+ /* Checkme: Disable rename button if album selected */
+ if (album_item->checked) {
+ gl_dbgW("Album checked!");
+ GL_CHECK(album_item->check_obj);
+ /* Album cover selected, b_ck_box=false */
+ _gl_albums_update_check_state(ad, album_item,
+ album_item->check_obj, false);
+ return;
+ }
+
+ 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);
+}
+
+/* Add callbacks to check bg icon */
+int _gl_albums_add_check_icon_cbs(Evas_Object *obj, void *data)
+{
+ GL_CHECK_VAL(obj, -1);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP,
+ _gl_albums_check_mouse_up_cb);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP,
+ _gl_albums_check_mouse_up_cb, data);
+ return 0;
+}
+
+char *_gl_albums_get_text(void *data, Evas_Object *obj, const char *part)
+{
+ GL_CHECK_NULL(part);
+ GL_CHECK_NULL(strlen(part));
+ GL_CHECK_NULL(data);
+ gl_cluster *album_item = (gl_cluster *)data;
+ GL_CHECK_NULL(album_item->cluster);
+ GL_CHECK_NULL(album_item->cluster->display_name);
+ GL_CHECK_NULL(album_item->cluster->uuid);
+ GL_CHECK_NULL(album_item->ad);
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+ char buf[GL_ALBUM_NAME_LEN_MAX] = { 0, };
+
+ if (!strcmp(part, "elm.text.name")) {
+ gl_dbg("text.name");
+ 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);
+ /* Show blue folder name */
+ if (!g_strcmp0(album_item->cluster->uuid, GL_ALBUM_ALL_ID)||
+ gl_db_is_default_album(ad, album_item->cluster))
+ elm_object_item_signal_emit(album_item->item,
+ "elm,name,show,blue", "elm");
+ } 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, };
+ 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);
+
+
+ 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 = 0;
+ return NULL;
+ }
+ memset(&t2, 0x00, sizeof(struct tm));
+ localtime_r((time_t *)&(items2[0]->item->mtime),
+ &t2);
+ strftime(date2, sizeof(date2), "%Y.%m.%d", &t2);
+
+ if (!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);
+ }
+ }
+
+ for (i = 0; i < item_count; i++) {
+ gl_db_destroy_item(items2[i]);
+ items2[i] = NULL;
+ }
+ } else if (!strcmp(part, "elm.text.count")) {
+ gl_db_update_item_cnt(album_item);
+ snprintf(buf, sizeof(buf), "%d",
+ (int)(album_item->cluster->count));
+ }
+
+ return strdup(buf);
+
+}
+
+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)
+{
+ 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_max_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;
+}
+
+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_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);
+ }
+
+ 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);
+ }
+
+ return tb;
+}
+
+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);
+ }
+
+ 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_albums_get_content(void *data, Evas_Object *obj, const char *part)
+{
+ GL_CHECK_NULL(part);
+ GL_CHECK_NULL(strlen(part));
+ GL_CHECK_NULL(data);
+ gl_cluster *album_item = (gl_cluster *)data;
+ GL_CHECK_NULL(album_item->cluster);
+ GL_CHECK_NULL(album_item->ad);
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+ 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);
+ /**
+ * for "All albums", and "Camera shots", their colors should be
+ * 25:25:25 by new gui
+ */
+ 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, "elm.swallow.check_bg") &&
+ view_mode == GL_VIEW_ALBUMS_EDIT) {
+ 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);
+ evas_object_color_set(bg, 0, 0, 0, 0);
+ 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);
+ _gl_albums_add_check_icon_cbs(bg, album_item);
+ evas_object_show(bg);
+ return bg;
+ } else if (!strcmp(part, "elm.swallow.end") &&
+ 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, 0);
+ elm_check_state_set(ck, album_item->checked);
+ album_item->check_obj = ck;
+ evas_object_smart_callback_add(ck, "changed",
+ _gl_albums_check_changed,
+ data);
+ evas_object_show(ck);
+
+ if (album_item->checked)
+ elm_object_item_signal_emit(album_item->item,
+ "elm,checkbox,cover_dim,show",
+ "elm");
+
+ return ck;
+ } else if (!strcmp(part, "elm.swallow.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))
+ 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, 0);
+ evas_object_smart_callback_add(btn, "clicked",
+ _gl_albums_rename_btn_cb, data);
+ return btn;
+ }
+ return NULL;
+}
+
+
+static int _gl_albums_create_items(void *data, Evas_Object *parent)
+{
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int i = 0;
+ gl_cluster *album_item = NULL;
+ int length = 0;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("");
+
+ /* Clear albums view */
+ elm_gengrid_clear(parent);
+
+ ad->albuminfo.albumgic.item_style = "gallery/albums_view";
+ ad->albuminfo.albumgic.func.text_get = _gl_albums_get_text;
+ ad->albuminfo.albumgic.func.content_get = _gl_albums_get_content;
+
+ GL_CHECK_VAL(ad->albuminfo.cluster_list, -1);
+ GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, -1);
+ Eina_List *clist = ad->albuminfo.cluster_list->clist;
+ length = eina_list_count(clist);
+ gl_dbg("Albums length: %d", length);
+ const char *al_id = NULL;
+ Elm_Gengrid_Item_Class *pgic = &(ad->albuminfo.albumgic);
+ int item_cnt = 0;
+
+ for (i = 0; i < length; i++) {
+ album_item = eina_list_nth(clist, i);
+ GL_CHECK_VAL(album_item, -1);
+ GL_CHECK_VAL(album_item->cluster, -1);
+ GL_CHECK_VAL(album_item->cluster->display_name, -1);
+ GL_CHECK_VAL(album_item->cluster->uuid, -1);
+ al_id = album_item->cluster->uuid;
+
+
+ if (view_mode == GL_VIEW_ALBUMS_EDIT) {
+ if (!g_strcmp0(al_id, GL_ALBUM_ALL_ID) )
+ continue;
+ }
+
+ album_item->item = elm_gengrid_item_append(parent, pgic,
+ album_item,
+ __gl_albums_sel_cb,
+ album_item);
+ album_item->index = item_cnt;
+ item_cnt++;
+ gl_dbg("Append[%s], id=%s.", album_item->cluster->display_name,
+ al_id);
+ }
+
+ ad->albuminfo.albums_cnt = item_cnt;
+
+ return 0;
+}
+
+int gl_albums_sel_album(gl_cluster *album_item)
+{
+ GL_CHECK_VAL(album_item, -1);
+ GL_CHECK_VAL(album_item->cluster, -1);
+ GL_CHECK_VAL(album_item->cluster->uuid, -1);
+ GL_CHECK_VAL(album_item->ad, -1);
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+ GL_CHECK_VAL(ad->albuminfo.cluster_list, -1);
+ GL_CHECK_VAL(ad->albuminfo.cluster_list->clist, -1);
+ int view_mode = gl_get_view_mode(ad);
+
+ if (view_mode != GL_VIEW_ALBUMS) {
+ gl_dbgE("Wrong view mode!");
+ return -1;
+ } else {
+ gl_dbg("ViewMode");
+ }
+
+ 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);
+ 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_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);
+ 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);
+ elm_object_part_content_set(layout, "elm.swallow.view", gv);
+ ad->gridinfo.all_view = gv;
+ ad->gridinfo.layout = layout;
+
+ /* View mode reset, Update view mode */
+ view_mode = gl_get_view_mode(ad);
+ if (view_mode != GL_VIEW_THUMBS) {
+ gl_dbgE("View mode is wrong!");
+ return -1;
+ }
+
+ gl_navi_mode mode = GL_NAVI_THUMBS;
+ /* check root case */
+ if (gl_db_is_root_path(ad, album_item->cluster->uuid, NULL))
+ al_na = GL_ALBUM_PHOME_ROOT_NAME;
+
+ gl_ui_create_title_and_push(ad, navi, layout, mode, 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);
+ 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");
+ gl_dbg("Done albums selected");
+
+ 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;
+ }
+
+ return 0;
+}
+
+Evas_Object *gl_albums_create_view(void *data, Evas_Object *parent)
+{
+ GL_CHECK_NULL(parent);
+ GL_CHECK_NULL(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_NULL(ad->albuminfo.cluster_list);
+ gl_dbg("");
+
+ gl_albums_free_cover_thumbs(ad);
+ memset(ad->albuminfo.cover_thumbs, 0x00,
+ GL_ALBUM_COVER_THUMB_NUM * sizeof(int));
+ ad->albuminfo.album_medias_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_size_hint_weight_set(grid, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+
+ 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)) {
+ 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_show(noc);
+ ad->albuminfo.nocontents = noc;
+
+ return noc;
+ } else {
+ ad->albuminfo.nocontents = NULL;
+ evas_object_show(grid);
+ }
+
+ gl_dbg("gl_albums_create_view:done");
+
+ return grid;
+}
+
+/* From thumbnails view to albums view */
+int gl_albums_comeback_from_view(void *data)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ gl_ui_destroy_notiinfo(ad);
+
+ gl_grid_clear_view(ad);
+ gl_list_clear_view(ad);
+
+ 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;
+
+ return 0;
+}
+
+/* From albums edit view to albums view */
+int gl_albums_change_to_view(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->albuminfo.cluster_list, -1);
+ gl_dbg("");
+
+ GL_CHECK_VAL(ad->albuminfo.view, -1);
+ gl_set_view_mode(ad, GL_VIEW_ALBUMS);
+ /* changed to show no contents if needed */
+ if (gl_check_gallery_empty(ad)) {
+ if (ad->albuminfo.view)
+ evas_object_del(ad->albuminfo.view);
+
+ /* 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);
+ 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");
+ evas_object_del(old_view);
+ elm_object_part_content_set(ad->albuminfo.layout,
+ "elm.swallow.view", noc);
+ } else {
+ _gl_albums_create_items(ad, ad->albuminfo.view);
+ }
+
+ return 0;
+}
+
+/* Update albums view */
+int gl_albums_update_items(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->albuminfo.cluster_list, -1);
+ int view_mode = gl_get_view_mode(ad);
+ 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);
+ 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");
+ evas_object_del(old_view);
+ 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);
+ } else {
+ if (ad->albuminfo.nocontents) {
+ /**
+ * current view is nocontents,
+ * unset it first then create albums view.
+ */
+ gl_albums_remove_nocontents(ad);
+ } else {
+ Evas_Object *al_view = NULL;
+ al_view = ad->albuminfo.view;
+ _gl_albums_create_items(ad, al_view);
+ }
+ }
+ }
+
+ return 0;
+}
+
+/* Update albums list and refresh albums view, remove invalid widgets */
+int gl_albums_update_view(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("view_mode: %d.", view_mode);
+
+ gl_albums_free_cover_thumbs(ad);
+ memset(ad->albuminfo.cover_thumbs, 0x00,
+ GL_ALBUM_COVER_THUMB_NUM * sizeof(int));
+
+ if (view_mode == GL_VIEW_ALBUMS) {
+ /* Update mass storage state */
+ gl_get_mass_storage_state(ad);
+ /* Update albums list*/
+ gl_refresh_albums_list(ad);
+
+ if (ad->albuminfo.nocontents) {
+ gl_albums_remove_nocontents(ad);
+ } 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);
+ else
+ gl_ui_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);
+ }
+ } 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!");
+ return -1;
+ }
+
+ if (gl_check_gallery_empty(ad) ||
+ ad->albuminfo.cluster_list->edit_cnt == 0) {
+ /* Remove invalid widgets */
+ gl_del_invalid_widgets(ad, GL_INVALID_NONE);
+
+ 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);
+ } else {
+ int sel_cnt = gl_db_get_albums_selected_cnt(ad);
+ int invalid_m = GL_INVALID_NONE;
+ /* Album selected for rename was deleted */
+ if (view_mode == GL_VIEW_ALBUMS_RENAME) {
+ if (ad->albuminfo.selected_album == NULL) {
+ gl_dbgW("Rename invalid album!");
+ invalid_m = GL_INVALID_RENAME_ALBUM;
+ /* 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);
+ if (sel_cnt == 0)
+ /* Reset view mode */
+ gl_set_view_mode(ad,
+ GL_VIEW_ALBUMS_EDIT);
+ }
+ } else if (sel_cnt == 0) {
+ /* If none albums selected */
+ gl_dbgW("None albums selected!");
+ /* Disable control bar buttons */
+ gl_ui_disable_toolbar_items(ad,
+ ad->albuminfo.nf_it_edit);
+ /* Remove invalid widgets */
+ gl_del_invalid_widgets(ad, invalid_m);
+ /* Reset view mode */
+ gl_set_view_mode(ad, GL_VIEW_ALBUMS_EDIT);
+ }
+
+ /* Update edit view, other update view in cancel callback */
+ 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);
+ } else {
+ /* Cluster list updated, clear view */
+ elm_gengrid_clear(edit_view);
+ }
+ }
+ }
+ return 0;
+}
+
+/**
+* Remove nocontents view and show albums view.
+* 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;
+ 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);
+ } 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;
+ }
+
+ return 0;
+}
+
+int gl_albums_free_cover_thumbs(void *data)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int i = 0;
+
+ for (i = 0; i < GL_ALBUM_COVER_THUMB_NUM; i++) {
+ if (ad->albuminfo.cover_thumbs[i]) {
+ gl_db_destroy_item(ad->albuminfo.cover_thumbs[i]);
+ ad->albuminfo.cover_thumbs[i] = NULL;
+ }
+ }
+
+ return 0;
+}
+
+/* Free resources allocated for albums view */
+int gl_albums_free_data(void *data)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ gl_albums_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;
+ }
+ return 0;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include "gl-debug.h"
+#include "gl-ui-util.h"
+#include "gl-button.h"
+#include "gl-strings.h"
+
+#define GL_BUT_NAME_DELETE GL_STR_DELETE
+#define GL_BUT_NAME_CANCEL GL_STR_CANCEL
+#define GL_BUT_NAME_DONE GL_STR_DONE
+
+/*******************************************************
+** Prototype : _gl_but_create_but
+** Description : Create button
+** Input : Evas_Object *parent
+** Input : gl_but_mode mode
+** Input : const char *style
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+Evas_Object *_gl_but_create_but(Evas_Object *parent, gl_but_mode mode, const char *style)
+{
+ gl_dbg("button mode: %d", mode);
+ Evas_Object *btn = NULL;
+
+ btn = elm_button_add(parent);
+ GL_CHECK_NULL(btn);
+ elm_object_focus_allow_set(btn, EINA_FALSE);
+ elm_object_style_set(btn, style);
+ 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);
+
+ if (mode == GL_BUT_DEL)
+ elm_object_text_set(btn, GL_BUT_NAME_DELETE);
+ else if (mode == GL_BUT_CANCEL)
+ elm_object_text_set(btn, GL_BUT_NAME_CANCEL);
+ else if (mode == 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);
+
+ evas_object_show(btn);
+ return btn;
+}
+
+Evas_Object *_gl_but_create_but_popup(Evas_Object *parent, const char *text, But_Smart_Cb cb_func, const void *data)
+{
+ Evas_Object *btn = NULL;
+ GL_CHECK_NULL(parent);
+ GL_CHECK_NULL(text);
+ gl_dbg("Button text: %s", text);
+
+ btn = elm_button_add(parent);
+ GL_CHECK_NULL(btn);
+ elm_object_text_set(btn, text);
+
+ if (cb_func)
+ evas_object_smart_callback_add(btn, "clicked", cb_func, data);
+
+ return btn;
+}
\ No newline at end of file
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#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;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include "gl-debug.h"
+#include "gl-gridview.h"
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-albums.h"
+#include "gl-db-handler.h"
+#include "gl-ext-ug-load.h"
+#include "gl-ext-exec.h"
+
+/* 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)
+{
+ gl_dbg("");
+ gl_grid_sel_cb(data, NULL, NULL);
+}
+
+static void
+_gl_grid_item_check_changed(void *data, Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(obj);
+ GL_CHECK(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("");
+
+ if (view_mode != GL_VIEW_THUMBS_EDIT)
+ 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);
+ }
+ else
+ {
+ gl_dbg("Remove:%s", gitem->item->file_url);
+ gl_db_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);
+}
+
+static void
+_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);
+}
+
+Evas_Object *
+_gl_grid_get_content(void *data, Evas_Object * obj, const char *part)
+{
+ GL_CHECK_NULL(part);
+ GL_CHECK_NULL(strlen(part));
+ GL_CHECK_NULL(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK_NULL(gitem->item);
+ GL_CHECK_NULL(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ int view_mode = gl_get_view_mode(ad);
+ int item_size = ad->gridinfo.icon_size;
+
+ 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 */
+ 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;
+ } else {
+ elm_bg_file_set(bg, gitem->item->thumb_url,
+ NULL);
+ }
+ }
+
+ 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)
+ {
+ int bk_len = 0;
+ // Set bookmark icon.
+ 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);
+ }
+ 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);
+ }
+ }
+ 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);
+ 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))
+ {
+ 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, 0);
+
+ 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;
+ }
+
+ return NULL;
+}
+
+static bool
+_gl_grid_create_items(void *data, Evas_Object * parent)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ int i = 0;
+ int item_cnt = 0;
+ gl_item *gitem = NULL;
+ int ret = -1;
+ /* Get all medias count of current album */
+ int cnt = ad->maininfo.medias_cnt;
+ gl_dbg("List count : %d gv_mode : %d", cnt, ad->gridinfo.grid_view_mode);
+
+ ad->gridinfo.thumbgic.item_style = GL_GENGRID_ITEM_STYLE_THUMBNAIL;
+ ad->gridinfo.thumbgic.func.text_get = NULL;
+ ad->gridinfo.thumbgic.func.content_get = _gl_grid_get_content;
+
+ elm_gengrid_clear(parent);
+ for (i = 1; i <= cnt; i++)
+ {
+ gl_db_get_item_by_index(ad, i, false, &gitem);
+ if (gitem == NULL || gitem->item == NULL ||
+ gitem->item->uuid == NULL) {
+ gl_dbgE("Invalid gitem. continue...");
+ continue;
+ }
+
+ if (!gitem->item->file_url)
+ {
+ gl_dbg("file_url is invalid.");
+ ret = minfo_delete_media_id(ad->maininfo.db_handle,
+ gitem->item->uuid);
+ if (ret < 0)
+ {
+ continue;
+ }
+ gl_db_selected_list_remove(ad, gitem);
+ gl_db_item_list_remove(ad, gitem);
+ cnt--;
+ i--;
+ gitem = NULL;
+ continue;
+ }
+
+ if (ad->gridinfo.back_to_normal)
+ gitem->checked = false;
+
+ if (ad->gridinfo.grid_view_mode == GL_GRID_IMAGES &&
+ gitem->item->type != MINFO_ITEM_IMAGE)
+ continue;
+
+ gitem->elm_item = elm_gengrid_item_append(parent,
+ &(ad->gridinfo.thumbgic),
+ gitem,
+ gl_grid_sel_cb,
+ gitem);
+ item_cnt++;
+ gitem->sequence = item_cnt;
+
+ }
+
+ elm_gengrid_select_mode_set(parent, ELM_OBJECT_SELECT_MODE_NONE);
+
+ ad->gridinfo.thumbs_cnt = item_cnt;
+ ad->gridinfo.back_to_normal = false;
+
+ if (item_cnt == 0)
+ {
+ return EINA_FALSE;
+ }
+ else
+ {
+ return EINA_TRUE;
+ }
+}
+
+void
+gl_grid_item_mouse_down(void *data, Evas * e,
+ Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(obj);
+ GL_CHECK(event_info);
+ GL_CHECK(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info;
+
+ ad->gridinfo.touch_info.x = ev->output.x;
+ ad->gridinfo.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;
+ }
+}
+
+void
+gl_grid_item_mouse_up(void *data, Evas * e,
+ Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+
+ if (!event_info || !obj)
+ {
+ goto RET_WO_EXEC;
+ }
+
+ Evas_Event_Mouse_Up *ev = event_info;
+ if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD ||
+ ev->event_flags & EVAS_EVENT_FLAG_ON_SCROLL)
+ {
+ goto RET_WO_EXEC;
+ }
+ if ((abs(ad->gridinfo.touch_info.x - ev->output.x) > GL_GRID_TOUCH_RANGE) ||
+ (abs(ad->gridinfo.touch_info.y - ev->output.y) > GL_GRID_TOUCH_RANGE))
+ {
+ goto RET_WO_EXEC;
+ }
+
+ gl_dbg("");
+
+ if (ad->gridinfo.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;
+ }
+ return;
+
+ RET_WO_EXEC:
+ if (ad->gridinfo.touch_info.b_pressed)
+ {
+ edje_object_signal_emit(_EDJ(obj), "mouse,up,expand", "bg");
+ ad->gridinfo.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.
+*
+* b_noc, true: it's nocontents view, false: normal view.
+*/
+static int _gl_grid_set_view(void *data, Evas_Object *view, bool b_noc)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_grid_mode view_mode = ad->gridinfo.grid_view_mode;
+
+ switch (view_mode) {
+ case GL_GRID_ALL:
+ ad->gridinfo.all_view = view;
+ if (b_noc)
+ gl_grid_set_nocontents(ad, view);
+ else
+ gl_grid_set_nocontents(ad, NULL);
+ break;
+ case GL_GRID_IMAGES:
+ ad->gridinfo.image_view = view;
+ if (b_noc)
+ gl_grid_set_nocontents(ad, view);
+ else
+ gl_grid_set_nocontents(ad, NULL);
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+void
+gl_grid_sel_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK(gitem->item);
+ GL_CHECK(gitem->item->file_url);
+ GL_CHECK(strlen(gitem->item->file_url));
+ GL_CHECK(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("");
+
+ if (view_mode != GL_VIEW_THUMBS)
+ return;
+ else
+ gl_dbg("ViewMode");
+
+ if (gitem->item->type == MINFO_ITEM_IMAGE ||
+ gitem->item->type == MINFO_ITEM_VIDEO)
+ {
+ gl_dbg("Loading UG-IMAGE(VIDEO)-VIEWER");
+ gl_ext_load_iv_ug(ad, gitem);
+ }
+}
+
+/*
+* When select album, show first (GL_FIRST_VIEW_END_POS+1) medias.
+* Then use idler to get other medias from DB and appened
+* them to gridview.
+* In order to reduce transit time of first show of thumbnails view.
+* Cause most of time is spent for getting records from DB,
+* so we get first (GL_FIRST_VIEW_END_POS+1) items and show thumbnails view,
+* it will accelerate view show.
+*/
+int
+gl_grid_idler_append_items(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->albuminfo.current_album, -1);
+ GL_CHECK_VAL(ad->gridinfo.all_view, -1);
+ int i = 0;
+ int item_cnt = 0;
+ gl_item *gitem = NULL;
+ /* Get all medias count of current album */
+ int cnt = ad->maininfo.medias_cnt;
+ int ret = -1;
+
+ gl_dbg("First view medias count: %d; girdview mode: %d",
+ cnt, ad->gridinfo.grid_view_mode);
+ if (ad->maininfo.medias_cnt != (GL_FIRST_VIEW_END_POS + 1))
+ {
+ gl_dbg("No any more items, return!");
+ return -1;
+ }
+ /* Get other items from DB */
+ ret = gl_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!");
+ return ret;
+ }
+
+ cnt = ad->maininfo.medias_cnt;
+ gl_dbg("Grid view all medias count: %d", cnt);
+
+ if (ad->gridinfo.grid_view_mode != GL_GRID_ALL)
+ {
+ /* Event gridview mode is wrong, we still need to get other records */
+ gl_dbg("Gridview mode is wrong, return!");
+ return -1;
+ }
+
+ /* From (GL_FIRST_VIEW_END_POS + 2)th item to last one */
+ i = GL_FIRST_VIEW_END_POS + 2;
+
+ for (; i <= cnt; i++)
+ {
+ gl_db_get_item_by_index(ad, i, false, &gitem);
+ if (gitem == NULL || gitem->item == NULL ||
+ gitem->item->uuid == NULL ) {
+ gl_dbgE("Invalid gitem, continue...");
+ continue;
+ }
+
+ if (!gitem->item->file_url)
+ {
+ gl_dbg("file_url is invalid.");
+ 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);
+ cnt--;
+ i--;
+ gitem = NULL;
+ continue;
+ }
+
+ if (ad->gridinfo.grid_view_mode == GL_GRID_IMAGES &&
+ gitem->item->type != MINFO_ITEM_IMAGE)
+ continue;
+
+ gitem->elm_item = elm_gengrid_item_append(ad->gridinfo.all_view,
+ &(ad->gridinfo.thumbgic),
+ gitem,
+ gl_grid_sel_cb,
+ gitem);
+ item_cnt++;
+ gitem->sequence = item_cnt + GL_FIRST_VIEW_END_POS + 1;
+ }
+
+ gl_dbg("\n\n<<<<<<<<Use idler to append other medias--Done<<<<<<<<<\n");
+ if (item_cnt == 0)
+ {
+ return -1;
+ }
+ else
+ {
+ ad->gridinfo.thumbs_cnt = item_cnt + GL_FIRST_VIEW_END_POS + 1;
+ gl_dbg("All count appended: %d", ad->gridinfo.thumbs_cnt);
+ return 0;
+ }
+}
+
+Evas_Object *gl_grid_create_view(void *data, Evas_Object * parent, gl_grid_mode mode)
+{
+ 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);
+
+ if (!_gl_grid_create_items(ad, grid)) {
+ evas_object_del(grid);
+ grid = NULL;
+ Evas_Object *noc = gl_ui_create_nocontents_full(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_grid_set_view_property(grid);
+
+ return grid;
+}
+
+int
+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;
+
+ if (view_mode != GL_VIEW_THUMBS_EDIT)
+ {
+ gl_dbg("Error: not in edit mode");
+ return -1;
+ }
+
+ b_ret = _gl_grid_create_items(ad, ad->gridinfo.edit_view);
+ gl_grid_set_item_size(ad, NULL);
+
+ if (!b_ret) {
+ gl_dbgE("Create items failed!");
+ return -1;
+ } else {
+ return 0;
+ }
+}
+
+int
+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;
+
+ if (ad->gridinfo.all_view == NULL
+ && ad->gridinfo.image_view == NULL)
+ {
+ gl_dbg("Error : Any gridview doesn't exist");
+ return -1;
+ }
+
+ ad->gridinfo.back_to_normal = true; // back from edit mode, save state.
+
+ 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);
+ gl_grid_set_item_size(ad, NULL);
+
+ if (!b_ret) {
+ gl_dbgE("Create items failed!");
+ return -1;
+ } else {
+ return 0;
+ }
+}
+
+/**
+* Get all/image_grid_view.
+*
+* True returned if it's normal view, if it's nocontents view return false.
+*/
+bool gl_grid_get_view(void *data, Evas_Object **view)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_grid_mode view_mode = ad->gridinfo.grid_view_mode;
+ Evas_Object *gv = NULL;
+ bool b_view = false;
+
+ switch (view_mode) {
+ case GL_GRID_ALL:
+ gv = ad->gridinfo.all_view;
+ if (gv && ad->gridinfo.all_nocontents == NULL)
+ b_view = true;
+ break;
+ case GL_GRID_IMAGES:
+ gv = ad->gridinfo.image_view;
+ if (gv && ad->gridinfo.image_nocontents == NULL)
+ b_view = true;
+ break;
+ default:
+ break;
+ }
+
+ /* Nocontents */
+ if (!b_view)
+ gl_dbg("Previous view is Nocontents...");
+
+ /* Return view */
+ if (view)
+ *view = gv;
+
+ return b_view;
+}
+
+/* Assign new value to all/image_grid_nocontents */
+int gl_grid_set_nocontents(void *data, Evas_Object *noc)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_grid_mode view_mode = ad->gridinfo.grid_view_mode;
+
+ switch (view_mode) {
+ case GL_GRID_ALL:
+ ad->gridinfo.all_nocontents = noc;
+ break;
+ case GL_GRID_IMAGES:
+ ad->gridinfo.image_nocontents = noc;
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+int gl_grid_update_items_cnt(void *data, int new_cnt)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ gl_dbg("gridview display item count=%d", new_cnt);
+ ad->gridinfo.updated_thumbs_cnt = new_cnt;
+
+ return 0;
+}
+
+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);
+
+ if (gridview) {
+ gv = gridview;
+ } else {
+ bool b_view = false;
+ if (view_mode == GL_VIEW_THUMBS_EDIT) {
+ b_view = true;
+ gv = ad->gridinfo.edit_view;
+ } else {
+ b_view = gl_grid_get_view(ad, &gv);
+ }
+
+ if (!b_view || !gv) {
+ gl_dbgE("gridview is invalid!");
+ return -1;
+ }
+ }
+
+ if (ad->gridinfo.updated_thumbs_cnt <= 0) {
+ cnt = ad->gridinfo.thumbs_cnt;
+ } else {
+ cnt = ad->gridinfo.updated_thumbs_cnt;
+ ad->gridinfo.updated_thumbs_cnt = 0;
+ }
+
+ 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;
+}
+
+Eina_Bool
+gl_grid_update_items(void *data)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ Eina_Bool res = EINA_FALSE;
+ Evas_Object *gv = NULL;
+ int view_mode = gl_get_view_mode(ad);
+ bool b_view = false;
+ gl_dbg("");
+
+ if (view_mode == GL_VIEW_THUMBS_EDIT)
+ {
+ gl_dbg("\n\nEdit_Mode\n");
+ gv = ad->gridinfo.edit_view;
+ }
+ else
+ {
+ b_view = gl_grid_get_view(ad, &gv);
+ GL_CHECK_FALSE(gv);
+ }
+ if (b_view) {
+ res = _gl_grid_create_items(ad, gv);
+ if (!res)
+ {
+ gl_dbg("_gl_grid_create_items() return false...");
+ 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_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);
+ }
+ else
+ {
+ gl_grid_set_item_size(ad, gv);
+ }
+ }
+ else
+ {
+ gl_dbg("Remove nocontents view.");
+ evas_object_hide(gv);
+ evas_object_del(gv);
+ _gl_grid_set_view(ad, NULL, false);
+ bool b_noc = false;
+ int view_m = ad->gridinfo.grid_view_mode;
+
+ Evas_Object *view = NULL;
+ view = gl_grid_create_view(ad, ad->maininfo.navi_bar, view_m);
+ if ((view_m == GL_GRID_IMAGES &&
+ ad->gridinfo.image_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
+ 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);
+ }
+
+ return res;
+}
+
+int
+gl_grid_clear_view(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)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;
+ }
+
+ ad->gridinfo.all_nocontents = NULL;
+ ad->gridinfo.image_nocontents = NULL;
+
+ ad->gridinfo.edit_it = NULL;
+
+ return 0;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include "gl-debug.h"
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-albums.h"
+#include "gl-listview.h"
+#include "gl-ext-ug-load.h"
+#include "gl-ext-exec.h"
+#include "gl-db-handler.h"
+#include "gl-progressbar.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)
+{
+ GL_CHECK(obj);
+ GL_CHECK(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK(gitem);
+ GL_CHECK(gitem->item);
+ GL_CHECK(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("");
+
+ if (view_mode != GL_VIEW_VIDEOLIST_EDIT)
+ {
+ gl_dbg("ViewMode.%d. now return.", view_mode);
+ return;
+ }
+ else
+ {
+ gl_dbg("Edit Mode");
+ }
+
+ int cnt = 0;
+ 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);
+ }
+ else
+ {
+ gl_dbg("Remove:%s", gitem->item->file_url);
+ gl_db_selected_list_remove(ad, gitem);
+ }
+
+ cnt = gl_db_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);
+}
+
+static Evas_Object *__gl_list_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->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);
+
+ return gl_pb_add_list_pbar(parent, ratio);
+}
+
+static char *
+_gl_list_text_get(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)
+ {
+ return strdup(gitem->item->display_name);
+ }
+ else
+ {
+ gl_dbg("gitem->item->display_name, addr=%p", gitem->item->display_name);
+ return NULL;
+ }
+ }
+ else if (!strcmp(part, "elm.text.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;
+
+ 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, GL_FILE_PATH_LEN_MAX,
+ "%02d:%02d:%02d", dur_hr, dur_min, dur_sec);
+ ret_str[strlen(ret_str)] = '\0';
+
+ return strdup(ret_str);
+ }
+
+ return NULL;
+}
+
+static Evas_Object *
+_gl_list_content_get(void *data, Evas_Object * obj, const char *part)
+{
+ GL_CHECK_NULL(obj);
+ GL_CHECK_NULL(part);
+ GL_CHECK_NULL(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK_NULL(gitem->item);
+ GL_CHECK_NULL(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ Evas_Object *image = NULL;
+
+ if (!strcmp(part, "elm.swallow.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, 0);
+
+ 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);
+ }
+
+ 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);
+
+ evas_object_image_file_set(image, gitem->item->thumb_url, NULL);
+ 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;
+ }
+ else
+ {
+ return NULL;
+ }
+ } else if (!g_strcmp0(part, "elm.progressbar.icon")) {
+ return __gl_list_show_pbar(obj, gitem);
+ }
+
+ return NULL;
+}
+
+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)
+{
+ gl_dbg("");
+}
+
+static void
+_gl_list_sel(void *data, Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(obj);
+ GL_CHECK(data);
+ gl_item *gitem = (gl_item *) data;
+ GL_CHECK(gitem->item);
+ GL_CHECK(gitem->ad);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("");
+
+ Elm_Object_Item *gen_item = elm_genlist_selected_item_get(obj);
+ if (gen_item)
+ {
+ 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)
+ {
+ gl_dbg("item or check_obj is NULL");
+ return;
+ }
+
+ gitem->checked = !gitem->checked;
+ elm_check_state_set(gitem->check_obj, gitem->checked);
+
+ if (gitem->checked)
+ {
+ gl_dbg("Append:%s", gitem->item->file_url);
+ gl_db_selected_list_append(ad, gitem);
+ }
+ else
+ {
+ gl_dbg("Remove:%s", gitem->item->file_url);
+ gl_db_selected_list_remove(ad, gitem);
+ }
+
+ cnt = gl_db_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);
+ }
+ else
+ {
+ GL_CHECK(gitem->item->uuid);
+ if (ad->listinfo.played_uuid) {
+ free(ad->listinfo.played_uuid);
+ ad->listinfo.played_uuid = NULL;
+ }
+ ad->listinfo.played_uuid = strdup(gitem->item->uuid);
+ /* Starting to play the video */
+ gl_dbg("Starting to play the video");
+ gl_ext_exec(data, GL_APP_VIDEOPLAYER);
+ }
+}
+
+static void
+_gl_list_update_view(void *data, Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(obj);
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ Evas_Object *genlist = obj;
+ int item_cnt = 0;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("");
+
+ elm_genlist_clear(genlist);
+
+ /* Get all medias count of current album */
+ int cnt = ad->maininfo.medias_cnt;
+ int i = 0;
+ gl_item *gitem = NULL;
+ bool it_showed = false;
+
+ 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 (gitem->item->type == MINFO_ITEM_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);
+ item_cnt++;
+ if (!it_showed && ad->listinfo.played_uuid &&
+ !g_strcmp0(ad->listinfo.played_uuid, gitem->item->uuid)) {
+ it_showed = true;
+ /*Move played item to middle position of view */
+ elm_genlist_item_show(gitem->elm_item,
+ ELM_GENLIST_ITEM_SCROLLTO_MIDDLE);
+ }
+ }
+ }
+
+ if (ad->listinfo.played_uuid) {
+ free(ad->listinfo.played_uuid);
+ ad->listinfo.played_uuid = NULL;
+ }
+
+ ad->listinfo.videos_cnt = item_cnt;
+ 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)
+ {
+ evas_object_hide(ad->listinfo.video_nocontents);
+ gl_list_clear_view(ad);
+ }
+ ad->listinfo.video_view = genlist;
+ }
+ else
+ {
+ ad->gridinfo.edit_view = genlist;
+ }
+ }
+ else
+ {
+ evas_object_del(genlist);
+
+ 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);
+ }
+
+ if (ad->listinfo.video_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);
+ }
+ }
+}
+
+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;
+ }
+ return 0;
+}
+
+Evas_Object *
+gl_list_create_view(void *data, Evas_Object * parent)
+{
+ GL_CHECK_NULL(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ Evas_Object *genlist = NULL;
+ int item_cnt = 0;
+ gl_item *gitem = NULL;
+ /* Get all medias count of current album */
+ int cnt = ad->maininfo.medias_cnt;
+ int view_mode = gl_get_view_mode(ad);
+ int i = 0;
+
+ gl_dbg("view mode=%d", view_mode);
+ if (view_mode == GL_VIEW_VIDEOLIST_EDIT)
+ {
+ ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO_EDIT;
+ }
+ else
+ {
+ ad->listinfo.videolic.item_style = GL_GENLIST_ITEM_STYLE_VIDEO;
+ }
+ 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);
+ }
+
+ 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);
+ if (gitem == NULL || gitem->item == NULL ||
+ gitem->item->uuid == NULL ) {
+ gl_dbgE("Invalid gitem!");
+ continue;
+ }
+ if (gitem->item->type == MINFO_ITEM_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);
+ item_cnt++;
+ }
+
+ }
+
+ ad->listinfo.videos_cnt = item_cnt;
+
+ 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;
+ 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;
+ }
+}
+
+int gl_list_clear_view(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.video_view) {
+ evas_object_del(ad->listinfo.video_view);
+ ad->listinfo.video_view = NULL;
+ ad->listinfo.video_nocontents = NULL;
+ }
+
+ return 0;
+}
+
+/* Update normal list view */
+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) {
+ gl_dbgW("Remove list nocontents view!");
+ if (ad->listinfo.video_nocontents) {
+ evas_object_hide(ad->listinfo.video_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;
+
+ /* 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);
+
+ elm_object_part_content_unset(ad->gridinfo.layout,
+ "elm.swallow.view");
+ evas_object_show(ad->listinfo.video_view);
+ elm_object_part_content_set(ad->gridinfo.layout,
+ "elm.swallow.view",
+ ad->listinfo.video_view);
+ } else {
+ _gl_list_update_view(ad, ad->listinfo.video_view, NULL);
+ }
+
+ return 0;
+}
+
+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)
+{
+ 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)
+ {
+ //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);
+ elm_object_part_content_set(ad->gridinfo.layout,
+ "elm.swallow.view",
+ ad->listinfo.video_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);
+ }
+
+ return 0;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <appsvc.h>
+#include "gallery.h"
+#include "gl-popup.h"
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-debug.h"
+#include "gl-listview.h"
+#include "gl-progressbar.h"
+#include "gl-strings.h"
+#include "gl-button.h"
+
+#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())
+#define GL_POPUP_MENUSTYLE_HEIGHT(x) ((113*x-1)*elm_config_scale_get())
+#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)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ if (ad->popupinfo.del_timer) {
+ ecore_timer_del(ad->popupinfo.del_timer);
+ ad->popupinfo.del_timer = NULL;
+ }
+
+ if (ad->popupinfo.popup) {
+ evas_object_del(ad->popupinfo.popup);
+ ad->popupinfo.popup = NULL;
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int __gl_popup_add_timer(void *data, double to_inc)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ if (ad->popupinfo.del_timer) {
+ ecore_timer_del(ad->popupinfo.del_timer);
+ ad->popupinfo.del_timer = NULL;
+ }
+
+ ad->popupinfo.del_timer = ecore_timer_add(to_inc, __gl_popup_timeout_cb,
+ data);
+ return 0;
+}
+
+static void __gl_popup_del_resp_cb(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ GL_CHECK(obj);
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ const char *text = NULL;
+
+ text = elm_object_text_get(obj);
+ GL_CHECK(text);
+ gl_dbg("Button: %s, mode: %d", text, ad->popupinfo.popup_mode);
+
+ if (!g_strcmp0(text, GL_STR_YES)) {
+ if (ad->popupinfo.popup_mode == GL_POPUP_ALBUM_DELETE)
+ gl_del_albums(ad);
+ }
+
+ if (ad->popupinfo.popup) {
+ evas_object_del(ad->popupinfo.popup);
+ ad->popupinfo.popup = NULL;
+ }
+}
+
+static void _gl_popup_move_to_album(void *data)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+ /**
+ * 'move_album_id == NULL' is new album case,
+ * other move/save to some existed album.
+ */
+ if (ad->albuminfo.move_album_id)
+ gl_move_to_album(ad);
+ else
+ gl_ui_move_to_newalbum(ad);
+}
+
+static void _gl_popup_resp_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ int mode = ad->popupinfo.popup_mode;
+ Ecore_IMF_Context *imf = ad->entryinfo.imf_context;
+ const char *text = NULL;
+
+ text = elm_object_text_get(obj);
+ GL_CHECK(text);
+ gl_dbg("Button: %s, mode: %d", text, mode);
+
+ if (mode == GL_POPUP_ALBUM_NEW_EMPTY ||
+ mode == GL_POPUP_ALBUM_NEW_DUPLICATE ||
+ mode == GL_POPUP_ALBUM_NEW_INVALID) {
+ if (!g_strcmp0(text, GL_STR_YES) ||
+ !g_strcmp0(text, GL_STR_OK)) {
+ ad->entryinfo.entry_mode = GL_ENTRY_NEW_ALBUM;
+ evas_object_show(ad->entryinfo.imf_entry);
+ elm_object_focus_set(ad->entryinfo.imf_entry, EINA_TRUE);
+ ecore_imf_context_input_panel_show(imf);
+ } else if (!g_strcmp0(text, GL_STR_NO) ||
+ !g_strcmp0(text, GL_STR_CANCEL)) {
+ if (ad->entryinfo.imf_entry)
+ ecore_imf_context_input_panel_hide(imf);
+
+ gl_ui_cancel_new_album(ad);
+ }
+ } else if (mode == GL_POPUP_ALBUM_RENAME_EMPTY ||
+ mode == GL_POPUP_ALBUM_RENAME_DUPLICATE ||
+ mode == GL_POPUP_ALBUM_RENAME_INVALID) {
+ if (!g_strcmp0(text, GL_STR_YES) ||
+ !g_strcmp0(text, GL_STR_OK)) {
+ evas_object_show(ad->entryinfo.imf_entry);
+ elm_object_focus_set(ad->entryinfo.imf_entry, EINA_TRUE);
+ ecore_imf_context_input_panel_show(imf);
+ } else if (!g_strcmp0(text, GL_STR_NO) ||
+ !g_strcmp0(text, GL_STR_CANCEL)) {
+ if (ad->entryinfo.imf_entry)
+ 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->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)
+{
+ 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);
+
+ int mode = ad->popupinfo.popup_mode;
+ const char *label = NULL;
+ /**
+ * Use index for album move,
+ * mainly for showing 'New album'
+ */
+ int idx = 0;
+
+ if (!strcmp(part, "elm.text"))
+ {
+ switch (mode)
+ {
+ case GL_POPUP_THUMB_MOVE:
+ idx = (int)data;
+ /* 1, Prevent pass NULL data */
+ idx -= 2;
+ if (idx == -1)
+ {
+ label = GL_STR_NEW_ALBUM; //add "New album" item.
+ }
+ else
+ {
+ Eina_List *album_list = NULL;
+
+ if (ad->albuminfo.cluster_list && ad->albuminfo.cluster_list->clist)
+ {
+ album_list = ad->albuminfo.cluster_list->clist;
+ }
+ else
+ {
+ gl_dbgE("cluster list is NULL.");
+ return NULL;
+ }
+
+ gl_cluster *album_item = eina_list_nth(album_list, idx);
+ if (album_item && album_item->cluster &&
+ album_item->cluster->uuid &&
+ album_item->cluster->display_name) {
+ if (strlen(album_item->cluster->display_name))
+ {
+ 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"
+ {
+ label = GL_ALBUM_PHOME_ROOT_NAME;
+ }
+ else
+ {
+ gl_dbgE("Album name[%s] is wrong!", album_item->cluster->display_name);
+ label = GL_ALBUM_PHOME_ROOT_NAME;
+ }
+ }
+ }
+ break;
+ default:
+ gl_dbg("default: wrong mode.");
+ break;
+ }
+
+ if (label)
+ {
+ return strdup(label);
+ }
+ else
+ {
+ gl_dbgE("label is NULL");
+ return NULL;
+ }
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+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)
+{
+ GL_CHECK_NULL(parent);
+ GL_CHECK_NULL(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+
+ if (item_type)
+ {
+ ad->popupinfo.popuplit.item_style = item_type;
+ }
+ else
+ {
+ 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.state_get = NULL;
+ ad->popupinfo.popuplit.func.del = NULL;
+
+ Evas_Object *genlist = elm_genlist_add(parent);
+ 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);
+
+ /* Attach 'ad' to genlist with 'GL_POPUP_OBJ_DATA_KEY' key to prevent use global variable. */
+ evas_object_data_set(genlist, GL_POPUP_OBJ_DATA_KEY, data);
+
+ return genlist;
+}
+
+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;
+ if (item)
+ {
+ elm_genlist_item_selected_set(item, EINA_FALSE);
+ }
+
+ /* 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);
+ if (ad->albuminfo.move_album_id) {
+ free(ad->albuminfo.move_album_id);
+ ad->albuminfo.move_album_id = NULL;
+ }
+ if (data)
+ ad->albuminfo.move_album_id = strdup((char *)data);
+ gl_dbg("Dest album id: %s", ad->albuminfo.move_album_id);
+
+ if (ad->popupinfo.popup) {
+ evas_object_del(ad->popupinfo.popup);
+ ad->popupinfo.popup = NULL;
+ }
+
+ _gl_popup_move_to_album(ad);
+}
+
+/* Append items to list in popup for 'Move' */
+static int _gl_popup_append_move_items(void *data, Evas_Object *genlist)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(genlist, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int idx = 0;
+ int i = 0;
+ int item_cnt = 0;
+ Eina_List *album_list = NULL;
+ int all_count = 0;
+ 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,
+ ELM_GENLIST_ITEM_NONE, _gl_popup_move_cb,
+ NULL);
+ item_cnt++;
+
+ if (ad->albuminfo.cluster_list && ad->albuminfo.cluster_list->clist) {
+ album_list = ad->albuminfo.cluster_list->clist;
+ all_count = eina_list_count(album_list);
+ } else {
+ gl_dbgE("cluster list is NULL");
+ return -1;
+ }
+
+ for (i = 0; i < all_count; i++) {
+ album_item = eina_list_nth(album_list, i);
+ GL_CHECK_VAL(album_item, -1);
+ GL_CHECK_VAL(album_item->cluster, -1);
+ GL_CHECK_VAL(album_item->cluster->display_name, -1);
+
+ idx++;
+ GL_CHECK_VAL(album_item->cluster->uuid, -1);
+ if (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.");
+ else {
+ elm_genlist_item_append(genlist, plit,
+ (void *)idx, NULL,
+ ELM_GENLIST_ITEM_NONE,
+ _gl_popup_move_cb,
+ album_item->cluster->uuid);
+ item_cnt++;
+ }
+ }
+ }
+ return item_cnt;
+}
+
+int gl_popup_create_albums_del_popup(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+
+ if (ad->popupinfo.popup != NULL) {
+ gl_dbg("The existed popup is deleted");
+ evas_object_del(ad->popupinfo.popup);
+ }
+
+ Evas_Object *popup = elm_popup_add(ad->maininfo.win);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+
+ 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,
+ __gl_popup_del_resp_cb, data);
+ btn2 = _gl_but_create_but_popup(popup, GL_STR_NO,
+ __gl_popup_del_resp_cb, data);
+ elm_object_part_content_set(popup, "button1", btn1);
+ elm_object_part_content_set(popup, "button2", btn2);
+
+ evas_object_show(popup);
+ ad->popupinfo.popup = popup;
+ ad->popupinfo.popup_mode = GL_POPUP_ALBUM_DELETE;
+ return 0;
+}
+
+static Evas_Object *_gl_popup_set_box(Evas_Object *parent,
+ Evas_Object *genlist, int item_cnt)
+{
+ GL_CHECK_NULL(parent);
+ GL_CHECK_NULL(genlist);
+ Evas_Object *box = elm_box_add(parent);
+
+ if (item_cnt < 4)
+ evas_object_size_hint_min_set(box, GL_POPUP_MENUSTYLE_WIDTH,
+ GL_POPUP_MENUSTYLE_HEIGHT(item_cnt));
+ else
+ evas_object_size_hint_min_set(box, GL_POPUP_MENUSTYLE_WIDTH,
+ GL_POPUP_MENUSTYLE_HEIGHT_MAX);
+
+ evas_object_show(genlist);
+ elm_box_pack_end(box, genlist);
+ return box;
+}
+
+int
+gl_popup_create_title_popup(void *data, gl_popup_mode mode, char *title, char *desc)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+
+ if (ad->popupinfo.popup)
+ {
+ gl_dbg("Delete existed popup.");
+ evas_object_del(ad->popupinfo.popup);
+ }
+
+ Evas_Object *popup = elm_popup_add(ad->maininfo.win);
+ ad->popupinfo.popup = popup;
+ ad->popupinfo.popup_mode = mode;
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_object_text_set(popup, desc);
+ Evas_Object *genlist = NULL;
+ Evas_Object *box = NULL;
+ int g_cnt = 0;
+ Evas_Object *btn1 = NULL;
+
+ switch (mode) {
+ case GL_POPUP_THUMB_MOVE:
+ elm_object_style_set(popup, GL_POPUP_STYLE_MIN_MENUSTYLE);
+ elm_object_part_text_set(popup, "title,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);
+ if ((g_cnt = _gl_popup_append_move_items(ad, genlist)) < 0) {
+ gl_dbgE("_gl_popup_append_move_items failed!");
+ goto POPUP_FAILED;
+ }
+ box = _gl_popup_set_box(popup, genlist, g_cnt);
+ elm_object_content_set(popup, box);
+ break;
+ default:
+ gl_dbg("Unexpected mode!");
+ break;
+ }
+
+ evas_object_show(popup);
+ return 0;
+
+ POPUP_FAILED:
+ gl_dbgE("POPUP_FAILED");
+ evas_object_del(popup);
+ ad->popupinfo.popup = NULL;
+ return -1;
+}
+
+int gl_popup_create_popup(void *data, gl_popup_mode mode, char *desc)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+
+ if (ad->popupinfo.popup) {
+ gl_dbg("The existed popup is deleted");
+ evas_object_del(ad->popupinfo.popup);
+ ad->popupinfo.popup = NULL;
+ }
+
+ /**
+ * Pogressbar is showed during moving or deleting medias,
+ * don't delete it while show popup.
+ */
+ if (mode != GL_POPUP_NOBUT_MOV_DEL)
+ gl_pb_del_pbar(ad);
+
+ Evas_Object *popup = elm_popup_add(ad->maininfo.win);
+ evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_object_text_set(popup, desc);
+ Evas_Object *btn1 = NULL;
+ Evas_Object *btn2 = NULL;
+
+ switch (mode) {
+ case GL_POPUP_NOBUT:
+ case GL_POPUP_NOBUT_APPEXIT:
+ 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);
+ break;
+ case GL_POPUP_ALBUM_NEW_EMPTY:
+ case GL_POPUP_ALBUM_NEW_DUPLICATE:
+ case GL_POPUP_ALBUM_NEW_INVALID:
+ case GL_POPUP_ALBUM_RENAME_EMPTY:
+ case GL_POPUP_ALBUM_RENAME_DUPLICATE:
+ case GL_POPUP_ALBUM_RENAME_INVALID:
+ btn1 = _gl_but_create_but_popup(popup, GL_STR_YES,
+ _gl_popup_resp_cb, data);
+ elm_object_part_content_set(popup, "button1", btn1);
+ btn2 = _gl_but_create_but_popup(popup, GL_STR_NO,
+ _gl_popup_resp_cb, data);
+ elm_object_part_content_set(popup, "button2", btn2);
+ break;
+ default:
+ gl_dbgE("Other popup mode...");
+ break;
+ }
+
+ 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;
+
+ return 0;
+}
+
+/* Update popup contents */
+int gl_popup_update_content(void *data, gl_popup_mode mode)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->popupinfo.popup, -1);
+ gl_dbg("mode: %d.", mode);
+
+ Evas_Object *genlist = NULL;
+ genlist = elm_object_content_get(ad->popupinfo.popup);
+ GL_CHECK_VAL(genlist, -1);
+ elm_genlist_clear(genlist);
+ int cnt = 0;
+
+ switch (mode) {
+ case GL_POPUP_THUMB_MOVE:
+ if ((cnt = _gl_popup_append_move_items(ad, genlist)) < 0) {
+ gl_dbgE("_gl_popup_append_move_items failed!");
+ return -1;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include "gallery.h"
+#include "gl-progressbar.h"
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-debug.h"
+#include "gl-albums.h"
+#include "gl-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 "<font=Helvetica Neue:style=Medium><font_size=42>"
+#define GL_FONT_STYLE_POP_E "</font_size></font>"
+
+static void
+_gl_pb_cancel_thread_pbar_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ gl_dbg("");
+ //set cancel false value
+ gl_thread_set_cancel_state(data, GL_PB_CANCEL_BUTTON);
+ //delete progressbar
+ gl_pb_del_pbar(data);
+}
+
+
+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);
+ gl_appdata *ad = (gl_appdata *)data;
+ Evas_Object *popup = NULL;
+ Evas_Object *progressbar = NULL;
+ Evas_Object *box = NULL;
+ Evas_Object *label = NULL;
+
+ gl_pb_del_pbar(ad);
+
+ popup = elm_popup_add(parent);
+ elm_object_part_text_set(popup, "title,text", title);
+
+ label = elm_label_add(popup);
+ elm_object_text_set(label, GL_STR_EMPTY);
+ evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_show(label);
+
+ progressbar = elm_progressbar_add(popup);
+ elm_progressbar_unit_format_set(progressbar, NULL);
+ elm_progressbar_value_set(progressbar, 0.0);
+ evas_object_size_hint_align_set(progressbar, EVAS_HINT_FILL,
+ EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(progressbar, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ evas_object_show(progressbar);
+
+ box = elm_box_add(popup);
+ evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_box_horizontal_set(box, EINA_FALSE);
+ elm_box_homogeneous_set(box, EINA_TRUE);
+ elm_box_pack_end(box, progressbar);
+ elm_box_pack_end(box, label);
+ evas_object_show(box);
+
+ elm_object_content_set(popup, box);
+
+ Evas_Object *btn1 = NULL;
+ btn1 = _gl_but_create_but_popup(popup, GL_STR_CANCEL,
+ _gl_pb_cancel_thread_pbar_cb, data);
+ elm_object_part_content_set(popup, "button1", btn1);
+
+ evas_object_show(popup);
+
+ ad->pbarinfo.pbar_popup = popup;
+ ad->pbarinfo.pbar = progressbar;
+ ad->pbarinfo.status_label = label;
+ ad->pbarinfo.finished_cnt = 0;
+
+ return 0;
+}
+
+int
+gl_pb_refresh_thread_pbar(void *data, int cur_cnt, int total_cnt)
+{
+ GL_CHECK_VAL(data, -1);
+ char status_info[GL_POPUP_DESC_LEN_MAX] = { 0, };
+ double percent = 0.0;
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->pbarinfo.pbar, -1);
+ GL_CHECK_VAL(ad->pbarinfo.status_label, -1);
+
+ snprintf(status_info, sizeof(status_info),
+ GL_FONT_STYLE_POP_S"%d/%d"GL_FONT_STYLE_POP_E, cur_cnt,
+ total_cnt);
+ /* Save medias count already operated */
+ ad->pbarinfo.finished_cnt = cur_cnt;
+ elm_object_text_set(ad->pbarinfo.status_label, status_info);
+ evas_object_show(ad->pbarinfo.status_label);
+
+ percent = (double)cur_cnt / (double)total_cnt;
+ elm_progressbar_value_set(ad->pbarinfo.pbar, percent);
+
+ return 0;
+}
+
+/* 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)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("destroy progressbar");
+
+ if (ad->pbarinfo.pbar_popup)
+ {
+ evas_object_del(ad->pbarinfo.pbar_popup);
+ ad->pbarinfo.pbar_popup = NULL;
+ ad->pbarinfo.pbar = NULL;
+ ad->pbarinfo.status_label = NULL;
+ ad->pbarinfo.finished_cnt = 0;
+ }
+ 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)
+{
+ GL_CHECK_NULL(parent);
+
+ Evas_Object *pbar = elm_progressbar_add(parent);
+ GL_CHECK_NULL(pbar);
+ elm_object_style_set(pbar, GL_PROGRESSBAR_STYLE_PROGRESS);
+ elm_progressbar_horizontal_set(pbar, EINA_TRUE);
+ evas_object_size_hint_align_set(pbar, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_size_hint_weight_set(pbar, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_progressbar_value_set(pbar, ratio);
+ evas_object_show(pbar);
+ 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;
+}
+
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <appcore-efl.h>
+#include <Evas.h>
+#include <aul.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <appsvc.h>
+#include "gallery.h"
+#include "gl-debug.h"
+#include "gl-albums.h"
+#include "gl-gridview.h"
+#include "gl-listview.h"
+#include "gl-controlbar.h"
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-db-handler.h"
+#include "gl-ext-ug-load.h"
+#include "gl-ext-exec.h"
+#include "gl-popup.h"
+#include "gl-progressbar.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_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"
+#define GL_BD_HOMESCREEN_PATH "homescreen-path"
+#define GL_BD_LOCKSCREEN_PATH "lockscreen-path"
+#define GL_BD_SELECT_ALBUM "select-album"
+#define GL_BD_SELECT_ONE "select-one"
+#define GL_BD_SELECT_MULTIPLE "select-multiple"
+#define GL_BD_SELECT_SETAS "select-setas"
+#define GL_BD_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"
+#define GL_BD_SETAS_WALLPALER "wallpaper"
+#define GL_BD_SETAS_CALLERID "callerid"
+
+#define GL_MIME_SEP ":"
+#define GL_MIME_TYPE_GALLERY "gallery.uri"
+
+struct text_part {
+ char *part;
+ char *msgid;
+};
+
+static struct text_part main_txt[] = {
+ {N_("txt_title"), N_("Application template"),},
+ {N_("txt_mesg"), N_("Click to exit"),},
+};
+
+/* User-defined function */
+static int _gallery_init_app_svc(void *data);
+
+static void _gallery_win_del_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ gl_dbgW("_gallery_win_del_cb!!");
+ GL_CHECK(data);
+
+ elm_exit();
+}
+
+static int _gallery_update_ts(Evas_Object *eo, struct text_part *tp, int size)
+{
+ int i = 0;
+
+ if (eo == NULL || tp == NULL || size < 0) {
+ return -1;
+ }
+ for (i = 0; i < size; i++) {
+ if (tp[i].part && tp[i].msgid) {
+ edje_object_part_text_set(eo, tp[i].part,
+ _(tp[i].msgid));
+ }
+ }
+
+ return 0;
+}
+
+static int _gallery_lang_changed_cb(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->maininfo.ly_main, -1);
+
+ _gallery_update_ts(elm_layout_edje_get(ad->maininfo.ly_main),
+ main_txt, sizeof(main_txt) / sizeof(main_txt[0]));
+
+ return 0;
+}
+
+static int _gallery_low_battery_cb(void *data)
+{
+ gl_dbg("");
+ return 1;
+}
+
+static Evas_Object *_gallery_create_win(void *data, const char *name)
+{
+ GL_CHECK_NULL(name);
+ GL_CHECK_NULL(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ Evas_Object *eo = NULL;
+ int w = 0;
+ int h = 0;;
+
+ eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
+ if (eo) {
+ 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);
+ }
+
+ gl_dbg("_gallery_create_win:done");
+ return eo;
+}
+
+static Evas_Object *_gallery_create_bg(Evas_Object *parent)
+{
+ GL_CHECK_NULL(parent);
+ Evas_Object *bg = NULL;
+
+ bg = elm_bg_add(parent);
+ 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);
+ evas_object_show(bg);
+
+ return bg;
+}
+
+static int _gallery_create_view_ly(gl_appdata *ad)
+{
+ 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);
+ 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,
+ ad->albuminfo.layout, GL_NAVI_ALBUMS,
+ GL_STR_ALBUMS);
+ return 0;
+}
+
+static Eina_Bool _gallery_create_albums_idler_cb(void *data)
+{
+ GL_CHECK_FALSE(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!");
+ } else {
+ gl_dbgW("\tIdler: Gallery is launched!");
+
+ /* Initialize libmedia-info */
+ gl_db_init(ad);
+ gl_dbg("minfo_init:done");
+
+ /* Get cluster list from libmedia-info */
+ gl_db_get_cluster_list(ad);
+ GL_CHECK_FALSE(ad->albuminfo.cluster_list);
+
+ gl_dbg("gl_db_get_cluster_list:done");
+ /* Set view mode */
+ gl_set_view_mode(ad, GL_VIEW_ALBUMS);
+ /**
+ * Disbale 'edit' button if none editable albums
+ * (albums except 'All albums'/'Camera shot') exist.
+ */
+ 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_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;
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static int _gallery_init_view(gl_appdata *ad)
+{
+ 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");
+
+ /* Background. */
+ ad->maininfo.bg = _gallery_create_bg(ad->maininfo.ly_main);
+ 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);
+
+ /* Indicator */
+ elm_win_indicator_mode_set(ad->maininfo.win, ELM_WIN_INDICATOR_SHOW);
+
+ /* 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");
+
+ elm_object_part_content_set(ad->maininfo.ly_main, "elm.swallow.content",
+ ad->maininfo.navi_bar);
+
+ /* Navigation Bar Item with a List */
+ _gallery_create_view_ly(ad);
+
+ return 0;
+}
+
+static int _gallery_create(void *data)
+{
+ gl_dbgW("==Create==");
+ GL_CHECK_VAL(data, -1);
+ 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);
+ ad->maininfo.win = win;
+
+ /* initialize gallery view */
+ if (_gallery_init_view(ad) != 0) {
+ gl_dbgE("_gallery_init_view failed");
+ return -1;
+ }
+
+ evas_object_show(win);
+ 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 */
+ gl_dbg("system event cb:done");
+ gl_reg_db_update_noti(ad);
+ gl_reg_mass_storage_noti(ad);
+
+ if (ad->albuminfo.create_albums_idler == NULL) {
+ /* Use idler to load albums view */
+ Ecore_Idler *idl = NULL;
+ idl = ecore_idler_add(_gallery_create_albums_idler_cb, ad);
+ ad->albuminfo.create_albums_idler = idl;
+ gl_dbg("create_albums_idler added: 0x%x",
+ ad->albuminfo.create_albums_idler);
+ }
+ /* 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;
+}
+
+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;
+ }
+ /* destroy rename album job.*/
+ if(ad->maininfo.rename_album_job) {
+ ecore_job_del(ad->maininfo.rename_album_job);
+ ad->maininfo.rename_album_job = NULL;
+ }
+ /* Destroy vibration timer */
+ if (ad->entryinfo.vibration_timer) {
+ ecore_timer_del(ad->entryinfo.vibration_timer);
+ ad->entryinfo.vibration_timer = NULL;
+ }
+ /* Free Ecore_Pipe object created */
+ if (ad->pbarinfo.sync_pipe) {
+ ecore_pipe_del(ad->pbarinfo.sync_pipe);
+ ad->pbarinfo.sync_pipe = NULL;
+ }
+
+ if (ad->pbarinfo.start_thread_timer) {
+ ecore_timer_del(ad->pbarinfo.start_thread_timer);
+ ad->pbarinfo.start_thread_timer = NULL;
+ }
+
+ if (ad->pbarinfo.del_pbar_idler) {
+ ecore_idler_del(ad->pbarinfo.del_pbar_idler);
+ ad->pbarinfo.del_pbar_idler = NULL;
+ }
+
+ /* Destroy timer for removing popup */
+ if (ad->popupinfo.del_timer) {
+ ecore_timer_del(ad->popupinfo.del_timer);
+ ad->popupinfo.del_timer = NULL;
+ }
+
+ /* Clear data in video list view */
+ _gl_list_clear_data(ad);
+ /* delete notification. */
+ gl_ui_destroy_notiinfo(ad);
+
+ /* Mass storage callback unregister. */
+ gl_dereg_mass_storage_noti();
+ /* DB update callback unregister. */
+ gl_dereg_db_update_noti();
+
+ /* Free memory allocated for appsvc */
+ _gallery_init_app_svc(ad);
+
+ ug_destroy_all();
+
+ gl_albums_free_data(data);
+
+ /* disconnet with libmedia-info */
+ gl_db_finalize(ad);
+
+ gl_dbgW("==Exit, bye~ ==");
+
+ return 0;
+}
+
+static int _gallery_terminate(void *data)
+{
+ gl_dbgW("==Terminate==");
+ GL_CHECK_VAL(data, -1);
+
+ return _gallery_close_app(data);
+}
+
+static int _gallery_pause(void *data)
+{
+ gl_dbgW("==Pause==");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ ad->maininfo.reentrant = TRUE;
+
+ ug_pause();
+
+ /* For select appsvc, destory ug when HOME key is pressed */
+ gl_ext_destroy_gallery_ug(ad);
+
+ return 0;
+}
+
+static int _gallery_resume(void *data)
+{
+ gl_dbgW("==Resume==");
+ GL_CHECK_VAL(data, -1);
+ 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;
+
+ /* 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);
+ Ecore_IMF_Context *imf = ad->entryinfo.imf_context;
+ ecore_imf_context_input_panel_show(imf);
+ }
+
+ /* Update view */
+ gl_update_view(ad, GL_UPDATE_VIEW_NORMAL);
+
+ return 0;
+}
+
+static int _gallery_reset_app(void *data, const char *cluster_id)
+{
+ 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 (ad->pbarinfo.sync_pipe) {
+ gl_dbgW("Cancel move/delete pthread/Pipe!");
+ /* Set cancel state to make child thread exit */
+ gl_thread_set_cancel_state(ad, GL_PB_CANCEL_RESET);
+ return -1;
+ }
+
+ if (view_mode == GL_VIEW_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);
+ }
+ 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");
+ }
+
+ gl_set_view_mode(ad, GL_VIEW_ALBUMS);
+ elm_win_activate(ad->maininfo.win);
+
+ return 0;
+}
+
+/* init appsvc launch related global variables */
+static int _gallery_init_app_svc(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_dbg("");
+ gl_appdata *ad = (gl_appdata *)data;
+
+ ad->albuminfo.aul_launch_type = GL_AUL_T_NONE;
+ ad->albuminfo.aul_file_type = GL_AUL_FILE_T_NONE;
+ ad->albuminfo.aul_setas_type = GL_AUL_SETAS_T_NONE;
+ if(ad->albuminfo.aul_album_id) {
+ free(ad->albuminfo.aul_album_id);
+ ad->albuminfo.aul_album_id = 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.aul_callid_size) {
+ free(ad->albuminfo.aul_callid_size);
+ ad->albuminfo.aul_callid_size = NULL;
+ }
+ if(ad->albuminfo.aul_callid_path) {
+ free(ad->albuminfo.aul_callid_path);
+ ad->albuminfo.aul_callid_path = NULL;
+ }
+ if(ad->albuminfo.aul_homescreen_path) {
+ free(ad->albuminfo.aul_homescreen_path);
+ ad->albuminfo.aul_homescreen_path = NULL;
+ }
+ if(ad->albuminfo.aul_lockscreen_path) {
+ free(ad->albuminfo.aul_lockscreen_path);
+ ad->albuminfo.aul_lockscreen_path = NULL;
+ }
+ return 0;
+}
+
+static int _gallery_parse_launch_type(bundle *b, void *data)
+{
+ GL_CHECK_VAL(b, -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;
+
+ /* get launch-type */
+ launch_type_str = appsvc_get_data(b, GL_BD_LAUNCH_TYPE);
+ if (launch_type_str == NULL) {
+ gl_dbg("set to default launch type: select-one");
+ ad->albuminfo.aul_launch_type = GL_AUL_T_SELECT_ONE;
+ return 0;
+ } else {
+ gl_dbg("launch-type: %s", launch_type_str);
+ }
+
+ if(!strcasecmp(launch_type_str, GL_BD_SELECT_ALBUM)) {
+
+ launch_type = GL_AUL_T_SELECT_ALBUM;
+ }
+ else if(!strcasecmp(launch_type_str, GL_BD_SELECT_ONE)) {
+
+ launch_type = GL_AUL_T_SELECT_ONE;
+ }
+ else if(!strcasecmp(launch_type_str, GL_BD_SELECT_MULTIPLE)) {
+
+ launch_type = GL_AUL_T_SELECT_MULTIPLE;
+ }
+ else if(!strcasecmp(launch_type_str, GL_BD_SELECT_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)) {
+
+ 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)
+ 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;
+
+ 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);
+ if (path) {
+ gl_dbg("homescreen-path: %s", path);
+ ad->albuminfo.aul_homescreen_path = strdup(path);
+ }
+ /* get lockscreen-path */
+ path = appsvc_get_data(b, GL_BD_LOCKSCREEN_PATH);
+ if (path) {
+ gl_dbg("lockscreen-path: %s", path);
+ ad->albuminfo.aul_lockscreen_path = strdup(path);
+ }
+ }
+ 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);
+ if (size) {
+ gl_dbg("callerid-size: %s", size);
+ ad->albuminfo.aul_callid_size = strdup(size);
+ }
+ /* get callerid-path */
+ path = appsvc_get_data(b, GL_BD_CALLERID_PATH);
+ if (path) {
+ gl_dbg("callerid-path: %s", path);
+ ad->albuminfo.aul_callid_path = strdup(path);
+ }
+ }
+
+ ad->albuminfo.aul_setas_type = setas_type;
+ }
+
+ ad->albuminfo.aul_launch_type = launch_type;
+ return 0;
+}
+
+/* analysis parameters */
+static int _gallery_parse_param(bundle *b, void *data)
+{
+ GL_CHECK_VAL(b, -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;
+
+ /* init */
+ _gallery_init_app_svc(ad);
+
+ /* save current bundle */
+ ad->albuminfo.recv_bundle = bundle_dup(b);
+
+ operation = appsvc_get_operation(b);
+
+ /* 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)
+ return -1;
+ gl_dbg("mime_type: %s", mime_type_str);
+
+ if(!strcmp(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);
+
+ char *szID = NULL;
+ char *str_buf = NULL;
+ szID = strtok_r(content, GL_MIME_SEP, &str_buf);
+ free(content);
+ 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_launch_by_mime = true;
+ gl_dbg("album_id: %s", ad->albuminfo.aul_album_id);
+ }
+ return 0;
+ }
+
+ gl_dbg("operation: %s", operation);
+
+ uri = appsvc_get_uri(b);
+ if(uri)
+ gl_dbg("uri: %s", uri);
+
+ /* OPERATION_VIEW */
+ if(!strcasecmp(operation, APPSVC_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;
+ ad->albuminfo.aul_file_type = GL_AUL_FILE_T_ALL; /* default */
+ file_type_str = appsvc_get_data(b, GL_BD_FILE_TYPE);
+ if(file_type_str) {
+
+ gl_dbg("file type: %s", file_type_str);
+ if (!strcmp(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)) {
+ ad->albuminfo.aul_file_type = GL_AUL_FILE_T_VIDEO;
+ }
+ }
+
+ const char *album_id_str = NULL;
+ /* get album-id */
+ album_id_str = appsvc_get_data(b, GL_BD_ALBUM_ID);
+
+ if(album_id_str) {
+ gl_dbg("album-id: %s", album_id_str);
+ ad->albuminfo.aul_album_id = strdup(album_id_str);
+ } else {
+ gl_dbg("album-id is invalid, set to default (ALL)");
+ ad->albuminfo.aul_album_id = strdup(GL_ALBUM_ALL_ID);
+ }
+ }
+ /* OPERATION_PICK */
+ else if(!strcasecmp(operation, APPSVC_OPERATION_PICK)) {
+
+ /* get file-type from mime */
+ ad->albuminfo.aul_file_type = GL_AUL_FILE_T_ALL; /* default */
+ mime = appsvc_get_mime(b);
+ if(mime) {
+
+ gl_dbg("mime: %s", mime);
+ if (!strcmp(mime, GL_MIME_IMAGE_ALL)) {
+ ad->albuminfo.aul_file_type = GL_AUL_FILE_T_IMAGE;
+ } else if (!strcmp(mime, GL_MIME_VIDEO_ALL)) {
+ ad->albuminfo.aul_file_type = GL_AUL_FILE_T_VIDEO;
+ }
+ }
+
+ _gallery_parse_launch_type(b, ad);
+ }
+
+ return 0;
+}
+
+static int _gallery_reset(bundle *b, void *data)
+{
+ gl_dbgW("==Reset==");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->maininfo.win, -1);
+ int ret = -1;
+
+ if (ad->maininfo.reentrant)
+ ad->maininfo.reentrant = FALSE;
+ else {
+ gl_dbgW("Gallery reentrant is not allowed, return!");
+ return 0;
+ }
+
+ /* Destroy gallery ug */
+ if (ad->uginfo.gallery_ug_called_by_me) {
+ gl_dbgW("Destroy Gallery UG launched, show App view!");
+ ug_destroy(ad->uginfo.gallery_ug_called_by_me);
+ ad->uginfo.gallery_ug_called_by_me = NULL;
+ }
+
+ /* Parse parameters */
+ if(_gallery_parse_param(b, 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("");
+ } else {
+ gl_dbgE("Failed to parse parameters!");
+ }
+ elm_win_activate(ad->maininfo.win);
+ return -1;
+ }
+
+ 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);
+ } else {
+/*@@ 3. Load Gallery UG @@*/
+ gl_dbg("Start loading Gallery UG");
+ gl_ext_load_gallery_ug(ad);
+
+ elm_win_activate(ad->maininfo.win);
+ }
+
+ return ret;
+}
+
+int gallery_reset_app(void *data, const char *cluster_id)
+{
+ 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);
+}
+
+int main(int argc, char *argv[])
+{
+ 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,
+ };
+
+ memset(&gl_ad, 0x00, sizeof(gl_appdata));
+ ops.data = &gl_ad;
+
+ ret = appcore_efl_main(PACKAGE, &argc, &argv, &ops);
+
+ return ret;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <media-svc.h>
+#include <appcore-efl.h>
+#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->check_obj = 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;
+ 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;
+ 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;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <Elementary.h>
+#include <app_service.h>
+#include "gl-ext-exec.h"
+#include "gl-debug.h"
+#include "gallery.h"
+#include "gl-db-handler.h"
+#include "gl-util.h"
+
+
+#define GL_APP_PKG_VIDEOPLAYER "org.tizen.video-player"
+
+#define GL_ARGV_VIDEO_LIST_TYPE "video_list_type"
+#define GL_ARGV_VIDEO_ALL_FOLDER_VIDEO "all_folder_video"
+#define GL_ARGV_VIDEO_FOLDER "folder"
+
+#define GL_ARGV_VIDEO_ORDER_TYPE "order_type"
+#define GL_ARGV_VIDEO_ORDER_DATE_DESC "date_desc"
+#define GL_ARGV_VIDEO_START_POS "start_pos_time"
+
+#define GL_ARGV_VIDEO_LAUNCH_APP "launching_application"
+#define GL_ARGV_VIDEO_LAUNCH_GALLERY "gallery"
+
+#define GL_ARGV_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)
+{
+ GL_CHECK_VAL(service, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_item *gitem = (gl_item *)data;
+ GL_CHECK_VAL(gitem->ad, -1);
+ gl_appdata *ad = (gl_appdata *)gitem->ad;
+ GL_CHECK_VAL(gitem->item, -1);
+ GL_CHECK_VAL(gitem->item->uuid, -1);
+ GL_CHECK_VAL(gitem->item->file_url, -1);
+
+ const char *video_path = gitem->item->file_url;
+ /* Albums view */
+ gl_cluster *cur_cluster = ad->albuminfo.current_album;
+ if (cur_cluster && cur_cluster->cluster)
+ {
+ gl_dbg("Album: %s", cur_cluster->cluster->display_name);
+ if (!g_strcmp0(cur_cluster->cluster->uuid, GL_ALBUM_ALL_ID))
+ {
+ gl_dbg("All album");
+ service_add_extra_data(service,
+ GL_ARGV_VIDEO_LIST_TYPE,
+ GL_ARGV_VIDEO_ALL_FOLDER_VIDEO);
+ service_add_extra_data(service,
+ GL_ARGV_VIDEO_ORDER_TYPE,
+ GL_ARGV_VIDEO_ORDER_DATE_DESC);
+ service_add_extra_data(service,
+ GL_ARGV_VIDEO_LAUNCH_APP,
+ GL_ARGV_VIDEO_LAUNCH_GALLERY);
+ }
+ else if (cur_cluster->cluster->type == MINFO_PHONE ||
+ cur_cluster->cluster->type == MINFO_MMC)
+ {
+ gl_dbg("Real album");
+ service_add_extra_data(service,
+ GL_ARGV_VIDEO_LIST_TYPE,
+ GL_ARGV_VIDEO_FOLDER);
+ service_add_extra_data(service,
+ GL_ARGV_VIDEO_ORDER_TYPE,
+ GL_ARGV_VIDEO_ORDER_DATE_DESC);
+ service_add_extra_data(service,
+ GL_ARGV_VIDEO_LAUNCH_APP,
+ GL_ARGV_VIDEO_LAUNCH_GALLERY);
+ }
+ else
+ {
+ gl_dbgE("Wrong type!");
+ }
+ }
+ 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)
+ return 0;
+ else
+ return -1;
+}
+
+static int
+_gl_ext_compose_exec_cmd(void *data, gl_ext_app_type type,
+ char *path, char **pkg_name)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_dbg("type:%d, path:%s", type, path);
+
+ switch (type)
+ {
+ case GL_APP_VIDEOPLAYER:
+ GL_CHECK_VAL(path, -1);
+ *pkg_name = GL_APP_PKG_VIDEOPLAYER;
+ break;
+ default:
+ *pkg_name = NULL;
+ }
+
+ return 0;
+}
+
+int
+gl_ext_exec(void *data, gl_ext_app_type type)
+{
+ GL_CHECK_VAL(data, GL_LAUNCH_FAIL);
+ gl_item *gitem = (gl_item *)data;
+ GL_CHECK_VAL(gitem->ad, GL_LAUNCH_FAIL);
+ 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);
+ 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.");
+ 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);
+
+ int ret = 0;
+ if (type == GL_APP_VIDEOPLAYER) {
+ if (path == NULL) {
+ service_destroy(service);
+ return GL_LAUNCH_FAIL;
+ }
+ if (_gl_ext_launch_video_player(data, service) != 0) {
+ service_destroy(service);
+ return GL_LAUNCH_FAIL;
+ }
+ } else {
+ service_set_operation(service, SERVICE_OPERATION_DEFAULT);
+ service_set_package(service, pkg_name);
+ ret = service_send_launch_request(service, NULL, NULL);
+ if (ret != SERVICE_ERROR_NONE) {
+ service_destroy(service);
+ gl_dbgE("service_send_launch_request failed[%d]!", ret);
+ return GL_LAUNCH_FAIL;
+ }
+ }
+
+ ret = service_destroy(service);
+ if (ret != SERVICE_ERROR_NONE) {
+ ad->uginfo.app_called_by_me = true;
+ return GL_LAUNCH_SUCCESS;
+ } else {
+ return GL_LAUNCH_FAIL;
+ }
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <Elementary.h>
+#include <Ecore_X.h>
+#include <appsvc.h>
+#include "gl-ext-ug-load.h"
+#include "gl-debug.h"
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-albums.h"
+#include "gl-gridview.h"
+#include "gl-listview.h"
+#include "gallery.h"
+#include "gl-popup.h"
+#include "gl-strings.h"
+
+#define GL_EXT_STR_BUNDLE_LEN 48
+
+#define GL_UG_PKG_IV "image-viewer-efl"
+#define GL_UG_PKG_GALLERY "gallery-efl"
+
+#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_BY_FOLER "By Folder"
+#define GL_ARGV_IV_VIEW_BY_ALL "All"
+#define GL_ARGV_IV_MEDIA_TYPE "Media type"
+#define GL_ARGV_IV_MEDIA_ALL "All"
+#define GL_ARGV_IV_MEDIA_IMAGE "Image"
+#define GL_ARGV_IV_MEDIA_VIDEO "Video"
+#define GL_ARGV_IV_ALBUM_INDEX "Album index"
+#define GL_ARGV_IV_SORT_BY "Sort By"
+#define GL_ARGV_IV_SORT_NAME "Name"
+#define GL_ARGV_IV_SORT_NAMEDESC "NameDesc"
+#define GL_ARGV_IV_SORT_DATE "Date"
+#define GL_ARGV_IV_SORT_DATEDESC "DateDesc"
+
+#define GL_ARGV_LAUNCH_TYPE "launch-type"
+#define GL_ARGV_FILE_TYPE "file-type"
+#define GL_ARGV_SETAS_TYPE "setas-type"
+#define GL_ARGV_CALLERID_SIZE "callerid-size"
+#define GL_ARGV_CALLERID_PATH "callerid-path"
+#define GL_ARGV_HOMESCREEN_PATH "homescreen-path"
+#define GL_ARGV_LOCKSCREEN_PATH "lockscreen-path"
+
+#define GL_ARGV_SETAS_WALLPALER "wallpaper"
+#define GL_ARGV_SETAS_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 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"
+
+static void __gl_ext_destroy_ug(void *data)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK(ad->uginfo.ug_called_by_me);
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("View mode: %d", view_mode);
+
+ gl_list_clear_view(ad);
+
+ /**
+ * 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)
+ 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_dbg("");
+ GL_CHECK(ug);
+ GL_CHECK(priv);
+
+ Evas_Object *base = NULL;
+ base = ug_get_layout(ug);
+ if (!base) {
+ gl_dbgE("ug_get_layout failed!");
+ ug_destroy(ug);
+ return;
+ }
+ gl_appdata *ad = (gl_appdata *)priv;
+
+ switch (mode) {
+ case UG_MODE_FULLVIEW:
+ evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND,
+ EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(ug_get_window(), base);
+ /* Disable effect when AUL, other show effect */
+ if(ad->albuminfo.aul_launch_type != GL_AUL_T_NONE &&
+ ad->albuminfo.aul_launch_type != GL_AUL_T_VIEW_ALBUM) {
+ gl_dbg("No animation.");
+ ug_disable_effect(ug);
+ }
+ evas_object_show(base);
+ break;
+ default:
+ break;
+ }
+}
+
+void
+_gl_ext_ug_destroy_cb(struct ui_gadget *ug, void *priv)
+{
+ GL_CHECK(priv);
+ gl_appdata *ad = (gl_appdata *)priv;
+ gl_dbg("");
+
+ if(ad->albuminfo.aul_launch_type == GL_AUL_T_NONE ||
+ ad->albuminfo.aul_launch_type == GL_AUL_T_VIEW_ALBUM) {
+ GL_CHECK(ad->uginfo.ug_called_by_me);
+ __gl_ext_destroy_ug(ad);
+ } else {
+ GL_CHECK(ad->uginfo.gallery_ug_called_by_me);
+ gl_dbg("Pause Gallery App.");
+ elm_win_lower(ad->maininfo.win);
+
+ 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);
+ ad->uginfo.gallery_ug_called_by_me = NULL;
+ }
+}
+
+/* Invoke Imageviewer UG */
+int gl_ext_load_iv_ug(void *data, gl_item *cur_item)
+{
+ GL_CHECK_VAL(cur_item, GL_UG_FAIL);
+ GL_CHECK_VAL(cur_item->item, GL_UG_FAIL);
+ GL_CHECK_VAL(data, GL_UG_FAIL);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->maininfo.win, GL_UG_FAIL);
+ Evas_Object *win = ad->maininfo.win;
+ struct ug_cbs cbs;
+ struct ui_gadget *ug = NULL;
+ bundle *param = NULL;
+ const char *album_id = NULL;
+ gl_dbg("");
+
+ if (ad->uginfo.ug_called_by_me) {
+ gl_dbg("Already exits some UG called by me");
+ return GL_UG_FAIL;
+ }
+ 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.destroy_cb = _gl_ext_ug_destroy_cb;
+ cbs.priv = ad;
+
+ param = bundle_create();
+ GL_CHECK_VAL(param, 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);
+
+ 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);
+
+ int grid_view_m = ad->gridinfo.grid_view_mode;
+
+ switch (view_mode) {
+ 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);
+ 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);
+ gl_dbg("Media type: Video");
+ } else {
+ bundle_add(param, 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);
+ gl_dbg("Media type: Video");
+ break;
+ default:
+ bundle_add(param, 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);
+ 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);
+ 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);
+
+ /* Sort by type */
+ int sort_type = ad->uginfo.sort_type;
+ switch (sort_type) {
+ case MINFO_MEDIA_SORT_BY_NAME_DESC:
+ /* Sort by display name descending */
+ bundle_add(param, GL_ARGV_IV_SORT_BY,
+ GL_ARGV_IV_SORT_NAMEDESC);
+ gl_dbg("Name descending");
+ break;
+ case MINFO_MEDIA_SORT_BY_NAME_ASC:
+ /* Sort by display name ascending */
+ bundle_add(param, GL_ARGV_IV_SORT_BY,
+ GL_ARGV_IV_SORT_NAME);
+ gl_dbg("Name ascending");
+ break;
+ case MINFO_MEDIA_SORT_BY_DATE_DESC:
+ /* Sort by modified_date descending */
+ bundle_add(param, GL_ARGV_IV_SORT_BY,
+ GL_ARGV_IV_SORT_DATEDESC);
+ gl_dbg("Date descending");
+ break;
+ case MINFO_MEDIA_SORT_BY_DATE_ASC:
+ /* Sort by modified_date ascending */
+ bundle_add(param, 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);
+ gl_dbg("no sort, use default Name ascending");
+ break;
+ }
+
+ ug = ug_create(NULL, GL_UG_PKG_IV, UG_MODE_FULLVIEW, param, &cbs);
+ ad->uginfo.ug_called_by_me = ug;
+ bundle_free(param);
+
+ if (ug) {
+ return GL_UG_SUCCESS;
+ } else {
+ gl_dbgE("ug_create failed!");
+ return GL_UG_FAIL;
+ }
+}
+
+void
+_gl_ext_gallery_ug_result_cb(struct ui_gadget *ug, bundle * result, void *priv)
+{
+ GL_CHECK(priv);
+ gl_appdata *ad = (gl_appdata *)priv;
+ gl_dbg("");
+
+ /* Send result to caller */
+ const char *ret = NULL;
+ bundle *aul_result = NULL;
+ appsvc_create_result_bundle(ad->albuminfo.recv_bundle, &aul_result);
+
+ 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);
+ }
+ 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);
+ }
+ 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);
+ }
+
+ 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);
+ }
+ 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);
+ }
+
+ 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);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if(ret)
+ appsvc_send_result(aul_result, APPSVC_RES_OK);
+ else
+ appsvc_send_result(aul_result, APPSVC_RES_CANCEL);
+
+ bundle_free(aul_result);
+}
+
+int
+gl_ext_load_gallery_ug(void *data)
+{
+ GL_CHECK_VAL(data, GL_UG_FAIL);
+ gl_appdata *ad = (gl_appdata *)data;
+ struct ug_cbs cbs;
+ struct ui_gadget *ug = NULL;
+ bundle *param = 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)
+ {
+ gl_dbg("Already exits some Gallery UG called by me, destroy it first!");
+ ug_destroy(ad->uginfo.gallery_ug_called_by_me);
+ ad->uginfo.gallery_ug_called_by_me = NULL;
+ }
+
+ memset(&cbs,0x00,sizeof(struct ug_cbs));
+
+ cbs.layout_cb = _gl_ext_ug_layout_cb;
+ cbs.result_cb = _gl_ext_gallery_ug_result_cb;
+ cbs.destroy_cb = _gl_ext_ug_destroy_cb;
+ cbs.priv = ad;
+
+ param = bundle_create();
+ if (!param)
+ {
+ return GL_UG_FAIL;
+ }
+
+ UG_INIT_EFL(win, UG_OPT_INDICATOR_ENABLE);
+
+ /* add launch-type */
+ launch_type = ad->albuminfo.aul_launch_type;
+ gl_dbg("launch-type: %d", launch_type);
+ switch (launch_type)
+ {
+ case GL_AUL_T_SELECT_ONE:
+ bundle_add(param, 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);
+ 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);
+
+ 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);
+ val = ad->albuminfo.aul_homescreen_path;
+ if(val) {
+ gl_dbg("homescreen-path: %s", val);
+ bundle_add(param, 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);
+ }
+
+ break;
+
+ case GL_AUL_SETAS_T_CALLER_ID:
+ bundle_add(param, 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);
+ }
+
+ val = ad->albuminfo.aul_callid_path;
+ if(val) {
+ gl_dbg("callerid-path: %s", val);
+ bundle_add(param, GL_ARGV_CALLERID_PATH, val);
+ }
+
+ break;
+
+ default:
+ bundle_free(param);
+ return GL_UG_FAIL;
+ }
+
+ break;
+
+ case GL_AUL_T_SELECT_ALBUM:
+ bundle_add(param, GL_ARGV_LAUNCH_TYPE, GL_ARGV_SELECT_ALBUM);
+ break;
+
+ default:
+ bundle_free(param);
+ return GL_UG_FAIL;
+ }
+
+ /* add file-type */
+ file_type = ad->albuminfo.aul_file_type;
+ gl_dbg("file-type: %d", file_type);
+ switch (file_type)
+ {
+ case GL_AUL_FILE_T_IMAGE:
+ bundle_add(param, 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);
+ break;
+
+ case GL_AUL_FILE_T_ALL:
+ bundle_add(param, GL_ARGV_FILE_TYPE, GL_ARGV_FILE_TYPE_ALL);
+ break;
+
+ default:
+ bundle_free(param);
+ return GL_UG_FAIL;
+ }
+
+ ug = ug_create(NULL, GL_UG_PKG_GALLERY, UG_MODE_FULLVIEW, param, &cbs);
+ bundle_free(param);
+
+ gl_dbg("ug_create: %p.", ug);
+ ad->uginfo.gallery_ug_called_by_me = ug;
+ if (ug) {
+ Evas_Object *ug_ly = ug_get_layout(ug);
+ if (ug_ly) {
+ evas_object_raise(ug_ly);
+ } else {
+ gl_dbgE("ug_get_layout failed!");
+ return GL_UG_FAIL;
+ }
+ return GL_UG_SUCCESS;
+ } else {
+ gl_dbgE("ug_create failed!");
+ return GL_UG_FAIL;
+ }
+}
+
+int
+gl_ext_destroy_gallery_ug(void *data)
+{
+ GL_CHECK_VAL(data, GL_UG_FAIL);
+ gl_dbg("");
+ gl_appdata *ad = (gl_appdata *)data;
+
+ /* For select 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) {
+
+ _gl_ext_ug_destroy_cb(ad->uginfo.gallery_ug_called_by_me, ad);
+ }
+
+ return GL_UG_SUCCESS;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <string.h>
+#include <Ecore_X.h>
+#include <glib.h>
+#include <linux/unistd.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <pthread.h>
+#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-popup.h"
+#include "gl-progressbar.h"
+#include "gl-strings.h"
+
+#define GALLERY_MAGIC_MAIN_CONTEXT (0x1983cdaf)
+#define GALLERY_MAGIC_DETAIL_LIST_ITEM (0x1977abcd)
+#define GALLERY_MAGIC_PIPE_DATA (0x0716ffcc)
+
+#define GALLERY_MAGIC unsigned int __magic
+#define GALLERY_MAGIC_SET(d, m) (d)->__magic = (m)
+#define GALLERY_MAGIC_CHECK(d, m) ((d) && ((d)->__magic == (m)))
+
+typedef struct
+{
+ GALLERY_MAGIC;
+ int finished_cnt;
+ int state; /* 0: operation is over; 1: operation is in process */
+ int popup_op;
+} gl_thread_pipe_data;
+
+
+static pid_t
+_gl_thread_gettid(void)
+{
+ return syscall(__NR_gettid);
+}
+
+static int _gl_thread_operate_medias(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int ret = -1;
+
+ switch (ad->maininfo.medias_op_type) {
+ case GL_MEDIA_OP_DELETE:
+ gl_dbg("Delete!");
+ ret = gl_del_selected(data);
+ break;
+ case GL_MEDIA_OP_MOVE:
+ gl_dbg("Move!");
+ ret = gl_move_selected(data);
+ break;
+ default:
+ gl_dbgE("Unknow media operation mode!");
+ break;
+ }
+
+ if (ret < 0) {
+ gl_dbgE("Operation failed!");
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+_gl_thread_update_view(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ switch (ad->maininfo.medias_op_type) {
+ case GL_MEDIA_OP_DELETE:
+ gl_dbg("Delete!");
+ gl_update_del_view(data);
+ break;
+ case GL_MEDIA_OP_MOVE:
+ gl_dbg("Move!");
+ gl_update_move_view(data);
+ break;
+ default:
+ gl_dbgE("Unknow media operation mode!");
+ break;
+ }
+
+ return 0;
+}
+
+static void *
+_gl_thread_data_thread(void *data)
+{
+ GL_CHECK_NULL(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ int cancel_flag = 0;
+
+ gl_dbg("@@@@@@@@@@ :::: Child thread ID = %d :::: @@@@@@@@@@", _gl_thread_gettid());
+ //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));
+ GALLERY_MAGIC_SET(&pipe_data, GALLERY_MAGIC_PIPE_DATA);
+ /* Set over state */
+ pipe_data.state = 0;
+ gl_thread_get_cancel_state(ad, &cancel_flag);
+
+ ecore_pipe_write(ad->pbarinfo.sync_pipe, &pipe_data, sizeof(gl_thread_pipe_data));
+
+ gl_dbg("@@@@@@@@@@ :::: Child thread done :::: @@@@@@@@@@");
+
+ return (void *)0;
+}
+
+static Eina_Bool _gl_thread_del_pbar_idler_cb(void *data)
+{
+ gl_dbg("Delete progressbar...");
+ GL_CHECK_CANCEL(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ /* Reset pb_cancel */
+ gl_thread_set_cancel_state(ad, GL_PB_CANCEL_NONE);
+ /* Operation done, destroy progressbar */
+ gl_pb_del_pbar(ad);
+
+ /* Destroy lock */
+ gl_thread_destroy_lock(ad);
+
+ if (ad->pbarinfo.del_pbar_idler) {
+ ecore_idler_del(ad->pbarinfo.del_pbar_idler);
+ ad->pbarinfo.del_pbar_idler = NULL;
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+static void
+_gl_thread_pipe_cb(void *data, void *buffer, unsigned int nbyte)
+{
+ gl_dbg(":::::::::: Main thread ID = %d ::::::::::", _gl_thread_gettid());
+ GL_CHECK(data);
+ GL_CHECK(buffer);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_thread_pipe_data *p_pipe_data = (gl_thread_pipe_data *) buffer;
+ gl_dbg("Pipe state is %d", p_pipe_data->state);
+
+ if (!GALLERY_MAGIC_CHECK(p_pipe_data, GALLERY_MAGIC_PIPE_DATA)) {
+ gl_dbgE("##### :: Check p_pipe_data Magic failed :: #####");
+ return;
+ }
+
+ int cancel_flag = false;
+ gl_thread_get_cancel_state(ad, &cancel_flag);
+
+ if (p_pipe_data->popup_op)
+ {
+ if (p_pipe_data->state)
+ {
+ /* Check cancel_flag */
+ if (cancel_flag != GL_PB_CANCEL_NORMAL) {
+ gl_dbgE("Failed to kill thread, try again!");
+ gl_thread_emit_next_signal(ad);
+ return;
+ }
+ char msg[GL_FILE_PATH_LEN_MAX] = { 0, };
+ gl_item *cur_gitem = NULL;
+ /* Get selected media */
+ gl_db_get_item_by_index(ad, p_pipe_data->finished_cnt, true, &cur_gitem);
+ GL_CHECK(cur_gitem);
+ GL_CHECK(cur_gitem->item);
+ GL_CHECK(cur_gitem->item->display_name);
+
+ if (p_pipe_data->popup_op == GL_POPUP_OP_SAME_ALBUM)
+ {
+ snprintf(msg, sizeof(msg), "Cannot move %s to the same album!",
+ cur_gitem->item->display_name);
+ }
+ else if (p_pipe_data->popup_op == GL_POPUP_OP_DUPLICATED_NAME)
+ {
+ snprintf(msg, sizeof(msg), "%s is duplicated, rename it!",
+ cur_gitem->item->display_name);
+ }
+ else if (p_pipe_data->popup_op == GL_POPUP_OP_PROTECTED_FILE)
+ {
+ snprintf(msg, sizeof(msg), "Cannot removed protected file %s!",
+ cur_gitem->item->display_name);
+ }
+ gl_dbg("Popup description: %s", msg);
+ gl_popup_create_popup(ad, GL_POPUP_NOBUT_MOV_DEL, msg);
+ }
+ else if (ad->popupinfo.popup)
+ {
+ /*
+ * If p_pipe_data->state is equal to 0,
+ * it means thread should be destoryed.
+ */
+ evas_object_del(ad->popupinfo.popup);
+ ad->popupinfo.popup = NULL;
+ }
+ }
+
+ /* Update progressbar state */
+ int all_cnt = gl_db_selected_list_count(ad);
+
+ if (p_pipe_data->state) {
+ /* Check cancel_flag */
+ if (cancel_flag != GL_PB_CANCEL_NORMAL) {
+ gl_dbgE("Failed to kill thread, try again!");
+ gl_thread_emit_next_signal(ad);
+ return;
+ }
+ /* 1. Moving/deleting is in porcess */
+ gl_pb_refresh_thread_pbar(ad, p_pipe_data->finished_cnt, all_cnt);
+ gl_dbg("@@@ finished/all = %d/%d, updating progressbar @@@",
+ p_pipe_data->finished_cnt, all_cnt);
+ /* Emit signal to notice child thread handle next media */
+ gl_dbg("Emit next signal...");
+ gl_thread_emit_next_signal(ad);
+ } else {
+ /* 2. Moving/deleting is over, show finished count */
+ gl_dbg("@@@ finished: %d, updating progressbar @@@",
+ ad->pbarinfo.finished_cnt);
+ gl_pb_refresh_thread_pbar(ad, ad->pbarinfo.finished_cnt,
+ ad->pbarinfo.finished_cnt);
+ ad->pbarinfo.finished_cnt = 0;
+ gl_dbg("@@@@@@@ :::: Pipe close && Update view :::: @@@@@@@");
+ int cancel_flag = false;
+ bool b_reset = false;
+ gl_thread_get_cancel_state(ad, &cancel_flag);
+ if (cancel_flag == GL_PB_CANCEL_RESET) {
+ /* Set medias_op_type none to stop refreshing view*/
+ ad->maininfo.medias_op_type = GL_MEDIA_OP_NONE;
+ gl_dbgW("Cancel error case, set reset state!");
+ b_reset = true;
+ }
+
+ /* Use idler to delete progressbar to refresh status totally */
+ if (ad->pbarinfo.del_pbar_idler) {
+ ecore_idler_del(ad->pbarinfo.del_pbar_idler);
+ ad->pbarinfo.del_pbar_idler = NULL;
+ }
+ Ecore_Idler *idler= NULL;
+ idler = ecore_idler_add(_gl_thread_del_pbar_idler_cb, ad);
+ ad->pbarinfo.del_pbar_idler = idler;
+
+ int mmc_state = ad->maininfo.mmc_state;
+ int op_type = ad->maininfo.medias_op_type;
+ gl_dbg("MMC state: %d, OP type: %d.", mmc_state, op_type);
+ /* Operate medias related to MMC while moving medias */
+ if (mmc_state == GL_MMC_STATE_REMOVED_MOVING) {
+ ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED;
+
+ /**
+ * Albums: Move/Delete.
+ *
+ * Case 1: Source folder does exist, update view.
+ * Case 2: Source folder is MMC, and it vanished.
+ */
+ gl_cluster *cur_album = ad->albuminfo.current_album;
+ if (cur_album && cur_album->cluster &&
+ cur_album->cluster->type == MINFO_MMC) {
+ gl_dbgW("MMC removed, change to albums view!");
+ gl_pop_to_ctrlbar_ly(ad, true);
+ } else {
+ _gl_thread_update_view(ad);
+ }
+ } else {
+ /* Operated files on MMC, reset MMC state */
+ if (mmc_state == GL_MMC_STATE_ADDED_MOVING)
+ ad->maininfo.mmc_state = GL_MMC_STATE_ADDED;
+ else if (mmc_state == GL_MMC_STATE_ADDING_MOVING)
+ ad->maininfo.mmc_state = GL_MMC_STATE_ADDED;
+ /* Refresh view */
+ _gl_thread_update_view(ad);
+ }
+
+ /* Free Ecore_Pipe object created */
+ if (ad->pbarinfo.sync_pipe) {
+ ecore_pipe_del(ad->pbarinfo.sync_pipe);
+ ad->pbarinfo.sync_pipe = NULL;
+ }
+
+ if (b_reset) {
+ /* Free selected list */
+ gl_db_selected_list_finalize(ad);
+ gl_dbgW("Thread cancellation is over, reset gallery!");
+ /* Continue remake gallery */
+ gallery_reset_app(ad, ad->albuminfo.aul_album_id);
+ } else {
+ /* Set medias_op_type none to stop refreshing view*/
+ ad->maininfo.medias_op_type = GL_MEDIA_OP_NONE;
+ }
+ }
+}
+
+/*******************************************************
+** Prototype : gl_thread_emit_next_signal
+** Description : Emit signal to notice child thread handle next media.
+** Input : void *data
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+int
+gl_thread_emit_next_signal(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ pthread_mutex_lock(&(ad->pbarinfo.refresh_lock));
+ gl_dbg("refresh_flag: %d.", ad->pbarinfo.refresh_flag);
+ if (ad->pbarinfo.refresh_flag == 0)
+ {
+ ad->pbarinfo.refresh_flag = 1;
+ pthread_cond_signal(&(ad->pbarinfo.refresh_cond));
+ }
+ pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock));
+
+ return 0;
+}
+
+/*******************************************************
+** Prototype : gl_thread_wait_next_signal
+** Description : Wait start signal to handle next media.
+** Input : void *data
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+int
+gl_thread_wait_next_signal(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ pthread_mutex_lock(&(ad->pbarinfo.refresh_lock));
+ gl_dbg("refresh_flag: %d.", ad->pbarinfo.refresh_flag);
+ while (ad->pbarinfo.refresh_flag == 0)
+ {
+ gl_dbg("Thread waiting...");
+ pthread_cond_wait(&(ad->pbarinfo.refresh_cond), &(ad->pbarinfo.refresh_lock));
+ }
+ ad->pbarinfo.refresh_flag = 0;
+ pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock));
+
+ return 0;
+}
+
+/*******************************************************
+** Prototype : gl_thread_set_cancel_state
+** Description : Set the value of cancel flag.
+** Input : void *data
+** Input : int val
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+int
+gl_thread_set_cancel_state(void *data, int val)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ pthread_mutex_lock(&(ad->pbarinfo.pbar_lock));
+ ad->pbarinfo.pbar_cancel = val;
+ pthread_mutex_unlock(&(ad->pbarinfo.pbar_lock));
+
+ return 0;
+}
+
+/*******************************************************
+** Prototype : gl_thread_get_cancel_state
+** Description : Get the value of cancel flag.
+** Input : void *data
+** Output : int* val
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+int
+gl_thread_get_cancel_state(void *data, int *val)
+{
+ GL_CHECK_VAL(val, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ pthread_mutex_lock(&(ad->pbarinfo.pbar_lock));
+ *val = ad->pbarinfo.pbar_cancel;
+ pthread_mutex_unlock(&(ad->pbarinfo.pbar_lock));
+
+ return 0;
+}
+
+
+/*******************************************************
+** Prototype : gl_thread_write_pipe
+** Description : Write date to pipe in order to make progressbar refreshed
+** Input : void *data
+** Input : int finished_cnt
+** Input : int popup_op
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+void
+gl_thread_write_pipe(void *data, int finished_cnt, int popup_op)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ int cancel_flag = false;
+
+ gl_dbg("Wait next signal...");
+ gl_thread_wait_next_signal(ad);
+
+ gl_thread_pipe_data pipe_data;
+ memset(&pipe_data, 0x00, sizeof(gl_thread_pipe_data));
+ GALLERY_MAGIC_SET(&pipe_data, GALLERY_MAGIC_PIPE_DATA);
+
+ pipe_data.state = 1;
+ pipe_data.finished_cnt = finished_cnt;
+ pipe_data.popup_op = popup_op;
+
+ gl_thread_get_cancel_state(ad, &cancel_flag);
+
+ if (cancel_flag == GL_PB_CANCEL_BUTTON ||
+ cancel_flag == GL_PB_CANCEL_MMC ||
+ cancel_flag == GL_PB_CANCEL_ERROR ||
+ cancel_flag == GL_PB_CANCEL_RESET)
+ {
+ //send cancel signal through pipe
+ pipe_data.finished_cnt = -1;
+ /* Set over state */
+ pipe_data.state = 0;
+ ecore_pipe_write(ad->pbarinfo.sync_pipe, &pipe_data, sizeof(gl_thread_pipe_data));
+ //exit the child thread
+ if (cancel_flag == GL_PB_CANCEL_BUTTON)
+ {
+ gl_dbg("Cancel button tapped, child thread exit!");
+ }
+ else if (cancel_flag == GL_PB_CANCEL_MMC)
+ {
+ gl_dbg("MMC removed, child thread exit!");
+ }
+ else if (cancel_flag == GL_PB_CANCEL_ERROR)
+ {
+ gl_dbg("Error happened, child thread exit!");
+ }
+ else if (cancel_flag == GL_PB_CANCEL_RESET) {
+ gl_dbg("Reset gallery, child thread exit!");
+ }
+
+ pthread_exit((void *)1);
+ }
+ else
+ {
+ gl_dbg("Writing pipe...");
+ ecore_pipe_write(ad->pbarinfo.sync_pipe, &pipe_data, sizeof(gl_thread_pipe_data));
+ }
+}
+
+/*******************************************************
+** Prototype : gl_thread_gen_data_thread
+** Description : Create child thread for moving or deleting medias
+** Input : void *data
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+int
+gl_thread_gen_data_thread(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ pthread_t tid;
+ pthread_attr_t attr;
+ int ret = -1;
+
+ gl_dbg("Creating child thread.");
+ //add pipe for update progressbar status
+ ad->pbarinfo.sync_pipe = ecore_pipe_add(_gl_thread_pipe_cb, ad);
+ //initialize thread attributes
+ ret = pthread_attr_init(&attr);
+ if (ret == 0)
+ {
+ ret = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ if (ret == 0)
+ {
+ //create child thread
+ ret = pthread_create(&tid, &attr, _gl_thread_data_thread, ad);
+ if (ret != 0)
+ {
+ gl_dbgE("[Error] ##### :: pthread_create failed :: #####");
+ pthread_attr_destroy(&attr);
+ return -1;
+ }
+ }
+ }
+
+ gl_dbg("\n\n[Done] @@@@@@@@@@ :::: pthread_create successfull :::: @@@@@@@@@@\n");
+ pthread_attr_destroy(&attr);
+
+ return 0;
+}
+
+/*******************************************************
+** Prototype : gl_thread_destroy_lock
+** Description : Destroy mutex lock.
+** Input : void *data
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+int
+gl_thread_destroy_lock(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("@@@@@@@@@@ :::: Destroy MUTEX :::: @@@@@@@@@@");
+
+ /**
+ * The variable below was accessed without holding a guarding lock.
+ * In a multithreaded environment, this can lead to a race condition.
+ * Add lock to prevent from RC.
+ */
+ pthread_mutex_lock(&(ad->pbarinfo.refresh_lock));
+ ad->pbarinfo.refresh_flag = 0;
+ pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock));
+
+ pthread_cond_destroy(&(ad->pbarinfo.refresh_cond));
+ pthread_mutex_destroy(&(ad->pbarinfo.pbar_lock));
+ pthread_mutex_destroy(&(ad->pbarinfo.refresh_lock));
+
+ return 0;
+}
+
+/*******************************************************
+** Prototype : gl_thread_init_lock
+** Description : Initialize mutex lock
+** Input : void *data
+** Output : None
+** Return Value :
+** Calls :
+** Called By :
+**
+** History :
+** 1.Date : 2011/06/10
+** Author : Samsung
+** Modification : Created function
+**
+*********************************************************/
+int
+gl_thread_init_lock(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("@@@@@@@@@@ :::: Initialize MUTEX :::: @@@@@@@@@@");
+
+ pthread_mutex_init(&(ad->pbarinfo.pbar_lock), NULL);
+ pthread_mutex_init(&(ad->pbarinfo.refresh_lock), NULL);
+ pthread_cond_init(&(ad->pbarinfo.refresh_cond), NULL);
+
+ /**
+ * The variable below was accessed without holding a guarding lock.
+ * In a multithreaded environment, this can lead to a race condition.
+ * Add lock to prevent from RC.
+ */
+ pthread_mutex_lock(&(ad->pbarinfo.refresh_lock));
+ ad->pbarinfo.refresh_flag = 0;
+ pthread_mutex_unlock(&(ad->pbarinfo.refresh_lock));
+
+ return 0;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <string.h>
+#include <Ecore_X.h>
+#include <glib.h>
+#include "gl-ui-util.h"
+#include "gl-util.h"
+#include "gl-ext-ug-load.h"
+#include "gl-ext-exec.h"
+#include "gl-button.h"
+#include "gl-gridview.h"
+#include "gl-controlbar.h"
+#include "gl-albums.h"
+#include "gl-listview.h"
+#include "gl-debug.h"
+#include "gl-db-handler.h"
+#include "gl-thread-util.h"
+#include "gl-popup.h"
+#include "gl-progressbar.h"
+#include "gl-strings.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
+
+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;
+}
+
+/**
+* Check album name is valid and remove unuseful characters
+* 1) not only includes space;
+* 2) contains invalid character;
+* 3) it's empty.
+*
+* @param b_new
+* true: add a new album ; false: rename a album.
+* @param b_enter
+* true: Enter key pressed ; false: Button Done clicked.
+*
+*/
+static int _gl_ui_get_valid_album_name(void *data, char* album_name,
+ bool b_new, bool b_enter)
+{
+ GL_CHECK_VAL(album_name, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata* ad = (gl_appdata*)data;
+ int mode = 0;
+ gl_dbg("Input album name: %s", album_name);
+ char *popup_desc;
+ popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, sizeof(char));
+ if (popup_desc == NULL) {
+ gl_dbg("memory allocation fail");
+ return -1;
+ }
+ /* Check album name length */
+ if (strlen(album_name) == 0) {
+ gl_dbgW("Inserted text is empty!");
+ if (b_enter) {
+ gl_dbg("Enter key pressed.");
+ goto INVALID_ALBUM_NAME;
+ return -1;
+ }
+
+ if (b_new)
+ mode = GL_POPUP_ALBUM_NEW_EMPTY;
+ else
+ mode = GL_POPUP_ALBUM_RENAME_EMPTY;
+ snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.<br>%s",
+ GL_STR_ENTRY_IS_EMPTY, GL_STR_RETRY_Q);
+ popup_desc[strlen(popup_desc)] = '\0';
+ gl_popup_create_popup(ad, mode, popup_desc);
+ goto INVALID_ALBUM_NAME;
+ }
+ gl_dbg("Inserted album name: %s, length: %d", album_name, strlen(album_name));
+
+ /* Removes leading and trailing whitespace */
+ g_strstrip((gchar*)album_name);
+ if (strlen(album_name) == 0) {
+ gl_dbgW("Album name includes only space!");
+ if (b_enter) {
+ gl_dbg("Enter key pressed.");
+ goto INVALID_ALBUM_NAME;
+ }
+
+ if (b_new)
+ mode = GL_POPUP_ALBUM_NEW_EMPTY;
+ else
+ mode = GL_POPUP_ALBUM_RENAME_EMPTY;
+ snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.<br>%s",
+ GL_STR_INVALID_INPUT_PARAMETER, GL_STR_RETRY_Q);
+ popup_desc[strlen(popup_desc)] = '\0';
+ gl_popup_create_popup(ad, mode, popup_desc);
+ goto INVALID_ALBUM_NAME;
+ }
+
+ /* Check if there is any invalid character in string */
+ if (gl_validate_album_name(album_name) == false) {
+ gl_dbgW("Album name includes invalid character!");
+ if (b_new)
+ mode = GL_POPUP_ALBUM_NEW_INVALID;
+ else
+ mode = GL_POPUP_ALBUM_RENAME_INVALID;
+ snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.<br>%s",
+ GL_STR_INVALID_INPUT_PARAMETER, GL_STR_RETRY_Q);
+ popup_desc[strlen(popup_desc)] = '\0';
+ gl_popup_create_popup(ad, mode, popup_desc);
+ goto INVALID_ALBUM_NAME;
+ }
+
+ free(popup_desc);
+
+ return 0;
+
+ INVALID_ALBUM_NAME:
+ free(popup_desc);
+ return -1;
+}
+
+/*
+* @param b_enter
+* True: Enter key on Keyboard pressed, False: Button Done clicked
+*/
+static 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");
+ goto NEW_ALBUM_FAILED;
+ }
+
+ if (ad->entryinfo.imf_context)
+ ecore_imf_context_input_panel_hide(ad->entryinfo.imf_context);
+
+ Evas_Object *entry = ad->entryinfo.imf_entry;
+ char album_name[GL_ALBUM_NAME_LEN_MAX] = { 0, };
+
+ /* Get utf8 format string */
+ if (gl_get_entry_text(entry, album_name, GL_ALBUM_NAME_LEN_MAX) != 0) {
+ gl_dbgE("Get entry text failed!");
+ goto NEW_ALBUM_FAILED;
+ }
+
+ /* 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);
+ return -1;
+ }
+ gl_dbg("Valid album name: %s", album_name);
+
+ /* Check whether the new folder exist */
+ char path[GL_DIR_PATH_LEN_MAX] = { 0, };
+ char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, };
+
+ /* Get default images path, make new album under it */
+ if (gl_get_default_images_path(dir_path) != 0) {
+ gl_dbgE("Failed to get default image dir path!");
+ goto NEW_ALBUM_FAILED;
+ }
+
+ /* Make dir full path of new album */
+ snprintf(path, GL_DIR_PATH_LEN_MAX, "%s/%s", dir_path, album_name);
+ path[strlen(path)] = '\0';
+ gl_dbg("New dir path: %s", path);
+
+ 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) {
+ char *popup_desc;
+ popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, sizeof(char));
+ if (popup_desc == NULL) {
+ gl_dbg("memory allocation fail");
+ return -1;
+ }
+
+ snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.<br>%s",
+ GL_STR_SAME_NAME_ALREADY_IN_USE, GL_STR_RETRY_Q);
+ popup_desc[strlen(popup_desc)] = '\0';
+ gl_popup_create_popup(ad, GL_POPUP_ALBUM_NEW_DUPLICATE,
+ popup_desc);
+ free(popup_desc);
+ gl_dbgW("New folder already exists and not NULL, return!");
+ return -1;
+ }
+
+ /* Save new album name */
+ 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_move_to_album(ad);
+ return 0;
+
+ NEW_ALBUM_FAILED:
+ _gl_ui_newalbum_cancel_cb(ad, NULL, NULL);
+ return -1;
+}
+
+static void _gl_ui_newalbum_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_newalbum_done(data, true);
+}
+
+static void _gl_ui_newalbum_done_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ gl_dbg("");
+ _gl_ui_newalbum_done(data, false);
+}
+
+static void
+_gl_ui_newalbum_cancel_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);
+}
+
+static void __gl_ui_rename_album_cancel_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK(ad->maininfo.navi_bar);
+ 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);
+ /* Update edit view */
+ gl_albums_update_items(ad);
+ return;
+}
+
+/*
+* @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)
+{
+ gl_dbg("b_enter: %d", b_enter);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ bool b_root_path = false;
+ gl_cluster *album_item = NULL;
+
+ if (gl_get_view_mode(ad) != GL_VIEW_ALBUMS_RENAME) {
+ gl_dbgE("View mode is wrong!");
+ goto RENAME_FAILED;
+ }
+
+ album_item = ad->albuminfo.selected_album;
+ if (album_item == NULL || album_item->cluster == NULL ||
+ album_item->cluster->uuid == NULL) {
+ gl_dbgE("selected_album is NULL!");
+ goto RENAME_FAILED;
+ }
+
+ char etxt[GL_FILE_NAME_LEN_MAX] = { 0, };
+ /* Get utf8 format string */
+ int ret = -1;
+ ret = gl_get_entry_text(ad->entryinfo.imf_entry, etxt,
+ GL_FILE_NAME_LEN_MAX);
+ if (ret != 0) {
+ gl_dbgE("Get entry text failed!");
+ goto RENAME_FAILED;
+ }
+
+ /* 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);
+ 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)) {
+ /**
+ * Root path, couldn't rename root path,
+ * make the new dest folder
+ * and move all files for root path to it.
+ */
+ gl_dbg("Rename [No Name] album's name.");
+ b_root_path = true;
+ }
+ }
+
+ /* Get dest folder path */
+ char temp_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) {
+ 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';
+ } else {
+ int length = 0;
+ int i = 0;
+
+ memcpy(temp_dir_path, dir_path, GL_DIR_PATH_LEN_MAX);
+ length = strlen(dir_path);
+
+ for (i = length; i >= 0; i--) {
+ if (temp_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,
+ strlen(etxt));
+ temp_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_dbgW("Same as current name!");
+ goto RENAME_FAILED;
+ }
+
+ /**
+ * If dir is empty, 1 is returned,
+ * if it contains at least 1 file, 0 is returned.
+ * On failure, -1 is returned.
+ */
+ if (ecore_file_dir_is_empty(temp_dir_path) == 0) {
+ char *popup_desc;
+ popup_desc = (char*)calloc(GL_POPUP_STRING_MAX, sizeof(char));
+ if (popup_desc == NULL) {
+ gl_dbg("memory allocation fail");
+ return -1;
+ }
+
+ snprintf(popup_desc, GL_POPUP_STRING_MAX, "%s.<br>%s",
+ GL_STR_SAME_NAME_ALREADY_IN_USE, GL_STR_RETRY_Q);
+ popup_desc[strlen(popup_desc)] = '\0';
+ gl_popup_create_popup(ad, GL_POPUP_ALBUM_RENAME_DUPLICATE,
+ popup_desc);
+ free(popup_desc);
+ gl_dbgW("New folder already exists and not NULL, return!");
+ return -1;
+ }
+
+ if (b_root_path) {
+ /**
+ * Case 1: Rename virtual album 'No Name'.
+ * It couldn't be done by updating album record in DB directly.
+ * Cuz it would change the folder path of all folder records,
+ * to make them invalid.
+ *
+ * Create new folder under default images path,
+ * Move all medias under root path to new folder.
+ */
+ if (gl_make_new_album(etxt) != 0) {
+ gl_popup_create_popup(ad, GL_POPUP_NOBUT,
+ GL_STR_UNABLE_TO_RENAME);
+ gl_dbgE("Failed to make a new directory!");
+ goto RENAME_FAILED;
+ }
+
+ /* Move medias from 'No Name' album to new album */
+ if (gl_move_root_album(ad, album_item, temp_dir_path) != 0) {
+ gl_dbg("gl_move_root_album failed!");
+ gl_popup_create_popup(ad, GL_POPUP_NOBUT,
+ GL_STR_UNABLE_TO_RENAME);
+ goto RENAME_FAILED;
+ } else {
+ gl_dbg("New album added, update albums list.");
+ ad->albuminfo.selected_album = NULL;
+ gl_db_update_cluster_list(ad);
+ }
+ } else {
+ /**
+ * Case 2: Rename normal album.
+ *
+ * Update album record in DB.
+ */
+ ret = minfo_update_cluster_name(ad->maininfo.db_handle,
+ album_item->cluster->uuid, etxt);
+ if (ret < 0) {
+ gl_dbg("minfo_update_cluster_name failed (%d)!", ret);
+ goto RENAME_FAILED;
+ }
+
+ /**
+ * Change folder name in file system
+ * for some special name, DB update success, but file mv failed.
+ * So, do this first.
+ */
+ if (ecore_file_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);
+ }
+ }
+ /* 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);
+ return 0;
+
+ RENAME_FAILED:
+ __gl_ui_rename_album_cancel_cb(ad, NULL, NULL);
+ 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)
+{
+ 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;
+}
+
+
+/* Select-all checkbox selected/deselected */
+static void _gl_ui_selall_check_changed(void *data, Evas_Object *obj,
+ void *event_info)
+{
+ GL_CHECK(obj);
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("view_mode: %d.", view_mode);
+
+ gl_item *current = NULL;
+ int i = 0;
+ int item_cnt = 0;
+ int sel_all_cnt = 0;
+ Eina_Bool state = EINA_FALSE;
+ state = elm_check_state_get(obj);
+ gl_dbg("Checkbox state: %d.", state);
+ /* 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)
+ {
+ file_type = MINFO_ITEM_IMAGE;
+ sel_all_cnt = 0;
+ }
+ else if (seg_mode == GL_CTRL_SEG_VIDEOS)
+ {
+ file_type = MINFO_ITEM_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)
+ {
+ 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)
+ {
+ continue;
+ }
+
+ sel_all_cnt++;
+ if (current->checked == state)
+ {
+ continue;
+ }
+ }
+
+ current->checked = state;
+
+ 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);
+
+ }
+
+ /* Update all realized items */
+ if (view_mode == GL_VIEW_VIDEOLIST_EDIT)
+ elm_genlist_realized_items_update(ad->gridinfo.edit_view);
+
+ /* 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);
+}
+
+/* Select-all background click, selected/deselected checkbox */
+static void _gl_ui_selall_bg_click_cb(void *data, Evas_Object *o,
+ const char *emission,
+ const char *source)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ Evas_Object *ly = NULL;
+ gl_dbg("view_mode: %d.", view_mode);
+
+ if (view_mode == GL_VIEW_THUMBS_EDIT ||
+ view_mode == GL_VIEW_VIDEOLIST_EDIT) {
+ ly = ad->gridinfo.edit_layout;
+ } else {
+ gl_dbgE("Wrong view!");
+ return;
+ }
+
+ Evas_Object *check = elm_object_part_content_get(ly, "selectall_check");
+ if (check) {
+ Eina_Bool new_state = EINA_FALSE;
+ Eina_Bool ck_state = elm_check_state_get(check);
+ /* uncheck->check */
+ if (ck_state == EINA_FALSE)
+ new_state = EINA_TRUE;
+
+ elm_check_state_set(check, new_state);
+
+ _gl_ui_selall_check_changed(ad, check, NULL);
+ } else {
+ gl_dbgE("Get select all checkbox object failed!");
+ }
+}
+
+
+static void
+_gl_ui_edit_cancel_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("");
+
+ 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_db_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_albums_change_to_view(ad);
+ gl_ui_destroy_selinfo(ad);
+ if (gl_check_gallery_empty(ad)) {
+ gl_ui_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);
+ }
+ }
+ }
+ else if (view_mode == GL_VIEW_THUMBS_EDIT)
+ {
+ _gl_destroy_thumbs_edit_view(ad);
+ gl_db_selected_list_finalize(ad);
+
+ gl_set_view_mode(ad, GL_VIEW_THUMBS);
+ if (ad->albuminfo.update_albums_list)
+ {
+ /*
+ * Update albums list if MMC added/removed,
+ */
+ ad->albuminfo.update_albums_list = false;
+ gl_refresh_albums_list(ad);
+ }
+
+ gl_grid_change_to_view(ad);
+ gl_ui_destroy_selinfo(ad);
+ }
+ else if (view_mode == GL_VIEW_VIDEOLIST_EDIT)
+ {
+ _gl_destroy_thumbs_edit_view(ad);
+ gl_db_selected_list_finalize(ad);
+ gl_set_view_mode(ad, GL_VIEW_VIDEOLIST);
+ if (ad->albuminfo.update_albums_list)
+ {
+ /*
+ * Update albums list if MMC added/removed
+ */
+ ad->albuminfo.update_albums_list = false;
+ gl_refresh_albums_list(ad);
+ }
+
+ gl_list_change_to_view(ad);
+ gl_ui_destroy_selinfo(ad);
+ }
+}
+
+/* callback after user tap Cancel button in option header in edit view */
+static void __gl_ui_click_cancel_edit_cb(void *data, Evas_Object *obj, void *event_info)
+{
+ 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);
+ return;
+}
+
+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)
+ {
+ /**
+ * Prevent changed to edit view in wrong way.
+ * 1. When invoke imageviewer UG;
+ * 2. First show thumbnails view, use idler to append other medias.
+ */
+ gl_dbg("UG invoked or appending gridview.");
+ return;
+ }
+
+ 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 */
+ /**
+ * 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.");
+ return;
+ }
+
+ gl_ui_destroy_notiinfo(ad);
+
+ 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,
+ GL_NAVI_ALBUMS_EDIT,
+ GL_STR_SELECT_ALBUM);
+ return;
+ }
+ else 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);
+ else
+ ad->gridinfo.edit_view = gl_grid_create_view(ad,
+ ad->maininfo.navi_bar,
+ GL_GRID_IMAGES);
+ }
+ 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);
+ }
+
+ 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);
+
+ 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_NAVI_THUMBS_EDIT, GL_STR_SELECT_ITEM);
+ edje_object_signal_emit(_EDJ(ad->gridinfo.edit_layout),
+ "elm,swallow_view,state,thumb_edit_default",
+ "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)
+{
+ GL_CHECK_VAL(ad, -1);
+ int view_mode = gl_get_view_mode(ad);
+ 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 -1;
+ }
+
+ if ((view_mode == GL_VIEW_THUMBS_EDIT) ||
+ (view_mode == GL_VIEW_VIDEOLIST_EDIT))
+ {
+
+ int cnt = gl_db_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 -1;
+ }
+
+ gl_popup_create_title_popup(ad, GL_POPUP_THUMB_MOVE,
+ GL_STR_MOVE, NULL);
+ return 0;
+ }
+ else
+ {
+ gl_dbg("Unknow mode!");
+ return -1;
+ }
+}
+
+static void
+_gl_ui_medias_del_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+
+ if (ad->uginfo.ug_called_by_me || ad->uginfo.app_called_by_me)
+ {
+ gl_dbg("UG or APP is already loaded, return.");
+ return;
+ }
+
+ 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);
+ if (cnt == 0)
+ {
+ gl_dbg("No thumbs selected, return!");
+ gl_popup_create_popup(ad, GL_POPUP_NOBUT, GL_STR_NO_FILES_SELECTED);
+ return;
+ }
+
+ gl_del_medias(ad);
+ }
+ else
+ {
+ gl_dbg("Unknow mode!");
+ }
+}
+
+static void
+_gl_ui_albums_del_cb(void *data, Evas_Object * obj, void *event_info)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+
+ if ((gl_get_view_mode(ad) == GL_VIEW_ALBUMS_EDIT))
+ {
+ int cnt = gl_db_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;
+ }
+ gl_popup_create_albums_del_popup(ad);
+ }
+ else
+ {
+ gl_dbg("Unknow mode!");
+ }
+}
+
+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)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int i = 0;
+ gl_item *gitem = NULL;
+ int _all_cnt = 0;
+ int db_all_cnt = 0;
+ gl_ctrl_seg_mode ctl_seg = GL_CTRL_SEG_ALL;
+ minfo_file_type file_type = MINFO_ITEM_NONE;
+ int view_mode = gl_get_view_mode(ad);
+
+ 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;
+ 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;
+ else if (ctl_seg == GL_CTRL_SEG_VIDEOS)
+ file_type = MINFO_ITEM_VIDEO;
+
+ for (i = 1; i <= db_all_cnt; i++) {
+ gl_db_get_item_by_index(ad, i, false,
+ &gitem);
+ if (gitem && gitem->item &&
+ (gitem->item->type == file_type))
+ _all_cnt++;
+ }
+ }
+ } else {
+ gl_dbg("Wrong view mode!");
+ return 0;
+ }
+
+ /**
+ * Set checkbox state
+ * except in albums edit view and selectioninfo view
+ */
+ gl_dbg("selected_cnt/_all_cnt = %d/%d", selected_cnt, _all_cnt);
+ Evas_Object *ly = NULL;
+ Evas_Object *check = NULL;
+ Eina_Bool state = EINA_FALSE;
+
+ if (selected_cnt == _all_cnt) {
+ /* Set checkbox checked */
+ state = EINA_TRUE;
+ } else {
+ /* Set checkbox unchecked */
+ 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;
+}
+
+/**
+* Update selectioinfo widget and view related to it
+*/
+static int _gl_ui_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);
+
+ 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;
+}
+
+/**
+* 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)
+{
+ 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_ui_destroy_selinfo(ad);
+ else
+ gl_ui_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);
+ /* 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)
+{
+ 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_dbg("Back button clicked, change view to background.");
+ GL_CHECK(data);
+ Evas_Object *win = (Evas_Object *) data;
+ elm_win_lower(win);
+ return;
+}
+
+static int __gl_ui_append_object_item(Evas_Object *cbar, Evas_Object *object)
+{
+ 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
+
+ elm_object_item_disabled_set(item, EINA_TRUE);
+ return 0;
+}
+
+/**
+ * Use naviframe api to push albums view to stack.
+ * @param obj is the content to be pushed.
+ */
+static int __gl_ui_push_view_albums(void *data, Evas_Object *parent,
+ Evas_Object *obj, char *title)
+{
+ gl_dbg("GL_NAVI_ALBUMS");
+ GL_CHECK_VAL(obj, -1);
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Elm_Object_Item *nf_it = NULL;
+ 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);
+ 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 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);
+ 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);
+ }
+ /* Push view to stack */
+ nf_it = elm_naviframe_item_push(parent, title, end_btn, NULL, obj, NULL);
+ ad->albuminfo.nf_it = nf_it;
+ /* Set tool controlbar to bottom */
+ elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR,
+ bot_bar);
+ return 0;
+}
+
+/**
+ * Use naviframe api to push albums edit view to stack.
+ * @param obj is the content to be pushed.
+ */
+static int __gl_ui_push_view_albums_edit(void *data, Evas_Object *parent,
+ Evas_Object *obj, char *title)
+{
+ gl_dbg("GL_NAVI_ALBUMS_EDIT");
+ GL_CHECK_VAL(obj, -1);
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Elm_Object_Item *nf_it = NULL;
+ Elm_Object_Item *cancel_it = NULL;
+ Elm_Object_Item *del_it = NULL;
+ Evas_Object *bot_bar = NULL;
+
+ /* create tool controlbar downside */
+ bot_bar = _gl_ctrl_create_toolbar(ad, 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 */
+ cancel_it = elm_toolbar_item_append(bot_bar, GL_CBAR_ICON_CANCEL, NULL,
+ __gl_ui_click_cancel_edit_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);
+
+ ad->albuminfo.nf_it_edit = nf_it;
+ /* Set tool bar to bottom */
+ elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR,
+ bot_bar);
+ return 0;
+}
+
+/**
+ * Use naviframe api to push thumbnails view to stack.
+ * @param obj is the content to be pushed.
+ */
+static int __gl_ui_push_view_thumbs(void *data, Evas_Object *parent,
+ Evas_Object *obj, char *title)
+{
+ gl_dbg("GL_NAVI_THUMBS");
+ GL_CHECK_VAL(obj, -1);
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Elm_Object_Item *nf_it = NULL;
+ Elm_Object_Item *edit_it = NULL;
+ Evas_Object *bot_bar = NULL;
+ Evas_Object *segment = NULL;
+
+ /* create tool controlbar downside */
+ bot_bar = _gl_ctrl_create_toolbar(ad, 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);
+ ad->gridinfo.edit_it = edit_it;
+ /* add segment */
+ segment = _gl_ctrl_create_segment(ad, bot_bar);
+ if(segment) {
+ Elm_Object_Item *it = NULL;
+ it = elm_toolbar_item_append(bot_bar, NULL, NULL, NULL,
+ NULL);
+ elm_object_item_part_content_set(it, "object", segment);
+ }
+ }
+ /* Push to stack */
+ 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);
+ return 0;
+}
+
+
+/**
+ * Use naviframe api to push thumbnails eidt view to stack.
+ * @param obj is the content to be pushed.
+ */
+static int __gl_ui_push_view_thumbs_edit(void *data, Evas_Object *parent,
+ Evas_Object *obj, char *title)
+{
+ gl_dbg("GL_NAVI_THUMBS_EDIT");
+ GL_CHECK_VAL(obj, -1);
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Elm_Object_Item *nf_it = NULL;
+ Elm_Object_Item *del_it = NULL;
+ Elm_Object_Item *move_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);
+ GL_CHECK_VAL(bot_bar, -1);
+ /* 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);
+ /* 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);
+
+ ad->gridinfo.nf_it_edit = nf_it;
+ /* Set tool bar to bottom */
+ elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR,
+ bot_bar);
+
+ return 0;
+}
+
+/**
+ * Use naviframe api to push albums rename view to stack.
+ * @param obj is the content to be pushed.
+ */
+static int __gl_ui_push_view_albums_rename(void *data, Evas_Object *parent,
+ Evas_Object *obj, char *title)
+{
+ gl_dbg("GL_NAVI_ALBUMS_RENAME");
+ GL_CHECK_VAL(obj, -1);
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Elm_Object_Item *nf_it = NULL;
+ Evas_Object *done_btn = NULL;
+ Evas_Object *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);
+ /* Add 'Cancel' button */
+ cancel_btn = _gl_but_create_but(obj, GL_BUT_CANCEL,
+ GL_BUTTON_STYLE_NAVI_TITLE);
+ 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,
+ cancel_btn);
+ /* Add 'Done' button */
+ done_btn = _gl_but_create_but(obj, GL_BUT_DONE,
+ GL_BUTTON_STYLE_NAVI_TITLE);
+ 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,
+ done_btn);
+ ad->entryinfo.done_btn = done_btn;
+ return 0;
+}
+
+/**
+ * Use naviframe api to push new album view to stack.
+ * @param obj is the content to be pushed.
+ */
+static int __gl_ui_push_view_albums_new(void *data, Evas_Object *parent,
+ Evas_Object *obj, char *title)
+{
+ gl_dbg("GL_NAVI_ALBUMS_NEW");
+ GL_CHECK_VAL(obj, -1);
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Elm_Object_Item *nf_it = NULL;
+ Evas_Object *done_btn = NULL;
+ Evas_Object *cancel_btn = NULL;
+
+ 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);
+ /* Add 'Cancel' button */
+ cancel_btn = _gl_but_create_but(obj, GL_BUT_CANCEL,
+ GL_BUTTON_STYLE_NAVI_TITLE);
+ 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,
+ cancel_btn);
+ /* Add 'Done' button */
+ done_btn = _gl_but_create_but(obj, GL_BUT_DONE,
+ GL_BUTTON_STYLE_NAVI_TITLE);
+ 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,
+ 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)
+{
+ 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);
+ }
+ return 0;
+}
+
+int gl_ui_disable_toolbar_item(void *data, bool disabled, gl_navi_mode mode,
+ bool edit)
+{
+ 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);
+ return 0;
+}
+
+int gl_ui_disable_toolbar_items(void *data, Elm_Object_Item *nf_it)
+{
+ 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);
+ }
+
+ return 0;
+}
+
+/* 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)
+{
+ 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;
+ }
+}
+
+int gl_ui_cancel_rename_album(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_dbg("");
+ __gl_ui_rename_album_cancel_cb(data, NULL, NULL);
+
+ return 0;
+}
+
+int
+gl_ui_cancel_new_album(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_dbg("");
+ _gl_ui_newalbum_cancel_cb(data, NULL, NULL);
+
+ return 0;
+}
+
+int
+gl_ui_move_to_newalbum(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ Evas_Object *editfield_ly = NULL;
+ 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);
+ 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);
+ ecore_imf_context_input_panel_show(ad->entryinfo.imf_context);
+
+ return 0;
+}
+
+int gl_ui_rename_album(gl_cluster *album_item)
+{
+ GL_CHECK_VAL(album_item, -1);
+ GL_CHECK_VAL(album_item->cluster, -1);
+ GL_CHECK_VAL(album_item->cluster->display_name, -1);
+ GL_CHECK_VAL(album_item->ad, -1);
+ gl_appdata *ad = (gl_appdata *)album_item->ad;
+ int view_mode = gl_get_view_mode(ad);
+ 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;
+ }
+ if (view_mode != GL_VIEW_ALBUMS_EDIT) {
+ gl_dbgE("Unexpected view mode(%d)!", view_mode);
+ return -1;
+ }
+
+ /* save album selected for rename */
+ ad->albuminfo.selected_album = 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);
+ 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_RENAME, GL_STR_CHNAGE_NAME);
+ elm_entry_cursor_line_end_set(ad->entryinfo.imf_entry);
+ elm_object_focus_set(ad->entryinfo.editfield, TRUE);
+ ecore_imf_context_input_panel_show(ad->entryinfo.imf_context);
+ return 0;
+}
+
+int gl_ui_create_title_and_push(void *data, Evas_Object *parent,
+ Evas_Object *obj, gl_navi_mode mode, char *title)
+{
+ GL_CHECK_VAL(obj, -1);
+ GL_CHECK_VAL(parent, -1);
+ GL_CHECK_VAL(data, -1);
+
+ if (mode == GL_NAVI_ALBUMS)
+ __gl_ui_push_view_albums(data, parent, obj, title);
+ else if (mode == GL_NAVI_ALBUMS_EDIT)
+ __gl_ui_push_view_albums_edit(data, parent, obj, title);
+ else if (mode == GL_NAVI_THUMBS)
+ __gl_ui_push_view_thumbs(data, parent, obj, title);
+ else if (mode == GL_NAVI_THUMBS_EDIT)
+ __gl_ui_push_view_thumbs_edit(data, parent, obj, title);
+ else if (mode == GL_NAVI_ALBUMS_RENAME)
+ __gl_ui_push_view_albums_rename(data, parent, obj, title);
+ else if (mode == GL_NAVI_ALBUMS_NEW)
+ __gl_ui_push_view_albums_new(data, parent, obj, title);
+ gl_dbg("Done");
+ 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)
+{
+ 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;
+}
+
+int gl_ui_edit_cancel(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ Elm_Object_Item *nf_it = NULL;
+
+ if (view_mode == GL_VIEW_ALBUMS_EDIT ||
+ view_mode == GL_VIEW_ALBUMS_RENAME) {
+ if (view_mode != GL_VIEW_ALBUMS_EDIT) {
+ gl_dbg("GL_VIEW_ALBUMS_xxx->Edit");
+ gl_set_view_mode(ad, GL_VIEW_ALBUMS_EDIT);
+ }
+ nf_it = ad->albuminfo.nf_it;
+ } else if (view_mode == GL_VIEW_THUMBS_EDIT ||
+ view_mode == GL_VIEW_VIDEOLIST_EDIT) {
+ nf_it = ad->gridinfo.nf_it;
+ }
+ elm_naviframe_item_pop_to(nf_it);
+ _gl_ui_edit_cancel_cb(ad, NULL, NULL);
+
+ return 0;
+}
+
+/* Back to normal thumbnail view */
+int gl_ui_back_to_normal(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ _gl_destroy_thumbs_edit_view(ad);
+ 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<br>%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;
+}
+
+/**
+* Update checkbox state and add click signal to Select-all widget.
+* Show arrow button in thumbnails/list edit mode.
+*/
+int gl_ui_show_selall(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ Eina_Bool ck_state = EINA_FALSE;
+ Evas_Object *view_ly = NULL;
+ char *sig = "selectall_show";
+
+ gl_dbg("view_mode: %d.", view_mode);
+ 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))
+ ck_state = EINA_TRUE;
+ if (view_mode == GL_VIEW_VIDEOLIST_EDIT)
+ sig = "selectall_show_video";
+ } else {
+ gl_dbgE("Wrong view!");
+ return -1;
+ }
+
+ const char *text = NULL;
+ text = edje_object_part_text_get(_EDJ(view_ly), "selectall_text");
+ if (text == NULL || g_strcmp0(text, GL_STR_SELECT_ALL))
+ edje_object_part_text_set(_EDJ(view_ly), "selectall_text",
+ GL_STR_SELECT_ALL);
+
+ Evas_Object *old_check = NULL;
+ old_check = elm_object_part_content_unset(view_ly, "selectall_check");
+ if (old_check)
+ evas_object_del(old_check);
+
+ Evas_Object *check = elm_check_add(view_ly);
+ elm_object_style_set(check, GL_CHECKBOX_STYLE_DEFAULT);
+ evas_object_propagate_events_set(check, 0);
+ elm_check_state_set(check, ck_state);
+
+ elm_object_part_content_set(view_ly, "selectall_check", check);
+ evas_object_smart_callback_add(check, "changed",
+ _gl_ui_selall_check_changed, ad);
+ edje_object_signal_emit(_EDJ(view_ly), sig, "elm");
+
+ /* Add signal to select-all bg */
+ edje_object_signal_callback_del(_EDJ(view_ly), "elm,action,click",
+ "selectall_bg",
+ _gl_ui_selall_bg_click_cb);
+ edje_object_signal_callback_add(_EDJ(view_ly), "elm,action,click",
+ "selectall_bg",
+ _gl_ui_selall_bg_click_cb, ad);
+
+ return 0;
+}
+
+/* Update checkbox state of Select-all and selectioninfo */
+int gl_ui_update_select_widgets(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ /* Update checkbox state of Select-all */
+ gl_ui_show_selall(ad);
+ /* Update selectioninfo */
+ int cnt = 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;
+
+ return 0;
+}
+
+Evas_Object *gl_ui_create_main_ly(Evas_Object *parent)
+{
+ 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");
+ evas_object_size_hint_weight_set(layout,
+ EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ elm_win_resize_object_add(parent, layout);
+ evas_object_show(layout);
+
+ return layout;
+}
+
+Evas_Object *gl_ui_create_naviframe(Evas_Object *parent)
+{
+ GL_CHECK_NULL(parent);
+ Evas_Object *navi_bar = NULL;
+
+ 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");
+
+ return navi_bar;
+}
+
+Evas_Object *gl_ui_create_view_ly(Evas_Object *parent)
+{
+ gl_dbg("");
+ GL_CHECK_NULL(parent);
+
+ Evas_Object *layout = NULL;
+ layout = gl_ui_load_edj(parent, GL_EDJ_FILE, GL_GRP_VIEW_LAYOUT);
+ GL_CHECK_NULL(layout);
+ evas_object_show(layout);
+
+ return layout;
+}
+
+int _gl_ui_elm_bg_file_set(Evas_Object *bg, gl_item *git)
+{
+ if (git == NULL || git->item == NULL) {
+ gl_dbgE("Invalid item :%p", git);
+ elm_bg_file_set(bg, GL_DEFAULT_THUMB_ICON, NULL);
+ return -1;
+ }
+
+ elm_bg_file_set(bg, _GETICON(git->item->thumb_url), NULL);
+ return 0;
+}
--- /dev/null
+/*
+Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
+
+This file is part of org.tizen.gallery
+Written by Sangjin Han <sjhan.han@samsung.com>,
+ Jiansong Jin <jiansong.jin@samsung.com>,
+ Jonghyuk Lee <jhyuk47.lee@samsung.com>,
+ Chaolong Lin <chaolong.lin@samsung.com>,
+ Yongjun Zhao <yj123.zhao@samsung.com>
+
+PROPRIETARY/CONFIDENTIAL
+
+This software is the confidential and proprietary information of
+SAMSUNG ELECTRONICS ("Confidential Information").
+You shall not disclose such Confidential Information and shall use it only
+in accordance with the terms of the license agreement you entered into with
+SAMSUNG ELECTRONICS.
+SAMSUNG make no representations or warranties about the suitability of
+the software, either express or implied, including but not limited to
+the implied warranties of merchantability, fitness for a particular purpose,
+or non-infringement.
+SAMSUNG shall not be liable for any damages suffered by licensee as a result
+of using, modifying or distributing this software or its derivatives.
+*/
+
+#include <sys/stat.h>
+#include <sys/statvfs.h>
+#include <vconf.h>
+#include <vconf-keys.h>
+#include <errno.h>
+#include <devman_haptic.h>
+#include <media-thumbnail.h>
+#include "gl-debug.h"
+#include "gallery.h"
+#include "gl-albums.h"
+#include "gl-gridview.h"
+#include "gl-listview.h"
+#include "gl-util.h"
+#include "gl-ui-util.h"
+#include "gl-controlbar.h"
+#include "gl-thread-util.h"
+#include "gl-popup.h"
+#include "gl-progressbar.h"
+#include "gl-ext-ug-load.h"
+#include "gl-ext-exec.h"
+#include "gl-strings.h"
+
+#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
+
+/* Use timer to show progressbar totally before write pipe */
+static Eina_Bool _gl_start_thread_op_timer_cb(void *data)
+{
+ gl_dbg("Emit START signal...");
+ GL_CHECK_CANCEL(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ /* Emit signal to notice child thread to handle next item. */
+ gl_thread_emit_next_signal(ad);
+ if (ad->pbarinfo.start_thread_timer) {
+ ecore_timer_del(ad->pbarinfo.start_thread_timer);
+ ad->pbarinfo.start_thread_timer = NULL;
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+/**
+* Use thread to move/delete medias
+* for displaying progrssabar UI
+*/
+static int _gl_use_thread_operate_medias(void *data, char *pbar_title, int all_cnt, int op_type)
+{
+ gl_dbg("all_cnt: %d, op_type: %d.", all_cnt, op_type);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ /* Initialize thread mutex lock */
+ gl_thread_init_lock(ad);
+ /* Make progressbar */
+ gl_pb_make_thread_pbar(ad, ad->maininfo.win, pbar_title);
+ /* Set pb_cancel, indicates thread operation is beginning */
+ gl_thread_set_cancel_state(ad, GL_PB_CANCEL_NORMAL);
+ /* Initialize progressbar */
+ gl_pb_refresh_thread_pbar(ad, 0, all_cnt);
+ /* Use timer to emit next signal to show progressbarbar totally */
+ if (ad->pbarinfo.start_thread_timer) {
+ ecore_timer_del(ad->pbarinfo.start_thread_timer);
+ ad->pbarinfo.start_thread_timer = NULL;
+ }
+ Ecore_Timer *timer = NULL;
+ timer = ecore_timer_add(GL_TIMER_INTERVAL_PBAR_SHOWED,
+ _gl_start_thread_op_timer_cb, ad);
+ ad->pbarinfo.start_thread_timer = timer;
+ /* Set media operation type */
+ ad->maininfo.medias_op_type = op_type;
+ /* Generate child thread */
+ gl_thread_gen_data_thread(ad);
+ return 0;
+}
+
+static void _gl_db_update_noti_cb(keynode_t *key, void *data)
+{
+ GL_CHECK(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbgW("VCONFKEY_FILEMANAGER_DB_STATUS changed!");
+ int mmc_state = -1;
+
+ vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc_state);
+
+ if (mmc_state == -1)
+ {
+ gl_dbg("Error when check MMC Status");
+ return;
+ }
+
+ if (mmc_state == VCONFKEY_SYSMAN_MMC_MOUNTED)
+ {
+ gl_dbg("mmc_state[%d] : VCONFKEY_SYSMAN_MMC_MOUNTED", mmc_state);
+ if (ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED)
+ ad->maininfo.mmc_state = GL_MMC_STATE_ADDING_MOVING;
+ else
+ ad->maininfo.mmc_state = GL_MMC_STATE_ADDED;
+
+ 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 */
+ if (ad->popupinfo.popup &&
+ (ad->popupinfo.popup_mode == GL_POPUP_THUMB_MOVE)) {
+ gl_dbg("Add MMC albums to popup.");
+ gl_popup_update_content(ad, GL_POPUP_THUMB_MOVE);
+ }
+ }
+ else if (mmc_state == VCONFKEY_SYSMAN_MMC_REMOVED ||
+ mmc_state == VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED)
+ {
+ gl_dbg("mmc_state[%d] : VCONFKEY_SYSMAN_MMC_REMOVED", mmc_state);
+ if (ad->maininfo.mmc_state == GL_MMC_STATE_ADDED_MOVING)
+ {
+ /*
+ * Set pb_cancel status,
+ * indicates MMC removed while moving or deleting.
+ */
+ gl_thread_set_cancel_state(ad, GL_PB_CANCEL_MMC);
+ /* MMC moved while moving or deleting */
+ ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED_MOVING;
+ } else if (ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED_MOVING) {
+ gl_dbgW("View updated on GL_MMC_STATE_ADDED_MOVING");
+ return;
+ } else
+ {
+ /* MMC is extracted */
+ ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED;
+ }
+
+ 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 */
+ if (ad->popupinfo.popup &&
+ (ad->popupinfo.popup_mode == GL_POPUP_THUMB_MOVE)) {
+ gl_dbg("Remove MMC albums from popup.");
+ gl_popup_update_content(ad, GL_POPUP_THUMB_MOVE);
+ }
+ }
+}
+
+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
+* True: Update albums list and medias list, then update normal view.
+* False: Get new medias for current view from DB
+* then update view to synchronize data with Myfile.
+* Use case:
+* Update edit gridview/listview.
+*/
+static int _gl_update_thumb_items(void *data, bool b_update_albums_list)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ bool b_edit_m = false;
+
+ gl_dbg("view_mode: %d, b_update_albums_list: %d.", view_mode,
+ b_update_albums_list);
+ if (view_mode == GL_VIEW_THUMBS_EDIT ||
+ view_mode == GL_VIEW_VIDEOLIST_EDIT) {
+ gl_dbg("Edit view.");
+ b_edit_m = true;
+ }
+
+ /**
+ * 1, Update albums list and medias_elist,
+ * 2, Update medias_elist.
+ */
+ if (b_update_albums_list)
+ gl_refresh_albums_list(ad);
+ else
+ gl_db_update_item_list(ad);
+
+ if (ad->maininfo.medias_cnt == 0) {
+ /* All items deleted, change to albms view */
+ gl_pop_to_ctrlbar_ly(ad, !b_update_albums_list);
+ } else {
+ if (view_mode == GL_VIEW_VIDEOLIST) {
+ gl_list_update_view(ad);
+ } else if (gl_ui_display_nocontents(ad)) {
+ gl_dbg("none video/image, show nocontents");
+ /* Remove invalid widgets */
+ gl_del_invalid_widgets(ad, GL_INVALID_NEW_ENTRY_NOC);
+ } else if (view_mode == GL_VIEW_THUMBS) {
+ gl_grid_update_items(ad);
+ } else if (view_mode == GL_VIEW_THUMBS_EDIT) {
+ gl_grid_change_to_edit(ad);
+ } else {
+ gl_list_change_to_edit(ad);
+ }
+
+ /* Normal view, return */
+ if (!b_edit_m)
+ return 0;
+
+ /* Remove invalid widgets if none medias selected */
+ if (gl_db_selected_list_count(ad) == 0)
+ gl_del_invalid_widgets(ad, GL_INVALID_NEW_ENTRY);
+
+ /**
+ * Update albums list when change to normal view.
+ * Maybe some empty albums exist.
+ */
+ if (!b_update_albums_list) {
+ gl_dbg("Update albums list when cancelled.");
+ ad->albuminfo.update_albums_list = true;
+ }
+ }
+
+ return 0;
+}
+
+/*
+* return file extension, f.e. jpg; then return new path without ext.
+*/
+static bool
+_gl_get_file_ext(const char *file_path, char *file_ext, char *new_path)
+{
+ int i = 0;
+
+ for (i = strlen(file_path); i >= 0; i--)
+ {
+ if ((file_path[i] == '.') && (i < GL_FILE_PATH_LEN_MAX))
+ {
+ g_strlcpy(file_ext, &file_path[i + 1], GL_FILE_EXT_LEN_MAX);
+ g_strlcpy(new_path, file_path, i + 1);
+ new_path[i] = '\0';
+ gl_dbg("path without extension :%s", new_path);
+ return true;
+ }
+
+ if (file_path[i] == '/') //meet the dir. no ext
+ {
+ return true;
+ }
+ }
+ return true;
+}
+
+/* Check if there is any MMC file contained in select_medias_elist */
+static bool _gl_check_mmc_file_selected(void *data)
+{
+ gl_dbg("");
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_item *gitem = NULL;
+ int i = 0;
+ int on_mmc = -1;
+ int cnt = gl_db_selected_list_count(ad);
+ for (i = 0; i < cnt; i++) {
+ gitem = NULL;
+ on_mmc = -1;
+
+ gitem = gl_db_selected_list_get_nth(ad, i);
+ /* File on MMC is selected */
+ if (gitem && gitem->item && gitem->item->file_url) {
+ on_mmc = strncmp(GL_ROOT_PATH_MMC,
+ gitem->item->file_url,
+ strlen(GL_ROOT_PATH_MMC));
+ if (on_mmc == 0)
+ return true;;
+ }
+ }
+ return false;
+}
+
+/* Stop vibrate device */
+static int _gl_stop_vibration(void *data)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int ret = -1;
+
+ if (ad->entryinfo.haptic_handle > 0) {
+ ret = device_haptic_stop_play(ad->entryinfo.haptic_handle);
+ if (ret != 0)
+ gl_dbgE("device_haptic_stop_play 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;
+ }
+
+ return 0;
+}
+
+static Eina_Bool _gl_vibration_timer_cb(void *data)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ _gl_stop_vibration(data);
+
+ if (ad->entryinfo.vibration_timer) {
+ ecore_timer_del(ad->entryinfo.vibration_timer);
+ ad->entryinfo.vibration_timer = NULL;
+ }
+ return ECORE_CALLBACK_CANCEL;
+}
+
+/* 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-info DB asynchronously.
+* While move/copy mass data in My Files appliation,
+* After move/copy done in My files, check the dest folder in Gallery.
+* You'll find its content is changing.
+* gl_file_mv() operate libmedia-info DB synchronously, so it's faster than media-server.
+*/
+
+/*
+* stop using "rename" when moving from mmc to phone for correct db update.
+*/
+Eina_Bool
+gl_file_mv(void *data, 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("src: %s", src);
+ gl_dbg("dest: %s", dst);
+
+ if (rename(src, dst))
+ {
+ /*
+ * File cannot be moved directly because
+ * it resides on a different mount point.
+ */
+ if (errno == EXDEV)
+ {
+ /*
+ * From->To: MMC->Phone or Phone->MMC
+ */
+ gl_dbg("errno = EXDEV(%d): Cross-device link", errno);
+ struct stat st;
+
+ /*
+ * Make sure this is a regular file before
+ * we do anything fancy.
+ */
+ stat(src, &st);
+ if (S_ISREG(st.st_mode))
+ {
+ /*
+ * Copy to dst file
+ */
+ if (!ecore_file_cp(src, dst))
+ {
+ gl_dbg("ecore_file_cp failed!");
+ goto FAIL;
+ }
+
+ /*
+ * If ecore_file_cp() works,
+ * media-server will also add new record
+ * to media table via minfo_add_media().
+ * But minfo_copy_media() will be invoked in advance,
+ * if it update DB correctly,
+ * minfo_add_media() will insert nothing to DB.
+ */
+ if ((ret = minfo_copy_media(ad->maininfo.db_handle,
+ src, dst, type)) < 0)
+ gl_dbg("minfo_copy_media failed (ret=%d)!", ret);
+
+
+ /*
+ * Delete src file
+ */
+ if (!ecore_file_unlink(src))
+ gl_dbg("ecore_file_unlink failed!");
+
+ /*
+ * Delete old media record and src thumbnail file.
+ */
+ if ((ret = minfo_delete_media(ad->maininfo.db_handle,
+ src)) < 0)
+ gl_dbg("minfo_delete_media failed (ret=%d)!", ret);
+
+ goto PASS;
+ }
+ gl_dbg("S_ISREG fail!");
+ }
+
+ gl_dbg("Fail! errno = %d", errno);
+ goto FAIL;
+ }
+
+ /*
+ * From->To: MMC->MMC or Phone->Phone
+ */
+
+ /*
+ * If rename() works, media-server will call minfo_delete_media()
+ * to delete the old media record firstly, then add new record to
+ * media table via minfo_add_media().
+ * But minfo_move_media() will be invoked in advance.
+ */
+ if ((ret = minfo_move_media(ad->maininfo.db_handle, src, dst, type)) < 0)
+ {
+ gl_dbg("minfo_move_media failed (ret=%d)!", ret);
+ goto FAIL;
+ }
+
+PASS:
+ return EINA_TRUE;
+
+FAIL:
+ return EINA_FALSE;
+}
+
+bool
+gl_validate_album_name(const char *new_name)
+{
+ GL_CHECK_FALSE(new_name);
+ char invalid_chars[] = { '/', '\\', ':', '*', '?', '"', '<', '>', '|', '\0' };
+ char *ptr = invalid_chars;
+
+ gl_dbg("new album name is %s\n", new_name);
+ while (*ptr != '\0')
+ {
+ gl_dbg("invalid character is %c", *ptr);
+ if (strchr(new_name, (*ptr)) != NULL)
+ {
+ return false;
+ }
+ ++ptr;
+ }
+
+ return true;
+}
+
+int
+gl_get_entry_text(Evas_Object * entry, char *entry_text, int len_max)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(entry_text, -1);
+ GL_CHECK_VAL(entry, -1);
+
+ memset(entry_text, 0x00, len_max);
+
+ char *entry_str = (char *)elm_entry_entry_get(entry);
+ if (entry_str)
+ {
+ if (strlen(entry_str) == 0)
+ {
+ gl_dbg("Entry string is empty!");
+ }
+ else
+ {
+ char *entry_utf8 = elm_entry_markup_to_utf8(entry_str); // changes user input to utf-8 encoding format
+ if (entry_utf8 == NULL)
+ {
+ gl_dbgE("Make entry string to UTF8 failed!");
+ return -1;
+ }
+ else if (strlen(entry_utf8) == 0)
+ {
+ gl_dbg("Entry text is empty!");
+ }
+ else
+ {
+ g_strlcpy(entry_text, entry_utf8, len_max);
+ entry_text[len_max - 1] = '\0';
+ }
+
+ free(entry_utf8);
+ entry_utf8 = NULL;
+ }
+ }
+ else
+ {
+ gl_dbgE("Get entry string failed!");
+ return -1;
+ }
+
+ return 0;
+}
+
+/**
+* Change utf8 string to markup, then set it as entry text.
+* To fix special character "&" issue, to convert "&" to "&". f.e.
+* Myfiles->rename folder to AB&C->Gallery/Rename ->displayed as "AB"
+*/
+int gl_set_entry_text(Evas_Object *entry, char *entry_text)
+{
+ GL_CHECK_VAL(entry, -1);
+ char *entry_makeup = NULL;
+ gl_dbg("Entry UTF8 text: %s.", entry_text);
+
+ if (entry_text) {
+ entry_makeup = elm_entry_utf8_to_markup(entry_text);
+ if (entry_makeup == NULL) {
+ gl_dbgE("Make utf8 string to makeup failed!");
+ return -1;
+ }
+ gl_dbg("Entry makeup text: %s.", entry_makeup);
+ }
+ /* Empty string set if entry_makeup is NULL */
+ elm_entry_entry_set(entry, entry_makeup);
+
+ if (entry_makeup) {
+ free(entry_makeup);
+ entry_makeup = NULL;
+ }
+
+ return 0;
+}
+
+int
+gl_get_default_images_path(char *directory_path)
+{
+ int len = 0;
+ GL_CHECK_VAL(directory_path, -1);
+
+ len = snprintf(directory_path, GL_DIR_PATH_LEN_MAX, "%s",
+ GL_ROOT_PATH_PHONE);
+ if (len < 0) {
+ gl_dbgE("snprintf returns failure!");
+ return -1;
+ } else {
+ directory_path[len] = '\0';
+ len = -1;
+ }
+
+ len = g_strlcat(directory_path, GL_DEFAULT_PATH_IMAGES,
+ GL_DIR_PATH_LEN_MAX);
+ if (len >= GL_DIR_PATH_LEN_MAX) {
+ gl_dbgE("strlcat returns failure(%d)!", len);
+ return -1;
+ }
+ gl_dbg("Default images path: %s.", directory_path);
+
+ return 0;
+}
+
+int gl_get_selected_files_path_str(void *data, gchar sep_c, char **path_str, int *sel_cnt)
+{
+ GL_CHECK_VAL(path_str, -1);
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_VAL(ad->selectedinfo.medias_elist, GL_UG_FAIL);
+ GString *selected_path_list = g_string_new(NULL);
+ gl_item *current = NULL;
+ int selected_item_cnt = 0;
+ Eina_List *l = NULL;
+
+ EINA_LIST_FOREACH(ad->selectedinfo.medias_elist, l, current) {
+ if (current == NULL || current->item == NULL) {
+ if (selected_path_list) {
+ g_string_free(selected_path_list, true);
+ selected_path_list = NULL;
+ }
+ return -1;
+ }
+ selected_item_cnt++;
+ g_string_append(selected_path_list, current->item->file_url);
+ g_string_append_c(selected_path_list, sep_c);
+
+ }
+ gl_dbg("Selected items count: %d.", selected_item_cnt);
+ if (sel_cnt)
+ *sel_cnt = selected_item_cnt;
+ int len = strlen(selected_path_list->str);
+ g_string_truncate(selected_path_list, len - 1);
+ /**
+ * Frees the memory allocated for the GString.
+ * If free_segment is true it also frees the character data.
+ * If it's false, the caller gains ownership of the buffer
+ * and must free it after use with g_free().
+ */
+ *path_str = g_string_free(selected_path_list, false);
+ GL_CHECK_VAL(*path_str, -1);
+ gl_dbg("Total string:\n\n\t>>@@:> %s <:@@<<\n", *path_str);
+ return 0;
+}
+
+int
+gl_make_dir(const char *dir_full_path)
+{
+ GL_CHECK_VAL(dir_full_path, -1);
+
+ return mkdir(dir_full_path, GL_CREATE_DIR_MASK_DEFAULT);
+}
+
+int
+gl_make_new_album(const char *name)
+{
+ gl_dbg("");
+ char path[GL_DIR_PATH_LEN_MAX] = { 0, };
+ char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, };
+
+ if (gl_get_default_images_path(dir_path) != 0)
+ {
+ gl_dbg("FAIL to get dir path");
+ return -1;
+ }
+
+ snprintf(path, GL_DIR_PATH_LEN_MAX, "%s/%s", dir_path, name);
+ path[strlen(path)] = '\0';
+ gl_dbg("Making %s directory", path);
+
+ if (ecore_file_dir_is_empty(path) == -1) // new folder doesn't exist
+ {
+ if (ecore_file_dir_is_empty(dir_path) == -1) // default images folder doesn't exist
+ {
+ gl_dbgE("[Error] Default images path[%s] doesn't exist. Create it...");
+ gl_make_dir(dir_path);
+ }
+
+ return gl_make_dir(path);
+ }
+ else
+ {
+ gl_dbg("new folder already exists, no need to make!");
+ return 0;
+ }
+}
+
+int
+gl_move_media_item(gl_item * gitem, char *new_dir_name, bool is_full_path, int *popup_op)
+{
+ gl_dbg("Move media item START>>>");
+ char new_path[GL_FILE_PATH_LEN_MAX] = { 0, };
+ char ext[GL_FILE_EXT_LEN_MAX] = { 0, };
+ char new_path_noext[GL_FILE_PATH_LEN_MAX] = { 0, };
+ char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, };
+ if (gitem == NULL || gitem->item == NULL || gitem->item->uuid == NULL ||
+ popup_op == NULL)
+ {
+ gl_dbg("gitem == NULL || gitem->item == NULL");
+ return -1;
+ }
+
+ *popup_op = GL_POPUP_OP_NONE;
+
+ if (is_full_path)
+ {
+ if (!gitem->item->file_url ||
+ !strlen(gitem->item->file_url) ||
+ !gitem->item->display_name)
+ {
+ gl_dbg("file url or name is error.");
+ return -1;
+ }
+ snprintf(new_path, sizeof(new_path), "%s/%s",
+ new_dir_name, (char *)(gitem->item->display_name));
+ gl_dbg("New path : %s", new_path);
+
+ if (!strcmp(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...");
+ 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);
+ 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);
+ //create popup in pipe callback
+ *popup_op = GL_POPUP_OP_DUPLICATED_NAME;
+ }
+ }
+ else
+ {
+ if (gl_get_default_images_path(dir_path) != 0)
+ {
+ gl_dbg("FAIL to get dir path!");
+ return -1;
+ }
+ snprintf(new_path, GL_FILE_PATH_LEN_MAX, "%s/%s/%s",
+ dir_path, new_dir_name, (char *)(gitem->item->display_name));
+ }
+
+ new_path[strlen(new_path)] = '\0';
+
+ // stop using "rename" when moving from mmc to phone for correct db update.
+ if (gl_file_mv(gitem->ad, gitem->item->file_url, new_path,
+ gitem->item->type) == EINA_FALSE)
+ {
+ gl_dbg("Move media item OVER<<<");
+ return -1;
+ }
+ else
+ {
+ gl_dbg("Move media item OVER<<<");
+ return 0;
+ }
+}
+
+/**
+* Check if there is any media in Gallery.
+*
+* False returned if none medias exist, other return True.
+*/
+bool gl_check_gallery_empty(void* data)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ if (ad->albuminfo.cluster_list == NULL) {
+ gl_dbgE("ad->albuminfo.cluster_list == NULL");
+ return true;
+ }
+
+ Eina_List *clist = ad->albuminfo.cluster_list->clist;
+ if (clist == NULL) {
+ gl_dbgW("Albums list is invalid!");
+ return true;
+ }
+
+ int len = eina_list_count(clist);
+ if (len == 0) {
+ gl_dbgW("Albums list is empty!");
+ return true;
+ }
+ return false;
+}
+
+bool gl_is_image_valid(void *data, char *filepath)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ GL_CHECK_FALSE(filepath);
+
+ Evas_Object *image = NULL;
+ int width = 0;
+ int height = 0;
+ Evas *evas = NULL;
+
+ evas = evas_object_evas_get(ad->maininfo.win);
+ GL_CHECK_FALSE(evas);
+
+ image = evas_object_image_add(evas);
+ GL_CHECK_FALSE(image);
+
+ evas_object_image_filled_set(image, 0);
+ evas_object_image_load_scale_down_set(image, 0);
+ evas_object_image_file_set(image, filepath, NULL);
+ evas_object_image_size_get(image, &width, &height);
+ if(image) {
+ evas_object_del(image);
+ image = NULL;
+ }
+
+ if (width <= 0 || height <= 0) {
+ gl_dbg("Cannot load file : %s", filepath);
+ return false;
+ }
+
+ return true;
+}
+
+bool
+gl_is_rotation_locked(void)
+{
+ int lock = -1;
+
+ if (!vconf_get_bool(VCONFKEY_SETAPPL_ROTATE_LOCK_BOOL, &lock))
+ {
+ gl_dbg("Rotation locked state[%d].", lock);
+ return lock;
+ }
+ else
+ {
+ gl_dbgE("Get rotation lock state failed!");
+ return false;
+ }
+}
+
+/*
+* Check MMC state(Inserted/Removed) for Move/Delete.
+*/
+int
+gl_check_mmc_state(void *data, char *dest_folder)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ /* MMC hasn't been inserted */
+ if (ad->maininfo.mmc_state == GL_MMC_STATE_REMOVED)
+ return 0;
+
+ int on_mmc = -1;
+ /**
+ * Albums: Move/Delete.
+ */
+ /* Move files to MMC album */
+ if (dest_folder) {
+ on_mmc = strncmp(GL_ROOT_PATH_MMC, dest_folder,
+ strlen(GL_ROOT_PATH_MMC));
+ if (on_mmc == 0)
+ goto ON_MMC;
+ }
+
+ gl_cluster *cur_album = ad->albuminfo.current_album;
+ char src_folder_path[GL_DIR_PATH_LEN_MAX] = { 0, };
+ GL_CHECK_VAL(cur_album, -1);
+ GL_CHECK_VAL(cur_album->cluster, -1);
+ /* Move files from MMC album */
+ GL_CHECK_VAL(cur_album->cluster->uuid, -1);
+ gl_db_get_folder_fullpath(ad, cur_album->cluster->uuid,
+ src_folder_path);
+ on_mmc = strncmp(GL_ROOT_PATH_MMC, src_folder_path,
+ strlen(GL_ROOT_PATH_MMC));
+ /* Check MMC files selected in album [All albums] */
+ if (on_mmc == 0) {
+ goto ON_MMC;
+ } else if (!g_strcmp0(cur_album->cluster->uuid, GL_ALBUM_ALL_ID)) {
+ gl_dbg("In album [All albums].");
+ if (_gl_check_mmc_file_selected(ad))
+ goto ON_MMC;
+ }
+ return 0;
+
+ ON_MMC:
+ gl_dbgW("Operate medias on MMC!");
+ ad->maininfo.mmc_state = GL_MMC_STATE_ADDED_MOVING;
+ return 0;
+}
+
+int gl_reg_db_update_noti(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int error_code = -1;
+ int mmc_state = -1;
+
+ vconf_get_int(VCONFKEY_SYSMAN_MMC_STATUS, &mmc_state);
+ /* Save the init status of MMC */
+ if (mmc_state == VCONFKEY_SYSMAN_MMC_MOUNTED)
+ {
+ gl_dbg("###### :::::: MMC loaded! :::::: ######");
+ ad->maininfo.mmc_state = GL_MMC_STATE_ADDED;
+ }
+ else if (mmc_state == VCONFKEY_SYSMAN_MMC_REMOVED ||
+ mmc_state == VCONFKEY_SYSMAN_MMC_INSERTED_NOT_MOUNTED)
+ {
+ gl_dbg("###### :::::: MMC removed! :::::: ######");
+ ad->maininfo.mmc_state = GL_MMC_STATE_REMOVED;
+ }
+
+ gl_dbg("Enable the noti handle for DB update status!");
+ /* Set DB update status callback */
+ error_code = vconf_notify_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS,
+ _gl_db_update_noti_cb, ad);
+ if (error_code == -1) {
+ gl_dbgE("vconf_notify_key_changed for DB_STATUS failed!");
+ return -1;
+ }
+
+ return 0;
+}
+
+int gl_dereg_db_update_noti(void)
+{
+ int error_code = -1;
+
+ gl_dbg("Disable the noti handle for DB update status!");
+ error_code = vconf_ignore_key_changed(VCONFKEY_FILEMANAGER_DB_STATUS,
+ _gl_db_update_noti_cb);
+ if (error_code == -1) {
+ gl_dbgE("vconf_ignore_key_changed for DB_STATUS failed!");
+ return -1;
+ }
+
+ return 0;
+}
+
+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)
+{
+ GL_CHECK_VAL(data, GL_VIEW_NONE);
+ gl_appdata *ad = (gl_appdata *)data;
+ return ad->maininfo.view_mode;
+}
+
+/*
+* Set view mode of app
+*/
+int
+gl_set_view_mode(void *data, int mode)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ ad->maininfo.view_mode = mode;
+ return 0;
+}
+
+int gl_del_invalid_widgets(void *data, int invalid_m)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("");
+ if (ad->popupinfo.popup) {
+ /* Remove popup */
+ evas_object_del(ad->popupinfo.popup);
+ ad->popupinfo.popup = NULL;
+ } else if (ad->uginfo.ug_called_by_me) {
+ /* Destroy UG */
+ gl_dbg("Destroy UG!");
+ if (ad->uginfo.ug_called_by_me) {
+ ug_destroy(ad->uginfo.ug_called_by_me);
+ ad->uginfo.ug_called_by_me = NULL;
+ }
+ if (ad->uginfo.gallery_ug_called_by_me) {
+ ug_destroy(ad->uginfo.gallery_ug_called_by_me);
+ ad->uginfo.gallery_ug_called_by_me = NULL;
+ }
+ }
+
+ switch (invalid_m) {
+ case GL_INVALID_RENAME_ALBUM:
+ /* gl_ui_edit_cancel pop navigationbar */
+ gl_dbgW("Destroy Rename album view!");
+ elm_naviframe_item_pop(ad->maininfo.navi_bar);
+ gl_set_view_mode(ad, GL_VIEW_ALBUMS_EDIT);
+ gl_ui_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);
+ Evas_Object *edit_ly = NULL;
+ edit_ly = ad->gridinfo.edit_layout;
+ const char *sig = NULL;
+ sig = "elm,swallow_view,state,thumb_edit_default";
+ edje_object_signal_emit(_EDJ(edit_ly), sig, "elm");
+ }
+ break;
+ default:
+ ad->entryinfo.entry_mode = GL_ENTRY_NONE;
+ break;
+ }
+ return 0;
+}
+
+int
+gl_del_medias(void *data)
+{
+ gl_dbg("");
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ /* Get all selected medias count */
+ int cnt = gl_db_selected_list_count(ad);
+ /* Check MMC state for cancel operation */
+ gl_check_mmc_state(ad, NULL);
+ gl_dbg("MMC state: %d.", ad->maininfo.mmc_state);
+ _gl_use_thread_operate_medias(ad, GL_STR_DELETING, cnt,
+ GL_MEDIA_OP_DELETE);
+
+ return 0;
+}
+
+/* Delete medias */
+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);
+ 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);
+ if (gitem != NULL && gitem->item != NULL)
+ gl_db_remove_item(gitem);
+ else
+ gl_dbgE("Invalid item!");
+
+ gl_dbg("Write pipe, make progressbar updated!");
+ gl_thread_write_pipe(ad, i, popup_op);
+ gitem = NULL;
+ }
+
+ return 0;
+}
+
+/* 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);
+
+ 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);
+
+ if (view_mode == GL_VIEW_THUMBS_EDIT)
+ _gl_display_iv_nocontents(ad);
+
+ /* Add notification */
+ gl_ui_create_notiinfo(ad, ad->gridinfo.layout,
+ GL_UI_NOTIFY_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);
+ } else if (ad->albuminfo.cluster_list->edit_cnt == 0) {
+ gl_ui_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);
+ }
+
+ return 0;
+}
+
+int
+gl_remove_album(void *data, gl_cluster * album_item)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int res = -1;
+ char dir_path[GL_DIR_PATH_LEN_MAX] = { 0, };
+
+ if (album_item == NULL || album_item->cluster == NULL ||
+ album_item->cluster->uuid == NULL) {
+ gl_dbgE("Invalid album!");
+ return GL_DB_FAIL;
+ }
+
+ 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_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 */
+ for (i = cnt; i >= 1; i--) {
+ gl_db_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 file system
+ if (ecore_file_rmdir(dir_path) == EINA_FALSE)
+ {
+ gl_dbg("ecore_file_rmdir failed!");
+ return GL_DB_FAIL;
+ }
+
+ return GL_DB_SUCCESS;
+}
+
+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 i = 0;
+ int ret = -1;
+ gl_dbg("");
+ // delete albums
+
+ Eina_List *selected_list = ad->albuminfo.selected_albums_elist;
+ if ((selected_list == NULL) || (eina_list_count(selected_list) == 0))
+ {
+ gl_dbg("zero length, return!");
+ return -1;
+ }
+ else
+ {
+ gl_dbg("cnt= %d, list length=%d", cnt, eina_list_count(selected_list));
+ }
+ for (i = 0; i < cnt; i++)
+ {
+ album_item = eina_list_nth(selected_list, i);
+
+ if (album_item && album_item->cluster &&
+ album_item->cluster->uuid) {
+ gl_dbg("Delete album: %s, id=%s, cluster_index=%d",
+ album_item->cluster->display_name,
+ album_item->cluster->uuid, album_item->index);
+ ret = gl_remove_album(ad, album_item);
+ if (ret < 0)
+ {
+ gl_dbg("gl_remove_album failed, error=%d", ret);
+ }
+ }
+ }
+
+ // update the albums view
+ gl_ui_edit_cancel(ad);
+
+ //add notification
+ gl_ui_create_notiinfo(ad, ad->albuminfo.layout,
+ GL_UI_NOTIFY_DELETED);
+ return 0;
+}
+
+int gl_refresh_albums_list(void *data)
+{
+ 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 */
+ ad->albuminfo.update_albums_list = false;
+
+ /* Save cluster ID to set new current_album from new albums list */
+ if (old_current_album && old_current_album->cluster &&
+ old_current_album->cluster->uuid) {
+ g_strlcpy(cluster_id, old_current_album->cluster->uuid,
+ GL_MTYPE_ITEN_ID_LEN_MAX);
+ b_get_cur_album = true;
+ } else {
+ gl_dbg("None album selected, current album is unavailable.");
+ }
+
+ gl_db_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);
+ 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);
+ 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);
+ ad->maininfo.medias_cnt = 0;
+ }
+ }
+
+ return 0;
+}
+
+/**
+* Move files under root album [/opt/media or /opt/storage/sdcard] to a newly created album.
+* Used in 'Rename' album case.
+*/
+int
+gl_move_root_album(void* data, gl_cluster* cur_album, char* dest_path)
+{
+ GL_CHECK_VAL(data, -1);
+ GL_CHECK_VAL(cur_album, -1);
+ GL_CHECK_VAL(cur_album->cluster, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+
+ /* Get all medias of current album */
+ gl_db_get_item_list(ad, cur_album, GL_GET_ALL_RECORDS,
+ GL_GET_ALL_RECORDS);
+
+ Eina_List* tmp_elist = NULL;
+ gl_item* gitem = NULL;
+ int popup_op = GL_POPUP_OP_NONE;
+ GL_CHECK_VAL(ad->maininfo.medias_elist, -1);
+
+ /* Move medias of album to dest folder */
+ EINA_LIST_FOREACH(ad->maininfo.medias_elist, tmp_elist, gitem)
+ {
+ if (gitem && gitem->item)
+ {
+ gl_dbg("Move [%s]", gitem->item->file_url);
+ if (gl_move_media_item(gitem, dest_path, true, &popup_op) != 0)
+ {
+ gl_dbgW("Failed to move this item");
+ }
+
+ gitem = NULL;
+ }
+ else
+ {
+ gl_dbgE("Invalid item!");
+ gl_db_clear_item_list(ad);
+ return -1;
+ }
+ }
+
+ /* Free item list */
+ gl_db_clear_item_list(ad);
+
+ return 0;
+}
+
+/* 'Move medias' is only available in tab Albums */
+int gl_move_selected(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int i = 0;
+ /* Get selected medias count */
+ int cnt = gl_db_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);
+ if (gitem && gitem->item)
+ {
+ gl_dbg("Selected [%s]", gitem->item->file_url);
+ if (gl_move_media_item(gitem, ad->albuminfo.dest_folder, true, &popup_op) != 0)
+ {
+ gl_dbg("Failed to move this item");
+ }
+ gl_dbg("File Moved:::::::%d/%d-->try to update progressbar", i, cnt);
+ }
+ else
+ {
+ gl_dbg("Invalid item!");
+ }
+
+ gl_dbg("Write pipe, make progressbar updated!");
+ gl_thread_write_pipe(ad, i, popup_op);
+
+ popup_op = GL_POPUP_OP_NONE;
+ }
+
+ return 0;
+}
+
+int gl_move_to_album(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ char folder_fullpath[GL_DIR_PATH_LEN_MAX] = { 0, };
+ char default_path[GL_DIR_PATH_LEN_MAX] = { 0, };
+ gl_cluster *cur_album = ad->albuminfo.current_album;
+ int cnt = gl_db_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) {
+ gl_dbg("---Popup list item: New album---");
+ ad->albuminfo.move_new_album = true;
+
+ if (gl_make_new_album(ad->albuminfo.new_album_name) != 0)
+ {
+ gl_popup_create_popup(ad, GL_POPUP_NOBUT,
+ GL_STR_SAME_NAME_ALREADY_IN_USE);
+ gl_dbgE("Failed to make a new directory!");
+ gl_ui_update_select_widgets(ad);
+ return -1;
+ }
+ if (gl_get_default_images_path(default_path) != 0)
+ {
+ gl_dbgE("Failed to get default images path!");
+ gl_ui_update_select_widgets(ad);
+ return -1;
+ }
+ snprintf(folder_fullpath, GL_DIR_PATH_LEN_MAX, "%s/%s",
+ default_path, ad->albuminfo.new_album_name);
+ /* 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;
+ }
+
+ if (cur_album == NULL || cur_album->cluster == NULL)
+ {
+ gl_dbgE("[Error] Current album is NULL!");
+ gl_ui_update_select_widgets(ad);
+ return -1;
+ }
+
+ memset(ad->albuminfo.dest_folder, 0x00, GL_DIR_PATH_LEN_MAX);
+ g_strlcpy(ad->albuminfo.dest_folder, folder_fullpath, GL_DIR_PATH_LEN_MAX);
+ /* Check MMC state for cancel operation */
+ gl_check_mmc_state(ad, folder_fullpath);
+ gl_dbg("MMC state: %d.", ad->maininfo.mmc_state);
+ _gl_use_thread_operate_medias(ad, GL_STR_MOVING, cnt,
+ GL_MEDIA_OP_MOVE);
+ return 0;
+}
+
+/* Update view after moving process done */
+int gl_update_move_view(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("view_mode: %d", view_mode);
+ gl_db_selected_list_finalize(ad);
+ gl_ui_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);
+
+ /* Nocontents view created when update video list */
+ if (view_mode != GL_VIEW_VIDEOLIST)
+ gl_ui_display_nocontents(ad);
+
+ /* Add notification */
+ gl_ui_create_notiinfo(ad, ad->gridinfo.layout,
+ GL_UI_NOTIFY_MOVED);
+ } 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);
+
+ 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);
+ } else {
+ gl_ui_disable_toolbar_item(ad, false, GL_NAVI_ALBUMS,
+ false);
+ }
+ /* Add notification */
+ gl_ui_create_notiinfo(ad, ad->albuminfo.layout,
+ GL_UI_NOTIFY_MOVED);
+ }
+
+ return 0;
+}
+
+Eina_Bool gl_update_view(void *data, int mode)
+{
+ GL_CHECK_FALSE(data);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("view_mode: %d", view_mode);
+ if (mode == GL_UPDATE_VIEW_NONE) {
+ gl_dbg("Don't need to update");
+ return EINA_FALSE;
+ }
+ /* 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 ||
+ view_mode == GL_VIEW_ALBUMS_RENAME) {
+ /* Albums list should be updated first */
+ gl_albums_update_view(ad);
+ } 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) {
+ gl_dbgW("MMC removed, change to albums view!");
+ gl_pop_to_ctrlbar_ly(ad, true);
+ return EINA_TRUE;
+ }
+
+ /* Albums list should be updated first */
+ _gl_update_thumb_items(ad, true);
+ } else if (view_mode == GL_VIEW_THUMBS_EDIT ||
+ view_mode == GL_VIEW_VIDEOLIST_EDIT) {
+ /* Check thread operation case */
+ if (ad->pbarinfo.sync_pipe) {
+ gl_dbgW("Thread operation is in process!");
+ return EINA_TRUE;
+ }
+
+ gl_cluster *cur_album = ad->albuminfo.current_album;
+ /* MMC removed, change to albums view if in mmc album */
+ if (mode == GL_UPDATE_VIEW_MMC_REMOVED && cur_album &&
+ cur_album->cluster &&
+ cur_album->cluster->type == MINFO_MMC) {
+ gl_dbgW("MMC removed, change to albums view!");
+ gl_pop_to_ctrlbar_ly(ad, true);
+ return EINA_TRUE;
+ }
+
+ /* Albums list should be updated first */
+ _gl_update_thumb_items(ad, true);
+ return EINA_TRUE;
+ }
+ return EINA_TRUE;
+}
+
+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;
+ return 0;
+}
+
+int gl_destroy_thumbs_view(void *data)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ int view_mode = gl_get_view_mode(ad);
+ gl_dbg("view_mode: %d.", view_mode);
+
+ gl_del_invalid_widgets(ad, GL_INVALID_NONE);
+
+ if(ad->gridinfo.edit_view) {
+ _gl_destroy_thumbs_edit_view(ad);
+ gl_db_selected_list_finalize(ad);
+ } else {
+ gl_albums_del_grid_append_idler(ad);
+ }
+ gl_ui_destroy_selinfo(ad);
+ /* destroy imf */
+ gl_ui_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;
+
+ /* Pop to controlbar layout */
+ elm_naviframe_item_pop_to(ad->albuminfo.nf_it);
+
+ return 0;
+}
+
+/**
+* b_update_albums_list
+* True: Update albums list. False: Albums list already updated.
+*
+* It's in thumbnails view, video list view, or selectioinfo view.
+* Destroy invalid widegets or UGs.
+* Pop current invalid view to controlbar layout,
+* to show Albums view.
+*/
+int gl_pop_to_ctrlbar_ly(void *data, bool b_update_albums_list)
+{
+ GL_CHECK_VAL(data, -1);
+ gl_appdata *ad = (gl_appdata *)data;
+ gl_dbg("b_update_albums_list: %d", b_update_albums_list);
+
+ /* Destroy thumbnails/video_list view then pop to ctrlbar_ly */
+ gl_destroy_thumbs_view(ad);
+
+ /* Update albums list */
+ if (b_update_albums_list)
+ gl_refresh_albums_list(ad);
+
+ if (gl_check_gallery_empty(ad)) {
+ /* None albums exist, Change to albums view. */
+ gl_dbgW("Empty Gallery, change to Albums view.");
+ gl_albums_comeback_from_view(ad);
+ /* None albums, disable edit button/controlbar */
+ gl_ui_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);
+ }
+ return 0;
+}
+
+/* Vibrate device */
+int gl_play_vibration(void *data)
+{
+ gl_dbg("");
+ 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) {
+ 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);
+ return -1;
+ }
+ ad->entryinfo.haptic_handle = ret;
+
+ if (ad->entryinfo.vibration_timer) {
+ ecore_timer_del(ad->entryinfo.vibration_timer);
+ ad->entryinfo.vibration_timer = NULL;
+ }
+ Ecore_Timer *vibration_timer = NULL;
+ vibration_timer = ecore_timer_add(GL_TIMER_INTERVAL_VIBRATION,
+ _gl_vibration_timer_cb, data);
+ ad->entryinfo.vibration_timer = vibration_timer;
+
+ 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);
+ return -1;
+ }
+
+ return 0;
+}
+
+char *_gl_get_thumb(void *data, const char *file_path, char **thumb_path)
+{
+ GL_CHECK_NULL(thumb_path);
+ if (*thumb_path && ecore_file_exists(*thumb_path) &&
+ (ecore_file_size(*thumb_path) > 0)) {
+ return NULL;
+ } else if (*thumb_path) {
+ gl_dbgW("Wrong thumb path[%s]", *thumb_path);
+ free(*thumb_path);
+ *thumb_path = NULL;
+ }
+
+ 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_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;
+ }
+ }
+}